summaryrefslogtreecommitdiff
path: root/Thermodynamics:_From_concepts_to_applications/Chapter_4__2.ipynb
diff options
context:
space:
mode:
authorhardythe12015-05-05 14:21:39 +0530
committerhardythe12015-05-05 14:21:39 +0530
commitfba055ce5aa0955e22bac2413c33493b10ae6532 (patch)
treebe70ef4fccd07c9c88de778014219201b4ea971f /Thermodynamics:_From_concepts_to_applications/Chapter_4__2.ipynb
parent67068710030ddd6b6c809518c34af2e04e0bf7ca (diff)
downloadPython-Textbook-Companions-fba055ce5aa0955e22bac2413c33493b10ae6532.tar.gz
Python-Textbook-Companions-fba055ce5aa0955e22bac2413c33493b10ae6532.tar.bz2
Python-Textbook-Companions-fba055ce5aa0955e22bac2413c33493b10ae6532.zip
add books
Diffstat (limited to 'Thermodynamics:_From_concepts_to_applications/Chapter_4__2.ipynb')
-rwxr-xr-xThermodynamics:_From_concepts_to_applications/Chapter_4__2.ipynb228
1 files changed, 125 insertions, 103 deletions
diff --git a/Thermodynamics:_From_concepts_to_applications/Chapter_4__2.ipynb b/Thermodynamics:_From_concepts_to_applications/Chapter_4__2.ipynb
index af2345df..087b31cb 100755
--- a/Thermodynamics:_From_concepts_to_applications/Chapter_4__2.ipynb
+++ b/Thermodynamics:_From_concepts_to_applications/Chapter_4__2.ipynb
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
- "signature": "sha256:0cf657809abd59a3a86b6df0687d80933981fc0951ab754e85709aa636b8b749"
+ "signature": "sha256:1f455d345757b912d780f8c505ce37e354978864332af7e0ecea71365b71aa92"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -10,10 +10,10 @@
"cells": [
{
"cell_type": "heading",
- "level": 2,
+ "level": 1,
"metadata": {},
"source": [
- "Chapter 4-simple systems"
+ "Chapter4-Simple systems"
]
},
{
@@ -21,7 +21,7 @@
"level": 2,
"metadata": {},
"source": [
- "Example1-46"
+ "Ex1-pg51"
]
},
{
@@ -29,6 +29,7 @@
"collapsed": false,
"input": [
"import math\n",
+ "#calculte pressure and mass and specific volume of water vapour\n",
"##initialisation of variables\n",
"V= 0.5 ##m**3\n",
"M= 18.02 ##kg/kmol\n",
@@ -46,7 +47,7 @@
"##RESULTS\n",
"print'%s %.2f %s'% ('mass of water vapour =',m,' kg')\n",
"print'%s %.2f %s' %(' specific volume of water vapour = ',v,' m**3/kg')\n",
- "print'%s %.2f %s' %(' pressure of water vapour =',p-10,'kPa')\n",
+ "print'%s %.2f %s' %(' pressure of water vapour =',p,'kPa')\n",
"print'%s %.2f %s' %(' pressure of water vapour = ',P-12,' kPa')\n",
"print'%s %.2f %s' %(' pressure of water vapour =',P1,' kPa')\n"
],
@@ -59,20 +60,20 @@
"text": [
"mass of water vapour = 27.03 kg\n",
" specific volume of water vapour = 0.02 m**3/kg\n",
- " pressure of water vapour = 15543.51 kPa\n",
+ " pressure of water vapour = 15553.51 kPa\n",
" pressure of water vapour = 12131.31 kPa\n",
" pressure of water vapour = 12432.21 kPa\n"
]
}
],
- "prompt_number": 3
+ "prompt_number": 14
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
- "Ex2-pg50"
+ "Ex2-pg52"
]
},
{
@@ -80,6 +81,7 @@
"collapsed": false,
"input": [
"import math\n",
+ "#calculate heat interaction\n",
"##initialisation of variables\n",
"m= 0.3 ##kg\n",
"T= 25 ##C\n",
@@ -101,14 +103,14 @@
]
}
],
- "prompt_number": 4
+ "prompt_number": 15
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
- "Example3-pg53"
+ "Ex3-pg53"
]
},
{
@@ -116,22 +118,22 @@
"collapsed": false,
"input": [
"import math\n",
- "#caluclate the heat interaction and temperature rise\n",
+ "#calculate heat interaction and temperature rise\n",
"##initialisation of variables\n",
- "m= 5000. ##kg\n",
+ "m= 5000 ##kg\n",
"cp= 1.4 ##kJ/kg K\n",
"T2= 27.6 ##K\n",
- "T1= 22. ##K\n",
- "t= 40. ##min\n",
- "P= 20. ##kW\n",
+ "T1= 22 ##K\n",
+ "t= 40 ##min\n",
+ "P= 20 ##kW\n",
"##CALCULATIONS\n",
"H= m*cp*(T2-T1)\n",
"W= -P*t*60\n",
"Q= H+W\n",
"dT= -W/(m*cp)\n",
"##RESULTS\n",
- "print'%s %.f %s'%('heat interaction =',Q,'kJ')\n",
- "print'%s %.2f %s'%('Temperature rise = ',dT,'C')\n"
+ "print'%s %.2f %s'% ('heat interaction = ',Q,' kJ')\n",
+ "print'%s %.2f %s'% ('\\n temperature rise = ',dT,' C')\n"
],
"language": "python",
"metadata": {},
@@ -140,19 +142,20 @@
"output_type": "stream",
"stream": "stdout",
"text": [
- "heat interaction = -8800 kJ\n",
- "Temperature rise = 6.86 C\n"
+ "heat interaction = -8800.00 kJ\n",
+ "\n",
+ " temperature rise = 6.86 C\n"
]
}
],
- "prompt_number": 15
+ "prompt_number": 16
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
- "example 4-pg 59\n"
+ "Ex4-pg59"
]
},
{
@@ -160,12 +163,12 @@
"collapsed": false,
"input": [
"import math\n",
- "#caluclate the volumes and internal energy and enthaply\n",
"##initialisation of variables\n",
+ "#calculate volume and internal energy and enthalpy\n",
"T= 300. ##C\n",
"p= 2. ##Mpa\n",
"T1= 300. ##C\n",
- "p1= 20.##Mpa\n",
+ "p1= 20. ##Mpa\n",
"T2= 300. ##C\n",
"p2= 8.501 ##Mpa\n",
"##CALCULATIONS\n",
@@ -176,12 +179,12 @@
"h= 3023.5\n",
"h1= 1333.3\n",
"##RESULTS\n",
- "print'%s %.5f %s'%('volume =',v,'m^3/kg')\n",
- "print'%s %.5f %s'%('volume =',v1,'m^3/kg')\n",
- "print'%s %.1f %s'%('internal energy = ',u,'kJ/kg')\n",
- "print'%s %.1f %s'%('internal energy =',u1,'kJ/kg')\n",
- "print'%s %.1f %s'%('enthalpy =',h,'kJ/kg')\n",
- "print'%s %.f %s'%('enthalpy = ',h1,'kJ/kg')\n"
+ "print'%s %.2f %s'% ('volume = ',v,' m^3/kg')\n",
+ "print'%s %.2f %s'% ('\\n volume =',v1,' m^3/kg')\n",
+ "print'%s %.2f %s'% ('\\n internal energy = ',u,' kJ/kg')\n",
+ "print'%s %.2f %s'% ('\\n internal energy = ',u1,' kJ/kg')\n",
+ "print'%s %.2f %s'% ('\\n enthalpy = ',h,' kJ/kg')\n",
+ "print'%s %.2f %s'% ('\\n enthalpy = ',h1,' kJ/kg')\n"
],
"language": "python",
"metadata": {},
@@ -190,12 +193,17 @@
"output_type": "stream",
"stream": "stdout",
"text": [
- "volume = 0.12547 m^3/kg\n",
- "volume = 0.00136 m^3/kg\n",
- "internal energy = 2772.6 kJ/kg\n",
- "internal energy = 1306.1 kJ/kg\n",
- "enthalpy = 3023.5 kJ/kg\n",
- "enthalpy = 1333 kJ/kg\n"
+ "volume = 0.13 m^3/kg\n",
+ "\n",
+ " volume = 0.00 m^3/kg\n",
+ "\n",
+ " internal energy = 2772.60 kJ/kg\n",
+ "\n",
+ " internal energy = 1306.10 kJ/kg\n",
+ "\n",
+ " enthalpy = 3023.50 kJ/kg\n",
+ "\n",
+ " enthalpy = 1333.30 kJ/kg\n"
]
}
],
@@ -206,7 +214,7 @@
"level": 2,
"metadata": {},
"source": [
- "example5-pg60\n"
+ "Ex5-pg60"
]
},
{
@@ -214,7 +222,7 @@
"collapsed": false,
"input": [
"import math\n",
- "#calculate the volume and internal energy and enthalpy\n",
+ "#calculate volume and internal energy\n",
"##initialisation of variables\n",
"vf= 0.001404 ##m^3/kg\n",
"x= 0.8\n",
@@ -228,9 +236,9 @@
"u= uf+x*ug\n",
"h= hf+x*hg\n",
"##RESULTS\n",
- "print'%s %.5f %s'%('volume =',v,'m^3/kg')\n",
- "print'%s %.1f %s'%('internal energy =',u,'kJ/kg')\n",
- "print'%s %.1f %s'%('enthalpy =',h, 'kJ/kg')\n"
+ "print'%s %.2f %s'% ('volume = ',v,' m^3/kg')\n",
+ "print'%s %.2f %s'% ('\\n internal energy = ',u,' kJ/kg')\n",
+ "print'%s %.2f %s'% ('\\n enthalpy = ',h,' kJ/kg')\n"
],
"language": "python",
"metadata": {},
@@ -239,20 +247,22 @@
"output_type": "stream",
"stream": "stdout",
"text": [
- "volume = 0.01762 m^3/kg\n",
- "internal energy = 2316.8 kJ/kg\n",
- "enthalpy = 2467.9 kJ/kg\n"
+ "volume = 0.02 m^3/kg\n",
+ "\n",
+ " internal energy = 2316.80 kJ/kg\n",
+ "\n",
+ " enthalpy = 2467.92 kJ/kg\n"
]
}
],
- "prompt_number": 5
+ "prompt_number": 18
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
- "Example6-pg 61"
+ "Ex6-pg61"
]
},
{
@@ -260,7 +270,7 @@
"collapsed": false,
"input": [
"import math\n",
- "#calculate the specific volume and internal energy and enthalpy and entropy\n",
+ "#calculate specific volume and internal energy and enthalpy and entropy\n",
"##initialisation of variables\n",
"T= 296. ##K\n",
"T1= 250. ##K\n",
@@ -275,17 +285,17 @@
"s2= 6.5433 ##kJ/kg K\n",
"##CALCULATIONS\n",
"a1= (T-T1)/(T2-T1)\n",
- "a2= 1-a1\n",
+ "a2= 1.-a1\n",
"V= a1*v+a2*v1\n",
"U= a1*u1+a2*u2\n",
"H= a1*h1+a2*h2\n",
"S= a1*s1+a2*s2\n",
"##RESULTS\n",
- "print'%s %.3f %s'%('a2 = ',a2,'')\n",
- "print'%s %.5f %s'%('specific volume =',V,'m^3/kg')\n",
- "print'%s %.1f %s'%('internal energy =',U,'kJ/kg')\n",
- "print'%s %.1f %s'%('enthalpy =',H,'kJ/kg')\n",
- "print'%s %.1f %s'%('Entropy =',S,'kJ/kg')\n"
+ "print'%s %.2f %s'% ('a2 = ',a2,'')\n",
+ "print'%s %.2f %s'% ('\\n specific volume = ',V,' m^3/kg')\n",
+ "print'%s %.2f %s'% ('\\n internal energy = ',U,' kJ/kg')\n",
+ "print'%s %.2f %s'% ('\\n enthalpy = ',H,' kJ/kg')\n",
+ "print'%s %.2f %s'% ('\\n Entropy = ',S,' kJ/kg')\n"
],
"language": "python",
"metadata": {},
@@ -294,22 +304,26 @@
"output_type": "stream",
"stream": "stdout",
"text": [
- "a2 = 0.080 \n",
- "specific volume = 0.12456 m^3/kg\n",
- "internal energy = 25765.2 kJ/kg\n",
- "enthalpy = 3013.8 kJ/kg\n",
- "Entropy = 6.7 kJ/kg\n"
+ "a2 = 0.08 \n",
+ "\n",
+ " specific volume = 0.12 m^3/kg\n",
+ "\n",
+ " internal energy = 25765.16 kJ/kg\n",
+ "\n",
+ " enthalpy = 3013.82 kJ/kg\n",
+ "\n",
+ " Entropy = 6.75 kJ/kg\n"
]
}
],
- "prompt_number": 6
+ "prompt_number": 19
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
- "Exapmle7-pg62"
+ "Ex7-pg62"
]
},
{
@@ -317,7 +331,7 @@
"collapsed": false,
"input": [
"import math\n",
- "#calculate a2 and internal enerjy\n",
+ "#calculate a2 and internal energy\n",
"##initialisation of variables\n",
"v= 0.15 ##m^3/kg\n",
"v1= 0.13857 ##m^3/kg\n",
@@ -333,8 +347,8 @@
"x= (v3-vf)/(vg-vf)\n",
"u= uf+x*ufg\n",
"##RESULTS\n",
- "print'%s %.3f %s'%('a2 =',a2,'')\n",
- "print'%s %.1f %s'%('internal energy =',u,'kJ/kg')\n"
+ "print'%s %.2f %s'% ('a2 = ',a2,'')\n",
+ "print'%s %.2f %s'% ('\\n internal energy = ',u,' kJ/kg')\n"
],
"language": "python",
"metadata": {},
@@ -343,19 +357,20 @@
"output_type": "stream",
"stream": "stdout",
"text": [
- "a2 = 0.095 \n",
- "internal energy = 1746.4 kJ/kg\n"
+ "a2 = 0.10 \n",
+ "\n",
+ " internal energy = 1746.40 kJ/kg\n"
]
}
],
- "prompt_number": 7
+ "prompt_number": 20
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
- "Example8-pg63"
+ "Ex8-pg63"
]
},
{
@@ -365,8 +380,8 @@
"import math\n",
"#calculate pressure and temperature\n",
"##initialisation of variables\n",
- "T= 250.##C\n",
- "T1= 300. ##C\n",
+ "T= 250. ##C\n",
+ "T2= 300. ##C\n",
"v300= 0.6548 ##m^3/kg\n",
"v250= 0.591 ##m^3/kg\n",
"v= 0.6 ##m^3/kg\n",
@@ -378,13 +393,13 @@
"p= 0.4 ##Mpa\n",
"p2= 0.2 ##Mpa\n",
"##CALCULATIONS\n",
- "T1= T1+((v-v250)/(v300-v250))*(T2-T)\n",
+ "T1= T+((v-v250)/(v300-v250))*(T2-T)\n",
"u1= u250+((v-v250)/(v300-v250))*(u300-u250)\n",
"du= u1-u\n",
"p1= p+((u-u1)/(u2-u1))*p2\n",
"##RESULTS\n",
- "print'%s %.3f %s'%('pressure =',p1,'Mpa')\n",
- "print'%s %.f %s'%('temperature =',T2,'C')\n"
+ "print'%s %.2f %s'% ('pressure = ',p1,' Mpa')\n",
+ "print'%s %.2f %s'% ('\\n temperature = ',T2,' C')\n"
],
"language": "python",
"metadata": {},
@@ -393,36 +408,38 @@
"output_type": "stream",
"stream": "stdout",
"text": [
- "pressure = 0.529 Mpa\n",
- "temperature = 510 C\n"
+ "pressure = 0.53 Mpa\n",
+ "\n",
+ " temperature = 510.30 C\n"
]
}
],
- "prompt_number": 8
+ "prompt_number": 21
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
- "Ex10-pg64"
+ "Ex9-pg64"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
- "\n",
+ "import math\n",
+ "#calculate mass and specific volume\n",
"##initialisation of variables\n",
"n= 1.5 ##kmol\n",
- "V= 0.5 ##m**3\n",
+ "V= 0.5 ##m^3\n",
"M= 18.02 ##kg\n",
"##CALCULATIONS\n",
"m= n*M\n",
"v= V/m\n",
"##RESULTS\n",
"print'%s %.2f %s'% ('mass = ',m,' kg')\n",
- "print'%s %.2f %s'% (' sepcific volume = ',v,' m^3/kg')\n"
+ "print'%s %.2f %s'% ('\\n sepcific volume = ',v,' m^3/kg')\n"
],
"language": "python",
"metadata": {},
@@ -432,18 +449,19 @@
"stream": "stdout",
"text": [
"mass = 27.03 kg\n",
+ "\n",
" sepcific volume = 0.02 m^3/kg\n"
]
}
],
- "prompt_number": 5
+ "prompt_number": 22
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
- "Example 12-pg66"
+ "Ex12-pg66"
]
},
{
@@ -459,18 +477,18 @@
"u1= 2747.7 ##kJ/kg\n",
"h2= 3092.5 ##kJ/kg\n",
"h1= 2987.3 ##kJ/kg\n",
- "p= 4 ##Mpa\n",
+ "p= 4. ##Mpa\n",
"v2= 0.06645 ##m^3/kg\n",
"v1= 0.02995 ##m^3/kg\n",
"##CALCULATIONS\n",
"m= V/v1\n",
"U= m*(u2-u1)\n",
"H= m*(h2-h1)\n",
- "W= m*p*10*10*10*(v2-v1)\n",
+ "W= m*p*10**3*(v2-v1)\n",
"Q= U+W\n",
"##RESULTS\n",
- "print'%s %.1f %s'%('work =',W,'kJ') \n",
- "print'%s %.1f %s'%('heat interaction =',Q,'kJ')\n"
+ "print'%s %.2f %s'% (' work = ',W,' kJ') \n",
+ "print'%s %.2f %s'% ('\\n heat interaction = ',Q,' kJ') \n"
],
"language": "python",
"metadata": {},
@@ -479,19 +497,20 @@
"output_type": "stream",
"stream": "stdout",
"text": [
- "work = 975.0 kJ\n",
- "heat interaction = 1502.5 kJ\n"
+ " work = 974.96 kJ\n",
+ "\n",
+ " heat interaction = 1502.50 kJ\n"
]
}
],
- "prompt_number": 10
+ "prompt_number": 23
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
- "Example13-pg 67"
+ "Ex13-pg67"
]
},
{
@@ -519,8 +538,8 @@
"W= m*0.5*((p1+p2)*(v2-v1)+(p2+p3)*(v3-v2)+(p3+p4)*(v4-v3)+(p4+p5)*(v5-v4))\n",
"Q=U+W\n",
"##RESULTS\n",
- "print'%s %.1f %s'%('work =',W,'kJ') \n",
- "print'%s %.f %s'%('heat interaction =',Q,'kJ') \n"
+ "print'%s %.2f %s'% (' work = ',W,' kJ') \n",
+ "print'%s %.2f %s'% ('\\n heat interaction = ',Q,' kJ') \n"
],
"language": "python",
"metadata": {},
@@ -529,19 +548,20 @@
"output_type": "stream",
"stream": "stdout",
"text": [
- "work = 1361.0 kJ\n",
- "heat interaction = 1889 kJ\n"
+ " work = 1361.04 kJ\n",
+ "\n",
+ " heat interaction = 1888.61 kJ\n"
]
}
],
- "prompt_number": 12
+ "prompt_number": 24
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
- "Example 14-pg68\n"
+ "Ex14-pg68"
]
},
{
@@ -549,7 +569,7 @@
"collapsed": false,
"input": [
"import math\n",
- "#calculate final pressure and enthalpy and etropy\n",
+ "#calculate final pressure and enthalpy and piston rise\n",
"##initialisation of variables\n",
"p0= 100. ##kpa\n",
"A= 0.1 ##m^2\n",
@@ -561,13 +581,13 @@
"u2= 2728.7 ##kJ/kg\n",
"v3= 0.9942 ##m^3/kg\n",
"##CALCULATIONS\n",
- "pe= (p0+(F/A))/1000\n",
+ "pe= (p0+(F/A))/1000.\n",
"h3= (m1*u1-m2*u2)/m3\n",
"z3= m3*v3/A\n",
"##RESULTS\n",
- "print'%s %.1f %s'%('final pressure =',pe,'Mpa') \n",
- "print'%s %.1f %s'%('enthalpy = ',h3,'kJ/kg') \n",
- "print'%s %.2f %s'%('piston rise =',z3,'m') \n"
+ "print'%s %.2f %s'% (' final pressure = ',pe,' Mpa') \n",
+ "print'%s %.2f %s'% (' \\n enthalpy = ',h3,' kJ/kg') \n",
+ "print'%s %.2f %s'% ('\\n piston rise = ',z3,' m') \n"
],
"language": "python",
"metadata": {},
@@ -576,13 +596,15 @@
"output_type": "stream",
"stream": "stdout",
"text": [
- "final pressure = 0.3 Mpa\n",
- "enthalpy = 3225.9 kJ/kg\n",
- "piston rise = 8.82 m\n"
+ " final pressure = 0.30 Mpa\n",
+ " \n",
+ " enthalpy = 3225.86 kJ/kg\n",
+ "\n",
+ " piston rise = 8.82 m\n"
]
}
],
- "prompt_number": 14
+ "prompt_number": 25
}
],
"metadata": {}