diff options
author | hardythe1 | 2015-06-03 15:27:17 +0530 |
---|---|---|
committer | hardythe1 | 2015-06-03 15:27:17 +0530 |
commit | df60071cf1d1c18822d34f943ab8f412a8946b69 (patch) | |
tree | ab059cf19bad4a1233a464ccf5d72cf8b3fb323c /Elements_of_Thermodynamics_and_heat_transfer/Chapter_7.ipynb | |
parent | fba055ce5aa0955e22bac2413c33493b10ae6532 (diff) | |
download | Python-Textbook-Companions-df60071cf1d1c18822d34f943ab8f412a8946b69.tar.gz Python-Textbook-Companions-df60071cf1d1c18822d34f943ab8f412a8946b69.tar.bz2 Python-Textbook-Companions-df60071cf1d1c18822d34f943ab8f412a8946b69.zip |
add books
Diffstat (limited to 'Elements_of_Thermodynamics_and_heat_transfer/Chapter_7.ipynb')
-rwxr-xr-x | Elements_of_Thermodynamics_and_heat_transfer/Chapter_7.ipynb | 162 |
1 files changed, 162 insertions, 0 deletions
diff --git a/Elements_of_Thermodynamics_and_heat_transfer/Chapter_7.ipynb b/Elements_of_Thermodynamics_and_heat_transfer/Chapter_7.ipynb new file mode 100755 index 00000000..92d0279f --- /dev/null +++ b/Elements_of_Thermodynamics_and_heat_transfer/Chapter_7.ipynb @@ -0,0 +1,162 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:15d0388b2c544d629a9ec990a9a36b6e26ea291bc7812312e5319e0c4bde1ab8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 - The second law"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - Pg 112"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the entropy in parts ab,ac and efficiency\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "cv=0.175 #Btu/lbm R\n",
+ "R0=1.986\n",
+ "M=29\n",
+ "T2=1040 #R\n",
+ "T1=520 #R\n",
+ "#calculations\n",
+ "cp=cv+R0/M\n",
+ "sab=cv*math.log(T2/T1)\n",
+ "sac=cp*math.log(T2/T1)\n",
+ "dqab=cv*(T2-T1)\n",
+ "dqca=cp*(T1-T2)\n",
+ "dqrev=T2*(sac-sab)\n",
+ "eta=(dqab+dqrev+dqca)/(dqab+dqrev)*100\n",
+ "#results\n",
+ "print '%s %.4f %s' %(\"Entropy in ab part =\",sab,\"Btu/lbm R\")\n",
+ "print '%s %.4f %s' %(\"\\n Entropy in ac part =\",sac,\" Btu/lbm R\")\n",
+ "print '%s %.2f %s' %(\"\\n Efficiency =\",eta,\" percent\")\n",
+ "print '%s' %(\"The answers are a bit different due to rounding off error in textbook\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Entropy in ab part = 0.1213 Btu/lbm R\n",
+ "\n",
+ " Entropy in ac part = 0.1688 Btu/lbm R\n",
+ "\n",
+ " Efficiency = 9.80 percent\n",
+ "The answers are a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3 - Pg 115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the change in entropy of the process\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "tc=32. #F\n",
+ "th=80. #F\n",
+ "mw=5 #lbm\n",
+ "mi=1 #lbm\n",
+ "P=14.7 #psia\n",
+ "cp=1\n",
+ "#calculations\n",
+ "t= (-144*mi+tc*mi+th*mw)/(mw+mi)\n",
+ "ds1=144/(tc+460)\n",
+ "ds2=cp*math.log((460+t)/(460+tc))\n",
+ "dsice=ds1+ds2\n",
+ "dswater=mw*cp*math.log((t+460)/(460+th))\n",
+ "ds=dsice+dswater\n",
+ "#results\n",
+ "print '%s %.4f %s' %(\"Change in entropy of the process =\",ds,\"Btu/R\")\n",
+ "print '%s' %(\"The answer is a bit different due to rounding off error in textbook\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in entropy of the process = 0.0192 Btu/R\n",
+ "The answer is a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4 - Pg 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the change in available energy\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "cp=1\n",
+ "T2=60. #F\n",
+ "T1=100. #F\n",
+ "ta=32. #F\n",
+ "#calculations\n",
+ "dq=cp*(T2-T1)\n",
+ "ds=cp*math.log((460+T2)/(460+T1))\n",
+ "dE=dq-ds*(ta+460)\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Change in available energy =\",dE,\"Btu/lbm\")\n",
+ "print '%s' %(\"The answer is a bit different due to rounding off error in textbook\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in available energy = -3.5 Btu/lbm\n",
+ "The answer is a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |