{
 "metadata": {
  "name": "Chapter 14"
 }, 
 "nbformat": 2, 
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown", 
     "source": [
      "# Chapter 14 :- Chemical and Phase Equilibrium"
     ]
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "##<heading2> Example 14.1 Page no-688"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# Given:-", 
      "# The reaction is CO + .5O2  ---->   CO2", 
      "# Part(a)", 
      "T = 298.0                                                                         # in kelvin", 
      "Rbar = 8.314                                                                      # universal gas constant in SI units", 
      "# From table A-25", 
      "", 
      "hfbarCO2 = -393520.0                                                              # in kj/kmol", 
      "hfbarCO = -110530.0                                                               # in kj/kmol", 
      "hfbarO2 = 0                                                                       # in kj/kmol", 
      "deltahbarCO2 = 0                                                                  # in kj/kmol", 
      "deltahbarCO = 0                                                                   # in kj/kmol", 
      "deltahbarO2 = 0                                                                   # in kj/kmol", 
      "sbarCO2 = 213.69                                                                  # in kj/kmol.K", 
      "sbarCO = 197.54                                                                   # in kj/kmol.K", 
      "sbarO2 = 205.03                                                                   # in kj/kmol.K", 
      "# From table A-27", 
      "logKtable = 45.066", 
      "# Calculations", 
      "import math", 
      "deltaG = (hfbarCO2-hfbarCO-.5*hfbarO2) + (deltahbarCO2-deltahbarCO-.5*deltahbarO2) - T*(sbarCO2-sbarCO-.5*sbarO2)", 
      "lnK = -deltaG/(Rbar*T)", 
      "logK = (1/math.log(10))*lnK", 
      "# Results", 
      "print '-> Part(a) the value of equilibrium constant expressed as log10K is:  '", 
      "print logK", 
      "print '-> The value of equilibrium constant expressed as log10K from table A-27 is:  '", 
      "print logKtable", 
      "", 
      "# Part(b)", 
      "T = 2000.0                                                                        # in kelvin", 
      "# From table A-23", 
      "hfbarCO2 = -393520.0                                                              # in kj/kmol", 
      "hfbarCO = -110530.0                                                               # in kj/kmol", 
      "hfbarO2 = 0                                                                       # in kj/kmol", 
      "deltahbarCO2 = 100804-9364                                                        # in kj/kmol", 
      "deltahbarCO = 65408 - 8669                                                        # in kj/kmol", 
      "deltahbarO2 = 67881 - 8682                                                        # in kj/kmol", 
      "sbarCO2 = 309.210                                                                 # in kj/kmol.K", 
      "sbarCO = 258.6                                                                    # in kj/kmol.K", 
      "sbarO2 = 268.655                                                                  # in kj/kmol.K", 
      "# Calculations", 
      "deltaG = (hfbarCO2-hfbarCO-.5*hfbarO2) + (deltahbarCO2-deltahbarCO-.5*deltahbarO2) - T*(sbarCO2-sbarCO-.5*sbarO2)", 
      "lnK = -deltaG/(Rbar*T)", 
      "logK = (1/math.log(10))*lnK", 
      "# From table A-27", 
      "logKtable = 2.884", 
      "# Results", 
      "print '-> Part(b) the value of equilibrium constant expressed as log10K is:  '", 
      "print logK", 
      "print '-> The value of equilibrium constant expressed as log10K from table A-27 is:  '", 
      "print logKtable"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "-> Part(a) the value of equilibrium constant expressed as log10K is:  ", 
        "45.094010685", 
        "-> The value of equilibrium constant expressed as log10K from table A-27 is:  ", 
        "45.066", 
        "-> Part(b) the value of equilibrium constant expressed as log10K is:  ", 
        "2.88485359375", 
        "-> The value of equilibrium constant expressed as log10K from table A-27 is:  ", 
        "2.884"
       ]
      }
     ], 
     "prompt_number": 10
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "##<heading2>  Example 14.2 Page no-690"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# Given:-", 
      "# Applying conservation of mass, the overall balanced chemical reaction equation is", 
      "# CO + .5O2    ------->    zCO + (z/2)O2 + (1-z)CO2", 
      "", 
      "# At 2500 K, Table A-27 gives", 
      "log10K = -1.44", 
      "# Part(a)", 
      "p = 1.0                                                                         # in atm", 
      "# Calculations", 
      "import math", 
      "K = (10.0)**(log10K)                                                            # equilibrium constant", 
      "# Solving equation K = (z/(1-z))*(2/(2 + z))^.5 *(p/1)^.5 gives", 
      "z = 0.129", 
      "yCO = 2.0*z/(2.0 + z)", 
      "yO2 = z/(2.0 + z)", 
      "yCO2 = 2.0*(1.0 - z)/(2.0 + z)", 
      "", 
      "# Results", 
      "print '-> Part(a) mole fraction of CO is:  ',round(yCO,3)", 
      "print '-> Mole fraction of O2 is:  ',round(yO2,3)", 
      "print '-> Mole fraction of CO2 is:  ',round(yCO2,3)", 
      "", 
      "# Part(b)", 
      "p = 10.0                                                                          # in atm", 
      "# Solving equation K = (z/(1-z))*(2/(2 + z))^.5 *(p/1)^.5 gives", 
      "z = 0.062", 
      "yCO = 2.0*z/(2.0 + z)", 
      "yO2 = z/(2.0 + z)", 
      "yCO2 = 2.0*(1.0 - z)/(2.0 + z)", 
      "", 
      "# Results", 
      "print '-> Part(b) mole fraction of CO is:  ',round(yCO,3)", 
      "print '-> Mole fraction of O2 is:  ',round(yO2,3)", 
      "print '-> Mole fraction of CO2 is:  ',round(yCO2,3)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "-> Part(a) mole fraction of CO is:   0.121", 
        "-> Mole fraction of O2 is:   0.061", 
        "-> Mole fraction of CO2 is:   0.818", 
        "-> Part(b) mole fraction of CO is:   0.06", 
        "-> Mole fraction of O2 is:   0.03", 
        "-> Mole fraction of CO2 is:   0.91"
       ]
      }
     ], 
     "prompt_number": 11
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "##<heading2> Example 14.3 Page no-691"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# Given:-", 
      "yCO = 0.298", 
      "p = 1                                                                           # in atm", 
      "pref = 1                                                                        # in atm", 
      "# With this value of K, table A-27 gives", 
      "T = 2881", 
      "", 
      "# Calculations", 
      "# Solving yCO = 2z/(2 + z)", 
      "z = 2*yCO/(2 - yCO)", 
      "K = (z/(1-z))*(z/(2 + z))**.5*(p/pref)**.5", 
      "", 
      "# Result", 
      "print '-> The temperature T of the mixture in kelvin is:  ',T"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "-> The temperature T of the mixture in kelvin is:   2881"
       ]
      }
     ], 
     "prompt_number": 12
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "##<heading2> Example 14.4 Page no-692"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# Given:-", 
      "# For a complete reaction of CO with the theoretical amount of air", 
      "# CO + .5 O2 + 1.88N2  ----->  CO2 + 1.88N2    ", 
      "# Accordingly, the reaction of CO with the theoretical amount of air to form CO2, CO, O2, and N2 is", 
      "# CO + .5O2 + 1.88N2 --->  zCO + z/2 O2 + (1-z)CO2 + 1.88N2", 
      "", 
      "K = 0.0363                                                                       # equilibrium constant the solution to Example 14.2", 
      "p =1.0                                                                           # in atm", 
      "pref = 1.0                                                                       # in atm", 
      "", 
      "# Calculations", 
      "# Solving K = (z*z^.5/(1-z))*((p/pref)*2/(5.76+z))^.5 gives", 
      "z = 0.175", 
      "yCO = 2.0*z/(5.76 + z)", 
      "yO2 = z/(5.76 + z)", 
      "yCO2 = 2.0*(1.0-z)/(5.76 + z)", 
      "yN2 = 3.76/(5.76 + z)", 
      "", 
      "# Results", 
      "print '-> The mole fraction of CO is:  ',round(yCO,3)", 
      "print '-> The mole fraction of O2 is:  ',round(yO2,3)", 
      "print '-> The mole fraction of CO2 is:  ',round(yCO2,3)", 
      "print '-> The mole fraction of N2 is:  ',round(yN2,3)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "-> The mole fraction of CO is:   0.059", 
        "-> The mole fraction of O2 is:   0.029", 
        "-> The mole fraction of CO2 is:   0.278", 
        "-> The mole fraction of N2 is:   0.634"
       ]
      }
     ], 
     "prompt_number": 13
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "##<heading2>  Example 14.5 Page no-692"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# Given:-", 
      "# Applying the conservation of mass principle, the overall dissociation reaction is described by", 
      "# CO2  ---->  zCO2 + (1-z)CO + ((1-z)/2)O2", 
      "", 
      "p = 1.0                                                                           # in atm", 
      "pref = 1.0                                                                        # in atm", 
      "# At 3200 K, Table A-27 gives", 
      "log10k = -.189", 
      "# Solving k = ((1-z)/2)*((1-z)/(3-z))^.5 gives", 
      "z = 0.422", 
      "", 
      "# Calculations", 
      "k = 10**log10k", 
      "# From tables A-25  and A-23", 
      "hfbarCO2 = -393520.0                                                              # in kj/kmol", 
      "deltahbarCO2 = 174695-9364                                                        # in kj/kmol", 
      "hfbarCO = -110530.0                                                               # in kj/kmol", 
      "deltahbarCO = 109667-8669                                                         # in kj/kmol", 
      "hfbarO2 = 0                                                                       # in kj/kmol", 
      "deltahbarO2 = 114809-8682                                                         # in kj/kmol", 
      "hfbarCO2r =  -393520.0                                                            # in kj/kmol", 
      "deltahbarCO2r = 0                                                                 # in kj/kmol", 
      "", 
      "Qcvdot = 0.422*(hfbarCO2 + deltahbarCO2) + 0.578*(hfbarCO + deltahbarCO) + 0.289*(hfbarO2 + deltahbarO2)- (hfbarCO2r + deltahbarCO2r)  ", 
      "", 
      "# Result", 
      "print '-> The heat transfer to the reactor, in kJ per kmol of CO2 entering is:  '", 
      "print Qcvdot"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "-> The heat transfer to the reactor, in kJ per kmol of CO2 entering is:  ", 
        "322385.449"
       ]
      }
     ], 
     "prompt_number": 14
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "##<heading2>Example 14.8 Page no-701"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "%matplotlib inline"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "", 
        "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].", 
        "For more information, type 'help(pylab)'."
       ]
      }
     ], 
     "prompt_number": 15
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# Given:-", 
      "# The ionization of cesium to form a mixture of Cs, Cs+, and e-\u0005 is described by", 
      "# Cs  ---->  (1-z)Cs + zCs+ + Ze-", 
      "", 
      "K = 15.63", 
      "z = 0.95", 
      "pref =1                                                                         # in atm", 
      "# Calculation", 
      "p = pref*K*((1-z**2)/z**2)", 
      "", 
      "# Results", 
      "print '-> The pressure if the ionization of CS is 95 percent complete is: ',p,'atm'", 
      "", 
      "x = []", 
      "y = []", 
      "from numpy import linspace ", 
      "from pylab import plot, show ", 
      "x = linspace(0,10,100)", 
      "for i in range(0,100):", 
      "    y.append(i)", 
      "    y[i]= 100*((1/(1+x[i]/K))**0.5)", 
      "", 
      "plot(x,y)", 
      "xlabel(\"Pressure (atm)\")", 
      "ylabel(\"Ionization\")", 
      "show()"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "-> The pressure if the ionization of CS is 95 percent complete is:  1.68855955679 atm"
       ]
      }, 
      {
       "output_type": "display_data", 
       "png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEMCAYAAADEXsFmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xt8z/X///Hbmy3L2BbZJnMKi9nYZk1cPpi0SUVyKirT\nvnwqn+pTOikJFabyCckhx3VkSfj4oZLWR2kfp9H6OKYtYiizwpy2vX5/PPVGaDbb+/Xedr9eLi7Z\n23vv9733pfbwPD2eDsuyLEREpMKrZHcAERFxDyoIIiICqCCIiMgZKggiIgKoIIiIyBkqCCIiApRC\nQUhISCAgIICwsDDnY9nZ2cTGxhIcHExcXBw5OTnOPxs7dixNmjShadOmfPbZZyUdR0RELlOJF4QH\nHniAFStWnPdYYmIisbGx7Nixg06dOpGYmAjAli1bmD9/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enVxo4kAKghSBlWtWpW0tDTS\n09O56qqrmDZt2nl/npeX57IsRXmvyZMnM2DAgL98TkZGBh988EGRczz88MO89tprRf4+kXOpIEiZ\n1q5dO3744Qe++uor2rVrx5133kloaCgFBQU8/fTTREdH07JlS95++23AnNhs3769c4TxzTffUFBQ\nwIABAwgLC6NFixZMnDgRgJiYGDZs2ADAr7/+SsOGDQGYO3cu3bp1o1OnTsTGxpKbm0tCQgKtW7cm\nMjKSJUuWXDTrggULnCOEzMxM2rdvT6tWrWjVqhXffvstAEOHDmX16tVEREQwYcIE54GiuLg4GjZs\nyOTJk3n99deJjIykTZs2HD58GIAmTZqQmZl5WS2ORS6p1E9MiJSwatWqWZZlWadPn7a6detmTZs2\nzUpJSbG8vb2tzMxMy7Isa/r06dYrr7xiWZZlnThxwoqKirIyMjKs8ePHW6NHj7Ysy7IKCgqsI0eO\nWOvXr7diY2Odr//bb79ZlmVZMTEx1oYNGyzLsqxffvnFatCggWVZljVnzhwrKCjIedDnueees957\n7z3Lsizr8OHDVnBwsHXs2LHzMmdlZVmhoaHOr3Nzc60TJ05YlmVZO3bssKKioizLMoft7rjjDufz\n5syZYzVu3Ng6evSo9csvv1g+Pj7W9OnTLcuyrCeeeMKaMGGC87n9+/e3li1bVsxPVcSyPOwuSCJF\ndfz4cSIiIgBo3749CQkJfPPNN0RHR1O/fn0APvvsM9LT01mwYAEAv//+Oz/88AM33ngjCQkJnD59\nmu7du9OyZUsaNWrEjz/+yGOPPcbtt99OXFxcoRliY2Px8/Nzvte///1vXn/9dQBOnjzJnj17uOGG\nG5zP/+mnn6hdu7bz61OnTvHII4+wefNmKleuzM6dOwEuaNjncDjo2LEj3t7eeHt74+fn57wUKCws\njO+++8753Ouuu47MzMwifZYi51JBkDLn6quvJi0t7YLHvb29z/t68uTJxMbGXvC81atXs3TpUgYM\nGMCQIUO4//772bx5M59++inTpk0jOTmZWbNm4eHhQUFBAQAnTpz4y/dauHAhTZo0+cvc5/6wf+ON\nN6hduzbvvvsu+fn5eHl5XfL7qlSp4vx9pUqVnF9XqlTpvDUMy7LUJViuiNYQpFzq3LkzU6ZMcf7A\n3LFjB7m5uezevZtatWoxcOBABg4cyMaNGzl06BD5+fn06NGDl19+2VlsGjRowPr16wGcI41Lvde5\nV5perFjVr1/f2XkSzIglMDAQMNfI5ufnA1C9enWOHDnifN6fRwzn+vOfZWVl0aBBg0s+X6QwKghS\n5lzsb8F/7vc+cOBAQkJCiIyMJCwsjIcffpi8vDxSUlIIDw8nMjKS5ORkHn/8cfbu3UvHjh2JiIjg\n/vvvZ+zYsQA89dRTTJ06lcjISA4dOuR8/T+/1/Dhwzl9+jQtWrQgNDSUESNGXJAvMDCQvLw8jh07\nBsDgwYNJSkoiPDyc7du3O++2aNmyJZUrVyY8PJwJEyZc8F5//v25X6elpdGmTZtifaYiAGpuJ+Ii\nI0eOpFmzZtx9990l/to7duzgqaeeuuQOJ5HLoRGCiIv84x//cPanL2nTpk3jmWeeKZXXlopDIwQR\nEQE0QhARkTNUEEREBFBBEBGRM1QQREQEUEEQEZEzVBBERASA/w+AWqN6z/mF6wAAAABJRU5ErkJg\ngg==\n"
      }
     ], 
     "prompt_number": 16
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "##<heading2> Example 14.9 Page no-703"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# Given:-", 
      "# The overall reaction can be written as", 
      "# CO2 + .5O2 + .5N2  ---->  aCO + bNO + (1-a)CO2 + .5(1+a-b)O2 + .5(1-b)N2", 
      "", 
      "# At 3000 K, Table A-27 provides", 
      "log10K1 = -0.485                      # equilibrium constant of the reaction CO2 <--> CO + .5O2", 
      "log10K2 = -0.913                      # equilibrium constant of the reaction .5O2 + .5N2 <-->NO", 
      "# Solving equations K1 = (a/(1-a))*((1+a-b)/(4+a))^.5  and  K2 = 2b/((1+a-b)*(1-b))^.5", 
      "a = 0.3745", 
      "b = 0.0675", 
      "", 
      "# Calculations", 
      "K1 = 10**log10K1", 
      "K2 = 10**log10K2", 
      "", 
      "# Result", 
      "print '-> The composition of the equilibrium mixture, in kmol per kmol of CO2 present initially, is then 0.3745CO, 0.0675NO, 0.6255CO2, 0.6535O2, 0.4663N2.'"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "-> The composition of the equilibrium mixture, in kmol per kmol of CO2 present initially, is then 0.3745CO, 0.0675NO, 0.6255CO2, 0.6535O2, 0.4663N2."
       ]
      }
     ], 
     "prompt_number": 17
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "##<heading2> Example 14.10 Page no-707"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# Given:-", 
      "# With data from Table A-2 at 20\u0004C,", 
      "vf = 1.0018e-3                                                                  # in m^3/kg", 
      "psat = 0.0239                                                                   # in bar", 
      "p = 1.0                                                                         # in bar", 
      "T = 293.15                                                                      # in kelvin", 
      "Rbar = 8.314                                                                    # universal gas constant in SI units", 
      "M = 18.02                                                                       # molat mass of water in kg/kmol", 
      "e=2.715", 
      "", 
      "# Calculations", 
      "pvbypsat = e**(vf*(p-psat)*10**5/((1000*Rbar/M)*T))", 
      "percent = (pvbypsat-1)*100", 
      "", 
      "# Result", 
      "print '-> The departure, in percent, of the partial pressure of the water vapor from the saturation pressure of water at 20\u0004 is: ',round(percent,3)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "-> The departure, in percent, of the partial pressure of the water vapor from the saturation pressure of water at 20\u0004 is:  0.072"
       ]
      }
     ], 
     "prompt_number": 18
    }
   ]
  }
 ]
}