diff options
Diffstat (limited to 'Introduction_To_Chemical_Engineering/ch7.ipynb')
-rw-r--r-- | Introduction_To_Chemical_Engineering/ch7.ipynb | 36 |
1 files changed, 0 insertions, 36 deletions
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", |