summaryrefslogtreecommitdiff
path: root/Introduction_To_Chemical_Engineering
diff options
context:
space:
mode:
authordebashisdeb2014-06-20 15:42:42 +0530
committerdebashisdeb2014-06-20 15:42:42 +0530
commit83c1bfceb1b681b4bb7253b47491be2d8b2014a1 (patch)
treef54eab21dd3d725d64a495fcd47c00d37abed004 /Introduction_To_Chemical_Engineering
parenta78126bbe4443e9526a64df9d8245c4af8843044 (diff)
downloadPython-Textbook-Companions-83c1bfceb1b681b4bb7253b47491be2d8b2014a1.tar.gz
Python-Textbook-Companions-83c1bfceb1b681b4bb7253b47491be2d8b2014a1.tar.bz2
Python-Textbook-Companions-83c1bfceb1b681b4bb7253b47491be2d8b2014a1.zip
removing problem statements
Diffstat (limited to 'Introduction_To_Chemical_Engineering')
-rw-r--r--Introduction_To_Chemical_Engineering/ch1.ipynb70
-rw-r--r--Introduction_To_Chemical_Engineering/ch2.ipynb132
-rw-r--r--Introduction_To_Chemical_Engineering/ch3.ipynb129
-rw-r--r--Introduction_To_Chemical_Engineering/ch4.ipynb74
-rw-r--r--Introduction_To_Chemical_Engineering/ch5.ipynb67
-rw-r--r--Introduction_To_Chemical_Engineering/ch6.ipynb65
-rw-r--r--Introduction_To_Chemical_Engineering/ch7.ipynb36
-rw-r--r--Introduction_To_Chemical_Engineering/ch8.ipynb40
-rw-r--r--Introduction_To_Chemical_Engineering/ch9.ipynb10
9 files changed, 0 insertions, 623 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",
diff --git a/Introduction_To_Chemical_Engineering/ch2.ipynb b/Introduction_To_Chemical_Engineering/ch2.ipynb
index 7f49d9ae..845b485b 100644
--- a/Introduction_To_Chemical_Engineering/ch2.ipynb
+++ b/Introduction_To_Chemical_Engineering/ch2.ipynb
@@ -27,21 +27,17 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the volume of oxygen that can be obtained\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"p1=15. #in bar\n",
"p2=1.013 #in bar\n",
"t1=283. #in K\n",
"t2=273. #in K\n",
"v1=10. #in l\n",
"\n",
- "# Calculations\n",
"v2=p1*v1*t2/(t1*p2);\n",
"\n",
- "# Results\n",
"print \"volume of oxygen = %f liters\"%(v2)\n"
],
"language": "python",
@@ -69,16 +65,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find volumetric composition,partial pressue of each gas and total pressure of mixture\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"nCO2 = 2./44; #moles of CO2\n",
"nO2 = 4./32; #moles of O2\n",
"nCH4 = 1.5/16; #moles of CH4\n",
"\n",
- "# Calculations and Results\n",
"total_moles = nCO2+nO2+nCH4;\n",
"yCO2 = nCO2/total_moles;\n",
"yO2 = nO2/total_moles;\n",
@@ -122,21 +115,17 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find equivalent mass of metal\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"P=104.3 #total pressure in KPa\n",
"pH2O=2.3 #in KPa\n",
"pH2=P-pH2O; #in KPa\n",
"\n",
- "# Calculations and Results\n",
"VH2=209*pH2*273/(293*101.3)\n",
"\n",
"print \"volume of hydrogen obtained = %f ml\"%(VH2)\n",
"\n",
- "#calculating amount of metal having 11.2l of hydrogen\n",
"\n",
"m=350/196.08*11.2 #mass of metal in grams\n",
"print \"mass of metal equivalent to 11.2 litre/mol of hydrogen = %f gm\"%(m)\n"
@@ -167,15 +156,11 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find NaCl content in NaOH solution\n",
"\n",
"import math \n",
- "# Variables\n",
"w=2 #in gm\n",
"m=0.287 #in gm\n",
"\n",
- "# Calculations and Results\n",
- "#precipitate from 58.5gm of NaCl=143.4gm\n",
"mNaCl=58.5/143.4*m;\n",
"\n",
"print \"mass of NaCl = %f gm\"%(mNaCl )\n",
@@ -209,20 +194,16 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the carbon content in sample\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"w=4.73 #in gm5\n",
"VCO2=5.30 #in liters\n",
"\n",
- "# Calculations\n",
"weight_CO2=44/22.4*VCO2;\n",
"carbon_content=12./44*weight_CO2;\n",
"percentage_content=(carbon_content/w)*100;\n",
"\n",
- "# Results\n",
"print \"percentage amount of carbon in sample = %f\"%(percentage_content)\n"
],
"language": "python",
@@ -250,19 +231,15 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the volume of air\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"volume_H2=0.5 #in m3\n",
"volume_CH4=0.35 #in m3\n",
"volume_CO=0.08 #in m3\n",
"volume_C2H4=0.02 #in m3\n",
"volume_oxygen=0.21 #in m3 in air\n",
"\n",
- "# Calculations\n",
- "#required oxygen for various gases\n",
"H2=0.5*volume_H2;\n",
"CH4=2*volume_CH4;\n",
"CO=0.5*volume_CO;\n",
@@ -271,7 +248,6 @@
"total_O2=H2+CH4+CO+C2H4;\n",
"oxygen_required=total_O2/volume_oxygen;\n",
"\n",
- "# Results\n",
"print \"amount of oxygen required = %f cubic meter\"%(oxygen_required)\n"
],
"language": "python",
@@ -299,23 +275,19 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the volume of sulphuric acid and mass of water consumed\n",
"\n",
"import math \n",
"\n",
"\n",
- "# Variables\n",
"density_H2SO4 = 1.10 #in g/ml\n",
"mass_1 = 100*density_H2SO4; #mass of 100ml of 15% solution\n",
"mass_H2SO4 = 0.15*mass_1;\n",
"density_std = 1.84 #density of 96% sulphuric acid\n",
"mass_std = 0.96*density_std; #mass of H2SO4 in 1ml 96% H2SO4\n",
"\n",
- "# Calculations\n",
"volume_std = mass_H2SO4/mass_std; #volume of 96%H2SO4\n",
"mass_water = mass_1 - mass_H2SO4;\n",
"\n",
- "# Results\n",
"print \"volume of 0.96 H2SO4 required = %f ml\"%(volume_std)\n",
"print \"mass of water required = %f g\"%(mass_water)\n"
],
@@ -345,18 +317,15 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find molarity,molality and normality\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"w_H2SO4=0.15 #in gm/1gm solution\n",
"density=1.10 #in gm/ml\n",
"m=density*1000; #mass per liter\n",
"weight=m*w_H2SO4; #H2SO4 per liter solution\n",
"molar_mass=98;\n",
"\n",
- "# Calculations and Results\n",
"Molarity=weight/molar_mass;\n",
"print \"Molarity = %f mol/l\"%(Molarity)\n",
"\n",
@@ -394,18 +363,14 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find normality\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"molar_mass_BaCl2=208.3; #in gm\n",
"equivalent_H2SO4=0.144;\n",
"\n",
- "# Calculations\n",
"normality=equivalent_H2SO4*1000/28.8;\n",
"\n",
- "# Results\n",
"print \"Normality = %f N\"%(normality)\n"
],
"language": "python",
@@ -433,20 +398,16 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find amount of KClO3 precipitated\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"solubility_70=30.2 #in gm/100gm\n",
"w_solute=solubility_70*350/130.2; #in gm\n",
"\n",
- "# Calculations\n",
"w_water=350-w_solute;\n",
"solubility_30=10.1 #in gm/100gm\n",
"precipitate=(solubility_70-solubility_30)*w_water/100\n",
"\n",
- "# Results\n",
"print \"amount precipitated = %f gm\"%(precipitate)\n"
],
"language": "python",
@@ -474,19 +435,15 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the pressure for solubility of CO2\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"absorbtion_coefficient=1.71 #in liters\n",
"molar_mass=44;\n",
"\n",
- "# Calculations\n",
"solubility=absorbtion_coefficient*molar_mass/22.4; #in gm\n",
"pressure=8/solubility*101.3;\n",
"\n",
- "# Results\n",
"print \"pressure required = %f kPa\"%(pressure)\n"
],
"language": "python",
@@ -514,23 +471,19 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the vapor pressure of water\n",
"\n",
"import math \n",
"\n",
"\n",
- "# Variables\n",
"w_water=540. #in gm\n",
"w_glucose=36. #in gm\n",
"m_water=18.; #molar mass of water\n",
"m_glucose=180.; #molar mass of glucose\n",
"\n",
- "# Calculations\n",
"x=(w_water/m_water)/(w_water/m_water+w_glucose/m_glucose);\n",
"p=8.2*x;\n",
"depression=8.2-p;\n",
"\n",
- "# Results\n",
"print \"depression in vapor pressure = %f Pa\"%(depression*1000)\n"
],
"language": "python",
@@ -558,21 +511,17 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the boiling point of solution\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"w_glucose=9. #in gm\n",
"w_water=100. #in gm\n",
"E=0.52;\n",
"m=90/180.; #moles/1000gm water\n",
"\n",
- "# Calculations\n",
"delta_t=E*m;\n",
"boiling_point=100+delta_t;\n",
"\n",
- "# Results\n",
"print \"boiling_point of water = %f degreeC\"%(boiling_point)\n"
],
"language": "python",
@@ -600,16 +549,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the molar mass and osmotic pressure\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"K=1.86;\n",
"c=15 #concentration of alcohol\n",
"delta_t=10.26;\n",
"\n",
- "# Calculations and Results\n",
"m=delta_t/K; #molality\n",
"M=c/(m*85); #molar mass\n",
"print \"molar mass = %f gm\"%(M*1000)\n",
@@ -648,22 +594,18 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find u_in, M_v, k'\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"u_in = 0.575 #from the graph\n",
"u_s = 0.295 #in mPa-s\n",
"\n",
- "# Calculations\n",
"M_v = (u_in/(5.80*10**-5))**(1/0.72);\n",
"u_red = 0.628; #in dl/g\n",
"\n",
"c = 0.40 #in g/dl\n",
"k = (u_red-u_in)/((u_in**2)*c);\n",
"\n",
- "# Results\n",
"print \"k = %f Mv = %fu_in = %f dl/gm\"%(k,M_v,u_in)\n"
],
"language": "python",
@@ -691,11 +633,9 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the molecular formula\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"C=54.5 #% of carbon\n",
"H2=9.1 #% of hydrogen\n",
"O2=36.4 #% of oxygen\n",
@@ -705,13 +645,11 @@
"molar_mass=88.;\n",
"density=44.;\n",
"\n",
- "# Calculations\n",
"ratio=molar_mass/density;\n",
"x=ratio*2;\n",
"y=ratio*1;\n",
"z=ratio*4;\n",
"\n",
- "# Results\n",
"print \"x = %f y = %f z = %f\"%(x,y,z)\n",
"print \"formula of butyric acid is = C4H8O2\"\n"
],
@@ -741,11 +679,9 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find molecular foemula \n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"C=93.75 #% of carbon\n",
"H2=6.25 #% of hydrogen\n",
"x=C/12 #number of carbon atoms\n",
@@ -753,12 +689,10 @@
"molar_mass=64\n",
"density=4.41*29;\n",
"\n",
- "# Calculations\n",
"ratio=density/molar_mass;\n",
"x=round(ratio*5);\n",
"y=round(ratio*4);\n",
"\n",
- "# Results\n",
"print \"x = %f y = %f\"%(x,y)\n",
"print \"formula of butyric acid is = C10H8\"\n",
"\n"
@@ -789,11 +723,9 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find molecular formula\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"C=50.69 #% of carbon\n",
"H2=4.23 #% of hydrogen\n",
"O2=45.08 #% of oxygen\n",
@@ -802,7 +734,6 @@
"b=H2/2; #number of hydrogen molecules\n",
"molar_mass=71;\n",
"\n",
- "# Calculations and Results\n",
"def f(m):\n",
" return (2.09*1000)/(60*m);\n",
"\n",
@@ -849,18 +780,15 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the molecular formula\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"C=64.6 #% of carbon\n",
"H2=5.2 #% of hydrogen\n",
"O2=12.6 #% of oxygen\n",
"N2=8.8 #% of nitrogen\n",
"Fe=8.8 #% of iron\n",
"\n",
- "# Calculations\n",
"a=C/12; #number of carbon molecules\n",
"c=8.8/14; #number of nitrogen molecules\n",
"b=H2; #number of hydrogen molecules\n",
@@ -871,7 +799,6 @@
"\n",
"molar_mass=63.3/cm;\n",
" \n",
- "# Results \n",
"print \"a = %d, b = %d, c = %d, d = %d, e = %d\"%(a*6.5,b*6.5,c*6.5,d*6.5,e*6.5)\n",
"print \"formula of butyric acid is = C34H33N4O5Fe\"\n",
"\n"
@@ -902,20 +829,16 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find sequence of deposition\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"E1=-0.25;\n",
"E2=0.80;\n",
"E3=0.34;\n",
"\n",
- "# Calculations\n",
"a=[E1,E2,E3];\n",
"sorted(a)\n",
"\n",
- "# Results\n",
"print \"sorted potential in volts =\"\n",
"print (a)\n",
"print (\"E2>E3>E1\")\n",
@@ -951,22 +874,18 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the emf of cell\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"E0_Zn=-0.76;\n",
"E0_Pb=-0.13;\n",
"c_Zn=0.1;\n",
"c_Pb=0.02;\n",
"\n",
- "# Calculations\n",
"E_Zn=E0_Zn+(0.059/2)*math.log10(c_Zn);\n",
"E_Pb=E0_Pb+(0.059/2)*math.log10(c_Pb);\n",
"E=E_Pb-E_Zn;\n",
"\n",
- "# Results\n",
"print \"emf of cell = %f V\"%(E)\n",
"print \"Since potential of lead is greater than that of zinc thus reduction will occur at\\\n",
" lead electrode and oxidation will occur at zinc electrode\"\n"
@@ -997,22 +916,18 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the emf of cell\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"E0_Ag=0.80;\n",
"E0_AgNO3=0.80;\n",
"c_Ag=0.001;\n",
"c_AgNO3=0.1;\n",
"\n",
- "# Calculations\n",
"E_Ag=E0_Ag+(0.059)*math.log10(c_Ag);\n",
"E_AgNO3=E0_AgNO3+(0.059)*math.log10(c_AgNO3);\n",
"E=E_AgNO3-E_Ag;\n",
"\n",
- "# Results\n",
"print \"emf of cell = %f V\" %(E)\n",
"print \"since E is positive, the left hand electrode will be anode and\\\n",
" the electron will travel in the external circuit from the left hand to the right hand electrode\"\n"
@@ -1043,18 +958,14 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find emf of cell\n",
"\n",
"import math \n",
- "# Variables\n",
"pH=12; #pH of solution\n",
"E_H2=0;\n",
"\n",
- "# Calculations\n",
"E2=-0.059*pH;\n",
"E=E_H2-E2;\n",
"\n",
- "# Results\n",
"print \"EMF of cell = %f V\"%(E)\n"
],
"language": "python",
@@ -1082,20 +993,16 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find amount of silver deposited\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"I=3 #in Ampere\n",
"t=900 #in s\n",
"m_eq=107.9 #in gm/mol\n",
"F=96500;\n",
"\n",
- "# Calculations\n",
"m=(I*t*m_eq)/F;\n",
"\n",
- "# Results\n",
"print \"mass = %f gm\"%(m)\n"
],
"language": "python",
@@ -1123,24 +1030,20 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the time for electroplating\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"volume=10*10*0.005; #in cm3\n",
"mass=volume*8.9;\n",
"F=96500;\n",
"atomic_mass=58.7 #in amu\n",
"current=2.5 #in Ampere\n",
"\n",
- "# Calculations\n",
"charge=(8.9*F*2)/atomic_mass;\n",
"yield_=0.95;\n",
"actual_charge=charge/(yield_*3600);\n",
"t=actual_charge/current;\n",
"\n",
- "# Results\n",
"print \"time required = %f hours\"%(t)\n"
],
"language": "python",
@@ -1168,17 +1071,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find hardness of water\n",
"\n",
- "# Variables\n",
"m_MgSO4=90. #in ppm\n",
"MgSO4_parts=120.;\n",
"CaCO3_parts=100.;\n",
"\n",
- "# Calculations\n",
"hardness=(CaCO3_parts/MgSO4_parts)*m_MgSO4;\n",
"\n",
- "# Results\n",
"print \"hardness of water = %f mg/l\"%(hardness)\n"
],
"language": "python",
@@ -1214,7 +1113,6 @@
"\n",
"import math \n",
"\n",
- "# Variables\n",
"m1 = 162. #mass of calcium bi carbonate in mg\n",
"m2 = 73. #mass of magnesium bi carbonate in mg\n",
"m3 = 136. # mass of calsium sulfate in mg\n",
@@ -1222,19 +1120,16 @@
"m5 = 500. #mass of sodium cloride in mg\n",
"m6 = 50. # mass of potassium cloride in mg\n",
"\n",
- "# Calculations and Results\n",
"content_1 = m1*100/m1; #content of calcium bi carbonate in mg\n",
"content_2 = m2*100/(2*m2); #content of magnesium bi carbonate in mg\n",
"content_3 = m3*100/m3; # content of calsium sufate in mg\n",
"content_4 = m4*100/m4; # content of magnesium cloride\n",
"\n",
- "#part_1\n",
"\n",
"temp_hardness = content_1 + content_2; #depends on bicarbonate only\n",
"total_hardness = content_1+content_2+content_3+content_4;\n",
"print \"total hardness = %.0f mg/l temporary hardness = %.0f mg/l\"%(temp_hardness,total_hardness)\n",
"\n",
- "#part 2\n",
"wt_lime = (74./100)*(content_1+2*content_2+content_4);\n",
"actual_lime = wt_lime/0.85;\n",
"print \"amount of lime required = %.1f mg/l\"%(actual_lime)\n",
@@ -1270,19 +1165,15 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find hardness of water\n",
"\n",
- "# Variables\n",
"volume_NaCl=50. #in l\n",
"c_NaCl=5000. #in mg/l\n",
"\n",
- "# Calculations\n",
"m=volume_NaCl*c_NaCl;\n",
"equivalent_NaCl=50/58.5;\n",
"\n",
"hardness=equivalent_NaCl*m;\n",
"\n",
- "# Results\n",
"print \"hardness of water = %f mg/l\"%(hardness/1000.)\n"
],
"language": "python",
@@ -1310,16 +1201,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the total vapor pressure and molar compositions\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"m_benzene = 55. #in kg\n",
"m_toluene = 28. #in kg\n",
"m_xylene = 17. # in kg\n",
"\n",
- "# Calculations and Results\n",
"mole_benzene = m_benzene/78.;\n",
"mole_toluene = m_toluene/92.;\n",
"mole_xylene = m_xylene/106.;\n",
@@ -1364,22 +1252,17 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the mixture composition\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"vapor_pressure=8. #in kPa\n",
"pressure=100. #in kPa\n",
"\n",
- "# Calculations and Results\n",
- "#part 1\n",
"volume=1 #in m3\n",
"volume_ethanol=volume*(vapor_pressure/pressure);\n",
"volume_air=1-volume_ethanol;\n",
"print \"volumetric composition:- air composition = %f ethanol compostion = %f\"%(volume_air*100,volume_ethanol*100)\n",
"\n",
- "#part 2\n",
"molar_mass_ethanol=46;\n",
"molar_mass_air=28.9;\n",
"mass_ethanol=0.08*molar_mass_ethanol; #in kg\n",
@@ -1388,16 +1271,13 @@
"fraction_air=(mass_air*100)/(mass_air+mass_ethanol);\n",
"print \"composition by weight:-Air = %f Ethanol vapor = %f\"%(fraction_air,fraction_ethanol)\n",
"\n",
- "#part 3\n",
"mixture_volume=22.3*(101.3/100)*(299./273); #in m3\n",
"weight_ethanol=mass_ethanol/mixture_volume;\n",
"print \"weight of ethanol/cubic meter = %f Kg\"%(weight_ethanol)\n",
"\n",
- "#part 4\n",
"w_ethanol=mass_ethanol/mass_air;\n",
"print \"weight of ethanol/kg vapor free air = %f Kg\"%(w_ethanol)\n",
"\n",
- "#part 5\n",
"moles_ethanol=0.08/0.92;\n",
"print \"kmol of ethanol per kmol of vapor free air = %f\"%(moles_ethanol)\n"
],
@@ -1430,23 +1310,18 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find relative saturation and dew point\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"vapor_pressure=8. #in kPa\n",
"volume_ethanol=0.05;\n",
"\n",
"\n",
- "# Calculations and Results\n",
- "#basis 1kmol of mixture\n",
"partial_pressure=volume_ethanol*100;\n",
"relative_saturation=partial_pressure/vapor_pressure;\n",
"mole_ratio=volume_ethanol/(1-volume_ethanol);\n",
"print \"mole ratio = %f \\nrelative saturation = %f %%\"%(mole_ratio,relative_saturation*100)\n",
"\n",
- "#basis 1kmol saturated gas mixture at 100kPa\n",
"volume_vapor=(8./100)*100;\n",
"ethanol_vapor=volume_vapor/100.;\n",
"air_vapor=1-ethanol_vapor;\n",
@@ -1455,7 +1330,6 @@
"\n",
"print \"percentage saturation = %f %%\"%(percentage_saturation*100)\n",
"\n",
- "#dew point\n",
"print \"corresponding to partial pressure of 5kPa we get a dew point of 17.3 degree celcius\"\n"
],
"language": "python",
@@ -1486,26 +1360,21 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the properties of humid air\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"p = 4.24 #in kPa\n",
"H_rel = 0.8;\n",
"\n",
- "# Calculations and Results\n",
"p_partial = p*H_rel;\n",
"molal_H = p_partial/(100-p_partial);\n",
"print \"initial molal humidity = %.3f\"%(molal_H)\n",
"\n",
- "#part 2\n",
"P = 200. #in kPa\n",
"p_partial = 1.70 #in kPa\n",
"final_H = p_partial/(P-p_partial);\n",
"print \"final molal humidity = %.4f\"%(final_H)\n",
"\n",
- "#part 3\n",
"p_dryair = 100 - 3.39;\n",
"v = 100*(p_dryair/101.3)*(273./303);\n",
"moles_dryair = v/22.4;\n",
@@ -1514,7 +1383,6 @@
"water_condensed = (vapor_initial-vapor_final)*18;\n",
"print \"amount of water condensed = %f kg\"%(water_condensed)\n",
"\n",
- "#part 4\n",
"total_air = moles_dryair+vapor_final;\n",
"final_v = 22.4*(101.3/200)*(288./273)*total_air;\n",
"print \"final volume of wety air = %f m**3\"%(final_v)\n"
diff --git a/Introduction_To_Chemical_Engineering/ch3.ipynb b/Introduction_To_Chemical_Engineering/ch3.ipynb
index e6461254..0b6043d2 100644
--- a/Introduction_To_Chemical_Engineering/ch3.ipynb
+++ b/Introduction_To_Chemical_Engineering/ch3.ipynb
@@ -27,15 +27,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the coal consumption\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"w_C = 0.6; #amount of carbon in coal\n",
"N2_content = 40. #in m3 per 100m3 air\n",
"\n",
- "# Calculations\n",
"air_consumed = N2_content/0.79;\n",
"weight_air = air_consumed*(28.8/22.4);\n",
"O2_content = air_consumed*32*(0.21/22.4); #in kg\n",
@@ -50,7 +47,6 @@
"total_consumption = C_consumption1+C_consumption2;\n",
"coal_consumption = total_consumption/w_C;\n",
"\n",
- "# Results\n",
"print \"coal consumption = %f kg\"%(coal_consumption)\n"
],
"language": "python",
@@ -78,16 +74,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find amount of ammonia and air consumed\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"NH3_required = (17./63)*1000; #NH3 required for 1 ton of nitric acid\n",
"NO_consumption = 0.96;\n",
"HNO3_consumption = 0.92;\n",
"\n",
- "# Calculations and Results\n",
"NH3_consumed = NH3_required/(NO_consumption*HNO3_consumption);\n",
"volume_NH3 = NH3_consumed*(22.4/17);\n",
"print \"volume of ammonia consumed= %f cubic metre/h\"%(volume_NH3)\n",
@@ -122,17 +115,14 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the consumption of NaCl and H2SO4 in HCl consumption\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"HCl_production = 500. #required to be produced in kg\n",
"NaCl_required = (117./73)*HCl_production;\n",
"yield_ = 0.92;\n",
"purity_NaCl= 0.96;\n",
"\n",
- "# Calculations and Results\n",
"actual_NaCl = NaCl_required/(purity_NaCl*yield_);\n",
"print \"amount of NaCl required = %f kg\"%(actual_NaCl)\n",
"\n",
@@ -170,20 +160,15 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the period of service\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"C2H2_produced = (1./64)*0.86; #in kmol\n",
"volume_C2H2 = C2H2_produced*22.4*1000; #in l\n",
"\n",
- "# Calculations\n",
- "#assuming ideal behaviour,\n",
"volume = (100/101.3)*(273./(273+30));\n",
"time = (volume_C2H2/volume)*(1./60);\n",
"\n",
- "# Results\n",
"print \"time of service = %f hr\"%(time)\n",
"\n"
],
@@ -212,17 +197,14 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the screen effectiveness\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"xv = 0.88;\n",
"xf = 0.46;\n",
"xl = 0.32;\n",
"F= 100. #in kg\n",
"\n",
- "# Calculations and Results\n",
"L = (F*(xf-xv))/(xl-xv);\n",
"V = F-L;\n",
"print \"L = %f Kg V = %f Kg\"%(L,V)\n",
@@ -264,16 +246,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the flow rate and concentration\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"G1 = 3600. #in m3/h\n",
"P = 106.6 #in kPa\n",
"T = 40 #in degree C\n",
"\n",
- "# Calculations and Results\n",
"q = G1*(P/101.3)*(273./((273+T))); #in m3/s\n",
"m = q/22.4; #in kmol/h\n",
"y1 = 0.02;\n",
@@ -284,16 +263,12 @@
"Gs = m*(1-y1);\n",
"print \"moles of benzene free gas = %f kmol drygas/h\"%(Gs)\n",
"\n",
- "#for 95% removal\n",
"Y2 = Y1*(1-0.95);\n",
"print \"final mole ratio of benzene = %f kmol benzene/kmol dry gas\"%(Y2)\n",
"\n",
"x2 = 0.002\n",
"X2 = 0.002/(1-0.002);\n",
"\n",
- "#at equilibrium y* = 0.2406X\n",
- "#part 1\n",
- "#for oil rate to be minimum the wash oil leaving the absorber must be in equilibrium with the entering gas\n",
"\n",
"y1 = 0.02;\n",
"x1 = y1/(0.2406);\n",
@@ -301,7 +276,6 @@
"min_Ls = Gs*((Y1-Y2)/(X1-X2));\n",
"print \"minimum Ls required = %f kg/h\"%(min_Ls*260)\n",
"\n",
- "#for 1.5 times of the minimum\n",
"Ls = 1.5*min_Ls;\n",
"print \"flow rate of wash oil = %f kg/h\"%(Ls*260)\n",
"X1 = X2 + (Gs*((Y1-Y2)/Ls));\n",
@@ -337,47 +311,38 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the extraction of nicotine\n",
"\n",
"from scipy.optimize import fsolve \n",
"import math \n",
"\n",
- "# Variables\n",
"xf = 0.01\n",
"Xf = xf/(1-xf);\n",
"Feed = 100 #feed in kg\n",
"\n",
- "# Calculations and Results\n",
"c_nicotine = Feed*Xf; #nicotine conc in feed\n",
"c_water = Feed*(1-Xf) #water conc in feed\n",
"\n",
- "#part 1\n",
"def F1(x):\n",
" return (x/150.)-0.9*((1-x)/99.);\n",
"\n",
- "#initial guess\n",
"x = 10.;\n",
"y = fsolve(F1,x)\n",
"print \"amount of nicotine removed N = %f kg\"%(y)\n",
- "#part 2\n",
"def F2(x):\n",
" return (x/50.)-0.9*((1-x)/99.);\n",
"\n",
- "#initial guess\n",
"x = 10.;\n",
"N1 = fsolve(F2,x)\n",
"print \"amount of nicotine removed in stage 1, N1 = %f kg\"%(N1)\n",
"def F3(x):\n",
" return (x/50.)-0.9*((1-x-N1)/99.);\n",
"\n",
- "#initial guess\n",
"x = 10.;\n",
"N2 = fsolve(F3,x)\n",
"print \"amount of nicotine removed in stage 2, N2 = %f kg\"%(N2)\n",
"def F4(x):\n",
" return (x/50.)-0.9*((1-x-N2-N1)/99.);\n",
"\n",
- "#initial guess\n",
"x = 10.;\n",
"N3 = fsolve(F4,x)\n",
"\n",
@@ -414,11 +379,9 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the amount of water in residue\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"vp_water = 31.06 #in kPa\n",
"vp_benzene = 72.92 #in kPa\n",
"\n",
@@ -426,13 +389,11 @@
"x_benzene = vp_benzene/P;\n",
"x_water = vp_water/P;\n",
"\n",
- "# Calculations\n",
"initial_water = 50./18; #in kmol of water\n",
"initial_benzene = 50./78 #in kmol of benzene\n",
"water_evaporated = initial_benzene*(x_water/x_benzene);\n",
"water_left = (initial_water - water_evaporated);\n",
"\n",
- "# Results\n",
"print \"amount of water left in residue = %f kg\"%(water_left*18)\n"
],
"language": "python",
@@ -460,15 +421,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the vapor content of dimethylanaline\n",
"\n",
"import math \n",
- "# Variables\n",
"po_D = 4.93 #in kPa\n",
"po_W = 96.3 #in kPa\n",
"n = 0.75 #vaporization efficiency\n",
"\n",
- "# Calculations and Results\n",
"P = n*po_D+po_W;\n",
"print \"P = %f kPa\"%(P)\n",
"\n",
@@ -477,7 +435,6 @@
"wt_dimethylanaline = (x_dimethylanaline*121)/(x_dimethylanaline*121+x_water*18);\n",
"print \"weight of dimethylanaline in water = %f\"%(wt_dimethylanaline*100)\n",
"\n",
- "#part 1\n",
"n = 0.8;\n",
"po_D = 32 #in kPa\n",
"actual_vp = n*po_D;\n",
@@ -485,7 +442,6 @@
"steam_required = (p_water*18)/(actual_vp*121);\n",
"print \"amount of steam required = %f kg steam/kg dimethylanaline\"%(steam_required)\n",
"\n",
- "#part 2\n",
"x_water = p_water/100.;\n",
"wt_water = x_water*18./(x_water*18+(1-x_water)*121.);\n",
"print \"weight of water vapor = %f weight of dimethylanaline =%f\"%(wt_water*100,100*(1-wt_water))\n"
@@ -518,22 +474,18 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the amount of water evaporated\n",
"\n",
"import math \n",
- "# Variables\n",
"xf = 0.15;\n",
"xl = (114.7)/(114.7+1000);\n",
"xc = 1;\n",
"\n",
- "# Calculations\n",
"K2Cr2O7_feed = 1000*0.15; #in kg\n",
"\n",
"n = 0.8;\n",
"C = n*K2Cr2O7_feed;\n",
"V = (K2Cr2O7_feed-120 - 880*0.103)/(-0.103);\n",
"\n",
- "# Results\n",
"print \"amount of water evaporated = %f kg\"%(V)\n"
],
"language": "python",
@@ -561,15 +513,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the yield of crystals\n",
"\n",
"import math \n",
- "# Variables\n",
"xc = round(106./286,3);\n",
"xf = 0.25;\n",
"xl = round(27.5/127.5,3);\n",
"\n",
- "# Calculations\n",
"water_present = 100*(1-xf); #in kg\n",
"V = 0.15*75; #in kg\n",
"C = (100*xf - 88.7*xl)/(xc-xl);\n",
@@ -577,7 +526,6 @@
"\n",
"yield_ = (C/Na2CO3_feed)*100;\n",
"\n",
- "# Results\n",
"print \"yield = %.1f %%\"%(yield_)\n"
],
"language": "python",
@@ -605,24 +553,20 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the fraction of air recirculated\n",
"\n",
"import math \n",
- "# Variables\n",
"r = 50. #weight of dry air passing through drier\n",
"w1 = 1.60 #in kg per kg dry solid\n",
"w2 = 0.1 #in kg/kg dry solid\n",
"H0 = 0.016 #in kg water vapor/kg dry air\n",
"H2 = 0.055 #in kg water vapor/kg dry air\n",
"\n",
- "# Calculations and Results\n",
"y = 1 - (w1-w2)/(r*(H2-H0));\n",
"print \"fraction of air recirculated = %f\"%(y)\n",
"\n",
"H1 = H2 - (w1-w2)/r;\n",
"print \"humidity of air entering the drier = %f kg water vapor/kg kg dry air\"%(H1)\n",
"\n",
- "#check\n",
"H11 = H2*y+H0*(1-y);\n",
"if H1 == H11:\n",
" print \"fraction of air recirculated = %f verified\"%(y)\n"
@@ -654,15 +598,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the volumetric flow rate and fraction of air passing through the cooler\n",
"\n",
"import math \n",
- "# Variables\n",
"Hf = 0.012;\n",
"Hi = 0.033;\n",
"H1 = 0.0075;\n",
"\n",
- "# Calculations and Results\n",
"water_vapor = Hf/18.; #in kmol of water vapor\n",
"dry_air = 1/28.9; #in kmol\n",
"total_mass = water_vapor+dry_air;\n",
@@ -671,12 +612,10 @@
"weight = 60/volume;\n",
"print \"weight of dry air handled per hr = %f kg\"%(weight)\n",
"\n",
- "#part 1\n",
"inlet_watervapor = 0.033/18; #in kmol of water vapor\n",
"volume_inlet = 22.4*(308./273)*(inlet_watervapor+dry_air);\n",
"print \"volumetric flow rate of inlet air = %f cubic meter\"%(volume_inlet*weight)\n",
"\n",
- "#part 2\n",
"y = (Hf - Hi)/(H1 - Hi);\n",
"print \"fraction of inlet air passing through cooler = %f\"%(y)\n"
],
@@ -707,25 +646,18 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the fraction of purged recycle and total yield\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
- "#x- moles of N2 and H2 recycled; y - moles of N2 H2 purged\n",
"Ar_freshfeed = 0.2;\n",
- "#argon in fresh feed is equal to argon in purge \n",
"\n",
- "# Calculations and Results\n",
"y = 0.2/0.0633; #argon in purge = 0.0633y\n",
"x = (0.79*100 - y)/(1-0.79);\n",
"print \"y = %f kmolx = %f kmol\"%(y,x)\n",
"\n",
- "#part 1\n",
"fraction = y/x;\n",
"print \"fration of recycle that is purged = %f\"%(fraction)\n",
"\n",
- "#part 2\n",
"yield_ = 0.105*(100+x);\n",
"print \"overall yield of ammonia = %f kmol\"%(yield_)\n"
],
@@ -756,18 +688,14 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find change in enthalpy\n",
"\n",
"import math \n",
- "# Variables\n",
"H0_CH4 = -74.9 #in kJ\n",
"H0_CO2 = -393.5 #in kJ\n",
"H0_H2O = -241.8 #in kJ\n",
"\n",
- "# Calculations\n",
"delta_H0 = H0_CO2+2*H0_H2O-H0_CH4;\n",
"\n",
- "# Results\n",
"print \"change in enthalpy = %f kJ\"%(delta_H0)\n"
],
"language": "python",
@@ -795,21 +723,16 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to compare the enthalpy change in two reactions\n",
"\n",
"import math \n",
- "# Variables\n",
"H0_glucose = -1273 #in kJ\n",
"H0_ethanol = -277.6 #in kJ\n",
"H0_CO2 = -393.5 #in kJ\n",
"H0_H2O = -285.8 #in kJ\n",
"\n",
- "# Calculations and Results\n",
- "#for reaction 1\n",
"delta_H1 = 2*H0_ethanol+2*H0_CO2-H0_glucose;\n",
"print \"enthalpy change in reaction 1 = %f KJ\"%(delta_H1)\n",
"\n",
- "#for reaction 2\n",
"delta_H2 = 6*H0_H2O+6*H0_CO2-H0_glucose;\n",
"print \"enthalpy change in reaction 2 = %f kJ\"%(delta_H2)\n",
"\n",
@@ -845,19 +768,15 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find enthalpy of formation of CuSO4.5H2O\n",
"\n",
"import math \n",
- "# Variables\n",
"delta_H2 = 11.7 #in kJ/mol\n",
"m_CuSO4 = 16 #in gm\n",
"m_H2O = 384 #in gm\n",
"\n",
- "# Calculations\n",
"delta_H3 = -((m_CuSO4+m_H2O)*4.18*3.95*159.6)/(16*10**3)\n",
"delta_H1 = delta_H3 - delta_H2;\n",
"\n",
- "# Results\n",
"print \"enthalpy of formation = %f kJ/mol\"%(delta_H1)\n"
],
"language": "python",
@@ -885,20 +804,16 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the temperature of combustion\n",
"\n",
"import math \n",
- "# Variables\n",
"H_combustion = 1560000 #in kJ/kmol \n",
"H0_CO2 = 54.56 #in kJ/kmol\n",
"H0_O2 = 35.2 #in kJ/kmol\n",
"H0_steam = 43.38 #in kJ/kmol\n",
"H0_N2 = 33.32 #in kJ/kmol\n",
"\n",
- "# Calculations\n",
"t = H_combustion/(2*H0_CO2+3*H0_steam+0.875*H0_O2+16.46*H0_N2);\n",
"\n",
- "# Results\n",
"print \"theoritical temperature of combustion = %f degree C\"%(t)\n"
],
"language": "python",
@@ -926,16 +841,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the heat of reaction and consumption of coke\n",
"\n",
"import math \n",
- "# Variables\n",
"H_NaCl = 410.9 #in MJ/kmol\n",
"H_H2SO4 = 811.3 #in MJ/kmol\n",
"H_Na2SO4 = 1384 #in MJ/kmol\n",
"H_HCl = 92.3 #in MJ/kmol\n",
"\n",
- "# Calculations and Results\n",
"Q = H_Na2SO4 + 2*H_HCl -2*H_NaCl-H_H2SO4;\n",
"print \"heat of reaction = %f MJ\"%(Q)\n",
"\n",
@@ -969,21 +881,17 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the rate of heat flow\n",
"\n",
"import math \n",
- "# Variables\n",
"cp_water = 146.5 #in kj/kg\n",
"cp_steam = 3040 #in kJ/kg\n",
"d = 0.102 #in m\n",
"u = 1.5 #in m/s\n",
"density = 1000 #in kg/m3\n",
"\n",
- "# Calculations\n",
"m = (3.14/4)*d**2*u*density;\n",
"Q = m*(cp_steam-cp_water);\n",
"\n",
- "# Results\n",
"print \"rate of heat flow = %f kW\"%(Q)\n"
],
"language": "python",
@@ -1011,10 +919,8 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the amount of air required for combustion and composition of flue gas\n",
"\n",
"import math \n",
- "# Variables\n",
"wt_C = 0.75 #in kg\n",
"wt_H2 = 0.05 #in kg\n",
"wt_O2 = 0.12 #in kg\n",
@@ -1022,7 +928,6 @@
"wt_S = 0.01 #in kg\n",
"wt_ash = 0.04 #in kg\n",
"\n",
- "# Calculations and Results\n",
"O2_C = wt_C*(32./12); #in kg\n",
"O2_H2 = wt_H2*(16./2); #in kg\n",
"O2_S = wt_S*(32./32); #in kg\n",
@@ -1060,7 +965,6 @@
"print \"N2 = %f %%\"%(x_N2*100)\n",
"print \"O2 = %f %%\"%(x_O2*100)\n",
"\n",
- "# Note : answers are slightly different because of rounding error."
],
"language": "python",
"metadata": {},
@@ -1092,17 +996,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the composition of flue gas\n",
"\n",
"import math \n",
- "# Variables\n",
"C = 0.8 #in kg\n",
"H2 = 0.05 #in kg\n",
"S = 0.005 #in kg\n",
"ash = 0.145 #in kg\n",
"\n",
- "# Calculations and Results\n",
- "#required oxygen in kg\n",
"C_O2 = C*(32./12); \n",
"H2_O2 = H2*(16./2);\n",
"S_O2 = S*(32./32);\n",
@@ -1113,7 +1013,6 @@
"wt_airsupplied = 1.25*wt_air;\n",
"print \"amount of air supplied = %f kg\"%(wt_airsupplied)\n",
"\n",
- "#flue gas composition\n",
"m_N2 = wt_airsupplied*0.77; #in kg\n",
"mole_N2 = m_N2/28.;\n",
"\n",
@@ -1131,7 +1030,6 @@
"\n",
"m = m_N2+m_O2+m_CO2+m_H2O+m_SO2\n",
"\n",
- "#percent by weight\n",
"w_N2 = m_N2/m;\n",
"print \"percentage of N2 by weight = %f\"%(w_N2*100)\n",
"\n",
@@ -1149,7 +1047,6 @@
"\n",
"m1 = mole_N2+mole_O2+mole_CO2+mole_H2O+mole_SO2\n",
"\n",
- "#percent by mole \n",
"x_N2 = mole_N2/m1;\n",
"print \"percentage of N2 by mole = %f\"%(x_N2*100)\n",
"\n",
@@ -1201,16 +1098,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find volumetric composition of flue glass\n",
"\n",
"import math \n",
- "# Variables\n",
"wt_H2 = 0.15;\n",
"wt_C = 0.85;\n",
"O2_H2 = wt_H2*(16./2);\n",
"O2_C = wt_C*(32./12);\n",
"\n",
- "# Calculations and Results\n",
"total_O2 = O2_H2+O2_C;\n",
"wt_air = total_O2/0.23;\n",
"air_supplied = 1.15*(wt_air);\n",
@@ -1258,20 +1152,16 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the excess air supplied\n",
"\n",
"import math \n",
- "# Variables\n",
"N2 = 80.5 #in m3\n",
"air_supplied = N2/0.79 #in m3\n",
"volume_O2 = air_supplied*0.21; #in m3\n",
"O2_fluegas = 6.1 #in m3\n",
"\n",
- "# Calculations\n",
"O2_used = volume_O2 - O2_fluegas;\n",
"excess_air_supplied = (O2_fluegas/O2_used)*100;\n",
"\n",
- "# Results\n",
"print \"percentage of excess air supplied = %f\"%(excess_air_supplied)\n"
],
"language": "python",
@@ -1299,15 +1189,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the outlet temperature of water\n",
"\n",
"import math \n",
- "# Variables\n",
"q_NTP = 10*(200/101.3)*(273./313);\n",
"m_CO2 = 44*(q_NTP/22.4);\n",
"s_CO2 = 0.85 #in kJ/kg K\n",
"\n",
- "# Calculations\n",
"Q = m_CO2*s_CO2*(40-20) #Q = ms*delta_T\n",
"\n",
"d0 = 0.023 #in mm\n",
@@ -1322,7 +1209,6 @@
"s_water = 4.19 #in kJ/kg K\n",
"t = 15+(Q/(m_water*s_water));\n",
"\n",
- "# Results\n",
"print \"exit water temperature = %f degree C\"%(t)\n"
],
"language": "python",
@@ -1350,14 +1236,11 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the area of heating surface\n",
"\n",
"import math \n",
- "# Variables\n",
"F = 1000 #in kg\n",
"xF = 0.01 \n",
"\n",
- "# Calculations and Results\n",
"solid_feed = F*xF;\n",
"water_feed = F - solid_feed;\n",
"\n",
@@ -1379,7 +1262,6 @@
"tc = 108.4 #in degree C\n",
"hc = 454 #in kJ/kg\n",
"\n",
- "#applying heat balance\n",
"S = (F*hF-V*Hv-L*hL)/(hc-Hs);\n",
"print \"weight of steam required = %f kg/hr\"%(S)\n",
"\n",
@@ -1415,10 +1297,8 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the top and bottom product,condenser duty,heat input to rebpoiler\n",
"\n",
"import math \n",
- "# Variables\n",
"hF = 171 #in kJ/kg\n",
"hD = 67 #in kJ/kg\n",
"hL = hD;\n",
@@ -1432,7 +1312,6 @@
"xW = 0.02;\n",
"xD = 0.97;\n",
"\n",
- "# Calculations and Results\n",
"D = F*(xF-xW)/(xD-xW);\n",
"W = F-D;\n",
"\n",
@@ -1480,23 +1359,19 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the rate of crystal formation, cooling water rate, required area\n",
"\n",
"import math \n",
- "# Variables\n",
"F = 1000.; #in kg\n",
"V = 0.05*F; #in kg\n",
"xF = 0.48;\n",
"xL = 75./(100+75);\n",
"xC = 1.;\n",
"\n",
- "# Calculations and Results\n",
"C = (F*xF-950*xL)/(1-0.429);\n",
"print \"rate of crystal formation = %f kg\"%(C)\n",
"\n",
"L = F-C-V;\n",
"\n",
- "#cooling water\n",
"W = (F*2.97*(85-35)+126.9*75.2-V*2414)/(4.19*11);\n",
"print \"rate of cooling water = %f kg\"%(W)\n",
"\n",
@@ -1535,16 +1410,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the heat of combustion\n",
"\n",
"import math \n",
- "# Variables\n",
"delta_n = 10-12.; #mole per mole napthanlene\n",
"\n",
- "#basis 1g\n",
"moles_napthalene = (1./128);\n",
"\n",
- "# Calculations and Results\n",
"print ('part 1')\n",
"Qv = 40.28 #in kJ\n",
"Qp = Qv-(delta_n*moles_napthalene*8.3144*298./1000);\n",
diff --git a/Introduction_To_Chemical_Engineering/ch4.ipynb b/Introduction_To_Chemical_Engineering/ch4.ipynb
index 4c312cd2..3a5046ad 100644
--- a/Introduction_To_Chemical_Engineering/ch4.ipynb
+++ b/Introduction_To_Chemical_Engineering/ch4.ipynb
@@ -27,18 +27,14 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find water compressibility\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"delta_p=70.; #in bar\n",
"Et=20680. #in bar\n",
"\n",
- "# Calculations\n",
"compressibility = delta_p/Et;\n",
"\n",
- "# Results\n",
"print \"compressibilty of water = %f\"%(compressibility)\n"
],
"language": "python",
@@ -66,14 +62,11 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the viscosity of oil\n",
"\n",
"import math \n",
- "# Variables\n",
"F=0.5*9.8; #in N\n",
"A=3.14*0.05*0.15; #in m2\n",
"\n",
- "# Calculations and Results\n",
"shear_stress=F/A; #in Pa\n",
"print \"shear_stress = %f Pa\"%(shear_stress)\n",
"\n",
@@ -107,17 +100,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find variation of losses with velocity\n",
"\n",
"import math \n",
- "# Variables\n",
"loss_ratio=3.6; #delta_P2/delta_P1=3.6\n",
"velocity_ratio=2.; #u2/u1=2\n",
"\n",
- "# Calculations\n",
"n=math.log(loss_ratio,2); #delta_P2/delta_P1=(u2/u1)**n\n",
"\n",
- "# Results\n",
"print \"power constant = %f flow is turbulent\"%(n)\n"
],
"language": "python",
@@ -145,16 +134,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the boundary layer properties\n",
"\n",
"import math \n",
"print ('part 1')\n",
"\n",
- "# Variables\n",
"x=0.05 #in m\n",
"density=1000. #in kg/m3\n",
"\n",
- "# Calculations and Results\n",
"viscosity=1.*10**-3 #in Pa-s\n",
"u=1. #in m/s\n",
"Re=(density*u*x)/viscosity;\n",
@@ -210,10 +196,8 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the flow properties\n",
"\n",
"import math \n",
- "# Variables\n",
"d1=0.05 #in m\n",
"A1=(3.14*d1**2)/4.;\n",
"density_1=2.1 #in kg/m3\n",
@@ -221,7 +205,6 @@
"P1=1.8; #in bar\n",
"P2=1.3; #in bar\n",
"\n",
- "# Calculations and Results\n",
"w=density_1*A1*u1;\n",
"density_2=density_1*(P2/P1);\n",
"print \"density at section 2 = %f kg/cubic meter\"%(density_2)\n",
@@ -255,19 +238,15 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the temperature increase\n",
"\n",
"import math \n",
- "# Variables\n",
"Q=0.001*10**5 #in J/s\n",
"w=0.001*1000 #in kg/s\n",
"density=1000. #in kg/m3\n",
"cp=4.19*10**3 #in J/kg K\n",
"\n",
- "# Calculations\n",
"delta_T=Q/(w*cp);\n",
"\n",
- "# Results\n",
"print \"Temperature increase = %f degree celcius\"%(delta_T)\n"
],
"language": "python",
@@ -295,17 +274,14 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the pressure\n",
"\n",
"import math \n",
- "# Variables\n",
"u1=0; #in m/s\n",
"ws=0;\n",
"P1=0.7*10**5 #in Pa\n",
"P3=0\n",
"density=1000 #in kg/m3\n",
"\n",
- "# Calculations and Results\n",
"u3=((2*(P1-P3))/density)**0.5;\n",
"print \"u3 = %f m/s\"%(u3)\n",
"\n",
@@ -313,7 +289,6 @@
"u2=u3/ratio_area;\n",
"print \"u2 = %f m/s\"%(u2)\n",
"\n",
- "#applying bernoulli's equation\n",
"P2=1.7*10**5-((density*u2**2)/2)\n",
"print \"P2 = %f Pa\"%(P2)\n",
"print \"this flow is physically unreal\"\n"
@@ -346,15 +321,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the power requirements\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"Q=3800./(24*3600) #in m3/s\n",
"d=0.202 #in m\n",
"\n",
- "# Calculations\n",
"u=Q/((3.14/4)*d**2); #in m/s\n",
"delta_P=5.3*10**6 #in Pa\n",
"density=897. #in kg/m3\n",
@@ -363,7 +335,6 @@
"mass_flow_rate= Q*density;\n",
"power=(ws*mass_flow_rate)/0.6;\n",
"\n",
- "# Results\n",
"print \"power required = %f kW\"%(power/1000)\n",
"\n"
],
@@ -392,15 +363,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the tube length\n",
"\n",
"import math \n",
- "# Variables\n",
"density=1000 #in kg/m3\n",
"viscosity=1*10**-3 #in Pa s\n",
"P=100*1000 #in Pa\n",
"\n",
- "# Calculations and Results\n",
"vdP=P/density;\n",
"\n",
"Q=2.5*10**-3/(24*3600)\n",
@@ -411,7 +379,6 @@
"Re=density*u*0.0005/viscosity;\n",
"print \"Re = %f\"%(Re)\n",
"\n",
- "#F=18.86*L\n",
"L=(-u**2+vdP)/18.86;\n",
"print \"L = %f m\"%(L)\n"
],
@@ -442,16 +409,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the discharge pressure\n",
"\n",
"import math \n",
- "# Variables\n",
"d=0.025 #in m\n",
"u=3. #in m/s\n",
"density=894. #in kg/m3\n",
"viscosity=6.2*10**4 #in Pa-s\n",
"\n",
- "# Calculations and Results\n",
"Re=(u*d*density)/viscosity;\n",
"f=0.0045;\n",
"L=50.;\n",
@@ -489,15 +453,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the level difference\n",
"\n",
"import math \n",
- "# Variables\n",
"Q=0.8*10**-3; #in m3/s\n",
"d=0.026 #in m\n",
"A=(3.14*(d**2))/4 #in m2\n",
"\n",
- "# Calculations\n",
"u=Q/A; #in m/s\n",
"density=800 #in kg/m3\n",
"viscosity=0.0005 #in Pa-s\n",
@@ -507,7 +468,6 @@
"L=60\n",
"h_f=2*f*((u**2)/9.8)*(L/d);\n",
"\n",
- "# Results\n",
"print \"level difference = %f m\"%(h_f)\n"
],
"language": "python",
@@ -535,16 +495,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the engery cost\n",
"\n",
"import math \n",
- "# Variables\n",
"delta_z=50; #in m\n",
"L=290.36 #in m\n",
"d=0.18 #in m\n",
"Q=0.05 #in m3/s\n",
"\n",
- "# Calculations\n",
"A=(3.14*d**2)/4; #in m2\n",
"u=Q/A; #in m/s\n",
"density=1180; #in kg/m3\n",
@@ -558,7 +515,6 @@
"power=mass_flow_rate*ws/1000; #in KW\n",
"energy_cost=power*24*0.8;\n",
"\n",
- "# Results\n",
"print \"Energy cost = Rs %f\"%(energy_cost)\n"
],
"language": "python",
@@ -586,16 +542,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the pressure loss\n",
"\n",
"import math \n",
- "# Variables\n",
"density=998 #in kg/m3\n",
"viscosity=0.0008 #in Pa-s\n",
"d=0.03 #in m\n",
"u=1.2 #in m/s\n",
"\n",
- "# Calculations\n",
"Re=density*d*u/viscosity;\n",
"\n",
"f=0.0088;\n",
@@ -605,7 +558,6 @@
"delta_P=(2*f*u**2*L)/d; #in Pa\n",
"delta_P_coil=delta_P*(1+(3.54*(d/D)));\n",
"\n",
- "# Results\n",
"print \"frictional pressure drop = %f kPa\"%(delta_P_coil)\n"
],
"language": "python",
@@ -633,11 +585,9 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find pressure drop per unit length\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"b=0.050 #in m\n",
"a=0.025 #in m\n",
"d_eq=b-a #in m\n",
@@ -645,14 +595,12 @@
"u=3 #in m/s\n",
"viscosity = 0.001\n",
"\n",
- "# Calculations\n",
"Re=d_eq*u*density/viscosity;\n",
"\n",
"e=40*10**6 #in m\n",
"f=0.0062;\n",
"P_perunit_length=2*f*density*u**2/d_eq; #in Pa/m\n",
"\n",
- "# Results\n",
"print \"pressure per unit length = %f Pa/m\"%(P_perunit_length)\n"
],
"language": "python",
@@ -680,17 +628,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the flow rate\n",
"\n",
"import math \n",
- "# Variables\n",
"d = 0.3 #in m\n",
"u = 17.63 #avg velocity in m/s\n",
"\n",
- "# Calculations\n",
"q = (3.14/4)*d**2*u;\n",
"\n",
- "# Results\n",
"print \"volumetric flow rate = %f cubic meter per second\"%(q)\n"
],
"language": "python",
@@ -718,18 +662,14 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the size of pipe required\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"d = 0.15 #in m\n",
"\n",
- "# Calculations\n",
"u = (0.0191/0.15**2); #in m/s\n",
"q = (3.14/4)*d**2*u;\n",
"\n",
- "# Results\n",
"print \"volumetric flow rate = %f cubic meter/s\"%(q)\n"
],
"language": "python",
@@ -757,15 +697,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the pressure gradient\n",
"\n",
"import math \n",
- "# Variables\n",
"Q=0.0003 #in m3/s\n",
"d=0.05 #in m\n",
"A=(3.14*d**2)/4;\n",
"\n",
- "# Calculations\n",
"u=Q/A;\n",
"\n",
"density=1000; #in kg/m3\n",
@@ -778,11 +715,9 @@
"L=0.5 #in m\n",
"delta_Pf=fm*((density*L*u**2)/dp)*((1-e)/e**3); #in Pa\n",
"\n",
- "#applying bernoulli's equation, we get\n",
"delta_P=delta_Pf-(density*9.8*L);\n",
"pressure_gradient=delta_P/(L*1000); #in kPa/m\n",
"\n",
- "# Results\n",
"print \"required pressure gradient = %f kPa/m of packed height\"%(pressure_gradient)\n"
],
"language": "python",
@@ -810,18 +745,15 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find minimum fluidization velocity\n",
"\n",
"from scipy.optimize import fsolve \n",
"import math \n",
"\n",
- "# Variables\n",
"d=120*10**-6 #in m\n",
"density=2500 #particle density in kg/m3\n",
"e_min=0.45;\n",
"density_water=1000 #in kg/m3\n",
"\n",
- "# Calculations and Results\n",
"viscosity=0.9*10**-3; #in Pa-s\n",
"umf=(d**2*(density-density_water)*9.8*e_min**3)/(150*viscosity*(1-e_min));\n",
"print \"minimum fludization velocity = %f m/s\"%(umf)\n",
@@ -829,11 +761,9 @@
"Re_mf=(d*umf*density_water)/(viscosity*(1-e_min));\n",
"\n",
"\n",
- "#given that uo/umf=10\n",
"def F(e):\n",
" return e**3+1.657*e-1.675;\n",
"\n",
- "#initial guess\n",
"x = 10.;\n",
"e = fsolve(F,x)\n",
"\n",
@@ -868,21 +798,17 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the power requirements\n",
"\n",
"import math \n",
- "# Variables\n",
"P=9807. #in Pa\n",
"density=1000. #in kg/m3\n",
"Q=250./(60.*density)\n",
"head=25. #in m\n",
"\n",
- "# Calculations\n",
"w= head*Q*P; #in kW\n",
"power_delivered=w/0.65;\n",
"power_taken=power_delivered/0.9;\n",
"\n",
- "# Results\n",
"print \"power_delivered = %f kW\"%(power_delivered/1000)\n",
"print \"power taken by motor = %f kW\"%(power_taken/1000)\n",
"\n"
diff --git a/Introduction_To_Chemical_Engineering/ch5.ipynb b/Introduction_To_Chemical_Engineering/ch5.ipynb
index b8695b88..6af51e50 100644
--- a/Introduction_To_Chemical_Engineering/ch5.ipynb
+++ b/Introduction_To_Chemical_Engineering/ch5.ipynb
@@ -27,22 +27,18 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the rate of heat loss\n",
"\n",
"import math \n",
- "# Variables\n",
"A=5.*4 #in m2\n",
"T1=100.; #in K\n",
"T2=30.; #in K\n",
"\n",
- "# Calculations\n",
"delta_T=T1-T2;\n",
"\n",
"x=0.25 #in m\n",
"k=0.70 #in W/mK\n",
"Q=k*A*(delta_T/x);\n",
"\n",
- "# Results\n",
"print \"rate of heat loss = %f W\"%(Q)\n"
],
"language": "python",
@@ -70,15 +66,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the heat loss\n",
"\n",
"import math \n",
- "# Variables\n",
"d1=0.15 #in m\n",
"d2=0.16 #in m\n",
"l=1. #in m\n",
"\n",
- "# Calculations\n",
"A1=3.14*d1*l;\n",
"A2=3.14*d2*l\n",
"Am=(A1-A2)/math.log (A1/A2);\n",
@@ -91,7 +84,6 @@
"k=50. #in W/mK\n",
"Q=k*Am*(delta_T/x);\n",
"\n",
- "# Results\n",
"print \"rate of heat loss per unit length = %f W/m\"%(Q)\n"
],
"language": "python",
@@ -119,16 +111,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the rate of heat loss\n",
"\n",
"import math \n",
- "# Variables\n",
"ri=0.5 #in m\n",
"ro=0.6; #in m\n",
"A1=4*3.14*ri**2;\n",
"A2=4*3.14*ro**2;\n",
"\n",
- "# Calculations\n",
"Am=(A1*A2)**0.5;\n",
"\n",
"Ti=140.; #in K\n",
@@ -139,7 +128,6 @@
"\n",
"Q=k*Am*(delta_T/x);\n",
"\n",
- "# Results\n",
"print \"Heat loss through sphere = %f W\"%(Q)\n"
],
"language": "python",
@@ -167,17 +155,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the heat loss from composite wall\n",
"\n",
"import math \n",
- "# Variables\n",
"x1=0.250; #in m\n",
"k1=0.7; #in W/mK\n",
"A1=1.; #in m2\n",
"R1=x1/(k1*A1); #in K/W\n",
"\n",
- "# Calculations and Results\n",
- "#for the felt layer\n",
"x2=0.020; #in m\n",
"k2=0.046; #in W/mK\n",
"A2=1.; #in m2\n",
@@ -217,10 +201,8 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the rate of heat loss through pipeline\n",
"\n",
"import math \n",
- "# Variables\n",
"d1=0.15 #in m\n",
"d2=0.16 #in m\n",
"l=1. #in m\n",
@@ -231,8 +213,6 @@
"k1=50. #in W/mK\n",
"R1=x1/(k1*Am1);\n",
"\n",
- "# Calculations and Results\n",
- "#resistance by insulation\n",
"d2=0.16 #in m\n",
"d3=0.26 #in m\n",
"l=1. #in m\n",
@@ -279,10 +259,8 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the increase in heat transfer rate\n",
"\n",
"import math \n",
- "# Variables\n",
"x1=0.1; #in m\n",
"x2= 0.25; #in m\n",
"k_rb=0.93; #in W/mK\n",
@@ -290,8 +268,6 @@
"k_al=203.6 #in W/mK\n",
"A=0.1 #in m2\n",
"\n",
- "# Calculations and Results\n",
- "#to find resistance without rivets\n",
"R=(1/A)*((x1/k_rb)+(x2/k_ib));\n",
"T1=225 #in K\n",
"T2=37 #in K\n",
@@ -299,7 +275,6 @@
"Q=delta_T/R;\n",
"print \"heat transfer rate = %f W\"%(Q)\n",
"\n",
- "#to find resistance with rivet\n",
"d=0.03 #in m\n",
"rivet_area= (3.14/4)*d**2;\n",
"R_r=(x1+x2)/(k_al*rivet_area);\n",
@@ -347,14 +322,12 @@
"\n",
"import math\n",
"\n",
- "# variables\n",
"Cp = 4.178 # kJ/kg K for water\n",
"q = 1838. # rate at which heat is transfered\n",
"A = .1005 # heat transfer area\n",
"dt1 = 80. - 24 # temperature diffference at hot end\n",
"dt2 = 36.-24 # temperature difference at cold end\n",
"\n",
- "# Calculations and Results\n",
"dtm = (56 + 12)/2.0\n",
"h = q/(A*dtm)\n",
"print \"Heat transfer coefficient, h = %.0f W/m**2 K\"%h\n",
@@ -390,11 +363,9 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the heat transfer coefficient\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"density=984.1 #in kg/cubic meter\n",
"v=3. #in m/s\n",
"viscosity=485*10**-6; #in Pa-s\n",
@@ -402,15 +373,12 @@
"cp=4178. #in J/kg K\n",
"d=0.016 #in m\n",
"\n",
- "# Calculations and Results\n",
"Re=(density*v*d)/viscosity;\n",
"Pr=(cp*viscosity)/k;\n",
"\n",
- "#dittus boelter equation\n",
"h=0.023*Re**0.8*Pr**0.3*(k/d);\n",
"print \"heat transfer coefficient = %f W/sq meter K\"%(h)\n",
"\n",
- "#Sieder Tate equation\n",
"viscosity_w=920*10**-6.\n",
"h1=0.023*Re**0.8*Pr**(1./3)*(k/d)*(viscosity/viscosity_w)**0.14;\n",
"print \"heat transfer coefficient = %f W/sq meter K\"%(h1)\n"
@@ -441,18 +409,14 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the surface temperature of earth\n",
"\n",
"import math \n",
- "# Variables\n",
"T_sun = 5973 #in degree C\n",
"d = 1.5*10**13 #in cm\n",
"R = 7.1*10**10; #in cm\n",
"\n",
- "# Calculations\n",
"T_earth = ((R/(2*d))**0.5)*T_sun;\n",
"\n",
- "# Results\n",
"print \"Temperature of earth = %f C\"%(T_earth-273) \n"
],
"language": "python",
@@ -480,18 +444,14 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find temperature of earth\n",
"\n",
"import math \n",
- "# Variables\n",
"R=7*10**10; #in cm\n",
"Ts=6000; #in K\n",
"\n",
- "# Calculations\n",
"l=1.5*10**13; #in m\n",
"To=((R**2/(4*l**2))**0.25)*Ts;\n",
"\n",
- "# Results\n",
"print \"temperature of earth = %f K\"%(To)\n"
],
"language": "python",
@@ -519,18 +479,14 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the equilibrium temperature\n",
"\n",
"import math \n",
- "# Variables\n",
"R=6.92*10**5 #in km\n",
"l=14.97*10**7 #in km\n",
"Ts=6200; #in K\n",
"\n",
- "# Calculations\n",
"To=(R**2/l**2)**0.25*Ts;\n",
"\n",
- "# Results\n",
"print \"Equilibrium temperature = %f K\"%(To)\n"
],
"language": "python",
@@ -558,19 +514,15 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the equilibrium temperature\n",
"\n",
"import math \n",
- "# Variables\n",
"view_factor=0.5;\n",
"R=6.92*10**5 #in km\n",
"l=14.97*10**7 #in km\n",
"Ts=6200; #in K\n",
"\n",
- "# Calculations\n",
"To=(view_factor*(R**2/l**2))**0.25*Ts;\n",
"\n",
- "# Results\n",
"print \"Equilibrium temperature = %f K\"%(To)\n",
"\n",
"\n"
@@ -600,10 +552,8 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the surface temperature\n",
"\n",
"import math \n",
- "# Variables\n",
"view_factor=0.25;\n",
"R=7.1*10**10 #in cm\n",
"l=1.5*10**13 #in cm\n",
@@ -611,12 +561,10 @@
"alpha=0.2;\n",
"epsilon=0.1;\n",
"\n",
- "# Calculations\n",
"ratio=alpha/epsilon;\n",
"To=(ratio*view_factor*(R**2/l**2))**0.25*Ts;\n",
"\n",
"\n",
- "# Results\n",
"print \"Equilibrium temperature = %f K\"%(To)\n"
],
"language": "python",
@@ -644,19 +592,15 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the solar constant\n",
"\n",
"import math \n",
- "# Variables\n",
"R=7*10**10; #in cm\n",
"l=1.5*10**13; #in cm\n",
"sigma=5.3*10**-5; #in erd/s(cm2)(K)4\n",
"T=6000; #in K\n",
"\n",
- "# Calculations\n",
"S=(R/l)**2*(sigma)*(T**4)*60;\n",
"\n",
- "# Results\n",
"print \"solar constant = %f J/sq cm min\"%(S/10**7)\n"
],
"language": "python",
@@ -684,15 +628,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the amount of vapor and liquid and amount of heat transfer\n",
"\n",
"import math \n",
- "# Variables\n",
"F = 5000. #in kg/hr\n",
"xF = 0.01\n",
"xL = 0.02;\n",
"\n",
- "# Calculations and Results\n",
"L = F*xF/xL;\n",
"V = F-L;\n",
"print \"L = %f Kg/hr V = %f kg/hr\"%(L,V)\n",
@@ -741,19 +682,15 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the amount of liquid and vapor leaving and outlet concentration\n",
"\n",
"import math \n",
"from numpy import *\n",
- "# Variables\n",
"b1 = 6000*125.79+3187.56*2691.5-3187.56*461.30; #data from previous problem\n",
"b2 = 6000;\n",
"A = array([[419.04, 2676.1],[1, 1]])\n",
"\n",
- "# Calculations and Results\n",
"b = array([[b1],[b2]]);\n",
"x = linalg.solve(A,b)\n",
- "#x = x*b\n",
"L = x[0];\n",
"V = x[1];\n",
"\n",
@@ -790,14 +727,11 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the change in heat trnasfer area\n",
"\n",
"import math \n",
- "# Variables\n",
"Hv=2635.3 #kJ/kg\n",
"hL=313.93 #in kJ/kg\n",
"\n",
- "# Calculations and Results\n",
"S=(2500*313.93+2500*2635.3-5000*125.79)/(2691.5-461.30);\n",
"print \"steam flow rate = %f kg steam/hr\"%(S)\n",
"\n",
@@ -810,7 +744,6 @@
"print \"Area = %f sq meter\"%(A)\n",
"print \"in this case a condensor and vaccum pump should be used\"\n",
"\n",
- "# Note : there is mistake in calculation in Book. Please calculate manually."
],
"language": "python",
"metadata": {},
diff --git a/Introduction_To_Chemical_Engineering/ch6.ipynb b/Introduction_To_Chemical_Engineering/ch6.ipynb
index dc10eb48..1a7b64a4 100644
--- a/Introduction_To_Chemical_Engineering/ch6.ipynb
+++ b/Introduction_To_Chemical_Engineering/ch6.ipynb
@@ -27,10 +27,8 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the flux and pressure difference\n",
"\n",
"import math \n",
- "# Variables\n",
"D_AB=6.75*10**-5 #in m2/s\n",
"Z=0.03 #in m\n",
"R=8314\n",
@@ -38,11 +36,9 @@
"p_A2=1.5*10**4 #in Pa\n",
"T=298 #in K\n",
"\n",
- "# Calculations and Results\n",
"N_A=D_AB*(p_A1-p_A2)/(R*T*Z);\n",
"print \"flux = %f kmol/sq m s\"%(N_A)\n",
"\n",
- "#for partial pressure\n",
"Z=0.02; #in m\n",
"p_A2=p_A1-((N_A*R*T*Z)/D_AB);\n",
"print \"pressure = %f Pa\"%(p_A2)\n",
@@ -74,17 +70,14 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the flux of NH3 and equimolar counter diffusion flux\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"Z=0.15 #in m\n",
"P=1.013*10**5 #in Pa\n",
"p_A1=1.5*10**4 #in Pa\n",
"p_A2=5*10**3 #in Pa\n",
"\n",
- "# Calculations and Results\n",
"p_B1=P-p_A1;\n",
"p_B2=P-p_A2;\n",
"\n",
@@ -92,13 +85,11 @@
"R=8314.\n",
"T=298. #in K\n",
"\n",
- "#for non diffusing N2\n",
"p_BM=(p_B2-p_B1)/math.log (p_B2/p_B1);\n",
"print p_B1, p_B2\n",
"N_A=D_AB*(p_A1-p_A2)*P/(R*T*Z*p_BM);\n",
"print \"flux = %.4e kmol/sq m s\"%(N_A)\n",
"\n",
- "#for diffusing N2\n",
"N_A=D_AB*(p_A1-p_A2)/(R*T*Z);\n",
"print \"flux = %.4e kmol/sq m s\"%(N_A)\n"
],
@@ -130,13 +121,11 @@
"collapsed": false,
"input": [
"import math \n",
- "# Variables\n",
"M_A=36.5 #molar mass of HCl\n",
"M_B=18. #molar masss of water\n",
"w_A1=12.; #weight % of HCL\n",
"w_A2=4. #weight % of HCL\n",
"\n",
- "# Calculations and Results\n",
"x_A1=(w_A1/M_A)/((w_A1/M_A)+((100-w_A1)/M_B));\n",
"print 'x_A1 =%f'%(x_A1)\n",
"\n",
@@ -144,7 +133,6 @@
"M1=100./((w_A1/M_A)+((100-w_A1)/M_B));\n",
"print \"molar mass at point 1 = %f kg/kmol\"%(M1)\n",
"\n",
- "#at point 2\n",
"x_A2=(w_A2/M_A)/((w_A2/M_A)+((100-w_A2)/M_B));\n",
"x_B2=1-x_A2;\n",
"M2=100/((w_A2/M_A)+((100-w_A2)/M_B)); #avg molecular weight at point 2\n",
@@ -190,10 +178,8 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the mean driving force and mass transfer area\n",
"\n",
"import math \n",
- "# Variables\n",
"Gs=700/22.4 #in kmol of dry air/hr\n",
"Ls=1500./18 #in kmol of dry air/hr\n",
"y1=0.05\n",
@@ -203,14 +189,11 @@
"X1=(Gs/Ls)*(Y1-Y2);\n",
"m=Gs*(Y1-Y2);\n",
"\n",
- "# Calculations and Results\n",
- "#driving force\n",
"delta_Y1=Y1-1.68*X1;\n",
"delta_Y2=Y2-1.68*X2;\n",
"delta_Y=(delta_Y1-delta_Y2)/(math.log (delta_Y1/delta_Y2));\n",
"print \"driving force = %f kmol acetone/kmol dry air\"%(delta_Y)\n",
"\n",
- "#mass transfer area\n",
"K_G=0.4 #in kmol acetone/kmol dry air\n",
"A=m/(K_G*delta_Y);\n",
"print \"area = %f sq m\"%(A)\n"
@@ -241,17 +224,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to calculate minimum oil circulation rate\n",
"\n",
"import math \n",
- "# Variables\n",
"G1=(855/22.4)*(106.6/101.3)*(273/299.7);\n",
"y1=0.02;\n",
"Y1=y1/(1-y1);\n",
"Gs=G1*(1-y1);\n",
"\n",
- "# Calculations\n",
- "#for 95% removal\n",
"Y2=0.05*Y1;\n",
"x2=0.005;\n",
"X2=x2/(1-x2);\n",
@@ -261,7 +240,6 @@
"Ls_molar=(Gs*(Y1-Y2))/(X1-X2);\n",
"Ls=Ls_molar*260;\n",
"\n",
- "# Results\n",
"print \"minimum oil circulation rate = %f kg/hr\"%(Ls)\n"
],
"language": "python",
@@ -289,15 +267,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# to find the equilibrium composition\n",
"\n",
"import math \n",
- "# Variables\n",
"P_M = 53.32 #kPa\n",
"P_W = 12.33 #in kpA\n",
"P = 40 #IN K pA\n",
"\n",
- "# Calculations and Results\n",
"x = (P - P_W)/(P_M-P_W);\n",
"\n",
"print \"liquid phase composition = %f\"%(x)\n",
@@ -331,7 +306,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the top and bottom composition\n",
"\n",
"import math \n",
"from matplotlib.pyplot import *\n",
@@ -339,13 +313,9 @@
"\n",
"%pylab inline\n",
"\n",
- "# Variables\n",
"x = [1,0.69,0.40,0.192,0.045,0];\n",
"y = [1,0.932,0.78,0.538,0.1775,0];\n",
"plot(x,y)\n",
- "#xlabel(\"x\")\n",
- "#ylabel(\"y\")\n",
- "#title(\"distillation curve\")\n",
"x = linspace(0,1,10)\n",
"y = linspace(0,1,10)\n",
"plot(x,y)\n",
@@ -362,7 +332,6 @@
"\n",
"show()\n",
"\n",
- "# Results\n",
"print \"composition of top product = %f mole percent of hexane\"%(y_D*100)\n",
"print \"composition of bottom product = %f mole percent of hexane\"%(x_W*100)\n"
],
@@ -415,19 +384,16 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the composite distillate and residue\n",
"\n",
"%pylab inline\n",
"import math \n",
"from numpy import *\n",
"from matplotlib.pyplot import *\n",
- "# Variables\n",
"F = 100. #moles\n",
"xf = 0.4;\n",
"D = 60. #moles\n",
"W = 40. #moles\n",
"\n",
- "# Calculations\n",
"x = linspace(0.2,0.45,6)\n",
"y = zeros(6)\n",
"z = zeros(6)\n",
@@ -443,7 +409,6 @@
"yd = (F*xf-W*xw)/D;\n",
"show()\n",
"\n",
- "# Results\n",
"print \"composition of distillate = %f\"%(yd)\n",
"print \"composition of residue = %f\"%(xw)\n"
],
@@ -488,22 +453,17 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the top and bottom product composition\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
- "#part 1\n",
"x=0.4;\n",
"y=0.8;\n",
"x_D=y;\n",
"x_W=0.135; #bottom concentration\n",
"\n",
- "# Calculations and Results\n",
"D=(100*x-100*x_W)/(y-x_W); #distillate amount\n",
"print \"amount of distillate =%f moles/h\"%(D)\n",
"\n",
- "#part 2\n",
"alpha=6; #relative volatility\n",
"x_R=y/(y+(alpha*(1-y))); #liquid leaving partial condensor\n",
"print \"liquid leaving partial condenser = %f\"%(x_R)\n",
@@ -543,15 +503,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the percentage extraction of nicotine\n",
"\n",
"import math \n",
- "# Variables\n",
"x=0.01; #% of nicotine\n",
"X0 = x/(1-x);\n",
"w=150. #weight of nicotine water solution\n",
"\n",
- "# Calculations and Results\n",
"A0=w*(1-X0);\n",
"B0=250.; #kg keroscene\n",
"X1 = A0*X0/(A0+B0*0.798);\n",
@@ -590,15 +547,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the number of stages\n",
"\n",
"import math \n",
- "# Variables\n",
"x=0.01 #mole fraction of nicotine\n",
"yN = 0.0006; #mole fraction in solvent\n",
"xN = 0.001; #final mole fraction in water\n",
"\n",
- "# Calculations and Results\n",
"X0=x/(1.-x); #in kg nicotine/kg water\n",
"YN =yN/(1.-yN); #in kg nicotine/kg keroscene\n",
"XN = xN/(1.-xN);\n",
@@ -608,7 +562,6 @@
"Y1=((A0*(X0-XN))/B0)+YN; #in kg nicotine/kg kerosene\n",
"print \"Y1 = %f kg nicotine/kg kerosene\"%(Y1)\n",
"\n",
- "#for graph refer to the book\n",
"number_of_stages = 8.4;\n",
"print \"numnber of stages = %f\"%(number_of_stages)\n"
],
@@ -638,16 +591,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to calculate the humidity\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"P = 101.3 #in kPa\n",
"pA = 3.74 #in kPa\n",
"p_AS = 7.415 #in kPa\n",
"\n",
- "# Calculations and Results\n",
"H = (18.02/28.97)*(pA/(P-pA));\n",
"print \"humidity = %f kg H2O/kg air\"%(H)\n",
"\n",
@@ -688,12 +638,10 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the air flow rate and outlet humidity\n",
"\n",
"import math \n",
"from numpy import *\n",
"\n",
- "# Variables\n",
"S=425.6 #in kg/h\n",
"X1 = 0.035 #in kgwater/kg dry solid\n",
"t_s1=25. #in degree C\n",
@@ -705,7 +653,6 @@
"C_pS = 1.465 #in kJ/kg dry solid\n",
"C_pA = 4.187 #in kg/ kg H2O K\n",
"\n",
- "# Calculations and Results\n",
"H_G2=(1.005+1.88*H2)*(t_G2-0)+H2*2501;\n",
"H_S1 = C_pS*(t_s1-0)+X1*C_pA*(t_s1-0); #in kJ/kg\n",
"H_S2 = C_pS*(t_s2-0)+X2*C_pA*(t_s2-0); #in kJ/kg\n",
@@ -715,8 +662,6 @@
"print \"Enthalpy of entering solid HS1 = %f kJ/kg dryair\"%(H_S1)\n",
"print \"Enthalpy of exit solid HS2 = %f kJ/kg dryair\"%(H_S2)\n",
"\n",
- "#applying GHg2 + SHs1 = GHg1 +SHs2 +Q, we get two linear equations\n",
- "#0.0175G+14.17248 = GH1 and 98.194G-29745.398 = 2562.664GH1\n",
"A = array([[0.0175, -1],[98.194, -2562.664]]);\n",
"b = array([[-14.17248],[29745.398]]);\n",
"x = linalg.solve(A,b)\n",
@@ -754,22 +699,16 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the crystal yield\n",
"\n",
"import math \n",
"from numpy import *\n",
- "# Variables\n",
"M_Na2CO3 = 106\n",
"M_10H2O = 180.2\n",
"M_Na2CO3_10H2O = 286.2;\n",
"w_Na2CO3 = 5000. #in kg\n",
"water = 0.05 #% of water evaporated\n",
"\n",
- "# Calculations\n",
"W = water*w_Na2CO3;\n",
- "#solving material balance, we have two equations\n",
- "#equation 1 -> 0.8230L +0.6296C = 3500\n",
- "#equation 2 -> 0.1769L + 0.3703C = 1250\n",
"\n",
"A = array([[0.8230, 0.6296],[0.1769, 0.3703]])\n",
"b = array([[3500],[1250]])\n",
@@ -777,7 +716,6 @@
"L = x[0]\n",
"C = x[1];\n",
"\n",
- "# Results\n",
"print \"L = %f kg solution\"%(L)\n",
"print \"C = %f kg of Na2CO3.10H2O crystals\"%(C)\n"
],
@@ -807,15 +745,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the crystal yield\n",
"\n",
"import math \n",
"from numpy import *\n",
- "# Variables\n",
"A = array([[0.7380, 0.5117],[0.2619, 0.4882]])\n",
"b = array([[1400],[600]])\n",
"\n",
- "# Calculations and Results\n",
"x = linalg.solve(A,b)\n",
"L = x[0]\n",
"C = x[1];\n",
diff --git a/Introduction_To_Chemical_Engineering/ch7.ipynb b/Introduction_To_Chemical_Engineering/ch7.ipynb
index abdbbfb1..cf9ad80b 100644
--- a/Introduction_To_Chemical_Engineering/ch7.ipynb
+++ b/Introduction_To_Chemical_Engineering/ch7.ipynb
@@ -27,18 +27,12 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the change on rate of reaction\n",
"\n",
"import math \n",
"\n",
- "#part 1\n",
- "#rate equation r = kC_NO**2*C_O2\n",
- "#if pressure increases 3 times\n",
- "# Calculations and Results\n",
"r = 3**2*3; #according to the rate reaction\n",
"print \"reaction reate will be increased by with 3 times increase in pressure = %f times\"%(r)\n",
"\n",
- "#part 2\n",
"r = 3**2*3; #according to the rate reaction\n",
"print \"reaction reate will be increased by with 3 times decrease in volume = %f times\"%(r)\n",
"\n",
@@ -72,25 +66,20 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the % transformation\n",
"\n",
"from scipy.optimize import fsolve \n",
"import math \n",
- "# Variables\n",
"moles_A = 3.;\n",
"moles_B = 5.;\n",
"K = 1.;\n",
"\n",
- "# Calculations\n",
"def F(x):\n",
" return 15.-8*x;\n",
"\n",
"\n",
- "#initial guess\n",
"x = 10.;\n",
"y = fsolve(F,x)\n",
"\n",
- "# Results\n",
"print \"amount of A transformed = %f percent\"%(y*100/3)\n",
"\n"
],
@@ -119,11 +108,9 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the initial conc of A and B\n",
"\n",
"from scipy.optimize import fsolve \n",
"import math \n",
- "# Variables\n",
"Cp = 0.02;\n",
"Cq = 0.02;\n",
"K = 4*10**-2;\n",
@@ -131,15 +118,12 @@
"Cb_i = Cb+Cp;\n",
"a = (Cp*Cq)/(K*Cb);\n",
"\n",
- "# Calculations\n",
"def F(x):\n",
" return x-0.02-a;\n",
"\n",
- "#initial guess\n",
"x = 10.;\n",
"y = fsolve(F,x)\n",
"\n",
- "# Results\n",
"print \"conc of A= %f mol/l\"%(y)\n",
"print \"conc of B= %f mol/l\"%(Cb_i)\n"
],
@@ -169,21 +153,17 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the initial concentration and shift in equilibrium\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"Ce_N2 = 3.; #equilibrium conc of N2\n",
"Ce_H2 = 9.; #equilibrium conc of H2\n",
"Ce_NH3 = 4.; #equilibrium conc oh NH3\n",
"\n",
- "# Calculations and Results\n",
"C_N2 = Ce_N2 + 0.5*Ce_NH3;\n",
"C_H2 = Ce_H2 + 1.5*Ce_NH3;\n",
"\n",
"print \"concentration of N2 = %f mol/l \\nconcentration of H2 = %f mol/l\"%(C_N2,C_H2)\n",
- "# Note :second part is theoritical, book shall be referred for solution\n",
"\n",
"n_H2 = 3.; #stotiometric coefficient\n",
"n_N2 = 1.; #stotiometric coefficient\n",
@@ -220,31 +200,24 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the % transformation\n",
"\n",
"from scipy.optimize import fsolve \n",
"import math \n",
- "# Variables\n",
"moles_A = 0.02;\n",
"K = 1.;\n",
"\n",
- "# Calculations and Results\n",
- "#part 1\n",
"moles_B = 0.02;\n",
"def F(x):\n",
" return moles_A*moles_B-(moles_A+moles_B)*x;\n",
"\n",
- "#initial guess\n",
"x = 10.;\n",
"y = fsolve(F,x)\n",
"print \"amount of A transformed = %f percent\"%(y*100/0.02)\n",
"\n",
- "#part 2\n",
"moles_B = 0.1;\n",
"y = fsolve(F,x)\n",
"print \"amount of A transformed = %f percent\"%(y*100/0.02)\n",
"\n",
- "#part 1\n",
"moles_B = 0.2;\n",
"y = fsolve(F,x)\n",
"print \"amount of A transformed = %.0f percent\"%(y*100/0.02)\n",
@@ -277,22 +250,18 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the rate equation\n",
"\n",
"import math \n",
"from numpy import *\n",
"from matplotlib.pyplot import *\n",
"\n",
"%pylab inline\n",
- "# Variables\n",
"t = array([0,5,10,15,20,25])\n",
"C_A = array([25,18.2,13.2,9.6,7,5.1])\n",
"\n",
- "#integral method of rate determination\n",
"s = 0;\n",
"k = zeros(6)\n",
"\n",
- "# Calculations and Results\n",
"for i in range(1,6):\n",
" k[i] = (1./t[i])*math.log(25./C_A[i])\n",
" #print (k[i],\"k values for various conc.\")\n",
@@ -308,7 +277,6 @@
"ylabel(\"concentration\")\n",
"suptitle(\"integral method\")\n",
"\n",
- "#differential method of rate determination\n",
"ra = array([1.16,0.83,0.60,0.43])\n",
"C_A = array([18.2,13.2,9.6,7])\n",
"\n",
@@ -373,20 +341,16 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the rate of reaction\n",
"\n",
"import math \n",
- "# Variables\n",
"E = 75200. #in J/mol\n",
"E1 = 50100. #in J/mol\n",
"R = 8.314 #in J/mol K\n",
"T = 298. #in K\n",
"\n",
- "# Calculations\n",
"ratio = math.exp((E1-E)/(R*T));\n",
"rate_increase = ratio**-1\n",
"\n",
- "# Results\n",
"print \"increase in rate of reaction =\",rate_increase,\"times\"\n"
],
"language": "python",
diff --git a/Introduction_To_Chemical_Engineering/ch8.ipynb b/Introduction_To_Chemical_Engineering/ch8.ipynb
index a18b8152..d67175c5 100644
--- a/Introduction_To_Chemical_Engineering/ch8.ipynb
+++ b/Introduction_To_Chemical_Engineering/ch8.ipynb
@@ -30,13 +30,11 @@
"\n",
"import math \n",
"\n",
- "# Variables\n",
"pressure_difference = 3.4 #in mm water\n",
"pressure = 1.0133*10**5 #in pa\n",
"temperatue = 293. #in K\n",
"mass_of_air = 29. #in Kg\n",
"\n",
- "# Calculations and Results\n",
"density_air = pressure/(temperatue*8314)*mass_of_air #in kg/m3\n",
"print \"Density of air = %f kg/cu m\"%(density_air)\n",
"\n",
@@ -76,21 +74,16 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find viscosity of oil \n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"diameter=0.6; #in m\n",
"disk_distance=1.25*10**-3; #in m\n",
"speed=5.; #revolutions/min\n",
"torque=11.5; #in Joules\n",
"\n",
- "# Calculations\n",
- "#we know that torque= pi*omega*viscosity*radius**4/2*disc_distance\n",
"viscosity=(2*disk_distance*torque)/(3.14*(10*3.14)*(diameter/2)**4);\n",
"\n",
- "# Results\n",
"print \"viscosity = %f Pa-s\"%(viscosity)\n"
],
"language": "python",
@@ -118,22 +111,18 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the viscosity of solution using given parameters\n",
"\n",
"import math \n",
- "# Variables\n",
"diameter =10.; #in mm\n",
"density_of_solution = 1750.; #in kg/m3\n",
"density_of_air = 1.2; #in kg/m3\n",
"velocity = 0.9; #in mm/s\n",
"\n",
- "# Calculations and Results\n",
"viscosity = (density_of_solution-density_of_air)*9.8*(diameter*10**-3)**2/(18*velocity*10**-3); #expression for finding viscosity\n",
"\n",
"print \"viscosity of solution = %f Pa-s\"%(viscosity)\n",
"\n",
"\n",
- "#checking stoke's region validity\n",
"v=(0.2*viscosity)/(density_of_solution*diameter*10**-3);\n",
"if v>0.9 :\n",
" print \"system follows stokes law\"\n"
@@ -164,11 +153,9 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the flow rate in an orifice\n",
"\n",
"import math \n",
"\n",
- "# Variables\n",
"density_of_water = 1000.; #in kg/m3\n",
"viscosity = 1*10.**-3; #in Pa-s\n",
"pipe_diameter = 250.; #in mm\n",
@@ -176,14 +163,11 @@
"density_of_mercury = 13600.; # in mm\n",
"manometer_height = 242.; #in mm\n",
"\n",
- "# Calculations and Results\n",
"height_water_equivalent = (density_of_mercury-density_of_water)*(manometer_height*10**-3)/(density_of_water) #in m\n",
"\n",
- "#assuming Re>30000\n",
"Co = 0.61;\n",
"velocity = Co*(2*9.8*height_water_equivalent/(1-(orifice_diameter/pipe_diameter)**4))**0.5; #in m/s\n",
"\n",
- "#checking Reynold's number\n",
"Re = (orifice_diameter*10**-3*velocity*density_of_water)/viscosity;\n",
"print \"reynolds number = %f which is greater than 30000\"%(Re)\n",
"\n",
@@ -220,10 +204,8 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the coefficient of discharge for converging cone\n",
"\n",
"import math \n",
- "# Variables\n",
"pipe_diameter=0.15; #in m\n",
"venturi_diameter=0.05; #in m\n",
"pressure_drop=0.12; #m of water\n",
@@ -231,15 +213,12 @@
"density = 1000.; #in kg/m3\n",
"viscosity = 0.001 #in Pa-s\n",
"\n",
- "# Calculations and Results\n",
"velocity = ((4./3.14)*flow_rate)/(venturi_diameter**2*density);\n",
"print \"velociy = %f m/s\"%(velocity)\n",
"\n",
- "#calculating coefficient of discharge\n",
"Cv=velocity*((1-(venturi_diameter/pipe_diameter)**4)/(2*9.8*pressure_drop))**0.5;\n",
"print \"coefficient of discharge = %f\"%(Cv)\n",
"\n",
- "#calculating reynold's number\n",
"Re = velocity*(venturi_diameter/pipe_diameter)**2*pipe_diameter*density/viscosity;\n",
"print \"reynolds No = %f\"%(Re)\n"
],
@@ -270,10 +249,8 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find pA and pB\n",
"\n",
"import math \n",
- "# Variables\n",
"h1=0.66; #in m\n",
"h2=0.203; #in m\n",
"h3=0.305 #in m\n",
@@ -282,7 +259,6 @@
"s1=0.83;\n",
"s2=13.6;\n",
"\n",
- "# Calculations and Results\n",
"print (\"part 1\")\n",
"pA=pB+(h2*s2-(h1-h3)*s1)*density*9.81; #in Pa\n",
"print \"pressure at A = %f Pa\"%(pA)\n",
@@ -322,17 +298,14 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the rate of oil flow in l/s\n",
"\n",
"import math \n",
- "# Variables\n",
"density_oil=900.; #in kg/m3\n",
"viscosity_oil=38.8*10**-3; #in Pa-s\n",
"density_water = 1000.; #in kg/m3\n",
"diameter=0.102 #in m\n",
"manometer_reading=0.9; #m of water\n",
"\n",
- "# Calculations and Results\n",
"delta_H=manometer_reading*(density_water-density_oil)/density_oil;\n",
"print \"manometer reading as m of oil = %f m\"%(delta_H)\n",
"\n",
@@ -378,20 +351,16 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the maximum capacity of keroscene\n",
"\n",
"import math \n",
- "# Variables\n",
"flow_rate_steel=1.2; #l/s\n",
"density_steel=7.92;\n",
"density_kerosene=0.82;\n",
"density_water=1;\n",
"\n",
- "# Calculations\n",
"flow_rate_kerosene =(((density_steel-density_kerosene)/density_kerosene)/((density_steel-density_water)/density_water))**0.5*flow_rate_steel\n",
"\n",
"\n",
- "# Results\n",
"print \"maximum_flow rate of kerosene = %f litre/s\"%(flow_rate_kerosene)\n"
],
"language": "python",
@@ -419,28 +388,19 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the rate of flow of flue gas\n",
"\n",
"from scipy.optimize import fsolve \n",
"import math \n",
- "# Variables\n",
"initial_CO2 = 0.02; #weight fraction\n",
"flow_rate_CO2 = 22.5; #gm/s\n",
"final_CO2=0.031; #weight fraction\n",
"\n",
- "#flow rate of flue gas =x\n",
- "#amount of CO2 entering = 0.02*x\n",
- "#amount of CO2 leaving = 0.02x+0.0225\n",
- "#amount of gas leaving = x+0.0225\n",
- "#amount of CO2 leaving = 0.031*(x+0.0225)\n",
"\n",
- "# Calculations\n",
"def f(x): \n",
"\t return initial_CO2*x+0.0225 - 0.031*(x+0.0225)\n",
"\n",
"flow_rate_flue_gas=fsolve(f,0)\n",
"\n",
- "# Results\n",
"print \"flow rate of flue gas = %f kg/s\"%(flow_rate_flue_gas)\n",
"\n"
],
diff --git a/Introduction_To_Chemical_Engineering/ch9.ipynb b/Introduction_To_Chemical_Engineering/ch9.ipynb
index ebdb2cdc..ff828207 100644
--- a/Introduction_To_Chemical_Engineering/ch9.ipynb
+++ b/Introduction_To_Chemical_Engineering/ch9.ipynb
@@ -27,10 +27,8 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the pressure drop in the coil\n",
"\n",
"import math \n",
- "# Variables\n",
"D = 38.*10**-3; #in m\n",
"U = 1. #in m/s\n",
"density = 998. #in kg/cubic m\n",
@@ -39,7 +37,6 @@
"N = 10.\n",
"e = 4.*10**-6; #in m\n",
"\n",
- "# Calculations and Results\n",
"Re = (density*U*D)/viscosity;\n",
"print \"Reynolds number = %f\"%(Re)\n",
"\n",
@@ -87,10 +84,8 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#to find the shell side pressure drop in heat exchanger\n",
"\n",
"import math \n",
- "# Variables\n",
"U = 0.5 #in m/s\n",
"N = 19.;\n",
"DT = 0.026 #in m\n",
@@ -102,7 +97,6 @@
"Pr = 6.5;\n",
"Prw = 7.6;\n",
"\n",
- "# Calculations and Results\n",
"HYDIA = (DS**2-N*DT**2)/(DS+N*DT);\n",
"Re = HYDIA*U*density/viscosity;\n",
"print \"Reynolds number = %f\"%(Re)\n",
@@ -151,7 +145,6 @@
"collapsed": false,
"input": [
"import math \n",
- "# Variables\n",
"MH = 10. #in kg/s\n",
"MC = 12.5 #in kg/s\n",
"CPH = 4.2 #in kJ/kg\n",
@@ -161,14 +154,12 @@
"TCI = 300. #in K\n",
"U = 1.8 #in kW/sq m K\n",
"\n",
- "# Calculations and Results\n",
"Q = MH*CPH*(THI-THO);\n",
"print \"heat load = %f J\"%(Q)\n",
"\n",
"TCO = Q/(MC*CPC)+TCI;\n",
"print \"cold fluid outlet temperature = %f K\"%(TCO)\n",
"\n",
- "#for co current flow\n",
"\n",
"DT1 = THI-TCO;\n",
"DT2 = THO-TCO;\n",
@@ -178,7 +169,6 @@
"A = Q/(U*LMTD);\n",
"print \"for co current flow area = %f sq m\"%(A);\n",
"\n",
- "#for counter current flow\n",
"\n",
"DT1 = THI-TCO;\n",
"DT2 = THO-TCI;\n",