diff options
author | hardythe1 | 2015-04-07 15:58:05 +0530 |
---|---|---|
committer | hardythe1 | 2015-04-07 15:58:05 +0530 |
commit | 92cca121f959c6616e3da431c1e2d23c4fa5e886 (patch) | |
tree | 205e68d0ce598ac5caca7de839a2934d746cce86 /Thermodynamics,_Statistical_Thermodynamics,_&_Kinetics/Chapter06.ipynb | |
parent | b14c13fcc6bb6d01c468805d612acb353ec168ac (diff) | |
download | Python-Textbook-Companions-92cca121f959c6616e3da431c1e2d23c4fa5e886.tar.gz Python-Textbook-Companions-92cca121f959c6616e3da431c1e2d23c4fa5e886.tar.bz2 Python-Textbook-Companions-92cca121f959c6616e3da431c1e2d23c4fa5e886.zip |
added books
Diffstat (limited to 'Thermodynamics,_Statistical_Thermodynamics,_&_Kinetics/Chapter06.ipynb')
-rwxr-xr-x | Thermodynamics,_Statistical_Thermodynamics,_&_Kinetics/Chapter06.ipynb | 709 |
1 files changed, 709 insertions, 0 deletions
diff --git a/Thermodynamics,_Statistical_Thermodynamics,_&_Kinetics/Chapter06.ipynb b/Thermodynamics,_Statistical_Thermodynamics,_&_Kinetics/Chapter06.ipynb new file mode 100755 index 00000000..c6258811 --- /dev/null +++ b/Thermodynamics,_Statistical_Thermodynamics,_&_Kinetics/Chapter06.ipynb @@ -0,0 +1,709 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:399beb745330e541e567baa0f45fde7ecc89dabcc65d8db71d8e5921a036072a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 06: Chemical Equilibrium"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 6.1, Page Number 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "dHcCH4 = -891.0 #Std. heat of combustion for CH4, kJ/mol\n",
+ "dHcC8H18 = -5471.0 #Std. heat of combustion for C8H18, kJ/mol\n",
+ "\n",
+ "T = 298.15\n",
+ "SmCO2, SmCH4, SmH2O, SmO2, SmC8H18 = 213.8,186.3,70.0,205.2, 316.1\n",
+ "dnCH4 = -2.\n",
+ "dnC8H18 = 4.5\n",
+ "R = 8.314\n",
+ "#Calculations\n",
+ "dACH4 = dHcCH4*1e3 - dnCH4*R*T - T*(SmCO2 + 2*SmH2O - SmCH4 - 2*SmO2)\n",
+ "dAC8H18 = dHcC8H18*1e3 - dnC8H18*R*T - T*(8*SmCO2 + 9*SmH2O - SmC8H18 - 25.*SmO2/2) \n",
+ "#Results \n",
+ "print 'Maximum Available work through combustion of CH4 %4.1f kJ/mol'%(dACH4/1000)\n",
+ "print 'Maximum Available work through combustion of C8H18 %4.1f kJ/mol'%(dAC8H18/1000)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Available work through combustion of CH4 -813.6 kJ/mol\n",
+ "Maximum Available work through combustion of C8H18 -5320.9 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 6.2, Page Number 118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "dHcCH4 = -891.0 #Std. heat of combustion for CH4, kJ/mol\n",
+ "dHcC8H18 = -5471.0 #Std. heat of combustion for C8H18, kJ/mol\n",
+ "\n",
+ "T = 298.15\n",
+ "SmCO2, SmCH4, SmH2O, SmO2, SmC8H18 = 213.8,186.3,70.0,205.2, 316.1\n",
+ "dnCH4 = -2.\n",
+ "dnC8H18 = 4.5\n",
+ "R = 8.314\n",
+ "#Calculations\n",
+ "dGCH4 = dHcCH4*1e3 - T*(SmCO2 + 2*SmH2O - SmCH4 - 2*SmO2)\n",
+ "dGC8H18 = dHcC8H18*1e3 - T*(8*SmCO2 + 9*SmH2O - SmC8H18 - 25.*SmO2/2) \n",
+ "#Results \n",
+ "print 'Maximum nonexapnasion work through combustion of CH4 %4.1f kJ/mol'%(dGCH4/1000)\n",
+ "print 'Maximum nonexapnasion work through combustion of C8H18 %4.1f kJ/mol'%(dGC8H18/1000)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum nonexapnasion work through combustion of CH4 -818.6 kJ/mol\n",
+ "Maximum nonexapnasion work through combustion of C8H18 -5309.8 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 6.4, Page Number 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "dGf298 = 370.7 #Std. free energy of formation for Fe (g), kJ/mol\n",
+ "dHf298 = 416.3 #Std. Enthalpy of formation for Fe (g), kJ/mol\n",
+ "T0 = 298.15 #Temperature in K\n",
+ "T = 400. #Temperature in K\n",
+ "R = 8.314\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "dGf = T*(dGf298*1e3/T0 + dHf298*1e3*(1./T - 1./T0))\n",
+ "\n",
+ "#Results \n",
+ "print 'Std. free energy of formation for Fe(g) at 400 K is %4.1f kJ/mol'%(dGf/1000)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Std. free energy of formation for Fe(g) at 400 K is 355.1 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 6.5, Page Number 127"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import log\n",
+ "#Variable Declaration\n",
+ "nHe = 1.0 #Number of moles of He\n",
+ "nNe = 3.0 #Number of moles of Ne\n",
+ "nAr = 2.0 #Number of moles of Ar\n",
+ "nXe = 2.5 #Number of moles of Xe\n",
+ "T = 298.15 #Temperature in K\n",
+ "P = 1.0 #Pressure, bar\n",
+ "R = 8.314\n",
+ "\n",
+ "#Calculations\n",
+ "n = nHe + nNe + nAr + nXe\n",
+ "dGmix = n*R*T*((nHe/n)*log(nHe/n) + (nNe/n)*log(nNe/n) +(nAr/n)*log(nAr/n) + (nXe/n)*log(nXe/n))\n",
+ "dSmix = n*R*((nHe/n)*log(nHe/n) + (nNe/n)*log(nNe/n) +(nAr/n)*log(nAr/n) + (nXe/n)*log(nXe/n))\n",
+ "\n",
+ "#Results \n",
+ "print 'Std. free energy Change on mixing is %3.1e J'%(dGmix)\n",
+ "print 'Std. entropy Change on mixing is %4.1f J'%(dSmix)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Std. free energy Change on mixing is -2.8e+04 J\n",
+ "Std. entropy Change on mixing is -93.3 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 6.6, Page Number 128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "dGfFe = 0.0 #Std. Gibbs energy of formation for Fe (S), kJ/mol\n",
+ "dGfH2O = -237.1 #Std. Gibbs energy of formation for Water (g), kJ/mol\n",
+ "dGfFe2O3 = -1015.4 #Std. Gibbs energy of formation for Fe2O3 (s), kJ/mol\n",
+ "dGfH2 = 0.0 #Std. Gibbs energy of formation for Hydrogen (g), kJ/mol\n",
+ "T0 = 298.15 #Temperature in K\n",
+ "R = 8.314\n",
+ "nFe, nH2, nFe2O3, nH2O = 3,-4,-1,4\n",
+ "\n",
+ "#Calculations\n",
+ "dGR = nFe*dGfFe + nH2O*dGfH2O + nFe2O3*dGfFe2O3 + nH2*dGfH2 \n",
+ "\n",
+ "#Results \n",
+ "print 'Std. Gibbs energy change for reaction is %4.2f kJ/mol'%(dGR)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Std. Gibbs energy change for reaction is 67.00 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 6.7, Page Number 128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "dGR = 67.0 #Std. Gibbs energy of formation for reaction, kJ, from previous problem\n",
+ "dHfFe = 0.0 #Enthalpy of formation for Fe (S), kJ/mol\n",
+ "dHfH2O = -285.8 #Enthalpy of formation for Water (g), kJ/mol\n",
+ "dHfFe2O3 = -1118.4 #Enthalpy of formation for Fe2O3 (s), kJ/mol\n",
+ "dHfH2 = 0.0 #Enthalpy of formation for Hydrogen (g), kJ/mol\n",
+ "T0 = 298.15 #Temperature in K\n",
+ "T = 525. #Temperature in K\n",
+ "R = 8.314\n",
+ "nFe, nH2, nFe2O3, nH2O = 3,-4,-1,4\n",
+ "\n",
+ "#Calculations\n",
+ "dHR = nFe*dHfFe + nH2O*dHfH2O + nFe2O3*dHfFe2O3 + nH2*dHfH2 \n",
+ "dGR2 = T*(dGR*1e3/T0 + dHR*1e3*(1./T - 1./T0))\n",
+ "\n",
+ "#Results \n",
+ "print 'Std. Enthalpy change for reactionat %4.1f is %4.2f kJ/mol'%(T, dHR)\n",
+ "print 'Std. Gibbs energy change for reactionat %4.1f is %4.0f kJ/mol'%(T, dGR2/1e3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Std. Enthalpy change for reactionat 525.0 is -24.80 kJ/mol\n",
+ "Std. Gibbs energy change for reactionat 525.0 is 137 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 6.8, Page Number 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import log\n",
+ "#Variable Declaration\n",
+ "dGfNO2 = 51.3 #Std. Gibbs energy of formation for NO2 (g), kJ/mol\n",
+ "dGfN2O4 = 99.8 #Std. Gibbs energy of formation for N2O4 (g), kJ/mol\n",
+ "T0 = 298.15 #Temperature in K\n",
+ "pNO2 = 0.350 #Partial pressure of NO2, bar\n",
+ "pN2O4 = 0.650 #Partial pressure of N2O4, bar\n",
+ "R = 8.314\n",
+ "nNO2, nN2O4 = -2, 1 #Stoichiomentric coeff of NO2 and N2O4 respectively in reaction\n",
+ "\n",
+ "#Calculations\n",
+ "dGR = nN2O4*dGfN2O4*1e3 + nNO2*dGfNO2*1e3 + R*T0*log(pN2O4/(pNO2)**2)\n",
+ "\n",
+ "#Results \n",
+ "print 'Std. Gibbs energy change for reaction is %5.3f kJ/mol'%(dGR/1e3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Std. Gibbs energy change for reaction is 1.337 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 6.9, Page Number 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import exp\n",
+ "\n",
+ "#Variable Declaration\n",
+ "dGfCO2 = -394.4 #Std. Gibbs energy of formation for CO2 (g), kJ/mol\n",
+ "dGfH2 = 0.0 #Std. Gibbs energy of formation for H2 (g), kJ/mol\n",
+ "dGfCO = 237.1 #Std. Gibbs energy of formation for CO (g), kJ/mol\n",
+ "dGfH2O = 137.2 #Std. Gibbs energy of formation for H24 (l), kJ/mol\n",
+ "T0 = 298.15 #Temperature in K\n",
+ "R = 8.314\n",
+ "nCO2, nH2, nCO, nH2O = 1,1,1,1 #Stoichiomentric coeff of CO2,H2,CO,H2O respectively in reaction\n",
+ "\n",
+ "#Calculations\n",
+ "dGR = nCO2*dGfCO2 + nH2*dGfH2 + nCO*dGfCO + nH2O*dGfH2O\n",
+ "Kp = exp(-dGR*1e3/(R*T0))\n",
+ "\n",
+ "#Results \n",
+ "print 'Std. Gibbs energy change for reaction is %5.3f kJ/mol'%(dGR/1e3)\n",
+ "print 'Equilibrium constant for reaction is %5.3f '%(Kp)\n",
+ "if Kp > 1: print 'Kp >> 1. hence, mixture will consists of product CO2 and H2'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Std. Gibbs energy change for reaction is -0.020 kJ/mol\n",
+ "Equilibrium constant for reaction is 3323.254 \n",
+ "Kp >> 1. hence, mixture will consists of product CO2 and H2\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 6.11, Page Number 133"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import exp, sqrt\n",
+ "\n",
+ "#Variable Declaration\n",
+ "dGfCl2 = 0.0 #Std. Gibbs energy of formation for CO2 (g), kJ/mol\n",
+ "dGfCl = 105.7 #Std. Gibbs energy of formation for H2 (g), kJ/mol\n",
+ "dHfCl2 = 0.0 #Std. Gibbs energy of formation for CO (g), kJ/mol\n",
+ "dHfCl = 121.3 #Std. Gibbs energy of formation for H24 (l), kJ/mol\n",
+ "T0 = 298.15 #Temperature in K\n",
+ "R = 8.314\n",
+ "nCl2, nCl= -1,2 #Stoichiomentric coeff of Cl2,Cl respectively in reaction\n",
+ "PbyP0 = 0.01\n",
+ "#Calculations\n",
+ "dGR = nCl*dGfCl + nCl2*dGfCl2 \n",
+ "dHR = nCl*dHfCl + nCl2*dHfCl2 \n",
+ "func = lambda T: exp(-dGR*1e3/(R*T0) - dHR*1e3*(1./T - 1./T0)/R)\n",
+ "Kp8 = func(800)\n",
+ "Kp15 = func(1500)\n",
+ "Kp20 = func(2000)\n",
+ "DDiss = lambda K: sqrt(K/(K+4*PbyP0))\n",
+ "alp8 = DDiss(Kp8)\n",
+ "alp15 = DDiss(Kp15)\n",
+ "alp20 = DDiss(Kp20)\n",
+ "\n",
+ "#Results \n",
+ "print 'Part A'\n",
+ "print 'Std. Gibbs energy change for reaction is %5.3f kJ/mol'%(dGR)\n",
+ "print 'Std. Enthalpy change for reaction is %5.3f kJ/mol'%(dHR)\n",
+ "print 'Equilibrium constants at 800, 1500, and 2000 K are %4.3e, %4.3e, and %4.3e'%(Kp8,Kp15,Kp20)\n",
+ "\n",
+ "print 'Part B'\n",
+ "print 'Degree of dissociation at 800, 1500, and 2000 K are %4.3e, %4.3e, and %4.3e'%(alp8,alp15,alp20)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part A\n",
+ "Std. Gibbs energy change for reaction is 211.400 kJ/mol\n",
+ "Std. Enthalpy change for reaction is 242.600 kJ/mol\n",
+ "Equilibrium constants at 800, 1500, and 2000 K are 4.223e-11, 1.042e-03, and 1.349e-01\n",
+ "Part B\n",
+ "Degree of dissociation at 800, 1500, and 2000 K are 3.249e-05, 1.593e-01, and 8.782e-01\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 6.12, Page Number 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import exp\n",
+ "#Variable Declaration\n",
+ "dGfCaCO3 = -1128.8 #Std. Gibbs energy of formation for CaCO3 (s), kJ/mol\n",
+ "dGfCaO = -603.3 #Std. Gibbs energy of formation for CaO (s), kJ/mol\n",
+ "dGfCO2 = -394.4 #Std. Gibbs energy of formation for O2 (g), kJ/mol\n",
+ "dHfCaCO3 = -1206.9 #Std. Enthalpy Change of formation for CaCO3 (s), kJ/mol\n",
+ "dHfCaO = -634.9 #Std. Enthalpy Change of formation for CaO (s), kJ/mol\n",
+ "dHfCO2 = -393.5 #Std. Enthalpy Change of formation for O2 (g), kJ/mol\n",
+ "T0 = 298.15 #Temperature in K\n",
+ "R = 8.314\n",
+ "nCaCO3, nCaO, nO2 = -1,1,1 #Stoichiomentric coeff of CaCO3, CaO, O2 respectively in reaction\n",
+ "\n",
+ "#Calculations\n",
+ "dGR = nCaO*dGfCaO + nO2*dGfCO2 + nCaCO3*dGfCaCO3\n",
+ "dHR = nCaO*dHfCaO + nO2*dHfCO2 + nCaCO3*dHfCaCO3\n",
+ "\n",
+ "func = lambda T: exp(-dGR*1e3/(R*T0) - dHR*1e3*(1./T - 1./T0)/R)\n",
+ "\n",
+ "Kp10 = func(1000)\n",
+ "Kp11 = func(1100)\n",
+ "Kp12 = func(1200)\n",
+ "\n",
+ "#Results \n",
+ "print 'Std. Gibbs energy change for reaction is %4.1f kJ/mol'%(dGR)\n",
+ "print 'Std. Enthalpy change for reaction is %4.1f kJ/mol'%(dHR)\n",
+ "print 'Equilibrium constants at 1000, 1100, and 1200 K are %4.4f, %4.3fe, and %4.3f'%(Kp10,Kp11,Kp12)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Std. Gibbs energy change for reaction is 131.1 kJ/mol\n",
+ "Std. Enthalpy change for reaction is 178.5 kJ/mol\n",
+ "Equilibrium constants at 1000, 1100, and 1200 K are 0.0956, 0.673e, and 3.423\n"
+ ]
+ }
+ ],
+ "prompt_number": 88
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 6.13, Page Number 135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import exp\n",
+ "\n",
+ "#Variable Declaration\n",
+ "dGfCG = 0.0 #Std. Gibbs energy of formation for CaCO3 (s), kJ/mol\n",
+ "dGfCD = 2.90 #Std. Gibbs energy of formation for CaO (s), kJ/mol\n",
+ "rhoG = 2.25e3 #Density of Graphite, kg/m3\n",
+ "rhoD = 3.52e3 #Density of dimond, kg/m3\n",
+ "T0 = 298.15 #Std. Temperature, K\n",
+ "R = 8.314 #Ideal gas constant, J/(mol.K) \n",
+ "P0 = 1.0 #Pressure, bar\n",
+ "M = 12.01 #Molceular wt of Carbon\n",
+ "#Calculations\n",
+ "P = P0*1e5 + dGfCD*1e3/((1./rhoG-1./rhoD)*M*1e-3)\n",
+ "\n",
+ "#Results \n",
+ "print 'Pressure at which graphite and dimond will be in equilibrium is %4.2e bar'%(P/1e5)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure at which graphite and dimond will be in equilibrium is 1.51e+04 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 98
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 6.14, Page Number 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import exp\n",
+ "\n",
+ "#Variable Declaration\n",
+ "beta = 2.04e-4 #Thermal exapansion coefficient, /K\n",
+ "kapa = 45.9e-6 #Isothermal compressibility, /bar\n",
+ "T = 298.15 #Std. Temperature, K\n",
+ "R = 8.206e-2 #Ideal gas constant, atm.L/(mol.K) \n",
+ "T1 = 320.0 #Temperature, K\n",
+ "Pi = 1.0 #Initial Pressure, bar\n",
+ "V = 1.00 #Volume, m3\n",
+ "a = 1.35 #van der Waals constant a for nitrogen, atm.L2/mol2\n",
+ "\n",
+ "#Calculations\n",
+ "dUbydV = Pf = (beta*T1-kapa*P0)/kapa\n",
+ "dVT = V*kapa*(Pf-Pi)\n",
+ "dVbyV = dVT*100/V\n",
+ "Vm = Pi/(R*T1)\n",
+ "dUbydVm = a/(Vm**2)\n",
+ "\n",
+ "#Results \n",
+ "print 'dUbydV = %4.2e bar'%(dUbydV)\n",
+ "print 'dVbyV = %4.3f percent'%(dVbyV)\n",
+ "print 'dUbydVm = %4.0e atm'%(dUbydVm)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dUbydV = 1.42e+03 bar\n",
+ "dVbyV = 6.519 percent\n",
+ "dUbydVm = 9e+02 atm\n"
+ ]
+ }
+ ],
+ "prompt_number": 113
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 6.15, Page Number 144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import exp, log\n",
+ "#Variable Declaration\n",
+ "m = 1000.0 #mass of mercury, g\n",
+ "Pi, Ti = 1.00, 300.0 #Intial pressure and temperature, bar, K\n",
+ "Pf, Tf = 300., 600.0 #Final pressure and temperature, bar, K\n",
+ "rho = 13534. #Density of mercury, kg/m3\n",
+ "beta = 18.1e-4 #Thermal exapansion coefficient for Hg, /K \n",
+ "kapa = 3.91e-6 #Isothermal compressibility for Hg, /Pa\n",
+ "Cpm = 27.98 #Molar Specific heat at constant pressure, J/(mol.K) \n",
+ "M = 200.59 #Molecular wt of Hg, g/mol\n",
+ "\n",
+ "#Calculations\n",
+ "Vi = m*1e-3/rho\n",
+ "Vf = Vi*exp(-kapa*(Pf-Pi))\n",
+ "Ut = m*Cpm*(Tf-Ti)/M \n",
+ "Up = (beta*Ti/kapa-Pi)*1e5*(Vf-Vi) + (Vi-Vf+Vf*log(Vf/Vi))*1e5/kapa\n",
+ "dU = Ut + Up\n",
+ "Ht = m*Cpm*(Tf-Ti)/M\n",
+ "Hp = ((1 + beta*(Tf-Ti))*Vi*exp(-kapa*Pi)/kapa)*(exp(-kapa*Pi)-exp(-kapa*Pf))\n",
+ "dH = Ht + Hp\n",
+ "#Results\n",
+ "print 'Internal energy change is %6.2e J/mol in which \\ncontribution of temeprature dependent term %6.4f percent'%(dU,Ut*100/dH)\n",
+ "print 'Enthalpy change is %4.3e J/mol in which \\ncontribution of temeprature dependent term %4.1f percent'%(dH,Ht*100/dH)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Internal energy change is 4.06e+04 J/mol in which \n",
+ "contribution of temeprature dependent term 99.9999 percent\n",
+ "Enthalpy change is 4.185e+04 J/mol in which \n",
+ "contribution of temeprature dependent term 100.0 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 6.16, Page Number 145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "T = 300.0 #Temperature of Hg, K \n",
+ "beta = 18.1e-4 #Thermal exapansion coefficient for Hg, /K \n",
+ "kapa = 3.91e-6 #Isothermal compressibility for Hg, /Pa\n",
+ "M = 0.20059 #Molecular wt of Hg, kg/mol \n",
+ "rho = 13534 #Density of mercury, kg/m3\n",
+ "Cpm = 27.98 #Experimental Molar specif heat at const pressure for mercury, J/(mol.K)\n",
+ "\n",
+ "#Calculations\n",
+ "Vm = M/rho\n",
+ "DCpmCv = T*Vm*beta**2/kapa\n",
+ "Cvm = Cpm - DCpmCv\n",
+ "#Results\n",
+ "print 'Difference in molar specific heats \\nat constant volume and constant pressure %4.2e J/(mol.K)'%DCpmCv\n",
+ "print 'Molar Specific heat of Hg at const. volume is %4.2f J/(mol.K)'%Cvm"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Difference in molar specific heats \n",
+ "at constant volume and constant pressure 3.73e-03 J/(mol.K)\n",
+ "Molar Specific heat of Hg at const. volume is 27.98 J/(mol.K)\n"
+ ]
+ }
+ ],
+ "prompt_number": 149
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example Problem 6.17, Page Number 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable Declaration\n",
+ "T = 298.15 #Std. Temperature, K \n",
+ "P = 1.0 #Initial Pressure, bar\n",
+ "Hm0, Sm0 = 0.0,154.8 #Std. molar enthalpy and entropy of Ar(g), kJ, mol, K units\n",
+ "Sm0H2, Sm0O2 = 130.7,205.2 #Std. molar entropy of O2 and H2 (g), kJ/(mol.K)\n",
+ "dGfH2O = -237.1 #Gibbs energy of formation for H2O(l), kJ/mol \n",
+ "nH2, nO2 = 1, 1./2 #Stoichiomentric coefficients for H2 and O2 in water formation reaction \n",
+ "\n",
+ "#Calculations\n",
+ "Gm0 = Hm0 - T*Sm0\n",
+ "dGmH2O = dGfH2O*1000 - T*(nH2*Sm0H2 + nO2*Sm0O2)\n",
+ "#Results\n",
+ "print 'Molar Gibbs energy of Ar %4.3f kJ/mol'%(Gm0/1e3)\n",
+ "print 'Molar Gibbs energy of Water %4.3f kJ/mol'%(dGmH2O/1e3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Molar Gibbs energy of Ar -46.154 kJ/mol\n",
+ "Molar Gibbs energy of Water -306.658 kJ/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |