{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 6 - Thermodynamic property relations" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.1 Page: 197" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.1 - Page: 197\n", "\n", "\n", " Mathematics is involved in proving but just that no numerical computations are involved.\n", "\n", "\n", " For prove refer to this example 6.1 on page 197 of the book.\n" ] } ], "source": [ "print \"Example: 6.1 - Page: 197\\n\\n\"\n", "\n", "# Mathematics is involved in proving but just that no numerical computations are involved.\n", "# For prove refer to this example 6.1 on page number 197 of the book.\n", "\n", "print \" Mathematics is involved in proving but just that no numerical computations are involved.\\n\\n\"\n", "print \" For prove refer to this example 6.1 on page 197 of the book.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.2 Page: 205" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.2 - Page: 205\n", "\n", "\n", "Increase in pressure of 1 atm lowers the freezing point by 0.0072 K\n" ] } ], "source": [ "from __future__ import division\n", "print \"Example: 6.2 - Page: 205\\n\\n\"\n", "\n", "# Solution\n", "\n", "# *****Data******#\n", "density_water = 0.998## [g/cubic cm]\n", "density_ice = 0.9168## [g/cubic cm]\n", "Hf = 335## [J/g]\n", "T = 0 + 273## [K]\n", "#*****************#\n", "\n", "V_water = 1/density_water## [cubic cm/g]\n", "V_ice = 1/density_ice## [cubic cm/g]\n", "# From Eqn. 6.56:\n", "# dP/dT = deltaS/(V2 - V1) = deltaH/(T*(V2 - V1))\n", "# Substituting these values in Eqn. 6.58\n", "deltaP_By_deltaT = (Hf/(T*(V_water - V_ice)))*10## [atm/K]\n", "deltaT_By_deltaP = 1/deltaP_By_deltaT## [K/atm]\n", "if deltaT_By_deltaP > 0:\n", " print \"Increase in pressure of 1 atm increases the freezing point by %.4f K\"%(abs(deltaT_By_deltaP))#\n", "else:\n", " print \"Increase in pressure of 1 atm lowers the freezing point by %.4f K\"%(abs(deltaT_By_deltaP))#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.3 Page: 206" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.3 - Page: 206\n", "\n", "\n", "Enthalpy of Vaporisation is 2125 kJ/kg\n", "\n" ] } ], "source": [ "print \"Example: 6.3 - Page: 206\\n\\n\"\n", "\n", "# Solution\n", "\n", "# *****Data******#\n", "P1 = 361.3## [kPa]\n", "T1 = 140 + 273## [K]\n", "P2 = 617.8## [kPa]\n", "T2 = 160 + 273## [K]\n", "T = 150 + 273## [K]\n", "Vg = 0.3917## [cubic m/kg]\n", "#****************#\n", "\n", "# From Eqn. 6.56\n", "# dP/dT = deltaH/(T*(Vg - V1)) = deltaH/(T*Vg)\n", "deltaP = P2 - P1## [kPa]\n", "deltaT = T2 - T1## [K]\n", "deltaH = T*Vg*deltaP/deltaT## [kJ/kg]\n", "print \"Enthalpy of Vaporisation is %d kJ/kg\\n\"%(round(deltaH))#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.4 Page: 206" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.4 - Page: 206\n", "\n", "\n", "Saturation pressure of the refrigerant is 39.48 kPa\n" ] } ], "source": [ "from math import exp\n", "print \"Example: 6.4 - Page: 206\\n\\n\"\n", "\n", "# Solution\n", "\n", "# *****Data******#\n", "T1 = -40 + 273## [K]\n", "T2 = -45 + 273## [K]\n", "P1 = 51.25## [kPa]\n", "R = 0.0815## [kJ/kg K]\n", "Hv = 225.86## [kJ/kg]\n", "#****************#\n", "\n", "# From Eqn. 6.61:\n", "P2 = P1*exp((Hv/R)*((1/T1) - (1/T2)))## [kPa]\n", "print \"Saturation pressure of the refrigerant is %.2f kPa\"%(P2)#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.5 Page: 206" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.5 - Page: 206\n", "\n", "\n", "The enthalpy of vaporisation is 13.85 kJ/mol\n", "\n" ] } ], "source": [ "from math import log10, exp\n", "print \"Example: 6.5 - Page: 206\\n\\n\"\n", "\n", "# Solution\n", "\n", "# *****Data******#\n", "Tb = -103.9 + 273## [K]\n", "def f1(T):\n", " P = 10**(-(834.13/T) + 1.75*log10(T) - 8.375*10**(-3)*T + 5.324)\n", " return P\n", "R = 8.314## [J/mol K]\n", "#***************#\n", "\n", "# From Eqn. 6.60, we get:\n", "# d(ln(P))/dT = deltaH/(R*T**2)\n", "def f2(T):\n", " P = exp(2.303*log10(f1(T)))\n", " return P\n", "# Differentiating it with respect to T\n", "# d(ln(P))/dT = (834.13*2.303/Tb**2 + 1.75/Tb - 2.303*8.375*10**(-3))\n", "deltaH = R*Tb**2*(834.13*2.303/Tb**2 + 1.75/Tb - 2.303*8.375*10**(-3))/1000## [kJ/mol]\n", "print \"The enthalpy of vaporisation is %.2f kJ/mol\\n\"%(deltaH)#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.6 Page: 214" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.6 - Page: 214\n", "\n", "\n", " Mathematics is involved in proving but just that no numerical computations are involved.\n", "\n", "\n", " For prove refer to this example 6.6 on page 214 of the book.\n" ] } ], "source": [ "print \"Example: 6.6 - Page: 214\\n\\n\"\n", "\n", "# Mathematics is involved in proving but just that no numerical computations are involved.\n", "# For prove refer to this example 6.6 on page number 214 of the book.\n", "\n", "print \" Mathematics is involved in proving but just that no numerical computations are involved.\\n\\n\"\n", "print \" For prove refer to this example 6.6 on page 214 of the book.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.7 Page: 215" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.7 - Page: 215\n", "\n", "\n", " Mathematics is involved in proving but just that no numerical computations are involved.\n", "\n", "\n", " For prove refer to this example 6.7 on page 215 of the book.\n" ] } ], "source": [ "print \"Example: 6.7 - Page: 215\\n\\n\"\n", "\n", "# Mathematics is involved in proving but just that no numerical computations are involved.\n", "# For prove refer to this example 6.7 on page number 215 of the book.\n", "\n", "print \" Mathematics is involved in proving but just that no numerical computations are involved.\\n\\n\"\n", "print \" For prove refer to this example 6.7 on page 215 of the book.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.8 Page: 217" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.8 - Page: 217\n", "\n", "\n", " Mathematics is involved in proving but just that no numerical computations are involved.\n", "\n", "\n", " For prove refer to this example 6.8 on page 217 of the book.\n" ] } ], "source": [ "print \"Example: 6.8 - Page: 217\\n\\n\"\n", "\n", "# Mathematics is involved in proving but just that no numerical computations are involved.\n", "# For prove refer to this example 6.8 on page number 217 of the book.\n", "\n", "print \" Mathematics is involved in proving but just that no numerical computations are involved.\\n\\n\"\n", "print \" For prove refer to this example 6.8 on page 217 of the book.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.9 Page: 217" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.9 - Page: 217\n", "\n", "\n", " Mathematics is involved in proving but just that no numerical computations are involved.\n", "\n", "\n", " For prove refer to this example 6.9 on page 217 of the book.\n" ] } ], "source": [ "print \"Example: 6.9 - Page: 217\\n\\n\"\n", "\n", "# Mathematics is involved in proving but just that no numerical computations are involved.\n", "# For prove refer to this example 6.9 on page number 217 of the book.\n", "\n", "print \" Mathematics is involved in proving but just that no numerical computations are involved.\\n\\n\"\n", "print \" For prove refer to this example 6.9 on page 217 of the book.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.10 Page: 218" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.10 - Page: 218\n", "\n", "\n", " Mathematics is involved in proving but just that no numerical computations are involved.\n", "\n", "\n", " For prove refer to this example 6.10 on page 218 of the book.\n" ] } ], "source": [ "print \"Example: 6.10 - Page: 218\\n\\n\"\n", "\n", "# Mathematics is involved in proving but just that no numerical computations are involved.\n", "# For prove refer to this example 6.10 on page number 218 of the book.\n", "\n", "print \" Mathematics is involved in proving but just that no numerical computations are involved.\\n\\n\"\n", "print \" For prove refer to this example 6.10 on page 218 of the book.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.11 Page: 219" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.11 - Page: 219\n", "\n", "\n", " Mathematics is involved in proving but just that no numerical computations are involved.\n", "\n", "\n", " For prove refer to this example 6.11 on page 219 of the book.\n" ] } ], "source": [ "print \"Example: 6.11 - Page: 219\\n\\n\"\n", "\n", "# Mathematics is involved in proving but just that no numerical computations are involved.\n", "# For prove refer to this example 6.11 on page number 219 of the book.\n", "\n", "print \" Mathematics is involved in proving but just that no numerical computations are involved.\\n\\n\"\n", "print \" For prove refer to this example 6.11 on page 219 of the book.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.12 Page: 219" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.12 - Page: 219\n", "\n", "\n", " Mathematics is involved in proving but just that no numerical computations are involved.\n", "\n", "\n", " For prove refer to this example 6.12 on page 219 of the book.\n" ] } ], "source": [ "print \"Example: 6.12 - Page: 219\\n\\n\"\n", "\n", "# Mathematics is involved in proving but just that no numerical computations are involved.\n", "# For prove refer to this example 6.12 on page number 219 of the book.\n", "\n", "print \" Mathematics is involved in proving but just that no numerical computations are involved.\\n\\n\"\n", "print \" For prove refer to this example 6.12 on page 219 of the book.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.13 Page: 220" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.13 - Page: 220\n", "\n", "\n", " This problem involves proving a relation in which no mathematics and no calculations are involved.\n", "\n", "\n", " For prove refer to this example 6.13 on page 220 of the book.\n" ] } ], "source": [ "print \"Example: 6.13 - Page: 220\\n\\n\"\n", "\n", "# This problem involves proving a relation in which no mathematics and no calculations are involved.\n", "# For prove refer to this example 6.13 on page number 220 of the book.\n", "\n", "print \" This problem involves proving a relation in which no mathematics and no calculations are involved.\\n\\n\"\n", "print \" For prove refer to this example 6.13 on page 220 of the book.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.14 Page: 221" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.14 - Page: 221\n", "\n", "\n", "Percentage error is 4.77 %\n" ] } ], "source": [ "print \"Example: 6.14 - Page: 221\\n\\n\"\n", "\n", "# Solution\n", "\n", "# *****Data******#\n", "alpha = 0.837*10**(-11)## [square m/N]\n", "beeta = 54.2*10**(-6)## [1/K]\n", "T = 227 + 273## [K]\n", "V = 7.115*10**(-3)## [cubic m/kmol]\n", "Cp = 26.15## [J/mol K]\n", "#*****************#\n", "\n", "Cv = Cp - (T*V*beeta**2/alpha)/1000## [J/mol K]\n", "# Percentage error if Cp is assumed to Cv.\n", "err = ((Cp - Cv)/Cp)*100#\n", "print \"Percentage error is %.2f %%\"%(err)#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.15 Page: 221" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.15 - Page: 221\n", "\n", "\n", " This problem involves proving a relation in which no mathematics and no calculations are involved.\n", "\n", "\n", " For prove refer to this example 6.15 on page 221 of the book.\n" ] } ], "source": [ "print \"Example: 6.15 - Page: 221\\n\\n\"\n", "\n", "# This problem involves proving a relation in which no mathematics and no calculations are involved.\n", "# For prove refer to this example 6.15 on page number 221 of the book.\n", "\n", "print \" This problem involves proving a relation in which no mathematics and no calculations are involved.\\n\\n\"\n", "print \" For prove refer to this example 6.15 on page 221 of the book.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.16 Page: 222" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.16 - Page: 222\n", "\n", "\n", " This problem involves proving a relation in which no mathematics and no calculations are involved.\n", "\n", "\n", " For prove refer to this example 6.16 on page 222 of the book.\n" ] } ], "source": [ "print \"Example: 6.16 - Page: 222\\n\\n\"\n", "\n", "# This problem involves proving a relation in which no mathematics and no calculations are involved.\n", "# For prove refer to this example 6.16 on page number 222 of the book.\n", "\n", "print \" This problem involves proving a relation in which no mathematics and no calculations are involved.\\n\\n\"\n", "print \" For prove refer to this example 6.16 on page 222 of the book.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.17 Page: 222" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.17 - Page: 222\n", "\n", "\n", " This problem involves proving a relation in which no mathematics and no calculations are involved.\n", "\n", "\n", " For prove refer to this example 6.17 on page 222 of the book.\n" ] } ], "source": [ "print \"Example: 6.17 - Page: 222\\n\\n\"\n", "\n", "# This problem involves proving a relation in which no mathematics and no calculations are involved.\n", "# For prove refer to this example 6.17 on page number 222 of the book.\n", "\n", "print \" This problem involves proving a relation in which no mathematics and no calculations are involved.\\n\\n\"\n", "print \" For prove refer to this example 6.17 on page 222 of the book.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.18 Page: 223" ] }, { "cell_type": "code", "execution_count": 22, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.18 - Page: 223\n", "\n", "\n", " This problem involves proving a relation in which no mathematics and no calculations are involved.\n", "\n", "\n", " For prove refer to this example 6.18 on page 223 of the book.\n" ] } ], "source": [ "print \"Example: 6.18 - Page: 223\\n\\n\"\n", "\n", "# This problem involves proving a relation in which no mathematics and no calculations are involved.\n", "# For prove refer to this example 6.18 on page number 223 of the book.\n", "\n", "print \" This problem involves proving a relation in which no mathematics and no calculations are involved.\\n\\n\"\n", "print \" For prove refer to this example 6.18 on page 223 of the book.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.19 Page: 227" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.19 - Page: 227\n", "\n", "\n", "Inversion of temperature is 2036.3 K\n" ] } ], "source": [ "print \"Example: 6.19 - Page: 227\\n\\n\"\n", "\n", "# Solution\n", "\n", "# *****Data******#\n", "a = 3.59## [square L atm /square mol]\n", "b = 0.043## [L/mol]\n", "R = 0.082## [J/mol K]\n", "#***************#\n", "\n", "# From Eqn. 6.122:\n", "Ti = 2*a/(R*b)## [K]\n", "print \"Inversion of temperature is %.1f K\"%(Ti)#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.20 Page: 227" ] }, { "cell_type": "code", "execution_count": 24, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.20 - Page: 227\n", "\n", "\n", " This problem involves proving a relation in which no mathematics and no calculations are involved.\n", "\n", "\n", " For prove refer to this example 6.20 on page 227 of the book.\n" ] } ], "source": [ "print \"Example: 6.20 - Page: 227\\n\\n\"\n", "\n", "# This problem involves proving a relation in which no mathematics and no calculations are involved.\n", "# For prove refer to this example 6.20 on page number 227 of the book.\n", "\n", "print \" This problem involves proving a relation in which no mathematics and no calculations are involved.\\n\\n\"\n", "print \" For prove refer to this example 6.20 on page 227 of the book.\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.23 Page: 239" ] }, { "cell_type": "code", "execution_count": 26, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.23 - Page: 239\n", "\n", "\n", "Residual Entropy is -0.3116 J/mol K\n", "\n", "Residual Enthalpy is -108.9010 J/mol K\n", "\n", "Residual Internal Energy is -56.3290 J/mol K\n", "\n" ] } ], "source": [ "from math import log\n", "print \"Example: 6.23 - Page: 239\\n\\n\"\n", "\n", "# Solution\n", "\n", "# *****Data******#\n", "T = 298## [K]\n", "P = 10*10**5## [Pa]\n", "Tc = 126.2## [K]\n", "Pc = 34*10**5## [bar]\n", "R = 8.314## [J/mol K]\n", "#****************#\n", "\n", "a = 27*R**2*Tc**2/(64*Pc)## [Pa.m**6/square mol]\n", "b = R*Tc/(8*Pc)## [cubic m/mol]\n", "V = 2.425*10**(-3)## [cubic m/mol]\n", "# From Eqn. 6.173:\n", "Sr = R*log(P*(V - b)/(R*T))## [J/mol K]\n", "print \"Residual Entropy is %.4f J/mol K\\n\"%(Sr)#\n", "# From Eqn. 6.174:\n", "Hr = P*V - R*T - (a/V)## [J/mol]\n", "print \"Residual Enthalpy is %.4f J/mol K\\n\"%(Hr)#\n", "Ur = -(a/V)## [J/mol]\n", "print \"Residual Internal Energy is %.4f J/mol K\\n\"%(Ur)#" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example: 6.24 Page: 244" ] }, { "cell_type": "code", "execution_count": 27, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Example: 6.24 - Page: 244\n", "\n", "\n", "Fugacity of iso-butane is 12.10 atm\n" ] } ], "source": [ "print \"Example: 6.24 - Page: 244\\n\\n\"\n", "\n", "# Solution\n", "\n", "# *****Data******#\n", "B = -4.28*10**(-4)## [cubic m/mol]\n", "P = 15*10**5## [Pa]\n", "T = 273 + 87## [K]\n", "R = 8.314## [J/atm K]\n", "#****************#\n", "\n", "# Z = 1 + (B*P/(R*T))\n", "# (Z - 1)/P = B/(R*T)\n", "# From Eqn. 6.192 (b)\n", "# ln(f/P) = integral('(Z - 1)/P','P',0,P) = B*P/(R*T)\n", "f = P*exp(B*P/(R*T))## [Pa]\n", "print \"Fugacity of iso-butane is %.2f atm\"%(f/10**5)#" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.9" } }, "nbformat": 4, "nbformat_minor": 0 }