diff options
Diffstat (limited to 'Introduction_To_Chemical_Engineering/ch1.ipynb')
-rw-r--r-- | Introduction_To_Chemical_Engineering/ch1.ipynb | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/Introduction_To_Chemical_Engineering/ch1.ipynb b/Introduction_To_Chemical_Engineering/ch1.ipynb index a09b75a5..b28f0745 100644 --- a/Introduction_To_Chemical_Engineering/ch1.ipynb +++ b/Introduction_To_Chemical_Engineering/ch1.ipynb @@ -27,17 +27,14 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to find composition of air by weight\n", "\n", "import math \n", "\n", - "# Variables\n", "y_oxygen = 0.21 #mole fraction of oxygen\n", "y_nitrogen = 0.79 #mole fraction of nitrogen\n", "molar_mass_oxygen = 32.\n", "molar_mass_nitrogen = 28.\n", "\n", - "# Calculations and Results\n", "molar_mass_air = y_oxygen*molar_mass_oxygen+y_nitrogen*molar_mass_nitrogen;\n", "mass_fraction_oxygen =y_oxygen*molar_mass_oxygen/molar_mass_air;\n", "mass_fraction_nitrogen = y_nitrogen*molar_mass_nitrogen/molar_mass_air;\n", @@ -83,18 +80,14 @@ "cell_type": "code", "collapsed": false, "input": [ - "#find the volume occupied by propane\n", "\n", "import math \n", - "# Variables\n", "mass_propane=14.2 #in kg\n", "molar_mass=44 #in kg\n", "\n", - "# Calculations\n", "moles=(mass_propane*1000)/molar_mass;\n", "volume=22.4*moles; #in liters\n", "\n", - "# Results\n", "print \"volume = %d liters\"%(volume)\n" ], "language": "python", @@ -122,18 +115,15 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to find the average weight, weight composition, gas volume in absence of SO2\n", "\n", "import math \n", "\n", - "# Variables\n", "y_CO2 = 0.25;\n", "y_CO = 0.002;\n", "y_SO2 = 0.012;\n", "y_N2 = 0.680;\n", "y_O2 = 0.056;\n", "\n", - "# Calculations and Results\n", "Mm = y_CO2*44+y_CO*28+y_SO2*64+y_N2*28+y_O2*32;\n", "print \" molar mass = %d \"%(Mm)\n", "\n", @@ -201,15 +191,12 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to find volume of NH3 dissolvable in water\n", "\n", "import math \n", "\n", - "# Variables\n", "p=1. #atm\n", "H=2.7 #atm\n", "\n", - "# Calculations and Results\n", "x=p/H;\n", "\n", "mole_ratio = (x)/(1-x);\n", @@ -247,21 +234,17 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to calculate amount of CO2 released by water\n", "\n", "import math \n", - "# Variables\n", "p=746 #in mm Hg\n", "H=1.08*10**6 #in mm Hg, Henry's constant\n", "\n", - "# Calculations\n", "x= p/H; #mole fraction of CO2\n", "X=x*(44./18); #mass ratio of CO2 in water\n", "\n", "initial_CO2 = 0.005; #kg CO2/kg H20\n", "G=1000*(initial_CO2-X);\n", "\n", - "# Results\n", "print \"CO2 given up by 1 cubic meter of water = %f kg CO2/cubic meter H20\"%(G)\n" ], "language": "python", @@ -289,17 +272,14 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to find vapor pressre of ethyl alchohal\n", "\n", "import math \n", "\n", - "# Variables\n", "pa1 = 23.6; #VP of ethyl alchohal at 10 degree C\n", "pa3=760. #VP of ethyl alchohal at 78.3 degree C in mm Hg\n", "pb1 = 9.2 #VP of ethyl water at 10 degree C in mm Hg\n", "pb3=332. #VP of ethyl water at 78.3 degree C in mm Hg\n", "\n", - "# Calculations\n", "C=(math.log10(pa1/pa3)/(math.log10(pb1/pb3)));\n", "\n", "pb2=149. #VP of water at 60 degree C in mm Hg\n", @@ -308,7 +288,6 @@ "pa=C*math.log10(pas);\n", "pa2=pa3/(10**pa);\n", "\n", - "# Results\n", "print \"vapor pressure of ethyl alcholoh at 60 degree C = %f mm Hg\"%(pa2)\n" ], "language": "python", @@ -336,20 +315,16 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to find vapor pressure using duhring plot\n", "\n", "import math \n", - "# Variables\n", "t1 = 41. #in degree C\n", "t2=59. #in degree C\n", "theta_1 =83. #in degree C\n", "theta_2=100. #in degree C\n", "\n", - "# Calculations\n", "K = (t1-t2)/(theta_1-theta_2);\n", "t=59+(K*(104.2-100));\n", "\n", - "# Results\n", "print \"boiling point of SCl2 at 880 Torr = %f degree celcius\"%(t)\n" ], "language": "python", @@ -377,20 +352,16 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to find the amount of steam released\n", "\n", "import math \n", "\n", - "# Variables\n", "vp_C6H6 = 520. #in torr\n", "vp_H2O = 225. #in torr\n", "mass_water=18.\n", "mass_benzene=78.\n", "\n", - "# Calculations\n", "amount_of_steam = (vp_H2O/vp_C6H6)/(mass_benzene/mass_water);\n", "\n", - "# Results\n", "print \"amount of steam = %f\"%( amount_of_steam)\n" ], "language": "python", @@ -418,17 +389,14 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to find equilibrium vapor liquid composition\n", "\n", "import math \n", "\n", - "# Variables\n", "p0b = 385. #vapor pressue of benzene at 60 degree C in torr\n", "p0t=140. #vapor pressue of toluene at 60 degree C in torr\n", "xb=0.4;\n", "xt=0.6;\n", "\n", - "# Calculations and Results\n", "pb=p0b*xb;\n", "pt=p0t*xt;\n", "P=pb+pt;\n", @@ -439,9 +407,7 @@ "yt=pt/P;\n", "print \"vapor composition of benzene = %f vapor composition of toluene = %f\"%(yb,yt)\n", "\n", - "#for liquid boiling at 90 degree C and 760 torr, liquid phase composition\n", "x=(760.-408)/(1013-408);\n", - "#(1013*x)+(408*(1-x))==760;\n", "print \"mole fraction of benzene in liquid mixture = %.3f mole fraction of toluene in liquid mixture= %.3f\"%(x,1-x)\n", "print \"Thus, the liquid mixture contained %.1f mole %% benzene and %.1f mole %% toluene\"%(x*100,(1-x)*100)" ], @@ -473,18 +439,14 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to find relation between friction factor and reynold's number\n", "\n", "import math \n", "\n", - "# Variables\n", - "#math.log f=y, math.log Re=x, math.log a=c\n", "sigma_x=23.393;\n", "sigma_y=-12.437;\n", "sigma_x2=91.456\n", "sigma_xy=-48.554;\n", "\n", - "# Calculations and Results\n", "m=((6*sigma_xy)-(sigma_x*sigma_y))/(6*sigma_x2-(sigma_x)**2);\n", "print \"m = %f \"%(m)\n", "\n", @@ -520,7 +482,6 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to find the average velocity\n", "\n", "import math\n", "from numpy import *\n", @@ -528,21 +489,17 @@ "\n", "%pylab inline\n", "\n", - "# Variables\n", "u = array([2,1.92,1.68,1.28,0.72,0]);\n", "r = array([0,1,2,3,4,5]);\n", "\n", - "# Calculations\n", "z = u*r;\n", "plot(r,z)\n", "suptitle(\"variation of ur with r\")\n", "xlabel(\"r\")\n", "ylabel(\"ur\")\n", "show()\n", - "#by graphical integration, we get\n", "u_avg = (2./25)*12.4\n", "\n", - "# Results\n", "print \"average velocity = %f cm/s\"%(u_avg)\n" ], "language": "python", @@ -593,16 +550,13 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to find the average velocity\n", "\n", "\n", "import math \n", "\n", - "# Variables\n", "n = 6.;\n", "h = (3. - 0)/n;\n", "\n", - "# Calculations and Results\n", "I = (h/2.)*(0+2*0.97+2*1.78+2*2.25+2*2.22+2*1.52+0);\n", "u_avg = (2./3**2)*I;\n", "\n", @@ -646,22 +600,18 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to find the settling velocity as a function of time\n", "\n", "import math \n", "\n", - "# Variables\n", "z0 = 30.84;\n", "z1 = 29.89;\n", "z2 = 29.10;\n", "h = 4;\n", "\n", - "# Calculations\n", "u1_t0 = (-3*z0+4*z1-z2)/(2*h);\n", "u1_t4 = (-z0+z2)/(2*h);\n", "u1_t8 = (z0-4*z1+3*z2)/(2*h);\n", "\n", - "#considering data set for t = 4,8,12 min\n", "z0 = 29.89;\n", "z1 = 29.10;\n", "z2 = 28.30;\n", @@ -669,7 +619,6 @@ "u2_t8 = (-z0+z2)/(2*h);\n", "u2_t12 = (z0-4*z1+3*z2)/(2*h);\n", "\n", - "#considering data set for t = 8,12,16 min\n", "z0 = 29.10;\n", "z1 = 28.30;\n", "z2 = 27.50;\n", @@ -677,12 +626,10 @@ "u3_t12 = (-z0+z2)/(2*h);\n", "u3_t16 = (z0-4*z1+3*z2)/(2*h);\n", "\n", - "#taking average\n", "u_t4 = (u1_t4+u2_t4)/2;\n", "u_t8 = (u1_t8+u2_t8+u3_t8)/3;\n", "u_t12 = (u2_t12+u3_t12)/2;\n", "\n", - "# Results\n", "print \"u_t0 = %f cm/min u_t4 = %f cm/min u_t8 = %f cm/min u_t12 = %f/n cm/min u_t16 =%f/n cm/min \"%(u1_t0,u_t4,u_t8,u_t12,u3_t16)\n" ], "language": "python", @@ -710,11 +657,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to find the flow rate and pressure drop\n", "\n", "import math \n", "\n", - "# Variables\n", "density_water=988. #in kg/m3\n", "viscosity_water=55.*10**-5 #in Ns/m2\n", "density_air=1.21 #in kg/m3\n", @@ -722,7 +667,6 @@ "L=1 #length in m\n", "\n", "\n", - "# Calculations and Results\n", "L1=10.*L #length in m\n", "Q=0.0133;\n", "\n", @@ -730,7 +674,6 @@ "\n", "print \"flow rate = %f cubic meter/s\"%(Q1)\n", "\n", - "#equating euler number\n", "\n", "p=9.8067*10**4; #pressure in pascal\n", "p1=(p*density_water*Q**2*L**4)/(density_air*Q1**2*L1**4);\n", @@ -763,20 +706,16 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to find the specific gravity of plasstic\n", "\n", "import math \n", "\n", - "# Variables\n", "L=1. #length of prototype in m\n", "L1=10*L #length of model in m\n", "density_prototype=2.65 #gm/cc\n", "density_water=1. #gm/cc\n", "\n", - "# Calculations\n", "density_model=(L**3*(density_prototype-density_water))/(L1**3)+1;\n", "\n", - "# Results\n", "print \"specific gravity of plastic = %f\"%(density_model)\n" ], "language": "python", @@ -804,20 +743,16 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to find error in actual data and nomographic chat value\n", "\n", "import math \n", "from numpy import linspace\n", "from matplotlib.pyplot import *\n", "\n", "\n", - "# Variables\n", - "#for my\n", "ly = 8 #in cm\n", "my = ly/((1/0.25) - (1/0.5));\n", "lz = 10.15 #in cm\n", "\n", - "# Calculations and Results\n", "mz = lz/((1./2.85) - (1/6.76));\n", "mx = (my*mz)/(my+mz);\n", "print \"mx = %f cm\"%(mx)\n", @@ -850,21 +785,16 @@ "cell_type": "code", "collapsed": false, "input": [ - "#to find the economic pipe diameter from nomograph\n", "\n", "import math \n", "\n", - "# Variables\n", - "#from the nomograph,we get the values of w and density\n", "w=450. #in kg/hr\n", "density=1000. #in kg/m3\n", "d=16. #in mm\n", "\n", - "# Calculations\n", "u=(w/density)/(3.14*d**2/4);\n", "Re=u*density*d/0.001;\n", "\n", - "# Results\n", "if Re>2100:\n", " print \"flow is turbulent and d= %f mm\"%(d)\n", "else:\n", |