{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ " Chapter 10 - The rates of reactions" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E1 - Pg 222" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the overall rate constant and hence the overall rate law\n", "#Initialization of variables\n", "%matplotlib inline\n", "import math\n", "import numpy as np\n", "from numpy import linalg\n", "import matplotlib\n", "from matplotlib import pyplot\n", "def fun(x,n):\n", "\tfor i in range(0,len(x)):\n", "\t\tx[i]=x[i]*math.pow(10,-n)\n", "\treturn\n", "\n", "I=([1., 2., 4., 6.])\n", "r1=([1.070, 3.48, 13.9, 31.3])\n", "r2=([4.35, 17.4, 69.6, 157])\n", "r3=([10.69, 34.7, 138, 313])\n", "Ar=([1., 5., 10.])\n", "fun(r1,3)\n", "fun(I,5)\n", "fun(r2,3)\n", "fun(r3,3)\n", "fun(Ar,3)\n", "#calculations\n", "def fun1(x):\n", "\tfor i in range(0,len(x)):\n", "\t\tx[i]=math.log10(x[i])\n", "\treturn x\n", "\n", "logI=fun1(I)\n", "logr1=fun1(r1)\n", "logr2=fun1(r2)\n", "logr3=fun1(r3)\n", "#The calculations are approximate.hence the value differs from textbook a bit.\n", "x=logI\n", "y=logr1\n", "A = np.vstack([x, np.ones(len(x))]).T\n", "m1, b1 = np.linalg.lstsq(A, y)[0]\n", "\n", "y=logr2\n", "A = np.vstack([x, np.ones(len(x))]).T\n", "m2, b2 = np.linalg.lstsq(A, y)[0]\n", "\n", "y=logr3\n", "A = np.vstack([x, np.ones(len(x))]).T\n", "m3, b3 = np.linalg.lstsq(A, y)[0]\n", "\n", "logAr=fun1(Ar)\n", "kdash=([b1, b2, b3])\n", "pyplot.plot(logAr,kdash)\n", "pyplot.xlabel('log(Ar)')\n", "pyplot.ylabel('log(kdash)')\n", "x=logAr\n", "y=kdash\n", "\n", "A = np.vstack([x, np.ones(len(x))]).T\n", "m4, b4 = np.linalg.lstsq(A, y)[0]\n", "\n", "logk=b4\n", "k=math.pow(10,logk)\n", "#results\n", "print '%s %.1e %s' %(\"Overall rate law is r =\",k,\" [I]^2 [Ar]\")\n", "pyplot.show()\n", "print '%s' %('The answers in the textbook are rounded and hence a bit different from the code.')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Populating the interactive namespace from numpy and matplotlib\n", "Overall rate law is r = 8.1e+09 [I]^2 [Ar]" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEPCAYAAABcA4N7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVXX+x/EXjtbkkk4qLoCaWCouqFlmbpiZpGa5K02a\nJsPY4ujMz9YZsywDrZlSJ6NFLXNAJynUFBvMm+KG5daMhim4piQ5bqCs5/fHGS8Sq3DPvZfL+/l4\n8AjuPdz78VT37ff7Oef79TIMw0BERKQY1VxdgIiIuDcFhYiIlEhBISIiJVJQiIhIiRQUIiJSIgWF\niIiUyLKgSEpKonPnzvavunXrMm/evALHpKWlERwcTKdOnWjfvj1LliyxqhwRESknL2fcR5GXl4eP\njw+JiYn4+fnZH585cyaZmZm8/vrrpKWl0bp1a1JTU6levbrVJYmISBk5ZeopPj4ef3//AiEB0KRJ\nEy5cuADAhQsXqF+/vkJCRMTNOOVTOTo6mpCQkEKPh4aGcu+999K0aVMuXrzIihUrnFGOiIhcB8un\nnrKysvDx8WH//v00bNiwwHOvvvoqaWlpvPXWWxw+fJj+/fuzd+9e6tSpY2VJIiJyHSwfUaxbt447\n7rijUEgAbN26lRdffBEAf39/br31VpKSkujatWuB41q1asXhw4etLlVExKP4+/tz6NChCr+O5T2K\nqKgoxo4dW+Rzbdq0IT4+HoDU1FSSkpJo2bJloeMOHz6MYRj6Mgxeeukll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OoSHtnZ2Rw4cICVK1cSExPD/v378fLyYseOHURERJTpTaKjowkpYlOB\nkydPFggPX19fTpw4cR3li7uIjYU+feC558w9rRUSIp6jTPtRXPs3fG9vb44fP079+vW54YYbSn2D\nrKwsVq9eXWyo/HL+rLi7vmfOnGn/PigoiKCgoFLfW6yXlwevvAIffghr1sBdd7m6IpGqy2azYbPZ\nHP66pQZF3759GTRoEKNGjcIwDFauXElQUBDp6enUq1ev1DdYt24dd9xxBw2LWMzHx8eH48eP238+\nceIEPj4+Rb7OtUEh7uH8eRg3ztxHYudOuGZ/KxFxgV/+Jfrll192yOuWOvW0YMECJkyYwJ49e9i7\ndy/jx4/nnXfeoVatWmzcuLHUN4iKimLs2LFFPjdkyBA+/vhjALZv3069evXUn6gkvv8eunUDX1/Y\nsEEhIeLJynR57OnTp9m5cydgNp1LutrpWunp6TRv3pyUlBTq1KkDQGRkJABhYWEAPPXUU8TFxVGr\nVi0WL15Mly5dChepy2PdyqpVMGkSvP46PP64q6sRkeI47T6KFStWMH36dPr06QPApk2bmDt3LiNH\njqzwm5eVgsI95OXBrFnwwQfmZkPdurm6IhEpidOComPHjsTHx9tHEWfOnKFfv37s27evwm9eVgoK\n17twwexHnDlj3kSnqSYR9+e0He4MwyjQiK5fv74+tKuYpCRz9NCkCWzcqJAQqWpKveopODiYAQMG\nEBISgmEYLF++vNAe2uK51qyBiRPhtdcgNNTV1YiIK5Q69WQYBjExMSQkJODl5UWvXr0KLcVhNU09\nOV9enhkOkZHwz39C9+6urkhErpfbLwroSAoK57p40exHpKaa/YgmTVxdkYiUh+WLAv5yK9Rfvrkz\nt0IV5zl40FyvqVcviI6GG290dUUi4moaUYjdF1/AhAnw6qvmPhIiUrk5bZlx8XyGAbNnwzvvwOef\nwz33uLoiEXEnCooq7uJFeOwx+PFHc72mpk1dXZGIuJtS76MQz3XoENx9N9xyC9hsCgkRKZqCoopa\ntw569ICnn4b33lPTWkSKp6mnKsYwIDwcFiyAmBgzLERESqKgqEIuXTKv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iaGd999l6+++sq+edSRI0do3bo148ePp0OHDpw4cYIhQ4YQHR3t/D+oSDko\nKESAmJgY9u7dy759+4iPj2f69OmcPn2amJgYjh49yoEDB1i6dCnbtm2zj0K2bNlC165d7a+xdetW\n/P39adq0KUFBQXzxxRf25w4dOsSTTz7Jv//9b/z8/GjUqBFpaWmkp6c7/c8qcr0UFCJAQkICISEh\neHl54e3tTZ8+fdi5cydbtmxh1KhRADRq1Ii+ffvaf+fo0aM0adLE/nNUVBQjR44EYOTIkQWmn5o3\nb85dd91V4D0bNWpU7Da/Iu6kuqsLEHEHXl5exe7bcO3jvzzm6s+5ubmsXLmSVatW8eqrr2IYBmfP\nnrWPGGrVqlXk63rSviriuTSiEAF69erF8uXLycvL48yZM2zatIlu3brRo0cPVq5ciWEYpKam8vXX\nX9t/p3nz5pw6dQqADRs20KlTJ44dO0ZKSgpHjhxh2LBhxMTEFBsGqamp+Pr6OuXPJ1IRCgqp0q5+\niA8dOpSOHTsSGBhIv379mDt3Lt7e3gwfPhxfX18CAgJ49NFH6dKli30f7p49e/LNN98AZmN76NCh\nBV57+PDh9ob1L8Pi9OnT1K9fv8iRhoi70TLjIqVIT0+nVq1a/Pzzz3Tr1o2tW7fi7e1NcnIyTz/9\ndIGmdVm99957pKenF7nNr4i7UY9CpBSDBw/m3LlzZGVlMWPGDLy9vQFo2bIlderU4fDhwwXupSiL\n5cuXExsba0W5Ig6nEYWIiJRIPQoRESmRgkJEREqkoBARkRIpKEREpEQKChERKZGCQkRESvT/MN8d\nc+SMsRQAAAAASUVORK5CYII=\n", "text": [ "" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "The answers in the textbook are rounded and hence a bit different from the code.\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E2 - Pg 224" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#calcualte the rate constant for the given first order reaction\n", "#Initialization of variables\n", "import math\n", "import numpy as np\n", "import matplotlib\n", "from matplotlib import pyplot\n", "t=([0, 1000., 2000., 3000., 4000.])\n", "p=[10.20, 5.72, 3.99, 2.78, 1.94]\n", "def fun2(x):\n", "\tfor i in range(0,len(x)):\n", "\t\tx[i]=math.log(x[i])\n", "\treturn x\n", "lnp=fun2(p)\n", "x=t\n", "y=lnp\n", "#hence the value differs from textbook a bit.\n", "A = np.vstack([x, np.ones(len(x))]).T\n", "m1, b1 = np.linalg.lstsq(A, y)[0]\n", "k= -m1\n", "pyplot.plot(x,y)\n", "pyplot.xlabel('time t/sec ')\n", "pyplot.ylabel('ln(P/Torr)')\n", "#Since first order reaction\n", "#results\n", "print '%s %.2e %s' %(\"rate constant =\",k,\" s^-1\")\n", "pyplot.show()" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "rate constant = 4.04e-04 s^-1\n" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEKCAYAAAAMzhLIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtYlGXeB/DvcLBewRRTRwVLRBDlMDNIYp5eLM0wJd08\ngJtiRiEeKjuZ2W5Y5qE8pGaubqa5r2lZW5IJWpuDpoKpgK7kCaUEkTyhgqkc7vePO8YQGVFm5nlm\n5vu5Lq9lOD3fnsv67TP373ffGiGEABERUS1clA5ARETqxkJBRERmsVAQEZFZLBRERGQWCwUREZnF\nQkFERGa5KR2gLvR6PbKzs5WOQURkV3Q6HbKysur9e+ziiSI7OxtCCNX/efPNNxXP4AgZmZM51f7H\nXnJa6v9g20WhICIi5bBQEBGRWSwUFhQZGal0hFuyh4wAc1oac1qWveS0FI0QQvV7PWk0GthBTCIi\nVbHUfzv5REFERGaxUBARkVksFEREZJbdFIriYqUTEBE5J7spFN27A8ePK52CiMj52E2hSEiQxSIj\nQ+kkRETOxa7aYzdsAMaMAT78EBgyROlURETqZqn2WLsqFACQmQlERwMTJgCvvgpoNAqHIy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DA5s2b0a1bN3Tu3BnDhg1DaWkpAOCnn35C9+7dodfrERERgZKSElvdLqKbs/Ro\nOZGa5OXlVdtf6s/7Ta1YsUK0b99elJSUiNOnT4t77rlHLF26VAghxKRJk8T7778vhBDioYceEkeO\nHBFCCJGeni4eeuihGte58YCb8vJyodfrhRBCzJkzR7zzzjtCCCEqKirEpUuXxOnTp0WvXr3E5cuX\nhRDywJm33npLXLt2Tfj6+ordu3cLIeShROXl5Ra9J0S3y03pQkVkTeIWO9T07t0bHh4e8PDwQJMm\nTUzHS4aEhGDfvn0oLS3Fjh07qq1rXLt27ZbXysjIQEREBACgS5cuGDNmDMrKyjBo0CDodDoYjUbk\n5OSgW7dupt/ZrVs3HDp0CK1bt0bnzp0ByEOJiJTGQkFO7a677jJ97OLiYnrt4uKC8vJyVFZWwsvL\nC5mZmbf1e1NSUhAVFQVAnu63bds2bNiwAaNHj8aLL74ILy8v9O3bF59++mm1n9u/f389/4mILI9r\nFOTQGjVqhEuXLt32z1U9HTRq1Ai+vr744osvTJ/ft2/fLa/zww8/oE+fPgCAX3/9Fc2bN0d8fDzi\n4+NNp9Ft374dubm5AIDS0lIcOXIEgYGBKCwsxO7duwEAly5dQkVFxW3nJ7IkFgpyaPfeey+6d++O\nkJAQTJ48udoJYDeeBnbjx1WvV69ejeXLl0Ov1yM4OBjJyck1rjNw4EB89dVXCAsLw48//oi7774b\nHh4eAACj0Qi9Xo+wsDB8/vnneP7559GsWTOsXLkSsbGx0Ol0pred3N3d8dlnn2HixInQ6/Xo168f\nrly5Ys1bRHRL3GacyMJWr16NgoICvPrqq0pHIbIIFgoiIjKLbz0REZFZLBRERGQWCwUREZnFQkFE\nRGaxUBARkVksFEREZBYLBRERmfX/emWTHUtSxxAAAAAASUVORK5CYII=\n", "text": [ "" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example E3 - Pg 230" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Calculate the Activation energy and Arrhenius factor\n", "#Initialization of variables\n", "import math\n", "import numpy as np\n", "from numpy import linalg\n", "T=[700, 730, 760, 790, 810, 840, 910, 1000]\n", "k=[0.011, 0.035, 0.105, 0.343, 0.789, 2.17, 20, 145]\n", "#calculations\n", "def fun1(x):\n", "\tfor i in range(0,len(x)):\n", "\t\tx[i]=1000./(x[i])\n", "\treturn x\n", "x= fun1(T)\n", "def fun2(x):\n", "\tfor i in range(0,len(x)):\n", "\t\tx[i]=math.log(x[i])\n", "\treturn x\n", "y=fun2(k)\n", "A = np.vstack([x, np.ones(len(x))]).T\n", "m1, b1 = np.linalg.lstsq(A, y)[0]\n", "print '%s' %('from graph')\n", "Ea=-m1*8.3145/1000. *1000.\n", "A=math.pow(math.e,(b1))\n", "#results\n", "print '%s %d %s' %(\"Activation energy =\",Ea,\" kJ/mol\")\n", "print '%s %.2e %s' %(\"\\n Arrhenius factor =\",A,\"L/ mol s\")" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "from graph\n", "Activation energy = 188 kJ/mol\n", "\n", " Arrhenius factor = 1.08e+12 L/ mol s\n" ] } ], "prompt_number": 19 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example I1 - Pg 228" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#calculate the net time required\n", "#Initialization of variables\n", "import math\n", "t=28.4 #min\n", "#calculations\n", "n=math.log10(8.) / math.log10(2.)\n", "time=n*t\n", "#results\n", "print '%s %.1f %s' %(\"Time required =\",time,\"min\")\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Time required = 85.2 min\n" ] } ], "prompt_number": 20 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example I2 - Pg 230" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#calculate the value of kdash\n", "#Initialization of variables\n", "import math\n", "E=50*1000. #J/mol\n", "T1=25+273. #K\n", "T2=37+273. #K\n", "#calculations\n", "ln=E/8.3145 *(1./T1-1./T2)\n", "factor=math.pow(math.e,(ln))\n", "#results\n", "print '%s %.2f %s' %(\"kdash =\",factor,\"k\")\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "kdash = 2.18 k\n" ] } ], "prompt_number": 21 } ], "metadata": {} } ] }