{ "metadata": { "name": "", "signature": "sha256:2573953a96bd6739252db580058edb8938919cec53d4f1d76f9484cfa4f2a1d5" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 16:INTRODUCTION TO PHASE AND CHEMICAL EQUILIBRIUM" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex16.1:676" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#ques1\n", "# pressure required to make diamonds from graphite\n", "import math\n", "T=25 # temp in degree C\n", "ggrp= 0 # g for fraphite\n", "gdiamnd=2867.8 # g for diamond in kJ/mol\n", "vgrp=0.000444 # specific volume of graphite in m^3/kg\n", "vdiamnd=0.000284 # specific volume of graphite in m^3/kg\n", "BetaTgrp=0.304e-6 # beta for graphite in 1/MPa\n", "BetaTdiamnd=0.016e-6 # beta for diamond in 1/MPa\n", "\n", "P=-(-2*(vgrp-vdiamnd)+math.sqrt((2*vgrp-2*vdiamnd)**2-4*(vgrp*BetaTgrp-vdiamnd*BetaTdiamnd)*(2*gdiamnd/(12.011*1000))))/(2*(vgrp*BetaTgrp-vdiamnd*BetaTdiamnd))\n", "print int(P),\" MPa is the pressure at which possibility exists for conversion from graphite to diamonds\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "1493 MPa is the pressure at which possibility exists for conversion from graphite to diamonds\n" ] } ], "prompt_number": 18 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex16.2:PG-681" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#ques2\n", "#to determine change in gibbs free energy\n", "\n", "#1-H2\n", "#2-O2\n", "#3-H2O\n", "\n", "#at T=298 K\n", "T1=298.0;#K\n", "Hf1=0;#Enthalpy of formation of H2 at 298 K\n", "Hf2=0;#Enthalpy of formation of O2 at 298 K\n", "Hf3=-241826;#enthalpy of formation of H2O at 298 K in kJ\n", "dH=2*Hf1+Hf2-2*Hf3;#Change in enthalpy in kJ\n", "Sf1=130.678;#Entropy of H2 at 298 K n kJ/K\n", "Sf2=205.148;#Entropy of O2 at 298 K in kJ/K\n", "Sf3=188.834;#entropy of H2O at 298 K in kJ/K\n", "dS=2*Sf1+Sf2-2*Sf3;#Change in entropy in kJ/K\n", "dG1=dH-T1*dS;#change n gibbs free energy in kJ\n", "print\" Change in gibbs free energy at\",T1,\"kelvin is\",round(dG1),\"kJ \"\n", "#at T=2000 K\n", "T2=2000.0;#K\n", "Hf1=52942-0;#Enthalpy of formation of H2 at 2000 K\n", "Hf2=59176-0;#Enthalpy of formation of O2 at 2000 K\n", "Hf3=-241826+72788;#enthalpy of formation of H2O at 2000 K in kJ\n", "dH=2*Hf1+Hf2-2*Hf3;#Change in enthalpy in kJ\n", "Sf1=188.419;#Entropy of H2 at 2000 K n kJ/K\n", "Sf2=268.748;#Entropy of O2 at 2000 K in kJ/K\n", "Sf3=264.769;#entropy of H2O at 2000 K in kJ/K\n", "dS=2*Sf1+Sf2-2*Sf3;#Change in entropy in kJ/K\n", "dG2=dH-(T2*dS);#change n gibbs free energy in kJ\n", "print\" Change in gibbs free energy at\",T2,\"kelvin is\",round(dG2),\" kJ \"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Change in gibbs free energy at 298.0 kelvin is 457179.0 kJ \n", " Change in gibbs free energy at 2000.0 kelvin is 271040.0 kJ \n" ] } ], "prompt_number": 21 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex16.3:PG-683" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#ques3\n", "#calculating equilibrium constant \n", "\n", "dG1=-457.166;#change in gibbs free energy at temp 298 K from example2 in kJ\n", "dG2=-271.040;#change in gibbs free energy at temp 2000 K from example2 n kJ\n", "T1=298;#K\n", "T2=2000;#K\n", "R=8.3145;#gas constant\n", "K1=dG1*1000/(R*T1);\n", "K2=dG2*1000/(R*T2);\n", "print\" Equilibrium constant at \",T1,\"K = \",round(K1,2)\n", "print\" Equilibrium constant at \",T2,\"K = \",round(K2,3)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " Equilibrium constant at 298 K = -184.51\n", " Equilibrium constant at 2000 K = -16.299\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex16.4:Pg-684" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# The example is about proving that Equlibrium constant can be found using table hence doesn't require solution in python " ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 19 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex16.5:Pg-685" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# ques 5\n", "# To determine Heat Transfer\n", "# The process is two step as:\n", "# Combustion: C + O2--->CO2\n", "# Dissociation reaction: 2CO2---->2CO + O2\n", "# overall process : C + O2 \u2192 0.5622 CO2 + 0.4378 CO + 0.2189 O2\n", "nCO2=0.5622 # moles of CO2\n", "nCO=0.4378 # moles of CO\n", "nO2=0.2189 # moles of NO2\n", "\n", "# from Table A.9:\n", "hfCO2=0 # enthalpy of formation\n", "hfC=0 # enthalpy of formation\n", "hfCO=0 # enthalpy of formation\n", "hfO2=0 # enthalpy of formation\n", "hfCO23000=-393522 # enthalpy @ 3000K\n", "hfCO3000=-110527 # enthalpy @ 3000K\n", "hfO23000=0 # enthalpy @ 3000K\n", "hfCO2298=-152853 # enthalpy @ 298K\n", "hfCO298=-93504 # enthalpy @ 298K\n", "hfO2298=-98013 # enthalpy @ 298K\n", "\n", "Hr=hfC+hfO2 # enthalpy of reactants\n", "Hp=nCO2*(hfCO2+hfCO23000-hfCO2298)+nCO*(hfCO+hfCO3000-hfCO298)+nO2*(hfO2+hfO23000-hfO2298)\n", "\n", "Qcv=Hp-Hr # using first law\n", "print round(Qcv),\"kJ/kmol C is the heat transfer \"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "-121302.0 kJ/kmol C is the heat transfer \n" ] } ], "prompt_number": 22 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex16.6:Pg-687" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# ques 6\n", "# to determine the composition\n", "# the standard equation is C + 2O2 \u2192 CO2 + O2\n", "# from equilibrium C + 2O2 \u2192 (1 \u2212 2z)CO2 + 2zCO + (1 + z)O2\n", "T=3000 # temp in K\n", "P=0.1 # prssure in MPa\n", "z = 0.1553 # from equilibrium equation using table\n", "yCO2=(1-2*z)/(2+z) # mole fraction of CO2\n", "yCO = 2*z/(2+z) # mole fraction of CO\n", "yO2=(1+z)/(2+z) # mole fraction of O2\n", "print \"The mole fraction is \",round(yCO2,3),\" for CO2 \\n\"\n", "print \"The mole fraction is \",round(yCO,3),\" for CO \\n\"\n", "print \"The mole fraction is \",round(yO2,3),\" for O2 \\n\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The mole fraction is 0.32 for CO2 \n", "\n", "The mole fraction is 0.144 for CO \n", "\n", "The mole fraction is 0.536 for O2 \n", "\n" ] } ], "prompt_number": 24 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex16.7:Pg-691" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# ques 7\n", "# to determine the equilibrium composition\n", "# The reaction equation is:\n", "# (1): 2.H2O -->2H2 + O2\n", "# (2): 2 H2O -->H2 + 2OH\n", "# the equilibrium equation is \n", "# H2O \u2192 (1 \u2212 2a \u2212 2b)H2O + (2a + b)H2 + aO2 + 2bOH\n", "P= 0.1 # pressure in MPa\n", "T=3000 # temp in Kelvin\n", "a=0.0534 # using value of K from Table A.11 @ 3000k\n", "b=0.0551 # using value of K from Table A.11 @ 3000k\n", "nH2O= (1-2*a-b) # moles of H2O\n", "nH2=2*a+b# moles of H2\n", "nO2=a# moles of O2\n", "nOH= 2*b# moles of OH\n", "X=nH2O+nH2+nO2+nOH\n", "yH2O=nH2O/X # mole fraction\n", "yH2=nH2/X # mole fraction\n", "yO2=nO2/X # mole fraction\n", "yOH=nOH/X # mole fraction\n", "print \"The mole fraction of H2O is\",round(yH2O,2),\"\\n\"\n", "print \"The mole fraction of H2 is\",round(yH2,2),\"\\n\"\n", "print \"The mole fraction of O2 is\",round(yO2,2),\"\\n\"\n", "print \"The mole fraction of OH is\",round(yOH,2),\"\\n\"\n", "# the answers are slightly different due to approximation in textbook while here the answers are precise" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The mole fraction of H2O is 0.72 \n", "\n", "The mole fraction of H2 is 0.139 \n", "\n", "The mole fraction of O2 is 0.046 \n", "\n", "The mole fraction of OH is 0.095 \n", "\n" ] } ], "prompt_number": 27 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex16.8:pg-696" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# ques 8\n", "# determine the the equilibrium composition\n", "P= 1 # pressure in Kpa\n", "T=10000 # temp in Kelvin\n", "z=0.2008 # using k from table \n", "# the chemical equation is Ar -->Ar^(+) + e\u2212\n", "\n", "yAr=(1-z)/(1 + z) # mole fraction of Ar\n", "yArpositive= z/(1+z) # mole fraction of Ar(+)\n", "yenegative=z/(1+z) # mole fraction of ye-\n", "print \"The mole fraction of Ar is\",round(yAr,3),\"\\n\"\n", "print \"The mole fraction of Ar+ is\",round(yArpositive,3),\"\\n\"\n", "print \"The mole fraction of e- is\",round(yenegative,3),\"\\n\"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The mole fraction of Ar is 0.666 \n", "\n", "The mole fraction of Ar+ is 0.167 \n", "\n", "The mole fraction of e- is 0.167 \n", "\n" ] } ], "prompt_number": 32 } ], "metadata": {} } ] }