summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/README.txt10
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch1.ipynb305
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch10.ipynb379
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch11.ipynb170
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch12.ipynb84
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch13.ipynb212
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch15.ipynb64
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch17.ipynb215
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch18.ipynb178
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch19.ipynb399
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch2.ipynb923
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch20.ipynb128
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch3.ipynb334
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch4.ipynb266
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch5.ipynb571
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch6.ipynb554
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch7.ipynb600
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch8.ipynb566
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/screenshots/1.pngbin0 -> 48121 bytes
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/screenshots/2.pngbin0 -> 43192 bytes
-rw-r--r--Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/screenshots/3.pngbin0 -> 40594 bytes
-rw-r--r--High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter2_3.ipynb233
-rw-r--r--High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter3_3.ipynb97
-rw-r--r--High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter4_3.ipynb168
-rw-r--r--High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter6_3.ipynb547
-rw-r--r--High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter7_3.ipynb380
-rw-r--r--High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter8_3.ipynb391
-rw-r--r--High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter9_3.ipynb452
-rw-r--r--High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/screenshots/chapter2_3.pngbin0 -> 54425 bytes
-rw-r--r--High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/screenshots/chapter3_3.pngbin0 -> 44455 bytes
-rw-r--r--High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/screenshots/chapter4_3.pngbin0 -> 50443 bytes
-rw-r--r--Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter2.ipynb136
-rw-r--r--Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter3.ipynb678
-rw-r--r--Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter4.ipynb513
-rw-r--r--Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter5.ipynb1807
-rw-r--r--Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter6.ipynb964
-rw-r--r--Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter7.ipynb359
-rw-r--r--Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter8.ipynb805
-rw-r--r--Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter9.ipynb902
-rw-r--r--Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/screenshots/1.pngbin0 -> 31420 bytes
-rw-r--r--Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/screenshots/2.pngbin0 -> 53294 bytes
-rw-r--r--Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/screenshots/3.pngbin0 -> 74209 bytes
-rw-r--r--Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/README.txt10
-rw-r--r--Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch1.ipynb198
-rw-r--r--Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch2.ipynb1335
-rw-r--r--Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch3.ipynb826
-rw-r--r--Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch4.ipynb1281
-rw-r--r--Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch5.ipynb2722
-rw-r--r--Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch6.ipynb1522
-rw-r--r--Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch7.ipynb712
-rw-r--r--Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/screenshots/1.pngbin0 -> 24306 bytes
-rw-r--r--Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/screenshots/2.pngbin0 -> 23058 bytes
-rw-r--r--Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/screenshots/3.pngbin0 -> 55941 bytes
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch1.ipynb196
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch11.ipynb378
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch12.ipynb179
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch13.ipynb622
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch14.ipynb240
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch15.ipynb265
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch16.ipynb155
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch17.ipynb103
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch18.ipynb320
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch19.ipynb292
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch2.ipynb261
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch3.ipynb109
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch4.ipynb265
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch5.ipynb486
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch6.ipynb390
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch7.ipynb148
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch8.ipynb387
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch9.ipynb185
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/screenshots/1.pngbin0 -> 31271 bytes
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/screenshots/2.pngbin0 -> 37536 bytes
-rw-r--r--Thermodynamics_for_chemists_by_Glasstone_&_Samuel/screenshots/3.pngbin0 -> 25555 bytes
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap1.ipynb462
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap10.ipynb240
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap11.ipynb466
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap12.ipynb1435
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap13.ipynb547
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap14.ipynb635
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap15.ipynb317
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap16.ipynb964
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap17.ipynb263
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap18.ipynb1298
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap19.ipynb640
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap2.ipynb534
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap20.ipynb255
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap21.ipynb1809
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap22.ipynb531
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap23.ipynb641
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap25.ipynb521
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap26.ipynb239
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap27.ipynb135
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap28.ipynb578
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap3.ipynb783
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap30.ipynb235
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap31.ipynb388
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap32.ipynb381
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap33.ipynb304
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap34.ipynb621
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap35.ipynb263
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap36.ipynb103
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap37.ipynb183
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap4.ipynb397
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap5.ipynb1167
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap6.ipynb1695
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap7.ipynb832
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap8.ipynb994
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap9.ipynb627
-rw-r--r--modern_physics_by_Satish_K._Gupta/chap_29.ipynb298
-rw-r--r--modern_physics_by_Satish_K._Gupta/screenshots/image1.pngbin0 -> 28295 bytes
-rw-r--r--modern_physics_by_Satish_K._Gupta/screenshots/image22.pngbin0 -> 32127 bytes
-rw-r--r--modern_physics_by_Satish_K._Gupta/screenshots/image33.pngbin0 -> 27664 bytes
113 files changed, 49758 insertions, 0 deletions
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/README.txt b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/README.txt
new file mode 100644
index 00000000..219820cc
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Jai Mathur
+Course: mca
+College/Institute/Organization: IIT
+Department/Designation: System Admin
+Book Title: Fluid Mechanics For Chemical Engineers
+Author: N. D. Nevers
+Publisher: McGraw-Hill Education; 3 edition (1 April 2004)
+Year of publication: -
+Isbn: 978-0072566086
+Edition: - \ No newline at end of file
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch1.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch1.ipynb
new file mode 100644
index 00000000..947cfb01
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/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/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch10.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch10.ipynb
new file mode 100644
index 00000000..477be3c0
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch10.ipynb
@@ -0,0 +1,379 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 10 : Pumps compressors and turbines"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 10.1 page no : 362"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The efficiency of the pump is 0.729167\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the efficiency of a pump\n",
+ "\n",
+ "# variables\n",
+ "Q=50. #gal/min\n",
+ "P1=30. #psia 0r lbf/in**2\n",
+ "P2=100. #psia 0r lbf/in**2\n",
+ "dP=P2-P1 #psia 0r lbf/in**2\n",
+ "power=2.8 #hp\n",
+ "\n",
+ "# calculation\n",
+ "#1 ft = 12 in\n",
+ "#1 hp.min = 33000 lbf.ft\n",
+ "#1 gal = 231 in**3\n",
+ "eta=(Q*dP/power)*(1/33000.0)*231*(1/12.0) #dimentionless\n",
+ "\n",
+ "# result\n",
+ "print \"The efficiency of the pump is %f\"%eta"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 10.2 page no : 366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the maximum elevation above the lowest water level in sump at which pump inlet can be placed is 19.770533 ft\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the maximum elevation above the lowest water level in sump at which pump inlet can be placed\n",
+ "\n",
+ "# variables\n",
+ "P1=3.72 #psia 0r lbf/in**2\n",
+ "P2=14.5 #psia 0r lbf/in**2\n",
+ "dP=P2-P1 #psia 0r lbf/in**2\n",
+ "rho=61.3 #lbm/ft**3\n",
+ "g=32.2 #ft/s**2\n",
+ "\n",
+ "# calculation\n",
+ "#1 ft = 12 in\n",
+ "#1 lbf.s**2 = 32.2 lbm.ft\n",
+ "h_loss=4 #ft\n",
+ "v=10 #ft/s\n",
+ "h_max=(dP/rho/g)*144*32.2-(v**2/2.0/g)-h_loss #ft\n",
+ "\n",
+ "# result\n",
+ "print \"the maximum elevation above the lowest water level in sump at which pump inlet can be placed is %f ft\"%h_max"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 10.3 page no : 370"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The work required per pound mole for a 100 percent efficient isothermal compressor is 2415.724914 Btu/lbmol\n",
+ "\n",
+ "The work required per pound mole for a 100 percent efficient adiabatic compressor is 3417.499724 Btu/lbmol\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the work requird per pound mole for a 100% efficient isothermal and adiabatic compressor\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "R=1.987 #Btu/lbmol/R (universal gas constant)\n",
+ "T=528. #R (Rankine temperature scale)\n",
+ "ratio_P=10. #dimentionless\n",
+ "\n",
+ "# calculations and results\n",
+ "#for isothermal compressor\n",
+ "W1=R*T*math.log(ratio_P) #Btu/lbmol\n",
+ "print \"The work required per pound mole for a 100 percent efficient isothermal compressor is %f \"%W1,\"Btu/lbmol\\n\"\n",
+ "\n",
+ "#for adiabatic compressor\n",
+ "gama=1.4#dimentionless\n",
+ "W2=(gama/(gama-1))*R*T*(ratio_P**((gama-1)/gama)-1)#Btu/lbmol\n",
+ "print \"The work required per pound mole for a 100 percent efficient adiabatic compressor is %f \"%W2,\"Btu/lbmol\\n\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 10.4 page no : 370"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The work required per pound mole for a 100 percent efficient adiabatic compressor is 2861.592127 Btu/lbmol\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the work requird per pound mole for a 100% efficient 2 stage adiabatic compressor\n",
+ "\n",
+ "# variables\n",
+ "R=1.987 #Btu/lbmol/R (universal gas constant)\n",
+ "T=528.0 #R (Rankine temperature scale)\n",
+ "ratio_P1=3 #dimentionless\n",
+ "ratio_P2=10/3.0 #dimentionless\n",
+ "gama=1.4 #dimentionless\n",
+ "\n",
+ "# calculation\n",
+ "W=(gama/(gama-1))*R*T*((ratio_P1**((gama-1)/gama)-1)+(ratio_P2**((gama-1)/gama)-1)) #Btu/lbmol\n",
+ "\n",
+ "# result\n",
+ "print \"The work required per pound mole for a 100 percent efficient adiabatic compressor is %f \"%W,\n",
+ "print \"Btu/lbmol\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 10.5 page no : 373"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The pump head is 112.471747 ft\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the pump head\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "N=1750. #rev/min\n",
+ "#1 min 60 sec\n",
+ "omega=2*(math.pi)*N/60 #radians/sec\n",
+ "Q=100. #gal/min\n",
+ "#1 gallon = 231 in**3\n",
+ "#1 ft =12 in\n",
+ "#1 min = 60 sec\n",
+ "d_inlet = 2.067 #ft\n",
+ "\n",
+ "# calculations\n",
+ "A_inlet=(math.pi)/4.*(d_inlet**2) #ft**2\n",
+ "V1=(Q/A_inlet)*231/60.0/12.0 #ft/s\n",
+ "d_outlet = 1.61 #ft\n",
+ "A_outlet=(math.pi)/4*(d_outlet**2) #ft**2\n",
+ "V2=(Q/A_outlet)*231/60.0/12.0 #ft/s\n",
+ "g=32.2 #ft/s**2\n",
+ "d_inner=0.086 #ft\n",
+ "d_outer=0.336 #ft\n",
+ "h=(omega)**2/g*((d_outer**2)-(d_inner)**2)+(V2**2-V1**2)/2./g #ft\n",
+ "\n",
+ "#result\n",
+ "print \"The pump head is %f ft\"%h"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 10.6 page no : 378"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The pump head is 2.734925 ft\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the pump head\n",
+ "\n",
+ "# variables\n",
+ "rho=62.3 #lbm/ft**3\n",
+ "g=32.2 #ft/s**2\n",
+ "v=18.46 #ft/s\n",
+ "\n",
+ "# calculation\n",
+ "#1 lbf/s**2 = 32.2 lbm.ft\n",
+ "h=1/(rho*g) * (v**2/2)*32.2 #ft\n",
+ "\n",
+ "# result\n",
+ "print \"The pump head is %f ft\"%h"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 10.7 page no : 381"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the estimated pressure rise in the first stage of mutisatge centrifugal compressor is 8.865562 psia\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the estimated pressure rise in the first stage of mutisatge centrifugal compressor\n",
+ "\n",
+ "# variables\n",
+ "rho=0.075 #lbm/ft**3\n",
+ "omega=1047. #rad/sec\n",
+ "d=2. #ft\n",
+ "\n",
+ "# calculation\n",
+ "dP=(1/2.0)*(rho)*(omega*d/2.0)**2/32.2/144.0 #psia\n",
+ "#1 lbf.s**2 = 32.2 lbm into feed\n",
+ "#1 ft = 144 in**2\n",
+ "\n",
+ "# result\n",
+ "print \"the estimated pressure rise in the first stage of mutisatge centrifugal compressor is %f psia\"%dP"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 10.8 page no : 383"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The efficiency of the compressor is 0.749243\n",
+ "dT_real = 190 K\n",
+ "dT_isentropic = 142 K\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the efficiency of a compressor and the change respective change in temperature\n",
+ "\n",
+ "# variables\n",
+ "m=100.0 #Kg/hr\n",
+ "M=29. #gm/mol\n",
+ "gama=1.4 #dimentionless\n",
+ "R=8.314 #J/mol/K\n",
+ "T=293.15 #K\n",
+ "ratio_P=4. #dimentionless\n",
+ "\n",
+ "# calculations\n",
+ "Po=(m/M)*R*T*(gama/(gama-1))*((ratio_P)**((gama-1)/gama)-1)/3600.0 #kW\n",
+ "P_real=5.3 #kW\n",
+ "eta=Po/P_real #dimentionless\n",
+ "\n",
+ "# result\n",
+ "print \"The efficiency of the compressor is %f\"%eta\n",
+ "Cp=29.1 #J/mol/K\n",
+ "dT_real=P_real*(M/m)*3600/Cp #K\n",
+ "print \"dT_real = %d K\"%dT_real\n",
+ "dT_isentropic=Po*(M/m)*3600/Cp #K\n",
+ "print \"dT_isentropic = %d K\"%dT_isentropic"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch11.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch11.ipynb
new file mode 100644
index 00000000..912da013
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch11.ipynb
@@ -0,0 +1,170 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 11 : Flow through porous media"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 11.1 page no : 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The velocity of water is 0.012422 ft/s\n",
+ "\n",
+ "The volumetric flow rate is 0.000271 ft**3/s\n",
+ "\n",
+ "Reynolds number is 4.288586\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the volumetric flow rate\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "g=32.2 #ft/s**2\n",
+ "dz=1.25 #ft\n",
+ "Dp=0.03 #in (Diameter of particle)\n",
+ "eta=0.33 #dimentionless\n",
+ "rho=62.3 #lbm/ft**3\n",
+ "mew=1.002 #cP\n",
+ "dx=1 #ft\n",
+ "#1 cP.ft.s = 6.72*10**(-4)#lbm\n",
+ "#1 ft = 12 in\n",
+ "\n",
+ "# calculation\n",
+ "Vs=g*dz*(Dp/12.0)**2*eta**3*rho/(150*mew*(1-eta)**2*dx*6.72*10**(-4)) #ft/s\n",
+ "d=2 #in (diameter of pipe)\n",
+ "A=(math.pi)/4.0*(d/12.0)**2 #ft**2\n",
+ "Q=Vs*A #ft**3/s\n",
+ "R=(Dp/12)*Vs*rho/(mew*6.72*10**(-4)*(1-eta)) #dimentionless (Reynold's number)\n",
+ "\n",
+ "# results\n",
+ "print \"The velocity of water is %f ft/s\\n\"%Vs\n",
+ "print \"The volumetric flow rate is %f ft**3/s\\n\"%Q\n",
+ "print \"Reynolds number is %f\"%R"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 11.2 page no : 403"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The pressure gradient is 701 psi/ft\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the pressure gradient\n",
+ "\n",
+ "# variables\n",
+ "Vs=2. #ft/s\n",
+ "dp=0.03 #in (diameter of particle)\n",
+ "rho=62.3 #lbm/ft**3\n",
+ "eta=0.33 #dimentionless\n",
+ "\n",
+ "# calculation\n",
+ "#let DP denote pressure gradient\n",
+ "#1 ft = 12 in\n",
+ "#1 lbf.s**2 = 32.2lbm.ft\n",
+ "DP=1.75*rho*Vs**2*(1-eta)/((dp/12)*eta**3*32.2*144) #psi/ft\n",
+ "\n",
+ "# result\n",
+ "print \"The pressure gradient is %d psi/ft\"%DP"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 11.3 page no : 405"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The permeability is 0.086 darcy\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the permeability\n",
+ "\n",
+ "# variables\n",
+ "Q=1. #ft**3/min\n",
+ "mew=0.018 #cP\n",
+ "dx=0.5 #in\n",
+ "A=1. #ft**2\n",
+ "dP=2. #lbf/in**2\n",
+ "\n",
+ "# calculations\n",
+ "#1 ft = 12 in\n",
+ "#1 min = 60 sec\n",
+ "#1 ft**2.cP = 2.09*10**(-5) lbf.s\n",
+ "#1 darcy = 1.06*10**(-11) ft**2\n",
+ "k=(Q*mew*(dx/12.0)/A/dP)*(1/144.0)*2.09*10**(-5)*(1/60.0)*(1.0/(1.06*10**(-11))) #darcy\n",
+ "\n",
+ "# result\n",
+ "print \"The permeability is %.3f darcy\"%k"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch12.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch12.ipynb
new file mode 100644
index 00000000..27d79062
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch12.ipynb
@@ -0,0 +1,84 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 12 : Gas liquid flow"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 12.1 page no : 421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Eta = 0.740741\n",
+ "\n",
+ "The slip velocity is 19.864286 ft/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the eta and slip velocity\n",
+ "\n",
+ "# variables\n",
+ "ratio_Q=10. #dimentionless (ratio of Qg to Ql)\n",
+ "Vl=2.06 #ft/s\n",
+ "\n",
+ "# calculation\n",
+ "x=3.5/ratio_Q #dimentionless\n",
+ "eta=1.0/(1+x) #dimentionless\n",
+ "Vl_avg=Vl/(1-eta) #ft/s\n",
+ "Vg_avg=ratio_Q*Vl/eta #ft/s\n",
+ "V_slip=Vg_avg-Vl_avg #ft/s\n",
+ "\n",
+ "# result\n",
+ "print \"Eta = %f\\n\"%eta\n",
+ "print \"The slip velocity is %f ft/s\"%V_slip"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch13.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch13.ipynb
new file mode 100644
index 00000000..9aa4961a
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch13.ipynb
@@ -0,0 +1,212 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 13 : Non newtonian fluid flow in circular pipes"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 13.1 page no : 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The pressure gradient is 61.241859 Pa/m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the pressure gradient\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "v=1. #ft/s\n",
+ "d=0.5 #ft\n",
+ "\n",
+ "# calculation\n",
+ "A=(math.pi)/4*d**2 #ft**2\n",
+ "Q=v*A #ft**3/s\n",
+ "#Let DP denote the pressure gradient\n",
+ "n=0.41 #dimentionless\n",
+ "K=0.66 #kg/m/s\n",
+ "#1 m = 3.281 ft \n",
+ "Q1=Q/3.281**3 #m**3/s\n",
+ "d1=d/3.281 #m\n",
+ "DP=(Q1*8*(3*n+1)/(n*(math.pi)*d1**3))**n*(4*K/d1) #Pa/m\n",
+ "\n",
+ "# result\n",
+ "print \"The pressure gradient is %f Pa/m\"%DP"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 13.3 page no : 437"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The fanning friction factor is 0.050081\n",
+ "The reynolds number is 318.531771\n",
+ "The flow is Laminar\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the fanning friction factor and reynolds number by power law\n",
+ "\n",
+ "# variables\n",
+ "DP=61.3 #Pa/m (pressure gradient)\n",
+ "D=0.152 #m\n",
+ "V_avg=0.305 #m/s\n",
+ "rho=1000. #kg/m**3\n",
+ "\n",
+ "# calculation\n",
+ "f=DP*D/(4*rho*V_avg**2/2.) #dimentionless\n",
+ "print \"The fanning friction factor is %f\"%f\n",
+ "n=0.41 #dimentionless\n",
+ "K=0.66 #dimentionless\n",
+ "R_pl=8*rho*V_avg**(2-n)*D**n/(K*(2*(3*n+1)/n)**n) #dimentionless\n",
+ "\n",
+ "# result\n",
+ "print \"The reynolds number is %f\"%R_pl\n",
+ "if (R_pl<2000):\n",
+ " print \"The flow is Laminar\"\n",
+ "else:\n",
+ " print \"The flow is turbulent\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 13.4 page no : 438"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The pressure gradient is 0.486400 KPa/m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the pressure gradient\n",
+ "\n",
+ "# variables\n",
+ "D=0.152 #m\n",
+ "V_avg=3.04 #m/s\n",
+ "rho=1000. #kg/m**3\n",
+ "n=0.41 #dimentionless\n",
+ "K=0.66 #dimentionless\n",
+ "\n",
+ "# calculation\n",
+ "R_pl=8*rho*V_avg**(2-n)*D**n/(K*(2*(3*n+1)/n)**n) #dimentionless\n",
+ "#print \"The reynolds number is %f\"%R_pl\n",
+ "f=0.004 #dimentionless (fanning friction factor)\n",
+ "#Let DP denote the pressure gradient\n",
+ "DP=4*f*(rho/D)*(V_avg**2/2)/1000 #KPa/m\n",
+ "\n",
+ "# result\n",
+ "print \"The pressure gradient is %f KPa/m\"%DP"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 13.5 page no : 440"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The headstrom number is 52427.752042\n",
+ "The reynolds number is 15942.778426\n",
+ "The fanning friction factor is 0.006189\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the headstrom ,reynold numbers and the fanning friction factor\n",
+ "\n",
+ "# variables\n",
+ "tow_yield=3.8 #Pa\n",
+ "mew=0.00686 #Pa.s\n",
+ "D=0.0206 #m\n",
+ "rho=1530.0 #kg/m**3\n",
+ "V=3.47 #m/s\n",
+ "\n",
+ "# calculation and Result\n",
+ "He=tow_yield*D**2*rho/mew**2 #dimentionless (headstrom number)\n",
+ "print \"The headstrom number is %f\"%He\n",
+ "R=D*V*rho/mew #dimentionless (reynolds number)\n",
+ "print \"The reynolds number is %f\"%R\n",
+ "dP=11069. #Pa/m\n",
+ "f=dP*D/(4*rho*V**2/2) #dimentionless (fanning friction factor)\n",
+ "print \"The fanning friction factor is %f\"%f"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch15.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch15.ipynb
new file mode 100644
index 00000000..b9ec6b86
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch15.ipynb
@@ -0,0 +1,64 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15 : Two and three dimentional fluid mechanics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Example 15.4 page no : 474\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the time taken by water in a long pipe to reach its steady state velocity\n",
+ "#let (new)*t/r0^2 be denoted by y\n",
+ "\n",
+ "# variables\n",
+ "y=0.05 #dimentionless\n",
+ "r0=0.077 #m\n",
+ "mew=1 #Pa.s\n",
+ "rho=1000.0 #Kg/m^3\n",
+ "\n",
+ "# calculations\n",
+ "new=mew/rho #m^2/s\n",
+ "t=y*r0**2/new #s\n",
+ "\n",
+ "# results\n",
+ "print \"the time taken by water in a long pipe to reach its steady state velocity is % f seconds\"%t"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the time taken by water in a long pipe to reach its steady state velocity is 0.296450 seconds\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch17.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch17.ipynb
new file mode 100644
index 00000000..1abdac34
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch17.ipynb
@@ -0,0 +1,215 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 17 : The boundary layer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.1 page no : 519\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the boundary layer thickness\n",
+ "#for the aeroplane\n",
+ "\n",
+ "# variables\n",
+ "v=1.61*10**(-4) #ft**2/s\n",
+ "x=2. #ft\n",
+ "V=200. #miles/hr\n",
+ "\n",
+ "# calculation\n",
+ "#1 mile = 5280 ft\n",
+ "#1 hr = 3600 sec\n",
+ "delta_aeroplane=5*(v*x/(V*5280/3600.0))**0.5\n",
+ "\n",
+ "# result\n",
+ "print \"The boundary layer thickness for the aeroplane is %f ft\\n\"%delta_aeroplane\n",
+ "#for the boat\n",
+ "v1=1.08*10**(-5) #ft**2/s\n",
+ "x1=2. #ft\n",
+ "V1=10. #miles/hr\n",
+ "#1 mile = 5280 ft\n",
+ "#1 hr = 3600 sec\n",
+ "delta_boat=5*(v1*x1/(V1*5280/3600.0))**0.5\n",
+ "print \"The boundary layer thickness for the boat is %f ft\"%delta_boat"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The boundary layer thickness for the aeroplane is 0.005239 ft\n",
+ "\n",
+ "The boundary layer thickness for the boat is 0.006068 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.2 page no : 521\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the force required to tow a square metal plate by a boat\n",
+ "\n",
+ "# variables\n",
+ "rho_water=998.2 #Kg/m**3\n",
+ "V=15. #km/hr\n",
+ "v=1.004*10**(-6) #m**2/s\n",
+ "l=1. #m length of plate\n",
+ "\n",
+ "#Calculations\n",
+ "#1 km = 1000 m\n",
+ "#1 hr = 3600 s\n",
+ "Rx=(V*1000/3600.)*l/v #dimentionless (reynold's number)\n",
+ "Cf=1.328/Rx**0.5 #dimentionless\n",
+ "F=Cf*rho_water*(V*1000/3600.0)**2 #N\n",
+ "\n",
+ "#Result\n",
+ "print \"The force required to tow the square plate is %f N\"%F"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The force required to tow the square plate is 11.297065 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.3 page no : 528\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the distance between the wall and edge of the laminar sublayer and buffer layer\n",
+ "\n",
+ "#Variables\n",
+ "V=10. #ft/s\n",
+ "l=0.25 #ft\n",
+ "v=1.08*10**(-5) #ft**2/s\n",
+ "f=0.0037 #dimentionless (fanning friction factor)\n",
+ "u01=5. #dimentionless\n",
+ "y01=5. #dimentionless\n",
+ "\n",
+ "#Calculations\n",
+ "R=V*l/v #dimentionless (reynold's number)\n",
+ "u1=V*(f/2.0)**0.5 #ft/s\n",
+ "r1=y01*v/u1 #ft\n",
+ "\n",
+ "#for buffer layer\n",
+ "u02=12. #dimentionless\n",
+ "y02=26. #dimentionless\n",
+ "r2=y02*v/u1 #ft\n",
+ "\n",
+ "#Results\n",
+ "print \"the distance between the wall and edge of the laminar sublayer is %f ft\\n\"%r1\n",
+ "print \"the distance between the wall and edge of the buffer layer is %f ft\"%r2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the distance between the wall and edge of the laminar sublayer is 0.000126 ft\n",
+ "\n",
+ "the distance between the wall and edge of the buffer layer is 0.000653 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 17.4 page no : 530\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the boundary layer thickness and the drag on the plate\n",
+ "\n",
+ "# variables\n",
+ "V=50. #ft/s\n",
+ "l=20. #ft\n",
+ "b=1. #ft\n",
+ "v=1.08*10**(-5) #ft**2/s\n",
+ "\n",
+ "# calculation and result\n",
+ "R=V*l/v #dimentionless (reynold's number)\n",
+ "delta=0.37*l/R**0.2 #ft\n",
+ "print \"The boundary layer thichness at the end of the plate is %f ft\\n\"%delta\n",
+ "Cf=0.072/R**0.2 #dimentionless\n",
+ "rho_water=62.3 #lbm/ft**3\n",
+ "V=50. #ft/s\n",
+ "#let A be the area of contact\n",
+ "A=2*l*b #ft**2\n",
+ "#1 lbf.s**2 = 32.2 lbm.ft\n",
+ "F=(1/2.0)*Cf*rho_water*V**2*A/32.2 #lbf\n",
+ "print \"The drag on the plate is %f lbf\"%F"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The boundary layer thichness at the end of the plate is 0.188763 ft\n",
+ "\n",
+ "The drag on the plate is 177.672178 lbf\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch18.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch18.ipynb
new file mode 100644
index 00000000..640ff2a5
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch18.ipynb
@@ -0,0 +1,178 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 18 : Turbulence"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.2 page no : 549\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the energy per unit mass and heat dissipation rate\n",
+ "\n",
+ "#variables\n",
+ "v=0.82 #m/s\n",
+ "energy_per_unit_mass=v**2/2.0 #J/Kg\n",
+ "\n",
+ "# calculation\n",
+ "#Let dissipation rate be denoted by eta\n",
+ "#Let D denote d/dL\n",
+ "DP=0.0286 #Pa/m\n",
+ "rho=1.2 #Kg/m^3\n",
+ "eta=DP*v/rho #m^2/s^3 or J/Kg/s\n",
+ "\n",
+ "# result\n",
+ "print \"The energy per unit mass is %f J/Kg\\n\"%energy_per_unit_mass\n",
+ "print \"The heat dissipation rate is %f J/Kg/s\"%eta"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The energy per unit mass is 0.336200 J/Kg\n",
+ "\n",
+ "The heat dissipation rate is 0.019543 J/Kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.3 page no : 550\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of k\n",
+ "\n",
+ "# variables\n",
+ "Vx_rms=9.5 #cm/s\n",
+ "Vy_rms=5.0 #cm/s\n",
+ "\n",
+ "# calculation\n",
+ "k=(1/2.0)*((Vx_rms/100.0)**2+(Vy_rms/100.0)**2) #J/Kg\n",
+ "\n",
+ "# result\n",
+ "print \"k = %f J/Kg\"%k"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "k = 0.005763 J/Kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.4 page no : 551\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the Kolmogorov scale\n",
+ "\n",
+ "# variables\n",
+ "v=1.613*10**(-4) #ft^2/s\n",
+ "eta=0.21 #ft^2/s^3\n",
+ "\n",
+ "# calculations\n",
+ "kolmogorov_scale=(v**3/eta)**0.25 #ft\n",
+ "\n",
+ "# result\n",
+ "print \"The Kolmogorov scale is %f ft\"%kolmogorov_scale"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Kolmogorov scale is 0.002114 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 18.7 page no : 557\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of turbulent kinematic viscosity\n",
+ "\n",
+ "# variables\n",
+ "K=0.00576 #m^2/s^2\n",
+ "eta=0.0196 #m^2/s^3\n",
+ "C_mew=0.09 #dimentionless\n",
+ "\n",
+ "# declarations\n",
+ "v_t=C_mew*(0.00576)**2/(0.0196) #m^2/s\n",
+ "\n",
+ "# results\n",
+ "print \"The value of turbulent kinematic viscosity is %f m^2/s\"%v_t"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of turbulent kinematic viscosity is 0.000152 m^2/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch19.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch19.ipynb
new file mode 100644
index 00000000..b3f394c9
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch19.ipynb
@@ -0,0 +1,399 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 19 : Mixing"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 19.1 page no : 563\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the time required for mixing\n",
+ "\n",
+ "# variables\n",
+ "L=10**(-6) #m\n",
+ "D=1.2*10**(-9) #m**2/s\n",
+ "\n",
+ "# calculation\n",
+ "t=2*L**2/D #s\n",
+ "\n",
+ "# result\n",
+ "print \"The time required for mixing is %f seconds\"%t"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The time required for mixing is 0.001667 seconds\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 19.2 page no : 567\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the power required to run an impeller\n",
+ "\n",
+ "# variables\n",
+ "D_tank=3. #ft\n",
+ "D_impeller=D_tank/3 #ft\n",
+ "N=4. #rps\n",
+ "v=1.077*10**(-5) #ft**2/s\n",
+ "\n",
+ "# calculation\n",
+ "R_impeller=N*D_impeller**2 #dimentionless (reynold's number)\n",
+ "#1 lbf.s**2 = 32.2 lbm.ft\n",
+ "#1 hp.s = 550 lbf.ft\n",
+ "rho_water=62.3 #lbm/ft**3\n",
+ "P=5*rho_water*N**3*D_impeller**5/32.2/550.0 #hp\n",
+ "\n",
+ "# result\n",
+ "print \"The power required to run an impeller is %.2f hp\"%P"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The power required to run an impeller is 1.13 hp\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 19.3 page no : 567\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the impeller speed in a model of a large mixer if the power per unit volume remains the same\n",
+ "\n",
+ "# variables\n",
+ "#let D1/D2 be denoted by ratio_D\n",
+ "ratio_D=5. #dimentionless\n",
+ "N2=240. #rpm\n",
+ "\n",
+ "# calculation\n",
+ "N1=N2/ratio_D**(2/3.) #rpm\n",
+ "\n",
+ "# result\n",
+ "print \"the impeller speed in a model of a large mixer if the power per unit volume remains the same is %d rpm\"%N1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the impeller speed in a model of a large mixer if the power per unit volume remains the same is 82 rpm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 19.4 page no : 569\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the time required to blend two miscible, low viscosity liquids\n",
+ "\n",
+ "# variables\n",
+ "D_tank=3. #ft\n",
+ "D_impeller=D_tank/3 #ft\n",
+ "H_tank=D_tank #ft\n",
+ "N=4.0 #rps\n",
+ "\n",
+ "# calculation\n",
+ "t_blend=4.3*(D_tank/H_tank)*(D_tank/D_impeller)**2/N #s\n",
+ "\n",
+ "# result\n",
+ "print \"the time required to blend two miscible, low viscosity liquids is %.1f s\"%t_blend"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the time required to blend two miscible, low viscosity liquids is 9.7 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 19.5 page no : 570\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate how far is the concentration of 0.1% from initial interface and the volume mixed\n",
+ "\n",
+ "# variables\n",
+ "c=0.1 #percent\n",
+ "c_interface=50. #percent\n",
+ "c_original=0. #percent\n",
+ "ratio_c=(c-c_interface)/(c_original-c_interface) #dimentionless\n",
+ "\n",
+ "# calculations\n",
+ "#erf(0.998)=2.15\n",
+ "#time required forfluid to travel 700 miles at 8ft/s is 4.57*10**5 sec\n",
+ "t=4.57*10**5 #s\n",
+ "D=2*10**(-9) #m**2/s\n",
+ "x=2*2.15*(D*t)**0.5 #m\n",
+ "print \"x=%.2f m\"%x\n",
+ "v0=0.355 #ft**3 of liquid/ft of pipe\n",
+ "#1 m = 3.281 ft\n",
+ "V_mixed=2*(3.281*x)*v0 #ft**3\n",
+ "\n",
+ "# result\n",
+ "print \"The mixed volume is %.2f ft**3\"%V_mixed"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x=0.13 m\n",
+ "The mixed volume is 0.30 ft**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 19.6 page no : 571\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate how far is the concentration of 0.1% from initial interface and the volume mixed\n",
+ "\n",
+ "# variables\n",
+ "v=8. #ft/s\n",
+ "f=0.0039 #dimentionless (fanning friction factor)\n",
+ "D_turbulent=0.665*v*3.57*(f)**0.5 #ft**2/s\n",
+ "\n",
+ "# calculation\n",
+ "#time required forfluid to travel 700 miles at 8ft/s is 4.57*10**5 sec\n",
+ "t=4.57*10**5 #s\n",
+ "x=2*2.15*(D_turbulent*t)**0.5 #ft\n",
+ "print \"x=%f m\"%x\n",
+ "v0=0.355 #ft**3 of liquid/ft of pipe\n",
+ "V_mixed=2*x*v0 #ft**3\n",
+ "\n",
+ "# result\n",
+ "print \"The mixed volume is %f ft**3\"%V_mixed"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x=3165.793854 m\n",
+ "The mixed volume is 2247.713636 ft**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 19.7 page no : 572\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate how far downstream does the dye become uniformly distributed throughout the fluid\n",
+ "\n",
+ "# variables\n",
+ "f=0.0039 #dimentionless (fanning friction factor)\n",
+ "D=0.665 #ft\n",
+ "\n",
+ "# calculation\n",
+ "L=D*0.56/(f)**0.5 #ft\n",
+ "\n",
+ "# result\n",
+ "print \"L = %.0f ft\"%L"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "L = 6 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 19.8 page no : 573\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the width of jet and entrainment ratio\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "Vo=40. #ft/s\n",
+ "Do=1. #ft\n",
+ "x=10. #ft\n",
+ "K=6.2 #dimentionless\n",
+ "\n",
+ "# calculation\n",
+ "V_centerline=Vo*K*(Do/x) #ft/s\n",
+ "alpha=20. #degrees\n",
+ "Dx=Do*(1+(x/Do)*math.sin(alpha*math.pi/180.0)) #ft\n",
+ "\n",
+ "#Let entrainment ratio be r\n",
+ "r=0.62*(x/Do)**0.5#dimentionless\n",
+ "\n",
+ "# result\n",
+ "print \"The jet diameter is %.2f ft\\n\"%Dx\n",
+ "print \"The entrainment ratio is %.2f\"%r"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The jet diameter is 4.42 ft\n",
+ "\n",
+ "The entrainment ratio is 1.96\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 19.9 page no : 577\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the SO2 concentration at the centerline\n",
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "Q=20. #gm/s\n",
+ "u=3. #m/s\n",
+ "sigma_y=30.0 #m\n",
+ "sigma_z=20.0 #m\n",
+ "y=60. #m\n",
+ "z=20. #m\n",
+ "H=0. #m\n",
+ "\n",
+ "# calculation\n",
+ "c=Q/(2.0*math.pi*u*sigma_y*sigma_z)*math.exp(-((y**2/2.0/sigma_y**2)+((z-H)**2/2.0/sigma_z**2)))#gm/m**3\n",
+ "\n",
+ "# result\n",
+ "print \"The SO2 concentration at the centerline is %f gm/m**3\"%c"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The SO2 concentration at the centerline is 0.000145 gm/m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch2.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch2.ipynb
new file mode 100644
index 00000000..a71f7441
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch2.ipynb
@@ -0,0 +1,923 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2 : Fluid statics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.1 page no : 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Specific weight of water is 62.3 lbf/ft^3\n"
+ ]
+ }
+ ],
+ "source": [
+ "# 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\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.2 page no : 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "pressure at the depth is 3164.154656 KPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#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\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.3 page no : 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Gauge pressure is 3300.0 lbf/ft^2\n",
+ "Gauge pressure is 22.9166666667 lbf/in^2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#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\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.4 page no : 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "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"
+ ]
+ }
+ ],
+ "source": [
+ "# 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\","
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.5 page no : 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "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"
+ ]
+ }
+ ],
+ "source": [
+ "#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"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.6 page no : 45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Force exerted by atmosphere on the roof is 23940443.9848 lbf\n"
+ ]
+ }
+ ],
+ "source": [
+ "# 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\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.7 page no : 45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "469965.799032\n"
+ ]
+ }
+ ],
+ "source": [
+ "# 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"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.8 page no : 46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The net force on the lock gate is 9.81 MN\n"
+ ]
+ }
+ ],
+ "source": [
+ "#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\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.9 page no : 49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Thichness of the storage tank is 0.8244 in\n"
+ ]
+ }
+ ],
+ "source": [
+ "#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\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.10 page no : 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Thichness of the storage tank is 0.75 in\n"
+ ]
+ }
+ ],
+ "source": [
+ "#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\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.11 page no : 53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Payload of the balloon is 144.307841185 N\n"
+ ]
+ }
+ ],
+ "source": [
+ "#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\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.12 page no : 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Fraction of wood in water 0.857142857143\n"
+ ]
+ }
+ ],
+ "source": [
+ "#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"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.13 page no : 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Gauge pressure is 1.08194444444 lbf/in^2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#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\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.14 page no : 56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The pressure difference is 0.0432638888889 lbf/in^2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#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\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.15 page no : 57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The gauge pressure is 25.0 KPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#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\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.16 page no : 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The pressure difference is 0.00318424170616 lbf/in^2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#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\","
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.17 page no : 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "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"
+ ]
+ }
+ ],
+ "source": [
+ "# 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\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.18 page no : 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The angle made by free surface with the horizontal is 1.77880031567 degrees\n"
+ ]
+ }
+ ],
+ "source": [
+ "# 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\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.19 page no : 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The liquid in the cylinder rises to a height of 0.0765120708158 m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#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\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### example 2.20 page no : 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The thickness of water strip at bottom of industrial centrifuge 13.9495728181 in\n"
+ ]
+ }
+ ],
+ "source": [
+ "#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\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch20.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch20.ipynb
new file mode 100644
index 00000000..3d6ce091
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch20.ipynb
@@ -0,0 +1,128 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 20 : Computational fluid dynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 20.1 page no : 588\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate first derivative and second derivative of the fluid flow\n",
+ "\n",
+ "# variables\n",
+ "y_fd2=0.4336 #m\n",
+ "y_fd1=0.4375 #m\n",
+ "delta_yfd=y_fd2-y_fd1 #m\n",
+ "x_fd2=0.75 #m\n",
+ "x=0.5 #m\n",
+ "delta_xfd=x_fd2-x #m\n",
+ "y_bd2=0.4375 #m\n",
+ "y_bd1=0.2461 #m\n",
+ "delta_ybd=y_bd2-y_bd1 #m\n",
+ "x_bd1=0.25 #m\n",
+ "delta_xbd=x-x_bd1 #m\n",
+ "\n",
+ "# calculation\n",
+ "#Let D denote d/dx and D2 denote d^2/dx^2\n",
+ "Dy_fd=delta_yfd/delta_xfd #dimentionless\n",
+ "Dy_bd=delta_ybd/delta_xbd #dimentionless\n",
+ "Dy=(Dy_fd+Dy_bd)/2 #dimentionless\n",
+ "D2y=(Dy_fd-Dy_bd)/delta_xfd #dimentionless\n",
+ "\n",
+ "# result\n",
+ "print \"The first derivative of fluid flow is %f\\n\"%Dy\n",
+ "print \"The second derivative of fluid flow is %.3f\"%D2y"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The first derivative of fluid flow is 0.375000\n",
+ "\n",
+ "The second derivative of fluid flow is -3.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 20.3 page no : 592\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the grid velocities\n",
+ "\n",
+ "# variables\n",
+ "v=1.077*10**(-5) #ft^2/s\n",
+ "t=2. #sec\n",
+ "dy=0.01 #ft\n",
+ "w=v*t/dy**2 #dimentionless\n",
+ "\n",
+ "#Let Vij represent velocity through the i,j grid\n",
+ "V00=5. #ft/s\n",
+ "V10=5. #ft/s\n",
+ "V01=0. #ft/s\n",
+ "V02=0. #ft/s\n",
+ "V12=0. #ft/s\n",
+ "\n",
+ "# calculation\n",
+ "V11=V01+w*(V00-2*V01+V02) #ft/s\n",
+ "V21=V11+w*(V10-2*V11+V12) #ft/s\n",
+ "V13=0. #ft/s\n",
+ "V22=V12+w*(V11-2*V12+V13) #ft/s\n",
+ "\n",
+ "# result\n",
+ "print \"The grid velocity for 2,1 is %.3f ft/s\\n\"%V21\n",
+ "print \"The grid velocity for 2,2 is %.3f ft/s\\n\"%V22"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The grid velocity for 2,1 is 1.690 ft/s\n",
+ "\n",
+ "The grid velocity for 2,2 is 0.232 ft/s\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch3.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch3.ipynb
new file mode 100644
index 00000000..af8703d1
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/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/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch4.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch4.ipynb
new file mode 100644
index 00000000..904ca6fe
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch4.ipynb
@@ -0,0 +1,266 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4 : The first law of thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.1 page no : 111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "change in pot. energy per unit mass is 225.630000 m^2/s^2\n",
+ "The total change in potential energy is 2256.300000 J\n"
+ ]
+ }
+ ],
+ "source": [
+ "#calculate change in pot. energy per unit mass and total change in pot. energy\n",
+ "\n",
+ "# variables\n",
+ "g=9.81; #m/s^2 acc. due to gravity\n",
+ "dh=23.; #m change in height\n",
+ "\n",
+ "# calculation and result\n",
+ "dpe=g*dh #m^2/s^2 change in pot energy per unit mass\n",
+ "print \"change in pot. energy per unit mass is %f m^2/s^2\"%dpe\n",
+ "\n",
+ "m=10.; #kg\n",
+ "dPE=m*dpe #kgm^2/s^2 or J change in pot. energy \n",
+ "print \"The total change in potential energy is %f J\"%dPE"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.2 page no : 112"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the kinetic energy of bullet is 842.236025 J\n"
+ ]
+ }
+ ],
+ "source": [
+ "#calculate the kinetic energy of bullet\n",
+ "\n",
+ "# variables\n",
+ "m=0.01; #lbm mass of bullet\n",
+ "v=2000.; #ft/s\n",
+ "\n",
+ "# calculation\n",
+ "KE=(m*v**2/2)*(1.356/32.2) #J\n",
+ "\n",
+ "# result\n",
+ "print \"the kinetic energy of bullet is %f J\"%KE"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.3 page no : 112"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the kinetic energy of bullet fired from a airplane is 0.021056 J\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Calculate the kinetic energy of bullet fired from a airplane\n",
+ "\n",
+ "# variables\n",
+ "v_bp=2000.; #ft/s vel of bullet wrt plane\n",
+ "v_p=-1990.; #ft/s\n",
+ "v_b=v_bp+v_p #ft/s vel of bullet wrt ground\n",
+ "m=0.01; #lbm\n",
+ "\n",
+ "# calculation\n",
+ "KE=(m*v_b**2/2)*(1.356/32.2) #J\n",
+ "\n",
+ "# result\n",
+ "print \"the kinetic energy of bullet fired from a airplane is %f J\"%KE"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.4 page no : 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the change in internal energy of the system is -44.720823 Btu\n"
+ ]
+ }
+ ],
+ "source": [
+ "#calculate the change in internal energy of the system\n",
+ "\n",
+ "# variables\n",
+ "p=14.7; #lbf/in^2 atmospheric pressure\n",
+ "dV=1.; #ft^3 change in volume\n",
+ "\n",
+ "# calculation\n",
+ "dW=p*dV*(144/778.) #Btu work done\n",
+ "dQ=-42.; #Btu heat removed from the system\n",
+ "dU=dQ-dW #Btu change in internal energy of the system\n",
+ "\n",
+ "# result\n",
+ "print \"the change in internal energy of the system is %f Btu\"%dU"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.5 page no : 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The work done is 101.650000 J/Kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "#calculate the work done\n",
+ "#work done=change in pot. energy + change in kinetic energy considering steady flow and adiabatic conditions\n",
+ "\n",
+ "# variables\n",
+ "v_in=3.; #m/s\n",
+ "v_out=10.; #m/s\n",
+ "dke=(v_in**2-v_out**2)/2.0; #m^2/s^2\n",
+ "g=9.81; #m/s^2\n",
+ "dh=15.; #m change in height in inlet and outlet\n",
+ "\n",
+ "# calculation\n",
+ "dpe=g*dh; #m^2/s^2\n",
+ "W=dpe+dke #J/kg\n",
+ "\n",
+ "# result\n",
+ "print \"The work done is %f J/Kg\"%W"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.6 page no : 124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the mass consumed in a nuclear reactor per unit time is 2.222222 * 10^(-8) kg/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "#calculate the mass consumed in a nuclear reactor per unit time\n",
+ "\n",
+ "# variables\n",
+ "#let D=d/dt\n",
+ "DQ=-13.*10**8; #J/s\n",
+ "DW=7*10.**8; #J/s\n",
+ "\n",
+ "#Dm=(DQ-DW)/c^2 where c is velocity of light sice E=mc^2\n",
+ "c=3.0*10**8; #m/s\n",
+ "c1=3.0; #velocity of light without power\n",
+ "p=8. #power of 10 in speed of light \n",
+ "\n",
+ "# calculation\n",
+ "Dm=float(DW-DQ)/c/c1 #kg/s\n",
+ "\n",
+ "# result\n",
+ "print \"the mass consumed in a nuclear reactor per unit time is %f * 10^(-%d) kg/s\"%(Dm,p)"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch5.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch5.ipynb
new file mode 100644
index 00000000..3ea8a173
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch5.ipynb
@@ -0,0 +1,571 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Bernoulli Equation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.1 page no : 134\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the increase in temperature due to falling water of waterfall\n",
+ "\n",
+ "# Variables \n",
+ "g=9.81; #m/s^2 acc. due to gravity\n",
+ "dz=100.; #m Height of waterfall\n",
+ "\n",
+ "# Calculation\n",
+ "du=g*dz; #J/kg Change in internal energy\n",
+ "Cv=4184.0; #J/kg/K;\n",
+ "dT=du/Cv #K Change in temperature\n",
+ "\n",
+ "# Result\n",
+ "print \"Change in temperature is %f K or degree centigrade\"%dT"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in temperature is 0.234465 K or degree centigrade\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.2 page no : 141\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate velocity of air coming out from the nozzle\n",
+ "\n",
+ "# Variables \n",
+ "T=528. #R Rankine scale\n",
+ "R=10.73; #psi.ft^3/R/lbmol universal gas constant\n",
+ "p=14.71 #psi\n",
+ "p_atm=14.7; #psi\n",
+ "M=29.; #lbm/lbmol\n",
+ "\n",
+ "# Calculation \n",
+ "#considering the velocity at the start of the nozzle is negligible\n",
+ "v=((2*R*T/p/M)*(p-p_atm)*(144*32.2))**0.5; #ft/s\n",
+ "\n",
+ "# Result\n",
+ "print \"Velocity of the air flowing out of the pipe %f ft/s\"%v"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity of the air flowing out of the pipe 35.094226 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.3 page no : 143\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the velocity of water flowing out of a nozzle at the bottom of a tank\n",
+ "\n",
+ "# Variables \n",
+ "g=32.2; #ft/s^2\n",
+ "h=30.; #ft height tank\n",
+ "\n",
+ "# Calculation \n",
+ "#considering the velocityof water at the top of the tank is negligible\n",
+ "v=(2*g*h)**0.5; #ft/s\n",
+ "\n",
+ "# Result\n",
+ "print \"The velocity of the water flowing out through the nozzle is %f ft/s\"%v"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of the water flowing out through the nozzle is 43.954522 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.4 page no : 144\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate velocity of water flowing out of nozzle\n",
+ "\n",
+ "# Variables \n",
+ "A_nozzle=1.0 #ft^2\n",
+ "A_tank=4.0 #ft^2\n",
+ "g=32.2 #ft/s^2\n",
+ "h=30. #ft\n",
+ "\n",
+ "# Calculation \n",
+ "v=(2*g*h/(1-(A_nozzle/A_tank)**2))**0.5 #ft/s\n",
+ "\n",
+ "# Result\n",
+ "print \"The velocity of water flowing out of nozzle is %f ft/s\"%v"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of water flowing out of nozzle is 45.396035 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.5 page no : 145\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the velocity of water flowing out of a nozzle\n",
+ "\n",
+ "# Variables \n",
+ "g=32.2 #ft/s^2\n",
+ "h=30. #ft\n",
+ "M_air=29. #dimentionless (molecular weight)\n",
+ "M_CO2=44. #dimentionless (molecular weight)\n",
+ "\n",
+ "# Calculation \n",
+ "v=(2*g*h*(1-(M_air/M_CO2)))**0.5 #ft/s\n",
+ "\n",
+ "# Result\n",
+ "print \"The velocity of water flowing out of nozzle is %f ft/s\"%v"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of water flowing out of nozzle is 25.663912 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.6 page no : 147\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate velocity of sailboat using pitot tube\n",
+ "\n",
+ "# Variables \n",
+ "h=1. #m height of water above the water level\n",
+ "g=9.81 #m/s^2\n",
+ "\n",
+ "# Calculation \n",
+ "v=(2*g*h)**0.5 #m/s\n",
+ "\n",
+ "# Result\n",
+ "print \"The velocity of sailboat is %f m/s\"%v"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of sailboat is 4.429447 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.7 page no : 148\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate velocity of air flowing through an air duct\n",
+ "\n",
+ "# Variables \n",
+ "dP=0.05 #psi or lbf/in^2\n",
+ "rho_air=0.075 #lbm/ft^3\n",
+ "\n",
+ "#1ft = 12in\n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "\n",
+ "# Calculation \n",
+ "v=(2*dP*144*32.2/rho_air)**0.5 #ft/s\n",
+ "\n",
+ "# Result\n",
+ "print \"The velocity of air in the air duct is %f ft/s\"%v"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of air in the air duct is 78.628239 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.8 page no : 149\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate volumetric flow rate using a venturi-meter\n",
+ "import math\n",
+ "\n",
+ "# Variables \n",
+ "dP=1. #psi\n",
+ "rho_water=62.3 #lbm/ft^3\n",
+ "d1=1. #ft area at pt 1 in venturimeter\n",
+ "A1=(math.pi)*d1**2/4.0 #ft^2\n",
+ "d2=0.5 #ft\n",
+ "A2=(math.pi)*d2**2/4.0 #ft^2\n",
+ "\n",
+ "#1ft = 12in\n",
+ "\n",
+ "# Calculation \n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "v=((2*dP*144*32.2/rho_water)/(1-(A2/A1)**2))**0.5 #ft/s\n",
+ "q=v*A2 #ft^3/s\n",
+ "\n",
+ "# Result\n",
+ "print \"The velocity of the water flowing through venturimeter is %f ft/s\"%v\n",
+ "print \"The volumetric flow rate of water is %f ft^3/s\"%q"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of the water flowing through venturimeter is 12.600696 ft/s\n",
+ "The volumetric flow rate of water is 2.474141 ft^3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.9 page no : 149\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate actual volumetric flow rate using a venturi-meter\n",
+ "import math\n",
+ "\n",
+ "# Variables \n",
+ "dP=1. #psi\n",
+ "rho_water=62.3 #lbm/ft^3\n",
+ "d1=1. #ft area at pt 1 in venturimeter\n",
+ "A1=(math.pi)*d1**2/4 #ft^2\n",
+ "d2=0.5 #ft\n",
+ "A2=(math.pi)*d2**2/4 #ft^2\n",
+ "#1ft = 12in\n",
+ "\n",
+ "# Calculation \n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "v_th=((2*dP*144*32.2/rho_water)/(1-(A2/A1)**2))**0.5 #ft/s\n",
+ "Cv=0.984 #dimentionless\n",
+ "v_act=Cv*v_th #ft/s actual velocity\n",
+ "q=v_act*A2 #ft^3/s\n",
+ "\n",
+ "# Result\n",
+ "print \"The velocity of the water flowing through venturimeter is %f ft/s\"%v_act\n",
+ "print \"The volumetric flow rate of water is %f ft^3/s\"%q"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of the water flowing through venturimeter is 12.399084 ft/s\n",
+ "The volumetric flow rate of water is 2.434555 ft^3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.10 page no : 152\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the pressure difference in a pipe\n",
+ "import math\n",
+ "\n",
+ "# Variables \n",
+ "v1=1. #m/s\n",
+ "d1=0.4 #m\n",
+ "A1=(math.pi)*d1**2/4 #m^2\n",
+ "d2=0.2 #m\n",
+ "A2=(math.pi)*d2**2/4 #m^2\n",
+ "v2=A1*v1/A2 #m/s\n",
+ "Cv=0.62 #dimentionless\n",
+ "rho_water=998.2 #kg/m^3\n",
+ "\n",
+ "# Calculation \n",
+ "dP=(rho_water*v2**2/2/Cv**2)*(1-(A2/A1)**2)/1000. #KPa\n",
+ "\n",
+ "# Result\n",
+ "print \"The pressure difference in the pipe is %f KPa\"%dP"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure difference in the pipe is 19.475806 KPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.11 page no : 155\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the flow rate of helium with rotameter caliberated with nitogen\n",
+ "\n",
+ "# Variables \n",
+ "M_N2=28. #dimentionless\n",
+ "M_He=4. #dimentionless\n",
+ "\n",
+ "#Density is proportional to molecular weight\n",
+ "q_N2=100. #cm^3/min\n",
+ "\n",
+ "# Calculation \n",
+ "q_He=q_N2*(M_N2/M_He)**0.5 #cm^3/min\n",
+ "\n",
+ "# Result\n",
+ "print \"The flow rate of Helium is %f cm^3/min\"%q_He"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The flow rate of Helium is 264.575131 cm^3/min\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.12 page no : 156\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the absolute pressure at the top of a inverted manometer tube\n",
+ "\n",
+ "# Variables \n",
+ "p_atm=14.7 #lbf/in^2\n",
+ "g=32.2 #ft/s^2\n",
+ "\n",
+ "#one end of the inverted manometer is immersed in a tank and the other end is open to atmosphere 10 ft below tank level\n",
+ "#pt 1 is at tank water level, pt 2 is at top of inverted manometer and pt3 is at the other end of manometer\n",
+ "dh=10. #ft\n",
+ "v3=(2*g*dh)**0.5 #ft/s\n",
+ "p1=p_atm #lbf/in^2\n",
+ "rho_water=62.3 #lbm/ft^3\n",
+ "\n",
+ "#Difference of height between pt 1 and pt 2 is 40 ft\n",
+ "dh1=40. #dft\n",
+ "\n",
+ "# Calculation \n",
+ "p2=p1-(rho_water*v3**2/2/32.2/144)-(rho_water*g*dh1)/32.2/144 #lbf/in^2\n",
+ "\n",
+ "# Result\n",
+ "print \"The absolute pressure at the top of the inverted manometer is %f lbf/in^2\"%p2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The absolute pressure at the top of the inverted manometer is -6.931944 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 5.13 page no : 156\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate pressure at the throat in a venturimeter\n",
+ "\n",
+ "# Variables \n",
+ "dP=10. #psi or lbf/in^2\n",
+ "rho_water=62.3 #lbm/ft^3\n",
+ "#1ft = 12in\n",
+ "\n",
+ "# Calculation and Result\n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "v3=(2*dP*144*32.2/rho_water)**0.5 #ft/s\n",
+ "print \"The velocity of water after the throat is %f ft/s\"%v3\n",
+ "\n",
+ "ratio_A=0.5 #dimentionless (ratio of throat area to pipe area)\n",
+ "v2=v3/ratio_A #ft/s\n",
+ "print \"The velocity of water at the throat is %f ft/s\"%v2\n",
+ "\n",
+ "P1=24.7 #psia\n",
+ "rho_water=62.3 #lbm/ft^3\n",
+ "P2=P1-(rho_water)*v2**2/32.2/144/2 #psia\n",
+ "print \"The pressure of water at the throat is %f psia\"%P2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of water after the throat is 38.581593 ft/s\n",
+ "The velocity of water at the throat is 77.163186 ft/s\n",
+ "The pressure of water at the throat is -15.300000 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch6.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch6.ipynb
new file mode 100644
index 00000000..af79b3a1
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch6.ipynb
@@ -0,0 +1,554 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 : Fluid friction in steady on dimentional flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.1 page no : 180\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the drop in pressure per unit length in a pipe\n",
+ "import math\n",
+ "\n",
+ "# Variables \n",
+ "q=50.0 #gal/min flow rate\n",
+ "d=3.068 #in inner diameter\n",
+ "\n",
+ "# Calculation \n",
+ "a=(math.pi)*(3.068/12.0)**2/4.0 #ft^2\n",
+ "#1 ft^3 = 7.48 gal\n",
+ "#1 min = 60 sec\n",
+ "v_avg=q/a/60.0/7.48 #ft/s\n",
+ "mew=50.0 #cP\n",
+ "#1 cP = 0.000672 lbm/ft/s\n",
+ "rho=62.3 #lbm/ft^3\n",
+ "\n",
+ "# Result\n",
+ "R=(d/12)*v_avg*rho/(mew*0.000672) #dimentionless reynold's no.\n",
+ "if (R<2000):\n",
+ " print \"Laminar flow\"\n",
+ "else:\n",
+ " print \"Turbulent flow\"\n",
+ "\n",
+ "dx=3000.0 #ft length of pipe\n",
+ "#1 gal = 231 in^3\n",
+ "#1 cP.ft^3 = 0.0000209 lbf.s\n",
+ "dp=(q/60)*(128/math.pi)*(mew/d**4)*dx*231*0.0000209/12 #lbf/in^2 or psi\n",
+ "#let D represent d/dx\n",
+ "Dp=(dp/dx)*100 #psi/ft\n",
+ "print \"The pressure gradient in the pipe is %f psi/100ft\"%Dp"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Laminar flow\n",
+ "The pressure gradient in the pipe is 0.770911 psi/100ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.2 page no : 182\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate viscosity of fluid using a viscometer\n",
+ "import math\n",
+ "\n",
+ "# Variables \n",
+ "rho=1050. #Kg/m^3\n",
+ "g=9.81 #m/s^2\n",
+ "dz=0.12 #m change in height\n",
+ "d=0.001 #m inner diameter of capillary of viscometer\n",
+ "q=10**(-8) #m^3/s\n",
+ "dx=0.1 #m length of capillary\n",
+ "\n",
+ "# Calculation \n",
+ "mew=(rho*g*dz*(math.pi)*d**4)*1000/128./(q*dx) #cP\n",
+ "\n",
+ "# Result\n",
+ "print \"The viscosity of the fluid is %f cP\"%mew"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The viscosity of the fluid is 30.337477 cP\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.3 page no : 187\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the fanning friction factor\n",
+ "\n",
+ "# Variables \n",
+ "R=10**5. #dimentionless reynold's no.\n",
+ "ratio_ED=0.0002 #dimentionless\n",
+ "\n",
+ "# Calculation \n",
+ "f=0.001375*(1+(20000*ratio_ED+10**6/R)**(1./3)) #dimentionless\n",
+ "\n",
+ "# Result\n",
+ "print \"The fanning friction factor is %f\"%f"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The fanning friction factor is 0.004689\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.4 page no : 188\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gauge pressure in the tank\n",
+ "import math\n",
+ "\n",
+ "# Variables \n",
+ "q=300. #gal/min flow rate\n",
+ "d=3.068 #in inner diameter\n",
+ "\n",
+ "# Calculation \n",
+ "a=(math.pi)*(3.068/12.0)**2/4.0 #ft^2\n",
+ "\n",
+ "#1 ft^3 = 7.48 gal\n",
+ "#1 min = 60 sec\n",
+ "v_avg=13. #q/a/60.0/7.48#ft/s\n",
+ "f=0.0091 #dimentionless fanning friction factor\n",
+ "dx=3000. #ft\n",
+ "rho=62.3 #lbm/ft^3\n",
+ "dp=4*f*(dx/(d/12.0))*rho*(v_avg**2/2.0)/32.2/144.0 #lbf/in^2 or psi\n",
+ "\n",
+ "# Result\n",
+ "print \"The gauge pressure in the tank is %d psi\"%dp"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gauge pressure in the tank is 484 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.5 page no : 190\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate volumetric flow rate of gasoline through a pipe\n",
+ "import math\n",
+ "\n",
+ "# Variables \n",
+ "d=0.1 #m internal diameter of pipe\n",
+ "A=math.pi*d**2/4.0 #m^2\n",
+ "dx=100.0 #m length of pipe\n",
+ "f=0.005 #dimentionless fanning friction factor\n",
+ "dz=10.0 #m difference in water level\n",
+ "g=9.81 #m/s^2\n",
+ "\n",
+ "# Calculation \n",
+ "v=((2*g*dz/4/f)*(0.1/100))**0.5 #4.0/f)*d/dx)**0.5#m/s\n",
+ "\n",
+ "# Result\n",
+ "print \"The velocity of gasoline through pipe is %f m/s\"%v\n",
+ "q=A*v#m^3/s\n",
+ "print \"The volumteric flow arte od gasoline through the pipe is %f m^3/s\"%q"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of gasoline through pipe is 3.132092 m/s\n",
+ "The volumteric flow arte od gasoline through the pipe is 0.024599 m^3/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.6 page no : 192\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate pressure difference across the duct\n",
+ "import math\n",
+ "\n",
+ "# Variables \n",
+ "p=14.75 #lbf/in^2\n",
+ "M=29. #lbm/lbmol\n",
+ "R=10.73 #lbf.ft^3/(in^2.lbmol.R)\n",
+ "T=500. #R Rankine temperature scale\n",
+ "rho=p*M/(R*T) #lbm/ft^3\n",
+ "q=500. #ft^3/min\n",
+ "d=1. #ft\n",
+ "A=(math.pi)*d**2/4 #ft^2\n",
+ "v=(q/60.0)/A #ft/s\n",
+ "mew=0.017 #cP\n",
+ "\n",
+ "#1cP = 0.000672 lbm/ft/s\n",
+ "R=d*v*rho/(mew*0.000672) #dimentionless reynold's no.\n",
+ "f=0.00465 #fanning friction factor\n",
+ "dx=800. #ft lenght of duct\n",
+ "#1 ft = 12 in\n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "\n",
+ "# Calculation \n",
+ "dP=rho*(4*f*(dx/d)*(v**2/2))/32.2/144. #lbf/in^2\n",
+ "\n",
+ "# Result\n",
+ "print \"The pressure drop across the duct is %f lbf/in^2\"%dP"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure drop across the duct is 0.014402 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.8 page no : 197\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the pump power required\n",
+ "\n",
+ "# Variables \n",
+ "q=200. #gal/min\n",
+ "rho=62.3 #lbm/ft^3\n",
+ "#1 ft^3 = 7.48 gal\n",
+ "\n",
+ "# Calculation \n",
+ "m=(q/60)*rho/7.48 #lbm/s\n",
+ "dx=2000. #ft\n",
+ "dp=3.87 #psi/100ft\n",
+ "F=(dp/100)*dx/rho*32.2*144 #ft\n",
+ "#1 hp = 550 lbf.ft/s\n",
+ "Po=F*m/550. #hp\n",
+ "\n",
+ "# Result\n",
+ "print \"The pump power required is %f hp\"%Po"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pump power required is 290.786193 hp\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.9 page no : 198\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the drop in pressure per unit length in a pipe\n",
+ "\n",
+ "# Variables \n",
+ "dp=0.1 #psi\n",
+ "dx=800. #ft\n",
+ "\n",
+ "#let D represent d/dx\n",
+ "#1 psi = 6895 Pa\n",
+ "#1 m = 3.28 ft\n",
+ "\n",
+ "# Calculation \n",
+ "Dp=(dp/dx)*6895*3.28 #Pa/m\n",
+ "\n",
+ "# Result\n",
+ "print \"The drop in pressure per unit length in the pipe is %f Pa/m\"%Dp\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drop in pressure per unit length in the pipe is 2.826950 Pa/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.10 page no : 201\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the pressure difference created due to expansion and contraction\n",
+ "\n",
+ "# Variables \n",
+ "rho=62.3 #lbm/ft^3\n",
+ "K=1.5 #dimentionless\n",
+ "v=13. #ft/s\n",
+ "\n",
+ "#1 ft = 12 in\n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "\n",
+ "# Calculation \n",
+ "dp=rho*K*(v**2/2)/32.2/144 #lbf/in^2\n",
+ "\n",
+ "# Result\n",
+ "print \"The pressure drop due to expansion and contraction is %f lbf/in^2\"%dp"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure drop due to expansion and contraction is 1.703012 lbf/in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.11 page no : 203\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the pressure drop in the pipe due to fittings\n",
+ "\n",
+ "# Variables \n",
+ "dx=3000.0 #ft actual length of pipe\n",
+ "dx1=281. #ft equivalent length of fittings\n",
+ "p=484. #psi\n",
+ "\n",
+ "# Calculation \n",
+ "dx_total=dx+dx1 #ft\n",
+ "dp_total=p*(dx_total/dx) #psi\n",
+ "dp_vnf=dp_total-p #psi pressure drop fue to valves and fittings\n",
+ "\n",
+ "# Result\n",
+ "print \"The pressure drop due to valves and fittings is %d psi\"%dp_vnf"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure drop due to valves and fittings is 45 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.12 page no : 203\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate pressure drop due to valves and fittings\n",
+ "\n",
+ "# Variables \n",
+ "K=27.56 #deimentionless\n",
+ "rho=62.3 #lbm/ft^3\n",
+ "v=13. #ft/s\n",
+ "\n",
+ "# Calculation \n",
+ "#1 ft = 12 in\n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "dp=rho*K*(v**2/2)/32.2/144. #psi\n",
+ "\n",
+ "# Result\n",
+ "print \"THe pressure drop due to valves and fittings is %d psi\"%dp"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "THe pressure drop due to valves and fittings is 31 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 6.13 page no : 207\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gasoline leakage rate through a seal\n",
+ "import math\n",
+ "\n",
+ "# Variables \n",
+ "p=100.0 #lbf/in^2\n",
+ "l=1. #in length od seal in direction of leak\n",
+ "mew=0.6 #cP\n",
+ "d=0.25 #in diameter of valve stem\n",
+ "t=0.0001 #in thickness of valva stem\n",
+ "\n",
+ "# Calculation \n",
+ "#1 cP = 0.0000209 lbf.s/ft^2\n",
+ "#1 ft = 12 in\n",
+ "q=(p/l)*(1/12.0/mew)*(math.pi)*d*t**3/0.0000209*144*3600. #in^3/hr\n",
+ "\n",
+ "# Result\n",
+ "print \"The volumetric leakage rate of gasoline is %f in^3/hr\"%q\n",
+ "rho=0.026 #lbm/in^3\n",
+ "m=q*rho #lbm/hr\n",
+ "print \"The mass leakage rate of gasoline is %f lbm/hr\"%m"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The volumetric leakage rate of gasoline is 0.270568 in^3/hr\n",
+ "The mass leakage rate of gasoline is 0.007035 lbm/hr\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch7.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch7.ipynb
new file mode 100644
index 00000000..d10bdc2a
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch7.ipynb
@@ -0,0 +1,600 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 : The momentum balance"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.2 page no : 248\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calulate the final velocity of duck after being hit by a bullet\n",
+ "\n",
+ "# Variables \n",
+ "m_duck=3. #lbm\n",
+ "v_duck=-15. #ft/s due west\n",
+ "m_bullet=0.05 #lbm\n",
+ "v_bullet=1000. #ft/s due east\n",
+ "\n",
+ "# Calculation \n",
+ "#total initial momentum = final momentum\n",
+ "v_sys=((m_duck*v_duck)+(m_bullet*v_bullet))/(m_duck+m_bullet)#ft/s\n",
+ "\n",
+ "# Result\n",
+ "print \"The final velocity of the duck is %f ft/s\"%v_sys"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The final velocity of the duck is 1.639344 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.3 page no : 250\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the force required to hold of water from a hoze\n",
+ "\n",
+ "# Variables \n",
+ "rho=998.2 #Kg/m^3\n",
+ "q=0.01 #m^3/s\n",
+ "v_initial=30. #m/s\n",
+ "v_final=0. #m/s\n",
+ "\n",
+ "# Calculation \n",
+ "F=q*rho*(v_final-v_initial) #N\n",
+ "\n",
+ "# Result\n",
+ "print \"The force required to hold of water from a hoze %f N\"%F\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The force required to hold of water from a hoze -299.460000 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.4 page no : 251\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the force required to hold of water from a hoze\n",
+ "\n",
+ "# Variables \n",
+ "rho=998.2 #Kg/m^3\n",
+ "q=0.01 #m^3/s\n",
+ "v_initial=30. #m/s\n",
+ "v_final=-15. #m/s\n",
+ "\n",
+ "# Calculation \n",
+ "F=q*rho*(v_final-v_initial) #N\n",
+ "\n",
+ "# Result\n",
+ "print \"The force required to hold of water from a hoze %f N\"%F"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The force required to hold of water from a hoze -449.190000 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.5 page no : 252\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the force exerted on the flange when the valve of the nozzle is closed\n",
+ "\n",
+ "# Variables \n",
+ "#Let the gauge pressure be denoted by Pg\n",
+ "Pg=100. #lbf/in^2\n",
+ "A=10. #in^2\n",
+ "\n",
+ "# Calculation \n",
+ "#F_bolts = -F_liq-F_atm\n",
+ "#F_bolts = -(Pg + P_atm)A - (-P_atm.A)\n",
+ "#F_bolts = -Pg.A\n",
+ "F_bolts=-Pg*A\n",
+ "\n",
+ "# Result\n",
+ "print \"The force exerted on the flange when the valve of the nozzle is closed is %d lbf\"%F_bolts"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The force exerted on the flange when the valve of the nozzle is closed is -1000 lbf\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.6 page no : 254\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the force exerted on the flange\n",
+ "\n",
+ "# Variables \n",
+ "dP=100. #lbf/in^2\n",
+ "A_out=1. #in^2\n",
+ "rho=62.3 #lbm/ft^3\n",
+ "ratio_A=0.1 #dimentionless\n",
+ "\n",
+ "# Calculation \n",
+ "#1 ft = 12 in\n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "v_out=(2*dP/rho/(1-ratio_A**2)*32.2*144)**0.5 #ft/s\n",
+ "v_in=12.3 #ft/s\n",
+ "\n",
+ "m=rho*A_out*v_out/144. #lbm/s\n",
+ "F=m*(v_out-v_in)/32.2 #lbf\n",
+ "\n",
+ "# Result\n",
+ "print \"The force exerted on the flange is %f lbf\"%F"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The force exerted on the flange is 181.755634 lbf\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.7 page no : 255\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the support forces in x and y direction in a 90 degree bend tube\n",
+ "\n",
+ "# Variables \n",
+ "p1=200. #KPa\n",
+ "A=0.1 #m^2\n",
+ "m=500. #Kg/s\n",
+ "rho=998.2 #Kg/m^3\n",
+ "q=m/rho #m^3/s\n",
+ "v=q/A #m/s\n",
+ "Vx_initial=v #m/s\n",
+ "Vx_final=0. #m/s\n",
+ "Vy_initial=0. #m/s\n",
+ "Vy_final=-v #m/s\n",
+ "\n",
+ "# Calculation and Result\n",
+ "neg_Fx=m*(Vx_final-Vx_initial)-p1*1000*A #N\n",
+ "Fx = neg_Fx\n",
+ "print \"The support force in the x direction is %f N\"%Fx\n",
+ "neg_Fy=m*(Vy_final-Vy_initial)-p1*1000*A#N\n",
+ "Fy = neg_Fy\n",
+ "print \"The support force in the y direction is %f N\"%Fy"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The support force in the x direction is -22504.508115 N\n",
+ "The support force in the y direction is -22504.508115 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.8 page no : 258\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the thrust on a rocket\n",
+ "\n",
+ "# Variables \n",
+ "m=1000. #Kg/s\n",
+ "v_out=-3000. #m/s its in the negative y direction\n",
+ "v_in=0. #m/s\n",
+ "A=7. #m^2\n",
+ "P=35000. #Pa\n",
+ "\n",
+ "# Calculation \n",
+ "F_thrust=(-m*(v_out-v_in)+P*A)/1000000.0 #MN\n",
+ "\n",
+ "# Result\n",
+ "print \"The thrust on the rocket is %f MN\"%F_thrust"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The thrust on the rocket is 3.245000 MN\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.9 page no : 258\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the specific impulse for a rocket\n",
+ "\n",
+ "# Variables \n",
+ "Vy_exh=-3000. #m/s in negative y direction\n",
+ "\n",
+ "# Calculation \n",
+ "Isp=-Vy_exh/1000.0 #KN.s/Kg\n",
+ "\n",
+ "# Result\n",
+ "print \"The specific impulse on the rocket is %d KN.s/Kg\"%Isp"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The specific impulse on the rocket is 3 KN.s/Kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.10 page no : 259\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the Mass air flow rate required by a jet engine\n",
+ "\n",
+ "# Variables \n",
+ "F_thrust=20000. #lbf\n",
+ "Vx_out=1350.0 #ft/s\n",
+ "Vx_in=0. #ft/s\n",
+ "\n",
+ "# Calculation \n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "m=F_thrust/(Vx_out-Vx_in)*32.2 #lbm/s\n",
+ "\n",
+ "# Result\n",
+ "print \"The mass air flow rate required by a jet engine is %d lbm/s\"%m"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mass air flow rate required by a jet engine is 477 lbm/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.12 page no : 267\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the final velocity of a rocket after launch\n",
+ "import math\n",
+ "\n",
+ "# Variables \n",
+ "Isp=430. #lbf.s/lbm specific impulse\n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "Vrel_out=-Isp*32.2 #ft/s\n",
+ "ratio_m=0.1 #dimentionless (ratio of final mass to initial mass)\n",
+ "\n",
+ "# Calculation \n",
+ "v_final=Vrel_out*math.log(ratio_m) #ft/s\n",
+ "\n",
+ "# Result\n",
+ "print \"The velocity of the rocket after launch is %d ft/s\"%v_final"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of the rocket after launch is 31881 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.15 page no : 278\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the velocity and height of flow in an open channel\n",
+ "\n",
+ "# Variables \n",
+ "v1=4. #ft/s\n",
+ "g=32.2 #ft/s^2\n",
+ "z1=0.0005 #ft\n",
+ "Fr=v1**2/(g*z1) #dimentionless (Fraude number)\n",
+ "ratio_z=-0.5+(0.25+2*Fr)**0.5 #dimentionless\n",
+ "\n",
+ "# Calculation \n",
+ "#ratio_z = z2/z1\n",
+ "z2=ratio_z*z1 #ft\n",
+ "#print \"The height of flow in open channel is %f ft\"%z2\n",
+ "v2=v1/(ratio_z) #ft/s\n",
+ "\n",
+ "# Result\n",
+ "print \"The velocity of flow in open channel is %f ft/s\"%v2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The velocity of flow in open channel is 0.090734 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.16 page no : 280\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the verticle downward velocity of air hitting an aircraft wing\n",
+ "\n",
+ "# Variables \n",
+ "l=15. #m length of wing\n",
+ "b=3. #m thickness of wing\n",
+ "A=l*b #m^2 area of the colliding surface of the wing\n",
+ "rho_air=1.21 #Kg/m^3\n",
+ "Vx=50. #m/s\n",
+ "m=rho_air*A*Vx #Kg/s\n",
+ "Fy=9810. #N Weight of the aircraft\n",
+ "\n",
+ "# Calculation \n",
+ "Vy=Fy/m #m/s\n",
+ "\n",
+ "# Result\n",
+ "print \"The verticle downward velocity of air hitting the aircraft wing is %f m/s\"%Vy"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The verticle downward velocity of air hitting the aircraft wing is 3.603306 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.17 page no : 281\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the ratio of the total weight of the aircraft to the weight of engine\n",
+ "\n",
+ "# Variables \n",
+ "#Let ratio of weight to thrust be denoted by r1\n",
+ "#Let ratio of thrust to the engine weight be denoted by r2\n",
+ "r1=10. #dimentionless\n",
+ "r2=2. #dimentionless\n",
+ "\n",
+ "# Calculation \n",
+ "#weight/engine wt = (weight/thrust)*(thrust/engine wt)\n",
+ "#let ratio of total wt to engine wt be denoted by r3\n",
+ "r3=r1*r2 #dimentionless\n",
+ "\n",
+ "# Result\n",
+ "print \"The ratio of the total weight of the aircraft to the weight of engine is %d\"%r3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ratio of the total weight of the aircraft to the weight of engine is 20\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 7.18 page no : 284\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the torque exerted on the rotor in a centrifugal pump\n",
+ "import math\n",
+ "\n",
+ "# Variables \n",
+ "q=100. #gal/min\n",
+ "rho=8.33 #lbm/gal\n",
+ "m=rho*q #lbm/min\n",
+ "f=1800. #rev/min frequency of impeller\n",
+ "omega=2*(math.pi)*f #rad/min\n",
+ "r_in=1/12.0 #ft\n",
+ "r_out=6/12.0 #ft\n",
+ "\n",
+ "# Calculation \n",
+ "#1 min = 60 sec\n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "tou=m*omega*(r_out**2-r_in**2)/32.2/3600. #lbf.ft\n",
+ "\n",
+ "# Result\n",
+ "print \"The torque exerted on the rotor is %f lbf.ft\"%tou"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The torque exerted on the rotor is 19.753523 lbf.ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch8.ipynb b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch8.ipynb
new file mode 100644
index 00000000..8a647447
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/ch8.ipynb
@@ -0,0 +1,566 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8 : One dimentional high velocity gas flow"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.1 page no : 297\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the speed of sound in water amd steel at 20 C\n",
+ " \n",
+ "# Variable \n",
+ "#for steel\n",
+ "K_steel=1.94*10**11 #Pa\n",
+ "rho_steel=7800. #Kg.m^3\n",
+ "\n",
+ "# Calculation and Result\n",
+ "c_steel=(K_steel/rho_steel)**0.5/1000 # Km/s\n",
+ "print \"the speed of sound in steel at 20 C is %f km/s\"%c_steel\n",
+ "\n",
+ "#for water\n",
+ "K_water=3.14*10**5 #lbf/in^2\n",
+ "rho_water=62.3 #lbm/ft^3\n",
+ "\n",
+ "#1 ft =12 in\n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "c_water=(K_water/rho_water*144*32.2)**0.5 #ft/s\n",
+ "print \"the speed of sound in water at 20 C is %f ft/s\"%c_water"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the speed of sound in steel at 20 C is 4.987163 km/s\n",
+ "the speed of sound in water at 20 C is 4834.259759 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Example 8.2 page no : 300\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the speed of sound in air at 20 C\n",
+ "\n",
+ "# Variable \n",
+ "R=10.73 #lbf.ft^3/in^2/lbmol/R\n",
+ "#1 ft = 12 in\n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "R1=(R*144*32.2)**0.5 #ft/s*(lbm/lbmol/R)^0.5\n",
+ "k=1.4 #dimentionless\n",
+ "T=528. #R (Rankine temperature scale)\n",
+ "M=29. #lbm/lbmol\n",
+ "\n",
+ "# Calculation \n",
+ "c=R1*(k*T/M)**0.5 #ft/s\n",
+ "\n",
+ "# Result\n",
+ "print \"the speed of sound in air at 20 C is %d ft/s\"%c"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the speed of sound in air at 20 C is 1126 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.3 page no : 302\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the temperature of the gas where is mach number is 2\n",
+ "\n",
+ "# Variable \n",
+ "Ma=2. #dimentionless (Mach number)\n",
+ "k=1.4 #dimentionless\n",
+ "T1=528. #R (Rankine temperature scale)\n",
+ "\n",
+ "# Calculation \n",
+ "T2=T1/((Ma**2*(k-1)/2)+1) #R (Rankine temperature scale)\n",
+ "\n",
+ "# Result\n",
+ "print \"The temperature of the gas when mach number is 2 is %d R\"%T2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature of the gas when mach number is 2 is 293 R\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.4 page no : 302\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the speed of sound in air at 20 C\n",
+ "\n",
+ "# Variable \n",
+ "R=10.73 #lbf.ft^3/(in^2.lbmol.R)\n",
+ "\n",
+ "#1 ft = 12 in\n",
+ "##1 lbf.s^2 = 32.2 lbm.ft\n",
+ "R_root=(R*144*32.2)**0.5 #ft/s*(lbm/lbmol.R)^0.5\n",
+ "Ma=2 #dimentionless (Mach number)\n",
+ "k=1.4 #dimentionless\n",
+ "T=298. #R (Rankine temperature scale)\n",
+ "M=29. #lbm/lbmol\n",
+ "\n",
+ "# Calculation \n",
+ "c=R_root*(k*T/M)**0.5 #ft/s\n",
+ "v=c*Ma #ft/s\n",
+ "\n",
+ "# Result\n",
+ "print \"%f\"%c\n",
+ "print \"The speed of sound in air at 20 C is %f ft/s\"%v"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "846.023046\n",
+ "The speed of sound in air at 20 C is 1692.046093 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.5 page no : 303\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the pressure and density at a pt where temperature ratio is 1.8 and initial pressure and density are given\n",
+ "\n",
+ "# Variable \n",
+ "ratio_T=1.8 #dimentionless\n",
+ "P1=2. #bar\n",
+ "k=1.4 #dimentionless\n",
+ "\n",
+ "# Calculation \n",
+ "P2=P1/ratio_T**(k/(k-1)) #bar\n",
+ "rho1=2.39 #Kg/m^3\n",
+ "rho2=rho1/ratio_T**(1/(k-1)) #Kg/m^3\n",
+ "\n",
+ "# Result\n",
+ "print \"The pressure where temperature ratio is 1.8 and initial pressure is 2 bar is %f bar\"%P2\n",
+ "print \"The density where temperature ratio is 1.8 and initial density is 2.39 Kg/m^3 is %f Kg/m^3\"%rho2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The pressure where temperature ratio is 1.8 and initial pressure is 2 bar is 0.255609 bar\n",
+ "The density where temperature ratio is 1.8 and initial density is 2.39 Kg/m^3 is 0.549815 Kg/m^3\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.6 page no : 306\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the cross sectional area, pressure, temperature and mach number at a pt in duct where air velocity is 1400ft/s\n",
+ "\n",
+ "# Variable \n",
+ "P1=30. #psia\n",
+ "T1=660. #R (Rankine temperature scale)\n",
+ "m=10. #lbm/s mass flow rate\n",
+ "v1=1400. #ft/s\n",
+ "R=4.98*10**4 #(ft^2/s^2)*(lbm/lbmol.R)^0.5\n",
+ "k=1.4 #dimentionless\n",
+ "M=29. #lbm/lbmol\n",
+ "\n",
+ "# Calculation and Result\n",
+ "T2=T1-v1**2*((k-1)/k)*M/2/R # R (Rankine temperature scale)\n",
+ "print \"The temperature at the pt in the duct where air velocity is 1400 ft/s is %f R\"%T2\n",
+ "\n",
+ "c=223*(k*T2/M)**0.5 #ft/s\n",
+ "Ma=v1/c #dimentionless (Mach number)\n",
+ "print \"The mach number at the pt in the duct where air velocity is 1400 ft/s is %f\"%Ma\n",
+ "\n",
+ "P2=P1/(T1/T2)**(k/(k-1)) #psia\n",
+ "print \"The pressure at the pt in the duct where air velocity is 1400 ft/s is %f psia\"%P2\n",
+ "\n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "A0=m/(P1*(M*k)**0.5*32.2/223/(T1)**0.5/((k-1)/2+1)**((k+1)/2/(k-1))) #in^2\n",
+ "ratio_A=((Ma**2*(k-1)/2+1)/((k-1)/2+1))**((k+1)/2/(k-1))/Ma #dimentionless\n",
+ "A=ratio_A*A0 #in^2\n",
+ "print \"The cross sectional at the pt in the duct where air velocity is 1400 ft/s is %f in^2\"%A"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature at the pt in the duct where air velocity is 1400 ft/s is 496.947791 R\n",
+ "The mach number at the pt in the duct where air velocity is 1400 ft/s is 1.281748\n",
+ "The pressure at the pt in the duct where air velocity is 1400 ft/s is 11.112331 psia\n",
+ "The cross sectional at the pt in the duct where air velocity is 1400 ft/s is 17.029147 in^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.7 page no : 307\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the cross sectional area, pressure, temperature and mach number at a pt in duct where air velocity is 1400ft/s\n",
+ "\n",
+ "# Variable \n",
+ "P1=30. #psia\n",
+ "T1=660. #R (Rankine temperature scale)\n",
+ "ratio_T=0.83333 #dimentionless\n",
+ "m=10. #lbm/s mass flow rate\n",
+ "v1=1400. #ft/s\n",
+ "R=4.98*10**4 #(ft^2/s^2)*(lbm/lbmol.R)^0.5\n",
+ "k=1.4 #dimentionless\n",
+ "M=29. #lbm/lbmol\n",
+ "\n",
+ "# Calculation and Result\n",
+ "T2=T1*ratio_T #R (Rankine temperature scale)\n",
+ "print \"The temperature at the pt in the duct where air velocity is 1400 ft/s is %f R\"%T2\n",
+ "\n",
+ "c=223*(k*T2/M)**0.5 #ft/s\n",
+ "Ma=v1/c #dimentionless (Mach number)\n",
+ "print \"The mach number at the pt in the duct where air velocity is 1400 ft/s is %f\"%Ma\n",
+ "\n",
+ "ratio_t=0.7528 #dimentionless\n",
+ "ratio_P=0.3701 #dimentionless\n",
+ "ratio_A=1.0587 #dimentionless\n",
+ "T=T1*ratio_t #R (Rankine temperature scale)\n",
+ "print \"T=%f\"%T\n",
+ "P=P1*ratio_P#psia\n",
+ "print \"P=%f\"%P"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature at the pt in the duct where air velocity is 1400 ft/s is 549.997800 R\n",
+ "The mach number at the pt in the duct where air velocity is 1400 ft/s is 1.218366\n",
+ "T=496.848000\n",
+ "P=11.103000\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.8 page no : 308\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the cross sectional area, pressure, temperature and mach number at a pt in duct where air velocity is 1400ft/s\n",
+ "\n",
+ "# Variable \n",
+ "P1=30. #psia\n",
+ "T1=660. #R (Rankine temperature scale)\n",
+ "m=10. #lbm/s mass flow rate\n",
+ "v1=4000. #ft/s\n",
+ "R=4.98*10**4 #(ft^2/s^2)*(lbm/lbmol.R)^0.5\n",
+ "k=1.4 #dimentionless\n",
+ "M=29. #lbm/lbmol\n",
+ "\n",
+ "# Calculation and Result\n",
+ "T2=T1-v1**2*((k-1)/k)*M/2./R #R (Rankine temperature scale)\n",
+ "print \"The temperature at the pt in the duct where air velocity is 1400 ft/s is %f R\"%T2\n",
+ "T2 = -T2\n",
+ "c=223.*(k*T2/M)**0.5 #ft/s\n",
+ "Ma=v1/c #dimentionless (Mach number)\n",
+ "P2=P1/(T1/T2)**(k/(k-1)) #psia\n",
+ "\n",
+ "#1 lbf.s^2 = 32.2 lbm.ft\n",
+ "A0=m/(P1*(M*k)**0.5*32.2/223/(T1)**0.5/((k-1)/2+1)**((k+1)/2/(k-1))) #in^2\n",
+ "ratio_A=((Ma**2*(k-1)/2+1)/((k-1)/2+1))**((k+1)/2/(k-1))/Ma #dimentionless\n",
+ "A=ratio_A*A0 #in^2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature at the pt in the duct where air velocity is 1400 ft/s is -671.038439 R\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.9 page no : 309\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the temperatures at different pts in a duct with different mach numbers\n",
+ "\n",
+ "# Variable \n",
+ "#for mach number=0.5\n",
+ "ratio_T=0.9524 #dimentionless\n",
+ "T1=293.15 #K\n",
+ "\n",
+ "# Calculation \n",
+ "T2=T1/ratio_T #K\n",
+ "\n",
+ "# Result\n",
+ "print \"The temperature at the pt in the duct where mach number is 0.5 is %f K\"%T2\n",
+ "#for mach number 2\n",
+ "ratio_t=0.5556 #dimentionless\n",
+ "t2=293.15 #K\n",
+ "t1=t2*ratio_t #K\n",
+ "print \"The temperature initially at the start of the nozzle is %f K\"%t1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature at the pt in the duct where mach number is 0.5 is 307.801344 K\n",
+ "The temperature initially at the start of the nozzle is 162.874140 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.12 page no : 324\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the reservoir temperature and the pressure of air around the aircraft\n",
+ "\n",
+ "# Variable \n",
+ "gama=1.4 #dimentionless\n",
+ "Ma=2. #dimentionless (Mach number)\n",
+ "To=273.15 #K\n",
+ "\n",
+ "# Calculation \n",
+ "Tr=To*(Ma**2*(gama-1)/2.+1) # K\n",
+ "P1=50. #KPa\n",
+ "Pr=P1*(Tr/To)**(gama*5/2) #KPa\n",
+ "\n",
+ "# Result\n",
+ "print \"the reservoir temperature of air around the aircraft is %f K\"%Tr\n",
+ "print \"The pressure of air around the aircraft is %f KPa\"%Pr"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the reservoir temperature of air around the aircraft is 491.670000 K\n",
+ "The pressure of air around the aircraft is 391.222453 KPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.13 page no : 325\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate temperature and the velocity of air inside the shock wave\n",
+ "\n",
+ "# Variable \n",
+ "#Let subscript y denote air inside the shock wave and x denote the air outside the shock wave\n",
+ "ratio_T=1.2309 #dimentionless\n",
+ "Tx=528. #R (Rankine temperature scale)\n",
+ "My=0.7558 #dimentionless\n",
+ "cy=1249. #ft/s\n",
+ "\n",
+ "#Calculations\n",
+ "Ty=ratio_T*Tx #R (Rankine temperature scale)\n",
+ "Vy=My*cy #ft/s\n",
+ "\n",
+ "#Results\n",
+ "print \"temperature of air inside the shock wave is %f R\"%Ty\n",
+ "print \"the velocity of air inside the shock wave is %f ft/s\"%Vy"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "temperature of air inside the shock wave is 649.915200 R\n",
+ "the velocity of air inside the shock wave is 943.994200 ft/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 8.14 page no : 328\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the ratio of area of throat to area of a certain point\n",
+ "\n",
+ "# Variable \n",
+ "A_throat=1. #in^2\n",
+ "A_exit=1.5 #in^2\n",
+ "ratio_A=2.2385 #dimentionless\n",
+ "\n",
+ "# Calculation \n",
+ "ratio_A1=ratio_A*(A_throat/A_exit) #dimentionless\n",
+ "\n",
+ "# Result\n",
+ "print \"the ratio of area of throat to area of a certain point is %f\"%ratio_A1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the ratio of area of throat to area of a certain point is 1.492333\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/screenshots/1.png b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/screenshots/1.png
new file mode 100644
index 00000000..145befa0
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/screenshots/1.png
Binary files differ
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/screenshots/2.png b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/screenshots/2.png
new file mode 100644
index 00000000..bca6429c
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/screenshots/2.png
Binary files differ
diff --git a/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/screenshots/3.png b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/screenshots/3.png
new file mode 100644
index 00000000..b5a9a280
--- /dev/null
+++ b/Fluid_Mechanics_For_Chemical_Engineers_by_N._D._Nevers/screenshots/3.png
Binary files differ
diff --git a/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter2_3.ipynb b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter2_3.ipynb
new file mode 100644
index 00000000..2bd26cb3
--- /dev/null
+++ b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter2_3.ipynb
@@ -0,0 +1,233 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2: Conduction and Breakdown in Gases"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1: pg 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the breakdown strength of air for 0.1mm air gap is (kV/cm.) = 43.45\n",
+ "\n",
+ "the breakdown strength of air for 20 cm air gap is (kV/cm.) = 25.58\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 2.1\n",
+ "#calculation of breakdown strength of air\n",
+ "\n",
+ "#given data\n",
+ "d1=0.1#length(in cm) of the gap\n",
+ "d2=20#length(in cm) of the gap\n",
+ "\n",
+ "#calculation\n",
+ "#from equation of breakdown strength\n",
+ "E1=24.22+(6.08/(d1**(1./2)))#for gap d1\n",
+ "E2=24.22+(6.08/(d2**(1./2)))#for gap d2\n",
+ "#results\n",
+ "print 'the breakdown strength of air for 0.1mm air gap is (kV/cm.) = ',round(E1,2)\n",
+ "print '\\nthe breakdown strength of air for 20 cm air gap is (kV/cm.) = ',round(E2,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2: pg 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Townsend primary ioniztion coefficient is (/cm torr) = 7.675\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 2.2\n",
+ "#calculation of Townsend primary ionization coefficient\n",
+ "from math import log\n",
+ "#given data\n",
+ "d1=0.4#gap distance(in cm)\n",
+ "d2=0.1#gap distance(in cm)\n",
+ "I1=5.5*10**-8#value of current(in A)\n",
+ "I2=5.5*10**-9#value of current(in A)\n",
+ "\n",
+ "#calculation\n",
+ "#from equation of current at anode I=I0*exp(alpha*d)\n",
+ "alpha=(log(I1/I2))*(1/(d1-d2))\n",
+ "#results\n",
+ "print 'Townsend primary ioniztion coefficient is (/cm torr) = ',round(alpha,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3: pg 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the value of Townsend secondary ionization coefficient is 9.994e-04\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 2.3\n",
+ "#calculation of Townsend secondary ionization coefficient\n",
+ "from math import exp\n",
+ "#given data\n",
+ "d=0.9#gap distance(in cm)\n",
+ "alpha=7.676#value of alpha\n",
+ "\n",
+ "#calculation\n",
+ "#from condition of breakdown.....gama*exp(alpha*d)=1\n",
+ "gama=1/(exp(d*alpha))\n",
+ "#results\n",
+ "print '%s %.3e' %('the value of Townsend secondary ionization coefficient is ',gama)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4: pg 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the value of breakdown voltage of the spark gap is (V) = 5626.0\n",
+ "The answer is a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 2.4\n",
+ "#calculation of breakdown voltage of a spark gap\n",
+ "from math import log\n",
+ "#given data\n",
+ "A=15.#value of A(in per cm)\n",
+ "B=360.#value of B(in per cm)\n",
+ "d=0.1#spark gap(in cm)\n",
+ "gama=1.5*10**-4#value of gama\n",
+ "p=760.#value of pressure of gas(in torr)\n",
+ "\n",
+ "#calculation\n",
+ "#from equation of breakdown voltage\n",
+ "V=(B*p*d)/(log((A*p*d)/(log(1+(1/gama)))))\n",
+ "\n",
+ "#results\n",
+ "print 'the value of breakdown voltage of the spark gap is (V) = ',round(V)\n",
+ "print 'The answer is a bit different due error in textbook'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5: pg 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the value of minimum spark over voltage is (V) = 481.0\n",
+ "The answer is a bit different due error in textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 2.5\n",
+ "#calculation of minimum spark over voltage\n",
+ "from math import log\n",
+ "#given data\n",
+ "A=15.#value of A(in per cm)\n",
+ "B=360.#value of B(in per cm)\n",
+ "gama=10**-4#value of gama\n",
+ "e=2.178#value of constant\n",
+ "\n",
+ "#calculation\n",
+ "Vbmin=(B*e/A)*(log(1+(1/gama)))\n",
+ "\n",
+ "#results\n",
+ "print 'the value of minimum spark over voltage is (V) = ',round(Vbmin)\n",
+ "print 'The answer is a bit different due error in textbook'"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter3_3.ipynb b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter3_3.ipynb
new file mode 100644
index 00000000..c7746ecf
--- /dev/null
+++ b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter3_3.ipynb
@@ -0,0 +1,97 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 3: Conduction and Breakdown in Liquid Dielectrics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1: pg 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAEPCAYAAAC3NDh4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmcnfP5//HXG19KEaG2itiX2Km1wXfUT2qrWNrYai8q\ndqoSqhmqllRtlWi/qNoltIRWI1KGJkiQhGwiSCwhkUYtQfbr98fnHo6YMzmznG3m/Xw8ziP3uc99\n7nPNGHPNZ7s+igjMzMwaslS5AzAzs8rlJGFmZnk5SZiZWV5OEmZmlpeThJmZ5eUkYWZmeZUkSUha\nStJoSY9kz/tIelfSqOyxb861vSVNljRRUrdSxGdmZg1bpkSfczYwHlg559y1EXFt7kWSugA9gC5A\nJ2CopE3CiznMzMqi6C0JSZ2A/YFbF3+pgcu7A/dHxIKImApMBnYuboRmZpZPKbqbrgMuABZvDZwh\naYykWyV1yM6tA7yTc8207JyZmZVBUZOEpAOAGRExhq+3HPoDG0bEdsB04PfFjMPMzJqn2GMSXYGD\nJO0PLA+sJOnOiDg255pbgEez42nAujmvdcrOfY0kj1GYmTVDRDTU1Z9XUVsSEXFRRHSOiA2BI4An\nI+JYSWvlXHYoMC47fgQ4QtKykjYANgZG5rm3H6306NOnT9ljaEsPfz/9vazUR3OUanbT4vpK2g5Y\nBEwFTgWIiAmSBgITgPlAz2juV2ZmZi1WsiQREU8DT2fHxzZy3ZXAlaWKy8zM8vOKa6OmpqbcIbQp\n/n62Hn8vy0/V2Jsjyb1QZmZNJImopIFrMzOrbk4SZmaWl5OEmZnl5SRhZmZ5OUmYmVleThJmZpaX\nk4SZmeXlJGFmZnk5SZiZWV5OEmZmlpeThJmZ5eUkYWbWxr3xBhx8cPPe6yRhZtZGzZ4NvXvDLrvA\nrrs27x5OEmZmbcyiRXDXXbD55jBtGrzyCvTq1bx7lWTTIUlLAS8C70bEQZI6AgOA9Ug70/WIiI+z\na3sDJwILgLMjYkgpYjQzawteeAHOOgsWLIAHHoDddmvZ/UrVkjibtCVpvV7A0IjYDHgS6A0gaQug\nB9AF2A/oL6lJtc/NzNqj6dPhxBOhe3c45RQYMaLlCQJKkCQkdQL2B27NOd0duCM7vgOoH1I5CLg/\nIhZExFRgMrBzsWM0M6tW8+bBNdfAVlvBaqvBq6/CCSfAUq30270U3U3XARcAHXLOrRkRMwAiYrqk\nNbLz6wDP5Vw3LTtnZmaLeewxOPdc2HhjePZZ2HTT1v+MoiYJSQcAMyJijKSaRi5t8l6ktbW1Xx7X\n1NR4L1wzazdeey0lh8mT4frrYf/9G76urq6Ourq6Fn1WUfe4lnQF8FPSIPTywErAQ8COQE1EzJC0\nFvBURHSR1AuIiLg6e/9goE9EjFjsvt7j2szanU8+gd/8Bm6/Pc1WOussWHbZwt9fcXtcR8RFEdE5\nIjYEjgCejIhjgEeB47PLjgMGZcePAEdIWlbSBsDGwMhixmhmVukWLUqJYfPNYdYsGDcOfvGLpiWI\n5irJFNgGXAUMlHQi8BZpRhMRMUHSQNJMqPlATzcZzKw9GzECzjwTll4aBg2CnXYq7ecXtbupWNzd\nZGZt3fvvpy6loUPhqqvg6KNbPmOp4rqbzMysaebOhb59YeutYe2105TWY45pvSmtTVWu7iYzM1vM\nP/4B55yTxh6eew422aTcETlJmJmV3aRJaUrrG2/AjTfCfvuVO6KvuLvJzKxMPvkELrgAunaFvfeG\nsWMrK0GAk4SZWcktWgR/+cvXp7Sef35pprQ2lbubzMxKaMSItAhOgocfhp0rvDqdWxJmZiUwfToc\nfzwccgicfnqqtVTpCQKcJMzMiiq3Suuaa6ZB6mOPLd+U1qZyd5OZWZH8859pSmsxq7QWm5OEmVkr\ne/31NKV10iS47jo44IByR9R8VdLgMTOrfJ9+mkpp7Lor7LlnmrVUzQkCnCTMzFosAu6+O01pff/9\ntN7hggsqc0prU7m7ycysBV56KU1pnTsXHnywdfaVriRuSZiZNcMHH8DJJ8OBB8JJJ8HIkW0vQYCT\nhJlZk8yfDzfcAFtuCSutBBMnwoknVs+U1qZyd5OZWYGGDoWzz4Z11oGnn4Yttih3RMVX1NwnaTlJ\nIySNljRWUp/sfB9J70oalT32zXlPb0mTJU2U1K2Y8ZmZFWLKFDj0UDjlFLjiCnj88faRIKDILYmI\nmCtpr4j4XNLSwHBJ/8xevjYirs29XlIX0lamXYBOwFBJm3gbOjMrh88/T7vC9esH550H994L3/pW\nuaMqraL3okXE59nhcqSkVP8Lv6Et9LoD90fEgoiYCkwGqqC6iZm1JRHwwAPQpQtMngxjxsDFF7e/\nBAElSBKSlpI0GpgOPBERL2QvnSFpjKRbJXXIzq0DvJPz9mnZOTOzkhg7Fn7wA7j8crjrLrjvPlh3\n3XJHVT5FH7iOiEXA9pJWBh6StAXQH7gsIkLS5cDvgZ815b61tbVfHtfU1FBTU9NqMZtZ+/Phh9Cn\nDwwYALW1afxhmSqf2lNXV0ddXV2L7qFSdvdLugT4LHcsQtJ6wKMRsY2kXkBExNXZa4OBPhExYrH7\neJjCzFrFwoVw221wySVpcPryy2G11codVXFIIiIa6urPq9izm75T35UkaXlgH+BVSWvlXHYoMC47\nfgQ4QtKykjYANgZGFjNGM2u/hg+HnXZK3UqDB8PNN7fdBNFcxW5MrQ3cIWkpUkIaEBGPSbpT0nbA\nImAqcCpAREyQNBCYAMwHerrJYGat7b334MIL4amn4He/gyOOSDvF2TeVtLuptbi7ycyaY+5cuP76\nlBhOOQUuughWXLHcUZVOc7qbGm1JSNoN+CmwB6lV8AWpa+gfwN0R8XEzYzUzK6nHHksbAG22GTz/\nfNoIyJYsb0siW/T2HjAIeBH4APgWsCmwF/Aj0oK4R0oT6tdic0vCzAry+uspObz2WmpF7L9/uSMq\nn+a0JBpLEt+JiP8s4QOXeE0xOEmY2ZLMng2//S3ccgv88pcpUbSF/R1aorVnN10qqWtjby5HgjAz\na0xEKp+x+ebw7rvwyispSbT3BNFcjY1JvAZcI2ltYCBwX0SMLk1YZmZN9/LLcOaZaRvRAQOga6N/\n5loh8rYkIuKGiNgN+F9gFvBnSa9mFVw3LVmEZmZL8OGHcPrp0K0bHH00vPiiE0RrWeJiuoh4KyKu\njojtgSOBg4GJRY/MzGwJFi6EP/4xFeKDtAHQqafC0kuXN662ZImL6SQtA+wHHAHsDdQBtUWNysxs\nCYYPT11LK64IQ4bAttuWO6K2qbHZTfuQWg4HACOA+4FBEfFZ6cJrmGc3mbVfXi3dfK09u6k38Cyw\neUQcFBH3VkKCMLP2ad486NsXttkGOnWCV1+FI490gii2xgaufxARt5IK8H2NpKuKGpWZWY7Bg2Hr\nrdO+0s89B1de2b7KaZRTIQX+DpM0JyLuAZDUj7Ty2sysqN54I20bOmFCWi19wAHljqj9KaRU+GHA\n8ZKOlHQHsCAiTipyXGbWjn3+edrfYeedYdddYdw4J4hyyduSkLRqztOfAQ8Dw0krsVeNiA+LHZyZ\ntS8R8OCD8ItfwPe/nxbHdepU7qjat8ZmN00BAlDOv/UiIjYsfngN8+wms7Zn/Hg46yyYORNuvBG8\nI3Hra9UCf5XMScKs7fj447Sn9N13w69/DaedVv17S1eqVp0CK2n3JXzYypK2WsI1y0kaIWm0pLGS\n+mTnO0oaImmSpMfrtzjNXustabKkiZK6NeWLMbPqsWgR3H57KsQ3e3YanD7zTCeIStNYd9N1wC7A\nYOAlYCZpVtPGpP0k1gPOj4gXGv0AaYWI+FzS0qQxjbNIg+GzIqKvpAuBjhHRS9IWwD3ATkAnYCiw\nyeLNBrckzKrbiy/CGWekMYibbkr7TFvxterOdBFxbjZ4fRjwE77amW4i8KeIGFbIB0TE59nhctnn\nBdCdVDgQ4A5SqY9ewEHA/RGxAJgqaTKwM2nFt5lVuZkz05ahf/87XHEFHHccLFXIHEsrm0YbdtkM\npluyR7NIWorUEtkI6BcRL0haMyJmZJ8xXdIa2eXrAM/lvH1ads7MqtiCBakQ32WXpSqtEyfCKquU\nOyorRNF7/yJiEbC9pJWBhyRtSWpNfO2ypt63trb2y+OamhpqPBXCrCI980waa1htNXjySdiq0ZFM\na011dXXU1dW16B4lnd0k6RLgc9K6i5qImCFpLeCpiOgiqRdpeu3V2fWDgT4RMWKx+3hMwqzCTZsG\nF1wAw4bBNdfAT37iOkvl1toF/lpM0nfqZy5JWh7YhzSm8QhwfHbZccCg7PgR4AhJy0ragDRIPrKY\nMZpZ65o3D66+OhXi23DD1LXUo4cTRLUqZD+JFYDzgc4RcbKkTYDNIuLvBdx/beCObFxiKWBARDwm\n6XlgoKQTgbeAHgARMUHSQGACMB/o6SaDWfV4/PG0IG7TTWHECNh443JHZC21xO4mSQNIA8/HRsRW\nWdJ4NiK2K0WAeWJy7jCrIFOmpEJ8Y8emQnwHHljuiKwhxepu2igi+pL+sq+f0uqGo5nxxRdw6aVp\nncNOO6VCfE4QbUshs5vmZeMJASBpI2BuUaMys4oWAYMGwbnnpuQwahR07lzuqKwYCkkSfUirrteV\ndA/Qla8Gnc2snZk0Cc4+G95+G269Ffbeu9wRWTEVNAVW0mrArqRupucj4j/FDmwJ8XhMwqzEZs+G\nyy9PieGii9Lah//5n3JHZU3RqmU5cm66Q3b4fvZv52xa61tZ+Qwza8MiYMCAtObhBz9Ig9Nrr13u\nqKxUCulu6g/sALxCaklsBYwHOkg6LSKGFDE+MyujsWNTi+Hjj+H++6Fr13JHZKVWyOym94DtI2LH\niPgesD3wJmlhXN9iBmdm5fHRR3DOOWm84fDDU9VWJ4j2qZAksWlEjK9/EhETgM0j4s3ihWVm5VC/\nx0OXLmmf6QkT0iZASy9d7sisXArpbhov6Wbg/uz54cAEScuRrZ0ws+o3ahScfnoag3j0Udhxx3JH\nZJWgkBXXywM9gfqd6oaTxinmACtExOyiRthwTJ7dZNZKPvwQLr4YHnoo7fFw/PHe46Gt8h7XZlaw\nhQvhttvgkktSAb7LLoOOHcsdlRVTsabAbgJcCWxB2r4UgIjYsMkRmllFGDEibR+63HKpKN92ZavE\nZpWukEbl7cDNwALS3tZ3AncXMygzK46ZM+Gkk+CQQ1K11n//2wnCGldIklg+Iv5F6pp6KyJqgQOK\nG5aZtaYFC6BfP9hyS+jQAV59FY45xns82JIVMrtpbrYfxGRJZ5D2nV6xuGGZWWsZPjzNWurYEZ56\nKiUKs0IV0pI4G1gBOAv4HvBT4NhCbi6pk6QnJY2XNFbSmdn5PpLelTQqe+yb857ekiZLmiipW9O/\nJDMDeP99OPZYOOII6N077S/tBGFNVUiSWD8iZkfEuxFxQkQcBhRaFHgBcF5EbAnsBpwhafPstWsj\nYofsMRhAUhfSLnVdgP2A/pIbxGZNMX8+XHcdbL11qrE0cWJaNe3/k6w5CkkSvQs89w0RMT0ixmTH\ns0n7W6+TvdzQj2x34P6IWBARU4HJwM6FfJaZwdNPw/bbwz//CcOGpb2mV3TnsLVA3jEJSfsB+wPr\nSLox56WVSS2EJpG0PrAdMIK0MO8MSccALwLnR8THpATyXM7bpvFVUjGzPN57D37xizT+cO21cOih\nbjlY62isJfEeaW/rOdm/9Y9HgB825UMkrQg8CJydtSj6Axtm+2RPB37f9NDNbP58uOYa2GYb2GCD\nVGvpsMOcIKz15G1JRMTLwMuS7m7JvhGSliEliLsiYlB275k5l9wCPJodTwPWzXmtU3buG2pra788\nrqmpoaamprkhmlWlJ59MC+I6d4Znn4VNNy13RFZp6urqqKura9E98pblkDSWbF/rhkTENgV9gHQn\n8J+IOC/n3FoRMT07PhfYKSKOkrQFcA+wC6mb6Qlgk8VrcLgsh7Vn776bupaefz4NUB98sFsOVpjW\nLstxYAvjQVJX4GhgrKTRpKRzEXCUpO2ARcBU4FRIZcglDQQmkCrM9nQ2MEvmzYPrr4e+fVP57j//\nGVZYodxRWVtX6B7XawI7ZU9HRsQHRY1qyfE4d1i7MnRo2iFuww3hhhtg443LHZFVo6JUgZXUA/gd\nUEeatroHcEFEPNjMOFvMScLai3fegfPOSzvD3XAD/OhH7lqy5mtOkihkncTFpDGD4yLiWNK6hUua\nE6CZFWbuXLjyylR8b4st0qylgw5ygrDSK6R201KLdS/NorDkYmbNMGRI6lradFMYORI22qjcEVl7\nVkiSGCzpceC+7PnhwGPFC8msfXr77dS1NHp06lo6sMVTR8xaboktgoi4APgTsE32+L+IuLDYgZm1\nF/PmwVVXwQ47pEVx48c7QVjlKGRnuvOAARHxtxLEY9auPPHE17uWNvR+j1ZhCuluWgkYIulDYADw\nQETMKG5YZm1b/ayll176ataSWSUqpLvp0qzU9+nA2sDTkoYWPTKzNmjevFSZdfvt094O48c7QVhl\nK6QlUe8DUjG+WcAaxQnHrO3617/SDnEbbQQjRnjWklWHQsYkepI2AlodeAA4OSImFDsws7bi3Xfh\n/PPTmIMXxFm1KWS9w7rAORGxZUTUOkGYFWbePPjd79KCuM0394I4q05LbElEREG70JnZV+rLeK+/\nfqrW6lpLVq2aMiZhZkswbVoq4/3cc6lryS0Hq3Yur2HWCubPh9//HrbdNrUaJkyA7t2dIKz6uSVh\n1kJPP51mLXXqlFoQm2xS7ojMWk8hs5sOBa4mTXtV9oiIWLnIsZlVtOnT4YILUpK47jo49FC3HKzt\nKaS7qS9wUER0iIiVI2KlQhOEpE6SnpQ0XtJYSWdl5ztKGiJpkqTHJXXIeU9vSZMlTZTUrXlfllnx\nLFgAN94IW28N66wDEyfCYYc5QVjbVMimQ8Mjomuzbi6tBawVEWMkrQi8BHQHTgBmRURfSRcCHSOi\nV84e1zsBnYCheI9rqyDPPgs9e8Kqq0K/ftClS7kjMitca+9xXe9FSQOAh4G59ScLKfgXEdNJq7SJ\niNmSJpJ++XcH/je77A7Srne9gIOA+yNiATBV0mTSJkcjCv2CzIrhgw+gV6+018M118Dhh7vlYO1D\nId1NKwOfA92AH2WPJhcylrQ+sB3wPLBmfZHALJHUl/lYB3gn523TsnNmZbFwIdx8M2y1FXTsmGYt\nHXGEE4S1H4W0JE6LiDkt+ZCsq+lB4OysRbF4X5H7jqzivPBC6lpafvlUd2nrrcsdkVnpFZIkxkma\nAfw7ewyLiI8L/QBJy5ASxF0RMSg7PUPSmhExIxu3qN8edRqpDEi9Ttm5b6itrf3yuKamhpqamkJD\nMmvUrFlw0UXwyCPQty/89KduOVh1qquro66urkX3WOLANYCkzsAeQFdgf+CjiNiuoA+Q7gT+ExHn\n5Zy7GvgwIq7OM3C9C6mb6Qk8cG0lsmgR/PnPcPHF0KMH/OY3sMoq5Y7KrPUUZeBaUidSctgD2BYY\nDwwrMKCuwNHAWEmjSd1KF5HWXQyUdCLwFqnKLBExQdJAYAIwH+jpbGClMHp06loCGDw47fdgZoVN\ngV0EvABckdNdVFZuSVhr+fhjuOQSGDAArrgCTjgBlnKxGmujmtOSKOR/h+2BO4GjJD0n6U5JJzUr\nQrMKEQH33JPWOcyZk2YtnXSSE4TZ4godk1gR2J3U5fRTgIhYr7ihNRqPWxLWbBMnpq6ljz+G/v1h\n113LHZFZaRSlJSHpReA54BBgIrBnOROEWXN99llaELfnnqnO0siRThBmS1LIFNj9ImJm0SMxK5II\nePhhOOcc2GMPGDsW1lqr3FGZVYdCksQ8SdcCe2bPnwYua8paCbNyefNNOPNMmDIF/vIX2Guvckdk\nVl0KGab7M/ApaZpqD+AT4PZiBmXWUnPmwGWXwc47p+6lMWOcIMyao5CWxEYRcVjO80sljSlWQGYt\nNXhwaj1svTWMGgWdO5c7IrPqVUiS+ELS7hExDL5cIPdFccMya7p33oFzz00L4/7wB9h//3JHZFb9\nCuluOg3oJ2mqpLeAm4CfFzcss8LNn5/Kd2+/PWy5JYwb5wRh1lqW2JKIiDHAtpJWzp5/UvSozAo0\nbBicdhp897veX9qsGPImCUnn5TkPQERcW6SYzJZo5ky48MK0CdB118GPf+xKrWbF0Fh300rZY0dS\nl9M62ePnwA7FD83smxYtgltuSd1KHTqkcho/+YkThFmxFFLg7xnggIj4NHu+EvCPiNiz0TcWkcty\ntE9jxqSuJSmV09iuoGL1ZlavWAX+1gTm5Tyfl50zK4lPPkmrpbt1S0X4hg1zgjArlUKmwN4JjJT0\nUPb8YOCO4oVklkTAAw/AeefBD38I48fD6quXOyqz9qXQKrA7kCrAAjwTEaOLGtWS43F3Uxs3eTKc\ncQa89x7cfDPsvnu5IzKrfsWqAntSRIyKiBuyx2hJVxUY0G2SZkh6JedcH0nvShqVPfbNea23pMmS\nJkrq1pQvxNqGOXOgthZ22y11L40a5QRhVk6FdDcdJmlORNwDIKkf8K0C73878AdSl1WuaxefQiup\nC6k2VBegEzBU0jf2t7a26/HH4fTTYdtt06rpddctd0RmVlCSAB7JtjHdF/goIgramS4ihklqaO+J\nhpo73YH7I2IBMFXSZGBnYEQhn2XVa9q0VE7jpZdcTsOs0uTtbpK0qqRVgeWBnwG/JFWDvTQ73xJn\nSBoj6VZJHbJz6wDv5FwzLTtnbdSCBXDDDanlsNlmLqdhVokaa0m8BATpr/76fw/IHgFs2MzP7E/a\njyIkXQ78npSEmqS2tvbL45qaGmpqapoZjpXDyJHw85/DKqukKa2bb17uiMzanrq6Ourq6lp0j4Jm\nN7XoA1J306MRsU1jr0nqBUREXJ29NhjoExHf6G7y7Kbq9dFHcNFF8NBDqSjfUUd5tbRZqRRrMR2S\ntpLUQ9Kx9Y+mxEXOGISk3I0jDwXGZcePAEdIWlbSBsDGwMgmfI5VsAi45x7YYot0PGECHH20E4RZ\npVviwLWkPkANsAXwGLAfMIxvzlhq6L33Zu9dTdLbQB9gL0nbAYuAqcCpABExQdJAYAIwH+jp5kLb\nMGkS9OwJs2bB3/4Gu+5a7ojMrFCF1G4aC2wLjI6IbSWtCdwdEfuUIsA8MTl/VIE5c+DKK6FfP/jV\nr9LiuGUKmU9nZkXRnO6mgnami4hFkhZke0p8AHgGuzVqyJDUethuu1SYr1OnckdkZs1RSJJ4UdIq\nwC2kGU+zgeeKGpVVrfffT2seRo6Em27ylFazatek2U2S1gdWjohXlnBpUbm7qfIsXJhqLF16KZxy\nClx8MaywQrmjMrNcReluUtqK7mhgw4i4TFJnSTtHhGceGQAvvpjWPHz72/D002kGk5m1DYVMge0P\n7AYcmT3/FOhXtIisanzyCZx1Fhx4YBqUrqtzgjBrawpJErtExOnAHICI+C+wbFGjsooWAQ8+mBLC\nZ5+lfR6OP95rHszaokIGrudLWppUigNJq5PWOFg7NHVqqtQ6ZQrcdx/ssccS32JmVayQlsSNwEPA\nGpJ+S1pId0VRo7KKM38+9O0LO+4IXbumaa1OEGZt3xJbEhFxj6SXgL1J5TUOjoiJRY/MKsazz6aB\n6e9+F0aMgI02KndEZlYqjU6BzbqZxkdERdXo9BTY0vjvf6FXL/j73+Haa6FHD487mFWzVi/wFxEL\ngUmSOrcoMqsqEXDvvWlgepll0sD04Yc7QZi1R4UMXHcExksaCXxWfzIiDipaVFY2r78Op50GM2fC\nww/DLruUOyIzK6dCksQlRY/Cym7u3DQwfcMN0Ls3nH22i/GZWWED10/XH0v6DjDLAwJty9NPw6mn\npi1ER42Czu5cNLNMY3tc7yqpTtLfJG0vaRxpg6AZkvYtXYhWLLNmwQknwDHHwFVXwaBBThBm9nWN\nDVzfRFoPcR/wJPCziFgL2BO4sgSxWZFEwF13wZZbQocOaWD64IPLHZWZVaLGksQyETEkIh4ApkfE\n8wAR8WqhN5d0m6QZkl7JOddR0hBJkyQ9LqlDzmu9JU2WNFFSt+Z8Qda4yZNhn33guuvS1Nbrr4eV\nVip3VGZWqRpLErmlN75Y7LVCxyRuB3642LlewNCI2IzUQukNIGkLoAfQhbRFav+sAq21gnnz4Le/\nhd12S3s8jByZVk+bmTWmsYHrbSV9QlplvXx2TPb8W4XcPCKGSVpvsdPdgf/Nju8A6kiJ4yDg/ohY\nAEyVNBnYGRhRyGdZfsOHp4Hp9deHl16C9Rb/L2JmlkfeJBERSxfpM9eIiBnZZ0yXtEZ2fh2+vuPd\ntOycNdNHH8GFF37VrfTjH3tBnJk1TSXMhG/WdNra2tovj2tqaqipqWmlcKpfBAwcmLYRPfhgmDAh\nDVCbWftSV1dHXV1di+7RpO1Lm/UBqbvp0YjYJns+EaiJiBmS1gKeioguknoBERFXZ9cNBvpExDe6\nm1y7Kb/6Ut5vvw3/939pDMLMDIpQu6mVKHvUewQ4Pjs+DhiUc/4ISctK2gDYGPAWqQVasACuuSYN\nRu++e1oU5wRhZi1V1O4mSfcCNcBqkt4G+gBXAQ9IOhF4izSjiYiYIGkgMAGYD/R0c6EwL7wAp5wC\nq6/uUt5m1rqK3t1UDO5uSj79FH71qzT+cM01cNRRHpg2s/wqtbvJiuDRR9OK6U8/hXHj4OijnSDM\nrPVVwuwma4Lp0+Gss2D0aLjjDthrr3JHZGZtmVsSVSICbr0VttkGNt4YXnnFCcLMis8tiSrw2mtp\nYPrzz2Ho0JQozMxKwS2JClZfb+n734dDDoHnnnOCMLPSckuiQj3/PJx8ctrfwfWWzKxcnCQqzKef\nwkUXwV//msp59+jhWUtmVj7ubqog9dNaP/88TWs9/HAnCDMrL7ckKoCntZpZpXJLoow8rdXMKp1b\nEmUyeXIamPa0VjOrZG5JlNiCBdC3b6rQ2r27p7WaWWVzS6KEXn4ZTjwRVl01VW7dYINyR2Rm1ji3\nJEpgzpzpep/vAAAJnklEQVRUrXWffeCMM2DIECcIM6sObkkU2fDh8LOfwRZbpJbE2muXOyIzs8I5\nSRTJ7NlpUdyDD8If/gCHHVbuiMzMmq5s3U2Spkp6WdJoSSOzcx0lDZE0SdLjkjqUK76WePxx2Gqr\nlCjGjXOCMLPqVbad6SS9CXwvIv6bc+5qYFZE9JV0IdAxIno18N6K3Jlu1iw47zx45hn405+gW7dy\nR2Rm9pVq25lODXx+d+CO7PgO4OCSRtRMEfDAA7D11tCxI4wd6wRhZm1DOcckAnhC0kLgTxFxK7Bm\nRMwAiIjpktYoY3wFee896Nkz7fnw17+m9Q9mZm1FOZNE14h4X9LqwBBJk0iJI1fePqXa2tovj2tq\naqipqSlGjHlFwG23Qe/ecNppMGAALLdcSUMwM2tUXV0ddXV1LbpH2cYkvhaE1AeYDfwMqImIGZLW\nAp6KiC4NXF/WMYmpU9O01o8/TonCK6bNrBpUzZiEpBUkrZgdfxvoBowFHgGOzy47DhhUjvjyWbQI\nbr4ZdtopjTm4pIaZtXXl6m5aE3hIUmQx3BMRQyS9CAyUdCLwFtCjTPF9w5QpqfUwe3aavdTlG+0b\nM7O2pyK6m5qqlN1Nixal6ay//jX88pdw7rmwjJcgmlkVak53k3/dNWLKFDjppFTO260HM2uPXOCv\nAYsWQf/+aexhv/1S/SUnCDNrj9ySWEx96+GLL2DYMNh883JHZGZWPm5JZBYtgn79Uuth//2dIMzM\nwC0JAN58M7Ue5sxxcjAzy9WuWxL1rYedd4YDDnCCMDNbXLttSbz5ZtpKdN48Jwczs3zaZUti0KDU\nevjRj+Df/3aCMDPLp10upnvrrTT+sNlmrRiUmVmFa85iunaZJMzM2qOqKfBnZmbVwUnCzMzycpIw\nM7O8nCTMzCwvJwkzM8urIpOEpH0lvSrpNUkXljseM7P2quKShKSlgJuAHwJbAkdK8nK3ImrpRun2\ndf5+th5/L8uv4pIEsDMwOSLeioj5wP1A9zLH1Kb5f8TW5e9n6/H3svwqMUmsA7yT8/zd7JyZmZVY\nJSYJMzOrEBVXlkPSrkBtROybPe8FRERcnXNNZQVtZlYlqr52k6SlgUnA3sD7wEjgyIiYWNbAzMza\noYrbTyIiFko6AxhC6g67zQnCzKw8Kq4lYWZmlaPqBq690K51SZoq6WVJoyWNLHc81UTSbZJmSHol\n51xHSUMkTZL0uKQO5YyxmuT5fvaR9K6kUdlj33LGWE0kdZL0pKTxksZKOis736Sf0apKEl5oVxSL\ngJqI2D4idi53MFXmdtLPYq5ewNCI2Ax4Euhd8qiqV0PfT4BrI2KH7DG41EFVsQXAeRGxJbAbcHr2\n+7JJP6NVlSTwQrtiENX3c1ARImIY8N/FTncH7siO7wAOLmlQVSzP9xPSz6g1UURMj4gx2fFsYCLQ\niSb+jFbbLwcvtGt9ATwh6QVJJ5c7mDZgjYiYAel/UmCNMsfTFpwhaYykW9191zyS1ge2A54H1mzK\nz2i1JQlrfV0jYgdgf1JzdPdyB9TGeGZIy/QHNoyI7YDpwLVljqfqSFoReBA4O2tRLP4z2ejPaLUl\niWlA55znnbJz1kwR8X7270zgIVKXnjXfDElrAkhaC/igzPFUtYiYmbOh/S3ATuWMp9pIWoaUIO6K\niEHZ6Sb9jFZbkngB2FjSepKWBY4AHilzTFVL0grZXxlI+jbQDRhX3qiqjvh6n/kjwPHZ8XHAoMXf\nYI362vcz+yVW71D889lUfwYmRMQNOeea9DNadesksilwN/DVQruryhxS1ZK0Aan1EKSFlff4+1k4\nSfcCNcBqwAygD/Aw8ACwLvAW0CMiPipXjNUkz/dzL1Jf+iJgKnBqfX+6NU5SV+AZYCzp//EALiJV\nsRhIgT+jVZckzMysdKqtu8nMzErIScLMzPJykjAzs7ycJMzMLC8nCTMzy8tJwszM8nKSsIomaQ1J\n90h6PasvNVxSRRd1lHSppB+04v3+Vb/osTVJuk/SRq19X2tbnCSs0j0M1EXExhGxE2mVfacyx9So\niOgTEU+2xr0k7Q+MyWrutLabAe/JYo1ykrCKlf01Pjcibqk/FxHvRES/7PX1JD0j6cXssWt2fi1J\nT2eb1LySrTxd/N5XSRqXVRftm527XdLNWYvlVUkHNPY52WsXZp8xWtIVOfc5NDueIqlW0kvZ5k6b\nZue/k238MlbSLdnmT6s28G04mqxsQhbHxOz+kyTdLWlvScOy5ztm1/WR9Jcs5imSDpF0dRbnY0r7\nyAP8G/h/2T4tZg3yD4dVsi2BUY28PgP4fxGxI6mF8Yfs/FHA4Ky67bbAmNw3Zb+MD46IrbLqopfn\nvLxe1mI5EPhjViOswc+RtB/wI2CniNge6Jsnzg8i4nvAH4FfZOf6AP+KiK1JBdjWzfPersBLOc83\nAn6XbRizOXBkROwOXABcnHPdhqQSF92Bu7PP2gaYAxwAkBXOm5x9j8watEy5AzArlKSbgN1JrYtd\ngGWBmyRtBywENskufQG4TdL/AIMi4uXFbvUx8IWkW4F/AH/PeW0gQES8LukN0i/iqXk+Z2/g9oiY\nm70nX/2bh7J/XwIOyY53J9vsJSIel9TQZjsAHSPis5znUyJiQnY8HvhXdjwWWC/nun9GxCJJY4Gl\nImJIznXr51w3E/guMDrP51s755aEVbLxwPfqn0TEGaRfzKtnp84Fpmd/Ie9IShpExL+BPUll5P8i\n6ae5N42IhaSS6A+SWgy5W2LmFjNT9rzBz2mCudm/C8n/h1m+3dcW5LkXpKJ3c3OOl1n8uqy1MH+x\n9+Re9y3gizyfbeYkYZUrG/xdTtKpOae/nXPcAXg/Oz4WWBpAUmdSF89twK3ADrn3zcqir5Ltl3we\nsE3Oyz9RshGwATAp3+cATwAnSFo+u2/HJnx5w4HDs/d1A1bJc90kSRvmht+EzyjkPZvi8tvWCCcJ\nq3QHAzWS3pD0PHA78Mvstf7A8ZJGk37Z1c8AqgFeljQK6EEqLZ9rJeDvkl4mlVI+N+e1t0mllP9B\nKks9r4HP+QxSNxGpNv+L2Wedn90jtzWSr8zypcA+kl4BDiPtuvZpA9f9g1Quu6H7FVrCucHrJK0B\nfB4R3hjJ8nKpcLOMpNuBRyPibyX4rGWBhRGxMJst1T8baF/8urWAOyLih0WI4Rzg44i4vbXvbW2H\nB67NvlLKv5g6AwOz6adzgZMbDChiejZFdsUirJX4L3BXK9/T2hi3JMzMLC+PSZiZWV5OEmZmlpeT\nhJmZ5eUkYWZmeTlJmJlZXk4SZmaW1/8HWhuHb2+QBFgAAAAASUVORK5CYII=\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0x35e6898>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The power law dependence between the gap spacing and the applied voltage of the oil is 24.2 *d^ 0.948\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 3.1\n",
+ "#determination of power law dependence between the gap spacing and the applied voltage of the oil\n",
+ "%matplotlib inline\n",
+ "from math import log, exp\n",
+ "from matplotlib import pyplot\n",
+ "import numpy as np\n",
+ "#given data\n",
+ "d1=4.#gap spacing(in mm)\n",
+ "d2=6.#gap spacing(in mm)\n",
+ "d3=10.#gap spacing(in mm)\n",
+ "d4=12.#gap spacing(in mm)\n",
+ "V1=90.#voltage(in kV) at breakdown\n",
+ "V2=140.#voltage(in kV) at breakdown\n",
+ "V3=210.#voltage(in kV) at breakdown\n",
+ "V4=255.#voltage(in kV) at breakdown\n",
+ "\n",
+ "#calculation\n",
+ "#from the relationship between breakdown voltage and the gap spacing.....V = K*d^n\n",
+ "#we get n = (log(V)-log(K))/log(d) = slope of line from given data\n",
+ "n=(log(V4)-log(V1))/(log(d4)-log(d1))\n",
+ "K=exp(log(V1)-n*log(d1))#Y intercept on the power law dependence graph\n",
+ "#plotting of graph\n",
+ "dn=np.linspace(1,20,num=20)\n",
+ "Vn=K*dn**n\n",
+ "#results\n",
+ "pyplot.plot(dn,Vn)\n",
+ "pyplot.xlabel(\"Gas spacing (mm)\")\n",
+ "pyplot.ylabel(\"Breakdown voltage (kV)\")\n",
+ "pyplot.show()\n",
+ "print 'The power law dependence between the gap spacing and the applied voltage of the oil is ',round(K,1),'*d^',round(n,3)"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter4_3.ipynb b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter4_3.ipynb
new file mode 100644
index 00000000..f74d0ff9
--- /dev/null
+++ b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter4_3.ipynb
@@ -0,0 +1,168 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4: Breakdown in Soild Dielectrics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1: pg 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The heat generated in specimen due to dielectric loss is (mW/cm^3) = 0.292\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 4.1\n",
+ "#calculation of heat generated in specimen due to dielectric loss\n",
+ "\n",
+ "#given data\n",
+ "epsilonr=4.2#value of the dielectric constant\n",
+ "tandelta=0.001#value of tandelta\n",
+ "f=50#value of frequency(in Hz)\n",
+ "E=50*10**3#value of electric field(in V/cm)\n",
+ "\n",
+ "#calculation\n",
+ "#from equation of dielectric heat loss......H=(E*E*f*epsilonr*tandelta)/(1.8*10^12)\n",
+ "H=(E*E*f*epsilonr*tandelta)/(1.8*10**12)\n",
+ "#results\n",
+ "print 'The heat generated in specimen due to dielectric loss is (mW/cm^3) = ',round(H*10**3,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2: pg 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the voltage at which an internal discharge can occur is (kV.) = 9.75\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 4.2\n",
+ "#calculation of voltage at which an internal discharge can occur\n",
+ "\n",
+ "#given data\n",
+ "d1=1#thickness(in mm) of the internal void\n",
+ "dt=10#thickness(in mm) of the specimen\n",
+ "epsilon0=8.89*10**-12#electrical permittivity(in F/m) of free space\n",
+ "epsilonr=4#relative permittivity of the dielectric\n",
+ "Vb=3#breakdown strength(in kV/mm) of air\n",
+ "\n",
+ "#calculation\n",
+ "d2=dt-d1\n",
+ "epsilon1=epsilon0*epsilonr#electrical permittivity(in F/m) of the dielectric\n",
+ "V1=Vb*d1#voltage at which air void of d1 thickness breaks\n",
+ "V=(V1*(d1+(epsilon0*d2/epsilon1))/d1)\n",
+ "#results\n",
+ "print 'the voltage at which an internal discharge can occur is (kV.) = ',round(V,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3: pg 124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the value of inner diameter of electrodes in coaxial cylindrical capacitor is (cm) = 11.74\n",
+ "\n",
+ "the value of outer diameter of electrodes in coaxial cylindrical capacitor is (cm) = 12.04\n",
+ "\n",
+ "the thickness of the insulation is (mm) = 3.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 4.3\n",
+ "#calculation of the dimensions of electrodes in coaxial cylindrical capacitor\n",
+ "from math import pi,exp\n",
+ "#given data\n",
+ "epsilon0=(36*pi*10**9)**-1#electrical permittivity(in F/m) of free space\n",
+ "#consider high density polyethylene as the dielectric material\n",
+ "epsilonr=2.3#relative permittivity of high density polyethylene\n",
+ "l=0.2#effective length(in m)\n",
+ "C=1000*10**-12#capacitance(in F) of the capacitor\n",
+ "V=15#operating voltage(in kV)\n",
+ "Emax=50#maximum stress(in kV/cm) for breakdown stress 200 kV/cm and factor of safety of 4\n",
+ "\n",
+ "#calculation\n",
+ "#from equation of capacitance of coaxial cylindrical capacitor\n",
+ "#C=(2*%pi*epsilon0*epsilonr*l)/(lod(d2/d1)).............(1)\n",
+ "#from equation of Emax occuring near electrodes\n",
+ "#Emax=V/(r1*(log(r2/r1)))...............................(2)\n",
+ "#from equation (1) and equation (2),we get\n",
+ "logr2byr1=(2*pi*epsilon0*epsilonr*l)/C#logd2/d1 = logr2/r1\n",
+ "r1=V/(Emax*logr2byr1)#from equation (1)\n",
+ "r2=r1*exp(logr2byr1)\n",
+ "#results\n",
+ "print 'the value of inner diameter of electrodes in coaxial cylindrical capacitor is (cm) = ',round(r1,2)\n",
+ "print '\\nthe value of outer diameter of electrodes in coaxial cylindrical capacitor is (cm) = ',round(r2,2)\n",
+ "print '\\nthe thickness of the insulation is (mm) = ',round((r2-r1)*10,1)\n",
+ "\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter6_3.ipynb b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter6_3.ipynb
new file mode 100644
index 00000000..f68c1627
--- /dev/null
+++ b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter6_3.ipynb
@@ -0,0 +1,547 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 6: Generation of High voltages and Currents"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1: pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the value of percentage ripple is (percentage) = 4.53\n",
+ "\n",
+ "the value of the regulation is (percentage) = 12.4\n",
+ "\n",
+ "the optimum number of stages for minimum regulation is 14.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 6.1\n",
+ "#calculation of percentage ripple,the regulation and the optimum number of stages for minimum regulation in Cockcroft-Walton type voltage multiplier\n",
+ "from math import sqrt\n",
+ "#given data\n",
+ "C=0.05*10**-6#value of capacitance(in F)\n",
+ "Vmax=125.*10**3#value of supply transformer secondary voltage(in V)\n",
+ "f=150.#frequency(in Hz)\n",
+ "I=5.*10**-3#load current(in A)\n",
+ "nst=8.#number of stages\n",
+ "\n",
+ "#calculation\n",
+ "n=nst*2#number of capacitors\n",
+ "#from equation of ripple voltage\n",
+ "deltaV=(I/(f*C))*(n*(n+1)/2)\n",
+ "perripple=(deltaV*100)/(16*Vmax)\n",
+ "deltaVn=(I/(f*C))*(((2*nst**3)/3)+(nst*nst/2)-(nst/6))#voltage drop...here n = nst = number of stages\n",
+ "reg=deltaVn/(2*nst*Vmax)#regulation\n",
+ "nopt=round(sqrt(Vmax*f*C/I))#optimum number of stages\n",
+ "#results\n",
+ "print 'the value of percentage ripple is (percentage) = ',round(perripple,2)\n",
+ "print '\\nthe value of the regulation is (percentage) = ',round(reg*100,1)\n",
+ "print '\\nthe optimum number of stages for minimum regulation is ',round(nopt)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2: pg 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of series inductance is (H) = 3820.0\n",
+ "\n",
+ "The value of input voltage to the transformer is (V) = 4.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 6.2\n",
+ "#calculation of series inductance and input voltage to transformer\n",
+ "from math import pi\n",
+ "#given data\n",
+ "kva=100.*10**3#value of volt-ampere of transformer(in VA)\n",
+ "V=250.*10**3#value of transformer secondary voltage(in V)\n",
+ "Vi=400.#value of transformer primary voltage(in V)\n",
+ "Vc=500.*10**3#voltage(in V)\n",
+ "Ic=0.4#charging current(in A)\n",
+ "perX=8.#percentage leakage reactance\n",
+ "f=50.#value of frequency(in Hz)\n",
+ "perR1=2.#percentage resistance\n",
+ "perR2=2.#percentage resistance of inductor\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "I=kva/V#maximum value of current that can be supplied\n",
+ "Xc=Vc/Ic#reactance of cable\n",
+ "Xl=(perX*V)/(100*I)#leakage reactance\n",
+ "adrec=Xc-Xl#additional reactance\n",
+ "Xadrec=adrec/(2*pi*f)\n",
+ "perR=perR1+perR2#total resistance\n",
+ "R=(perR*V)/(100*I)\n",
+ "VE2=I*R#excitation at secondary\n",
+ "VE1=VE2*Vi/V#primary voltage\n",
+ "IkW=(VE1/Vi)*100#input kW\n",
+ "#results\n",
+ "print 'The value of series inductance is (H) = ',round(Xadrec)\n",
+ "print '\\nThe value of input voltage to the transformer is (V) = ',round(IkW)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3: pg 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of series resistance is (ohm) = 420.0\n",
+ "\n",
+ "The value of damping resistance is (ohm) = 2981.0\n",
+ "\n",
+ "The value of maximum output voltage of the generator is (kV) = 892.02\n",
+ "The answer is a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 6.3\n",
+ "#calculation of series resistance ,damping resistance and maximum output voltage of the generator\n",
+ "from math import exp\n",
+ "#given data\n",
+ "n=8.#number of stages\n",
+ "C=0.16*10**-6#value of condenser(in farad)\n",
+ "Cl=1000.*10**-12#value of load capacitor (in farad)\n",
+ "t1=1.2*10**-6#time to front(in second)\n",
+ "t2=50.*10**-6#time to tail(in second)\n",
+ "Vc=120.*10**3#charging voltage(in V)\n",
+ "\n",
+ "#calculation\n",
+ "C1=C/n#generator capacitance\n",
+ "C2=Cl#load capacitance\n",
+ "R1=(t1*(C1+C2))/(3*C1*C2)\n",
+ "R2=(t2/(0.7*(C1+C2)))-R1\n",
+ "V=n*Vc#dc charging voltage for n stages\n",
+ "alpha=1/(R1*C2)\n",
+ "betaa=1/(R2*C1)\n",
+ "Vmax=(V*(exp(-alpha*t1)-exp(-betaa*t1)))/(R1*C2*(alpha-betaa))\n",
+ "#results\n",
+ "print 'The value of series resistance is (ohm) = ',round(R1)\n",
+ "print '\\nThe value of damping resistance is (ohm) = ',round(R2)\n",
+ "print '\\nThe value of maximum output voltage of the generator is (kV) = ',round(-Vmax*10**-3,2)\n",
+ "print 'The answer is a bit different due to rounding off error in textbook'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4: pg 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of circuit inductance is (microhenry) = 8.125\n",
+ "\n",
+ "The value of dynamic resistance is (ohm) = 0.8694\n",
+ "\n",
+ "The value of charging voltage is (kV) = 17.5\n",
+ "The answer for Charging Voltage is wrong in textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 6.4\n",
+ "#calculation of circuit inductance and dynamic resistance\n",
+ "\n",
+ "#given data\n",
+ "alpha=0.0535*10**6#from table\n",
+ "LC=65.#value of product\n",
+ "C=8.#value of capacitor (in microfarad)\n",
+ "Ip=10.#output peak current(in kA)\n",
+ "t1=8.#time to front(in microsecond)\n",
+ "\n",
+ "#calculation\n",
+ "L=LC/C#inductance(in microhenry)\n",
+ "Rd=2*(LC*10**-6)*alpha/t1#dynamic resistance\n",
+ "V=Ip*14./C#charging voltage\n",
+ "\n",
+ "#results\n",
+ "print 'The value of circuit inductance is (microhenry) = ',round(L,3)\n",
+ "print '\\nThe value of dynamic resistance is (ohm) = ',round(Rd,4)\n",
+ "print '\\nThe value of charging voltage is (kV) = ',round(V,1)\n",
+ "print 'The answer for Charging Voltage is wrong in textbook'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5: pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of circuit inductance is (microhenry) = 4.09\n",
+ "\n",
+ "The value of dynamic resistance is (ohm) = 1.4302\n",
+ "\n",
+ "The value of charging voltage is (kV) = 1.59\n",
+ "The answers are a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 6.5\n",
+ "#calculation circuit inductance and dynamic resistance\n",
+ "from math import pi,exp,atan\n",
+ "#given data\n",
+ "C=8.*10**-6#value of capacitor (in farad)\n",
+ "Ip=10.#output peak current(in kA)\n",
+ "t1=8.*10**-6#time to front(in second)\n",
+ "t2=20.*10**-6#time to first half cycle(in second)\n",
+ "V=25.*10**3#charging voltage\n",
+ "im=10.*10**3#output currennt(in A)\n",
+ "\n",
+ "#calculation\n",
+ "omega=pi/t2\n",
+ "omegat1=omega*t1\n",
+ "alpha=omega*(1/atan(omegat1))\n",
+ "LC=1/((t1**2)+(alpha**2))\n",
+ "L=LC/C\n",
+ "R=2*L*alpha \n",
+ "V=omega*L*10*exp(-alpha*t1)\n",
+ "#results\n",
+ "print 'The value of circuit inductance is (microhenry) = ',round(L*10**6,2)\n",
+ "print '\\nThe value of dynamic resistance is (ohm) = ',round(R,4)\n",
+ "print '\\nThe value of charging voltage is (kV) = ',round(V,2)\n",
+ "print 'The answers are a bit different due to rounding off error in textbook'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6: pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The time to front is (microsecond) = 2.19\n",
+ "\n",
+ "The time to tail is (microsecond) = 46.7\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 6.6\n",
+ "#calculation of front and tail time\n",
+ "\n",
+ "#given data\n",
+ "n=12#number of stages\n",
+ "C=0.126*10**-6#capacitance(in Farad)\n",
+ "R1=800#wavefront resistance(in ohm)\n",
+ "R2=5000#xavetail resistance(in ohm)\n",
+ "C2=1000*10**-12#load capacitance(in Farad)\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "C1=C/n\n",
+ "t1=3*R1*(C1*C2)/(C1+C2)\n",
+ "t2=0.7*(R1+R2)*(C1+C2)\n",
+ "#results\n",
+ "print 'The time to front is (microsecond) = ',round(t1*10**6,2)\n",
+ "print '\\nThe time to tail is (microsecond) = ',round(t2*10**6,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7: pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of highest resonant frequency produced is (kHz) = 8.04714659485\n",
+ "\n",
+ "The peak value of output voltage is (kV) - 209.631374545\n",
+ "The answers are a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 6.7\n",
+ "#calculation of peak value of output voltage and highest resonant frequency produced\n",
+ "from cmath import sqrt,pi\n",
+ "#given data\n",
+ "V=10.*10**3#voltage(in V) at primary winding\n",
+ "L1=10.*10**-3#inductance(in H)\n",
+ "L2=200.*10**-3#inductance(in H)\n",
+ "K=0.6#coefficient of coupling\n",
+ "C1=2.*10**-6#capacitance(in Farad) on primary side\n",
+ "C2=1.*10**-9#capacitance(in Farad) on secondary side\n",
+ "\n",
+ "#calculation\n",
+ "M=K*sqrt(L1*L2)\n",
+ "omega1=1/sqrt(L1*C1)\n",
+ "sigma=sqrt(1-(K**2))\n",
+ "omega2=1/sqrt(L2*C2)\n",
+ "gama2=sqrt(((omega1**2+omega2**2)/2)+sqrt(((omega1**2+omega2**2)/2)-(sigma**2*omega1**2*omega2**2)))\n",
+ "gama1=sqrt(((omega1**2+omega2**2)/2)-sqrt(((omega1**2+omega2**2)/2)-(sigma**2*omega1**2*omega2**2)))\n",
+ "fh=gama2/(2*pi)#highest frequency\n",
+ "V2p=(V*M)/(sigma*L1*L2*C2*(gama2**2-gama1**2))\n",
+ "#results\n",
+ "print 'The value of highest resonant frequency produced is (kHz) = ',abs(fh)*10**-3\n",
+ "print '\\nThe peak value of output voltage is (kV) - ',abs(V2p)*10**-3\n",
+ "\n",
+ "#gama1 and gama2 are imaginary numbers....Moreover their magnitudes will also be same....so peak value of output voltage from equation is zero\n",
+ "print 'The answers are a bit different due to rounding off error in textbook'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8: pg 201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of output voltage is (kV) = 100.0\n",
+ "correct answer is 100 kV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 6.8\n",
+ "#calculation of output voltage\n",
+ "from math import sqrt\n",
+ "#given data\n",
+ "V1=10.#voltage(in kV) at primary winding \n",
+ "C1=2.*10**-6#capacitance(in Farad) on primary side\n",
+ "C2=1.*10**-9#capacitance(in Farad) on secondary side\n",
+ "pern=5.#energy efficiency(in percentage)\n",
+ "\n",
+ "#calculation\n",
+ "n=pern/100.\n",
+ "V2=V1*sqrt(n*C1/C2)\n",
+ "#results\n",
+ "print 'The value of output voltage is (kV) = ',round(V2,1)\n",
+ "print 'correct answer is 100 kV'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9: pg 201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of self capacitance is (nF) = 1.126\n",
+ "\n",
+ "The value of leakage reactance is (kohm) = 28.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 6.9\n",
+ "#calculation of self capacitance and leakage reactance\n",
+ "from math import pi\n",
+ "#given data\n",
+ "Vi=350.*10**3#rating(in VA)\n",
+ "V=350.*10**3#secondary voltage(in V)\n",
+ "V1=6.6*10**3#primary voltage(in V)\n",
+ "perV=8.#percentage ratedd voltage\n",
+ "perR=1.#percentage rise\n",
+ "f=50.#frequency(in Hz)\n",
+ "\n",
+ "#calculation\n",
+ "I=Vi/V\n",
+ "Xl=(perV*V)/(100*I)\n",
+ "I0=perR*V/(100*Xl)\n",
+ "Xc=((1+(perR/100))*V)/I0\n",
+ "C=1/(Xc*2*pi*f)\n",
+ "#results\n",
+ "print 'The value of self capacitance is (nF) = ',round(C*10**9,3)\n",
+ "print '\\nThe value of leakage reactance is (kohm) = ',round(Xl*10**-3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10: pg 202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of resistance for 1/50 microsecond voltage is (ohm) = 70.6\n",
+ "\n",
+ "The value of inductance for 1/50 microsecond voltage is (microhenry) = 11.6\n",
+ "\n",
+ "The value of output voltage is (kV) = 9.88\n",
+ "\n",
+ "The value of inductance for 8/20 microsecond voltage is (microhenry) = 65.0\n",
+ "\n",
+ "The value of resistance for 8/20 microsecond voltage is (ohm) = 6.955\n",
+ "\n",
+ "The peak value of current is (A) = 714.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 6.10\n",
+ "#calculation of resistance and inductance\n",
+ "\n",
+ "#given data\n",
+ "CR=70.6#value from table\n",
+ "LC=11.6#value from table\n",
+ "C=1#capacitance(in microfarad)\n",
+ "pern=98.8#percentage voltage efficiency\n",
+ "V=10.#rating(in kV)\n",
+ "LC2=65.#value from table\n",
+ "alpha=0.0535#value from table\n",
+ "\n",
+ "#calculation\n",
+ "R=CR/C\n",
+ "L=LC/C\n",
+ "Vo=pern*V/100\n",
+ "L2=LC2/C\n",
+ "R2=2*L2*alpha\n",
+ "Ip=V*C/14.\n",
+ "\n",
+ "print 'The value of resistance for 1/50 microsecond voltage is (ohm) = ',round(R,1)\n",
+ "print '\\nThe value of inductance for 1/50 microsecond voltage is (microhenry) = ',round(L,1)\n",
+ "print '\\nThe value of output voltage is (kV) = ',round(Vo,2)\n",
+ "print '\\nThe value of inductance for 8/20 microsecond voltage is (microhenry) = ',round(L2)\n",
+ "print '\\nThe value of resistance for 8/20 microsecond voltage is (ohm) = ',round(R2,3)\n",
+ "print '\\nThe peak value of current is (A) = ',round(Ip*10**3)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter7_3.ipynb b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter7_3.ipynb
new file mode 100644
index 00000000..9e1c3bce
--- /dev/null
+++ b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter7_3.ipynb
@@ -0,0 +1,380 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 7: Measurement of High Voltages and Currents"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1: pg 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The capacitance of the generating voltmeter is (pF) = 0.9\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 7.1\n",
+ "#calculation of capacitance of generating voltmeter\n",
+ "from math import pi,sqrt\n",
+ "#given data\n",
+ "Irms=2.*10**-6#current(in A)\n",
+ "V1=20.*10**3#applied voltage(in V)\n",
+ "V2=200.*10**3#applied voltage(in V)\n",
+ "rpm=1500.#assume synchronous speed(in rpm) of motor\n",
+ "\n",
+ "#calculation\n",
+ "Cm=Irms*sqrt(2)/(V1*(rpm/60)*2*pi)\n",
+ "Irmsn=V2*Cm*2*pi*(rpm/60)/sqrt(2)\n",
+ "#results\n",
+ "print 'The capacitance of the generating voltmeter is (pF) = ',round(Cm*10**12,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2: pg 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of Cs is (microfarad) = 1.0\n",
+ "\n",
+ "The value of R is 1.0e+07 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 7.2\n",
+ "#Design of a peak reading voltmeter\n",
+ "\n",
+ "#given data\n",
+ "r=1000.#ratio is 1000:1\n",
+ "V=100.*10**3#read voltage(in V)\n",
+ "R=10**7#value of resistance(in ohm)\n",
+ "\n",
+ "#calculation\n",
+ "#take range as 0-10 microampere\n",
+ "Vc2=V/r#voltage at C2 arm\n",
+ "#Cs * R = 1 to 10 s\n",
+ "Cs=10./R\n",
+ "#results\n",
+ "print 'The value of Cs is (microfarad) = ',round(Cs*10**6)\n",
+ "print '%s %.1e %s' %('\\nThe value of R is ',R,'ohm')\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3: pg 278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The air density factor is 0.9327\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 7.3\n",
+ "#calculation of correction factors for atmospheric conditions\n",
+ "\n",
+ "#given data\n",
+ "t=37#temperature(in degree celsius)\n",
+ "p=750.#atmospheric pressure(in mmHg)\n",
+ "\n",
+ "#calculation\n",
+ "d=p*293./(760*(273+t))\n",
+ "\t\n",
+ "#results\n",
+ "print 'The air density factor is ',round(d,4)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4: pg 278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The divider ratio is 1238.3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 7.4\n",
+ "#calculation of divider ratio\n",
+ "\n",
+ "#given data\n",
+ "R1=16.*10**3#high voltage arm resistance(in ohm)\n",
+ "n=16.#number of members\n",
+ "R=250.#resistance(in ohm) of each member in low voltage arm\n",
+ "R2dash=75.#terminating resistance(in ohm)\n",
+ "\n",
+ "#calculation\n",
+ "R2=R/n\n",
+ "a=1+(R1/R2)+(R1/R2dash)\n",
+ "#results\n",
+ "print 'The divider ratio is ',round(a,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5: pg 278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of capacitance needed for correct compensation is 1.8e-08 F or 17 nf\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 7.5\n",
+ "#calculation of capacitance needed for correct compensation\n",
+ "\n",
+ "#given data\n",
+ "Cgdash=20*10**-12#ground capacitance(in farad)\n",
+ "n=15.#number of capacitors\n",
+ "r=120.#resistance(in ohm)\n",
+ "R2=5.#resistance(in ohm) of LV arm\n",
+ "\n",
+ "#calculation\n",
+ "Ce=(2./3)*n*Cgdash\n",
+ "R1=n*r/2\n",
+ "T=R1*Ce/2\n",
+ "C2=T/R2\n",
+ "#results\n",
+ "print '%s %.1e %s %d %s' %('The value of capacitance needed for correct compensation is ',C2,' F or ',C2*10**9,' nf')\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6: pg 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of resistance is (milliohm) = 1.0\n",
+ "\n",
+ "The length of shunt is (cm) = 10.0\n",
+ "\n",
+ "The radius of shunt is (mm) = 25.6\n",
+ "\n",
+ "The thickness of shunt is (mm) = 0.187\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 7.6\n",
+ "#calculation of ohmic value of shunt an its dimensions\n",
+ "from math import sqrt,pi\n",
+ "#given data\n",
+ "I=50.*10**3#impulse current (in A)\n",
+ "Vm=50.#voltage(in V) drop across shunt\n",
+ "B=10.*10**6#bandwidth(in Hz) of the shunt\n",
+ "mu0=4.*pi*10**-7#magnetic permeability(in H/m) of free space\n",
+ "\n",
+ "#calculation\n",
+ "R=Vm/I#resistance of shunt\n",
+ "L0=1.46*R/B\n",
+ "mu=mu0#in this case ...mu = mu0 * mur ~mu0\n",
+ "rho=30*10**-8#resistivity(in ohm m) of the tube material\n",
+ "d=sqrt((1.46*rho)/(mu*B))#thickness of the tube(in m)\n",
+ "l=10**-1#length(in m) (assume)\n",
+ "r=(rho*l)/(2*pi*R*d)\n",
+ "#results\n",
+ "print 'The value of resistance is (milliohm) = ',round(R*10**3)\n",
+ "print '\\nThe length of shunt is (cm) = ',round(l*100)\n",
+ "print '\\nThe radius of shunt is (mm) = ',round(r*10**3,1)\n",
+ "print '\\nThe thickness of shunt is (mm) = ',round(d*10**3,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7: pg 280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of mutual inductance is (nH) = 2.0\n",
+ "\n",
+ "The value of resistance is 2.0e+03 ohm\n",
+ "\n",
+ "The value of capacitance is (pF) = 1000.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 7.7\n",
+ "#Estimation of values of mutual inductance,resistance and capacitance\n",
+ "from math import pi\n",
+ "#given data\n",
+ "It=10.*10**3#impulse current(in A)\n",
+ "Vmt=10.#meter reading(in V) for full scale deflection\n",
+ "dibydt=10.**11#rate of change of current(in A/s)\n",
+ "\n",
+ "#calculation\n",
+ "MbyCR=Vmt/It\n",
+ "t=It/dibydt\n",
+ "f=1/(4.*t)\n",
+ "omega=2*pi*f\n",
+ "CR=10*pi/omega\n",
+ "M=10**-3*CR\n",
+ "R=2*10**3#assume resistance(in ohm)\n",
+ "C=CR/R\n",
+ "#results\n",
+ "print 'The value of mutual inductance is (nH) = ',round(M*10**9)\n",
+ "print '%s %.1e %s' %('\\nThe value of resistance is',R,'ohm')\n",
+ "print '\\nThe value of capacitance is (pF) = ',round(C*10**12)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8: pg 281"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of resistance is 2.0e+03 ohm\n",
+ "\n",
+ "The value of capacitance is (microfarad) = 0.25\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 7.8\n",
+ "#calculation of resistance and capacitance\n",
+ "from math import pi\n",
+ "#given data\n",
+ "t1=8.*10**-6#fronttime(in s)\n",
+ "t2=20.*10**-6#tailtime(in s)\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "f2=1/t2#frequency corresponding to tail time\n",
+ "fl=f2/5\n",
+ "omega=2*pi*fl\n",
+ "CR=10*pi/omega\n",
+ "M=10**-3*(1/CR)\n",
+ "R=2*10**3#assume resistance(in ohm)\n",
+ "C=CR/R\n",
+ "\n",
+ "print '%s %.1e %s' %('The value of resistance is ',R,'ohm')\n",
+ "print '\\nThe value of capacitance is (microfarad) = ',round(C*10**6,2)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter8_3.ipynb b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter8_3.ipynb
new file mode 100644
index 00000000..10109095
--- /dev/null
+++ b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter8_3.ipynb
@@ -0,0 +1,391 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 8: Overvoltage phenomenon and Insulation coordination in electric power systems"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1: pg 350 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of surge impedance is (ohm) = 374.2\n",
+ "\n",
+ "The value of velocity is 3.0e+05 km/s\n",
+ "\n",
+ "The time taken by the surge to travel to the other end is (ms) = 1.35\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 8.1\n",
+ "#calculation of surge impedance,velocity and time taken by the surge to travel to the other end\n",
+ "from math import sqrt\n",
+ "#given data\n",
+ "L=1.26*10**-3#inductance(in H/km)\n",
+ "C=0.009*10**-6#capacitance(in F/km)\n",
+ "l=400.#length(in km) of the transmission line\n",
+ "\n",
+ "#calculation\n",
+ "v=1/sqrt(L*C)\n",
+ "Xs=sqrt(L/C)\n",
+ "t=l/v\n",
+ "#results\n",
+ "print 'The value of surge impedance is (ohm) = ',round(Xs,1)\n",
+ "print '%s %.1e %s' %('\\nThe value of velocity is ',v,' km/s')\n",
+ "print '\\nThe time taken by the surge to travel to the other end is (ms) = ',round(t*10**3,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2: pg 350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of the voltage build up at the junction is (kV) = 893.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 8.2\n",
+ "#calculation of the voltage build up at the junction\n",
+ "\n",
+ "#given data\n",
+ "Z1=500.#surge impedance(in ohm) of transmission line\n",
+ "Z2=60.#surge impedance(in ohm) of cable\n",
+ "e=500.#value of surge(in kV)\n",
+ "\n",
+ "#calculation\n",
+ "tau=(Z1-Z2)/(Z2+Z1)#coefficient of reflection\n",
+ "Vj=(1+tau)*e\n",
+ "#results\n",
+ "print 'The value of the voltage build up at the junction is (kV) = ',round(Vj)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5: pg 352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "When wave travels along the cable,the transmitted voltage is (kV) = 374.85\n",
+ "\n",
+ "When wave travels along the cable,the reflected voltage is (kV) = 174.85\n",
+ "\n",
+ "When wave travels along the cable,the transmitted current is (kA) = 1.002\n",
+ "\n",
+ "When wave travels along the cable,the reflected current is (kA) = 6.97\n",
+ "\n",
+ "When wave travels along the line,the transmitted voltage is (kV) = 25.15\n",
+ "\n",
+ "When wave travels along the line,the reflected voltage is (kV) = -174.85\n",
+ "\n",
+ "When wave travels along the line,the transmitted current is (kA) = 1.002\n",
+ "\n",
+ "When wave travels along the line,the reflected current is 0.467 kA or 467.0 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 8.5\n",
+ "#calculation of the transmitted,reflected voltage and current waves\n",
+ "from math import sqrt\n",
+ "#given data\n",
+ "L1=0.189*10**-3#inductance(in H/km) of the cable\n",
+ "C1=0.3*10**-6#capacitance(in Farad/km) of the cable\n",
+ "L2=1.26*10**-3#inductance(in H/km) of the overhead line\n",
+ "C2=0.009*10**-6#capacitance(in Farad/km) of the overhead line\n",
+ "e=200.*10**3#surge volatge(in kV)\n",
+ "\n",
+ "#calculation\n",
+ "Z1=sqrt(L1/C1)#surge impedance of the cable\n",
+ "Z2=sqrt(L2/C2)#surge impedance of the line\n",
+ "tau=(Z2-Z1)/(Z2+Z1)#when wave travels along the cable\n",
+ "edash=tau*e#reflected wave\n",
+ "edashdash=(1+tau)*e#transmitted wave\n",
+ "Idash=edash/Z1#reflected current wave\n",
+ "Idashdash=edashdash/Z2#transmitted current wave\n",
+ "Z2n=Z1\n",
+ "Z1n=Z2\n",
+ "taun=(Z2n-Z1n)/(Z2n+Z1n)#when wave travels along the line\n",
+ "edashn=taun*e#reflected wave\n",
+ "edashdashn=(1+taun)*e#transmitted wave\n",
+ "Idashdashn=edashdashn/Z2n#transmitted current wave\n",
+ "Idashn=edashn/Z1n#reflected current wave\n",
+ "#results\n",
+ "print 'When wave travels along the cable,the transmitted voltage is (kV) = ',round(edashdash*10**-3,2)\n",
+ "print '\\nWhen wave travels along the cable,the reflected voltage is (kV) = ',round(edash*10**-3,2)\n",
+ "print '\\nWhen wave travels along the cable,the transmitted current is (kA) = ',round(Idashdash*10**-3,3)\n",
+ "print '\\nWhen wave travels along the cable,the reflected current is (kA) = ',round(Idash*10**-3,2) \n",
+ "print '\\nWhen wave travels along the line,the transmitted voltage is (kV) = ',round(edashdashn*10**-3,2)\n",
+ "print '\\nWhen wave travels along the line,the reflected voltage is (kV) = ',round(edashn*10**-3,2)\n",
+ "print '\\nWhen wave travels along the line,the transmitted current is (kA) = ',round(Idashdashn*10**-3,3)\n",
+ "print '\\nWhen wave travels along the line,the reflected current is ',round(abs(Idashn*10**-3),3),' kA or ',round(abs(Idashn)),'A' \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6: pg 353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of voltage at the receiving end in Bewley lattice diagram is 0.9756 u(t) V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 8.6\n",
+ "#calculation of value of voltage at the receiving end in Bewley lattice diagram\n",
+ "\n",
+ "#given data\n",
+ "alpha=0.8\n",
+ "\n",
+ "#calculation\n",
+ "Vut=2*alpha/(1+alpha**2)\n",
+ "#results\n",
+ "print 'The value of voltage at the receiving end in Bewley lattice diagram is ',round(Vut,4),'u(t) V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7: pg 355"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The sparkover voltage for terminated line is (kV) = 347.0\n",
+ "\n",
+ "The arrester current for terminated line is (kA) = 5.0\n",
+ "\n",
+ "The sparkover voltage for continuous line is (kV) = 294.0\n",
+ "\n",
+ "The arrester current for continuous line is (kA) = 2.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 8.7\n",
+ "#calculation of sparkover voltage and the arrester current\n",
+ "\n",
+ "#given data\n",
+ "Xs=400.#surge impedance(in ohm)\n",
+ "Xv=1000.#surge voltage(in kV)\n",
+ "\n",
+ "#calculation\n",
+ "#for line terminated\n",
+ "Iam=2*Xv/Xs#maximum arrester current\n",
+ "#as Iam = 5 kA from graph Vd = 330 kV\n",
+ "Vd=330.#sparkover voltage(in kV)\n",
+ "Vso=Vd+(Vd*5./100)\n",
+ "#for continuous line\n",
+ "Iamn=Xv/Xs#maximum arrester current\n",
+ "#as Iamn = 2.5 kA from graph Vdn = 280 kV\n",
+ "Vdn=280#sparkover voltage(in kV)\n",
+ "Vson=Vdn+(Vdn*5./100)\n",
+ "#results\n",
+ "print 'The sparkover voltage for terminated line is (kV) = ',round(Vso)\n",
+ "print '\\nThe arrester current for terminated line is (kA) = ',round(Iam)\n",
+ "print '\\nThe sparkover voltage for continuous line is (kV) = ',round(Vson)\n",
+ "print '\\nThe arrester current for continuous line is (kA) = ',round(Iamn,1)\n",
+ "#values of sparover voltages are\n",
+ "#for terminated line = 346 kV\n",
+ "#for continuous line = 294 kV\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8: pg 356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Neglecting resistance of line,the rise in voltage at the other end is (kV) = 11.89\n",
+ "\n",
+ "Considering all the parameters,the rise in voltage at the other end is (kV) = 94.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 8.8\n",
+ "#calculation of rise in voltage at the other end\n",
+ "from cmath import pi,sqrt,cos\n",
+ "#given data\n",
+ "R=0.1#resistance(in ohm/km)\n",
+ "L=1.26*10**-3#inductance(in H/km)\n",
+ "C=0.009*10**-6#capacitance(in F/km)\n",
+ "l=400#length(in km) of the line\n",
+ "V1=230#line voltage(in kV)\n",
+ "f=50#frequency(in Hz)\n",
+ "G=0\n",
+ "\n",
+ "#calculation\n",
+ "#Neglecting resistance of line\n",
+ "V1p=V1/sqrt(3)\n",
+ "omega=2*pi*f\n",
+ "Xl=complex(0,omega*L*l)\n",
+ "Xc=complex(0,-1/(omega*C*l))\n",
+ "V2=V1p*((1-(Xl/(2*Xc)))-1)\n",
+ "\n",
+ "#Considering all the parameters\n",
+ "omegaL=complex(0,omega*L)\n",
+ "omegaC=complex(0,omega*C)\n",
+ "i=l*sqrt((R+omegaL)*(G+omegaC))\n",
+ "betal=i.imag*l\n",
+ "V2n=V1p/cos(betal)\n",
+ "\n",
+ "print 'Neglecting resistance of line,the rise in voltage at the other end is (kV) = ',round(V2.real,2)\n",
+ "print '\\nConsidering all the parameters,the rise in voltage at the other end is (kV) = ',round(V2n.real-V1p.real,2)\n",
+ "\n",
+ "#By considering all the parameters the rise in voltage at the other end is 94.50 kV\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9: pg 357"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The protective margin for lightning impulses is (percentage) = 34.3\n",
+ "\n",
+ "The protective margin for switching gears is (percentage) = 27.6\n",
+ "\n",
+ "The margin when lightning arrester just sparks is (percentage) = 27.6\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 8.9\n",
+ "#working out of insulation coordination\n",
+ "from math import sqrt\n",
+ "#given data\n",
+ "V=220.#voltage(in kV) of substation\n",
+ "BIL=1050.#value of BIL(in kV)\n",
+ "BtoS=1.24#ratio of BIL to SIL\n",
+ "\n",
+ "#calculation\n",
+ "Vh=245.#highest voltage(in kV)\n",
+ "Vg=Vh*sqrt(2.)/sqrt(3)#highest system voltage\n",
+ "Vs=3*Vg#expected switching voltage(in kV)\n",
+ "Vfw=760.#impulse sparkover voltage(in kV)\n",
+ "Vd1=690.#discharge voltage(in kV) for 5 kA\n",
+ "Vd2=615.#discharge voltage(in kV) for 2 kA\n",
+ "#SIL = BIL/BtoS = 846 ~ 850 kV\n",
+ "SIL=850.#value of SIL(in kV)\n",
+ "Pmlig=(BIL-Vd1)/BIL#protective margin for lightning impulses\n",
+ "Pmswi=(SIL-Vd2)/SIL#protective margin for switching gears\n",
+ "Pmspr=(BIL-Vfw)/BIL#margin when lightning arrester just sparks\n",
+ "#results\n",
+ "print 'The protective margin for lightning impulses is (percentage) = ',round(Pmlig*100,1)\n",
+ "print '\\nThe protective margin for switching gears is (percentage) = ',round(Pmswi*100,1)\n",
+ "print '\\nThe margin when lightning arrester just sparks is (percentage) = ',round(Pmspr*100,1)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter9_3.ipynb b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter9_3.ipynb
new file mode 100644
index 00000000..13f9024c
--- /dev/null
+++ b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/Chapter9_3.ipynb
@@ -0,0 +1,452 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 9: Non Destructive testing of materials and electrical apparatus"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1: pg 395"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The volume resistivity is (ohmcm) = 1.226e+14\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 9.1\n",
+ "#calculation of the volume resistivity\n",
+ "from math import pi\n",
+ "#given data\n",
+ "V=1000.#applied voltage(in V)\n",
+ "Rs=10**7#standard resistance(in ohm)\n",
+ "n=3000.#universal shunt ratio\n",
+ "Ds=33.3#deflection(in cm) for Rs\n",
+ "D=3.2#deflection(in cm)\n",
+ "d=10.#diameter(in cm) of the electrodes\n",
+ "t=2*10**-1#thickness(in cm) of the specimen\n",
+ "\n",
+ "#calculation\n",
+ "G=V/(Rs*n*Ds)#galvanometer sensitivity\n",
+ "R=V/(D*G)#resistance of the specimen\n",
+ "r=d/2#radius of the electrodes\n",
+ "rho=(pi*r**2*R)/t#volume resistivity\n",
+ "#results\n",
+ "print '%s %.3e' %('The volume resistivity is (ohmcm) = ',rho)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2: pg 395"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The resistivity of the specimen is (ohmcm) = 1.031e+13\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 9.2\n",
+ "#calculation of resistivity of the specimen\n",
+ "import math\n",
+ "from math import log\n",
+ "#given data\n",
+ "tm=30.#time (in minute)\n",
+ "ts=20.#time(in second)\n",
+ "Vn=1000.#voltage(in V) to which the condenser was charged\n",
+ "V=500.#voltage(in V) fall to\n",
+ "C=0.1*10**-6#capacitance(in Farad)\n",
+ "d=10.#diameter(in cm) of the electrodes\n",
+ "th=2*10**-1#thickness(in cm) of the specimen\n",
+ "\n",
+ "#calculation\n",
+ "t=(tm*60)+ts\n",
+ "R=t/(C*log(Vn/V))#resistance\n",
+ "r=d/2#radius of the electrodes\n",
+ "rho=(math.pi*r**2*R)/th#volume resistivity\n",
+ "#results\n",
+ "print '%s %.3e' %('The resistivity of the specimen is (ohmcm) = ',rho)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3: pg 396"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The dielectric constant is 4.2\n",
+ "The complex permittivity(in F/m)is 3.714e-11 -4.456e-14 j\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 9.3\n",
+ "#calculation of dielectric constant and complex permittivity of bakelite\n",
+ "from cmath import pi\n",
+ "#given data\n",
+ "C=147*10**-12#capacitance(in Farad)\n",
+ "Ca=35*10**-12#air capacitance(in Farad)\n",
+ "tandelta=0.0012\n",
+ "epsilon0=(36*pi*10**9)**-1#electrical permittivity(in F/m) of free space\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "epsilonr=C/Ca#dielectric constant\n",
+ "Kdash=epsilonr\n",
+ "Kdashdash=tandelta*Kdash\n",
+ "Kim=complex(Kdash,-Kdashdash)\n",
+ "epsilonast=epsilon0*Kim\n",
+ "\n",
+ "print 'The dielectric constant is ',epsilonr\n",
+ "print '%s %.3e %.3e %s' %('The complex permittivity(in F/m)is ',epsilonast.real,epsilonast.imag,'j')\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4: pg 396"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The capacitance is (pF) = 500.0\n",
+ "\n",
+ "The value of tandelta of bushing is 0.00125\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 9.4\n",
+ "#calculation of capacitance and tandelta of bushing\n",
+ "from math import pi\n",
+ "#given data\n",
+ "R3=3180.#resistance(in ohm)\n",
+ "R4=636.#resistance(in ohm)\n",
+ "Cs=100.#standard condenser(in pF)\n",
+ "f=50.#frequency(in Hz)\n",
+ "C3=0.00125*10**-6#capacitance(in farad)\n",
+ "\n",
+ "#calculation\n",
+ "omega=2*pi*f\n",
+ "Cx=R3*Cs/R4#unknown capacitance\n",
+ "tandelta=omega*C3*R3\n",
+ "#results\n",
+ "print 'The capacitance is (pF) = ',Cx\n",
+ "print '\\nThe value of tandelta of bushing is ',round(tandelta,5)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5: pg 396"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The dielectric constant is 2.19\n",
+ "\n",
+ "The value of tandelta of the transformer oil is 0.00044\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 9.5\n",
+ "#calculation of dielectric constant and tandelta of the transformer oil\n",
+ "\n",
+ "#given data\n",
+ "f=1*10**3#frequency(in Hz)\n",
+ "C1=504.#capacitance(in pF) for standard condenser and leads\n",
+ "D1=0.0003#dissipation factor for standard condenser and leads\n",
+ "C2=525.#capacitance(in pF) for standard condenser in parallel with the empty test cell\n",
+ "D2=0.00031#dissipation factor for standard condenser in parallel with the empty test cell\n",
+ "C3=550.#capacitance(in pF) for standard condenser in parallel with the test cell and oil\n",
+ "D3=0.00075#dissipation factor for standard condenser in parallel with the test cell and oil\n",
+ "\n",
+ "#calculation\n",
+ "Ctc=C2-C1#capacitance of the test cell\n",
+ "Ctcoil=C3-C1#capacitance of the test cell + oil\n",
+ "epsilonr=Ctcoil/Ctc#dielectric constant of oil\n",
+ "deltaDoil=D3-D2#deltaD of oil\n",
+ "#results\n",
+ "print 'The dielectric constant is ',round(epsilonr,2)\n",
+ "print '\\nThe value of tandelta of the transformer oil is ',round(deltaDoil,5)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6: pg 397"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The charge transferred from the cavity is (pC) = 0.92\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 9.6\n",
+ "#calculation of magnitude of the charge transferred from the cavity\n",
+ "from math import pi\n",
+ "#given data\n",
+ "Vd=0.2#discharge voltage(in V)\n",
+ "s=1#sensitivity(in pC/V)\n",
+ "epsilonr=2.5#relative permittivity\n",
+ "epsilon0=(36*pi*10**9)**-1#electrical permittivity(in F/m) of free space\n",
+ "d1=1*10**-2#diameter(in m) of the cylindrical disc\n",
+ "t1=1*10**-2#thickness(in m) of the cylindrical disc\n",
+ "d2=1*10**-3#diameter(in m) of the cylindrical cavity\n",
+ "t2=1*10**-3#thickness(in m) of the cylindrical cavity\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "Dm=Vd*s#discharge magnitude\n",
+ "Ca=epsilon0*(pi*(d2/2)**2)/t2#capacitance of the cavity\n",
+ "Cb=epsilon0*epsilonr*(pi*(d2/2)**2)/(t1-t2)#capacitance\n",
+ "qc=((Ca+Cb)/Cb)*Dm\n",
+ "#results\n",
+ "print 'The charge transferred from the cavity is (pC) = ',round(qc,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7: pg 397"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The dielectric constant is 5.8\n",
+ "\n",
+ "The loss factor tandelta is 5e-06\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 9.7\n",
+ "#calculation of dielectric constant and loss factor tandelta\n",
+ "from math import pi\n",
+ "#given data\n",
+ "R3=1000./pi#resistance(in ohm) in CD branch\n",
+ "R4=62.#variable resistance(in ohm)\n",
+ "Cs=100.*10**-12#standard capacitance(in F)\n",
+ "epsilon0=8.854*10**-12#electrical permittivity(in F/m) of free space\n",
+ "f=50.#frequency(in Hz)\n",
+ "C3=50.*10**-9#variable capacitor(in F)\n",
+ "d=1.*10**-3#thickness(in m) of sheet\n",
+ "a=100.*10**-4#electrode effective area(in m**2)\n",
+ "\n",
+ "#calculation\n",
+ "Cx=R3*Cs/R4\n",
+ "epsilonr=Cx*d/(epsilon0*a)\n",
+ "omega=2*pi*f\n",
+ "tandelta=omega*C3*R3*d\n",
+ "#results\n",
+ "print 'The dielectric constant is ',round(epsilonr,2)\n",
+ "print '\\nThe loss factor tandelta is ',round(tandelta,7)\n",
+ "#In equation of tandelta d is multiplied\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8: pg 398"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The voltage across AD branch at balance is (V) = 0.1\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 9.8\n",
+ "#calculation of voltage at balance\n",
+ "from math import pi,sqrt\n",
+ "#given data\n",
+ "V=10000#applied voltage(in V)\n",
+ "R3=1000/pi#resistance(in ohm) in CD branch\n",
+ "R4=62#variable resistance(in ohm)\n",
+ "Cs=100*10**-12#standard capacitance(in F)\n",
+ "f=50#frequency(in Hz)\n",
+ "C3=50*10**-9#variable capacitor(in F)\n",
+ "\n",
+ "#calculation\n",
+ "Rx=C3*R4/Cs\n",
+ "Cx=R3*Cs/R4\n",
+ "omega=2*pi*f\n",
+ "zx=complex(Rx,-1/(omega*Cx))\n",
+ "VR4=R4*V/(R4+zx)\n",
+ "MVR4=sqrt((VR4.real)**2+VR4.imag**2)#magnitude\n",
+ "#results\n",
+ "print 'The voltage across AD branch at balance is (V) = ',round(MVR4,1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9: pg 399"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum value of capacitance is (nF) = 11.1\n",
+ "\n",
+ "The minimum value of capacitance is (pF) = 10.0\n",
+ "\n",
+ "The maximum value of tandelta is 3.87\n",
+ "\n",
+ "The minimum value of tandelta is 3.14e-05\n"
+ ]
+ }
+ ],
+ "source": [
+ "#example 9.9\n",
+ "#calculation of maximum and minimum value of capacitance and tandelta\n",
+ "from math import pi\n",
+ "#given data\n",
+ "R3min=100.#minimum value of R3 resistance(in ohm)\n",
+ "R3max=11100.#maximum value of R3 resistance(in ohm)\n",
+ "R4min=100.#minimum value of R4 resistance(in ohm)\n",
+ "R4max=1000.#maximum value of R4 resistance(in ohm)\n",
+ "Cs=100.*10**-12#standard capacitance(in farad)\n",
+ "C3min=1.*10**-9#minimum value of C3 capacitance(in farad)\n",
+ "C3max=1.11*10**-6#maximum value of C3 capacitance(in farad)\n",
+ "f=50.#frequency(in Hz)\n",
+ "\n",
+ "#calculation\n",
+ "Cxmax=R3max*Cs/R4min\n",
+ "Cxmin=R3min*Cs/R4max\n",
+ "omega=2*pi*f\n",
+ "tandeltamax=omega*R3max*C3max\n",
+ "tandeltamin=omega*R3min*C3min\n",
+ "#results\n",
+ "print 'The maximum value of capacitance is (nF) = ',round(Cxmax*10**9,1)\n",
+ "print '\\nThe minimum value of capacitance is (pF) = ',round(Cxmin*10**12)\n",
+ "print '\\nThe maximum value of tandelta is ',round(tandeltamax,2)\n",
+ "print '%s %.2e' %('\\nThe minimum value of tandelta is ',tandeltamin)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/screenshots/chapter2_3.png b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/screenshots/chapter2_3.png
new file mode 100644
index 00000000..78f269d9
--- /dev/null
+++ b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/screenshots/chapter2_3.png
Binary files differ
diff --git a/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/screenshots/chapter3_3.png b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/screenshots/chapter3_3.png
new file mode 100644
index 00000000..ecdd0b3d
--- /dev/null
+++ b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/screenshots/chapter3_3.png
Binary files differ
diff --git a/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/screenshots/chapter4_3.png b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/screenshots/chapter4_3.png
new file mode 100644
index 00000000..6b19b460
--- /dev/null
+++ b/High_Voltage_Engineering_by_V_Kamaraju_,_M_S_Naidu/screenshots/chapter4_3.png
Binary files differ
diff --git a/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter2.ipynb b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter2.ipynb
new file mode 100644
index 00000000..5293973c
--- /dev/null
+++ b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter2.ipynb
@@ -0,0 +1,136 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:e69ccbb1735a0c440e4d73af0d7e8991c9d99315b31e67bbedcd0e1e4ee9909a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2: Memory Management"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1, page no. 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Enter the number of element(s) to be added: \"\n",
+ "n = int(raw_input())\n",
+ "nos = []\n",
+ "for i in range(1,n+1):\n",
+ " print \"Enter the %d element: \" %i\n",
+ " nos.append(int(raw_input()))\n",
+ "\n",
+ "sum = 0\n",
+ "for i in range(0,n):\n",
+ " sum += nos[i]\n",
+ "\n",
+ "print \"The SUM of no(s) is: %d\" %sum"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the number of element(s) to be added: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 1 element: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 2 element: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 3 element: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter the 4 element: \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The SUM of no(s) is: 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter3.ipynb b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter3.ipynb
new file mode 100644
index 00000000..6b3d3b24
--- /dev/null
+++ b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter3.ipynb
@@ -0,0 +1,678 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 3: The Stack"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1, page no. 28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "1. PUSH\n",
+ "2. POP\n",
+ "3. TRAVERSE\n",
+ "Enter your choice: \n",
+ "1\n",
+ "Enter the element to be inserted: \n",
+ "5\n",
+ "\n",
+ "Print Y/y to continue\n",
+ "y\n",
+ "1. PUSH\n",
+ "2. POP\n",
+ "3. TRAVERSE\n",
+ "Enter your choice: \n",
+ "1\n",
+ "Enter the element to be inserted: \n",
+ "10\n",
+ "\n",
+ "Print Y/y to continue\n",
+ "3\n"
+ ]
+ }
+ ],
+ "source": [
+ "MAXSIZE = 100\n",
+ "\n",
+ "class stack:\n",
+ " def __init__(self):\n",
+ " self.stack = []\n",
+ " self.top = -1\n",
+ "\n",
+ "def push(pu):\n",
+ " if(pu.top == MAXSIZE-1):\n",
+ " print \"The stack is full\"\n",
+ " else:\n",
+ " print \"Enter the element to be inserted: \"\n",
+ " item = int(raw_input())\n",
+ " pu.stack.append(item)\n",
+ " pu.top += 1\n",
+ "\n",
+ "def pop(po):\n",
+ " if(po.top == -1):\n",
+ " print \"Stack is empty\"\n",
+ " else:\n",
+ " item = po.stack[po.top]\n",
+ " po.top-=1\n",
+ " print \"The item deleted is: %d\" %item\n",
+ "\n",
+ "\n",
+ "def traverse(pt):\n",
+ " if(pt.top == -1):\n",
+ " print \"Stack is empty\"\n",
+ " else:\n",
+ " print \"The element(s) in the stack are...\"\n",
+ " i = pt.top\n",
+ " while(i>=0):\n",
+ " print \"%d\" %pt.stack[i],\n",
+ " i-=1\n",
+ "\n",
+ "ps = stack()\n",
+ "ch = 'y'\n",
+ "\n",
+ "while(ch == 'Y' or ch == 'y'):\n",
+ " print \"1. PUSH\"\n",
+ " print \"2. POP\"\n",
+ " print \"3. TRAVERSE\"\n",
+ " print \"Enter your choice: \"\n",
+ " choice = int(raw_input())\n",
+ " if(choice == 1):\n",
+ " push(ps)\n",
+ " elif(choice == 2):\n",
+ " pop(ps)\n",
+ " elif(choice == 3):\n",
+ " traverse(ps)\n",
+ " else:\n",
+ " print \"You entered a wrong choice...\"\n",
+ " \n",
+ " print \"\\nPrint Y/y to continue\"\n",
+ " ch = raw_input()\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Exampe 2, page no. 31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "1. PUSH\n",
+ "2. POP\n",
+ "3. TRAVERSE\n",
+ "Enter your choice: \n",
+ "1\n",
+ "Enter the element to be inserted: \n",
+ "5\n",
+ "\n",
+ "Print Y/y to continue\n",
+ "y\n",
+ "1. PUSH\n",
+ "2. POP\n",
+ "3. TRAVERSE\n",
+ "Enter your choice: \n",
+ "1\n",
+ "Enter the element to be inserted: \n",
+ "10\n",
+ "\n",
+ "Print Y/y to continue\n",
+ "y\n",
+ "1. PUSH\n",
+ "2. POP\n",
+ "3. TRAVERSE\n",
+ "Enter your choice: \n",
+ "3\n",
+ "The element(s) in the stack are...\n",
+ "10 5 \n",
+ "Print Y/y to continue\n",
+ "n\n"
+ ]
+ }
+ ],
+ "source": [
+ "MAXSIZE = 100\n",
+ "\n",
+ "class stack:\n",
+ " \n",
+ " def __init__(self):\n",
+ " self.stack = []\n",
+ " self.top = -1\n",
+ " \n",
+ " def push(self,pu):\n",
+ " if(pu.top == MAXSIZE-1):\n",
+ " print \"The stack is full\"\n",
+ " else: \n",
+ " print \"Enter the element to be inserted: \"\n",
+ " item = int(raw_input())\n",
+ " pu.stack.append(item)\n",
+ " pu.top += 1\n",
+ "\n",
+ " def pop(self,po):\n",
+ " if(po.top == -1):\n",
+ " print \"Stack is empty\"\n",
+ " else:\n",
+ " item = po.stack[po.top]\n",
+ " po.top-=1\n",
+ " print \"The item deleted is: %d\" %item\n",
+ " \n",
+ " def traverse(self,pt):\n",
+ " if(pt.top == -1):\n",
+ " print \"Stack is empty\"\n",
+ " else:\n",
+ " print \"The element(s) in the stack are...\"\n",
+ " i = pt.top\n",
+ " while(i>=0):\n",
+ " print \"%d\" %pt.stack[i],\n",
+ " i-=1\n",
+ "\n",
+ "ps = stack()\n",
+ "ch = 'y'\n",
+ "\n",
+ "while(ch == 'Y' or ch == 'y'):\n",
+ " print \"1. PUSH\"\n",
+ " print \"2. POP\"\n",
+ " print \"3. TRAVERSE\"\n",
+ " print \"Enter your choice: \"\n",
+ " choice = int(raw_input())\n",
+ " if(choice == 1):\n",
+ " ps.push(ps)\n",
+ " elif(choice == 2):\n",
+ " ps.pop(ps)\n",
+ " elif(choice == 3):\n",
+ " ps.traverse(ps)\n",
+ " else:\n",
+ " print \"You entered a wrong choice...\"\n",
+ " \n",
+ " print \"\\nPrint Y/y to continue\"\n",
+ " ch = raw_input()\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3, page no. 31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter a number: \n",
+ "5\n",
+ "Factorial is: 120\n"
+ ]
+ }
+ ],
+ "source": [
+ "def fact(n):\n",
+ " if (n<=0):\n",
+ " return 1\n",
+ " else:\n",
+ " return n * fact(n-1)\n",
+ "\n",
+ "print \"Enter a number: \"\n",
+ "n = int(raw_input())\n",
+ "n = fact(n)\n",
+ "print \"Factorial is: %d\" %n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4, page no. 36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "-----------Tower of Hanoi-------------\n",
+ "Enter number of disks: \n",
+ "4\n",
+ "Move from disk 1 from tower X to tower Z\n",
+ "\n",
+ "Move from disk 2 from tower X to tower Y\n",
+ "Move from disk 1 from tower Z to tower Y\n",
+ "\n",
+ "Move from disk 3 from tower X to tower Z\n",
+ "Move from disk 1 from tower Y to tower X\n",
+ "\n",
+ "Move from disk 2 from tower Y to tower Z\n",
+ "Move from disk 1 from tower X to tower Z\n",
+ "\n",
+ "Move from disk 4 from tower X to tower Y\n",
+ "Move from disk 1 from tower Z to tower Y\n",
+ "\n",
+ "Move from disk 2 from tower Z to tower X\n",
+ "Move from disk 1 from tower Y to tower X\n",
+ "\n",
+ "Move from disk 3 from tower Z to tower Y\n",
+ "Move from disk 1 from tower X to tower Z\n",
+ "\n",
+ "Move from disk 2 from tower X to tower Y\n",
+ "Move from disk 1 from tower Z to tower Y\n",
+ "Press any key to continue...\n",
+ "\n"
+ ]
+ },
+ {
+ "data": {
+ "text/plain": [
+ "''"
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "class tower:\n",
+ " \n",
+ " def __init__(self):\n",
+ " self.nodisk = 0\n",
+ " self.fromtower = \"\"\n",
+ " self.totower = \"\"\n",
+ " self.auxtower = \"\"\n",
+ " \n",
+ " def hanoi(self,i, frm_t, to_t, aux_t):\n",
+ " if(i <= 1):\n",
+ " print \"Move from disk 1 from tower \" + frm_t + \" to tower \" + to_t\n",
+ " return\n",
+ " self.hanoi(i-1, frm_t, aux_t, to_t)\n",
+ " print \"\\nMove from disk \" + str(i) + \" from tower \" + frm_t + \" to tower \" + to_t\n",
+ " self.hanoi(i-1,aux_t, to_t, frm_t)\n",
+ "\n",
+ "print \"-----------Tower of Hanoi-------------\"\n",
+ "print \"Enter number of disks: \"\n",
+ "no = int(raw_input())\n",
+ "ob = tower()\n",
+ "ob.hanoi(no,'X','Y','Z')\n",
+ "print \"Press any key to continue...\"\n",
+ "raw_input()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5, page no. 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter an infix expression: \n",
+ "a+b\n",
+ "The postfix expression is: \n",
+ "['a', 'b', '+']\n",
+ "Do you want to continue? Y/y \n",
+ "n\n"
+ ]
+ }
+ ],
+ "source": [
+ "MAXSIZE = 100\n",
+ "\n",
+ "class stack:\n",
+ " def __init__(self):\n",
+ " self.stack = []\n",
+ " self.top = -1\n",
+ "\n",
+ "def push(pu,symbol):\n",
+ " if(pu.top == MAXSIZE-1):\n",
+ " print \"The stack is full\"\n",
+ " else:\n",
+ " pu.stack.append(symbol)\n",
+ " pu.top += 1\n",
+ " return pu\n",
+ "\n",
+ "def pop(po):\n",
+ " if(po.top == -1):\n",
+ " print \"Stack is empty\"\n",
+ " else:\n",
+ " symbol = po.stack.pop()\n",
+ " po.top-=1\n",
+ " return symbol,po\n",
+ " \n",
+ " \n",
+ "def prec(symbol):\n",
+ " if symbol == '(':\n",
+ " return 1\n",
+ " elif symbol == ')':\n",
+ " return 2\n",
+ " elif symbol == '+' or symbol == '-':\n",
+ " return 3\n",
+ " elif symbol == '*' or symbol == '/' or symbol == '%':\n",
+ " return 4\n",
+ " elif symbol == '^':\n",
+ " return 5\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "def infix_postfix(infix):\n",
+ " \n",
+ " length = len(infix)\n",
+ " ps = stack()\n",
+ " infix += ')'\n",
+ " ps = push(ps,'(')\n",
+ " postfix = []\n",
+ " for i in range(0,length+1):\n",
+ " ret_val = prec(infix[i])\n",
+ " if ret_val == 1:\n",
+ " ps = push(ps,infix[i])\n",
+ " elif(ret_val == 2):\n",
+ " ch,ps = pop(ps)\n",
+ " while(ch != '('):\n",
+ " postfix.append(ch)\n",
+ " ch,ps = pop(ps)\n",
+ " elif(ret_val == 3):\n",
+ " ch,ps = pop(ps)\n",
+ " while(prec(ch) >= 3):\n",
+ " postfix.append(ch)\n",
+ " ch,ps = pop(ps)\n",
+ " ps=push(ps,ch)\n",
+ " ps=push(ps,infix[i])\n",
+ " elif(ret_val == 4):\n",
+ " ch,ps = pop(ps)\n",
+ " while(prec(ch) >= 4):\n",
+ " postfix.append(ch)\n",
+ " ch,ps = pop(ps)\n",
+ " ps=push(ps,ch)\n",
+ " ps=push(ps,infix[i])\n",
+ " elif(ret_val == 5):\n",
+ " ch,ps = pop(ps)\n",
+ " while(prec(ch) == 5):\n",
+ " postfix.append(ch)\n",
+ " ch,ps = pop(ps)\n",
+ " ps=push(ps,ch)\n",
+ " ps=push(ps,infix[i])\n",
+ " else:\n",
+ " postfix.append(infix[i])\n",
+ "\n",
+ " print \"The postfix expression is: \"\n",
+ " print postfix\n",
+ "\n",
+ "choice = 'y'\n",
+ "while (choice == 'Y' or choice == 'y'):\n",
+ " print \"Enter an infix expression: \"\n",
+ " infix = raw_input()\n",
+ " infix_postfix(infix)\n",
+ " print \"Do you want to continue? Y/y \"\n",
+ " choice = raw_input()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6, page no. 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter an infix expression: \n",
+ "a+b\n",
+ "The postfix expression is: \n",
+ "['a', 'b', '+']\n",
+ "Do you want to continue? Y/y \n",
+ "n\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "MAXSIZE = 100\n",
+ "\n",
+ "class stack:\n",
+ " def __init__(self):\n",
+ " self.stack = []\n",
+ " self.top = -1\n",
+ "\n",
+ " def push(self, pu, symbol):\n",
+ " if(pu.top == MAXSIZE-1):\n",
+ " print \"The stack is full\"\n",
+ " else:\n",
+ " pu.stack.append(symbol)\n",
+ " pu.top += 1\n",
+ " return pu\n",
+ "\n",
+ " def pop(self, po):\n",
+ " if(po.top == -1):\n",
+ " print \"Stack is empty\"\n",
+ " else:\n",
+ " symbol = po.stack.pop()\n",
+ " po.top-=1\n",
+ " return symbol,po\n",
+ " \n",
+ " \n",
+ " def prec(self, symbol):\n",
+ " if symbol == '(':\n",
+ " return 1\n",
+ " elif symbol == ')':\n",
+ " return 2\n",
+ " elif symbol == '+' or symbol == '-':\n",
+ " return 3\n",
+ " elif symbol == '*' or symbol == '/' or symbol == '%':\n",
+ " return 4\n",
+ " elif symbol == '^':\n",
+ " return 5\n",
+ " else:\n",
+ " return 0\n",
+ "\n",
+ "def infix_postfix(infix):\n",
+ " \n",
+ " length = len(infix)\n",
+ " ps = stack()\n",
+ " infix += ')'\n",
+ " ps = ps.push(ps,'(')\n",
+ " postfix = []\n",
+ " for i in range(0,length+1):\n",
+ " ret_val = ps.prec(infix[i])\n",
+ " if ret_val == 1:\n",
+ " ps = ps.push(ps,infix[i])\n",
+ " elif(ret_val == 2):\n",
+ " ch,ps = ps.pop(ps)\n",
+ " while(ch != '('):\n",
+ " postfix.append(ch)\n",
+ " ch,ps = ps.pop(ps)\n",
+ " elif(ret_val == 3):\n",
+ " ch,ps = ps.pop(ps)\n",
+ " while(ps.prec(ch) >= 3):\n",
+ " postfix.append(ch)\n",
+ " ch,ps = ps.pop(ps)\n",
+ " ps = ps.push(ps,ch)\n",
+ " ps = ps.push(ps,infix[i])\n",
+ " elif(ret_val == 4):\n",
+ " ch,ps = ps.pop(ps)\n",
+ " while(ps.prec(ch) >= 4):\n",
+ " postfix.append(ch)\n",
+ " ch,ps = ps.pop(ps)\n",
+ " ps = ps.push(ps,ch)\n",
+ " ps = ps.push(ps,infix[i])\n",
+ " elif(ret_val == 5):\n",
+ " ch,ps = ps.pop(ps)\n",
+ " while(ps.prec(ch) == 5):\n",
+ " postfix.append(ch)\n",
+ " ch,ps = ps.pop(ps)\n",
+ " ps = ps.push(ps,ch)\n",
+ " ps = ps.push(ps,infix[i])\n",
+ " else:\n",
+ " postfix.append(infix[i])\n",
+ " print \"The postfix expression is: \"\n",
+ " print postfix\n",
+ "\n",
+ "choice = 'y'\n",
+ "while (choice == 'Y' or choice == 'y'):\n",
+ " print \"Enter an infix expression: \"\n",
+ " infix = raw_input()\n",
+ " infix_postfix(infix)\n",
+ " print \"Do you want to continue? Y/y \"\n",
+ " choice = raw_input()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7, page no. 57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter the postfix expression: "
+ ]
+ }
+ ],
+ "source": [
+ "MAXSIZE = 100\n",
+ "\n",
+ "class stack:\n",
+ " def __init__(self):\n",
+ " self.stack = []\n",
+ " self.top = -1\n",
+ "\n",
+ "def push(pu,item):\n",
+ " if(pu.top == MAXSIZE-1):\n",
+ " print \"The stack is full\"\n",
+ " else:\n",
+ " pu.stack.append(item)\n",
+ " pu.top += 1\n",
+ " return pu\n",
+ "\n",
+ "def pop(po):\n",
+ " if(po.top == -1):\n",
+ " print \"Stack is empty\"\n",
+ " else:\n",
+ " item = po.stack.pop()\n",
+ " po.top-=1\n",
+ " return po, item\n",
+ "\n",
+ "def postfix_eval(postfix):\n",
+ " ps = stack()\n",
+ " for i in range(0,len(postfix)):\n",
+ " if(postfix[i]<='9' and postfix[i]>='0'):\n",
+ " ps = push(ps, postfix[i])\n",
+ " else:\n",
+ " ps, a = pop(ps)\n",
+ " ps, b = pop(ps)\n",
+ " a = int(a)\n",
+ " b = int(b)\n",
+ " temp = 0\n",
+ " if postfix[i] == \"+\":\n",
+ " temp = b+a\n",
+ " elif postfix[i] == \"-\":\n",
+ " temp = b-a\n",
+ " elif postfix[i] == \"*\":\n",
+ " temp = b*a\n",
+ " elif postfix[i] == \"/\":\n",
+ " temp = b/a\n",
+ " elif postfix[i] == \"%\":\n",
+ " temp = a%b\n",
+ " elif postfix[i] == \"^\":\n",
+ " temp = pow(a,b)\n",
+ " ps = push(ps, temp)\n",
+ " ps, a = pop(ps)\n",
+ " return a\n",
+ "\n",
+ "choice = \"y\"\n",
+ "while(choice == \"Y\" or choice == \"y\"):\n",
+ " print \"Enter the postfix expression: \",\n",
+ " post_fix = raw_input()\n",
+ " print \"The post fix evaluation is \", postfix_eval(post_fix),\n",
+ " print \"\\nYou want to continue(Y/y) ?? \"\n",
+ " choice = raw_input()"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter4.ipynb b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter4.ipynb
new file mode 100644
index 00000000..dfa6f8e1
--- /dev/null
+++ b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter4.ipynb
@@ -0,0 +1,513 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4: The Queue"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1, page no. 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "1. Insert\n",
+ "2. Delete\n",
+ "3. Display\n",
+ "4. Quit\n",
+ "Enter your choice: \n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "MAX = 50\n",
+ "queue_arr = []\n",
+ "rear = [-1]\n",
+ "front = [-1]\n",
+ "\n",
+ "def insert():\n",
+ " if (rear[0] == MAX-1):\n",
+ " print \"Queue is full...\"\n",
+ " return\n",
+ " else:\n",
+ " if(front[0] == -1):\n",
+ " front[0] = 0\n",
+ " print \"Input the element to be added: \"\n",
+ " added_item = int(raw_input())\n",
+ " rear[0] = rear[0]+1\n",
+ " queue_arr.append(added_item)\n",
+ "\n",
+ "def que_del(): # del() is an inbuilt function in python so we name it as que_del here\n",
+ " print front[0]\n",
+ " if(front[0] == -1 or front[0]>rear[0]):\n",
+ " print \"Queue is empty...\"\n",
+ " return\n",
+ " else:\n",
+ " dell = front[0]\n",
+ " print \"Deleted element from queue is: \", queue_arr[dell]\n",
+ " front[0] = front[0]+1\n",
+ "\n",
+ "def display():\n",
+ " if(front[0] == -1 or front[0]>rear[0]):\n",
+ " print \"Queue is empty...\"\n",
+ " return\n",
+ " else:\n",
+ " print \"Queue is: \"\n",
+ " for i in range(front[0],rear[0]+1):\n",
+ " print queue_arr[i],\n",
+ "\n",
+ "while(1):\n",
+ " print \"\\n1. Insert\"\n",
+ " print \"2. Delete\"\n",
+ " print \"3. Display\"\n",
+ " print \"4. Quit\"\n",
+ " print \"Enter your choice: \"\n",
+ " choice = raw_input()\n",
+ " if choice == '1':\n",
+ " insert()\n",
+ " elif choice == '2':\n",
+ " que_del()\n",
+ " elif choice == '3':\n",
+ " display()\n",
+ " elif choice == '4':\n",
+ " sys.exit()\n",
+ " else:\n",
+ " print \"You entered an invalid choice...\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2, page no. 73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "1. Insert\n",
+ "2. Delete\n",
+ "3. Display\n",
+ "4. Quit\n",
+ "Enter your choice: \n",
+ "1\n",
+ "Enter element to be added: \n",
+ "5\n",
+ "\n",
+ "1. Insert\n",
+ "2. Delete\n",
+ "3. Display\n",
+ "4. Quit\n",
+ "Enter your choice: \n",
+ "1\n",
+ "Enter element to be added: \n",
+ "10\n",
+ "\n",
+ "1. Insert\n",
+ "2. Delete\n",
+ "3. Display\n",
+ "4. Quit\n",
+ "Enter your choice: \n",
+ "1\n",
+ "Enter element to be added: \n",
+ "15\n",
+ "\n",
+ "1. Insert\n",
+ "2. Delete\n",
+ "3. Display\n",
+ "4. Quit\n",
+ "Enter your choice: \n",
+ "3\n",
+ "Queue Elements: 5 10 15 \n",
+ "1. Insert\n",
+ "2. Delete\n",
+ "3. Display\n",
+ "4. Quit\n",
+ "Enter your choice: \n",
+ "4\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "MAX = 50\n",
+ "\n",
+ "class circular_queue:\n",
+ " def __init__(self):\n",
+ " self.cqueue_arr = []\n",
+ " self.rear = -1\n",
+ " self.front = -1\n",
+ "\n",
+ " def insert(self):\n",
+ " if((self.front == 0 and self.rear == MAX-1) or (self.front == self.rear+1)):\n",
+ " print \"Queue is full...\"\n",
+ " return\n",
+ " if(self.front == -1):\n",
+ " self.front = 0\n",
+ " self.rear = 0\n",
+ " else:\n",
+ " if(self.rear == MAX-1):\n",
+ " rear = 0\n",
+ " else:\n",
+ " self.rear = self.rear+1\n",
+ " print \"Enter element to be added: \"\n",
+ " item_added = int(raw_input())\n",
+ " self.cqueue_arr.append(item_added)\n",
+ " \n",
+ " def que_del(self):\n",
+ " if(self.front == -1):\n",
+ " print \"Queue is empty...\"\n",
+ " return\n",
+ " print \"Element deleted from queue is: \", self.cqueue_arr[self.front]\n",
+ " if(self.front == self.rear):\n",
+ " self.front = -1\n",
+ " self.rear = -1\n",
+ " else:\n",
+ " if(self.front == MAX-1):\n",
+ " self.front = 0\n",
+ " else:\n",
+ " self.front += 1\n",
+ " \n",
+ " def display(self):\n",
+ " front_pos = self.front\n",
+ " rear_pos = self.rear\n",
+ " if(self.front == -1):\n",
+ " print \"Queue is empty...\"\n",
+ " return\n",
+ " print \"Queue Elements: \",\n",
+ " if(front_pos <= rear_pos):\n",
+ " while(front_pos <= rear_pos):\n",
+ " print \" \", self.cqueue_arr[front_pos],\n",
+ " front_pos += 1\n",
+ " \n",
+ "co = circular_queue()\n",
+ "while(1):\n",
+ " print \"\\n1. Insert\"\n",
+ " print \"2. Delete\"\n",
+ " print \"3. Display\"\n",
+ " print \"4. Quit\"\n",
+ " print \"Enter your choice: \"\n",
+ " choice = int(raw_input())\n",
+ " if choice == 1:\n",
+ " co.insert()\n",
+ " elif choice == 2:\n",
+ " co.que_del()\n",
+ " elif choice == 3:\n",
+ " co.display()\n",
+ " elif choice == 4:\n",
+ " sys.exit()\n",
+ " else:\n",
+ " print \"You entered an invalid choice...\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3, page no. 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "1. Input restricted dequeue\n",
+ "2. Output restricted dequeue\n",
+ "3. Enter your choice: \n",
+ "2\n",
+ "\n",
+ "1. Insert at right\n",
+ "2. Insert at left\n",
+ "3. Delete from left\n",
+ "4. Display\n",
+ "5 .Quit\n",
+ "Enter your choice: \n",
+ "1\n",
+ "Input the element for adding in queue: \n",
+ "5\n",
+ "\n",
+ "1. Insert at right\n",
+ "2. Insert at left\n",
+ "3. Delete from left\n",
+ "4. Display\n",
+ "5 .Quit\n",
+ "Enter your choice: \n",
+ "1\n",
+ "Input the element for adding in queue: \n",
+ "10\n",
+ "\n",
+ "1. Insert at right\n",
+ "2. Insert at left\n",
+ "3. Delete from left\n",
+ "4. Display\n",
+ "5 .Quit\n",
+ "Enter your choice: \n",
+ "3\n",
+ "Element deleted from queue is: 5\n",
+ "\n",
+ "1. Insert at right\n",
+ "2. Insert at left\n",
+ "3. Delete from left\n",
+ "4. Display\n",
+ "5 .Quit\n",
+ "Enter your choice: \n",
+ "4\n",
+ "Queue elements : 10 \n",
+ "1. Insert at right\n",
+ "2. Insert at left\n",
+ "3. Delete from left\n",
+ "4. Display\n",
+ "5 .Quit\n",
+ "Enter your choice: \n",
+ "5\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "MAX = 50\n",
+ "left = -1\n",
+ "right = -1\n",
+ "dqueue_arr = []\n",
+ "\n",
+ "# insert element to right\n",
+ "def insert_right():\n",
+ " global left, right, dqueue_arr\n",
+ " if ((left == 0 and right == MAX-1) or (left == right+1)):\n",
+ " print \"Queue is full...\"\n",
+ " return\n",
+ " if(left == -1):\n",
+ " left = 0\n",
+ " right = 0\n",
+ " else:\n",
+ " if(right == MAX-1):\n",
+ " right = 0;\n",
+ " else:\n",
+ " right = right+1;\n",
+ " print \"Input the element for adding in queue: \"\n",
+ " added_item = int(raw_input())\n",
+ " # Inputting the element at the right\n",
+ " dqueue_arr.append(added_item)\n",
+ "\n",
+ "def insert_left():\n",
+ " global left, right, dqueue_arr\n",
+ " # Checking for queue overflow\n",
+ " if ((left == 0 and right == MAX-1) or (left == right+1)):\n",
+ " print \"Queue is full...\"\n",
+ " return\n",
+ " if (left == -1): # If queue is initially empty\n",
+ " left = 0;\n",
+ " right = 0;\n",
+ " else:\n",
+ " if (left== 0):\n",
+ " left = MAX -1;\n",
+ " else:\n",
+ " left = left-1;\n",
+ " print \"\\nInput the element for adding in queue:\"\n",
+ " added_item = int(raw_input())\n",
+ " # inputting at the left side of the queue\n",
+ " dqueue_arr.insert(added_item,left)\n",
+ "\n",
+ "# This function will delete an element from the queue from the left side\n",
+ "def delete_left():\n",
+ " global left, right, dqueue_arr\n",
+ " # Checking for queue underflow\n",
+ " if (left == -1):\n",
+ " print \"Queue is empty... \"\n",
+ " return\n",
+ " # deleting the element from the left side\n",
+ " print \"Element deleted from queue is: \", dqueue_arr[left]\n",
+ " if(left == right): # Queue has only one element \n",
+ " left = -1\n",
+ " right = -1\n",
+ " else:\n",
+ " if (left == MAX-1):\n",
+ " left = 0\n",
+ " else:\n",
+ " left = left+1\n",
+ " \n",
+ "# Function to delete an element from the right hand side of the de-queue\n",
+ "def delete_right():\n",
+ " global left, right, dqueue_arr\n",
+ " # Checking for underflow conditions\n",
+ " if (left == -1):\n",
+ " print \"Queue is empty...\"\n",
+ " return\n",
+ " print \"Element deleted from queue is : \", dqueue_arr[right]\n",
+ " if(left == right): # queue has only one element\n",
+ " left = -1\n",
+ " right = -1\n",
+ " else:\n",
+ " if (right == 0):\n",
+ " right = MAX-1\n",
+ " else:\n",
+ " right = right -1\n",
+ "\n",
+ "# Displaying all the contents of the queue\n",
+ "def display_queue():\n",
+ " global left, right, dqueue_arr\n",
+ " front_pos = left \n",
+ " rear_pos = right\n",
+ " # Checking whether the queue is empty or not\n",
+ " if (left == -1):\n",
+ " print \"Queue is empty...\"\n",
+ " return\n",
+ " # displaying the queue elements\n",
+ " print \"Queue elements :\",\n",
+ " if (front_pos <= rear_pos):\n",
+ " while(front_pos <= rear_pos):\n",
+ " print \" \", dqueue_arr[front_pos],\n",
+ " front_pos = front_pos + 1\n",
+ "\n",
+ "# Function to implement all the operation of the input restricted queue\n",
+ "def input_que():\n",
+ " global left, right, dqueue_arr\n",
+ " while(1):\n",
+ " # menu options to input restricted queue\n",
+ " print \"\\n1.Insert at right\"\n",
+ " print \"2.Delete from left\\n\"\n",
+ " print \"3.Delete from right\\n\"\n",
+ " print \"4.Display\\n\"\n",
+ " print \"5.Quit\\n\"\n",
+ " print \"\\nEnter your choice : \"\n",
+ " choice = int(raw_input())\n",
+ " if choice == 1:\n",
+ " insert_right()\n",
+ " display_queue()\n",
+ " elif choice == 2:\n",
+ " delete_left()\n",
+ " elif choice == 3:\n",
+ " delete_right()\n",
+ " elif choice == 4:\n",
+ " display_queue()\n",
+ " elif choice == 5:\n",
+ " sys.exit\n",
+ " else:\n",
+ " print \"Wrong choice...\"\n",
+ "\n",
+ "def output_que():\n",
+ " global left, right, dqueue_arr\n",
+ " while(1):\n",
+ " # menu options for output restricted queue\n",
+ " print \"\\n1. Insert at right\"\n",
+ " print \"2. Insert at left\"\n",
+ " print \"3. Delete from left\"\n",
+ " print \"4. Display\"\n",
+ " print \"5 .Quit\"\n",
+ " print \"Enter your choice: \"\n",
+ " choice = int(raw_input())\n",
+ " if choice == 1:\n",
+ " insert_right()\n",
+ " elif choice == 2:\n",
+ " insert_left()\n",
+ " elif choice == 3:\n",
+ " delete_left()\n",
+ " elif choice == 4:\n",
+ " display_queue()\n",
+ " elif choice == 5:\n",
+ " sys.exit()\n",
+ " else:\n",
+ " print \"Wrong choice...\"\n",
+ "\n",
+ "# Main menu options\n",
+ "print \"1. Input restricted dequeue\"\n",
+ "print \"2. Output restricted dequeue\"\n",
+ "print \"3. Enter your choice: \"\n",
+ "choice = int(raw_input())\n",
+ "if choice == 1:\n",
+ " input_que()\n",
+ "elif choice == 2:\n",
+ " output_que()\n",
+ "else:\n",
+ " print \"Wrong choice...\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter5.ipynb b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter5.ipynb
new file mode 100644
index 00000000..5d6327d9
--- /dev/null
+++ b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter5.ipynb
@@ -0,0 +1,1807 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 5: The Linked List"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1, page no. 95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " \n",
+ "1.Create List\n",
+ "2.Add at beginning\n",
+ "3.Add after\n",
+ "4.Delete\n",
+ "5.Display\n",
+ "6.Count\n",
+ "7.Reverse\n",
+ "8.Search\n",
+ "9.Quit\n",
+ "Enter your choice: 1\n",
+ " \n",
+ "\n",
+ "How many nodes you want:\n",
+ "3\n",
+ "Enter the element: \n",
+ "10\n",
+ "Enter the element: \n",
+ "15\n",
+ "Enter the element: \n",
+ "20\n",
+ "\n",
+ "1.Create List\n",
+ "2.Add at beginning\n",
+ "3.Add after\n",
+ "4.Delete\n",
+ "5.Display\n",
+ "6.Count\n",
+ "7.Reverse\n",
+ "8.Search\n",
+ "9.Quit\n",
+ "Enter your choice: 5\n",
+ " \n",
+ "\n",
+ "List is : \n",
+ "10 15 20 \n",
+ "1.Create List\n",
+ "2.Add at beginning\n",
+ "3.Add after\n",
+ "4.Delete\n",
+ "5.Display\n",
+ "6.Count\n",
+ "7.Reverse\n",
+ "8.Search\n",
+ "9.Quit\n",
+ "Enter your choice: 6\n",
+ " Number of elements are 3\n",
+ "\n",
+ "\n",
+ "1.Create List\n",
+ "2.Add at beginning\n",
+ "3.Add after\n",
+ "4.Delete\n",
+ "5.Display\n",
+ "6.Count\n",
+ "7.Reverse\n",
+ "8.Search\n",
+ "9.Quit\n",
+ "Enter your choice: 9\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "class node:\n",
+ " def __init__(self, data=0, link=None):\n",
+ " self.data = data\n",
+ " self.link = link\n",
+ "\n",
+ "start = None\n",
+ "\n",
+ "def create_list(data):\n",
+ " global start\n",
+ " tmp = node(data)\n",
+ " q = node()\n",
+ " if(start==None):\n",
+ " start = tmp\n",
+ " else:\n",
+ " q = start\n",
+ " while(q.link != None):\n",
+ " q = q.link\n",
+ " q.link = tmp\n",
+ " \n",
+ "def AddAtBeg(data):\n",
+ " global start\n",
+ " tmp = node(data)\n",
+ " if(start == None):\n",
+ " start = tmp\n",
+ " else:\n",
+ " tmp.link = start\n",
+ " start = tmp\n",
+ " \n",
+ "def AddAfter(data, pos):\n",
+ " global start\n",
+ " q = start\n",
+ " for i in range(pos-1):\n",
+ " q = q.link\n",
+ " if(q == None):\n",
+ " print \"\\n\\n There are less than %d elements\" %pos\n",
+ " return\n",
+ " tmp = node(data)\n",
+ " tmp.link = q.link\n",
+ " q.link = tmp\n",
+ " \n",
+ "def Del(data):\n",
+ " global start\n",
+ " if (start.data == data):\n",
+ " tmp = start\n",
+ " start = start.link\n",
+ " return\n",
+ " q = start\n",
+ " while(q.link.link != None):\n",
+ " if(q.link.data == data):\n",
+ " tmp = q.link\n",
+ " q.link = tmp.link\n",
+ " return\n",
+ " q = q.link\n",
+ " if(q.link.data == data):\n",
+ " tmp = q.link;\n",
+ " q.link = None\n",
+ " return\n",
+ " print \"\\n\\nElement %d not found\" %data\n",
+ "\n",
+ "def Display():\n",
+ " global start\n",
+ " if(start == None):\n",
+ " print \"\\n\\nList is empty\"\n",
+ " return\n",
+ " q=start\n",
+ " print \"\\n\\nList is : \"\n",
+ " while(q != None):\n",
+ " print q.data,\n",
+ " q = q.link\n",
+ "\n",
+ "def Count():\n",
+ " global start\n",
+ " q = start\n",
+ " cnt = 0\n",
+ " while(q != None):\n",
+ " q = q.link\n",
+ " cnt+=1\n",
+ " print \"Number of elements are %d\\n\" %cnt\n",
+ "\n",
+ "def Rev():\n",
+ " global start\n",
+ " if(start.link==None):\n",
+ " return\n",
+ " p1 = start\n",
+ " p2 = p1.link\n",
+ " p3 = p2.link\n",
+ " p1.link = None\n",
+ " p2.link = p1\n",
+ " while(p3 != None):\n",
+ " p1=p2\n",
+ " p2=p3\n",
+ " p3=p3.link\n",
+ " p2.link=p1\n",
+ " start=p2\n",
+ "\n",
+ "def Search(data):\n",
+ " global start\n",
+ " ptr = start\n",
+ " pos = 1\n",
+ " while(ptr!=None):\n",
+ " if (ptr.data == data):\n",
+ " print \"\\n\\nItem %d found at position %d\" %(data, pos)\n",
+ " return\n",
+ " ptr = ptr.link\n",
+ " pos+=1\n",
+ " if (ptr == None):\n",
+ " print \"\\n\\nItem %d not found in list\" %data\n",
+ "\n",
+ "while(1):\n",
+ " print \"\\n1.Create List\"\n",
+ " print \"2.Add at beginning\"\n",
+ " print \"3.Add after\"\n",
+ " print \"4.Delete\"\n",
+ " print \"5.Display\"\n",
+ " print \"6.Count\"\n",
+ " print \"7.Reverse\"\n",
+ " print \"8.Search\"\n",
+ " print \"9.Quit\"\n",
+ " print \"Enter your choice: \",\n",
+ " choice =int(raw_input())\n",
+ " if choice == 1:\n",
+ " print \"\\n\\nHow many nodes you want:\"\n",
+ " n = int(raw_input())\n",
+ " for i in range(n):\n",
+ " print \"Enter the element: \"\n",
+ " data = int(raw_input())\n",
+ " create_list(data)\n",
+ " elif choice == 2:\n",
+ " print \"\\n\\nEnter the element : \"\n",
+ " data = int(raw_input())\n",
+ " AddAtBeg(data)\n",
+ " elif choice == 3:\n",
+ " print \"\\n\\nEnter the element : \"\n",
+ " data = int(raw_input())\n",
+ " print \"\\nEnter the position after which this element is inserted:\"\n",
+ " pos = int(raw_input())\n",
+ " AddAfter(data,pos)\n",
+ " elif choice == 4:\n",
+ " if (start == None):\n",
+ " print \"\\n\\nList is empty\"\n",
+ " continue\n",
+ " print \"\\n\\nEnter the element for deletion:\"\n",
+ " data = int(raw_input())\n",
+ " Del(data)\n",
+ " elif choice == 5:\n",
+ " Display()\n",
+ " elif choice == 6:\n",
+ " Count()\n",
+ " elif choice == 7:\n",
+ " Rev()\n",
+ " elif choice == 8:\n",
+ " print \"\\n\\nEnter the element to be searched:\"\n",
+ " data = int(raw_input())\n",
+ " Search(data)\n",
+ " elif choice == 9:\n",
+ " sys.exit()\n",
+ " else:\n",
+ " print \"\\n\\nWrong choice\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2. page no. 101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " \n",
+ "1.Create List\n",
+ "2.Add at beginning\n",
+ "3.Add after\n",
+ "4.Delete\n",
+ "5.Display\n",
+ "6.Count\n",
+ "7.Reverse\n",
+ "8.Search\n",
+ "9.Quit\n",
+ "Enter your choice: 1\n",
+ " \n",
+ "\n",
+ "How many nodes you want:\n",
+ "3\n",
+ "Enter the element: \n",
+ "5\n",
+ "Enter the element: \n",
+ "10\n",
+ "Enter the element: \n",
+ "15\n",
+ "\n",
+ "1.Create List\n",
+ "2.Add at beginning\n",
+ "3.Add after\n",
+ "4.Delete\n",
+ "5.Display\n",
+ "6.Count\n",
+ "7.Reverse\n",
+ "8.Search\n",
+ "9.Quit\n",
+ "Enter your choice: 5\n",
+ " \n",
+ "\n",
+ "List is : \n",
+ "5 10 15 \n",
+ "1.Create List\n",
+ "2.Add at beginning\n",
+ "3.Add after\n",
+ "4.Delete\n",
+ "5.Display\n",
+ "6.Count\n",
+ "7.Reverse\n",
+ "8.Search\n",
+ "9.Quit\n",
+ "Enter your choice: 6\n",
+ " Number of elements are 3\n",
+ "\n",
+ "\n",
+ "1.Create List\n",
+ "2.Add at beginning\n",
+ "3.Add after\n",
+ "4.Delete\n",
+ "5.Display\n",
+ "6.Count\n",
+ "7.Reverse\n",
+ "8.Search\n",
+ "9.Quit\n",
+ "Enter your choice: 9\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "import sys\n",
+ "\n",
+ "class node:\n",
+ " def __init__(self, data=0, link=None):\n",
+ " self.data = data\n",
+ " self.link = link\n",
+ "\n",
+ "start = None\n",
+ "\n",
+ "class LinkedList():\n",
+ "\n",
+ " def create_list(self,data):\n",
+ " global start\n",
+ " tmp = node(data)\n",
+ " q = node()\n",
+ " if(start==None):\n",
+ " start = tmp\n",
+ " else:\n",
+ " q = start\n",
+ " while(q.link != None):\n",
+ " q = q.link\n",
+ " q.link = tmp\n",
+ " \n",
+ " \n",
+ " def AddAtBeg(self,data):\n",
+ " global start\n",
+ " tmp = node(data)\n",
+ " if(start == None):\n",
+ " start = tmp\n",
+ " else:\n",
+ " tmp.link = start\n",
+ " start = tmp\n",
+ " \n",
+ "\n",
+ " def AddAfter(self,data, pos):\n",
+ " global start\n",
+ " q = start\n",
+ " for i in range(pos-1):\n",
+ " q = q.link\n",
+ " if(q == None):\n",
+ " print \"\\n\\n There are less than %d elements\" %pos\n",
+ " return\n",
+ " tmp = node(data)\n",
+ " tmp.link = q.link\n",
+ " q.link = tmp\n",
+ " \n",
+ "\n",
+ " def Del(self,data):\n",
+ " global start\n",
+ " if (start.data == data):\n",
+ " tmp = start\n",
+ " start = start.link\n",
+ " return\n",
+ " q = start\n",
+ " while(q.link.link != None):\n",
+ " if(q.link.data == data):\n",
+ " tmp = q.link\n",
+ " q.link = tmp.link\n",
+ " return\n",
+ " q = q.link\n",
+ " if(q.link.data == data):\n",
+ " tmp = q.link;\n",
+ " q.link = None\n",
+ " return\n",
+ " print \"\\n\\nElement %d not found\" %data \n",
+ "\n",
+ "\n",
+ " def Display(self):\n",
+ " global start\n",
+ " if(start == None):\n",
+ " print \"\\n\\nList is empty\"\n",
+ " return\n",
+ " q=start\n",
+ " print \"\\n\\nList is : \"\n",
+ " while(q != None):\n",
+ " print q.data,\n",
+ " q = q.link\n",
+ " \n",
+ " def Count(self):\n",
+ " global start\n",
+ " q = start\n",
+ " cnt = 0\n",
+ " while(q != None):\n",
+ " q = q.link\n",
+ " cnt+=1\n",
+ " print \"Number of elements are %d\\n\" %cnt\n",
+ " \n",
+ " \n",
+ " def Rev(self):\n",
+ " global start\n",
+ " if(start.link==None):\n",
+ " return\n",
+ " p1 = start\n",
+ " p2 = p1.link\n",
+ " p3 = p2.link\n",
+ " p1.link = None\n",
+ " p2.link = p1\n",
+ " while(p3 != None):\n",
+ " p1=p2\n",
+ " p2=p3\n",
+ " p3=p3.link\n",
+ " p2.link=p1\n",
+ " start=p2\n",
+ " \n",
+ "\n",
+ " def Search(self,data):\n",
+ " global start\n",
+ " ptr = start\n",
+ " pos = 1\n",
+ " while(ptr!=None):\n",
+ " if (ptr.data == data):\n",
+ " print \"\\n\\nItem %d found at position %d\" %(data, pos)\n",
+ " return\n",
+ " ptr = ptr.link\n",
+ " pos+=1\n",
+ " if (ptr == None):\n",
+ " print \"\\n\\nItem %d not found in list\" %data\n",
+ " \n",
+ "\n",
+ "l_list = LinkedList()\n",
+ "\n",
+ "while(1):\n",
+ " print \"\\n1.Create List\"\n",
+ " print \"2.Add at beginning\"\n",
+ " print \"3.Add after\"\n",
+ " print \"4.Delete\"\n",
+ " print \"5.Display\"\n",
+ " print \"6.Count\"\n",
+ " print \"7.Reverse\"\n",
+ " print \"8.Search\"\n",
+ " print \"9.Quit\"\n",
+ " print \"Enter your choice: \",\n",
+ " choice =int(raw_input())\n",
+ " if choice == 1:\n",
+ " print \"\\n\\nHow many nodes you want:\"\n",
+ " n = int(raw_input())\n",
+ " for i in range(n):\n",
+ " print \"Enter the element: \"\n",
+ " data = int(raw_input())\n",
+ " l_list.create_list(data)\n",
+ " elif choice == 2:\n",
+ " print \"\\n\\nEnter the element : \"\n",
+ " data = int(raw_input())\n",
+ " l_list.AddAtBeg(data)\n",
+ " elif choice == 3:\n",
+ " print \"\\n\\nEnter the element : \"\n",
+ " data = int(raw_input())\n",
+ " print \"\\nEnter the position after which this element is inserted:\"\n",
+ " pos = int(raw_input())\n",
+ " l_list.AddAfter(data,pos)\n",
+ " elif choice == 4:\n",
+ " if (start == None):\n",
+ " print \"\\n\\nList is empty\"\n",
+ " continue\n",
+ " print \"\\n\\nEnter the element for deletion:\"\n",
+ " data = int(raw_input())\n",
+ " l_list.Del(data)\n",
+ " elif choice == 5:\n",
+ " l_list.Display()\n",
+ " elif choice == 6:\n",
+ " l_list.Count()\n",
+ " elif choice == 7:\n",
+ " l_list.Rev()\n",
+ " elif choice == 8:\n",
+ " print \"\\n\\nEnter the element to be searched:\"\n",
+ " data = int(raw_input())\n",
+ " l_list.Search(data)\n",
+ " elif choice == 9:\n",
+ " sys.exit()\n",
+ " else:\n",
+ " print \"\\n\\nWrong choice\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3, page no. 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.DISPLAY\n",
+ "4.EXIT\n",
+ "Enter your choice: 1\n",
+ " Enter element to be pushed: 5\n",
+ " \n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.DISPLAY\n",
+ "4.EXIT\n",
+ "Enter your choice: 1\n",
+ " Enter element to be pushed: 10\n",
+ " \n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.DISPLAY\n",
+ "4.EXIT\n",
+ "Enter your choice: 3\n",
+ " Stack elements: \n",
+ "10 5 \n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.DISPLAY\n",
+ "4.EXIT\n",
+ "Enter your choice: 4\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "class node:\n",
+ " def __init__(self, link=None):\n",
+ " self.data = None\n",
+ " self.link = link\n",
+ " \n",
+ "start = None\n",
+ "\n",
+ "\n",
+ "def push(top):\n",
+ " new = node()\n",
+ " print \"Enter element to be pushed: \",\n",
+ " pushed_item = int(raw_input())\n",
+ " new.data = pushed_item\n",
+ " new.link = top\n",
+ " top = new\n",
+ " return top\n",
+ "\n",
+ "def pop(top):\n",
+ " tmp = node()\n",
+ " if(top == None):\n",
+ " print \"Stack is empty...\" \n",
+ " else:\n",
+ " tmp = top\n",
+ " print \"Popped item is: \", tmp.data\n",
+ " top = top.link\n",
+ " tmp.link = None\n",
+ " return top\n",
+ "\n",
+ "def display(top):\n",
+ " if(top == None):\n",
+ " print \"Stack is empty...\"\n",
+ " else:\n",
+ " print \"Stack elements: \"\n",
+ " while(top.link != None):\n",
+ " print top.data,\n",
+ " top = top.link\n",
+ " \n",
+ "Top = node()\n",
+ "while(1):\n",
+ " print \"\\n1.PUSH\"\n",
+ " print \"2.POP\"\n",
+ " print \"3.DISPLAY\"\n",
+ " print \"4.EXIT\"\n",
+ " print \"Enter your choice: \",\n",
+ " choice = int(raw_input())\n",
+ " if choice == 1:\n",
+ " Top = push(Top)\n",
+ " elif choice == 2:\n",
+ " Top=pop(Top)\n",
+ " elif choice == 3:\n",
+ " display(Top)\n",
+ " elif choice == 4:\n",
+ " sys.exit() \n",
+ " else:\n",
+ " print \"Wrong choice\"\n",
+ " print \"\\nDo you want to continue (Y/y) = \"\n",
+ " ch = raw_input()\n",
+ " if ch == 'Y' or ch == 'y':\n",
+ " continue\n",
+ " else:\n",
+ " sys.exit()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4, page no. 111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " \n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.DISPLAY\n",
+ "4.EXIT\n",
+ "Enter your choice: 1\n",
+ " Enter element to be pushed: 5\n",
+ " \n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.DISPLAY\n",
+ "4.EXIT\n",
+ "Enter your choice: 1\n",
+ " Enter element to be pushed: 10\n",
+ " \n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.DISPLAY\n",
+ "4.EXIT\n",
+ "Enter your choice: 3\n",
+ " Stack elements: \n",
+ "10 5 None \n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.DISPLAY\n",
+ "4.EXIT\n",
+ "Enter your choice: 4\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "class node:\n",
+ " def __init__(self, link=None):\n",
+ " self.data = None\n",
+ " self.link = link\n",
+ "\n",
+ "\n",
+ "class linkList:\n",
+ " def push(self, top):\n",
+ " new = node()\n",
+ " print \"Enter element to be pushed: \",\n",
+ " pushed_item = int(raw_input())\n",
+ " new.data = pushed_item\n",
+ " new.link = top\n",
+ " top = new\n",
+ " return top\n",
+ "\n",
+ " def pop(self, top):\n",
+ " tmp = node()\n",
+ " if(top == None):\n",
+ " print \"Stack is empty...\" \n",
+ " else:\n",
+ " tmp = top\n",
+ " print \"Popped item is: \", tmp.data\n",
+ " top = top.link\n",
+ " tmp.link = None\n",
+ " return top\n",
+ "\n",
+ " def display(self, top):\n",
+ " if(top == None):\n",
+ " print \"Stack is empty...\"\n",
+ " else:\n",
+ " print \"Stack elements: \"\n",
+ " while(top.link != None):\n",
+ " print top.data,\n",
+ " top = top.link\n",
+ " \n",
+ "Top = node()\n",
+ "link_list = linkList()\n",
+ "while(1):\n",
+ " print \"\\n1.PUSH\"\n",
+ " print \"2.POP\"\n",
+ " print \"3.DISPLAY\"\n",
+ " print \"4.EXIT\"\n",
+ " print \"Enter your choice: \",\n",
+ " choice = int(raw_input())\n",
+ " if choice == 1:\n",
+ " Top = link_list.push(Top)\n",
+ " elif choice == 2:\n",
+ " Top = link_list.pop(Top)\n",
+ " elif choice == 3:\n",
+ " link_list.display(Top)\n",
+ " elif choice == 4:\n",
+ " sys.exit() \n",
+ " else:\n",
+ " print \"Wrong choice\"\n",
+ " print \"\\nDo you want to continue (Y/y) = \"\n",
+ " ch = raw_input()\n",
+ " if ch == 'Y' or ch == 'y':\n",
+ " continue\n",
+ " else:\n",
+ " sys.exit()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5, page no. 116"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " \n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.TRAVERSE\n",
+ "4.EXIT\n",
+ "Enter your choice: 1\n",
+ " Enter the no. to be pushed: 5\n",
+ " \n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.TRAVERSE\n",
+ "4.EXIT\n",
+ "Enter your choice: 1\n",
+ " Enter the no. to be pushed: 10\n",
+ " \n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.TRAVERSE\n",
+ "4.EXIT\n",
+ "Enter your choice: 3\n",
+ " The element(s) is/are: \n",
+ "5 10 \n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.TRAVERSE\n",
+ "4.EXIT\n",
+ "Enter your choice: 4\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "class node:\n",
+ " def __init__(self, link=None):\n",
+ " self.data = None\n",
+ " self.link = link\n",
+ "\n",
+ "def push(rear):\n",
+ " new_node = node()\n",
+ " print \"Enter the no. to be pushed: \",\n",
+ " new_node.data = int(raw_input())\n",
+ " new_node.link = None\n",
+ " if (rear != None):\n",
+ " rear.link = new_node\n",
+ " rear = new_node\n",
+ " return rear\n",
+ "\n",
+ "def pop(f, r):\n",
+ " if f == None:\n",
+ " print \"The Queue is empty\"\n",
+ " else:\n",
+ " print \"The poped element is: \", f.data\n",
+ " if f != r:\n",
+ " f = f.link\n",
+ " else:\n",
+ " f = None\n",
+ " return f\n",
+ "\n",
+ "def traverse(fr, re):\n",
+ " if fr == None:\n",
+ " print \"The Queue is empty\"\n",
+ " else:\n",
+ " print \"The element(s) is/are: \"\n",
+ " while fr != re:\n",
+ " print fr.data,\n",
+ " fr = fr.link\n",
+ " print fr.data,\n",
+ "\n",
+ "rear = None\n",
+ "front = None\n",
+ "while(1):\n",
+ " print \"\\n1.PUSH\"\n",
+ " print \"2.POP\"\n",
+ " print \"3.TRAVERSE\"\n",
+ " print \"4.EXIT\"\n",
+ " print \"Enter your choice: \",\n",
+ " choice = int(raw_input())\n",
+ " if choice == 1:\n",
+ " rear = push(rear)\n",
+ " if front == None:\n",
+ " front = rear\n",
+ " elif choice == 2:\n",
+ " front = pop(front, rear)\n",
+ " if front == None:\n",
+ " rear = None\n",
+ " elif choice == 3:\n",
+ " traverse(front, rear)\n",
+ " elif choice == 4:\n",
+ " sys.exit() \n",
+ " else:\n",
+ " print \"Wrong choice\"\n",
+ " print \"\\nDo you want to continue (Y/y) = \"\n",
+ " ch = raw_input()\n",
+ " if ch == 'Y' or ch == 'y':\n",
+ " continue\n",
+ " else:\n",
+ " sys.exit()\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6, page no. 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " \n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.TRAVERSE\n",
+ "4.EXIT\n",
+ "Enter your choice: 1\n",
+ " Enter the no. to be pushed: 5\n",
+ " \n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.TRAVERSE\n",
+ "4.EXIT\n",
+ "Enter your choice: 1\n",
+ " Enter the no. to be pushed: 10\n",
+ " \n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.TRAVERSE\n",
+ "4.EXIT\n",
+ "Enter your choice: 3\n",
+ " The element(s) is/are: \n",
+ "5 10 \n",
+ "1.PUSH\n",
+ "2.POP\n",
+ "3.TRAVERSE\n",
+ "4.EXIT\n",
+ "Enter your choice: 5\n",
+ " Wrong choice\n",
+ "\n",
+ "Do you want to continue (Y/y) = \n",
+ "n\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "class node:\n",
+ " def __init__(self, link=None):\n",
+ " self.data = None\n",
+ " self.link = link\n",
+ "\n",
+ "class linkList:\n",
+ " def push(self, rear):\n",
+ " new_node = node()\n",
+ " print \"Enter the no. to be pushed: \",\n",
+ " new_node.data = int(raw_input())\n",
+ " new_node.link = None\n",
+ " if (rear != None):\n",
+ " rear.link = new_node\n",
+ " rear = new_node\n",
+ " return rear\n",
+ "\n",
+ " def pop(self, f, r):\n",
+ " if f == None:\n",
+ " print \"The Queue is empty\"\n",
+ " else:\n",
+ " print \"The poped element is: \", f.data\n",
+ " if f != r:\n",
+ " f = f.link\n",
+ " else:\n",
+ " f = None\n",
+ " return f\n",
+ "\n",
+ " def traverse(self, fr, re):\n",
+ " if fr == None:\n",
+ " print \"The Queue is empty\"\n",
+ " else:\n",
+ " print \"The element(s) is/are: \"\n",
+ " while fr != re:\n",
+ " print fr.data,\n",
+ " fr = fr.link\n",
+ " print fr.data,\n",
+ " \n",
+ "rear = None\n",
+ "front = None\n",
+ "l = linkList()\n",
+ "while(1):\n",
+ " print \"\\n1.PUSH\"\n",
+ " print \"2.POP\"\n",
+ " print \"3.TRAVERSE\"\n",
+ " print \"4.EXIT\"\n",
+ " print \"Enter your choice: \",\n",
+ " choice = int(raw_input())\n",
+ " if choice == 1:\n",
+ " rear = l.push(rear)\n",
+ " if front == None:\n",
+ " front = rear\n",
+ " elif choice == 2:\n",
+ " front = l.pop(front, rear)\n",
+ " if front == None:\n",
+ " rear = None\n",
+ " elif choice == 3:\n",
+ " l.traverse(front, rear)\n",
+ " elif choice == 4:\n",
+ " sys.exit() \n",
+ " else:\n",
+ " print \"Wrong choice\"\n",
+ " print \"\\nDo you want to continue (Y/y) = \"\n",
+ " ch = raw_input()\n",
+ " if ch == 'Y' or ch == 'y':\n",
+ " continue\n",
+ " else:\n",
+ " sys.exit()\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8, page no. 127"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Polynomial 1 : \n",
+ "How many terms u want to enter: \n",
+ "2\n",
+ "Enter coeficient for term 0:\n",
+ "2\n",
+ "Enter exponent for term 0:\n",
+ "3\n",
+ "Enter coeficient for term 1:\n",
+ "4\n",
+ "Enter exponent for term 1:\n",
+ "5\n",
+ "\n",
+ "Polynomial 2 :\n",
+ "How many terms u want to enter: \n",
+ "2\n",
+ "Enter coeficient for term 0:\n",
+ "1\n",
+ "Enter exponent for term 0:\n",
+ "2\n",
+ "Enter coeficient for term 1:\n",
+ "3\n",
+ "Enter exponent for term 1:\n",
+ "4\n",
+ "\n",
+ "Polynomial 1 is: \n",
+ "(4.0x^5) + \n",
+ "(2.0x^3) + \n",
+ "\b\b \n",
+ "\n",
+ "Polynomial 2 is: \n",
+ "(3.0x^4) + \n",
+ "(1.0x^2) + \n",
+ "\b\b \n",
+ "\n",
+ "\n",
+ "Added polynomial is: \n",
+ "(1.0x^2) + \n",
+ "\b\b \n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "class node:\n",
+ " \n",
+ " def __init__(self):\n",
+ " self.coef = 0.0\n",
+ " self.expo = 0\n",
+ " self.link = None\n",
+ "\n",
+ "def insert(start, co, ex):\n",
+ " ptr = node()\n",
+ " tmp = node()\n",
+ " tmp.coef = co\n",
+ " tmp.expo = ex\n",
+ " if(start==None or ex>start.expo):\n",
+ " tmp.link=start\n",
+ " start = tmp\n",
+ " else:\n",
+ " ptr=start\n",
+ " while(ptr.link != None and ptr.link.expo > ex):\n",
+ " ptr = ptr.link\n",
+ " tmp.link = ptr.link\n",
+ " ptr.link = tmp\n",
+ " if(ptr.link==None):\n",
+ " tmp.link = None\n",
+ " return start\n",
+ "\n",
+ "def poly_add(p1, p2):\n",
+ " p3 = node()\n",
+ " tmp = node()\n",
+ " p3_start = None\n",
+ " if(p1 == None and p2 == None):\n",
+ " return p3_start\n",
+ " while(p1 != None and p2 != None):\n",
+ " if(p3_start == None):\n",
+ " p3_start = tmp\n",
+ " p3 = p3_start\n",
+ " else:\n",
+ " p3.link = tmp\n",
+ " p3 = p3.link\n",
+ " if(p1.expo > p2.expo):\n",
+ " tmp.coef=p1.coef\n",
+ " tmp.expo=p1.expo\n",
+ " p1 = p1.link\n",
+ " else:\n",
+ " if(p2.expo > p1.expo):\n",
+ " tmp.coef = p2.coef\n",
+ " tmp.expo = p2.expo\n",
+ " p2 = p2.link\n",
+ " else:\n",
+ " if(p1.expo == p2.expo):\n",
+ " tmp.coef=p1.coef + p2.coef\n",
+ " tmp.expo=p1.expo\n",
+ " p1=p1.link\n",
+ " p2=p2.link\n",
+ " while(p1!=None):\n",
+ " tmp.coef = p1.coef\n",
+ " tmp.expo = p1.expo\n",
+ " if (p3_start==None):\n",
+ " p3_start=tmp\n",
+ " p3=p3_start\n",
+ " else:\n",
+ " p3.link=tmp\n",
+ " p3=p3.link\n",
+ " p1=p1.link\n",
+ " while(p2!=None):\n",
+ " tmp.coef = p2.coef\n",
+ " tmp.expo = p2.expo\n",
+ " if (p3_start==None):\n",
+ " p3_start = tmp\n",
+ " p3 = p3_start\n",
+ " else:\n",
+ " p3.link = tmp\n",
+ " p3 = p3.link\n",
+ " p2 = p2.link\n",
+ " p3.link = None\n",
+ " return p3_start\n",
+ "\n",
+ "def enter(start):\n",
+ " print \"How many terms u want to enter: \"\n",
+ " n = int(raw_input())\n",
+ " for i in range(n):\n",
+ " print \"Enter coeficient for term %d:\" %i\n",
+ " co = float(raw_input())\n",
+ " print \"Enter exponent for term %d:\" %i\n",
+ " ex = int(raw_input())\n",
+ " start = insert(start,co,ex);\n",
+ " return start\n",
+ "\n",
+ "def display(ptr):\n",
+ " if (ptr==None):\n",
+ " print \"Empty...\"\n",
+ " return\n",
+ " while(ptr!=None):\n",
+ " print \"(%.1fx^%d) + \" %(ptr.coef, ptr.expo)\n",
+ " ptr = ptr.link\n",
+ " print \"\\b\\b \\n\"\n",
+ "\n",
+ "p1_start=None\n",
+ "p2_start=None\n",
+ "p3_start=None\n",
+ "print \"\\nPolynomial 1 : \"\n",
+ "p1_start = enter(p1_start)\n",
+ "print \"\\nPolynomial 2 :\"\n",
+ "p2_start = enter(p2_start)\n",
+ "p3_start = poly_add(p1_start, p2_start)\n",
+ "print \"\\nPolynomial 1 is: \"\n",
+ "display(p1_start)\n",
+ "print \"Polynomial 2 is: \"\n",
+ "display(p2_start)\n",
+ "print \"\\nAdded polynomial is: \"\n",
+ "display (p3_start)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9, page no. 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " \n",
+ "1.Create List\n",
+ "2.Add at begining\n",
+ "3.Add after\n",
+ "4.Delete\n",
+ "5.Display\n",
+ "6.Count\n",
+ "7.Reverse\n",
+ "8.exit\n",
+ "Enter your choice: 1\n",
+ " \n",
+ "How many nodes you want: 3\n",
+ " Enter the element: 5\n",
+ " Enter the element: 10\n",
+ " Enter the element: 15\n",
+ " \n",
+ "1.Create List\n",
+ "2.Add at begining\n",
+ "3.Add after\n",
+ "4.Delete\n",
+ "5.Display\n",
+ "6.Count\n",
+ "7.Reverse\n",
+ "8.exit\n",
+ "Enter your choice: 5\n",
+ " \n",
+ "List is :\n",
+ "\n",
+ "15 \n",
+ "1.Create List\n",
+ "2.Add at begining\n",
+ "3.Add after\n",
+ "4.Delete\n",
+ "5.Display\n",
+ "6.Count\n",
+ "7.Reverse\n",
+ "8.exit\n",
+ "Enter your choice: 8\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "class node:\n",
+ " def __init__(self, info=0, next=None, prev=None):\n",
+ " self.info = info\n",
+ " self.next = next\n",
+ " self.prev = prev\n",
+ "\n",
+ "start = node()\n",
+ "\n",
+ "def create_list(num):\n",
+ " global start\n",
+ " tmp = node()\n",
+ " tmp.info = num\n",
+ " q = node()\n",
+ " if(start.next == None):\n",
+ " tmp.prev = None\n",
+ " start.prev = tmp\n",
+ " start = tmp\n",
+ " else:\n",
+ " q = start\n",
+ " while(q.next != None):\n",
+ " q = q.next\n",
+ " q.next = tmp\n",
+ " tmp.prev = q\n",
+ "\n",
+ "def addatbeg(num):\n",
+ " global start\n",
+ " tmp = node()\n",
+ " tmp.info = num\n",
+ " tmp.next = start\n",
+ " start.prev = tmp\n",
+ " start = tmp\n",
+ "\n",
+ "def addafter(num, pos):\n",
+ " global start\n",
+ " q=start\n",
+ " for i in range(0,pos-1):\n",
+ " q=q.next\n",
+ " if(q==None):\n",
+ " print \"\\nThere are less than %d elements\\n\" %pos\n",
+ " return\n",
+ " tmp = node()\n",
+ " tmp.info = num\n",
+ " q.next.prev = tmp\n",
+ " tmp.next = q.next\n",
+ " tmp.prev = q\n",
+ " q.next = tmp\n",
+ "\n",
+ "def my_del(num):\n",
+ " global start\n",
+ " if(start.info==num):\n",
+ " tmp = start\n",
+ " start = start.next\n",
+ " start.prev = None\n",
+ " return\n",
+ " q = start;\n",
+ " while(q.next.next != None):\n",
+ " if(q.next.info==num):\n",
+ " tmp=q.next\n",
+ " q.next=tmp.next\n",
+ " tmp.next.prev = q\n",
+ " return\n",
+ " q = q.next\n",
+ " if (q.next.info==num):\n",
+ " tmp = q.next\n",
+ " q.next = None\n",
+ " return\n",
+ " print \"\\nElement %d not found\\n\" %num\n",
+ "\n",
+ "def display():\n",
+ " global start\n",
+ " if(start==None):\n",
+ " print \"\\nList is empty\\n\"\n",
+ " return\n",
+ " q = start\n",
+ " print \"\\nList is :\\n\"\n",
+ " while(q!=None):\n",
+ " print q.info,\n",
+ " q = q.next\n",
+ "\n",
+ "def count():\n",
+ " global start\n",
+ " q=start\n",
+ " cnt=0\n",
+ " while(q!=None):\n",
+ " q=q.next\n",
+ " cnt+=1\n",
+ " print \"\\nNumber of elements are \\n\", cnt\n",
+ "\n",
+ "def rev():\n",
+ " global start\n",
+ " p1=start\n",
+ " p2=p1.next\n",
+ " p1.next=None\n",
+ " p1.prev=p2\n",
+ " while(p2!=None):\n",
+ " p2.prev=p2.next\n",
+ " p2.next=p1\n",
+ " p1=p2\n",
+ " p2=p2.prev\n",
+ " start=p1\n",
+ "\n",
+ "while(1):\n",
+ " print \"\\n1.Create List\"\n",
+ " print \"2.Add at begining\"\n",
+ " print \"3.Add after\"\n",
+ " print \"4.Delete\"\n",
+ " print \"5.Display\"\n",
+ " print \"6.Count\"\n",
+ " print \"7.Reverse\"\n",
+ " print \"8.exit\"\n",
+ " print \"Enter your choice: \",\n",
+ " choice = int(raw_input())\n",
+ " if choice == 1:\n",
+ " print \"\\nHow many nodes you want: \",\n",
+ " n = int(raw_input())\n",
+ " for i in range(n):\n",
+ " print \"Enter the element: \",\n",
+ " m = int(raw_input())\n",
+ " create_list(m)\n",
+ " elif choice == 2:\n",
+ " print \"\\nEnter the element: \",\n",
+ " m = int(raw_input())\n",
+ " addatbeg(m)\n",
+ " elif choice == 3:\n",
+ " print \"\\nEnter the element: \",\n",
+ " m = int(raw_input())\n",
+ " print \"Enter the position after which this element is inserted: \",\n",
+ " po = int(raw_input())\n",
+ " addafter(m,po)\n",
+ " elif choice == 4:\n",
+ " print \"\\nEnter the element for deletion: \",\n",
+ " m = int(raw_input())\n",
+ " my_del(m);\n",
+ " elif choice == 5:\n",
+ " display()\n",
+ " elif choice == 6:\n",
+ " count()\n",
+ " elif choice == 7:\n",
+ " rev()\n",
+ " elif choice == 8:\n",
+ " sys.exit()\n",
+ " else:\n",
+ " print \"\\nWrong choice\\n\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10, page no. 141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " \n",
+ "1.Create List\n",
+ "2.Add at begining\n",
+ "3.Add after\n",
+ "4.Delete\n",
+ "5.Display\n",
+ "6.Quit\n",
+ "Enter your choice:\n",
+ "1\n",
+ "How many nodes you want:3\n",
+ " \n",
+ "Enter the element:5\n",
+ " \n",
+ "Enter the element:10\n",
+ " \n",
+ "Enter the element:15\n",
+ " \n",
+ "1.Create List\n",
+ "2.Add at begining\n",
+ "3.Add after\n",
+ "4.Delete\n",
+ "5.Display\n",
+ "6.Quit\n",
+ "Enter your choice:\n",
+ "5\n",
+ "List is:\n",
+ "5 10 15\n",
+ "\n",
+ "1.Create List\n",
+ "2.Add at begining\n",
+ "3.Add after\n",
+ "4.Delete\n",
+ "5.Display\n",
+ "6.Quit\n",
+ "Enter your choice:\n",
+ "6\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "class node:\n",
+ " def __init__(self, info=None, link=None):\n",
+ " self.info = info\n",
+ " self.link = link\n",
+ "\n",
+ "last = None\n",
+ "class Circular_Linked:\n",
+ " def create_list(self, num):\n",
+ " global last\n",
+ " q = node()\n",
+ " tmp = node()\n",
+ " tmp.info = num\n",
+ " if (last == None):\n",
+ " last = tmp\n",
+ " tmp.link = last\n",
+ " else:\n",
+ " tmp.link = last.link\n",
+ " last.link = tmp\n",
+ " last = tmp\n",
+ "\n",
+ " def addatbeg(self, num):\n",
+ " global last\n",
+ " tmp = node()\n",
+ " tmp.info = num\n",
+ " tmp.link = last.link\n",
+ " last.link = tmp\n",
+ "\n",
+ " def addafter(self, num, pos):\n",
+ " global last\n",
+ " q = node()\n",
+ " tmp = node()\n",
+ " q = last.link\n",
+ " for i in range(0, pos-1):\n",
+ " q = q.link\n",
+ " if (q == last.link):\n",
+ " print \"There are less than \", pos, \" elements\"\n",
+ " return\n",
+ " tmp.link = q.link\n",
+ " tmp.info = num\n",
+ " q.link = tmp\n",
+ " if(q==last):\n",
+ " last=tmp\n",
+ "\n",
+ " def my_del(self):\n",
+ " global last\n",
+ " if(last == None):\n",
+ " print \"List underflow\"\n",
+ " return\n",
+ " print \"Enter the number for deletion:\"\n",
+ " num = int(raw_input())\n",
+ " q = node()\n",
+ " tmp = node()\n",
+ " if( last.link == last and last.info == num):\n",
+ " tmp = last\n",
+ " last = None\n",
+ " return\n",
+ " q = last.link\n",
+ " if(q.info == num):\n",
+ " tmp = q\n",
+ " last.link = q.link\n",
+ " return\n",
+ " while(q.link != last):\n",
+ " if(q.link.info == num):\n",
+ " tmp = q.link\n",
+ " q.link = tmp.link\n",
+ " print num, \" deleted\"\n",
+ " q = q.link\n",
+ " if(q.link.info == num):\n",
+ " tmp = q.link\n",
+ " q.link = last.link\n",
+ " last = q\n",
+ " return\n",
+ " print \"Element \",num,\" not found\"\n",
+ "\n",
+ " def display(self):\n",
+ " global last\n",
+ " q = node()\n",
+ " if(last == None):\n",
+ " print \"List is empty\"\n",
+ " return\n",
+ " q = last.link\n",
+ " print \"List is:\"\n",
+ " while(q != last):\n",
+ " print q.info,\n",
+ " q = q.link\n",
+ " print last.info\n",
+ " \n",
+ "co = Circular_Linked()\n",
+ "while(1):\n",
+ " print \"\\n1.Create List\"\n",
+ " print \"2.Add at begining\"\n",
+ " print \"3.Add after\"\n",
+ " print \"4.Delete\"\n",
+ " print \"5.Display\"\n",
+ " print \"6.Quit\"\n",
+ " print \"Enter your choice:\"\n",
+ " choice = int(raw_input())\n",
+ " if choice == 1:\n",
+ " print \"How many nodes you want:\",\n",
+ " n = int(raw_input())\n",
+ " for i in range(n):\n",
+ " print \"\\nEnter the element:\",\n",
+ " m = int(raw_input())\n",
+ " co.create_list(m)\n",
+ " elif choice == 2:\n",
+ " print \"\\nEnter the element:\",\n",
+ " m = int(raw_input())\n",
+ " co.addatbeg(m)\n",
+ " elif choice == 3:\n",
+ " print \"\\nEnter the element:\",\n",
+ " m = int(raw_input())\n",
+ " print \"\\nEnter the position after which this element is inserted:\",\n",
+ " po = int(raw_input())\n",
+ " co.addafter(m,po)\n",
+ " elif choice == 4:\n",
+ " co.my_del()\n",
+ " elif choice == 5:\n",
+ " co.display()\n",
+ " elif choice == 6:\n",
+ " sys.exit()\n",
+ " else:\n",
+ " print \"Wrong choice\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11, page no. 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "1.Insert\n",
+ "2.Delete\n",
+ "3.Display\n",
+ "4.Quit\n",
+ "Enter your choice4\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "class node:\n",
+ " def __init__(self, priority=None, info=None, link=None):\n",
+ " self.priority = priority\n",
+ " self.info = info\n",
+ " self.link = link\n",
+ "\n",
+ "def insert(front):\n",
+ " tmp = node()\n",
+ " q = node()\n",
+ " print \"Input the item value to be added in the queue:\"\n",
+ " added_item = int(raw_input())\n",
+ " print \"Enter its priority:\"\n",
+ " item_priority = int(raw_input())\n",
+ " tmp.info = added_item\n",
+ " tmp.priority = item_priority\n",
+ " if(front == None or item_priority < front.priority):\n",
+ " tmp.link = front\n",
+ " front = tmp\n",
+ " else:\n",
+ " q = front\n",
+ " while(q.link != None and q.link.priority <= item_priority):\n",
+ " q = q.link\n",
+ " tmp.link = q.link\n",
+ " q.link = tmp\n",
+ " return front\n",
+ "\n",
+ "def my_del(front):\n",
+ " tmp = node()\n",
+ " if(front == None):\n",
+ " print \"Queue Underflow\"\n",
+ " else:\n",
+ " tmp = front;\n",
+ " print \"Deleted item is \", tmp.info\n",
+ " front = front.link\n",
+ " return front\n",
+ "\n",
+ "def display(front):\n",
+ " ptr = node()\n",
+ " ptr = front;\n",
+ " if(front == None):\n",
+ " print \"Queue is empty\"\n",
+ " else:\n",
+ " print \"Queue is: \"\n",
+ " print \"Priority Item \"\n",
+ " while(ptr != None):\n",
+ " print \"%5d %5d \" %(ptr.priority,ptr.info)\n",
+ " ptr = ptr.link\n",
+ "\n",
+ "front = None\n",
+ "while(1):\n",
+ " print \"\\n1.Insert\"\n",
+ " print \"2.Delete\"\n",
+ " print \"3.Display\"\n",
+ " print \"4.Quit\"\n",
+ " print \"Enter your choice\",\n",
+ " choice = int(raw_input())\n",
+ " if choice == 1:\n",
+ " front = insert(front);\n",
+ " elif choice == 2:\n",
+ " front = my_del(front);\n",
+ " elif choice == 3:\n",
+ " display(front)\n",
+ " elif choice == 4:\n",
+ " sys.exit()\n",
+ " else:\n",
+ " print \"Wrong choice\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter6.ipynb b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter6.ipynb
new file mode 100644
index 00000000..9e4cb5c5
--- /dev/null
+++ b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter6.ipynb
@@ -0,0 +1,964 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 6: Sorting Techniques"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1, page no. 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter the number of elements : 3\n",
+ " Enter 3 elements: \n",
+ "15\n",
+ "10\n",
+ "5\n",
+ "Unsorted list is : \n",
+ "15 10 5 \n",
+ "After pass 1 elements are : \n",
+ "10 5 15 \n",
+ "After pass 2 elements are : \n",
+ "5 10 15 \n",
+ "Sorted list is : \n",
+ "5 10 15\n"
+ ]
+ }
+ ],
+ "source": [
+ "MAX = 20\n",
+ "arr = []\n",
+ "print \"Enter the number of elements : \",\n",
+ "n = int(raw_input())\n",
+ "print \"Enter %d elements: \" %n\n",
+ "for i in range(n):\n",
+ " arr.append(int(raw_input()))\n",
+ "print \"Unsorted list is : \"\n",
+ "for i in range(n):\n",
+ " print arr[i],\n",
+ "for i in range(n):\n",
+ " xchanges=0\n",
+ " for j in range(n-1-i):\n",
+ " if (arr[j] > arr[j+1]):\n",
+ " arr[j], arr[j+1] = arr[j+1],arr[j]\n",
+ " xchanges+=1\n",
+ " if (xchanges == 0):\n",
+ " break\n",
+ " print \"\\nAfter pass %d elements are : \" %(i+1)\n",
+ " for k in range(n):\n",
+ " print arr[k],\n",
+ "print \"\\nSorted list is : \"\n",
+ "for i in range(n):\n",
+ " print arr[i],"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2, page no. 157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " \n",
+ "Enter the number of elements: 3\n",
+ " \n",
+ "Enter the elements: 15\n",
+ "10\n",
+ "5\n",
+ " \n",
+ "Sorted array is: 5 10 15\n"
+ ]
+ }
+ ],
+ "source": [
+ "def bubblesort(a, n):\n",
+ " for i in range(1,n):\n",
+ " for j in range(0,n-1):\n",
+ " if (a[j] > a[j+1]):\n",
+ " a[j], a[j+1] = a[j+1], a[j]\n",
+ "\n",
+ "a = []\n",
+ "print \"\\nEnter the number of elements: \",\n",
+ "n = int(raw_input())\n",
+ "l = n;\n",
+ "print \"\\nEnter the elements: \",\n",
+ "while(l>0):\n",
+ " a.append(int(raw_input()))\n",
+ " l -= 1\n",
+ "bubblesort(a,n);\n",
+ "print \"\\nSorted array is: \",\n",
+ "l = 0\n",
+ "while(l < n):\n",
+ " print a[l],\n",
+ " l += 1"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3, page no. 160"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Enter the number of elements: 3\n",
+ " Enter element 1: 15\n",
+ " Enter element 2: 10\n",
+ " Enter element 3: 5\n",
+ " \n",
+ "Unsorted list is: 15 10 5 \n",
+ "After pass 1 elements are: 5 15 10 \n",
+ "After pass 2 elements are: 5 10 15 \n",
+ "Sorted list is: 5 10 15\n"
+ ]
+ }
+ ],
+ "source": [
+ "arr = []\n",
+ "print \"\\nEnter the number of elements: \",\n",
+ "n = int(raw_input())\n",
+ "for i in range(n):\n",
+ " print \"Enter element %d: \" %(i+1),\n",
+ " arr.append(int(raw_input()))\n",
+ "print \"\\nUnsorted list is: \",\n",
+ "for i in range(n):\n",
+ " print arr[i],\n",
+ "\n",
+ "for i in range(0,n-1):\n",
+ " smallest = i\n",
+ " for k in range(i+1,n):\n",
+ " if (arr[smallest] > arr[k]):\n",
+ " smallest = k\n",
+ " if (i != smallest):\n",
+ " arr[i], arr[smallest] = arr[smallest], arr[i]\n",
+ " print \"\\nAfter pass %d elements are: \" %(i+1),\n",
+ " for j in range(n):\n",
+ " print arr[j],\n",
+ "\n",
+ "print \"\\nSorted list is: \",\n",
+ "for i in range(n):\n",
+ " print arr[i],"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4, page no. 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Enter the number of elements: "
+ ]
+ }
+ ],
+ "source": [
+ "def selectionsort(a, n):\n",
+ " for i in range(n-1):\n",
+ " for j in range(i+1, n):\n",
+ " if (a[i]>a[j]):\n",
+ " a[i], a[j] = a[j],a[i]\n",
+ "\n",
+ "a = []\n",
+ "print \"\\nEnter the number of elements: \",\n",
+ "n = int(raw_input())\n",
+ "l = n\n",
+ "print \"\\nEnter the elements: \",\n",
+ "while(l > 0):\n",
+ " a.append(int(raw_input()))\n",
+ " l -= 1\n",
+ "selectionsort(a, n)\n",
+ "print \"\\nSorted array: \",\n",
+ "l = 0\n",
+ "while(l < n):\n",
+ " print a[l],\n",
+ " l += 1"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5, page no. 166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Enter the number of elements: 3\n",
+ " Enter element 1: 15\n",
+ " Enter element 2: 10\n",
+ " Enter element 3: 5\n",
+ " \n",
+ "Unsorted list is: 15 10 5 \n",
+ "Pass 1, Element inserted in proper place: 10 10 15 5 \n",
+ "Pass 2, Element inserted in proper place: 5 5 10 15 \n",
+ "Sorted list is: 5 10 15\n"
+ ]
+ }
+ ],
+ "source": [
+ "arr = []\n",
+ "print \"\\nEnter the number of elements: \",\n",
+ "n = int(raw_input())\n",
+ "for i in range(n):\n",
+ " print \"Enter element %d: \" %(i+1),\n",
+ " arr.append(int(raw_input()))\n",
+ "print \"\\nUnsorted list is: \",\n",
+ "for i in range(n):\n",
+ " print arr[i],\n",
+ "for j in range (1, n):\n",
+ " k=arr[j]\n",
+ " i = j-1\n",
+ " while (i>=0):\n",
+ " if k < arr[i]:\n",
+ " arr[i+1]=arr[i]\n",
+ " i-=1\n",
+ " arr[i+1]=k\n",
+ " print \"\\nPass %d, Element inserted in proper place: %d \" %(j,k),\n",
+ " for i in range(n):\n",
+ " print arr[i],\n",
+ "\n",
+ "print \"\\nSorted list is: \",\n",
+ "for i in range(n):\n",
+ " print arr[i],"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6, page no. 169"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter the number of elements : 3\n",
+ " Enter element 1 : 15\n",
+ " Enter element 2 : 10\n",
+ " Enter element 3 : 5\n",
+ " Unsorted list is : 15 10 5 \n",
+ "Enter maximum increment (odd value) : 3\n",
+ " \n",
+ "Increment=3 \n",
+ "15 10 5 \n",
+ "Increment=1 \n",
+ "5 10 15 \n",
+ "Sorted list is : 5 10 15\n"
+ ]
+ }
+ ],
+ "source": [
+ "arr = []\n",
+ "print \"Enter the number of elements : \",\n",
+ "n = int(raw_input())\n",
+ "for i in range(n):\n",
+ " print \"Enter element %d : \" %(i+1),\n",
+ " arr.append(int(raw_input()))\n",
+ "print \"Unsorted list is : \",\n",
+ "for i in range(n):\n",
+ " print arr[i],\n",
+ "print \"\\nEnter maximum increment (odd value) : \",\n",
+ "incr = int(raw_input())\n",
+ "\n",
+ "while(incr>=1):\n",
+ " for j in range(incr,n):\n",
+ " k = arr[j]\n",
+ " i = j-incr\n",
+ " while (i>=0 and k < arr[i]):\n",
+ " arr[i+incr] = arr[i]\n",
+ " i = i-incr\n",
+ " arr[i+incr] = k\n",
+ " print \"\\nIncrement=%d \" %incr\n",
+ " for i in range(n):\n",
+ " print arr[i],\n",
+ " incr = incr-2\n",
+ "print \"\\nSorted list is : \",\n",
+ "for i in range(n):\n",
+ " print arr[i],"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7, page no. 173"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Enter the number of elements : 3\n",
+ " Enter element 1: 15\n",
+ " Enter element 2: 10\n",
+ " Enter element 3: 5\n",
+ " \n",
+ "Unsorted list: 15 10 5 0 2\n",
+ "\n",
+ "Sublist: 15 10 \n",
+ "-> Pivot Placed is 15 -> \n",
+ "5 10 0 1\n",
+ "\n",
+ "Sublist: 5 \n",
+ "-> Pivot Placed is 5 -> \n",
+ "5 0 -1\n",
+ "1 1\n",
+ "3 2\n",
+ "\n",
+ "Sorted List: 5 10 15\n"
+ ]
+ }
+ ],
+ "source": [
+ "def display(arr, low, up):\n",
+ " for i in range(low, up):\n",
+ " print arr[i],\n",
+ " \n",
+ "def quick(arr, low, up):\n",
+ " left = low\n",
+ " right = up\n",
+ " piv = low\n",
+ " pivot_placed = False\n",
+ " print low, up\n",
+ " if (low>=up):\n",
+ " return\n",
+ " print \"\\nSublist: \",\n",
+ " display(arr,low,up)\n",
+ " while(pivot_placed == False):\n",
+ " while(arr[piv] <= arr[right] and piv != right):\n",
+ " right=right-1\n",
+ " if (piv==right):\n",
+ " pivot_placed = True\n",
+ " if (arr[piv] > arr[right]):\n",
+ " arr[piv], arr[right] = arr[right], arr[piv]\n",
+ " piv=right\n",
+ " while(arr[piv]>=arr[left] and left != piv):\n",
+ " left=left+1\n",
+ " if (piv==left):\n",
+ " pivot_placed = True\n",
+ " if (arr[piv] < arr[left]):\n",
+ " arr[piv], arr[left] = arr[left], arr[piv]\n",
+ " piv = left\n",
+ " print \"\\n-> Pivot Placed is %d -> \" %arr[piv]\n",
+ " display(arr,low,up)\n",
+ " quick(arr,low,piv-1)\n",
+ " quick(arr,piv+1,up)\n",
+ "\n",
+ "arr = []\n",
+ "print \"\\nEnter the number of elements : \",\n",
+ "n = int(raw_input())\n",
+ "for i in range(n):\n",
+ " print \"Enter element %d: \" %(i+1),\n",
+ " arr.append(int(raw_input()))\n",
+ "print \"\\nUnsorted list: \",\n",
+ "display(arr, 0, n)\n",
+ "quick(arr,0, n-1)\n",
+ "print \"\\nSorted List: \",\n",
+ "display(arr, 0, n)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8, page no. 177"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " \n",
+ "Enter the number of elements in list1: 2\n",
+ " \n",
+ "Take the elements in sorted order \n",
+ "Enter element 1 : 10\n",
+ " Enter element 2 : 15\n",
+ " \n",
+ "Enter the number of elements in list2: \n",
+ "5\n",
+ "\n",
+ "Take the elements in sorted order :\n",
+ "\n",
+ "Enter element 1: 1\n",
+ " Enter element 2: 2\n",
+ " Enter element 3: 3\n",
+ " Enter element 4: 4\n",
+ " Enter element 5: 5\n",
+ " \n",
+ "List 1: 10 15 \n",
+ "List 2: 1 2 3 4 5 \n",
+ "Merged list: \n",
+ "1 2 3 4 5 10 15\n"
+ ]
+ }
+ ],
+ "source": [
+ "arr1 = []\n",
+ "arr2 = []\n",
+ "arr3 = []\n",
+ "print \"\\nEnter the number of elements in list1: \", \n",
+ "max1 = int(raw_input())\n",
+ "print \"\\nTake the elements in sorted order \\n\",\n",
+ "for i in range(max1):\n",
+ " print \"Enter element %d : \" %(i+1),\n",
+ " arr1.append(int(raw_input()))\n",
+ "print \"\\nEnter the number of elements in list2: \"\n",
+ "max2 = int(raw_input())\n",
+ "print \"\\nTake the elements in sorted order :\\n\"\n",
+ "for i in range(max2):\n",
+ " print \"Enter element %d: \"%(i+1),\n",
+ " arr2.append(int(raw_input()))\n",
+ "i = 0\n",
+ "j = 0\n",
+ "while((i < max1) and (j < max2)):\n",
+ " if (arr1[i] < arr2[j]):\n",
+ " arr3.append(arr1[i])\n",
+ " i += 1\n",
+ " else:\n",
+ " arr3.append(arr2[j])\n",
+ " j += 1\n",
+ "while(i < max1):\n",
+ " arr3.append(arr1[i])\n",
+ " i += 1\n",
+ "while(j < max2):\n",
+ " arr3.append(arr2[j])\n",
+ " j += 1\n",
+ "print \"\\nList 1: \",\n",
+ "for i in range(max1):\n",
+ " print arr1[i],\n",
+ "print \"\\nList 2: \",\n",
+ "for i in range(max2):\n",
+ " print arr2[i],\n",
+ "print \"\\nMerged list: \"\n",
+ "for i in range(max1+max2):\n",
+ " print arr3[i],"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9, page no. 179"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Enter the number of elements: 3\n",
+ " Enter element 1: 15\n",
+ " Enter element 2: 10\n",
+ " Enter element 3: 5\n",
+ " \n",
+ "Unsorted list is: 15 10 5 \n",
+ "Size=1 \n",
+ "Elements are: \n",
+ "15 10 5 \n",
+ "Size=2 \n",
+ "Elements are: \n",
+ "15 10 5 \n",
+ "Sorted list is: 10 15 5\n"
+ ]
+ }
+ ],
+ "source": [
+ "arr = []\n",
+ "temp = []\n",
+ "\n",
+ "print \"\\nEnter the number of elements: \",\n",
+ "n = int(raw_input())\n",
+ "for i in range(n):\n",
+ " print \"Enter element %d: \" %(i+1),\n",
+ " arr.append(int(raw_input()))\n",
+ "print \"\\nUnsorted list is: \",\n",
+ "for i in range(n):\n",
+ " print arr[i],\n",
+ "\n",
+ "size = 1\n",
+ "\n",
+ "while size < n:\n",
+ " l1 = 0\n",
+ " k = 0\n",
+ " while(l1+size<n):\n",
+ " h1 = l1 + (size - 1)\n",
+ " l2 = h1 + 1\n",
+ " h2 = l2 + (size - 1)\n",
+ " if (h2>=n):\n",
+ " h2 = n-1\n",
+ " i=l1\n",
+ " j=l2\n",
+ " while(i<=h1 and j<=h2 ):\n",
+ " if (arr[i]<=arr[j]):\n",
+ " temp.append(arr[i])\n",
+ " i += 1\n",
+ " else:\n",
+ " temp.append(arr[j])\n",
+ " j += 1\n",
+ " while(i<=h1):\n",
+ " temp.append(arr[i])\n",
+ " i += 1\n",
+ " while(j<=h2):\n",
+ " temp.append(arr[j])\n",
+ " j += 1\n",
+ " l1 = h2+1\n",
+ " for i in range (l1, n):\n",
+ " temp.append(arr[i])\n",
+ " for i in range(0):\n",
+ " arr[i]=temp[i]\n",
+ " print \"\\nSize=%d \\nElements are: \" %size\n",
+ " for i in range(n):\n",
+ " print arr[i],\n",
+ " size = size * 2\n",
+ "arr = temp \n",
+ "print \"\\nSorted list is:\",\n",
+ "for i in range(n):\n",
+ " print arr[i],"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10, page no. 181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Enter the number of elements: \n",
+ "3\n",
+ "Enter element 1: 15\n",
+ " Enter element 2: 10\n",
+ " Enter element 3: 5\n",
+ " \n",
+ "Unsorted list is: 15 10 5 [15, 10, 5]\n",
+ "[10.0, 15.0, 5]\n",
+ "\n",
+ "Sorted list is : 5.0 10.0 15.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "from numpy import zeros\n",
+ "array = []\n",
+ "def merge(low, mid, high):\n",
+ " global array\n",
+ " temp = zeros(len(array))\n",
+ " i = low;\n",
+ " j = mid +1 ;\n",
+ " k = low ;\n",
+ " print array\n",
+ " while((i<=mid) and (j<=high)):\n",
+ " if (array[i]<=array[j]):\n",
+ " temp[k] = array[i]\n",
+ " k += 1\n",
+ " i += 1\n",
+ " else:\n",
+ " temp[k] = array[j]\n",
+ " k += 1\n",
+ " j += 1\n",
+ " while(i<=mid):\n",
+ " temp[k] = array[i]\n",
+ " k += 1\n",
+ " i += 1\n",
+ " while(j<=high):\n",
+ " temp[k] = array[j]\n",
+ " k += 1\n",
+ " j += 1\n",
+ "\n",
+ " for i in range(low,high+1):\n",
+ " array[i] = temp[i]\n",
+ "\n",
+ "def merge_sort(low, high):\n",
+ " if (low != high):\n",
+ " mid = (low+high)/2;\n",
+ " merge_sort(low , mid)\n",
+ " merge_sort(mid+1, high)\n",
+ " merge(low, mid, high)\n",
+ " \n",
+ "print \"\\nEnter the number of elements: \"\n",
+ "n = int(raw_input())\n",
+ "for i in range(n):\n",
+ " print \"Enter element %d: \" %(i+1),\n",
+ " array.append(int(raw_input()))\n",
+ "print \"\\nUnsorted list is: \",\n",
+ "for i in range(n):\n",
+ " print array[i],\n",
+ "merge_sort(0, n-1)\n",
+ "print \"\\nSorted list is :\",\n",
+ "for i in range(n):\n",
+ " print array[i],"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11, page no. 184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter the number of elements in the list: 3\n",
+ " Enter element 1: 15\n",
+ " 15\n",
+ "Enter element 2: 10\n",
+ " Enter element 3: 12\n",
+ " 10\n",
+ "\n",
+ "Unsorted list is: 15 10 12 \n",
+ "\n",
+ "Largest Element is 15\n",
+ "\n",
+ "Number of digits in it are 2 \n",
+ "\n",
+ "PASS 1 : Examining 1th digit from right\n",
+ "\n",
+ "mindig=0 maxdig=5\n",
+ "\n",
+ "\n",
+ "New list : 10 12 15 \n",
+ "\n",
+ "PASS 2 : Examining 2th digit from right\n",
+ "\n",
+ "mindig=1 maxdig=1\n",
+ "\n",
+ "\n",
+ "New list : 10 12 15 \n",
+ "\n",
+ "Sorted list is: \n",
+ "10 12 15 \n"
+ ]
+ }
+ ],
+ "source": [
+ "from numpy import zeros\n",
+ "class node:\n",
+ " def __init__(self, info=None, link=None):\n",
+ " self.info = info\n",
+ " self.link = link\n",
+ "\n",
+ "start = None\n",
+ "\n",
+ "\n",
+ "def display():\n",
+ " global start\n",
+ " p = start\n",
+ " while(p != None):\n",
+ " print p.info,\n",
+ " p = p.link\n",
+ " print \"\"\n",
+ " \n",
+ "def large_dig(p):\n",
+ " large = 0\n",
+ " ndig = 0\n",
+ " while (p!=None):\n",
+ " if (p.info > large):\n",
+ " large = p.info\n",
+ " p = p.link\n",
+ " print \"\\nLargest Element is %d\" %large\n",
+ " while (large!=0):\n",
+ " ndig += 1\n",
+ " large = large/10\n",
+ " print \"\\nNumber of digits in it are %d \" %ndig\n",
+ " return ndig\n",
+ "\n",
+ "def digit(number, k):\n",
+ " digit = 0\n",
+ " for i in range (1, k+1):\n",
+ " digit = number % 10 ;\n",
+ " number = number /10 ;\n",
+ " return digit\n",
+ "\n",
+ "def radix_sort():\n",
+ " global start\n",
+ " rear = []\n",
+ " front = []\n",
+ " least_sig=1;\n",
+ " most_sig=large_dig(start);\n",
+ " for k in range(least_sig, most_sig+1):\n",
+ " print \"\\nPASS %d : Examining %dth digit from right\" %(k,k)\n",
+ " for i in range(0,10):\n",
+ " rear.append(None)\n",
+ " front.append(None)\n",
+ " maxdig=0\n",
+ " mindig=9\n",
+ " p = start\n",
+ " while(p!=None):\n",
+ " dig = digit(p.info, k)\n",
+ " if (dig>maxdig):\n",
+ " maxdig=dig\n",
+ " if (dig<mindig):\n",
+ " mindig=dig \n",
+ " if (front[dig] == None):\n",
+ " front[dig] = p\n",
+ " else:\n",
+ " rear[dig].link = p\n",
+ " rear[dig] = p\n",
+ " p = p.link\n",
+ " print \"\\nmindig=%d maxdig=%d\\n\" %(mindig, maxdig)\n",
+ " start = front[mindig]\n",
+ " for i in range(mindig,maxdig):\n",
+ " if (rear[i+1]!=None):\n",
+ " rear[i].link = front[i+1]\n",
+ " else:\n",
+ " rear[i+1]=rear[i];\n",
+ " rear[maxdig].link = None\n",
+ " print \"\\nNew list : \",\n",
+ " display()\n",
+ "\n",
+ "\n",
+ "q = node()\n",
+ "print \"Enter the number of elements in the list: \",\n",
+ "n = int(raw_input())\n",
+ "for i in range(n):\n",
+ " print \"Enter element %d: \" %(i+1),\n",
+ " item = int(raw_input())\n",
+ " tmp = node()\n",
+ " tmp.info = item\n",
+ " tmp.link = None\n",
+ " if (start == None):\n",
+ " start = tmp\n",
+ " print start.info\n",
+ " else:\n",
+ " q = start\n",
+ " while(q.link != None):\n",
+ " q = q.link\n",
+ " print q.info\n",
+ " q.link = tmp\n",
+ "print \"\\nUnsorted list is: \",\n",
+ "display()\n",
+ "radix_sort()\n",
+ "print \"\\nSorted list is: \"\n",
+ "display ()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12, Page no. 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter number of elements: "
+ ]
+ }
+ ],
+ "source": [
+ "arr = []\n",
+ "n = None\n",
+ "\n",
+ "def display():\n",
+ " global n\n",
+ " for i in range(n):\n",
+ " print arr[i],\n",
+ "\n",
+ "\n",
+ "def insert(num, loc):\n",
+ " while(loc>0):\n",
+ " par = (loc-1)/2;\n",
+ " if (num<=arr[par]):\n",
+ " arr[loc] = num\n",
+ " return\n",
+ " arr[loc] = arr[par]\n",
+ " loc=par\n",
+ " arr[0] = num\n",
+ "\n",
+ "def create_heap():\n",
+ " global n\n",
+ " for i in range(n):\n",
+ " arr.append(i)\n",
+ "\n",
+ "def del_root(last):\n",
+ " i=0\n",
+ " arr[i], arr[last] = arr[last], arr[i]\n",
+ " left = 2*i+1\n",
+ " right = 2*i+2\n",
+ " while(right<last):\n",
+ " if (arr[i]>=arr[left] and arr[i]>=arr[right]):\n",
+ " return\n",
+ " if (arr[right]<=arr[left]):\n",
+ " arr[i], arr[left] = arr[left], arr[i]\n",
+ " else:\n",
+ " arr[i], arr[right] = arr[right], arr[i]\n",
+ " i=right;\n",
+ " left=2*i+1;\n",
+ " right=2*i+2;\n",
+ " if (left==last-1 and arr[i]<arr[left]):\n",
+ " arr[i], arr[left] = arr[left], arr[i]\n",
+ "\n",
+ "def heap_sort():\n",
+ " global n\n",
+ " last = n-1\n",
+ " while(last>0):\n",
+ " del_root(last)\n",
+ " last -= 1\n",
+ "\n",
+ "print \"Enter number of elements: \",\n",
+ "n = int(raw_input())\n",
+ "for i in range(n):\n",
+ " print \"Enter element %d: \" %(i+1),\n",
+ " arr.append(int(raw_input()))\n",
+ "print \"\\nEntered list is: \",\n",
+ "display()\n",
+ "create_heap()\n",
+ "print \"\\nHeap is: \",\n",
+ "display()\n",
+ "heap_sort()\n",
+ "print \"\\nSorted list is: \",\n",
+ "display()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter7.ipynb b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter7.ipynb
new file mode 100644
index 00000000..aa91e3c2
--- /dev/null
+++ b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter7.ipynb
@@ -0,0 +1,359 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 7: Searching & Hashing"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1, page no. 208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "nHow many elements you want to enter in the array: 3\n",
+ " Enter element 1: 15\n",
+ " Enter element 2: 10\n",
+ " Enter element 3: 5\n",
+ " \n",
+ "\n",
+ "Press any key to continue...\n",
+ "\n",
+ "Enter the element to be searched: 5\n",
+ " \n",
+ "5 found at position 3\n",
+ "Press (Y/y) to continue: n\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "arr = []\n",
+ "opt = 'y'\n",
+ "print \"nHow many elements you want to enter in the array: \",\n",
+ "n = int(raw_input())\n",
+ "for i in range(n):\n",
+ " print \"Enter element %d: \" %(i+1),\n",
+ " arr.append(int(raw_input()))\n",
+ "print \"\\n\\nPress any key to continue...\"\n",
+ "raw_input()\n",
+ "\n",
+ "while (1):\n",
+ " if opt == 'Y' or opt == 'y':\n",
+ " print \"Enter the element to be searched: \",\n",
+ " item = int(raw_input())\n",
+ " found = False\n",
+ " for i in range(n):\n",
+ " if (item == arr[i]):\n",
+ " print \"\\n%d found at position %d\" %(item,(i+1))\n",
+ " found = True\n",
+ " break\n",
+ " if not found:\n",
+ " print \"Item %d not found in array\" %item\n",
+ " print \"Press (Y/y) to continue: \",\n",
+ " opt = raw_input()\n",
+ " else:\n",
+ " sys.exit()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2, page no. 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " How many elements you want to enter in the array ?: 3\n",
+ " Enter element 1: 15\n",
+ " Enter element 2: 10\n",
+ " Enter element 3: 5\n",
+ " \n",
+ "Press any key to continue...\n",
+ " Enter the element to be searched: 10\n",
+ " 10 found at position 2\n",
+ "Press (Y/y) to continue: n\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "arr = []\n",
+ "print \"How many elements you want to enter in the array ?: \",\n",
+ "n = int(raw_input())\n",
+ "for i in range(n):\n",
+ " print \"Enter element %d: \" %(i+1),\n",
+ " arr.append(int(raw_input()))\n",
+ "print \"\\nPress any key to continue...\",\n",
+ "raw_input()\n",
+ "opt = 'y'\n",
+ "while(1):\n",
+ " if opt == \"Y\" or opt == \"y\":\n",
+ " print \"Enter the element to be searched: \",\n",
+ " item = int(raw_input())\n",
+ " start = 0\n",
+ " end = n - 1\n",
+ " middle = (start + end)/2\n",
+ " while(item != arr[middle] and start <= end):\n",
+ " if (item > arr[middle]):\n",
+ " start = middle+1\n",
+ " else:\n",
+ " end = middle-1\n",
+ " middle = (start+end)/2\n",
+ " if (item==arr[middle]):\n",
+ " print \"%d found at position %d\" %(item,(middle + 1));\n",
+ " if (start>end):\n",
+ " print \"%d not found in array\" %item\n",
+ " print \"Press (Y/y) to continue: \",\n",
+ " opt = raw_input()\n",
+ " else:\n",
+ " sys.exit()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3, page no. 215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter the number of elements: 3\n",
+ " Enter element 1: 5\n",
+ " Enter element 2: 10\n",
+ " Enter element 3: 15\n",
+ " Enter the Number to be searched: 15\n",
+ " The key 15 is found at the location 2\n",
+ "Press any key to continue...\n"
+ ]
+ },
+ {
+ "data": {
+ "text/plain": [
+ "''"
+ ]
+ },
+ "execution_count": 5,
+ "metadata": {},
+ "output_type": "execute_result"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "class interpolation:\n",
+ " def InterSearch(self, arr, no):\n",
+ " Low = 0\n",
+ " High = no - 1\n",
+ " print \"Enter the Number to be searched: \",\n",
+ " key = int(raw_input())\n",
+ " while(Low < High):\n",
+ " Mid = (Low+(High-Low)) * ((key-arr[Low])/(arr[High]-arr[Low]))\n",
+ " if (key < arr[Mid]):\n",
+ " High = Mid-1\n",
+ " elif (key > arr[Mid]):\n",
+ " Low = Mid+1;\n",
+ " else:\n",
+ " print \"The key \", key, \" is found at the location \", Mid\n",
+ " return\n",
+ " print \"\\nThe Key \" , key, \" is NOT found\"\n",
+ "\n",
+ "\n",
+ "ob = interpolation()\n",
+ "print \"Enter the number of elements: \",\n",
+ "n = int(raw_input())\n",
+ "a = []\n",
+ "for i in range(n):\n",
+ " print \"Enter element %d: \" %(i+1),\n",
+ " a.append(int(raw_input()))\n",
+ "b = a\n",
+ "ob.InterSearch(b,n);\n",
+ "print \"Press any key to continue...\",\n",
+ "raw_input()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4, page no. 217"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter the total number of list: 3\n",
+ " Enter the elements in the list \n",
+ "Input number 1 : 5\n",
+ " Input number 2 : 10\n",
+ " Input number 3 : 15\n",
+ " Enter the number to be searched: 10\n",
+ " The number is in the list...\n",
+ "\n"
+ ]
+ },
+ {
+ "data": {
+ "text/plain": [
+ "''"
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "def fib(n):\n",
+ " f1 = 0\n",
+ " f2 = 1\n",
+ " for i in range(n):\n",
+ " temp = f2\n",
+ " f2 = (f1+f2)\n",
+ " f1 = temp\n",
+ " return f2\n",
+ "\n",
+ "def fibonacci_search(lst, n, item):\n",
+ " j = 1\n",
+ " while(fib(j)<n):\n",
+ " f1 = fib(j-2)\n",
+ " j += 1\n",
+ " f2 = fib(j-3)\n",
+ " mid = n-(f1+1);\n",
+ " while (item != lst[mid]):\n",
+ " if(mid<0 or item > lst[mid]):\n",
+ " if (f1==1):\n",
+ " return -1\n",
+ " mid = mid+f2\n",
+ " f1 = f1-f2\n",
+ " f2 = f2-f1\n",
+ " else:\n",
+ " if (f2==0):\n",
+ " return -1\n",
+ " mid = mid-f2\n",
+ " t = f1-f2\n",
+ " f1 = f2\n",
+ " f2 = t\n",
+ " return mid\n",
+ " \n",
+ "lst = []\n",
+ "print \"Enter the total number of list: \",\n",
+ "n = int(raw_input())\n",
+ "print \"Enter the elements in the list \"\n",
+ "for i in range(n):\n",
+ " print \"Input number \", i+1, \": \",\n",
+ " lst.append(int(raw_input()))\n",
+ "print \"Enter the number to be searched: \",\n",
+ "item = int(raw_input())\n",
+ "loc = fibonacci_search(lst, n, item)\n",
+ "if (loc != -1):\n",
+ " print \"The number is in the list...\"\n",
+ "else:\n",
+ " print \"The number is not in the list...\"\n",
+ "raw_input()"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter8.ipynb b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter8.ipynb
new file mode 100644
index 00000000..08a04923
--- /dev/null
+++ b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter8.ipynb
@@ -0,0 +1,805 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 8: The Trees"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1, page no. 238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "1.Insert\n",
+ "2.Delete\n",
+ "3.Search\n",
+ "4.Display\n",
+ "5.Quit\n",
+ "Enter your choice : "
+ ]
+ }
+ ],
+ "source": [
+ "class node:\n",
+ " n = 0\n",
+ " keys = []\n",
+ " p = []\n",
+ "\n",
+ "root = None\n",
+ "\n",
+ "class KeyStatus:\n",
+ " Duplicate = 0\n",
+ " SearchFailure =1\n",
+ " Success = 2 \n",
+ " InsertIt = 3\n",
+ " LessKeys = 4\n",
+ "\n",
+ "def insert(key):\n",
+ " global root\n",
+ " newnode = node()\n",
+ " upKey = 0\n",
+ " value, upKey, newnode = ins(root, key, upKey, newnode)\n",
+ " if (value == KeyStatus.Duplicate):\n",
+ " print \"Key already available\"\n",
+ " if (value == KeyStatus.InsertIt):\n",
+ " uproot = root\n",
+ " root = node()\n",
+ " root.n = 1\n",
+ " root.keys.append(upKey)\n",
+ " root.p.append(uproot)\n",
+ " root.p.append(newnode)\n",
+ "\n",
+ "def ins(ptr, key, upKey, newnode):\n",
+ " newPtr = node()\n",
+ " lastPtr = node()\n",
+ " newKey = 0\n",
+ " if (ptr == None):\n",
+ " newnode = None\n",
+ " upKey = key\n",
+ " return KeyStatus.InsertIt, upKey, newnode\n",
+ " n = ptr.n\n",
+ " pos = searchPos(key, ptr.keys, n)\n",
+ " print pos\n",
+ " if (pos < n and key == ptr.keys[pos]):\n",
+ " return KeyStatus.Duplicate, upKey, newnode\n",
+ " value, newKey, newPtr = ins(ptr.p[pos], key, newKey, newPtr);\n",
+ " if (value != KeyStatus.InsertIt):\n",
+ " return value\n",
+ " if(n < (5-1)):\n",
+ " pos = searchPos(newKey, ptr.keys, n)\n",
+ " for i in range(pos, n, -1):\n",
+ " ptr.keys[i] = ptr.keys[i-1]\n",
+ " ptr.p.append(ptr.p[i])\n",
+ " ptr.keys.append(newKey)\n",
+ " ptr.p.append(newPtr)\n",
+ " ptr.n += 1\n",
+ " return KeyStatus.Success, upKey, newnode\n",
+ " if (pos == 5 - 1):\n",
+ " lastKey = newKey;\n",
+ " lastPtr = newPtr;\n",
+ " else:\n",
+ " lastKey = ptr.keys[5-2];\n",
+ " lastPtr = ptr.p[5-1];\n",
+ " for i in range(pos, 5-2, -1):\n",
+ " ptr.keys[i] = ptr.keys[i-1]\n",
+ " ptr.p.append(ptr.p[i])\n",
+ " ptr.keys.append(newKey)\n",
+ " ptr.p.append(newPtr)\n",
+ " splitPos = (5 - 1)/2\n",
+ " upKey = ptr.keys[splitPos]\n",
+ " newnode = node()\n",
+ " ptr.n = splitPos\n",
+ " newnode.n = 5-1-splitPos\n",
+ " for i in range(newnode.n):\n",
+ " newnode.p[i] = ptr.p[i + splitPos + 1]\n",
+ " if(i < newnode.n - 1):\n",
+ " newnode.keys[i] = ptr.keys[i + splitPos + 1]\n",
+ " else:\n",
+ " newnode.keys[i] = lastKey\n",
+ " newnode.p[newnode.n] = lastPtr\n",
+ " return KeyStatus.InsertIt, upKey, newnode\n",
+ "\n",
+ "def display(ptr, blanks):\n",
+ " if (ptr):\n",
+ " for i in range(blanks):\n",
+ " print \" \"\n",
+ " for i in range(ptr.n):\n",
+ " print \"%d \" %ptr.keys[i],\n",
+ " print \"\\n\"\n",
+ " for i in range(ptr.n):\n",
+ " display(ptr.p[i], blanks+10)\n",
+ "\n",
+ "def searchPos(key, key_arr, n):\n",
+ " pos = 0\n",
+ " while(pos < n and key > key_arr[pos]):\n",
+ " pos += 1\n",
+ " return pos\n",
+ "\n",
+ "def search(key):\n",
+ " global root\n",
+ " ptr = root\n",
+ " print \"Search path: \"\n",
+ " while(ptr):\n",
+ " n = ptr.n\n",
+ " for i in range(ptr.n):\n",
+ " print \"%d\" %ptr.keys[i]\n",
+ " print \"\\n\"\n",
+ " pos = searchPos(key, ptr.keys, n);\n",
+ " if (pos < n and key == ptr.keys[pos]):\n",
+ " print \"\\nKey %d found in position %d of last dispalyed node\\n\" %(key,i)\n",
+ " return\n",
+ " ptr = ptr.p[pos]\n",
+ " print \"Key %d is not available\\n\" %key\n",
+ "\n",
+ "def my_del(ptr, key):\n",
+ " p = node()\n",
+ " lptr = node()\n",
+ " rptr = node()\n",
+ " if(ptr == None):\n",
+ " return SearchFailure;\n",
+ " n=ptr.n\n",
+ " key_arr = ptr.keys\n",
+ " p = ptr.p\n",
+ " min = (5 - 1)/2\n",
+ " pos = searchPos(key, key_arr, n)\n",
+ " if(p[0] == None):\n",
+ " if (pos == n or key < key_arr[pos]):\n",
+ " return KeyStatus.SearchFailure\n",
+ " for i in range(pos+1, n):\n",
+ " key_arr[i-1] = key_arr[i]\n",
+ " p[i] = p[i+1]\n",
+ " ptr.n -= 1\n",
+ " temp = 0\n",
+ " if(ptr == root):\n",
+ " temp = 1\n",
+ " else:\n",
+ " temp = min\n",
+ " if(ptr.n >= temp):\n",
+ " return KeyStatus.Success\n",
+ " else:\n",
+ " return KeyStatus.LessKeys\n",
+ " if (pos < n and key == key_arr[pos]):\n",
+ " qp = p[pos]\n",
+ " while(True):\n",
+ " nkey = qp.n\n",
+ " qp1 = qp.p[nkey]\n",
+ " if (qp1 == None):\n",
+ " break\n",
+ " qp = qp1\n",
+ " key_arr[pos] = qp.keys[nkey-1]\n",
+ " qp.keys[nkey - 1] = key\n",
+ " value = my_del(p[pos], key)\n",
+ " if (value != KeyStatus.LessKeys):\n",
+ " return value\n",
+ " if (pos > 0 and p[pos-1].n > min):\n",
+ " pivot = pos - 1\n",
+ " lptr = p[pivot]\n",
+ " rptr = p[pos]\n",
+ " rptr.p[rptr.n + 1] = rptr.p[rptr.n]\n",
+ " for i in range(0, ptr.n, -1):\n",
+ " rptr.keys[i] = rptr.keys[i-1];\n",
+ " rptr.p[i] = rptr.p[i-1];\n",
+ " rptr.n += 1\n",
+ " rptr.keys[0] = key_arr[pivot]\n",
+ " rptr.p[0] = lptr.p[lptr.n]\n",
+ " key_arr[pivot] = lptr .keys[--lptr.n];\n",
+ " return KeyStatus.Success\n",
+ " if (pos<n and p[pos+1].n > min):\n",
+ " pivot = pos\n",
+ " lptr = p[pivot]\n",
+ " rptr = p[pivot+1]\n",
+ " lptr.keys[lptr.n] = key_arr[pivot]\n",
+ " lptr.p[lptr.n + 1] = rptr.p[0]\n",
+ " key_arr[pivot] = rptr.keys[0]\n",
+ " lptr.n += 1\n",
+ " rptr.n -= 1\n",
+ " for i in range(rptr.n):\n",
+ " rptr.keys[i] = rptr.keys[i+1]\n",
+ " rptr.p[i] = rptr.p[i+1]\n",
+ " rptr .p[rptr.n] = rptr.p[rptr.n + 1]\n",
+ " return KeyStatus.Success\n",
+ " if(pos == n):\n",
+ " pivot = pos-1\n",
+ " else:\n",
+ " pivot = pos\n",
+ " lptr = p[pivot]\n",
+ " rptr = p[pivot+1]\n",
+ " lptr.keys[lptr.n] = key_arr[pivot]\n",
+ " lptr.p[lptr.n + 1] = rptr.p[0]\n",
+ " for i in range(rptr.n):\n",
+ " lptr.keys[lptr .n + 1 + i] = rptr.keys[i]\n",
+ " lptr.p[lptr.n + 2 + i] = rptr.p[i+1]\n",
+ " lptr.n = lptr.n + rptr.n +1\n",
+ " for i in range(pos+1, n):\n",
+ " key_arr[i-1] = key_arr[i]\n",
+ " p[i] = p[i+1]\n",
+ " ptr -= 1\n",
+ " temp = 0\n",
+ " if(ptr == root):\n",
+ " temp = 1\n",
+ " else:\n",
+ " temp = min\n",
+ " if(ptr.n >= temp):\n",
+ " return KeyStatus.Success\n",
+ " else:\n",
+ " return KeyStatus.LessKeys\n",
+ "\n",
+ "def DelNode(key):\n",
+ " global root\n",
+ " uproot = node()\n",
+ " value = my_del(root,key)\n",
+ " if value == KeyStatus.SearchFailure:\n",
+ " print \"Key %d is not available\" %key\n",
+ " return\n",
+ " if value == KeyStatus.LessKeys:\n",
+ " uproot = root\n",
+ " root = root.p[0]\n",
+ " return\n",
+ "\n",
+ "\n",
+ "while(True):\n",
+ " print \"1.Insert\"\n",
+ " print \"2.Delete\"\n",
+ " print \"3.Search\"\n",
+ " print \"4.Display\"\n",
+ " print \"5.Quit\"\n",
+ " print \"Enter your choice : \",\n",
+ " choice = int(raw_input())\n",
+ " if choice == 1:\n",
+ " print \"\\nEnter the key : \",\n",
+ " key = int(raw_input())\n",
+ " insert(key)\n",
+ " elif choice == 2:\n",
+ " print \"\\nEnter the key : \",\n",
+ " key = int(raw_input())\n",
+ " DelNode(key)\n",
+ " elif choice == 3:\n",
+ " print \"\\nEnter the key : \",\n",
+ " key = int(raw_input())\n",
+ " search(key)\n",
+ " elif choice == 4:\n",
+ " print \"\\nBtree is :\\n\"\n",
+ " display(root,0)\n",
+ " elif choice == 5:\n",
+ " import sys\n",
+ " sys.exit()\n",
+ " else:\n",
+ " print \"Wrong choice\"\n",
+ " break"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2, page no. 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "def preorder(p):\n",
+ " stack = []\n",
+ " top = -1\n",
+ " if(p != None):\n",
+ " print p.info\n",
+ " if(p.rchild != None):\n",
+ " top += 1\n",
+ " stack[top] = p.rchild\n",
+ " p = p.lchild\n",
+ " while(top >= -1):\n",
+ " while ( p!= None):\n",
+ " print p.data\n",
+ " if(p.rchild != None):\n",
+ " top += 1\n",
+ " stack[top] = p.rchild\n",
+ " p = p.lchild\n",
+ " p = stack[top]\n",
+ " top -= 1"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Eample 3, page no. 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "def inorder(p):\n",
+ " stack = []\n",
+ " top = -1;\n",
+ " if(p != None):\n",
+ " top += 1\n",
+ " stack[top] = p\n",
+ " p = p.lchild\n",
+ " while(top >= 0):\n",
+ " while ( p!= None):\n",
+ " top += 1\n",
+ " stack[top] = p\n",
+ " p = p.lchild\n",
+ " p = stack[top]\n",
+ " top -= 1\n",
+ " print p.data\n",
+ " p = p.rchild\n",
+ " if ( p != None):\n",
+ " top += 1\n",
+ " stack[top] = p\n",
+ " p = p.lchild"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4, page no. 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "def postorder(p):\n",
+ " stack = []\n",
+ " sig = 0\n",
+ " sign = []\n",
+ " top = -1\n",
+ " if(p != None):\n",
+ " top += 1\n",
+ " stack[top] = p\n",
+ " sign[top] = 1\n",
+ " if(p.rchild != None):\n",
+ " top += 1\n",
+ " stack[top] = p.rchild\n",
+ " sign[top] = -1\n",
+ " p = p.lchild\n",
+ " while(top >= 0):\n",
+ " while(p != None):\n",
+ " top += 1\n",
+ " stack[top] = p\n",
+ " sign[top] = 1\n",
+ " if(p.rchild != None):\n",
+ " top += 1\n",
+ " stack[top] = p.rchild\n",
+ " sign[top] = -1\n",
+ " p = p.lchild\n",
+ " p = stack[top]\n",
+ " sig = sign[top]\n",
+ " top -= 1\n",
+ " while((sig > 0) and (top >= -1)):\n",
+ " print p.info\n",
+ " p = stack[top]\n",
+ " sig = sign[top]\n",
+ " top -= 1"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5, page no. 264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "1.Insert\n",
+ "2.Delete\n",
+ "3.Inorder Traversal\n",
+ "4.Preorder Traversal\n",
+ "5.Postorder Traversal\n",
+ "6.Display\n",
+ "7.Quit\n",
+ "\n",
+ "Enter your choice: 1\n",
+ " Enter the number to be inserted: 5\n",
+ " \n",
+ "1.Insert\n",
+ "2.Delete\n",
+ "3.Inorder Traversal\n",
+ "4.Preorder Traversal\n",
+ "5.Postorder Traversal\n",
+ "6.Display\n",
+ "7.Quit\n",
+ "\n",
+ "Enter your choice: 1\n",
+ " Enter the number to be inserted: 2\n",
+ " \n",
+ "1.Insert\n",
+ "2.Delete\n",
+ "3.Inorder Traversal\n",
+ "4.Preorder Traversal\n",
+ "5.Postorder Traversal\n",
+ "6.Display\n",
+ "7.Quit\n",
+ "\n",
+ "Enter your choice: 1\n",
+ " Enter the number to be inserted: 6\n",
+ " \n",
+ "1.Insert\n",
+ "2.Delete\n",
+ "3.Inorder Traversal\n",
+ "4.Preorder Traversal\n",
+ "5.Postorder Traversal\n",
+ "6.Display\n",
+ "7.Quit\n",
+ "\n",
+ "Enter your choice: 1\n",
+ " Enter the number to be inserted: 3\n",
+ " \n",
+ "1.Insert\n",
+ "2.Delete\n",
+ "3.Inorder Traversal\n",
+ "4.Preorder Traversal\n",
+ "5.Postorder Traversal\n",
+ "6.Display\n",
+ "7.Quit\n",
+ "\n",
+ "Enter your choice: 1\n",
+ " Enter the number to be inserted: 7\n",
+ " \n",
+ "1.Insert\n",
+ "2.Delete\n",
+ "3.Inorder Traversal\n",
+ "4.Preorder Traversal\n",
+ "5.Postorder Traversal\n",
+ "6.Display\n",
+ "7.Quit\n",
+ "\n",
+ "Enter your choice: 1\n",
+ " Enter the number to be inserted: 4\n",
+ " \n",
+ "1.Insert\n",
+ "2.Delete\n",
+ "3.Inorder Traversal\n",
+ "4.Preorder Traversal\n",
+ "5.Postorder Traversal\n",
+ "6.Display\n",
+ "7.Quit\n",
+ "\n",
+ "Enter your choice: 1\n",
+ " Enter the number to be inserted: 8\n",
+ " \n",
+ "1.Insert\n",
+ "2.Delete\n",
+ "3.Inorder Traversal\n",
+ "4.Preorder Traversal\n",
+ "5.Postorder Traversal\n",
+ "6.Display\n",
+ "7.Quit\n",
+ "\n",
+ "Enter your choice: 3\n",
+ " 2\n",
+ "3\n",
+ "4\n",
+ "5\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "\n",
+ "\n",
+ "1.Insert\n",
+ "2.Delete\n",
+ "3.Inorder Traversal\n",
+ "4.Preorder Traversal\n",
+ "5.Postorder Traversal\n",
+ "6.Display\n",
+ "7.Quit\n",
+ "\n",
+ "Enter your choice: 5\n",
+ " 4\n",
+ "3\n",
+ "2\n",
+ "8\n",
+ "7\n",
+ "6\n",
+ "5\n",
+ "\n",
+ "\n",
+ "1.Insert\n",
+ "2.Delete\n",
+ "3.Inorder Traversal\n",
+ "4.Preorder Traversal\n",
+ "5.Postorder Traversal\n",
+ "6.Display\n",
+ "7.Quit\n",
+ "\n",
+ "Enter your choice: 7\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "class BST:\n",
+ " class node:\n",
+ " info = None\n",
+ " lchild = None\n",
+ " rchild = None\n",
+ " def __init__(self):\n",
+ " self.root = self.node()\n",
+ "\n",
+ " def find(self, item, par, loc):\n",
+ " ptr = self.node()\n",
+ " ptrsave = self.node()\n",
+ " if(self.root==None):\n",
+ " loc = None\n",
+ " par = None\n",
+ " return\n",
+ " if(item == self.root.info):\n",
+ " loc = self.root\n",
+ " par = None\n",
+ " return\n",
+ " if(item < self.root.info):\n",
+ " ptr = self.root.lchild\n",
+ " else:\n",
+ " ptr = self.root.rchild\n",
+ " ptrsave = self.root\n",
+ " while(ptr!=None):\n",
+ " if(item == ptr.info):\n",
+ " loc = ptr\n",
+ " par = ptrsave\n",
+ " return\n",
+ " ptrsave = ptr\n",
+ " if(item<ptr.info):\n",
+ " ptr = ptr.lchild\n",
+ " else:\n",
+ " ptr = ptr.rchild\n",
+ " loc = None\n",
+ " par = ptrsave\n",
+ " return par,loc\n",
+ " \n",
+ " def case_a(self, par, loc):\n",
+ " if(par == None):\n",
+ " self.root = None\n",
+ " else:\n",
+ " if(loc == par.lchild):\n",
+ " par.lchild = None\n",
+ " else:\n",
+ " par.rchild = None\n",
+ " \n",
+ " def case_b(self, par, loc):\n",
+ " child = self.node()\n",
+ " if(loc.lchild != None):\n",
+ " chile = loc.lchild\n",
+ " else:\n",
+ " child = loc.rchild\n",
+ " if(par == None):\n",
+ " self.root = None\n",
+ " else:\n",
+ " if(loc == par.lchild):\n",
+ " par.lchild = child\n",
+ " else:\n",
+ " par.rchid = child\n",
+ " \n",
+ " def case_c(self, par, loc):\n",
+ " ptr = self.node()\n",
+ " ptrsave = self.node()\n",
+ " suc = self.node()\n",
+ " parsuc = self.node()\n",
+ " ptrsave = loc\n",
+ " ptr = loc.lchild\n",
+ " while(ptr.lchild != None):\n",
+ " ptrsave = ptr\n",
+ " ptr = ptr.lchild\n",
+ " suc = ptr\n",
+ " parsuc = ptrsave\n",
+ " if(suc.lchild == None and suc.rchild == None):\n",
+ " self.case_a(parsuc, suc)\n",
+ " else:\n",
+ " self.case_b(parsuc, suc)\n",
+ " if(par==None):\n",
+ " self.root = suc\n",
+ " else: \n",
+ " if(loc==par.lchild):\n",
+ " par.lchild = suc\n",
+ " else:\n",
+ " par.rchild = suc\n",
+ " suc.lchild = loc.lchild\n",
+ " suc.rchild = loc.rchild\n",
+ " \n",
+ " def insert(self, item):\n",
+ " tmp = self.node()\n",
+ " parent = self.node()\n",
+ " location = self.node()\n",
+ " parent,location = self.find(item, parent, location)\n",
+ " if(location != None):\n",
+ " print \"Item already present\"\n",
+ " raw_input()\n",
+ " return\n",
+ " tmp.info = item\n",
+ " tmp.lchild = None\n",
+ " tmp.rchild = None\n",
+ " if(parent.info==None):\n",
+ " self.root = tmp\n",
+ " else:\n",
+ " if(item<parent.info):\n",
+ " parent.lchild=tmp\n",
+ " else:\n",
+ " parent.rchild=tmp\n",
+ " \n",
+ " def my_del(self, item):\n",
+ " parent = self.node()\n",
+ " location = self.node()\n",
+ " if(self.root==None):\n",
+ " print \"Tree is empty\"\n",
+ " raw_input()\n",
+ " return\n",
+ " self.find(item, parent, location)\n",
+ " if(location==None):\n",
+ " print \"Item not present in tree\"\n",
+ " return\n",
+ " if(location.lchild==None and location.rchild==None):\n",
+ " self.case_a(parent,location)\n",
+ " if(location.lchild!=None and location.rchild==None):\n",
+ " self.case_b(parent,location)\n",
+ " if(location.lchild==None and location.rchild!=None):\n",
+ " self.case_b(parent,location)\n",
+ " if(location.lchild!=None and location.rchild!=None):\n",
+ " self.case_c(parent,location)\n",
+ " delete(location)\n",
+ " \n",
+ " def preorder(self, ptr):\n",
+ " if(self.root==None):\n",
+ " print \"Tree is empty\"\n",
+ " raw_input()\n",
+ " return\n",
+ " if(ptr!=None):\n",
+ " print ptr.info\n",
+ " self.preorder(ptr.lchild)\n",
+ " self.preorder(ptr.rchild)\n",
+ " \n",
+ " def inorder(self, ptr):\n",
+ " if(self.root==None):\n",
+ " print \"Tree is empty\"\n",
+ " raw_input()\n",
+ " return\n",
+ " if(ptr!=None):\n",
+ " self.inorder(ptr.lchild)\n",
+ " print ptr.info\n",
+ " self.inorder(ptr.rchild)\n",
+ " \n",
+ " def postorder(self, ptr):\n",
+ " if(self.root==None):\n",
+ " print \"Tree is empty\"\n",
+ " raw_input()\n",
+ " return\n",
+ " if(ptr!=None):\n",
+ " self.postorder(ptr.lchild)\n",
+ " self.postorder(ptr.rchild)\n",
+ " print ptr.info\n",
+ " \n",
+ " def display(self, ptr, level):\n",
+ " #print ptr.info\n",
+ " if (ptr!=None):\n",
+ " self.display(ptr.rchild, level+1);\n",
+ " for i in range(level):\n",
+ " print \" \"\n",
+ " print ptr.info\n",
+ " self.display(ptr.lchild, level+1)\n",
+ "\n",
+ "bo = BST()\n",
+ "while(1):\n",
+ " print \"\\n1.Insert\"\n",
+ " print \"2.Delete\"\n",
+ " print \"3.Inorder Traversal\"\n",
+ " print \"4.Preorder Traversal\"\n",
+ " print \"5.Postorder Traversal\"\n",
+ " print \"6.Display\"\n",
+ " print \"7.Quit\"\n",
+ " print \"\\nEnter your choice: \",\n",
+ " choice = int(raw_input())\n",
+ " if choice == 1:\n",
+ " print \"Enter the number to be inserted: \",\n",
+ " num = int(raw_input())\n",
+ " bo.insert(num)\n",
+ " elif choice == 2:\n",
+ " print \"Enter the number to be deleted: \",\n",
+ " num = int(raw_input())\n",
+ " bo.my_del(num)\n",
+ " elif choice == 3:\n",
+ " bo.inorder(bo.root)\n",
+ " raw_input()\n",
+ " elif choice == 4:\n",
+ " bo.preorder(bo.root)\n",
+ " raw_input()\n",
+ " elif choice == 5:\n",
+ " bo.postorder(bo.root);\n",
+ " raw_input()\n",
+ " elif choice == 6:\n",
+ " bo.display(bo.root,1);\n",
+ " raw_input()\n",
+ " elif choice == 7:\n",
+ " sys.exit()\n",
+ " else:\n",
+ " print \"Wrong choice...\"\n",
+ " raw_input()"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter9.ipynb b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter9.ipynb
new file mode 100644
index 00000000..a684d164
--- /dev/null
+++ b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/chapter9.ipynb
@@ -0,0 +1,902 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 9: Graphs"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1, page no. 314"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter number of nodes: 3\n",
+ " Enter edge 1(0 0) to quit: \n",
+ "1\n",
+ "2\n",
+ "Enter edge 2(0 0) to quit: \n",
+ "2\n",
+ "3\n",
+ "Enter edge 3(0 0) to quit: \n",
+ "3\n",
+ "1\n",
+ "Enter edge 4(0 0) to quit: \n",
+ "0\n",
+ "0\n",
+ "1.Insert a node\n",
+ "2.Insert an edge\n",
+ "3.Delete a node\n",
+ "4.Delete an edge\n",
+ "5.Dispaly\n",
+ "6.Exit\n",
+ "Enter your choice: 5\n",
+ " -1 1 -1 \n",
+ " -1 -1 1 \n",
+ " 1 -1 -1 \n",
+ "1.Insert a node\n",
+ "2.Insert an edge\n",
+ "3.Delete a node\n",
+ "4.Delete an edge\n",
+ "5.Dispaly\n",
+ "6.Exit\n",
+ "Enter your choice: 1\n",
+ " The inserted node is 4 \n",
+ "1.Insert a node\n",
+ "2.Insert an edge\n",
+ "3.Delete a node\n",
+ "4.Delete an edge\n",
+ "5.Dispaly\n",
+ "6.Exit\n",
+ "Enter your choice: 5\n",
+ " -1 1 -1 0 \n",
+ " -1 -1 1 0 \n",
+ " 1 -1 -1 0 \n",
+ " 0 0 0 0 \n",
+ "1.Insert a node\n",
+ "2.Insert an edge\n",
+ "3.Delete a node\n",
+ "4.Delete an edge\n",
+ "5.Dispaly\n",
+ "6.Exit\n",
+ "Enter your choice: 6\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "adj =[]\n",
+ "n = None\n",
+ "\n",
+ "for i in range(20):\n",
+ " a = []\n",
+ " for j in range(20):\n",
+ " a.append(-1)\n",
+ " adj.append(a)\n",
+ "\n",
+ "def create_graph():\n",
+ " global n\n",
+ " print \"Enter number of nodes: \",\n",
+ " n = int(raw_input())\n",
+ " max_edges = n*(n-1)\n",
+ " for i in range(1,max_edges):\n",
+ " print \"Enter edge %d(0 0) to quit: \" %i\n",
+ " origin = int(raw_input())\n",
+ " destination = int(raw_input())\n",
+ " if ((origin==0) and (destination==0)):\n",
+ " break\n",
+ " if ( origin > n or destination > n or origin<=0 or destination<=0):\n",
+ " print \"Invalid edge! \"\n",
+ " i -= 1 \n",
+ " else:\n",
+ " adj[origin][destination] = 1\n",
+ "\n",
+ "def display():\n",
+ " global n\n",
+ " for i in range(1,n+1):\n",
+ " for j in range(1,n+1):\n",
+ " print \"%4d\" %(adj[i][j]),\n",
+ " print \"\"\n",
+ "\n",
+ "def insert_node():\n",
+ " global n\n",
+ " n += 1\n",
+ " print \"The inserted node is %d \" %n\n",
+ " for i in range(1,n+1):\n",
+ " adj[i][n] = 0\n",
+ " adj[n][i] = 0\n",
+ "\n",
+ "def delete_node(u):\n",
+ " global n\n",
+ " if(n == 0):\n",
+ " print \"Graph is empty \"\n",
+ " return\n",
+ " if ( u>n ):\n",
+ " print \"This node is not present in the graph \"\n",
+ " return\n",
+ " for i in range(u, n):\n",
+ " for j in range(1, n+1):\n",
+ " adj[j][i]=adj[j][i+1]\n",
+ " adj[i][j]=adj[i+1][j]\n",
+ " n -= 1\n",
+ "\n",
+ "def insert_edge(u, v):\n",
+ " global n\n",
+ " if (u > n):\n",
+ " print \"Source node does not exist\"\n",
+ " return\n",
+ " if(v > n):\n",
+ " print \"Destination node does not exist\"\n",
+ " return\n",
+ " adj[u][v] = 1\n",
+ "\n",
+ "def del_edge(u,v):\n",
+ " global n\n",
+ " if (u>n or v>n or adj[u][v]==0):\n",
+ " print \"This edge does not exist\"\n",
+ " return\n",
+ " adj[u][v] = 0\n",
+ "\n",
+ "create_graph()\n",
+ "while(1):\n",
+ " print \"1.Insert a node\"\n",
+ " print \"2.Insert an edge\"\n",
+ " print \"3.Delete a node\"\n",
+ " print \"4.Delete an edge\"\n",
+ " print \"5.Dispaly\"\n",
+ " print \"6.Exit\"\n",
+ " print \"Enter your choice: \",\n",
+ " choice = int(raw_input())\n",
+ " if choice == 1:\n",
+ " insert_node()\n",
+ " elif choice == 2:\n",
+ " print \"Enter an edge to be inserted: \",\n",
+ " origin = int(raw_input())\n",
+ " destin = int(raw_input())\n",
+ " insert_edge(origin, destin)\n",
+ " elif choice == 3:\n",
+ " print \"\\nEnter a node to be deleted: \",\n",
+ " node = int(raw_input())\n",
+ " delete_node(node)\n",
+ " elif choice == 4:\n",
+ " print \"Enter an edge to be deleted: \",\n",
+ " origin = int(raw_input())\n",
+ " destin = int(raw_input())\n",
+ " del_edge(origin,destin)\n",
+ " elif choice == 5:\n",
+ " display()\n",
+ " elif choice == 6:\n",
+ " sys.exit()\n",
+ " else:\n",
+ " print \"Wrong choice \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2, page no. 321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Enter Number of nodes: 10\n",
+ " Enter edges (0 0) to quit: 0\n",
+ "1\n",
+ " Enter edges (0 0) to quit: 0\n",
+ "2\n",
+ " Enter edges (0 0) to quit: 1\n",
+ "3\n",
+ " Enter edges (0 0) to quit: 1\n",
+ "4\n",
+ " Enter edges (0 0) to quit: 2\n",
+ "5\n",
+ " Enter edges (0 0) to quit: 5\n",
+ "6\n",
+ " Enter edges (0 0) to quit: 3\n",
+ "7\n",
+ " Enter edges (0 0) to quit: 4\n",
+ "9\n",
+ " Enter edges (0 0) to quit: 7\n",
+ "8\n",
+ " Enter edges (0 0) to quit: 0\n",
+ "0\n",
+ " Enter source: \n",
+ "0\n",
+ "Enter destination to be searched: \n",
+ "9\n",
+ "BFS Traversal\n",
+ "0 -> 1 -> 4 -> 9\n"
+ ]
+ }
+ ],
+ "source": [
+ "from collections import deque\n",
+ "\n",
+ "class MyBFS:\n",
+ " def __init__(self, n, e, src):\n",
+ " self.node = n\n",
+ " self.edges = e\n",
+ " self.source = src\n",
+ " self.color = ['W' for i in range(0,n)]\n",
+ " self.graph = color= [[False for i in range(0,n)] for j in range(0,n)]\n",
+ " self.queue = deque()\n",
+ " self.parent = [-1 for u in range(0,n)]\n",
+ "\n",
+ " self.create_graph()\n",
+ " self.traversal()\n",
+ "\n",
+ " def create_graph(self):\n",
+ " for u,v in self.edges:\n",
+ " self.graph[u][v], self.graph[v][u] = True, True\n",
+ "\n",
+ " def traversal(self):\n",
+ "\n",
+ " self.queue.append(self.source)\n",
+ " self.color[self.source] = 'B'\n",
+ "\n",
+ " while len(self.queue):\n",
+ " u = self.queue.popleft()\n",
+ " for v in range(0,self.node):\n",
+ " if self.graph[u][v] == True and self.color[v]=='W':\n",
+ " self.color[v]='B'\n",
+ " self.queue.append(v)\n",
+ " self.parent[v]=u\n",
+ "\n",
+ " def show_path(self, destin):\n",
+ " if destin == self.source:\n",
+ " print destin,\n",
+ " elif self.parent[destin] == -1:\n",
+ " print \"No Path\"\n",
+ " else:\n",
+ " self.show_path(self.parent[destin])\n",
+ " print \"-> \",destin,\n",
+ "\n",
+ "\n",
+ "e = []\n",
+ "print \"Enter Number of nodes: \", \n",
+ "n = int(raw_input())\n",
+ "for i in range(n):\n",
+ " print \"Enter edges (0 0) to quit: \",\n",
+ " origin = int(raw_input())\n",
+ " destin = int(raw_input())\n",
+ " if(origin == 0 and destin == 0):\n",
+ " break\n",
+ " temp = [origin, destin]\n",
+ " e.append(temp)\n",
+ " \n",
+ "print \"Enter source: \"\n",
+ "src = int(raw_input())\n",
+ "print \"Enter destination to be searched: \"\n",
+ "destin = int(raw_input())\n",
+ "#sample [(0,1),(0,3),(1,2),(1,5),(2,7),(3,4),(3,6),(4,5),(5,7)]\n",
+ "bfs = MyBFS(n, e, src)\n",
+ "print \"BFS Traversal\"\n",
+ "bfs.show_path(destin)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3, page no. 326"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter the number of nodes in graph maximum = 10: \n"
+ ]
+ }
+ ],
+ "source": [
+ "adj =[]\n",
+ "n = None\n",
+ "\n",
+ "for i in range(10):\n",
+ " a = []\n",
+ " for j in range(10):\n",
+ " a.append(-1)\n",
+ " adj.append(a)\n",
+ " \n",
+ "def buildadjm(adj, n):\n",
+ " for i in range(n):\n",
+ " for j in range(n):\n",
+ " print \"Enter 1 if there is an edge from %d to %d, otherwise enter 0 \" %(i,j),\n",
+ " adj[i][j] = int(raw_input())\n",
+ " \n",
+ "def dfs(x, visited, adj, n):\n",
+ " visited[x] = 1\n",
+ " print \"The node visited is %d\\n\" %x\n",
+ " for j in range(n):\n",
+ " if (adj[x][j] ==1 and visited[j] ==0):\n",
+ " dfs(j,visited,adj,n);\n",
+ "\n",
+ "visited = []\n",
+ "print \"Enter the number of nodes in graph maximum = 10: \"\n",
+ "n = int(raw_input())\n",
+ "buildadjm(adj, n);\n",
+ "for i in range(n):\n",
+ " visited.append(0)\n",
+ "for i in range(n):\n",
+ " if(visited[i] == 0):\n",
+ " dfs(i,visited,adj,n);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4, page no. 332"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter number of nodes: 3\n",
+ " Enter edge 1 (0 0) to quit: \n",
+ "0\n",
+ "1\n",
+ "Enter weight for this edge: 5\n",
+ " Enter edge 2 (0 0) to quit: \n",
+ "1\n",
+ "2\n",
+ "Enter weight for this edge: 7\n",
+ " Enter edge 3 (0 0) to quit: \n",
+ "2\n",
+ "0\n",
+ "Enter weight for this edge: 8\n",
+ " 0\n",
+ "Edge processed is 0->1 5\n",
+ "n1 = 0\n",
+ "n2 = 1\n",
+ "root_n1=0\n",
+ "root_n2=1\n",
+ "This edge inserted in the spanning tree: 0\n",
+ "1\n",
+ "Edge processed is 1->2 7\n",
+ "n1 = 1\n",
+ "n2 = 2\n",
+ "root_n1=1\n",
+ "root_n2=2\n",
+ "This edge inserted in the spanning tree: 1\n",
+ "Edges to be included in spanning tree are: 2\n",
+ "0 1\n",
+ "1 2\n",
+ "Weight of the minimum spanning tree is: 12\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "class edge:\n",
+ " u = 0\n",
+ " v = 0\n",
+ " weight = 0\n",
+ " link = None\n",
+ "\n",
+ "front = None\n",
+ "\n",
+ "father = []\n",
+ "tree = []\n",
+ "n = 0\n",
+ "wt_tree = 0\n",
+ "count = 0\n",
+ "\n",
+ "def create_graph():\n",
+ " global n\n",
+ " print \"Enter number of nodes: \",\n",
+ " n = int(raw_input())\n",
+ " max_edges = n*(n-1)/2\n",
+ " for i in range(1, max_edges+1):\n",
+ " print \"Enter edge %d (0 0) to quit: \" %i\n",
+ " origin = int(raw_input())\n",
+ " destin = int(raw_input())\n",
+ " if (origin==0 and destin == 0):\n",
+ " break\n",
+ " print \"Enter weight for this edge: \",\n",
+ " wt = int(raw_input())\n",
+ " if(origin > n or destin> n or origin < 0 or destin < 0):\n",
+ " print \"Invalid edge...\"\n",
+ " i -= 1\n",
+ " else:\n",
+ " insert_pque(origin, destin, wt)\n",
+ " if(i<n-1):\n",
+ " print \"Spanning tree is not possible...\"\n",
+ " sys.exit()\n",
+ "\n",
+ "def insert_pque(i, j, wt):\n",
+ " global front\n",
+ " tmp = edge()\n",
+ " tmp.u = i\n",
+ " tmp.v = j\n",
+ " tmp.weight = wt\n",
+ " if(front == None or tmp.weight < front.weight):\n",
+ " tmp.link = front\n",
+ " front = tmp\n",
+ " else:\n",
+ " q = front\n",
+ " while(q.link != None and q.link.weight <= tmp.weight):\n",
+ " q = q.link\n",
+ " tmp.link = q.link\n",
+ " q.link = tmp\n",
+ " if(q.link == None):\n",
+ " tmp.link = None\n",
+ "\n",
+ "def make_tree():\n",
+ " global n\n",
+ " global wt_tree\n",
+ " global count\n",
+ " global father\n",
+ " for i in range(n):\n",
+ " father.append(0)\n",
+ " temp = edge()\n",
+ " root_n1 = 0\n",
+ " root_n2 = 0\n",
+ " while(count<n-1):\n",
+ " print count\n",
+ " temp = del_pque()\n",
+ " node1 = temp.u\n",
+ " node2 = temp.v\n",
+ " print \"n1 = %d\" %node1\n",
+ " print \"n2 = %d\" %node2\n",
+ " while(node1>0):\n",
+ " root_n1 = node1\n",
+ " node1 = father[node1]\n",
+ " while(node2>0):\n",
+ " root_n2 = node2\n",
+ " node2 = father[node2]\n",
+ " print \"root_n1=%d\" %root_n1\n",
+ " print \"root_n2=%d\" %root_n2\n",
+ " if(root_n1!=root_n2):\n",
+ " insert_tree(temp.u, temp.v, temp.weight)\n",
+ " wt_tree = wt_tree + temp.weight\n",
+ " father[root_n2] = root_n1\n",
+ "\n",
+ "def insert_tree(i, j, wt):\n",
+ " global count\n",
+ " global tree\n",
+ " print \"This edge inserted in the spanning tree: \",\n",
+ " print count\n",
+ " count += 1\n",
+ " ob = edge()\n",
+ " ob.u = i\n",
+ " ob.v = j\n",
+ " ob.weight = wt\n",
+ " tree.append(ob)\n",
+ "\n",
+ "def del_pque():\n",
+ " global front\n",
+ " tmp = edge()\n",
+ " tmp = front\n",
+ " print \"Edge processed is %d->%d %d\" %(tmp.u, tmp.v, tmp.weight)\n",
+ " front = front.link\n",
+ " return tmp\n",
+ " \n",
+ "\n",
+ "create_graph()\n",
+ "make_tree()\n",
+ "print \"Edges to be included in spanning tree are: \",\n",
+ "print count\n",
+ "for i in range(0, count):\n",
+ " print tree[i].u, tree[i].v\n",
+ "print \"Weight of the minimum spanning tree is: \", wt_tree"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5, page no. 341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter number of vertices: "
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "\n",
+ "class node:\n",
+ " predecessor = 0\n",
+ " dist = 0\n",
+ " status = 0\n",
+ "\n",
+ "class edge:\n",
+ " u = 0\n",
+ " v = 0\n",
+ "\n",
+ "adj = []\n",
+ "n = 0\n",
+ "TEMP = 0\n",
+ "PERM = 1\n",
+ "FALSE = 0\n",
+ "TRUE = 1\n",
+ "infinity = 9999\n",
+ "\n",
+ "for i in range(10):\n",
+ " a = []\n",
+ " for j in range(10):\n",
+ " a.append(-1)\n",
+ " adj.append(a)\n",
+ " \n",
+ "def create_graph():\n",
+ " global n\n",
+ " global TEMP\n",
+ " global PERM\n",
+ " global FALSE\n",
+ " global TRUE\n",
+ " global infinity\n",
+ " print \"Enter number of vertices: \",\n",
+ " n = int(raw_input())\n",
+ " max_edges=n*(n-1)/2\n",
+ " for i in range(1, max_edges+1):\n",
+ " print \"Enter edge %d(0 0 to quit): \" %i\n",
+ " origin = int(raw_input())\n",
+ " destin = int(raw_input())\n",
+ " if((origin==0) and (destin==0)):\n",
+ " break\n",
+ " print \"Enter weight for this edge: \",\n",
+ " wt = int(raw_input())\n",
+ " if( origin > n or destin > n or origin<=0 or destin<=0):\n",
+ " print \"Invalid edge! \"\n",
+ " i -= 1\n",
+ " else:\n",
+ " adj[origin][destin]=wt\n",
+ " adj[destin][origin]=wt\n",
+ " if(i<n-1):\n",
+ " print \"Spanning tree is not possible...\"\n",
+ " sys.exit()\n",
+ "\n",
+ "def display():\n",
+ " global n\n",
+ " for i in range(1, n+1):\n",
+ " for j in range(1, n+1):\n",
+ " print \"%3d\" %(adj[i][j]),\n",
+ " print \"\"\n",
+ "\n",
+ "def all_perm(state):\n",
+ " global n\n",
+ " global n\n",
+ " global TEMP\n",
+ " global PERM\n",
+ " global FALSE\n",
+ " global TRUE\n",
+ " global infinity\n",
+ " for i in range(1, n+1):\n",
+ " if( state[i].status == TEMP ):\n",
+ " return FALSE\n",
+ " return TRUE\n",
+ "\n",
+ "def maketree(tree):\n",
+ " global n\n",
+ " global TEMP\n",
+ " global PERM\n",
+ " global FALSE\n",
+ " global TRUE\n",
+ " global infinity\n",
+ " state = []\n",
+ " for i in range(n+1):\n",
+ " state.append(0)\n",
+ " weight=0\n",
+ " for i in range(1, n+1):\n",
+ " ob = node()\n",
+ " ob.predecessor=0\n",
+ " ob.dist = infinity\n",
+ " ob.status = TEMP\n",
+ " state[i] = ob\n",
+ " state[1].predecessor = 0\n",
+ " state[1].dist = 0\n",
+ " state[1].status = PERM\n",
+ " current = 1\n",
+ " count = 0\n",
+ " while( all_perm(state) != TRUE ):\n",
+ " for i in range(1, n+1):\n",
+ " if(adj[current][i] > 0 and state[i].status == TEMP):\n",
+ " if(adj[current][i] < state[i].dist):\n",
+ " state[i].predecessor = current\n",
+ " state[i].dist = adj[current][i]\n",
+ " min = infinity;\n",
+ " for i in range(1, n+1):\n",
+ " if (state[i].status == TEMP and state[i].dist < min):\n",
+ " min = state[i].dist\n",
+ " current = i\n",
+ " state[current].status = PERM\n",
+ " u1 = state[current].predecessor\n",
+ " v1 = current\n",
+ " count += 1\n",
+ " tree[count].u=u1\n",
+ " tree[count].v=v1\n",
+ " weight = weight+adj[u1][v1]\n",
+ " return count, weight\n",
+ "\n",
+ "path = []\n",
+ "\n",
+ "tree = []\n",
+ "for i in range(10):\n",
+ " ob = edge()\n",
+ " ob.u = 0\n",
+ " ob.v = 0\n",
+ " tree.append(ob)\n",
+ "create_graph()\n",
+ "print \"Adjacency matrix is: \"\n",
+ "display()\n",
+ "count, weight = maketree(tree)\n",
+ "print \"Weight of spanning tree is: %d\" %weight\n",
+ "print \"Edges to be included in spanning tree are: \"\n",
+ "for i in range(1, count+1):\n",
+ " print tree[i].u, tree[i].v"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6, page no. 351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter number of vertices: 3\n",
+ " Enter edge 1(0 0 to quit): \n",
+ "1\n",
+ "2\n",
+ "Enter weight for this edge: 8\n",
+ " Enter edge 2(0 0 to quit): \n",
+ "2\n",
+ "3\n",
+ "Enter weight for this edge: 7\n",
+ " Enter edge 3(0 0 to quit): \n",
+ "3\n",
+ "1\n",
+ "Enter weight for this edge: 5\n",
+ " Enter edge 4(0 0 to quit): \n",
+ "0\n",
+ "0\n",
+ "The adjacency matrix is: \n",
+ " 0 8 0 \n",
+ " 0 0 7 \n",
+ " 5 0 0 \n",
+ "\n",
+ "Enter source node(0 to quit): 2\n",
+ " \n",
+ "Enter destination node(0 to quit): 3\n",
+ " 2\n",
+ "There is no path from source to destination node\n",
+ "\n",
+ "Enter source node(0 to quit): 0\n",
+ " \n",
+ "Enter destination node(0 to quit): 0\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "\n",
+ "TEMP = 0\n",
+ "PERM = 1\n",
+ "infinity = 9999\n",
+ "adj = [[0 for i in range(100)] for j in range(100)]\n",
+ "n = 0 \n",
+ "\n",
+ "\n",
+ "class node:\n",
+ " predecessor = 0\n",
+ " dist = 0\n",
+ " status = 0\n",
+ " \n",
+ "for i in range(10):\n",
+ " ob = node()\n",
+ " adj.append(ob)\n",
+ "\n",
+ "def create_graph():\n",
+ " global TEMP\n",
+ " global PERM\n",
+ " global infinity\n",
+ " global n\n",
+ " print \"Enter number of vertices: \",\n",
+ " n = int(raw_input())\n",
+ " max_edges = n*(n-1)\n",
+ " for i in range (1, max_edges+1):\n",
+ " print \"Enter edge %d(0 0 to quit): \" %i\n",
+ " origin = int(raw_input())\n",
+ " destin = int(raw_input())\n",
+ " if((origin==0) and (destin==0)):\n",
+ " break\n",
+ " print \"Enter weight for this edge: \",\n",
+ " wt = int(raw_input())\n",
+ " if ( origin > n or destin > n or origin<=0 or destin<=0):\n",
+ " print \"Invalid edge! \"\n",
+ " i -= 1\n",
+ " else:\n",
+ " adj[origin][destin] = wt\n",
+ "\n",
+ "def display():\n",
+ " for i in range(1, n+1):\n",
+ " for j in range(1, n+1):\n",
+ " print \"%3d\" %(adj[i][j]),\n",
+ " print \"\"\n",
+ "def findpath(s, d, path, sdist):\n",
+ " global TEMP\n",
+ " global PERM\n",
+ " global infinity\n",
+ " global n\n",
+ " state = []\n",
+ " count = 0\n",
+ " sdist = 0\n",
+ " for i in range(1, n+1):\n",
+ " temp = node()\n",
+ " temp.predecessor = 0\n",
+ " temp.dist = infinity\n",
+ " temp.status = TEMP\n",
+ " state.append(temp)\n",
+ " state[s-1].predecessor = 0\n",
+ " state[s-1].dist = 0\n",
+ " state[s-1].status = PERM\n",
+ " current = s\n",
+ " while(current-1 != d):\n",
+ " for i in range(1, n+1):\n",
+ " if (adj[current-1][i-1] > 0 and state[i-1].status == TEMP):\n",
+ " newdist = state[current-1].dist + adj[current-1][i-1]\n",
+ " if ( newdist < state[i-1].dist ):\n",
+ " state[i-1].predecessor = current-1\n",
+ " state[i-1].dist = newdist\n",
+ " min = infinity\n",
+ " current = 0\n",
+ " for i in range(1, n+1):\n",
+ " if(state[i-1].status == TEMP and state[i-1].dist < min):\n",
+ " min = state[i-1].dist\n",
+ " current = i-1\n",
+ " if(current==0):\n",
+ " return 0\n",
+ " state[current].status=PERM\n",
+ " while( current!=0 ):\n",
+ " count += 1\n",
+ " path[count] = current\n",
+ " current=state[current-1].predecessor\n",
+ " for i in range(count, -1, -1):\n",
+ " u = path[i]\n",
+ " v = path[i-1]\n",
+ " sdist += adj[u][v]\n",
+ " return count\n",
+ "\n",
+ "path = []\n",
+ "create_graph()\n",
+ "print \"The adjacency matrix is: \"\n",
+ "display()\n",
+ "shortdist = 0\n",
+ "while(1):\n",
+ " print \"\\nEnter source node(0 to quit): \",\n",
+ " source = int(raw_input())\n",
+ " print \"\\nEnter destination node(0 to quit): \",\n",
+ " dest = int(raw_input())\n",
+ " if(source==0 or dest==0):\n",
+ " sys.exit()\n",
+ " count = findpath(source,dest,path,shortdist);\n",
+ " if(shortdist!=0):\n",
+ " print \"\\nShortest distance is: \", shortdist\n",
+ " print \"\\nShortest Path is: \"\n",
+ " for i in range(count, 1, -1):\n",
+ " print path[i]\n",
+ " print path[i]\n",
+ " print \"\"\n",
+ " else:\n",
+ " print \"There is no path from source to destination node\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/screenshots/1.png b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/screenshots/1.png
new file mode 100644
index 00000000..6ed21b4b
--- /dev/null
+++ b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/screenshots/1.png
Binary files differ
diff --git a/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/screenshots/2.png b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/screenshots/2.png
new file mode 100644
index 00000000..da7db60a
--- /dev/null
+++ b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/screenshots/2.png
Binary files differ
diff --git a/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/screenshots/3.png b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/screenshots/3.png
new file mode 100644
index 00000000..d9d8ce5b
--- /dev/null
+++ b/Principles_of_Data_structures_using_C_and_C++_by_Vinu_V_Das/screenshots/3.png
Binary files differ
diff --git a/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/README.txt b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/README.txt
new file mode 100644
index 00000000..443b7cdd
--- /dev/null
+++ b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/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: Stoichiometry
+Author: B. I. Bhatt And S. B. Thakore
+Publisher: McGraw-Hill Education - Europe
+Year of publication: 2010
+Isbn: 9780070681149
+Edition: 5 \ No newline at end of file
diff --git a/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch1.ipynb b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch1.ipynb
new file mode 100644
index 00000000..6fab7da5
--- /dev/null
+++ b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch1.ipynb
@@ -0,0 +1,198 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1 : Dimensions and Units"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 1.1 Page 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "mass flow rate = 4.54609513159 [kg/s] \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "# solution\n",
+ " \n",
+ "# Variables \n",
+ "# Using conversion factors from table 1.3 (Pg 9)\n",
+ "q1 = 75. # [gallon/min] (volumetric flow rate)\n",
+ "q2 = 75./(60*.219969) # [dm**3/s]\n",
+ "row = 0.8 # [kg/dm**3]\n",
+ "\n",
+ "# Calculation \n",
+ "q3 = q2*row # [kg/s] (mass flow rate)\n",
+ "\n",
+ "# Result\n",
+ "print \"mass flow rate = \",q3,\" [kg/s] \"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 1.2 Page 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "velocity of the steam in the pipeline is 53.7752187869 m/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "qm = 2000. # [kg/h] (mass flow rate)\n",
+ "d1 = 3.068 # [in] (internal dia of pipe)\n",
+ "\n",
+ "# Calculation \n",
+ "# Using conversion factors from table 1.3 (Pg 9)\n",
+ "d2 = 3.068/.0393701 # [mm]\n",
+ "A = ((math.pi/4)*d2**2)/10**6 # [m**2] (cross section area)\n",
+ "\n",
+ "# Using steam tables; Appendix IV.3\n",
+ "v = 0.46166 # [m**3/kg] (sp. vol. of steam at 440 kPa)\n",
+ "qv = (qm*v)/3600. # [m**3/s]\n",
+ "vs = qv/A # [m/s]\n",
+ "\n",
+ "# Result\n",
+ "print \"velocity of the steam in the pipeline is \",vs,\" m/s\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 1.3 Page 13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "1 TR = 3.51450421333 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "m = 2000. # [lb] (mass flow rate)\n",
+ "t = 24. #[hr]\n",
+ "lf = 144. # [Btu/lb] (latent heat of fusion)\n",
+ "\n",
+ "# Calculation \n",
+ "# Using conversion factors from table 1.3 (Pg 9)\n",
+ "TR = (m*lf*.251996*4.184)/(3600*24.)\n",
+ "\n",
+ "# Result\n",
+ "print \"1 TR = \",TR,\" kW\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 1.4 Page 13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "eq in SI becomes C = 36.4488724075 *T/M**.5 [m**3/s]\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# C = 89.2*A*(T/M**).5 [ft**3/s]\n",
+ "k = 89.2 \n",
+ "C1 = 1. # [ft**3/s]\n",
+ "\n",
+ "# Calculation \n",
+ "# Using conversion factors from table 1.3 (Pg 9)\n",
+ "C2 = 35.31467*C1\n",
+ "T1 = 1. #[dgree R]\n",
+ "T2 = 1.8*T1 # [K]\n",
+ "A1 = 1. # [ft**2]\n",
+ "A2 = 10.76391\n",
+ "k2 = (k*A2*(1.8)**.5)/35.34167\n",
+ "\n",
+ "# Result\n",
+ "print \"eq in SI becomes C = \",k2,\"*T/M**.5 [m**3/s]\"\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch2.ipynb b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch2.ipynb
new file mode 100644
index 00000000..ea1a9f8c
--- /dev/null
+++ b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch2.ipynb
@@ -0,0 +1,1335 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2 : Basic Chemical Calculations"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.1 Page 17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "5 mol of NH4Cl = 267.5 [g]\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# NH4Cl\n",
+ "M = 14+4+35.5 # [g] (molar mass of NH4Cl)\n",
+ "n=5 # [mol]\n",
+ "\n",
+ "# Calculation \n",
+ "m = M*n # [g]\n",
+ "\n",
+ "# Result\n",
+ "print \"5 mol of NH4Cl = \",m,\" [g]\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.2 Page 17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "In the formula CuSO4.5H2O, the moles of CuSO4 is one hence, the equivalent moles of CuSO4 in the crystal is 2.0 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "\n",
+ "# CuSO4.5H2O\n",
+ "M1 = 159.5 # [g] (molar mass of CuSO4)\n",
+ "M2 = 159.5+5.*(2.+16) # (molar mass of CuSO4.5H2O)\n",
+ "m = 499.\n",
+ "\n",
+ "# Calculation \n",
+ "n = m/M2 #[mol]\n",
+ "\n",
+ "# Result\n",
+ "print \"In the formula CuSO4.5H2O, the moles of CuSO4 is one hence,\\\n",
+ " the equivalent moles of CuSO4 in the crystal is \",n,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.3 Page 17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " 1.5 kmol of K2CO3 contains 117 kg of K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "\n",
+ "# K2CO3\n",
+ "m = 117. # [kg] (wt of K)\n",
+ "Mk = 39. # [g] (at wt of K)\n",
+ "\n",
+ "# Calculation \n",
+ "a = m/Mk # [kg atoms] \n",
+ "\n",
+ "# 1 mol of K2CO3 contains 2 atoms of K\n",
+ "n = a/2. # [kmol] (moles of K2CO3)\n",
+ "\n",
+ "# Result\n",
+ "print \" \",n,\" kmol of K2CO3 contains 117 kg of K.\" \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.4 Page 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Atoms present in 416.6 g BaCl2 = 1.2044e+24 \n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# BaCl2\n",
+ "M = 137.3+2*35.5 # [g] (molar mass of BaCl2)\n",
+ "m = 416.6 # [g]\n",
+ "\n",
+ "# Calculation \n",
+ "n = m/M # [mol]\n",
+ "N = n*6.022*10**23 # (no. of atoms)\n",
+ "\n",
+ "# Result\n",
+ "print \"Atoms present in 416.6 g BaCl2 = \",N,\"\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.5 Page 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a eq. mass of PO4 is 31.6666666667 [g] \n",
+ "b eq. mass of Na3PO4 is 54.6666666667 [g] \n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "print \"a \",\n",
+ "#PO4 radical\n",
+ "M = 31+4*16. #[g] \n",
+ "V = 3. # (valence of PO4)\n",
+ "\n",
+ "# Calculation and Result\n",
+ "eqm = M/V \n",
+ "print \"eq. mass of PO4 is \",eqm,\" [g] \"\n",
+ "print \"b \",\n",
+ "#Na3PO4\n",
+ "M = 3*23+95. #[g]\n",
+ "V = 3.\n",
+ "eqm = M/V\n",
+ "print \"eq. mass of Na3PO4 is \",eqm,\" [g] \"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.6 Page 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "no. of equivalents in 3 kmol of AlCl3 is 9.0 keq.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# AlCl3\n",
+ "v = 3. # valency of Al ion\n",
+ "\n",
+ "# Calculation \n",
+ "eq = 3.*3 # [mol]\n",
+ "\n",
+ "# Result\n",
+ "print \"no. of equivalents in 3 kmol of AlCl3 is \",eq,\" keq.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.7 Page 20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a mass percentage of NaCl is 75.0 mass percentage of KCl is 25.0 \n",
+ "b mol percentage of NaCl is 79.2553191489 mol percentage of KCl is 20.7446808511 \n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# (a)\n",
+ "print \"a \",\n",
+ "# mass %\n",
+ "m1 = 600. #[kg] (NaCl)\n",
+ "m2 = 200. #[kg] (KCl)\n",
+ "\n",
+ "# Calculation \n",
+ "m = m1+m2 # total mass\n",
+ "Wa = (m1/m)*100.\n",
+ "Wb = (m2/m)*100.\n",
+ "\n",
+ "# Result\n",
+ "print \"mass percentage of NaCl is \",Wa,\" mass percentage of KCl is \",Wb,\" \"\n",
+ "\n",
+ "# (b)\n",
+ "print \"b \",\n",
+ "#mol %\n",
+ "M1 = 23+35.5 # molar mass of NaCl\n",
+ "n1 = m1/M1 # no. of moles of NaCl\n",
+ "M2 = 39+35.5 # molar mass of KCl\n",
+ "n2 = m2/M2 # no. of moles of KCl\n",
+ "n = n1+n2\n",
+ "N1 = (n1/n)*100.\n",
+ "N2 = (n2/n)*100.\n",
+ "print \"mol percentage of NaCl is \",N1,\" mol percentage of KCl is \",N2,\" \"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.8 Page 21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "mass percentage of C is 53.4941324009\n",
+ " mass percentage of H is 1.57123286189\n",
+ " mass percentage of O is 24.9407534679\n",
+ " mass percentage of S is 19.9938812693\n",
+ "molar mass = 12.2023744565 kg/kmol.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# CH.35O.35S.14\n",
+ "# mass %\n",
+ "C = 12.0107 #[kg] \n",
+ "H = 1.00794*.35 # [kg]\n",
+ "O = 15.9994*.35 # [kg]\n",
+ "S = 32.065*.14 #[kg]\n",
+ "\n",
+ "# Calculation \n",
+ "m = C+H+O+S\n",
+ "m1 = (C/m)*100.\n",
+ "m2 = (H/m)*100.\n",
+ "m3 = (O/m)*100.\n",
+ "m4 = (S/m)*100.\n",
+ "\n",
+ "# Result\n",
+ "print \"mass percentage of C is \",m1\n",
+ "print \" mass percentage of H is \",m2\n",
+ "print \" mass percentage of O is \",m3\n",
+ "print \" mass percentage of S is \",m4\n",
+ "M = m/(1+.35+.35+.14)\n",
+ "print \"molar mass = \",M,\" kg/kmol.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.9 Page 22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The sample contains 96.4285714286 percent urea.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100kg urea\n",
+ "m1 = 45. #[kg] (mass of N present)\n",
+ "Mu = 60. # (molar mass of urea)\n",
+ "m2 = 14*2. #[kg] (mass of N in 1 kmol of urea)\n",
+ "\n",
+ "# Calculation \n",
+ "m = (Mu/m2)*m1\n",
+ "\n",
+ "# Result\n",
+ "print \"The sample contains \",m,\" percent urea.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.10 Page 22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Mass percent of SiO2 is 0.006 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# NaOH\n",
+ "Impurity = 60. # [ppm] SiO2\n",
+ "\n",
+ "# Calculation \n",
+ "m = (60/1000000.)*100.\n",
+ "\n",
+ "# Result\n",
+ "print \"Mass percent of SiO2 is \",m,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.11 Page 22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Total no. of Ca+ ions is 392.749838659 and total no. of F- ions is 2.43335898941 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "Ca = 40.078 # at. wt of Ca\n",
+ "F = 18.9984032 # at wt of F\n",
+ "\n",
+ "# Calculation \n",
+ "M1 = 3*Ca +2*(30.97762+(4*15.9994)) # molar mass of Ca3PO4\n",
+ "M2 = Ca +12.0107+3*15.9994 # molar mass of CaCO3\n",
+ "M3 = Ca+2*F # molar mass of CaF2\n",
+ "m1 = 800. #[mg] Ca3PO4\n",
+ "m2 = 200. #[mg] CaCO3\n",
+ "m3 = 5. #[mg] CaF2\n",
+ "n1 = ((3*Ca)/M1)*m1+(Ca/M2)*m2+(Ca/M3)*m3 # [mg] total Ca ions\n",
+ "n2 = (F/M3)*2*5 #[mg] total F ions\n",
+ "\n",
+ "# Result\n",
+ "print \"Total no. of Ca+ ions is \",n1,\" and total no. of F- ions is \",n2,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.12 Page 23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a mass percent of salicylic acid is 39.0243902439 and mass percent of methanol is 60.9756097561 . \n",
+ "b Mole percent of methanol is 87.0772337203 and Mole percent of salicylic acid is 12.9227662797 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# (a)\n",
+ "print \"a \",\n",
+ "# mass %\n",
+ "m1 = 100. #[kg] methanol (basis)\n",
+ "m2 = 64. #[kg] salicylic acid\n",
+ "\n",
+ "# Calculation \n",
+ "m = m1+m2 # [kg] mass of solution\n",
+ "w1 = m2/m*100\n",
+ "w2 = 100-w1\n",
+ "\n",
+ "# Result\n",
+ "print \"mass percent of salicylic acid is \",w1,\" and mass percent of methanol is \",w2,\". \"\n",
+ "\n",
+ "#(b)\n",
+ "print \"b \",\n",
+ "#mole %\n",
+ "M1 = 32. # molar mass of methanol\n",
+ "M2 = 138. #molar mass of salicylic acid\n",
+ "n1 = m1/M1 #[kmol] methanol\n",
+ "n2 = m2/M2 #[kmol] salicylic acid\n",
+ "n = n1+n2\n",
+ "N1 = n1/n*100.\n",
+ "N2 = n2/n*100.\n",
+ "print \"Mole percent of methanol is \",N1,\" and Mole percent of salicylic acid is \",N2,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.13 Page 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "mass percent of HCl is 11.195554466\n",
+ "mass percent of NaCl is 7.08506987007\n",
+ "and mass percent of H2O is 81.719375664 . \n",
+ "Mole percent of HCl is 6.1851712101\n",
+ "Mole percent of NaCl is 2.44200543258\n",
+ "and Mole percent of H2O is 91.3728233573\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "#mass %\n",
+ "m1 = 13.70 # HCl\n",
+ "m2 = 8.67 # NaCl\n",
+ "m3 = 100. # H2O\n",
+ "\n",
+ "# Calculation \n",
+ "m = m1+m2+m3 # mass of solution\n",
+ "w1 = m1/m*100.\n",
+ "w2 = m2/m*100.\n",
+ "w3 = m3/m*100.\n",
+ "\n",
+ "# Result\n",
+ "print \"mass percent of HCl is \",w1\n",
+ "print \"mass percent of NaCl is \",w2\n",
+ "print \"and mass percent of H2O is \",w3,\". \"\n",
+ "M1=36.4609 #HCl\n",
+ "M2=58.4428 #NaCl\n",
+ "M3=18.0153 #H2O\n",
+ "n1=m1/M1 #HCl\n",
+ "n2=m2/M2 #NaCl\n",
+ "n3=m3/M3 #H2O\n",
+ "n=n1+n2+n3\n",
+ "N1=n1/n*100.\n",
+ "N2=n2/n*100.\n",
+ "N3=n3/n*100.\n",
+ "print \"Mole percent of HCl is \",N1\n",
+ "print \"Mole percent of NaCl is \",N2\n",
+ "print \"and Mole percent of H2O is \",N3\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.14 Page 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage of Na2O in the solution is 56.575 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# solution \n",
+ "# Variables\n",
+ "\n",
+ "m = 100. #[kg] Lye (basis)\n",
+ "m1 = 73. #[kg] NaOH\n",
+ "M1 = 40. # NaOH\n",
+ "M2 = 62. # Na2O\n",
+ "\n",
+ "# Calculation\n",
+ "p = (M2*m1)/(2*M1)\n",
+ "\n",
+ "# Result\n",
+ "print \"percentage of Na2O in the solution is \",p,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.15 Page 25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "TOC = 234.782608696 mg/l\n",
+ "ThOD = 730.434782609 mg/l\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "#(CH2OH)3\n",
+ "M = 92. # molar mass of glycerin\n",
+ "C = 600. #[mg/l] glycerin conc.\n",
+ "\n",
+ "# Calculation \n",
+ "TOC = (3.*12./92.)*600. #[mg/l]\n",
+ "\n",
+ "# by combustion reaction we see 3.5 O2 is required for 1 mol of (CH2OH)3\n",
+ "ThOD = (3.5*32.*600)/92 #[mg/l]\n",
+ "\n",
+ "# Result\n",
+ "print \"TOC = \",TOC,\" mg/l\"\n",
+ "print \"ThOD = \",ThOD,\" mg/l\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.16 Page 25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Actual concentration of CaHCO32 in the sample water is 486.0 mg/l and of MgHCO32 is 292.6 mg/l.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "M1 = 100. # CaCO3\n",
+ "v1 = 2. # valence of CaCO3\n",
+ "\n",
+ "# Calculation \n",
+ "eqm1 = M1/v1 # equivalent mass of CaCO3\n",
+ "M2 = 162. # Ca(HCO3)2\n",
+ "v2 = 2.\n",
+ "eqm2 = M2/v2\n",
+ "m = 500. # [mg/l] CaCO3\n",
+ "C1 = (eqm2/eqm1)*m*.6 # [mg/l] conc. of Ca(HCO3)2\n",
+ "M3 = 146.3 # Mg(HCO3)2\n",
+ "v3 = 2.\n",
+ "eqm3 = M3/v3\n",
+ "C2 = (eqm3/eqm1)*m*.4 #[mg/l] conc. of Mg(HCO3)2\n",
+ "\n",
+ "# Result\n",
+ "print \"Actual concentration of CaHCO32 in the sample\\\n",
+ " water is \",C1,\" mg/l and of MgHCO32 is \",C2,\" mg/l.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.17 Page 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Sulphur content in LDO is 5780.0 ppm.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "S = .68 # sulphur content by mass\n",
+ "d = .85 # kg/l\n",
+ "\n",
+ "# Calculation \n",
+ "s = (S*d*10**6)/100. # [mg/l] or [ppm]\n",
+ "\n",
+ "# Result\n",
+ "print \"Sulphur content in LDO is \",s,\" ppm.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.18 Page 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Molarity = 0.385299145299 M\n",
+ "Normality = 0.385299145299 N\n",
+ "Molality = 0.42735042735 mol/kg.\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "m1 = 100. #[kg] solution (basis)\n",
+ "m2 = 20. #[kg] NaCl\n",
+ "d = 1.127 #[kg/l]\n",
+ "\n",
+ "# Calculation \n",
+ "V = m1/d # volume of 100 kg sol.\n",
+ "n = (m2/58.5)*100. # [mol] NaCl\n",
+ "M = n/V #[M]\n",
+ "v = 1. # valence of NaCl so,\n",
+ "N = M\n",
+ "m = n/(m1-m2) #[mol/kg]\n",
+ "\n",
+ "# Result\n",
+ "print \"Molarity = \",M,\"M\"\n",
+ "print \"Normality = \",N,\"N\"\n",
+ "print \"Molality = \",m,\" mol/kg.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.19 Page 27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Molarity of solution = 0.352348993289 M.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "m1 = 100. #[kg] TEA solution (basis)\n",
+ "m2 = 50. #[kg] TEA\n",
+ "M1 = 149. # molar mass of TEA\n",
+ "d = 1.05 #[kg/l]\n",
+ "\n",
+ "# Calculation \n",
+ "V = m1/d # volume of 100 kg sol.\n",
+ "n = (m2/M1)*100. # [mol] NaCl\n",
+ "M = n/V #[M]\n",
+ "\n",
+ "# Result\n",
+ "print \"Molarity of solution = \",M,\" M.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.20 Page 27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Mass percent of CO2 = 2.97180327869 and Mol percent = 1.44480291766 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "m1 = 100. #[kg] MEA solution (basis)\n",
+ "m2 = 20. #[kg] MEA\n",
+ "M1 = 61. # molar mass of MEA\n",
+ "n1 = m2/M1 # [kmol]\n",
+ "C = .206 \n",
+ "\n",
+ "# Calculation \n",
+ "n2 = C*n1 #[kmol] dissolved CO2\n",
+ "m3 = n2*44 # [kg] mass of CO2\n",
+ "n3 = (m1-m2-m3)/18 #[kmol] water\n",
+ "n = (n2/(n1+n2+n3))*100.\n",
+ "m = (m3/100)*100.\n",
+ "\n",
+ "# Result\n",
+ "print \"Mass percent of CO2 = \",m,\" and Mol percent = \",n,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.21 Page 27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "pH of the sol is 3.50886438348 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# solution \n",
+ "# Variables \n",
+ "#HOCl\n",
+ "Ma = .1 #molarity\n",
+ "\n",
+ "# Calculation \n",
+ "Ka = 9.6*10**-7\n",
+ "C = (Ma*Ka)**.5 # conc. of H+ ions\n",
+ "pH = -math.log10(C)\n",
+ "\n",
+ "# Result\n",
+ "print \"pH of the sol is \",pH,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.22 Page 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "average molar mass of air is 28.96968 g.\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "# solution \n",
+ "# Variables \n",
+ "n = 100. # [mol] air (basis)\n",
+ "n1 = 21. #[mol] O2\n",
+ "n2 = 78. #[mol] N2\n",
+ "n3 = 1. #[mol] Ar\n",
+ "M1 = 31.9988 # O2\n",
+ "M2 = 28.0134 # N2\n",
+ "M3 = 39.948 # Ar\n",
+ "\n",
+ "# Calculation \n",
+ "m1 = n1*M1\n",
+ "m2 = n2*M2\n",
+ "m3 = n3*M3\n",
+ "Ma = (m1+m2+m3)/n\n",
+ "\n",
+ "# Result\n",
+ "print \"average molar mass of air is \",Ma,\" g.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.23 Page 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Average molar mass of gas is 26.54 g.\n",
+ "b GAS Mass Percent \n",
+ " Methane 27.128862095\n",
+ " Ethane 11.3036925396\n",
+ " Ethylene 26.3752825923\n",
+ " Propane 11.6051243406\n",
+ " Propylene 12.6601356443\n",
+ " n-Butane 10.9269027882\n",
+ "c Specific gravity is 0.916120124266 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "# (a)\n",
+ "print \"a \",\n",
+ "n = 100. # [kmol] cracked gas (basis)\n",
+ "n1 = 45. # methane\n",
+ "n2 = 10. # ethane\n",
+ "n3 = 25. # ethylene\n",
+ "n4 = 7. # propane\n",
+ "n5 = 8. # propylene\n",
+ "n6 = 5. # n-butane\n",
+ "M1 = 16. \n",
+ "M2 = 30.\n",
+ "M3 = 28.\n",
+ "M4 = 44.\n",
+ "M5 = 42.\n",
+ "M6 = 58.\n",
+ "\n",
+ "# Calculation \n",
+ "m1 = n1*M1\n",
+ "m2 = n2*M2\n",
+ "m3 = n3*M3\n",
+ "m4 = n4*M4\n",
+ "m5 = n5*M5\n",
+ "m6 = n6*M6\n",
+ "m = m1+m2+m3+m4+m5+m6\n",
+ "M = m/n\n",
+ "\n",
+ "# Result\n",
+ "print \"Average molar mass of gas is \",M,\" g.\"\n",
+ "#(b)\n",
+ "print \"b \",\n",
+ "\n",
+ "# composition\n",
+ "p1 = (m1/m)*100.\n",
+ "p2 = m2*100./m\n",
+ "p3 = m3*100./m\n",
+ "p4 = m4*100./m\n",
+ "p5 = m5*100./m\n",
+ "p6 = m6*100./m\n",
+ "print \" GAS Mass Percent \"\n",
+ "print \" Methane \",p1\n",
+ "print \" Ethane \",p2\n",
+ "print \" Ethylene \",p3\n",
+ "print \" Propane \",p4\n",
+ "print \" Propylene \",p5\n",
+ "print \" n-Butane \",p6\n",
+ "# (c)\n",
+ "print \"c \",\n",
+ "# specific gravity\n",
+ "g = M/28.97\n",
+ "print \"Specific gravity is \",g,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.24 Page 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Specific volume = 0.0287598911758 m**3/kg.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "p = 100. #[bar]\n",
+ "T = 623.15 #[K]\n",
+ "R = .083145\n",
+ "\n",
+ "# Calculation \n",
+ "V = R*T/p # [l/mol] molar volume\n",
+ "v = V/18.0153 \n",
+ "\n",
+ "# Result \n",
+ "print \"Specific volume = \",v,\" m**3/kg.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.25 Page 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Molar volume = 16.0708891875 l/mol. \n",
+ "by Vanderwall eq molar volume = 15.74 l/mol\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# solution \n",
+ "# Variables \n",
+ "p = 4. #[bar]\n",
+ "T = 773.15 #[K]\n",
+ "R = .083145\n",
+ "V = R*T/p # [l/mol] molar volume\n",
+ "print \"Molar volume = \",V,\" l/mol. \"\n",
+ "\n",
+ "# Calculation \n",
+ " # using appendix III\n",
+ " # calculating Tc and Pc of different gases according to their mass fractions\n",
+ "Tc1 = .352*32.20 # H2\n",
+ "Tc2 = .148*190.56 # methane\n",
+ "Tc3 = .128*282.34 #ethylene\n",
+ "Tc4 = .339*132.91 # CO\n",
+ "Tc5 = .015*304.10 # CO2\n",
+ "Tc6 = .018*126.09 # N2\n",
+ "Tc = Tc1+Tc2+Tc3+Tc4+Tc5+Tc6 # Tc of gas\n",
+ "\n",
+ " # similarly finding Pc\n",
+ "Pc1=.352*12.97 \n",
+ "Pc2=.148*45.99\n",
+ "Pc3=.128*50.41\n",
+ "Pc4=.339*34.99\n",
+ "Pc5=.015*73.75\n",
+ "Pc6=.018*33.94\n",
+ "Pc=Pc1+Pc2+Pc3+Pc4+Pc5+Pc6 # Pc of gas\n",
+ "a = (27*R**2*Tc**2)/(64*Pc) # [bar/mol**2]\n",
+ "b = (R*Tc)/(8*Pc) # l/mol\n",
+ "\n",
+ "# substituting these values in vanderwall eq and solving by Newton Rhapson method we get\n",
+ "V = 15.74 # [l/mol]\n",
+ "\n",
+ "# Result\n",
+ "print \"by Vanderwall eq molar volume = \",V,\" l/mol\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.26 Page 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "component mol percent mass percent\n",
+ " n-Butane 43.1 570378.642948\n",
+ " 1-Butene 56.9 727039.966353\n",
+ " Furfural -26.0350 570378.642948\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# solution \n",
+ "# Variables \n",
+ "m = 6.5065 #[g] mixture (basis)\n",
+ "Pv = 2.175 #[kPa] V.P. of water over KOH\n",
+ "Pa = 102.5-2.175 #[kPa] Partial P of n-butane and 1butene\n",
+ "V = 415.1*10**-3 #[l]\n",
+ "R = 8.314472\n",
+ "T = 296.4 #[K]\n",
+ "\n",
+ "# Calculation \n",
+ "n = (Pa*V)/R*T # moles of butene and butane\n",
+ "n1 = n*.431 # n-butane\n",
+ "m1 = n1*58 # [g]\n",
+ "n2 = n-n1 # 1 butene\n",
+ "m2 = n2*56 #[g]\n",
+ "m3 = m-m1 # [g] furfural\n",
+ "n3 = m3/96.\n",
+ "\n",
+ "# Result\n",
+ "print \"component mol percent mass percent\"\n",
+ "print \" n-Butane \",n1/n*100,\" \",m1/m*100\n",
+ "print \" 1-Butene \",n2/n*100,\" \",m2/m*100\n",
+ "print \" Furfural %.4f\"%(n3/n*100),\" \",m1/m*100\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.27 Page 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "mol fraction of Furfural is 0.00379701058122 mol fraction of 1-Butene is 0.996202989419 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "P = 5.7+1.01 #[bar] absolute total P\n",
+ "\n",
+ "# Calculation \n",
+ "# using Roult's law\n",
+ "vp = 3.293*.7737 #[kPa] vap P of furfural\n",
+ "# using Dalton's law of partial P\n",
+ "n1 = vp/(P*100) # mol fraction of furfural\n",
+ "n2 = 1-n1 # mol fraction of 1 -butene\n",
+ "\n",
+ "# Result\n",
+ "print \"mol fraction of Furfural is \",n1,\"mol fraction of 1-Butene is \",n2,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.28 Page 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "absolute humidity = 0.0161586369044 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "P = 100. #[kPa] total P\n",
+ "Pw = 2.5326 #[kPa] V.P> of water at dew point\n",
+ "\n",
+ "# Calculation \n",
+ "#absolute humity = mass of water vapour/ mass of dry air\n",
+ "H = (Pw/(P-Pw))*(18.0153/28.9697) # absolute humidity\n",
+ "\n",
+ "# Result\n",
+ "print \"absolute humidity = \",H,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.29 Page 45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Outlet temperature is 335.758 K\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "#Ti-Tf = mu*(Pi-Pf)\n",
+ "Pi = 20.7 #[bar]\n",
+ "Pf = 8.7 # [bar]\n",
+ "mu = 1.616 #[K/bar]\n",
+ "Ti = 355.15 #[K]\n",
+ "\n",
+ "# Calculation \n",
+ "Tf = Ti-mu*(Pi-Pf)\n",
+ "\n",
+ "# Result\n",
+ "print \"Outlet temperature is \",Tf,\" K\"\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch3.ipynb b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch3.ipynb
new file mode 100644
index 00000000..72b3ec71
--- /dev/null
+++ b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch3.ipynb
@@ -0,0 +1,826 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 3 : Material Balances without Chemical Reaction"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.1 Page 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Percentage of feed water to be blown down is 0.342857142857 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "m = 1. #[kg] feed water\n",
+ "m1 = 1200. #[mg] dissolved solids in 1 kg feed water\n",
+ "m2 = 3500. #[mg] max dissolved solid content \n",
+ "\n",
+ "# Calculation \n",
+ "x = (m*m1)/m2 # [kg] blown down water\n",
+ "\n",
+ "# Result\n",
+ "print \"Percentage of feed water to be blown down is \",x,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.2 Page 61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Amount of water that evaporated is 84 kg.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "m = 100. #[kg] weak liquor (feed)\n",
+ "m1 = 4. #[kg] NaOH\n",
+ "p = .25\n",
+ "\n",
+ "# Calculation \n",
+ "x = 4./p # water left\n",
+ "y = 100-16 # [kg] evaporated water\n",
+ "\n",
+ "# Result\n",
+ "print \"Amount of water that evaporated is \",y,\" kg.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.3 Page 61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Percentage of Tannin recovered during leaching is 94.5625688387 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "m = 100. #[kg] babul bark (basis)\n",
+ "m1 = 5.8 #[kg] moisture\n",
+ "m2 = 12.6 #[kg] Tannin\n",
+ "m3 = 8.3 #[kg] soluble non tannin organic material\n",
+ "m4 = m-m1-m2-m3 # [kg] Lignin\n",
+ "\n",
+ "# Calculation \n",
+ "# lignin content remains unaffected during leaching\n",
+ "m5 = 100-.92-.65 # [kg lignin/kg dry residue]\n",
+ "x = (m4*100)/m5 # [kg]\n",
+ "T1 = x*.0092 #[kg] Tannin present in residue\n",
+ "T2 = m2 - T1 # [kg] Tannin recovered\n",
+ "T = (T2/m2)*100\n",
+ "\n",
+ "# Result \n",
+ "print \"Percentage of Tannin recovered during leaching is \",T,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.4 Page 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a mass of extract phase per kg of dry leaves is 0.0243902439024 kg \n",
+ "b percent recovery of Alpha Tocopherol is 82.1845174973 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "m = 1. #[kg] dry neem leaves (basis)\n",
+ "m1 = .01/100 #[kg] beta cartene content of leaves\n",
+ "\n",
+ "# Calculation\n",
+ "Ex = (m1*100)/.41 #[kg] extract quantity\n",
+ "Tc1 = Ex*.155 #[kg] Alpha Tocopherol in the extract\n",
+ "Tc2 = .46/100 #[kg] Alpha Tocopherol in the neem leaves\n",
+ "R = (Tc1*100)/Tc2 # recovery of Alpha Tocopherol \n",
+ "\n",
+ "# Result\n",
+ "print \"a mass of extract phase per kg of dry leaves is \"\\\n",
+ ",Ex,\" kg \\nb percent recovery of Alpha Tocopherol is \",R,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.5 Page 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a) Upper layer = 93.4470832373 kg \n",
+ "and Lower layer = 102.421028361 \n",
+ "b) mass ratio of the mixed solvent to the original mixture is -0.9989 \n",
+ "c) water mass percent = 58.9418250036 \n",
+ "and acetic acid mass percent = 41.0581749964 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "from numpy import array, linalg\n",
+ "\n",
+ "# Variables \n",
+ "m= 100. #[kg] original mixture (basis)\n",
+ "A = 27.8 #[kg]\n",
+ "B = 72.2 #[kg]\n",
+ "\n",
+ "# let x and y be uper and lower layer amounts\n",
+ "# total mixture = (x+y) kg\n",
+ "# balancing A and B\n",
+ "X = array([[.075 ,.203],[.035, .673]])\n",
+ "d = array([27.8,72.2])\n",
+ "\n",
+ "# Calculation \n",
+ "x = linalg.solve(X,d)\n",
+ "M = X[0][0]+X[1,0] # [kg] total mixture\n",
+ "Ms = M - m #[kg] mixed solvent\n",
+ "Mr = Ms/m\n",
+ "S1 = x[0]*.574+x[1]*.028 #[kg] water balance\n",
+ "S2 = x[0]*.316+x[1]*.096 #[kg] acetic acid balance\n",
+ "Qs = S1+S2\n",
+ "pS1 = (S1*100)/Qs\n",
+ "pS2 = 100-pS1\n",
+ "\n",
+ "# Result\n",
+ "print \"a) Upper layer = \",x[0],\" kg \\nand Lower layer = \",x[1],\\\n",
+ "\" \\nb) mass ratio of the mixed solvent to the original mixture is \",Mr,\\\n",
+ "\" \\nc) water mass percent = \",pS1,\"\\nand acetic acid mass percent = \",pS2,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.6 Page 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Vol percent of N2 is 70.6666666667 and Vol percent of O2 is 29.3333333333 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "m = 170. #[Nm**3/h] air (basis)\n",
+ "m1 = 50*.99 #[Nm**3/h] N2 content of the stream\n",
+ "m2 = 50*.01 #[Nm**3/h]\n",
+ "\n",
+ "# Calculation \n",
+ "N = m*.79-m1 # [Nm**3/h] N2\n",
+ "O = m*.21-m2 # [Nm**3/h] O2\n",
+ "V1 = N*100/(N+O)\n",
+ "V2 = O*100/(N+O)\n",
+ "\n",
+ "# Result\n",
+ "print \"Vol percent of N2 is \",V1,\" and Vol percent of O2 is \",V2,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.7 Page 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Strength of Oleum required is 22.8571428571 HNO3 and Oleum are required to be mixed in the proportion of 0.942857142857 :1.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "m = 100. #[kg] SO3 free mixed acid (basis)\n",
+ "m1 = 55. #[kg] HNO3\n",
+ "m2 = 45. #[kg] H2SO4\n",
+ "\n",
+ "# Calculation \n",
+ "# SO3 + H2O --> H2SO4\n",
+ "m3 = (80./18)*3 #[kg] SO3 equivalent to 3 kg of water\n",
+ "Q = m2+m3 #[kg] oleum to be mixed\n",
+ "S = (m3/Q)*100 # strength of oleum\n",
+ "R = m1/Q \n",
+ "\n",
+ "# Result\n",
+ "print \"Strength of Oleum required is \",S,\" HNO3 and Oleum are required\\\n",
+ " to be mixed in the proportion of \",R,\":1.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.8 Page 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "quantities of acids required are :\n",
+ " Spent = 76.4139267072 kg\n",
+ " HNO3 = 345.961362536 kg\n",
+ " H2SO4 = 577.624710757 kg.\n"
+ ]
+ }
+ ],
+ "source": [
+ "from numpy import array, linalg\n",
+ "\n",
+ "# solution \n",
+ "# Variables \n",
+ "m = 1000. #[kg] mixed acid (basis)\n",
+ "# doing overall mass balance, H2SO4 balance and HNO3 balance\n",
+ "A = array([[1, 1, 1],[.444, 0, .98],[.113, .9, 0]])\n",
+ "d = array([1000,600,320])\n",
+ "\n",
+ "# Calculation \n",
+ "x = linalg.solve(A,d)\n",
+ "\n",
+ "# Result\n",
+ "print \"quantities of acids required are :\"\n",
+ "print \" Spent = \",x[0],\"kg\"\n",
+ "print \" HNO3 = \",x[1],\" kg\"\n",
+ "print \" H2SO4 = \",x[2],\" kg.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.9 Page 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Component analysis of raw water:\n",
+ " Compound mg/l \n",
+ " Ca(HCO3)2 505.62\n",
+ " Mg(HCO3)2 49.896\n",
+ " NaHCO3 11.088\n",
+ " Na2CO3 69.854\n",
+ " NaCl 783.735211268\n",
+ " Na2SO4 152.20625\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "l = 1. #[litre] water (basis)\n",
+ "Cl = 475.6 #[mg]\n",
+ "m1 = (58.5/35.5)*Cl #[mg] NaCl present in water\n",
+ "SO4 = 102.9 #[mg] # SO4\n",
+ "m3 = (142./96)*SO4 #[mg] Na2SO4 present in water\n",
+ "\n",
+ "# Calculation \n",
+ "# carbonates are present due to Na2CO3\n",
+ "# eq mass of CaCO3 = 50\n",
+ "# eq mass of Na2CO3 = 53\n",
+ "m4 = (53./50)*65.9 # [mg] Na2CO3 present in water\n",
+ "\n",
+ "# NaHCO3 in water = bicarbonates - temporary hardness\n",
+ "m5 = 390.6-384 # [mg] NaHCO3 present as CaCO3\n",
+ "m6 = (84./50)*m5 # [mg] NaHCO3 present in water\n",
+ "\n",
+ "# equivalent mass of Mg(HCO3)2 = 73.15\n",
+ "m7 = (m6/50.)*225\n",
+ "m8 = 384-225 #[mg] CaCO3 from Ca(HCO3)2\n",
+ "# equivalent mass of Ca(HCO3)2 is 81\n",
+ "m9 = (m8/50.)*159 #[mg] Ca(HCO3)2 present in water\n",
+ "\n",
+ "# Result\n",
+ "print \"Component analysis of raw water:\"\n",
+ "print \" Compound mg/l \"\n",
+ "print \" Ca(HCO3)2 \",m9\n",
+ "print \" Mg(HCO3)2 \",m7\n",
+ "print \" NaHCO3 \",m6\n",
+ "print \" Na2CO3 \",m4\n",
+ "print \" NaCl \",m1\n",
+ "print \" Na2SO4 \",m3\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.11 Page 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Flowrates are : \n",
+ " A = 158.0 kg/h\n",
+ " B = 422.0 kg/h\n",
+ " C = 420.0 kg/h\n"
+ ]
+ }
+ ],
+ "source": [
+ "from numpy import array, linalg\n",
+ "# solution \n",
+ "# Variables \n",
+ "# basis : 1000 kg/h of feed\n",
+ "# balancing H2SO4, HNO3 and H2O in all the three product streams\n",
+ "M = array([[1, 0, 0, 1, 0, 0, 1, 0, 0],[0, 1, 0 ,0, 1, 0, 0, 1, 0],\\\n",
+ "[0, 0, 1, 0, 0, 1, 0, 0, 1],[1, 0, 0, 0, 0, 0, 0, 0, 0],[0, 1, 0, 0, 0, 0, 0, 0, 0]\\\n",
+ ",[0, 0, 1, 0, 0, 0, 0, 0, 0],[0 ,0, 0, 1, 0, 0, 0, 0, 0],[0, 0, 0, 0, 1, 0, 0, 0, 0],\\\n",
+ "[0, 0, 0, 0, 0, 1, 0, 0, 0]])\n",
+ "v = array([400,100,500,4,94,60,16,6,400])\n",
+ "\n",
+ "# Calculation \n",
+ "s = linalg.solve(M,v)\n",
+ "A = s[0]+s[1]+s[2]\n",
+ "B = s[3]+s[4]+s[5]\n",
+ "C = s[6]+s[7]+s[8]\n",
+ "\n",
+ "# Result\n",
+ "print \"Flowrates are : \"\n",
+ "print \" A = \",A,\" kg/h\"\n",
+ "print \" B = \",B,\" kg/h\"\n",
+ "print \" C = \",C,\" kg/h\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.12 Page 70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEACAYAAABS29YJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8VHW6x/HPJNSEGiDBjqL0Jk1EkUEBsayLuIpruVz7\nWhAbgm0Ju+ulKOqqy7q+BC5elaurd0GsWBhFUVlcFAQRpayiEoqAElqAuX88E5iECZlkyu/MzPf9\nes1rZk4mZx4O8Jzfec5zfgdERERERERERERERERERERERERERCSOpgJFwJKwZRcCS4G9QLew5QOA\nhcDi0HO/JMUoIiIx6gOcSNlk3wZoBcwFuoYt7wI0D71uD6xNRoAiIhIfLSib7EuVT/bhfMAmoGaC\nYhIRkShlJXDdFwCfAiUJ/A4REYlCjQSttz0wHqvhi4iIY4lI9kcC/wdcDqyO9IGWLVsGV65cmYCv\nFhFJWyuB46v7y/Eo4/jCXjcCXgVGAR9V9AsrV64kGAx6+jFmzBjnMShOxak4FWfpA2gZS6KOJtnP\nAOYDrYHvgCuBwaHXvULJ/fXQZ28KBTQGWBR6NI0lQBERiV00ZZzfVrB8ZoRlfwo9RETEQxLZjZPS\n/H6/6xCiojjjS3HGl+L0Dl/lH0mIYKgGJSIiUfD5fBBDztbIXkQkAyjZi4hkACV7EZEMoGQvIpIB\nlOxFRDKAkr2ISAZwluyLilx9s4hI5nGW7Dt0gCeegH37XEUgIpI5nCX7d9+FZ56Bk0+GRYtcRSEi\nkhmcJfuOHeH99+Haa2HQILj1VvjlF1fRiIikN6cnaLOy4KqrYOlS2LoV2raFF18EzaQgIhJfnpob\nZ948+N3v4Jhj4PHH4bjjHEQmIuJBaTU3Tp8+Vr/v2xd69oT774ddu1xHJSKS+jyV7AFq1YJRo2Dh\nQvj4Y+jcGebOdR2ViEhq81QZ5+APwaxZcPPN4PfDgw9Cfn7igxMR8Zq0KuOU5/PB4MGwbBkUFFhv\n/t/+pt58EZGq8vTIvrzFi+0EbjAIf/0rdOmSgMhERDwo0SP7qUARsCRs2YXAUmAv0LXc5+8CvgaW\nAwOrG1RFOnWCDz6wds2BA+G229SbLyISjcqS/TRgULllS4DzgffLLW8HDA09DwImR7H+KsvKgquv\ntt78zZuhXTt46SX15ouIHEplyXgesLncsuXAigif/TUwAygB1gDfAD1jjK9CzZrBtGk25cJ998G5\n58Lq1Yn6NhGR1BbPkffhwNqw92uBI+K4/oj69oXPPrMe/R494L/+C3bvTvS3ioiklhoJXn+FxZXC\nwsL9r/1+P36/v9pfUqsWjB4NQ4fC8OF24nbyZGvXFBFJRYFAgEAgELf1RXNmtwUwG+hYbvlc4Hbg\nX6H3o0PP40PPbwBjgE8irLNa3TjRCAZh5kzrzT/9dHjgAfXmi0jqc91nH/7FLwMXA7WAY4ETgAUx\nrr/qAfng/POtN79pU+vNf/JJ9eaLSGarbC8xA+gLNMVaMMcAPwGPhZZtBRYBZ4U+fzdwJbAHGAG8\nWcF6EzayL+/zz6033+ez3vzOnZPytSIicRXryD6lLqqqrn37YMoUuOceuPxyGDsW6tVL2teLiMTM\ndRknJWRlwTXXwBdfwMaN1pv/j3+oN19EMkdGjOzLCwTg+uuhZUt47DE49lhnoYiIREUj+2rw+62W\n37u39eaPG6fefBFJbxk5sg+3apX15q9eDU88Aaed5joiEZGD6QRtHASDVsMfMQL694eJE206BhER\nr1AZJw58PhgyxHrzGzeG9u3hqafUmy8i6UMj+wg++8x687OyrLTTqZPriEQk02lknwBdusD8+TBs\nmJV1Ro6EbdtcRyUiUn1K9hXIyoLrroMlS6CoyHrzZ85Ub76IpCaVcaI0d6715p9wgvXmt2jhOiIR\nySQq4yRJv37Wm9+rF3TvDhMmqDdfRFKHRvbVsGoV3HgjfPutncDt08d1RCKS7tRn70gwaPe+veUW\nu/n5xIk2pbKISCKojOOIzwe/+Y315jdsaL35U6aoN19EvEkj+zhZtMh682vWtHnzO5a/r5eISAw0\nsveIE0+03vzLLrPbId55JxQXu45KRMQo2cdRdraN7r/4An780XrzZ81yHZWIiMo4CfXuu9ab36YN\nPPooHHOM64hEJFWpjONhp58OixfbnPldu1rHTkmJ66hEJBNVluynYjcaXxK2LA94C1gBzAEahZbX\nwW5QvhhYBoyOa6QpqnZtuPde+OQTG+l37QoffOA6KhHJNJUl+2nAoHLLRmPJvhXwDgeS+sWh505A\nN+A64Oj4hJn6jj8eXn8dfv97uPhiuOoqux+uiEgyVJbs5wGbyy07D5geej0dGBx6/SOQC2SHnncD\nP8cnzPTg88GFF1pvfv361ps/dap680Uk8apTsy/ASjuEngtCr9/EkvuPwBrgAWBLjPGlpQYN4JFH\nbKT/xBPQt6918IiIJEqNGH8/GHoAXAbUBQ7D6vrzsDLP6ki/WFhYuP+13+/H7/fHGErq6doVPvoI\n/vY3m2jtyiutzJOb6zoyEXEtEAgQCATitr5o2nhaALOB0mtClwN+YB2W2OcCbYDJwHzgmdDnpgBv\nAH+PsM6MaL2sinXr4Pbb4cMPrU3zvPNcRyQiXuKi9fJlYFjo9TBgZuj1cuD00OtcoBfwZXUDyzTN\nm8Ozz9r8OiNHwuDBNqumiEg8VJbsZ2Cj9dbAd8AVwHhgANZ6eXroPcDfgFpYm+YCrG1TlegqOuMM\n683v1s3KPA88oN58EYmdrqD1sG++sXnzf/jBTuSecorriETEFc1nn+aCQXjhBbjtNjjrLLtDVpMm\nrqMSkWTTdAlpzueDoUOtNz8nx3rzp03Tjc9FpGo0sk8xn35qM2vWrWvz5rdv7zoiEUkGjewzTLdu\n8PHHNtr3+2H0aM2bLyKVU7JPQdnZduJ28WJrz2zfHl55xXVUIuJlKuOkgbffhhtugA4d4M9/hqOO\nch2RiMSbyjhC//42yu/c2W6POGmSevNFpCyN7NPM119biWfdOuvN793bdUQiEg/qs5eDBIPw/PM2\n187ZZ8P48erNF0l1KuPIQXw+u0HKsmVQp46dwJ0+Xb35IplMI/sMsHCh9ebXqweTJ0O7dq4jEpGq\n0sheKtW9u90D9ze/sRul3H03bN/uOioRSSYl+wyRnQ033WRdO6tXW2nn1VddRyUiyaIyToaaM8d6\n8zt3tt78I490HZGIHIrKOFItAwfafW87doQuXeChh2DPHtdRiUiiaGQvrFhhvfkbNtjkaief7Doi\nESlPffYSF8Eg/O//Wm/+r34F48ZBXp7rqESklMo4Ehc+H/z2t9abX7OmtWc+/bR680XShUb2EtE/\n/2m9+Q0aWG9+27auIxLJbIke2U8FirCbiJfKA97Cbjg+B2gU9rNOwEfYjcYXA7WrG5i41aMHLFgA\nQ4ZAnz5wzz3qzRdJZZUl+2nAoHLLRmPJvhXwTug9QA3gf4BrgQ5AX0BzL6aw7GwYPtx681eutCmU\nX3vNdVQiUh3RHBK0AGYDHUPvl2OJvAhoDgSANsDZwG+By6NYp8o4KejNN61rp0sXeOQR9eaLJJOL\nE7QFWKIn9FwQet0KCAJvAJ8CI6sblHjTmWfCkiV28rZLF3j4YfXmi6SKGjH+fjD0KF3XqUB3YAdW\n4vkUeDfSLxYWFu5/7ff78fv9MYYiyVC3LvzhD3DppXYF7vTpNm9+r16uIxNJL4FAgEAgELf1VbeM\n4wfWAYcBc7EyzlDgLOA/Q5+7F9gJPBhhnSrjpIFgEGbMgDvugPPOs978xo1dRyWSnlyUcV4GhoVe\nDwNmhl7PwXYIdbFRfl9gaXUDE+/z+eCSS6w3PzvbyjvPPKPefBEvqmwvMQNL2k2x+vzvgVnAC8DR\nwBrgImBL6POXAndhpZ1XOdCpU55G9mlowQLrzW/UyHrz27RxHZFI+tB0CeIpe/bAX/4Cf/yjJf57\n7rE6v4jERtMliKfUqAEjRsDnn9sEax06wOuvu45KRDSyl4R64w3rze/a1XrzjzjCdUQiqUkje/G0\nQYNs3vw2bQ7cKEW9+SLJp5G9JM3y5dabv3mz9eafdJLriERSh0b2kjLatIF33rG+/MGD4frrLfGL\nSOIp2UtS+Xx29e2yZfa+XTt49ln15oskmso44tQnn1iLZl6e9ea3bu06IhFvUhlHUtpJJ9mNUn71\nKzjlFLjvPtixw3VUIulHyV6cq1EDbrnFevOXL7fe/DfecB2VSHpRGUc857XX4KaboHt3680//HDX\nEYm4pzKOpJ2zz7be/FatoFMnePRR9eaLxEoje/G0L7+03vytW603v2dP1xGJuKGRvaS1tm3h3Xfh\n1lttzvwbb4QtWyr/PREpS8lePM/ng8svt978vXutN/+559SbL1IVKuNIyvn4Y+vNb9rUevNbtXId\nkUjiqYwjGadXL1i4EM45B3r3hjFjYOdO11GJeJuSvaSkGjWsjv/ZZ7B0qfXmz5njOioR71IZR9LC\nq69ab/5JJ8FDD6k3X9KPyjgiWEln6VJo2dJ68x97zE7mioipLNlPxW40viRsWR7wFrACmAM0Kvc7\nRwPbgNvjFKNIVHJy4P77Yd48eOklG+UvXOg6KhFvqCzZTwMGlVs2Gkv2rYB3Qu/DPQS8GpfoRKqh\nbVuYOxduvhnOPdfKO1u3uo5KxK3Kkv08oPztJc4DpodeTwcGh/1sMLAKWBaX6ESqyeeD//gP683f\nvdt2ADNmqDdfMld1avYFWGmH0HNB6HU94E6gMPawROIjLw+efBJefBHGj4eBA+Hrr11HJZJ8NWL8\n/WDoAZbkHwa2E8UZ48LCwv2v/X4/fr8/xlBEKta7N3z6qU2qdvLJVtoZPRrq1HEdmUhkgUCAQCAQ\nt/VF08bTApgNdAy9Xw74gXXAYcBcoA3wPnBU6DONgH3AfcDkCOtU66U48913Nn/+4sV2Be6AAa4j\nEqlcrK2X1Un2E4FNwATs5GwjDj5JOwb4BTtZG4mSvTj3yiswfLhdkfvQQ3DYYa4jEqlYovvsZwDz\ngdbAd8AVwHhgANZ6eXrovUjKOfdc681v0cJ68x9/XL35kr6cXUG7ZvMa8nPzqVuzrqMQRA5YutTm\nzS8utnnzu3d3HZFIWcko4yRC8KiHjmJ98XpqZtckPzef/Nx8CnIL9r+OtCyvbh7ZWdmOQpZ0FwzC\n00/DqFFw4YXwpz9Bw4auoxIxKZvsg8EgwWCQX3b/QtG2ItYXrz/oUVRcdvnWXVvJq5tX6U6h9JFb\nK9fRH09S2aZN1qnz2mtWy7/oIuvbF3EppZN9VZXsLWHj9o2V7hRKl2X7sqPaKeTn5tM0p6mOGqSM\nDz+E66+H5s3hL3+BE05wHZFksoxK9lX8Arbt3hb1jmHLzi00rtO40h1DQT1bllszt3TjSxorKbHe\n/HHjrHNn1Cj15osbSvZxsmffHjZt31TpTmF98XqKttkFxGV2ADmRdwqlRw01smK9fk1c+vZbGDHC\nTuROngz9+7uOSDKNkr0jxbuLK9wplF/+046faFi7YdmdQE7kHUN+bj71a9XXUYNHzZ5tI/zeva2e\n37y564gkUyjZp4C9+/by046fIh8tbCti/fayy/bs23PweYWcg3cK+bn5NMtpRs3smq7/iBmluBj+\n+EeYMgUKC+1+uNk63SMJpmSfhraXbI98tBBhx7Bx+0Ya1G4Q1Y6hILeABrUb6KghTpYutRO4O3ZY\nb363bq4jknSmZJ/h9gX38dOOnw7eKZS+3152+a69u6LqTirILaBZbjNqZddy/Uf0tGAQpk+3E7dD\nh9qIX735kghK9lIlO0p2sGH7hqh2DBu2b6BerXpR7Rjyc/NpVKdRxh41bNpkCf/11+Hhh+2irAzd\nFJIgSvaSMPuC+9iyc0vkHUNo5xC+bHvJdprlNovqauhmuc2oUyP9ehg//NBq+Icfbr35xx/vOiJJ\nF0r24hm79uzaf9RQ2Y5hffF66tasG9WOIT83n8Z1G5Plq869dpKvpAQeeQQmTLBbI44aBbVru45K\nUp2SvaSkYDDI1l1bo54q45fdv9A0p2nUU2V4YYK9b7+1ZP/ll9abf8YZriOSVKZkLxlh997dbCje\nENWOYX3xempl1zrk+YXwR5OcJgk9anj5ZUv6p54KkyZBQUHlvyNSnpK9SDnBYJCfd/0c1U6hdIK9\nJnWbRLVjKKhXQE7NnCrHVFwMf/gDTJ1qz9deq958qRole5EYlU6wV1RctP/ooaLpMoq2FVEjq0bU\ncyg1qdukzAR7X3xhvfm7dllvfteuDv/gklKU7EWSqPwEe4eaQ2l98foyE+yV7gCa5eSz9qt83p6Z\nj79HASOuzufYfNtJ1KtVz/UfUTxKyV7Ew0on2Iu0U/j3piLm/Ws9635ZT6Mj1rMtWITP5zvoauhI\n8ydpgr3Mo2QvkuI++MB68486CiY8vI16BRGmyYhw0dvmnZtpVKdR5SWl0LJ6tepl7EVv6SAZyX4q\ncA6wHugYWpYHPA8cA6wBLgK2YDciHwfUAnYDI4G5EdapZC8SpqTErrydOBFuuQVGjqy8N3/vvr1s\n2rHp4J1CBdc27A3ujWqnUHrUoAn2vCUZyb4PsA14mgPJfiKwMfQ8CmgMjAa6AOtCj/bAm8CREdap\nZC8Swb//bW2aX30Ff/0r9OsXv3UX7y5mw/YNEa9tKF9m2rRjEw1qN4j6ugZNsJd4ySrjtABmcyDZ\nLwf6AkVAcyAAtImw7o2hn5eU+5mSvcghzJplSf+00+DBB5Pfm78vuK/MzXwqOyFdsrckqp1C6VQZ\nmmCv6lwl+83YaL50HT+FvS/1G+BaYGCE9SnZi1Ri2zbryZ82zWbTvPZayPLojBHbS7YfdNFbRTuG\njds3Ur9W/ehmX61XQMPaDXXUgDeSPViyzwt73x6YhdXwV0dYX3DMmDH73/j9fvx+f5ShiGSWJUus\nN3/PHuvN79LFdUSx2Rfcx+Ydm6PaMawvXs/OPTtpltOs7DUMOZF3DM1ymlG7RnpMRBQIBAgEAvvf\njx07FhyVcfxYbf4w7CRsaRnnSOAd4D+BjypYn0b2IlWwb5+N8O++Gy65xEb89eu7jio5du7ZWeao\n4VA7hg3FG8ipmRP1RW+N6jRKmQn2XI3sJwKbgAnYidlGYc/vAWOAmYdYn5K9SDVs3Ah33glvvWXd\nOxdcoHnzwwWDwbLTcldy0Vvx7mKa5jQ95FFD+DUOLqflTkayn4GdjG2KnZD9PVaieQE4mrKtl/di\nSf/rsN8fgJ2oDadkLxKD99+30s4xx8Djj8Nxx7mOKDWFT7BX0dxJ4ctrZ9eOqpyUn5tPXt28uB41\n6KIqkQy1e7eN7h94AG69Fe64Q/PmJ1L4BHvR7Bh+3vXz/gn29h8dHOKoobIJ9pTsRTLcmjUwfDh8\n84315qvXwRtKJ9iLppxUfoK9SEcNl3S6BJTsRTJbMHigN9/vt978/HzXUUm0wifYq2jH8MKFL4CS\nvYiA9eaPHQvTp1tv/jXXeLc3X6pGZRwROcjixTa5WjBovfmdO7uOSGIVa7LXPl8kDXXqZLNpXnUV\nDBgAt90Gv/ziOipxScleJE1lZcHVV8PSpbB5M7RrBy+9ZKN9yTwq44hkiPfes978Y4+13vxjj3Ud\nkVSFyjgiEpW+feGzz6BPH+jRA8aNs159yQwa2YtkoNWrrTd/1Srrze/b13VEUhl144hItQSDMHMm\njBhhN0l54AH15nuZyjgiUi0+H5x/PixbBs2aQYcO8OSTNsOmpB+N7EUEgM8/t958n89KO+rN9xaN\n7EUkLjp3hg8/hCuusN78O+6wK3IlPSjZi8h+WVk2xcIXX9jc+e3awT/+od78dKAyjohUKBCw3vyW\nLeGxx9Sb75LKOCKSMH6/1fJ797be/PHj1ZufqjSyF5GorFplvflr1tgJ3NNOcx1RZlGfvYgkTTBo\nNfwRI6B/f5g40do2JfFUxhGRpPH5YMgQ683Py4P27eGpp9SbnwoqS/ZTsZuMLwlblge8BawA5gCN\nwn52F3az8eXAwPiFKSJeUr8+TJoEc+ZYsj/1VJtDX7yrsmQ/DRhUbtloLNm3At4JvQdoBwwNPQ8C\nJkexfhFJYV26wPz5MGyYlXVGjlRvvldVloznAZvLLTsPmB56PR0YHHr9a2AGUAKsAb4BesYlShHx\nrKwsuO46680vKrLe/Jkz1ZvvNdUZeRdgpR1CzwWh14cDa8M+txY4ovqhiUgqyc+Hp5+2+9+OHg2/\n/rV17og31Ijx94Ohx6F+HlFhYeH+136/H7/fH2MoIuIF/fpZb/6DD0L37lbaue02qFnTdWSpJRAI\nEAgE4ra+aNp4WgCzgY6h98sBP7AOOAyYC7ThQO1+fOj5DWAM8EmEdar1UiQDrFoFN90E335rvfl9\n+riOKHW5aL18GRgWej0MmBm2/GKgFnAscAKwoLqBiUjqO+44ePVVGDsWLrkErrzS5tyR5Kss2c8A\n5gOtge+AK7CR+wCs9fJ0DozklwEvhJ5fB27g0CUeEckAPh9ccIH15jdsaL35U6aoNz/ZdAWtiCTV\nokU2b37Nmlba6dix8t8RXUErIinmxBOtN/+yy+CMM+DOO6G42HVU6U/JXkSSLjvbRvdLlsCPP1pv\n/qxZrqNKbyrjiIhz774LN9wArVvDo4/CMce4jsh7VMYRkZR3+unWm9+jB3TrZrNplpS4jiq9aGQv\nIp6ycqX15q9daydwTz3VdUTeoPnsRSTtBIPw4otw661w5pkwYQI0beo6KrdUxhGRtOPzwYUXWm9+\n/frWmz9tmnrzY6GRvYh43r/+Zd07tWtbaadDB9cRJZ9G9iKS9rp2hY8+sikX+vWDUaPUm19VSvYi\nkhKys+H66603//vvrbQze7brqFKHyjgikpLeecd689u1gz//GY4+2nVEiaUyjohkpDPOsPvedu1q\njwcfVG/+oWhkLyIp75tv4MYb4Ycf4Ikn4JRTXEcUf+qzFxHBevP//ne7K9ZZZ8H48dCkieuo4kdl\nHBERrDf/oousNz8nx07g/vd/68bnpTSyF5G09Omn1ptft6715rdv7zqi2GhkLyISQbdu8PHHcPHF\n4PfDXXfB9u2uo3JHyV5E0lZ2trVnLlliNz1v1w5eecV1VG7EkuxHAEuAL0KvAXpiNxlfBPwT6BFT\ndCIicdC8OTz7LDz1lJ3AHTIEvvvOdVTJVd1k3wG4GkvmnYFzgZbAROA+4ETg96H3IiKe0L+/9eZ3\n7my3R5w0KXN686ub7NsAnwA7gb3Ae8AQ4AegYegzjYDvYw1QRCSe6tSBMWNsrp0337Ta/vz5rqNK\nvOqe2W0DzAJOxhL+O1j5ZhIwH9iH7UhOBiIdLKkbR0ScCwbhhRestHPOOdabn5fnOqrIXHXjLAcm\nAHOA17Ea/T5gCjAcOBq4FZha3cBERBLN54OhQ603v04dO4E7fXp69ubHq8/+fmAttgNoELbuLRwo\n64QLjhkzZv8bv9+P3++PUygiItWzcKH15terB5MnW/J3JRAIEAgE9r8fO3YsOJouIR9Yj43i3wR6\nAXOxEf17wBnAeCJ35KiMIyKetHevza9TWAjXXAP33mtX5Lrmcm6c94EmQAmW4OcC3YG/ALWBHcAN\nWImnPCV7EfG0H3+0Wv4nn8Bjj1lN3yVNhCYikkBvvWUXZnXqZPPmH3mkmzg0XYKISAINGGBX4Hbs\nCF26wEMPwZ49rqOqOo3sRUSitGKFzZu/YYPV9Xv1St53q4wjIpJEwSA8/zzcfjucey6MG5ec3nyV\ncUREksjns5k0ly6FmjVt6uSnn/Z+b75G9iIiMfjnP603v0ED681v2zYx36ORvYiIQz16wIIFNpPm\naafBPfd4c958JXsRkRhlZ8Pw4fD557ByJXToAK+95jqqslTGERGJszlzrDe/Sxd45JH49OarjCMi\n4jEDB1pvfvv2BxK+6958jexFRBJoxQob5W/aZL35J51UvfVoZC8i4mGtWtmUCyNHwvnnw/XXw+bN\nyY9DyV5EJMF8PrjkEps3PyvLpk5+5pnk9uarjCMikmQLFlhvfqNG1pvfpk3lv6MyjohIiunZ0xL+\n4MHQpw/cdx/s2JHY71SyFxFxoEYNuPlm681fscJ68994I3HfpzKOiIgHvPmmzah54onWqnnEEWV/\nrjKOiEgaOPNM681v2xY6d7YbpcSzN18jexERj/nqK+vN37zZevN79ox9ZF8jfuGJiEg8tG4Nb78N\nzz1nJ3EHD459nbGUcUYAS4AvQq9LDQe+DC2fEMP6RUQyls8Hl15q8+bHQ3WTfQfgaqAH0Bk4F2gJ\n9APOAzqFPvNgHGJ0IhAIuA4hKoozvhRnfCnO2DVubL34sapusm8DfALsBPYC7wFDgN8B44CS0Oc2\nxBqgK17+yw+nOONLccaX4vSO6ib7L4A+QB6QA5wNHAW0Ak4DPgYCQPfYQxQRkVhV9wTtcqwePwco\nBj7DRvg1gMZAL6zE8wJwXOxhiohILOLVenk/sBar14/HyjoA3wAnAZvKff4brMYvIiLRWQkc7+KL\n80PPR2PdNw2A64CxoeWtgG8dxCUiInH0PrAUK+H0Cy2rCfwP1pL5KeB3EpmIiIiIiMRXa2BR2GMr\ncDPWxfMWsAI7ydvIVYAhkeIcARRi5yJKlw9yFF+4u7AjqiXAc0BtvLc9IXKchXhre0a6MNCL2zJS\nnIW435ZTgaJQbKUOtf3uAr7GGjwGJilGqFqcLYAdHNiucehwj1qkOC/E/h/tBbqW+7yr7VmpLOBH\nrEVzInBnaPko7KSuV4THOQa4zW04ZbQAVmGJE+B5YBje254tiBynl7ZnB+w/VR0gG/uP3xLvbcuK\n4vTCtuwDnEjZ5FTR9muHlXxrYv8+viF5EzFWJc4W5T6XTJHibIOd/5xL2WRf5e2ZzFkv+2MBfYd1\n7UwPLZ8OxGHmh7gJj9OHu8niIvkZu2AtB2tzzQF+wHvbM1Kc34d+5pXtGenCwAvw3ras6AJGcL8t\n5wHl76Za0fb7NTAD+3exBvs/1jPxIQJVi9OlSHEux44+yqvy9kxmsr8YCw6gADtcIfRckMQ4KhMe\nZxCb6+cehcL9AAACJ0lEQVRzYAruD+l/AiZhXU4/AFuwkZ7XtmekON8O/cwr2zPShYFH4r1tWdEF\njOCdbRmuou13OFZ2KrUWKDdje1Id6u/5WKyEEwBOTW5YUavy9kxWsq8F/Ar4e4SfBUMPLygf51+x\nv/guWGlnkqO4SrUEbsEO2w4H6gGXlfuMF7ZnpDgvxVvbM/zCwNc5cGFgOC9sy4rinIx3tmVFKtt+\nrrdtqfA4f8B2pidiZbLngPqO4qqqQ27PZCX7s7BWzNK5coqA5qHXhwHrkxRHZcrHuZ4D/xCeInmH\nnRXpDszHLlLbA/wfcDKwDm9tz0hx9sZ723MqFmtf7PB5Bd78txke5xbgK+zfqJe2ZamKtt/3HDgi\nATuK+h53KopzNwdKKf/CLmQ6IbmhRaXK2zNZyf63HCiNALyMnbAj9DwzSXFUpnych4W9Ph93J25K\nLcemoqiL1Wv7A8uA2Xhre1YUZ/Owz3hhe4ZfGDgEG8V58d9meJznY3F67d9mqYq238tYibQWdkRy\nArAg6dEdUFGcTbET4WBTvZyANRt4Qfg5Gq9tTwBygY2UPRTKw2q4XmpvixTn08BirC46E/f1W7AO\ngtKWxunY2Xgvbs/ycdbCe9sz0oWBXtyWkeL0wracgZU9dmMNDVdw6O13N3YicTlwpkfjHIKdJ1mE\nHeWf4zDOK7ETx99h7aDrsFJeKVfbU0RERERERERERERERERERERERERERERERETE+/4f1Fdopvf2\nNvUAAAAASUVORK5CYII=\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0x7f0690347e50>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Upper layer = 93.4 kg and Lower layer = 102.4\n",
+ "b mass ratio of the mixed solvent to the original mixture is 0.958\n",
+ "c water mass percent = 58.9403862931 and acetic acid mass percent = 41.0596137069 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "%matplotlib inline\n",
+ "from numpy import linspace\n",
+ "from matplotlib.pyplot import plot, show\n",
+ "# solution \n",
+ "# Variables \n",
+ "m = 100. # kg\n",
+ "x = linspace(70,110,5);\n",
+ "y = linspace(100,115,4);\n",
+ "\n",
+ "# Calculation \n",
+ "y1 = 27.8/.203 - .075*x/.203\n",
+ "y2 = 72.2/.673 - .035*x/.673\n",
+ "x = linspace(70,110,5);\n",
+ "plot(x,y1)\n",
+ "plot(x,y2)\n",
+ "show()\n",
+ "x = 93.4;\n",
+ "y = 102.4;\n",
+ "M = x+y # [kg] total mixture\n",
+ "Ms = M - m #[kg] mixed solvent\n",
+ "Mr = Ms/m # mixed solvent/original mixture\n",
+ "S1 = x*.574+y*.028 #[kg] water balance\n",
+ "S2 = x*.316+y*.096 #[kg] acetic acid balance\n",
+ "Qs = S1+S2\n",
+ "pS1 = (S1*100)/Qs\n",
+ "pS2 = 100-pS1\n",
+ "\n",
+ "# Result\n",
+ "print \"a Upper layer = \",x,\" kg and Lower layer = \",y\n",
+ "print \"b mass ratio of the mixed solvent to the original mixture is \",Mr\n",
+ "print \"c water mass percent = \",pS1,\" and acetic acid mass percent = \",pS2,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.14 Page 73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a recovery percent of glycerine is 85.9864521592\n",
+ " b percent loss of glycerinr is 1.04784081287\n",
+ " c product contamination with respect to salt NaCl is 0.283116033416\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "#using table 2.7 on page no 75\n",
+ "Rg = 8124.*100/9448 # recovery of glycerine\n",
+ "Lg = (16+83)*100./9448 # loss of glycerine in waste\n",
+ "Reg = 100-Rg-Lg # recycle of glycerine\n",
+ "\n",
+ "# Calculation \n",
+ "m1 = 238/8124. # NaCl in product\n",
+ "m2 = Rg*12/100. # glycerine in product\n",
+ "m3 = m1+m2 # total solute\n",
+ "n = m1*100/m3 # NaCl percent in total solute\n",
+ "\n",
+ "# Result\n",
+ "print \"a recovery percent of glycerine is \",Rg\n",
+ "print \" b percent loss of glycerinr is \",Lg\n",
+ "print \" c product contamination with respect to salt NaCl is \",n\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.15 Page 76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a moisture removed in AC plant = 1.48829053429\n",
+ " b moisture added in auditorium = 4249.92025923\n",
+ " c recycle ratio of moles of air recycled per mole mole of fresh ambient air input = 3.89342336\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "f1 = 1.25 #[m**3/s] fresh ambient air as feed (basis)\n",
+ "f2 = 5.806 #[m**/s] air entering auditorium\n",
+ "v1 = 8.314*290/101.3 #[m**3/kmol] sp. vol. of moist air at 101.3 kPa and 290 K\n",
+ "na1 = f2*1000/v1 # [mol/s] molar flow rate of air entering auditorium\n",
+ "nw1 = 243.95*.0163/1.0163 # [mol/s]\n",
+ "na2 = 243.95 - nw1 #[mol/s] dry air flow\n",
+ "nw2 = 240.04*.0225 #[mol/s] moisture enterin air conditioning plant\n",
+ "\n",
+ "# Calculation \n",
+ "# using table 3.8\n",
+ "m1 = (nw2-nw1) #[kg/h] moisture removed in a c plant\n",
+ "m2 = na2-.0181 #[mol/s] moisture in air leaving auditorium\n",
+ "m3 = (m2-nw1)*18 # [kg/h] moisture added in auditorium\n",
+ "Vm2 = 8.314*308/101.3 # [m**3/kmol]\n",
+ "na3 = (f1/25.28)*1000 #[mol/s] \n",
+ "n4 = 5.40-1.925 #[mol/s] moisture in recycle stream\n",
+ "mr = 240.04-47.525 #[mol/s] molar flow rate of wet recycle stream\n",
+ "R = mr/na3\n",
+ "\n",
+ "# Result\n",
+ "print \"a moisture removed in AC plant = \",m1\n",
+ "print \" b moisture added in auditorium = \",m3\n",
+ "print \" c recycle ratio of moles of air recycled per mole mole of fresh ambient air input = \",R\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.16 Page 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Overall Efficiency = E1 E2 E3*100/[1-E11-E2+E2 E3].\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# screen 1\n",
+ "# feed = N kg\n",
+ "# Oversize particle = NE1 kg\n",
+ "# Undersize particle = N-NE1\n",
+ "\n",
+ "#screen 2\n",
+ "#feed = NE1+X kg\n",
+ "# Oversize particle = (NE1+X)*E2 kg\n",
+ "# Undersize particle = (NE1+X)(1-E2) kg\n",
+ "\n",
+ "\n",
+ "#screen 3\n",
+ "# feed = (NE1+X)*E2 kg\n",
+ "# Oversize particle = (NE1+X)*E2*E3 kg\n",
+ "# Undersize particle = (NE1+X)*E2*(1-E3) kg\n",
+ "print \"Overall Efficiency = E1 E2 E3*100/[1-E11-E2+E2 E3].\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.17 Page 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a \n",
+ " Flow rate of product stream is 2234.89795918 kmol/h.\n",
+ "b \n",
+ " Product H2 stream : H2 = 2605.30204082 kmol/h CO = 159.8 kmol/h \n",
+ "c \n",
+ " Composition of Mixed feed : H2 = 66.842375 CO = 33.157625\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "print \"a \"\n",
+ "F = 5000. #[kmol/h] feed (basis)\n",
+ "\n",
+ "# Calculation \n",
+ "m1 = F*.47 #[kmol/h] CO in F\n",
+ "m2 = F-m1 #[kmol/h] H2 in F\n",
+ "m3 = m1*.932 # CO in product stream\n",
+ "n2 = m3/.98 #[kmol/h] \n",
+ "\n",
+ "# Result\n",
+ "print \" Flow rate of product stream is \",n2,\" kmol/h.\\nb \"\n",
+ "n2 = n2-m3 #[kmol/h] H2 in CO stream\n",
+ "print \" Product H2 stream : H2 = \",m2-n2,\" kmol/h CO = \",m1-m3,\" kmol/h \\nc \"\n",
+ "nH2 = 2697.39 #[kmol/h]\n",
+ "nCO = 3000-nH2 # [kmol/h]\n",
+ "n4 = m2+nH2\n",
+ "n5 = m1+nCO\n",
+ "n6 = n4+n5\n",
+ "\n",
+ "print \" Composition of Mixed feed : H2 = \",n4*100/n6,\" CO = \",n5*100/n6\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.18 Page 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "F = 8.2196969697\n",
+ " m**3/h R1 = 60.8294930876\n",
+ " m**3/h P = 11.25\n",
+ " m**3/h R2 = 1.25\n",
+ " m**3/h recycle ratio = 0.152073732719\n",
+ " rejection percentage of salt in module I = 95.3914154639\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "\n",
+ "# Overall balance\n",
+ "# F=R1+P2\n",
+ "# Balance across Module I\n",
+ "# F+R2 = R1+P1 ==> R1+P2+R2 = R1+P1\n",
+ "# balance across module II\n",
+ "# P1 = P2+R2\n",
+ "P2 = 5. #[m**3/h]\n",
+ "P1 = P2/.8 #[m**3/h]\n",
+ "R2 = P1-P2 #[m**3/h]\n",
+ "F = P1/.66 - R2 #[m**3/h]\n",
+ "R1 = F-P2 #[m**3/h]\n",
+ "\n",
+ "# Calculation \n",
+ "# Overall balance of DS in water\n",
+ "xR1 = (F*4200-P2*5.)/R1 #[mg/l]\n",
+ "xP1 = (P2*5)/(.015*P1) # [mg/l]\n",
+ "xR2 = (P1*xP1-P2*5)/R2 #[mg/l]\n",
+ "m1 = F*4200+R2*xR2 #[g] DS mixeed in MF\n",
+ "C1 = m1/(F+R2) # [mg/l]\n",
+ "m2 = R1*xR1 #[g] DS in R1\n",
+ "r = m2*100/m1 # rejection in module in I\n",
+ "m3 = m1-m2 #[g] DS in P1\n",
+ "C2 = m3/P1 # [mg/l] \n",
+ "R = R2/F \n",
+ "R1 = P2*100/F\n",
+ "\n",
+ "# Result\n",
+ "print \"F = \",F\n",
+ "print \" m**3/h R1 = \",R1\n",
+ "print \" m**3/h P = \",P1+P2\n",
+ "print \" m**3/h R2 = \",R2\n",
+ "print \" m**3/h recycle ratio = \",R\n",
+ "print \" rejection percentage of salt in module I = \",r\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch4.ipynb b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch4.ipynb
new file mode 100644
index 00000000..89ab57be
--- /dev/null
+++ b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch4.ipynb
@@ -0,0 +1,1281 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4 : Material Balances Involving Chemical Reactions"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.1 Page 116"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Percentage conversion = 89.2001241751\n",
+ " Percentage yield of MCA = 92.8448972013\n",
+ " selectivity of MCA = 12.976039592\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "\n",
+ "# basis one day operation\n",
+ "# Cl2 is the limiting component\n",
+ "n1 = 4536./71 #[kmol] Cl2 charged\n",
+ "\n",
+ "# 1mol MCA requires 1 mol Cl2, so\n",
+ "n2 = 5000/94.5 # [kmol] Cl2 used for MCA production\n",
+ "\n",
+ "# Calculation \n",
+ "# 1 mol DCA requires 2 mol of Cl2\n",
+ "n3 = 263*2./129 #[kmol] Cl2 used for DCA production\n",
+ "n4 = n2+n3 # total Cl2 used\n",
+ "a = n4*100/n1 # conversion %age\n",
+ "b = n2*100/n4 # yield % of MCA\n",
+ "s = n2/n3\n",
+ "\n",
+ "# Result\n",
+ "print \"Percentage conversion = \",a\n",
+ "print \" Percentage yield of MCA = \",b\n",
+ "print \" selectivity of MCA = \",s\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.2 Page 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Yield of OT = 72.8790087464\n",
+ " b Excess quantity of iron powder = 11.8367346939\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "m = 700. #[kg] ONT charged to reactor (basis)\n",
+ "m1 = 505*.99 # [kg] OT produced\n",
+ "\n",
+ "# Calculation \n",
+ "m2 = (4*137.*500)/(4.*107) #[kg] ONT required\n",
+ "m3 = m*.98 # [kg] ONT reacted\n",
+ "n1 = m1*100/m3 # yield of OT\n",
+ "m4 = (9*56*m)/(4.*137) # [kg] theoretical iron reqiurement\n",
+ "m5 = 800*.9 #[kg] iron charged\n",
+ "E = (m5-m4)*100/m4 # excess iron\n",
+ "\n",
+ "# Result\n",
+ "print \"a Yield of OT = \",n1\n",
+ "print \" b Excess quantity of iron powder = \",E\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.3 Page 118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a \n",
+ " Analysis of charge: \n",
+ "Component mass percent\n",
+ "Chlorobenzene 46.62004662\n",
+ "HNO3 32.520979021\n",
+ "H2SO4 47.1272727273\n",
+ "H2O 20.3517482517\n",
+ "b \n",
+ "Percent conversion of Chloro benzene is 93.71\n",
+ "c \n",
+ " Composition of product stream :\n",
+ "Component mass percent\n",
+ " CB 1.46820564496\n",
+ " p-NCB 20.2112955666\n",
+ " o-NCB 10.4118795343\n",
+ " HNO3 30.6231751009\n",
+ " H2SO4 23.595862041\n",
+ " H2O 13.6895821123\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "\n",
+ "print \"a \"\n",
+ "m = 100. #kg chlorobenzene (basis)\n",
+ "m1 = 106.5*.655 #kg HNO3 \n",
+ "m2 = 108*.936 # kg H2SO4\n",
+ "\n",
+ "# Calculation and Result\n",
+ "m3 = 106.5*.345 +108*.064 #kg water\n",
+ "M = m1+m2+m3\n",
+ "print \" Analysis of charge: \" \n",
+ "print \"Component mass percent\"\n",
+ "print \"Chlorobenzene \",m*100/M\n",
+ "print \"HNO3 \",m1*100/M\n",
+ "print \"H2SO4 \",m2*100/M\n",
+ "print \"H2O \",m3*100/M\n",
+ "print \"b \"\n",
+ "# (b)\n",
+ "# total charge mass is constant\n",
+ "m4 = 314.5*.02 #[kg] unreacted CB in the product\n",
+ "m5 = 100-m4 # [kg] CB that reacted\n",
+ "c = m5*100./100 # conversion of CB\n",
+ "print \"Percent conversion of Chloro benzene is \",c\n",
+ "print \"c \"\n",
+ "# (c)\n",
+ "m6 = 63*c/112.5 #[kg] HNO3 consumed\n",
+ "m7 = m1-m6 # unreacted HNO3\n",
+ "m7 = 157.5*c/112.5 # [kg] total NCB produced\n",
+ "m8 = m7*.66 #[kg] p-NCB\n",
+ "m9 = m7*.34 #[kg] o-NCB\n",
+ "m10 = 18*c/112.5 #[kg] water produced\n",
+ "m11 = m10+m3 # total water in product\n",
+ "m12 = m4+m8+m9+m7+m2+m11\n",
+ "print \" Composition of product stream :\"\n",
+ "print \"Component mass percent\"\n",
+ "print \" CB \",m4*100/m12\n",
+ "print \" p-NCB \",m8*100/m12\n",
+ "print \" o-NCB \",m9*100/m12\n",
+ "print \" HNO3 \",m7*100/m12\n",
+ "print \" H2SO4 \",m2*100/m12\n",
+ "print \" H2O \",m11*100/m12"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.4 Page 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Conversion percent of ethanol = 21.7435446009\n",
+ "b Yield of acetaldehyde = 94.0298507463\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "n=100. #[kmol] outgoing gas from 2nd scrubber\n",
+ "n1=.852*n #[kmol] N2\n",
+ "n2=21*n1/79. #[kmol] O2\n",
+ "n3=n2-2.1 # [kmol] reacted O2\n",
+ "# O2 balance\n",
+ "# O2 consumed in rxn (ii),(iii),(v) - O2 produced by rxn (iv) = 20.55 kmol\n",
+ "# let a,b,c be ethanol reacted (ii),(iii),(iv) and d be H2 reacted in (v)\n",
+ "\n",
+ "# Calculation \n",
+ "# CO balance\n",
+ "a=2.3/2 #kmol\n",
+ "\n",
+ "#CO2 balance \n",
+ "b = .7/2\n",
+ "\n",
+ "#CH4 balance\n",
+ "c=2.6/2\n",
+ "\n",
+ "#O2 balance\n",
+ "d = 41.1-a-3*b+c\n",
+ "\n",
+ "#H2 balance\n",
+ "e = 7.1 +c+d #kmol (total H2 produced)\n",
+ "f = e-(3*b + 3*a) #kmol (H2 produced in (i) = ethanol reacted in (i))\n",
+ "g = f+a+b+c # total ethanol reacted\n",
+ "h = 2*(n1+n2) # total ethanol entering\n",
+ "c1 = g*100/h\n",
+ "\n",
+ "# Result\n",
+ "print \"a Conversion percent of ethanol = \",c1\n",
+ "y = f*100/g\n",
+ "print \"b Yield of acetaldehyde = \",y\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.5 Page 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Amount of lime required = 218.736 mg/l.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "v = 1. #[l] water (basis)\n",
+ "# 1 mol (100mg) CaCO3 gives 1 mol (56) Cao\n",
+ "# use table 3.3 and eg 3.9\n",
+ "\n",
+ "# Calculation \n",
+ "x = 56*390.6/100 #[mg/l] lime produced\n",
+ "\n",
+ "# Result\n",
+ "print \"Amount of lime required = \",x,\" mg/l.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.5 Page 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "x = 64.3747773424\n",
+ " and y = 35.6252226576\n",
+ "Amount of steam required = 36.5874599216 kmol\n"
+ ]
+ }
+ ],
+ "source": [
+ "from numpy import array, linalg\n",
+ "\n",
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "m=100. #[kmol] (basis) dry mixed gas\n",
+ "# x = kmol of water gas\n",
+ "# y =kmol of producer gas\n",
+ "# overall material balance : \n",
+ "# x+y = 100 (i)\n",
+ "\n",
+ "#r2 =.43x+.25y # H2 formed by shift rxn\n",
+ "#r2=.51x+.25y # H2 entering with water and producer gas\n",
+ "#r = r1+r2 # taoal H2 \n",
+ "#/n =.02x+.63y # N2 entering\n",
+ "#N2:H2=1:3\n",
+ "# ==> x-1.807y = 0(ii)\n",
+ "#solving (i) and (ii)\n",
+ "A = array([[1, 1],[1, -1.807]])\n",
+ "d = array([100,0])\n",
+ "\n",
+ "# Calculation \n",
+ "x = linalg.solve(A,d)\n",
+ "s = .43*x[0]+.25*x[1] # steam req.\n",
+ "\n",
+ "# Result\n",
+ "print \"x = \",x[0]\n",
+ "print \" and y = \",x[1]\n",
+ "print \"Amount of steam required = \",s,\" kmol\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.7 Page 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a NaOH required = 135.842696629 kg \n",
+ "b amount of glycerine liberated = 10.3370786517 kg.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "m = 100. #[kg] Tallow\n",
+ "\n",
+ "# Calculation \n",
+ "m1 = 3*403*m/890. # [kg]\n",
+ "m2 = 92*m/890.\n",
+ "\n",
+ "# Result\n",
+ "print \"a NaOH required = \",m1,\" kg \\nb amount of glycerine liberated = \",m2,\" kg.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.8 Page 124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a The fraction of S burnt = 0.0712504453153\n",
+ "b percentage of excess air over the amount req. for S oxidising to SO2 = 20.4488778055\n",
+ "c volume of dry air = 43.3707633304 m**3/s \n",
+ "d volume of burner gases = 53815.0344364 m**3/s.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "n = 100. #[kmol] SO3 free gas basis\n",
+ "n1 = 16.5 #[kmol] SO2\n",
+ "n2 = 3. #[kmol] O2\n",
+ "n3 = 80.5 #[kmol] N2\n",
+ "\n",
+ "\n",
+ "# Calculation \n",
+ "# S + O2 = SO2\n",
+ "# S + 3/2 O2 = SO3\n",
+ "n4 = (21/79.)*80.5 #[kmol] O2 supplied\n",
+ "n5 = n4-n1-n2 # [kmol] Unaccounted O2\n",
+ "\n",
+ "# O2 used in 2nd eq is m5\n",
+ "n6 = (2./3)*n5 #[kmol] SO3 produced\n",
+ "n7 = n1+n6 # sulphur burnt\n",
+ "m7 = n7*32 #[kg]\n",
+ "f1 = n6/n7 # fraction of SO3 burnt\n",
+ "\n",
+ "# O2 req. for complete combustion of S = n7\n",
+ "n8 = n4-n7 #[kmol] excess O2\n",
+ "p1 = n8*100/n7 # %age of excess air\n",
+ "n9 = n4+n3 #[kmol/s] air supplied\n",
+ "F1 = n9*.3/n7 # air supply rate\n",
+ "v = 22.414*(303.15/273.15)*(101.325/100) #[m**3/kmol] sp. vol of air\n",
+ "V1 = F1*v #[m**3/s] flow rate of fresh air\n",
+ "n10 = n+n7 #[kmol] total gas from burner\n",
+ "n11 = n10*.3/m7 # [kmol/s] gas req. for .3 kg/s S\n",
+ "V2 = 220414*1073.15*n11/273.15 # flowrate of burner gases\n",
+ "\n",
+ "# Result\n",
+ "print \"a The fraction of S burnt = \",f1\n",
+ "print \"b percentage of excess air over the amount req. for S oxidising to SO2 = \",p1\n",
+ "print \"c volume of dry air = \",V1,\" m**3/s \\nd volume of burner gases = \",V2,\" m**3/s.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.9 Page 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a theoretical H2 required = 11.434 Nm**3/100kg soyabean oil\n",
+ "b actual H2 required = 52.95\n",
+ "c Iodine value for soyabean oil = 129.5\n",
+ "d Iodine value of hardened fat = 69.2\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "m = 100. #[kg] soya fatty acid (basis)\n",
+ "\n",
+ "# use table 4.6\n",
+ "M1 = m/.3597 # M(avg) of soya fatty acid\n",
+ "\n",
+ "\n",
+ "# Calculation \n",
+ "#3 mol of fatty acid + 1 mol of glycerol = 1 mol triglyceride + 3 mol of water\n",
+ "M2 = M1*3+92.09-3*18.02 # Mavg of soyabean oil\n",
+ "q1 = M2*m/(M1*3) # soyabean oil per 100kg fatty acid\n",
+ "\n",
+ "# based on reactions occuring\n",
+ "q2 = .0967+.1822*2+.0241*3 # kmol H2 req. per 100 kg soya fatty acid\n",
+ "q3 = .5101 # kmol H2 req. per 100 kg soyabean oil\n",
+ "q4 = 11.434 # Nm**3/100kg soyabean oil\n",
+ "# x = linoleic acid converted to oleic acid\n",
+ "# y = oleic acid converted to stearic acid\n",
+ "q5 = 282.46*6.7/278.43 \n",
+ "#q6 = 282.46*x/280.15 = 1.00717x [kg] oleic acid by linoleic acid\n",
+ "#q7 = 284.48*y/282.46 = 1.00715y [kg] stearic acid by oleic acid\n",
+ "#q8 = 100.097 + .00717x + .00715y total fatty acid\n",
+ "#stearic balance : -.00105x + 1.00611y = 10.8142 (i)\n",
+ "#linoleic balance : 1.0019x + .00019y = 48.4975 (ii)\n",
+ "# solving (i) and (ii) we get\n",
+ "x = 48.5 #kg\n",
+ "y = 10.8 #kg\n",
+ "M3 = 100.52/.3596 # Mavg of fatty acid\n",
+ "H2req1 = .5334-.2864 # per 100kg fatty acid\n",
+ "H2req = 52.95 #Nm**3/t \n",
+ "I2s = 129.5 #kg I2 per 100 kg soyabean oil # for soyabean oil\n",
+ "I2h = 69.2 #kg I2 per 100 kg of fat\n",
+ "\n",
+ "# Result\n",
+ "print \"a theoretical H2 required = \",q4,\" Nm**3/100kg soyabean oil\"\n",
+ "print \"b actual H2 required = \",H2req\n",
+ "print \"c Iodine value for soyabean oil = \",I2s\n",
+ "print \"d Iodine value of hardened fat = \",I2h\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.10 Page 128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Composition of exit gas stream : CH3OH = 1.25\n",
+ " HCHO = 111.375\n",
+ " CO2 = 8.786\n",
+ " CO = 0.99\n",
+ " H2 = 1.98\n",
+ " CH4 = 0.619\n",
+ " CH32O = 0.99\n",
+ " O2 = 212.713\n",
+ " N2 = -1058.09347048\n",
+ " H2O = 153.667\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "\n",
+ "F1 = 4000. #kg/h methanol (basis)\n",
+ "F2 = F1/32 #kmol/h\n",
+ "F3 = F2/.084 #kmol/h gaseous mix flowrate\n",
+ "F4 = F2-F3 #kmol/h flow of wet air\n",
+ "n1 = .011*29/18. # kmol/kmol dry air \n",
+ "F5 = F4/(1+n1) # kmol/h dry air flowrate\n",
+ "O2 = F5*.21 #kmol/h\n",
+ "N2 = F5-O2 #kmol/h\n",
+ "Mreacted1 = F2*.99 #kmol/h\n",
+ "Munreacted1 = F2-Mreacted1 #kmol/h\n",
+ "\n",
+ "# Calculation \n",
+ "# reaction (i)\n",
+ "Mreacted2 = Mreacted1*.9 #kmol/h\n",
+ "HCHOproduced1 = 111.375\n",
+ "O2consumed1 = 111.375/2\n",
+ "H2Oproduced1 = 111.375\n",
+ "\n",
+ "# for rxn ii to iv\n",
+ "Mconsumed = Mreacted1*.1\n",
+ "\n",
+ "#rxn (ii)\n",
+ "CH3OHreacted1 = Mconsumed*.71\n",
+ "O2consumed2 = 8.786*1.5\n",
+ "CO2produced = 8.786\n",
+ "H2Oproduced2 = 8.786*2\n",
+ "\n",
+ "#rxn(iii)\n",
+ "CH3OHreacted2 = 12.375*.08\n",
+ "COproduced = .99\n",
+ "H2produced = 2*.99\n",
+ "\n",
+ "#rxn(iv)\n",
+ "CH3OHreacted3 = 12.375*.05\n",
+ "CH4produced = .619\n",
+ "O2produced = .619/2\n",
+ "\n",
+ "#rxn(v)\n",
+ "CH3OHreacted4 = 12.375-CH3OHreacted1-CH3OHreacted2-CH3OHreacted3\n",
+ "DMEproduced = 1.98/2\n",
+ "H2Oproduced3 = 1.98/2\n",
+ "O2 = 281.27-O2consumed1-O2consumed2+O2produced\n",
+ "H2O = 23.73+H2Oproduced1+H2Oproduced2+H2Oproduced3\n",
+ "\n",
+ "# Result\n",
+ "print \"Composition of exit gas stream : CH3OH = \",Munreacted1\n",
+ "print \" HCHO = \",HCHOproduced1\n",
+ "print \" CO2 = \",CO2produced\n",
+ "print \" CO = \",COproduced\n",
+ "print \" H2 = \",H2produced\n",
+ "print \" CH4 = \",CH4produced\n",
+ "print \" CH32O = \",DMEproduced\n",
+ "print \" O2 = \",O2\n",
+ "print \" N2 = \",N2\n",
+ "print \" H2O = \",H2O\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.11 Page 132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a percentage of cinder remained in cinder = 4.28571428571 . \n",
+ "b percentage of S burnt to form SO3 = 9.9912948486 \n",
+ "c volumetric flow rate of air = 17.2460430576 m**3/s \n",
+ "d volumetric flow rate of roaster gases = 44.246401399 m**3/s \n",
+ "f Amount of 98 percent acid strength produced = 409.643136 t/d.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "m = 100. #kg pyrites (basis)\n",
+ "\n",
+ "#(a)\n",
+ "print \"a \",\n",
+ "S1 = 42. #kg\n",
+ "i1 = 58. #kg inerts\n",
+ "\n",
+ "# Calculation \n",
+ "# 8 moll S = 3 mol O2 in Fe2O3\n",
+ "m1 = 3*32*42./8.*32 #kg O2 converted to Fe2O3\n",
+ "m2 = i1+m1 # mass of SO3 free cinder\n",
+ "\n",
+ "#2.3 kg S is in 100kg cinder\n",
+ "m3 = 100-(2.3*80./32)\n",
+ "m4 = (100./m3)*m2\n",
+ "m5 = m4*.023 #kg S in cinder\n",
+ "p1 = 1.8*100/42.\n",
+ "\n",
+ "# Result\n",
+ "print \"percentage of cinder remained in cinder = \",p1,\". \\nb \",\n",
+ "\n",
+ "#(b)\n",
+ "m6 = 100. #kmol SO3 free roaster gas (basis)\n",
+ "m7 = 7.12 #kmol O2 as SO2\n",
+ "m8 = 10.6 #O2\n",
+ "m9 = 100-m8-m7 #N2\n",
+ "m10 = (21/79.)*m9 # O2 entering roaster along N2\n",
+ "m11 = m7+m8+(3*7.12/8) # accounted O2\n",
+ "m12 = m10-m11 # unaccounted O2\n",
+ "m13 = (8/15.)*m12 # SO3 formed\n",
+ "m14 = m13+m7 # S burnt\n",
+ "p2 = (m13/m14)*100.\n",
+ "print \"percentage of S burnt to form SO3 = \",p2,\" \\nc \",\n",
+ "\n",
+ "# (c)\n",
+ "# basis 100kg pyrite\n",
+ "m15 = 37.81/32 # SO2 formed\n",
+ "m16 = (m9+m10)*1.181/m7 # air supplied\n",
+ "\n",
+ "# 4 kg pyrite is roasted\n",
+ "m17 = m16*4/100. #kmol/s total air supplied\n",
+ "v1 = m17*24.957 \n",
+ "print \"volumetric flow rate of air = \",v1,\" m**3/s \\nd \",\n",
+ "# (d)\n",
+ "m18 = (100.455*m17)/(m9+m10) # roaster gases\n",
+ "v2 = m18*66.386\n",
+ "print \"volumetric flow rate of roaster gases = \",v2,\" m**3/s \\nf \",\n",
+ "#(f)\n",
+ "m19 = 4.838*10**-2*.98 # SO3 absorbed in absorber\n",
+ "# SO3 + H2O = H2SO4\n",
+ "m20 = (m19*98*24*3600)/(.98*1000) #[t/d]\n",
+ "print \"Amount of 98 percent acid strength produced = \",m20,\" t/d.\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.12 Page 136"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a \n",
+ "Total cinder produced = 79.398250005 kg \n",
+ "Composition of cinder : ZnO = 14.2073921971 kg \n",
+ "Fe2O3 = 44.97581 kg \n",
+ "S as FeS2 = 1.57 kg \n",
+ "S as SO3 = 4.64504780785 kg \n",
+ "inerts = 14.0 kg \n",
+ "b \n",
+ "percentage of S left in cinder = 6.57552394194\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100kg mixed charge = 75 kg pyrite + 25kg ZnS\n",
+ "# pyrites\n",
+ "m1 = 75*.92 #[kg] FeS2\n",
+ "G1 = 75-m1 # gangue\n",
+ "# 4FeS2 + 11O2 = 2Fe2O3 + 8SO2\n",
+ "# 4FeS2 + 15O2 = 2Fe2O3 + 8SO3\n",
+ "#Zn ore\n",
+ "m2 = 25*.68 # ZnS\n",
+ "I1 = 25-m2 # inerts\n",
+ "\n",
+ "# Calculation \n",
+ "# 2ZnS + 3 O2 = 2 ZnO + 2 SO2\n",
+ "I2 = I1+6 # total inerts\n",
+ "# new basis : 100kg cinder \n",
+ "m3 = 3.5*.7 # S as SO3\n",
+ "m4 = 3.5-m3 # S as FeS2\n",
+ "m5 = 100-m3-m4 # S free cinder\n",
+ "m6 = (81.4/97.4)*17 # ZnO\n",
+ "\n",
+ "# FeS2 reacted = x\n",
+ "# (FeS2 in cinder/S free cinder) = (69-x)/(28.2+.667x) = 1.969/91.906\n",
+ "# solving this we get\n",
+ "x = 67.43 #kg\n",
+ "m7 = m6 + .667*x + 14 # S free cinder\n",
+ "m8 = 69-x # FeS2 in cinder\n",
+ "m9 = 6.125*m7/m5 # SO3\n",
+ "m10 = .667*x # Fe2O3\n",
+ "m11 = m6+m10+m8+m9+I2\n",
+ "\n",
+ "# Result\n",
+ "print \"a \"\n",
+ "print \"Total cinder produced = \",m11,\"kg \\nComposition of cinder : ZnO = \",m6,\\\n",
+ "\"kg \\nFe2O3 = \",m10,\"kg \\nS as FeS2 = \",m8,\"kg \\nS as SO3 = \",m9,\"kg \\ninerts = \",I2,\"kg \\nb \"\n",
+ "S1 = (64./120)*69 + (32./97.4)*17 #[kg] S charged to burner\n",
+ "S2 = .035*79.63 # S in cinder\n",
+ "p = S2*100/S1\n",
+ "print \"percentage of S left in cinder = \",p"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.13 Page 138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Mass of 0.5 percnt NaOH required to be added to raise the pH = 170.21 g.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables\n",
+ "m1 = 1200*1.2 #[kg] mass of reactants\n",
+ "pOH1 = 14-6 #pOH of reactants\n",
+ "pOH = 14-9 #pOH of final mass\n",
+ "# ROWs = 1/sigma(Wi/ROWsi)\n",
+ "#Ms = mass of .5% NaOH required\n",
+ "#ROWs = density of final solution\n",
+ "\n",
+ "# Calculation \n",
+ "#ROWs = 1/{((m1*10**3*1)/(((m1*10**3+Ms)*1.2)+(Ms/((m1*10**3+Ms)*1.005))} (i)\n",
+ "#balance of OH- ions\n",
+ "#1200*10**-8 +Ms*10**-1.15/(1.005*10**-5) = (1200*1.2*10**3+Ms)*10**-5/ROWs*10**-5 (ii)\n",
+ "#solving (i) and (ii)\n",
+ "Ms = 170.21 #g\n",
+ "ROWs = 1.2016 #[kg/l]\n",
+ "\n",
+ "# Result\n",
+ "print \"Mass of 0.5 percnt NaOH required to be added to raise the pH = \",Ms,\"g.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.14 Page 140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[ 1.05810000e+03 1.25000000e+00 2.12724501e+02 1.53665988e+02\n",
+ " 1.12037218e+02 8.45438500e+00 9.69022000e-01 1.93804400e+00\n",
+ " 8.52651283e-14 9.90000000e-01 1.12037218e+02 8.45438500e+00\n",
+ " 9.69022000e-01 3.09375000e-01 9.90000000e-01]\n"
+ ]
+ }
+ ],
+ "source": [
+ "from numpy import array, linalg\n",
+ "# solution \n",
+ "# Variables \n",
+ "# using equations of example 4.10\n",
+ "\n",
+ "# soving 4.10 by linear model method\n",
+ "M = array([[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [0 ,1 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,1 ,1 ,1 ,1 ,2],\n",
+ " [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, .5, 1.5, 0, -.5, 0],\n",
+ " [0 ,0 ,0 ,1 ,0 ,0, 0, 0, 0, 0, -1, -2 ,0 ,0 ,-1],\n",
+ " [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0],\n",
+ " [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0, 0],\n",
+ " [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, -2, 0, 0],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .5, 1.5, 0, -.5, 0],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -2, 0, 0, -1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2]])\n",
+ "V = array([1058.1,125,281.27,23.73,0,0,0,0,0,0,.99*125,.2437*281.27,-5.4756*23.73,.61875,1.98])\n",
+ "\n",
+ "# Calculation \n",
+ "X = linalg.lstsq(M,V)\n",
+ "\n",
+ "# Result\n",
+ "print (X[0])\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.15 Page 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Amount of Cu lberated = 6693.21656216\n",
+ "b Current efficiency of the cell = 94.872173058 percent.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables\n",
+ "# basis = 1.12 M63 O2 at NTP\n",
+ "m1 = 1.12*1000*32/22.4 #[g] O2\n",
+ "m2 = m1/8. # g eq O2\n",
+ "\n",
+ "# Calculation \n",
+ "#at cathode : Cu++ +2e = Cu\n",
+ "#at anode : SO4-- - 2e = SO4\n",
+ "eqwtCu = 63.5/2\n",
+ "depositedCu = eqwtCu*m2\n",
+ "E = (1130*18000.)/96485 #faradays Total energy passed to cell\n",
+ "libCu = (1130*18000*eqwtCu)/96485. #[g] theoritical liberation of Cu\n",
+ "eff = (depositedCu/libCu)*100. # current efficiency\n",
+ "\n",
+ "# Result\n",
+ "print \"a Amount of Cu lberated = \",libCu\n",
+ "print \"b Current efficiency of the cell = \",eff,\" percent.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.16 Page 144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Current efficiency of the cell = 95.6846807485 percent. \n",
+ "b Cl2 produced = 456.26375 kg/day H2 produced = 12.8535211268 kg/day \n",
+ "c loss of water = 627.391756664 kg/day\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis : 1day operation\n",
+ "# NaCl = Na+ + Cl-\n",
+ "#H2O = H+ + OH-\n",
+ "#Na+ + OH- = NaOH\n",
+ "#H+ + e = (1/2)H2\n",
+ "#Cl- - e = (1/2)Cl2\n",
+ "E = (15000.*3600*24)/96485 # faraday/day Total energy passed thrrough cell\n",
+ "NaOH = (15000*3600*24*40)/(96485*1000.) #[kg/day] theoretical NaOH\n",
+ "eff = (514.1/NaOH)*100 # current efficiency\n",
+ "Cl2 = (35.5/40)*514.1\n",
+ "H2 = (456.3*2)/(35.5*2)\n",
+ "\n",
+ "# Calculation \n",
+ "#40 g NaOH = 58.5g NaCl\n",
+ "consNaCl = (58.5/40)*514.1 # NaCl consumed\n",
+ "Tliquor = 514.1/.11 #[kg/day] total cell liquor\n",
+ "remNaCl = 514.1*1.4\n",
+ "totalNaCl = consNaCl+remNaCl\n",
+ "Fbrine = totalNaCl/.266 #feed rate of brine\n",
+ "consH2O = (18./40)*514.1\n",
+ "lossH2O = Fbrine-Tliquor-consH2O\n",
+ "\n",
+ "# Result\n",
+ "print \"a Current efficiency of the cell = \",eff,\n",
+ "print \" percent. \\nb Cl2 produced = \",Cl2,\n",
+ "print \" kg/day H2 produced = \",H2,\n",
+ "print \" kg/day \\nc loss of water = \",lossH2O,\" kg/day\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.17 Page 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a recycle feed rate = 338.589 kmol/s \n",
+ "b purge gas rate = 7.90009519163 kmol/s \n",
+ "c mass rate of NH3 = 779.467550624 kg/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "#M = mix feed rate, F = fresh feed rate , R = recycle stream\n",
+ "# using fig 4.3\n",
+ "# N2 balance\n",
+ "# a = 24.75M/(.25M+7.5M) (i)\n",
+ "# P = (4.15M + 17.75a)/M (ii)\n",
+ "# .585M -1.775a +(4.15M+17.75a)/M = 100 (iii)\n",
+ "#solving (i,) (ii), (iii)\n",
+ "M = 438.589 #[kmol/s] \n",
+ "\n",
+ "# Calculation \n",
+ "a = (24.75*M)/((.25*M)+7.5) #kmol/s\n",
+ "P = (4.15*438.589+17.75*92.662)/M #kmol/s\n",
+ "R = M-100 # kmol/s\n",
+ "r = R/100 # recycle ratio\n",
+ "NH3 = (.585*M-2.275*a)*17.0305 #kg/s\n",
+ "\n",
+ "# Result\n",
+ "print \"a recycle feed rate = \",R,\" kmol/s \\nb purge gas rate = \",P,\\\n",
+ "\" kmol/s \\nc mass rate of NH3 = \",NH3,\" kg/s\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.18 Page 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Mixed feed rate = 457.011 kmol/s \n",
+ "Recycle stream = 350.771 kmol/s \n",
+ "Recovered H2 stream = 6.24106025284 kmol/s \n",
+ "Fresh feed rate = 99.9989397472 kmol/s \n",
+ "Recycle ratio = 350.833411264 kmol/kmol of fresh feed.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# given\n",
+ "# (.1*M*R1)/(.415M+1.775a) + (.1125a*P)/(.415M + 1.775a) + 1 = .1M \n",
+ "# R1*(.315M-1.225a)/(.415M + 1.775a) = .9M-4a\n",
+ "# M = 100 + R1 + (2.25a*p)/(.415M + 1.775a)\n",
+ "# .1M*P/(.415M + 1.775a) - (.1125a*P)/(.415M1.775a)\n",
+ "#solving them\n",
+ "M = 457.011 # kmol/s\n",
+ "R1 = 350.771 # kmol/s\n",
+ "P = 10.368 # kmol/s\n",
+ "a = 96.608 # kmol/s\n",
+ "\n",
+ "# Calculation \n",
+ "R2 = 2.25*96.608*10.369/(.415*457.011 + 1.775*96.608) # kmol/s\n",
+ "F = M -R1 - R2\n",
+ "\n",
+ "# Result\n",
+ "print \"Mixed feed rate = \",M,\" kmol/s \\nRecycle stream = \",R1,\\\n",
+ "\" kmol/s \\nRecovered H2 stream = \",R2,\" kmol/s \\nFresh feed rate = \",F,\\\n",
+ "\" kmol/s \\nRecycle ratio = \",R1+R2/F,\" kmol/kmol of fresh feed.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.19 Page 153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "48.4197432526 percent of total raw water is passed through the H ion exchanger.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "m1 = (50/35.5)*312 #[mg/l] Cl2 expressed as equivalent CaCO3\n",
+ "m2 = (50/48)*43.2 #[mg/l] Sulphates as equivalent CaCO3\n",
+ "A = m1+m2 #[mg/l as CaCO3] EMA in raw water\n",
+ "M1 = 550. # alkalinity of raw water\n",
+ "M2 = 50. # alkalinity of blend water\n",
+ "\n",
+ "# Calculation \n",
+ "#let 100 l of raw water enters both ion exchangers\n",
+ "# balancing neutrilasion\n",
+ "x = 100.*(M1-M2)/(A+M1) # raw water inlet to H2 ion echanger\n",
+ "\n",
+ "# Result\n",
+ "print x,\" percent of total raw water is passed through the H ion exchanger.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.20 Page 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Increase in capacity = 95.8492338978 percent.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "m1 = 1488.1 #kmol/h gas mix to reactor1 (basis)\n",
+ "m2 = m1*.0625 # CH3OH\n",
+ "m3 = m1-m2 # ambient air flow\n",
+ "m4 = m3/1.01772 # dry air flow rate\n",
+ "m5 = m3-m4 # moisture\n",
+ "m6 = m2*.99 # CH3OH conversion in R1\n",
+ "m7 = m2-m6 # unreacted CH3OH\n",
+ "\n",
+ "# Calculation \n",
+ "#rxn i\n",
+ "m8 = m7*.9 # CH3OH reacted = HCHO produced = H2O produced\n",
+ "m9 = m8/2 # O2 consumed \n",
+ "m10 = m6-m8 # CH3OH reacted in rxn ii to v\n",
+ "\n",
+ "#rxn ii\n",
+ "m11 = m10*.71 # CH3OH reacted = CO2 produced\n",
+ "m12 = m11*1.5 # O2 consumed\n",
+ "m13 = 2*m11 # H2O produced\n",
+ "\n",
+ "#rxn iii\n",
+ "m14 = m10*.08 # CH3OH reacted = CO produced\n",
+ "m15 = 2*m14 # H2 produced\n",
+ "\n",
+ "#rxn iv\n",
+ "m16 = m10*.05 # Ch3OH reacted = CH4 produced\n",
+ "m17 = m16/2 # O2 produced\n",
+ "\n",
+ "#rxn v\n",
+ "m18 = m10-m16-m14-m11 # CH3OH reacted\n",
+ "m19 = m18/2 # (CH3)2O = H2O produced\n",
+ "\n",
+ "m20 = 287.87-m9-m12+m17 # O2 in R1 exit stream\n",
+ "m21 = m5+m8+m13+m19 # H2O in R1\n",
+ "m = m7+m8+m11+m14+m15+m16+m19+m20+1082.93+m21\n",
+ "\n",
+ "# R2\n",
+ "# x kmol/h CH3OH is added b/w reactors\n",
+ "# (m7+x)/(m+x) = .084 solving it\n",
+ "x = 140.548 #[kmol/h]\n",
+ "m22 = x+m7 # CH3OH entering R2\n",
+ "m23 = m22*.99 #CH3OH reacted\n",
+ "m24 = m22-m23 # CH3OH unreacted\n",
+ "\n",
+ "#rxn i\n",
+ "m25 = m23*.9 # CH3OH reacted = HCHO produced = H2O produced\n",
+ "m26 = m25/2 # O2 consumed\n",
+ "m27 = m23 - m25 # CH3OH reacted in rxn ii to v\n",
+ "\n",
+ "#rxn ii\n",
+ "m28 = m27*.71 # CH3OH reacted = CO2 produced\n",
+ "m29 = m28*1.5 # O2 consumed\n",
+ "m30 = m28*2 # H2O produced\n",
+ "\n",
+ "#rxn iii\n",
+ "m31 = m27*.08 # CH3OH reacted = CO produced\n",
+ "m32 = m31*2 # H2 produced\n",
+ "\n",
+ "#rxn iv\n",
+ "m33 = m27*.05 # Ch3OH reacted = CH4 produced\n",
+ "m34 = m33/2 # O2 produced\n",
+ "\n",
+ "#rxn v\n",
+ "m35 = m27-m28-m31-m33 # CH3OH reacted\n",
+ "m36 = m35/2 # (CH3)2O = H2O produced\n",
+ "\n",
+ "m37 = m20 - m26-m29+m34 # O2 in R2 exit stream\n",
+ "m38 = m21+m25+m36 # H2O in R2\n",
+ "m39 = 92.07+m25 # HCHO in R2\n",
+ "m40 = m24+m39+m28+m31+m32+m33+m36+m37+m38+1082.93\n",
+ "\n",
+ "m41 = m39*30 # kg/h HCHO produced\n",
+ "m42 = m41/.37 # bottom sol floe rate\n",
+ "c = (m42-9030.4)*100/9030.4 # increase in capacity\n",
+ "\n",
+ "# Result\n",
+ "print \"Increase in capacity = \",c,\" percent.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.21 Page 159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Mass of slag made = 633.285714286 kg. \n",
+ "b Mass of ore required = 1696.42857143 kg. \n",
+ "c Composition of slag : SiO2 = 273.571428571 kg Al2O3 = 135.714285714 kg CaO = 224.0 kg. \n",
+ "d Volume of air to be supplied = 3569.53115079 m**3.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 1 tonne of pig iron\n",
+ "coke = 1000. #kg\n",
+ "flux = 400. #kg\n",
+ "Fe1 = 1000*.95 # Fe in pig iron\n",
+ "\n",
+ "# Calculation and Result\n",
+ "Fe2 = (112/160.)*.8 # Fe available per kg of ore\n",
+ "ore = Fe1/Fe2 # kg\n",
+ "Si = .014*1000 #kg #Si in pig iron\n",
+ "si1 = (60/28.)*14 # silica present in pig iron\n",
+ "si2 = ore*.12 # silica in ore\n",
+ "si3 = .1*coke # silica in coke\n",
+ "si4 = si2+si3-si1 # silica in slag\n",
+ "alumina = ore*.08 # Al2O3 in ore = Al2O3 in slag\n",
+ "CaO = flux*(56/100.)\n",
+ "slag = si4+alumina+CaO\n",
+ "print \"a Mass of slag made = \",slag,\" kg. \\nb Mass of ore required = \",ore,\\\n",
+ "\" kg. \\nc Composition of slag : SiO2 = \",si4,\" kg Al2O3 = \",alumina,\" kg CaO = \",CaO,\" kg. \\nd \",\n",
+ "C = .9*coke+(12/100.)*flux-36 # total C available\n",
+ "\n",
+ "# CO:CO2 = 2:1\n",
+ "C1 = C/3 # C converted to CO2\n",
+ "C2 = 2*C/3 # C converted to CO\n",
+ "O21 = C1*(32/12.)+C2*(16./12) # O2 required for CO and CO2 formation\n",
+ "O22 = (32/28.)*Si # O2 from SiO2\n",
+ "O23 = ore*(.8*48/160) # O2 from Fe2O3\n",
+ "O24 = flux*(32/100.) # O2 from CaCO3\n",
+ "O25 = O21-O22-O23-O24 #kg O2 to be supplied\n",
+ "O26 = O25/32 #kmol\n",
+ "air = O26/.21 #kmol\n",
+ "V = air*22.414 #m**3\n",
+ "print \" Volume of air to be supplied = \",V,\" m**3.\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch5.ipynb b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch5.ipynb
new file mode 100644
index 00000000..ed249880
--- /dev/null
+++ b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch5.ipynb
@@ -0,0 +1,2722 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 5 : Energy Balances"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.1 Page 186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Increase in internal energy between the storage tank and the bottom of the well = 31.237 kW.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis pumping of 1 l/s of water\n",
+ "Hadd = 52. # kW\n",
+ "Hlost = 21. # kW\n",
+ "\n",
+ "# Calculation \n",
+ "fi = Hadd - Hlost # kW\n",
+ "p1 = 101325. # Pa\n",
+ "p2 = p1\n",
+ "Z1 = -50 # m\n",
+ "Z2 = 10 # m\n",
+ "g = 9.80665 # m/s sq\n",
+ "gc = 1 # kg.m/(N.s sq)\n",
+ "row = 1 # kg/l\n",
+ "W = 1.5*.55 # kW\n",
+ "# energy balance b/w A and B\n",
+ "# dE = E2-E1 = W + Q + (Z1-Z2)*(g/gc)*qm\n",
+ "dE = 31.237 # kW\n",
+ "\n",
+ "# Result\n",
+ "print \"Increase in internal energy between the storage tank and the bottom of the well = \",dE,\" kW.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.2 Page 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat added = 9243.82741713 kJ/kmol methane.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# using table 5.1\n",
+ "# basis 1 kmol of methane\n",
+ "T1 = 303.15 # K\n",
+ "T2 = 523.15 # K\n",
+ "\n",
+ "# Calculation \n",
+ "# using eq 5.17\n",
+ "H = 19.2494*(T2-T1) + 52.1135*10**-3*(T2**2-T1**2)/2 + \\\n",
+ "11.973*10**-6*(T2**3-T1**3)/3 - 11.3173*(T2**4-T1**4)*10**-9/4 # kJ\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat added = \",H,\" kJ/kmol methane.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.3 Page 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat added = 9430.3 kJ/kmol of methane.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 1 kmol methane at 25 bar\n",
+ "Pc = 46.04 # bar\n",
+ "Tc = 190.5 # K\n",
+ "Pr = 25/Pc\n",
+ "\n",
+ "# Calculation \n",
+ "# H-Ho = intgr(from303.15 to 523.15){CmpR dT}\n",
+ "# solving it by simpson's rule\n",
+ "HE = 255.2 # kJ/kmol\n",
+ "H = 9175.1 + HE\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat added = \",H,\" kJ/kmol of methane.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.4 Page 206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat required to be added to toulene = 26.1324337975 kW.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# using table 5.3\n",
+ "# .25 kg/s toulene heated from 290.15K to 350.15K\n",
+ "qm = .25/92 # kmol/s\n",
+ "\n",
+ "# Calculation \n",
+ "# reference 7\n",
+ "fi = 2.717*10**-3*(1.8083*(350.15-290.15) + 812.223*10**-3*(350.15**2-290.15**2)/2 \\\n",
+ " - 1512.67*10**-6*(350.15**3-290.15**3)/3 + 1630.01*10**-9*(350.15**4-290.15**4)/4)\n",
+ " \n",
+ "# Result\n",
+ "print \" Heat required to be added to toulene = \",fi,\" kW.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.5 Page 206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat required to be added = 290.8 kJ.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 1kg of 20% NaOH sol\n",
+ "# referring to fig 5.4\n",
+ "C11 = 3.56 # kJ/kg.K at 280.15K\n",
+ "C12 = 3.71 # kJ/kg.K at 360.15K\n",
+ "\n",
+ "# Calculation \n",
+ "C1m = (C11+C12)/2\n",
+ "H = 1*C1m*(360.15-280.15) # kJ\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat required to be added = \",H,\"kJ.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.6 Page 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat to be supplied = 360.066666667 kW Percent error = 8.27133892074 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 1kg Diphyl A-30\n",
+ "Q = .7511*(553.15-313.15) + 1.465*10**-3*(553.15**2-313.15**2)/2 # kJ/kg\n",
+ "fi = Q*4000 # kJ/h for mass flowrate 4000 kg/h\n",
+ "\n",
+ "# Calculation \n",
+ "Clm = (1.1807+1.5198)/2\n",
+ "fi1 = Clm*(553.15-313.15)*4000/3600. # kJ/h\n",
+ "err = (fi1-Q)*100/Q\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat to be supplied = \",fi1,\" kW Percent error = \",err,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.7 Page 208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat content of 1 kmol of gas mixture at 298K = 15016.6500785 kJ/kmol.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "T1 = 298.15 # K\n",
+ "T2 = 775.15 #K\n",
+ "\n",
+ "# Calculation \n",
+ "# using eq 5.17\n",
+ "Q = 28.839*(T2-T1)+2.0395*10**-3*(T2**2-T1**2)/2 + \\\n",
+ "6.9907*10**-6*(T2**3-T1**3)/3 - 3.2304*10**-9*(T2**4-T1**4)/4 # kJ/kmol\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat content of 1 kmol of gas mixture at 298K = \",Q,\" kJ/kmol.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.8 Page 210"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat removal rate of subcooling zone of the condenser = 1905578.44431 kJ/h.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 8000 kg/h mixture is to be cooled\n",
+ "qn1m = .118*8000 # kg/h\n",
+ "qn1 = qn1m/93.1242 # kmol/h\n",
+ "qn2m = 8000-qn1m # kg/h\n",
+ "qn2 = qn2m/18 # kmol/h\n",
+ "T1 = 373.15 #K\n",
+ "T2 = 313.15 #K\n",
+ "\n",
+ "# Calculation \n",
+ "fi = qn1*(206.27*(T1-T2)-211.5065*10**-3*(T1**2-T2**2)/2+564.2902*10**-6*(T1**3-T2**3)/3) \\\n",
+ " + qn2*(50.845*(T1-T2)+213.08*10**-3*(T1**2-T2**2)/2-631.398*10**-6*(T1**3-T2**3)/3 \\\n",
+ " +648.746*10**-9*(T1**4-T2**4)/4) # kJ/h\n",
+ " \n",
+ "# Result \n",
+ "print \" Heat removal rate of subcooling zone of the condenser = \",fi,\" kJ/h.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.9 Page 220"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " a V.P. of n-hexane at 305.15K = 0.270921991993 bar. \n",
+ "b V.P. of water at 395.15K = 1.96343968214 bar.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# (a)\n",
+ "T = 305.15 #K\n",
+ "\n",
+ "# Calculation \n",
+ "Pv1 = 10**(4.0026-(1171.530/(305.15-48.784))) # bar\n",
+ "# (b)\n",
+ "T = 395.15 \n",
+ "Pv2 = 10**(3.559-(643.748/(395.15-198.043))) # bar\n",
+ "\n",
+ "# Result\n",
+ "print \" a V.P. of n-hexane at 305.15K = \",Pv1,\\\n",
+ "\" bar. \\nb V.P. of water at 395.15K = \",Pv2,\" bar.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.10 Page 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " a Latent heat of vaporization at Tb using Riedel eq is 36944.6599382 kJ/kmol. \n",
+ "b Latent heat of vaporizaation at 298.15 K using Watson eq is 42928.2871556 kJ/kmol.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# (a)\n",
+ "Pc = 3732. # kPa\n",
+ "Tc = 630.3 # K\n",
+ "Tb = 417.6 # K\n",
+ "TBr = Tb/Tc\n",
+ "\n",
+ "# Calculation \n",
+ "lambdav = 8.314472*417.6*(1.092*(math.log(3732)-5.6182)/(.930-.6625))\n",
+ "# (b)\n",
+ "T1 = 298.15 #K\n",
+ "lambdav1 = 36240*((630.3-298.15)/(630.3-417.6))**.38\n",
+ "\n",
+ "# Result\n",
+ "print \" a Latent heat of vaporization at Tb using Riedel eq is \",lambdav,\\\n",
+ "\" kJ/kmol. \\nb Latent heat of vaporizaation at 298.15 K using Watson eq is \",\\\n",
+ "lambdav1,\" kJ/kmol.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.11 Page 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " a \n",
+ "Latent heat of vaporization at Tb using Riedel eq is 40200.030668 kJ/kmol \n",
+ "NIST eq is 38564.1849773 kJ/kmol \n",
+ "b Latent heat of vaporization at 298.15 K using Watson eq is 42946.0066334 kJ/kmol \n",
+ "NIST eq is 42479.9527916 kJ/kmol\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# (a)\n",
+ "Pc = 61.37 # bar\n",
+ "Tc = 514. #K\n",
+ "Tb = 351.4\n",
+ "P = 1 # atm\n",
+ "TBr = Tb/Tc\n",
+ "\n",
+ "# Calculation \n",
+ "# Riedel eq\n",
+ "lambdav1 = 8.314472*Tb*1.092*(math.log(6137)-5.6182)/(.930-TBr)\n",
+ "\n",
+ "# NIST eq\n",
+ "lambdav2 = 50430*math.exp(-(-.4475*TBr))*(1-TBr)**.4989\n",
+ "\n",
+ "# (b)\n",
+ "T1 = 298.15\n",
+ "TBr1 = T1/Tc\n",
+ "\n",
+ "# Watson eq\n",
+ "lambdav21 = 38563*((514-298.15)/(514-351.4))**.38\n",
+ "\n",
+ "# NIST eq\n",
+ "lambdav22 = 50430*math.exp(-(-.4475*TBr1))*(1-TBr1)**.4969\n",
+ "\n",
+ "# Result\n",
+ "print \" a \\nLatent heat of vaporization at Tb using Riedel eq is \",lambdav1,\\\n",
+ "\" kJ/kmol \\nNIST eq is \",lambdav2,\\\n",
+ "\" kJ/kmol \\nb Latent heat of vaporization at 298.15 K using Watson eq is \",lambdav21,\\\n",
+ "\" kJ/kmol \\nNIST eq is \",lambdav22,\" kJ/kmol\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.12 Page 227"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Saturation Pressure of steam at 565.15K is 76.6507315525 bar.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "# solution \n",
+ "# Variables \n",
+ "# using Appendix IV.2\n",
+ "Ps1 = 75.\n",
+ "Ps2 = 80.\n",
+ "T1 = 563.65\n",
+ "T2 = 568.12\n",
+ "T = 565.15 \n",
+ "\n",
+ "# Calculation \n",
+ "Ps = 75*math.exp((T2*(T-T1)*math.log(80./75)/(T*(T2-T1))))\n",
+ "\n",
+ "# Result\n",
+ "print \" Saturation Pressure of steam at 565.15K is \",Ps,\" bar.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.13 Page 236"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Bubble point = 321.6 K and Dew point = 329.9 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 1 kmol equimolar mix\n",
+ "npent = .5 # kmol\n",
+ "nhex = .5 # kmol\n",
+ "P = 101.325 # kPa\n",
+ "x1 = .5\n",
+ "x2 = x1\n",
+ "Ts1 = 309.2 # K\n",
+ "Ts2 = 341.9 # K\n",
+ "\n",
+ "# Calculation \n",
+ "T1 = (Ts1+Ts2)/2.\n",
+ "\n",
+ "# using these data, we get table 5.10 and 5.11\n",
+ "Tbb = 321.6 # K\n",
+ "Tdp = 329.9 # K\n",
+ "\n",
+ "# Result\n",
+ "print \" Bubble point = \",Tbb,\\\n",
+ "\" K and Dew point = \",Tdp,\" K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.14 Page 237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " The quantity of flash steam produced = 133.756324936 kg/h.\n"
+ ]
+ }
+ ],
+ "source": [
+ "from numpy import poly1d,roots\n",
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 1000 kg/h of condensate at the saturation temperature corresponding to 8 bar a\n",
+ "# using Appendix IV.2\n",
+ "H = 720.94 # kJ/kg\n",
+ "Hm = 419.06 # kJ/kg\n",
+ "\n",
+ "# Calculation \n",
+ "x = poly1d(0,'x')\n",
+ "condensate = 1000-x\n",
+ "Hcondensate1 = 1000*H\n",
+ "Hcondensate2 = condensate*419.06\n",
+ "Ht = x*2676.\n",
+ "p = Hcondensate2+Ht-Hcondensate1\n",
+ "\n",
+ "# Result\n",
+ "print \" The quantity of flash steam produced = \",roots(p)[0],\" kg/h.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.15 Page 238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Flow of vapor from he chiller = 6.50500625782 kg/s.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "from numpy import poly1d, roots\n",
+ "\n",
+ "# Variables \n",
+ "qv1 = 50. # l/s\n",
+ "qm = qv1*1.08 # kg/s\n",
+ "fi = qm*3.08*(263.15-258.15) # kW\n",
+ "lv = 384.19-168.7 # kJ/kg\n",
+ "\n",
+ "# Calculation \n",
+ "qm2 = fi/lv\n",
+ "H = 256.35 # kJ/kg\n",
+ "x = poly1d(0,'x')\n",
+ "p = H*(qm2+x) - 168.7*qm2-x*384.19\n",
+ "a = qm2+roots(p)[0]\n",
+ "\n",
+ "# Result\n",
+ "print \" Flow of vapor from he chiller = \",a,\" kg/s.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.16 Page 238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " a Recycle ratio = 0.149514564975 kg Cl2/kg fresh feed \n",
+ "b Cooling water required at interface = 0.0230689309258 kg/s after cooler = 0.152400566068 kg/s \n",
+ "c Refrigiration load of chiller = 35.1468085758 kW.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis liquifaction capacity = 0.116 kg/s\n",
+ "p1 = 101. # kPa\n",
+ "Ts1 = 239.15\n",
+ "lv1 = 288.13 # kJ/kg\n",
+ "p2 = 530. # kPa\n",
+ "Ts2 = 290.75 # K\n",
+ "lv2 = 252.93 # kJ/kg\n",
+ "\n",
+ "# Calculation \n",
+ "# referring to table 5.3 and using eq 5.21\n",
+ "H1 = -39.246*(Ts2-Ts1)+1401.223*10**-3*(Ts2**2-Ts1**2)/2-6047.226* \\\n",
+ "10**-6*(Ts2**3-Ts1**3)/3+8591.4*10**-9*(Ts2**4-Ts1**4)/4 # kJ/kmol\n",
+ "T3 = 313.15\n",
+ "H2 = (28.5463*(T3-Ts1)+23.8795*10**-3*(T3**2-Ts1**2)/2-21.3631* \\\n",
+ "10**-6*(T3**3-Ts1**3)/3+6.4726*10**-9*(T3**4-Ts1**4)/4)/70.903 # kJ/kg\n",
+ "fi2 = .116*H2\n",
+ "Cl2evp = fi2/lv1 # kg/s\n",
+ "Cl2recy = Cl2evp/(1-.185)\n",
+ "R = Cl2recy/.116 # kg/kg fresh feed\n",
+ "\n",
+ "# T4/T1 = (p2/p1)**[(gamma-1)/gamma]\n",
+ "gm = 1.355\n",
+ "p22 = 326.3\n",
+ "p21 = 101.\n",
+ "T4 = Ts1*(p2/p1)**((gm-1)/gm)\n",
+ "T5 = 313.15\n",
+ "fi3 = 1.88*10**-3*(343.1+91.6-26.2+2.5) # kW\n",
+ "Fwater1 = fi3/(8*4.1868) # kg/s\n",
+ "\n",
+ "# similarly\n",
+ "T6 = 379.9\n",
+ "fi4 = 1.88*10**-3*(28.5463*(T6-T5)+23.8795*10**-3*(T6**2-T5**2)/2-21.3631 \\\n",
+ "*10**-6*(T6**3-T5**3)/3+6.4726*10**-9*(T6**4-T5**4)/4) # kW\n",
+ "Fwater2 = fi4/(8*4.1868) # kg/s\n",
+ "Wreq = Fwater1+Fwater2\n",
+ "fi5 = 1.88*10**-3*(28.5463*(T5-Ts2)+23.8795*10**-3* \\\n",
+ "(T5**2-Ts2**2)/2-21.3631*10**-6*(T5**3-Ts2**3)/3+6.4726 \\\n",
+ "*10**-9*(T5**4-Ts2**4)/4) +.1333*252.93 # kW\n",
+ "\n",
+ "# Result\n",
+ "print \" a Recycle ratio = \",R,\" kg Cl2/kg fresh feed \\nb Cooling water required at interface = \"\\\n",
+ ",Fwater1,\" kg/s after cooler = \",Wreq,\" kg/s \\nc Refrigiration load of chiller = \",fi5,\" kW.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.17 Page 242"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Quantity of eutectic mixture condensed = 39.7117062542 kg per 100 kg of tin melted at its melting point.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100 kg of tin\n",
+ "T1 = 303.15\n",
+ "T2 = 505.15\n",
+ "n = 100/118.7 # kmol\n",
+ "\n",
+ "# Calculation \n",
+ "# Q1 = n*[intgr from T1 to T2 (Cms dT)]\n",
+ "Q1 = 4973.3 # kJ\n",
+ "lf = 7201.\n",
+ "Q2 = n*lf # kJ\n",
+ "Q = Q1+Q2\n",
+ "lv = 278. # kJ/kg\n",
+ "vp = Q/lv # kg\n",
+ "\n",
+ "# Result\n",
+ "print \" Quantity of eutectic mixture condensed = \",vp,\\\n",
+ "\" kg per 100 kg of tin melted at its melting point.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.18 Page 243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " total time required = 42.2249688079 hrs.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "Ts1 = (438.2+436)/2.\n",
+ "Ta = 300.\n",
+ "\n",
+ "# Calculation \n",
+ "fi1 = .045*(Ts1-Ta)*3600.\n",
+ "theta1 = 307293/fi1 #h\n",
+ "Ts2 = (436+434)/2.\n",
+ "fi2 = .045*(Ts2-Ta)*3600.\n",
+ "theta2 = 302415./fi2\n",
+ "Ts3 = (434+432.1)/2\n",
+ "fi3 = .045*(Ts3-Ta)*3600.\n",
+ "theta3 = 313859/fi3\n",
+ "theta = theta1+theta2+theta3\n",
+ "\n",
+ "# Result\n",
+ "print \" total time required = \",theta,\" hrs.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.19 Page 245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Yield of dry ice = 89.8658011815 kg. \n",
+ "b Percent liquifaction = 71.2505768343 . \n",
+ "c Temp of vented gas = 262.15 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "from numpy import poly1d, roots\n",
+ "\n",
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "H1 = 482.9 # kJ/kg\n",
+ "H2 = 273.4\n",
+ "fi1 = 100*(H1-H2) # kJ/h\n",
+ "T1 = 313.15\n",
+ "T2 = 403.15\n",
+ "\n",
+ "# Calculation \n",
+ "fi11 = 21.3655*(T2-T1)+64.2841*10**-3*(T2**2-T1**2)/2-41.0506*10**-6 \\\n",
+ "*(T2**3-T1**3)/3+9.7999*10**-9*(T2**4-T1**4)/4 # kJ/h\n",
+ "\n",
+ "# at 20 MPa\n",
+ "h1 = 211.1\n",
+ "Ts = 277.6\n",
+ "H11 = 427.8\n",
+ "x = poly1d(0,'x')\n",
+ "p = x*h1+(100-x)*H11-100*H2\n",
+ "a = roots(p)[0]\n",
+ "fi2 = (100-a)*(H11-h1) # kJ/h\n",
+ "h2 = -148.39\n",
+ "H3 = 422.61\n",
+ "y = poly1d(0,'y')\n",
+ "p1 = 100*176.18-(100-y)*H3+h2*y\n",
+ "b = roots(p1)[0]\n",
+ "fi3 = 100*(h1-176.8)\n",
+ "H = fi3+24021 \n",
+ "H4 = H/(100-43.16)\n",
+ "# from ref 23\n",
+ "T = 262.15\n",
+ "\n",
+ "# Result\n",
+ "print \"a Yield of dry ice = \",b,\\\n",
+ "\" kg. \\nb Percent liquifaction = \",a,\\\n",
+ "\". \\nc Temp of vented gas = \",T,\" K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.20 Page 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Amount of steam produced = 353.569213147 kg/h.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 200 kg/h of Sulphur firing\n",
+ "F = 200./32 # kmol/h\n",
+ "O2req = 6.25*1.1\n",
+ "airin = O2req/.21\n",
+ "\n",
+ "# Calculation \n",
+ "N2in = airin-O2req\n",
+ "T1 = 1144.15\n",
+ "T2 = 463.15\n",
+ "fi = 788852.2 # kJ/h\n",
+ "H = 15*4.1868+1945.2\n",
+ "qm = fi*.9/2008 # kg/h\n",
+ "\n",
+ "# Result\n",
+ "print \" Amount of steam produced = \",qm,\" kg/h.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.21 Page 248"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " a H = 4370.454066 kJ/kmol b H = 33019.341801 kJ/kmol\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# enthalpy at Tbb\n",
+ "Tbb = 321.6\n",
+ "T1 = 298.15\n",
+ "\n",
+ "# Calculation \n",
+ "H1 = 65.4961*(Tbb-T1)+628.628*10**-3*(Tbb**2-T1**2)/2-1898.8*10**-6*(Tbb**3-T1**3)/3 \\\n",
+ "+3186.51*10**-9*(Tbb**4-T1**4)/4 # kJ/kmol\n",
+ "H2 = 31.421*(Tbb-T1)+976.058*10**-3*(Tbb**2-T1**2)/2-2353.68* \\\n",
+ "10**-6*(Tbb**3-T1**3)/3+3092.73*10**-9*(Tbb**4-T1**4)/4 # kJ/kmol\n",
+ "Hsol = (H1+H2)/2 # kJ/kmol\n",
+ "\n",
+ "# enthalpy at Tdp\n",
+ "lv1 = 25790*((469.7-329.9)/(469.7-309.2))**.38\n",
+ "lv2 = 28850*((507.6-329.9)/(507.6-341.9))**.38\n",
+ "Tdp = 329.9\n",
+ "H21ig = 65.4961*(Tdp-T1)+628.628*10**-3*(Tdp**2-T1**2)/2-1898.8*10**-6* \\\n",
+ "(Tdp**3-T1**3)/3+3186.51*10**-9*(Tdp**4-T1**4)/4 + lv1 # kJ/kmol\n",
+ "H22ig = 31.421*(Tdp-T1)+976.058*10**-3*(Tdp**2-T1**2)/2-2353.68* \\\n",
+ "10**-6*(Tdp**3-T1**3)/3+3092.73*10**-9*(Tdp**4-T1**4)/4 +lv2 # kJ/kmol\n",
+ "Hmixig = (H21ig+H22ig)/2\n",
+ "\n",
+ "# Result\n",
+ "print \" a H = \",Hsol,\" kJ/kmol b H = \",Hmixig,\" kJ/kmol\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.22 Page 252"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enthalpy of vapor-liquid mixture after flashing = 23529.2 kJ/mol.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "H1 = 23549. #kJ/kmol\n",
+ "H2 = 16325.\n",
+ "H3 = 28332.\n",
+ "\n",
+ "# Calculation \n",
+ "H4 = .4*H2+.6*H3\n",
+ "\n",
+ "# Result\n",
+ "print \"Enthalpy of vapor-liquid mixture after flashing = \",H4,\" kJ/mol.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.23 Page 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Purity of product H2 stream = 91.5733341399 percent.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables\n",
+ "# basis feed gas = 12000 Nm**3 = 535.4 kmol/h\n",
+ "T1 = 147.65 # K\n",
+ "n1 = 535.4*.3156 # kmol/h HP tail gas stream\n",
+ "T = 118.5 # K\n",
+ "\n",
+ "# Calculation \n",
+ "n2 = (535.4-n1)*.0602 # kmol/h LP tail stream\n",
+ "n3 = 535.4-n2-n1 # kmol/h product H2 stream\n",
+ "p = 315.35*100/n3\n",
+ "\n",
+ "# Result\n",
+ "print \" Purity of product H2 stream = \",p,\" percent.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.24 Page 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " a Refrigiration requirement = 170787.7 kJ/h b Refrigiration requirement based on real enthalpies = 61756.688 kJ/h.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# fi1 = integr (from 304.15 to 313.15) {11831.6+24997.4*10T**-3-5979.8*10**-6T**2-31.7*10**-9T3}dt\n",
+ "fi1 = 170787.7 # kJ/h\n",
+ "\n",
+ "# Calculation \n",
+ "fi2 = 535.4*12086 - (344.36*8743.2+168.97*18036+22.07*15892) # kJ/h\n",
+ "\n",
+ "# Result\n",
+ "print \" a Refrigiration requirement = \",fi1,\\\n",
+ "\" kJ/h b Refrigiration requirement based on real enthalpies = \",fi2,\" kJ/h.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.25 Page 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Liquid product stream = 89.669 kmol/h Vapor product stream = 50.331 kmol/h\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100 kmol/h of benzene feed rate\n",
+ "Cl2 = .4*100\n",
+ "HClp = 40.\n",
+ "Benzenecon = 37.\n",
+ "MCBp = 100*.37*.9189\n",
+ "\n",
+ "# Calculation \n",
+ "DCBp = Benzenecon-MCBp\n",
+ "unreactBenzene = 100-Benzenecon\n",
+ "Nt = HClp + MCBp + DCBp + unreactBenzene\n",
+ "# using eq xi = Ni/(L(1-K1)+NtKi) and sigma xi = 1\n",
+ "L = 89.669 # kmol/h\n",
+ "V = Nt - L\n",
+ "\n",
+ "# Result\n",
+ "print \" Liquid product stream = \",L,\" kmol/h Vapor product stream = \",V,\" kmol/h\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.26 Page 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat of formation of Ethylene is 52.44 kJ/mol.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# 2C + 2O2 = 2CO2 A\n",
+ "# 2H2 + O2 = 2H2O B\n",
+ "# C2H4 + 3O2 = 2CO2 + 2H2O C\n",
+ "# A+B-C gives\n",
+ "# 2C(g) + 2H2 = C2H4(g) D\n",
+ "\n",
+ "# Calculation \n",
+ "H = -2*393.51-2*241.82+1323.1 # kJ/mol\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat of formation of Ethylene is \",H,\" kJ/mol.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.27 Page 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat of combustion of ethyl mercaptan = -2172.891 kJ/mol.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Calculation \n",
+ "\n",
+ "Hc = 2*(-393.51)-887.811+2*(-285.83)-(-73.6+0) #kJ/mol\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat of combustion of ethyl mercaptan = \",Hc,\" kJ/mol.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.28 Page 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat of formation of liquid di ethyl ether = -279.292123302 kJ/mol.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "lv1 = 26694. # kj/kmol\n",
+ "Tc = 466.74\n",
+ "\n",
+ "# Calculation \n",
+ "lv2 = lv1*((Tc-298.15)/(Tc-307.7))**.38/1000 # kJ/mol\n",
+ "Hf = -252. # kJ/mol\n",
+ "Hf1 = Hf-lv2 # kJ/kmol\n",
+ "\n",
+ "# Result\n",
+ "print \"Heat of formation of liquid di ethyl ether = \",Hf1,\" kJ/mol.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.29 Page 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat of formation of motor spirit = -2085.0 kJ/kg.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 1 kg motor spirit\n",
+ "G = 141.5/(131.5+64)\n",
+ "\n",
+ "# Calculation \n",
+ "# r = C/H\n",
+ "r = (74.+15*G)/(26-15*G)\n",
+ "C = r/6.605 # C content of motor spirit\n",
+ "H2 = 1-C\n",
+ "O2req = C+H2\n",
+ "Hf = 44050-27829-18306. # kJ/kg\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat of formation of motor spirit = \",Hf,\" kJ/kg.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.30 Page 267"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Mean heat capacity between 600K and 298.15 K is 173.433824747 kJ/kmol K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "# basis 1 kmol of styrene\n",
+ "dH = 241749-189398. # kJ/mol\n",
+ "\n",
+ "# Calculation \n",
+ "Cmpn = dH/(600-298.15) # kJ/kmol K\n",
+ "\n",
+ "# Result\n",
+ "print \" Mean heat capacity between 600K and 298.15 K is \",Cmpn,\" kJ/kmol K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.31 Page 269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat of reaction = 1432.17 kJ/mol SiO2.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Calculation \n",
+ "# basis 1 mol of SiO2 reacted\n",
+ "Hf = (-2879+3*(-296.81)+3*0/2)-(3*(-1432.7)+1*(-903.5)) # kJ/mol SiO2\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat of reaction = \",Hf,\" kJ/mol SiO2.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.32 Page 269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " heat of reaction = 3456.15219753 kJ/100 kg solution.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100 kg of 2% ammonia solution\n",
+ "NH3 = 2. # kg\n",
+ "H2O = 98. # kg\n",
+ "\n",
+ "# Calculation \n",
+ "Hr = -361.2-(-45.94-285.83) # kJ/mol NH3 dissolved\n",
+ "Hd = -(Hr*2*1000/17.0305) # kJ/100 kg sol.\n",
+ "\n",
+ "# Result\n",
+ "print \" heat of reaction = \",Hd,\" kJ/100 kg solution.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.33 Page 272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat of reaction at 775K is 93855.2952943 kJ/kmol.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 1 kmol of SO2 reacted\n",
+ "a = 22.036-24.771-.5*(26.026)\n",
+ "b = (121.624-62.948-.5*11.755)\n",
+ "c = (-91.876+44.258-.5*(-2.343))\n",
+ "d = (24.369-11.122-.5*(-.562))\n",
+ "Hr = -395720+296810. # kJ/kmol\n",
+ "\n",
+ "# Calculation \n",
+ "Hro = Hr-a*298.15-b*10**-3*298.15**2/2-c*10**-6*298.15**3/3-d*10**-9*298.15**4/4.\n",
+ "T = 778.15\n",
+ "Hrt = -Hro-15.748*T+26.4*10**-3*T**2-15.48*10**-6*T**3+3.382*10**-9*T**4\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat of reaction at 775K is \",Hrt,\" kJ/kmol.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.34 Page 272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat of reaction at 373 K is -6441.65717017 kJ/kmol reactant.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Calculation\n",
+ "Hr = -480-285.83+277.2+484.2 # kJ/mol\n",
+ "Hrt1 = Hr*1000 + (146.89+75.76-119.55-129.70)*75 # kJ/kmol \n",
+ "a = 4.2905+50.845-100.92-155.48\n",
+ "b = 934.378+213.08+111.8386+326.5951\n",
+ "c = -2640-631.398-498.54-744.199\n",
+ "d = 3342.58+648.746\n",
+ "Hro = Hr*1000+a*(-298.15)+b*10**-3*(-298.15**2)/2+ \\\n",
+ "c*10**-6*(-298.15**3)/3+d*10**-9*(-298.15**4)/4\n",
+ "T = 373.15\n",
+ "Hrt = Hro+a*T+792.949*10**-3*T**2-1504.712*10**-6*T**3+997.832*10**-9*T**4\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat of reaction at 373 K is \",Hrt,\" kJ/kmol reactant.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.35 Page 273"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Net enthalpy change = -178.010235047 kW.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "T2 = 800.\n",
+ "T1 = 298.15\n",
+ "\n",
+ "# Calculation \n",
+ "fi1 = 3614.577*(T2-T1)+305.561*10**-3*(T2**2-T2**2)/2+836.881*10**-6*(T2**3-T1**3)/3-393.707*10**-9*(T2**4-T1**4)/4 # kW\n",
+ "T3 = 875.\n",
+ "fi2 = 3480.737*(T3-T1)+754.347*10**-3*(T3**2-T2**2)/2+442.159*10**-6*(T3**3-T1**3)/3-278.735*10**-9*(T3**4-T1**4)/4 # kW\n",
+ "Hr = -98910. # kJ/kmol SO2 reacted by eg 5.33\n",
+ "fi3 = (8.8511-.351)*Hr/3600. # kW\n",
+ "dH = fi2/3600+fi3-fi1/3600.\n",
+ "\n",
+ "# Result\n",
+ "print \" Net enthalpy change = \",dH,\" kW.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.36 Page 275"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat of reaction = -605.80005705 kJ/kmol total reactants.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100 kmol outgoing gas mixture from scrubber\n",
+ "moistin = 3127.7*.015/18 # kmol\n",
+ "waterin = 40.2+moistin # kmol\n",
+ "\n",
+ "\n",
+ "# Calculation \n",
+ "# using tables 5.29 and 5.30\n",
+ "Hr = -27002658-(-26853359.)\n",
+ "Hr1 = Hr/246.4493 # kJ/kmol total reactants\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat of reaction = \",Hr1,\" kJ/kmol total reactants.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.37 Page 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Downtherm circulation rate = 57837.7819041 kg/h.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "fi3 = 15505407. # kJ/h\n",
+ "lv = 296.2 # from table 5.6\n",
+ "Ht = 17131551. # kJ/h\n",
+ "\n",
+ "# Calculation \n",
+ "r = Ht/lv # kg/h\n",
+ "\n",
+ "# Result\n",
+ "print \" Downtherm circulation rate = \",r,\" kg/h.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.38 Page 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Compositions of gas streams : \n",
+ "Component Stream 3 Stream 5 Stream 4 Stream 6 \n",
+ " Cl2 10.802 10.802\n",
+ " HCl 0.198 0.198\n",
+ " C2H4 1 1\n",
+ " EDC 3.6264582115 0.2355 3.3947 98.5665\n",
+ " TEC 0.00246937055797 Nil 0.00246937055797 0.198\n",
+ " Heavy duty of Overhead condenser = 157524.3947 kJ/h. \n",
+ " Heavy duty of external cooler = 21095870.3588 kJ/h.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "F = 100. # kmol/h feed rate of ethylene\n",
+ "Econ = .99*F\n",
+ "\n",
+ "\n",
+ "# Calculation and Result\n",
+ "Econ1 = Econ*.998\n",
+ "Econ2 = Econ-Econ1\n",
+ "Cl2con = Econ1+2*Econ2\n",
+ "Cl2in = F*1.1\n",
+ "Cl2s3 = Cl2in-Cl2con\n",
+ "HCls3 = Econ2\n",
+ "TCEp = Econ2\n",
+ "EDCp = Econ1\n",
+ "nC2H4 = 1\n",
+ "T = 328.15\n",
+ "pv1 = math.exp(4.58518-1521.789/(T-24.67)) # bar\n",
+ "pv2 = math.exp(4.06974-1310.297/(T-64.41)) # bar\n",
+ "xEDC = Econ1/(Econ1+Econ2)\n",
+ "xTEC = 1-xEDC\n",
+ "pEDC = 37.2*xEDC\n",
+ "pTEC = 12.64*xTEC\n",
+ "pCl2HClC2H4 = 1.6*100-pEDC-pTEC\n",
+ "yEDC = pEDC/160\n",
+ "yTEC = pTEC/160\n",
+ "nt = (Cl2s3+Econ2+1)*160/pCl2HClC2H4\n",
+ "nEDC = yEDC*nt\n",
+ "nTEC = yTEC*nt\n",
+ "print \" Compositions of gas streams : \"\n",
+ "print \"Component Stream 3 Stream 5 Stream 4 Stream 6 \"\n",
+ "print \" Cl2 \",Cl2s3,\" \",Cl2s3\n",
+ "print \" HCl \",HCls3,\" \",HCls3\n",
+ "print \" C2H4 \",nC2H4,\" \",nC2H4\n",
+ "print \" EDC \",nEDC,\" 0.2355 3.3947 98.5665\"\n",
+ "print \" TEC \",nTEC,\" Nil \",nTEC,\" \",TCEp\n",
+ "fi1 = (10.802*33.9+.198*29.1+1*43.6+3.6302*17.4+.0025*85.3)*(328.15-273.15)\n",
+ "fi2 = 35.053*1000*3.3947+39.58*1000*.0025\n",
+ "fi3 = (3.3947*129.4+.0025*144.4)*55/2\n",
+ "fi = fi1+ fi2+ fi3 # kJ/h\n",
+ "print \" Heavy duty of Overhead condenser = \",fi,\" kJ/h. \"\n",
+ "fi5 = (100*43.6+110*33.9)*(328.15-273.15)\n",
+ "fi6 = 3.6302*1000*33.6+.0025*1000*38.166\n",
+ "fi7 = (98.5665*129.4+.1988*144.4)*(328.15-273.15)\n",
+ "fi8 = 216845.5*98.802+392394.5*.198\n",
+ "ficol = fi5+fi8-fi1-fi6-fi7\n",
+ "print \" Heavy duty of external cooler = \",ficol,\" kJ/h.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.39 Page 284"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Temperature of the gas mixture leaving the reactor = 657.41 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "To = 298.15\n",
+ "T1 = 483.15\n",
+ "\n",
+ "# Calculation \n",
+ "# fi1 = intgr(from To to T1){12199.5+2241.4*10**-3*T+1557.7*10**-6*T**2-671.3*10**-9*T**3}dT\n",
+ "fi1 = 2455874.6 # kJ/h\n",
+ "dHr = 2*(-45.94) # kJ/mol N2 reacted\n",
+ "fi2 = 91.88*1000*23.168\n",
+ "fi3 = fi1+fi2\n",
+ "# fi3 = intgr(from To to T2){10713.9+3841*10**-3*T+1278.8*10**-6*T**2-752.6*10**-9*T**3}dT \n",
+ "# solving it\n",
+ "T2 = 657.41 # K\n",
+ "\n",
+ "# Result\n",
+ "print \"Temperature of the gas mixture leaving the reactor = \",T2,\" K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.40 Page 292"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 40,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " a) Composition of dry product gas stream : \n",
+ " Component Dry product gas stream,kmol\n",
+ " HCl 0.8\n",
+ " O2 0.55\n",
+ " Cl2 1.6\n",
+ " H2O 1.6\n",
+ " N2 5.07857142857\n",
+ "b) \n",
+ " Adiabatic reaction temperature of product gas stream = 599.5 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 4 kmol of HCl gas\n",
+ "O2req = 1. # kmol\n",
+ "O2spply = 1.35*1\n",
+ "\n",
+ "# Calculation \n",
+ "N2 = 1.35*79/21.\n",
+ "air = O2spply+N2\n",
+ "HClbrnt = .8*4\n",
+ "HCl = 4-HClbrnt\n",
+ "O2 = O2spply-.8\n",
+ "Cl2 = .8*2\n",
+ "H2O = .8*2\n",
+ "\n",
+ "# Result\n",
+ "print \" a) Composition of dry product gas stream : \"\n",
+ "print \" Component Dry product gas stream,kmol\"\n",
+ "print \" HCl \",HCl\n",
+ "print \" O2 \",O2\n",
+ "print \" Cl2 \",Cl2\n",
+ "print \" H2O \",H2O\n",
+ "print \" N2 \",N2\n",
+ "print \"b) \"\n",
+ "H2 = 114.4*1000*.8\n",
+ "# H2 = intgr(from 298.15 to T){286.554+12.596*10**-3*T+63.246*10**-6*T**2-25.933*10**-9*T**3}dT\n",
+ "# solving it\n",
+ "T = 599.5 # K\n",
+ "print \" Adiabatic reaction temperature of product gas stream = \",T,\" K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.41 Page 294"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 41,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Adiabatic reaction T at the outlet of the reactor is 798.79 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# 1 kmol of EB vapors entering the reactor at 811.15 K\n",
+ "# (from 811.15 to T1)intgr{-36.72+671.12*10**-3*T-422.02*10**-6*T**2+101.15*10**-9*T**3}dT = (from T1 to 978.15)intgr{487.38+1.19*10**-3*T+198.16*10**-6*T**2-68.21*10**-9*T**3}dT\n",
+ "# we get\n",
+ "T1 = 929.72 # K\n",
+ "To = 298.15\n",
+ "H1 = 493405. # kJ\n",
+ "EBr = .35\n",
+ "\n",
+ "# Calculation \n",
+ "Styrenep = EBr*.9\n",
+ "Benzeneb = EBr*.03\n",
+ "Ethyleneb = Benzeneb\n",
+ "Cb = EBr*.01\n",
+ "Toulened = EBr*.06\n",
+ "Hr1 = 147.36-29.92 # kJ/mol EB\n",
+ "Hr2 = 82.93+52.5-29.92\n",
+ "Hr3 = -29.92\n",
+ "Hr4 = 50.17-74.52-147.36 # kJ/mol styrene\n",
+ "dHr = 1000*(Hr1*(Styrenep+Toulened)+Hr2*Benzeneb+Hr3*Cb+Hr4*Toulened)\n",
+ "H2 = H1-dHr\n",
+ "\n",
+ "# H2 = (from To t0 T2)intgr{Comp2dT\n",
+ "# we get\n",
+ "\n",
+ "T2 = 798.79 # K\n",
+ "\n",
+ "# Result\n",
+ "print \" Adiabatic reaction T at the outlet of the reactor is \",T2,\" K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.42 Page 297"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 62,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat of crystallization of 1 kg crystal is 219.681597979 kJ.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "Hsol = 62.86 # kJ/mol solute\n",
+ "Mcrystal = 286.1414\n",
+ "\n",
+ "# Calculation \n",
+ "Hcry = Hsol*1000/Mcrystal # kJ/kg solute\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat of crystallization of 1 kg crystal is \",Hcry,\" kJ.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.43 Page 297"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 43,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat of crystallization = -81.98 kJ/mol.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "Hf = -285.82 # kJ/mol of H2O\n",
+ "\n",
+ "# Calculation \n",
+ "Hcryst = -4327.26-(-1387.08+10*Hf)\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat of crystallization = \",Hcryst,\" kJ/mol.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.44 Page 297"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat of solution of Boric acid = 22.01 kJ/mol.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "Hfs = -1094.33\n",
+ "Hfao = -1072.32\n",
+ "\n",
+ "# Calculation \n",
+ "Hsol = Hfao-Hfs\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat of solution of Boric acid = \",Hsol,\" kJ/mol.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.45 Page 297"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " a Hdissolulition = -71.104 kJ/mol ZnSO4. b Hsolution = 23.036 kJ/kmol.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# (a)\n",
+ "Hf = -982.8\n",
+ "Hfcryst = -1053.904\n",
+ "\n",
+ "# Calculation \n",
+ "Hdis = Hfcryst-Hf\n",
+ "# (b)\n",
+ "Hfcr = -3077.75\n",
+ "Hsol = Hfcryst+7*(-285.83)-(-3077.75)\n",
+ "\n",
+ "# Result\n",
+ "print \" a Hdissolulition = \",Hdis,\" kJ/mol ZnSO4. b Hsolution = \",Hsol,\" kJ/kmol.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.46 Page 300"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 46,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " T = 329.5 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# using chart 5.16 we get\n",
+ "T = 329.5 # K\n",
+ "\n",
+ "# Result\n",
+ "print \" T = \",T,\" K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.47 Page 300"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 47,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Final sol T = 336.930679731 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100(m1) kg 46% sol\n",
+ "NaOH = 46. # kg\n",
+ "H2O = 54. # kg\n",
+ "\n",
+ "# Calculation \n",
+ "m2 = NaOH/.25\n",
+ "NaOHo = 25. # kg\n",
+ "H2Oo = 75. # kg\n",
+ "Hf1 = -453.138 # kJ/mol\n",
+ "Hf2 = -467.678 # kJ/mol\n",
+ "Hs = Hf2-Hf1\n",
+ "Hg = -Hs*1000*1.501\n",
+ "\n",
+ "# using Appendix IV.1\n",
+ "Hw1 = 146.65\n",
+ "Hw2 = 104.9\n",
+ "Hadd = 84*(Hw1-Hw2)\n",
+ "H = Hg+Hadd\n",
+ "C1 = 3.55\n",
+ "T2 = 298.15+H/(184*C1) # K\n",
+ "\n",
+ "# Result\n",
+ "print \" Final sol T = \",T2,\" K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.48 Page 301"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 48,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat effect of the sol = 10388.7187316 kJ.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100 kg of sol with 32% N\n",
+ "MNH4NO3 = 80.0434\n",
+ "MNH2CONO2 = 60.0553\n",
+ "MN2 = 28.0134\n",
+ "\n",
+ "# Calculation \n",
+ "na = 32/(60.9516)\n",
+ "Ureadis = 1.1758*na*MNH2CONO2 # kg\n",
+ "water = 100-(na*MNH4NO3+Ureadis)\n",
+ "ndis = 525.\n",
+ "m = ndis/water\n",
+ "HE1 = 40.3044-2.5962*m+.1582*m**2-3.4782*10**-3*m**3\n",
+ "HE = HE1*ndis\n",
+ "\n",
+ "# Result\n",
+ "print \"Heat effect of the sol = \",HE,\" kJ.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.49 Page 302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 49,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Integral heat of sol of n-amyl alcohol = 19.3203381059 kJ/kg n-amyl alcohol and of benzene = 24.2857917277 kJ/kg benzene.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "Hmix = 896.\n",
+ "M1 = 88. # molar mass of n-amyl alcohol\n",
+ "M2 = 78. # molar mass of benzene\n",
+ "\n",
+ "# Calculation \n",
+ "B = .473*M2\n",
+ "A = .527*M1\n",
+ "Ha = Hmix/A\n",
+ "Hb = Hmix/B\n",
+ "\n",
+ "# Result\n",
+ "print \" Integral heat of sol of n-amyl alcohol = \",Ha,\\\n",
+ "\" kJ/kg n-amyl alcohol and of benzene = \",Hb,\" kJ/kg benzene.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.50 Page 302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 50,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Resultant T of 77 percent sol = 379.5 K. \n",
+ "b Heat to be removed to cool it to 298.15 K = -167.5 kJ/kg sol \n",
+ "c By mean heat capacity method : 166.7675 kJ/kg sol \n",
+ "d Quantity of 15 percent acid to be mixed = 25.8064516129 kg. \n",
+ "e from fig : 25.3 kg.\n"
+ ]
+ }
+ ],
+ "source": [
+ "from numpy import poly1d, roots\n",
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# from fig 5.18\n",
+ "Ta = 379.5 # K\n",
+ "dH = -274-(-106.5) # kJ/kg sol\n",
+ "Cm = 2.05 # kJ/kg K\n",
+ "dHc = Cm*(Ta-298.15)\n",
+ "\n",
+ "# Calculation \n",
+ "# basis 100 kg of 93 % acid\n",
+ "# acid balance \n",
+ "x = poly1d(0,'x')\n",
+ "p = .93*100+x*.15-(100+x)*.77\n",
+ "y = roots(p)[0]\n",
+ "\n",
+ "#from fig\n",
+ "y1 = 25.3\n",
+ "\n",
+ "# Result\n",
+ "print \"a Resultant T of 77 percent sol = \",Ta, \\\n",
+ "\" K. \\nb Heat to be removed to cool it to 298.15 K = \",dH,\\\n",
+ "\" kJ/kg sol \\nc By mean heat capacity method : \",dHc,\\\n",
+ "\" kJ/kg sol \\nd Quantity of 15 percent acid to be mixed = \",y,\\\n",
+ "\" kg. \\ne from fig : \",y1,\" kg.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.51 Page 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 51,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Temp of sol = 363.832345186 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100 kg of 93% acid and 25.8 kg of 15% acid\n",
+ "Hfp = -814.\n",
+ "Hf1 = -830.\n",
+ "HE1 = Hf1-Hfp\n",
+ "Hf2 = -886.2\n",
+ "HE2 = Hf2-Hfp\n",
+ "Hf3 = -851.\n",
+ "HE3 = Hf3-Hfp\n",
+ "\n",
+ "# Calculation \n",
+ "Hsol = .9876*1000*(-37)-(.9482*1000*(-16)+.0394*1000*(-72.2))\n",
+ "Hev = 100*(30-25)*1.6\n",
+ "Hcon = 25.8*25*3.7\n",
+ "netHev = -Hsol-Hcon+Hev\n",
+ "T = 298.15+netHev/(125.8*2.05)\n",
+ "\n",
+ "# Result\n",
+ "print \" Temp of sol = \",T,\" K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.52 Page 306"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat of mixing = -74878.72 kJ.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 1000 kg of mixed acid\n",
+ "C11 = 2.45\n",
+ "\n",
+ "# Calculation \n",
+ "H1 = -296.7+C11*(308.15-273.15)\n",
+ "C12 = 2.2\n",
+ "H2 = -87.8+C12*(308.15-273.15)\n",
+ "C13 = 1.45\n",
+ "H3 = -35.5+C13*(308.15-273.15)\n",
+ "C14 = 1.8\n",
+ "H4 = -148.9+C14*(308.15-273.15)\n",
+ "Hmix = 1000*H4-(76.3*H1+345.9*H2+577.7*H3)\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat of mixing = \",Hmix,\" kJ.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.53 Page 308"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 53,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Total heat exchanged = -796777.546799 kJ/h.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "F = 1135.\n",
+ "Benzenef = 400*.993\n",
+ "\n",
+ "# Calculation \n",
+ "HNO3con = Benzenef*63/78.\n",
+ "H1 = -186.5\n",
+ "C11 = 1.88\n",
+ "H11 = H1+C11*(298.15-273.15)\n",
+ "H2 = -288.9\n",
+ "C12 = 1.96\n",
+ "H22 = H2+C12*(298.15-273.15)\n",
+ "H3 = 0\n",
+ "C13 = 1.98\n",
+ "H33 = C13*(298.15-273.15)\n",
+ "Hr = -285.83+12.5-(-174.1+49.08)\n",
+ "Benzener = Benzenef/78.1118\n",
+ "fi = 903.84*H22+HNO3con*H33-F*H11+Benzener*Hr*1000 # kJ/h\n",
+ "\n",
+ "# Result\n",
+ "print \" Total heat exchanged = \",fi,\" kJ/h.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.54 Page 311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 54,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Temp of resultant sol = 373.525565624 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# from ref 24\n",
+ "H = 1600.83\n",
+ "To = 273.15\n",
+ "h = 200.\n",
+ "Hf1 = -79.3 # table 5.59\n",
+ "Hf2 = -46.11\n",
+ "Hsol = Hf1-Hf2\n",
+ "\n",
+ "# Calculation \n",
+ "Hg = Hsol*1000*140./17.0305\n",
+ "Raq = 140/.15 # kg/h\n",
+ "dT = Hg/(4.145*Raq)\n",
+ "T = -dT+303.\n",
+ "\n",
+ "# Result\n",
+ "print \" Temp of resultant sol = \",T,\" K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.55 Page 311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 55,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat generated for making 2 percent solution = -3996.35947271 kJ/100 kg sol.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "Hf1 = -80.14\n",
+ "Hf2 = -46.11\n",
+ "\n",
+ "# Calculation \n",
+ "Hsol = Hf1-Hf2\n",
+ "Hg = Hsol*1000.*2/17.0305\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat generated for making 2 percent solution = \",Hg,\" kJ/100 kg sol.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.56 Page 312"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 56,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat removal in the cooler = 9372691.2781 kJ/h.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "fi3 = 15505407.\n",
+ "fi4 = 11395056.\n",
+ "fi5 = fi3-fi4 # kJ/h\n",
+ "\n",
+ "# Calculation \n",
+ "fi6 = 111.375*62.75*1000\n",
+ "fi7 = 1063379.\n",
+ "fi8 = 5532.15*4.1868*(303.15-298.15)\n",
+ "fi9 = 9030.4*3.45*(323.15-298.15)\n",
+ "fi = fi5+fi6+fi8-fi7-fi9\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat removal in the cooler = \",fi,\" kJ/h.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.57 Page 314"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEACAYAAAC6d6FnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8VPW9//HXENYgizRIA8HLYlRERUQWK8KwishmXTAI\nKMVbLFWoC6Jor3FD6xURrdAq1QoKAuqlIAgWYQpu0PoLAQp6CeKSgCICgsgFQub3x+cMM8bAzGSZ\nM8v7+XicR2a+c2bmwwHOJ98dREREREREREREREREREREREREREQkiaUBecBi5/k853kesN35CdAC\nOBTy2vSQz+gAbAS2AtOqPGIREakUtwOvAIvKeO0J4D7ncQvsJl+WdUAn5/FSoF8lxiciIlUgC1gB\n9CBYAwjwAF8ArZ3nLSg7AWQCW0KeXwf8qVKjFBGRqFSL4JypwASgpIzXLgW+BraFlLXEmn98QFen\nrBlQGHJOkVMmIiIuqR7m9QHALuyG7i3j9RxgTsjzHUBzYC9wIbAQaFvhKEVEpNKFSwC/AAYB/YHa\nQH1gFjDSee+V2I0+4IhzAPw/rGaQjf3GnxVyXpZT9hOtW7f2b9u2rayXRESkbNuAM6ryC7rz4z6A\nfsCqUudkYCOGAFphzT4Nnedrgc5Yv8HJOoH94vfff//9bocQN3QtgnQtgnQtggB/eW7q4WoAP7k5\nhzweCswt9Xo34EHgKNZnMAbY57w2FvgrUAdLAMui/G4REalE0SSAfzhHwKgyznnDOcryEXBeFN8n\nIiJVKJJRQOICr9frdghxQ9ciSNciSNei4jxuB1AGp0lLREQi4fF4oBz3c9UARERSlBKAiEiKUgIQ\nEUlRSgAiIikq2nkAUsmKi2HPnuCxb58d330HBw7AwYPw/ffwww/wf/8Hhw/bz+JiOHbMDr8fqlUL\nHjVrQq1adqSnwymnBI9GjYJH48bQpAnUrw+eeBwOICJVKh7/2yf8KKCSEvjmG9ixI3h89VXw2LXL\njm++gf37oWFD+NnP7KbcsCE0aGBHvXp2065b147ate2oVQtq1LCbfVqa3bz9fvveY8fgyBFLFIcP\nW+I4eNCSyYEDsHevJZpvv7Xv//prSyaZmZCVBaefDs2bQ6tWcMYZ0Lq1lVdTXVEkbpV3FJASQJRK\nSuzm/eWXwaOwMPizsBB27rSbd7Nm0LSp3VwzM+HnP7fjtNPsaNzYbvpu31wPHrSYA3+eL76ATz+F\nggLYts1qJGedBW3aQNu20K4dXHCB/dlUcxBxnxJApXwx7N4NRUU/vql/8UXw5lhUZDf35s1/emRl\n2dG0qf2mniwOHICPP4bNm2HTJsjPh/Xr7XpddBF06gQdO0LnzpbURCS2lABO+GHWhh5o8gg0v3z9\ntf3Wu3Pnj5tq0tPtN/fQm3rpm3x6eqWFl7D8frt2//oXrFtnx9q1lvy6doVu3aBHD7teIlK1kioB\nnHmmn4wM65wMtH+np1t7d+AIdIAWF1ub9w8/BNu79++347vvrL27Rg1rY8/IsE7PJk2sCSbQNJOZ\nGWyu0c29/I4dg40bYc0aWL0aVq2ya96rF1x2GfTsaX0aIlK5kioBbNniZ/duu4kfPGjHDz8Eb/ol\nJdZuXr26JYOaNe3GHTgaNLDk0aABnHpqcjXHJJKSEmsuWrECli+3GkKXLnDFFTB4MLRs6XaEIskh\nqRJAPHcCS/kdOADvvANvvgmLFlmNa8gQuPpqOPdct6MTSVxKAJJQjh2D99+H//kfWLDAamxDh0JO\nDmRnux2dSGJRApCEVVICH3wA8+bZ0aoVjBxpCaFRI7ejE4l/SgCSFI4ehbffhtmzYdkyuPxyuOkm\nG1Hk9nwJkXilBCBJZ+9emDMHnn/eBgT8+tcwerTmGoiUpgQgScvvt/kGM2ZYn8HAgXDLLTYBTUSq\nfkOYNCAPWOw8n+c8zwO2Oz8D7gG2Ah8DfUPKOwAbndemRRuopC6Px2Yav/CCLU9x/vnWP3DJJfDa\nazYXRESiF2nGuB27gdcDBpV67QlgH/AwcA4wB+gINANWANmAH1gH3OL8XAo8DSwr47tUA5Cwioth\n4UKYOtVmcN9xB/zqV5rIJ6mpKmsAWUB/YGYZX+ABrgXmOs8HO4+PAp8BBUBnIBNLHuuc82YBQ6IN\nViSgenWbP/DeezB3rs0vaNkSHn7Y+g5EJLxIEsBUYAJQUsZrlwJfA9uc502BwpDXC7GaQOnyIqdc\npMK6dLG+AZ/PVi894wy47z5b/0lETixcAhgA7MLa+MuqXuRgTT4irmvTBl580TqMd+2CM8+Ee+6x\n9aBE5KfC7Qj2C6zNvz9QG6iPNd+MdN57JXBhyPlFQPOQ51nYb/5FzuPQ8qITfWlubu7xx16vF6/X\nGyZMkaCWLeG55+Dee2HyZEsE48bB735nM45FEp3P58Pn81X4c6LpNOgO3AkMdJ73AyYCPULOCXQC\ndyLYCXwG1gm8FhiH9QMsQZ3AEiPbtkFurk0wu/tuGDvWdlUTSRZVPQw0IPTOPJRg52/AZmC+8/Mt\nYGzIe8ZiHclbsc7hsm7+IpWudWubWbxypR1nnw2vvGJLUIikMk0Ek5SzejXcdZftIzF1KnTv7nZE\nIhWjmcAiUfD7beG5iRNtW8vHH7eagkgiilUTkEhS8Hjguutsr+MOHWw/40mTbPMhkVShBCAprU4d\nu/Hn58Pnn9tQ0nnzrIYgkuzUBCQSYs0auPVW20N6+nQ46yy3IxIJT01AIpXg0kttItnAgbbY3O9/\nD4cOuR2VSNVQAhAppXp1mzSWnw+ffALnnWdrDYkkGzUBiYSxZIlNHuvZE554wpqHROKJmoBEqsgV\nV8CmTbaMxLnn2ib2IslANQCRKHzwge070LYtPPssNGnidkQiqgGIxMTFF0NeHmRn285kr77qdkQi\n5acagEg5/fOfcMMN1kn87LOQkeF2RJKqVAMQibGOHeGjjyArC9q1gzffdDsikeioBiBSCVavhhtv\nhL59YcoUqFvX7YgklagGIOKibt1g/XqbNNa+vTUPicQ71QBEKtn8+bacxPjxttpoWprbEUmy03LQ\nInGksBCGD4dq1WwzmmbN3I5IkpmagETiSFaWLR/Rs6ctN714sdsRifyUagAiVey992DYMLj6anj0\nUahZ0+2IJNmoBiASpy65xCaPFRTYaqPbt7sdkYiJNAGkAXlAaEX2VmALsAn4g1PWAjjknJsHTA85\nvwOwEdsUflq5IxZJQI0awcKFkJNju4/97W9uRyQC1SM8bzywGajnPO8BDALOB44CjUPOLQDal/EZ\nM4DRwDpgKdAPWBZ9yCKJyeOxZaa7dIGhQ+H99+GRR2z5aRE3RFIDyAL6AzMJtjH9BngUu/kDfBPm\nMzKx5LHOeT4LGBJVpCJJoksXm0Gcn2+dxDt3uh2RpKpIEsBUYAJQElKWDXQDPgR8wEUhr7XEmn98\nQFenrBlQGHJOkVMmkpIyMmDpUujTBy66CN591+2IJBWFq3wOAHZhN3RvqfedCnQBOgLzgVbADqA5\nsBe4EFgItI02qNzc3OOPvV4vXq/3hOeKJKpq1WzLyY4d4aqr4N57bQKZJx7H5klc8fl8+Hy+Cn9O\nuH9qk4ERQDFQG6gPvAFkAI8B/3DOKwA6A9+Wev8q4A5gJ7ASaOOU5wDdgZvL+E4NA5WU8+mnlgTa\ntoXnnoP0dLcjkkRSVcNAJ2G/0bcErsNu4iOw3+x7OuecCdTEbv4Z2IghsBpBNvAplgD2Y0nCE/IZ\nIgK0amXzBTwe6NoVPv/c7YgkFUQ7DyDwq/kL2A1+IzAXGOmUdwPysSajBcAYYJ/z2lisI3krVmPQ\nCCCREOnpMGsWjBhhHcWVUMMXOal4bG1UE5CkvBUrbC2h++6D3/5W/QJycloMTiTJfPopDBpkM4mf\neUZLSMiJaSkIkSTTqpVNFtu504aLfhNuto1IlJQAROJY/fq2hMQll9gSEv/+t9sRSTJRE5BIgpg9\nG+64wzqK+/VzOxqJJ+oDEEkB771ny0pPmmSTxkRACUAkZWzfDgMG2DpCU6dqMTlRAhBJKfv2wTXX\nQK1aMHcu1KsX/j2SvDQKSCSFNGxoi8llZtomM0VFbkckiUgJQCRB1ahh6wbl5MDFF8PGjW5HJIlG\nTUAiSeDVV2HcOJgzB3r3djsaiTU1AYmksOuug9deg+uvh5decjsaSRSqAYgkkY8/hssvh5tusqGi\nWkMoNWgUkIgAtnRE//62ougf/whpaeHfI4lNCUBEjtu/3zaYqVvXhonWqeN2RFKV1AcgIsfVrw9L\nllgC6NsX9u51OyKJR0oAIkmqZk1bP6hjR+jWTXMF5KeUAESSWLVqMGWK7TJ2ySXWSSwSoFVERJKc\nxwN33QWnnQY9esDixXDRRW5HJfFAncAiKWTRIhsi+uqrtpicJIeq7gROwzZ6XxxSdiuwBdgE/CGk\n/B5s4/ePgb4h5R2wTeS3AtOiDVREKm7QIFiwwCaOvfGG29GI2yJtAhoPbAYCaw72AAYB5wNHgcZO\n+TnAUOdnM2AFkA34gRnAaGAdsBToByyr8J9ARKLSvTssXw5XXAHffQejRrkdkbglkhpAFtAfmEmw\nivEb4FHs5g8Q2K10MDDXKf8MKAA6A5lY8ljnnDcLGFKx0EWkvNq3h1WrIDcXpqk+nrIiSQBTgQlA\nSUhZNtAN+BDwAYEupaZAYch5hVhNoHR5kVMuIi456yxYswaefRYeeADU9ZZ6wjUBDQB2Ye3/3lLv\nOxXoAnQE5gOtKiuo3Nzc44+9Xi9er/eE54pI+Z1+uiWByy6z5qApU7R+UCLw+Xz4fL4Kf064v+rJ\nwAigGKgN1AfeADKAx4B/OOcVYMngJuf5Y87PZcD9wOfAKqCNU54DdAduLuM7NQpIJMb27rVF5Nq1\ng+nTtX5QoqmqUUCTgOZAS+A6YCWWEBYCgUFkZwI1gd3AIue8ms57srF2/6+A/Vh/gCfkM0QkDpx6\nKvz97/C//ws33ADFxW5HJLEQ7UzgwK/mL2BNPhuxTt+RTvlmrDloM/AWMDbkPWOxjuStWI1BI4BE\n4ki9erbN5J49tt/w4cNuRyRVLR5b+9QEJOKiI0dsnsDhw/D661C7ttsRSThaDVREKkXNmjBvnq0o\nOmAAHDzodkRSVZQAROQnatSAl1+G5s2tc/jAAbcjkqqgBCAiZUpLg7/8Bc45JzhMVJKLEoCInFC1\najBjBnToAH36aGOZZKMEICIn5fHA009D167Quzd8+63bEUllUQIQkbA8Hpsl3Ls39OoFu3e7HZFU\nBm0IIyIR8XjgscesWahXL3jnHcjIcDsqqQglABGJmMcDkydbEujZ05JA48bh3yfxSQlARKLi8cDD\nDweTwMqVSgKJSglARKLm8cCDD9oS0oHmICWBxKMEICLl4vHAQw9ZEujdW30CiUgJQETKLdAcVFIS\nTAI/+5nbUUmktBiciFSY3w93321LSr/zji0vLbFT3sXglABEpFL4/XDnnbB6tSWChg3djih1KAGI\niOv8fvjd72DtWnj7bVtRVKqeEoCIxAW/H265Bdavh+XL4ZRT3I4o+SkBiEjcKCmBMWOgoACWLIH0\ndLcjSm5KACISV0pK4MYb4auvYNEi7SxWlZQARCTuFBfD8OHw/ffwxhu225hUvqreEjINyAMWO89z\ngUKnLA/o55S3AA6FlE8P+YwO2CbyW4Fp0QYqIomnenWYPdt+DhtmCUHiR6QJYDywGQj8au4HngTa\nO8eykHMLQsrHhpTPAEYD2c7RDxFJejVq2B7D338Po0ZZ05DEh0gSQBbQH5hJsIrhIbrqRiZQD1jn\nPJ8FDIni/SKSwGrVsiagL7+Em2+2kULivkgSwFRgAhCat/3ArUA+8BcgdMpHS6z5xwd0dcqaYU1G\nAUVOmYikiPR0WLwYNm6E229XEogH4dYCGgDswm7o3pDyGcCDzuOHgClY884OoDmwF7gQWAi0jTao\n3Nzc44+9Xi9er/eE54pI4qhXD5YutWWkc3PhgQfcjigx+Xw+fD5fhT8nXDPOZGAEUAzUBuoDrwMj\nQ85pgXUOn1fG+1cBdwA7gZVAG6c8B+gO3FzGezQKSCTJ7doF3bvD6NG2fIRUTFWNApqE/UbfErgO\nu4mPxNr0A67ERvcAZGAjhgBaYZ29n2IJYD/Q2QlyBFY7EJEUdNpptl7Q9Onw5z+7HU3qimY5aA/B\nUUCPA+2c59uBMU55N6xp6CjWZzAG2Oe8Nhb4K1AHWMqPRw6JSIrJyoIVK6BbN1szKCfH7YhSjyaC\niYirNm2yvQSefx4GDnQ7msSkmcAikrDWrYMBA2D+fNCYj+hV9UxgEZEq06mTTRa79lr45z/djiZ1\nKAGISFzo0QNmzrRmoC1b3I4mNWhPYBGJG4MGwb59cNllsGYN/Md/uB1RclMCEJG4MnIk7N0LffpY\nEmjSxO2IkpcSgIjEnfHjYc8euPxyWLUKGjRwO6LkpFFAIhKXAltLbt4Mb72lDWVORsNARSTpHDsG\n118PR47YENHqarMok4aBikjSSUuDWbNsLwEtI135lABEJK7VrGl7CWzYAL//vdvRJBdVqEQk7p1y\nCixZAl272qigW291O6LkoAQgIgmhcWNYvtySwGmnwdChbkeU+JQARCRhtGhhG8r06QMZGdCrl9sR\nJTb1AYhIQjn/fBsRlJMDeXluR5PYlABEJOF07w4zZtgKotu3ux1N4lITkIgkpKuugq++snWD3nvP\n+ggkOpoIJiIJ7d57bWexlSuhbl23o3GHZgKLSEry+2HUKNi9GxYuTM3ZwpoJLCIpyeOx7SSLi2Hs\nWM0WjkakCSANyAMWO89zgUKnLA+4POTce4CtwMdA35DyDsBG57Vp5Y5YRKSUGjVgwQL46CN48EG3\no0kckSaA8cBmIJBb/cCTQHvneMspPwcY6vzsB0wnWC2ZAYwGsp2jXwVjFxE5rl49my380kvw4otu\nR5MYIkkAWUB/YCbBm7mHstubBgNzgaPAZ0AB0BnIBOoB65zzZgFDyhu0iEhZfv5zmyh2993w9ttu\nRxP/IkkAU4EJQElImR+4FcgH/gI0dMqbYk1DAYVAszLKi5xyEZFKdfbZ8PrrMHw4rF/vdjTxLVx/\n+QBgF9bO7w0pnwEEWtoeAqZgzTuVIjc39/hjr9eL1+s94bkiIqV17QrPPmsTxd5/H04/3e2IKpfP\n58Pn81X4c8ING5oMjACKgdpAfeB1YGTIOS2wzuHzgLudssecn8uA+4HPgVVAG6c8B+gO3FzGd2oY\nqIhUiieftP6Ad99N7m0lq2oY6CSgOdASuA5Yid38M0POuRIb3QOwyDmvpvOebKzd/ytgP9Yf4MGS\nysJogxURicZtt9myEVdfDUePuh1N/IlmHoCH4Cigx4ENWB9Ad+A2p3wzMN/5+RYwNuQ9Y7GO5K1Y\n5/CyigQuIhKOxwPTpkGdOjBmjOYIlKaZwCKS9A4etJrA4MHJuatYeZuAUnDStIikmrp1YfFiuPhi\naN0ahg1zO6L4oAQgIikhMxPefBN69oTmzeHSS92OyH1aC0hEUsa558LLL8M118DWrW5H4z4lABFJ\nKX37wkMPQf/+8O23bkfjLnUCi0hKmjgRPvzQloyoVcvtaCpG+wGIiEShpMTmB9Svb5PFPPF4N4yQ\n9gMQEYlCtWowezZs2gSPPup2NO7QKCARSVl168KiRdClC2RnW+dwKonHSo+agEQkptavhz59bCnp\njh3djiZ6agISESmnCy6AmTPhyiuhsDD8+clCTUAiItgyEZ98AoMGwZo11jyU7NQEJCLi8Pth9GjY\nu9c2lamWIG0kagISEakgjwdmzLAJYsm4aFxpSgAiIiFq1bLf/ufMsSOZqQlIRKQMGzdCr162imjn\nzm5Hc3JqAhIRqUTnnWcjg375y+QdGaRRQCIiJzBoEGzeDEOG2MigOnXcjqhyqQlIROQk/H4YPtx+\nvvJKfK4ZpCYgEZEq4PFYU9DWrfCHP7gdTeWKNAGkAXnA4lLldwAlQCPneQvgkHNuHjA95NwOwEZs\nU/hp5QtXRCT26tSBhQvhmWesUzhZRJoAxgObgdC2meZAH+DzUucWAO2dY2xI+QxgNJDtHP3KEa+I\niCuaNbPhoaNHw5YtbkdTOSJJAFlAf2AmP25jehK4K8LvyQTqAeuc57OAIRG+V0QkLnTpYs1AQ4bA\nvn1uR1NxkSSAqcAErKknYDBQCGwo4/yWWPOPD+jqlDVzzg8ocspERBLKqFFw2WUwbBgcO+Z2NBUT\nbhjoAGAXdkP3OmXpwCSs+ScgUDPYgTUN7QUuBBYCbaMNKjc39/hjr9eL1+s94bkiIrE2ZYolgfvu\nc2czGZ/Ph8/nq/DnhBs2NBkYARQDtYH6wFvApcAPzjlZ2G/0nbBkEWoV1lG8E1gJtHHKc4DuwM1l\nfKeGgYpI3Nu92/YOePxx9zeSicWewN2BO4GBpcq3YyN89gAZ2G//x4BWwGrgXGAfsBYYh/UDLAGe\nBpaV8T1KACKSEPLyoG9fWLnSZg67JVbzAMq6M4eWdQPysSajBcAY7OYPNiJoJjYMtICyb/4iIgmj\nfXt46inbSGbPHrejiV4czmlTDUBEEsvtt9uSEUuWQFpa7L9fM4FFRFzy+ONw5Eji7SGgBCAiUkHV\nq8Orr8LLL9uM4UShJiARkUqybh0MGGArh551Vuy+V01AIiIu69QJHnnEOoUPHHA7mvBUAxARqWT/\n+Z+2VMT8+bFZPlo1ABGROPHMM7B9O0yd6nYkJ6cagIhIFfjsM9tLeMEC6Natar9LNQARkTjSogW8\n9BLk5MDOnW5HUzYlABGRKtKvH/z61zB0KBw96nY0P6UmIBGRKlRSYkND27aF//7vqvkONQGJiMSh\natVg9mwbERRvk8RUAxARiYG1a2HgQPjgA2jdunI/WzUAEZE41rkz/Nd/wdVXw6FDbkdjVAMQEYkR\nv99GBTVoAH/+c+V9rmoAIiJxzuOB556DVatgzhy3o1ENQEQk5vLzoXdvePfdylk0TjUAEZEE0a6d\nLRp3zTXwww/hz68qqgGIiLjA74fhw6FOHZg5s2KfVdU1gDRsn9/FpcrvAEqARiFl92D7/n4M9A0p\n7wBsdF6bFm2gIiLJxOOBP/3J9g5wqz8g0gQwHtjMjzeAbw70AT4PKTsHGOr87AdMJ5iVZgCjgWzn\n6FfuqEVEkkC9ejBvHowfD1u3xv77I0kAWUB/YCY/rmI8CdxV6tzBwFzgKPAZUAB0BjKBesA657xZ\nwJDyBi0ikiwuuAAeeMDWCzp8OLbfHUkCmApMwJp6AgYDhcCGUuc2dcoDCoFmZZQXOeUiIinvN7+B\nVq1gwoTYfm+4BDAA2IW1/wd++08HJgH3h5wXj53JIiIJweOxjuDFi+Fvf4vd91YP8/ovgEFYE1Bt\noD7WfNMCyHfOyQI+wpp6irC+AUJeK3TKs0qVF53oS3Nzc48/9nq9eL3eMGGKiCS2hg2tM3jIEOjQ\nAbKyTnyuz+fD5/NV+Duj+c29O3AnMLBU+XZshM8erPN3DtAJa+JZAZyBdR6vBcZh/QBLgKeBZWV8\nj4aBikjKmjwZli+HlSshLS2y98RqIlhZd+bQss3AfOfnW8DYkNfHYh3JW7HO4bJu/iIiKW3iRLvx\nT55c9d8Vj233qgGISErbsQMuvBBeew26dg1/vpaCEBFJEk2bWqfw8OGwb1/VfY9qACIiceq3v4U9\ne6xz2HOSu7VqACIiSeaJJ2DDBttSsiqoBiAiEsc2bIBeveDDD0+8laRqACIiSej88+Hee+H66+Ho\n0cr9bCUAEZE4N26cbSP5yCOV+7lqAhIRSQA7dkD79rBokW0wH0pNQCIiSaxpU5g+3YaGfv995Xym\nagAiIglk1CioUcM2lw8obw1ACUBEJIHs3297CDz1FAwaZGVKACIiKeLdd+HaayE/Hxo3VgIQEUkp\nEyfaNpKvvw7VqqkTWEQkZTz4oCWAl18u/2eoBiAikqDWr4e+feGbb1QDEBFJKRdcALfdVv73qwYg\nIpLAiouhRg11AouIpCTNBBYRkagoAYiIpKhIE0AakAcsdp4/BOQD64F3gOZOeQvgkHNuHjA95DM6\nABuxTeGnVSRoERGpuEgTwHhgMxBonH8caAdcACwE7g85twBo7xxjQ8pnAKOBbOfoV+6oU4DP53M7\nhLihaxGkaxGka1FxkSSALKA/MJNgJ8OBkNdPAXaH+YxMoB6wznk+CxgSeZipR/+4g3QtgnQtgnQt\nKi6SBDAVmACUlCp/BPgCuAF4LKS8Jdb84wO6OmXNgMKQc4qcMhERcUm4BDAA2IXd0EsPMboXOB34\nK5YkAHZg/QHtgduBOdhv/iIikmAmA18C24GdwEGs+SbU6cCmE7x/FXAh1gS0JaQ8B/jTCd5TgPU1\n6NChQ4eOyI4Cqlh3gqOAskPKbwVmO48zsBFDAK2wZp+GzvO1QGesJrEUdQKLiCQML7DIefwaNqRz\nPfA6cJpT/kusNpAHfARcEfL+wDDQAuDpqg9XRERERETiRj/gY2xS2MQTnPO083o+1qmcrMJdi+ux\na7ABeA84P3ahxVwk/y4AOgLFWI0zWUVyLbxYbXsTNuouWYW7FhnAMqxFYhNwY8wii60XgK+xlpQT\nifv7ZhrWDNQCqIH9pbUpdU5/rJ8ArN/gw1gFF2ORXIuLgQbO436k9rUInLcSeBO4KlbBxVgk16Ih\n8G9sng7YTTAZRXItcoFHnccZwLdA9diEF1OXYjf1EyWAqO+bbqwF1An7C/0MOAq8Cgwudc4g4CXn\n8VrsH3uTGMUXS5Fciw+A75zHawn+h082kVwLsEEHrwHfxCyy2IvkWgzD+t8C82vCTcZMVJFci51A\nfedxfSwBFMcovlhaA+w9yetR3zfdSADNsKGlAYX8dFJYWeck440vkmsRajTBDJ9sIv13MRhbVgRs\n+FsyiuRaZAONsKHW/wJGxCa0mIvkWjwPtMXmIeVjS9ekoqjvm25UkyL9T1t64lky/meP5s/UA/gV\ncEkVxeK2SK7FU8Ddzrke4nM/i8oQybWogc2x6QWkYzXFD7H232QSybWYhDUNeYHWwN+xtcoOnOQ9\nySqq+6asQNZwAAABHElEQVQbCaCI4OqhOI8Lw5yT5ZQlm0iuBVjH7/NYH8DJqoCJLJJr0QFrAgBr\n670caxZYRHKJ5Fp8iTX7HHKO1dhNL9kSQCTX4hfY0jQA27CJq2dhNaNUkhD3zerYX1ILoCbhO4G7\nkLwdn5Fci9OxNtAuMY0s9iK5FqFeJHlHAUVyLc4GVmCdpOlYx+A5sQsxZiK5Fk8SXJG4CZYgGsUo\nvlhrQWSdwHF937wc+AS7sd3jlI1xjoA/Oq/nY1XdZBXuWszEOrUCeyysK/0BSSSSfxcByZwAILJr\ncSc2EmgjMC6m0cVWuGuRga1SkI9di2GxDjBG5mL9HEewGuCvSN37poiIiIiIiIiIiIiIiIiIiIiI\niIiIiIiIiIhIavj/31aygaPb0jQAAAAASUVORK5CYII=\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0x7f32273f21d0>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Enthalpy, kJ/kmol mix \n",
+ " x1 HE H\n",
+ " 0 0 4721.5\n",
+ " 0.1 37.372608 4723.522608\n",
+ " 0.2 78.615936 4729.415936\n",
+ " 0.3 111.825504 4727.275504\n",
+ " 0.4 131.236032 4711.336032\n",
+ " 0.5 135.6 4680.35\n",
+ " 0.6 126.566208 4635.966208\n",
+ " 0.7 107.058336 4581.108336\n",
+ " 0.8 79.653504 4518.353504\n",
+ " 0.9 44.960832 4448.310832\n",
+ " 1.0 0.0 4368.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "%matplotlib inline\n",
+ "# solution \n",
+ "from numpy import linspace\n",
+ "from matplotlib.pyplot import plot, show\n",
+ "\n",
+ "# Variables \n",
+ "To = 273.15\n",
+ "T1 = 308.15\n",
+ "H1 = 124.8*(T1-To) # kJ/kmol\n",
+ "H2 = 134.9*(T1-To) # kJ/kmol\n",
+ "\n",
+ "# Calculation \n",
+ "HE1 = .1*.9*(542.4+55.4*(.9-.1)-132.8*(.9-.1)**2-168.9*(.9-.1)**3) # kJ/kmol of mix\n",
+ "Ha = HE1+H1*.1+H2*.9\n",
+ "HE2 = .2*.8*(542.4+55.4*(.8-.2)-132.8*(.8-.2)**2-168.9*(.8-.2)**3) # kJ/kmol of mix\n",
+ "Hb = HE2+H1*.2+H2*.8\n",
+ "HE3 = .3*.7*(542.4+55.4*(.7-.3)-132.8*(.7-.3)**2-168.9*(.7-.3)**3) # kJ/kmol of mix\n",
+ "Hc = HE3+H1*.3+H2*.7\n",
+ "HE4 = .4*.6*(542.4+55.4*(.6-.4)-132.8*(.6-.4)**2-168.9*(.6-.4)**3) # kJ/kmol of mix\n",
+ "Hd = HE4+H1*.4+H2*.6\n",
+ "HE5 = .5*.5*(542.4+55.4*(.5-.5)-132.8*(.5-.5)**2-168.9*(.5-.5)**3) # kJ/kmol of mix\n",
+ "He = HE5+H1*.5+H2*.5\n",
+ "HE6 = .6*.4*(542.4+55.4*(.4-.6)-132.8*(.4-.6)**2-168.9*(.4-.6)**3) # kJ/kmol of mix\n",
+ "Hf = HE6+H1*.6+H2*.4\n",
+ "HE7 = .7*.3*(542.4+55.4*(.3-.7)-132.8*(.3-.7)**2-168.9*(.3-.7)**3) # kJ/kmol of mix\n",
+ "Hg = HE7+H1*.7+H2*.3\n",
+ "HE8 = .8*.2*(542.4+55.4*(.2-.8)-132.8*(.2-.8)**2-168.9*(.2-.8)**3) # kJ/kmol of mix\n",
+ "Hh = HE8+H1*.8+H2*.2\n",
+ "HE9 = .9*.1*(542.4+55.4*(.1-.9)-132.8*(.1-.9)**2-168.9*(.1-.9)**3) # kJ/kmol of mix\n",
+ "Hi = HE9+H1*.9+H2*.1\n",
+ "HE10 = .0*1.*(542.4+55.4*(.0-1.)-132.8*(.0-1.)**2-168.9*(.0-1.)**3) # kJ/kmol of mix\n",
+ "Hj = HE10+H1+H2*0\n",
+ "x = linspace(0,1,100)\n",
+ "y = linspace(4300,5000,100)\n",
+ "y = 4721.5-57.4*x+1137.7*x**2-3993.6*x**3+3909.2*x**4-1351.2*x**5\n",
+ "\n",
+ "# Result\n",
+ "plot(x,y)\n",
+ "show()\n",
+ "#title(\"H vs x1\")\n",
+ "#xlabel(\"x1\")\n",
+ "#ylabel(\"H (kJ/kg sol.)\")\n",
+ "print \" Enthalpy, kJ/kmol mix \"\n",
+ "print \" x1 HE H\"\n",
+ "print \" 0 0 \",H2\n",
+ "print \" 0.1 \",HE1,\" \",Ha\n",
+ "print \" 0.2 \",HE2,\" \",Hb\n",
+ "print \" 0.3 \",HE3,\" \",Hc\n",
+ "print \" 0.4 \",HE4,\" \",Hd\n",
+ "print \" 0.5 \",HE5,\" \",He\n",
+ "print \" 0.6 \",HE6,\" \",Hf\n",
+ "print \" 0.7 \",HE7,\" \",Hg\n",
+ "print \" 0.8 \",HE8,\" \",Hh\n",
+ "print \" 0.9 \",HE9,\" \",Hi\n",
+ "print \" 1.0 \",HE10,\" \",Hj\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.59 Page 318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 59,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " H1 at x1=0.3 is 300.0 kJ/kg sol \n",
+ "H2 at x1=0.3 is 30.0 kJ/kg sol \n",
+ "H1 at x1=0.6 is 63.0 kJ/kg sol \n",
+ "H2 at x1=0.6 is 214.0 kJ/kg sol.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "\n",
+ "# from graph drawn in 5.57 we can see\n",
+ "H1E1 = 300.\n",
+ "H1E2 = 63.\n",
+ "H2E1 = 30.\n",
+ "H2E2 = 214.\n",
+ "\n",
+ "# Result\n",
+ "print \" H1 at x1=0.3 is \",H1E1,\" kJ/kg sol \\nH2 at x1=0.3 is \",H2E1,\\\n",
+ "\" kJ/kg sol \\nH1 at x1=0.6 is \",H1E2,\" kJ/kg sol \\nH2 at x1=0.6 is \",H2E2,\" kJ/kg sol.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.60 Page 320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 60,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat of dilution = -57267.8712082 kJ/kg original solution \n",
+ "Final T of resultant solution = 331.612662617 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "# basis 100 kg 96.1% H2SO4\n",
+ "# from table 5.64\n",
+ "m1SO3 = 78.4 # kg\n",
+ "m1H2O = 21.6\n",
+ "n1SO3 = m1SO3/80.063\n",
+ "n1H2O = m1H2O/18.015\n",
+ "\n",
+ "# Calculation \n",
+ "# resultant sol has 23.2% H2SO4\n",
+ "m2SO3 = 19.\n",
+ "m2H2O = 81.\n",
+ "Mrsol = m1SO3*100./m2SO3\n",
+ "Mw = Mrsol-100.\n",
+ "w = Mrsol-m1SO3/18.015 # kmol\n",
+ "HEosol = n1SO3*(-56940.)+n1H2O*(-32657.) # kJ\n",
+ "HErsol = n1SO3*(-156168.)+w-(-335.)\n",
+ "HE = HErsol-HEosol # kJ/kg original acid\n",
+ "C = 3.43 # kJ/kg K\n",
+ "dT = -HE/(Mrsol*C)\n",
+ "T = 291.15+dT # K\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat of dilution = \",HE,\" kJ/kg original solution \\nFinal T of resultant solution = \",T,\" K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.61 Page 321"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 61,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Heat of dilution = 636.08178112 kJ/kg.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100 kg of original acid\n",
+ "lv = 333.7 # kJ/kg\n",
+ "\n",
+ "# Calculation \n",
+ "H = -lv-18*4.1868\n",
+ "HE = (-64277-H*312.63)/100 # kJ/kg\n",
+ "\n",
+ "# Result\n",
+ "print \" Heat of dilution = \",HE,\" kJ/kg.\"\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch6.ipynb b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch6.ipynb
new file mode 100644
index 00000000..4b441d7c
--- /dev/null
+++ b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch6.ipynb
@@ -0,0 +1,1522 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 6 : Stoichiometry and Unit Operations"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.1 Page 346"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a performing overall material balance for 100kmol of feed we get 71.5 kmol as distillate and 28.5 kml as bottom product. b \n",
+ " performing overall enthalpy balance we get Heat load of condenser = 6496490.0 kJ/kmol and Heat load of reboiler = 3394675.0 kJ/kmol.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis = 100kmol of feed\n",
+ "Benzene = 100*.72 # kmol\n",
+ "Toulene = 100-Benzene #kmol\n",
+ "# use fig 6.1\n",
+ "# D = distillate, B = bottom\n",
+ "# F = B + D (i) overall material balance\n",
+ "xd = .995\n",
+ "xb = .03 \n",
+ "xf = .72\n",
+ "# xd*D + xb*B = F*xf (ii) benzene balance\n",
+ "# solving (i) and (ii)\n",
+ "D = 71.5 #kmol\n",
+ "B = 28.5 #kmol\n",
+ "print \"a performing overall material balance for 100kmol of feed we get \",D,\\\n",
+ "\"kmol as distillate and \",B,\"kml as bottom product. b \"\n",
+ "# enthalpy balance\n",
+ "# use fig 6.2\n",
+ "R = 1.95\n",
+ "\n",
+ "# Calculation \n",
+ "v = D*(1+R) #kmol total overhead vapours\n",
+ "To = 273.15 #K\n",
+ "# using fig 6.2\n",
+ "Ev = 42170. #kJ/kmol enthalpy of vapours overhead\n",
+ "El = 11370. #kJ/kmol enthalpy of liquid\n",
+ "E1 = Ev-El # enthalpy removed in condenser\n",
+ "Hc = E1*v # heat load of condenser\n",
+ "Hd = El*71.5\n",
+ "Hb = 18780*28.5\n",
+ "Hf = 44500*100\n",
+ "Hn = Hd+Hc+Hb-Hf # kJ heat load of reboiler\n",
+ "\n",
+ "# Result\n",
+ "print \" performing overall enthalpy balance we get Heat load of condenser = \",Hc,\\\n",
+ "\"kJ/kmol and Heat load of reboiler = \",Hn,\"kJ/kmol.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.2 Page 349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "composition of vapour liquid mix : mol fraction N2 = 0.71 in liquid phase and 0.859 in vapour phase.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis = 2000kg/h liquid feed rate\n",
+ "F = 2000/28.84 #kmol/h\n",
+ "\n",
+ "#D = distillate, W = residue flow rate\n",
+ "#N2 balance\n",
+ "# F*.79 = .999D + .422W (i)\n",
+ "# 54.840 = D + .4224W (ii)\n",
+ "# solving it\n",
+ "W = 25.118 #kmol/h\n",
+ "D = 44.230 #kmol/h\n",
+ "#using fig 6.4 and 6.5\n",
+ "# trial method is used for flash calculations\n",
+ "# Trial I\n",
+ "\n",
+ "x = .75\n",
+ "\n",
+ "# from fig 6.4\n",
+ "y = .8833\n",
+ "\n",
+ "# from fig 6.5\n",
+ "Hl = 1083.65\n",
+ "Hv = 6071.7\n",
+ "\n",
+ "# Calculation \n",
+ "Hf = .3*Hv+Hv*.7\n",
+ "\n",
+ "# calculating we get Emix is not close to 2592.2kJ/kmol\n",
+ "#Trial II\n",
+ "x = .71\n",
+ "y = .859\n",
+ "Hl = 1085.6\n",
+ "Hv = 6118.6\n",
+ "Hf = .3*Hv+.7*Hl #kJ/kmol\n",
+ "# which is aproox equal to 2595.2kJ/kmol, so flashing will occur\n",
+ "\n",
+ "# Result\n",
+ "print \"composition of vapour liquid mix : mol fraction N2 = \",x,\\\n",
+ "\" in liquid phase and \",y,\" in vapour phase.\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.3 Page 353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "After performing overall material balance we get Reflux, R = 93.369136 kmol/h and recycle ratio = 0.05634472 kmol/kmol fresh feed.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# material balance\n",
+ "# V2 vapour mix is a ternary azeotrope in which all cyclohexane of D1 is recycled\n",
+ "# V2 stream\n",
+ "# Cyclohexane balance\n",
+ "# D1 = (.488/.024)*V2\n",
+ "# IPA in V2 = .206V2\n",
+ "# water in V2 = (1-.488-.206)*V2\n",
+ "# W2 stream\n",
+ "# IPA in W2 = (.23D1-.206V2)\n",
+ "# water in W2 = (1-.024-.23)*D1-.306V2\n",
+ "# W2 stream = 4.471V2 + 14.862V2\n",
+ "# D3 is an azeotrope containing 67.5 mol% IPA\n",
+ "# water in W3 stream = (1-.675)F\n",
+ "# basis = 100 kmol/h fresh feed\n",
+ "# W1+W3 = 100 (i)\n",
+ "# .998W1 + .001W3 = 67.5 (ii)\n",
+ "# solving it \n",
+ "W1 = 67.603 #kmol/h\n",
+ "W3 = 32.397 #kmol/h\n",
+ "IPA1 = W3*.001 # IPA in W3\n",
+ "#IPA2 = 4.471*V2 - .032 IPA in D3\n",
+ "#C-1 = F+D3 = F1\n",
+ "# water in D3 = 6.624V2 - .047-4.471V2+.032\n",
+ "# water in W3 = 14.862V2-2.153V2+.015\n",
+ "# solving them\n",
+ "V2 = 2.624 #kmol/h\n",
+ "\n",
+ "# Calculation \n",
+ "D3 = 2.153*V2-.015\n",
+ "D1 = 20.333*V2\n",
+ "F1 = 6.624*V2+99.953\n",
+ "R = 1.75*D1 # = V1+V2-D1\n",
+ "V1 = 144.1\n",
+ "r = D3/100 # recycle ratio\n",
+ "\n",
+ "# Result\n",
+ "print \"After performing overall material balance we get Reflux, R = \",R,\\\n",
+ "\"kmol/h and recycle ratio = \",r,\" kmol/kmol fresh feed.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.4 Page 355"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Concentration of dissolved CO2 in the solution leaving the tower = 0.492054702187 kmol/kmol of MEA.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution\n",
+ "\n",
+ "# variables\n",
+ "# basis 0.625 l/s of MEA solution\n",
+ "c = 3.2 #M conc of MEA\n",
+ "M = 61. # molar mass of MEA\n",
+ "\n",
+ "# calculation\n",
+ "C = M*c #g/l conc of MEA in sol\n",
+ "MEAin = c*.625*3600/1000. # kmol/h\n",
+ "CO2diss = .166*7.2 #kmol/h CO2 dissolved in lean MEA\n",
+ "v = 26.107 #m**3 sp. vol of gas at 318K and 101.3kPa (table 7.8)\n",
+ "qv = 1000/v #kmol/h \n",
+ "CO2in = qv*.104 # moles of CO2 in inlet gas\n",
+ "CO2freegas = qv - CO2in\n",
+ "\n",
+ "#outgoing has 4.5% CO2\n",
+ "GASout = CO2freegas/(1-.0455) #kmol/h\n",
+ "CO2abs = qv-GASout\n",
+ "CO2 = CO2diss + CO2abs \n",
+ "CO2conc = CO2/MEAin #kmol/kmol MEA\n",
+ "\n",
+ "# Result\n",
+ "print \"Concentration of dissolved CO2 in the solution leaving the tower = \",CO2conc,\\\n",
+ "\"kmol/kmol of MEA.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.5 Page 356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Composition of final liquor :\n",
+ "Component mi kg/h\n",
+ " NaOH 5529.30076871\n",
+ " NaNO2 2522.73285015\n",
+ " NaNO3 3163.59293325\n",
+ " H2O 26299.5585151\n",
+ " b\n",
+ "Heat efeet of scrubbing system = -2017.12645556 kW.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "#(a)\n",
+ "print \"a \",\n",
+ "# basis 50000 m**3/h of gas mix at 295.5K 100kPa\n",
+ "v = 24.57 #m**3/kmol sp vol of gas at 295.5K and 100kPa\n",
+ "n1 = 50000/v # kmol/h flow of incoming gas\n",
+ "\n",
+ "# Calculation \n",
+ "NO2in = n1*.0546\n",
+ "N2O4in = n1*.0214\n",
+ "N2in = n1-NO2in-N2O4in\n",
+ "\n",
+ "#N2 is unaffected \n",
+ "n2 = 1880.34/.95 #kmol/h outgoing gas flow\n",
+ "# using tables 6.3 and 6.4 on page 357\n",
+ "NO2rem = NO2in - (n2*.0393)\n",
+ "N2O4rem = N2O4in - (n2*.0082)\n",
+ "\n",
+ "# rxn (ii)\n",
+ "NaOHreac2 = 2*40*N2O4rem\n",
+ "NaNO2pro2 = 69*N2O4rem\n",
+ "NaNO3pro2 = 85*N2O4rem\n",
+ "H2Opro2 = 18*N2O4rem\n",
+ "\n",
+ "# rxn (iii)\n",
+ "NO2reac3 = 3*n2*.0025\n",
+ "NaOHreac3 = 2*4.95*40\n",
+ "NaNO3pro3 = 2*4.95*85\n",
+ "H2Opro3 = 4.95*18\n",
+ "NO2abs2 = 33.33-NO2reac3\n",
+ "NaOHreac1 = 18.48*40\n",
+ "NaNO2pro1 = 69*NO2abs2/2\n",
+ "NaNO3pro1 = 85*NO2abs2/2\n",
+ "H2Opro1 = 18*NO2abs2/2\n",
+ "NaNO2t = NaNO2pro2 + NaNO2pro1\n",
+ "NaNO3t = NaNO3pro2+NaNO3pro3\n",
+ "H2Ot = H2Opro1+H2Opro2+H2Opro3\n",
+ "NaOHt = NaOHreac1+NaOHreac2+NaOHreac3\n",
+ "liq = 37500. #kg/h\n",
+ "NaOHin = liq*.236\n",
+ "NaOHout = NaOHin-NaOHt\n",
+ "moist = n2*.045*18\n",
+ "water = liq-NaOHin-H2Ot-moist #kg/h\n",
+ "\n",
+ "# Result\n",
+ "print \"Composition of final liquor :\"\n",
+ "print \"Component mi kg/h\"\n",
+ "print \" NaOH \",NaOHout\n",
+ "print \" NaNO2 \",NaNO2t\n",
+ "print \" NaNO3 \",NaNO3t\n",
+ "print \" H2O \",water\n",
+ "print \" b\"\n",
+ "\n",
+ "#(b)\n",
+ "#heat effect of scrubbing\n",
+ "#using tables 6.6 and 6.7\n",
+ "#fi1 = integ{59865.7+4545.8+10**-3 *T + 15266.3*10**-6*T**2-705.11*10**-9*T**3}\n",
+ "fi1 = -155941.3/3600 #kW\n",
+ "#similarly\n",
+ "fi2 = 75.778 #kW\n",
+ "dH1 = (-346.303-450.1-285.83-(2*(-468.257)+2*33.18))/2 #kJ/mol NO2\n",
+ "dH2 = -346.303-450.1-285.83-(2*(-468.257)+9.16) #kJ/mol N2O4\n",
+ "dH3 = (2*(-450.1)-285.83+90.25-(2*(-468.257)+3*33.18))/3 # kJ/mol NO2\n",
+ "dHdil = -469.837-(-468.257) #kJ/mol NaOH\n",
+ "fi3 = (dH1*1000*18.48+dH2*1000*27.32+dH3*1000*14.85+dHdil*1000*138.23)/3600 #kW\n",
+ "fi4 = -fi1+fi2+fi3\n",
+ "print \"Heat efeet of scrubbing system = \",fi4,\" kW.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.6 Page 361"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Acetic acid that remained unextracted = 14.9726315789 percent.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "#(a)\n",
+ "# basis 100 kg feed mix\n",
+ "# F = E +R = 100 (i)\n",
+ "xf = .475\n",
+ "xe = .82\n",
+ "xr = .14\n",
+ "#acetic acid balance\n",
+ "# xf*F = xe*E + xr*R (ii)\n",
+ "#solving (i) & (ii)\n",
+ "E = 49.2 #kg\n",
+ "R = 50.8 #kg\n",
+ "\n",
+ "# Calculation \n",
+ "a = R*xr #kg acetic acid leftover\n",
+ "b= (a/(xf*100))*100.\n",
+ "\n",
+ "# Result\n",
+ "print \" Acetic acid that remained unextracted = \",b,\" percent.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.7 Page 361"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Flow rate of ether to the system = 249.7844 kg/h and percentage of recovery oil = 91.4887470817 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# referring to fig 6.9\n",
+ "#basis 1000kg/h halibut livers\n",
+ "F = 1000. #kg/h\n",
+ "OILin = F*.257\n",
+ "Sin = F-OILin # solid in the charge\n",
+ "U = .23*Sin\n",
+ "\n",
+ "# Calculation \n",
+ "OILu = U*.128\n",
+ "Eu = U-OILu # ether in underflow\n",
+ "R = OILin-OILu #kg/h recovery of oil\n",
+ "p = R*100/OILin\n",
+ "O = R/.7 \n",
+ "Eo = O-R\n",
+ "Et = Eu+Eo\n",
+ "\n",
+ "# Result\n",
+ "print \" Flow rate of ether to the system = \",Et,\\\n",
+ "\" kg/h and percentage of recovery oil = \",p,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.8 Page 362"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Summary : \n",
+ " Stream Flow rate kg/h\n",
+ " Feed 1000.0\n",
+ " Solvent 806.383588647\n",
+ " Extract 1337.15318679\n",
+ " Raffinate 469.230401854\n",
+ " Acetic acid 271.256931608\n",
+ " Top layer from D1 738.075719471\n",
+ " Bottom layer from D1 327.820535714\n",
+ " Feed to C3 797.050937568\n",
+ " Overhead from C3 68.307869176\n",
+ " Water waste 728.743068392\n",
+ " Stream 1806.38358865\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "F = 1000. #kg/h Basis feed rate\n",
+ "# using fig 6.11\n",
+ "# W/A = 15.77/5.87\n",
+ "# A+F+W = 1000\n",
+ "# solving it\n",
+ "W = 15.77*F/21.64 #kg/h\n",
+ "A = F-W #kg/h\n",
+ "# material balance across C3\n",
+ "# R+R1 = D+W\n",
+ "# W/D = 19.31/1.81\n",
+ "\n",
+ "# Calculation \n",
+ "# solving it\n",
+ "D = 1.81*W/19.31 #kg/h\n",
+ "M1 = D+W\n",
+ "# R1/R = 4.63/6.57\n",
+ "R1 = 4.63*793/11.2\n",
+ "R = M1-R1\n",
+ "# material balance across C2\n",
+ "m = .89 # = E1/R1\n",
+ "# E = A+E1+R1 = A+M11\n",
+ "# M11/A = 15.6/3.97\n",
+ "M11 = 15.6*A/3.97\n",
+ "E = M11 + A\n",
+ "E1 = M11 - R1\n",
+ "# material balance across C1\n",
+ "# F+S = M = E+R\n",
+ "M = E+R\n",
+ "S = D+E1\n",
+ "AAloss = W*.4*100/(100*.3)\n",
+ "AArec = 100-AAloss\n",
+ "\n",
+ "# Result\n",
+ "print \" Summary : \"\n",
+ "print \" Stream Flow rate kg/h\"\n",
+ "print \" Feed \",F\n",
+ "print \" Solvent \",S\n",
+ "print \" Extract \",E\n",
+ "print \" Raffinate \",R\n",
+ "print \" Acetic acid \",A\n",
+ "print \" Top layer from D1 \",E1\n",
+ "print \" Bottom layer from D1 \",R1\n",
+ "print \" Feed to C3 \",M1\n",
+ "print \" Overhead from C3 \",D\n",
+ "print \" Water waste \",W\n",
+ "print \" Stream \",M\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.9 Page 367"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Percent yield of glauber salt = 77.9421927531 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100 kg free water\n",
+ "Na2SO4in = 32. #kg\n",
+ "Win = 68. #kg\n",
+ "\n",
+ "# Calculation \n",
+ "W1 = (180/142.)*32 #kg water with Na2SO4\n",
+ "Wfree1 = Win-W1\n",
+ "GS1 = ((Na2SO4in+W1)*100)/Wfree1 #kg glauber salt present in 100 kg free water\n",
+ "W2 = (180*19.4)/142. # water associated with Na2SO4 in final mother liquor\n",
+ "Wfree2 = 100-W2\n",
+ "GS2 = ((19.4+W2)/Wfree2)*100.\n",
+ "Y = GS1-GS2 #kg\n",
+ "p = Y*100/GS1\n",
+ "\n",
+ "# Result\n",
+ "print \"Percent yield of glauber salt = \",p,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.10 Page 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Quantity if original solution to be fed to the crystallizer per 1000kg crystals of MgSO4.7H2O = 1761.06816585 kg.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100kg free water in original sol\n",
+ "# initial T = 353K\n",
+ "W1 = (126/120.3)*64.2 #kg\n",
+ "Wfree1 = 100-W1\n",
+ "MS1 = ((64.20+W1)*100)/32.76 # MgSO4.7H2O in 100kg free water\n",
+ "\n",
+ "\n",
+ "# Calculation \n",
+ "# 4% of original sol evaporates\n",
+ "E = (MS1 + 100)*.04\n",
+ "Wfree2 = 100-E # free water in mother liquor\n",
+ "# at 303.15 K\n",
+ "W2 = (126/120.3)*40.8\n",
+ "Wfree3 = 100-W2\n",
+ "MS2 = (W2+40.80)*Wfree2/Wfree3 # crystals of MgSO4.7H2O\n",
+ "y = MS1-MS2 #kg \n",
+ "q = 501.2*1000/284.6 # quantity of original sol to be fed\n",
+ "\n",
+ "# Result\n",
+ "print \" Quantity if original solution to be fed to the crystallizer \\\n",
+ " per 1000kg crystals of MgSO4.7H2O = \",q,\"kg.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.11 Page 370"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Percentage recovery of p-DCB = 65.738385326 . b \n",
+ "Additional recovery of p-DCB = 25.6258199306 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# (a)\n",
+ "print \"a \",\n",
+ "# using fig 6.12\n",
+ "# peforming material balance at 290K\n",
+ "a1 = 5.76\n",
+ "b1 = 4.91\n",
+ "\n",
+ "# Calculation and Result\n",
+ "DCBs = b1*100/(a1+b1) # % of solid separated p-DCB\n",
+ "DCBr1 = DCBs*100/70. # recovery of p-DCB\n",
+ "print \"Percentage recovery of p-DCB = \",DCBr1,\". b \"\n",
+ "\n",
+ "#(b)\n",
+ "#at 255K\n",
+ "a2 = 5.76\n",
+ "b2 = 10.22\n",
+ "DCBs = b2*100/(a2+b2)\n",
+ "DCBr2 = (DCBs*100)/70\n",
+ "Ar = DCBr2-DCBr1\n",
+ "print \"Additional recovery of p-DCB = \",Ar,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.12 Page 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Composition of various streams : \n",
+ " Component T kg/h D kg/h\n",
+ " A 925.6 74.6 \n",
+ " B 345.1 3654.9\n",
+ " C 66.9 nil \n",
+ " Purity of top product = 69.2 percent A Purity of bottom product = 98.0 percent Make-up solvent = 66.9 kg/h.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "F = 5000. #kg/h solvent free mix fed to simple crystallization unit\n",
+ "B1 = 4000/157.5 # kmol/h p-NCB in feed\n",
+ "A1 = 1000/157.5 # kmol/h o-NCB in feed\n",
+ "\n",
+ "# Calculation \n",
+ "# after crstallization mother liquor has 33.1 mol % B, A doesn't crstallizes\n",
+ "m = A1/(1-.331) # mother liquor entering extractive crytallization unit\n",
+ "B2 = m-A1\n",
+ "\n",
+ "# optimizing solid flux\n",
+ "# dCt/dR = 1 - 2/R**3 = 0\n",
+ "R = 2**(1/3)\n",
+ "# referring fig 6.14\n",
+ "# overall material balance\n",
+ "# p-isomer (B)\n",
+ "# .98D + xT = 4000 (i)\n",
+ "# o-isomer (A)\n",
+ "# .02D + (1-.05-x)T = 1000 (ii)\n",
+ "# material balance around solvent recovery unit\n",
+ "# B\n",
+ "# 2.26Tx = .198G = xH (iii)\n",
+ "# A\n",
+ "# 2.26T(.95-x) = .531G (iv)\n",
+ "# solving above eq\n",
+ "T = 1337.6 # kg/h\n",
+ "D = 3729 # kg/h\n",
+ "G = 3939 # kg/h\n",
+ "x = .258\n",
+ "\n",
+ "# Result\n",
+ "#putting these values we get composition of various streams\n",
+ "print \" Composition of various streams : \"\n",
+ "print \" Component T kg/h D kg/h\"\n",
+ "print \" A 925.6 74.6 \"\n",
+ "print \" B 345.1 3654.9\"\n",
+ "print \" C 66.9 nil \"\n",
+ "print \" Purity of top product = 69.2 percent A Purity of bottom product \\\n",
+ "= 98.0 percent Make-up solvent = 66.9 kg/h.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.13 Page 383"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Dew Point = 252.97 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "Pw1 = 12.84 #Pa v.p. of ice at 233.15K (table 6.12)\n",
+ "P1 = 101325. #Pa\n",
+ "\n",
+ "# Calculation \n",
+ "Hm = (Pw1/(P1-Pw1)) # kmol/kmol dry air\n",
+ "P2 = 801325. #Pa\n",
+ "Pw2 = P2*.0001267/(1+.0001267)\n",
+ "dp = -20.18 + 273.15 #K from table 6.12\n",
+ "\n",
+ "# Result\n",
+ "print \"Dew Point = \",dp,\"K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.14 Page 384"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The absolute molar humidity = 0.0210583065135 kmol water vapour/kg dry air \n",
+ "Absolute humidity = 0.0130982666514 kg moisture/kg dry air percent RH = 51.5084915085 percent saturation = 50.4873424594 \n",
+ "Humid heat = 1.03010081064 kJ/kg dry air K \n",
+ "Humid volume = 0.88462068344 m**3/kg dry air.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "#Pa = v.p. at DP\n",
+ "Pw = 2.0624 #kPa\n",
+ "P = 100. #kPa\n",
+ "\n",
+ "# Calculation \n",
+ "Hm = Pw/(P-Pw) # kmol water vapour / kmol dry air\n",
+ "H = .622*Hm # kg moisture/kg dry air\n",
+ "\n",
+ "# at saturation, DB = WB = DP\n",
+ "Ps = 4.004 #kPa\n",
+ "RH = Pw*100/Ps\n",
+ "Hs = (Ps/(P-Ps))*.622\n",
+ "s = H*100/Hs\n",
+ "Ch = 1.006+1.84*H #kJ/kg dry air K\n",
+ "Vh = (.00073+.03448)*22.414*1.1062*1.0133 #m**3/kg dry air\n",
+ "# using fig 6.15\n",
+ "WB = 294.55 #K\n",
+ "ias = 62.3 # kJ/kg dry air\n",
+ "d = -.28 # kJ/kg dry air\n",
+ "ia = ias + d\n",
+ "\n",
+ "# Result\n",
+ "print \"The absolute molar humidity = \",Hm,\\\n",
+ "\" kmol water vapour/kg dry air \\nAbsolute humidity = \",H,\\\n",
+ "\" kg moisture/kg dry air percent RH = \",RH,\" percent saturation = \",s,\\\n",
+ "\" \\nHumid heat = \",Ch,\" kJ/kg dry air K \\nHumid volume = \",Vh,\" m**3/kg dry air.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.15 Page 385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " the moisture added to the air = 5.96 g/kg dry air DB temp of final air = 300.95 K WB temp of final air = 298.15 K The heating load of the steam coil per kg dry air = 108828.110731 kJ/h Steam consumption = 50.3088529638 kg/h.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "#basis 1kg of dry air entering the air washer\n",
+ "#from fig 6.15\n",
+ "H1 = 11.8 #g/kg dry air\n",
+ "H2 = 17.76 #g/kg dry air\n",
+ "H = H2-H1 # moisture added during saturation\n",
+ "DB = 300.95 #K\n",
+ "WB = 298.15 #K\n",
+ "DP = 297.15 #K\n",
+ "\n",
+ "# Calculation \n",
+ "Ch = 1.006+1.84*.01776 #kJ/kg dry air K\n",
+ "dT = DB-DP\n",
+ "Hs = Ch*3.8\n",
+ "A = 25000. #m**3/h actual air at 41 and 24 degree celcius\n",
+ "# again from fig 6.15\n",
+ "Vh = .9067 #m**3/kg dry air\n",
+ "qm = A/Vh #kg dry air/h\n",
+ "fi = qm*Hs #kJ/h\n",
+ "P = 300. #kPa\n",
+ "lamda= 2163.2 #kJ/kg by appendix IV.2\n",
+ "SC = fi/lamda #kg/h steam consumption at the heater\n",
+ "\n",
+ "# Result\n",
+ "print \" the moisture added to the air = \",H,\\\n",
+ "\" g/kg dry air DB temp of final air = \",DB,\\\n",
+ "\"K WB temp of final air = \",WB,\\\n",
+ "\"K The heating load of the steam coil per kg dry air = \",fi,\\\n",
+ "\" kJ/h Steam consumption = \",SC,\" kg/h.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.16 Page 387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Air leaves th induced draft fan at 307.583067857 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# M = E+B+W\n",
+ "Tav = (45+32.)/2 +273.15 #K avg cooling water T\n",
+ "# using steam tables (Appendix A IV.1)\n",
+ "lamda = 2410.5 #kJ/kg \n",
+ "E = 530/lamda #kg/s\n",
+ "Cl = 4.1868\n",
+ "Ti = 45+273.15 #K\n",
+ "To = 32+273.15 #K\n",
+ "fi = 530. # = mc*Cl*(Ti-To)\n",
+ "mc = 530/(Cl*(Ti-To)) #kg/s\n",
+ "W = .3*mc/100 #kg/s\n",
+ "\n",
+ "\n",
+ "# Calculation \n",
+ "# dissolved solid balance\n",
+ "# M*xm = (B+W)*xc\n",
+ "# 500*10**-6*M = (B+.0292)*2000*10**-6\n",
+ "# solving above eqs\n",
+ "B = .0441 #kg/s\n",
+ "M = .2932 #kg/s\n",
+ "\n",
+ "#energy balance on cooling tower\n",
+ "# fi = ma*(i2-i1)\n",
+ "# i2-i1 = 11.042 kJ/kg dry air\n",
+ "# moisture balance \n",
+ "#E = ma(H2-H1)\n",
+ "H2 = .2199/48 + .0196\n",
+ "iws = 2546.2 # Appendix IV\n",
+ "Ch1 = 1.006+1.84*.0196\n",
+ "i1 = 1.006*(297.45-273.15)+.0196*iws+1.042*(308.15-297.5) # kJ/kg dry air\n",
+ "i2 = i1 + 11.04\n",
+ "Tdb = ((i2 - 1.006*(301.25-273.15)-iws*H2)/1.05)+301.25 # K\n",
+ "\n",
+ "# Result\n",
+ "print \"Air leaves th induced draft fan at \",Tdb,\" K.\"\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.17 Page 389"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a The heat loss rate rate from the hot air in the bed = 397963.39774 kW b The percentage heat recovery in hot water = 79.5581997436 percent.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 1 kg dry air fed to tower\n",
+ "# from fig 6.16 we get\n",
+ "# at WB=330 K and DB=393 K\n",
+ "H1 = .0972 # kg/kg dry air\n",
+ "DP = 325.15 #K\n",
+ "# at 313 K\n",
+ "H2 = .0492 # kg/kg dry air\n",
+ "H = H1-H2 # moisture condensed in tower\n",
+ "\n",
+ "# Calculation \n",
+ "Ch1 = 1.006 + 1.84*H1 # kJ/kg dry air\n",
+ "Ch2 = 1.006 + 1.84*H2\n",
+ "ia1 = 1.006*(325-273) + H1*2596 + 1.185*(393-325) # enthalpy of entering air\n",
+ "ia2 = 1.006*(313-273) + H2*2574.4 # enthalpy of outgoing air\n",
+ "i = ia1-ia2\n",
+ "qm = 2000/(1+H1)\n",
+ "fi1 = qm*i # heat loss rate\n",
+ "fi2 = 1.167*3600*4.1868*(323-305) # heat gained by water\n",
+ "r = fi2*100/fi1\n",
+ "\n",
+ "# Result\n",
+ "print \"a The heat loss rate rate from the hot air in the bed = \",fi1,\\\n",
+ "\" kW b The percentage heat recovery in hot water = \",r,\" percent.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.18 Page 390"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Volumetric flowrate of entering mixture = 1732.08256916 m**3/h b Mass flowrate of activated carbon = 2228.57142857 kg/h c Original mixture must be coole to 281.5 K at 405 kPa for achieving same concentration of the outlet mixture with adsorption.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 800 kmol of inlet CS2-H2 mix\n",
+ "Pi = 106.7 #kPa Total Pressure\n",
+ "Pcs2i = 16.93 # kPa\n",
+ "n = 800. # kmol\n",
+ "\n",
+ "# Calculation \n",
+ "ncs2i = Pcs2i*n/Pi # kmol\n",
+ "nh2i = n-ncs2i\n",
+ "Po = 101.325 # kPa\n",
+ "Pcs2o = 6.19 # kPa\n",
+ "nh2o = 673.1 # kmol\n",
+ "ncs2o = Pcs2o*nh2o/(Po-Pcs2o)\n",
+ "ncs2a = ncs2i-ncs2o\n",
+ "mcs2a = ncs2a*76.1407 #kg\n",
+ "r = 600. # kg/h design adsorption rate\n",
+ "Mi = n*r/mcs2a # kmol/h\n",
+ "Vi = Mi*22.843 # m**3/h\n",
+ "mcs2ac = .32-.04 # kg CS2 absorbed per kg BD activated carbon\n",
+ "qm = r*1.04/mcs2ac # kg/h\n",
+ "C = ncs2o/nh2o # kmol CS2/kmol H2 = Pcs2/(P-Pcs2)\n",
+ "Pcs2 = 24.763 # kPa\n",
+ "T = 281.5 #K by eq 5.24\n",
+ "\n",
+ "# Result\n",
+ "print \"a Volumetric flowrate of entering mixture = \",Vi,\\\n",
+ "\" m**3/h b Mass flowrate of activated carbon = \",qm,\\\n",
+ "\" kg/h c Original mixture must be coole to \",T,\\\n",
+ "\" K at 405 kPa for achieving same concentration of the outlet mixture with adsorption.\" \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.19 Page 391"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " The heat liberation rate in the tower = 70323.4193977 kJ/h.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 4000 kg/h of NaOH produced\n",
+ "Cl2p = 35.5*2*4000/80 # kg/h\n",
+ "Mcl2 = Cl2p/71 # kmol/h\n",
+ "P = 101.325 # kPa\n",
+ "Pw = 2.0624 # kPa\n",
+ "\n",
+ "# Calculation \n",
+ "moist = (Pw/(P-Pw))*(18.0154/70.906) \n",
+ "Tmoist = Cl2p*moist # kg/h\n",
+ "# for 90% onc of acid\n",
+ "n = (10/18.0153)/(90/98.0776) # kmol H2O/kmol acid\n",
+ "Q = 134477/(18.*(n+1.7983)**2) #kJ/kg H2O by eq (ii)\n",
+ "lambdav = 2459. # kJ/kg (Appendix IV)\n",
+ "heatload = Q+lambdav\n",
+ "fi = heatload*18.74 #kJ/h\n",
+ "\n",
+ "# Result\n",
+ "print \" The heat liberation rate in the tower = \",fi,\" kJ/h.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.20 Page 393"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Temp of feed water to absorber = 291.367208278 K. b Temp of aq NH3 sol leaving the absorber = 304.469504086 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100 kmol of feed gas\n",
+ "# using table 5.1\n",
+ "Sniai = 20.6*29.5909+62*28.6105+4.1*20.7723+11.1*19.2494+2.2*25.6503\n",
+ "Snibi = (20.6*(-5.141)+62*1.0194+11.1*52.1135+2.2*33.4806)/1000\n",
+ "Snici = (20.6*13.1829+62*(-.1476)+11.1*11.973+2.2*.3518)/10**6\n",
+ "Snidi = (20.6*(-4.968)+62*.769+11.1*(-11.3173)+2.2*(-3.0832))/10**9\n",
+ "Hgas = Sniai*(283-263) + Snibi*(283**2-263**2)/2 + Snici*(283**3-263**3)/3 + Snidi*(283**4-263**4)/4 #kJ\n",
+ "Hnh3 = 1533.8 #kJ \n",
+ "\n",
+ "# Calculation \n",
+ "SniCmpi = (Hgas-Hnh3)/20 # kJ/(K 97.8 kmol gas) NH3 free gas\n",
+ "Go = 97.8/.99995 #kmol\n",
+ "NH3a = (2.2-.005)*17 # kg\n",
+ "F1 = NH3a/.04 # flowrate of 4% NH3 solution\n",
+ "Water = F1-NH3a #kg\n",
+ "dT1 = Hgas/(Water*4.1868) # K\n",
+ "Twater = 307-dT1 #K\n",
+ "Wvp = 2.116 #kPa\n",
+ "P = 5101.325 #kPa\n",
+ "moist = Go*Wvp/(P-Wvp) # kg\n",
+ "W = Water + moist # total demineralised water\n",
+ "dTactual = Hgas/(W*4.1868) #K\n",
+ "# from table 5.59\n",
+ "dHf1 = -80.093 #kJmol NH3 of 4% NH3 sol\n",
+ "dHf2 = -46.11 #kJ/molNH3\n",
+ "H = dHf1-dHf2 # heat of 4% NH3 sol\n",
+ "Hevl = -(H*NH3a*1000)/17. # total heat evolved\n",
+ "\n",
+ "# in absorber gas is further heated from 283K to 291.4K\n",
+ "Hsol = Hevl-(2854.1*(291.4-283.15)) # kJ\n",
+ "# c 0f 4% NH3 sol = c of water = 4.1868 kJ/kg K\n",
+ "dT2 = Hsol/(F1*4.1868) \n",
+ "To = 291.4+dT2\n",
+ "\n",
+ "# Result\n",
+ "print \"a Temp of feed water to absorber = \",Twater,\\\n",
+ "\"K. b Temp of aq NH3 sol leaving the absorber = \",To,\"K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.21 Page 396"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Flowrate of incoming air on dry basis = 4.25 kg/s b Humidity of air leaving the drier = 0.056 kg/kg dry air. c Steam consumption in the heater = 0.181547726207 kg/h.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis : product rate of 100 kg/h\n",
+ "H1 = .036 # kg moist/ kg dry solid\n",
+ "X1 = .25/.75 # kg /kg dry solid\n",
+ "X2 = .02/.98 # kg/kg dry solid\n",
+ "\n",
+ "# Calculation \n",
+ "# moist balance\n",
+ "# ms*(X1-X2) = ma*(H2-H1)\n",
+ "To = 273.15 #K\n",
+ "is1 = 1.43*(30-0)+X1*4.1868*30 \n",
+ "is2 = 1.43*80+.0204*4.1868*80\n",
+ "Tdb = 393.15 #K\n",
+ "Tdp1 = 308.15 #K\n",
+ "iwb1 = 2565.4 #kJ/kg\n",
+ "Ch1 = 1.006+1.84*.036\n",
+ "ia1 = 1.006*(Tdp1-273.15)+H1*iwb1+Ch1*(Tdb-Tdp1)\n",
+ "H2 = .056\n",
+ "Tdp2 = 315.55\n",
+ "iwb2 = 2578.7\n",
+ "ia2 = 1.006*(Tdp2-273.15)+H2*iwb2+(1.006+1.84*H2)*(323.15-Tdp2)\n",
+ "ma = .085/(.056-.036)\n",
+ "iaa = 1.006*(Tdp1-273.15)+H1*iwb1\n",
+ "fi = 4.25*(218.68-iaa) #kW\n",
+ "lambda_ = 2133.0\n",
+ "steam = fi/lambda_ # kg/h\n",
+ "\n",
+ "# Result\n",
+ "print \"a Flowrate of incoming air on dry basis = \",ma,\\\n",
+ "\" kg/s b Humidity of air leaving the drier = \",H2,\\\n",
+ "\" kg/kg dry air. c Steam consumption in the heater = \",steam,\" kg/h.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.22 Page 398"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Bone dry production of the dryer = 471.96 kg/h. b The evaporation taking place in the dryer = 396.4464 kg/h. c The air circulation rate = 5377.43182932 m**3/h.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables\n",
+ "# basis cloth speed = 1.15 m/s\n",
+ "prod = 1.15*1.2*3600*.095\n",
+ "moisti = .90 # kg/kg bone dry cloth \n",
+ "moisto = .06\n",
+ "evp = 471.96*(moisti-moisto)\n",
+ "\n",
+ "# using fig 6.15 and 6.16\n",
+ "H1 = .01805 \n",
+ "H2 = .0832\n",
+ "dH = H2-H1\n",
+ "qm1 = evp/dH # kg dry air/h\n",
+ "Vh = .8837 #m**3/kg dry air\n",
+ "qv = qm1*Vh\n",
+ "DP1 = 296.5 #K\n",
+ "DP2 = 322.5 #K\n",
+ "lambdaV2 = 2384.1 #kJ/kg\n",
+ "To = 273.15 #K\n",
+ "\n",
+ "# Calculation \n",
+ "fi1 = prod*1.256*(368-303)+prod*.06*(368-303)*4.1868 # kJ/h\n",
+ "fi2 = evp*(322.5-303.15)+evp*lambdaV2 #kJ/h\n",
+ "ia1 = 1.006*(303.15-273.15)+2556.4*.01805 #kJ/kg dry air\n",
+ "ia2 = 1.006*(322.8-273.15)+2591.5*.0832+(1.006+1.84*.0832)*(393-328.8)\n",
+ "fi2 = ia2-ia1\n",
+ "hlost = fi2-fi1 # kJ/h\n",
+ "# using Appendix IV\n",
+ "h = 720.94 #kJ/kg\n",
+ "lambdav = 2046.5 # kJ/kg\n",
+ "steami = (h+lambdav)*885 # kJ/h\n",
+ "fi4 = h*885 #kJ/h\n",
+ "qm2 = 885/evp\n",
+ "\n",
+ "# Result\n",
+ "print \"a Bone dry production of the dryer = \",prod,\\\n",
+ "\" kg/h. b The evaporation taking place in the dryer = \",evp,\\\n",
+ "\" kg/h. c The air circulation rate = \",qv,\" m**3/h.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.23 Page 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Specific heat consumption of the system is 0.511230907457 kg steam/kg evaporation.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis : weak liquor flowrate = 1060 kg/h\n",
+ "s1 = 1060*.04 #kg/h solids in weak liquor\n",
+ "liqr = s1/.25 # kg/h conc liquor leaving 4th effect\n",
+ "evp = 1060-liqr # kg/h\n",
+ "lambdas = 2046.3 # kJ/kg\n",
+ "Wf = 1060. # kg/h\n",
+ "C1f = 4.04\n",
+ "T1 = 422.6\n",
+ "Tf = 303\n",
+ "lambdav1 = 2114.4\n",
+ "\n",
+ "\n",
+ "# Calculation \n",
+ "# enthalpy balance of 1st effect\n",
+ "# Ws*lambdas = Wf*C1f*(T1-Tf) + (Wf-W1)*2114.4\n",
+ "#putting values we get\n",
+ "# Ws = 1345.57 - 1.033*W1\n",
+ "# 2nd effect\n",
+ "# W1 = 531.38+.510*W2\n",
+ "# 3rd effect\n",
+ "# W1 - 1.990*W2 = -1.027*W3\n",
+ "# 4th effect\n",
+ "# W2 - 1.983*W3 = -176.84\n",
+ "#solving above eqs\n",
+ "W1 = 862. # kg/h\n",
+ "W2 = 648.2 # kg/h\n",
+ "W3 = 416.7 # kg/h\n",
+ "Ws = 455.2 # kg/h\n",
+ "eco = evp/Ws # kg evaporation/kg steam\n",
+ "spcon = 1/eco # kg steam/kg evaporation\n",
+ "\n",
+ "# Result\n",
+ "print \"Specific heat consumption of the system is \",spcon,\" kg steam/kg evaporation.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.24 Page 403"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "By mass balance, required cooling water flow in external cooler = 57684.2098978 kg/h.By enthalpy balance, overall rise in CCW temperature = 8.80728433048 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "Fspd1 = 4300. # kg/h\n",
+ "Bcrtn = Fspd1*600*10**-6 # kg/h\n",
+ "Fspd2 = Bcrtn/.00645 # kg/h\n",
+ "evp1 = Fspd1-Fspd2\n",
+ "Fspd3 = Bcrtn/.057\n",
+ "evp2 = Fspd2-Fspd3\n",
+ "C3 = Bcrtn/.4\n",
+ "evp3 = Fspd3-C3\n",
+ "\n",
+ "# Calculation \n",
+ "fi1 = Fspd1*2.56*(468.15-373.15)+3900*450 # kJ/h\n",
+ "fi2 = Fspd2*2.56*(463.15-468.15)+354.737*450 # kJ/h\n",
+ "fi3 = Fspd3*2.56*(453.15-463.15)+38.813*450 # kJ/h\n",
+ "fi = fi1+fi2+fi3\n",
+ "mt = fi/(2.95*(503.15-478.15)) # kg/h\n",
+ "qt = mt/.71 # l/h\n",
+ "mccw1 = 1755000/(8*4.1868) # kg/h\n",
+ "mccw2 = mccw1*.9 \n",
+ "dT2 = 159632/(mccw2*4.1868)\n",
+ "mccw3 = mccw1-mccw2\n",
+ "dT3 = 17466/(mccw3*4.1868)\n",
+ "dT = (1755000+159632+17466)/(mccw1*4.1868)\n",
+ "Fw = 1932098/(8*4.1868) # kg/h\n",
+ "\n",
+ "# Result\n",
+ "print \"By mass balance, required cooling water flow in external cooler = \",Fw,\\\n",
+ "\" kg/h.By enthalpy balance, overall rise in CCW temperature = \",dT,\" K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.25 Page 405"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Material balance thickener ITEM STREAM, kg/h M2 O2 M1 O1 W Mo Slurry 14917.5166812 52985.3076 26839.6907216 64907.4816404 55206.3736997 17803.3637049 Suspended solids 5206.21332174 15.89559228 5206.21332174 12.9814963281 2042.63582689 7156.95220938 Liquor 9711.30335947 52969.4120077 21632.7907216 64894.5001441 53163.7378728 10646.4114955 Na2O 1116.75827836 1389.36162643 527.220818361 614.385800181 127.592970895 168.759164606\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "#stream M2\n",
+ "Vcaco3M2 = .349/2.711\n",
+ "VliqrM2 = .651/1.167\n",
+ "VslryM2 = Vcaco3M2+VliqrM2\n",
+ "spgM2 = 1/VslryM2\n",
+ "FsM2 = 2.845*3600*spgM2\n",
+ "sM2 = FsM2*.349 # kg/h\n",
+ "liqrM2 = FsM2*.651\n",
+ "Na2OM2 = liqrM2*.1342/1.167\n",
+ "\n",
+ "# Calculation \n",
+ "#stream O2\n",
+ "FsO2 = 14.193*3600*1.037 # kg/h\n",
+ "sO2 = FsO2*.0003\n",
+ "liqrO2 = FsO2-sO2\n",
+ "Na2OO2 = liqrO2*.0272/1.037\n",
+ "#stream M1\n",
+ "VM1 = .194/2.711 + .806/1.037 # l\n",
+ "spgM1 = 1/VM1\n",
+ "FsM1 = 5206.9/.194\n",
+ "liqrM1 = FsM1 - 5206.9\n",
+ "Na2OM1 = liqrM1*.0252/1.034\n",
+ "# stream O1\n",
+ "FsO1 = FsO2+FsM1-FsM2\n",
+ "sO1 = FsO1*.0002\n",
+ "liqrO1 = FsO1 - sO1\n",
+ "Na2OO1 = liqrO1*.0096/1.014\n",
+ "# stream W\n",
+ "VW = .037/2.711 + .963\n",
+ "spgW = 1/VW\n",
+ "FsW = 14.977*3600*spgW\n",
+ "sW = FsW*.037\n",
+ "liqrW = FsW-sW\n",
+ "Na2OW = liqrW*.0024\n",
+ "# stream Mo\n",
+ "VMo = .402/2.711 + .598/1.022\n",
+ "spgMo = 1/VMo\n",
+ "FsMo = 3.627*3600*spgMo\n",
+ "sMo = FsMo*.402\n",
+ "liqrMo = FsMo - sMo\n",
+ "Na2OMo = liqrMo*.0162/1.022\n",
+ "\n",
+ "# Result\n",
+ "print \" Material balance thickener ITEM STREAM, kg/h M2 O2 M1\\\n",
+ " O1 W Mo Slurry \",FsM2,\" \",FsO2,\" \",FsM1,\" \",FsO1,\\\n",
+ " \" \",FsW,\" \",FsMo,\" Suspended solids \",sM2,\" \",sO2,\\\n",
+ " \" \",sM2,\" \",sO1,\" \",sW,\" \",sMo,\" Liquor \",liqrM2,\\\n",
+ " \" \",liqrO2,\" \",liqrM1,\" \",liqrO1,\" \",liqrW,\" \",liqrMo,\\\n",
+ " \" Na2O \",Na2OM2,\" \",Na2OO2,\" \",Na2OM1,\" \",Na2OO1,\" \",Na2OW,\\\n",
+ " \" \",Na2OMo\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch7.ipynb b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch7.ipynb
new file mode 100644
index 00000000..34e27ebc
--- /dev/null
+++ b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/ch7.ipynb
@@ -0,0 +1,712 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 7 : Combustion"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 7.1 Page 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Net H2 in coal = 0.535 kg. b \n",
+ "Combined water in the coal = 20.304 kg. c \n",
+ "GCV by Dulongs formula = 17855.94 kJ/kg. d \n",
+ "NCV of the coal = 16057.95325 kJ/kg. e \n",
+ "Total Carbon by Calderwood eq = 43.5822593081 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100 kg as received coal\n",
+ "O2 = 18.04 #kg\n",
+ "nH2 = 2.79-(O2/8) #kg\n",
+ "print \"a Net H2 in coal = \",nH2,\" kg. b \"\n",
+ "cbW = 1.128*18 # kg \n",
+ "print \"Combined water in the coal = \",cbW,\" kg. c \"\n",
+ "\n",
+ "# Calculation \n",
+ "# Dulong's formula\n",
+ "GCV1 = 33950*(50.22/100) + 144200*nH2/100 + 9400*.37/100 # kJ/kg\n",
+ "\n",
+ "# Result\n",
+ "print \"GCV by Dulongs formula = \",GCV1,\" kJ/kg. d \"\n",
+ "tH2 = 1.395 # kmol\n",
+ "wp = tH2*18 + 7\n",
+ "Hv = 2442.5*wp/100 # kJ/kg fuel\n",
+ "GCV2 = 23392*(1-.21-.07) # as of received coal\n",
+ "NCV = GCV2-Hv\n",
+ "print \"NCV of the coal = \",NCV,\" kJ/kg. e \"\n",
+ "# Calderwood eq\n",
+ "# Total C = 5.88 + .00512(B-40.5S) +- .0053[80-100*(VM/FC)]**1.55\n",
+ "C = 5.88 + .00512*(7240.8-40.5*.37)+.0053*(80-56.52)**1.55\n",
+ "print \"Total Carbon by Calderwood eq = \",C,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 7.2 Page 436"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "NCV = 42323.1875 kJ/kg.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 1 kg crude oil\n",
+ "H2 = .125 # kg burnt\n",
+ "\n",
+ "# Calculation \n",
+ "H2O = H2*18/2.\n",
+ "Lh = H2O*2442.5 #kJ\n",
+ "GCV = 45071\n",
+ "NCV = GCV-Lh #kJ/kg oil\n",
+ "\n",
+ "# Result\n",
+ "print \"NCV = \",NCV,\" kJ/kg.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 7.3 Page 444"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "NHV = 2043.160519 kJ/mol.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "# Variables \n",
+ "\n",
+ "# basis 1 mol of gaseous propane\n",
+ "H2O = 4*18.0153 #g\n",
+ "\n",
+ "# Calculation \n",
+ "NHV = 2219.17-(H2O*2442.5/1000.)\n",
+ "\n",
+ "# Result\n",
+ "print \"NHV = \",NHV,\" kJ/mol.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 7.4 Page 444"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " GCV = 52126.6269579 kJ/kg. NCV = 47260.2164681 kJ/kg.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 1 mol of natural gas\n",
+ "# using table 7.7\n",
+ "# Calculation \n",
+ "H2O = (2*.894+3*.05+.019+5*(.004+.006))*18 # g\n",
+ "Hv = H2O*2442.5/1000.\n",
+ "NCV1 = 945.16-Hv\n",
+ "GCV = 945.16*1000/18.132\n",
+ "NCV = NCV1*1000/18.132\n",
+ "\n",
+ "# Result\n",
+ "print \" GCV = \",GCV,\" kJ/kg. NCV = \",NCV,\" kJ/kg.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 7.5 Page 451"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Theoratical O2 requirement per unit mass of coal = 1.38592 kg. b Theoratical dry air requirement = 5.94790666667 kg/kg coal.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100 kg fuel\n",
+ "O2req = 4.331*32 # kg\n",
+ "\n",
+ "# Calculation \n",
+ "rO2req = O2req/100\n",
+ "N2in = (79/21.)*4.331 # kmol\n",
+ "AIRreq = O2req+N2in*28 #kg\n",
+ "rAIRreq = AIRreq/100.\n",
+ "R = AIRreq/100.\n",
+ "AIRspld = R*2 # kg/kg coal\n",
+ "O2spld = 4.331*2 # kmol\n",
+ "N2spld = N2in*2\n",
+ "N2coal = 2.05/28 # kmol\n",
+ "tN2 = N2spld+N2coal\n",
+ "moist = 1.395+(7/18.) # kmol\n",
+ "\n",
+ "# Result\n",
+ "print \"a Theoratical O2 requirement per unit mass of coal = \",rO2req,\\\n",
+ "\" kg. b Theoratical dry air requirement = \",rAIRreq,\" kg/kg coal.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 7.6 Page 452"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Theoretical air required = 13.514 kg/kg fuel. \n",
+ "b Actual dry air supplied = 0.5825 kg/kg fuel. \n",
+ "c Concentration of SO2 = 2490.75695661 mg/kg. \n",
+ "d Concentration of SO2 = 1135.99480688 ppm vol/vol.\n",
+ "e Concentration of SO2 if gases are discharged at 523.15K and100.7kPa = 1683.25355648 mg/m**3. \n",
+ "f Dew Point of flue gas = 424.4 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100 kg of RFO\n",
+ "O2req = 9.786 #kmol\n",
+ "N2req = (79/21.)*O2req #kmol\n",
+ "AIRreq = O2req+N2req #kmol\n",
+ "rAIRreq = AIRreq*29/100\n",
+ "AIRspld = AIRreq*1.25\n",
+ "rAIRspld = AIRspld/100\n",
+ "\n",
+ "\n",
+ "# Calculation \n",
+ "# using table 7.11 and 7.12\n",
+ "xSO2 = .07/(55.925+5.695) # kmol SO2/kmol wet gas\n",
+ "vSO2 = xSO2*10**6 # ppm\n",
+ "mSO2 = 4.48*10**6/(1696.14+102.51)\n",
+ "\n",
+ "# at 523.15 K and 100.7 kPa\n",
+ "V = ((55.925+5.695)*8.314*523.15)/100.7 # m**3\n",
+ "cSO2 = (4.48*10**6)/V # mg/m**3\n",
+ "#from fig 7.3\n",
+ "dp = 424.4 #K\n",
+ "\n",
+ "# Result\n",
+ "print \"a Theoretical air required = \",rAIRreq,\" kg/kg fuel. \"\n",
+ "print \"b Actual dry air supplied = \",rAIRspld,\" kg/kg fuel. \"\n",
+ "print \"c Concentration of SO2 = \",mSO2,\" mg/kg. \"\n",
+ "print \"d Concentration of SO2 = \",vSO2,\" ppm vol/vol.\"\n",
+ "print \"e Concentration of SO2 if gases are discharged at 523.15K and100.7kPa = \",cSO2,\" mg/m**3. \"\n",
+ "print \"f Dew Point of flue gas = \",dp,\" K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 7.7 Page 454"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Percent excess air = 23.0320699708 . b In fuel C:H = 5.00333333333 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100 kmol of dry flue gas\n",
+ "O2acntd = 11.4+4.2 # kmol\n",
+ "O2avlbl = (21./79)*84.4 # kmol\n",
+ "O2excs = 4.2 #kmol\n",
+ "\n",
+ "# Calculation \n",
+ "O2unactd = O2avlbl-O2acntd\n",
+ "H2brnt = O2unactd*2\n",
+ "O2req = 11.4+O2unactd\n",
+ "pexcsAIR = O2excs*100/O2req\n",
+ "mH2brnt = H2brnt*2 # kg\n",
+ "mCbrnt = 11.4*12\n",
+ "r = mCbrnt/mH2brnt\n",
+ "\n",
+ "# Result\n",
+ "print \"a Percent excess air = \",pexcsAIR,\". b In fuel C:H = \",r,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 7.8 Page 459"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a Theoretical air required = 2.3432 kg dry air/kg fuel. \n",
+ " b Percent excess air = 30.2652456295 . \n",
+ " c Dew Point of flue gas = 339.85 K. \n",
+ " d Thermal efficiency of the boiler = 0.728802718447 .\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables \n",
+ "# basis 100 kg of bagasse fired in th boiler\n",
+ "#(a)\n",
+ "O2req = 2.02 # kmol\n",
+ "N2in = (79/21)*O2req # kmol\n",
+ "AIRreq = (O2req+N2in)*29 # kg\n",
+ "rAIR = AIRreq/100\n",
+ "print \"a Theoretical air required = \",rAIR,\" kg dry air/kg fuel. \\n b \",\n",
+ "\n",
+ "# Calculation \n",
+ "# (b)\n",
+ "tflugas = 1.95/.1565 #/kmol\n",
+ "xcsO2N2 = tflugas - 1.95\n",
+ "x = (xcsO2N2-7.6)/4.76 # kmol\n",
+ "pxcsAIR = x*100/O2req\n",
+ "\n",
+ "# Result\n",
+ "print \"Percent excess air = \",pxcsAIR,\". \\n c \",\n",
+ "#(c)\n",
+ "pW = 100*.2677 # kPa partial p of water vap\n",
+ "# from fig 6.13\n",
+ "dp = 339.85 #K\n",
+ "print \"Dew Point of flue gas = \",dp,\"K. \\n d \",\n",
+ "# (d)\n",
+ "# from appendix IV\n",
+ "hfw = 292.97 #kJ/kg enthalpy of feed water at 343.15 K\n",
+ "Hss = 3180.15 # kJ/kg enthalpy of super heated steam at 2.15 bar and 643.15K\n",
+ "Hgain = Hss - hfw\n",
+ "H6 = Hgain*2.6*100 # kJ heat gained by water\n",
+ "H1 = 100*1030000. # kJ\n",
+ "GCV = H6*100/H1\n",
+ "print \"Thermal efficiency of the boiler = \",GCV,\".\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 7.9 Page 465"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Overall efficiency rate = 0.0230701331531 percent.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "\n",
+ "# Variables \n",
+ "# using mean heat capacity data Table 7.21\n",
+ "# basis 100 kmol of dry flue gas\n",
+ "\n",
+ "# Calculation \n",
+ "H7 = 1.0875*100*30.31*(423.15-298.15)\n",
+ "H71 = 3633.654*(423.15-298.15)\n",
+ "fi7 = H71*3900*.7671/162.2 # kJ/h\n",
+ "fi1 = 3.9*1000*26170 # kJ/h\n",
+ "# performing heat balance\n",
+ "Hsteamgen = 23546.07 \n",
+ "eff = Hsteamgen*100/fi1 # overall efficiency rate\n",
+ "\n",
+ "# Result\n",
+ "print \"Overall efficiency rate = \",eff,\" percent.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 7.10 Page 468"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a NCV = 41561.332 kJ/kg. \n",
+ " b Theoretical air required = 12.8699733333 kg/kg fuel. \n",
+ " c When fluid is burnt with theoretical air AFT = 2612.71 K. d \n",
+ "When 30 percent excess air is supplied AFT = 2178.66 K. d Dew Point = 429.0 K. e For incomplete combustion AFT = 2561.42 K.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "\n",
+ "# Variables \n",
+ "# basis 100 kg of fuel oil\n",
+ "O2req = 9.364 # kmol\n",
+ "N2in = (79/21.)*O2req\n",
+ "tN2 = N2in+.036\n",
+ "AIRreq = O2req*32 + tN2*28 \n",
+ "rAIR = AIRreq/100. # kg/kg\n",
+ "wp = 4.5 # kmol\n",
+ "Hloss = 2442.8*wp*18/100 # kJ/kg fuel\n",
+ "NCV = 43540-Hloss\n",
+ "print \"a NCV = \",NCV,\" kJ/kg. \\n b Theoretical air required = \",rAIR,\" kg/kg fuel. \\n c \",\n",
+ "H1 = 100*41561.33 # kJ\n",
+ "\n",
+ "# Calculation \n",
+ "# from table 5.1\n",
+ "H71 = 1349.726*(1500-298.15)+252.924*10**-3 * ((1500**2-298.15**2)/2)+ \\\n",
+ "257.436*10**-6*((1500**3-298.15**3)/3)-137.532*10**-9*((1500**4-298.15**4)/4) # upto 1500 K\n",
+ "H711 = H1-H71 # above 1500K\n",
+ "# F(T) = {1500 to T} integr[1477.301+375.2710*10**-3T-91.2760*10**-6T**2+8.146*10**-9T**3]dT-2147118 (i)\n",
+ "# solving it for T = 2000\n",
+ "AFT = 2612.71 # K\n",
+ "\n",
+ "# Result\n",
+ "print \"When fluid is burnt with theoretical air AFT = \",AFT,\" K. d \"\n",
+ "# with 30% excess air\n",
+ "O2spld = 9.364*1.3\n",
+ "xcsO2 = O2spld-O2req\n",
+ "N2in1 = (79/21.)*O2spld\n",
+ "tN21 = N2in1+.036\n",
+ "# now, using table 7.26, table 7.27 and eq(i) we get\n",
+ "AFT1 = 2178.66 # K\n",
+ "# from fig 7.3\n",
+ "dp = 429. # K\n",
+ "# similarly for incomplete combustion we find\n",
+ "AFT2 = 2561.42 #K\n",
+ "print \"When 30 percent excess air is supplied AFT = \",AFT1,\\\n",
+ "\" K. d Dew Point = \",dp,\" K. e For incomplete combustion AFT = \",AFT2,\" K.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 7.11 Page 473"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " After performing material and thermal balance operations we get Overall thermal efficiency of the boiler based on GCV of the fuel = 67.4403345362 percent. Overall efficiency of the boiler based on NCV of the fuel = 71.464013185 percent. Steam to fuel ratio = 10.9125 at 16 bar. Equivalent boiler capacity = 5051.22697062 kg/h.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables\n",
+ "# basis 100 kg of fuel\n",
+ "# material balance of carbon\n",
+ "CO2 = 7.092+.047 #kmol in flue gases\n",
+ "N2 = 11.94*7.139/7.01\n",
+ "O2 = 11.94*7.139/7.01\n",
+ "flue = CO2+N2+O2\n",
+ "\n",
+ "# Calculation \n",
+ "# material balance of O2\n",
+ "O2air = 21*N2/79.\n",
+ "airin = N2+O2air\n",
+ "tO2in = O2air+.078 # O2 in burner\n",
+ "O2xcs = tO2in-9.864\n",
+ "# material balance of water vapour\n",
+ "moistfrmd = 5.45 # kmol from combustion of H2\n",
+ "H = .0331 # kmol/kmol of dry air humidity at 100.7 kPa\n",
+ "moistair = H*104.482 #kmol\n",
+ "tmoist = moistfrmd+moistair\n",
+ "pxcsair = O2xcs*100/9.786\n",
+ "# now using table 7.32\n",
+ "H7 = 3391.203*(563.15-298.15) #kJ\n",
+ "Ff = 400. # kg/h fuel firing rate\n",
+ "tH = 2791.7-179.99 # kJ/kg total heat supplied in boiler\n",
+ "fi5 = tH*4365 # kJ/h\n",
+ "fi8 = 5.45*18*Ff*2403.5/100 # kJ/h\n",
+ "GCVf = 42260. #kJ/kg\n",
+ "fi1 = Ff*GCVf\n",
+ "Fdryair = 104.482*29*Ff/100\n",
+ "Cha = 1.006+1.84*.0205 # kJ/kg dry air K\n",
+ "fi3 = Fdryair*Cha*(308.15-298.15)\n",
+ "fi2 = Ff*1.758*(353.15-298.15)\n",
+ "BOILEReff1 = fi5*100/fi1\n",
+ "NCVf = GCVf-(18.0153/2.016)*.109*2442.8 # kJ/kg\n",
+ "BOILEReff2 = fi5*100/(Ff*NCVf)\n",
+ "r = 4365/Ff # steam:fuel\n",
+ "BOILERcapacity = fi5/2256.9\n",
+ "\n",
+ "# Result\n",
+ "print \" After performing material and thermal balance\\\n",
+ " operations we get Overall thermal efficiency of the boiler based on GCV\\\n",
+ " of the fuel = \",BOILEReff1,\" percent. Overall efficiency of the boiler based\\\n",
+ " on NCV of the fuel = \",BOILEReff2,\" percent. Steam to fuel ratio = \",r,\" \\\n",
+ " at 16 bar. Equivalent boiler capacity = \",BOILERcapacity,\" kg/h.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 7.12 Page 478"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " a Moistproducer gas obtained = 3.9053717744 Nm**3/kg coal. \n",
+ " b Air supplied = 3.15945684695 kg/kg coal gassified. \n",
+ " c Steam supplied = 0.289649027717 kg/kg coal.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables\n",
+ "# basis 100 kmol of dry producer gas\n",
+ "C = 33*12. # kg\n",
+ "O2 = 18.5*32 #kg\n",
+ "H2 = 20*2. # kg\n",
+ "O2air = 21*51/79. # kmol\n",
+ "COALgassified = 396/.672 # kg\n",
+ "\n",
+ "# Calculation \n",
+ "O2coal = COALgassified*.061/32 # kmol\n",
+ "tO2 = O2coal + O2air\n",
+ "O2steam = 18.5-tO2 # kmol\n",
+ "H2steam = 2*O2steam # kmol\n",
+ "H2fuel = 20-H2steam\n",
+ "dryproducergas = 100*22.41/COALgassified # Nm**3/kg coal\n",
+ "Pw = 2.642 # kPa\n",
+ "Ha = Pw/(100.7-Pw) # kmol/kmol dry gas\n",
+ "water = Ha*100.\n",
+ "moistproducergas = (100+water)*22.41/COALgassified # Nm**3/kg coal\n",
+ "dryair = (51*28+O2air*32)/COALgassified # kg/kg coal\n",
+ "tsteamsupplied = H2steam+water-(COALgassified*.026/18) # kmol\n",
+ "steam = tsteamsupplied*18/COALgassified\n",
+ "\n",
+ "# Result\n",
+ "print \" a Moistproducer gas obtained = \",moistproducergas,\" Nm**3/kg coal. \\n \\\n",
+ " b Air supplied = \",dryair,\" kg/kg coal gassified. \\n c Steam supplied = \",steam,\" kg/kg coal.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 7.13 Page 479"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat Balance of Waste Heat Boiler kJ/h \n",
+ "Heat Output Steam rising Economiser 2864424.0 \n",
+ "Steam generator 14971273.0 \n",
+ "Super heater 1856650.0 \n",
+ "Heat loss in flue gases 11409604.8615 \n",
+ "Unaccounted heat loss 4715492.33477\n"
+ ]
+ }
+ ],
+ "source": [
+ "# solution \n",
+ "\n",
+ "# Variables\n",
+ "# solving by alternate method on page 483\n",
+ "# basis 100 kmol of dry producer gas\n",
+ "# using tables 7.38 and 7.39\n",
+ "fi7 = 6469.67*(833.15-298.15)*(27650/2672.) # kJ/h\n",
+ "\n",
+ "# Calculation \n",
+ "# heat output basis 1 kg of steam\n",
+ "# referring Appendix IV\n",
+ "H4 = 675.47-272.03 # kJ/kg\n",
+ "Ts = 463. # K\n",
+ "h = 806.69 # kJ/kg\n",
+ "lambdav = 1977.4 # kJ/kg\n",
+ "Hss = 2784.1 # kJ/kg at Ts\n",
+ "i = 3045.6 # kJ/kg\n",
+ "H6 = i-Hss\n",
+ "fi4 = H4*7100 # kJ/h\n",
+ "fi5 = (Hss-675.47)*7100 # kJ/h\n",
+ "fi6 = H6*7100 # kJ/h\n",
+ "recovery = fi4+fi5+fi6\n",
+ "BOILERcapacity = recovery*3600/2256.9 # kg/h\n",
+ "fi8 = 6125.47*(478.15-298.15)*(27650/2672.) # kJ/h\n",
+ "hloss = fi7-fi4-fi5-fi6-fi8 #/ kJ/h\n",
+ "\n",
+ "# Result\n",
+ "print \"Heat Balance of Waste Heat Boiler kJ/h \\nHeat Output Steam rising Economiser\",fi4,\\\n",
+ "\" \\nSteam generator \",fi5,\" \\nSuper heater \",fi6,\\\n",
+ "\" \\nHeat loss in flue gases \",fi8,\" \\nUnaccounted heat loss \",hloss\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/screenshots/1.png b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/screenshots/1.png
new file mode 100644
index 00000000..c4c2de47
--- /dev/null
+++ b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/screenshots/1.png
Binary files differ
diff --git a/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/screenshots/2.png b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/screenshots/2.png
new file mode 100644
index 00000000..579a039b
--- /dev/null
+++ b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/screenshots/2.png
Binary files differ
diff --git a/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/screenshots/3.png b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/screenshots/3.png
new file mode 100644
index 00000000..33f1eb61
--- /dev/null
+++ b/Stoichiometry_by_B._I._Bhatt_And__S._B._Thakore/screenshots/3.png
Binary files differ
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch1.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch1.ipynb
new file mode 100644
index 00000000..cac3ce48
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch1.ipynb
@@ -0,0 +1,196 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1 : Heat work and energy"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.1 Page No : 7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Energy expenditure in joules = 64.33 int.joules\n",
+ " Energy expenditure in ergs = 6.43e+08 ergs\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "q = 26.45 \t\t\t#coloumbs\n",
+ "e = 2.432 \t\t\t#volts\n",
+ "\n",
+ "# Calculations\n",
+ "Q1 = q*e\n",
+ "Q2 = Q1*1.0002*10**7\n",
+ "\n",
+ "# Results\n",
+ "print 'Energy expenditure in joules = %.2f int.joules'%(Q1)\n",
+ "print ' Energy expenditure in ergs = %.2e ergs'%(Q2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.2 Page No : 9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat capacity = 1675 int.joules deg**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "I = 0.565 \t\t\t#amp\n",
+ "R = 15.43 \t\t\t#ohms\n",
+ "t = 185 \t\t\t#secs\n",
+ "Tr = 0.544 \t\t\t#C\n",
+ "\n",
+ "# Calculations\n",
+ "Q1 = I**2*R*t\n",
+ "Q2 = I**2*R*t/Tr\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat capacity = %.f int.joules deg**-1'%(Q2)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.3 Page No : 10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat capacity = 400.4 calories\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "I = 0.565 \t\t\t#amp\n",
+ "R = 15.43 \t\t\t#ohms\n",
+ "t = 185 \t\t\t#secs\n",
+ "Tr = 0.544 \t\t\t#C\n",
+ "\n",
+ "# Calculations\n",
+ "Q1 = I**2*R*t\n",
+ "Q2 = I**2*R*t/(Tr*4.183)\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat capacity = %.1f calories'%(Q2)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.4 Page No : 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Work done in lit-atm = 1 lit-atm\n",
+ " Work done in dynes = 1.01e+06 dynes cm**-2\n",
+ " Work done in ergs = 1.01e+02 ergs\n",
+ " Work done in calories = 24.24 calories\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "v = 1. \t\t\t#lit\n",
+ "p = 1. \t \t\t#atm\n",
+ "h = 76. \t\t\t#cm\n",
+ "d = 13.595 \t\t\t#kg/cm**3\n",
+ "g = 980.66 \t\t\t#dunes cm**-2\n",
+ "j = 4.18 \t\t\t#joules\n",
+ "\n",
+ "# Calculations\n",
+ "W = v*p\n",
+ "W1 = h*d*g\n",
+ "W2 = W1*10**-4\n",
+ "W3 = W2/j\n",
+ "\n",
+ "# Results\n",
+ "print 'Work done in lit-atm = %.f lit-atm'%(W)\n",
+ "print ' Work done in dynes = %.2e dynes cm**-2'%(W1)\n",
+ "print ' Work done in ergs = %.2e ergs'%(W2)\n",
+ "print ' Work done in calories = %.2f calories'%(W3)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch11.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch11.ipynb
new file mode 100644
index 00000000..65544719
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch11.ipynb
@@ -0,0 +1,378 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 11 : Phase Equilibria"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.1 Page No : 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "rate of change of melting point = -0.0075 deg atm**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T = 0. \t\t\t#C\n",
+ "sv = 1.0001 \t\t\t#cc g**-1\n",
+ "sv1 = 1.0907 \t\t\t#cc g**-1\n",
+ "R = 0.0242 \t \t\t#atm**-1 cc**-1 cal\n",
+ "p = 79.8 \t\t \t#atm\n",
+ "\n",
+ "# Calculations\n",
+ "r = (273.2+T)*(sv-sv1)*R/p\n",
+ "\n",
+ "# Results\n",
+ "print 'rate of change of melting point = %.4f deg atm**-1'%(r)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.2 Page No : 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat of transition = 3.2 cal g**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T = 95.5 \t\t\t#C\n",
+ "p = 1. \t\t\t#atm\n",
+ "v = 0.0126 \t\t\t#cc g**-1\n",
+ "a = 0.0242 \t\t\t#cal cc**-1 atm**-1\n",
+ "r = 0.035 \t\t\t#K atm**-1\n",
+ "\n",
+ "# Calculations\n",
+ "dH = (273.2+T)*v*a/r\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat of transition = %.1f cal g**-1'%(dH)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.3 Page No : 226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Rise in temperature per unit of pressure = 27.9 deg atm**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T = 100. \t\t\t#C\n",
+ "j = 0.0242 \t\t\t#cal cc**-1 atm6-1\n",
+ "k = 539. \t\t\t#cal g**-1\n",
+ "p = 1664. \t\t\t#cc g**-1\n",
+ "\n",
+ "# Calculations\n",
+ "r = (273.2+T)*(p-1)*j/k\n",
+ "\n",
+ "# Results\n",
+ "print 'Rise in temperature per unit of pressure = %.1f deg atm**-1'%(r)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.4 Page No : 228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Final vapour pressure of water = 52.9 cm\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T1 = 100. \t\t\t#C\n",
+ "T2 = 90. \t\t\t#C\n",
+ "p = 76. \t\t\t#cm of hg\n",
+ "H = 542*18.02 \t\t\t#cal mole**-1\n",
+ "\n",
+ "# Calculations\n",
+ "p1 = p/10**((H/4.576)*((T1-T2)/((273.2+T1)*(273.2+T2))))\n",
+ "\n",
+ "# Results\n",
+ "print 'Final vapour pressure of water = %.1f cm'%(p1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.5 Page No : 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "heat of vapourisation of liquid chlorine = 68.3 cal g**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T = 239.05 \t\t\t#K\n",
+ "r = 0.0242 \t\t\t#cal cc6-1 atm**-1\n",
+ "Vv = 269.1 \t\t\t#cc g**-1\n",
+ "Vl = 0.7 \t\t\t#cc g**-1\n",
+ "r1 = 3.343 \t\t\t#cm of mercury deg6-1\n",
+ "p = 76. \t\t\t#cm\n",
+ "\n",
+ "# Calculations\n",
+ "tbyp = r1/p\n",
+ "dH = T*(Vv-Vl)*tbyp*r\n",
+ "\n",
+ "# Results\n",
+ "print 'heat of vapourisation of liquid chlorine = %.1f cal g**-1'%(dH)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.6 Page No : 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Normal boiling point of silver = 2412 K\n",
+ " Normal boiling point of silver in degrees = 2139 degrees\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "Ta = 441. \t\t \t#C\n",
+ "Tb = 882. \t \t\t#C\n",
+ "Tb1 = 1218. \t\t\t#C\n",
+ "\n",
+ "# Calculations\n",
+ "Ta1 = (273+Tb1)*(Tb+273)/(273+Ta)\n",
+ "Tb = Ta1-273\n",
+ "\n",
+ "# Results\n",
+ "print 'Normal boiling point of silver = %.f K'%(Ta1)\n",
+ "print ' Normal boiling point of silver in degrees = %.f degrees'%(Tb)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.7 Page No : 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "vapour pressure = 19.6 cm\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "T = 40. \t\t\t#C\n",
+ "T1 = 80.1 \t\t\t#C\n",
+ "\n",
+ "# Calculations\n",
+ "H = 2*(273.2+T1)\n",
+ "p = math.e**(-(H/(4.576*(273.2+T)))+4.59)/3.07\n",
+ "\n",
+ "# Results\n",
+ "print 'vapour pressure = %.1f cm'%(p)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.8 Page No : 237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "vapour pressure = 23.78 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "p = 23.76 \t\t\t#mm\n",
+ "R = 0.082 \t\t\t#atm-lit deg**-1 mol**-1\n",
+ "T = 25. \t\t\t#C\n",
+ "vl = 18 \t\t\t#ml\n",
+ "p1 = 1. \t\t\t#atm\n",
+ "\n",
+ "# Calculations\n",
+ "dP = 0.001*vl*p*p1/(R*(273+T))\n",
+ "p2 = p+dP\n",
+ "\n",
+ "# Results\n",
+ "print 'vapour pressure = %.2f mm'%(p2)\n",
+ "\n",
+ "# Note : ANSWER GIVEN IN THE TEXTBOOK IS WRONG\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.9 Page No : 246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "vapour pressure = 24.01 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T = 25. \t\t\t #C\n",
+ "R = 8.314*10**7 \t\t#ergs /mol K\n",
+ "st = 72. \t\t \t#dynes cm**-1\n",
+ "mv = 18. \t \t\t#cc mole**-1\n",
+ "r = 10.**-5 \t\t\t#cm\n",
+ "p = 23.76 \t\t\t#cm\n",
+ "\n",
+ "# Calculations\n",
+ "p1 = p*10**(2*st*mv/(r*R*2.303*(273.2+T)))\n",
+ "\n",
+ "# Results\n",
+ "print 'vapour pressure = %.2f mm'%(p1)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch12.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch12.ipynb
new file mode 100644
index 00000000..f3230ef5
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch12.ipynb
@@ -0,0 +1,179 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 12 : Fugacity and Activity"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.1 Page No : 252"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fugacity of nitrogen gas = 48.95 atm\n",
+ " fugacity of nitrogen gas = 96.7 atm\n",
+ " fugacity of nitrogen gas = 194.2 atm\n",
+ " fugacity of nitrogen gas = 424.4 atm\n",
+ " fugacity of nitrogen gas = 1191 atm\n",
+ " fugacity of nitrogen gas = 1834 atm\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "p1 = 50 \t\t\t#atm\n",
+ "p2 = 100 \t\t\t#atm\n",
+ "p3 = 200 \t\t\t#atm\n",
+ "p4 = 400 \t\t\t#atm\n",
+ "p5 = 800 \t\t\t#atm\n",
+ "p6 = 1000 \t\t\t#atm\n",
+ "r1 = 0.979\n",
+ "r2 = 0.967\n",
+ "r3 = 0.971\n",
+ "r4 = 1.061\n",
+ "r5 = 1.489\n",
+ "r6 = 1.834\n",
+ "\n",
+ "# Calculations\n",
+ "f1 = r1*p1\n",
+ "f2 = r2*p2\n",
+ "f3 = r3*p3\n",
+ "f4 = r4*p4\n",
+ "f5 = r5*p5\n",
+ "f6 = r6*p6\n",
+ "\n",
+ "# Results\n",
+ "print 'fugacity of nitrogen gas = %.2f atm'%(f1)\n",
+ "print ' fugacity of nitrogen gas = %.1f atm'%(f2)\n",
+ "print ' fugacity of nitrogen gas = %.1f atm'%(f3)\n",
+ "print ' fugacity of nitrogen gas = %.1f atm'%(f4)\n",
+ "print ' fugacity of nitrogen gas = %.f atm'%(f5)\n",
+ "print ' fugacity of nitrogen gas = %.f atm'%(f6)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.2 Page No : 258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fugacity of nitrogen gas = 49 atm\n",
+ " fugacity of nitrogen gas = 98 atm\n",
+ " fugacity of nitrogen gas = 196 atm\n",
+ " fugacity of nitrogen gas = 428 atm\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "p1 = 50 \t\t\t#atm\n",
+ "p2 = 100 \t\t\t#atm\n",
+ "p3 = 200 \t\t\t#atm\n",
+ "p4 = 400 \t\t\t#atm\n",
+ "r1 = 0.98\n",
+ "r2 = 0.97\n",
+ "r3 = 0.98\n",
+ "r4 = 1.07\n",
+ "\n",
+ "# Calculations\n",
+ "f1 = p1*r1\n",
+ "f2 = p2*r1\n",
+ "f3 = p3*r3\n",
+ "f4 = p4*r4\n",
+ "\n",
+ "# Results\n",
+ "print 'fugacity of nitrogen gas = %.f atm'%(f1)\n",
+ "print ' fugacity of nitrogen gas = %.f atm'%(f2)\n",
+ "print ' fugacity of nitrogen gas = %.f atm'%(f3)\n",
+ "print ' fugacity of nitrogen gas = %.f atm'%(f4)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.3 Page No : 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fugacity of liquid chlorine = 3.60 atm\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "p = 3.66 \t\t\t#atm\n",
+ "v = 6.01 \t\t\t#litre mole**-1\n",
+ "T = 0 \t\t\t#C\n",
+ "R = 0.082 \t\t\t#lit-atm mole**-1 K**-1\n",
+ "\n",
+ "# Calculations\n",
+ "f = p**2*v/(R*(273+T))\n",
+ "\n",
+ "# Results\n",
+ "print 'fugacity of liquid chlorine = %.2f atm'%(f)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch13.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch13.ipynb
new file mode 100644
index 00000000..d6ffa58a
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch13.ipynb
@@ -0,0 +1,622 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 13 : Free Energy and Chemical Reactions"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.1 Page No : 285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Free energy = -5340 cal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "R = 4.576 \t\t\t#cal deg**-1 mole**-1\n",
+ "T = 700 \t\t\t#C\n",
+ "Kp = 0.71\n",
+ "p1 = 1.5 \t\t\t#atm\n",
+ "p2 = 5 \t\t\t#atm\n",
+ "\n",
+ "# Calculations\n",
+ "dF = -R*(273+T)*(math.log(Kp)-math.log((p1*p2)/(10*p2)))*0.77\n",
+ "\n",
+ "# Results\n",
+ "print 'Free energy = %.f cal'%(dF-10)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.1.1 Page no : 287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Jy = 1.27\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "# variables and calculations\n",
+ "\n",
+ "# for CO2\n",
+ "Tc = 304. #K\n",
+ "Pc = 72.9 # atm\n",
+ "a = 873. # K\n",
+ "b = 500. # atm\n",
+ "\n",
+ "theta1 = a/Tc\n",
+ "pi2 = b/Pc\n",
+ "YCO2 = 1.09\n",
+ "\n",
+ "# for H2\n",
+ "Tc = 33.2 #K\n",
+ "Pc = 12.8 # atm\n",
+ "\n",
+ "theta1 = a/(Tc+8)\n",
+ "pi2 = b/(Pc+8)\n",
+ "YH2 = 1.10\n",
+ "\n",
+ "# for CO\n",
+ "Tc = 134. #K\n",
+ "Pc = 34.6 # atm\n",
+ "\n",
+ "theta1 = a/Tc\n",
+ "pi2 = b/Pc\n",
+ "YCO = 1.23\n",
+ "\n",
+ "# for H20\n",
+ "Tc = 647. #K\n",
+ "Pc = 218 # atm\n",
+ "\n",
+ "theta1 = a/Tc\n",
+ "pi2 = b/Pc\n",
+ "YHO2 = 0.77\n",
+ "\n",
+ "Jy = YCO2*YH2/(YCO*YHO2)\n",
+ "# results\n",
+ "print \"Jy = %.2f\"%Jy\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.2 Page No : 293"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Kf = 0.041 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "k1 = 4600.\n",
+ "k2 = -8.64\n",
+ "k3 = 1.86*10**-3\n",
+ "k4 = -0.12*10**-6\n",
+ "k5 = 12.07\n",
+ "T = 600. \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "Kf = math.e**(k1*(1/T)+k2*math.log10(T)+k3*T+k4*T**2+k5)\n",
+ "\n",
+ "# Results\n",
+ "print 'Kf = %.3f '%(Kf)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.3 Page No : 294"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Standard heat of reaction = -10718 cal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "k = -8810 \t\t\t#cal\n",
+ "k1 = -7.46 \t\t\t#cal K**-1\n",
+ "k2 = 3.69*10**-3 \t\t\t#cal K**-2\n",
+ "k3 = -0.47*10**-6 \t\t\t#cak K**-3\n",
+ "T = 298 \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "dH = k+k1*T+k2*T**2+k3*T**3\n",
+ "\n",
+ "# Results\n",
+ "print 'Standard heat of reaction = %.f cal'%(dH)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.4 Page No : 296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Free energy = -3933 cal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "k1 = -9130 \t\t\t#cal\n",
+ "k2 = 7.46 \t\t\t#cal K**-1\n",
+ "k3 = -3.69*10**-3 \t\t\t#K**-2\n",
+ "k4 = 0.235*10**-6 \t\t\t#K**-3\n",
+ "k5 = -12.07\n",
+ "T = 298 \t\t\t#K\n",
+ "R = 1.987 \t\t\t#cal deg**-1 mole**-1\n",
+ "\n",
+ "# Calculations\n",
+ "dF = k1+k2*T*math.log(T)+k3*T**2+k4*T**3+k5*R*T\n",
+ "\n",
+ "# Results\n",
+ "print 'Free energy = %.f cal'%(dF)\n",
+ "\n",
+ "# rounding off error is there. please check.\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.5 Page No : 297"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Kf at this temperature = 1.06e-05 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T = 25 \t\t\t#C\n",
+ "dF1 = 61.44 \t\t\t#kcal\n",
+ "dF = 54.65 \t\t\t#kcal\n",
+ "R = 4.576 \t\t\t#cal deg**-1 mole**-1\n",
+ "\n",
+ "# Calculations\n",
+ "Kf = 10**(-(dF1-dF)*10**3/(R*(273.2+T)))\n",
+ "\n",
+ "# Results\n",
+ "print 'Kf at this temperature = %.2e '%(Kf)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.6 Page No : 300"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Standard free energy change = -40 kcal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "R = 4.576 \t\t\t#cal mole**-1 K**-1\n",
+ "T = 25. \t\t\t#C\n",
+ "p1 = 122. \t\t\t#mm\n",
+ "F1 = -5.88 \t\t\t#kcal\n",
+ "F2 = -33 \t\t\t#kcal\n",
+ "\n",
+ "# Calculations\n",
+ "dF = R*(273.2+T)*math.log10(p1/760)\n",
+ "F = F2+F1+(dF/1000)\n",
+ "\n",
+ "# Results\n",
+ "print 'Standard free energy change = %.f kcal'%(F)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.7 Page No : 303"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "dS = 7.8 E.U.cal deg**-1\n",
+ " molar entropy = 47 E.U.mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "r = 3.38*10**-4 \t\t\t#volt deg**-1\n",
+ "F = 23070. \t\t\t#cal volt**-1 deg**-1\n",
+ "Sagcl = 23 \t \t\t#E.U.mole**-1\n",
+ "Shg = 18.5 \t \t\t#E.U.mole**-1\n",
+ "Sag = 10.2 \t\t \t#E.U.mole**-1\n",
+ "\n",
+ "# Calculations\n",
+ "dS = F*r\n",
+ "shgcl = 2*-(dS-Sagcl-Shg+Sag)\n",
+ "\n",
+ "# Results\n",
+ "print 'dS = %.1f E.U.cal deg**-1'%(dS)\n",
+ "print ' molar entropy = %.f E.U.mole**-1'%(shgcl)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.8 Page No : 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Entropy Change = -57.9 E.U\n",
+ " Enthalpy Change = -212.7 E.U\n",
+ " Standard free energy = -195.4 kcal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "s1 = 44.5 \t\t\t#cal deg**-1 mole**-1\n",
+ "s2 = 49 \t\t\t#cal deg**-1 mole**-1\n",
+ "s3 = 51.06 \t\t\t#cal deg**-1 mole**-1\n",
+ "s4 = 16.75 \t\t\t#cal deg**-1 mole**-1\n",
+ "h1 = -17.9 \t\t\t#kcal mole**-1\n",
+ "h2 = 0 \t\t\t#kcal mole**-1\n",
+ "h3 = -94 \t\t\t#kcal mole**-1\n",
+ "h4 = -68.3 \t\t\t#kcal mole**-1\n",
+ "T = 25 \t\t\t#C\n",
+ "n = 2\n",
+ "\n",
+ "# Calculations\n",
+ "dS = s3+2*s4-s1-n*s2\n",
+ "dH = h3+n*h4-h1-n*h2\n",
+ "dF = -0.001*(273.2+T)*dS+dH\n",
+ "\n",
+ "# Results\n",
+ "print 'Entropy Change = %.1f E.U'%(dS)\n",
+ "print ' Enthalpy Change = %.1f E.U'%(dH)\n",
+ "print ' Standard free energy = %.1f kcal'%(dF)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.9 Page No : 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "heat of formation = -17920 cal\n",
+ " Entropy = -5870 cal\n",
+ " Inertia = -46.56 gm cm**2\n",
+ " Entropy = 11121 cal\n",
+ " Kf = 8.9e-05 \n",
+ " Kp = 2.1e-04 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "a = -15.84 \n",
+ "b = 22.84*10**-3\n",
+ "c = -80.97*10**-7 \n",
+ "T = 25. \t\t\t#C\n",
+ "H1 = -48.1 \t\t\t#kcal\n",
+ "H2 = -26.4\n",
+ "dS = 53.09\n",
+ "T1 = 327. \t\t\t#C\n",
+ "r1 = 0.58\n",
+ "r2 = 1.1\n",
+ "r3 = 1.13\n",
+ "\n",
+ "# Calculations\n",
+ "dH = round((H1-H2)*1000-a*(273.2+T)-0.5*b*(273.2+T)**2-0.33*c*(273.2+T)**3,-1)\n",
+ "dF = round((H1-H2)*1000+(273.2+T)*dS,-1)\n",
+ "I = (dF-dH+a*(273.2+T)*math.log(273.2+T)+0.5*b*(273.2+T)**2+0.166*c*(273.2+T)**3)/(273.2+T)\n",
+ "dF1 = (dH-a*(273+T1)*math.log(273+T1)-0.5*b*(273+T1)**2-0.166*c*(273+T1)**3)+I*(273+T1)\n",
+ "Kf = 10**(-dF1/(4.576*(273+T1)))\n",
+ "Jr = r1/(r2**2*r3)\n",
+ "Kp = Kf/Jr\n",
+ "\n",
+ "# Results\n",
+ "print 'heat of formation = %d cal'%(dH)\n",
+ "print ' Entropy = %.f cal'%(dF)\n",
+ "print ' Inertia = %.2f gm cm**2'%(I)\n",
+ "print ' Entropy = %.f cal'%(dF1)\n",
+ "print ' Kf = %.1e '%(Kf)\n",
+ "print ' Kp = %.1e '%(Kp)\n",
+ "\n",
+ "# rounding off error is there. please check."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.10 Page No : 309"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Standard free energy = -54.64 kcal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "F1 = 24.423\t\t\t#cal deg**-1\n",
+ "F2 = 21.031 \t\t\t#cal deg**-1\n",
+ "F3 = 37.172 \t\t\t#cal deg**-1\n",
+ "H1 = 2.024 \t\t\t#kcal\n",
+ "H2 = 1.035 \t\t\t#kcal\n",
+ "H3 = 2.365 \t\t\t#kcal\n",
+ "H = -57.8 \t\t\t#kcal\n",
+ "T = 25. \t\t\t#C\n",
+ "\n",
+ "# Calculations\n",
+ "dF = F3-F1-F2\n",
+ "dH = H3-H1-H2\n",
+ "Hf = H-dH\n",
+ "F = Hf-((273.2+T)*dF*10**-3) \n",
+ "\n",
+ "# Results\n",
+ "print 'Standard free energy = %.2f kcal'%(F)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.11 Page No : 311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Equilibrium constant = 0.184 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "T = 1000 \t\t\t #C\n",
+ "j = 1.5\n",
+ "Q = 35840 \t\t\t#cal\n",
+ "I = 743*10**-40 \t\t#g cm**2\n",
+ "w = 214 \t \t\t#cm**-2\n",
+ "Kf = 0.184\n",
+ "\n",
+ "# Results\n",
+ "print 'Equilibrium constant = %.3f '%(Kf)\n",
+ "\n",
+ "# Note :NO SOLUTION IS GIVEN TO SOLVE Kf INCOMPLETE SOLUTION IN THE TEXTBOOK\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.12 Page No : 313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Equilibrium constant = 1.2 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "dH = 83 \t\t\t#cal\n",
+ "R = 1.98 \t\t\t#cal mole K**-1\n",
+ "T = 25 \t\t\t#C\n",
+ "M1 = 128 \t\t\t#gms\n",
+ "M2 = 4 \t\t\t#gms\n",
+ "M3 = 2 \t\t\t#gms\n",
+ "M4 = 129 \t\t\t#gms\n",
+ "I1 = 4.31 \t\t\t#g cm**2\n",
+ "I2 = 0.920 \t\t\t#g cm**2\n",
+ "I3 = 0.459 \t\t\t#g cm**2\n",
+ "I4 = 8.55 \t\t\t# g cm**2\n",
+ "\n",
+ "# Calculations\n",
+ "K = 1+10**((-dH/(2.303*R*(298)))+1.5*math.log(M1**2*M2/(M3*M4**2))+math.log(I1**2*I2/(I3*I4**2)))\n",
+ "\n",
+ "# Results\n",
+ "print 'Equilibrium constant = %.1f '%(K)\n",
+ "\n",
+ "# note : rounding off error."
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch14.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch14.ipynb
new file mode 100644
index 00000000..064d23a0
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch14.ipynb
@@ -0,0 +1,240 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 14 : The Properties of Solution"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.1 Page No : 322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "partial pressure of benzene = 64 mm\n",
+ " partial pressure of toulene = 16.8 mm\n",
+ " weight proportions = 3.22 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "M2 = 92. \t\t\t#gms\n",
+ "M1 = 78. \t\t\t#gms\n",
+ "pb = 118.2 \t\t\t#mm\n",
+ "pt = 36.7 \t\t\t#mm\n",
+ "\n",
+ "# Calculations\n",
+ "n1 = M2/(M1+M2)\n",
+ "n2 = 1-n1\n",
+ "p1 = n1*pb\n",
+ "p2 = n2*pt\n",
+ "w = p1*M1/(p2*M2)\n",
+ "\n",
+ "# Results\n",
+ "print 'partial pressure of benzene = %.f mm'%(p1)\n",
+ "print ' partial pressure of toulene = %.1f mm'%(p2)\n",
+ "print ' weight proportions = %.2f '%(w)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.2 Page No : 325"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ideal solubility of ethane = 0.024 mole fraction\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "vpe = 42 \t\t\t#atm\n",
+ "p2 = 1. \t\t\t#atm\n",
+ "\n",
+ "# Calculations\n",
+ "N2 = p2/vpe\n",
+ "\n",
+ "# Results\n",
+ "print 'Ideal solubility of ethane = %.3f mole fraction'%(N2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.3 Page No : 325"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat of reaction = 2039 cal mole**-1\n",
+ " pressure = 309 atm\n",
+ " Solubility of methane = 0.00323 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "p1 = 25.7 \t\t\t#atm\n",
+ "p2 = 11.84 \t\t\t#atm\n",
+ "T1 = 173. \t\t\t#K\n",
+ "T2 = 153. \t\t\t#K\n",
+ "T3 = 25. \t\t\t#C\n",
+ "\n",
+ "# Calculations\n",
+ "dH = math.log10(p1/p2)*4.579*T1*T2/(T1-T2)\n",
+ "p = p1*10**((dH/4.576)*(273+T3-T1)/((273+T3)*T1))\n",
+ "s = 1./p\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat of reaction = %d cal mole**-1'%(dH)\n",
+ "print ' pressure = %d atm'%(p)\n",
+ "print ' Solubility of methane = %.5f '%(s)\n",
+ "\n",
+ "# note : rounding error is there. please check. "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.4 Page No : 329"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ideal solubility of napthalene = 0.266 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T1 = 20. \t\t\t#C\n",
+ "T2 = 80. \t\t\t#C\n",
+ "H1 = 4540. \t\t\t#cal mole**-1\n",
+ "\n",
+ "# Calculations\n",
+ "n = 10**(H1*(-T2+T1)/(4.576*(273+T1)*(273+T2)))\n",
+ "\n",
+ "# Results\n",
+ "print 'ideal solubility of napthalene = %.3f '%(n)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.5 Page No : 342"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "molal depression consmath.tant = 5.11 \n",
+ " molality = 0.0247 \n",
+ " molecular weight of solute = 245 gms\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "R = 1.987 \t\t\t#cal mole**-1 K**-1\n",
+ "T = 278.6 \t\t\t#K\n",
+ "dH = 30.2 \t\t\t#cal g**-1\n",
+ "m = 6.054 \t\t\t#gms\n",
+ "a = 0.1263 \t\t\t#degrees\n",
+ "\n",
+ "# Calculations\n",
+ "l = R*T**2/(1000*dH)\n",
+ "m1 = a/l\n",
+ "M2 = m/m1\n",
+ "\n",
+ "# Results\n",
+ "print 'molal depression consmath.tant = %.2f '%(l)\n",
+ "print ' molality = %.4f '%(m1)\n",
+ "print ' molecular weight of solute = %.f gms'%(M2)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch15.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch15.ipynb
new file mode 100644
index 00000000..cacb11ab
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch15.ipynb
@@ -0,0 +1,265 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 15 : Activities and Activity coefficients"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.1 Page No : 357"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "activity = 0.9821 \n",
+ " activity coefficient = 0.9823 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "p1 = 17.222 \t\t\t#mm\n",
+ "p2 = 17.535 \t\t\t#mm\n",
+ "n = 1. \t\t\t#mole\n",
+ "m = 1000 \t \t\t#gms\n",
+ "M = 18.016 \t\t \t#gms\n",
+ "\n",
+ "# Calculations\n",
+ "a = p1/p2\n",
+ "N1 = (m/M)/(n+(m/M))\n",
+ "\n",
+ "# Results\n",
+ "print 'activity = %.4f '%(a)\n",
+ "print ' activity coefficient = %.4f '%(N1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.2 Page No : 361"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "activity = 0.9967 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "M = 0.1 \t\t\t#molal\n",
+ "Tf = 0.345 \t\t\t#C\n",
+ "k = -9.702*10**-3\n",
+ "k1 = -5.2*10**-6\n",
+ "\n",
+ "# Calculations\n",
+ "a = math.e**(k*Tf+k1*Tf**2)\n",
+ "\n",
+ "# Results\n",
+ "print 'activity = %.4f '%(a)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.3 Page No : 366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a2/N2 = 2.820 \n",
+ " a2 = 0.2780 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "R = 1.98*10**-4 \t\t\t#cal mole**-1 deg**-1\n",
+ "T = 20. \t\t\t#C\n",
+ "E = -0.11118 \t \t\t#volt\n",
+ "n2 = 0.00326\n",
+ "n21 = 0.0986\n",
+ "\n",
+ "# Calculations\n",
+ "r = 10**((-E/(R*(273.16+T)))-math.log10(n21)+math.log10(n2))+n21\n",
+ "a2 = r*n21\n",
+ "\n",
+ "# Results\n",
+ "print 'a2/N2 = %.3f '%(r)\n",
+ "print ' a2 = %.4f '%(a2)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.4 Page No : 367"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a2/N2 = 0.929 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "n1 = 0.424 \t\t\t#mole fraction\n",
+ "a2 = 3.268\n",
+ "n = 8.3\n",
+ "\n",
+ "# Calculations\n",
+ "r = a2/(n*n1)\n",
+ "\n",
+ "# Results\n",
+ "print 'a2/N2 = %.3f '%(r)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.5 Page No : 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "activity coefficient = 1.21 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "e = 0.7865 \t \t\t#volt\n",
+ "emf = 0.8085 \t\t\t#emf\n",
+ "T = 500. \t\t\t#C\n",
+ "R = 1.98*10**-4 \t\t\t#cal mol6-1 deg**-1\n",
+ "n2 = 0.5937\n",
+ "\n",
+ "# Calculations\n",
+ "a2 = 10**((e-emf)/(R*(273+T)))\n",
+ "r = a2/n2\n",
+ "\n",
+ "# Results\n",
+ "print 'activity coefficient = %.2f '%(r)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.6 Page No : 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Constant = 0.5037 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "ac = 1.211\n",
+ "n2 = 0.5937\n",
+ "\n",
+ "# Calculations\n",
+ "b = math.log10(ac)/(1-n2)**2\n",
+ "\n",
+ "# Results\n",
+ "print 'Constant = %.4f '%(b)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch16.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch16.ipynb
new file mode 100644
index 00000000..5a2207a3
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch16.ipynb
@@ -0,0 +1,155 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 16 : Solutions of Electrolytes"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 16.1 Page No : 380"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "mean ionic molality = 0.5 \n",
+ " mean ionic molality = 0.794 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "v = 1.\n",
+ "m = 0.5\n",
+ "\n",
+ "# Calculations\n",
+ "m1 = 2*m\n",
+ "m2 = 1*m\n",
+ "v1 = 2*v\n",
+ "v2 = 1*v\n",
+ "M = (m1**2*m2)**(1/(v1+v2))\n",
+ "\n",
+ "# Results\n",
+ "print 'mean ionic molality = %.1f '%(m2)\n",
+ "print ' mean ionic molality = %.3f '%(M)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 16.2 Page No : 399"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "mean ionic molality = 0.831 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "n = 2\n",
+ "m = 0.01422\n",
+ "m1 = 0.00869\n",
+ "m2 = 0.025\n",
+ "\n",
+ "# Calculations\n",
+ "M = m2+m1\n",
+ "M1 = (M*m1)**(1./n)\n",
+ "r = m/M1\n",
+ "\n",
+ "# Results\n",
+ "print 'mean ionic molality = %.3f '%(r)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 16.3 Page No : 400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ionic strength of solution = 1 *m\n",
+ " ionic strength of solution = 3 *m\n",
+ " ionic strength of solution = 4 *m\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "mu = 1\n",
+ "mb = 2\n",
+ "m = 1 \n",
+ "m1 = 2\n",
+ "\n",
+ "# Calculations\n",
+ "ym1 = 0.5*(mu*m**2+mu*m**2)\n",
+ "ym2 = 0.5*(mb*m**2+m*m1**2)\n",
+ "ym3 = 0.5*(mu*m1**2+mu*m1**2)\n",
+ "\n",
+ "# Results\n",
+ "print 'ionic strength of solution = %.f *m'%(ym1)\n",
+ "print ' ionic strength of solution = %.f *m'%(ym2)\n",
+ "print ' ionic strength of solution = %.f *m'%(ym3)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch17.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch17.ipynb
new file mode 100644
index 00000000..52c5c92b
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch17.ipynb
@@ -0,0 +1,103 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 17 : The Debye Huckel Theory"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 17.1 Page No : 416"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Solubility = 1.87e-04 mole litre**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "s = 1.771*10**-4 \t\t\t#mole litre**-1\n",
+ "s1 = 0.3252*10**-2 \t\t\t#mole litre**-1\n",
+ "\n",
+ "# Calculations\n",
+ "S = s*10**(0.509*(math.sqrt(s+s1)-math.sqrt(s)))\n",
+ "\n",
+ "# Results\n",
+ "print 'Solubility = %.2e mole litre**-1'%(S)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 17.2 Page No : 420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "mean ionic acctivity coefficient = 0.755 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "a = 0.1\n",
+ "\n",
+ "# Calculations\n",
+ "r = 10**(-0.509*math.sqrt(a)/(1+math.sqrt(a)))\n",
+ "\n",
+ "# Results\n",
+ "print 'mean ionic acctivity coefficient = %.3f '%(r)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch18.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch18.ipynb
new file mode 100644
index 00000000..e48d00c3
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch18.ipynb
@@ -0,0 +1,320 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 18 : Partial Molar Properties"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18.1 Page No : 429"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Apparent molar volume = 17.7 ml mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "k1 = 16.4 \t\t\t#ml mole**-1\n",
+ "k2 = 2.5 \t\t\t#ml mole**-2\n",
+ "k3 = -1.2 \t\t\t#ml mole**-3\n",
+ "m = 1 \t\t\t#molal\n",
+ "\n",
+ "# Calculations\n",
+ "Ov = k1+k2*m+k3*m**2\n",
+ "\n",
+ "# Results\n",
+ "print 'Apparent molar volume = %.1f ml mole**-1'%(Ov)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18.2 Page No : 443"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat required to remove the water = -390 cal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "n = 1 \t\t\t#mole\n",
+ "n1 = 400 \t\t\t#mole\n",
+ "T = 25 \t \t\t#C\n",
+ "H1 = 5410 \t\t\t#cal\n",
+ "H2 = -5020 \t\t\t#cal\n",
+ "\n",
+ "# Calculations\n",
+ "dH = -(H1+H2)\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat required to remove the water = %.f cal'%(dH)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18.3 Page No : 443"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat required to remove the water = -18130 cal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "n = 1 \t\t\t#mole\n",
+ "n1 = 400 \t\t\t#mole\n",
+ "T = 25 \t \t\t#C\n",
+ "H1 = 23540 \t\t\t#cal\n",
+ "H2 = -5410 \t\t\t#cal\n",
+ "\n",
+ "# Calculations\n",
+ "dH = -(H1+H2)\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat required to remove the water = %.f cal'%(dH)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18.4 Page No : 446"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat change = -17742 cal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "n1 = 1 \t\t\t#mole\n",
+ "n2 = 400 \t\t\t#mole\n",
+ "H1 = 5638 \t\t\t#cal\n",
+ "H2 = 23540 \t\t\t#cal\n",
+ "L = -1.54 \t\t\t#cal/mole\n",
+ "l1 = -2.16 \t\t\t#cal/mole\n",
+ "l2 = 5842 \t\t\t#cal/mole\n",
+ "\n",
+ "# Calculations\n",
+ "Q1 = n2*L+H1+H2\n",
+ "Q2 = n2*l1+2*l2\n",
+ "Q = Q2-Q1\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat change = %.f cal'%(Q)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18.5 Page No : 447"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ratio = 0.134 \n",
+ " Relative change in mean ionic coefficient = 1.36 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "L2 = 6000. \t \t\t#cal\n",
+ "v = 3. \n",
+ "T = 25. \t\t\t#C\n",
+ "T1 = 0. \t \t\t#C\n",
+ "\n",
+ "# Calculations\n",
+ "R = ((L2/(v*4.576))*(T-T1)/((273+T1)*(273+T)))\n",
+ "r = 10**((L2/(v*4.576))*(T-T1)/((273+T1)*(273+T)))\n",
+ "\n",
+ "# Results\n",
+ "print 'Ratio = %.3f '%(R)\n",
+ "print ' Relative change in mean ionic coefficient = %.2f '%(r)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18.6 Page No : 450"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "differential heat of solution = 3814 cal mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "L2 = 4120. \t\t\t#cal\n",
+ "l = -108. \t\t\t#cal mole**-1\n",
+ "L21 = -306. \t\t\t#cal mole**-1\n",
+ "n1 = 55.5 \t\t\t#moles\n",
+ "n2 = 1. \t\t\t#mole\n",
+ "\n",
+ "# Calculations\n",
+ "Q = L21+L2\n",
+ "\n",
+ "# Results\n",
+ "print 'differential heat of solution = %.f cal mole**-1'%(Q) \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 18.7 Page No : 456"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Increase in temperature = 1.71 deg\n",
+ " Final temperature = 26.7 deg\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "n1 = 2. \t\t\t#moles\n",
+ "n2 = 100. \t\t\t#moles\n",
+ "Cp1 = 17.9 \t\t\t#cal deg**-1 mole**-1\n",
+ "Cp2 = 21.78 \t\t\t#cal deg**-1 mole**-1\n",
+ "T1 = 30 \t\t\t#C\n",
+ "T2 = 25 \t\t\t#C\n",
+ "L1 = 5780. \t\t\t#cal\n",
+ "L2 = 5410. \t\t\t#cal\n",
+ "h = 5620. \t\t\t#cal mole**-1\n",
+ "n3 = 3. \t\t\t#moles\n",
+ "Cp3 = 16.55 \t\t\t#cal deg**-1 mole**-1\n",
+ "\n",
+ "# Calculations \n",
+ "Cp = n2*Cp1+n1*Cp2\n",
+ "Q = (T2-T1)*Cp\n",
+ "Q1 = (n1*L1+L2)\n",
+ "Q2 = n3*h\n",
+ "dQ = Q2-Q1\n",
+ "dH = Q+dQ\n",
+ "HC = 300*Cp1+n3*Cp3\n",
+ "t = -dH/HC\n",
+ "Tf = T2+t\n",
+ "\n",
+ "# Results\n",
+ "print 'Increase in temperature = %.2f deg'%(t) \n",
+ "print ' Final temperature = %.1f deg'%(Tf) \n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch19.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch19.ipynb
new file mode 100644
index 00000000..82162269
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch19.ipynb
@@ -0,0 +1,292 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 19 : EMF and the thermodynamics of ions"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 19.1 Page No : 466"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat change in the cell reaction = -51.87 kcal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "h = 23070. \t\t\t#cal volt**-1 g equiv**-1\n",
+ "n = 2. \t\t\t#electrons\n",
+ "e = 1.005 \t\t\t#volts\n",
+ "T = 25. \t\t\t#C\n",
+ "e1 = 1.015 \t\t\t#volts\n",
+ "\n",
+ "# Calculations\n",
+ "dH = (-n*h*(e-((273.2+T)*(e-e1)/T)))/1000\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat change in the cell reaction = %.2f kcal'%(dH)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 19.2 Page No : 482"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Pressure of Oxygen = 1.4e-04 atm\n",
+ " Change in Enthalpy = 15200 cal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "E = -0.344 \t\t\t#volt\n",
+ "E1 = -0.401 \t\t\t#volt\n",
+ "R = 0.05914 \t\t\t#volt\n",
+ "n = 4.\n",
+ "T = 25. \t \t\t#C\n",
+ "H = -7300. \t\t \t#cal\n",
+ "\n",
+ "# Calculations\n",
+ "po2 = 10**(-n*(E-E1)/R)\n",
+ "dH = -0.5*n*H+0.5*n*(273+T)\n",
+ "\n",
+ "# Results\n",
+ "print 'Pressure of Oxygen = %.1e atm'%(po2)\n",
+ "print ' Change in Enthalpy = %.f cal'%(dH+4)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 19.3 Page No : 489"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Standard entropy of pottasium ion = 24.1 E.U.g ion**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "H = -60.15 \t\t\t#kcal\n",
+ "e = 2.924 \t\t\t#volt\n",
+ "v = 23070. \t\t\t#cc\n",
+ "T = 25. \t\t\t#C\n",
+ "Sm = 15.2 \t\t\t#E.U.mole**-1\n",
+ "Sg = 31.2 \t\t\t#E.U.mole**-1\n",
+ "\n",
+ "# Calculations\n",
+ "dS = (H*1000-(-e*v))/(273.2+T)\n",
+ "Sk = (dS+Sm)-0.5*Sg\n",
+ "\n",
+ "# Results\n",
+ "print 'Standard entropy of pottasium ion = %.1f E.U.g ion**-1'%(Sk)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 19.4 Page No : 490"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Standard entropy of zinc ion = -25.9 E.U.g ion**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "dS = -4.61 \t\t\t#E.Ugm ion**-1\n",
+ "SH = 31.21 \t\t\t#E.U gm ion**-1\n",
+ "Sm = 9.95 \t\t\t#E.U gm ion**-1\n",
+ "\n",
+ "# Calculations\n",
+ "Szn = dS-SH+Sm\n",
+ "\n",
+ "# Results\n",
+ "print 'Standard entropy of zinc ion = %.1f E.U.g ion**-1'%(Szn)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 19.5 Page No : 491"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Standard entropy of sulfate ion = 3.2 E.U.g ion**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "n = 2.\n",
+ "T = 25. \t\t\t#C\n",
+ "R = 4.576 \n",
+ "is_ = 9.57*10**-6\n",
+ "n1 = 4.\n",
+ "f = 0.509 \t\t\t#volts\n",
+ "dH = 5970. \t\t\t#cal\n",
+ "SBa = 2.3 \t\t\t#E.U. gm ion**-1\n",
+ "Sba = 31.5 \t\t\t#E.U. gm ion6-1\n",
+ "\n",
+ "# Calculations\n",
+ "r = 10**(-n1*f*math.sqrt(n1*is_))\n",
+ "dF = -n*R*(273.2+T)*math.log10(is_*r)\n",
+ "dS = (dH-dF)/(273.2+T)\n",
+ "Sso = Sba-SBa+dS\n",
+ "\n",
+ "# Results\n",
+ "print 'Standard entropy of sulfate ion = %.1f E.U.g ion**-1'%(Sso)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 19.6 Page No : 496"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "free energy = -37.12 kcal\n",
+ " heat of formation = -73.9 kcal\n",
+ " Entropy = -120.9 E.U\n",
+ " Entropy umath.sing heat of formation and free energy = -123.3 E.U\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "f1 = 20.66 \t\t\t#kcal\n",
+ "h1 = 21.6 \t\t\t#kcal\n",
+ "e1 = 50.34 \t\t\t#kcal\n",
+ "f2 = 0 \t\t\t#kcal\n",
+ "f3 = -56.70 \t\t\t#kcal\n",
+ "f4 = -26.25 \t\t\t#kcal\n",
+ "h2 = 0 \t \t\t#kcal\n",
+ "h3 = -68.32 \t\t\t#kcal\n",
+ "h4 = -49.5 \t\t\t#kcal\n",
+ "e2 = 49.00 \t\t\t#kcal\n",
+ "e3 = 16.75 \t\t\t#kcal\n",
+ "e4 = 35 \t\t\t#kcal\n",
+ "n1 = 2\n",
+ "n2 = 1.5\n",
+ "n3 = 1\n",
+ "T = 25 \t\t\t#C\n",
+ "\n",
+ "# Calculations\n",
+ "dF = n1*f4-(n1*f1+f3)\n",
+ "dH = n1*h4-(n1*h1+h3)\n",
+ "dS = n1*e4-(n1*e1+e3+n2*e2)\n",
+ "dS1 = (dH-dF)*1000/(273.2+T)\n",
+ "\n",
+ "# Results\n",
+ "print 'free energy = %.2f kcal'%(dF)\n",
+ "print ' heat of formation = %.1f kcal'%(dH)\n",
+ "print ' Entropy = %.1f E.U'%(dS)\n",
+ "print ' Entropy umath.sing heat of formation and free energy = %.1f E.U'%(dS1)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch2.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch2.ipynb
new file mode 100644
index 00000000..2d18ef7f
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch2.ipynb
@@ -0,0 +1,261 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2 : Properties of thermodynamic systems"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.1 Page No : 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Pressure = 51.1 atm\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T = 40 \t\t\t#C\n",
+ "R = 0.0820 \t\t\t#lit-atm deg**-1 mol**-1\n",
+ "v = 0.381 \t\t\t#lit\n",
+ "b = 0.043 \t\t\t#lit\n",
+ "a = 3.6 \n",
+ "\n",
+ "# Calculations\n",
+ "P = (R*(273+T)/(v-b))-(a/v**2)\n",
+ "\n",
+ "# Results\n",
+ "print 'Pressure = %.1f atm'%(P)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.2 Page No : 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Volume of the ideal gas = 0.0560 lit mol**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T = 0 \t \t\t#C\n",
+ "R = 0.0820 \t\t\t#lit-atm deg**-1 mol**-1\n",
+ "p = 400. \t\t\t#atm\n",
+ "\n",
+ "# Calculations\n",
+ "V = R*(273+T)/p\n",
+ "\n",
+ "# Results\n",
+ "print 'Volume of the ideal gas = %.4f lit mol**-1'%(V)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.3 Page No : 29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Volume of the ideal gas = 0.071 lit mol**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "p = 400. \t\t\t#atm\n",
+ "T = 273 \t \t\t#K\n",
+ "R = 0.0820 \t\t\t#lit-atm deg**-1 mol**-1\n",
+ "k = 1.27\n",
+ "\n",
+ "# Calculations\n",
+ "V = k*R*T/p\n",
+ "\n",
+ "# Results\n",
+ "print 'Volume of the ideal gas = %.3f lit mol**-1'%(V)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.4 Page No : 29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Pressure of carbon dioxide gas = 67.4 atm\n",
+ " ratio = 0.924 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "V = 0.381 \t\t\t#lit\n",
+ "T = 313. \t\t\t#K\n",
+ "R = 0.0820 \t\t\t#lit-atm deg**-1 mol**-1\n",
+ "pc = 72.9 \t\t\t#atm\n",
+ "\n",
+ "# Calculations\n",
+ "p = R*T/V\n",
+ "r = p/pc\n",
+ "\n",
+ "# Results\n",
+ "print 'Pressure of carbon dioxide gas = %.1f atm'%(p)\n",
+ "print ' ratio = %.3f '%(r)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.5 Page No : 30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Total Pressure = 394 atm\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "n1 = 0.25 \t\t\t#mole\n",
+ "n2 = 0.75 \t\t\t#mole\n",
+ "l = 0.0832 \t\t\t#lit\n",
+ "T = 50 \t\t\t#C\n",
+ "p1 = 404 \t\t\t#atm\n",
+ "p2 = 390 \t\t\t#atm\n",
+ "\n",
+ "# Calculations\n",
+ "P = n1*p1+n2*p2\n",
+ "\n",
+ "# Results\n",
+ "print 'Total Pressure = %.f atm'%(P)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.6 Page No : 31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Volume of given mixture is = 0.082 lit\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "n1 = 0.25 \t\t\t#mole\n",
+ "nh = 0.75 \t\t\t#mole\n",
+ "p = 400. \t\t\t#atm\n",
+ "T = 50. \t\t\t#C\n",
+ "vn = 0.083 \t\t\t#lit\n",
+ "vh = 0.081 \t\t\t#lit\n",
+ "\n",
+ "# Calculations\n",
+ "V = n1*vn+vh*nh\n",
+ "\n",
+ "# Results\n",
+ "print 'Volume of given mixture is = %.3f lit'%(V)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch3.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch3.ipynb
new file mode 100644
index 00000000..2ef790bb
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch3.ipynb
@@ -0,0 +1,109 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 3 : The first law of thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.1 Page No : 34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Work of expansion = 2.87e+06 ergs\n",
+ " 1 cal = 4.17e+07 ergs\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "p = 1.013*10**6 \t\t\t#dynecm**2\n",
+ "T = 273.16 \t\t\t#K\n",
+ "V = 773.4 \t\t\t#cc\n",
+ "n = 0.0687 \t\t\t#cal\n",
+ "#CALCCULATIONS\n",
+ "W = p*V/T\n",
+ "k = W/n\n",
+ "\n",
+ "# Results\n",
+ "print 'Work of expansion = %.2e ergs'%(W)\n",
+ "print ' 1 cal = %.2e ergs'%(k)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.2 Page No : 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Work of expansion = -3.99e+10 ergs mole**-1 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "R = 8.314*10**7 \t\t\t#J/mol K\n",
+ "T = 298.2 \t \t\t#K\n",
+ "p1 = 1. \t\t\t#atm\n",
+ "p2 = 5.\t \t\t #atm\n",
+ "\n",
+ "# Calculations\n",
+ "W = R*T*math.log(p1/p2)\n",
+ "\n",
+ "# Results\n",
+ "print 'Work of expansion = %.2e ergs mole**-1 '%(W)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch4.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch4.ipynb
new file mode 100644
index 00000000..b05b78a6
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch4.ipynb
@@ -0,0 +1,265 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4 : Heat changes and heat capacities"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.1 Page No : 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat required to raise the temperature = 710 cal-mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T1 = 400. \t\t\t#K\n",
+ "T2 = 300. \t \t\t#K\n",
+ "k1 = 6.095 \t\t \t#cal mole**-1 K**-1\n",
+ "k2 = 3.253*10**-3 \t\t\t#cal mole**-1 K**-2\n",
+ "k3 = -1.017*10**-6 \t\t\t#cal mole**-1 K**-3\n",
+ "\n",
+ "# Calculations\n",
+ "dH = k1*(T1-T2)+0.5*k2*(T1**2-T2**2)+(1./3)*k3*(T1**3-T2**3)\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat required to raise the temperature = %d cal-mole**-1'%(dH)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.2 Page No : 56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Final temperature = 476 C\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "p1 = 10. \t\t\t#atm\n",
+ "p2 = 1. \t\t\t#atm\n",
+ "T1 = 25. \t\t\t#C\n",
+ "n = 2/5.\n",
+ "\n",
+ "# Calculations\n",
+ "T2 = (p1/p2)**n*(273+T1)-273\n",
+ "\n",
+ "# Results\n",
+ "print 'Final temperature = %.f C'%(T2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.3 Page No : 57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Final temperature = -119 C\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "p1 = 20. \t\t\t#atm\n",
+ "p2 = 200. \t\t\t#atm\n",
+ "T1 = 25. \t\t\t#C\n",
+ "n = 2/7.\n",
+ "\n",
+ "# Calculations\n",
+ "T2 = (p1/p2)**n*(273+T1)-273\n",
+ "\n",
+ "# Results\n",
+ "print 'Final temperature = %.f C'%(T2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4 Page No : 58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Work of expansion = -3.64e+10 ergs mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "Cv = 5*4.18*10**7 \t\t\t#ergs deg**-1 mole**-1\n",
+ "T1 = 25. \t\t\t#C\n",
+ "P2 = 5. \t\t\t#atm\n",
+ "P1 = 1. \t\t\t#atm\n",
+ "n = 2./7\n",
+ "\n",
+ "# Calculations\n",
+ "W = Cv*(273+T1)*(1-(P2/P1)**n)\n",
+ "\n",
+ "# Results\n",
+ "print 'Work of expansion = %.2e ergs mole**-1'%(W)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.5 Page No : 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Final temperature = -6 degrees\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "Ti = 25. \t\t\t#C\n",
+ "p = 200. \t\t\t#atm\n",
+ "p = 1. \t\t\t#atm\n",
+ "dT = 31 \t\t\t#C \n",
+ "\n",
+ "# Calculations\n",
+ "Tf = Ti-dT\n",
+ "\n",
+ "# Results\n",
+ "print 'Final temperature = %.f degrees'%(Tf)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.6 Page No : 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cp = 6.87 cal deg**-1 mole**-1\n",
+ " Specific heat at temperature = 1.36e-03 cal deg**-2 mole**-1\n",
+ " Specific heat at pressure = 1.00e-02 cal deg**-2 mole**-1 atm**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "k1 = 6.45 \t\t\t#cal deg**-1 mol**-1\n",
+ "k2 = 1.41*10**-3 \t\t\t#cal deg**-2 mol**-1\n",
+ "k3 = -0.81*10**-7 \t\t\t#cal deg**-3 mol**-1\n",
+ "T = 300 \t\t \t#K\n",
+ "k4 = -0.21*1.36 \t\t\t#cal deg**-3 mol**-1 atm**-1\n",
+ "k5 = 6.87*1.5\t\t\t #cal deg**-3 mol**-1 atm**-2\n",
+ "p = 10**-3\n",
+ "\n",
+ "# Calculations\n",
+ "Cp = k1+k2*T+k3*T**2\n",
+ "dCp = k2+2*k3*T\n",
+ "dCp1 = k4*p+k5*p\n",
+ "\n",
+ "# Results\n",
+ "print 'Cp = %.2f cal deg**-1 mole**-1'%(Cp)\n",
+ "print ' Specific heat at temperature = %.2e cal deg**-2 mole**-1'%(dCp)\n",
+ "print ' Specific heat at pressure = %.2e cal deg**-2 mole**-1 atm**-1'%(dCp1)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch5.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch5.ipynb
new file mode 100644
index 00000000..724f6ad0
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch5.ipynb
@@ -0,0 +1,486 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 5 : Thermochemistry"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.1 Page No : 71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat of reaction = -1228.2 kcal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "Q1 = -1227 \t \t\t#kcal\n",
+ "R = 2*10**-3 \t\t\t#kcal\n",
+ "T = 25 \t\t\t#C\n",
+ "dn = -2\n",
+ "\n",
+ "# Calculations\n",
+ "Qp = Q1+R*(273+T)*dn\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat of reaction = %.1f kcal'%(Qp)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.2 Page No : 72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat change of reaction = -32.8 kcal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "H1 = -337.3 \t\t\t#kcal\n",
+ "H2 = -68.3 \t\t\t#kcal\n",
+ "H3 = -372.8 \t\t\t#kcal\n",
+ "\n",
+ "# Calculations\n",
+ "Ht = H1+H2-H3\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat change of reaction = %.1f kcal'%(Ht)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.3 Page No : 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat of formation = 14.4 kcal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "dH = -1228.2 \t\t\t#kcal\n",
+ "n1 = 10\n",
+ "n2 = 4\n",
+ "dH1 = -94.05 \t\t\t#kcal\n",
+ "dH2 = -68.32 \t\t\t#kcal\n",
+ "\n",
+ "# Calculations\n",
+ "x = n1*dH1+n2*dH2-dH\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat of formation = %.1f kcal'%(x)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.4 Page No : 75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat of combustion = 5 kcal\n",
+ " Standard heat of formation = -491.9 kcal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "H1 = -29.6 \t\t\t#kcal\n",
+ "H2 = -530.6 \t\t\t#kcal\n",
+ "H3 = -94 \t\t\t#kcal\n",
+ "H4 = -68.3 \t\t\t#kcal\n",
+ "\n",
+ "# Calculations\n",
+ "dH1 = -(H1+H2-3*H3-4*H4)\n",
+ "dH2 = -dH1+3*H3+3*H4\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat of combustion = %.f kcal'%(dH1)\n",
+ "print ' Standard heat of formation = %.1f kcal'%(dH2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.5 Page No : 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Standard heat of formation = -57.98 kcal mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T1 = 25. \t\t\t#C\n",
+ "T2 = 100. \t\t\t#C\n",
+ "dH1 = -57.8 \t\t\t#kcal\n",
+ "Cp1 = 8.03 \t\t\t#cal deg**-1\n",
+ "Cp2 = 6.92 \t\t\t#cal deg**-1\n",
+ "Cp3 = 7.04 \t\t\t#cal deg**-1\n",
+ "\n",
+ "# Results\n",
+ "Cp = Cp1-(Cp2+0.5*Cp3)\n",
+ "dH2 = Cp*10**-3*(T2-T1)+dH1\n",
+ "\n",
+ "# Results\n",
+ "print 'Standard heat of formation = %.2f kcal mole**-1'%(dH2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.6 Page No : 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat obtained = -182 cal \n",
+ " Smath.tanadard heat of formation = -57.98 kcal mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "a = -2.776\n",
+ "b = 0.947*10**-3\n",
+ "c = 0.295*10**-6\n",
+ "T1 = 373 \t\t\t#K\n",
+ "T2 = 298 \t \t\t#K\n",
+ "dH1 = -57.8 \t\t\t#kcal\n",
+ "\n",
+ "# Calculations\n",
+ "dH = a*(T1-T2)+0.5*b*(T1**2-T2**2)+0.33*c*(T1**3-T2**3)\n",
+ "dH2 = dH1+(dH/1000)\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat obtained = %.f cal '%(dH)\n",
+ "print ' Smath.tanadard heat of formation = %.2f kcal mole**-1'%(dH2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.7 Page No : 81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a = -7.46e-03 kcal mole**-1\n",
+ " b = 3.69e-06 kcal mole**-1\n",
+ " c = -4.65e-10 kcal mole**-1\n",
+ " dH = -9.13 kcal mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "a1 = 6.189 \n",
+ "a2 = 3.225\n",
+ "a3 = 10.421\n",
+ "b1 = 7.787*10**-3\n",
+ "b2 = 0.707*10**-3\n",
+ "b3 = -0.3*10**-3\n",
+ "c1 = -0.728*10**-6\n",
+ "c2 = -0.04014*10**-6\n",
+ "c3 = 0.7212*10**-6\n",
+ "dH = -9.13 \t\t\t#kcal\n",
+ "\n",
+ "# Calculations\n",
+ "a = -(a2+a3-a1)*10**-3\n",
+ "b = -0.5*(b2+b3-b1)*10**-3\n",
+ "c = -0.33*(c2+c3-c1)*10**-3\n",
+ "\n",
+ "# Results\n",
+ "print 'a = %.2e kcal mole**-1'%(a)\n",
+ "print ' b = %.2e kcal mole**-1'%(b)\n",
+ "print ' c = %.2e kcal mole**-1'%(c)\n",
+ "print ' dH = %.2f kcal mole**-1'%(dH)\n",
+ "\n",
+ "# note : rounding off error.\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.8 Page No : 81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Change in enthalpy = 30.13 kcal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "dH = 31.39 \t\t\t#kcal\n",
+ "k1 = 3.397*10**-3 \t\t\t#kcal K**-1\n",
+ "k2 = -1.68*10**-6 \t\t\t#kcal K**-2\n",
+ "k3 = -0.022*10**-9 \t\t\t#kcal K**-3\n",
+ "k4 = 1.17*10**2 \t\t\t#kcal K\n",
+ "T = 25 \t\t\t#C\n",
+ "#CALCULTIONS\n",
+ "H = dH-(k1*(273+T)+k2*(273+T)**2+k3*(273+T)**3+k4*(273+T)**-1)\n",
+ "\n",
+ "# Results\n",
+ "print 'Change in enthalpy = %.2f kcal'%(H)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.9 Page No : 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Temperature = 2253 C\n"
+ ]
+ }
+ ],
+ "source": [
+ "from numpy import roots\n",
+ "# Variables\n",
+ "dH = 214470 \t\t\t#kcal mole**-1\n",
+ "a = 72.43 \t \t\t#calmole**-1deg**-1\n",
+ "b = 13.08*10**-3 \t\t\t#kcalmole**-1\n",
+ "c = -1.172*10**-6 \t\t\t#kcalmole**-1\n",
+ "\n",
+ "# Calculations\n",
+ "vec =roots([c,b,a,-dH])\n",
+ "T = vec[2]\n",
+ "\n",
+ "# Results\n",
+ "print 'Temperature = %.f C'%(T+15)\n",
+ "\n",
+ "# note : rounding off error because of roots()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.10 Page No : 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Temperature final = 2920 K\n",
+ " pressure final = 8.4 atm\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "c1 = 9.3 \t\t\t#cal deg**-1\n",
+ "c2 = 6.3 \t\t\t#cal deg**-1\n",
+ "n = 2.\n",
+ "dH = -57500. \t\t\t#cal\n",
+ "V = 3. \t\t \t#cc\n",
+ "v1 = 3.5 \t\t\t#cc\n",
+ "T1 = 25. \t\t\t#C\n",
+ "p1 = 1. \t\t\t #atm\n",
+ "\n",
+ "# Calculations\n",
+ "T2 = (-dH/(c1+n*c2))+298\n",
+ "p2 = p1*V*T2/(v1*(273+T1))\n",
+ "\n",
+ "# Results\n",
+ "print 'Temperature final = %.f K'%(round(T2,-1))\n",
+ "print ' pressure final = %.1f atm'%(p2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.11 Page No : 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Heat of combustion = -766 kcal\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "Hc = 234.4 \t\t\t#kcal\n",
+ "Hdc = 300 \t\t\t#kcal\n",
+ "Hch = 436.5 \t\t\t#kcal\n",
+ "Hco = 152 \t\t\t#kcal\n",
+ "Hsco = 70 \t\t\t#kcal\n",
+ "Hoh = 110.2 \t\t\t#kcal\n",
+ "Hoo = 885 \t\t\t#kcal\n",
+ "Hb = 38 \t\t\t#kcal\n",
+ "Hc = 28 \t\t\t#kcal\n",
+ "Ha = 206 \t\t\t#kcal\n",
+ "H1co = 2128 \t\t\t#kcal\n",
+ "H1oh = 661 \t\t\t#kcal\n",
+ "H1c = 231 \t\t\t#kcal\n",
+ "\n",
+ "# Calculations\n",
+ "dH = Hc+Hdc+Hch+Hco+Hsco+Hoh+Hoo+Ha+Hb+Hc-H1co-H1oh-H1c\n",
+ "\n",
+ "# Results\n",
+ "print 'Heat of combustion = %.f kcal'%(dH)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch6.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch6.ipynb
new file mode 100644
index 00000000..dae8a14f
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch6.ipynb
@@ -0,0 +1,390 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 6 : Calculation of energy and heat capcity"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.1 Page No : 105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Qt = 4.28e+30 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "m = 5.313*10**-23 \t\t\t#g\n",
+ "k = 1.38*10**-16 \n",
+ "T = 298 \t\t\t#K\n",
+ "R = 82.06 \t\t\t#ml-atm /mol K\n",
+ "h = 6.624*10**-27 \t\t\t#J /mol\n",
+ "\n",
+ "# Calculations\n",
+ "Qt = (2*math.pi*m*k*T)**1.5*R*T/h**3\n",
+ "\n",
+ "# Results\n",
+ "print 'Qt = %.2e '%(Qt)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.2 Page No : 107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "electronic contribution = 0.255 cal deg**-1.g.atom**-1\n",
+ " electronic contribution = 0.466 cal deg**-1.g.atom**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "Qe = 4.029\n",
+ "Qe1 = -37.02\n",
+ "Qe2 = 4.695*10**4\n",
+ "T = 300 \t\t\t#K\n",
+ "R = 1.98 \t\t\t#cal /mol K\n",
+ "Qe3 = 4.158\n",
+ "Qe4 = -200.8\n",
+ "Qe5 = 2.546*10**5\n",
+ "T1 = 500 \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "Ce = R*((Qe2/Qe)-(Qe1/Qe)**2)/T**2\n",
+ "Ce1 = R*((Qe5/Qe3)-(Qe4/Qe3)**2)/T1**2\n",
+ "\n",
+ "# Results\n",
+ "print 'electronic contribution = %.3f cal deg**-1.g.atom**-1'%(Ce)\n",
+ "print ' electronic contribution = %.3f cal deg**-1.g.atom**-1'%(Ce1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.3 Page No : 111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Rotational Partition = 1.71 \n",
+ " Rotational Partition = 1825 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "I = 0.459*10**-40 \t\t\t#g cm**2\n",
+ "k = 1.38*10**-16\n",
+ "T = 300 \t\t\t#K\n",
+ "h = 6.624*10**-27 \t\t\t#J/mol\n",
+ "I1 = 245*10**-40 \t\t\t# g cm**2\n",
+ "\n",
+ "# Calculations\n",
+ "Qr = I*k*T*8*math.pi**2*0.5/h**2\n",
+ "Qr1 = I1*k*T*8*math.pi**2/h**2\n",
+ "\n",
+ "# Results\n",
+ "print 'Rotational Partition = %.2f '%(Qr)\n",
+ "print ' Rotational Partition = %.f '%(Qr1)\n",
+ "\n",
+ "# note : rounding off error. please check."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.4 Page No : 114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Vibrational Partition = 1.000 \n",
+ " Vibrational Partition = 1.071 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "h = 1.439\n",
+ "T = 300. \t\t\t#K\n",
+ "w = 4405. \t\t\t#cm**-1\n",
+ "w1 = 565. \t\t\t#cm**-1\n",
+ "\n",
+ "# Calculations\n",
+ "Qv1 = (1-math.e**(-h*w/T))**-1\n",
+ "Qv2 = (1-math.e**(-h*w1/T))**-1\n",
+ "\n",
+ "# Results\n",
+ "print 'Vibrational Partition = %.3f '%(Qv1)\n",
+ "print ' Vibrational Partition = %.3f '%(Qv2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.5 Page No : 116"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Vibrational Partition = 2.71 \n",
+ " Cv = 1.11 cal deg**-1 mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "h = 1.439\n",
+ "T = 300 \t\t\t#K\n",
+ "w = 565 \t\t\t#cm**-1\n",
+ "R = 1.98 \t\t\t#cal /mol K\n",
+ "n = 0.56\n",
+ "\n",
+ "# Calculations\n",
+ "Qr = h*w/T\n",
+ "Cv = n*R\n",
+ "\n",
+ "# Results\n",
+ "print 'Vibrational Partition = %.2f '%(Qr)\n",
+ "print ' Cv = %.2f cal deg**-1 mole**-1'%(Cv)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.6 Page No : 118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Total heat capacity = 6.36 cal deg**-1 mole**-1\n",
+ " Total heat capacity = 7.69 cal deg**-1 mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "R = 1.986 \t\t\t#cal deg**-1 mole**-1\n",
+ "cv1 = 0.392 \t\t\t#cal deg**-1 mole**-1\n",
+ "cv2 = 0.004 \t\t\t#cal deg**-1 mole**-1\n",
+ "cv3 = 0.003 \t\t\t#cal deg**-1 mole**-1\n",
+ "cv4 = 1.265 \t\t\t#cal deg**-1 mole**-1\n",
+ "cv5 = 0.247 \t\t\t#cal deg**-1 mole**-1\n",
+ "cv6 = 0.225 \t\t\t#cal deg**-1 mole**-1\n",
+ "\n",
+ "# Calculations\n",
+ "Cv = 3*R+cv1+cv2+cv3\n",
+ "Cv1 = 3*R+cv4+cv5+cv6\n",
+ "\n",
+ "# Results\n",
+ "print 'Total heat capacity = %.2f cal deg**-1 mole**-1'%(Cv)\n",
+ "print ' Total heat capacity = %.2f cal deg**-1 mole**-1'%(Cv1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.7 Page No : 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cv = 5.65 cal deg**-1 g.atom**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "R = 1.98 \t\t\t#cal/mol K\n",
+ "\n",
+ "# Calculations\n",
+ "Cv = 2.856*R\n",
+ "\n",
+ "# Results\n",
+ "print 'Cv = %.2f cal deg**-1 g.atom**-1'%(Cv)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.8 Page No : 124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cv = 5.15 cal deg**-1 g.atom**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "R = 1.98 \t\t\t#cal/mol K\n",
+ "n = 3\n",
+ "\n",
+ "# Calculations\n",
+ "Cv = n*R*0.8673\n",
+ "\n",
+ "# Results\n",
+ "print 'Cv = %.2f cal deg**-1 g.atom**-1'%(Cv)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.9 Page No : 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cv = 5.37 cal deg**-1.g.atom**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "R = 1.98 \t\t\t#cal/mol K\n",
+ "n = 3\n",
+ "\n",
+ "# Calculations\n",
+ "Cv = n*R*0.904\n",
+ "\n",
+ "# Results\n",
+ "print 'Cv = %.2f cal deg**-1.g.atom**-1'%(Cv)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch7.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch7.ipynb
new file mode 100644
index 00000000..e1133ba6
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch7.ipynb
@@ -0,0 +1,148 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 7 : The second law of thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.1 Page No : 137"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Efficiency = 0.174 \n",
+ " Efficiency = 0.428 \n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T1 = 308 \t\t\t#K\n",
+ "T2 = 373. \t\t\t#K\n",
+ "T3 = 538. \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "e1 = (T2-T1)/T2\n",
+ "e2 = (T3-T1)/T3\n",
+ "\n",
+ "# Results\n",
+ "print 'Efficiency = %.3f '%(e1)\n",
+ "print ' Efficiency = %.3f '%(e2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.2 Page No : 139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Work required = 7.3 cal\n",
+ " Work required = 3.05e+08 ergs\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T = 25 \t\t\t#C\n",
+ "T1 = 0. \t\t\t#C\n",
+ "h = 79.8 \t\t\t#cal g**-1\n",
+ "j = 4.18*10**7 \t\t\t#ergs\n",
+ "\n",
+ "# Calculations\n",
+ "Wc = (T-T1)*h/(273+T1)\n",
+ "W = (T-T1)*h*j/(273+T1)\n",
+ "\n",
+ "# Results\n",
+ "print 'Work required = %.1f cal'%(Wc)\n",
+ "print ' Work required = %.2e ergs'%(W)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.3 Page No : 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Entropy = 4.38 cal deg**-1 mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "R = 1.98 \t\t\t#cal\t\t\t#mol K\n",
+ "x = 0.75\n",
+ "n = 9\n",
+ "\n",
+ "# Calculations\n",
+ "dS = -R*(n*(x/n)*math.log(x/n)+(1-x)*math.log(1-x))\n",
+ "\n",
+ "# Results\n",
+ "print 'Entropy = %.2f cal deg**-1 mole**-1'%(dS)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch8.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch8.ipynb
new file mode 100644
index 00000000..17769c3d
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch8.ipynb
@@ -0,0 +1,387 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 8 : Entropy relationships and applications"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.1 Page No : 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Entropy increase = 7.07 cal deg**-1 g atom**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "k1 = 6.2\n",
+ "k2 = 1.33*10**-3\n",
+ "k3 = 6.78*10**4\n",
+ "T1 = 800. \t\t\t#C\n",
+ "T2 = 300. \t\t\t#C\n",
+ "\n",
+ "# Calculations\n",
+ "dS = k1*math.log(T1/T2)+k2*(T1-T2)-0.5*k3*(T1**-2-T2**-2)\n",
+ "\n",
+ "# Results\n",
+ "print 'Entropy increase = %.2f cal deg**-1 g atom**-1'%(dS)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.2 Page No : 159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Entropy increase = 0.216 cal deg**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T = 77.32 \t\t\t#K\n",
+ "p = 1 \t\t\t#atm\n",
+ "Tc = 126 \t\t\t#K\n",
+ "Pc = 33.5 \t\t\t#atm\n",
+ "Mo = 32 \t\t\t#gms\n",
+ "mo = 27 \t\t\t#gms\n",
+ "R = 1.98 \t\t\t#cl/mol K\n",
+ "\n",
+ "# Calculations\n",
+ "dS = (mo)*R*Tc**3/(Mo*Pc*T**3)\n",
+ "\n",
+ "# Results\n",
+ "print 'Entropy increase = %.3f cal deg**-1'%(dS)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.3 Page No : 160"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enthalpy = 1.66 cal mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "R = 1.987 \t\t\t#cal deg**-1 mole**-1\n",
+ "T = 25 \t\t\t#C\n",
+ "Pc = 49.7 \t\t\t#atm\n",
+ "m = 128 \t\t\t#gms\n",
+ "pc = 49.7 \t\t\t#atm\n",
+ "Tc = 154.3 \t\t\t#K\n",
+ "m1 = 9 \t \t\t#gms\n",
+ "m2 = 18\n",
+ "\n",
+ "# Calculations\n",
+ "dH = (m1*R*Tc/(m*pc))*(1-m2*(Tc/(273.15+T))**2)*-1\n",
+ "\n",
+ "# Results\n",
+ "print 'Enthalpy = %.2f cal mole**-1'%(dH)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.4 Page No : 165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cp-Cv = 1.93 *R lit-atm mole**-1 K**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "a = 1.39 \t\t\t#lit**2\n",
+ "p = 200. \t\t\t#atm\n",
+ "R = 0.082 \t\t\t#lit-atm /mol K\n",
+ "T = 298. \t\t\t#K\n",
+ "\n",
+ "# Calculations\n",
+ "dC = (1+(2*a*p/(R*T)**2))\n",
+ "\n",
+ "# Results\n",
+ "print 'Cp-Cv = %.2f *R lit-atm mole**-1 K**-1'%(dC)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.5 Page No : 165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cp-Cv = 1.76 *R cal mole**-1 K**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "P = 200. \t\t\t#atm\n",
+ "Tc = 126. \t\t\t#k\n",
+ "T = 25. \t\t\t#C\n",
+ "Pc = 33.5 \t\t\t#atm\n",
+ "M = 27. \t\t\t#gms\n",
+ "m = 16. \t\t\t#gms\n",
+ "\n",
+ "# Calculations\n",
+ "dC = (1+(M*Tc**3*P/(m*Pc*(273.2+T)**3)))\n",
+ "\n",
+ "# Results\n",
+ "print 'Cp-Cv = %.2f *R cal mole**-1 K**-1'%(dC)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.6 Page No : 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cp-Cv = 0.158 cal deg**-1g atom**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "T = 25. \t\t\t#C\n",
+ "b = 0.785*10**-6 \t\t\t#atm**-1\n",
+ "a = 49.2*10**-6 \t\t\t#deg**-1\n",
+ "d = 8.93 \t\t \t#gm/cc\n",
+ "aw = 63.57 \t\t\t #gms\n",
+ "\n",
+ "# Calculations\n",
+ "dC = a**2*(273.2+T)*aw*0.0242/(b*d)\n",
+ "\n",
+ "# Results\n",
+ "print 'Cp-Cv = %.3f cal deg**-1g atom**-1'%(dC)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.7 Page No : 169"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cp-Cp* = 0.038 lit atm deg**-1 mole**-1\n",
+ " Cp-Cp* = 0.047 lit atm deg**-1 mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "p = 100 \t\t\t#atm\n",
+ "T = 25. \t\t\t#C\n",
+ "a = 1.38\n",
+ "b = 3.92*10**-2 \t\t\t#lit atm\n",
+ "R = 0.082 \t\t\t#lit-atm mole**-1 K**-1\n",
+ "Tc = 126 \t\t\t#K\n",
+ "Pc = 33.5 \t\t\t#atm\n",
+ "M = 81. \t\t\t#gms\n",
+ "m = 32. \t\t\t#gms\n",
+ "\n",
+ "# Calculations\n",
+ "dC = a*2*p/(R*(273+T)**2)\n",
+ "dC1 = M*R*Tc**3*p/(m*Pc*(273+T)**3)\n",
+ "\n",
+ "# Results\n",
+ "print 'Cp-Cp* = %.3f lit atm deg**-1 mole**-1'%(dC)\n",
+ "print ' Cp-Cp* = %.3f lit atm deg**-1 mole**-1'%(dC1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.8 Page No : 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Joule-thomson coefficient = 0.142 deg atm**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "Cp = 8.21*0.0413 \t\t\t#lit-atm deg**-1 mole**-1\n",
+ "V = 8.64*28*10**-3 \t\t\t#lit\n",
+ "r = 1.199\n",
+ "\n",
+ "# Calculations\n",
+ "u = V*(r-1)/Cp\n",
+ "\n",
+ "# Results\n",
+ "print 'Joule-thomson coefficient = %.3f deg atm**-1'%(u)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.9 Page No : 173"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Joule-thomson coefficient = 0.142 deg atm**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "Cp = 8.21*0.0413 \t\t\t#lit-atm\n",
+ "R = 0.0821 \t\t\t#lit-atm deg**-1 mole**-1\n",
+ "p = 100 \t\t\t#atm\n",
+ "T = 20. \t\t\t#C\n",
+ "a = 1.39 \n",
+ "b = 3.92*10**-2 \t\t\t#lit-atm**2 mole\n",
+ "\n",
+ "# Calculations\n",
+ "u = (1/Cp)*((2*a/(R*(273+T)))-b-(3*a*b*p/(R**2*(273+T)**2)))\n",
+ "\n",
+ "# Results\n",
+ "print 'Joule-thomson coefficient = %.3f deg atm**-1'%(u)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch9.ipynb b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch9.ipynb
new file mode 100644
index 00000000..69ba0d1f
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/ch9.ipynb
@@ -0,0 +1,185 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 9 : Entropy determination and Significance"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.1 Page No : 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Standard entropy = 39.4 cal deg**-1 g atom**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "w = 35.46 \t\t\t#gms\n",
+ "T = 298.2 \t\t\t#K\n",
+ "Qc = 4.03 \n",
+ "\n",
+ "# Calculations\n",
+ "S = 4.576*(1.5*math.log10(w)+2.5*math.log10(T)+math.log10(Qc)-0.5055)\n",
+ "\n",
+ "# Results\n",
+ "print 'Standard entropy = %.1f cal deg**-1 g atom**-1'%(S)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.2 Page No : 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Standard entropy = 35.9 E.U.mole**-1\n",
+ " Standard entropy = 9.8 E.U.mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "M = 28. \t \t \t#gms\n",
+ "T = 25. \t \t\t#C\n",
+ "I = 13.9*10**-40 \t\t\t# gcm**2\n",
+ "s = 2\n",
+ "\n",
+ "# Calculations\n",
+ "S = 4.576*(1.5*math.log10(M)+2.5*math.log10(273.2+T)-0.5055)\n",
+ "S1 = 4.576*(math.log10(I)+math.log10(273.2+T)-math.log10(s)+38.82)\n",
+ "\n",
+ "# Results\n",
+ "print 'Standard entropy = %.1f E.U.mole**-1'%(S)\n",
+ "print ' Standard entropy = %.1f E.U.mole**-1'%(S1)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.3 Page No : 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Standard entropy = 11.5 cal deg**-1 mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "import math \n",
+ "T = 25. \t\t\t#C\n",
+ "I = 4.33*10**-40 \t\t\t# gcm**2\n",
+ "I1 = 2.78*10**-40 \t\t\t#g cm**2\n",
+ "s = 3\n",
+ "\n",
+ "# Calculations\n",
+ "S = 4.576*(0.5*math.log10(I1**2*I)+1.5*math.log10(273.2+T)-math.log10(s)+58.51)\n",
+ "\n",
+ "# Results\n",
+ "print 'Standard entropy = %.1f cal deg**-1 mole**-1'%(S)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.4 Page No : 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Standard entropy = 60.40 cal deg**-1 mole**-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# Variables\n",
+ "Sco = 47.3 \t\t \t#cal deg**-1 \n",
+ "Sh2 = 31.21 \t\t\t#cal deg**-1\n",
+ "Sc = 1.36 \t\t \t#cal deg**-1\n",
+ "Sho = 16.75 \t\t\t#cal deg**-1\n",
+ "\n",
+ "# Calculations\n",
+ "S = Sco+Sh2-Sc-Sho\n",
+ "\n",
+ "# Results\n",
+ "print 'Standard entropy = %.2f cal deg**-1 mole**-1'%(S)\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/screenshots/1.png b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/screenshots/1.png
new file mode 100644
index 00000000..c6cb998f
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/screenshots/1.png
Binary files differ
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/screenshots/2.png b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/screenshots/2.png
new file mode 100644
index 00000000..dc3a4976
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/screenshots/2.png
Binary files differ
diff --git a/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/screenshots/3.png b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/screenshots/3.png
new file mode 100644
index 00000000..a7369b98
--- /dev/null
+++ b/Thermodynamics_for_chemists_by_Glasstone_&_Samuel/screenshots/3.png
Binary files differ
diff --git a/modern_physics_by_Satish_K._Gupta/chap1.ipynb b/modern_physics_by_Satish_K._Gupta/chap1.ipynb
new file mode 100644
index 00000000..36a74a3e
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap1.ipynb
@@ -0,0 +1,462 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1a5424f1a289fa2ea02065679fbda8bfa43c7eec69070520139086e97a973104"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 Coulombs Law"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1 Page no 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q=-3*10**-7 #C\n",
+ "e=-1.6*10**-19 #C\n",
+ "\n",
+ "#Calculation\n",
+ "n=q/e\n",
+ "\n",
+ "#Result\n",
+ "print\"Number of electrons transferred from wool to polythene is\", n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of electrons transferred from wool to polythene is 1.875e+12\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2 Page no 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=3.11 #g\n",
+ "Z=29\n",
+ "A=63.5 \n",
+ "N=6.023*10**23\n",
+ "e=1.6*10**-19\n",
+ "\n",
+ "#Calculation\n",
+ "n=(N*m)/A\n",
+ "n1=n*Z\n",
+ "q=n1*e\n",
+ "\n",
+ "#Result\n",
+ "print\"Total positive or negative charge is\", round(q*10**-5,2),\"*10**5 C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total positive or negative charge is 1.37 *10**5 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3 Page no 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q1=2*10**-7\n",
+ "q2=3*10**-7\n",
+ "r=0.3 #m\n",
+ "a=9*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "F=(a*q1*q2)/r**2\n",
+ "\n",
+ "#Result\n",
+ "print\"Force between two small charged spheres is\", F*10**3,\"*10**-3\",\"N(repulsive\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force between two small charged spheres is 6.0 *10**-3 N(repulsive\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.4 page no. 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "F=3.7*10**-9 #N\n",
+ "r=5*10**-10 #m\n",
+ "a=9*10**9\n",
+ "q1=1.6*10**-19\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "n=math.sqrt(F*r**2/(a*q1**2))\n",
+ "\n",
+ "#Result\n",
+ "print\"number of electrons is\", round(n,0)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "number of electrons is 2.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.5 Page no 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q1=0.4*10**-6 #C\n",
+ "q2=0.8*10**-6 #C\n",
+ "F12=0.2 #N\n",
+ "a=9.0*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "r=math.sqrt((a*q1*q2)/F12)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Distance between two spheres is\", r,\"m\"\n",
+ "print\"(b) Force on charge q2 due to q1 is\",F12,\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Distance between two spheres is 0.12 m\n",
+ "(b) Force on charge q2 due to q1 is 0.2 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.6 Page no 13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q1=5*10**-8 #C\n",
+ "m1=8*10**-3 #Kg\n",
+ "a=9*10**9\n",
+ "r=0.05 #m\n",
+ "\n",
+ "#Calculation\n",
+ "q2=m1*9.8*r**2/(a*q1)\n",
+ "\n",
+ "#Result\n",
+ "print\"Charge q2 is\", round(q2*10**7,2)*10**-7,\"C(positive)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Charge q2 is 4.36e-07 C(positive)\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.7 Page no 13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q1=6.5*10**-7 #C\n",
+ "q2=6.5*10**-7\n",
+ "r=0.5 #m\n",
+ "a=9*10**9\n",
+ "K=80.0\n",
+ "\n",
+ "#Calculation\n",
+ "Fair=a*q1*q2/r**2\n",
+ "r1=0.5/2.0\n",
+ "F1=a*4*q1*q2/r1**2\n",
+ "Fwater=Fair/K\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Mutual force of electrostatic repulsion is\", Fair*10**2,\"*10**-2 N\"\n",
+ "print\"(b) (i) Force of repulsion is\", round(F1,4),\"N\"\n",
+ "print \"(ii) Force of repulsion is\",round(Fwater*10**4,1),\"*10**-4 N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Mutual force of electrostatic repulsion is 1.521 *10**-2 N\n",
+ "(b) (i) Force of repulsion is 0.2434 N\n",
+ "(ii) Force of repulsion is 1.9 *10**-4 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 57
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.8 Page no 13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q1=6.5*10**-7 #C\n",
+ "r=0.05 #m\n",
+ "a=9*10**9\n",
+ "r1=0.5\n",
+ "\n",
+ "#Calculation\n",
+ "q11=q1/2.0\n",
+ "q21=(q1+q11)/2.0\n",
+ "F=(a*q11*q21)/r1**2\n",
+ "\n",
+ "#Result\n",
+ "print\"New force of repulsion between A and B is\", round(F*10**3,3),\"*10**-3 N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "New force of repulsion between A and B is 5.704 *10**-3 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 64
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.10 Page no 14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=9.0*10**9\n",
+ "r=0.2\n",
+ "m=9.8*10**-3\n",
+ "a1=0.1\n",
+ "a2=0.5\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "a11=m*(a1/(math.sqrt(a2**2-a1**2)))\n",
+ "q=math.sqrt((a11*r**2)/a)\n",
+ "\n",
+ "#Result\n",
+ "print\"Charge on each ball is\", round(q*10**8,2)*10**-6,\"C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Charge on each ball is 9.43e-06 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 100
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.12 Page no 14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "qa=10**-5 #C\n",
+ "qb=5*10**-6 #C\n",
+ "qc=-5*10**-6 #C\n",
+ "r=0.1 #m\n",
+ "a=9*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Fab=(a*qa*qb)/r**2\n",
+ "Fac=Fab\n",
+ "F=math.sqrt(Fab**2+Fac**2+(2*Fab*Fac*math.cos(120*3.14/180.0)))\n",
+ "\n",
+ "#Result\n",
+ "print\"Resultant force is\", round(F,0),\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resultant force is 45.0 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 75
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.13 Page no 15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "qa=1\n",
+ "qb=100\n",
+ "ab=10\n",
+ "a=9*10**9\n",
+ "qd=75\n",
+ "a1=5\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Fab=(a*qa*qb)/ab**2\n",
+ "Fac=Fab\n",
+ "Fac1=(a*qa*qd)/(ab**2-a1**2)\n",
+ "Fx=Fab*math.cos(60*3.14/180.0)+Fac1*math.cos(60*3.14/180.0)\n",
+ "Fy=Fac\n",
+ "F=math.sqrt(Fx**2+Fy**2)\n",
+ "B=Fy/Fx\n",
+ "B1=math.atan(B)*180/3.14\n",
+ "\n",
+ "#Result\n",
+ "print\"Resultant force on charge qa is inclined at\", round(B1,0),\"Degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resultant force on charge qa is inclined at 45.0 Degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 90
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap10.ipynb b/modern_physics_by_Satish_K._Gupta/chap10.ipynb
new file mode 100644
index 00000000..1207ccc1
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap10.ipynb
@@ -0,0 +1,240 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:59cd979321ac17257305319649b46031fe00ee56620ef7034e9b0708b633af30"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 Thermoelectric effect"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.1 Page no 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=15 #degree C\n",
+ "b=270 \n",
+ "\n",
+ "#Calculation\n",
+ "c=(2*b)-a\n",
+ "\n",
+ "#Result\n",
+ "print\"Temperature is\", c,\"degree C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature is 525 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.2 Page no 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=10 #degree C\n",
+ "a1=527 \n",
+ "\n",
+ "#Calculation\n",
+ "a2=(a+a1)/2.0\n",
+ "print\"Temperature is\",a2,\"degree C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature is 268.5 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.3 Page no 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=100 #ohm\n",
+ "I=10**-6 #A\n",
+ "E=40.0*10**-6 #V\n",
+ "\n",
+ "#Calculaton\n",
+ "e=R*I\n",
+ "t=e/E\n",
+ "\n",
+ "#Result\n",
+ "print\"Smallest temperature difference is\",t,\"degree C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Smallest temperature difference is 2.5 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.4 Page no 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=80 #Degree C\n",
+ "b=13.31 #micro V degree/C\n",
+ "B=-0.038 #micro V degree/C**2\n",
+ "\n",
+ "#Calculation\n",
+ "E=(b*a)+((B*a**2)/2.0)\n",
+ "an=-b/B\n",
+ "\n",
+ "#Result\n",
+ "print\"Thermo emf of silver is\",E,\"micro V\"\n",
+ "print\"Neutral temperature is\",round(an,2),\"degree C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermo emf of silver is 943.2 micro V\n",
+ "Neutarl temperature is 350.26 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.5 Page no 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=14 #micro V degree/C\n",
+ "b=-0.04 #micro V degree/C**2\n",
+ "\n",
+ "#Calculation\n",
+ "an=-a/b\n",
+ "\n",
+ "#Result\n",
+ "print\"Neutral temperature is\",an,\"degree C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Neutral temperature is 350.0 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.6 Page no 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=500 #micro V\n",
+ "a=41 #micro V degree/C\n",
+ "b=0.041 #micro V degree/C**2\n",
+ "c=-5500\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=-(a+(math.sqrt(a**2-4*b*c)))/(2.0*b)\n",
+ "\n",
+ "#Result\n",
+ "print\"Temperature of hot junction is\", round(A,2),\"degree C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature of hot junction is -1119.8 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap11.ipynb b/modern_physics_by_Satish_K._Gupta/chap11.ipynb
new file mode 100644
index 00000000..bce9c399
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap11.ipynb
@@ -0,0 +1,466 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:516acdbb9c17332f6e1ea973b0354e9af84e691b9ea2bf4ff9f153c48f9c31a8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11 Magnetic Effects Of Current And Magnetism "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.1 Page no 350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given \n",
+ "i=90 #A\n",
+ "a=1.5 #m\n",
+ "b=2\n",
+ "l=10**7\n",
+ "\n",
+ "#Calculation\n",
+ "u=l*((b*i)/a)\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnitude of the magnetic field is\",u*10**-9,\"10**-5\",\"T\"\n",
+ "print\"Direction of the magnetic field is south\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of the magnetic field is 1.2 10**-5 T\n",
+ "Direction of the magnetic field is south\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.2 Page no 350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I=3 #A\n",
+ "a=0.15 #m\n",
+ "e=10**-7\n",
+ "b=2\n",
+ "\n",
+ "#Calculation\n",
+ "Z=(e*b*I)/a\n",
+ "\n",
+ "#Result\n",
+ "print\"The magnitude of the magnetic field is\",Z*10**6,\"10**-6\",\"T\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The magnitude of the magnetic field is 4.0 10**-6 T\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.4 Page no 351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "l=10 #A\n",
+ "a=0.05 #cm\n",
+ "b=10**-7\n",
+ "a1=45 #degree\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "B=b*(l/a)*(math.sin(a1*3.14/180.0)+math.sin(a1*3.14/180.0))\n",
+ "B1=4*B\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnetic field induction is\",round(B1*10**4,2),\"*10**-4 T\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnetic field induction is 1.13 *10**-4 T\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.5 Page no 351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=10\n",
+ "a=0.08 #m\n",
+ "l=2 #A\n",
+ "v=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "B=(v*l*math.pi*n*l)/a\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnitude of the magnetic field is\", round(B*10**4,2),\"*10**-4 T\"\n",
+ "print\"Direction of the field is vertically downward.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of the magnetic field is 1.57 *10**-4 T\n",
+ "Direction of the field is vertically downward.\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.6 Page no 351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "v=2.2*10**6 #m/s\n",
+ "a=0.5*10**-10 #m\n",
+ "e=1.6*10**-19\n",
+ "m=10**-7 #N/a**2\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "I=e*v/(2*math.pi*a)\n",
+ "B=m*2*math.pi*I/a\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnetic field produced at the centre is\", B,\"T\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnetic field produced at the centre is 14.08 T\n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.8 Page no 352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I=10 #A\n",
+ "a=0.03 #m\n",
+ "a1=360 #degree\n",
+ "a2=90\n",
+ "a3=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=a1-a2\n",
+ "B=a3*I*3*math.pi/(a*2.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnitude of magnetic field is\", round(B*10**4,2),\"*10**-4 T\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of magnetic field is 1.57 *10**-4 T\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.10 Page no 352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=500\n",
+ "I=7 #A\n",
+ "a=0.05 #m\n",
+ "x=0.12 #m\n",
+ "m=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "B=(2*math.pi*n*I*a**2)/(a**2+x**2)**1.5\n",
+ "B1=m*2*math.pi*n*I/a\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Magnetic field at the point on the axis is\", round(B*10**-4,1),\"*10**-3 tesla\"\n",
+ "print\"(b)Magnetic field at the centre of the coil is\",round(B1*10**2,2),\"*10**-2 tesla\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Magnetic field at the point on the axis is 2.5 *10**-3 tesla\n",
+ "(b)Magnetic field at the centre of the coil is 4.4 *10**-2 tesla\n"
+ ]
+ }
+ ],
+ "prompt_number": 69
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.13 Page no 353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=2.52*10**-3 #T\n",
+ "l=0.5 #m\n",
+ "N=500\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "n=N/l\n",
+ "I=B/(4*math.pi*10**-7*n)\n",
+ "\n",
+ "#Result\n",
+ "print\"Current in the solenoid is\", round(I,0),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in the solenoid is 2.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 75
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.14 Page no 353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I=5 #A\n",
+ "l=2.0 #m\n",
+ "n=1000\n",
+ "n1=5\n",
+ "\n",
+ "#Calculation\n",
+ "N=n*n1\n",
+ "n2=N/l\n",
+ "B=4*math.pi*10**-7*n2*I\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnetic field at the center is\", round(B*10**2,2),\"*10**-2 T\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnetic field at the center is 1.57 *10**-2 T\n"
+ ]
+ }
+ ],
+ "prompt_number": 80
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.15 Page no 353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=16.0*10**-2 #m\n",
+ "n=20\n",
+ "I=16 #A\n",
+ "b=10**-7\n",
+ "a1=10.0*10**-2\n",
+ "n1=25\n",
+ "I1=18\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "B=b*2*math.pi*n*I/a\n",
+ "B1=b*2*math.pi*n1*I1/a1\n",
+ "B2=B1-B\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnitude of the magnetic field is\", round(B1*10**4,2),\"*10**-4 T\"\n",
+ "print\"Direction is towards west\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of the magnetic field is 28.27 *10**-4 T\n",
+ "Direction is towards west\n"
+ ]
+ }
+ ],
+ "prompt_number": 88
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 11.18 Page no 355"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "l=11 #A\n",
+ "s=3500\n",
+ "r1=25 #cm\n",
+ "r2=26\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "w=((r1+r2)/2.0)\n",
+ "l1=2*math.pi*w\n",
+ "n=s/l1\n",
+ "B=4*math.pi*10**-7*n*l\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Magnetic field outside the toroid is zero\"\n",
+ "print\"(b) Magnetic field inside the core is\",round(B*10**4,2),\"*10**-2 T\"\n",
+ "print\"(c) Magnetic field in the empty space is zero\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Magnetic field outside the toroid is zero\n",
+ "(b) Magnetic field inside the core is 3.02 *10**-2 T\n",
+ "(c) Magnetic field in the empty space is zero\n"
+ ]
+ }
+ ],
+ "prompt_number": 105
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap12.ipynb b/modern_physics_by_Satish_K._Gupta/chap12.ipynb
new file mode 100644
index 00000000..30e711a0
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap12.ipynb
@@ -0,0 +1,1435 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:48ced6bcb2294321844f4027bedbd6f874bf0da0aa33534190457acb1015aba8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 Motion of charged particle"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.1 Page no 379"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=1.6*10**-27 #Kg\n",
+ "e=1.6*10**-19\n",
+ "Ey=2*10**4 #V/m\n",
+ "x=0.1 #m\n",
+ "vx=5*10**6 #m/s\n",
+ "\n",
+ "#Calculation\n",
+ "t=x/vx\n",
+ "Fy=e*Ey\n",
+ "a=Fy/m\n",
+ "y=a*t**2/2.0\n",
+ "\n",
+ "#Result\n",
+ "print\"Transverse deflection is\", y*10**3,\"mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Transverse deflection is 0.4 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.2 Page no 379"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=8*10**28 #/m**2\n",
+ "l=1 #m\n",
+ "A=8*10**-6 #m**2\n",
+ "B=5*10**-3 #T\n",
+ "F=8*10**-2 #N\n",
+ "e=1.6*10**-19 #C\n",
+ "\n",
+ "#Calculation\n",
+ "vd=F/(B*n*A*l*e)\n",
+ "\n",
+ "#Result\n",
+ "print\"Drift velocity is\", vd*10**4,\"*10**-4 m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drift velocity is 1.5625 *10**-4 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.3 Page no 379"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q=1.6*10**-19 #C\n",
+ "v=10**7 #m/s\n",
+ "B=3 #T\n",
+ "\n",
+ "#Calculation\n",
+ "F=q*v*B\n",
+ "\n",
+ "#Result\n",
+ "print\"Instantaneous force is\", F,\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Instantaneous force is 4.8e-12 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.4 Page no 379"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I=2 #A\n",
+ "a=0.1 #m\n",
+ "u=10**-7\n",
+ "q=1.6*10**-19\n",
+ "v=4*10**4 #m/s\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "B=(u*2*I)/a\n",
+ "F=B*q*v\n",
+ "\n",
+ "#Result\n",
+ "print\"Force of magnetic field is\", F,\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force of magnetic field is 2.56e-20 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.6 Page no 380"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "v=10**5 #m/s\n",
+ "e=1.6*10**-19 #C\n",
+ "m=9.1*10**-31 #Kg\n",
+ "B=0.019*10**-4 #T\n",
+ "\n",
+ "#Calculation\n",
+ "r=m*v/(B*e)\n",
+ "\n",
+ "#Result\n",
+ "print\"Radius of the circular path is\", round(r,3),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radius of the circular path is 0.299 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.7 Page no 380"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "e=1.6*10**-19\n",
+ "m=9*10**-31 #Kg\n",
+ "T=10**-6 #S\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "B=2*math.pi*m/(e*T)\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnetic field is\", round(B*10**5,3)*10**-5 ,\"T\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnetic field is 3.534e-05 T\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.9 Page no 381"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=1.67*10**-27 #Kg\n",
+ "e=1.60*10**-19\n",
+ "V=10**7 #Hz\n",
+ "R=0.6 #m\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "B=2*math.pi*m*V/e\n",
+ "Emax=(B**2*e**2*R**2/(2*m))/1.6*10**13\n",
+ "\n",
+ "#Result\n",
+ "print\"Kinetic energy of the proton is\",round(Emax,3),\"Mev\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Kinetic energy of the proton is 7.417 Mev\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.10 Page no 381"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I=5 #A\n",
+ "l=0.1 #m\n",
+ "m=3*10**-3\n",
+ "g=9.8\n",
+ "a=0.5\n",
+ "\n",
+ "#Calculation\n",
+ "w=m*g*l\n",
+ "B=w/a\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnitude of the magnetic field is\", B*10**3,\"*10**-3 tesla\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of the magnetic field is 5.88 *10**-3 tesla\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.11 Page no 381"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "I1=4 #A\n",
+ "I2=6\n",
+ "r=0.03 #m\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "F=u*2*I1*I2/r\n",
+ "\n",
+ "#Result\n",
+ "print\"Force per unit length is\", F*10**4,\"*10**-4 N/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force per unit length is 1.6 *10**-4 N/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.12 Page no 381"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I1=5 #A\n",
+ "I2=12\n",
+ "r=0.4 #m\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "F=u*2*I1*I2/r\n",
+ "F1=u*2*I1*I2/r\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Force when current flows in same direction is\", F,\"N/m\"\n",
+ "print\"(ii) Force when current flows in opposite direction is\",F1,\"N/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Force when current flows in same direction is 3e-05 N/m\n",
+ "(ii) Force when current flows in opposite direction is 3e-05 N/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.13 Page no 381"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I1=300 #A\n",
+ "r=1.5*10**-2 #m\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "F=u*2*I1*I1/r\n",
+ "\n",
+ "#Result\n",
+ "print\"Force per unit length is\",F,\"N/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force per unit length is 1.2 N/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.14 Page no 381"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I=10 #A\n",
+ "n=100\n",
+ "A=8*10**-2 #m**2\n",
+ "B=5 #T\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "t=n*B*I*A*math.cos(60*3.14/180.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"Torque is\", round(t,0),\"Nm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Torque is 200.0 Nm\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.15 Page no 381"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=30\n",
+ "I=6 #A\n",
+ "B=1 #T\n",
+ "r=8*10**-2 #m\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=math.pi*r**2\n",
+ "t=n*B*I*A*math.sin(60*3.14/180.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Magnitude of the counter torque is\", round(t,3),\"Nm\"\n",
+ "print\"(b) Torque on the planar loop is independent of its shape, the torque will remain unchanged.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Magnitude of the counter torque is 3.133 Nm\n",
+ "(b) Torque on the planar loop is independent of its shape, the torque will remain unchanged.\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.16 Page no 382"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=100*10**-4 #T\n",
+ "I=10 #A\n",
+ "l=44\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "r=l/(2.0*math.pi)\n",
+ "A=math.pi*r**2\n",
+ "t=B*I*A\n",
+ "\n",
+ "#Result\n",
+ "print\"Maximum torque is\", round(t*10**-1,2),\"*10**-3 Nm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum torque is 1.54 *10**-3 Nm\n"
+ ]
+ }
+ ],
+ "prompt_number": 62
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.17 Page no 382"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=20\n",
+ "r=10*10**-2 #m\n",
+ "B=0.10 #T\n",
+ "I=5 #A\n",
+ "n1=10**29 #/m**3\n",
+ "A1=10**-5 #m**2\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=math.pi*r**2\n",
+ "t=n*B*I*A*math.sin(0*3.14/180.0)\n",
+ "F=B*I/(n1*A1)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Total torque on the coil is\", t\n",
+ "print\"(b) Net force on a planar loop in a magnetic field is always zero\"\n",
+ "print\"(c) Average force is\",F,\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Total torque on the coil is 0.0\n",
+ "(b) Net force on a planar loop in a magnetic field is always zero\n",
+ "(c) Average force is 5e-25 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 68
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.18 Page no 382"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=5*10**-4 #m**2\n",
+ "n=60\n",
+ "a=18 #degree\n",
+ "B=90*10**-4 #T\n",
+ "I=0.20*10**-3 #A\n",
+ "\n",
+ "#calculation\n",
+ "k=n*B*I*A/a\n",
+ "\n",
+ "#Result\n",
+ "print\"Torsional constant is\",k,\"N m per degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Torsional constant is 3e-09 N m per degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 70
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.21 Page no 383"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "G=15 #ohm\n",
+ "Ig=2*10**-3 #A\n",
+ "I=5 #A\n",
+ "\n",
+ "#Calculation\n",
+ "S=Ig*G/(I-Ig)\n",
+ "\n",
+ "#Result\n",
+ "print\"Shunt resistance is\",round(S,3),\"Ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance is 0.006 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 74
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.22 Page no 383"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=50*10**-3 #V\n",
+ "G=100.0 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "Ig=V/G\n",
+ "S=Ig*G/(I-Ig)\n",
+ "\n",
+ "#Result\n",
+ "print\"Shunt resistance is\", round(S,2),\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance is 0.01 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 79
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.23 Page no 383"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "G=100 #ohm\n",
+ "Ig=5*10**-3 #A\n",
+ "I=5 #A\n",
+ "\n",
+ "#Calculation\n",
+ "S=Ig*G/(I-Ig)\n",
+ "\n",
+ "#Result\n",
+ "print\"Shunt resistance is\",S"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance is 0.1001001001\n"
+ ]
+ }
+ ],
+ "prompt_number": 80
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.24 Page no 383"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "G=5 #ohm\n",
+ "Ig=15.0*10**-3 #A\n",
+ "I=1.5\n",
+ "V=1.5 #V\n",
+ "\n",
+ "#Calculation\n",
+ "S=Ig*G/(I-Ig)\n",
+ "R=(V/Ig)-G\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) To enable galvanometer to read 1.5 A is\", round(S,2),\"ohm\"\n",
+ "print\"(b) To enable galvanometer to read 1.5 V is\",R,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) To enable galvanometer to read 1.5 A is 0.05 ohm\n",
+ "(b) To enable galvanometer to read 1.5 V is 95.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 88
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.25 Page no 383"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "G=10 #ohm\n",
+ "Ig=25.0*10**-3 #A\n",
+ "V=120 #V\n",
+ "I=20 #A\n",
+ "\n",
+ "#Calculation\n",
+ "R=(V/Ig)-G\n",
+ "S=Ig*G/(I-Ig)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) To convert the galvanometer into the voltmeter reading is\" ,R,\"ohm\"\n",
+ "print\"(b) To convert the galvanometer into the ammeter reading is\",round(S,4),\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) To convert the galvanometer into the voltmeter reading is 4790.0 ohm\n",
+ "(b) To convert the galvanometer into the ammeter reading is 0.0125 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 95
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.26 Page no 383"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=3 #v\n",
+ "R=55 #ohm\n",
+ "Ra=1\n",
+ "I=50*10**-3 #A\n",
+ "\n",
+ "#Calculation\n",
+ "r=(E/I)-(R+Ra)\n",
+ "\n",
+ "#Result\n",
+ "print\"Value of r is\", r,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of r is 4.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 98
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.27 Page no 384"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=60 #V\n",
+ "R1=400 #ohm\n",
+ "R2=300\n",
+ "V1=30.0\n",
+ "a=120000\n",
+ "\n",
+ "#Calculation\n",
+ "Rv=(-V1*a)/(V1*(R1+R2)-E*R1)\n",
+ "R=Rv*R2/(Rv+R2)\n",
+ "I1=E/(R+R1)\n",
+ "V=I1*R\n",
+ "\n",
+ "#Result\n",
+ "print\"Voltmeter reads\", V,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltmeter reads 22.5 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 108
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.28 Page no 384"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Rv=400.0\n",
+ "E=84 #V\n",
+ "r=100.0\n",
+ "r1=200\n",
+ "\n",
+ "#Calculation\n",
+ "R=1/(1/Rv+1/100.0)\n",
+ "R1=R+200\n",
+ "I=E/R1\n",
+ "I1=I/5.0\n",
+ "V=I1*Rv\n",
+ "R2=r+r1\n",
+ "I2=E/R2\n",
+ "V2=I2*r\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Reading on voltmeter is\", V,\"V\"\n",
+ "print\"(b) Potential difference is\",V2,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Reading on voltmeter is 24.0 V\n",
+ "(b) Potential difference is 28.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 122
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.29 Page no 385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=120 #v\n",
+ "Rv=10**4 #ohm\n",
+ "a=4.0\n",
+ "\n",
+ "#Calculation\n",
+ "x=(Rv*(E-a))/a\n",
+ "\n",
+ "#Result\n",
+ "print\"Large resistance is\", x*10**-3,\"K ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Large resistance is 290.0 K ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 131
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.30 Page no 385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=0.75 #T\n",
+ "E=9*10**5 #V/m\n",
+ "V=15*10**3\n",
+ "\n",
+ "#Calculation\n",
+ "v=E/B\n",
+ "a=v**2/(2.0*V)\n",
+ "\n",
+ "#Result\n",
+ "print\"The value of e/m is\", a*10**-7,\"*10**7 C/Kg\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of e/m is 4.8 *10**7 C/Kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 127
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.31 Page no 385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=9.11*10**-31 #Kg\n",
+ "e=1.60*10**-19 #C\n",
+ "B=0.40*10**-4 #T\n",
+ "a=18*1.6*10**-16\n",
+ "PQ=0.30\n",
+ "a2=1.52 #degree\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "r=math.sqrt(2*m*a)/(B*e)\n",
+ "a1=(PQ/r)\n",
+ "PA=r*(1-math.cos(a2*3.14/180.0))\n",
+ "\n",
+ "#Result\n",
+ "print\"up and down deflection of the beam is\", round(PA*10**3,0),\"mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "up and down deflection of the beam is 4.0 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 153
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.32 Page no 386"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=60*10**-3\n",
+ "g=9.8\n",
+ "I=5\n",
+ "l=0.45\n",
+ "\n",
+ "#Calculation\n",
+ "B=m*g/(I*l)\n",
+ "T=2*m*g\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Magnetic field is\", round(B,3),\"T\"\n",
+ "print\"(ii) Total tension in the wire is\",T,\"N\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Magnetic field is 0.261 T\n",
+ "(ii) Total tension in the wire is 1.176 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 161
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.33 Page no 386"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=0.15 #T\n",
+ "m=0.30 #Kg/m\n",
+ "a=30 #degree\n",
+ "g=9.8 #m/s**2\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "I=m*g*math.tan(a*3.14/180.0)/B\n",
+ "\n",
+ "#Result\n",
+ "print\"Value of current is\", round(I,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of current is 11.31 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 165
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.34 Page no 386"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I1=4 #A\n",
+ "I2=3\n",
+ "r=3.0*10**-2 #m\n",
+ "u=10**-7\n",
+ "l=5*10**-2\n",
+ "\n",
+ "#Calculation\n",
+ "F=u*2*I1*I2/r\n",
+ "F1=F*l\n",
+ "\n",
+ "#Result\n",
+ "print\"Total force is\", F1,\"N (attractive force)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total force is 4e-06 N (attractive force)\n"
+ ]
+ }
+ ],
+ "prompt_number": 171
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.35 Page no 386"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "AB=25*10**-2 #m\n",
+ "BC=10*10**-2\n",
+ "r1=2.0*10**-2 #m\n",
+ "I1=15 #A\n",
+ "I2=25 #A\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "r2=BC+r1\n",
+ "F1=u*2*I1*I2*AB/r1\n",
+ "F2=u*2*I1*I2*AB/r2\n",
+ "F=F1-F2\n",
+ "\n",
+ "#Result\n",
+ "print\"Net force on the loop is\", F*10**4,\"*10**-4 N (towards XY)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net force on the loop is 7.8125 *10**-4 N (towards XY)\n"
+ ]
+ }
+ ],
+ "prompt_number": 182
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.36 Page no 387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "M=30*10**-3 #Kg\n",
+ "g=9.8 #m/s**2\n",
+ "l=0.5 #m\n",
+ "r=10**-2\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "I=math.sqrt((M*g*r)/(u*2*l))\n",
+ "\n",
+ "#Result\n",
+ "print\"Value of current is\", round(I,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of current is 171.46 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 186
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.37 Page no 387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=900\n",
+ "l=0.6\n",
+ "u=10**-7\n",
+ "l2=0.02 #m\n",
+ "l1=6\n",
+ "m=2.5*10**-3 #Kg\n",
+ "g=9.8\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "n1=n/l\n",
+ "B=4*math.pi*n1\n",
+ "F=B*l1*l2\n",
+ "I=m*g/F\n",
+ "\n",
+ "#Result\n",
+ "print\"Current in the winding of the secondary is\", round(I*10**7,1),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in the winding of the secondary is 108.3 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 197
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.38 Page no 387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=1.6*10**-3 #m**2\n",
+ "n=200\n",
+ "B=0.2 #T\n",
+ "a=30 #degree\n",
+ "K=10**-6 #N m /degree\n",
+ "a1=0.1\n",
+ "\n",
+ "#Calculation\n",
+ "Imax=K*a/(n*B*A)\n",
+ "Imin=K*a1/(n*B*A)\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Minimum current is\",round(Imax*10**4,2),\"*10**-4 A\"\n",
+ "print\"(ii) Smallest current that can be detected is\",Imin,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Minimum current is 4.69 *10**-4 A\n",
+ "(ii) Smallest current that can be detected is 1.5625e-06 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 204
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.39 Page no 388 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=5000.0 #ohm/V\n",
+ "V=5\n",
+ "V1=20.0\n",
+ "\n",
+ "#Calculation\n",
+ "Ig=1/R\n",
+ "G=V/Ig\n",
+ "R1=(V1/Ig)-G\n",
+ "Rn=R1+G\n",
+ "Rv=Rn/V1\n",
+ "\n",
+ "#Result\n",
+ "print\"New voltmeter will be still graded as\", Rv,\"ohm/V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "New voltmeter will be still graded as 5000.0 ohm/V\n"
+ ]
+ }
+ ],
+ "prompt_number": 212
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12.40 Page no 388"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V1=100 #V\n",
+ "Rv=400.0 \n",
+ "\n",
+ "#Calculation\n",
+ "I1=V1/Rv\n",
+ "V=I1*20\n",
+ "V2=V1+V\n",
+ "V3=V2-V1\n",
+ "\n",
+ "#Result\n",
+ "print\"Error in the reading of the voltmeter is\",V3,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Error in the reading of the voltmeter is 5.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 215
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap13.ipynb b/modern_physics_by_Satish_K._Gupta/chap13.ipynb
new file mode 100644
index 00000000..13ac3401
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap13.ipynb
@@ -0,0 +1,547 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a82b820d4c986803883c47a06b19e19453881487c8189443b60dab54c2680966"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13 Magnetic dipole"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.1 Page no 415"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "F=14.4*10**-4 #N\n",
+ "r=0.05 #m\n",
+ "u=10.0**-7\n",
+ "F1=1.6*10**-4 #N\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "m=math.sqrt(F*r**2/u)\n",
+ "r1=math.sqrt(u*6*6/F1)\n",
+ "\n",
+ "#Result\n",
+ "print\"Distance between the poles is\", r1,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Distance between the poles is 0.15 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.2 Page no 415"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "F=0.8*10**-3\n",
+ "r=0.1 #m\n",
+ "g=9.8\n",
+ "u=10.0**-7\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "m=math.sqrt(F*g*r**2/(u*5.0))\n",
+ "a=5*m\n",
+ "\n",
+ "#Result\n",
+ "print\"Strength of each pole is\", round(a,1),\"A m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Strength of each pole is 62.6 A m\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.4 Page no 416"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=50 #Am\n",
+ "r=0.2 #m\n",
+ "l=0.05 #M\n",
+ "M=5 #Am**2\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "Baxial=u*2*M*r/((r**2-l**2)**2)\n",
+ "Bequi=u*M/((r**2+l**2)**1.5)\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Magnetic field at a distance of 0.2 m from its centre on axial line is\",round(Baxial*10**4,2),\"*10**-4 T\"\n",
+ "print\"(ii) Magnetic field at a distance of 0.2 m from its centre on its equitorial line is\",round(Bequi*10**5,3)*10**-5,\"T\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Magnetic field at a distance of 0.2 m from its centre on axial line is 1.42 *10**-4 T\n",
+ "(ii) Magnetic field at a distance of 0.2 m from its centre on its equitorial line is 5.707e-05 T\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.5 Page no 416"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "M=12.5 #Am**2\n",
+ "OP=0.05 #m\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "b1=(u*2*M)/(OP**3)\n",
+ "b2=(u*M)/(OP**3)\n",
+ "B=math.sqrt(b1**2+b2**2)\n",
+ "a=b2/b1\n",
+ "a1=math.atan(a*180/3.14)\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnetic field at a point midway between two magnets is\",round(B*10**2,3),\"10**-2 T\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnetic field at a point midway between two magnets is 2.236 10**-2 T\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.6 Page no 416"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=0.3 #T\n",
+ "A=30 #Degree\n",
+ "t=0.06 #Nn\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "M=t/(B*math.sin(A*3.14/180.0))\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnetic moment is\",round(M,1),\"Am**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnetic moment is 0.4 Am**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.7 Page no 416"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=48 #Am\n",
+ "l=0.25 #m\n",
+ "a=30 #degree\n",
+ "B=0.15\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "M=m*l\n",
+ "T=M*B*math.sin(a*3.14/180.0)\n",
+ "\n",
+ "#Result \n",
+ "print\"(i) Magnetic moment is\",M,\"Am**2\"\n",
+ "print\"(ii) Torque is\",round(T,1),\"Mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Magnetic moment is 12.0 Am**2\n",
+ "(ii) Torque is 0.9 Mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.8 Page no 416"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=0.2 #t\n",
+ "a=30\n",
+ "t=0.06\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "M=t/(B*math.sin(a*3.14/180.0))\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Magnetic moment is\",round(M,1),\"An**2\"\n",
+ "print\"(b) When the magnet aligns itself parallel to the magnetic field\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Magnetic moment is 0.6 An**2\n",
+ "(b) When the magnet aligns itself parallel to the magnetic field\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.9 Page no 416"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "M=1.5 #J/T\n",
+ "B=0.22 #T\n",
+ "a=0\n",
+ "a1=90\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "W=M*B*(math.cos(a*3.14/180.0)-math.cos(a1*3.14/180.0))\n",
+ "t=M*B*math.sin(a1*3.14/180.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"Amount of work required is\", round(W,2),\"J\"\n",
+ "print\"Torque is\",round(t,2),\"Nm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Amount of work required is 0.33 J\n",
+ "Torque is 0.33 Nm\n"
+ ]
+ }
+ ],
+ "prompt_number": 57
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.10 Page no 417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=50\n",
+ "a=0.2 \n",
+ "I=12 #A\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "B=u*2*math.pi*n*I/a\n",
+ "M=n*I*math.pi*a**2\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Magnetic moment at the centre is\",round(B*10**3,3),\"*10**-3 T\"\n",
+ "print\"(b) Magnetic moment associated is\",round(M,1),\"Am**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Magnetic moment at the centre is 1.885 *10**-3 T\n",
+ "(b) Magnetic moment associated is 75.4 Am**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 65
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.11 Page no 417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "r=0.53*10**-10 #m\n",
+ "v=6.8*10**15 #Kz\n",
+ "e=1.6*10**-19 #C\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "M=math.pi*e*v*r**2\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnetic moment is\",round(M*10**24,1)*10**-24,\"A m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnetic moment is 9.6e-24 A m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 69
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.12 Page no 417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "M=1.8*10**-23 #Am**2\n",
+ "v=5*10**-6 #m**3\n",
+ "a=7.8*10**3\n",
+ "N=6.02*10**26\n",
+ "A=56.0\n",
+ "B=1.5 #T\n",
+ "a1=90 #degree\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "m=v*a\n",
+ "n=N*m/A\n",
+ "M1=M*n\n",
+ "t=M1*B*math.sin(a1*3.14/180.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Magnetic moment is\", round(M1,2),\"A m**2\"\n",
+ "print\"(b) Torque required is\",round(t,2),\"N m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Magnetic moment is 7.55 A m**2\n",
+ "(b) Torque required is 11.32 N m\n"
+ ]
+ }
+ ],
+ "prompt_number": 79
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.13 Page no 417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B1=1.2*10**-2 #T\n",
+ "a=15 #degree\n",
+ "a2=60\n",
+ "\n",
+ "#Calculation\n",
+ "a3=a2-a\n",
+ "B2=B1*math.sin(a*3.14/180.0)/(math.sin(a3*3.14/180.0))\n",
+ "\n",
+ "#Result\n",
+ "print round(B2*10**3,2),\"*10**-3 T\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4.39 *10**-3 T\n"
+ ]
+ }
+ ],
+ "prompt_number": 83
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.14 Page no 417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=1000\n",
+ "I=2 #A\n",
+ "A=2*10**-4 #m**@\n",
+ "a=30\n",
+ "B=0.16\n",
+ "a1=0 #degree\n",
+ "a2=180 \n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "M=I*A*n\n",
+ "t=M*B*math.sin(a*3.14/180.0)\n",
+ "W=M*B*(math.cos(a1*3.14/180.0)-math.cos(a2*3.14/180.0))\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Torque required is\", round(t,3),\"Nm\"\n",
+ "print\"(b) Work needed is\",round(W,3),\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Torque required is 0.032 Nm\n",
+ "(b) Work needed is 0.128 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 92
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap14.ipynb b/modern_physics_by_Satish_K._Gupta/chap14.ipynb
new file mode 100644
index 00000000..9106ddd9
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap14.ipynb
@@ -0,0 +1,635 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:04d8806c560b3bd07d87813351e39839b8f2c2b391de8dcf1afa3dc83f2be11d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14 Earths magnetism"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.3 Page no 433"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=60 #Degree\n",
+ "Bh=0.16 #G\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "B=Bh/cos(a*3.14/180.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnitude of earth's field is\", round(B,2),\"G\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of earth's field is 0.32 G\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.4 Page no 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=60\n",
+ "a2=45\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "a1=math.tan(a2*3.14/180.0)/math.cos(a*3.14/180.0)\n",
+ "a3=math.atan(a1)*180/3.14\n",
+ "\n",
+ "#Result\n",
+ "print\"Apparent value of the dip is\", round(a3,1),\"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Apparent value of the dip is 63.4 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.6 Page no 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "l=30 #cm\n",
+ "l=0.15 #m\n",
+ "r=0.30 #m\n",
+ "Bh=0.34*10**-4 #T\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "M=Bh*(r**2-l**2)**2/(2*u*r)\n",
+ "m=M/(2*l)\n",
+ "\n",
+ "#Result\n",
+ "print\"Pole strength of the magnet is\",m,\"Am\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pole strength of the magnet is 8.60625 Am\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.7 Page no 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "M=0.4 #Am**2\n",
+ "r=0.1 #m\n",
+ "l=0.05 #m\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "Bh=u*M/((r**2+l**2)**1.5)\n",
+ "\n",
+ "#Result\n",
+ "print\"Horizontal component of earth's magnetic field is\", round(Bh*10**4,3)*10**-4,\"T\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Horizontal component of earth's magnetic field is 2.86e-05 T\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.8 Page no 435"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=0.33\n",
+ "a=0\n",
+ "u=10**-7\n",
+ "I=2.5 #A\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Bh=B/math.cos(a*3.14/180.0)\n",
+ "a=u*2*I/(Bh*10**-4)\n",
+ "\n",
+ "#Result\n",
+ "print\"Neutral point is\", round(a*10**2,1),\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Neutral point is 1.5 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.9 Page no 435"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Bh=0.32 #G\n",
+ "B=0.48 \n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "a=B/Bh\n",
+ "a1=math.atan(a)*180/3.14\n",
+ "\n",
+ "#Result\n",
+ "print\"New stable equilibrium is\", round(a1,1),\"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "New stable equilibrium is 56.3 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.10 Page no 435"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=22\n",
+ "a=0.1 #m\n",
+ "Bh=0.3*10**-4 #T\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "K=2*a*Bh/(n*4*math.pi*u)\n",
+ "\n",
+ "#Result\n",
+ "print\"Reduction factor is\", round(K,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reduction factor is 0.217 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.11 Page no 435"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=40\n",
+ "a=0.12\n",
+ "I=0.15\n",
+ "a1=45 #degree\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Bh=(n*u*4*math.pi*I)/(2.0*a*math.tan(a1*3.14/180.0))\n",
+ "\n",
+ "#Result\n",
+ "print\"Strength of horizontal component is\", round(Bh*10**4,3),\"*10**-4 T\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Strength of horizontal component is 0.314 *10**-4 T\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.12 Page no 435"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a1=30\n",
+ "a2=45 #degree\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "n=2*math.tan(a1*3.14/180.0)/(math.tan(a2*3.14/180.0))\n",
+ "\n",
+ "#Result\n",
+ "print\"Ratio of number of turns is\", round(n,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ratio of number of turns is 1.155\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.13 Page no 436"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=16\n",
+ "a=0.1 #m\n",
+ "i=0.75 #A\n",
+ "Bh=5*10**-2 #T\n",
+ "v=2 #/s\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "M=n*i*math.pi*a**2\n",
+ "I=M*Bh/(4*math.pi**2*v**2)\n",
+ "\n",
+ "#Result\n",
+ "print\"Moment of inertia is\",round(I*10**4,3),\"*10**-4 Kg m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Moment of inertia is 1.194 *10**-4 Kg m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.14 Page no 436"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "T1=2.5\n",
+ "T2=4.5\n",
+ "M2=1.5\n",
+ "\n",
+ "#Calculation\n",
+ "M=T2**2/(M2*T1**2)\n",
+ "\n",
+ "#Result\n",
+ "print\"Ratio of magnetic moment is\",M"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ratio of magnetic moment is 2.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.15 Page no 436"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "T1=3.0\n",
+ "T2=4.0\n",
+ "\n",
+ "#Calculation\n",
+ "M=(T2**2+T1**2)/(T2**2-T1**2)\n",
+ "\n",
+ "#Result\n",
+ "print\"Ratio of magnetic moments is\",round(M,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ratio of magnetic moments is 3.57\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.16 Page no 436"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a1=35 #Degree\n",
+ "B=0.39\n",
+ "I=1 #A\n",
+ "a=4.0*10**-2\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Bh=B*math.cos(a1*3.14/180.0)\n",
+ "Bv=B*math.sin(a1*3.14/180.0)\n",
+ "B1=(u*2*I*4/a)*10**4\n",
+ "Rh=Bh-B1\n",
+ "R=math.sqrt(Rh**2+Bv**2)\n",
+ "Rh1=Bh+B1\n",
+ "R3=math.sqrt(Rh1**2+Bv**2)\n",
+ "\n",
+ "#Result\n",
+ "print\"Resultant magnetic field is\", round(R3,3),\"G\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resultant magnetic field is 0.566 G\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.17 Page no 436"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "M=5.25*10**-2 #J/T\n",
+ "Bh=0.42*10**-4 #T\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "r=(u*M/Bh)**0.333\n",
+ "r1=(u*2*M/Bh)**0.333\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Distance from the centre of the magnet on its normal bisector is\", round(r*10**2,1),\"cm\"\n",
+ "print\"(b) Distance from the centre of the magnet on its axis is\",round(r1*10**2,1),\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Distance from the centre of the magnet on its normal bisector is 5.0 cm\n",
+ "(b) Distance from the centre of the magnet on its axis is 6.3 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.18 Page no 437"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I=0.35 #A\n",
+ "n=30\n",
+ "a=12.0*10**-2\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Bh=u*2*math.pi*n*I*0.707/a\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Horizontal component of the earth's magnetic field is\", round(Bh*10**4,2),\"G\"\n",
+ "print\"(b) The needle will reverse its original direction i.e. it will point east to west.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Horizontal component of the earth's magnetic field is 0.39 G\n",
+ "(b) The needle will reverse its original direction i.e. it will point east to west.\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 14.19 Page no 437"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "t1=9 #S\n",
+ "t2=4.5\n",
+ "Bh=0.34*10**-4 #T\n",
+ "u=10**-7\n",
+ "r=0.1 #m\n",
+ "\n",
+ "#Calculation\n",
+ "Baxial=Bh*((t1**2/t2**2)-1)\n",
+ "M2=Baxial*r**2/(2*u)\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnetic moment is\", M2*10**-1,\"A m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnetic moment is 0.51 A m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 66
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap15.ipynb b/modern_physics_by_Satish_K._Gupta/chap15.ipynb
new file mode 100644
index 00000000..f90ea520
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap15.ipynb
@@ -0,0 +1,317 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:859464a7b9c1dff7d24f65e6024e51cc8bc55fc7979a3e8c04919720ca49d3b9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15 Classification of Magnetic Materials"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.1 Page no 457"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q=0.12 #TA**-1m\n",
+ "q1=4*math.pi*10**-7 #TA**-1m\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "q3=q/q1\n",
+ "e=q3-1\n",
+ "\n",
+ "#Result\n",
+ "print\"Relative permeability is\",round(q3*10**-4,2),\"10**4\"\n",
+ "print\"susceptibility is\",round(e*10**-4,2),\"10**4\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Relative permeability is 9.55 10**4\n",
+ "susceptibility is 9.55 10**4\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.2 Page no 457"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=0.5*10**-4 #m**2\n",
+ "H=1200 #Am**-1\n",
+ "W=599\n",
+ "Q=4*math.pi*10**-7 #TA\"**-1m\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Z=Q*(1+W)\n",
+ "Z1=Z*H\n",
+ "Z2=Z1*A\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Z produced is\",round(Z*10**4,2),\"10**-4\",\"TA**-1m\"\n",
+ "print\"(ii) Z1 produced is\",round(Z1,3),\"T\"\n",
+ "print\"(iii) Z2 produced is\",round(Z2*10**5,3),\"10**-5\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Z produced is 7.54 10**-4 TA**-1m\n",
+ "(ii) Z1 produced is 0.905 T\n",
+ "(iii) Z2 produced is 4.524 10**-5\n"
+ ]
+ }
+ ],
+ "prompt_number": 66
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.3 Page no 457"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I=1.2 #A\n",
+ "Q=800\n",
+ "A=0.15 #m\n",
+ "S=3500\n",
+ "K=4*math.pi*10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "L=2*math.pi*A\n",
+ "n=S/L\n",
+ "B=(K*Q*S*I)/L\n",
+ "\n",
+ "#Result\n",
+ "print\"The magnetic field in the core for a magnetising current of 1.2 A is\",B,\"T\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The magnetic field in the core for a magnetising current of 1.2 A is 4.48 T\n"
+ ]
+ }
+ ],
+ "prompt_number": 73
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.4 Page no 457"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "H=2*10**3 #Am**-1\n",
+ "I=4.8*10**-2 #Am**-1\n",
+ "T=280 #K\n",
+ "T1=320.0 #K\n",
+ "\n",
+ "#Calculation\n",
+ "S=I/H\n",
+ "S1=S*(T/T1)\n",
+ "S2=S1*H\n",
+ "\n",
+ "#Result\n",
+ "print\"The susceptibility of aluminium is raised to 280 k is\",S*10**5,\"10**3\"\n",
+ "print\"The temperature of the aluminium is raised to 320 k is\",S1\n",
+ "print\"The suscepitibility and intensity of magnetistionis\",S2*10**2,\"10**-2\",\"Am**-1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The susceptibility of aluminium is raised to 280 k is 2.4 10**3\n",
+ "The temperature of the aluminium is raised to 320 k is 2.1e-05\n",
+ "The suscepitibility and intensity of magnetistionis 4.2 10**-2 Am**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 90
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.5 Page no 458"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "W=3.2*10**4 #J\n",
+ "M=8.4\n",
+ "D=7200\n",
+ "v=50 #cycle s**-1\n",
+ "T=30*60 #s\n",
+ "\n",
+ "#Calculation\n",
+ "V=M/D\n",
+ "Q=W/(V*v*T)\n",
+ "\n",
+ "#Result\n",
+ "print\"The value of energy is\",round(Q,1),\"J m**-3 cycle**-1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of energy is 304.8 J m**-3 cycle**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 95
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.6 Page no 458"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=4.5 #Am\n",
+ "l=0.06 #m\n",
+ "A=0.9*10**-4 #m**2\n",
+ "r=0.06 #m\n",
+ "J=4*math.pi*10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "I=m/A\n",
+ "H1=m/(4*math.pi*r**2)\n",
+ "H2=m/(4*math.pi*r**2)\n",
+ "H=H1+H2\n",
+ "B=J*(-H+I)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Intensity of the magnetisation is\", I*10**-4,\"10**4 A/m\"\n",
+ "print\"(b) Magnetic intensity is\",round(H,0),\"A/m\"\n",
+ "print\"(c) Magnetic induction is\",round(B*10**2,2),\"*10**-2 T\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Intensity of the magnetisation is 5.0 10**4 A/m\n",
+ "(b) Magnetic intensity is 199.0 A/m\n",
+ "(c) Magnetic induction is 6.26 *10**-2 T\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 15.7 Page no 458"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=1.5*10**-23 #J/T\n",
+ "n=2.0*10**24\n",
+ "a=15 #%\n",
+ "T1=4.2 #K\n",
+ "T2=2.8\n",
+ "B1=0.84 #T\n",
+ "B2=0.98\n",
+ "\n",
+ "#Calculation\n",
+ "M=m*n\n",
+ "M1=M*(a/100.0)\n",
+ "M2=M1*T1*B2/(T2*B1)\n",
+ "\n",
+ "#Result\n",
+ "print\"Total dipole moment is\",M2,\"J/T\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total dipole moment is 7.875 J/T\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap16.ipynb b/modern_physics_by_Satish_K._Gupta/chap16.ipynb
new file mode 100644
index 00000000..a6266584
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap16.ipynb
@@ -0,0 +1,964 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:03e25d70b6f5039934ebff67f76c18265eda838017719c81d51174de65a0d0cb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 16 Electromagnetic induction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.1 Page no 508"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=5.0 #ohm\n",
+ "t=2\n",
+ "a=15\n",
+ "b=8\n",
+ "\n",
+ "#Calculation\n",
+ "e=-a*t**2-(b*t)-t\n",
+ "I=-e/R\n",
+ "\n",
+ "#Result\n",
+ "print\"Induced current is\", I,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Induced current is 15.6 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.2 Page no 508"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "S1=75*10**-4 #m**2\n",
+ "B1=0.8 #wb/m**2\n",
+ "S2=100*10**-4\n",
+ "B2=1.4\n",
+ "t=0.05\n",
+ "\n",
+ "#Calculation\n",
+ "a1=B1*S1\n",
+ "a2=B2*S2\n",
+ "a=a2-a1\n",
+ "e=-a/t\n",
+ "\n",
+ "#Result\n",
+ "print\"Induced e.m.f is\", e,\"Volt\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Induced e.m.f is -0.16 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.3 Page no 508"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a1=5.5*10**-4 #Wb\n",
+ "a2=0.5*10**-4\n",
+ "N=1000\n",
+ "t=0.1\n",
+ "R=10 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "a=a2-a1\n",
+ "a11=N*a\n",
+ "e=-(a11/t)\n",
+ "I1=e/R\n",
+ "I2=I1*t\n",
+ "\n",
+ "#Result\n",
+ "print\" Induced e.m.f produced is\",e,\"V\"\n",
+ "print\" Charge flowing through the coil in 0.1 is\",I2,\"C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Induced e.m.f produced is 5.0 V\n",
+ " Charge flowing through the coil in 0.1 is 0.05 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.5 Page no 509"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=2.5*10**-3 #Wb**-2\n",
+ "L=1 #m\n",
+ "v=30 #r.p.s\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "e=-B*math.pi*L**2*v\n",
+ "\n",
+ "#Result\n",
+ "print\"The produced e.m.f. between its ends is\",round(e,3),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The produced e.m.f. between its ends is -0.236 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.6 Page no 509"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=1.2 #m\n",
+ "e=10**-2 #v\n",
+ "B=5*10**-5 #tesla\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "V=e/(B*math.pi*L**2)\n",
+ "\n",
+ "#Result\n",
+ "print\"The rate of rotation of the wheel is\",round(V,1),\"Rotation a**-1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rate of rotation of the wheel is 44.2 Rotation a**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.7 Page no 509"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "D=10\n",
+ "L=0.50 #m\n",
+ "B=0.40*10**-4 #T\n",
+ "V=2 #r.p.s.\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "E=-B*math.pi*L**2*V\n",
+ "\n",
+ "#Result\n",
+ "print\"The induced e.m.f. between the axle and the rim of the wheel is\",round(E*10**5,3),\"10**-5\",\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The induced e.m.f. between the axle and the rim of the wheel is -6.283 10**-5 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.8 Page no 509"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=0.2 #T\n",
+ "r=0.1 #m\n",
+ "R=2 #ohm\n",
+ "D=20*math.pi #rad s**-1\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "V=D/(2*math.pi)\n",
+ "E=-B*math.pi*r**2*V\n",
+ "I=E/R\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) The potential difference is\",round(E,4),\"V\"\n",
+ "print\"(ii) The induced current is\",round(I,4),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The potential difference is -0.0628 V\n",
+ "(ii) The induced current is -0.0314 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.9 Page no 509"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=8.0*10**-5 #Wb m**-2\n",
+ "L=2 #m\n",
+ "v=30 #m s**-1\n",
+ "\n",
+ "#Calculation\n",
+ "e=B*L*v\n",
+ "\n",
+ "#Result\n",
+ "print\"The vertical component of earth's field is\",e*10**3,\"10**-3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The vertical component of earth's field is 4.8 10**-3\n"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.10 Page no 509"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Givem\n",
+ "l=10 #m\n",
+ "v=5 #m/s\n",
+ "Bh=0.30*10**-4 #Wb/m**2\n",
+ "\n",
+ "#Calculation\n",
+ "e=Bh*l*v\n",
+ "\n",
+ "#Result\n",
+ "print \"Instantaneous value of e.m.f. induced is\",e*10**3,\"*10**-3 V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Instantaneous value of e.m.f. induced is 1.5 *10**-3 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 64
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.11 Page no 509"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=0.3 #T\n",
+ "v=10**-2 #m/s\n",
+ "l=8*10**-2\n",
+ "L=1\n",
+ "v1=1.0\n",
+ "l2=2*10**-2\n",
+ "L1=8\n",
+ "\n",
+ "#Calculation\n",
+ "e=B*l*v\n",
+ "l=L/v1\n",
+ "e1=B*l2*v\n",
+ "t1=L1/v1\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Voltage developed in the direction of motion normal to the longer side is\", e*10**3,\"mv\"\n",
+ "print\"(ii) Voltage developed in the direction of motion normal to the shorter side is\",e1*10**3,\"mV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Voltage developed in the direction of motion normal to the longer side is 0.24 mv\n",
+ "(ii) Voltage developed in the direction of motion normal to the shorter side is 0.06 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 72
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.12 Page no 510"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=0.4 #T\n",
+ "v=5 #m/s\n",
+ "l=0.25 #m\n",
+ "e=0.5\n",
+ "R=5.0\n",
+ "\n",
+ "#Calculation\n",
+ "e=B*l*v\n",
+ "I=e/R\n",
+ "\n",
+ "#Result\n",
+ "print\"New current is\",I,\"A\"\n",
+ "print\"Direction is from the end S to R\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "New current is 0.1 A\n",
+ "Direction is from the end S to R\n"
+ ]
+ }
+ ],
+ "prompt_number": 75
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.13 Page no 510"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "v=500 #m/s\n",
+ "B=5*10**-4 #t\n",
+ "a=30 #degree\n",
+ "l=25 #m\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Bv=B*math.sin(a*3.14/180.0)\n",
+ "e=Bv*l*v\n",
+ "\n",
+ "#Result\n",
+ "print\"Voltage difference is\", round(e,3),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage difference is 3.124 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 80
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.14 Page no 510"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=10*10**-3 #H\n",
+ "I=4*10**-3 #A\n",
+ "N=200.0\n",
+ "\n",
+ "#Calculation\n",
+ "a=L*I\n",
+ "A=a/N\n",
+ "\n",
+ "#Result\n",
+ "print\"Total magnetic flux is\",a,\"Weber\"\n",
+ "print\"Magnetic flux through the cross section is\",A,\"Weber\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total magnetic flux is 4e-05 Weber\n",
+ "Magnetic flux through the cross section is 2e-07 Weber\n"
+ ]
+ }
+ ],
+ "prompt_number": 85
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.15 Page no 510"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=10**-2 #H\n",
+ "I1=0\n",
+ "I2=1 #A\n",
+ "l=1 \n",
+ "t=0.01\n",
+ "\n",
+ "#Calculation\n",
+ "e=-L*(l/t)\n",
+ "\n",
+ "#Result\n",
+ "print\"Self induced e.m.f is\", e,\"V\"\n",
+ "print\"The self-induced e.m.f. will act so as to oppose the growth of current.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Self induced e.m.f is -1.0 V\n",
+ "The self-induced e.m.f. will act so as to oppose the growth of current.\n"
+ ]
+ }
+ ],
+ "prompt_number": 89
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.16 Page no 510"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=1500 #turns/m\n",
+ "A=2*10**-4 #m**2\n",
+ "l=20 #A/s\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "e=-4*math.pi*n*A*l*10**-7\n",
+ "\n",
+ "#Result\n",
+ "print\"Induced e.m.f. is\",round(e*10**6,2)*10**-6,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Induced e.m.f. is -7.54e-06 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 97
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.17 Page no 511"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "e=50*10**-3 #V\n",
+ "a=8\n",
+ "b=4\n",
+ "t=0.5\n",
+ "\n",
+ "#Calculation\n",
+ "l=a-b\n",
+ "M=e*t/l\n",
+ "\n",
+ "#Result\n",
+ "print\"Mutual inductance is\",M*10**3,\"*10**-3 H\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mutual inductance is 6.25 *10**-3 H\n"
+ ]
+ }
+ ],
+ "prompt_number": 101
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.18 Page no 511"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n1=5000 #turns/m\n",
+ "A=4*10**-4 #m**2\n",
+ "n2l=200\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "M=4*math.pi*u*n1*n2l*A\n",
+ "\n",
+ "#Result\n",
+ "print\"Mutual inductance is\", round(M*10**4,3),\"*10**-4 H\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mutual inductance is 5.027 *10**-4 H\n"
+ ]
+ }
+ ],
+ "prompt_number": 109
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.19 Page no 511"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "N=1200\n",
+ "A=12*10**-4\n",
+ "r=15*10**-2 #m\n",
+ "u=10**-7\n",
+ "I=1.0\n",
+ "N2=300\n",
+ "I1=0\n",
+ "I2=2\n",
+ "t=0.05\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "n=N/(2*math.pi*r)\n",
+ "B=4*math.pi*u*n\n",
+ "a=B*A*N\n",
+ "L=a/I\n",
+ "a1=B*A*N2\n",
+ "a11=a1*I1\n",
+ "a12=a1*I2\n",
+ "a13=a12-a11\n",
+ "e=-a13/t\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Self inductance is\", L*10**3,\"*10**-3 H\"\n",
+ "print\"(b) Induced e.m.f is\", round(e,3),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Self inductance is 2.304 *10**-3 H\n",
+ "(b) Induced e.m.f is -0.023 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 124
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.20 Page no 511"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=25*10**-4\n",
+ "N=500\n",
+ "l=30.0*10**-2 #m\n",
+ "I=2.5\n",
+ "u=10**-7\n",
+ "t=10.0**-3\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "n=N/l\n",
+ "B=4*math.pi*u*n*I\n",
+ "a=B*A*N\n",
+ "a1=0-a\n",
+ "e=-a1/t\n",
+ "\n",
+ "#Result\n",
+ "print\"Average induced e.m.f. produced is\", round(e,3),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average induced e.m.f. produced is 6.545 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 130
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.21 Page no 511"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "N=25.0\n",
+ "A=2*10**-4 #m**2\n",
+ "q=7.5*10**-3\n",
+ "R=0.50\n",
+ "\n",
+ "#Calculation\n",
+ "B=R*q/(N*A)\n",
+ "\n",
+ "#Result\n",
+ "print\"Field strength of the magnet is\" ,B,\"T\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Field strength of the magnet is 0.75 T\n"
+ ]
+ }
+ ],
+ "prompt_number": 136
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.22 Page no 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=0.50 #T\n",
+ "l=15*10**-2 #m\n",
+ "R=9.0*10**-3 #ohm\n",
+ "v=12*10**-2 #m/s\n",
+ "\n",
+ "#Calculation\n",
+ "e=B*v*l\n",
+ "F=B*l*(e/R)\n",
+ "P=F*v\n",
+ "P1=e**2/R\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Induced e.m.f is\", e*10**3,\"*10**3 V\"\n",
+ "print\"The end P of the rod will become positive and the end Q will become negative\"\n",
+ "print\"(b) on closing the switch, electrons collects at the end Q. Therefore , excess charge is built up i.e it doesn't open when switch is open\" \n",
+ "print\"(c) The magnetic lorentz force on electron is cancelled due to the electric field set up across the two end\"\n",
+ "print\"(d) Retarding force is\",F*10**2,\"*10**-2 N\"\n",
+ "print\"(e) Power is\",P*10**3,\"*10*-3 W\"\n",
+ "print\"(f) Dissipated power is\",P*10**3,\"*10**-3 W\"\n",
+ "print\"(g) The motion of the rod does not cut field lines,hence no induced e.m.f. is produced\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Induced e.m.f is 9.0 *10**3 V\n",
+ "The end P of the rod will become positive and the end Q will become negative\n",
+ "(b) on closing the switch, electrons collects at the end Q. Therefore , excess charge is built up i.e it doesn't open when switch is open\n",
+ "(c) The magnetic lorentz force on electron is cancelled due to the electric field set up across the two end\n",
+ "(d) Retarding force is 7.5 *10**-2 N\n",
+ "(e) Power is 9.0 *10*-3 W\n",
+ "(f) Dissipated power is 9.0 *10**-3 W\n",
+ "(g) The motion of the rod does not cut field lines,hence no induced e.m.f. is produced\n"
+ ]
+ }
+ ],
+ "prompt_number": 156
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.23 Page no 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a1=20*10**-2\n",
+ "a2=0.3*10**-2 #m\n",
+ "x=15*10**-2\n",
+ "I=2.0 #A\n",
+ "u=10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "B1=u*2*math.pi*I*a1**2/((a1**2+x**2)**1.5)\n",
+ "a=B1*math.pi*a2**2\n",
+ "M=a/I\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Flux is\", round(B1*10**6,3)*10**-6 ,\"T\"\n",
+ "print\"(b) Mutual inductance is\",round(M*10**11,3)*10**-11,\"H\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Flux is 3.217e-06 T\n",
+ "(b) Mutual inductance is 4.548e-11 H\n"
+ ]
+ }
+ ],
+ "prompt_number": 168
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 16.25 Page no 513"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "N1=1500\n",
+ "l1=80.0*10**-2\n",
+ "l2=4*10**-2\n",
+ "r2=2*10**-2\n",
+ "I=3.0 #A\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A2=math.pi*r**2\n",
+ "n1=N1/l1\n",
+ "a=4*math.pi*10**-7*n1*I*4*math.pi*10**-4*100\n",
+ "M=a/I\n",
+ "\n",
+ "#Result\n",
+ "print\"Flux is\",round( a*10**4,3),\"*10**-4 Wb\"\n",
+ "print\"Mutual inductance is\",round(M*10**4,2),\"*10**-4 H\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flux is 8.883 *10**-4 Wb\n",
+ "Mutual inductance is 2.96 *10**-4 H\n"
+ ]
+ }
+ ],
+ "prompt_number": 181
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap17.ipynb b/modern_physics_by_Satish_K._Gupta/chap17.ipynb
new file mode 100644
index 00000000..cb448cf8
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap17.ipynb
@@ -0,0 +1,263 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7c5cc6b58c18456d76e825a85df242d83f70c07f62b0e167355c9552ee60085c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 17 Transient Current"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.1 Page no 534"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=3 #V\n",
+ "L=2.5 #H\n",
+ "R=50.0 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "T=L/R\n",
+ "L1=E/L\n",
+ "I0=E/R\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Time constant is\", T,\"S\"\n",
+ "print\"(ii) Rate of change of current is\",L1,\"A/S\"\n",
+ "print\"(iii) Maximum current is\",I0,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Time constant is 0.05 S\n",
+ "(ii) Rate of change of current is 1.2 A/S\n",
+ "(iii) Maximum current is 0.06 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.2 Page no 534"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=1 #V\n",
+ "R=1 #ohm\n",
+ "L=1 #H\n",
+ "t=1 #S\n",
+ "a=2.3036\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "I=1-math.exp(-E/L)\n",
+ "t=a*math.log10(2)\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Current after 1 S is\", round(I,3),\"A\"\n",
+ "print\"(ii) Time to take the current to reach half its final value is\",round(t,3),\"S\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Current after 1 S is 0.632 A\n",
+ "(ii) Time to take the current to reach half its final value is 0.693 S\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.3 Page no 534"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I0=2 #A\n",
+ "L=0.1 #H\n",
+ "R=20 #ohm\n",
+ "I=0.3 \n",
+ "a=3.333\n",
+ "b=200.0\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "t=2.3026*math.log10(a)/b\n",
+ "l=R*I*I0/L\n",
+ "\n",
+ "#Result\n",
+ "print\"Rate of change of current is\", l,\"A/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate of change of current is 120.0 A/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.4 Page no 535"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=2*10**6 #ohm\n",
+ "C=10**-6 #farad\n",
+ "q=0.8647\n",
+ "a=0.1353\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "t=-2*2.3026*math.log10(a)\n",
+ "\n",
+ "#Result\n",
+ "print\"Time is\", round(t,0),\"S\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time is 4.0 S\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.5 Page no 535"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C=1.443*10**-6 #F\n",
+ "t=60 #S\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "a=2.303*math.log10(2)\n",
+ "R=t/(C*a)\n",
+ "\n",
+ "#Result\n",
+ "print\"Value of resistance is\", round(R*10**-6,0),\"*10**6 ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of resistance is 60.0 *10**6 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 17.6 Page no 535"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=200*10**-6 #H\n",
+ "f1=8*10**5\n",
+ "f2=12*10**-5 #Hz\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "C1=1/(4*math.pi**2*f1**2*L)\n",
+ "C=1/(4*math.pi**2*f2**2*L)\n",
+ "\n",
+ "#Result\n",
+ "print\"Range of capacitor C is\",round(C*10**-8,0),\"pF\"\n",
+ "print\"Range of capacitor C1 is\",round(C1*10**12,0),\"pF\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Range of capacitor C is 88.0 pF\n",
+ "Range of capacitor C1 is 198.0 pF\n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap18.ipynb b/modern_physics_by_Satish_K._Gupta/chap18.ipynb
new file mode 100644
index 00000000..94dff4f2
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap18.ipynb
@@ -0,0 +1,1298 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:14dd6f2dca7ff6e4458a0a97e28043f8703a45199dee1a45b482cebdf3ee0a74"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 18 Alternating current"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.2 Page no 555"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f1=100\n",
+ "f2=2.0\n",
+ "I0=50\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "f=f1/f2\n",
+ "Im=0.636*I0\n",
+ "Iv=0.707*I0\n",
+ "I=I0*math.sin(60*3.14/180.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Frequency of A.C applied is\",f,\"c.p.s\"\n",
+ "print\"(ii) Mean value of current is\",Im,\"A\"\n",
+ "print\"(iii) Virtual value of current is\",Iv,\"A\"\n",
+ "print\"(iv) Value of current is\",round(I,1),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Frequency of A.C applied is 50.0 c.p.s\n",
+ "(ii) Mean value of current is 31.8 A\n",
+ "(iii) Virtual value of current is 35.35 A\n",
+ "(iv) Value of current is 43.3 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Example 18.3 Page no 555"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=10.0 #ohm\n",
+ "E0=200\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Ev=E0/math.sqrt(2)\n",
+ "Iv=Ev/R\n",
+ "Pav=Ev*Iv\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) r.m.s value of voltage is\", E0,\"V\"\n",
+ "print\"(ii) r.m.s value of current is\",round(Iv,2),\"A\"\n",
+ "print\"(iii)Power dissipated is\",Pav,\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) r.m.s value of voltage is 200 V\n",
+ "(ii) r.m.s value of current is 14.14 A\n",
+ "(iii)Power dissipated is 2000.0 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.4 Page no 555"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=1 #H\n",
+ "Ev=110 #V\n",
+ "f=70 #Hz\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Xl=2*3.14*f*L\n",
+ "I=Ev/Xl\n",
+ "I0=math.sqrt(2)*I\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Reactance is\", round(Xl,0)\n",
+ "print\"(b) Current through inductance is\",round(I,2),\"A\"\n",
+ "print\"(c) Peak value of current is\",round(I0,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Reactance is 440.0\n",
+ "(b) Current through inductance is 0.25 A\n",
+ "(c) Peak value of current is 0.354 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.5 Page no 555"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=2*10**-3\n",
+ "w=200 #rad/s\n",
+ "I0=0.2\n",
+ "\n",
+ "#Calculation\n",
+ "Xl=w*L\n",
+ "e=L*I0*w\n",
+ "I0=e/Xl\n",
+ "\n",
+ "#Result\n",
+ "print\"Maximum value of induced current is\", I0,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum value of induced current is 0.2 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.6 Page no 555"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C=10*10**-6 #F\n",
+ "f=50 #cycles/s\n",
+ "Ev=110\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Xc=1/(math.pi*2*f*C)\n",
+ "Iv=Ev/Xc\n",
+ "\n",
+ "#Result\n",
+ "print\"Virtual value of current is\", round(Iv,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Virtual value of current is 0.346 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.7 Page no 555"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=4\n",
+ "R=30 #ohm\n",
+ "Ev=200\n",
+ "f=50\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Xl=2*math.pi*f*(L/math.pi)\n",
+ "Z=math.sqrt(R**2+Xl**2)\n",
+ "Iv=Ev/Z\n",
+ "\n",
+ "#Result\n",
+ "print\"current flowing in the circuit is\", round(Iv,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "current flowing in the circuit is 0.499 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.8 Page no 556"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=100\n",
+ "I=1.0\n",
+ "Iv=0.5\n",
+ "f=50\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "R=E/I\n",
+ "Z=E/Iv\n",
+ "Xl=math.sqrt(Z**2-R**2)\n",
+ "L=Xl/(2*math.pi*f)\n",
+ "\n",
+ "#Result\n",
+ "print\"Inductance of the coil is\", round(L,2),\"H\"\n",
+ "print\"Resistance is\",R,\"ohm\"\n",
+ "print\"Impedence is\",Z,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Inductance of the coil is 0.55 H\n",
+ "Resistance is 100.0 ohm\n",
+ "Impedence is 200.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.9 Page no 556"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=0.50 #H\n",
+ "R=100.0 #ohm\n",
+ "f=50 #Hz\n",
+ "Ev=240\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Iv=Ev/(math.sqrt(R**2+(2*math.pi*f*L)**2))\n",
+ "I0=math.sqrt(2)*Iv\n",
+ "a=2*math.pi*f*L/R\n",
+ "a1=math.atan(a)*180/3.14\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Maximum current in the coil is\", round(I0,3),\"A\"\n",
+ "print\"(b) Phase difference is\",round(a1,1),\"degree (e.m.f. leads current)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Maximum current in the coil is 1.823 A\n",
+ "(b) Phase difference is 57.5 degree (e.m.f. leads current)\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.10 Page no 556"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Ev=220\n",
+ "Iv=0.5\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "R=Ev/Iv\n",
+ "Xl=Ev/Iv\n",
+ "Z=math.sqrt(R**2+Xl**2)\n",
+ "Iv1=Ev/Z\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) X is a resistor of\",R,\"ohm\\n and Y is a inductor of\",Xl,\"ohm\"\n",
+ "print\"(b) Current in the circuit is\",round(Iv1,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) X is a resistor of 440.0 ohm\n",
+ " and Y is a inductor of 440.0 ohm\n",
+ "(b) Current in the circuit is 0.354 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.11 Page no 556"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Z=100 #ohm\n",
+ "a=45 #degree\n",
+ "f=1000\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Xl=Z/math.sqrt(2)\n",
+ "L=Xl/(2*math.pi*f)\n",
+ "\n",
+ "#Result\n",
+ "print\"Self inductance of the coil is\", round(L*10**2,4),\"*10**-2 H\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Self inductance of the coil is 1.1254 *10**-2 H\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.12 Page no 556"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=10 #ohm\n",
+ "Ev=220\n",
+ "f=50 #Hz\n",
+ "Iv=2.0 #A\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Z=Ev/Iv\n",
+ "Xc=math.sqrt(Z**2-R**2)\n",
+ "\n",
+ "#Result\n",
+ "print\"Reactance of the capacitor is\",round(Xc,2),\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reactance of the capacitor is 109.54 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.13 Page no 556"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=10\n",
+ "C=0.1*10**-6 #F\n",
+ "Ev=100 #V\n",
+ "f=50\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Z=math.sqrt(R**2+(1/(2*math.pi*f*C))**2)\n",
+ "Iv=Ev/Z\n",
+ "\n",
+ "#Result\n",
+ "print\"Current in the circuit is\", round(Iv*10**3,3),\"*10**-3 A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in the circuit is 3.142 *10**-3 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.14 Page no 557"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C=100*10**-6\n",
+ "R=40\n",
+ "Ev=110\n",
+ "f=60\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Iv=Ev/(math.sqrt(R**2+(1/(2*math.pi*f*C)**2)))\n",
+ "Iv1=math.sqrt(2)*Iv\n",
+ "a=1/(2*math.pi*f*C*R)\n",
+ "a1=math.atan(a)*180/3.14\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Maximum current in the circuit is\", round(Iv1,2),\"A\"\n",
+ "print\"(b) Phase lag between the current maximum and voltage maximum is\",round(a1,2),\"degree (e.m.f. lags behind the current)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Maximum current in the circuit is 3.24 A\n",
+ "(b) Phase lag between the current maximum and voltage maximum is 33.57 degree (e.m.f. lags behind the current)\n"
+ ]
+ }
+ ],
+ "prompt_number": 62
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.15 page no 557"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C=100*10**-6\n",
+ "R=50 #ohm\n",
+ "L=0.5 #H\n",
+ "Ev=110\n",
+ "f=50\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Z=math.sqrt(R**2+(2*math.pi*f*L-1/(2*math.pi*f*C))**2)\n",
+ "I0=Ev/Z\n",
+ "\n",
+ "#Result\n",
+ "print\"r.m.s value of current is\", round(I0,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "r.m.s value of current is 0.816 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 68
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.16 Page no 557"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=0.1 #H\n",
+ "C=25*10**-6\n",
+ "R=25.0\n",
+ "e=314\n",
+ "E0=310\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "f=e/(2*math.pi)\n",
+ "Xl=2*math.pi*f*L\n",
+ "Xc=1/(2*math.pi*f*C)\n",
+ "A=Xc-Xl\n",
+ "Z=math.sqrt(R**2+(Xc-Xl)**2)\n",
+ "Ev=E0/math.sqrt(2)\n",
+ "Iv=Ev/Z\n",
+ "a1=(Xc-Xl)/R\n",
+ "a2=math.atan(a1)*180/3.14\n",
+ "a3=a2*math.pi/180.0\n",
+ "V=Iv*Xc\n",
+ "V1=Iv*Xl\n",
+ "V2=Iv*R\n",
+ "L=1/(((2*math.pi*f)**2)*C)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The frequency of the e.m.f is\",round(f,0),\"cycle s**-1\" \n",
+ "print\"(b) The reactance of the circuit is\",round(A,0),\"ohm\"\n",
+ "print\"(c) The impedance of the circuit is\",round(Z,1),\"ohm\"\n",
+ "print\"(d) The current in the circuit is\",round(Iv,2),\"A\"\n",
+ "print\"(e) The phase angle of the current is\",round(a3,3),\"rad\"\n",
+ "print\"(f) The expression for the instantaneous value of the current is 3.125 cos(314t-1.316)\"\n",
+ "print\"(g) Effective voltage across the capacitor is\",round(V,1),\"V\"\n",
+ "print\" Effective Voltage across the inductor is\",round(V1,1),\"V\"\n",
+ "print\"Effective voltage across the resistor is\",round(V2,2),\"V\"\n",
+ "print\"(h) Value of inductance is\",round(L,3),\"H\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The frequency of the e.m.f is 50.0 cycle s**-1\n",
+ "(b) The reactance of the circuit is 96.0 ohm\n",
+ "(c) The impedance of the circuit is 99.2 ohm\n",
+ "(d) The current in the circuit is 2.21 A\n",
+ "(e) The phase angle of the current is 1.317 rad\n",
+ "(f) The expression for the instantaneous value of the current is 3.125 cos(314t-1.316)\n",
+ "(g) Effective voltage across the capacitor is 281.5 V\n",
+ " Effective Voltage across the inductor is 69.4 V\n",
+ "Effective voltage across the resistor is 55.25 V\n",
+ "(h) Value of inductance is 0.406 H\n"
+ ]
+ }
+ ],
+ "prompt_number": 113
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.17 Page no 558"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f=50 #Hz\n",
+ "L=101.5*10**-3\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "C=1/((2*math.pi*f)**2*L)\n",
+ "\n",
+ "#Result\n",
+ "print\"Capacitance of the capacitor is\",round(C*10**6,0),\"micro F\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance of the capacitor is 100.0 micro F\n"
+ ]
+ }
+ ],
+ "prompt_number": 117
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.18 Page no 558"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Ev=230 #V\n",
+ "L=5 #H\n",
+ "C=80*10**-6\n",
+ "R=40.0\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "f=1/(math.pi*2*math.sqrt(L*C))\n",
+ "E0=math.sqrt(2)*Ev\n",
+ "A=E0/R\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Angular frequency is\", round(f,2),\"Hz\"\n",
+ "print\"(ii) Impedence of circuit is\",R,\"ohm\"\n",
+ "print\"(iii) Amplitude of the current is\",round(A,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Angular frequency is 7.96 Hz\n",
+ "(ii) Impedence of circuit is 40.0 ohm\n",
+ "(iii) Amplitude of the current is 8.13\n"
+ ]
+ }
+ ],
+ "prompt_number": 126
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.19 Page no 558"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C=2*10**-6 #F\n",
+ "R=100 #ohm\n",
+ "L=8 #H\n",
+ "E=200 #V\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "F=1/((2*math.pi*math.sqrt(L*C)))\n",
+ "D=2*math.pi*F*L\n",
+ "L1=E/R\n",
+ "\n",
+ "#Result\n",
+ "print\"The resonant frequency is\",round(F,2),\"Hz\"\n",
+ "print\"(i) The inductive and capacitive reactances of the circuit is\",D,\"ohm\"\n",
+ "print\"(ii) Total impedance of the circuit is 100\",\"ohm\"\n",
+ "print\"(iii) Peak value of current is\",L1,\"A\"\n",
+ "print\"(iv) The voltages across inductor and resistor differ in phase by\",\"90\"\n",
+ "print\"(v) The voltages across inductor and capacitor differ in phase by\",\"180\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resonant frequency is 39.79 Hz\n",
+ "(i) The inductive and capacitive reactances of the circuit is 2000.0 ohm\n",
+ "(ii) Total impedance of the circuit is 100 ohm\n",
+ "(iii) Peak value of current is 2 A\n",
+ "(iv) The voltages across inductor and resistor differ in phase by 90\n",
+ "(v) The voltages across inductor and capacitor differ in phase by 180\n"
+ ]
+ }
+ ],
+ "prompt_number": 144
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.20 Page no 558"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Ev=220 #V\n",
+ "f=50 #Hz\n",
+ "R=100.0 #ohm\n",
+ "Vr=65 #V\n",
+ "Vc=415 #V\n",
+ "Vl=204 #V\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Iv=Vr/R\n",
+ "Xl=Vl/Iv\n",
+ "L=Xl/(2*math.pi*f)\n",
+ "Xc=Vc/Iv\n",
+ "C=1/(2*math.pi*f*Xc)\n",
+ "C1=1/(4*math.pi**2*f**2*L)\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) The current in the circuit is\",Iv,\"A\"\n",
+ "print\"(ii) The value of the inductor is\",round(L,0),\"H\"\n",
+ "print\"(iii) The value of the capacitor C is\",round(C*10**6,1),\"micro F\"\n",
+ "print\"(iv) The value of C required to produce resonance is\",round(C1*10**6,1),\"micro F\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The current in the circuit is 0.65 A\n",
+ "(ii) The value of the inductor is 1.0 H\n",
+ "(iii) The value of the capacitor C is 5.0 micro F\n",
+ "(iv) The value of C required to produce resonance is 10.1 micro F\n"
+ ]
+ }
+ ],
+ "prompt_number": 189
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.21 Page no 559"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=3 #H\n",
+ "C=27*10**-6\n",
+ "R=7.4 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "w0=1/(math.sqrt(L*C))\n",
+ "Q=1/R*(math.sqrt(L/C))\n",
+ "\n",
+ "#Result\n",
+ "print\"Resonant frequency is\", round(w0,1),\"rad/s\"\n",
+ "print\"Q factor is\",round(Q,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resonant frequency is 111.1 rad/s\n",
+ "Q factor is 45.05\n"
+ ]
+ }
+ ],
+ "prompt_number": 196
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.22 Page no 559"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=30 #ohm\n",
+ "Xl=40\n",
+ "E0=220\n",
+ "I0=1 \n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Z=math.sqrt(R**2+Xl**2)\n",
+ "a=R/Z\n",
+ "Pav=E0*I0*a/(math.sqrt(2)*math.sqrt(2))\n",
+ "\n",
+ "#Result\n",
+ "print\"Power consumed in the circuit is\", Pav,\"Watt\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power consumed in the circuit is 66.0 Watt\n"
+ ]
+ }
+ ],
+ "prompt_number": 201
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.23 Page no 559"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Ev=100\n",
+ "f=50 #Hz\n",
+ "C=10*10**-6\n",
+ "R=100\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Xc=1/(2*math.pi*f*C)\n",
+ "Iv=Ev/Xc\n",
+ "Pav=Ev*Iv*Ev/(math.sqrt(Ev**2+Xc**2))\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The reactance of the capacitor is\",round(Xc,2),\"ohm\"\n",
+ "print\"(b) Current flowing is\",round(Iv,3),\"A\"\n",
+ "print\"(c) Average power supplied is\",round(Pav,2),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The reactance of the capacitor is 318.31 ohm\n",
+ "(b) Current flowing is 0.314 A\n",
+ "(c) Average power supplied is 9.42 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 214
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.24 Page no 559"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=60.0\n",
+ "P=10\n",
+ "Ev=100\n",
+ "f=60 #Hz\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "I=P/V\n",
+ "R=f/I\n",
+ "Z=Ev/I\n",
+ "L=math.sqrt(Z**2-R**2)/(2*math.pi*f)\n",
+ "R1=Z-R\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) The inductance is\", round(L,3),\"henry\"\n",
+ "print\"(ii) Value of resistance is\",R1,\"ohm\"\n",
+ "print\"(iii) If resistance is used in the place of inductance, the electrical energy is wasted.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The inductance is 1.273 henry\n",
+ "(ii) Value of resistance is 240.0 ohm\n",
+ "(iii) If resistance is used in the place of inductance, the electrical energy is wasted.\n"
+ ]
+ }
+ ],
+ "prompt_number": 224
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.25 Page no 559"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=50.0 #V\n",
+ "P=20 #watt\n",
+ "Ev=250 #V\n",
+ "f=50\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "I=P/V\n",
+ "R=V/I\n",
+ "Z=Ev/I\n",
+ "C=1/(2*math.pi*f*Ev*math.sqrt(6))\n",
+ "\n",
+ "#Result\n",
+ "print\"Value of capacitance required is\", round(C*10**6,3)*10**-6,\"F\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of capacitance required is 5.198e-06 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 233
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.26 Page no 560"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Ev=200\n",
+ "f=50 #H\n",
+ "R=50\n",
+ "L=0.3\n",
+ "C=40*10**-6\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Xl=2*math.pi*f*L\n",
+ "Xc=1/(2*math.pi*f*C)\n",
+ "Z=math.sqrt(R**2+(Xl-Xc)**2)\n",
+ "Iv=Ev/Z\n",
+ "a=R/Z\n",
+ "Pav=Ev*Iv*a\n",
+ "\n",
+ "#Result\n",
+ "print\"Impedence in the circuit is\", round(Z,2),\"ohm\"\n",
+ "print\"Power in the circuit is\",round(Pav,1),\"watt\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Impedence in the circuit is 52.11 ohm\n",
+ "Power in the circuit is 736.6 watt\n"
+ ]
+ }
+ ],
+ "prompt_number": 244
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.27 Page no 560"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Ev=200 #v\n",
+ "L=5 #H\n",
+ "C=80\n",
+ "R=40.0\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "W=10**3/(math.sqrt(L*C))\n",
+ "Iv=Ev/R\n",
+ "I0=math.sqrt(2)*Iv\n",
+ "Pav=Ev*L*math.cos(0*3.14/180.0)\n",
+ "\n",
+ "print\"(a) Angular frequency is\",W,\"rad s**-1\"\n",
+ "print\"(b) The current amplitude is\",round(I0,2),\"A\" \n",
+ "print\"(c) The power dissipation in the circuit is\",Pav,\"Watt\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Angular frequency is 50.0 rad s**-1\n",
+ "(b) The current amplitude is 7.07 A\n",
+ "(c) The power dissipation in the circuit is 1000.0 Watt\n"
+ ]
+ }
+ ],
+ "prompt_number": 272
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.28 Page no 560"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=5.0 #H\n",
+ "C=80*10**-6 #F\n",
+ "R=40.0 #ohm\n",
+ "Ev=230 #V\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "D=1/math.sqrt(L*C)\n",
+ "Iv=Ev/R\n",
+ "I0=math.sqrt(2)*Iv\n",
+ "S=Iv*R\n",
+ "S1=Iv*D*L\n",
+ "S2=Iv/(1/D*C)\n",
+ "S3=Iv/(D*L-1/D*C)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The resonant angular frequency is\",D,\"rad s**-1\"\n",
+ "print\"(b) The impedance of the circuit and the amplitude of curremt is\",round(I0,2),\"A\"\n",
+ "print\"(c) The R.M.S. potential drop across LC is\",round(S3,0)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The resonant angular frequency is 50.0 rad s**-1\n",
+ "(b) The impedance of the circuit and the amplitude of curremt is 8.13 A\n",
+ "(c) The R.M.S. potential drop across LC is 0.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 282
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.29 Page no 560"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=0.12 #H\n",
+ "C=480*10**-9 #F\n",
+ "R=23 #ohm\n",
+ "Ev=230 #V\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "D=1/(math.sqrt(L*C))\n",
+ "Iv=Ev/(math.sqrt(R**2+(D*L-1/D*C))**2)\n",
+ "I0=(math.sqrt(2)*Ev)/(math.sqrt(R**2+(D*L-1/D*C))**2)\n",
+ "I1=(math.sqrt(2)*Ev)/R\n",
+ "EvIv=Ev*(I1/math.sqrt(2))\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The source frequency is\",round(D,1),\"rad s**-1\"\n",
+ "print\" The maximum value is\",round(I1,2),\"A\"\n",
+ "print\"(b) Average power will also be maximum at resonant frequency is\",round(D,1),\"rad s**-1\" \n",
+ "print\" The value of this maximum power is\",EvIv,\"Watt\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The source frequency is 4166.7 rad s**-1\n",
+ " The maximum value is 14.14 A\n",
+ "(b) Average power will also be maximum at resonant frequency is 4166.7 rad s**-1\n",
+ " The value of this maximum power is 2300.0 Watt\n"
+ ]
+ }
+ ],
+ "prompt_number": 298
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 18.30 Page no 561"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=80*10**-3 #H\n",
+ "C=60*10**-6 #F\n",
+ "Ev=230 #V\n",
+ "f=50 #Hz\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Iv=-Ev/((2*math.pi*f*L)-(1/(2*math.pi*f*C)))\n",
+ "I0=math.sqrt(2)*Iv\n",
+ "Iv1=Iv*2*math.pi*f*L\n",
+ "Iv2=Iv*(1/(2*math.pi*f*C))\n",
+ "Pav=math.cos(90*3.14/180.0)*Ev\n",
+ "Pav1=math.cos(-90*3.14/180.0)*Ev\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The current amplitude is\",round(Iv,2),\"A\",\"and r.m.s. value is\",round(I0,2),\"A\"\n",
+ "print\"(b) The r.m.s. value of potential drops across L is\",round(Iv1,1),\"V\",\"and across C is\",round(Iv2,1),\"W\"\n",
+ "print\"(c) The average power transferred to the inductor is\",round(Pav,0)\n",
+ "print\"(d) The average power transferred to the capacitor is\",round(Pav1,0)\n",
+ "print\"(e) Total average power absorbed is zero\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The current amplitude is 8.24 A and r.m.s. value is 11.65 A\n",
+ "(b) The r.m.s. value of potential drops across L is 207.0 V and across C is 437.0 W\n",
+ "(c) The average power transferred to the inductor is 0.0\n",
+ "(d) The average power transferred to the capacitor is 0.0\n",
+ "(e) Total average power absorbed is zero\n"
+ ]
+ }
+ ],
+ "prompt_number": 357
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap19.ipynb b/modern_physics_by_Satish_K._Gupta/chap19.ipynb
new file mode 100644
index 00000000..6e89d5a2
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap19.ipynb
@@ -0,0 +1,640 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c81057d61d55f846d72bc0a6263de0452d74cd37dd94b021ce01d87a17a0c974"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 19 Electrical machines and devices"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.1 Page no 582"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Ep=2300.0 #v\n",
+ "Np=4000\n",
+ "Es=230 #v\n",
+ "\n",
+ "#Calculation\n",
+ "Ns=Np*(Es/Ep)\n",
+ "\n",
+ "#Result\n",
+ "print\"Number of turns is\", Ns"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of turns is 400.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.2 Page no 582"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Ep=220.0 #v\n",
+ "Es=110\n",
+ "E=550 #watt\n",
+ "\n",
+ "#Calculation\n",
+ "Ip=E/Ep\n",
+ "\n",
+ "#Result\n",
+ "print\"Current drawn is\",Ip,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn is 2.5 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.3 Page no 582"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Gien\n",
+ "Ep=220.0 #v\n",
+ "Es=22 \n",
+ "Z=220.0 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "Is=Es/Z\n",
+ "Ip=(Es/Ep)*Is\n",
+ "\n",
+ "#Result\n",
+ "print\"Current drawn is\",Ip,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn is 0.01 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.4 Page no 582"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Np=200.0\n",
+ "Ns=1000\n",
+ "Ep=200.0 #v\n",
+ "E=10**4 #W\n",
+ "\n",
+ "#Calculation\n",
+ "Es=(Ns/Np)*Ep\n",
+ "Ip=E/Ep\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Output voltage is\",Es,\"V\"\n",
+ "print\"(b) Current is\",Ip,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Output voltage is 1000.0 V\n",
+ "(b) Current is 50.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.5 Page no 582"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "ep=120\n",
+ "Ip=1.85 #A\n",
+ "Is=150*10**-3\n",
+ "n=0.95\n",
+ "\n",
+ "#Calculation\n",
+ "es=n*ep*Ip/Is\n",
+ "\n",
+ "#result\n",
+ "print\"Voltage across the secondary is\",es,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage across the secondary is 1406.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.6 Page no 582"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "K=100\n",
+ "Np=100\n",
+ "e=1100 #watt\n",
+ "ep=220.0\n",
+ "\n",
+ "#Calculation\n",
+ "Ns=K*Np\n",
+ "ip=e/ep\n",
+ "es=K*ep\n",
+ "Is=ip*ep/es\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Number of turns is\",Ns\n",
+ "print\"(ii) Current is\",ip,\"A\"\n",
+ "print\"(iii) Voltage across the secondary is\",es,\"V\"\n",
+ "print\"(iv) Current in the secondaryis\",Is,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Number of turns is 10000\n",
+ "(ii) Current is 5.0 A\n",
+ "(iii) Voltage across the secondary is 22000.0 V\n",
+ "(iv) Current in the secondaryis 0.05 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.7 Page no 583"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "e=11000 #W\n",
+ "es=220.0 #V\n",
+ "es1=22000.0\n",
+ "\n",
+ "#Calculation\n",
+ "Is=e/es\n",
+ "V=Is**2\n",
+ "Is1=e/es1\n",
+ "P=Is1**2\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Electrical energy dissipated when power is transmitted at es=220 V is\",V,\"R watt\"\n",
+ "print\"(ii)Electrical energy dissipated when power is transmitted at es=22000 V is\",P,\"R watt\"\n",
+ "print\"Transmission should be done at 22000 V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Electrical energy dissipated when power is transmitted at es=220 V is 2500.0 R watt\n",
+ "(ii)Electrical energy dissipated when power is transmitted at es=22000 V is 0.25 R watt\n",
+ "Transmission should be done at 22000 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.8 Page no 583"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=0.1 #T\n",
+ "n=2000\n",
+ "A=0.05 #m**2\n",
+ "w=2100 #r.p.m.\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "A1=2*math.pi*w/60.0\n",
+ "e0=w*B*A*A1\n",
+ "e=e0*math.sin(60*3.14/180.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"Maximum e.m.f is\", round(e0,0),\"V\"\n",
+ "print\"Instantaneous e.m.f is\",round(e,0),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum e.m.f is 2309.0 V\n",
+ "Instantaneous e.m.f is 1999.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.9 Page no 583"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=100\n",
+ "A=3 #m**2\n",
+ "w=60 #rad/s\n",
+ "B=0.04\n",
+ "R=500.0\n",
+ "\n",
+ "#Calculation\n",
+ "e0=n*B*A*w\n",
+ "I0=e0/R\n",
+ "P=e0*I0\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Maximum current is\",I0,\"A\"\n",
+ "print\"(b) Maximum power is\",P,\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Maximum current is 1.44 A\n",
+ "(b) Maximum power is 1036.8 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.10 Page no 583"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=50\n",
+ "A=2.5 #m**2\n",
+ "w=60 #rad/s\n",
+ "B=0.30\n",
+ "R=500.0\n",
+ "\n",
+ "#Calculation\n",
+ "e0=n*B*A*w\n",
+ "I0=e0/R\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The maximum current is\",I0,\"A\"\n",
+ "print\"(b) Current is zero when coil is vertical and flux is maximum.On the other hand current is maximum when coil is horizontal,flux is minimum\"\n",
+ "print\"(c) Yes,there should be relative motion between the magnetic field and coil\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The maximum current is 4.5 A\n",
+ "(b) Current is zero when coil is vertical and flux is maximum.On the other hand current is maximum when coil is horizontal,flux is minimum\n",
+ "(c) Yes,there should be relative motion between the magnetic field and coil\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.11 Page no 583"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=220\n",
+ "e=200.0\n",
+ "P=5000\n",
+ "\n",
+ "#Calculation\n",
+ "I=P/e\n",
+ "R=(E-e)/I\n",
+ "\n",
+ "#Result\n",
+ "print\"Armature current is\",I,\"A\"\n",
+ "print\"Motor resistance is\",R,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Armature current is 25.0 A\n",
+ "Motor resistance is 0.8 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 65
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.12 Page no 583"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=8.5\n",
+ "E=200\n",
+ "I=5\n",
+ "\n",
+ "#Calculation\n",
+ "e=E-(I*R)\n",
+ "Pi=E*I\n",
+ "Po=E*I-(I**2*R)\n",
+ "n=Po/Pi\n",
+ "\n",
+ "#Result\n",
+ "print\"Back e.m.f of the motor is\", e,\"V\"\n",
+ "print\"Power input is\",Pi,\"W\"\n",
+ "print\"Power output is\",Po,\"W\"\n",
+ "print\"Efficiencyis\",n*10**2,\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Back e.m.f of the motor is 157.5 V\n",
+ "Power input is 1000 W\n",
+ "Power output is 787.5 W\n",
+ "Efficiencyis 78.75 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 78
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.13 Page no 584"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "h=300\n",
+ "g=9.8 #m/s**2\n",
+ "a=1000\n",
+ "A=100.0\n",
+ "n=60\n",
+ "\n",
+ "#Calculation\n",
+ "m=A*a\n",
+ "E=m*g*h\n",
+ "P=E*n/A\n",
+ "\n",
+ "#Result\n",
+ "print\"Electric power is\", P*10**-6,\"MW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electric power is 176.4 MW\n"
+ ]
+ }
+ ],
+ "prompt_number": 84
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.14 Page no 584"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=30 #km\n",
+ "R=15 #ohm\n",
+ "V=4000.0 #V\n",
+ "P=8*10**5 #W\n",
+ "\n",
+ "#Calculation\n",
+ "Is=P/V\n",
+ "P1=Is**2*R\n",
+ "P2=P+P1\n",
+ "V1=R*Is\n",
+ "A=440-(V+V1)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Line power loss is\",P1*10**-3,\"KW\"\n",
+ "print\"(b) Supplied power is\",P2*10**-3,\"KW\"\n",
+ "print\"(c) Step up transformer at the plane is\",A"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Line power loss is 600.0 KW\n",
+ "(b) Supplied power is 1400.0 KW\n",
+ "(c) Step up transformer at the plane is -6560.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 94
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 19.15 Page no 584"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "r=8*10**-2\n",
+ "n=20\n",
+ "w=50 #rad/s\n",
+ "B=3*10**-2 #T\n",
+ "A=64*math.pi*10**-4 #m**2\n",
+ "Eav=0\n",
+ "R=10 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "math.pi\n",
+ "e0=n*B*A*w\n",
+ "Pav=e0**2/(2*R)\n",
+ "\n",
+ "#Result\n",
+ "print\" Maximum e.m.f. is\",round(e0,4),\"V\"\n",
+ "print\" Average e.m.f. is zero\"\n",
+ "print\" Dissipated power is\",round(Pav,4),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Maximum e.m.f. is 0.6032 V\n",
+ " Average e.m.f. is zero\n",
+ " Dissipated power is 0.0182 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 103
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap2.ipynb b/modern_physics_by_Satish_K._Gupta/chap2.ipynb
new file mode 100644
index 00000000..efbea0a7
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap2.ipynb
@@ -0,0 +1,534 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1e2d45d8326c66f64e42e0f8f482f41d5aabf3a1eabc7e50f07a0c18121fe999"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 Electric field"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 Page no 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=10**-7 #Kg\n",
+ "q=1.6*10**-19 #C\n",
+ "g=9.8\n",
+ "\n",
+ "#Calculation\n",
+ "E=(m*g)/q\n",
+ "\n",
+ "#Result\n",
+ "print\"Electric field strength required is\", E"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electric field strenght required is 6.125e+12\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2 Page no 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=10.0**-3 #Kg\n",
+ "q=5*10**-6 #C\n",
+ "u=20 #m/s\n",
+ "E=2*10**5 #N/C\n",
+ "\n",
+ "#Calculation\n",
+ "F=q*E\n",
+ "a=-F/m\n",
+ "S=-u**2/(2.0*a)\n",
+ "\n",
+ "#Result\n",
+ "print\"Distance travelled is\", S,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Distance travelled is 0.2 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3 Page no 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=2.55*10**4 #V/m\n",
+ "a=1.26*10**3 #Kg/m**4\n",
+ "g=9.81 #m/s**2\n",
+ "e=1.6*10**-19\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "q=12*e\n",
+ "Fe=q*E\n",
+ "r=((3*Fe)/(4.0*math.pi*a*g))**0.333\n",
+ "\n",
+ "#Result\n",
+ "print\"The radius of the drop is\", round(r*10**4,5)*10**3,\"*10**-4 mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The radius of the drop is 9.95 *10**-4 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4 Page no 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=80.0*10**-6 #Kg\n",
+ "q=2*10**-8 #C\n",
+ "E=20000 #V/m\n",
+ "g=9.8\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "a=(q*E)/(m*g)\n",
+ "a1=math.atan(a)*180/3.14\n",
+ "T=(q*E)/(math.sin(a1*3.14/180.0))\n",
+ "\n",
+ "#Result\n",
+ "print\"Tension in the thread of the pendulum is\", round(T*10**4,1),\"*10**-4 N\"\n",
+ "print\"Angle it make with the vertical is\",round(a1,2),\"Degree C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Tension in the thread of the pendulum is 8.8 *10**-4 N\n",
+ "Angle it make with the vertical is 27.04 Degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5 Page no 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q1=2.0*10**-7 #C\n",
+ "q2=1.0*10**-7 #C\n",
+ "r=10.0**-2 #m\n",
+ "m=9*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "E1=(m*q1)/r**2\n",
+ "E2=(m*q2)/r**2\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnitude of field E1 is\", E1*10**-7,\"*10**7 N/C\"\n",
+ "print\"Magnitude of field E2 is\", E2*10**-6,\"*10**6 N/C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of field E1 is 1.8 *10**7 N/C\n",
+ "Magnitude of field E2 is 9.0 *10**6 N/C\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6 Page no 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q1=5.0*10**-19 #c\n",
+ "q2=20*10**-19\n",
+ "r=2.0 #m\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "x=-math.sqrt(q2/q1)\n",
+ "x1=math.sqrt(q2/(q1*3))\n",
+ "\n",
+ "#Result\n",
+ "print\"The point on the line joining is\", round(x,1),\"m and \",round(x1,1),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The point on the line joining is -2.0 m and 1.2 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.7 Page no 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "r=0.2\n",
+ "m=9*10**9\n",
+ "qa=3*10**-6\n",
+ "q=1.5*10**-9\n",
+ "\n",
+ "#Calculation\n",
+ "a=r/2.0\n",
+ "Ea=(m*qa)/a**2\n",
+ "Eb=(m*qa)/a**2\n",
+ "E=Ea+Eb\n",
+ "F=q*E\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Electric field at the mid point is\", E*10**-6,\"*10**6 N/C (along OB)\"\n",
+ "print\"(b) Force experienced by the test charge is\",F*10**3,\"*10**-3 N (along OA)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Electric field at the mid point is 5.4 *10**6 N/C (along OB)\n",
+ "(b) Force experienced by the test charge is 8.1 *10**-3 N (along OA)\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.8 Page no 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "qa=16*10**-6 #c\n",
+ "qb=-9.0*10**-6 #C\n",
+ "r=0.08 #m\n",
+ "\n",
+ "#Calculation\n",
+ "x=-(qa/qb)*r\n",
+ "\n",
+ "#Result\n",
+ "print\"Position of the point is\", round(x,2),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Position of the point is 0.14 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 82
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.9 Page no 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=9*10**9\n",
+ "qa=4*10**-6\n",
+ "r=2.0*10**-2\n",
+ "r1=10**-2\n",
+ "qb=2*10**-6\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Ea=(m*qa)/r**2\n",
+ "Eb=(m*qb)/r1**2\n",
+ "a=r1/r\n",
+ "E=math.sqrt(Ea**2+Eb**2+(2*Ea*Eb*a))\n",
+ "a11=Ea*(math.sin(60)*180/3.14)/(Ea+Eb*(math.cos(60)*180/3.14))\n",
+ "\n",
+ "#Result\n",
+ "print\"Position is\", round(a11,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Position is 0.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10 Page no 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q=500*10**-6\n",
+ "r=0.1 #m\n",
+ "d=0.2\n",
+ "m=9*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "p=q*r\n",
+ "a=r/2.0\n",
+ "R=d+a\n",
+ "E=(m*2*p*R)/((R**2-a**2)**2)\n",
+ "\n",
+ "#Result\n",
+ "print\"Electric dipole moment of the dipole is\", p,\"Cm\"\n",
+ "print\"Electric field due to dipole is\",E*10**-7,\"*10**7 N/C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electric dipole moment of the dipole is 5e-05 Cm\n",
+ "Electric field due to dipole is 6.25 *10**7 N/C\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11 Page no 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q=0.2*10**-12 #C\n",
+ "w=10**-8 #m\n",
+ "r=0.1 #m\n",
+ "e=9*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "p=q*w\n",
+ "E=(e*2*p)/r**3\n",
+ "\n",
+ "#Result\n",
+ "print\"The electric field at an axical point at a distance of 10cm from there mid point is\", E*10**8,\"*10**-8 N/C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The electric field at an axical point at a distance of 10cm from there mid point is 3.6 *10**-8 N/C\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13 Page no 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=10.0**4\n",
+ "t=9*10**-26 #Nm\n",
+ "\n",
+ "#Calculation\n",
+ "import math \n",
+ "p=t/(E*math.sin(30*3.14/180.0))\n",
+ "\n",
+ "#Result\n",
+ "print\"Dipole moment of the dipole is\", round(p*10**29,1),\"*10**-19 Cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dipole moment of the dipole is 1.8 *10**-19 Cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.17 Page no 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "p=-10**-7 #Cm\n",
+ "i=10**5\n",
+ "\n",
+ "#Calculation\n",
+ "F=p*i\n",
+ "\n",
+ "#Result\n",
+ "print\"Force is given by\", F,\"N\"\n",
+ "print\"Torque is zero\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force is given by -0.01 N\n",
+ "Torque is zero\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap20.ipynb b/modern_physics_by_Satish_K._Gupta/chap20.ipynb
new file mode 100644
index 00000000..b99b0934
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap20.ipynb
@@ -0,0 +1,255 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:17722fc50855830105e8bbc1d5e7f4e9c2450186689d4bcffcae55541cf58a10"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 20 Electromagnetic Waves"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20.1 Page no 618"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=5.5*10**-7 #m\n",
+ "c=3*10**8 #m s**-1\n",
+ "u=1.5\n",
+ "\n",
+ "#Calculation\n",
+ "V=c/L\n",
+ "T=L/c\n",
+ "v=c/u\n",
+ "L1=v*T\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The frequency is\",round(V*10**-14,3),\"10**8\",\"MHz\",\"and time period is\",round(T*10**15,1),\"10**-19\",\"micro s\"\n",
+ "print\"(b) The wavelenght in glass is\",round(L1*10**7,1),\"10**-7\",\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The frequency is 5.455 10**8 MHz and time period is 1.8 10**-19 micro s\n",
+ "(b) The wavelenght in glass is 3.7 10**-7 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20.2 Page no 619"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=2*10**8 #m s**-1\n",
+ "Ur=1.0\n",
+ "C=3*10**8\n",
+ "\n",
+ "#Calculation\n",
+ "Er=(C**2)/(V**2*Ur)\n",
+ "\n",
+ "#Result \n",
+ "print\" The relative permittivity is\",Er"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The relative permittivity is 2.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20.3 Page no 619"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C=3*10**8\n",
+ "V=10**8\n",
+ "E0=0.5\n",
+ "\n",
+ "#Calculation\n",
+ "L=C/V\n",
+ "Bz=E0/C\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) There is the positive direction of x-axis of propagation of electromagnetic waves\"\n",
+ "print\"(b) The wavelengh of the wave is\",L,\"m\"\n",
+ "print\"(c) The component of associated magnetic field is\",round(Bz*10**9,0),\"cos(2*math.pi*10**8(t-x/c))\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) There is the positive direction of x-axis of propagation of electromagnetic waves\n",
+ "(b) The wavelengh of the wave is 3 m\n",
+ "(c) The component of associated magnetic field is 2.0 cos(2*math.pi*10**8(t-x/c))\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20.4 Page no 619"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=6*10**-3 #m\n",
+ "E0=33 #V m**-1\n",
+ "C=3.0*10**8\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "W=(2*math.pi*C)/(L)\n",
+ "B=E0/C\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnetic field is\",B,\"sin*math.pi*10**11(t-x/c)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnetic field is 1.1e-07 sin*math.pi*10**11(t-x/c)\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20.5 Page no 619"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I=8\n",
+ "E0=8.85*10**-12\n",
+ "C=3*10**8\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "e0=math.sqrt((2*I)/(E0*C))\n",
+ "\n",
+ "#Result\n",
+ "print\"The amplitude of the electric field is\",round(e0,1),\"N C**-1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The amplitude of the electric field is 77.6 N C**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 20.6 Page no 619"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=0.024 #m\n",
+ "k=5.9*10**-9\n",
+ "c=3*10**8\n",
+ "\n",
+ "#Calculation\n",
+ "V=L/k\n",
+ "t=L/c\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) The number of oscillation is\",round(V*10**-6,3),\"10**6\",\"Hz\"\n",
+ "print\"(ii) The coherence time is\",t,\"s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The number of oscillation is 4.068 10**6 Hz\n",
+ "(ii) The coherence time is 8e-11 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 65
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap21.ipynb b/modern_physics_by_Satish_K._Gupta/chap21.ipynb
new file mode 100644
index 00000000..54cafbe9
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap21.ipynb
@@ -0,0 +1,1809 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:07c4b928a455230c9db333bb0062ec9efe3c0f7899f2ff1857d420b5212b1285"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 21 Refraction Of Light"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.1 Page no 650"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "U=1.5\n",
+ "c=3.0*10**8 #m s**-1\n",
+ "\n",
+ "#Calculation\n",
+ "v=c/U\n",
+ "\n",
+ "#Result\n",
+ "print\" Speed of light in glass is\",v*10**-8,\"10**8\",\"m s**-1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Speed of light in glass is 2.0 10**8 m s**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.2 Page no 650"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u=1.33\n",
+ "Lu=589*10**-9 #m\n",
+ "c=3*10**8\n",
+ "\n",
+ "#Calculation\n",
+ "v=c/Lu\n",
+ "v1=c/u\n",
+ "Lw=v1/v\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Wavelenght of light after reflection is\",Lu*10**9,\"10**-9\"\n",
+ "print\" Velocity of light after reflection is\",c*10**-8,\"10**8\",\"m s**-1\"\n",
+ "print\" Frqequency of light after reflection is\",round(v*10**-14,4),\"10**14\",\"Hz\"\n",
+ "print\"(b) Frequency of light after refraction is\",round(v*10**-14,4),\"10**14\",\"Hz\"\n",
+ "print\" Velocity of light after refraction is\",round(v1*10**-8,3),\"10**8\",\"m s**-1\"\n",
+ "print\" Wavelength of light after refraction is\",round(Lw*10**9,2),\"nm\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Wavelenght of light after reflection is 589.0 10**-9\n",
+ " Velocity of light after reflection is 3.0 10**8 m s**-1\n",
+ " Frqequency of light after reflection is 5.0934 10**14 Hz\n",
+ "(b) Frequency of light after refraction is 5.0934 10**14 Hz\n",
+ " Velocity of light after refraction is 2.256 10**8 m s**-1\n",
+ " Wavelength of light after refraction is 442.86 nm\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.3 Page no 651"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "i=60\n",
+ "u=1.5\n",
+ "t=0.1 #m\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "r=(math.sin(60*3.14/180.0))/u\n",
+ "a=math.asin(r)*180/3.14\n",
+ "d=t/math.cos(r*3.14/180.0)*(math.sin(24*3.14/180.0))\n",
+ "\n",
+ "#Result\n",
+ "print\"The lateral shift produced is\",round(d,4),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The lateral shift produced is 0.0407 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.4 Page no 651"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=4/3.0\n",
+ "A1=3/2.0\n",
+ "I=30\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "S=A1/A\n",
+ "R=math.sin(30*3.16/180.0)/S\n",
+ "A=math.asin(R)*180/3.14\n",
+ "\n",
+ "#Result\n",
+ "print\"The angle of refraction is\",round(A,0)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The angle of refraction is 27.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.5 Page no 651"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "t=15\n",
+ "u=1.5\n",
+ "\n",
+ "#Calculation\n",
+ "d=t*(1-(1/u))\n",
+ "\n",
+ "#Result\n",
+ "print\" Real thickness of glass slab is\",d,\"cm\"\n",
+ "print\" The answer does not depend upon the location of the slab\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Real thickness of glass slab is 5.0 cm\n",
+ " The answer does not depend upon the location of the slab\n"
+ ]
+ }
+ ],
+ "prompt_number": 67
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.6 Page no 651"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "c=3*10**8 #m s**-1\n",
+ "v=2.0*10**8 #m s**-1\n",
+ "t=6.0 #cm\n",
+ "\n",
+ "#Calculation\n",
+ "u=c/v\n",
+ "d=t*(1-(1/u))\n",
+ "\n",
+ "#Result\n",
+ "print\"An ink dot appear to be rasied\",d,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "An ink dot appear to be rasied 2.0 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 73
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.7 Page no 651"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "d=12.5 #cm\n",
+ "a=9.4 #cm\n",
+ "u=1.63\n",
+ "\n",
+ "#Calculation\n",
+ "S=d/a\n",
+ "S1=d/u\n",
+ "S3=a-S1\n",
+ "\n",
+ "#Result\n",
+ "print\"The refractive index of water is\",round(S,2)\n",
+ "print\"The refractive index of liquid is\",round(S1,2),\"cm\"\n",
+ "print\"Distance is\",round(S3,2),\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The refractive index of water is 1.33\n",
+ "The refractive index of liquid is 7.67 cm\n",
+ "Distance is 1.73 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 84
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.8 Page no 651"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=4/3.0\n",
+ "d=0.015 #m\n",
+ "\n",
+ "#Calculatiom\n",
+ "t=d/(1-(1/A))\n",
+ "\n",
+ "#Result\n",
+ "print\"The height upto which water must be poured into the beaker is\",t,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The height upto which water must be poured into the beaker is 0.06 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 91
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.9 Page no 652"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=3/2.0\n",
+ "A1=4/3.0\n",
+ "t1=6\n",
+ "t2=4\n",
+ "\n",
+ "#Calculation\n",
+ "d1=t1*(1-(1/A))\n",
+ "d2=t2*(1-(1/A1))\n",
+ "d3=d1+d2\n",
+ "\n",
+ "#Result\n",
+ "print\"The apparent position of an object is\",d3,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The apparent position of an object is 3.0 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 102
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.10 Page no 652"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "S=1.5\n",
+ "W=1.33\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=S/W\n",
+ "C=1/A\n",
+ "Q=math.asin(C)*180/3.14\n",
+ "\n",
+ "#Result\n",
+ "print\"The critical angle for a glass water interface is\",round(Q,0),\"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The critical angle for a glass water interface is 62.0 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 124
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.11 Page no 652"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I=40 #degree\n",
+ "A=15 #degree\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "r=I-A\n",
+ "u=(math.sin(40*3.14/180.0))/(math.sin(25*3.14/180.0))\n",
+ "c=1/u\n",
+ "A=math.asin(c)*180/3.14\n",
+ "\n",
+ "#Result\n",
+ "print\"The critical angle is\",round(A,1),\"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The critical angle is 41.1 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 123
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.12 Page no 652"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u=1.5\n",
+ "h=20\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "C=1/u\n",
+ "A=math.asin(C)*180/3.14\n",
+ "r=h*math.tan(A*3.14/180.0)\n",
+ "D=math.pi*r**2\n",
+ "\n",
+ "#Result \n",
+ "print\"The required surface area is\",round(D,1),\"cm**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required surface area is 1005.3 cm**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 138
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.13 Page no 653"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=60 #degree\n",
+ "B=1.45\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "I=1/(math.sin(A*3.14/180.0))\n",
+ "Z=B/I\n",
+ "\n",
+ "#Result\n",
+ "print\"The refractive index of the liquid is\",round(Z,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The refractive index of the liquid is 1.255\n"
+ ]
+ }
+ ],
+ "prompt_number": 143
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.14 Page no 653"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=1.68\n",
+ "A1=1.44\n",
+ "A2=90 #degree\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "K=A/A1\n",
+ "C=1/K\n",
+ "Q=math.asin(C)*180/3.14\n",
+ "r=A2-Q\n",
+ "I=A*math.sin(r*3.14/180.0)\n",
+ "Q1=math.asin(I)*180/3.14\n",
+ "\n",
+ "#Result\n",
+ "print\"Refraction index of glass fibre is\",round(Q1,0),\"degree\"\n",
+ "print\"All rays having angle of incidence between 0 degree to 60 degree will suffer total internal reflection\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Refraction index of glass fibre is 60.0 degree\n",
+ "All rays having angle of incidence between 0 degree to 60 degree will suffer total internal reflection\n"
+ ]
+ }
+ ],
+ "prompt_number": 161
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.15 Page no 653"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u1=1\n",
+ "u2=1.5\n",
+ "u=-10.0 #cm\n",
+ "v=-40.0 #cm\n",
+ "\n",
+ "#Calculation\n",
+ "R=(u2-u1)/((-u1/u)+(u2/v))\n",
+ "\n",
+ "#Result\n",
+ "print\"Radius of curvature is\", R,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radius of curvature is 8.0 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 178
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.16 Page no 653"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u=-60.0 #cm\n",
+ "R=25.0 #cm\n",
+ "u1=1\n",
+ "u2=1.5\n",
+ "R1=0.25\n",
+ "\n",
+ "#Calculation\n",
+ "v=u2/(((u2-u1)/R)+(u1/u))\n",
+ "P=(u2-u1)/R1\n",
+ "\n",
+ "#Result\n",
+ "print\"Position of the image is\", v,\"cm\"\n",
+ "print\"Power of refracting surface is\",P,\"dioptre\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Position of the image is 450.0 cm\n",
+ "Power of refracting surface is 2.0 dioptre\n"
+ ]
+ }
+ ],
+ "prompt_number": 191
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.17 Page no 654 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "U1=1.5\n",
+ "U2=1\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "x=(U1+U2)/(U1-U2)\n",
+ "\n",
+ "#Result\n",
+ "print\"Distance of the object is\",x,\"R\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Distance of the object is 5.0 R\n"
+ ]
+ }
+ ],
+ "prompt_number": 194
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.18 Page no 654"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u1=1\n",
+ "u2=1.5\n",
+ "u=-10.0 #cm\n",
+ "R=-5.0 \n",
+ "\n",
+ "#Calculation\n",
+ "v=u1/((u1-u2)/R+(u2/u))\n",
+ "\n",
+ "#Result\n",
+ "print\"Position of the image is\",v,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Position of the image is -20.0 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 196
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.19 Page no 654"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u=1.5\n",
+ "R=-5.0 #cm\n",
+ "OC=2\n",
+ "\n",
+ "#Calculation\n",
+ "u1=R+OC\n",
+ "v=1/((1-u)/R+(u/u1))\n",
+ "\n",
+ "#Result\n",
+ "print\"Apparent position of the bubble is\", v,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Apparent position of the bubble is -2.5 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 202
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.20 Page no 654"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=-0.02 #m\n",
+ "u=1.54\n",
+ "v=-0.01 #m\n",
+ "\n",
+ "#calculation\n",
+ "u1=-u/((1-u)/R-(1/v))\n",
+ "\n",
+ "#Result\n",
+ "print\"Real depth of bubble is\", round(u1,4),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Real depth of bubble is -0.0121 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 206
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.21 Page no 655"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=7.5 #cm\n",
+ "u=4/3.0\n",
+ "\n",
+ "#Calculation\n",
+ "v=1/((1-u)/R)\n",
+ "\n",
+ "#Result\n",
+ "print\"It get focussed at\",v,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "It get focussed at -22.5 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 213
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.22 Page no 655"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "u=1.55\n",
+ "f=20 #cm\n",
+ "\n",
+ "#Calculation\n",
+ "R=(u-1)*2*f\n",
+ "\n",
+ "#Result\n",
+ "print\"Radius of curvature is,\",R,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radius of curvature is, 22.0 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 215
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.23 Page no 655"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u=1.5\n",
+ "f=0.3\n",
+ "\n",
+ "#Calculation\n",
+ "R=(u-1)*f\n",
+ "\n",
+ "#Result\n",
+ "print\"Radius of curvature is\", R,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radius of curvature is 0.15 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 218
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.24 Page no 655"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=2.0\n",
+ "\n",
+ "#Calculation\n",
+ "u=(a+1)/a\n",
+ "\n",
+ "#Result\n",
+ "print\"Refractive index is\",u"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Refractive index is 1.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 219
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.25 Page no 655"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "ug=1.5\n",
+ "uc=1.63\n",
+ "R1=20.0 #cm\n",
+ "R2=-20.0\n",
+ "\n",
+ "#Calculation\n",
+ "fair=1/((ug-1)*(1/R1-1/R2))\n",
+ "ug1=ug/uc\n",
+ "fc=1/((ug1-1)*(1/R1-1/R2))\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal length of the lens is\",round(fc,1),\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal length of the lens is -125.4 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 225
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.26 Page no 656"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "fair=0.2 #m\n",
+ "ug=1.50\n",
+ "uw=1.33\n",
+ "\n",
+ "#Calculation\n",
+ "R=1/(fair*(ug-1))\n",
+ "ug1=ug/uw\n",
+ "fw=1/((ug1-1)*R)\n",
+ "f=fw-fair\n",
+ "\n",
+ "#Result\n",
+ "print\"Change in focal length is\", round(f,2),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in focal length is 0.58 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 234
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.27 Page no 656"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u1=1.2\n",
+ "u2=1.3\n",
+ "a=13.0\n",
+ "\n",
+ "#Calculation\n",
+ "u=u1/u2\n",
+ "f=1/((-1/a)*(1/(u1-1)))\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal length is\", f,\"f\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal length is -2.6 f\n"
+ ]
+ }
+ ],
+ "prompt_number": 237
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.28 Page no 656"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f=20.0 #cm\\\n",
+ "u=12.0\n",
+ "f1=-20.0\n",
+ "\n",
+ "#Calculation\n",
+ "v=1/(1/f+1/u)\n",
+ "v1=1/(1/f1+1/u)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Beam will converge at a point of distant\",v,\"cm\"\n",
+ "print\"(b) Beam will converge at a point of distant\",v1,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Beam will converge at a point of distant 7.5 cm\n",
+ "(b) Beam will converge at a point of distant 30.0 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 244
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.29 Page no 656"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f=-0.2 #m\n",
+ "v=0.3 #m\n",
+ "\n",
+ "#Calculation\n",
+ "u=1/(1/v-1/f)\n",
+ "\n",
+ "#Result\n",
+ "print\"The position of the point is\",u,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The position of the point is 0.12 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 249
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.30 Page no 656"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f=10.0 #cm\n",
+ "c=20 #cm\n",
+ "o=5.0\n",
+ "\n",
+ "#Calculation\n",
+ "u=-(c-o)\n",
+ "u1=-(c+o)\n",
+ "v1=1/((1/f)+(1/u))\n",
+ "v2=1/((1/f)+(1/u1))\n",
+ "v=v1-v2\n",
+ "\n",
+ "#Result\n",
+ "print\"Length of image of needle is\", round(v,2),\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length of image of needle is 13.33 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 273
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.31 Page no 657"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u=-30.0\n",
+ "v=20.0\n",
+ "R1=10.0\n",
+ "R2=-15.0\n",
+ "ug1=1.33\n",
+ "\n",
+ "#Calculation\n",
+ "f=1/(-1/u+1/v)\n",
+ "ug=(1/f+1/6.0)*6.0\n",
+ "fw=1/(((ug/ug1)-1)*(1/R1-1/R2))\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal length of the lens is\", f,\"cm\"\n",
+ "print\"Focal length of the lens is\",round(fw,2),\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal length of the lens is 12.0 cm\n",
+ "Focal length of the lens is 46.94 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 289
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.32 Page no 657"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f=0.12\n",
+ "m=-3.0\n",
+ "\n",
+ "#Calculation\n",
+ "u=(f/m)-f\n",
+ "\n",
+ "#Result\n",
+ "print\"Distance between object and lens is\", u,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Distance between object and lens is -0.16 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 292
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.33 Page no 657"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=-19.0\n",
+ "v=10\n",
+ "\n",
+ "#Calculation\n",
+ "f=v/(-m+1)\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal length of the lens is\",f,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal length of the lens is 0.5 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 296
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.34 Page no 657"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=4\n",
+ "f=20\n",
+ "\n",
+ "#Calculation\n",
+ "u=m+1-f\n",
+ "v=f-(m*f)\n",
+ "\n",
+ "#Result\n",
+ "print\"Object is at\", u,\"cm\"\n",
+ "print\"Image is at\",v,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Object is at -15 cm\n",
+ "Image is at -60 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 301
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.35 Page no 657"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "O=5 #cm\n",
+ "u=-45.0 #cm\n",
+ "v=90.0\n",
+ "\n",
+ "#Calculation\n",
+ "f=-1/(1/u-1/v)\n",
+ "I=v*O/u\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal length is\", f,\"cm\"\n",
+ "print\"size of the image is\",I,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal length is 30.0 cm\n",
+ "size of the image is -10.0 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 309
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.36 Page no 658"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "O=3 #cm\n",
+ "u=-14.0\n",
+ "f=-21.0\n",
+ "\n",
+ "#Calculation\n",
+ "v=1/(1/f+1/u)\n",
+ "I=O*v/u\n",
+ "\n",
+ "#Result\n",
+ "print\"Image produced by the lens is\",I,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Image produced by the lens is 1.8 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.37 Page no 658"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=0.20\n",
+ "R2=-0.2\n",
+ "u=1.5\n",
+ "u1=1.25\n",
+ "\n",
+ "#Calculation\n",
+ "P1=(u-1)*(1/R1-1/R2)\n",
+ "u2=u/u1\n",
+ "P2=(u2-1)*(-1/R2-1/R2)\n",
+ "P=P1/P2\n",
+ "\n",
+ "#Result\n",
+ "print\"Ratio of power of lens is\", P"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ratio of power of lens is 2.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.38 Page no 658"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f1=15.0 #cm\n",
+ "f2=30.0\n",
+ "\n",
+ "#Calculation\n",
+ "f=1/(1/f1+1/f2)\n",
+ "P=1/f\n",
+ "\n",
+ "#Result\n",
+ "print\"Power is\",f*10**-2,\"m\"\n",
+ "print\"Focal length is\",P*10**2,\"D\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power is 0.1 m\n",
+ "Focal length is 10.0 D\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.39 Page no 658"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P1=-1.5 #D\n",
+ "P2=2.75\n",
+ "\n",
+ "#Calculation\n",
+ "P=P1+P2\n",
+ "f=1/P\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal length is\",f,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal length is 0.8 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.40 Page no 659"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=0.11\n",
+ "a1=0.07\n",
+ "\n",
+ "#Calculation\n",
+ "x=a-a1\n",
+ "u=(a1-0.01)/x\n",
+ "\n",
+ "#Result\n",
+ "print\"Refractive index is\",u"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Refractive index is 1.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.41 Page no 659"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=70 #Degree\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "a=1/(math.sin(a*3.14/180.0))\n",
+ "a1=math.atan(a)*180/3.14\n",
+ "u=1/math.sin(a1*3.14/180.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"Critical angle is\", round(u,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Critical angle is 1.372\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.42 Page no 659"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=180 #degree\n",
+ "b=90\n",
+ "c=45\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "r=a-(b+c)\n",
+ "A=1.352*math.sin(r*3.14/180.0)\n",
+ "A1=math.asin(A)*180/3.14\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Angle of incidence is sin-1[(math.sqrt(u**2-u1**2)-u1)/math.sqrt(2)]\"\n",
+ "print\"(b) Angle of incidence at face AB is\",round(A1,0),\"Degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Angle of incidence is sin-1[(math.sqrt(u**2-u1**2)-u1)/math.sqrt(2)]\n",
+ "(b) Angle of incidence at face AB is 73.0 Degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.43 Page no 660"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u=40.0 #cm\n",
+ "R=10.0\n",
+ "u1=1\n",
+ "u2=1.5\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "v=u2/(((u2-u1)/R)+(u1/u))\n",
+ "\n",
+ "#Result\n",
+ "print\"Position of the image is\", v,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Position of the image is 20.0 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.44 Page no 660"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "x=0.04\n",
+ "y=8/300.0\n",
+ "u=-0.04\n",
+ "v=-16/500.0\n",
+ "\n",
+ "#Calculation\n",
+ "U=x/y\n",
+ "R=(1-U)/(-U/u+1/v)\n",
+ "f=1/((U-1)/R)\n",
+ "\n",
+ "print\"(i) Refractive index is\",U\n",
+ "print\"(ii) Radius of curvature is\",R,\"m\"\n",
+ "print\"(iii) Focal length is\",f,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Refractive index is 1.5\n",
+ "(ii) Radius of curvature is -0.08 m\n",
+ "(iii) Focal length is -0.16 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 53
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.46 Page no 661"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "OI=90.0 #cm\n",
+ "O1O2=20\n",
+ "x=35 #cm\n",
+ "\n",
+ "#Calculation\n",
+ "f=(OI-x)*x/((OI-x)+x)\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal length of the lens is\", round(f,1),\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal length of the lens is 21.4 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.47 Page no 662"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=-4\n",
+ "a=1.5\n",
+ "u=0.3\n",
+ "\n",
+ "#Calculation\n",
+ "x=a/(-m+1)\n",
+ "v=a-u\n",
+ "f=1/(1/u+1/v)\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal length of the lens is\", f,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal length of the lens is 0.24 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 21.48 Page no 662"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P1=8.0 #dioptre\n",
+ "P2=2.0\n",
+ "\n",
+ "#Calculation\n",
+ "f1=1/P1\n",
+ "f2=1/P2\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal length of lens 1 is\",f1,\"m\"\n",
+ "print\"Focal length of lens 2 is\",f2,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal length of lens 1 is 0.125 m\n",
+ "Focal length of lens 2 is 0.5 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 66
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap22.ipynb b/modern_physics_by_Satish_K._Gupta/chap22.ipynb
new file mode 100644
index 00000000..60d6e4e2
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap22.ipynb
@@ -0,0 +1,531 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:168ff39597791c08930937d1b2aac6af790d1f198c96130c4b12669d6560fe5b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 22 Dispersion"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.1 Page no 686"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=60 #Degree\n",
+ "i=49\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "r=A/2.0\n",
+ "u=math.sin(i*3.14/180.0)/math.sin(r*3.14/180.0)\n",
+ "\n",
+ "#Result\n",
+ "print \"Refractive index is\",round(u,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Refractive index is 1.51\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.2 Page no 686"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u=1.5\n",
+ "A=60 #Degree\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "a1=A/2.0\n",
+ "a=u*math.sin(a1*3.14/180.0)\n",
+ "a2=math.asin(a)*180/3.14\n",
+ "X=(a2*2)-A\n",
+ "i=(A+X)/2.0\n",
+ "\n",
+ "#Result\n",
+ "print\"Angle of deviation is\", round(X,1),\"degree\"\n",
+ "print\"Angle of incidence is\",round(i,1),\"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angle of deviation is 37.2 degree\n",
+ "Angle of incidence is 48.6 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.3 Page no 686"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=60 #Degree\n",
+ "ug=1.53\n",
+ "uw=1.33\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "ug1=ug/uw\n",
+ "a2=A/2.0\n",
+ "a1=ug1*math.sin(a2*3.14/180.0)\n",
+ "a2=math.asin(a1)*180/3.14\n",
+ "d=(a2*2)-A\n",
+ "\n",
+ "#Result\n",
+ "print\"Angle of minimum deviation is\", round(d,1),\"Degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angle of minimum deviation is 10.2 Degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.4 Page no 686"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "ug=1.6\n",
+ "uw=1.33\n",
+ "i=40 #Degree\n",
+ "A=60\n",
+ "\n",
+ "#Calculation\n",
+ "ug1=ug/uw\n",
+ "r1=math.asin(math.sin(i*3.14/180.0)/ug1)*180/3.14\n",
+ "r2=A-r1\n",
+ "e=math.asin(ug1*math.sin(r2*3.14/180.0))*180/3.14\n",
+ "d=i+e-A\n",
+ "\n",
+ "#Result\n",
+ "print\"Angle of deviation is\", round(d,0),\"Degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angle of deviation is 14.0 Degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.5 Page no 686"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=60 #degree\n",
+ "ur=1.622\n",
+ "uv=1.663\n",
+ "\n",
+ "#Calculation\n",
+ "a=A*(uv-ur)\n",
+ "\n",
+ "#Result\n",
+ "print\"Angle of dispersion between red and violet color is\",a,\"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angle of dispersion between red and violet color is 2.46 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.6 Page no 686"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=60 #Degree\n",
+ "ab=53\n",
+ "ar=51\n",
+ "a=52.0\n",
+ "\n",
+ "#Calculation\n",
+ "w=(ab-ar)/a\n",
+ "\n",
+ "#Result\n",
+ "print\"Dispersive power is\",round(w,4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dispersive power is 0.0385\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.7 Page no 686"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "ub=1.522\n",
+ "ur=1.514\n",
+ "ub1=1.662\n",
+ "ur1=1.644\n",
+ "\n",
+ "#Calculation\n",
+ "u=(ub+ur)/2.0\n",
+ "w=(ub-ur)/(u-1)\n",
+ "u1=(ub1+ur1)/2.0\n",
+ "w1=(ub1-ur1)/(u1-1)\n",
+ "\n",
+ "#Result\n",
+ "print\"Dispersive power of crown glass is\",round(w,4)\n",
+ "print\"Dispersive power of flint galss is\",round(w1,4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dispersive power of crown glass is 0.0154\n",
+ "Dispersive power of flint galss is 0.0276\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.8 Page no 687"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "w=0.031\n",
+ "ur=1.645\n",
+ "ub=1.665\n",
+ "\n",
+ "#Calculation\n",
+ "u=1+((ub-ur)/w)\n",
+ "\n",
+ "#Result\n",
+ "print\"Refractive index is\",round(u,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Refractive index is 1.645\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.9 Page no 687"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "uv=1.523\n",
+ "ur=1.515\n",
+ "A=5 #Degree\n",
+ "uv1=1.688\n",
+ "ur1=1.650\n",
+ "\n",
+ "#Calculation\n",
+ "u=(uv+ur)/2.0\n",
+ "u1=(uv1+ur1)/2.0\n",
+ "A1=-(5*(u-1))/(u1-1)\n",
+ "\n",
+ "#Result\n",
+ "print\"Angle of flint glass prism is\",round(A1,2),\"Degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angle of flint glass prism is -3.88 Degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.10 Page no 687"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "w=0.021\n",
+ "u=1.53\n",
+ "w1=0.045\n",
+ "u1=1.65\n",
+ "A1=4.2 #degree\n",
+ "\n",
+ "#Calculation\n",
+ "A=-w1*A1*(u1-1)/(w*(u-1))\n",
+ "d=-(A*(u-1)+A1*(u1-1))\n",
+ "\n",
+ "#Result\n",
+ "print\"Angle of prism is\", d,\"Degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angle of prism is 3.12 Degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.11 Page no 687"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=40 #degree\n",
+ "u=1.54\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "i=math.asin(u*math.sin(A*3.14/180.0))*180/3.14\n",
+ "\n",
+ "#Result\n",
+ "print\"Angle of incidence is\",round(i,2),\"Degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angle of incidence is 81.72 Degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.12 Page no 687"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u=1.524\n",
+ "A=60 #degree\n",
+ "C=41 #degree\n",
+ "\n",
+ "#calculation\n",
+ "import math\n",
+ "C1=1/u\n",
+ "A1=math.asin(C1)*180/3.14\n",
+ "r1=A-C\n",
+ "i=u*math.sin(r1*3.14/180.0)\n",
+ "A2=math.asin(i)*180/3.14\n",
+ "\n",
+ "#Result\n",
+ "print\"Angle of incidence is\", round(A2,2),\"Degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angle of incidence is 29.75 Degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 84
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.13 Page no 688"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u=0.015\n",
+ "w=0.03\n",
+ "u1=0.022\n",
+ "w1=0.05\n",
+ "a=2 #degree\n",
+ "\n",
+ "#Calculation\n",
+ "A=-u1/u\n",
+ "A1=a/(A/2.0+u1/w1)\n",
+ "a2=A*A1\n",
+ "print\"Angle of 1st prism is\", round(A1,2),\"Degree\"\n",
+ "print\"Angle of 2nd prism is\",a2,\"Degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angle of 1st prism is -6.82 Degree\n",
+ "Angle of 2nd prism is 10.0 Degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 98
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap23.ipynb b/modern_physics_by_Satish_K._Gupta/chap23.ipynb
new file mode 100644
index 00000000..3565eff3
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap23.ipynb
@@ -0,0 +1,641 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fd3a71d11d7e73e323877019a1c5f0e92d8e8b30b7f927fde2bcadd4742b58c1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 23 Optical instruments"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.1 Page no 704"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f=5.0 #cm\n",
+ "D=25\n",
+ "\n",
+ "#Calculation\n",
+ "M=1+(D/f)\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnifying power is\",M"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnifying power is 6.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.2 Page no 704"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f=6.25 #cm\n",
+ "v=-25\n",
+ "\n",
+ "#Calculation\n",
+ "u=v*f/(v-f)\n",
+ "M=1+(D/f)\n",
+ "M1=D/f\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) The distance of the object from the lens is\", M\n",
+ "print\"(ii) Anguar magnification is\",M1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The distance of the object from the lens is 5.0\n",
+ "(ii) Anguar magnification is 4.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.3 Page no 704"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u=-9\n",
+ "f=10 #cm\n",
+ "v1=-25.0\n",
+ "\n",
+ "#Calculation\n",
+ "v=u*f/(u+f)\n",
+ "M=v/u\n",
+ "u=-v1*f/(v1-f)\n",
+ "M1=1-(v1/f)\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Magnification is\", M,\"\\n Size of each square in the image will appear as 100 mm**2\"\n",
+ "print\"(ii) Magnification is\",M1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Magnification is 10 \n",
+ " Size of each square in the image will appear as 100 mm**2\n",
+ "(ii) Magnification is 3.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.4 Page no 704"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "v=-25\n",
+ "f=10.0\n",
+ "\n",
+ "#Calculation\n",
+ "u=-v*f/(f-v)\n",
+ "m=-v/u\n",
+ "M=1-(v/f)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Distance is\", round(u,2),\"cm\"\n",
+ "print\"(b) Magnification is\",m\n",
+ "print\"(c) Magnification is\",M"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Distance is 7.14 cm\n",
+ "(b) Magnification is 3.5\n",
+ "(c) Magnification is 3.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.5 Page no 705"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "M=-30\n",
+ "fe=5 #cm\n",
+ "D=25 #cm\n",
+ "\n",
+ "#Calculation\n",
+ "m0=M/(1+(D/fe))\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnification produced is\",m0"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnification produced is -5\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.6 Page no 705"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f0=4\n",
+ "u0=-6\n",
+ "D=25\n",
+ "fe=6.0\n",
+ "\n",
+ "#Calculation\n",
+ "v0=f0*u0/(f0+u0)\n",
+ "M=v0/u0*(1+(D/fe))\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnification produceed by the microscope is\", round(M,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnification produceed by the microscope is -10.33\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.7 Page no 705"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=20\n",
+ "fe=5\n",
+ "f0=1.0 \n",
+ "\n",
+ "#Calculation\n",
+ "v01=L-fe\n",
+ "u0=v01*f0/(f0-v01)\n",
+ "M=v01*D/(u0*fe)\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnification power is\", M,\"\\nThe -ve sigh shows that the image formed is inverted and real\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnification power is -70.0 \n",
+ "The -ve sigh shows that the image formed is inverted and real\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.8 Page no 705"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f=36 #cm\n",
+ "M=-8\n",
+ "\n",
+ "#Calculation\n",
+ "fe=-f/(M-1)\n",
+ "f0=-M*fe\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal length of the lenses is\", fe,\"cm and\",f0,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal length of the lenses is 4 cm and 32 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.9 Page no 705"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f=75 #cm\n",
+ "fe=5.0\n",
+ "D=25 \n",
+ "\n",
+ "#Calculation\n",
+ "M=-f/fe*(1+(fe/D))\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnying power is\",M"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnying power is -18.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.10 Page no 705"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f0=140\n",
+ "fe=5\n",
+ "D=25.0\n",
+ "\n",
+ "#Calculation\n",
+ "M=-f0/fe\n",
+ "M1=-(f0/fe)*(1+(fe/D))\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Magnefying power, when telescope is in normal adjustment is\", M\n",
+ "print\"(b) Magnifying power, when image is formed at least distance of distinct vision is is\",M1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Magnefying power, when telescope is in normal adjustment is -28\n",
+ "(b) Magnifying power, when image is formed at least distance of distinct vision is is -33.6\n"
+ ]
+ }
+ ],
+ "prompt_number": 54
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.11 Page no 706"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f0=1 #m\n",
+ "fe=0.05\n",
+ "I=0.92*10**-2\n",
+ "u0=38*10**-7\n",
+ "fe1=5.0 #cm\n",
+ "ve=-25\n",
+ "\n",
+ "#Calculation\n",
+ "d=I*u0/f0\n",
+ "L=f0+fe\n",
+ "ue=ve*fe1/(fe1-ve)\n",
+ "L1=(f0*10**2)-ue\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Distance between two lenses is\", L*10**2,\"cm\"\n",
+ "print\"(ii) Distance when final image at 25 cm from the eye is\",round(L1,2),\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Distance between two lenses is 105.0 cm\n",
+ "(ii) Distance when final image at 25 cm from the eye is 104.17 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.12 Page no 706"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "M=-20\n",
+ "R=120\n",
+ "\n",
+ "#Calculation\n",
+ "f0=R/2.0\n",
+ "fe=-f0/M\n",
+ "\n",
+ "#Result\n",
+ "print\"Focal length of the eye piece is\",fe,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Focal length of the eye piece is 3.0 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 74
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.13 Page no 706"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "d=0.8 #cm\n",
+ "D=508\n",
+ "\n",
+ "#Calculation\n",
+ "B=D**2/d**2\n",
+ "\n",
+ "#Result\n",
+ "print\"The telescope can see a star \",B,\"time sfarther than the faintest star that can be seen with naked eye.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The telescope can see a star 403225.0 time sfarther than the faintest star that can be seen with naked eye.\n"
+ ]
+ }
+ ],
+ "prompt_number": 76
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.14 Page no 706"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "ve=-25 #cm\n",
+ "fe=6.25\n",
+ "a=15\n",
+ "f0=2\n",
+ "\n",
+ "#Calculation\n",
+ "ue=-ve*fe/(ve-fe)\n",
+ "v0=a+ue\n",
+ "u0=f0*v0/(f0-v0)\n",
+ "v01=a-fe\n",
+ "u01=v01*f0/(f0-v01)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Distance when final image at least distance of distinct vision is\", u0,\"cm\"\n",
+ "print\"(b) Distance when final image is at infinity is\",round(u01,2),\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Distance when final image at least distance of distinct vision is -2.5 cm\n",
+ "(b) Distance when final image is at infinity is -2.59 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 87
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.15 Page no 707"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=10\n",
+ "D=24\n",
+ "fe=20.0\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=a/(1+(D/fe))/100.0\n",
+ "\n",
+ "#Result\n",
+ "print\"Angle is\", round(A,4),\"radian\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angle is 0.0455 radian\n"
+ ]
+ }
+ ],
+ "prompt_number": 95
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 23.16 Page no 707"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "f0=-0.5 #m\n",
+ "fe=0.01\n",
+ "d=3.48*10**6\n",
+ "r=3.8*10**8\n",
+ "a1=15\n",
+ "\n",
+ "#Calculation\n",
+ "M=f0/fe\n",
+ "a=d/r\n",
+ "I=a*a1\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Angular Magnification of the telescope is\",M\n",
+ "print\"(b) Diameter of the image is\", round(I,3),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Angular Magnification of the telescope is -50.0\n",
+ "(b) Diameter of the image is 0.137 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 103
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap25.ipynb b/modern_physics_by_Satish_K._Gupta/chap25.ipynb
new file mode 100644
index 00000000..1f9c7095
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap25.ipynb
@@ -0,0 +1,521 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:caf7ddcffb734a0e87ae0e90d77de524bc76c7023aae29373fc9035427092542"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 25 Interference of light "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25.1 Page no 728"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "w1=4\n",
+ "w2=9.0\n",
+ "a=25\n",
+ "\n",
+ "#Calculation\n",
+ "I=w1/w2\n",
+ "Imax=a/1.0\n",
+ "\n",
+ "#Result\n",
+ "print\"Ratio of intensity is\",Imax"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ratio of intensity is 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25.2 Page no 728"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "l=4800*10**-10 #m\n",
+ "b=0.6*10**-2\n",
+ "b1=0.0045\n",
+ "\n",
+ "#Calculation\n",
+ "a=l/b\n",
+ "l1=a*b1*2\n",
+ "\n",
+ "#Result\n",
+ "print\"Wavelenght of the light is\", l1*10**10,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Wavelenght of the light is 7200.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25.3 Page no 728"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "d=1.5*10**-3\n",
+ "D=1 #m\n",
+ "w=3.93 #mm\n",
+ "D1=1.5\n",
+ "\n",
+ "#Calculation\n",
+ "b=w/10.0\n",
+ "l=(b*10**-3*d)/D\n",
+ "a=(10*D1*l)/d\n",
+ "\n",
+ "#Result\n",
+ "print\"Wavelength of the light is\", l,\"m\"\n",
+ "print\"Width of 10 fringes is\",a*10**3,\"*10**-3 m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Wavelength of the light is 5.895e-07 m\n",
+ "Width of 10 fringes is 5.895 *10**-3 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25.4 Page no 729"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "d=0.02 #cm\n",
+ "D=80\n",
+ "l=6*10**-5\n",
+ "n=5\n",
+ "\n",
+ "#Calculation\n",
+ "y5=n*D*l/d\n",
+ "\n",
+ "#Result\n",
+ "print\"Distance of fifth bright fringe is\",y5,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Distance of fifth bright fringe is 1.2 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25.5 Page no 729"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "d=3*10**-4\n",
+ "D=1.5\n",
+ "y4=10**-2 #m\n",
+ "\n",
+ "#Calculation\n",
+ "l=y4*d/(4*D)\n",
+ "\n",
+ "#Result\n",
+ "print\"Wavelength of light is\",l,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Wavelength of light is 5e-07 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25.6 Page no 729"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "d=0.125*10**-3 #m\n",
+ "l=4500*10**-10\n",
+ "D=1\n",
+ "\n",
+ "#Calculation\n",
+ "y2=2*D*l/d\n",
+ "y21=2*y2\n",
+ "\n",
+ "#Result\n",
+ "print\"Seperation between bright fringe on both sides of central maximum is\",y21*10**3,\"*10**-3 m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Seperation between bright fringe on both sides of central maximum is 14.4 *10**-3 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25.7 Page no 729"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "d=0.012 #m\n",
+ "D=100\n",
+ "l=6000*10**-8 #cm\n",
+ "n=2\n",
+ "\n",
+ "#Calculation\n",
+ "y2=(n**2+1)*D*l/(n*d)\n",
+ "\n",
+ "#result\n",
+ "print\"Distance of 3rd dark band is\",y2,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Distance of 3rd dark band is 1.25 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25.8 Page no 729"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "d=2*10**-4 #m\n",
+ "D=1.5\n",
+ "y3=1.8*10**-2\n",
+ "\n",
+ "#Calculation\n",
+ "l=2*y3*d/(7*D)\n",
+ "\n",
+ "#Result\n",
+ "print\"Wavelength of the light is\", round(l*10**7,2)*10**-7,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Wavelength of the light is 6.86e-07 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25.9 Page no 729"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "b=2*10**-3\n",
+ "l=6.0*10**-7\n",
+ "u=1.33\n",
+ "\n",
+ "#calculation\n",
+ "l1=b/l\n",
+ "b2=(b*l)/(u*l)\n",
+ "\n",
+ "#Result\n",
+ "print\"Fringe width is\",round(b2*10**3,2),\"mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fringe width is 1.5 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25.10 Page no 729"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "l=6000*10**-10 #m\n",
+ "d=10**-3\n",
+ "D=1\n",
+ "n=10\n",
+ "\n",
+ "#Calculation\n",
+ "a10=n*l/d\n",
+ "b=(D*l)/d\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Angular position of 10th maximum is\",a10,\"radian\"\n",
+ "print\"(b) Separation of the two adjacent minima is\",b*10**3,\"mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Angular position of 10th maximum is 0.006 radian\n",
+ "(b) Separation of the two adjacent minima is 0.6 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25.11 Page no 730"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "l=6000*10**-10 #m\n",
+ "r=0\n",
+ "n=7\n",
+ "\n",
+ "#Calculation\n",
+ "t=n*l/2.0\n",
+ "\n",
+ "#Result\n",
+ "print\"Difference of the film is\", t,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Difference of the film is 2.1e-06 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25.12 Page no 730"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u=1.4\n",
+ "t=10**-4 #cm\n",
+ "n1=4.0\n",
+ "n2=5.0\n",
+ "n3=6.0\n",
+ "n4=7.0\n",
+ "N1=9\n",
+ "N2=11\n",
+ "N3=13\n",
+ "\n",
+ "#Calculation\n",
+ "a=2*u*t*10**8\n",
+ "l1=a/n1\n",
+ "l2=a/n2\n",
+ "l3=a/n3\n",
+ "l4=a/n4\n",
+ "L1=2*a/N1\n",
+ "L2=2*a/N2\n",
+ "L3=2*a/N3\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Wavelength When the reflection is weak is\",l1,\"A ,\",l2,\"A ,\",round(l3,0),\"A ,\",l4,\"A\"\n",
+ "print\"(ii) Wavelength when the reflection is strong is\",round(L1,0),\"A ,\",round(L2,0),\"A ,\",round(L3,0),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Wavelength When the reflection is weak is 7000.0 A , 5600.0 A , 4667.0 A , 4000.0 A\n",
+ "(ii) Wavelength when the reflection is strong is 6222.0 A , 5091.0 A , 4308.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25.13 Page no 730"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n1=10\n",
+ "l1=4358*10**-10 #m\n",
+ "l2=5893.0*10**-10\n",
+ "\n",
+ "#Calculation\n",
+ "n2=n1*l1/l2\n",
+ "\n",
+ "#Result\n",
+ "print\"Number of fringes is\",round(n2,1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of fringes is 7.4\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap26.ipynb b/modern_physics_by_Satish_K._Gupta/chap26.ipynb
new file mode 100644
index 00000000..26f66f05
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap26.ipynb
@@ -0,0 +1,239 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:010c48e259f2faa6331c5ac2dae668d950f9fc1e120bf60a20ed01cae899383a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 26 Diffraction of light"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 26.1 Page no 747"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=0.5*10**-3 #m\n",
+ "l=6000*10**-10 \n",
+ "D=2\n",
+ "\n",
+ "#Calculation\n",
+ "d=2*D*l/a\n",
+ "\n",
+ "#Result\n",
+ "print\"Distance between the two dark bands is\",d*10**3,\"mm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Distance between the two dark bands is 4.8 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 26.2 Page no 747"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "l=5900*10**-10 #m\n",
+ "a=11.8*10**-7\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "a=l/a\n",
+ "A=math.asin(a)*180/3.14\n",
+ "A1=2*A\n",
+ "\n",
+ "#Result\n",
+ "print\"Angular position is\",round(A1,0),\"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angular position is 60.0 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 26.3 Page no 747 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "l=650*10**-9\n",
+ "a1=30 #degree\n",
+ "\n",
+ "#Calculation\n",
+ "a=l/math.sin(a1*3.14/180.0)\n",
+ "a2=3*l/math.sin(a1*3.14/180.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Value of a when the 1st min. falls at 30 degree is\",round(a*10**6,1)*10**-6,\"m\"\n",
+ "print\"(b) Value of a when the 1st max. falls at 30 degree is\",round(a2*10**6,2)*10**-6,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Value of a when the 1st min. falls at 30 degree is 1.3e-06 m\n",
+ "(b) Value of a when the 1st max. falls at 30 degree is 3.9e-06 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 26.4 Page no 747"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "l=600.0*10**-9 #m\n",
+ "a=2*10**-3 \n",
+ "\n",
+ "#Calculation\n",
+ "Z=a**2/l\n",
+ "\n",
+ "#Result\n",
+ "print\"Distance is\",round(Z,2),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Distance is 6.67 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 26.5 Page no 747"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "d=4.6*10**-6 #rad\n",
+ "l=5460*10**-10 #m\n",
+ "\n",
+ "#Calculation\n",
+ "D=1.22*l/d\n",
+ "\n",
+ "#Result\n",
+ "print\"Aperture of the objective of the telescope is\",round(D,4),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Aperture of the objective of the telescope is 0.1448 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 26.6 Page no 748"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "lr=660\n",
+ "\n",
+ "#Calculation\n",
+ "l1=2*lr/3.0\n",
+ "\n",
+ "#Result\n",
+ "print\"Value of lembda is\",l1,\"nm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of lembda is 440.0 nm\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap27.ipynb b/modern_physics_by_Satish_K._Gupta/chap27.ipynb
new file mode 100644
index 00000000..9edfe788
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap27.ipynb
@@ -0,0 +1,135 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c77b859962fb938dcd11a74749cd47ac07047d0f8605a1cc5e5320189808ac31"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 27 Polarisation of light "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 27.1 Page no 758"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u=1.536\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "p=math.atan(u)*180/3.14\n",
+ "r=90-p\n",
+ "\n",
+ "#Result\n",
+ "print\"Angle of refraction is\", round(r,1),\"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angle of refraction is 33.0 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 27.2 Page no 758"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "p=60 #degree\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "u=math.tan(p*3.14/180.0)\n",
+ "C=1/u\n",
+ "C1=math.asin(C)*180/3.14\n",
+ "\n",
+ "#Result\n",
+ "print\"Critical angle is\", round(C1,1),\"Degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Critical angle is 35.3 Degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 27.3 Page no 758"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=60 #degree\n",
+ "b=100\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "a1=90-a\n",
+ "A=a/2.0\n",
+ "I=(math.cos(A*3.14/180.0)**2)/2.0\n",
+ "I0=b*I\n",
+ "\n",
+ "#result\n",
+ "print\"Unpolarised light is\", round(I0,1),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Unpolarised light is 37.5 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap28.ipynb b/modern_physics_by_Satish_K._Gupta/chap28.ipynb
new file mode 100644
index 00000000..c53c8334
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap28.ipynb
@@ -0,0 +1,578 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:487f66e71ac79d9579f4a8e998f21bc6fadb0986ba14ee5d89b77699b48cadee"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 28 Particle nature of radiation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 28.1 Page no 801"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "l=4950.0*10**-10\n",
+ "h=6.6*10**-34 #js\n",
+ "c=3*10**8 #m/s\n",
+ "\n",
+ "#Calculation\n",
+ "E=(h*c/l)/(1.6*10**-19)\n",
+ "\n",
+ "#Result\n",
+ "print\"Energy of each photon is\",E,\"eV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy of each photon is 2.5 eV\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 28.2 Page no 801"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=6.62 #J\n",
+ "v=10**12 #Hz\n",
+ "h=6.62*10**-34\n",
+ "\n",
+ "#Calculation\n",
+ "E1=h*v\n",
+ "n=E/(h*v)\n",
+ "\n",
+ "#Result\n",
+ "print\"Number of photons is\",n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of photons is 1e+22\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 28.3 Page no 801"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "h=6.62*10**-34 #js\n",
+ "c=3*10**8 #m/s\n",
+ "Iev=1.6*10**-19 #J\n",
+ "V=10**6 #hz\n",
+ "V1=5890*10**-10 #m\n",
+ "L=10.0**-10 #m\n",
+ "\n",
+ "#Calculation\n",
+ "E=h*v\n",
+ "E1=E/Iev\n",
+ "A=(h*c)/V1\n",
+ "A1=A/Iev\n",
+ "B=(h*c)/L\n",
+ "B1=B/Iev\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) The energy of a photon with frequency 1000 Khz is\",round(E1*10**3,2),\"10**-9\",\"ev\" \n",
+ "print\"(ii) The energy of a photon when wavelength is 5890A is\",round(A1,2) ,\"eV\"\n",
+ "print\"(iii) The energy of a photon when wavelength is 1 A is\", B1,\"eV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The energy of a photon with frequency 1000 Khz is 4.14 10**-9 ev\n",
+ "(ii) The energy of a photon when wavelength is 5890A is 2.11 eV\n",
+ "(iii) The energy of a photon when wavelength is 1 A is 12412.5 eV\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 28.4 Page no 801"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "l=0.66*10**-10 #m\n",
+ "h=6.62*10**-34 #Js\n",
+ "c=3*10**8 #m/s\n",
+ "\n",
+ "#Calculation\n",
+ "E=((h*c)/l)/(1.6*10**-19)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Maximum energy of photon is\",round(E*10**-3,2),\"Kev\"\n",
+ "print\"(b) To produce electrons of energy 18.81 Kev,accelerating potential of 18.81 KV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Maximum energy of photon is 18.81 Kev\n",
+ "(b) To produce electrons of energy 18.81 Kev,accelerating potential of 18.81 KV\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 28.5 Page no 801"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=10.2*10**9 #ev\n",
+ "h=6.62*10**-34\n",
+ "c=3*10**8\n",
+ "\n",
+ "#Calculation\n",
+ "E1=(E/2.0)*(1.6*10**-19)\n",
+ "l=(h*c)/E1\n",
+ "\n",
+ "#Result\n",
+ "print\"Wavelength is\",round(l*10**16,3),\"10**-16\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Wavelength is 2.434 10**-16\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 28.6 Page no 802"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=3500.0*10**-10 #m\n",
+ "h=6.62*10**-34\n",
+ "c=3*10**8\n",
+ "\n",
+ "#Calculation\n",
+ "Hv=h*c/(L*(1.6*10**-19))\n",
+ "\n",
+ "#Result\n",
+ "print\"Energy of incident light is\", round(Hv,3),\"eV \\nMetal B will yield photoelectrons.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy of incident light is 3.546 eV \n",
+ "Metal B will yield photoelectrons.\n"
+ ]
+ }
+ ],
+ "prompt_number": 75
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 28.7 Page no 802"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "l=6000.0*10**-10 #m\n",
+ "h=6.62*10**-34 #Js\n",
+ "e=1.6*10**-19\n",
+ "c=3*10**8\n",
+ "\n",
+ "#Calculation\n",
+ "v0=c/l\n",
+ "w=(h*v0)/e\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Threshold frequency is\", v0,\"Hz\"\n",
+ "print\"(ii) Work function is\",round(w,3),\"eV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Threshold frequency is 5e+14 Hz\n",
+ "(ii) Work function is 2.069 eV\n"
+ ]
+ }
+ ],
+ "prompt_number": 83
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 28.8 Page no 802"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "w=1.2*1.6*10**-19\n",
+ "l=5000.0*10**-10\n",
+ "c=3*10**8\n",
+ "h=6.62*10**-34\n",
+ "e=1.6*10**-19\n",
+ "\n",
+ "#Calculation\n",
+ "A=((h*c)/l)-w\n",
+ "V0=A/e\n",
+ "\n",
+ "#Result\n",
+ "print\"Stopping potential is\", round(V0,2),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Stopping potential is 1.28 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 90
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 28.9 Page no 802"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "h=6.6*10**-34 #Js\n",
+ "e=1.6*10**-19\n",
+ "l=500.0*10**-9 #m\n",
+ "\n",
+ "#Calculation\n",
+ "w=2*e\n",
+ "l0=(h*c)/w\n",
+ "E=((h*c)/l)-w\n",
+ "v0=E/e\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) The threshold wavelength is\", l0*10**9,\"nm\"\n",
+ "print\"(ii) Maximum energy is\",E*10**19,\"*10**-19 J\"\n",
+ "print\"(iii) The stopping potential is\",v0,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The threshold wavelength is 618.75 nm\n",
+ "(ii) Maximum energy is 0.76 *10**-19 J\n",
+ "(iii) The stopping potential is 0.475 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 104
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 28.10 Page no 802"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V0=1.3\n",
+ "l=2271*10**-10\n",
+ "h=6.62*10**-34\n",
+ "e=1.6*10**-19\n",
+ "c=3*10**8\n",
+ "\n",
+ "#Calculation\n",
+ "w=(h*c/l)-(V0*e)\n",
+ "l0=(h*c)/w\n",
+ "\n",
+ "#Result\n",
+ "print\"Work function of metal is\", round(l0*10**10,0),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work function of metal is 2980.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 109
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 28.11 Page no 803"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "h=6.62*10**-34\n",
+ "c=3*10**8\n",
+ "l=640.2*10**-9\n",
+ "e=1.6*10**-19\n",
+ "V0=0.54\n",
+ "l1=427.2*10**-9\n",
+ "\n",
+ "#Calculation\n",
+ "w=(h*c/l)-(e*V0)\n",
+ "v0=(((h*c)/l1)-w)/e\n",
+ "\n",
+ "#Result\n",
+ "print\"New stopping voltage is\", round(v0,3),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "New stopping voltage is 1.507 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 115
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 28.12 Page no 803"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "l=5600.0*10**-10 #m\n",
+ "h=6.625*10**-34\n",
+ "c=3*10**8\n",
+ "a=5\n",
+ "\n",
+ "#Calculation\n",
+ "E=h*c/l\n",
+ "n=a/E\n",
+ "\n",
+ "#Result\n",
+ "print\"Number of visible light photon is\", round(n*10**-19,2)*10**-19"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of visible light photon is 1.41e-19\n"
+ ]
+ }
+ ],
+ "prompt_number": 121
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 28.13 Page no 803"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=10**4 #W\n",
+ "l=500.0 #m\n",
+ "h=6.62*10**-34\n",
+ "A=0.4*10**-14 #m**2\n",
+ "i=10**-10 #W/m**2\n",
+ "v=6*10**14\n",
+ "\n",
+ "#Calculation\n",
+ "E1=E*l/(h*c)\n",
+ "E2=h*v\n",
+ "n=A/E2\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Number of photons emitted is\",round(E1*10**-31,3)*10**31\n",
+ "print\"(ii) Number of photons is\", round(n*10**-4,0),\"*10**4\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Number of photons emitted is 2.518e+31\n",
+ "(ii) Number of photons is 1.0 *10**4\n"
+ ]
+ }
+ ],
+ "prompt_number": 132
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 28.14 Page no 803"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=2*10**-4 #m**2\n",
+ "An=10.0**-20\n",
+ "n1=5\n",
+ "i=10**-5 #W/m**2\n",
+ "\n",
+ "#Calculation\n",
+ "n=(A*n1)/An\n",
+ "E=i*A\n",
+ "E1=(E/n)/e\n",
+ "t=2/E1\n",
+ "\n",
+ "#Result\n",
+ "print\"Time required for the photoelectric emission is\",t*10**-7,\"*10**7 S\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required for the photoelectric emission is 1.6 *10**7 S\n"
+ ]
+ }
+ ],
+ "prompt_number": 145
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap3.ipynb b/modern_physics_by_Satish_K._Gupta/chap3.ipynb
new file mode 100644
index 00000000..7c6ed32c
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap3.ipynb
@@ -0,0 +1,783 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c3ec75ccee40d0eb91752b49524186dbe794af4f0e24a564bb72af8d09f81af1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 Electric potential"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1 Page no 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q=4.0 #c\n",
+ "Va=-10 #V\n",
+ "Wab=100 #joule\n",
+ "\n",
+ "#Calculation\n",
+ "V=(Wab/q)+Va\n",
+ "\n",
+ "#Result\n",
+ "print\"The value of V is\", V,\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V is 15.0 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2 Page no 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Z=79\n",
+ "e=1.6*10**-19 #C\n",
+ "r=6.6*10**-15 #m\n",
+ "m=9*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "q=Z*e\n",
+ "V=(m*q)/r\n",
+ "\n",
+ "#Result\n",
+ "print\"Electric potential at the surface of a gold nucleus is\", round(V*10**-7,3),\"*10**7 V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electric potential at the surface of a gold nucleus is 1.724 *10**7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3 Page no 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q=4*10**-7 #C\n",
+ "r=0.09 #m\n",
+ "m=9*10**9\n",
+ "a=2*10**-9\n",
+ "\n",
+ "#Calculation\n",
+ "Vp=(m*q)/r\n",
+ "W=a*Vp\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Potential at point P is\", Vp*10**-4,\"*10**4 V\"\n",
+ "print\"(b) Work done is\", W,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Potential at point P is 4.0 *10**4 V\n",
+ "(b) Work done is 8e-05 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4 Page no 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q=20*10**-6 #C\n",
+ "r1=0.1 #m\n",
+ "r2=0.05 #m\n",
+ "m=9*10**9\n",
+ "e=1.6*10**-19\n",
+ "\n",
+ "#Calculation\n",
+ "Va=(m*q)/r1\n",
+ "Vb=(m*q)/r2\n",
+ "Wab=-(Va-Vb)*e\n",
+ "\n",
+ "#Result\n",
+ "print\"Potential at point A is\", Va*10**-6,\"*10**6 V\"\n",
+ "print\"Potential at point b is\", Vb*10**-6,\"*10**6 V\"\n",
+ "print\"Work done is\",Wab,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Potential at point A is 1.8 *10**6 V\n",
+ "Potential at point b is 3.6 *10**6 V\n",
+ "Work done is 2.88e-13 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5 Page no 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=9.0*10**9\n",
+ "r=0.5\n",
+ "a=16\n",
+ "\n",
+ "#Calculation\n",
+ "q=(a*r)/m\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnitude of charge is\", round(q*10**10,2)*10**-10,\"C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of charge is 8.89e-10 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.6 Page no 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q1=2*10**-6 #c\n",
+ "q2=-2*10**-6\n",
+ "q3=-3*10**-6\n",
+ "q4=6*10**-6\n",
+ "r=1.0 #m\n",
+ "m=9*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "V=m*(q1+q2+q3+q4)/r\n",
+ "\n",
+ "#Result\n",
+ "print\"Potential at the centre of the square is\",V*10**-4,\"*10**4 V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Potential at the centre of the square is 2.7 *10**4 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.7 Page no 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=9*10**9\n",
+ "q=5*10**-6\n",
+ "r=0.1\n",
+ "\n",
+ "#Calculation\n",
+ "V=(6*m*q)/r\n",
+ "\n",
+ "#Result\n",
+ "print\"Potential at the centre of the hexagon is\", V*10**-6,\"*10**6 V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Potential at the centre of the hexagon is 2.7 *10**6 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.9 Page no 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "r=0.1 #m\n",
+ "q=200*10**-6 #C\n",
+ "m=9*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "V=(m*q)/r\n",
+ "\n",
+ "#Result\n",
+ "print\"Electric potential at the centre is\", V*10**-7,\"*10**7 V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electric potential at the centre is 1.8 *10**7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.11 Page no 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=0.2 #m\n",
+ "m=9*10**9\n",
+ "q1=2*10**-9\n",
+ "q2=4*10**-9\n",
+ "q3=8*10**-9\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "V=m*((q1/a)+(q2/(a*math.sqrt(2)))+(q3/a))\n",
+ "b=0.1*math.sqrt(2)\n",
+ "V0=m*((q1/b)+(q2/b)+(q3/b))\n",
+ "W=q*(V0-V)\n",
+ "\n",
+ "#Result\n",
+ "print\"Required work is\",round(W*10**2,2)*10**-7,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Required work is 6.27e-07 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 62
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.12 Page no 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=60\n",
+ "r=0.05\n",
+ "\n",
+ "#Calculation\n",
+ "E=-V/r\n",
+ "\n",
+ "#Result\n",
+ "print\"Electric field intensity between the two plate is\", E,\"V/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electric field intensity between the two plate is -1200.0 V/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 66
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.13 Page no 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "e=1.6*10**-19\n",
+ "m=3*10**-16 #Kg\n",
+ "r=5*10**-3 #m\n",
+ "g=9.8\n",
+ "\n",
+ "#Calculation\n",
+ "q=10*e\n",
+ "V=(m*g*r)/q\n",
+ "\n",
+ "#Result\n",
+ "print round(V,2),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9.19 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.14 Page no 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q1=7*10**-6 #c\n",
+ "q2=-2*10**-6 #C\n",
+ "r12=0.18 #m\n",
+ "m=9*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "U=m*((q1*q2)/r12)\n",
+ "W=0-U\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Electrostatic potential energy of a system is\",U,\"J\"\n",
+ "print\"(b) work required is\", W,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Electrostatic potential energy of a system is -0.7 J\n",
+ "(b) work required is 0.7 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 78
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.15 Page no 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=9*10**9\n",
+ "e=1.6*10**-19 #C\n",
+ "r=5.3*10**-11 #m\n",
+ "\n",
+ "#Calculation\n",
+ "V=(m*e)/r\n",
+ "U=((m*e*-e)/r)/e\n",
+ "q=2*e\n",
+ "V1=(m*q)/r\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Electric potential is\", round(V,2),\"V\"\n",
+ "print\"(b) Electric potential energy is\",round(V1,2),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Electric potential is 27.17 V\n",
+ "(b) Electric potential energy is 54.34 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 91
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.16 Page no 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "r12=1.5*10**-10 #m\n",
+ "r13=10.0**-10\n",
+ "q1=1.6*10**-19 #C\n",
+ "q3=-1.6*10**-19\n",
+ "m=9*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "U=m*(((q1**2)/r12)+((q1*q3)/r13)+((q1*q3)/r13))/q1\n",
+ "\n",
+ "#Result\n",
+ "print\"Potential energy is\",U,\"ev\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Potential energy is -19.2 ev\n"
+ ]
+ }
+ ],
+ "prompt_number": 109
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.17 Page no 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=10**5 #N/C\n",
+ "q=10**-6 #C\n",
+ "a=0.02 #m\n",
+ "A=1\n",
+ "\n",
+ "#Calculation'\n",
+ "import math\n",
+ "p=q*a\n",
+ "t=p*E*A\n",
+ "W=p*E*(math.cos(0*3.14/180.0)-math.cos(180*3.14/180.0))\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Torque acting on dipole is\",t,\"N m\"\n",
+ "print\"(ii) Work done is\", round(W,3),\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Torque acting on dipole is 0.002 N m\n",
+ "(ii) Work done is 0.004 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 126
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.18 Page no 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=9*10**9\n",
+ "q=8*10**-3\n",
+ "q0=-2*10**-9\n",
+ "ra=0.03\n",
+ "rb=0.04\n",
+ "\n",
+ "#Calculation\n",
+ "W=(m*q*q0*(1/rb-1/ra))\n",
+ "\n",
+ "#Result\n",
+ "print\"Work done is\", W,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work done is 1.2 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 129
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.19 Page no 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "qa=1.5*10**-6 #C\n",
+ "qb=2.5*10**-6 \n",
+ "a=0.15 #m\n",
+ "m=9*10**9\n",
+ "a1=0.18\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "V=((qa+qb)/a)*m\n",
+ "Ea=m*qa/a**2\n",
+ "Eb=m*qb/a**2\n",
+ "E=Eb-Ea\n",
+ "V1=((qa+qb)/a1)*m\n",
+ "Ea1=m*qa/a1**2\n",
+ "Ea2=m*qb/a1**2\n",
+ "A=math.atan(15/10.0)*180/3.14\n",
+ "A1=2*A\n",
+ "A2=math.cos(A1*3.14/180.0)\n",
+ "E3=math.sqrt(Ea1**2+Ea2**2+(2*Ea1*Ea2*A2))\n",
+ "tb=Ea1*math.sin(A1*3.14/180.0)/(Ea2+Ea1*math.cos(A1*3.14/180.0))\n",
+ "B=math.atan(tb)*180/3.14\n",
+ "y=90-A\n",
+ "Y=y+B\n",
+ "\n",
+ "#Result\n",
+ "print \"(a) Net electric field is\",E*10**-5,\"*10**5 N/C\"\n",
+ "print\"(b) Angle is\" ,round(Y,1),\"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Net electric field is 4.0 *10**5 N/C\n",
+ "(b) Angle is 69.4 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 160
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.23 Page no 71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q1=-1.6*10**-19 #C\n",
+ "q2=1.6*10**19\n",
+ "r12=0.53*10**-10 #m\n",
+ "m=9*10**9\n",
+ "r11=1.06*10**-10\n",
+ "\n",
+ "#Calculation\n",
+ "U=((m*q1*q2)/r12)/q2\n",
+ "K=U/2.0\n",
+ "E=-(U-K)\n",
+ "U1=((m*q1*q2)/r11)/q2\n",
+ "E1=U-U1\n",
+ "\n",
+ "#Result\n",
+ "print \"(a) Potential energy is\",round(U,2),\"ev\"\n",
+ "print\"(b) Minimum work required is\",round(E,3) ,\"ev\"\n",
+ "print\"(c) Potential energy is\",round(E1,3),\"ev\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Potential energy is -27.17 ev\n",
+ "(b) Minimum work required is 13.585 ev\n",
+ "(c) Potential energy is -13.585 ev\n"
+ ]
+ }
+ ],
+ "prompt_number": 181
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.24 Page no 72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=10**6 #V/m\n",
+ "p=10**-29 #cm\n",
+ "a=6.023*10**23\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Np=a*p\n",
+ "U1=Np*E\n",
+ "U2=Np*E*math.cos(60*3.14/180.0)\n",
+ "U=U1-U2\n",
+ "\n",
+ "#Result\n",
+ "print\"Heat released by the substance is\", round(U,2),\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat released by the substance is 3.01 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 188
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap30.ipynb b/modern_physics_by_Satish_K._Gupta/chap30.ipynb
new file mode 100644
index 00000000..cf038d52
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap30.ipynb
@@ -0,0 +1,235 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:75345a10ab4b01b2d63b7c49ca20de9a23e8e81cbab11c7f6d702383f9b2feef"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 30 Structure Of Nucleus"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 30.1 Page no 840"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A1=197\n",
+ "A2=107.0\n",
+ "\n",
+ "#Calculation\n",
+ "R=(A1/A2)**(0.3)\n",
+ "\n",
+ "#Result\n",
+ "print\"The ratio of the nuclear radii of the gold and silver isotope is\",round(R,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ratio of the nuclear radii of the gold and silver isotope is 1.201\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 30.2 Page no 840"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=1.2*10**-15 #m\n",
+ "M=1.67*10**-27 #kg\n",
+ "P1=10**3 #kg m**-3\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "V=1.3*math.pi*(R**3)\n",
+ "P=M/V\n",
+ "A=P/P1\n",
+ "\n",
+ "#Result\n",
+ "print\"Nuclear matter is denser than water is\",round(A*10**-14,3),\"*10**14\",\"times\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nuclear matter is denser than water is 2.366 10**14 times\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 30.3 Page no 840"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Mh=4.00150 #a.m.u.\n",
+ "Mp=1.00728 #a.m.u.\n",
+ "Mn=1.00867 #a.m.u.\n",
+ "W0=931.5 #MeV\n",
+ "\n",
+ "#Calculation\n",
+ "A=((2*Mp)+(2*Mn))-Mh\n",
+ "A1=A*W0\n",
+ "\n",
+ "#Result\n",
+ "print\"Binding energy of a-particle is\",round(A1,2),\"MeV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Binding energy of a-particle is 28.32 MeV\n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 30.4 Page no 840"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Mp=1.007275 #a.m.u.\n",
+ "Mn=1.008665 #a.m.u.\n",
+ "Mh=2.013553 #a.m.u.\n",
+ "S=2.0\n",
+ "U=931.5\n",
+ "\n",
+ "#Calculation\n",
+ "A=(Mp+Mn)-Mh\n",
+ "P=A/S\n",
+ "W=A*U\n",
+ "L=W/S\n",
+ "\n",
+ "#Result\n",
+ "print\"The mass defect is\",A,\"a.m.u.\" \n",
+ "print\"The packing fraction is\",P,\"a.m.u.\"\n",
+ "print\"The binding energy of deutron is\",round(W,2),\"MeV\"\n",
+ "print\"The binding energy of per nucleon of deutron is\",round(L,2),\"MeV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mass defect is 0.002387 a.m.u.\n",
+ "The packing fraction is 0.0011935 a.m.u.\n",
+ "The binding energy of deutron is 2.22 MeV\n",
+ "The binding energy of per nucleon of deutron is 1.11 MeV\n"
+ ]
+ }
+ ],
+ "prompt_number": 62
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 30.5 Page no 840"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Mh=1.007825 #a.m.u.\n",
+ "Mn=1.008665 #a.m.u.\n",
+ "Mp=55.934939 #a.m.u.\n",
+ "Mb=208.980388 #a.m.u.\n",
+ "A=56.0\n",
+ "Z=26\n",
+ "S=931.5\n",
+ "A1=209.0\n",
+ "Z1=83\n",
+ "\n",
+ "#Calculation\n",
+ "W=A-Z\n",
+ "Q=((Z*Mh+W*Mn)-Mp)*S\n",
+ "R=Q/A\n",
+ "W1=A1-Z1\n",
+ "Q1=((Z1*Mh+W1*Mn)-Mb)*S\n",
+ "R1=Q1/A1\n",
+ "\n",
+ "#Result\n",
+ "print\"The binding energy of the nuclri of Fe is\",round(Q,2),\"MeV\"\n",
+ "print\"The binding energy of the nuclei of Bi is\",round(Q1,2),\"MeV\"\n",
+ "print\"Binding energy per nucleon of Fe is\",round(R,2),\"MeV\"\n",
+ "print\"Binding energy per nucleon of Bi is\",round(R1,3),\"MeV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The binding energy of the nuclri of Fe is 492.26 MeV\n",
+ "The binding energy of the nuclei of Bi is 1640.26 MeV\n",
+ "Binding energy per nucleon of Fe is 8.79 MeV\n",
+ "Binding energy per nucleon of Bi is 7.848 MeV\n"
+ ]
+ }
+ ],
+ "prompt_number": 80
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap31.ipynb b/modern_physics_by_Satish_K._Gupta/chap31.ipynb
new file mode 100644
index 00000000..6135b7c0
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap31.ipynb
@@ -0,0 +1,388 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:64e0a844a3ba33dead720cfb202f40f7dab27e1a9fab7ab4975bb30624a36195"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 31 Radioactivity"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 31.1 Page no 855"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "T=138.0 #days\n",
+ "E=0.693\n",
+ "N=12.5\n",
+ "N0=100\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "L=E/T\n",
+ "N1=N/N0\n",
+ "t=(2.303*math.log10(8))/L\n",
+ "\n",
+ "#Result\n",
+ "print\"Time is\",round(t,2),\"days\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time is 414.16 days\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 31.2 Page no 855"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "T=1.42*10**17 #s\n",
+ "A=6.02*10**23 #mol**-1\n",
+ "E=0.693\n",
+ "L=238.0\n",
+ "\n",
+ "#Calculation\n",
+ "N=A/L\n",
+ "L1=E/T\n",
+ "Z=L1*N\n",
+ "\n",
+ "#Result\n",
+ "print\"Disintegrations per second occur in 1g of U**238 is\",round(Z*10**-4,3),\"*10**4 s**-1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Disintegrations per second occur in 1g of U**238 is 1.234 *10**4 s**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 31.3 Page no 855"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "K=-40 #Cl\n",
+ "M=0.075 #kg mole**-1\n",
+ "m=1.2*10**-6 #kg\n",
+ "A=6.0*10**23\n",
+ "D=170 #s**-1\n",
+ "E=0.693\n",
+ "\n",
+ "#Calculation\n",
+ "N=(A/M)*m\n",
+ "L=D/N\n",
+ "T=(E/L)\n",
+ "O=T/31536000.0\n",
+ "\n",
+ "#Result\n",
+ "print\"Half life of K40 atom is\",round(O*10**-9,3),\"*10**9 years\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Half life of K40 atom is 1.241 *10**9 years\n"
+ ]
+ }
+ ],
+ "prompt_number": 81
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 31.4 Page no 856"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "T=6.0 #hours\n",
+ "E=0.693\n",
+ "A=6.025*10**23\n",
+ "W=99.0\n",
+ "S=10**-12\n",
+ "t=1 #hours\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "L=E/T\n",
+ "N0=(A/W)*S\n",
+ "R0=L*N0\n",
+ "N=N0*math.exp(-L)\n",
+ "R=L*N\n",
+ "R1=L*N\n",
+ "\n",
+ "#Result\n",
+ "print\"Activity at beginning is\", round(R0*10**-8,2),\"*10**8 /h\"\n",
+ "print\"Activity at the end is\",round(R1*10**-8,3),\"*10**8 /h\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Activity at beginning is 7.03 *10**8 /h\n",
+ "Activity at the end is 6.262 *10**8 /h\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 31.5 Page no 856"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "t=30.0 #years\n",
+ "a=16\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "l=(2.3026*math.log10(a))/t\n",
+ "T=0.693/l\n",
+ "\n",
+ "#Result\n",
+ "print\"Half life period is\", round(T,1),\"years\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Half life period is 7.5 years\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 31.6 Page no 856"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m1=238.05081\n",
+ "m2=234.04363\n",
+ "m3=4.00260\n",
+ "A=931.5 #Mev\n",
+ "\n",
+ "#Calculation\n",
+ "Ea=(m1-m2-m3)*A\n",
+ "\n",
+ "#Result\n",
+ "print\"Kinetic energy is\",round(Ea,2),\"Mev\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Kinetic energy is 4.27 Mev\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 31.7 Page no 856"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m1=22.994466\n",
+ "m2=22.989770\n",
+ "A=931.5\n",
+ "\n",
+ "#Calculation\n",
+ "Eb=(m1-m2)*A\n",
+ "\n",
+ "#Result\n",
+ "print\"Maximum kinetic energy is\",round(Eb,3),\"Mev\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum kinetic energy is 4.374 Mev\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 31.8 Page no 856"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E1=0\n",
+ "E2=0.412*1.6*10**-13\n",
+ "E3=1.088*1.6*10**-13\n",
+ "h=6.62*10**-34\n",
+ "m1=197.968233\n",
+ "m2=197.966760\n",
+ "a=931.5\n",
+ "A=1.088\n",
+ "A1=0.412\n",
+ "\n",
+ "#Calculation\n",
+ "v1=(E3-E1)/h\n",
+ "v2=(E2-E1)/h\n",
+ "v3=(E3-E2)/h\n",
+ "Eb1=((m1-m2)*a)-A\n",
+ "Eb2=((m1-m2)*a)-A1\n",
+ "\n",
+ "#Result\n",
+ "print\"Radiation frequencies are\",round(v1*10**-20,2)*10**20,\",\",round(v2*10**-20,3)*10**20,\"and\",round(v3*10**-20,2)*10**20\n",
+ "print\"Maximum kinetic energies are\",round(Eb1,3),\"Mev and \",round(Eb2,3),\"Mev\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radiation frequencies are 2.63e+20 , 9.96e+19 and 1.63e+20\n",
+ "Maximum kinetic energies are 0.284 Mev and 0.96 Mev\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 31.9 Page no 857"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=15\n",
+ "b=9.0\n",
+ "T=5730\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=a/b\n",
+ "l=2.303*math.log10(A)\n",
+ "t=(l*T)/0.693\n",
+ "\n",
+ "#Result\n",
+ "print\"Approximation age of the indus valley civilization is\",round(t,2),\"years\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Approximation age of the indus valley civilization is 4224.47 years\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap32.ipynb b/modern_physics_by_Satish_K._Gupta/chap32.ipynb
new file mode 100644
index 00000000..69ecaa80
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap32.ipynb
@@ -0,0 +1,381 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1a205c66d8c05960f2478abf5942d3dc43db8b63d7327dc1bc8decd646c4e601"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 32 Nuclear reactions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 32.3 Page no 874"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "r1=6.015126\n",
+ "r2=1.008665\n",
+ "p1=4.002603\n",
+ "p2=3.016049\n",
+ "a=931\n",
+ "\n",
+ "#Calculation\n",
+ "R=r1+r2\n",
+ "P=p1+p2\n",
+ "M=R-P\n",
+ "E=M*a\n",
+ "\n",
+ "#Result\n",
+ "print\"Energy released is\",round(E,2),\"Mev\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy released is 4.78 Mev\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 32.4 Page no 874"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P=400*10**6 #J/s\n",
+ "c=3.0*10**8\n",
+ "\n",
+ "#Calculation\n",
+ "E=P*24*60*60\n",
+ "m=E/c**2\n",
+ "\n",
+ "#Result\n",
+ "print\"U235 is\",m*10**3,\"g\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "U235 is 0.384 g\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 32.5 Page no 874"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=6.023*10**23\n",
+ "w=235.0\n",
+ "E=200\n",
+ "e=1.6*10**-13\n",
+ "\n",
+ "#Calculation\n",
+ "E1=((A*E)/w)*e\n",
+ "E2=E1/(1000.0*3600.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"Energy released is\", round(E2*10**-4,3),\"*10**4 KWh\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy released is 2.278 *10**4 KWh\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 32.6 Page no 874"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=7.6*10**13 #J\n",
+ "E1=200.0*1.6*10**-13\n",
+ "h=6.023*10**23\n",
+ "a=235\n",
+ "\n",
+ "#Calculation\n",
+ "n=E/E1\n",
+ "M=(a*n)/h\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Number of uranium atom is\",n\n",
+ "print\"(ii) Mass of uranium is\",round(M,2),\"g\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Number of uranium atom is 2.375e+24\n",
+ "(ii) Mass of uranium is 926.66 g\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 32.7 Page no 874"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m1=235.043933\n",
+ "m2=140.917700\n",
+ "m3=91.895400\n",
+ "n1=1.0086651\n",
+ "a=931.5\n",
+ "\n",
+ "#Calculation\n",
+ "Q=(m1-m2-m3-2*(n1))*a\n",
+ "\n",
+ "#Result\n",
+ "print\"Energy released is\",round(Q,2),\"Mev\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy released is 198.88 Mev\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 32.8 Page no 874"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "M1=1.007825\n",
+ "M2=4.002603\n",
+ "M3=0.000549\n",
+ "A=931.5\n",
+ "S=4\n",
+ "W=2\n",
+ "\n",
+ "#Calculation\n",
+ "Q=((S*M1-M2-W*M3)*A)\n",
+ "\n",
+ "#Result\n",
+ "print\"The energy is\",round(Q,2),\"MeV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The energy is 25.71 MeV\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 32.9 Page no 875"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "M1=1.008 #a.m.u.\n",
+ "M2=4.004 #a.m.u.\n",
+ "M3=7.016 #a.m.u.\n",
+ "A=2\n",
+ "W=931\n",
+ "\n",
+ "#Calculation\n",
+ "Q=(M3+M1-A*M2)*W\n",
+ "\n",
+ "#Result\n",
+ "print\"The initial energy of each alpha-particle is\",Q,\"MeV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The initial energy of each alpha-particle is 14.896 MeV\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 32.10 Page no 875"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "M1=235.0439\n",
+ "M2=93.9065\n",
+ "M3=139.9055\n",
+ "M4=1.00866\n",
+ "S=931.5\n",
+ "\n",
+ "#Calculation\n",
+ "Q=(M1-M2-M3-M4)*S\n",
+ "\n",
+ "#Result\n",
+ "print\"Total energy is\",round(Q,2),\"MeV\"\n",
+ "print\"All the available energy does not appear as the kinetic energy of fission products\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total energy is 207.95 MeV\n",
+ "All the available energy does not appear as the kinetic energy of fission products\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 32.11 Page no 875"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "M1=2.014102\n",
+ "M2=3.016049\n",
+ "M3=4.002603\n",
+ "M4=1.008665\n",
+ "S=931.5\n",
+ "q1=1.6*10**-19 #C\n",
+ "q2=9*10**9\n",
+ "r=2*1.5*10**-15\n",
+ "r1=1.38*10**-23\n",
+ "\n",
+ "#Calculation\n",
+ "Q=(M1+M2-M3-M4)*S\n",
+ "Q2=q2*(q1**2/r)\n",
+ "Q3=(2*Q2)/(3*r1)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The amount of energy is\",round(Q,2),\"MeV\"\n",
+ "print\"(b) The kinetic energy is\",Q2,\"J\"\n",
+ "print\"The temperature is\",round(Q3*10**-9,2),\"*10**9 K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The amount of energy is 17.59 MeV\n",
+ "(b) The kinetic energy is 7.68e-14 J\n",
+ "The temperature is 3.71 *10**9 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap33.ipynb b/modern_physics_by_Satish_K._Gupta/chap33.ipynb
new file mode 100644
index 00000000..4183f15e
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap33.ipynb
@@ -0,0 +1,304 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:52e9ff37336a0b3392520c7ec0e817b37056adea4740de3297c85e4e3e83dc56"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 33 Solids"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 33.1 Page no 904"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Eg=0.72*1.6*10**-19 #J\n",
+ "h=6.62*10**-34\n",
+ "c=3*10**8\n",
+ "\n",
+ "#Calculation\n",
+ "L=(h*c)/Eg\n",
+ "\n",
+ "#Result\n",
+ "print\"The maximum wavelength of electromagnetic radiation is\",round(L*10**6,3)*10**-6,\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum wavelength of electromagnetic radiation is 1.724e-06 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 33.2 Page no 904"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n1=1.5*10**16 #/m**3\n",
+ "nh=4.5*10**22\n",
+ "\n",
+ "#Calculation\n",
+ "ne=n1**2/nh\n",
+ "\n",
+ "#Result\n",
+ "print\"ne in the doping silicon is\",ne*10**-9,\"*10**9 /m**3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "ne in the doping silicon is 5.0 *10**9 /m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 33.3 Page no 904"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "ne=8*10**19 #/m**3\n",
+ "nh=5*10**18\n",
+ "ue=2.3 #m**2/V/S\n",
+ "uh=0.01\n",
+ "e=1.6*10**-19\n",
+ "\n",
+ "#Calculation\n",
+ "a=1/(e*((ne*ue)+(nh*uh)))\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The semiconductor has greater electron concentration, it is n-type semiconductor\"\n",
+ "print\"(b) Resistivity is\", round(a*10**2,3),\"*10**-2 ohm/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The semiconductor has greater electron concentration, it is n-type semiconductor\n",
+ "(b) Resistivity is 3.396 *10**-2 ohm/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 33.4 Page no 904"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "e=1.6*10**-19 #C\n",
+ "A=500 #ohm**-1 m**-1\n",
+ "Ue=0.39 #m**2 V**-1 s**-1\n",
+ "\n",
+ "#Calculation\n",
+ "Ne=A/(e*Ue)\n",
+ "\n",
+ "#Result\n",
+ "print\"The number density of donor atoms is\",round(Ne*10**-21,3)*10**21,\"m**3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The number density of donor atoms is 8.013e+21 m**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 33.5 Page no 904"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "F=1.6*10**-19 #E\n",
+ "W=4.2*10**8\n",
+ "e=2.4\n",
+ "w=4.2*10**-8\n",
+ "\n",
+ "#Calculation\n",
+ "S=F*W\n",
+ "A=S/F\n",
+ "E=e/w\n",
+ "\n",
+ "#Result\n",
+ "print\"Electric field is\", round(E*10**-7,2),\"*10**7 V/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electric field is 5.71 *10**7 V/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 33.6 Page no 904"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "h=6.62*10**-34\n",
+ "c=3*10**8\n",
+ "l=630*10**-9\n",
+ "e=1.6*10**-19\n",
+ "\n",
+ "#Calculation\n",
+ "Eg=(h*c)/(l*e)\n",
+ "\n",
+ "#Result\n",
+ "print\"Width of the forbidden energy gap is\",round(Eg,2),\"eV\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width of the forbidden energy gap is 1.97 eV\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 33.7 Page no 904"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#iven\n",
+ "A=10**-4 #m**2\n",
+ "l=0.1 #m\n",
+ "V=2 #V\n",
+ "T=300 #K\n",
+ "ue=0.135 #m**2/V/S\n",
+ "n=1.5*10**15 #/m**3\n",
+ "uh=0.048 #m**2/V/S\n",
+ "e=1.6*10**-19\n",
+ "ue1=0.39\n",
+ "uh1=0.19\n",
+ "n1=2.4*10**19\n",
+ "\n",
+ "#Calculation\n",
+ "E=V/l\n",
+ "ve=ue*E\n",
+ "vh=uh*E\n",
+ "Ie=e*A*n*ve\n",
+ "Ih=e*A*n*vh\n",
+ "I=Ie+Ih\n",
+ "ve1=ue1*E\n",
+ "ve2=uh1*E\n",
+ "Ie1=e*A*n1*ve1\n",
+ "Ie2=e*A*n1*ve2\n",
+ "I1=Ie1+Ie2\n",
+ "\n",
+ "#Result\n",
+ "print\"Electron current is\", Ie*10.0,\"A \\nHole current is\",Ih*10,\"A\"\n",
+ "print\"Magnitude of total current is\",I*10,\"A \\nTotal current when germanium is used is\",I1*10**3,\"*10**-3 A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electron current is 6.48e-07 A \n",
+ "Hole current is 2.304e-07 A\n",
+ "Magnitude of total current is 8.784e-07 A \n",
+ "Total current when germanium is used is 4.4544 *10**-3 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap34.ipynb b/modern_physics_by_Satish_K._Gupta/chap34.ipynb
new file mode 100644
index 00000000..9aea6687
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap34.ipynb
@@ -0,0 +1,621 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:13c8f6846e205753ae8bd963e82228c66a5cc1ec104d777be242a6767f4586d5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 34 Semiconductor devices"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 34.1 Page no 932"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=3 #V\n",
+ "Vd=0.7\n",
+ "R=100.0\n",
+ "\n",
+ "#Calculation\n",
+ "V=E-Vd\n",
+ "I=V/R\n",
+ "\n",
+ "#Result\n",
+ "print\"Current in the circuit is\",I*10**3,\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in the circuit is 23.0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 34.2 Page no 932"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=1.5 #V\n",
+ "Vd=0.5\n",
+ "P=0.1 #W\n",
+ "\n",
+ "#Calculation\n",
+ "I=P/Vd\n",
+ "V=E-Vd\n",
+ "R=V/I\n",
+ "\n",
+ "#Result\n",
+ "print\"Value of resistance is\",R,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of resistance is 5.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 34.3 Page no 932"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=9 #V\n",
+ "Vz=6 #V\n",
+ "Rl=1000.0 #ohm\n",
+ "R=100.0 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "V=E-Vz\n",
+ "I=V/R\n",
+ "Il=Vz/Rl\n",
+ "Iz=I-Il\n",
+ "Pz=Vz*Iz\n",
+ "\n",
+ "#Result\n",
+ "print\"Power dissipated in zener diode is\",Pz,\"watt\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power dissipated in zener diode is 0.144 watt\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 34.4 Page no 932"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E0=50 #V\n",
+ "S=2.0\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "E1=50/math.sqrt(S) #V\n",
+ "V=math.sqrt(E1**2/S)\n",
+ "V1=(S*E0/math.pi)/S\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The r.m.s. voltage across Rl is\",V,\"V\"\n",
+ "print\"(b) Reading of a d.c voltametre connected across Rl is\",round(V1,2),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The r.m.s. voltage across Rl is 25.0 V\n",
+ "(b) Reading of a d.c voltametre connected across Rl is 15.92 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 34.5 Page no 933"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=0.96\n",
+ "Ie=7.2 #mA\n",
+ "\n",
+ "#Calculation\n",
+ "Ic=A*Ie\n",
+ "Ib=Ie-Ic\n",
+ "\n",
+ "#Result\n",
+ "print\"The base current is\",round(Ib,2),\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The base current is 0.29 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 34.6 Page no 933"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=70\n",
+ "Ie=8.8 #mA\n",
+ "Ib=1.0\n",
+ "Ic=70.0\n",
+ "\n",
+ "#Calculation\n",
+ "Ib1=Ie/(Ic+Ib)\n",
+ "Ic1=Ic*Ib1\n",
+ "A=Ic/(Ic+Ib)\n",
+ "\n",
+ "#Result\n",
+ "print\"The collector current is\",round(Ib1,3),\"mA\"\n",
+ "print\"The base current is\",round(Ic1,2),\"mA\"\n",
+ "print\"Current gain is\",round(A,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current is 0.124 mA\n",
+ "The base current is 8.68 mA\n",
+ "Current gain is 0.986\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 34.7 Page no 933"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Ib=105*10**-6 #A\n",
+ "Ic=2.05*10**-3 #A\n",
+ "Ib1=27*10**-6 #A\n",
+ "Ic1=650*10**-6 #A\n",
+ "\n",
+ "#Calculation\n",
+ "B=Ic/Ib\n",
+ "Ie=Ib+Ic\n",
+ "A=Ic/Ie\n",
+ "Bac=Ic1/Ib1\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The value of B is\",round(B,1),\",Value of Ie is\",Ie*10**3,\"*10**-3 A\",\"and Value of A is\",round(A,2)\n",
+ "print\"(b) The value of Bac is\",round(Bac,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The value of B is 19.5 ,Value of Ie is 2.155 *10**-3 A and Value of A is 0.95\n",
+ "(b) The value of Bac is 24.07\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 34.8 Page no 933"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Ie=7.89*10**-3 #A\n",
+ "Ic=7.8*10**-3 #A\n",
+ "\n",
+ "#Calculation\n",
+ "A=Ic/Ie\n",
+ "B=A/(1-A)\n",
+ "Ib=Ic/B\n",
+ "\n",
+ "#Result\n",
+ "print\"change in the base current is\",Ib,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "change in the base current is 9e-05 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 34.9 Page no 933"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Ib=20.0*10**-6 #A\n",
+ "Vbe=0.02 #V\n",
+ "Ic=2*10**-3 #A\n",
+ "Rl=5000 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "P=Vbe/Ib\n",
+ "B=Ic/Ib\n",
+ "Gm=Ic/Vbe\n",
+ "Q=(Rl*Ic)/Vbe\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The input resistance Bac is\",P,\"ohm\",\"and transconductance of the transister is\",Gm,\"ohm**-1\"\n",
+ "print\"(b) The voltage gain of the amplifier is\",Q"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The input resistance Bac is 1000.0 ohm and transconductance of the transister is 0.1 ohm**-1\n",
+ "(b) The voltage gain of the amplifier is 500.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 34.10 Page no 933"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Ib=15*10**-6 #A\n",
+ "Ic=2*10**-3 #A\n",
+ "R=665.0 #ohm\n",
+ "Rl=5*10**3 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "B=Ic/Ib\n",
+ "Gm=B/R\n",
+ "Av=Gm*Rl\n",
+ "\n",
+ "#Result \n",
+ "print\"(i) Current gain is\",round(B,1)\n",
+ "print\"(ii) Transconductance is\",round(Gm,1),\"ohm**-1\"\n",
+ "print\"(iii) Voltage gain Av of the amplifier is\",round(Av,0)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Current gain is 133.3\n",
+ "(ii) Transconductance is 0.2 ohm**-1\n",
+ "(iii) Voltage gain Av of the amplifier is 1003.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 34.11 Page no 934"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "B=100.0\n",
+ "Vcc=24 #V\n",
+ "Ic=1.5*10**-3 #A\n",
+ "Rc=4.7*10**3\n",
+ "Rb=220*10**3\n",
+ "\n",
+ "#Calculation\n",
+ "Ib=Ic/B\n",
+ "Vce=Vcc-(Ic*Rc)\n",
+ "Vbe=Vcc-(Ib*Rb)\n",
+ "Vbc=(Ic*Rc)-(Ib*Rb)\n",
+ "\n",
+ "#Result\n",
+ "print\"The value of Ib is\",Ib,\"A\"\n",
+ "print\"The value of Vce is\",Vce,\"V\"\n",
+ "print\"The value of Vbe is\",Vbe,\"V\"\n",
+ "print\"The value of Vbc is\",Vbc,\"V\"\n",
+ "print\"The transistor is in saturation state\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of Ib is 1.5e-05 A\n",
+ "The value of Vce is 16.95 V\n",
+ "The value of Vbe is 20.7 V\n",
+ "The value of Vbc is 3.75 V\n",
+ "The transistor is in saturation state\n"
+ ]
+ }
+ ],
+ "prompt_number": 84
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 34.15 Page no 935"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Vb=5 #V\n",
+ "I=10**3 #A\n",
+ "Q=0.7\n",
+ "I1=5*10**-3\n",
+ "Vb1=6 #V\n",
+ "R0=1000 #ohm\n",
+ "I3=10**-3 #A\n",
+ "\n",
+ "#Calculation\n",
+ "R=(Vb-Q)*I\n",
+ "R1=(R*10**-3)/I1\n",
+ "R3=(Vb1-Q)/I1\n",
+ "R4=I1**2*R3\n",
+ "R5=Q*I1\n",
+ "Vz=(I3*R0)+Q\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The maximum value of R is\",R*10**-3,\"10**3\",\"ohm\"\n",
+ "print\"(b) The value of R is\",R1,\"ohm\"\n",
+ "print\"(c) The power dissipated across R is\",R4*10**3,\"10**-3\",\"ohm\",\"and across diode is\",R5*10**3,\"10**-3 W\"\n",
+ "print\"(d) The maximum voltage Vb is\",Vz,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The maximum value of R is 4.3 10**3 ohm\n",
+ "(b) The value of R is 860.0 ohm\n",
+ "(c) The power dissipated across R is 26.5 10**-3 ohm and across diode is 3.5 10**-3 W\n",
+ "(d) The maximum voltage Vb is 1.7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 148
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 34.16 Page no 935"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I0=5*10**-12 #A\n",
+ "K=8.6*10**-5 #eVK**-1\n",
+ "Q=1.6*10**-19 #J K**-1\n",
+ "V=0.6 #volts\n",
+ "V1=0.7 #volts\n",
+ "A=23.256\n",
+ "A1=27.132\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "I=-I0*(Q*V/math.exp(K*Q)-1)\n",
+ "Z=I*(math.exp(A)-1)\n",
+ "I1=-I0*(Q*V1/math.exp(K*Q)-1)\n",
+ "Z1=I1*(math.exp(A1)-1)\n",
+ "S=Z1-Z\n",
+ "V2=V1-V\n",
+ "J=V2/S\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The forward current at a forward voltage is\",round(Z,4),\"A\"\n",
+ "print\"(b) The voltage across the diode is\",round(S,4),\"A\"\n",
+ "print\"(c) The dynamic resistance is\",round(J,4),\"ohm\"\n",
+ "print\"(d) For change in votage from 1V to 2V,the current will remain equal to\",I0,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The forward current at a forward voltage is 0.0629 A\n",
+ "(b) The voltage across the diode is 2.9727 A\n",
+ "(c) The dynamic resistance is 0.0336 ohm\n",
+ "(d) For change in votage from 1V to 2V,the current will remain equal to 5e-12 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 34.17 Page no 936"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Vbe=24*10**-3 #V\n",
+ "Ib=32*10**-6 #A\n",
+ "Ic=3.6*10**-3 #A\n",
+ "Rl=4.8*10**3\n",
+ "\n",
+ "#Calculation\n",
+ "B=Ic/Ib\n",
+ "Rbe=Vbe/Ib\n",
+ "Gm=Ic/Vbe\n",
+ "Av=(Rl*Ic)/Vbe\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) The current gain is\",B\n",
+ "print\"(ii) The input resistance Rbe is\",Rbe,\"ohm\"\n",
+ "print\"(iii) The transconductance Gm is\",Gm,\"S\"\n",
+ "print\"(iv) Voltage gain Av is\",Av"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) The current gain is 112.5\n",
+ "(ii) The input resistance Rbe is 750.0 ohm\n",
+ "(iii) The transconductance Gm is 0.15 S\n",
+ "(iv) Voltage gain Av is 720.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap35.ipynb b/modern_physics_by_Satish_K._Gupta/chap35.ipynb
new file mode 100644
index 00000000..27056667
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap35.ipynb
@@ -0,0 +1,263 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:6fd837c473d583739b16708ec5ff802d29867f6cb2f48bae07778822e1c04084"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 35 Analog and Digital Communication"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 35.1 Page no 978"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Em=0.5 \n",
+ "Ec=1\n",
+ "\n",
+ "#Calculation\n",
+ "Emax=Ec+Em\n",
+ "Emin=Ec-Em\n",
+ "Ma=(Emax-Emin)/(Emax+Emin)\n",
+ "\n",
+ "#Result\n",
+ "print\"The modulation index is\",Ma"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The modulation index is 0.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 35.2 Page no 978"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=3.6*10**-3 #H\n",
+ "C=2.5*10**-12 #F\n",
+ "Fm=15 #KHz\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "Fc=1/(2*math.pi*math.sqrt(L*C))*10**-3\n",
+ "S=Fc+Fm\n",
+ "S1=Fc-Fm\n",
+ "\n",
+ "#Result\n",
+ "print\"Frequency of upper sideband is\",round(S,0),\"kHz\"\n",
+ "print\"Frequency of lower sideband is\",round(S1,0),\"kHz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of upper sideband is 1693.0 kHz\n",
+ "Frequency of lower sideband is 1663.0 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 35.3 Page no 978"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Fm=3.2 #kHz\n",
+ "Fc=84*10**3 #kHz\n",
+ "A=96 #kHz\n",
+ "\n",
+ "#Calculation\n",
+ "Mf=A/Fm\n",
+ "M1=Fc-Fm\n",
+ "M2=Fc+Fm\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Frequency modulation index is\",Mf\n",
+ "print\"(b) Frequency range of the modulated wave is\",round(M1*10**-3,3),\"*10**3 MHz\",\"to\",round(M2*10**-3,3),\"*10**3 MHz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Frequency modulation index is 30.0\n",
+ "(b) Frequency range of the modulated wave is 83.997 *10**3 MHz to 84.003 *10**3 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 35.4 Page no 979"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=1\n",
+ "B=2\n",
+ "C=0\n",
+ "\n",
+ "#Calculation\n",
+ "Q1=(A*B**0)+(C*B**1)+(C*B**2)+(C*B**3)\n",
+ "Q2=(C*B**0)+(A*B**1)+(C*B**2)+(C*B**3)\n",
+ "Q3=(C*B**0)+(C*B**1)+(A*B**2)+(C*B**3)\n",
+ "Q4=(C*B**0)+(C*B**1)+(C*B**2)+(A*B**3)\n",
+ "Q5=(A*B**0)+(C*B**1)+(C*B**2)+(A*B**3)\n",
+ "Q6=(A*B**0)+(C*B**1)+(A*B**2)+(A*B**3)\n",
+ "\n",
+ "#Result\n",
+ "print\"Input voltage 0001 is\",Q1,\"V\"\n",
+ "print\"Input voltage 0010 is\",Q2,\"V\"\n",
+ "print\"Input voltage 0100 is\",Q3,\"V\"\n",
+ "print\"Input voltage 1000 is\",Q4,\"V\"\n",
+ "print\"Input voltage 1001 is\",Q5,\"V\"\n",
+ "print\"Input voltage 1101 is\",Q6,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input voltage 0001 is 1 V\n",
+ "Input voltage 0010 is 2 V\n",
+ "Input voltage 0100 is 4 V\n",
+ "Input voltage 1000 is 8 V\n",
+ "Input voltage 1001 is 9 V\n",
+ "Input voltage 1101 is 13 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 35.5 Page no 979"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=2\n",
+ "N=32\n",
+ "\n",
+ "#Calculation\n",
+ "Z=A**N\n",
+ "\n",
+ "#Result\n",
+ "print\"Number of quantisation levels is\",round(Z*10**-9,1),\"*10**9\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of quantisation levels is 4.3 *10**9\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 35.6 Page no 979"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "S=16\n",
+ "Q=8000\n",
+ "\n",
+ "#Calculation\n",
+ "N=math.sqrt(S)\n",
+ "W=Q*N\n",
+ "\n",
+ "#Result\n",
+ "print\"The bill rate for a signal is\",W,\"bill s**-1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The bill rate for a signal is 32000.0 bill s**-1\n"
+ ]
+ }
+ ],
+ "prompt_number": 69
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap36.ipynb b/modern_physics_by_Satish_K._Gupta/chap36.ipynb
new file mode 100644
index 00000000..4e06b38b
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap36.ipynb
@@ -0,0 +1,103 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:d9296ed3bbb0144b6fddcd9bd9b4d00b56d458558332cd059b27e6750c38d570"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 36 Space Communication"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 36.1 Page no 990"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "AB=2*10**5 #m\n",
+ "CN=100 #km\n",
+ "C=3.0*10**8\n",
+ "\n",
+ "#Calculation\n",
+ "Tg=AB/C\n",
+ "Q=(math.sqrt(CN**2+CN**2))+(math.sqrt(CN**2+CN**2))\n",
+ "Ts=Q*10**3/C\n",
+ "W=(Ts-Tg)\n",
+ "\n",
+ "#Result\n",
+ "print\"The time delay is\",round(W*10**4,2),\"*10**-4 s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The time delay is 2.76 *10**-4 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 57
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 36.2 Page no 990"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "H=80 #m\n",
+ "R=6.4*10**6\n",
+ "W=800 #km**-2\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "D=math.sqrt(2*H*R)\n",
+ "A=math.pi*D**2\n",
+ "S=A*W\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) The radius of the circle is\",D*10**-4,\"10**4 m\"\n",
+ "print\"(b) The population covered by the transmission is\",round(S*10**-12,3),\"*10**6\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The radius of the circle is 3.2 10**4 m\n",
+ "(b) The population covered by the transmission is 2.574 *10**6\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap37.ipynb b/modern_physics_by_Satish_K._Gupta/chap37.ipynb
new file mode 100644
index 00000000..03f26ef4
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap37.ipynb
@@ -0,0 +1,183 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:10e3d0cfbf86d2f1081a9d348d19bd93a499331702a8a9f3c32ddc1a8679292a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 37 Line Communication"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 37.1 Page no 1007"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "U=1.48\n",
+ "U2=1.45\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "C=U2/U\n",
+ "C1=math.asin(C)*180/3.14\n",
+ "\n",
+ "#Result \n",
+ "print\"The critical angle for a light is\",round(C1,1),\"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The critical angle for a light is 78.5 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 37.2 Page no 1007"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u=1.7\n",
+ "u2=1.5\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "C=u2/u\n",
+ "A=math.asin(C)*180/3.14\n",
+ "I=math.sqrt(u**2-u2**2)\n",
+ "A1=math.asin(I)*180/3.14\n",
+ "\n",
+ "#Result\n",
+ "print\"The critical angle is\",round(A,1),\"degree\"\n",
+ "print\"The angle of acceptance is\",round(A1,1),\"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The critical angle is 62.0 degree\n",
+ "The angle of acceptance is 53.2 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 37.3 Page no 1007"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "u1=1.5\n",
+ "u2=1.3\n",
+ "L=30 #m\n",
+ "c=3*10**8\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "V=c/u1\n",
+ "t1=L/V\n",
+ "C=u2/u1\n",
+ "C1=math.asin(C)*180/3.14\n",
+ "x=L/C\n",
+ "t=x/V\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Time taken for light in axical mode is\",t1*10**7,\"*10**-7 s\" \n",
+ "print\"(b) Time taken for light in highest order mode is\",round(t*10**7,2),\"*10**-7 s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Time taken for light in axical mode is 1.5 *10**-7 s\n",
+ "(b) Time taken for light in highest order mode is 1.73 *10**-7 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 37.5 Page no 1007"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=0.5\n",
+ "b=50.0 #Km\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=10*math.log10(a)\n",
+ "B=A/b\n",
+ "\n",
+ "#Result\n",
+ "print\"Attenuation is\", round(B,2),\"dB/Km\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Attenuation is -0.06 dB/Km\n"
+ ]
+ }
+ ],
+ "prompt_number": 54
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap4.ipynb b/modern_physics_by_Satish_K._Gupta/chap4.ipynb
new file mode 100644
index 00000000..488631fb
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap4.ipynb
@@ -0,0 +1,397 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1087fb8dbcb5b183b8a1d36b431412b33d35209d5f6a3a237469594e817213fb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 Gauss theorem"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.1 Page no 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=25 #V/m\n",
+ "s=150*10**-4 #m**2\n",
+ "a=60 #degree\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=E*s*math.cos(a*3.14/180.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"Flux of the electric field is\",round(A,4),\"Nm**2/C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flux of the electric field is 0.1877 Nm**2/C\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.2 Page no 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=3*10**3 #N/C\n",
+ "S=10**-2 #m**2\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "a=E*S\n",
+ "A=E*S*math.cos(60*3.14/180.0)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Flux of the field is\",a,\"Nm**2/C\"\n",
+ "print\"(b) Flux through the square is\", round(A,0),\"Nm**2/C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Flux of the field is 30.0 Nm**2/C\n",
+ "(b) Flux through the square is 15.0 Nm**2/C\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.3 Page no 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "e=8.854*10**-12 #C**2/N/m**2\n",
+ "q=1 #C\n",
+ "\n",
+ "#Calculation\n",
+ "a=q/e\n",
+ "\n",
+ "#Result\n",
+ "print\"Number of electric lines are\",round(a*10**-11,3)*10**11"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of electric lines are 1.129e+11\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.4 Page no 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=8*10**3 #Nm**2/C\n",
+ "e=8.854*10**-12 #C**2/N/m**2\n",
+ "\n",
+ "#Calculation\n",
+ "q=a*e\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Net charge inside the box is\",q,\"C\"\n",
+ "print\"(b) If the net outward flux is zero,we can't conclude that the charge inside the box is zero.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Net charge inside the box is 7.0832e-08 C\n",
+ "(b) If the net outward flux is zero,we can't conclude that the charge inside the box is zero.\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.5 Page no 89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q=10**-5\n",
+ "e=8.854*10**-12\n",
+ "\n",
+ "#Calculation\n",
+ "a=q/(6.0*e)\n",
+ "\n",
+ "#Result\n",
+ "print\"Magnitude of electric flux is\", round(a*10**-5,2),\"*10**5 Nm**2/C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of electric flux is 1.88 *10**5 Nm**2/C\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.6 Page no 89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=9*10**4 #N/C\n",
+ "r=0.04 #m\n",
+ "m=9*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "l=E*r/(2.0*m)\n",
+ "\n",
+ "#Result\n",
+ "print\"Linear charge density is\", l,\"C/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Linear charge density is 2e-07 C/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.7 Page no 89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=5*10**-6 #C/m**2\n",
+ "e=8.854*10**-12 #C**2/Nm**2\n",
+ "r=0.1 #m\n",
+ "a1=60 #Degree\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=(a*math.pi*r**2*math.cos(a1*3.14/180.0))/(2.0*e)\n",
+ "\n",
+ "#Result\n",
+ "print\"Electric flux is\", round(A*10**-3,2),\"*10**3 N m**2/C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electric flux is 4.44 *10**3 N m**2/C\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.8 Page no 89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=17*10**-22 #C/m**2\n",
+ "e=8.854*10**-12\n",
+ "\n",
+ "#Calculation\n",
+ "E=a/e\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Electric field to the left of the plate is zero\"\n",
+ "print\"(b) Electric field to the right of the plate is zero\"\n",
+ "print\"(c) Electric field between the plates is\",round(E*10**10,2)*10**-10,\"N/C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Electric field to the left of the plate is zero\n",
+ "(b) Electric field to the right of the plate is zero\n",
+ "(c) Electric field between the plates is 1.92e-10 N/C\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.9 Page no 89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "q=1.6*10**-7 #C\n",
+ "R=0.12 #m\n",
+ "m=9*10**9\n",
+ "r=0.18\n",
+ "\n",
+ "#Calculation\n",
+ "E=(m*q)/R**2\n",
+ "E1=(m*q)/r**2\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) ELectric field inside the sphere is zero\"\n",
+ "print\"(b) Electric field outside the sphere is\",E,\"N/C\"\n",
+ "print\"(c) Electric field at a point 18 cm from the centre is\", round(E1*10**-4,2),\"*10**4 N/C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) ELectric field inside the sphere is zero\n",
+ "(b) Electric field outside the sphere is 100000.0 N/C\n",
+ "(c) Electric field at a point 18 cm from the centre is 4.44 *10**4 N/C\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4.11 Page no 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "e=50\n",
+ "V=0.2\n",
+ "m=9*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "q=e*V**2/m\n",
+ "\n",
+ "#Result\n",
+ "print\"Charge contained in the sphere is\",round(q*10**10,2)*10**-10,\"C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Charge contained in the sphere is 2.22e-10 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap5.ipynb b/modern_physics_by_Satish_K._Gupta/chap5.ipynb
new file mode 100644
index 00000000..84950cb9
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap5.ipynb
@@ -0,0 +1,1167 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:59a10421d0b18543bcaaf15fad8dcc2fa1ef98c5fe857c6feab5eddfb8fae6cd"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 Capacitor"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1 Page no 108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "r=6.4*10**6 #m\n",
+ "t=9*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "C=r/t\n",
+ "\n",
+ "#Result\n",
+ "print\"The capacitance is\",round(C*10**6,0),\"F\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The capacitance is 711.0 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "Example 5.2 Page no 108"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "r=0.01 #m\n",
+ "q=1 #C\n",
+ "d=9.0*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "V=(q*d)/r\n",
+ "\n",
+ "#Result\n",
+ "print\"V=\",V,\"V\"\n",
+ "print\"The given metal sphere will not be able to hold charge of 1 C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V= 9e+11 V\n",
+ "The given metal sphere will not be able to hold charge of 1 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3 Page no 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=3\n",
+ "Q=27\n",
+ "q=4*220\n",
+ "\n",
+ "#Calculation\n",
+ "d=(Q*q)/(4*R)\n",
+ "\n",
+ "#Result\n",
+ "print\"The potential of the bigger drop is\",d,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The potential of the bigger drop is 1980 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "Example 5.4 Page no 109"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C=2 #F\n",
+ "d=0.5*10**-2 #m\n",
+ "a=8.854*10**-12\n",
+ "\n",
+ "#Calculation\n",
+ "Q=(C*d)/a\n",
+ "\n",
+ "#Result\n",
+ "print\"Area of the plate is\", round(Q*10**-9,2),\"*10**9 m**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Area of the plate is 1.13 *10**9 m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5 Page no 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=10**-2 #m**2\n",
+ "d=10**-3 #m\n",
+ "q=0.12*10**-6\n",
+ "V=120.0\n",
+ "e=8.85*10**-12\n",
+ "\n",
+ "#Calculation\n",
+ "C=q/V\n",
+ "K=C*d/(e*A)\n",
+ "\n",
+ "#Result\n",
+ "print\"Dielectric constant of the material is\", round(K,1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dielectric constant of the material is 11.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6 Page no 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A1=100.0 #cm**2\n",
+ "A2=500 #cm**2\n",
+ "d1=0.05 #cm\n",
+ "\n",
+ "#Calculation\n",
+ "d2=(A2*d1)/A1\n",
+ "\n",
+ "#Result\n",
+ "print\"Difference between the plates of second capacitor is\", d2,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Difference between the plates of second capacitor is 0.25 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7 Page no 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=6.45*10**6 #m\n",
+ "b=6.4*10**6 #m\n",
+ "m=9*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "C=(a*b)/(m*(a-b))\n",
+ "\n",
+ "#Result\n",
+ "print\"Capacitance of the spherical capacitor is\",round(C,3),\"F\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance of the spherical capacitor is 0.092 F\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.8 Page no 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=12*10**-2 #m\n",
+ "b=13*10**-2 #m\n",
+ "q=2.5*10**-6 #C\n",
+ "K=32\n",
+ "m=9.0*10**9\n",
+ "\n",
+ "#Calculation\n",
+ "C=(K*a*b)/(m*(b-a))\n",
+ "V=q/C\n",
+ "C1=a/m\n",
+ "C2=C/C1\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Capacitance of the capacitor is\", round(C*10**9,3)*10**-9,\"F\"\n",
+ "print\"(b) Potential of the inner sphere is\", round(V,1),\"V\"\n",
+ "print\"(c) Capacitance of the capacitor is\",C2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Capacitance of the capacitor is 5.547e-09 F\n",
+ "(b) Potential of the inner sphere is 450.7 V\n",
+ "(c) Capacitance of the capacitor is 416.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.9 Page no 110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=1.4*10**-2 #m\n",
+ "b=1.5*10**-2 #m\n",
+ "q=3.5*10**-6 #C\n",
+ "e=8.854*10**-12\n",
+ "l=15*10**-2\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "C=(2*math.pi*e*l)/(2.303*math.log10(b/a))\n",
+ "V=q/C\n",
+ "\n",
+ "#Result\n",
+ "print\"Capacitance of the system is\", round(C*10**10,2)*10**-8,\"F\"\n",
+ "print\"Potential of the inner cylinder is\", round(V*10**-4,2),\"*10**4 V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance of the system is 1.21e-08 F\n",
+ "Potential of the inner cylinder is 2.89 *10**4 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.10 Page no 110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C=9.0*10**-12 #F\n",
+ "V=120 #V\n",
+ "\n",
+ "#Calculation\n",
+ "C1=1/(3/C)\n",
+ "q=(V*C)/3.0\n",
+ "V1=q/C\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Total capacitance is\",C1,\"F\"\n",
+ "print\"(b) Potential difference across each capacitor is\",V1,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Total capacitance is 3e-12 F\n",
+ "(b) Potential difference across each capacitor is 40.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.11 Page no 110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C1=2*10**-12 #F\n",
+ "C2=3*10**-12\n",
+ "C3=4*10**-12\n",
+ "V=100 #Volts\n",
+ "\n",
+ "#Calculation\n",
+ "C=C1+C2+C3\n",
+ "q1=C1*V\n",
+ "q2=C2*V\n",
+ "q3=C3*V\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Total capacitamce of the parallel combination is\",C,\"F\"\n",
+ "print\"(b) Charge on q1 is\",q1,\"C\"\n",
+ "print\"(c) Charge on q2 is\",q2,\"C\"\n",
+ "print\"(d) Charge on q3 is\",q3,\"C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Total capacitamce of the parallel combination is 9e-12 F\n",
+ "(b) Charge on q1 is 2e-10 C\n",
+ "(c) Charge on q2 is 3e-10 C\n",
+ "(d) Charge on q3 is 4e-10 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.12 Page no 110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "c1=5.0 #micro F\n",
+ "c2=4.0\n",
+ "c3=3.0\n",
+ "\n",
+ "#Calculation\n",
+ "C=1/(1/c1+1/c2)\n",
+ "c11=C+c3\n",
+ "\n",
+ "#Result\n",
+ "print\"Capacitance of the combination is\",round(c11,2),\"micro F\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance of the combination is 5.22 micro F\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.13 Page no 111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "cs=3 #micro F\n",
+ "cp=16\n",
+ "c1=12\n",
+ "\n",
+ "#Calculation\n",
+ "C=cs*cp\n",
+ "c2=cp-c1\n",
+ "\n",
+ "#Result\n",
+ "print\"Capacitance of each capacitor is\",c2,\"micro F\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance of each capacitor is 4 micro F\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.14 Page no 111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "c2=6.0 #micro F\n",
+ "c3=6.0\n",
+ "c1=12.0\n",
+ "c4=12.0\n",
+ "\n",
+ "#Calculation\n",
+ "c23=c2+c3\n",
+ "C=1/(1/c1+1/c23+1/c4)\n",
+ "\n",
+ "#Result\n",
+ "print\"resultant of capacitance is\",C,\"micro F\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "resultant of capacitance is 4.0 micro F\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.15 Page no 111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "c1=3.0 #pico F\n",
+ "c2=2.0\n",
+ "\n",
+ "#Calculation\n",
+ "C=1/(1/c1+1/c2+1/c1)\n",
+ "c11=C+c2\n",
+ "C11=1/(1/c1+1/c11+1/c1)\n",
+ "\n",
+ "#Result \n",
+ "print\"Resultant capacitance is\",round(C11,0),\"pF\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resultant capacitance is 1.0 pF\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.16 Page no 111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C2=2\n",
+ "C3=2\n",
+ "C1=1 #micro F\n",
+ "C4=2\n",
+ "C5=1\n",
+ "\n",
+ "#Calculation\n",
+ "C23=C2*C3/(C2+C3)\n",
+ "C123=C1+C23\n",
+ "C1234=C123*C4/(C123+C4)\n",
+ "C=C1234+C5\n",
+ "\n",
+ "#Ressult\n",
+ "print\"Equivalent capacitance is\", C,\"micro F\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent capacitance is 2 micro F\n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.17 Page no 112"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C5=10*10**-6 #micro F\n",
+ "C6=10*10**-6\n",
+ "C2=60.0*10**-6\n",
+ "C3=60.0*10**-6\n",
+ "C4=60.0*10**-6\n",
+ "C1=40*10**-6\n",
+ "V=100 #V\n",
+ "\n",
+ "#Calculation\n",
+ "C56=(C5+C6)\n",
+ "C234=1/(1/C2+1/C3+1/C4)\n",
+ "C=C56+C234\n",
+ "C11=(C1*C)/(C1+C)\n",
+ "q=C56*V\n",
+ "\n",
+ "#Result\n",
+ "print\"Total charge is\",q*10**3,\"*10**-3 C\"\n",
+ "print\"Equivalent capacitance is\",C11*10**6,\"micro F\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total charge is 2.0 *10**-3 C\n",
+ "Equivalent capacitance is 20.0 micro F\n"
+ ]
+ }
+ ],
+ "prompt_number": 75
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.19 Page no 113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C1=5.0*10**-6 #F\n",
+ "C2=10.0*10**-6\n",
+ "C3=2.0*10**-6\n",
+ "C4=4.0*10**-6\n",
+ "\n",
+ "#Calculation\n",
+ "C12=1/(1/C1+1/C2)\n",
+ "C34=1/(1/C3+1/C4)\n",
+ "C=C12+C34\n",
+ "\n",
+ "#Result\n",
+ "print\"Effective capacitance is\", round(C*10**6,2),\"micro F\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Effective capacitance is 4.67 micro F\n"
+ ]
+ }
+ ],
+ "prompt_number": 81
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.20 Page no 113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=3\n",
+ "C1=1.0\n",
+ "C2=1.0\n",
+ "C3=1.0\n",
+ "C=2 #micro F\n",
+ "\n",
+ "#Calculation\n",
+ "C11=1/(1/C1+1/C2+1/C3)\n",
+ "m=C/C11\n",
+ "\n",
+ "#Result\n",
+ "print\"Capacitance required is\", m"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance required is 6.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 84
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.21 Page no 113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C1=4\n",
+ "V=6\n",
+ "C2=6\n",
+ "\n",
+ "#Calculation\n",
+ "q1=C1*V\n",
+ "q2=C2*V\n",
+ "\n",
+ "#Result\n",
+ "print\"Charge on C1 is\",q1,\"micro C\"\n",
+ "print\"Charge on C2 is\",q2,\"micro C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Charge on C1 is 24 micro C\n",
+ "Charge on C2 is 36 micro C\n"
+ ]
+ }
+ ],
+ "prompt_number": 88
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.22 Page no 114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C2=5 #micro F\n",
+ "C3=5 \n",
+ "a=6\n",
+ "C1=10\n",
+ "V=3\n",
+ "\n",
+ "#Calculation\n",
+ "C23=C2+C3\n",
+ "V1=a/2.0\n",
+ "q1=C1*V\n",
+ "q23=C23*V\n",
+ "q3=q23/2.0\n",
+ "\n",
+ "#Result\n",
+ "print\"Charge on capacitor C1 is\",q1,\"micro F\"\n",
+ "print\"Charge on capacitor C2 is\",q23,\"micro F\"\n",
+ "print\"Charge on capacitor C3 is\",q3,\"micro F\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Charge on capacitor C1 is 30 micro F\n",
+ "Charge on capacitor C2 is 30 micro F\n",
+ "Charge on capacitor C3 is 15.0 micro F\n"
+ ]
+ }
+ ],
+ "prompt_number": 94
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.23 Page no 114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C1=4*10**-6 #F\n",
+ "V1=400 #V\n",
+ "C2=2*10**-6\n",
+ "q2=0\n",
+ "\n",
+ "#Calculation\n",
+ "q1=C1*V1\n",
+ "C=C1+C2\n",
+ "q=q1+q2\n",
+ "V=q/C\n",
+ "\n",
+ "#Result\n",
+ "print\"Common potential is\", round(V,2),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Common potential is 266.67 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 101
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.24 Page no 114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=12\n",
+ "C1=8 #micro F\n",
+ "C2=4\n",
+ "\n",
+ "#Calculation\n",
+ "Va=V-C2\n",
+ "Vb=V-C1\n",
+ "V1=Va-Vb\n",
+ "\n",
+ "#Result\n",
+ "print\"Potential difference is\", V1,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Potential difference is 4 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 105
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.25 Page no 114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=90*10**-4 #m**2\n",
+ "d=2.5*10**-3 #m\n",
+ "V=400 #Volts\n",
+ "e=8.854*10**-12\n",
+ "\n",
+ "#Calculation\n",
+ "C=(e*A)/d\n",
+ "W=(C*V**2)/2.0\n",
+ "\n",
+ "#Result\n",
+ "print\"Electrostatic energy is\", round(W*10**6,2)*10**-6,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electrostatic energy is 2.55e-06 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 112
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.26 Page no 114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C=2000*10**-6 \n",
+ "V=1.5 #V\n",
+ "t=10.0**-4 #s\n",
+ "\n",
+ "#Calculation\n",
+ "U=(C*V**2)/2.0\n",
+ "P=U/t\n",
+ "\n",
+ "#Result\n",
+ "print\"Energy stored in the capacitor is\", U*10**3,\"*10**-3 J\"\n",
+ "print\"Power of the flash is\",P,\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy stored in the capacitor is 2.25 *10**-3 J\n",
+ "Power of the flash is 22.5 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 119
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.27 Page no 115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "C1=4*10**-6\n",
+ "V1=200 #V\n",
+ "C2=2*10**-6 # F\n",
+ "\n",
+ "#Calculation\n",
+ "U1=(C1*V1**2)/2.0\n",
+ "q=C1*V1\n",
+ "C=C1+C2\n",
+ "V=q/C\n",
+ "U2=(C*V**2)/2.0\n",
+ "U=U1-U2\n",
+ "\n",
+ "#Result\n",
+ "print\"Electrostatic energy is\",round(U*10**2,2),\"*10**-2 J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electrostatic energy is 2.67 *10**-2 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 129
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.28 Page no 115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "K=6.0\n",
+ "C=17.7*10**-12 #F\n",
+ "V=100\n",
+ "\n",
+ "#Calculation\n",
+ "C1=K*C\n",
+ "q=C1*V\n",
+ "V1=V/K\n",
+ "q1=C1*V1\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Charge on capacitor is\", q,\"C\"\n",
+ "print\"(b) Charge on capacitor is\", q1,\"C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Charge on capacitor is 1.062e-08 C\n",
+ "(b) Charge on capacitor is 1.77e-09 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 135
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.29 Page no 115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "K=3\n",
+ "e=8.854*10**-12 #C**2/N/m**2\n",
+ "C=50*10**-12 #F\n",
+ "a=10**7 #V/m\n",
+ "b=10\n",
+ "V=10**3\n",
+ "\n",
+ "#Calculation\n",
+ "E=(a*b)/100.0\n",
+ "q=C*V\n",
+ "A=q/(e*K*E)\n",
+ "\n",
+ "#Result\n",
+ "print\"Minimum area is\", round(A*10**4,1),\"cm**2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum area is 18.8 cm**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 140
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.30 Page no 115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=15*10**5 #V\n",
+ "E=5.0*10**7 #V/m\n",
+ "\n",
+ "#Calculation\n",
+ "r=V/E\n",
+ "\n",
+ "#Result\n",
+ "print\"Minimum radius of the spherical shell is\", r*10**2,\"cm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum radius of the spherical shell is 3.0 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 144
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap6.ipynb b/modern_physics_by_Satish_K._Gupta/chap6.ipynb
new file mode 100644
index 00000000..2c3272c0
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap6.ipynb
@@ -0,0 +1,1695 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9ba957b16289f27dba06e59c72667002157ed6d6f12727710ff725257f8649eb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 Current electricity"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.1 Page no 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I=300*10**-3\n",
+ "e=1.6*10**-19 #C\n",
+ "t=60 #S\n",
+ "\n",
+ "#Calculation\n",
+ "q=I*t\n",
+ "n=q/e\n",
+ "\n",
+ "#Result\n",
+ "print\"Number of electron passed is\", n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of electron passed is 1.125e+20\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.2 Page no 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "e=1.6*10**-19 #C\n",
+ "v=6.8*10**15 #revolution/s\n",
+ "r=0.51*10**-10 #m\n",
+ "\n",
+ "#Calculation\n",
+ "I=e*v\n",
+ "\n",
+ "#Result\n",
+ "print\"Equivalent current is\", I*10**3,\"*10**-3 A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent current is 1.088 *10**-3 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3 Page no 191 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I=10 #A\n",
+ "n=9*10**28 #/m**3\n",
+ "A=10.0**-4 #m**2\n",
+ "e=1.6*10**-19\n",
+ "\n",
+ "#Calculation\n",
+ "Vd=I/(n*e*A)\n",
+ "\n",
+ "#Result\n",
+ "print\"Drift velocity is\", round(Vd*10**6,2)*10**-6,\"m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drift velocity is 6.94e-06 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.4 Page no 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=8.5*10**28 #/m**3\n",
+ "I=3 #A\n",
+ "A=2.0*10**-6 #m**2\n",
+ "l=3 #m\n",
+ "e=1.6*10**-19\n",
+ "\n",
+ "#Calculation\n",
+ "Vd=I/(n*e*A)\n",
+ "t=I/Vd\n",
+ "\n",
+ "#Result\n",
+ "print\"Drift velocity of the electron is\", round(Vd*10**4,3),\"*10**-4 m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drift velocity of the electron is 1.103 *10**-4 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.5 Page no 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=10**-7 #m**2\n",
+ "I=1 #A\n",
+ "K=6.023*10**23\n",
+ "w=63.5\n",
+ "d=9*10**3 #Kg/m**3\n",
+ "\n",
+ "#Calculation\n",
+ "a=(K/w)*1000\n",
+ "n=a*d\n",
+ "Vd=I/(n*e*A)\n",
+ "\n",
+ "#Result\n",
+ "print\"Average drift velocity is\", round(Vd*10**4,2),\"*10**-4 m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average drift velocity is 7.32 *10**-4 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.6 Page no 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=5 #Volt\n",
+ "l=0.1 #m\n",
+ "vd=2.5*10**-4 #m/s\n",
+ "\n",
+ "#Calculation\n",
+ "E=V/l\n",
+ "u=vd/E\n",
+ "\n",
+ "#Result\n",
+ "print\"Electron mobility is\", u,\"m**2/V/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electron mobility is 5e-06 m**2/V/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.7 Page no 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=3 #Volt\n",
+ "l=0.2 #m\n",
+ "A=10**-6 #m**2\n",
+ "n=8.5*10**28 #/m**3\n",
+ "u=4.5*10**-6 #m**2/V/s\n",
+ "e=1.6*10**-19\n",
+ "\n",
+ "#Calculation\n",
+ "E=V/l\n",
+ "I=n*A*u*E*e\n",
+ "\n",
+ "#Result\n",
+ "print\"Current through the wire is\",round(I,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through the wire is 0.92 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.8 Page no 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I=1.8 #A\n",
+ "A=0.5*10**-6 #m**2\n",
+ "n=8.8*10**28\n",
+ "e=1.6*10**-19\n",
+ "\n",
+ "#Calculation\n",
+ "j=I/A\n",
+ "vd=j/(n*e)\n",
+ "\n",
+ "#Result\n",
+ "print\"Drift velocity is\", round(vd*10**4,2),\"*10**-4 m/s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drift velocity is 2.56 *10**-4 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.9 Page no 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=1.5 #V\n",
+ "n=8.4*10**28 #/m**3\n",
+ "l=0.2 #m\n",
+ "A=0.3*10**-6 #m**2\n",
+ "I=2.4 #A\n",
+ "m=9.1*10**-31 #Kg\n",
+ "e=1.6*10**-19\n",
+ "\n",
+ "#Calculation\n",
+ "E=V/l\n",
+ "j=I/A\n",
+ "t=m*j/(n*e**2*E)\n",
+ "\n",
+ "#Result\n",
+ "print\"Average relaxation time is \", round(t*10**16,2)*10**-16,\"s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average relaxation time is 4.51e-16 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 53
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.10 Page no 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=200 #V\n",
+ "R=100.0 #ohm\n",
+ "t=1\n",
+ "\n",
+ "#Calculation\n",
+ "I=V/R\n",
+ "q=I*t\n",
+ "n=q/e\n",
+ "\n",
+ "#Result\n",
+ "print\"Number of electrons is\", n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of electrons is 1.25e+19\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.11 Page no 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=2 #ohm\n",
+ "l=1 #m\n",
+ "d=4*10**-4 #m\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=(math.pi*d**2)/4.0\n",
+ "a=(R*A)/l\n",
+ "\n",
+ "#Result\n",
+ "print\"Resistivity of the material is\", round(a*10**7,3)*10**-7,\"ohm m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistivity of the material is 2.513e-07 ohm m\n"
+ ]
+ }
+ ],
+ "prompt_number": 62
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.12 Page no 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=0.45 #Kg\n",
+ "R=0.14 #ohm\n",
+ "a=1.78*10**-8 #ohm m\n",
+ "l=1.99\n",
+ "d=8.93*10**3\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "l=(math.sqrt(R*m/(a*d)))/10.0\n",
+ "r=math.sqrt(m/(math.pi*l*d))\n",
+ "\n",
+ "#Result\n",
+ "print\"Radius is\", round(r*10**3,2),\"mm\"\n",
+ "print\"Length is\", round(l,2),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radius is 2.84 mm\n",
+ "Length is 1.99 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 76
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.13 Page no 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=5\n",
+ "\n",
+ "#Calculation\n",
+ "R1=4*R\n",
+ "\n",
+ "#Result\n",
+ "print\"New resistance is\",R1,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "New resistance is 20 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 78
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.14 Page no 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "l=3\n",
+ "A=0.02*10**-6 #m**2\n",
+ "R=2 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "a=l/(R*A)\n",
+ "\n",
+ "#Result\n",
+ "print\"Electrical conductivity is\", a*10**-7,\"*10**7 S/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electrical conductivity is 7.5 *10**7 S/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 82
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.15 Page no 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=1.8 #V\n",
+ "I=1.2 #A\n",
+ "l=3 #m\n",
+ "A=5.4*10**-6 #m**2\n",
+ "\n",
+ "#Calculation\n",
+ "R=V/I\n",
+ "G=1/R\n",
+ "a=l/(R*A)\n",
+ "\n",
+ "#Result\n",
+ "print\"Conductance is\",round(G,2),\"S\"\n",
+ "print\"Conductivity is\", round(a*10**-5,1),\"*10**5 S/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Conductance is 0.67 S\n",
+ "Conductivity is 3.7 *10**5 S/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 92
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.16 Page no 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=2.1 #ohm\n",
+ "a1=300.0 #K\n",
+ "a2=373.0\n",
+ "R2=2.7 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "A=(R2-R1)/(R1*(a2-a1))\n",
+ "\n",
+ "#Result\n",
+ "print\"Temperature coefficient is\", round(A*10**3,3),\"*10**-3 /K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature coefficient is 3.914 *10**-3 /K\n"
+ ]
+ }
+ ],
+ "prompt_number": 99
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.17 Page no 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a1=50 #degree\n",
+ "R1=6.0 #ohm\n",
+ "a2=100 #degree\n",
+ "R=7 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "a=(R-R1)/(R1*(a2-a1))\n",
+ "R0=R1/(1+(a*a1))\n",
+ "\n",
+ "#Result\n",
+ "print\"Mean temperature coefficient is\", round(a,4),\"degree/C\"\n",
+ "print\"Resistance of the conductor is\",round(R0,3),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean temperature coefficient is 0.0033 degree/C\n",
+ "Resistance of the conductor is 5.143 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 110
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.18 Page no 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=230 #v\n",
+ "a=27 #degree C\n",
+ "I1=3.2 #A\n",
+ "I2=2.8 #A\n",
+ "a1=1.70*10**-4 #degree/C\n",
+ "\n",
+ "#Calculation\n",
+ "R1=V/I1\n",
+ "R2=V/I2\n",
+ "a2=a+((R2-R1)/(R1*a1))\n",
+ "\n",
+ "#Result\n",
+ "print\"Steady temperature is\", round(a2,2),\"degree C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Steady temperature is 867.34 degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 117
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.21 Page no 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=1 #ohm\n",
+ "R2=2 \n",
+ "R3=3\n",
+ "E=12 #V\n",
+ "\n",
+ "#Calculation\n",
+ "Rs=R1+R2+R3\n",
+ "I=E/Rs\n",
+ "R11=I*R1\n",
+ "R12=I*R2\n",
+ "R13=I*R3\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Total resistance of the combination is\",Rs,\"ohm\"\n",
+ "print\"(b) Potential drop across R1 is\",R11,\"V\"\n",
+ "print\" Potential drop across R2 is\",R12,\"V\"\n",
+ "print\" Potential drop across R3 is\",R13,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Total resistance of the combination is 6 ohm\n",
+ "(b) Potential drop across R1 is 2 V\n",
+ " Potential drop across R2 is 4 V\n",
+ " Potential drop across R3 is 6 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 125
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.22 Page no 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=2.0 #ohm\n",
+ "R2=4.0 #ohm\n",
+ "R3=5.0 \n",
+ "E=20 #V\n",
+ "\n",
+ "#calculation\n",
+ "Rp=1/(1/R1+1/R2+1/R3)\n",
+ "I=E/Rp\n",
+ "I1=E/R1\n",
+ "I2=E/R2\n",
+ "I3=E/R3\n",
+ "\n",
+ "print\"(a) Toatl resisatnce is\", round(Rp,2),\"ohm\"\n",
+ "print\"(b) Current through R1 is\",I1,\"A\"\n",
+ "print\"Current through R2 is\",I2,\"A\"\n",
+ "print\"Current through R3 is\",I3,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Toatl resisatnce is 1.05 ohm\n",
+ "(b) Current through R1 is 10.0 A\n",
+ "Current through R2 is 5.0 A\n",
+ "Current through R3 is 4.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 134
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.24 Page no 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=6\n",
+ "R1=2.0\n",
+ "\n",
+ "#calculation\n",
+ "n=R/R1\n",
+ "\n",
+ "#Result\n",
+ "print\"Number of resistance is\",n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of resistance is 3.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 135
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.25 Page no 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=9.0 #ohm\n",
+ "R2=5.0\n",
+ "R3=3.0\n",
+ "R4=7.0\n",
+ "\n",
+ "#Calculation\n",
+ "R11=R1+R2\n",
+ "R22=R3+R4\n",
+ "R=1/(1/R11+1/R22+1/R22)\n",
+ "\n",
+ "#Result\n",
+ "print\"Equivalent resistance is\",round(R,2),\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent resistance is 3.68 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 141
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.26 Page no 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=3 #ohm\n",
+ "R2=3\n",
+ "\n",
+ "#Calculation\n",
+ "R11=R1+R2\n",
+ "R22=(R11*R11)/(R11+R11)\n",
+ "R=R11*R1/(R11+R1)\n",
+ "\n",
+ "#Result\n",
+ "print\"Effective resistance is\", R,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Effective resistance is 2 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 148
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.27 Page no 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=30.0 #ohm\n",
+ "R2=30.0\n",
+ "E=2 #V\n",
+ "\n",
+ "#Calculation\n",
+ "R11=R1+R2\n",
+ "R=R11*R1/(R11+R1)\n",
+ "I=E/R\n",
+ "\n",
+ "#Result\n",
+ "print\"Current through the cell is\",I,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through the cell is 0.1 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 151
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.28 Page no 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Rl=500.0 #ohm\n",
+ "E=50 #V\n",
+ "Rac=2000.0 #ohm\n",
+ "Rab=500.0 \n",
+ "\n",
+ "#Calculation\n",
+ "Rbc=Rac-Rab\n",
+ "R11=1/(1/Rbc+1/Rl)\n",
+ "I=E/(Rab+R11)\n",
+ "V=E-(I*Rab)\n",
+ "I1=E/Rac\n",
+ "Rbc1=40/I1\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Potential difference across the load is\", round(V,2),\"V\"\n",
+ "print\"(b) Resistance is\",Rbc1,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Potential difference across the load is 21.43 V\n",
+ "(b) Resistance is 1600.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 165
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.29 Page no 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=3 #ohm\n",
+ "E=9 #V\n",
+ "\n",
+ "#Calcuation\n",
+ "R=R1+R1+R1\n",
+ "I=E/R\n",
+ "I1=I/4.0\n",
+ "\n",
+ "#Result\n",
+ "print\"Total resistance is\",R,\"ohm\"\n",
+ "print\"Current is\",I1,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total resistance is 9 ohm\n",
+ "Current is 0.25 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 169
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.30 Page no 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=1 #ohm\n",
+ "R2=1 \n",
+ "r=2/3.0 #ohm\n",
+ "E=1 #V\n",
+ "\n",
+ "#Calculation\n",
+ "R11=R1*R2/(R1+R2)\n",
+ "R=1/(1/R1+1/R2+1/R1)\n",
+ "I=E/(R+r)\n",
+ "\n",
+ "#Result\n",
+ "print\"Current drawn from the cell is\", I,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn from the cell is 1.5 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 174
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.31 Page no 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=10.0 #ohm\n",
+ "r=3.33\n",
+ "E=15\n",
+ "\n",
+ "#Calculation\n",
+ "Rp=1/(1/R+(1/(R+R)))\n",
+ "R1=R+Rp+R\n",
+ "I=E/(R1+r)\n",
+ "V=I*Rp\n",
+ "I1=V/(R+R)\n",
+ "I2=V/R\n",
+ "\n",
+ "#Result\n",
+ "print\"Current flow through the main circuit is\", round(I,1),\"A\"\n",
+ "print\"Current through QRS is\",round(I1,3),\"A\"\n",
+ "print\"Current through QS is\",round(I2,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current flow through the main circuit is 0.5 A\n",
+ "Current through QRS is 0.167 A\n",
+ "Current through QS is 0.333 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 199
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.32 Page no 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=2 #ohm\n",
+ "R2=3 \n",
+ "R3=2.8\n",
+ "E=6 #V\n",
+ "\n",
+ "#calculation\n",
+ "R=(R1*R2/(R1+R2))+R3\n",
+ "I=E/R\n",
+ "\n",
+ "#Result\n",
+ "print\"Current in steady state is\", round(I,1),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in steady state is 1.6 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 206
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.33 Page no 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=10 #v\n",
+ "r=3 #ohm\n",
+ "I=0.5 #A\n",
+ "\n",
+ "#Calculation\n",
+ "R=(E/I)-r\n",
+ "V=I*R\n",
+ "\n",
+ "#Result\n",
+ "print\"Resistance of the resistor is\", R,\"ohm\"\n",
+ "print\"Terminal voltage is\",V,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance of the resistor is 17.0 ohm\n",
+ "Terminal voltage is 8.5 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 212
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.35 Page no 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=3.0 #ohm\n",
+ "R2=4.0\n",
+ "R3=6.0\n",
+ "r=2/3.0\n",
+ "E=2 #V\n",
+ "\n",
+ "#Calculation\n",
+ "Rp=1/(1/R1+1/R2+1/R3)\n",
+ "R=Rp+r\n",
+ "I=E/R\n",
+ "V=I*Rp\n",
+ "I1=V/R1\n",
+ "\n",
+ "#Result\n",
+ "print\"Current drawn from the cell is\", I,\"A\"\n",
+ "print\"Current through 3 Ohm resistance is\",round(I1,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn from the cell is 1.0 A\n",
+ "Current through 3 Ohm resistance is 0.44 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.36 Page no 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=8\n",
+ "R=3.0\n",
+ "r=1.0\n",
+ "\n",
+ "#Calculation\n",
+ "I=E/(R+r)\n",
+ "I1=I/2.0\n",
+ "\n",
+ "#Result\n",
+ "print\"Current from the battery is\",I,\"A\"\n",
+ "print\"Current through AC and ABC is\",I1,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current from the battery is 2.0 A\n",
+ "Current through AC and ABC is 1.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.37 Page no 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=12 #V\n",
+ "R2=8 #ohm\n",
+ "r=1 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "R1=-((E/I)-R2-r)\n",
+ "\n",
+ "#Result\n",
+ "print\"Value of resistance is\", R1,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of resistance is 3.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.38 Page no 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E1=20 #V\n",
+ "r1=1 #ohm\n",
+ "E2=8 #Volt\n",
+ "r2=2 #ohm\n",
+ "R1=12.0\n",
+ "R2=6.0\n",
+ "R3=4.0\n",
+ "\n",
+ "#Calculation\n",
+ "E=E1-E2\n",
+ "R11=1/(1/R1+1/R2+1/R3)\n",
+ "R=R11+r1+r2+5\n",
+ "I=E/R\n",
+ "I1=I-1\n",
+ "V1=E1-(I*r1)\n",
+ "V2=E2+(I*r2)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Current in the circuit is\", I,\"A\"\n",
+ "print\"(b) Current in the resister is\", I1,\"A\"\n",
+ "print\"(c) Potential difference across 12 V battery is\", V1,\"V\"\n",
+ "print\" Potential difference across 8 V battery is\",V2,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Current in the circuit is 1.2 A\n",
+ "(b) Current in the resister is 0.2 A\n",
+ "(c) Potential difference across 12 V battery is 18.8 V\n",
+ " Potential difference across 8 V battery is 10.4 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.39 Page no 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=2 #V\n",
+ "r=0.015 #ohm\n",
+ "R=8.5\n",
+ "\n",
+ "#Calculation\n",
+ "E1=E*6\n",
+ "r1=r*6\n",
+ "I=E1/(R+r1)\n",
+ "V=I*R\n",
+ "\n",
+ "#Result\n",
+ "print\"Current drawn from the supply is\", round(I,3),\"A\"\n",
+ "print\"Terminal voltage is\",round(V,3),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn from the supply is 1.397 A\n",
+ "Terminal voltage is 11.874 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.40 Page no 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=4 #V\n",
+ "I=1.5 #A\n",
+ "R=6 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "E1=3*E\n",
+ "r=((E1/I)-R)/3.0\n",
+ "V=E-(I*r)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Internal resistance is\", round(r,2),\"ohm\"\n",
+ "print\"(b) Terminal voltage is\",V,\"Volt\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Internal resistance is 0.67 ohm\n",
+ "(b) Terminal voltage is 3.0 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.41 Page no 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=15.0 #ohm\n",
+ "R2=15.0\n",
+ "E=2\n",
+ "V=1.6\n",
+ "\n",
+ "#Calculation\n",
+ "R=R1*R2/(R1+R2)\n",
+ "r=(((E/V)-1)*R)*4\n",
+ "\n",
+ "#Result\n",
+ "print\"Internal resistance is\", r,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Internal resistance is 7.5 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 53
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.42 Page no 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=1\n",
+ "a=2\n",
+ "\n",
+ "#Calculation\n",
+ "r=(a*E*(a-E))/(a*E*(a-E))\n",
+ "\n",
+ "#Result\n",
+ "print\"The internal resistance is\",r,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The internal resistance is 1 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 66
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.43 Page no 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=2 #V\n",
+ "r=1.5 #ohm\n",
+ "R=10 #ohm\n",
+ "r1=1.5\n",
+ "r2=1.5\n",
+ "\n",
+ "#Calculation\n",
+ "E1=2*E\n",
+ "w=r1+r2\n",
+ "A=1/(1/w+1/w)\n",
+ "B=R+A\n",
+ "I=E1/B\n",
+ "IR=I*R\n",
+ "\n",
+ "#Result\n",
+ "print\"The potential difference across external resistance is\",round(IR,2),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The potential difference across external resistance is 3.48 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 63
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.44 Page no 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "n=2.7*10**18\n",
+ "N=1.0*10**18\n",
+ "e=1.6*10**-19\n",
+ "V=230 #V\n",
+ "\n",
+ "#Calculation\n",
+ "I=(n+N)*(e)\n",
+ "R=V/I\n",
+ "\n",
+ "#Result\n",
+ "print\"The effective resistance of the tube is\",round(R,1),\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The effective resistance of the tube is 388.5 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 73
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.47 Page no 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "X=1\n",
+ "a=3\n",
+ "E1=12\n",
+ "r=0.5\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "X1=X+math.sqrt(a)\n",
+ "I=E1/(X1+r)\n",
+ "\n",
+ "#Result\n",
+ "print\"Current drawn is\", round(I,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn is 3.713 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 99
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.48 Page no 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=6\n",
+ "R2=3.0\n",
+ "R3=5\n",
+ "E=24 #V\n",
+ "I=3 #A\n",
+ "\n",
+ "#Calculation\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "R=R3+Rp+r\n",
+ "r=R-(R3+Rp)\n",
+ "V=I*Rp\n",
+ "I1=V/R1\n",
+ "I2=V/R2\n",
+ "R11=R2+R3+r\n",
+ "I11=E/R11\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Internal resistance is\", r,\"ohm\"\n",
+ "print\" Current I1 is\",I1,\"A and I2 is\",I2,\"A\"\n",
+ "print\"(b) Current in the circuit is\",round(I11,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Internal resistance is 1.0 ohm\n",
+ " Current I1 is 1.0 A and I2 is 2.0 A\n",
+ "(b) Current in the circuit is 2.67 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 91
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap7.ipynb b/modern_physics_by_Satish_K._Gupta/chap7.ipynb
new file mode 100644
index 00000000..0476eb75
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap7.ipynb
@@ -0,0 +1,832 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3ec304c8c9eb23fdd2ae23967a8effd62df3acdefa633ca8bf2a83485250a21b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 Electrical Measurements"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1 Page no 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=2\n",
+ "R2=3\n",
+ "R3=5\n",
+ "E1=6\n",
+ "E2=4\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=np.array([[7,5],[5,8]])\n",
+ "b=np.array([6,4])\n",
+ "z=np.linalg.solve(A,b)\n",
+ "Z=z[0]\n",
+ "Z1=z[1]\n",
+ "A1=Z+Z1\n",
+ "\n",
+ "#Result\n",
+ "print\"Current through R1 is\", round(Z,3),\"A\"\n",
+ "print\"Current through R2 is\", round(Z1,3),\"A\"\n",
+ "print\"Current through R3 is\",round(A1,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through R1 is 0.903 A\n",
+ "Current through R2 is -0.065 A\n",
+ "Current through R3 is 0.84 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2 Page no 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E1=1.5 #V\n",
+ "E2=2.0 #V\n",
+ "r1=1 #ohm\n",
+ "r2=2 #ohm\n",
+ "R=5 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=np.array([[6,5],[5,7]])\n",
+ "B=np.array([1.5,2])\n",
+ "Z=np.linalg.solve(A,B)\n",
+ "Z1=Z[0]\n",
+ "Z2=Z[1]\n",
+ "A1=(Z1+Z2)*R\n",
+ "\n",
+ "#Result\n",
+ "print\"Current through R1 is\", round(Z1,4),\"A\"\n",
+ "print\"Current through R2 is\",round(Z2,4),\"A\"\n",
+ "print\"Current through R3 is\",round(A1,4),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through R1 is 0.0294 A\n",
+ "Current through R2 is 0.2647 A\n",
+ "Current through R3 is 1.4706 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3 Page no 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E1=2 #V\n",
+ "E2=1 #V\n",
+ "E3=4 #V\n",
+ "r1=4 #ohm\n",
+ "r2=3 #ohm\n",
+ "r3=2 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=np.array([[1,1,1],[4,-3,0],[0,3,-2]])\n",
+ "A1=np.array([0,1,-3])\n",
+ "Z=np.linalg.solve(A,A1)\n",
+ "Z1=Z[0]\n",
+ "Z2=Z[1]\n",
+ "Z3=Z[2]\n",
+ "\n",
+ "#Result\n",
+ "print\"Current through R1 is\", round(Z1,2),\"A\"\n",
+ "print\"Current through R2 is\",round(Z2,2),\"A\"\n",
+ "print\"Current through R3 is\",round(Z3,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through R1 is -0.15 A\n",
+ "Current through R2 is -0.54 A\n",
+ "Current through R3 is 0.69 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4 Page no 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=5 #ohm\n",
+ "R3=2 \n",
+ "R=10\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=np.array([[9,5],[10,19]])\n",
+ "A1=np.array([1,1])\n",
+ "Z=np.linalg.solve(A,A1)\n",
+ "Z1=Z[0]\n",
+ "Z2=Z[1]\n",
+ "I=(Z1+Z2)*R\n",
+ "\n",
+ "#Result\n",
+ "print\"Potential difference across the resistor is\", round(I,4),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Potential difference across the resistor is 1.0744 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5 Page no 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "A=10 #ohm\n",
+ "B=5 #ohm\n",
+ "S=2\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=np.array([[25,-10],[5,5]])\n",
+ "B=np.array([9,7]) \n",
+ "Z=np.linalg.solve(A,B)\n",
+ "Z1=Z[1]*10\n",
+ "\n",
+ "#Result\n",
+ "print\"Equivalent resistance is\", round(Z1,0),\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent resistance is 7.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.6 Page no 231 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P=15 #ohm\n",
+ "Q=12.0\n",
+ "R=10.0\n",
+ "S=4\n",
+ "\n",
+ "#Calculation\n",
+ "R1=S*(P/Q)\n",
+ "X=1/(1/R1-1/R)\n",
+ "\n",
+ "#Result\n",
+ "print\"The resistance to be connectedin parallel is\",X,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistance to be connectedin parallel is 10.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.7 Page no 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P=4.0\n",
+ "Q=4.0\n",
+ "R=4.0\n",
+ "X=4.0\n",
+ "\n",
+ "#Calculation\n",
+ "R1=P+Q\n",
+ "R2=R+X\n",
+ "R3=1/(1/R1+1/R2)\n",
+ "I=P/R3\n",
+ "I1=I/2\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Equivalent resistance is\",R3,\"ohm\"\n",
+ "print\"(ii) The magnitudes of current is\",I1,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Equivalent resistance is 4.0 ohm\n",
+ "(ii) The magnitudes of current is 0.5 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.8 Page no 232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=4\n",
+ "b=3\n",
+ "c=2.0\n",
+ "E=6 #v\n",
+ "\n",
+ "#Calculation\n",
+ "X=(a*b)/c\n",
+ "R1=a+c\n",
+ "R2=b+R1\n",
+ "R=((R1*R2)/(R1+R2))+2.4\n",
+ "I=E/R\n",
+ "\n",
+ "#Result\n",
+ "print\"Current drawn by the circuit is\", I,\"A\"\n",
+ "print\"Unknown resistance is\",R,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn by the circuit is 1.0 A\n",
+ "Unknown resistance is 6.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.9 Page no 232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=1.5\n",
+ "b=5\n",
+ "c=6\n",
+ "\n",
+ "#Calculation\n",
+ "I1=a/(b+c)\n",
+ "I2=I1/10.0\n",
+ "I=I1+I2\n",
+ "\n",
+ "#Result\n",
+ "print\"Current in the arms is\", round(I1,4),\"A and\",round(I2,4),\"A\"\n",
+ "print\"Current in the cell is\",I,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in the arms is 0.1364 A and 0.0136 A\n",
+ "Current in the cell is 0.15 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 68
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.10 Page no 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "X=10\n",
+ "P=3\n",
+ "Q=2.0\n",
+ "\n",
+ "#Calculation\n",
+ "R=X*P/Q\n",
+ "L=1/R\n",
+ "\n",
+ "#Result\n",
+ "print\"Length is\",round(L,3),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Length is 0.067 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.11 Page no 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "r=6 #ohm\n",
+ "l=1/3.0\n",
+ "r1=2/3.0\n",
+ "\n",
+ "#Calculation\n",
+ "R1=r/((2.0*(r1/l))-1)\n",
+ "R2=2*R1\n",
+ "\n",
+ "#Result\n",
+ "print\"Resistance of two wires is\", R1,\"ohm and\",R2,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance of two wires is 2.0 ohm and 4.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 76
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.12 Page no 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P=1.2 #ohm\n",
+ "Q=0.8\n",
+ "R=2\n",
+ "E=4 #V\n",
+ "\n",
+ "#Calculation\n",
+ "X=(R*P)/Q\n",
+ "R1=X+R\n",
+ "R2=P+Q\n",
+ "R11=R1*R2/(R1+R2)\n",
+ "I=E/R11\n",
+ "\n",
+ "#Result\n",
+ "print\"Unknown resistance is\", X,\"ohm\"\n",
+ "print\"Current drawn is\",I,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Unknown resistance is 3.0 ohm\n",
+ "Current drawn is 2.8 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 83
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.13 Page no 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=20.0 #ohm\n",
+ "V=10**-3 #V/m\n",
+ "l=10**4 #mm\n",
+ "V1=10**-2 #V\n",
+ "\n",
+ "#Calculation\n",
+ "I=V1/R\n",
+ "R1=(2/I)-R\n",
+ "\n",
+ "#Result\n",
+ "print\"Value of resistance is\", R1,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of resistance is 3980.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 87
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.14 Page no 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "l1=65 #cm\n",
+ "l2=60.0\n",
+ "a=0.1\n",
+ "\n",
+ "#Calculation\n",
+ "E1=((a*l1)/l2)/((l1/l2)-1)\n",
+ "E2=E1-a\n",
+ "\n",
+ "#Result\n",
+ "print\"E.m.f of cell is\", E1,\"V and\",E2,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "E.m.f of cell is 1.3 V and 1.2 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 93
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.15 Page no 234"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "S=9.5 #ohm\n",
+ "I1=76.3 #cm\n",
+ "l2=64.8\n",
+ "\n",
+ "#Calculation\n",
+ "r=((I1/I2)-1)*S\n",
+ "\n",
+ "#Result\n",
+ "print\"Internal resistance is\",round(r*10**-3,1),\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Internal resistance is 53.1 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 138
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.16 Page no 234"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=10*10**-3 \n",
+ "r=10\n",
+ "l=40 #cm\n",
+ "\n",
+ "#Calculation\n",
+ "R=10*l/100.0\n",
+ "R1=(R*2/E)-10\n",
+ "\n",
+ "#Result\n",
+ "print\"External resistance is\", R1,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "External resistance is 790.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 111
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.17 Page no 234"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=10*10**3\n",
+ "E=12\n",
+ "\n",
+ "#Calculation\n",
+ "R=R1/((E/2.0)-1)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Resistance is\",R*10**-3,\"K ohm\"\n",
+ "print\"(b) When current flows through a resistor,its temperature increases due toheat produced across it.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Resistance is 2.0 K ohm\n",
+ "(b) When current flows through a resistor,its temperature increases due toheat produced across it.\n"
+ ]
+ }
+ ],
+ "prompt_number": 116
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.18 Page no 235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=3.0\n",
+ "b=6.0\n",
+ "\n",
+ "#Caculation\n",
+ "E=(1/a)+(1/b)+1+(1/a)\n",
+ "\n",
+ "#Result\n",
+ "print\"Equivalent resistance is\",round(E,2),\"r\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent resistance is 1.83 r\n"
+ ]
+ }
+ ],
+ "prompt_number": 120
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.22 Page no 237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=5\n",
+ "b=10\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "A=np.array([[7,1],[1,5]])\n",
+ "A1=np.array([2,2])\n",
+ "B=np.linalg.solve(A,A1)\n",
+ "B1=B[0]\n",
+ "B2=B[1]\n",
+ "E=(a*B2)+(B1*b)\n",
+ "\n",
+ "#Result\n",
+ "print\"Equivalent resistance is\", round(E,2),\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent resistance is 4.12 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 125
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.23 Page no 238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=12.5\n",
+ "l=39.5\n",
+ "\n",
+ "#Calculation\n",
+ "X=(R*(100-l))/l\n",
+ "L=X/(X+R)\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Resistance is\",round(X,2),\"W\"\n",
+ "print\"(b) Balance point of bridge is\", L*10**2,\"cm\"\n",
+ "print\"(c) The galvanometer will not show any current.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Resistance is 19.15 W\n",
+ "(b) Balance point of bridge is 60.5 cm\n",
+ "(c) The galvanometer will not show any current.\n"
+ ]
+ }
+ ],
+ "prompt_number": 135
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap8.ipynb b/modern_physics_by_Satish_K._Gupta/chap8.ipynb
new file mode 100644
index 00000000..1b06633c
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap8.ipynb
@@ -0,0 +1,994 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a40c0c75d3ca70fc3ecf4f82797b161ff3f00d80a8c81333303a3e01cdc2b09b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8 Thermal effects of current"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.1 Page no 258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P=100.0 #W\n",
+ "V=220.0 #V\n",
+ "\n",
+ "#Calculation\n",
+ "I=P/V\n",
+ "R=V**2/P\n",
+ "\n",
+ "#Result\n",
+ "print\"Resistance is\",R,\"ohm\"\n",
+ "print\"Current capacity is\",round(I,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance is 484.0 ohm\n",
+ "Current capacity is 0.455 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.2 Page no 258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "e=1.6*10**-19 #C\n",
+ "P=100 #W\n",
+ "V=200.0 #V\n",
+ "t=1\n",
+ "\n",
+ "#Calculation\n",
+ "I=P/V\n",
+ "q=I*t\n",
+ "N=q/e\n",
+ "\n",
+ "#Result\n",
+ "print\"Number of electrons is\", N"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of electrons is 3.125e+18\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.3 Page no 258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P1=60 #W\n",
+ "P2=100.0 \n",
+ "\n",
+ "#Calculation\n",
+ "I=P1/P2\n",
+ "\n",
+ "#Result\n",
+ "print\"Hence 100 W bulb draws more current\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hence 100 W bulb draws more current\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.4 Page no 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P1=60.0 #W\n",
+ "P2=100\n",
+ "\n",
+ "#Calculation\n",
+ "R=P2/P1\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) 60 W bulb will dissipate more power.\"\n",
+ "print\"(b) Since 60 W bulb is dissipating more power, it glows brighter.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) 60 W bulb will dissipate more power.\n",
+ "(b) Since 60 W bulb is dissipating more power, it glows brighter.\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.5 Page no 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P1=500.0 #W\n",
+ "V1=220 #V\n",
+ "P2=100.0\n",
+ "V2=220\n",
+ "\n",
+ "#Calculation\n",
+ "R1=V1**2/P1\n",
+ "R2=V2**2/P2\n",
+ "I=V2/(R1+R2)\n",
+ "P11=I**2*R1\n",
+ "P22=I**2*R2\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Power consumed by heater is\",round(P11,2),\"W\"\n",
+ "print\"(ii) Power consumed by electric bulb is\",round(P22,2),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Power consumed by heater is 13.89 W\n",
+ "(ii) Power consumed by electric bulb is 69.44 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.6 Page no 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P=100.0 #W\n",
+ "V=220 #V\n",
+ "V1=110\n",
+ "\n",
+ "#Calculation\n",
+ "R=V**2/P\n",
+ "P1=V1**2/R\n",
+ "\n",
+ "#Result\n",
+ "print\"Power consumed by the bulb is\",P1,\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power consumed by the bulb is 25.0 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.7 Page no 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P=550 #W\n",
+ "V=220 #V\n",
+ "V1=222.2 #V\n",
+ "V2=217.8 #V\n",
+ "\n",
+ "#Calculation\n",
+ "R=V**2/P\n",
+ "P=V1**2/R\n",
+ "P1=V2**2/R\n",
+ "\n",
+ "#Result\n",
+ "print\"minimum power is\",round(P,0),\"W\"\n",
+ "print\"maximum power is\",round(P1,0),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "minimum power is 561.0 W\n",
+ "maximum power is 539.0 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.8 Page no 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=220\n",
+ "P=60.0 #W\n",
+ "P1=85\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "R=V**2/P\n",
+ "V1=math.sqrt(P1*R)\n",
+ "\n",
+ "#Result\n",
+ "print\"Voltage fluctuation is\",round(V1,1),\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage fluctuation is 261.9 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.9 Page no 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P=50*10**3 #W\n",
+ "V=5000.0\n",
+ "R=20\n",
+ "\n",
+ "#Calculation\n",
+ "I=P/V\n",
+ "P1=I**2*R\n",
+ "P2=P-P1\n",
+ "\n",
+ "#Result \n",
+ "print\"Power received by the factory is\",P2*10**-3,\"Kw\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power received by the factory is 48.0 Kw\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.10 Page no 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R2=2 #ohm\n",
+ "R3=2 #ohm\n",
+ "I=3 #A\n",
+ "\n",
+ "#Calculation\n",
+ "P=I**2*R2\n",
+ "R1=(R2*R3)/(R2+R3)\n",
+ "P1=I**2*R1\n",
+ "D=P+P1\n",
+ "\n",
+ "#Result\n",
+ "print\"The maximum power is\",D,\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum power is 27 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.11 Page no 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=0.5 #ohm\n",
+ "I=100 #A\n",
+ "T=24*60*60\n",
+ "\n",
+ "#Calculation\n",
+ "Q=I**2*R*T\n",
+ "\n",
+ "#Result\n",
+ "print\"Energy is being lost per day in the form of heat is\",Q*10**-8,\"*10**8 J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy is being lost per day in the form of heat is 4.32 *10**8 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.12 Page no 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=50.0 #ohm\n",
+ "V=10 #V\n",
+ "T=3600 #s\n",
+ "\n",
+ "#Calculation\n",
+ "I=V/R\n",
+ "W=I**2*R*T\n",
+ "\n",
+ "#Result \n",
+ "print\"The source of this energy is\",W,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The source of this energy is 7200.0 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 64
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.13 Page no 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P=100 #W\n",
+ "V=200 #V\n",
+ "T=60\n",
+ "I=10\n",
+ "\n",
+ "#Calculation\n",
+ "R=V**2/P\n",
+ "W=(P**2/R)*I*T\n",
+ "\n",
+ "#Result \n",
+ "print\"The heat & light produced by the bulb is\",W,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat & light produced by the bulb is 15000 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 70
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.14 Page no 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=3 #ohm\n",
+ "R2=6\n",
+ "R3=2\n",
+ "V=12 #V\n",
+ "T=300 #s\n",
+ "\n",
+ "#Calculation\n",
+ "R12=R1*R2/(R1+R2)\n",
+ "R=R12+R3\n",
+ "I=V/R\n",
+ "I1=I*R2/(R1+R2)\n",
+ "I2=I*R1/(R1+R2)\n",
+ "Q1=I1**2*R1*T\n",
+ "Q2=I2**2*R2*T\n",
+ "Q3=I**2*R3*T\n",
+ "\n",
+ "#Result \n",
+ "print\"Heat produced in resistance R1 is\",Q1,\"J\"\n",
+ "print\"Heat produced in resistance R2 is\",Q2,\"J\"\n",
+ "print\"Heat produced in resistance R3 is\",Q3,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat produced in resistance R1 is 3600 J\n",
+ "Heat produced in resistance R2 is 1800 J\n",
+ "Heat produced in resistance R3 is 5400 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 82
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.15 Page no 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "t1=300 #S\n",
+ "t2=600 #S\n",
+ "\n",
+ "#Calculation\n",
+ "t=(t1+t2)/60.0\n",
+ "\n",
+ "#Result\n",
+ "print\"Time required to boil water is\",t,\"minute\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required to boil water is 15.0 minute\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.16 Page no 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R=100 #ohm\n",
+ "I=0.5 #A\n",
+ "W=10*10**-3 #Kg\n",
+ "M=250*10**-3 #Kg\n",
+ "T=1800 #s\n",
+ "C=4.2*10**3\n",
+ "\n",
+ "#Calculation\n",
+ "Q=I**2*R*T\n",
+ "V=Q/((W+M)*C)\n",
+ "\n",
+ "#Result\n",
+ "print\"The rise of the temperature is\",round(V,1),\"C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rise of the temperature is 41.2 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.17 Page no 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=200\n",
+ "R=100\n",
+ "R1=121.0\n",
+ "A=1000 #W\n",
+ "B=400 #W\n",
+ "C=400 #W\n",
+ "T=116 #h\n",
+ "G=2.50\n",
+ "\n",
+ "#Calculation\n",
+ "D=V**2/R\n",
+ "D1=V**2/R1\n",
+ "E=A+B+C+D1\n",
+ "F=E*T\n",
+ "H=F*G\n",
+ "\n",
+ "#Result \n",
+ "print\"The bill for february is\",round(H*10**-3,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The bill for february is 617.87\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.18 Page no 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=0.12 #KWh\n",
+ "b=1.44 #KWh\n",
+ "c=0.48 #KWh\n",
+ "d=0.24 \n",
+ "e=0.30\n",
+ "i=2.70\n",
+ "g=30\n",
+ "\n",
+ "#Calculation\n",
+ "f=a+b+c+d+e\n",
+ "h=2*g*f\n",
+ "k=i*h\n",
+ "\n",
+ "#Result\n",
+ "print\"Electric bill for 2 month is\", k"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electric bill for 2 month is 417.96\n"
+ ]
+ }
+ ],
+ "prompt_number": 103
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.19 Page no 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "P=100*10**6 #W\n",
+ "V1=20000\n",
+ "V2=200 #V\n",
+ "\n",
+ "#Calculation\n",
+ "I1=P/V1\n",
+ "Q1=I1**2\n",
+ "I2=P/V2\n",
+ "Q2=I2**2\n",
+ "\n",
+ "#Result\n",
+ "print\"Transmission done at V1=20,000 is\", Q1*10**-5,\"10**5\"\n",
+ "print\"Transmission done at V2=200 V is\", Q2*10**-10,\"10**10\"\n",
+ "print\"Less power wastage when transmission is done at Q1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Transmission done at V1=20,000 is 250.0 10**5\n",
+ "Transmission done at V2=200 V is 25.0 10**10\n",
+ "Less power wastage when transmission is done at Q1\n"
+ ]
+ }
+ ],
+ "prompt_number": 105
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.20 Page no 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "p1=4.9*10**-7 #ohm m\n",
+ "l1=8.456 #m\n",
+ "b1=1.0 #mm\n",
+ "t1=0.03*10**-6 #m\n",
+ "l2=4.235\n",
+ "A2=0.12*10**-6\n",
+ "p2=1.1*10**-6\n",
+ "\n",
+ "#Calculation\n",
+ "A1=b1*t1\n",
+ "R1=p1*(l1/A1)\n",
+ "R2=p2*(l2/A2)\n",
+ "\n",
+ "#Result\n",
+ "print\"Rate for heat production for constantan ribbon is\", round(R1,3),\"W\"\n",
+ "print\"Rate for heat production for nichrome ribbon is\",round(R2,3),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rate for heat production for constantan ribbon is 138.115 W\n",
+ "Rate for heat production for nichrome ribbon is 38.821 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 115
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.21 Page no 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=50 #V\n",
+ "I=12 #A\n",
+ "d=70\n",
+ "\n",
+ "#Calculation\n",
+ "g=V*I\n",
+ "t=g*(d/100.0)\n",
+ "v=t/I**2\n",
+ "\n",
+ "#Result \n",
+ "print\"The resistance of the motor is\",round(v,2),\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistance of the motor is 2.92 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 76
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.22 Page no 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=100\n",
+ "b=6\n",
+ "c=8.0\n",
+ "d=2.0\n",
+ "f=0.50\n",
+ "t=15*60\n",
+ "\n",
+ "#Calculation\n",
+ "e=a-b*d\n",
+ "x=b*f\n",
+ "r=(e/c)-x\n",
+ "r1=a*r\n",
+ "r2=r**2*(r+b*f)\n",
+ "r3=r1-r2\n",
+ "M=r3*t\n",
+ "\n",
+ "#Result\n",
+ "print\"Resistance in the charging circuit is\",r,\"ohm\"\n",
+ "print\"The power supplied by the d.c source is\",r1,\"W\"\n",
+ "print\"The power dissipated as heat is\",r2,\"W\"\n",
+ "print\"The power stored in the battery is\",r3,\"W\"\n",
+ "print\"Energy stored in the battery in 15 minute is\",M,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance in the charging circuit is 8.0 ohm\n",
+ "The power supplied by the d.c source is 800.0 W\n",
+ "The power dissipated as heat is 704.0 W\n",
+ "The power stored in the battery is 96.0 W\n",
+ "Energy stored in the battery in 15 minute is 86400.0 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 96
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.23 Page no 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=64 #V\n",
+ "e=2.0 #V\n",
+ "n=8\n",
+ "r=1/8.0\n",
+ "R=7 #ohm\n",
+ "I=3.5 #A\n",
+ "b=3600\n",
+ "\n",
+ "#Calculation\n",
+ "Te=e*n\n",
+ "R1=r*n\n",
+ "E=V*I\n",
+ "E1=Te*I\n",
+ "E11=I**2*(R+R1)\n",
+ "Em=E-(E1+E11)\n",
+ "Em1=Em*b\n",
+ "Ec=E1*b\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Mechanical energy yielded by motor is\", Em1,\"J\"\n",
+ "print\"(b) Chemical energy stored in the battery is\",Ec,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Mechanical energy yielded by motor is 252000.0 J\n",
+ "(b) Chemical energy stored in the battery is 201600.0 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 130
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8.25 Page no 263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=24 #V\n",
+ "r=4 #ohm\n",
+ "a=1\n",
+ "\n",
+ "#Calculation\n",
+ "R=r/(2.0-a)\n",
+ "I=E/(R+r)\n",
+ "\n",
+ "#Result\n",
+ "print\"Current drawn from the battery is\", I,\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn from the battery is 3.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 134
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap9.ipynb b/modern_physics_by_Satish_K._Gupta/chap9.ipynb
new file mode 100644
index 00000000..ecaec460
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap9.ipynb
@@ -0,0 +1,627 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3404f51fc9045816d89b5507acdfe9797796d47a0805fc064b3ee38cacd900d7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 Chemical effects of current"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1 Page no 285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=1*10**-3 #kg\n",
+ "I=2 #A\n",
+ "z=3.3*10**-7 #kg/C\n",
+ "\n",
+ "#Calculation\n",
+ "t=m/(z*I)\n",
+ "\n",
+ "#Result\n",
+ "print\"Time required is\", round(t,1),\"s\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required is 1515.2 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2 Page no 285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=0.15*10**-3 #Kg\n",
+ "z=3.3*10**-7 #Kg/C\n",
+ "t=900 #S\n",
+ "I1=0.6 #A\n",
+ "\n",
+ "#Calculation\n",
+ "I=m/(z*t)\n",
+ "I2=I-I1\n",
+ "\n",
+ "#Result\n",
+ "print\"Correction required for the ammeter reading is\", round(I2,1),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Correction required for the ammeter reading is -0.1 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 Page no 285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "t=0.002 #m\n",
+ "A=72 #cm**2\n",
+ "d=8.9 #g/cm**3\n",
+ "z=33*10**-5 #g/C\n",
+ "I=5 #A\n",
+ "\n",
+ "#Calculation\n",
+ "V=t*A\n",
+ "m=V*d\n",
+ "t1=m/(z*I)\n",
+ "\n",
+ "#Result\n",
+ "print\"Time required is\", round(t1,0),\"S\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required is 777.0 S\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 Page no 286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m1=2 #g\n",
+ "m2=1 #g\n",
+ "t=1800 #s\n",
+ "z1=1118*10**-6 \n",
+ "z2=3294*10**-7 \n",
+ "a=6\n",
+ "\n",
+ "#Calculation\n",
+ "l1=m1/(z1*t)\n",
+ "l2=m2/(z2*t)\n",
+ "l=l1+l2\n",
+ "p=l*a\n",
+ "\n",
+ "#Result\n",
+ "print\"Power of the current is\",round(p,3),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power of the current is 16.082 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5 Page no 286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m1=0.403*10**-3 #Kg\n",
+ "z1=1.12*10**-6\n",
+ "z2=3.3*10**-7\n",
+ "t=900 #s\n",
+ "e=12 #V\n",
+ "\n",
+ "#Calculation\n",
+ "m2=(m1*z2)/z1\n",
+ "d=(e*m1)/z1\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Mass of the copper deposited is\",round(m2*10**3,3),\"10**-3\"\n",
+ "print\"(b) The energy supplied by the battery is\",round(d*10**-3,2),\"10**3\",\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Mass of the copper deposited is 0.119 10**-3\n",
+ "(b) The energy supplied by the battery is 4.32 10**3 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.6 Page no 286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "r=100 #ohm\n",
+ "t=600 #s\n",
+ "z=3.3*10**-7\n",
+ "m=10**-4\n",
+ "\n",
+ "#Calculation\n",
+ "I=m/(z*t)\n",
+ "Q=I**2*r*t\n",
+ "\n",
+ "#Result\n",
+ "print\"Heat produced in the resistance coil is\",round(Q,1),\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat produced in the resistance coil is 15304.6 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 64
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 Page no 286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "a=1.008\n",
+ "v=1\n",
+ "m1=1.05*10**-8\n",
+ "a1=63.54\n",
+ "v1=2\n",
+ "m2=3.29*10**-7\n",
+ "a2=107.9\n",
+ "v2=1\n",
+ "m3=1.12*10**-6\n",
+ "a3=55.85\n",
+ "v3=3\n",
+ "\n",
+ "#Calculation\n",
+ "#For water voltameter\n",
+ "E=a/v\n",
+ "s=m1/E\n",
+ "\n",
+ "#For copper voltameter\n",
+ "E2=a1/v1\n",
+ "s1=m2/E2\n",
+ "\n",
+ "#For silver voltameter\n",
+ "E3=a2/v2\n",
+ "s2=m3/E3\n",
+ "\n",
+ "#For iron voltameter\n",
+ "E4=a3/v3\n",
+ "m4=(s/a)*E4\n",
+ "\n",
+ "#Result\n",
+ "print\"Mass of hydrogen liberated is\",round(s*10**8,4)*10**-8\n",
+ "print\"Mass of copper deposited is\",round(s1*10**8,4)*10**-8\n",
+ "print\"Mass of silver deposited is\",round(s2*10**8,4)*10**-8\n",
+ "print\"Mass of iron deposited is\", round(m4*10**7,2)*10**-7,\"Kg/C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of hydrogen liberated is 1.0417e-08\n",
+ "Mass of copper deposited is 1.0356e-08\n",
+ "Mass of silver deposited is 1.038e-08\n",
+ "Mass of iron deposited is 1.92e-07 Kg/C\n"
+ ]
+ }
+ ],
+ "prompt_number": 104
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.8 Page no 287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=2.5 #g\n",
+ "I=10 #A\n",
+ "F=96500 #C/mol\n",
+ "m1=63.5\n",
+ "n=2.0\n",
+ "\n",
+ "#Calculation\n",
+ "E=m1/n\n",
+ "t=m*F/(E*I)\n",
+ "\n",
+ "#Result\n",
+ "print\"Time required is\",round(t,1),\"S\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required is 759.8 S\n"
+ ]
+ }
+ ],
+ "prompt_number": 110
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.9 Page no 287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "m=16.43 #g\n",
+ "t=4000 #s\n",
+ "F=96485 #C/mol\n",
+ "m1=63.54\n",
+ "n=2.0\n",
+ "I1=12.6 #A\n",
+ "\n",
+ "#Calculation\n",
+ "E=m1/n\n",
+ "I=m*F/(E*t)\n",
+ "I2=I1-I\n",
+ "\n",
+ "#Result\n",
+ "print\"Error in the ammeter reading is\", round(I2,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Error in the ammeter reading is 0.126 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 119
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.10 Page no 287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "t=600 #S\n",
+ "m=5.92 #g\n",
+ "F=96500 #C/mol\n",
+ "V1=1.62 #V\n",
+ "V2=1.34\n",
+ "m1=63.5\n",
+ "n=2.0\n",
+ "\n",
+ "#Calculation\n",
+ "V=V1-V2\n",
+ "E=m1/n\n",
+ "I=m*F/(E*t)\n",
+ "R=V/I\n",
+ "\n",
+ "#Result\n",
+ "print\"Resistance of the voltmeter is\",round(R*10**3,2),\"m ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance of the voltmeter is 9.34 m ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 123
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.11 Page no 287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "E=8 #V\n",
+ "r=1 #ohm\n",
+ "R=15 #ohm\n",
+ "E1=120\n",
+ "t=300 #s\n",
+ "\n",
+ "#Calculation\n",
+ "I=(E1-E)/(R+r)\n",
+ "V=E+(I*r)\n",
+ "E12=E*I*t\n",
+ "\n",
+ "#Result\n",
+ "print\"(a) Current in the circuit is\", I,\"A\"\n",
+ "print\"(b) Terminal voltage across the battery is\",V,\"V\"\n",
+ "print\"(c) Chemical energy stored in the battery is\",E12,\"J\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Current in the circuit is 7 A\n",
+ "(b) Terminal voltage across the battery is 15 V\n",
+ "(c) Chemical energy stored in the battery is 16800 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 133
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.12 Page no 288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I=10 #A\n",
+ "t=300 #S\n",
+ "m=2.016\n",
+ "n=2.0\n",
+ "n1=1.0\n",
+ "m1=1.008\n",
+ "F=96500\n",
+ "V=22.4\n",
+ "\n",
+ "#Calculation\n",
+ "q=I*t\n",
+ "M=m/n\n",
+ "M2=m1/n1\n",
+ "q1=F*m/m1\n",
+ "V1=V*q/q1\n",
+ "\n",
+ "#Result\n",
+ "print\"Volume of hydrogen is\",round(V1,4),\"litre\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Volume of hydrogen is 0.3482 litre\n"
+ ]
+ }
+ ],
+ "prompt_number": 136
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.13 Page no 288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "w=107.9 #g/mol\n",
+ "r=2 #ohm\n",
+ "E=12 #V\n",
+ "V=10\n",
+ "F=96500\n",
+ "t=1800\n",
+ "\n",
+ "#Calculation\n",
+ "R=r*(V/(E-V))\n",
+ "I=E/(R+r)\n",
+ "E=w/I\n",
+ "z=E/F\n",
+ "m=z*I*t\n",
+ "\n",
+ "#Result\n",
+ "print\"Silver deposited at the cathode is\", round(m,2),\"g\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Silver deposited at the cathode is 2.01 g\n"
+ ]
+ }
+ ],
+ "prompt_number": 143
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.14 Page no 288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "I=5.0 #A\n",
+ "a=0.5 #mole\n",
+ "n=1\n",
+ "F=96500\n",
+ "I1=10 #A\n",
+ "t1=9650*2\n",
+ "n1=2.0\n",
+ "m=63.54\n",
+ "m2=55.85\n",
+ "n2=3.0\n",
+ "\n",
+ "#Calculation\n",
+ "q=F*a\n",
+ "t=q/I\n",
+ "E=m/n1\n",
+ "m1=(E*I1*t1)/F\n",
+ "E3=m2/n2\n",
+ "m3=(E3*I1*t1)/F\n",
+ "\n",
+ "#Result\n",
+ "print\"Molar mass of copper is\", m1,\"equal to its atomic mass i.e 1 mole of copper is liberated.\"\n",
+ "print\"Molar mass of iron is\",round(m3,3),\"Hence 2/3 mole of iron will be deposited.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Molar mass of copper is 63.54 equal to its atomic mass i.e 1 mole of copper is liberated.\n",
+ "Molar mass of iron is 37.233 Hence 2/3 mole of iron will be deposited.\n"
+ ]
+ }
+ ],
+ "prompt_number": 153
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/chap_29.ipynb b/modern_physics_by_Satish_K._Gupta/chap_29.ipynb
new file mode 100644
index 00000000..581d372d
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/chap_29.ipynb
@@ -0,0 +1,298 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:15f32b3e96d10d200143bd7ffbc8811afc0974b65cf155210561266d411e6511"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 29 Wave Nature Of Matter"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 29.1 Page no 815"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "h=6.62*10**-34 #Js\n",
+ "Me=9.1*10**-31 #Kg\n",
+ "Ve=10**5 #m s**-1\n",
+ "Mp=1.67*10**-27 #Kg\n",
+ "Vp=10**5 #m s**-1\n",
+ "\n",
+ "#Calculation\n",
+ "Le=h/(Me*Ve)\n",
+ "Lp=h/(Mp*Vp)\n",
+ "\n",
+ "#Result\n",
+ "print\"The de-broglie wavelength of electron is\",round(Le*10**9,2),\"*10**-9 m\"\n",
+ "print\"The de-broglie wavelenght of proton is\",round(Lp*10**12,2),\"*10**-12 m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The de-broglie wavelength of electron is 7.27 10**-9 m\n",
+ "The de-broglie wavelenght of proton is 3.96 10**-12 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 29.2 Page no 816"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "M0=9.1*10**-31 #Kg\n",
+ "h=6.62*10**-34 #J s\n",
+ "V=0.5 #c\n",
+ "V1=1.5*10**8\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "L=(h*math.sqrt(1-V**2))/(M0*V1)\n",
+ "\n",
+ "#Result\n",
+ "print\"The de-broglie wavelenght is\",round(L*10**12,1),\"*10**-12 m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The de-broglie wavelenght is 4.2 10**-12 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 29.3 Page no 816"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "h=6.6*10**-34 #J s\n",
+ "m=9.1*10**-31 #kg\n",
+ "Iev=1.6*10**-19 #J\n",
+ "E=6.4*10**-17 #J\n",
+ "\n",
+ "#Calculation\n",
+ "L=h/(math.sqrt(2*m*E))\n",
+ "\n",
+ "#Result\n",
+ "print\"The de-broglie wavelenght of electron is\",round(L*10**10,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The de-broglie wavelenght of electron is 0.61 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 29.4 Page no 816"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "T=300 #K\n",
+ "K=1.38*10**-23 #J\n",
+ "h=6.62*10**-34\n",
+ "m=1.675*10**-27\n",
+ "\n",
+ "#Calculation\n",
+ "E=(3/2.0)*K*T\n",
+ "L=h/(math.sqrt(2*m*E))\n",
+ "\n",
+ "#Result\n",
+ "print\"The de-broglie wavelenght associated with thermal neutrons is\",round(L*10**10,3),\"*10**-10 m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The de-broglie wavelenght associated with thermal neutrons is 1.451 10**-10 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 29.5 Page no 816"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "L=10**-10 #m\n",
+ "h=6.62*10**-34\n",
+ "c=3*10**8\n",
+ "S=1.6*10**-19\n",
+ "m=9.11*10**-31 #kg\n",
+ "\n",
+ "#Calculation\n",
+ "#For X-ray photon of wavelength\n",
+ "E=(h*c)/L\n",
+ "E1=E/S\n",
+ "#For electron of wavelength \n",
+ "Mv=h/L\n",
+ "E2=(Mv**2)/(2*m)\n",
+ "E3=E2/S\n",
+ "\n",
+ "#Result\n",
+ "print\"Energy of electron is\",round(E3,1),\"eV\"\n",
+ "print\"It follows that X-ray photon has greater energy\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy of electron is 150.3 eV\n",
+ "It follows that X-ray photon has greater energy\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 29.6 Page no 816"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "M=1.675*10**-27 #kg\n",
+ "E=2.4*10**-17 #J\n",
+ "h=6.62*10**-34\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "L=h/(math.sqrt(2*M*E))\n",
+ "\n",
+ "#Result\n",
+ "print\"The de-broglie wavelength of neutron is\",round(L*10**12,3)*10**-12,\" m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The de-broglie wavelength of neutron is 2.335e-12 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 29.7 Page no 816"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=50 #kV\n",
+ "E=8.0*10**-15 #J\n",
+ "m=9.1*10**-31\n",
+ "h=6.62*10**-34\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "L=h/(math.sqrt(2*m*E))\n",
+ "\n",
+ "#Result\n",
+ "print\"Energy of electron is\",round(L*10**12,3),\"*10**-12 m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy of electron is 5.486 10**-12 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 54
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/modern_physics_by_Satish_K._Gupta/screenshots/image1.png b/modern_physics_by_Satish_K._Gupta/screenshots/image1.png
new file mode 100644
index 00000000..a1aeb52f
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/screenshots/image1.png
Binary files differ
diff --git a/modern_physics_by_Satish_K._Gupta/screenshots/image22.png b/modern_physics_by_Satish_K._Gupta/screenshots/image22.png
new file mode 100644
index 00000000..c6bd4243
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/screenshots/image22.png
Binary files differ
diff --git a/modern_physics_by_Satish_K._Gupta/screenshots/image33.png b/modern_physics_by_Satish_K._Gupta/screenshots/image33.png
new file mode 100644
index 00000000..26358a05
--- /dev/null
+++ b/modern_physics_by_Satish_K._Gupta/screenshots/image33.png
Binary files differ