{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3 : Fundamental concepts of Stoichiometry"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.1 page no : 41"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables \n",
      "\n",
      "m = 1000 * 0.4536;              #kg/min pounds\n",
      "M = 30.24;                      #gm/mol avg. molecular weight\n",
      "\n",
      "# Calculation \n",
      "m1 = m * 60 / M;\n",
      "\n",
      "# Result\n",
      "print \"molar folw rate = \",m1,\"kmol/hr\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "molar folw rate =  900.0 kmol/hr\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.2 page no : 42"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables \n",
      "MK = 39.1;         #potassium\n",
      "MC = 12.0;         # carbon\n",
      "MO = 16.;          # oxygen\n",
      "\n",
      "# Calculation \n",
      "MK2CO3 = MK * 2 + MC + MO * 3;\n",
      "m = 691.;\n",
      "N = m / MK2CO3;\n",
      "A = 6.023 * 10**23;\n",
      "molecules = N * A;\n",
      "\n",
      "# Result \n",
      "print \"Total no. of molecules = %.4e molecules\"%molecules\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Total no. of molecules = 3.0115e+24 molecules\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3 page no : 43"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables \n",
      "Na = 23.;                   #gm/mol  weight of sodium\n",
      "MNa = 100.;                 #kg      sodium\n",
      "\n",
      "# Calculation \n",
      "N = MNa * 1000 / Na ;       #g-atoms \n",
      "NNa2SO4 = N / 2;\n",
      "\n",
      "# Result \n",
      "print \"(a) moles of sodium sulphate = %.3e mol\"%NNa2SO4\n",
      "MNa2SO4 = 142.06;\n",
      "m = NNa2SO4 * MNa2SO4/1000;\n",
      "print \"(b)kilograms of sodium sulphate = %.2f kg\"%m\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) moles of sodium sulphate = 2.174e+03 mol\n",
        "(b)kilograms of sodium sulphate = 308.83 kg\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.4 page no : 43"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables \n",
      "MFe = 55.85;            \n",
      "MO = 16.;\n",
      "MS = 32.;\n",
      "MFeS2 = MFe + MS * 2;        # molecular weight of FeS2\n",
      "MFe2O3 = MFe * 2 + MO * 3;   # molecular weight of Fe2O3\n",
      "MSO3 = MS + MO * 3;          # molecular weight of SO3\n",
      "m1SO3 = 100.;                       #kg\n",
      "\n",
      "# Calculation \n",
      "N1 = m1SO3 / (MSO3);                #kmol\n",
      "NFeS2 = N1 / 2;\n",
      "mFeS2 = NFeS2 * MFeS2;\n",
      "\n",
      "# Result\n",
      "print \"mass of pyrites to obtain 100kg of SO3 = %.2f kg\"%mFeS2\n",
      "m2SO3 = 50.;                        #kg\n",
      "N2 = m2SO3 / (MSO3);                #kmol\n",
      "NO2 = N2 * 15/8.;\n",
      "mO2 = NO2 * MO * 2;\n",
      "print \"mass of Oxygen consumed to produce 50kg of SO3 = %.2f kg\"%mO2\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "mass of pyrites to obtain 100kg of SO3 = 74.91 kg\n",
        "mass of Oxygen consumed to produce 50kg of SO3 = 37.50 kg\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.5 page no : 44"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables \n",
      "MKClO3 = 122.55                 # weight of potassium\n",
      "mKClO3 = 100.;                  #kg potassium\n",
      "\n",
      "# Calculation \n",
      "NKClO3 = mKClO3 / MKClO3;\n",
      "NO2 = 3 * NKClO3 / 2;\n",
      "V1 = 22.4143;                   #m**3/kmol;\n",
      "V = V1 * NO2;\n",
      "\n",
      "# Result \n",
      "print \"volume of oxygen produced = %.2f m**3\"%V\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "volume of oxygen produced = 27.43 m**3\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.6 page no : 44"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables \n",
      "mH2 = 100.;                 #kg  hydrogen\n",
      "\n",
      "# Calculation \n",
      "NH2 = mH2/2.016;\n",
      "NFe = 3. * NH2 / 4;\n",
      "mFe = NFe * 55.85;\n",
      "\n",
      "# Result \n",
      "print \"(a)mass of iron required = %.2f kg\"%mFe\n",
      "NH2O = NH2 \n",
      "mH2O = NH2O * 18;\n",
      "print \"mass of steam required = %.1f kg\"%mH2O\n",
      "V1 = 22.4143;               #m**3/kmol;\n",
      "V = V1 * NH2;\n",
      "print \"(b)Volume of hydrogen = %.1f m**3\"%V\n",
      "\n",
      "# Answer may vary because of rounding error.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)mass of iron required = 2077.75 kg\n",
        "mass of steam required = 892.9 kg\n",
        "(b)Volume of hydrogen = 1111.8 m**3\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.7 page no : 46"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# variables \n",
      "MCaCO3 = 100.08;    # molecular weight of CaCO3\n",
      "\n",
      "# Calculation \n",
      "GE = MCaCO3 / 2;\n",
      "\n",
      "# Result\n",
      "print \"Gram equivalent wt. of CaCO3 =\",GE,\"g\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Gram equivalent wt. of CaCO3 = 50.04 g\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.8 page no : 48\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# variables \n",
      "m1 = 1.;            #kg (mass in air)\n",
      "m2 = 0.9;           #kg (mass in water)\n",
      "m3 = 0.82;          #kg (mass in liquid)\n",
      "\n",
      "# Calculation \n",
      "L1 = m2 - m1;       #kg (loss of mass in water)\n",
      "L2 = m3 - m1;       #kg (loss of mass in liquid)\n",
      "sp_g = L2 /L1;\n",
      "\n",
      "# Result\n",
      "print \"specific gravity of liquid = \",sp_g\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "specific gravity of liquid =  1.8\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.9 page no : 49\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# variables \n",
      "m1 = 10.            #kg  liquid A\n",
      "m2 = 5.             #kg  liquid B\n",
      "sp_g1 = 1.17;       # gravity A\n",
      "sp_g2 = 0.83;       # gravity B\n",
      "Dwater = 1000.      #kg/m**3  water\n",
      "\n",
      "# Calculation \n",
      "DA = Dwater * sp_g1;\n",
      "DB = Dwater * sp_g2;\n",
      "V1 = m1 / DA;\n",
      "V2 = m2 / DB;\n",
      "V = V1 + V2;\n",
      "Dmix = (m1 + m2)/ V ;\n",
      "sp_g3 = Dmix \n",
      "\n",
      "# Result\n",
      "print \"specific gravity of mixture = %.f kg/m**3\"%sp_g3\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "specific gravity of mixture = 1029 kg/m**3\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.10 page no : 49"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# variables \n",
      "Tw = 100.;              #Tw  baume scale\n",
      "\n",
      "# Calculation \n",
      "sp_g = Tw/200 + 1;\n",
      "Be = 145 - 145/sp_g;\n",
      "\n",
      "# Result\n",
      "print \"specific gravity on beume scale = %.1f Be\"%Be\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "specific gravity on beume scale = 48.3 Be\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.11 page no : 49\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# variables \n",
      "API1 = 30.                          #API gas oil\n",
      "sp_g1 = 141.5/(131.5 + API1)        # (since, API = 141.5/sp_g -131.5)    gravity scale\n",
      "Dwater = 999.                       #kg/m**3;  density of water\n",
      "\n",
      "# Calculation \n",
      "Doil1 = sp_g1 * Dwater;\n",
      "V1 = 250.;                          #m**3\n",
      "m1 = V1 * Doil1;\n",
      "API2 = 15.;                         #API\n",
      "sp_g2 = 141.5/(131.5 + API2);       # (since, API = 141.5/sp_g -131.5)\n",
      "Dwater = 999.;                      #kg/m**3;\n",
      "Doil2 = sp_g2 * Dwater;\n",
      "V2 = 1000.;                         #m**3\n",
      "m2 = V2 * Doil2;\n",
      "Dmix = (m1 + m2)/(V1 + V2);\n",
      "\n",
      "# Result\n",
      "print \"density of the mixture = %.f kg/m**3\"%Dmix\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "density of the mixture = 947 kg/m**3\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.12 page no : 51"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# variables \n",
      "m1 = 250.               #kg wet ammonium sulphate\n",
      "mwater1 = 50.           #kg moisture\n",
      "\n",
      "# Calculation \n",
      "mdrysolid1 = m1 - mwater1;\n",
      "wfe1 = mwater1 / m1;\n",
      "wr1 = mwater1 / mdrysolid1; \n",
      "wtpercentw1 = mwater1 * 100 / m1;\n",
      "wtpercentd1 = mwater1 * 100 / mdrysolid1;\n",
      "a = 90.                 #%\n",
      "mwater2 = mwater1 * (1 - a/100);\n",
      "m2 = mdrysolid1 + mwater2;\n",
      "wfe2 = mwater2 / m2;\n",
      "wr2 = mwater2 / mdrysolid1; \n",
      "wtpercentw2 = mwater2 * 100 / m2;\n",
      "wtpercentd2 = mwater2 * 100 / mdrysolid1;\n",
      "\n",
      "# Result\n",
      "print \"(a)weight fraction of water at entrance =\",wfe1\n",
      "print \"weight fraction of water at exit = %.3f\"%wfe2\n",
      "print \"(b)weight ratio of water at entrance = \",wr1\n",
      "print \"weight ratio of water at exit = \",wr2\n",
      "print \"weight percent of moisture on wet basis at entrance = \",wtpercentw1,\"%\"\n",
      "print \"(c)weight percent of moisture on dry basis at entrance = \",wtpercentd1,\"%\"\n",
      "print \"weight percent of moisture on wet basis at exit = %.2f %%\"%wtpercentw2\n",
      "print \"(d)weight percent of moisture on dry basis at exit = \",wtpercentd2,\"%\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)weight fraction of water at entrance = 0.2\n",
        "weight fraction of water at exit = 0.024\n",
        "(b)weight ratio of water at entrance =  0.25\n",
        "weight ratio of water at exit =  0.025\n",
        "weight percent of moisture on wet basis at entrance =  20.0 %\n",
        "(c)weight percent of moisture on dry basis at entrance =  25.0 %\n",
        "weight percent of moisture on wet basis at exit = 2.44 %\n",
        "(d)weight percent of moisture on dry basis at exit =  2.5 %\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.13 page no : 53"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# variables \n",
      "mdrysolid = 100.                #kg  dry solids\n",
      "percentin = 25.                 # water in the feed\n",
      "\n",
      "# Calculation \n",
      "mwaterin = mdrysolid * percentin / 100;\n",
      "percentout = 2.5;\n",
      "mwaterout = mdrysolid * percentout / 100;\n",
      "mremoved = mwaterin - mwaterout;\n",
      "percentremoved = mremoved *100 / mwaterin ;\n",
      "\n",
      "# Result\n",
      "print \"percentage of water removed = \",percentremoved\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "percentage of water removed =  90.0\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.14 page no : 53"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# variables \n",
      "m = 1.                      #kg  wet ammonium sulphate\n",
      "percent1 = 20.              #%   water\n",
      "\n",
      "# Calculation \n",
      "mwaterin = m * percent1 / 100.\n",
      "mdrysolid = m - mwaterin;\n",
      "percent2 = 2.44;            #%\n",
      "mout = mdrysolid / (1 - percent2/100);\n",
      "mwaterout = mout - mdrysolid;\n",
      "mremoved = mwaterin - mwaterout;\n",
      "percentremoved = mremoved * 100 / mwaterin ;\n",
      "\n",
      "# Result\n",
      "print \"weight of water removed = %.2f kg\"%mremoved\n",
      "print \"percentage of water removed = %.f %%\"%percentremoved\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "weight of water removed = 0.18 kg\n",
        "percentage of water removed = 90 %\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.15 page no : 55"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# variables \n",
      "mwater = 100.                #kg water\n",
      "mNaCl = 35.8                 #kg solubility\n",
      "\n",
      "# Calculation \n",
      "msolu = mwater + mNaCl;\n",
      "mfr = mNaCl / msolu;\n",
      "mpr = mfr * 100;\n",
      "MNaCl = 58.45;              #kg/kmol\n",
      "NNaCl = mNaCl / MNaCl;\n",
      "MH2O = 18.                  #kg/kmol\n",
      "NH2O = mwater / MH2O;\n",
      "Mfr = NNaCl / (NNaCl + NH2O);\n",
      "Mpr = Mfr * 100;\n",
      "N = NNaCl *1000 / mwater;\n",
      "\n",
      "# Result\n",
      "print \"(a)mass fraction of NaCl = %.4f\"%mfr\n",
      "print \"mass percent of NaCl= %.2f %%\"%mpr\n",
      "print \"(b)mole fraction of NaCl = %.4f\"%Mfr\n",
      "print \"mole percent of NaCl = %.2f %%\"%Mpr\n",
      "print \"kmol NaCl per 1000 kg of water = %.3f kMol NaCl\"%N\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)mass fraction of NaCl = 0.2636\n",
        "mass percent of NaCl= 26.36 %\n",
        "(b)mole fraction of NaCl = 0.0993\n",
        "mole percent of NaCl = 9.93 %\n",
        "kmol NaCl per 1000 kg of water = 6.125 kMol NaCl\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.16 page no : 55"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# variables \n",
      "Y = 0.015;                  #kg water vapour/kg dry air\n",
      "Mair = 29.;                 #kg/kmol weight of air\n",
      "Mwater = 18.016;            #kg/kmol  \n",
      "\n",
      "# Calculation \n",
      "Nwater = Y / Mwater;        #kmol\n",
      "Nair = 1 / Mair;            #kmol\n",
      "Mpr = Nwater *100 / (Nwater + Nair);\n",
      "Mr = Nwater / Nair;\n",
      "\n",
      "# Result\n",
      "print \"(a)mole percent of water vapour = %.2f %%\"%Mpr\n",
      "print \"(b) molal absolute humidity = %.4f kmol water/kmol dry air\"%Mr\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)mole percent of water vapour = 2.36 %\n",
        "(b) molal absolute humidity = 0.0241 kmol water/kmol dry air\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.17 page no : 56"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# variables \n",
      "msolu = 100.;                       #g basis\n",
      "MK2CO3 = 138.20;                    #g/mol molecular weight\n",
      "percent1 = 50.;                     #% mass of K2CO3\n",
      "\n",
      "# Calculation \n",
      "mK2CO3 = percent1 *msolu / 100;\n",
      "NK2CO3 = mK2CO3 / MK2CO3;\n",
      "mwater = msolu - mK2CO3;\n",
      "Nwater = mwater / 18.06;\n",
      "Mpr = NK2CO3 * 100 / (NK2CO3 + Nwater);\n",
      "sp_gr  =1.53;\n",
      "Vsolu = msolu/sp_gr;                #mL\n",
      "Vwater = mwater / 1;                #mL\n",
      "Vpr = Vwater * 100/ Vsolu;\n",
      "Molality = NK2CO3 / (mwater * 10**-3);\n",
      "Molarity = NK2CO3 / (Vsolu * 10**-3);\n",
      "Eq_wt = MK2CO3 / 2;\n",
      "No = mK2CO3/Eq_wt;\n",
      "N = No / (Vsolu * 10**-3);\n",
      "\n",
      "# Result\n",
      "print \"(a)Mole prcent of salt = %.2f %%\"%Mpr\n",
      "print \"(b)Volume percent of water = %.2f %%\"%Vpr\n",
      "print \"(c)Molality = %.3f mol/kg\"%Molality\n",
      "print \"(d)Molarity = %.3f mol/L\"%Molarity\n",
      "print \"(e)Normality = %.2f N\"%N\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)Mole prcent of salt = 11.56 %\n",
        "(b)Volume percent of water = 76.50 %\n",
        "(c)Molality = 7.236 mol/kg\n",
        "(d)Molarity = 5.535 mol/L\n",
        "(e)Normality = 11.07 N\n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.18 page no : 58"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# variables \n",
      "msolu = 100.;               #kg volume\n",
      "percent1 = 60.;             #%  alcohol\n",
      "Dwater = 998.;              #kg/m**3  water\n",
      "Dalco = 798.;               #kg/m**3  alcohol\n",
      "Dsolu = 895.;               #kg/m**3  solution\n",
      "\n",
      "# Calculation \n",
      "Vsolu = msolu/Dsolu;\n",
      "malco = msolu * percent1 / 100;\n",
      "Valco = malco / Dalco;\n",
      "Vpr = Valco * 100 / Vsolu;\n",
      "Malco = 46.048;             #kg/kmol\n",
      "N = malco/Malco;\n",
      "Molarity = N/(Vsolu );\n",
      "mwater = msolu - malco;\n",
      "Molality = N * 1000 /mwater;\n",
      "\n",
      "# Result\n",
      "print \"(a)Volume percent of ethanol in solution = %.1f %%\"%Vpr\n",
      "print \"(b)Molarity = %.2f mol/L\"%Molarity\n",
      "print \"(c)Molality = %.3f mol/(kg of water)\"% Molality\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)Volume percent of ethanol in solution = 67.3 %\n",
        "(b)Molarity = 11.66 mol/L\n",
        "(c)Molality = 32.575 mol/(kg of water)\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.19 page no : 63"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#CO + CL2 = COCl2\n",
      "import math \n",
      "# Variables  \n",
      "Np = 12.;                   #moles phosgene\n",
      "NCl2 = 3.;                  #moles chlorine\n",
      "NCO = 8.;                   #moles carbon monoxide\n",
      "\n",
      "# Calculation \n",
      "N1Cl2 = NCl2 + Np;\n",
      "N1CO = NCO + Np;\n",
      "pr_ex = (N1CO - N1Cl2)* 100/N1Cl2;\n",
      "pr_co = (N1Cl2-NCl2) * 100/ N1Cl2;\n",
      "T = Np + NCl2 + NCO;\n",
      "T1 = N1Cl2 + N1CO;\n",
      "N = T / T1;\n",
      "\n",
      "# Result\n",
      "print \"(a)percent excess of CO = %.2f %%\"%pr_ex\n",
      "print \"(b)percent conversion = %.2f %%\"%pr_co\n",
      "print \"(c)Moles of total products per mole of total reactants = %.3f\"%N\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)percent excess of CO = 33.33 %\n",
        "(b)percent conversion = 80.00 %\n",
        "(c)Moles of total products per mole of total reactants = 0.657\n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.21 page no : 64"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables \n",
      "\n",
      "msolu = 100.;               #g  mold of feed mixture\n",
      "MK2CO3 = 138.20;            #g/mol \n",
      "ethylene = 53.89            # %\n",
      "ethanol = 14.37             # %\n",
      "ether = 1.8                 # %\n",
      "water = 23.35               # %\n",
      "\n",
      "# Calculation \n",
      "Ethylene = ethylene * 83.57 / 100\n",
      "Ethanol = ethanol*83.57 / 100\n",
      "Ether = ether*83.57 / 100\n",
      "Water = water*83.57 / 100\n",
      "Inerts = 3                 # mol\n",
      "\n",
      "conversion_ethylene = (60 - Ethylene)/60 * 100\n",
      "yield_ethanol =  Ethanol/(60 - Ethylene)*100\n",
      "yeild_ether = Ether*2/(60-Ethylene) * 100\n",
      "\n",
      "# Result \n",
      "print \"Conversation of ethylene = %.2f %%\"%conversion_ethylene\n",
      "print \"Yield of ethanol = %.2f %%\"%yield_ethanol\n",
      "print \"Yield of Ether = %d %%\"%yeild_ether\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Conversation of ethylene = 24.94 %\n",
        "Yield of ethanol = 80.25 %\n",
        "Yield of Ether = 20 %\n"
       ]
      }
     ],
     "prompt_number": 1
    }
   ],
   "metadata": {}
  }
 ]
}