diff options
author | hardythe1 | 2015-06-11 17:31:11 +0530 |
---|---|---|
committer | hardythe1 | 2015-06-11 17:31:11 +0530 |
commit | 251a07c4cbed1a5a960f5ed416ce6ac13c8152b7 (patch) | |
tree | cb7f084fad6d7ee6ae89e586fad0e909b5408319 /Thermodynamics_by_J._P._Holman | |
parent | 47d7279a724246ef7aa0f5359cf417992ed04449 (diff) | |
download | Python-Textbook-Companions-251a07c4cbed1a5a960f5ed416ce6ac13c8152b7.tar.gz Python-Textbook-Companions-251a07c4cbed1a5a960f5ed416ce6ac13c8152b7.tar.bz2 Python-Textbook-Companions-251a07c4cbed1a5a960f5ed416ce6ac13c8152b7.zip |
add books
Diffstat (limited to 'Thermodynamics_by_J._P._Holman')
28 files changed, 8156 insertions, 0 deletions
diff --git a/Thermodynamics_by_J._P._Holman/ch1.ipynb b/Thermodynamics_by_J._P._Holman/ch1.ipynb new file mode 100755 index 00000000..ab6704bd --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch1.ipynb @@ -0,0 +1,157 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:8c130f65381c568b421044f85ca49022c02733507c1f974f96d3542659c93a58" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1 : Introduction" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.1 pg : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "d = 8. \t\t\t#in\n", + "ir = 16. \t\t\t#in\n", + "MW = 28.97\n", + "T = 70.+460 \t\t\t#R\n", + "P = 30+14.7 \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "V = math.pi**2 *d**2 *(d+ir)/4\n", + "V = V*10./12**3\n", + "Rair = 1545/MW\n", + "m = P*144*V/(Rair*T)\n", + "\t\t\t\n", + "# Results\n", + "print \"Mass of air = %.2f lbm\"%(m)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of air = 4.99 lbm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.2 pg : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V = 4. \t\t\t#in**3\n", + "P = 30. \t\t\t#psia\n", + "T = 500.\t\t\t#R\n", + "MW = 32.\n", + "\t\t\t\n", + "# Calculations\n", + "print (\"Metric unit conversion,\")\n", + "V = V*2.54**3 *10**-3\n", + "P = 30*4.448/(2.54**2 *10**-4)\n", + "T = 5*(T-32)/9 +273\n", + "n = P*V/(8314.5*T)\n", + "eta = n*1000\n", + "N = eta*6.025*10**23\n", + "m = eta*MW\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of molecules of oxygen = %.3e molecules\"%(N)\n", + "print \" Mass of molecules = %.1f g\"%(m)\n", + "\n", + "#The answer in the textbook is a bit different due to rounding off error\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Metric unit conversion,\n", + "No. of molecules of oxygen = 1.843e+24 molecules\n", + " Mass of molecules = 97.9 g\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 1.3 pg : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "P = 14.7 \t\t\t#psia\n", + "T = 70.+460 \t\t\t#R\n", + "M = 32.\n", + "\t\t\t\n", + "# Calculations\n", + "Ro = 1545/M\n", + "V2 = 3*Ro*T\n", + "V2 = V2*32.174\n", + "vrms = math.sqrt(V2)\n", + "\t\t\t\n", + "# Results\n", + "print \"rms velocity = %d ft/sec\"%(vrms)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "rms velocity = 1571 ft/sec\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch10.ipynb b/Thermodynamics_by_J._P._Holman/ch10.ipynb new file mode 100755 index 00000000..b175206d --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch10.ipynb @@ -0,0 +1,358 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:9a6776975ca26711999c009e1ea80f5d9873f1eba4664269073ed9b23e69c74f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 10 :\n", + "Gaseous Mixtures" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.1 pg : 262" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 2. \n", + "M = 28.\n", + "M2 = 32.\n", + "PN = 300. \t\t\t#psia\n", + "Pt = 400.\t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "nN = m/M\n", + "PO = Pt-PN\n", + "nO = nN*PO/PN\n", + "mO = M2*nO\n", + "\t\t\t\n", + "# Results\n", + "print \"Mass of oxygen added = %.3f lbm\"%(mO)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of oxygen added = 0.762 lbm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.2 pg : 262" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "n = 0.0714\n", + "R = 1545.\n", + "T = 560. \t\t\t#R\n", + "P = 400. \t\t\t#psia\n", + "VN = n*R*T/(P*144)\n", + "VO = (0.0238)*R*T/(P*144)\n", + "V = VN+VO\n", + "\t\t\t\n", + "# Results\n", + "print \"Total volume = %.3f ft**3\"%(V)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total volume = 1.430 ft**3\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.3 pg : 265" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "m1 = 5.\n", + "m2 = 2.\n", + "cp1 = 0.248\n", + "cp2 = 0.203\n", + "T11 = 300. \t\t\t#F\n", + "T12 = 100. \t\t\t#F\n", + "P = 10. \t\t\t#psia\n", + "Pi = 20. \t\t\t#psia\n", + "Pf = 15. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = (m1*cp1*T11 + m2*cp2*T12)/(m1*cp1+m2*cp2)\n", + "n1 = m1/28.\n", + "n2 = m2/44.\n", + "n = n1+n2\n", + "P1 = P*n1/n\n", + "P2 = P*n2/n\n", + "dS = m2*(cp2*math.log((T2+460)/(T12+460)) - 35.1/778 *math.log(P2/Pi)) +m2*(cp2*math.log((T2+460)/(T12+460)) - 55.2/778 *math.log(P1/Pf))\n", + "\t\t\t\n", + "# Results\n", + "print \"change in enthalpy = %.2f B/R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "change in enthalpy = 0.49 B/R\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.4 pg : 268" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Pg = 2.8886 \t\t\t#psia\n", + "P = 25. \t\t\t#psia\n", + "phi = 0.5\n", + "\t\t\t\n", + "# Calculations\n", + "pv = phi*Pg\n", + "pa = P-pv\n", + "w = 0.622*pv/pa\n", + "x = (w)/(1+w)\n", + "\t\t\t\n", + "# Results\n", + "print \"Mass fraction of water vapor in the mixture = %.4f lbm vapor/ lvm mixture\"%(x)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass fraction of water vapor in the mixture = 0.0367 lbm vapor/ lvm mixture\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.5 pg : 271" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "pgw = 0.5069 \t\t\t#psia\n", + "p = 14.696 \t\t\t#psia\n", + "Td = 100. \t \t\t#F\n", + "Tw = 80. \t\t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "pv = pgw- (p-pgw)*(Td-Tw)/(2800-Tw)\n", + "pg = 0.9492 \t\t\t#psia\n", + "phi = pv/pg\n", + "\t\t\t\n", + "# Results\n", + "print \"relative humidity of air stream = %.1f percent\"%(phi*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "relative humidity of air stream = 42.4 percent\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.6 pg : 279" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "w1 = 0.0176 \t\t\t#lbm\n", + "w2 = 0.0093 \t\t\t#lbm\n", + "T2d = 73. \t\t\t#F\n", + "T2 = 55. \t\t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "hv1 = 1061+0.445*100\n", + "hv2 = 1061+0.445*55\n", + "hf = 23.06\n", + "q1 = 20.\n", + "q2 = 4.88\n", + "\t\t\t\n", + "# Results\n", + "print \"Heat removed in cooling section = %d Btu/lbm \"%(q1)\n", + "print \"Heat added in heating section = %.2f Btu/lbm \"%(q2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat removed in cooling section = 20 Btu/lbm \n", + "Heat added in heating section = 4.88 Btu/lbm \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.7 pg : 280" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Tdb = 115. \t\t\t#F\n", + "ph = 0.05\n", + "\n", + "Twb = 67. \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print (\"From steam tables, Twb = 67 F\")\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From steam tables, Twb = 67 F\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.8 pg : 280" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "w1 = 206.\n", + "w2 = 55.\n", + "ma1 = 2.\n", + "ma2 = 3.\n", + "\t\t\t\n", + "# Calculations\n", + "w3 = (ma1*w1 + ma2*w2)/(ma1+ma2)\n", + "Tdb3 = 82. \t\t\t#F\n", + "TWb3 = 74.55 \t\t\t#F\n", + "phi3 = 70. \t \t\t#percent\n", + "\t\t\t\n", + "# Results\n", + "print \"relative humidity = %d percent\"%(phi3)\n", + "print \" Dry bulb temperature = %d F\"%(Tdb3)\n", + "print \" Wet bulb temperature = %.2f F\"%(TWb3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "relative humidity = 70 percent\n", + " Dry bulb temperature = 82 F\n", + " Wet bulb temperature = 74.55 F\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch10_1.ipynb b/Thermodynamics_by_J._P._Holman/ch10_1.ipynb new file mode 100755 index 00000000..b175206d --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch10_1.ipynb @@ -0,0 +1,358 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:9a6776975ca26711999c009e1ea80f5d9873f1eba4664269073ed9b23e69c74f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 10 :\n", + "Gaseous Mixtures" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.1 pg : 262" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 2. \n", + "M = 28.\n", + "M2 = 32.\n", + "PN = 300. \t\t\t#psia\n", + "Pt = 400.\t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "nN = m/M\n", + "PO = Pt-PN\n", + "nO = nN*PO/PN\n", + "mO = M2*nO\n", + "\t\t\t\n", + "# Results\n", + "print \"Mass of oxygen added = %.3f lbm\"%(mO)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of oxygen added = 0.762 lbm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.2 pg : 262" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "n = 0.0714\n", + "R = 1545.\n", + "T = 560. \t\t\t#R\n", + "P = 400. \t\t\t#psia\n", + "VN = n*R*T/(P*144)\n", + "VO = (0.0238)*R*T/(P*144)\n", + "V = VN+VO\n", + "\t\t\t\n", + "# Results\n", + "print \"Total volume = %.3f ft**3\"%(V)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total volume = 1.430 ft**3\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.3 pg : 265" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "m1 = 5.\n", + "m2 = 2.\n", + "cp1 = 0.248\n", + "cp2 = 0.203\n", + "T11 = 300. \t\t\t#F\n", + "T12 = 100. \t\t\t#F\n", + "P = 10. \t\t\t#psia\n", + "Pi = 20. \t\t\t#psia\n", + "Pf = 15. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = (m1*cp1*T11 + m2*cp2*T12)/(m1*cp1+m2*cp2)\n", + "n1 = m1/28.\n", + "n2 = m2/44.\n", + "n = n1+n2\n", + "P1 = P*n1/n\n", + "P2 = P*n2/n\n", + "dS = m2*(cp2*math.log((T2+460)/(T12+460)) - 35.1/778 *math.log(P2/Pi)) +m2*(cp2*math.log((T2+460)/(T12+460)) - 55.2/778 *math.log(P1/Pf))\n", + "\t\t\t\n", + "# Results\n", + "print \"change in enthalpy = %.2f B/R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "change in enthalpy = 0.49 B/R\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.4 pg : 268" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Pg = 2.8886 \t\t\t#psia\n", + "P = 25. \t\t\t#psia\n", + "phi = 0.5\n", + "\t\t\t\n", + "# Calculations\n", + "pv = phi*Pg\n", + "pa = P-pv\n", + "w = 0.622*pv/pa\n", + "x = (w)/(1+w)\n", + "\t\t\t\n", + "# Results\n", + "print \"Mass fraction of water vapor in the mixture = %.4f lbm vapor/ lvm mixture\"%(x)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass fraction of water vapor in the mixture = 0.0367 lbm vapor/ lvm mixture\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.5 pg : 271" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "pgw = 0.5069 \t\t\t#psia\n", + "p = 14.696 \t\t\t#psia\n", + "Td = 100. \t \t\t#F\n", + "Tw = 80. \t\t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "pv = pgw- (p-pgw)*(Td-Tw)/(2800-Tw)\n", + "pg = 0.9492 \t\t\t#psia\n", + "phi = pv/pg\n", + "\t\t\t\n", + "# Results\n", + "print \"relative humidity of air stream = %.1f percent\"%(phi*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "relative humidity of air stream = 42.4 percent\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.6 pg : 279" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "w1 = 0.0176 \t\t\t#lbm\n", + "w2 = 0.0093 \t\t\t#lbm\n", + "T2d = 73. \t\t\t#F\n", + "T2 = 55. \t\t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "hv1 = 1061+0.445*100\n", + "hv2 = 1061+0.445*55\n", + "hf = 23.06\n", + "q1 = 20.\n", + "q2 = 4.88\n", + "\t\t\t\n", + "# Results\n", + "print \"Heat removed in cooling section = %d Btu/lbm \"%(q1)\n", + "print \"Heat added in heating section = %.2f Btu/lbm \"%(q2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat removed in cooling section = 20 Btu/lbm \n", + "Heat added in heating section = 4.88 Btu/lbm \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.7 pg : 280" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Tdb = 115. \t\t\t#F\n", + "ph = 0.05\n", + "\n", + "Twb = 67. \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print (\"From steam tables, Twb = 67 F\")\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From steam tables, Twb = 67 F\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.8 pg : 280" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "w1 = 206.\n", + "w2 = 55.\n", + "ma1 = 2.\n", + "ma2 = 3.\n", + "\t\t\t\n", + "# Calculations\n", + "w3 = (ma1*w1 + ma2*w2)/(ma1+ma2)\n", + "Tdb3 = 82. \t\t\t#F\n", + "TWb3 = 74.55 \t\t\t#F\n", + "phi3 = 70. \t \t\t#percent\n", + "\t\t\t\n", + "# Results\n", + "print \"relative humidity = %d percent\"%(phi3)\n", + "print \" Dry bulb temperature = %d F\"%(Tdb3)\n", + "print \" Wet bulb temperature = %.2f F\"%(TWb3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "relative humidity = 70 percent\n", + " Dry bulb temperature = 82 F\n", + " Wet bulb temperature = 74.55 F\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch11.ipynb b/Thermodynamics_by_J._P._Holman/ch11.ipynb new file mode 100755 index 00000000..657d8d20 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch11.ipynb @@ -0,0 +1,390 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:bcb2b5536fdc9000213789c2755747f3e4bd3724ffe95c35320fbc2314325dca" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11 :\n", + "Chemical Thermodynamics and\n", + "Equilibrium" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.1 pg : 287" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "x = 1.5\n", + "P = 14.696 \t \t\t#psia\n", + "m = 28.96\n", + "\t\t\t\n", + "# Calculations\n", + "mf = 114. \t\t\t# lbm/mol fuel\n", + "ma = x*12.5*(1+3.76)*m\n", + "AF = ma/mf\n", + "n1 = 8.\n", + "n2 = 9.\n", + "n3 = (x-1)*12.5 \n", + "n4 = x*3.76*12.5\n", + "np = n1+n2+n3+n4\n", + "x1 = n1/np\n", + "x2 = n2/np\n", + "x3 = n3/np\n", + "x4 = n4/np\n", + "ph = x2*P\n", + "Td = 113.5 \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print \"Air fuel ratio = %.1f lbm air/lbm fuel\"%(AF)\n", + "print \" Mole fraction of CO2 = %.2f percent\"%(x1*100)\n", + "print \" Mole fraction of H2O = %.2f percent\"%(x2*100)\n", + "print \" Mole fraction of O2 = %.2f percent\"%(x3*100)\n", + "print \" Mole fraction of N2 = %.2f percent\"%(x4*100)\n", + "print (\"From tables of saturation pressure\")\n", + "print \"Dew point = %.1f F\"%(Td)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Air fuel ratio = 22.7 lbm air/lbm fuel\n", + " Mole fraction of CO2 = 8.53 percent\n", + " Mole fraction of H2O = 9.60 percent\n", + " Mole fraction of O2 = 6.67 percent\n", + " Mole fraction of N2 = 75.20 percent\n", + "From tables of saturation pressure\n", + "Dew point = 113.5 F\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.2 pg : 290" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "x1 = 9.\n", + "x2 = 1.2\n", + "x3 = 1.5\n", + "x4 = 88.3\n", + "\t\t\t\n", + "# Calculations\n", + "a = x1+x2\n", + "b = 2*a\n", + "xO = (2*x1 + x2+ 2*x3 + b)/2\n", + "xN = x4/3.76\n", + "ratio = xO/a\n", + "percent = ratio/2 *100\n", + "\t\t\t\n", + "# Results\n", + "print \"Percent theoretical air = %.1f percent\"%(percent)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percent theoretical air = 104.4 percent\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.3 pg : 291" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 440. \t\t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "h1 = -169290\n", + "h2 = 7597.6\n", + "h3 = 4030.2\n", + "ht = h1+h2-h3\n", + "\t\t\t\n", + "# Results\n", + "print \"Molal enthalpy of CO2 = %d Btu/lbm mole\"%(ht)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Molal enthalpy of CO2 = -165722 Btu/lbm mole\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.4 pg : 291" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 77. \t \t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "Hr = -36420. \t\t\t#B\n", + "hc = -169290. \t\t\t#B/lb mol\n", + "hh = -122970. \t\t\t#B/lb mol\n", + "Hp = 2*hc+3*hh\n", + "Q = Hp-Hr\n", + "\t\t\t\n", + "# Results\n", + "print \"Heat transfer = %d B/mol fuel\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat transfer = -671070 B/mol fuel\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.5 pg : 294" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T2 = 440. \t\t\t#F\n", + "T1 = 77. \t\t\t#F\n", + "Mch4 = 16.\n", + "Mw = 18.\n", + "\t\t\t\n", + "# Calculations\n", + "h77 = 3725.1\n", + "ht = 6337.9\n", + "ht2 = 7597.6\n", + "h772 = 4030.2\n", + "hwt = 1260.3\n", + "h77w = 45.02\n", + "hr77 = -383040. \t\t\t#B/lbm mol\n", + "dHR = 1*Mch4*0.532*(T1-T2) + 2*(h77-ht)\n", + "dHp = 1*(ht2-h772) + 2*Mw*(hwt - h77w)\n", + "hrp = dHp+hr77+dHR\n", + "\t\t\t\n", + "# Results\n", + "print \"Enthalpy of combustion of gaseous methane = %d B/lbm mol fuel\"%(hrp)\n", + "\n", + "#The calculation in textbook is wrong Please check it using a calculator.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enthalpy of combustion of gaseous methane = -344037 B/lbm mol fuel\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.6 pg : 295" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Hr = -107530. \t\t\t#B/mol fuel\n", + "print (\"By iteration of temperatures, T = 2700 R\")\n", + "T = 2700. \t\t\t#R\n", + "\t\t\t\n", + "# Results\n", + "print \"Adiabatic flame temperature = %d R\"%(T)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "By iteration of temperatures, T = 2700 R\n", + "Adiabatic flame temperature = 2700 R\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.7 pg : 306" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from numpy import poly1d,roots\n", + "\n", + "# Variables\n", + "import math \n", + "Kp = 0.668\n", + "y = Kp**2\n", + "\t\t\t\n", + "# Calculations\n", + "x = poly1d(0)\n", + "vec = roots([y,2,-y,-2,0]) #x**3 + y*x**3 + 2*y*x**2 -y*x -2*y)\n", + "\n", + "eps = vec[0]\n", + "x1 = (1-eps)/(1+ eps/2)\n", + "x2 = eps/(1+eps/2)\n", + "x3 = eps/2/(1+ eps/2)\n", + "\t\t\t\n", + "# Results\n", + "print \"degree of reaction = %.3f \"%(eps)\n", + "print \" Equilibrium concentration of CO2 = %.3f \"%(x1)\n", + "print \" Equilibrium concentration of CO = %.3f \"%(x2)\n", + "print \" Equilibrium concentration of O2 = %.3f \"%(x3)\n", + "\n", + "#the answers are different due to approximation in textbook\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "degree of reaction = -4.482 \n", + " Equilibrium concentration of CO2 = -4.417 \n", + " Equilibrium concentration of CO = 3.612 \n", + " Equilibrium concentration of O2 = 1.806 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.8 pg : 307" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from numpy import roots\n", + "\n", + "# Variables\n", + "Kp = 15.63\n", + "y = Kp\n", + "\t\t\t\n", + "# Calculations\n", + "vec = roots([y+1,0,-y])#x**2 + y*x**2 - y)\n", + "eps = vec[0]\n", + "x1 = (1-eps)/(1+eps)\n", + "x2 = eps/(1+eps)\n", + "x3 = eps/(1+eps)\n", + "\t\t\t\n", + "# Results\n", + "print \" Equilibrium concentration of Cs = %.4f \"%(x1)\n", + "print \" Equilibrium concentration of Cs+ = %.4f \"%(x2)\n", + "print \" Equilibrium concentration of e- = %.4f \"%(x3)\n", + "\n", + "#the answers are a bit different due to approximation in textbook\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Equilibrium concentration of Cs = 0.0155 \n", + " Equilibrium concentration of Cs+ = 0.4922 \n", + " Equilibrium concentration of e- = 0.4922 \n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch11_1.ipynb b/Thermodynamics_by_J._P._Holman/ch11_1.ipynb new file mode 100755 index 00000000..657d8d20 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch11_1.ipynb @@ -0,0 +1,390 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:bcb2b5536fdc9000213789c2755747f3e4bd3724ffe95c35320fbc2314325dca" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11 :\n", + "Chemical Thermodynamics and\n", + "Equilibrium" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.1 pg : 287" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "x = 1.5\n", + "P = 14.696 \t \t\t#psia\n", + "m = 28.96\n", + "\t\t\t\n", + "# Calculations\n", + "mf = 114. \t\t\t# lbm/mol fuel\n", + "ma = x*12.5*(1+3.76)*m\n", + "AF = ma/mf\n", + "n1 = 8.\n", + "n2 = 9.\n", + "n3 = (x-1)*12.5 \n", + "n4 = x*3.76*12.5\n", + "np = n1+n2+n3+n4\n", + "x1 = n1/np\n", + "x2 = n2/np\n", + "x3 = n3/np\n", + "x4 = n4/np\n", + "ph = x2*P\n", + "Td = 113.5 \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print \"Air fuel ratio = %.1f lbm air/lbm fuel\"%(AF)\n", + "print \" Mole fraction of CO2 = %.2f percent\"%(x1*100)\n", + "print \" Mole fraction of H2O = %.2f percent\"%(x2*100)\n", + "print \" Mole fraction of O2 = %.2f percent\"%(x3*100)\n", + "print \" Mole fraction of N2 = %.2f percent\"%(x4*100)\n", + "print (\"From tables of saturation pressure\")\n", + "print \"Dew point = %.1f F\"%(Td)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Air fuel ratio = 22.7 lbm air/lbm fuel\n", + " Mole fraction of CO2 = 8.53 percent\n", + " Mole fraction of H2O = 9.60 percent\n", + " Mole fraction of O2 = 6.67 percent\n", + " Mole fraction of N2 = 75.20 percent\n", + "From tables of saturation pressure\n", + "Dew point = 113.5 F\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.2 pg : 290" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "x1 = 9.\n", + "x2 = 1.2\n", + "x3 = 1.5\n", + "x4 = 88.3\n", + "\t\t\t\n", + "# Calculations\n", + "a = x1+x2\n", + "b = 2*a\n", + "xO = (2*x1 + x2+ 2*x3 + b)/2\n", + "xN = x4/3.76\n", + "ratio = xO/a\n", + "percent = ratio/2 *100\n", + "\t\t\t\n", + "# Results\n", + "print \"Percent theoretical air = %.1f percent\"%(percent)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percent theoretical air = 104.4 percent\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.3 pg : 291" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 440. \t\t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "h1 = -169290\n", + "h2 = 7597.6\n", + "h3 = 4030.2\n", + "ht = h1+h2-h3\n", + "\t\t\t\n", + "# Results\n", + "print \"Molal enthalpy of CO2 = %d Btu/lbm mole\"%(ht)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Molal enthalpy of CO2 = -165722 Btu/lbm mole\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.4 pg : 291" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 77. \t \t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "Hr = -36420. \t\t\t#B\n", + "hc = -169290. \t\t\t#B/lb mol\n", + "hh = -122970. \t\t\t#B/lb mol\n", + "Hp = 2*hc+3*hh\n", + "Q = Hp-Hr\n", + "\t\t\t\n", + "# Results\n", + "print \"Heat transfer = %d B/mol fuel\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat transfer = -671070 B/mol fuel\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.5 pg : 294" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T2 = 440. \t\t\t#F\n", + "T1 = 77. \t\t\t#F\n", + "Mch4 = 16.\n", + "Mw = 18.\n", + "\t\t\t\n", + "# Calculations\n", + "h77 = 3725.1\n", + "ht = 6337.9\n", + "ht2 = 7597.6\n", + "h772 = 4030.2\n", + "hwt = 1260.3\n", + "h77w = 45.02\n", + "hr77 = -383040. \t\t\t#B/lbm mol\n", + "dHR = 1*Mch4*0.532*(T1-T2) + 2*(h77-ht)\n", + "dHp = 1*(ht2-h772) + 2*Mw*(hwt - h77w)\n", + "hrp = dHp+hr77+dHR\n", + "\t\t\t\n", + "# Results\n", + "print \"Enthalpy of combustion of gaseous methane = %d B/lbm mol fuel\"%(hrp)\n", + "\n", + "#The calculation in textbook is wrong Please check it using a calculator.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enthalpy of combustion of gaseous methane = -344037 B/lbm mol fuel\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.6 pg : 295" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Hr = -107530. \t\t\t#B/mol fuel\n", + "print (\"By iteration of temperatures, T = 2700 R\")\n", + "T = 2700. \t\t\t#R\n", + "\t\t\t\n", + "# Results\n", + "print \"Adiabatic flame temperature = %d R\"%(T)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "By iteration of temperatures, T = 2700 R\n", + "Adiabatic flame temperature = 2700 R\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.7 pg : 306" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from numpy import poly1d,roots\n", + "\n", + "# Variables\n", + "import math \n", + "Kp = 0.668\n", + "y = Kp**2\n", + "\t\t\t\n", + "# Calculations\n", + "x = poly1d(0)\n", + "vec = roots([y,2,-y,-2,0]) #x**3 + y*x**3 + 2*y*x**2 -y*x -2*y)\n", + "\n", + "eps = vec[0]\n", + "x1 = (1-eps)/(1+ eps/2)\n", + "x2 = eps/(1+eps/2)\n", + "x3 = eps/2/(1+ eps/2)\n", + "\t\t\t\n", + "# Results\n", + "print \"degree of reaction = %.3f \"%(eps)\n", + "print \" Equilibrium concentration of CO2 = %.3f \"%(x1)\n", + "print \" Equilibrium concentration of CO = %.3f \"%(x2)\n", + "print \" Equilibrium concentration of O2 = %.3f \"%(x3)\n", + "\n", + "#the answers are different due to approximation in textbook\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "degree of reaction = -4.482 \n", + " Equilibrium concentration of CO2 = -4.417 \n", + " Equilibrium concentration of CO = 3.612 \n", + " Equilibrium concentration of O2 = 1.806 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.8 pg : 307" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from numpy import roots\n", + "\n", + "# Variables\n", + "Kp = 15.63\n", + "y = Kp\n", + "\t\t\t\n", + "# Calculations\n", + "vec = roots([y+1,0,-y])#x**2 + y*x**2 - y)\n", + "eps = vec[0]\n", + "x1 = (1-eps)/(1+eps)\n", + "x2 = eps/(1+eps)\n", + "x3 = eps/(1+eps)\n", + "\t\t\t\n", + "# Results\n", + "print \" Equilibrium concentration of Cs = %.4f \"%(x1)\n", + "print \" Equilibrium concentration of Cs+ = %.4f \"%(x2)\n", + "print \" Equilibrium concentration of e- = %.4f \"%(x3)\n", + "\n", + "#the answers are a bit different due to approximation in textbook\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Equilibrium concentration of Cs = 0.0155 \n", + " Equilibrium concentration of Cs+ = 0.4922 \n", + " Equilibrium concentration of e- = 0.4922 \n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch12.ipynb b/Thermodynamics_by_J._P._Holman/ch12.ipynb new file mode 100755 index 00000000..de315e52 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch12.ipynb @@ -0,0 +1,606 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:82090567853b966deac889dc0128f75e1e99033e5ed66e328546471b278bffea" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 12 :\n", + "conventional power and\n", + "refrigeration cycles" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.1 pg : 321" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "h1 = 1357. \t\t\t#500 psia, 700 F\n", + "h2 = 935. \t\t\t#P2 = 2 psia\n", + "h3 = 93.99 \t\t\t#sat liq at 2 psia\n", + "vf = 0.01613\n", + "P4 = 500. \t\t\t#psia\n", + "P3 = 2. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "dh4 = vf*(P4-P3)*144/778.\n", + "h4 = h3+dh4\n", + "eta = ((h1-h2)-(h4-h3))/(h1-h4)\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.1f percent \"%(eta*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 33.3 percent \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.2 pg : 323" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "h1 = 1357. \t\t\t#500 psia 700F\n", + "h2 = 1194. \t\t\t#P2 = 100 psia\n", + "h3 = 1379. \t\t\t#100 psia, 700 F\n", + "h4 = 1047. \t\t\t#p4 = 2 psia\n", + "h5 = 93.99 \t\t\t#sat liq at 2 psia\n", + "h6 = 95.02 \t\t\t#example 12.1\n", + "\t\t\t\n", + "# Calculations\n", + "W = h1-h2+h3-h4-(h6-h5)\n", + "Q = (h1-h6)+(h3-h2)\n", + "eta = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.2f percent\"%(eta*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 34.14 percent\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.3 pg : 327" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 100. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "h1 = 1357. \t\t\t#500 psia, 700F\n", + "h2 = 1194. \t\t\t#100 psia\n", + "h3 = 935.\t\t\t#2 psia\n", + "h4 = 93.99 \t\t\t#sat liq at 2 psia\n", + "vf = 0.01613 \n", + "vf2 = 0.01774\n", + "P5 = 100. \t\t\t#psia\n", + "P4 = 2. \t\t\t#psia\n", + "dh4 = vf*(P5-P4)*144/778.\n", + "h5 = h4+dh4\n", + "h6 = 298.4\n", + "P7 = 500. \t\t\t#psia\n", + "P6 = 100. \t\t\t#psia\n", + "dh6 = vf2*(P7-P6)*144./778\n", + "h7 = dh6+h6\n", + "m = (h6-h5)/(h2-h5)\n", + "W = h1-h2 + (1-m)*(h2-h3) - (1-m)*(h5-h4) -(h7-h6)\n", + "Q = h1-h7\n", + "etath = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.1f percent\"%(etath*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 35.2 percent\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.4 pg : 330" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "x = 0.8\n", + "\t\t\t\n", + "# Calculations\n", + "h1 = 1357. \t\t\t#500 psia 700F\n", + "h2 = 1194. \t\t\t#P2 = 100 psia\n", + "h3 = 1379. \t\t\t#100 psia, 700 F\n", + "h4 = 1047. \t\t\t#p4 = 2 psia\n", + "h5 = 93.99 \t\t\t#sat liq at 2 psia\n", + "h6 = 95.02 \t\t\t#example 12.1\n", + "h2d = h1- x*(h1-h2) \n", + "h4d = h3- x*(h3-h4)\n", + "W = (h1-h2d) +(h3-h4d) - (h6-h5)\n", + "Q = (h1-h6) + (h3-h2d)\n", + "eta = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %d percent\"%(eta*100+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 28 percent\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.5 pg : 335" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P4 = 50. \t\t\t#psia\n", + "P1 = 14.7 \t\t\t#psia\n", + "P3 = 50. \t\t\t#psia\n", + "P2 = 14.7 \t\t\t#psia\n", + "g = 1.4\n", + "\t\t\t\n", + "# Calculations\n", + "V1r = (P4/P1)**(1/g)\n", + "V2r = (P3/P2)**(1/g)\n", + "#After solving,\n", + "V4 = 5.38 \t\t\t#ft**3/min\n", + "V1 = 12.9 \t \t\t#ft**3/min\n", + "V2 = 112.9 \t\t\t#ft**3/min\n", + "PD = V2-V4\n", + "etavol = (V2-V1)/(V2-V4)\n", + "W32 = g*P2*144*V2*((P3/P2)**((g-1)/g) -1 ) /(1-g)\n", + "W41 = g*P4*144*V4*((P1/P4)**((g-1)/g) -1 ) /(1-g)\n", + "Wt = W32+W41\n", + "\t\t\t\n", + "# Results\n", + "print \"Total work = %.2e ft-lbf /min\"%(Wt)\n", + "\t\t\t#The answer given in textbook is wrong . please verify it umath.sing a calculator\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total work = -3.10e+05 ft-lbf /min\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.6 pg : 337" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "P1 = 14.7 \t\t\t#psia\n", + "P4 = 100. \t\t\t#psia\n", + "T1 = 530. \t\t\t#R\n", + "T3 = T1\n", + "g = 1.4\n", + "m = 10. \t\t\t#lbm\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "P2 = math.sqrt(P1*P4)\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "T4 = T2\n", + "W = 2*cp*(T2-T1)\n", + "Wt = W*m\n", + "hp = Wt*60./2545\n", + "Q = m*cp*(T2-T3)\n", + "T4 = T1*(P4/P1)**((g-1)/g)\n", + "W2 = m*cp*(T4-T1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Work required in case 1 = %d Btu/min\"%(Wt+1)\n", + "print \" Work required in case 2 = %d Btu/min\"%(W2+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work required in case 1 = 802 Btu/min\n", + " Work required in case 2 = 928 Btu/min\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.7 pg : 342" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "g = 1.4\n", + "r1 = 10.\n", + "r2 = 12.\n", + "r3 = 15.\n", + "Tl = 530. \t\t\t#R\n", + "Th = 1960. \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "eta1 = 1- (r1)**(1-g)\n", + "eta2 = 1- (r2)**(1-g)\n", + "eta3 = 1- (r3)**(1-g)\n", + "etac = 1-Tl/Th\n", + "\t\t\t\n", + "# Results\n", + "print \"Efficiency in case 1 = %.1f percent\"%(eta1*100)\n", + "print \" Efficiency in case 2 = %.1f percent\"%(eta2*100)\n", + "print \" Efficiency in case 3 = %.1f percent\"%(eta3*100)\n", + "print \" Carnot efficiency = %.f percent\"%(etac*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency in case 1 = 60.2 percent\n", + " Efficiency in case 2 = 63.0 percent\n", + " Efficiency in case 3 = 66.1 percent\n", + " Carnot efficiency = 73 percent\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.8 pg : 344" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 70.+460 \t\t\t#R\n", + "P1 = 14.7 \t\t\t#psia\n", + "g = 1.4\n", + "r = 15.\n", + "rc = 2.\n", + "cp = 0.24\n", + "cp2 = 0.1715\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(r)**(g-1)\n", + "T3 = rc*T2\n", + "T4 = T3*(rc/r)**(g-1)\n", + "Qh = cp*(T3-T2)\n", + "Ql = cp2*(T4-T1)\n", + "W = Qh-Ql\n", + "eta = W/Qh\n", + "\t\t\t\n", + "# Results\n", + "print \"Work output = %.f B/lbm\"%(W)\n", + "print \" Efficiency = %.1f percent\"%(eta*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work output = 227 B/lbm\n", + " Efficiency = 60.4 percent\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.9 pg : 351" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P1 = 14.7 \t\t\t#psia\n", + "P4 = 14.7 \t\t\t#psia\n", + "T1 = 530. \t\t\t#R\n", + "T3 = 1960. \t\t\t#R\n", + "P2 = 60. \t\t\t#psia\n", + "P3 = P2\n", + "g = 1.4\n", + "eta1 = 0.85\n", + "eta2 = 0.9\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "T4 = T3*(P4/P3)**((g-1)/g)\n", + "T2d = (T2-T1)/eta1 + T1\n", + "T4d = -eta2*(T3-T4) +T3\n", + "Wact = 0.24*(T3-T4d - (T2d-T1))\n", + "Qh = 0.24*(T3-T2d)\n", + "etath = Wact/Qh\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.1f percent\"%(etath*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 24.5 percent\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.10 pg : 352" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "e = 0.83\n", + "\t\t\t\n", + "# Calculations\n", + "T1 = 530. \t\t\t#R\n", + "T2d = 838. \t\t\t#R\n", + "T6d = T2d\n", + "T3 = 1960. \t\t\t#R\n", + "T4d = 1375. \t\t\t#R\n", + "T5d = T4d\n", + "T5 = e*(T5d-T2d) +T2d\n", + "W = 0.24*((T3-T4d)- (T2d-T1))\n", + "Q = 0.24*(T3-T5)\n", + "eta = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %d percent\"%(eta*100+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 41 percent\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.11 pg : 354" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "T1 = 420. \t\t\t#R\n", + "T11 = 530. \t\t\t#R\n", + "T3 = 2460. \t\t\t#R\n", + "V1 = 300. \t\t\t#ft/sec\n", + "P1 = 5. \t\t\t#psia\n", + "P5 = P1\n", + "P2 = 50. \t\t\t#psia\n", + "P3 = 5. \t\t\t#psia\n", + "P4 = 50. \t\t\t#psia\n", + "g = 1.4\n", + "cp = 0.24\n", + "m = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "T4 = T3-T2+T11\n", + "T5 = T3*(P3/P4)**((g-1)/g)\n", + "V5 = math.sqrt(2*32.2*cp*(T4-T5)*778)\n", + "T = m*(V1-V5)/32.2\n", + "Qh = cp*(T3-T2)\n", + "P = -T*V1\n", + "\t\t\t\n", + "# Results\n", + "print \"Thrust = %.1f lbf\"%(T)\n", + "print \" Heat input = %d B/lbm\"%(Qh)\n", + "print \" Power = %d ft-lbf /sec\"%(round(P,-3))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thrust = -93.1 lbf\n", + " Heat input = 395 B/lbm\n", + " Power = 28000 ft-lbf /sec\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.12 pg : 360" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "h1 = 80.419 \t\t\t#B/lbm\n", + "h3 = 36.013 \t\t\t#B/lbm\n", + "h4 = h3\n", + "P3 = 172.35 \t\t\t#psia\n", + "P2 = P3\n", + "m = 5. \t\t\t#tons\n", + "Q = 12000.\n", + "\t\t\t\n", + "# Calculations\n", + "h2 = 91.5 \t\t\t#B/lbm\n", + "COP = (h1-h4)/(h2-h1)\n", + "W = h2-h1\n", + "md = m*Q/(h1-h4)\n", + "Wt = md*(h2-h1)\n", + "Wt2 = Wt/2545.\n", + "\t\t\t\n", + "# Results\n", + "print \"Coefficient of performance = %.1f\"%(COP)\n", + "print \" Input work = %.1f hp\"%(Wt2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Coefficient of performance = 4.0\n", + " Input work = 5.9 hp\n" + ] + } + ], + "prompt_number": 15 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch12_1.ipynb b/Thermodynamics_by_J._P._Holman/ch12_1.ipynb new file mode 100755 index 00000000..de315e52 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch12_1.ipynb @@ -0,0 +1,606 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:82090567853b966deac889dc0128f75e1e99033e5ed66e328546471b278bffea" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 12 :\n", + "conventional power and\n", + "refrigeration cycles" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.1 pg : 321" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "h1 = 1357. \t\t\t#500 psia, 700 F\n", + "h2 = 935. \t\t\t#P2 = 2 psia\n", + "h3 = 93.99 \t\t\t#sat liq at 2 psia\n", + "vf = 0.01613\n", + "P4 = 500. \t\t\t#psia\n", + "P3 = 2. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "dh4 = vf*(P4-P3)*144/778.\n", + "h4 = h3+dh4\n", + "eta = ((h1-h2)-(h4-h3))/(h1-h4)\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.1f percent \"%(eta*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 33.3 percent \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.2 pg : 323" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "h1 = 1357. \t\t\t#500 psia 700F\n", + "h2 = 1194. \t\t\t#P2 = 100 psia\n", + "h3 = 1379. \t\t\t#100 psia, 700 F\n", + "h4 = 1047. \t\t\t#p4 = 2 psia\n", + "h5 = 93.99 \t\t\t#sat liq at 2 psia\n", + "h6 = 95.02 \t\t\t#example 12.1\n", + "\t\t\t\n", + "# Calculations\n", + "W = h1-h2+h3-h4-(h6-h5)\n", + "Q = (h1-h6)+(h3-h2)\n", + "eta = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.2f percent\"%(eta*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 34.14 percent\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.3 pg : 327" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 100. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "h1 = 1357. \t\t\t#500 psia, 700F\n", + "h2 = 1194. \t\t\t#100 psia\n", + "h3 = 935.\t\t\t#2 psia\n", + "h4 = 93.99 \t\t\t#sat liq at 2 psia\n", + "vf = 0.01613 \n", + "vf2 = 0.01774\n", + "P5 = 100. \t\t\t#psia\n", + "P4 = 2. \t\t\t#psia\n", + "dh4 = vf*(P5-P4)*144/778.\n", + "h5 = h4+dh4\n", + "h6 = 298.4\n", + "P7 = 500. \t\t\t#psia\n", + "P6 = 100. \t\t\t#psia\n", + "dh6 = vf2*(P7-P6)*144./778\n", + "h7 = dh6+h6\n", + "m = (h6-h5)/(h2-h5)\n", + "W = h1-h2 + (1-m)*(h2-h3) - (1-m)*(h5-h4) -(h7-h6)\n", + "Q = h1-h7\n", + "etath = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.1f percent\"%(etath*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 35.2 percent\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.4 pg : 330" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "x = 0.8\n", + "\t\t\t\n", + "# Calculations\n", + "h1 = 1357. \t\t\t#500 psia 700F\n", + "h2 = 1194. \t\t\t#P2 = 100 psia\n", + "h3 = 1379. \t\t\t#100 psia, 700 F\n", + "h4 = 1047. \t\t\t#p4 = 2 psia\n", + "h5 = 93.99 \t\t\t#sat liq at 2 psia\n", + "h6 = 95.02 \t\t\t#example 12.1\n", + "h2d = h1- x*(h1-h2) \n", + "h4d = h3- x*(h3-h4)\n", + "W = (h1-h2d) +(h3-h4d) - (h6-h5)\n", + "Q = (h1-h6) + (h3-h2d)\n", + "eta = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %d percent\"%(eta*100+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 28 percent\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.5 pg : 335" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P4 = 50. \t\t\t#psia\n", + "P1 = 14.7 \t\t\t#psia\n", + "P3 = 50. \t\t\t#psia\n", + "P2 = 14.7 \t\t\t#psia\n", + "g = 1.4\n", + "\t\t\t\n", + "# Calculations\n", + "V1r = (P4/P1)**(1/g)\n", + "V2r = (P3/P2)**(1/g)\n", + "#After solving,\n", + "V4 = 5.38 \t\t\t#ft**3/min\n", + "V1 = 12.9 \t \t\t#ft**3/min\n", + "V2 = 112.9 \t\t\t#ft**3/min\n", + "PD = V2-V4\n", + "etavol = (V2-V1)/(V2-V4)\n", + "W32 = g*P2*144*V2*((P3/P2)**((g-1)/g) -1 ) /(1-g)\n", + "W41 = g*P4*144*V4*((P1/P4)**((g-1)/g) -1 ) /(1-g)\n", + "Wt = W32+W41\n", + "\t\t\t\n", + "# Results\n", + "print \"Total work = %.2e ft-lbf /min\"%(Wt)\n", + "\t\t\t#The answer given in textbook is wrong . please verify it umath.sing a calculator\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total work = -3.10e+05 ft-lbf /min\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.6 pg : 337" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "P1 = 14.7 \t\t\t#psia\n", + "P4 = 100. \t\t\t#psia\n", + "T1 = 530. \t\t\t#R\n", + "T3 = T1\n", + "g = 1.4\n", + "m = 10. \t\t\t#lbm\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "P2 = math.sqrt(P1*P4)\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "T4 = T2\n", + "W = 2*cp*(T2-T1)\n", + "Wt = W*m\n", + "hp = Wt*60./2545\n", + "Q = m*cp*(T2-T3)\n", + "T4 = T1*(P4/P1)**((g-1)/g)\n", + "W2 = m*cp*(T4-T1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Work required in case 1 = %d Btu/min\"%(Wt+1)\n", + "print \" Work required in case 2 = %d Btu/min\"%(W2+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work required in case 1 = 802 Btu/min\n", + " Work required in case 2 = 928 Btu/min\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.7 pg : 342" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "g = 1.4\n", + "r1 = 10.\n", + "r2 = 12.\n", + "r3 = 15.\n", + "Tl = 530. \t\t\t#R\n", + "Th = 1960. \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "eta1 = 1- (r1)**(1-g)\n", + "eta2 = 1- (r2)**(1-g)\n", + "eta3 = 1- (r3)**(1-g)\n", + "etac = 1-Tl/Th\n", + "\t\t\t\n", + "# Results\n", + "print \"Efficiency in case 1 = %.1f percent\"%(eta1*100)\n", + "print \" Efficiency in case 2 = %.1f percent\"%(eta2*100)\n", + "print \" Efficiency in case 3 = %.1f percent\"%(eta3*100)\n", + "print \" Carnot efficiency = %.f percent\"%(etac*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency in case 1 = 60.2 percent\n", + " Efficiency in case 2 = 63.0 percent\n", + " Efficiency in case 3 = 66.1 percent\n", + " Carnot efficiency = 73 percent\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.8 pg : 344" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 70.+460 \t\t\t#R\n", + "P1 = 14.7 \t\t\t#psia\n", + "g = 1.4\n", + "r = 15.\n", + "rc = 2.\n", + "cp = 0.24\n", + "cp2 = 0.1715\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(r)**(g-1)\n", + "T3 = rc*T2\n", + "T4 = T3*(rc/r)**(g-1)\n", + "Qh = cp*(T3-T2)\n", + "Ql = cp2*(T4-T1)\n", + "W = Qh-Ql\n", + "eta = W/Qh\n", + "\t\t\t\n", + "# Results\n", + "print \"Work output = %.f B/lbm\"%(W)\n", + "print \" Efficiency = %.1f percent\"%(eta*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work output = 227 B/lbm\n", + " Efficiency = 60.4 percent\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.9 pg : 351" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P1 = 14.7 \t\t\t#psia\n", + "P4 = 14.7 \t\t\t#psia\n", + "T1 = 530. \t\t\t#R\n", + "T3 = 1960. \t\t\t#R\n", + "P2 = 60. \t\t\t#psia\n", + "P3 = P2\n", + "g = 1.4\n", + "eta1 = 0.85\n", + "eta2 = 0.9\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "T4 = T3*(P4/P3)**((g-1)/g)\n", + "T2d = (T2-T1)/eta1 + T1\n", + "T4d = -eta2*(T3-T4) +T3\n", + "Wact = 0.24*(T3-T4d - (T2d-T1))\n", + "Qh = 0.24*(T3-T2d)\n", + "etath = Wact/Qh\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %.1f percent\"%(etath*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 24.5 percent\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.10 pg : 352" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "e = 0.83\n", + "\t\t\t\n", + "# Calculations\n", + "T1 = 530. \t\t\t#R\n", + "T2d = 838. \t\t\t#R\n", + "T6d = T2d\n", + "T3 = 1960. \t\t\t#R\n", + "T4d = 1375. \t\t\t#R\n", + "T5d = T4d\n", + "T5 = e*(T5d-T2d) +T2d\n", + "W = 0.24*((T3-T4d)- (T2d-T1))\n", + "Q = 0.24*(T3-T5)\n", + "eta = W/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal efficiency = %d percent\"%(eta*100+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 41 percent\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.11 pg : 354" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "T1 = 420. \t\t\t#R\n", + "T11 = 530. \t\t\t#R\n", + "T3 = 2460. \t\t\t#R\n", + "V1 = 300. \t\t\t#ft/sec\n", + "P1 = 5. \t\t\t#psia\n", + "P5 = P1\n", + "P2 = 50. \t\t\t#psia\n", + "P3 = 5. \t\t\t#psia\n", + "P4 = 50. \t\t\t#psia\n", + "g = 1.4\n", + "cp = 0.24\n", + "m = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "T4 = T3-T2+T11\n", + "T5 = T3*(P3/P4)**((g-1)/g)\n", + "V5 = math.sqrt(2*32.2*cp*(T4-T5)*778)\n", + "T = m*(V1-V5)/32.2\n", + "Qh = cp*(T3-T2)\n", + "P = -T*V1\n", + "\t\t\t\n", + "# Results\n", + "print \"Thrust = %.1f lbf\"%(T)\n", + "print \" Heat input = %d B/lbm\"%(Qh)\n", + "print \" Power = %d ft-lbf /sec\"%(round(P,-3))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thrust = -93.1 lbf\n", + " Heat input = 395 B/lbm\n", + " Power = 28000 ft-lbf /sec\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.12 pg : 360" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "h1 = 80.419 \t\t\t#B/lbm\n", + "h3 = 36.013 \t\t\t#B/lbm\n", + "h4 = h3\n", + "P3 = 172.35 \t\t\t#psia\n", + "P2 = P3\n", + "m = 5. \t\t\t#tons\n", + "Q = 12000.\n", + "\t\t\t\n", + "# Calculations\n", + "h2 = 91.5 \t\t\t#B/lbm\n", + "COP = (h1-h4)/(h2-h1)\n", + "W = h2-h1\n", + "md = m*Q/(h1-h4)\n", + "Wt = md*(h2-h1)\n", + "Wt2 = Wt/2545.\n", + "\t\t\t\n", + "# Results\n", + "print \"Coefficient of performance = %.1f\"%(COP)\n", + "print \" Input work = %.1f hp\"%(Wt2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Coefficient of performance = 4.0\n", + " Input work = 5.9 hp\n" + ] + } + ], + "prompt_number": 15 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch13.ipynb b/Thermodynamics_by_J._P._Holman/ch13.ipynb new file mode 100755 index 00000000..f2b649d3 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch13.ipynb @@ -0,0 +1,107 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:11cb16e5df43b71fcfcbd028a413a4b4822b665e44e65d30bde344b1e73319cb" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 13 :\n", + "Thermodynamics of irreversible\n", + "processes" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.1 pg : 377" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Eab1 = 0.\n", + "Eab2 = 5.87 \t\t\t#mV\n", + "T1 = 150. \t\t\t#F\n", + "T2 = 200. \t \t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "Eab = -1.12+ 0.035*T1\n", + "pi1 = 0.035*(T1+460)\n", + "pi2 = 0.035*(T2+460)\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermocouple reading at %d F = %.2f mv\"%(T1,Eab)\n", + "print \" Peltier coefficient at %d F = %.1f mv\"%(T1,pi1)\n", + "print \" Peltier coefficient at %d F = %.1f mv\"%(T2,pi2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermocouple reading at 150 F = 4.13 mv\n", + " Peltier coefficient at 150 F = 21.4 mv\n", + " Peltier coefficient at 200 F = 23.1 mv\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.2 pg : 380" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 0. \t\t\t#C\n", + "\t\t\t\n", + "# Calculations\n", + "de1 = -72. \t\t\t#mV/C\n", + "de2 = 500. \t\t\t#mv/C\n", + "alpha = de1-de2\n", + "pi = -(T+273)*alpha\n", + "\t\t\t\n", + "# Results\n", + "print \"Peltier coefficient at %d C = %d mv\"%(T,pi/1000)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Peltier coefficient at 0 C = 156 mv\n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch13_1.ipynb b/Thermodynamics_by_J._P._Holman/ch13_1.ipynb new file mode 100755 index 00000000..f2b649d3 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch13_1.ipynb @@ -0,0 +1,107 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:11cb16e5df43b71fcfcbd028a413a4b4822b665e44e65d30bde344b1e73319cb" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 13 :\n", + "Thermodynamics of irreversible\n", + "processes" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.1 pg : 377" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Eab1 = 0.\n", + "Eab2 = 5.87 \t\t\t#mV\n", + "T1 = 150. \t\t\t#F\n", + "T2 = 200. \t \t\t#F\n", + "\t\t\t\n", + "# Calculations\n", + "Eab = -1.12+ 0.035*T1\n", + "pi1 = 0.035*(T1+460)\n", + "pi2 = 0.035*(T2+460)\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermocouple reading at %d F = %.2f mv\"%(T1,Eab)\n", + "print \" Peltier coefficient at %d F = %.1f mv\"%(T1,pi1)\n", + "print \" Peltier coefficient at %d F = %.1f mv\"%(T2,pi2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermocouple reading at 150 F = 4.13 mv\n", + " Peltier coefficient at 150 F = 21.4 mv\n", + " Peltier coefficient at 200 F = 23.1 mv\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.2 pg : 380" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 0. \t\t\t#C\n", + "\t\t\t\n", + "# Calculations\n", + "de1 = -72. \t\t\t#mV/C\n", + "de2 = 500. \t\t\t#mv/C\n", + "alpha = de1-de2\n", + "pi = -(T+273)*alpha\n", + "\t\t\t\n", + "# Results\n", + "print \"Peltier coefficient at %d C = %d mv\"%(T,pi/1000)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Peltier coefficient at 0 C = 156 mv\n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch14.ipynb b/Thermodynamics_by_J._P._Holman/ch14.ipynb new file mode 100755 index 00000000..b28135ae --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch14.ipynb @@ -0,0 +1,189 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:af8a4c7e1aee0095ba7f54013d97317f8251c73de6783cf6d6c6f47de9fd5e14" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 14 :\n", + "direct energy conversion" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.1 pg : 385" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 25.+273 \t\t\t#K\n", + "F = 23060.\n", + "\t\t\t\n", + "# Calculations\n", + "H = -68317.\n", + "G = -56690.\n", + "Er = -G/(2*F)\n", + "eta = G/H\n", + "W = -G\n", + "Q = H-G\n", + "\t\t\t\n", + "# Results\n", + "print \"Voltage output of the cell = %.3f volts\"%(Er)\n", + "print \" Efficiency = %d percent\"%(eta*100 +1)\n", + "print \" Electrical Work output = %d cal/mol H2\"%(W)\n", + "print \" Heat transfer to the surroundings = %d cal/mol H2\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Voltage output of the cell = 1.229 volts\n", + " Efficiency = 83 percent\n", + " Electrical Work output = 56690 cal/mol H2\n", + " Heat transfer to the surroundings = -11627 cal/mol H2\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.2 pg : 395" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "x1 = 0.75\n", + "x2 = 0.25\n", + "an = -190*10**-6 \t\t\t#volt/C\n", + "rn = 1.45*10**-3 \t\t\t#ohm cm\n", + "zn = 2*10**-3 \t\t\t#K**-1\n", + "ap = 190*10**-6 \t\t\t#volt/C\n", + "rp = 1.8*10**-3 \t\t\t#ohm cm\n", + "zp = 1.7*10**-3 \t\t\t#K**-1\n", + "T = 200.+273 \t\t\t#K\n", + "Tc = 373. \t\t\t#K\n", + "Th = 573. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "Ktn = an**2/(rn*zn)\n", + "Ktp = ap**2/(rp*zp)\n", + "Z = (an-ap)**2 /(math.sqrt(rn*Ktn) + math.sqrt(rp*Ktp))**2\n", + "Ap = math.sqrt(Ktn*rp/Ktp/rn)\n", + "An = 1\n", + "K = Ktn*An+ Ktp*Ap\n", + "R = rn/An + rp/Ap\n", + "mopt = math.sqrt(1+ Z*T)\n", + "RL = mopt*R\n", + "nopt = (T-273)*(mopt-1)/(Th*(mopt+ Tc/Th))\n", + "nmax = T/(Th*(1+1- T/Th/2 + 4/Th/Z))\n", + "nmax = 0.0624\n", + "dT = T-273\n", + "Popt = (an-ap)**2 *dT**2 /((1+mopt)**2 *RL)\n", + "Pmax = (an-ap)**2 *dT**2 /((1+1)**2 *R)\n", + "\t\t\t\n", + "# Results\n", + "print \"Optimum efficiency = %.2f percent\"%(nopt*100)\n", + "print \" Max. efficiency = %.2f percent\"%(nmax*100)\n", + "print \" Optimum power = %.3f Watt\"%(Popt)\n", + "print \" Maximum power = %.3f Watt\"%(Pmax)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Optimum efficiency = 6.36 percent\n", + " Max. efficiency = 6.24 percent\n", + " Optimum power = 0.249 Watt\n", + " Maximum power = 0.478 Watt\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.3 pg : 399" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "phic = 2.5 \t\t\t#V\n", + "phia = 2. \t\t\t#V\n", + "phip = 0.1\t\t\t#V\n", + "Th = 2000. \t\t\t#K\n", + "Tc = 1000. \t\t\t#K\n", + "eff = 0.2\n", + "k = 1.38*10**-23\n", + "e = 1.6*10**-19\n", + "sigma = 5.67*10**-12\n", + "\t\t\t\n", + "# Calculations\n", + "V = phic-phia-phip\n", + "Jc = 1.2*10**6 *Th**2 *math.exp(-e*phic/(k*Th))\n", + "Ja = 1.2*10**6 *Tc**2 *math.exp(-e*phia/(k*Tc))\n", + "J = Jc\n", + "Qc1 = J*(phic + 2*k*Th/e) + eff*sigma*10**4 *(Th**4 - Tc**4)\n", + "eta1 = J*0.4/Qc1\n", + "eta2 = (Th-Tc)/Th\n", + "\t\t\t\n", + "# Results\n", + "print \"Efficiency of the device = %.1f percent\"%(eta1*100)\n", + "print \" Carnot efficiency = %d percent\"%(eta2*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency of the device = 13.7 percent\n", + " Carnot efficiency = 50 percent\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch14_1.ipynb b/Thermodynamics_by_J._P._Holman/ch14_1.ipynb new file mode 100755 index 00000000..b28135ae --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch14_1.ipynb @@ -0,0 +1,189 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:af8a4c7e1aee0095ba7f54013d97317f8251c73de6783cf6d6c6f47de9fd5e14" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 14 :\n", + "direct energy conversion" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.1 pg : 385" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 25.+273 \t\t\t#K\n", + "F = 23060.\n", + "\t\t\t\n", + "# Calculations\n", + "H = -68317.\n", + "G = -56690.\n", + "Er = -G/(2*F)\n", + "eta = G/H\n", + "W = -G\n", + "Q = H-G\n", + "\t\t\t\n", + "# Results\n", + "print \"Voltage output of the cell = %.3f volts\"%(Er)\n", + "print \" Efficiency = %d percent\"%(eta*100 +1)\n", + "print \" Electrical Work output = %d cal/mol H2\"%(W)\n", + "print \" Heat transfer to the surroundings = %d cal/mol H2\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Voltage output of the cell = 1.229 volts\n", + " Efficiency = 83 percent\n", + " Electrical Work output = 56690 cal/mol H2\n", + " Heat transfer to the surroundings = -11627 cal/mol H2\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.2 pg : 395" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "x1 = 0.75\n", + "x2 = 0.25\n", + "an = -190*10**-6 \t\t\t#volt/C\n", + "rn = 1.45*10**-3 \t\t\t#ohm cm\n", + "zn = 2*10**-3 \t\t\t#K**-1\n", + "ap = 190*10**-6 \t\t\t#volt/C\n", + "rp = 1.8*10**-3 \t\t\t#ohm cm\n", + "zp = 1.7*10**-3 \t\t\t#K**-1\n", + "T = 200.+273 \t\t\t#K\n", + "Tc = 373. \t\t\t#K\n", + "Th = 573. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "Ktn = an**2/(rn*zn)\n", + "Ktp = ap**2/(rp*zp)\n", + "Z = (an-ap)**2 /(math.sqrt(rn*Ktn) + math.sqrt(rp*Ktp))**2\n", + "Ap = math.sqrt(Ktn*rp/Ktp/rn)\n", + "An = 1\n", + "K = Ktn*An+ Ktp*Ap\n", + "R = rn/An + rp/Ap\n", + "mopt = math.sqrt(1+ Z*T)\n", + "RL = mopt*R\n", + "nopt = (T-273)*(mopt-1)/(Th*(mopt+ Tc/Th))\n", + "nmax = T/(Th*(1+1- T/Th/2 + 4/Th/Z))\n", + "nmax = 0.0624\n", + "dT = T-273\n", + "Popt = (an-ap)**2 *dT**2 /((1+mopt)**2 *RL)\n", + "Pmax = (an-ap)**2 *dT**2 /((1+1)**2 *R)\n", + "\t\t\t\n", + "# Results\n", + "print \"Optimum efficiency = %.2f percent\"%(nopt*100)\n", + "print \" Max. efficiency = %.2f percent\"%(nmax*100)\n", + "print \" Optimum power = %.3f Watt\"%(Popt)\n", + "print \" Maximum power = %.3f Watt\"%(Pmax)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Optimum efficiency = 6.36 percent\n", + " Max. efficiency = 6.24 percent\n", + " Optimum power = 0.249 Watt\n", + " Maximum power = 0.478 Watt\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.3 pg : 399" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "phic = 2.5 \t\t\t#V\n", + "phia = 2. \t\t\t#V\n", + "phip = 0.1\t\t\t#V\n", + "Th = 2000. \t\t\t#K\n", + "Tc = 1000. \t\t\t#K\n", + "eff = 0.2\n", + "k = 1.38*10**-23\n", + "e = 1.6*10**-19\n", + "sigma = 5.67*10**-12\n", + "\t\t\t\n", + "# Calculations\n", + "V = phic-phia-phip\n", + "Jc = 1.2*10**6 *Th**2 *math.exp(-e*phic/(k*Th))\n", + "Ja = 1.2*10**6 *Tc**2 *math.exp(-e*phia/(k*Tc))\n", + "J = Jc\n", + "Qc1 = J*(phic + 2*k*Th/e) + eff*sigma*10**4 *(Th**4 - Tc**4)\n", + "eta1 = J*0.4/Qc1\n", + "eta2 = (Th-Tc)/Th\n", + "\t\t\t\n", + "# Results\n", + "print \"Efficiency of the device = %.1f percent\"%(eta1*100)\n", + "print \" Carnot efficiency = %d percent\"%(eta2*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Efficiency of the device = 13.7 percent\n", + " Carnot efficiency = 50 percent\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch1_1.ipynb b/Thermodynamics_by_J._P._Holman/ch1_1.ipynb new file mode 100755 index 00000000..e80dd8df --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch1_1.ipynb @@ -0,0 +1,157 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:63e7a1dd37e633f9295c9d960c0e205303b570a077850a55f1a7161c70b32cb5" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1 : Introduction" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.1 pg : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "d = 8. \t\t\t#in\n", + "ir = 16. \t\t\t#in\n", + "MW = 28.97\n", + "T = 70.+460 \t\t\t#R\n", + "P = 30+14.7 \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "V = math.pi**2 *d**2 *(d+ir)/4\n", + "V = V*10./12**3\n", + "Rair = 1545/MW\n", + "m = P*144*V/(Rair*T)\n", + "\t\t\t\n", + "# Results\n", + "print \"Mass of air = %.2f lbm\"%(m)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of air = 4.99 lbm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.2 pg : 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V = 4. \t\t\t#in**3\n", + "P = 30. \t\t\t#psia\n", + "T = 500.\t\t\t#R\n", + "MW = 32.\n", + "\t\t\t\n", + "# Calculations\n", + "print (\"Metric unit conversion,\")\n", + "V = V*2.54**3 *10**-3\n", + "P = 30*4.448/(2.54**2 *10**-4)\n", + "T = 5*(T-32)/9 +273\n", + "n = P*V/(8314.5*T)\n", + "eta = n*1000\n", + "N = eta*6.025*10**23\n", + "m = eta*MW\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of molecules of oxygen = %.3e molecules\"%(N)\n", + "print \" Mass of molecules = %.1f g\"%(m)\n", + "\n", + "#The answer in the textbook is a bit different due to rounding off error\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Metric unit conversion,\n", + "No. of molecules of oxygen = 1.843e+24 molecules\n", + " Mass of molecules = 97.9 g\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.3 pg : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "P = 14.7 \t\t\t#psia\n", + "T = 70.+460 \t\t\t#R\n", + "M = 32.\n", + "\t\t\t\n", + "# Calculations\n", + "Ro = 1545/M\n", + "V2 = 3*Ro*T\n", + "V2 = V2*32.174\n", + "vrms = math.sqrt(V2)\n", + "\t\t\t\n", + "# Results\n", + "print \"rms velocity = %d ft/sec\"%(vrms)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "rms velocity = 1571 ft/sec\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch2.ipynb b/Thermodynamics_by_J._P._Holman/ch2.ipynb new file mode 100755 index 00000000..bfbcf6e6 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch2.ipynb @@ -0,0 +1,240 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:f1d828103bb270e68cac7fea789e3b42ea64320d86ed9fcc67d96c498216f06e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 2 : The first law of Thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.1 pg : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P1 = 200. \t\t\t#psia\n", + "P2 = 15. \t\t\t#psia\n", + "V1 = 1. \t\t\t#ft**3\n", + "g = 1.3\n", + "\t\t\t\n", + "# Calculations\n", + "V2 = V1*(P1/P2)**(1/g)\n", + "W = -(144*(P2*V2 - P1*V1)/(g-1))\n", + "\t\t\t\n", + "# Results\n", + "print \"Work done = %.2e ft. lbf\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = 4.32e+04 ft. lbf\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.2 pg : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "L = 0.305 \t\t\t#m\n", + "v = 4.58 \t\t\t#m/s\n", + "i = 10. \t\t\t#A\n", + "B = 1. \t\t\t#W/m**2\n", + "\t\t\t\n", + "# Calculations\n", + "F = i*B*L\n", + "W = F*v\n", + "\t\t\t\n", + "# Results\n", + "print \"Force necessary = %.2f N\"%(F)\n", + "print \" Work per unit time = %.2f W\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Force necessary = 3.05 N\n", + " Work per unit time = 13.97 W\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.3 pg : 45" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "U = 2545. \t\t\t#B/hr\n", + "m = 50. \t\t\t#lbm\n", + "cv = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "dT = U/(m*cv)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in temperature = %.1f F\"%(dT)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in temperature = 50.9 F\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.4 pg : 46" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P1 = 14.7 \t\t\t#psia\n", + "V1 = 1. \t\t\t#ft**3\n", + "P2 = 14.7 \t\t\t#psia\n", + "M = 28.97\n", + "T1 = 70.+460 \t\t\t#R\n", + "T2 = 500.+460 \t\t\t#R\n", + "cp = 0.24 \t\t\t#B/lbm F\n", + "\t\t\t\n", + "# Calculations\n", + "m = P1*144*V1*M/(1545*T1)\n", + "Qp = m*cp*(T2-T1)\n", + "V2 = V1*P1*T2/(P2*T1)\n", + "\n", + "W = P1*144*(V2-V1)\n", + "W = -W/778\n", + "dU = Qp+W\n", + "\t\t\t\n", + "# Results\n", + "print \"Work done = %.2f Btu\"%(W)\n", + "print \" Heat added = %.2f Btu\"%(Qp)\n", + "print \" Change in internal energy = %.2f Btu\"%(dU)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = -2.21 Btu\n", + " Heat added = 7.73 Btu\n", + " Change in internal energy = 5.52 Btu\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.5 pg : 47" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "l = 20. \n", + "b = 25.\n", + "h = 8.\n", + "Vp = 2.5\n", + "n = 20.\n", + "P = 14.7 \t\t\t#psia\n", + "T = 530. \t \t\t#R\n", + "t = 15. \t\t \t#min\n", + "Qp = 375. \t\t\t #B/hr\n", + "cv = 0.1715 \t\t\t#B/lbm F\n", + "\t\t\t\n", + "# Calculations\n", + "Vroom = l*b*h\n", + "Vair = Vroom-Vp*n\n", + "m = P*Vair*144/(53.35*T)\n", + "dU = n*Qp\n", + "U = t*dU/60\n", + "dT = U/(m*cv)\n", + "\t\t\t\n", + "# Results\n", + "print \"Air temperature rise = %d F\"%(dT+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Air temperature rise = 37 F\n" + ] + } + ], + "prompt_number": 6 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch2_1.ipynb b/Thermodynamics_by_J._P._Holman/ch2_1.ipynb new file mode 100755 index 00000000..bfbcf6e6 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch2_1.ipynb @@ -0,0 +1,240 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:f1d828103bb270e68cac7fea789e3b42ea64320d86ed9fcc67d96c498216f06e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 2 : The first law of Thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.1 pg : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P1 = 200. \t\t\t#psia\n", + "P2 = 15. \t\t\t#psia\n", + "V1 = 1. \t\t\t#ft**3\n", + "g = 1.3\n", + "\t\t\t\n", + "# Calculations\n", + "V2 = V1*(P1/P2)**(1/g)\n", + "W = -(144*(P2*V2 - P1*V1)/(g-1))\n", + "\t\t\t\n", + "# Results\n", + "print \"Work done = %.2e ft. lbf\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = 4.32e+04 ft. lbf\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.2 pg : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "L = 0.305 \t\t\t#m\n", + "v = 4.58 \t\t\t#m/s\n", + "i = 10. \t\t\t#A\n", + "B = 1. \t\t\t#W/m**2\n", + "\t\t\t\n", + "# Calculations\n", + "F = i*B*L\n", + "W = F*v\n", + "\t\t\t\n", + "# Results\n", + "print \"Force necessary = %.2f N\"%(F)\n", + "print \" Work per unit time = %.2f W\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Force necessary = 3.05 N\n", + " Work per unit time = 13.97 W\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.3 pg : 45" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "U = 2545. \t\t\t#B/hr\n", + "m = 50. \t\t\t#lbm\n", + "cv = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "dT = U/(m*cv)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in temperature = %.1f F\"%(dT)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in temperature = 50.9 F\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.4 pg : 46" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P1 = 14.7 \t\t\t#psia\n", + "V1 = 1. \t\t\t#ft**3\n", + "P2 = 14.7 \t\t\t#psia\n", + "M = 28.97\n", + "T1 = 70.+460 \t\t\t#R\n", + "T2 = 500.+460 \t\t\t#R\n", + "cp = 0.24 \t\t\t#B/lbm F\n", + "\t\t\t\n", + "# Calculations\n", + "m = P1*144*V1*M/(1545*T1)\n", + "Qp = m*cp*(T2-T1)\n", + "V2 = V1*P1*T2/(P2*T1)\n", + "\n", + "W = P1*144*(V2-V1)\n", + "W = -W/778\n", + "dU = Qp+W\n", + "\t\t\t\n", + "# Results\n", + "print \"Work done = %.2f Btu\"%(W)\n", + "print \" Heat added = %.2f Btu\"%(Qp)\n", + "print \" Change in internal energy = %.2f Btu\"%(dU)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = -2.21 Btu\n", + " Heat added = 7.73 Btu\n", + " Change in internal energy = 5.52 Btu\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.5 pg : 47" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "l = 20. \n", + "b = 25.\n", + "h = 8.\n", + "Vp = 2.5\n", + "n = 20.\n", + "P = 14.7 \t\t\t#psia\n", + "T = 530. \t \t\t#R\n", + "t = 15. \t\t \t#min\n", + "Qp = 375. \t\t\t #B/hr\n", + "cv = 0.1715 \t\t\t#B/lbm F\n", + "\t\t\t\n", + "# Calculations\n", + "Vroom = l*b*h\n", + "Vair = Vroom-Vp*n\n", + "m = P*Vair*144/(53.35*T)\n", + "dU = n*Qp\n", + "U = t*dU/60\n", + "dT = U/(m*cv)\n", + "\t\t\t\n", + "# Results\n", + "print \"Air temperature rise = %d F\"%(dT+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Air temperature rise = 37 F\n" + ] + } + ], + "prompt_number": 6 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch3.ipynb b/Thermodynamics_by_J._P._Holman/ch3.ipynb new file mode 100755 index 00000000..98e0dd2e --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch3.ipynb @@ -0,0 +1,305 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:b83edffd06279953e9d9c22648c2ce548f84e9427ec05c98afa676ab5960d29e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3 : Macroscopic properties of pure substances" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.1 pg : 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V = 1. \t\t\t#ft**3\n", + "m = 30. \t\t\t#lbm\n", + "\t\t\t\n", + "# Calculations\n", + "v = V/m\n", + "vf1 = 0.01665\n", + "vfg1 = 32.38 \t\t\t#ft**3/lbm\n", + "x1 = 0.000515\n", + "uf1 = 169.92\n", + "ufg1 = 904.8\n", + "u1 = uf1+x1*ufg1\n", + "vfg = 0.0216\n", + "vfg2 = 0.4240\n", + "v2 = v\n", + "x2 = 0.0277\n", + "uf2 = 538.4\n", + "ufg2 = 571.\n", + "u2 = uf2+x2*ufg2\n", + "Q = m*(u2-u1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Heat transfer = %d Btu\"%(round(Q,-2))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat transfer = 11500 Btu\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.2 pg : 59" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V2 = 2.5 \t\t\t#ft**3\n", + "V1 = 0.5 \t\t\t#ft**3\n", + "P = 100. \t\t\t#psia\n", + "x1 = 0.5\n", + "\t\t\t\n", + "# Calculations\n", + "W = -P*144*(V2-V1)\n", + "vf1 = 0.01774\n", + "vfg1 = 4.414\n", + "v1 = vf1+x1*vfg1\n", + "m = V1/v1\n", + "v2 = V2/m\n", + "uf1 = 298.08\n", + "ufg1 = 807.1\n", + "u1 = uf1+x1*ufg1\n", + "h2 = 1747.9\n", + "u2 = h2-P*144*v2/778\n", + "Q = m*(u2-u1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Amount of heat = %d Btu\"%(Q)\n", + "\t\t\t#The answer for u2 is given wrong in the textbook. Please use a calculator to find it\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Amount of heat = 188 Btu\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.3 pg : 60" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V1 = 1.735*10**-4 \t\t\t#ft**3\n", + "v1 = 0.016080 \t\t\t#ft**3/lbm\n", + "h1 = 70.61 \t\t \t #B/lbm\n", + "P1 = 100. \t\t \t#psia\n", + "V2 = 1. \t\t \t #ft**3\n", + "\t\t\t\n", + "# Calculations\n", + "u1 = h1-P1*v1*144/778.\n", + "m = V1/v1\n", + "v2 = V2/m\n", + "vf2 = 0.01613\n", + "vfg2 = 350.3\n", + "x2 = (v2-vf2)/vfg2\n", + "hf2 = 67.97\n", + "hfg2 = 1037.2\n", + "h2 = hf2+x2*hfg2\n", + "P2 = 0.9492\n", + "u2 = h2- P2*144*v2/778.\n", + "Q = m*(u2-u1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Enthalpy change = %.2f Btu\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enthalpy change = 2.76 Btu\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.4 pg : 64" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 20. \t\t\t#psia\n", + "V = 1. \t\t\t#ft**3\n", + "T = 560. \t\t\t#R\n", + "cv = 0.1715\n", + "Q = 10. \t\t\t#Btu\n", + "\t\t\t\n", + "# Calculations\n", + "m = P*144*V/(53.35*T)\n", + "T2 = Q/(m*cv) +T\n", + "P2 = m*53.35*T2/V\n", + "\t\t\t\n", + "# Results\n", + "print \"Fina pressure = %d lbf/ft**2\"%(P2)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Fina pressure = 5990 lbf/ft**2\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.5 pg : 66" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from scipy.integrate import quad\n", + "\t\t\t\n", + "# Variables\n", + "T1 = 560 \t\t\t#R\n", + "T2 = 3460 \t\t\t#R\n", + "m = 28.02 \t\t\t#lb\n", + "cv = 0.248\n", + "\t\t\t\n", + "# Calculations\n", + "def fun(T):\n", + " return 9.47 - 3.29*10**3 /T +1.07*10**6 /T**2\n", + "\n", + "Q1 = quad(fun,T1,T2)[0]\n", + "Q2 = m*cv*(T2-T1)\n", + "Error = (Q1-Q2)/Q1\n", + "\t\t\t\n", + "# Results\n", + "print \"Percentage error = %.1f percent\"%(Error*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percentage error = 12.7 percent\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.6 pg : 66" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "rate = 20. \t\t\t#gal/min\n", + "P1 = 20. \t\t\t#psia\n", + "P2 = 1000. \t\t\t#psia\n", + "T = 100.+460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "vf = 0.01613\n", + "dv = -5.2*10**-5 \t\t\t#ft**3/lbm\n", + "K = -dv/(vf*P2*144)\n", + "wt = K*vf*(P2**2 - P1**2)*144*144*10**4 /2\n", + "m = rate*8.33\n", + "Wt = wt*m\n", + "Wthp = Wt/33000\n", + "\t\t\t\n", + "# Results\n", + "print \"Pump power required = %d hp\"%(Wthp)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pump power required = 188 hp\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch3_1.ipynb b/Thermodynamics_by_J._P._Holman/ch3_1.ipynb new file mode 100755 index 00000000..98e0dd2e --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch3_1.ipynb @@ -0,0 +1,305 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:b83edffd06279953e9d9c22648c2ce548f84e9427ec05c98afa676ab5960d29e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3 : Macroscopic properties of pure substances" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.1 pg : 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V = 1. \t\t\t#ft**3\n", + "m = 30. \t\t\t#lbm\n", + "\t\t\t\n", + "# Calculations\n", + "v = V/m\n", + "vf1 = 0.01665\n", + "vfg1 = 32.38 \t\t\t#ft**3/lbm\n", + "x1 = 0.000515\n", + "uf1 = 169.92\n", + "ufg1 = 904.8\n", + "u1 = uf1+x1*ufg1\n", + "vfg = 0.0216\n", + "vfg2 = 0.4240\n", + "v2 = v\n", + "x2 = 0.0277\n", + "uf2 = 538.4\n", + "ufg2 = 571.\n", + "u2 = uf2+x2*ufg2\n", + "Q = m*(u2-u1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Heat transfer = %d Btu\"%(round(Q,-2))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat transfer = 11500 Btu\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.2 pg : 59" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V2 = 2.5 \t\t\t#ft**3\n", + "V1 = 0.5 \t\t\t#ft**3\n", + "P = 100. \t\t\t#psia\n", + "x1 = 0.5\n", + "\t\t\t\n", + "# Calculations\n", + "W = -P*144*(V2-V1)\n", + "vf1 = 0.01774\n", + "vfg1 = 4.414\n", + "v1 = vf1+x1*vfg1\n", + "m = V1/v1\n", + "v2 = V2/m\n", + "uf1 = 298.08\n", + "ufg1 = 807.1\n", + "u1 = uf1+x1*ufg1\n", + "h2 = 1747.9\n", + "u2 = h2-P*144*v2/778\n", + "Q = m*(u2-u1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Amount of heat = %d Btu\"%(Q)\n", + "\t\t\t#The answer for u2 is given wrong in the textbook. Please use a calculator to find it\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Amount of heat = 188 Btu\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.3 pg : 60" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "V1 = 1.735*10**-4 \t\t\t#ft**3\n", + "v1 = 0.016080 \t\t\t#ft**3/lbm\n", + "h1 = 70.61 \t\t \t #B/lbm\n", + "P1 = 100. \t\t \t#psia\n", + "V2 = 1. \t\t \t #ft**3\n", + "\t\t\t\n", + "# Calculations\n", + "u1 = h1-P1*v1*144/778.\n", + "m = V1/v1\n", + "v2 = V2/m\n", + "vf2 = 0.01613\n", + "vfg2 = 350.3\n", + "x2 = (v2-vf2)/vfg2\n", + "hf2 = 67.97\n", + "hfg2 = 1037.2\n", + "h2 = hf2+x2*hfg2\n", + "P2 = 0.9492\n", + "u2 = h2- P2*144*v2/778.\n", + "Q = m*(u2-u1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Enthalpy change = %.2f Btu\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enthalpy change = 2.76 Btu\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.4 pg : 64" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 20. \t\t\t#psia\n", + "V = 1. \t\t\t#ft**3\n", + "T = 560. \t\t\t#R\n", + "cv = 0.1715\n", + "Q = 10. \t\t\t#Btu\n", + "\t\t\t\n", + "# Calculations\n", + "m = P*144*V/(53.35*T)\n", + "T2 = Q/(m*cv) +T\n", + "P2 = m*53.35*T2/V\n", + "\t\t\t\n", + "# Results\n", + "print \"Fina pressure = %d lbf/ft**2\"%(P2)\n", + "\n", + "# note : rounding off error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Fina pressure = 5990 lbf/ft**2\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.5 pg : 66" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from scipy.integrate import quad\n", + "\t\t\t\n", + "# Variables\n", + "T1 = 560 \t\t\t#R\n", + "T2 = 3460 \t\t\t#R\n", + "m = 28.02 \t\t\t#lb\n", + "cv = 0.248\n", + "\t\t\t\n", + "# Calculations\n", + "def fun(T):\n", + " return 9.47 - 3.29*10**3 /T +1.07*10**6 /T**2\n", + "\n", + "Q1 = quad(fun,T1,T2)[0]\n", + "Q2 = m*cv*(T2-T1)\n", + "Error = (Q1-Q2)/Q1\n", + "\t\t\t\n", + "# Results\n", + "print \"Percentage error = %.1f percent\"%(Error*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percentage error = 12.7 percent\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.6 pg : 66" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "rate = 20. \t\t\t#gal/min\n", + "P1 = 20. \t\t\t#psia\n", + "P2 = 1000. \t\t\t#psia\n", + "T = 100.+460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "vf = 0.01613\n", + "dv = -5.2*10**-5 \t\t\t#ft**3/lbm\n", + "K = -dv/(vf*P2*144)\n", + "wt = K*vf*(P2**2 - P1**2)*144*144*10**4 /2\n", + "m = rate*8.33\n", + "Wt = wt*m\n", + "Wthp = Wt/33000\n", + "\t\t\t\n", + "# Results\n", + "print \"Pump power required = %d hp\"%(Wthp)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pump power required = 188 hp\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch4.ipynb b/Thermodynamics_by_J._P._Holman/ch4.ipynb new file mode 100755 index 00000000..2420bc0c --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch4.ipynb @@ -0,0 +1,307 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:694b356fc4f85fd8aa841dd0d02eae327738df2eb161cb913631664ccceb9a07" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4 : principles of energy analysis" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1 pg : 79" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 1.\n", + "he = 1148.8 \t\t\t#B/lbm\n", + "hi = 1357. \t\t\t#B/lbm\n", + "Ve = 100. \t\t\t#ft/sec\n", + "Vi = 800. \t\t\t#ft/sec\n", + "\t\t\t\n", + "# Calculations\n", + "dW = m*(he-hi) + m*(Ve**2 - Vi**2)/(2*32.2*778)\n", + "dWhr = dW*3600\n", + "hp = -dWhr/2545.\n", + "\t\t\t\n", + "# Results\n", + "print \"Horsepower output = %d hp\"%(hp+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Horsepower output = 313 hp\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2 pg:79" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "rate = 80. \t\t\t#lbm/min\n", + "T1 = 100. \t\t\t#F\n", + "P1 = 100. \t\t\t#psia\n", + "P2 = 1000. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "v = 0.01613 \t\t\t#ft**3/lbm\n", + "W = rate*(P2-P1)*144*v\n", + "\t\t\t\n", + "# Results\n", + "print \"Work done = %.2f ft-lbf/min\"%(round(W,-3))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = 167000.00 ft-lbf/min\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3 pg : 81" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "hi = 1279.1 \t\t\t#B/lbm\n", + "\t\t\t\n", + "# Calculations\n", + "u2 = hi\n", + "T2 = 564. \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print \"Temperature of steam = %d F\"%(T2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature of steam = 564 F\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4 pg : 82" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "P1 = 20. \t\t\t#psia\n", + "P2 = 100. \t\t\t#psia\n", + "V = 3. \t \t\t#ft**3\n", + "T = 560. \t\t\t#R\n", + "ma = 0.289\n", + "\t\t\t\n", + "# Calculations\n", + "ma = P1*V/(53.35*T)\n", + "Wa = -ma*53.35*T*math.log(P1/P2)\n", + "Qa = -Wa\n", + "Va2 = 3/5.\n", + "V2s = V-Va2\n", + "hi = 1279.1 \t\t\t#B/lbm\n", + "T2s = 536. \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print \"Final temperature = %d F\"%(T2s)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final temperature = 536 F\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5 pg : 87" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "# Variables\n", + "P1 = 200. \t\t\t#psia\n", + "P2 = 100. \t\t\t#psia\n", + "T1 = 300.+460 \t\t\t#R\n", + "g = 1.4\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = (T1)*(P2/P1)**((g-1)/g)\n", + "V2 = math.sqrt(2*32.2*778*cp*(T1-T2))\n", + "\t\t\t\n", + "# Results\n", + "print \"Final velocity = %d ft/sec\"%(V2)\n", + "\n", + "# check answer using calculator" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final velocity = 1281 ft/sec\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.6 pg : 88" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 500.+460 \t\t\t#R\n", + "P1 = 50. \t\t\t#psia\n", + "P2 = 15. \t\t\t#psia\n", + "g = 1.4\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "W = cp*(T2-T1) + (T1-460)**2 /(2*32.2*778)\n", + "\t\t\t\n", + "# Results\n", + "print \"Net work output from turbine = %.1f B/lbm\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Net work output from turbine = -62.1 B/lbm\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.7 pg : 91" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 150.+460 \t\t\t#R\n", + "T1 = 40.+460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "h2 = 43.850 \t\t\t#B/lbm\n", + "hf2 = 17.273\n", + "hfg2 = 64.163\n", + "x2 = (h2-hf2)/hfg2\n", + "\t\t\t\n", + "# Results\n", + "print \"Quality of freon vapor = %.3f\"%(x2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Quality of freon vapor = 0.414\n" + ] + } + ], + "prompt_number": 9 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch4_1.ipynb b/Thermodynamics_by_J._P._Holman/ch4_1.ipynb new file mode 100755 index 00000000..2420bc0c --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch4_1.ipynb @@ -0,0 +1,307 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:694b356fc4f85fd8aa841dd0d02eae327738df2eb161cb913631664ccceb9a07" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4 : principles of energy analysis" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1 pg : 79" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 1.\n", + "he = 1148.8 \t\t\t#B/lbm\n", + "hi = 1357. \t\t\t#B/lbm\n", + "Ve = 100. \t\t\t#ft/sec\n", + "Vi = 800. \t\t\t#ft/sec\n", + "\t\t\t\n", + "# Calculations\n", + "dW = m*(he-hi) + m*(Ve**2 - Vi**2)/(2*32.2*778)\n", + "dWhr = dW*3600\n", + "hp = -dWhr/2545.\n", + "\t\t\t\n", + "# Results\n", + "print \"Horsepower output = %d hp\"%(hp+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Horsepower output = 313 hp\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2 pg:79" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "rate = 80. \t\t\t#lbm/min\n", + "T1 = 100. \t\t\t#F\n", + "P1 = 100. \t\t\t#psia\n", + "P2 = 1000. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "v = 0.01613 \t\t\t#ft**3/lbm\n", + "W = rate*(P2-P1)*144*v\n", + "\t\t\t\n", + "# Results\n", + "print \"Work done = %.2f ft-lbf/min\"%(round(W,-3))\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = 167000.00 ft-lbf/min\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3 pg : 81" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "hi = 1279.1 \t\t\t#B/lbm\n", + "\t\t\t\n", + "# Calculations\n", + "u2 = hi\n", + "T2 = 564. \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print \"Temperature of steam = %d F\"%(T2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature of steam = 564 F\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4 pg : 82" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "P1 = 20. \t\t\t#psia\n", + "P2 = 100. \t\t\t#psia\n", + "V = 3. \t \t\t#ft**3\n", + "T = 560. \t\t\t#R\n", + "ma = 0.289\n", + "\t\t\t\n", + "# Calculations\n", + "ma = P1*V/(53.35*T)\n", + "Wa = -ma*53.35*T*math.log(P1/P2)\n", + "Qa = -Wa\n", + "Va2 = 3/5.\n", + "V2s = V-Va2\n", + "hi = 1279.1 \t\t\t#B/lbm\n", + "T2s = 536. \t\t\t#F\n", + "\t\t\t\n", + "# Results\n", + "print \"Final temperature = %d F\"%(T2s)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final temperature = 536 F\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5 pg : 87" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "# Variables\n", + "P1 = 200. \t\t\t#psia\n", + "P2 = 100. \t\t\t#psia\n", + "T1 = 300.+460 \t\t\t#R\n", + "g = 1.4\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = (T1)*(P2/P1)**((g-1)/g)\n", + "V2 = math.sqrt(2*32.2*778*cp*(T1-T2))\n", + "\t\t\t\n", + "# Results\n", + "print \"Final velocity = %d ft/sec\"%(V2)\n", + "\n", + "# check answer using calculator" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final velocity = 1281 ft/sec\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.6 pg : 88" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 500.+460 \t\t\t#R\n", + "P1 = 50. \t\t\t#psia\n", + "P2 = 15. \t\t\t#psia\n", + "g = 1.4\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((g-1)/g)\n", + "W = cp*(T2-T1) + (T1-460)**2 /(2*32.2*778)\n", + "\t\t\t\n", + "# Results\n", + "print \"Net work output from turbine = %.1f B/lbm\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Net work output from turbine = -62.1 B/lbm\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.7 pg : 91" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 150.+460 \t\t\t#R\n", + "T1 = 40.+460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "h2 = 43.850 \t\t\t#B/lbm\n", + "hf2 = 17.273\n", + "hfg2 = 64.163\n", + "x2 = (h2-hf2)/hfg2\n", + "\t\t\t\n", + "# Results\n", + "print \"Quality of freon vapor = %.3f\"%(x2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Quality of freon vapor = 0.414\n" + ] + } + ], + "prompt_number": 9 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch5.ipynb b/Thermodynamics_by_J._P._Holman/ch5.ipynb new file mode 100755 index 00000000..8df6c255 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch5.ipynb @@ -0,0 +1,207 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:427d2fadecfbb47aca45827faabee15c72f488581939d9b848cacc0b97c7f502" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5 : principles of statistical\n", + "thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.1 pg : 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import factorial\n", + "\t\t\t\n", + "# Variables\n", + "N1 = 1.\n", + "N2 = 1.\n", + "N3 = 3.\n", + "N4 = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "N = N1+N2+N3+N4\n", + "sig = factorial(N) /(factorial(N1) *factorial(N2)*factorial(N3)*factorial(N4))\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of ways of arranging = %d \"%(sig)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of ways of arranging = 120 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.2 pg : 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "N = 6.\n", + "g = 4.\n", + "\t\t\t\n", + "# Calculations\n", + "sig = factorial(g+N-1) /(factorial(g-1) *factorial(N))\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of ways of arranging = %d \"%(sig)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of ways of arranging = 84 \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.3 pg : 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import factorial\t\t\t\n", + "# Variables\n", + "N = 6.\n", + "g = 8.\n", + "\t\t\t\n", + "# Calculations\n", + "sig = factorial(g) /(factorial(N) *factorial(g-N))\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of ways = %d \"%(sig)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of ways = 28 \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.4 pg : 121" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%matplotlib inline\n", + "import math \n", + "from matplotlib.pyplot import bar\n", + "\n", + "# Variables\n", + "N0 = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "N1 = 3/math.e\n", + "N2 = 6/math.e**2\n", + "N3 = 10/math.e**3\n", + "N = N0+N1+N2+N3\n", + "ei = [0, 1, 2, 3]\n", + "\n", + "f0 = N0/N\n", + "f1 = N1/N\n", + "f2 = N2/N\n", + "f3 = N3/N\n", + "fi = [f0, f1, f2, f3]\n", + "\t\t\t\n", + "# Results\n", + "print \"fractional population of level 0 = %.3f\"%(f0)\n", + "print \" fractional population of level 1 = %.3f\"%(f1)\n", + "print \" fractional population of level 2 = %.3f\"%(f2)\n", + "print \" fractional population of level 3 = %.3f\"%(f3)\n", + "bar(ei,fi,0.1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "fractional population of level 0 = 0.293\n", + " fractional population of level 1 = 0.323\n", + " fractional population of level 2 = 0.238\n", + " fractional population of level 3 = 0.146\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 2, + "text": [ + "<Container object of 4 artists>" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "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\nIAAAAABJRU5ErkJggg==\n", + "text": [ + "<matplotlib.figure.Figure at 0x1085f7050>" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch5_1.ipynb b/Thermodynamics_by_J._P._Holman/ch5_1.ipynb new file mode 100755 index 00000000..eac11d77 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch5_1.ipynb @@ -0,0 +1,209 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:7515996c0789938329f86975cb5205356a100488f9513af4795fb2fe55a812d5" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5 : principles of statistical\n", + "thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.1 pg : 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import factorial\n", + "\t\t\t\n", + "# Variables\n", + "N1 = 1.\n", + "N2 = 1.\n", + "N3 = 3.\n", + "N4 = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "N = N1+N2+N3+N4\n", + "sig = factorial(N) /(factorial(N1) *factorial(N2)*factorial(N3)*factorial(N4))\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of ways of arranging = %d \"%(sig)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of ways of arranging = 120 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.2 pg : 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "N = 6.\n", + "g = 4.\n", + "\t\t\t\n", + "# Calculations\n", + "sig = factorial(g+N-1) /(factorial(g-1) *factorial(N))\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of ways of arranging = %d \"%(sig)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of ways of arranging = 84 \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.3 pg : 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import factorial\t\t\t\n", + "# Variables\n", + "N = 6.\n", + "g = 8.\n", + "\t\t\t\n", + "# Calculations\n", + "sig = factorial(g) /(factorial(N) *factorial(g-N))\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of ways = %d \"%(sig)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of ways = 28 \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.4 pg : 121" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%matplotlib inline\n", + "\n", + "\n", + "import math \n", + "from matplotlib.pyplot import bar\n", + "\n", + "# Variables\n", + "N0 = 1.\n", + "\t\t\t\n", + "# Calculations\n", + "N1 = 3/math.e\n", + "N2 = 6/math.e**2\n", + "N3 = 10/math.e**3\n", + "N = N0+N1+N2+N3\n", + "ei = [0, 1, 2, 3]\n", + "\n", + "f0 = N0/N\n", + "f1 = N1/N\n", + "f2 = N2/N\n", + "f3 = N3/N\n", + "fi = [f0, f1, f2, f3]\n", + "\t\t\t\n", + "# Results\n", + "print \"fractional population of level 0 = %.3f\"%(f0)\n", + "print \" fractional population of level 1 = %.3f\"%(f1)\n", + "print \" fractional population of level 2 = %.3f\"%(f2)\n", + "print \" fractional population of level 3 = %.3f\"%(f3)\n", + "bar(ei,fi,0.1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "fractional population of level 0 = 0.293\n", + " fractional population of level 1 = 0.323\n", + " fractional population of level 2 = 0.238\n", + " fractional population of level 3 = 0.146\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 1, + "text": [ + "<Container object of 4 artists>" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "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\nIAAAAABJRU5ErkJggg==\n", + "text": [ + "<matplotlib.figure.Figure at 0x103672c90>" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch6.ipynb b/Thermodynamics_by_J._P._Holman/ch6.ipynb new file mode 100755 index 00000000..489db493 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch6.ipynb @@ -0,0 +1,263 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:8b62be1f41dd311c1ab38e8f1f5050fc85b3e25eb123d081120fb3bbfeaaa74a" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6 :\n", + "The second law of\n", + "thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.1 pg : 140" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 5. \t \t \t#lbm\n", + "P = 50. \t \t\t#psia\n", + "T = 500. + 460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "s1 = 0.4110 \t\t\t#B/lbm R\n", + "s2 = 1.7887 \t\t\t#B/lbm R\n", + "dS = m*(s2-s1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy = %.3f B/R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy = 6.888 B/R\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.2 pg : 140" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 20. \t\t\t#psia\n", + "T = 227.96+ 459.69 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "sfg = 1.3962 \t\t\t#B/ R lbm\n", + "Q = T*sfg\n", + "\t\t\t\n", + "# Results\n", + "print \"heat transfer = %.1f B/lbm\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "heat transfer = 960.1 B/lbm\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.3 pg : 141" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\n", + "# Variables\n", + "T1 = 100.+460 \t\t\t#R\n", + "P1 = 15. \t\t\t#psia\n", + "P2 = 50. \t \t\t#psia\n", + "n = 1.3\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((n-1)/n)\n", + "dS = cp*math.log(T2/T1) - 53.35/778 *math.log(P2/P1) \n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy = %.3f B/lbm R\"%(dS)\n", + "\t\t\t#the answer given in textbook is wrong. Please check it using a calculator\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy = -0.016 B/lbm R\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.4 pg : 141" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\n", + "# Variables\n", + "T1 = 85.+460 \t\t\t#R\n", + "T2 = T1\n", + "cp = 0.24\n", + "P2 = 15. \t\t\t#psia\n", + "P1 = 30. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "dS = cp*math.log(T2/T1) - 53.35/778 *math.log(P2/P1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy = %.4f B/lbm R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy = 0.0475 B/lbm R\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.5 pg : 142" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Qh = -1000. \t\t\t#Btu\n", + "Ql = 1000. \t\t\t#Btu\n", + "Th = 1460. \t \t\t#R\n", + "Tl = 960. \t\t \t#R\n", + "\t\t\t\n", + "# Calculations\n", + "Sh = Qh/Th\n", + "Sl = Ql/Tl\n", + "S = Sh+Sl\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy of the universe = %.3f B/R\"%(S)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy of the universe = 0.357 B/R\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.6 pg : 143" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "h1 = 1416.4 \t\t\t#B/lbm\n", + "s1 = 1.6842 \t\t\t#B/lbm R\n", + "\t\t\t\n", + "# Calculations\n", + "s2 = s1\n", + "P2 = 50. \t\t\t#psia\n", + "T2 = 317.5 \t\t\t#F\n", + "h2 = 1193.7\n", + "W = h2-h1\n", + "\t\t\t\n", + "# Results\n", + "print \"Work calculated = %.1f B/lbm\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work calculated = -222.7 B/lbm\n" + ] + } + ], + "prompt_number": 7 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch6_1.ipynb b/Thermodynamics_by_J._P._Holman/ch6_1.ipynb new file mode 100755 index 00000000..489db493 --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch6_1.ipynb @@ -0,0 +1,263 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:8b62be1f41dd311c1ab38e8f1f5050fc85b3e25eb123d081120fb3bbfeaaa74a" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6 :\n", + "The second law of\n", + "thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.1 pg : 140" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 5. \t \t \t#lbm\n", + "P = 50. \t \t\t#psia\n", + "T = 500. + 460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "s1 = 0.4110 \t\t\t#B/lbm R\n", + "s2 = 1.7887 \t\t\t#B/lbm R\n", + "dS = m*(s2-s1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy = %.3f B/R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy = 6.888 B/R\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.2 pg : 140" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 20. \t\t\t#psia\n", + "T = 227.96+ 459.69 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "sfg = 1.3962 \t\t\t#B/ R lbm\n", + "Q = T*sfg\n", + "\t\t\t\n", + "# Results\n", + "print \"heat transfer = %.1f B/lbm\"%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "heat transfer = 960.1 B/lbm\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.3 pg : 141" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\n", + "# Variables\n", + "T1 = 100.+460 \t\t\t#R\n", + "P1 = 15. \t\t\t#psia\n", + "P2 = 50. \t \t\t#psia\n", + "n = 1.3\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "T2 = T1*(P2/P1)**((n-1)/n)\n", + "dS = cp*math.log(T2/T1) - 53.35/778 *math.log(P2/P1) \n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy = %.3f B/lbm R\"%(dS)\n", + "\t\t\t#the answer given in textbook is wrong. Please check it using a calculator\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy = -0.016 B/lbm R\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.4 pg : 141" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math \n", + "\t\t\t\n", + "# Variables\n", + "T1 = 85.+460 \t\t\t#R\n", + "T2 = T1\n", + "cp = 0.24\n", + "P2 = 15. \t\t\t#psia\n", + "P1 = 30. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "dS = cp*math.log(T2/T1) - 53.35/778 *math.log(P2/P1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy = %.4f B/lbm R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy = 0.0475 B/lbm R\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.5 pg : 142" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Qh = -1000. \t\t\t#Btu\n", + "Ql = 1000. \t\t\t#Btu\n", + "Th = 1460. \t \t\t#R\n", + "Tl = 960. \t\t \t#R\n", + "\t\t\t\n", + "# Calculations\n", + "Sh = Qh/Th\n", + "Sl = Ql/Tl\n", + "S = Sh+Sl\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in entropy of the universe = %.3f B/R\"%(S)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy of the universe = 0.357 B/R\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.6 pg : 143" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "h1 = 1416.4 \t\t\t#B/lbm\n", + "s1 = 1.6842 \t\t\t#B/lbm R\n", + "\t\t\t\n", + "# Calculations\n", + "s2 = s1\n", + "P2 = 50. \t\t\t#psia\n", + "T2 = 317.5 \t\t\t#F\n", + "h2 = 1193.7\n", + "W = h2-h1\n", + "\t\t\t\n", + "# Results\n", + "print \"Work calculated = %.1f B/lbm\"%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work calculated = -222.7 B/lbm\n" + ] + } + ], + "prompt_number": 7 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch7.ipynb b/Thermodynamics_by_J._P._Holman/ch7.ipynb new file mode 100755 index 00000000..906a386e --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch7.ipynb @@ -0,0 +1,373 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:718f559da4ae2a13e9c934b6162f71a824de61441f47a14a1f58cca792ea40ff" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 7 :\n", + "equations of state and general\n", + "thermodynamic relations" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.1 pg : 158" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 1160. \t\t\t#R\n", + "h1 = 281.14 \t\t\t#B/lbm\n", + "Pr1 = 21.18 \n", + "P2 = 30. \t\t\t#psia\n", + "P1 = 100. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "Pr2 = Pr1*P2/P1\n", + "T2 = 833. \t\t\t#R\n", + "h2 = 199.45 \t\t\t#B/lbm\n", + "dh = h2-h1\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in enthalpy = %.2f B/lbm\"%(dh)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in enthalpy = -81.69 B/lbm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.2 pg : 159" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "# Variables\n", + "T2 = 860. \t\t\t#R\n", + "phi1 = 0.78767\n", + "phi2 = 0.71323\n", + "P2 = 30. \t\t\t#psia\n", + "P1 = 100. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "dS = phi2-phi1- 53.35/778 *math.log(P2/P1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Net change of entropy = %.5f B/lbm R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Net change of entropy = 0.00812 B/lbm R\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.3 pg : 159" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 540. \t\t\t#R\n", + "T2 = 960. \t\t\t#R\n", + "h2 = 231.06 \t\t\t#B/lbm\n", + "h1 = 129.06 \t\t\t#B/lbm\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "W = h2-h1\n", + "dh = cp*(T2-T1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in enthalpy = %.1f B/lbm\"%(dh)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in enthalpy = 100.8 B/lbm\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.4 pg : 161" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\t\t\t\n", + "# Variables\n", + "T1 = 420. \t\t\t#R\n", + "T2 = 380. \t\t\t#R\n", + "hig = 1221.2\n", + "P1 = 0.0019\n", + "\t\t\t\n", + "# Calculations\n", + "lnp = hig*778*(1/T1 - 1/T2)/85.6\n", + "pra = math.exp(lnp)\n", + "P2 = pra*P1\n", + "\t\t\t\n", + "# Results\n", + "print \"Final pressure = %.3e psia\"%(P2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final pressure = 1.177e-04 psia\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.5 pg : 170" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "pc = 482.\t\t\t#psia\n", + "Tc = 227. \t\t\t#R\n", + "vc = 1.44 \t\t\t#ft**3/lbm mol\n", + "P = 600. \t\t\t#psia\n", + "T = 310. \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "Pr = P/pc\n", + "Tr = T/Tc\n", + "Z = 0.83\n", + "v = Z*55.12*T/(P*144)\n", + "rho = 1/v\n", + "\t\t\t\n", + "# Results\n", + "print \"Density = %.1f lbm/ft**3\"%(rho)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Density = 6.1 lbm/ft**3\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.6 pg : 174" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = -150.+460 \t\t\t#R\n", + "v = 0.6 \t\t \t#ft**3/lbm\n", + "vc = 1.44\n", + "Tc = 227. \t \t\t#R\n", + "Pc = 482. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "vr = v/vc\n", + "Tr = T/Tc\n", + "Pr = 1.75\n", + "P = Pr*Pc\n", + "\t\t\t\n", + "# Results\n", + "print \"Final pressure = %d psia\"%(P)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final pressure = 843 psia\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.7 pg : 177" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Tc = 344. \t\t\t#R\n", + "Pc = 673. \t\t\t#psia\n", + "P1 = 20. \t\t\t#psia\n", + "P2 = 500. \t\t\t#psia\n", + "M = 16.\n", + "T = 560. \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "pr1 = P1/Pc\n", + "pr2 = P2/Pc\n", + "Tr = T/Tc\n", + "dh2 = 0.65*Tc\n", + "dsp = 0.35 \t\t\t#B/lbm mol R\n", + "dsp2 = 0.018-dsp- 1545/778 *math.log(P2/P1)\n", + "W = dh2-dsp2*T\n", + "W2 = W/M\n", + "\t\t\t\n", + "# Results\n", + "print \"Work per pound mass = %d B/lbm\"%(W2)\n", + "\n", + "#The answer is a bit different due to rounding off error. check using calculator.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work per pound mass = 138 B/lbm\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.8 pg : 179" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 1000. \t \t\t#psia\n", + "T1 = 100. + 460 \t\t\t#R\n", + "T2 = 800. + 460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "pc = 1070. \t\t\t#psia\n", + "Tc = 548. \t\t\t#R\n", + "pr1 = P/pc\n", + "Tr1 = T1/Tc\n", + "Tr2 = T2/Tc\n", + "M = 44.\n", + "h1 = 4235.8 \t\t\t#B/lbm mol\n", + "h2 = 11661 \t\t\t#B/lbm mol\n", + "h2bar = 3.5 \t\t\t#B/lbm mol\n", + "h1bar = 0.48 \t\t\t#B/lbm mol\n", + "dhbar = Tc*(h2bar-h1bar) + h2-h1\n", + "Q = dhbar/M\n", + "cp = 0.202 \t\t\t#B/lbm F\n", + "Q2 = cp*(T2-T1)\n", + "Error = (Q-Q2)/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Error in calculation = %d percent\"%(Error*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Error in calculation = 31 percent\n" + ] + } + ], + "prompt_number": 9 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch7_1.ipynb b/Thermodynamics_by_J._P._Holman/ch7_1.ipynb new file mode 100755 index 00000000..906a386e --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch7_1.ipynb @@ -0,0 +1,373 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:718f559da4ae2a13e9c934b6162f71a824de61441f47a14a1f58cca792ea40ff" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 7 :\n", + "equations of state and general\n", + "thermodynamic relations" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.1 pg : 158" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 1160. \t\t\t#R\n", + "h1 = 281.14 \t\t\t#B/lbm\n", + "Pr1 = 21.18 \n", + "P2 = 30. \t\t\t#psia\n", + "P1 = 100. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "Pr2 = Pr1*P2/P1\n", + "T2 = 833. \t\t\t#R\n", + "h2 = 199.45 \t\t\t#B/lbm\n", + "dh = h2-h1\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in enthalpy = %.2f B/lbm\"%(dh)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in enthalpy = -81.69 B/lbm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.2 pg : 159" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "# Variables\n", + "T2 = 860. \t\t\t#R\n", + "phi1 = 0.78767\n", + "phi2 = 0.71323\n", + "P2 = 30. \t\t\t#psia\n", + "P1 = 100. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "dS = phi2-phi1- 53.35/778 *math.log(P2/P1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Net change of entropy = %.5f B/lbm R\"%(dS)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Net change of entropy = 0.00812 B/lbm R\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.3 pg : 159" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T1 = 540. \t\t\t#R\n", + "T2 = 960. \t\t\t#R\n", + "h2 = 231.06 \t\t\t#B/lbm\n", + "h1 = 129.06 \t\t\t#B/lbm\n", + "cp = 0.24\n", + "\t\t\t\n", + "# Calculations\n", + "W = h2-h1\n", + "dh = cp*(T2-T1)\n", + "\t\t\t\n", + "# Results\n", + "print \"Change in enthalpy = %.1f B/lbm\"%(dh)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in enthalpy = 100.8 B/lbm\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.4 pg : 161" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\t\t\t\n", + "# Variables\n", + "T1 = 420. \t\t\t#R\n", + "T2 = 380. \t\t\t#R\n", + "hig = 1221.2\n", + "P1 = 0.0019\n", + "\t\t\t\n", + "# Calculations\n", + "lnp = hig*778*(1/T1 - 1/T2)/85.6\n", + "pra = math.exp(lnp)\n", + "P2 = pra*P1\n", + "\t\t\t\n", + "# Results\n", + "print \"Final pressure = %.3e psia\"%(P2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final pressure = 1.177e-04 psia\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.5 pg : 170" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "pc = 482.\t\t\t#psia\n", + "Tc = 227. \t\t\t#R\n", + "vc = 1.44 \t\t\t#ft**3/lbm mol\n", + "P = 600. \t\t\t#psia\n", + "T = 310. \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "Pr = P/pc\n", + "Tr = T/Tc\n", + "Z = 0.83\n", + "v = Z*55.12*T/(P*144)\n", + "rho = 1/v\n", + "\t\t\t\n", + "# Results\n", + "print \"Density = %.1f lbm/ft**3\"%(rho)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Density = 6.1 lbm/ft**3\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.6 pg : 174" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = -150.+460 \t\t\t#R\n", + "v = 0.6 \t\t \t#ft**3/lbm\n", + "vc = 1.44\n", + "Tc = 227. \t \t\t#R\n", + "Pc = 482. \t\t\t#psia\n", + "\t\t\t\n", + "# Calculations\n", + "vr = v/vc\n", + "Tr = T/Tc\n", + "Pr = 1.75\n", + "P = Pr*Pc\n", + "\t\t\t\n", + "# Results\n", + "print \"Final pressure = %d psia\"%(P)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final pressure = 843 psia\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.7 pg : 177" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "Tc = 344. \t\t\t#R\n", + "Pc = 673. \t\t\t#psia\n", + "P1 = 20. \t\t\t#psia\n", + "P2 = 500. \t\t\t#psia\n", + "M = 16.\n", + "T = 560. \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "pr1 = P1/Pc\n", + "pr2 = P2/Pc\n", + "Tr = T/Tc\n", + "dh2 = 0.65*Tc\n", + "dsp = 0.35 \t\t\t#B/lbm mol R\n", + "dsp2 = 0.018-dsp- 1545/778 *math.log(P2/P1)\n", + "W = dh2-dsp2*T\n", + "W2 = W/M\n", + "\t\t\t\n", + "# Results\n", + "print \"Work per pound mass = %d B/lbm\"%(W2)\n", + "\n", + "#The answer is a bit different due to rounding off error. check using calculator.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work per pound mass = 138 B/lbm\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.8 pg : 179" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 1000. \t \t\t#psia\n", + "T1 = 100. + 460 \t\t\t#R\n", + "T2 = 800. + 460 \t\t\t#R\n", + "\t\t\t\n", + "# Calculations\n", + "pc = 1070. \t\t\t#psia\n", + "Tc = 548. \t\t\t#R\n", + "pr1 = P/pc\n", + "Tr1 = T1/Tc\n", + "Tr2 = T2/Tc\n", + "M = 44.\n", + "h1 = 4235.8 \t\t\t#B/lbm mol\n", + "h2 = 11661 \t\t\t#B/lbm mol\n", + "h2bar = 3.5 \t\t\t#B/lbm mol\n", + "h1bar = 0.48 \t\t\t#B/lbm mol\n", + "dhbar = Tc*(h2bar-h1bar) + h2-h1\n", + "Q = dhbar/M\n", + "cp = 0.202 \t\t\t#B/lbm F\n", + "Q2 = cp*(T2-T1)\n", + "Error = (Q-Q2)/Q\n", + "\t\t\t\n", + "# Results\n", + "print \"Error in calculation = %d percent\"%(Error*100)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Error in calculation = 31 percent\n" + ] + } + ], + "prompt_number": 9 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch8.ipynb b/Thermodynamics_by_J._P._Holman/ch8.ipynb new file mode 100755 index 00000000..34ac501d --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch8.ipynb @@ -0,0 +1,300 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:79ebced3b14c5bbd0f1f1f599d71ac5841752e19c3ef6de2a5a4223855b1a785" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 8 :\n", + "applications of statistical\n", + "thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.1 pg : 202" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 70. \t\t\t#K\n", + "Tr = 85.5 \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "cvrot = 1.1\n", + "cvtra = 1.5\n", + "cv = cvtra+cvrot\n", + "\t\t\t\n", + "# Results\n", + "print \"Cv total = %.1f R\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cv total = 2.6 R\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.2 pg : 202" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 2000. \t\t\t#K\n", + "Tr = 3340. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "print (\"From fig 8.2\")\n", + "cvrot = 0.85\n", + "cvtra = 1.5\n", + "cvvib = 1.\n", + "cv = cvtra+cvrot+cvvib\n", + "\t\t\t\n", + "# Results\n", + "print \"Cv total = %.2f R\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From fig 8.2\n", + "Cv total = 3.35 R\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3 pg : 208" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 200. \t\t\t#K\n", + "the = 398. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "ratio = T/the\n", + "cv = 4.9\n", + "\t\t\t\n", + "# Results\n", + "print \"Specific heat of aluminium = %.1f cal/g mol K\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Specific heat of aluminium = 4.9 cal/g mol K\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.4 pg : 208" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 10. \t\t\t#K\n", + "td = 315. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "cv = 464.4 *(T/td)**3\n", + "\t\t\t\n", + "# Results\n", + "print \"specific heat of copper = %.5f cal/g mol K\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "specific heat of copper = 0.01486 cal/g mol K\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5 pg : 213" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "N0 = 6.025*10**23\n", + "M = 63.57 \n", + "d = 8.94 \t\t\t#g/cc\n", + "h = 6.624*10**-27\n", + "me = 9.1*10**-28\n", + "\t\t\t\n", + "# Calculations\n", + "NbyV = N0*d/M\n", + "mu0 = h**2 *(3*NbyV/ math.pi)**(2./3) /(8*me)\n", + "e0 = 0.6*mu0*10**-7\n", + "Teq = 2*e0/(3*1.38*10**-23)\n", + "\t\t\t\n", + "# Results\n", + "print \"Equivalent temperature = %d K\"%(Teq)\n", + "\n", + "# check using calculator" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equivalent temperature = 32681 K\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.6 pg : 214" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "T = 300. \t\t\t#K\n", + "mu = 1.13*10**-18\n", + "k = 1.38*10**-23\n", + "\t\t\t\n", + "# Calculations\n", + "cv = math.pi**2 *k*T/(2*mu)\n", + "\t\t\t\n", + "# Results\n", + "print \"Electron contribution = %.4f R\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Electron contribution = 0.0181 R\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.7 pg : 223" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "sig = 5.668*10**-5\n", + "T1 = 1000. \t\t\t#K\n", + "T2 = 2000. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "Eb1 = sig*T1**4 *10**-7\n", + "Eb2 = sig*T2**4 *10**-7\n", + "\t\t\t\n", + "# Results\n", + "print \"total energy emitted in case 1 = %.3f Watts/cm**2\"%(Eb1)\n", + "print \" total energy emitted in case 2 = %.3f Watts/cm**2\"%(Eb2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "total energy emitted in case 1 = 5.668 Watts/cm**2\n", + " total energy emitted in case 2 = 90.688 Watts/cm**2\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch8_1.ipynb b/Thermodynamics_by_J._P._Holman/ch8_1.ipynb new file mode 100755 index 00000000..34ac501d --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch8_1.ipynb @@ -0,0 +1,300 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:79ebced3b14c5bbd0f1f1f599d71ac5841752e19c3ef6de2a5a4223855b1a785" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 8 :\n", + "applications of statistical\n", + "thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.1 pg : 202" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 70. \t\t\t#K\n", + "Tr = 85.5 \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "cvrot = 1.1\n", + "cvtra = 1.5\n", + "cv = cvtra+cvrot\n", + "\t\t\t\n", + "# Results\n", + "print \"Cv total = %.1f R\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cv total = 2.6 R\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.2 pg : 202" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 2000. \t\t\t#K\n", + "Tr = 3340. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "print (\"From fig 8.2\")\n", + "cvrot = 0.85\n", + "cvtra = 1.5\n", + "cvvib = 1.\n", + "cv = cvtra+cvrot+cvvib\n", + "\t\t\t\n", + "# Results\n", + "print \"Cv total = %.2f R\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From fig 8.2\n", + "Cv total = 3.35 R\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3 pg : 208" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 200. \t\t\t#K\n", + "the = 398. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "ratio = T/the\n", + "cv = 4.9\n", + "\t\t\t\n", + "# Results\n", + "print \"Specific heat of aluminium = %.1f cal/g mol K\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Specific heat of aluminium = 4.9 cal/g mol K\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.4 pg : 208" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "T = 10. \t\t\t#K\n", + "td = 315. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "cv = 464.4 *(T/td)**3\n", + "\t\t\t\n", + "# Results\n", + "print \"specific heat of copper = %.5f cal/g mol K\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "specific heat of copper = 0.01486 cal/g mol K\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5 pg : 213" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "N0 = 6.025*10**23\n", + "M = 63.57 \n", + "d = 8.94 \t\t\t#g/cc\n", + "h = 6.624*10**-27\n", + "me = 9.1*10**-28\n", + "\t\t\t\n", + "# Calculations\n", + "NbyV = N0*d/M\n", + "mu0 = h**2 *(3*NbyV/ math.pi)**(2./3) /(8*me)\n", + "e0 = 0.6*mu0*10**-7\n", + "Teq = 2*e0/(3*1.38*10**-23)\n", + "\t\t\t\n", + "# Results\n", + "print \"Equivalent temperature = %d K\"%(Teq)\n", + "\n", + "# check using calculator" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equivalent temperature = 32681 K\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.6 pg : 214" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "T = 300. \t\t\t#K\n", + "mu = 1.13*10**-18\n", + "k = 1.38*10**-23\n", + "\t\t\t\n", + "# Calculations\n", + "cv = math.pi**2 *k*T/(2*mu)\n", + "\t\t\t\n", + "# Results\n", + "print \"Electron contribution = %.4f R\"%(cv)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Electron contribution = 0.0181 R\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.7 pg : 223" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "sig = 5.668*10**-5\n", + "T1 = 1000. \t\t\t#K\n", + "T2 = 2000. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "Eb1 = sig*T1**4 *10**-7\n", + "Eb2 = sig*T2**4 *10**-7\n", + "\t\t\t\n", + "# Results\n", + "print \"total energy emitted in case 1 = %.3f Watts/cm**2\"%(Eb1)\n", + "print \" total energy emitted in case 2 = %.3f Watts/cm**2\"%(Eb2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "total energy emitted in case 1 = 5.668 Watts/cm**2\n", + " total energy emitted in case 2 = 90.688 Watts/cm**2\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch9.ipynb b/Thermodynamics_by_J._P._Holman/ch9.ipynb new file mode 100755 index 00000000..838e6d3d --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch9.ipynb @@ -0,0 +1,275 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:d5accb40ab200594c5bee653d2ffb7fee1e29e674b04c22a54296f7e8cb68080" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 9 : Kinetic theory and transport\n", + "phenomena" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.1 pg : 232" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "N0 = 6.025*10**26\n", + "M = 32.\n", + "k = 1.38*10**-23\n", + "T = 300. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "m = M/N0\n", + "vavg = math.sqrt(8*k*T/(math.pi*m))\n", + "vrms = math.sqrt(3*k*T/m)\n", + "vm = math.sqrt(2*k*T/m)\n", + "\t\t\t\n", + "# Results\n", + "print \"Average velocity = %d m/sec\"%(vavg)\n", + "print \" RMS velocity = %d m/sec\"%(vrms)\n", + "print \" Most probable velocity = %.f m/sec\"%(vm)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Average velocity = 445 m/sec\n", + " RMS velocity = 483 m/sec\n", + " Most probable velocity = 395 m/sec\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.2 pg : 233" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "T = 300. \t\t\t#K\n", + "dv = 0.02\n", + "vm = 395. \t\t\t#m/s\n", + "m = 5.32*10**-26 \t\t\t#kg\n", + "k = 1.38*10**-23\n", + "vrms = 483. \t\t\t#m/s\n", + "\t\t\t\n", + "# Calculations\n", + "N1 = math.sqrt(2/math.pi) *(m/(k*T))**(3./2) *vm**2 *math.exp(-1) *dv*vm\n", + "N2 = math.sqrt(2/math.pi) *(m/(k*T))**(3./2) *vrms**2 *math.exp(-3/2) *dv*vrms\n", + "\t\t\t\n", + "# Results\n", + "print \"Fraction of oxygen molecules at v most probable speed = %.4f \"%(N1)\n", + "print \" Fraction of oxygen molecules at v rms speed = %.4f \"%(N2)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Fraction of oxygen molecules at v most probable speed = 0.0167 \n", + " Fraction of oxygen molecules at v rms speed = 0.0112 \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.3 pg : 236" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "p = 1.013*10**5 \t\t\t#N/m**2\n", + "k = 1.38*10**-23\n", + "T = 300. \t \t\t#K\n", + "v = 445. \t \t \t#m/s\n", + "A = 0.001*10**-6 \t\t\t#m**2\n", + "\t\t\t\n", + "# Calculations\n", + "n = p/(k*T)\n", + "J = n*v/4\n", + "escaping = J*A\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of molecules escaping per unit time = %.2e mol/sec\"%(escaping)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of molecules escaping per unit time = 2.72e+18 mol/sec\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.4 pg : 239" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "d = 3.5*10**-10 \t\t\t#m\n", + "n = 2.45*10**25\n", + "\t\t\t\n", + "# Calculations\n", + "sig = math.pi*d**2\n", + "lambda_ = 1./(math.sqrt(2) *sig*n) \n", + "frac = math.exp(-2)\n", + "\t\t\t\n", + "# Results\n", + "print \"Mean free path = %.2e m\"%(lambda_)\n", + "print \" fraction of molecules = %.3f\"%(frac)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mean free path = 7.50e-08 m\n", + " fraction of molecules = 0.135\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.5 pg : 244" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 1. \t \t\t#atm\n", + "T = 300. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "cv = 4.97\n", + "vavg = 1580. \t\t\t#ft/s\n", + "sig = 4.13*10**-18 \t\t\t#ft**2\n", + "N0 = 6.025*10**26 *0.4536\n", + "K = vavg*3600.*cv/(3*N0*sig)\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal conductivity = %.2e B/hr ft F\"%(K)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal conductivity = 8.35e-03 B/hr ft F\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.6 pg : 245" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 5.32*10**-26 \t\t\t#kg\n", + "v = 445. \t \t\t#m/s\n", + "sigma = 3.84*10**-19 \t\t\t#m**2\n", + "\t\t\t\n", + "# Calculations\n", + "mu = m*v/(3*sigma)\n", + "\t\t\t\n", + "# Results\n", + "print \"Dynamic viscosity of oxygen = %.2e newton sec/m**2\"%(mu)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Dynamic viscosity of oxygen = 2.06e-05 newton sec/m**2\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_J._P._Holman/ch9_1.ipynb b/Thermodynamics_by_J._P._Holman/ch9_1.ipynb new file mode 100755 index 00000000..838e6d3d --- /dev/null +++ b/Thermodynamics_by_J._P._Holman/ch9_1.ipynb @@ -0,0 +1,275 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:d5accb40ab200594c5bee653d2ffb7fee1e29e674b04c22a54296f7e8cb68080" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 9 : Kinetic theory and transport\n", + "phenomena" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.1 pg : 232" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "N0 = 6.025*10**26\n", + "M = 32.\n", + "k = 1.38*10**-23\n", + "T = 300. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "m = M/N0\n", + "vavg = math.sqrt(8*k*T/(math.pi*m))\n", + "vrms = math.sqrt(3*k*T/m)\n", + "vm = math.sqrt(2*k*T/m)\n", + "\t\t\t\n", + "# Results\n", + "print \"Average velocity = %d m/sec\"%(vavg)\n", + "print \" RMS velocity = %d m/sec\"%(vrms)\n", + "print \" Most probable velocity = %.f m/sec\"%(vm)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Average velocity = 445 m/sec\n", + " RMS velocity = 483 m/sec\n", + " Most probable velocity = 395 m/sec\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.2 pg : 233" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "T = 300. \t\t\t#K\n", + "dv = 0.02\n", + "vm = 395. \t\t\t#m/s\n", + "m = 5.32*10**-26 \t\t\t#kg\n", + "k = 1.38*10**-23\n", + "vrms = 483. \t\t\t#m/s\n", + "\t\t\t\n", + "# Calculations\n", + "N1 = math.sqrt(2/math.pi) *(m/(k*T))**(3./2) *vm**2 *math.exp(-1) *dv*vm\n", + "N2 = math.sqrt(2/math.pi) *(m/(k*T))**(3./2) *vrms**2 *math.exp(-3/2) *dv*vrms\n", + "\t\t\t\n", + "# Results\n", + "print \"Fraction of oxygen molecules at v most probable speed = %.4f \"%(N1)\n", + "print \" Fraction of oxygen molecules at v rms speed = %.4f \"%(N2)\n", + "\n", + "# rounding off error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Fraction of oxygen molecules at v most probable speed = 0.0167 \n", + " Fraction of oxygen molecules at v rms speed = 0.0112 \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.3 pg : 236" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "p = 1.013*10**5 \t\t\t#N/m**2\n", + "k = 1.38*10**-23\n", + "T = 300. \t \t\t#K\n", + "v = 445. \t \t \t#m/s\n", + "A = 0.001*10**-6 \t\t\t#m**2\n", + "\t\t\t\n", + "# Calculations\n", + "n = p/(k*T)\n", + "J = n*v/4\n", + "escaping = J*A\n", + "\t\t\t\n", + "# Results\n", + "print \"No. of molecules escaping per unit time = %.2e mol/sec\"%(escaping)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No. of molecules escaping per unit time = 2.72e+18 mol/sec\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.4 pg : 239" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "import math \n", + "d = 3.5*10**-10 \t\t\t#m\n", + "n = 2.45*10**25\n", + "\t\t\t\n", + "# Calculations\n", + "sig = math.pi*d**2\n", + "lambda_ = 1./(math.sqrt(2) *sig*n) \n", + "frac = math.exp(-2)\n", + "\t\t\t\n", + "# Results\n", + "print \"Mean free path = %.2e m\"%(lambda_)\n", + "print \" fraction of molecules = %.3f\"%(frac)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mean free path = 7.50e-08 m\n", + " fraction of molecules = 0.135\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.5 pg : 244" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "P = 1. \t \t\t#atm\n", + "T = 300. \t\t\t#K\n", + "\t\t\t\n", + "# Calculations\n", + "cv = 4.97\n", + "vavg = 1580. \t\t\t#ft/s\n", + "sig = 4.13*10**-18 \t\t\t#ft**2\n", + "N0 = 6.025*10**26 *0.4536\n", + "K = vavg*3600.*cv/(3*N0*sig)\n", + "\t\t\t\n", + "# Results\n", + "print \"Thermal conductivity = %.2e B/hr ft F\"%(K)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal conductivity = 8.35e-03 B/hr ft F\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.6 pg : 245" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\t\t\t\n", + "# Variables\n", + "m = 5.32*10**-26 \t\t\t#kg\n", + "v = 445. \t \t\t#m/s\n", + "sigma = 3.84*10**-19 \t\t\t#m**2\n", + "\t\t\t\n", + "# Calculations\n", + "mu = m*v/(3*sigma)\n", + "\t\t\t\n", + "# Results\n", + "print \"Dynamic viscosity of oxygen = %.2e newton sec/m**2\"%(mu)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Dynamic viscosity of oxygen = 2.06e-05 newton sec/m**2\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |