{
 "metadata": {
  "name": "",
  "signature": "sha256:979be99f782b9e96d5c91c71d16d98b4d3114044e9cfea33a19906379e1d8fd0"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 8 Chemical Equlibrium"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.1 , Page no:164"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "x= 3.33\n",
      "n= 5 #moles\n",
      "\n",
      "#CALCULATIONS\n",
      "N= x**2/(n-x)**2\n",
      "\n",
      "#RESULTS\n",
      "print\"moles of water and ester formed=\",round(N);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "moles of water and ester formed= 4.0\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.2 , Page no:165"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "n= 1 #mole\n",
      "x= 3\n",
      "y= 4\n",
      "\n",
      "#CALCULATIONS\n",
      "r= x**2/n**2\n",
      "z= n/x\n",
      "n= n+z\n",
      "n1= x-z\n",
      "\n",
      "#RESULTS\n",
      "print\"moles of acid and alcohol=\",round(n,2),\"moles\";\n",
      "print\"moles of ester and water=\",round(n1,2),\"moles\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "moles of acid and alcohol= 1.33 moles\n",
        "moles of ester and water= 2.67 moles\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.3 , Page no:165"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "k= 1.1*10**-5\n",
      "V= 600 #ml\n",
      "n= 0.4 #mole\n",
      "\n",
      "#CALCULATIONS\n",
      "m= n*1000/V\n",
      "x= (-k+math.sqrt(k**2+4*4*0.67*k))/(2*4)\n",
      "M= 2*x\n",
      "P= x*100/m\n",
      "\n",
      "#RESULTS\n",
      "print\"molar concentration of NO2=\",'%.2E'%M,\"mol per litre\";\n",
      "print\"per cent dissociation=\",round(P,2),\"per cent\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "molar concentration of NO2= 2.71E-03 mol per litre\n",
        "per cent dissociation= 0.2 per cent\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.4 , Page no:167"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "pno2= 0.31 #atm\n",
      "pn2o2= 0.69 #atm\n",
      "p= 10 #atm\n",
      "\n",
      "#CALCULATIONS\n",
      "Kp= pno2**2/pn2o2\n",
      "x= (-Kp+math.sqrt(Kp**2+4*4*p*Kp))/(2*4)\n",
      "p1= p-x\n",
      "p2= 2*x\n",
      "\n",
      "#RESULTS\n",
      "print\"Kp=\",round(Kp,2);\n",
      "print\"N2O4=\",round(p1,2);\n",
      "print\"NO2=\",round(p2,2);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Kp= 0.14\n",
        "N2O4= 9.43\n",
        "NO2= 1.15\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.5 , Page no:172"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "T= 65 #C\n",
      "R= 1.98 #cal/mol K\n",
      "kp= 2.8\n",
      "kp1= 0.141\n",
      "T1= 25 #C\n",
      "\n",
      "#CALCULATIONS\n",
      "H= math.log10(kp/kp1)*2.303*R*(273+T1)*(273+T)/(T-T1)\n",
      "\n",
      "#RESULTS\n",
      "print\"average heat of reaction=\",round(H+62),\"cal\";"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "average heat of reaction= 14965.0 cal\n"
       ]
      }
     ],
     "prompt_number": 5
    }
   ],
   "metadata": {}
  }
 ]
}