summaryrefslogtreecommitdiff
path: root/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter9.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter9.ipynb')
-rw-r--r--[-rwxr-xr-x]Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter9.ipynb78
1 files changed, 37 insertions, 41 deletions
diff --git a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter9.ipynb b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter9.ipynb
index 91d540ce..ceef1a80 100755..100644
--- a/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter9.ipynb
+++ b/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter9.ipynb
@@ -40,7 +40,7 @@
}
],
"source": [
- "\n",
+ "import math\n",
"# At 1 MPa\n",
"tsat = 179.91 # Saturation temperature in degree Celsius\n",
"vf = 0.001127 # Specific volume of fluid in m**3/kg\n",
@@ -67,7 +67,7 @@
},
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": 2,
"metadata": {
"collapsed": false
},
@@ -87,6 +87,7 @@
}
],
"source": [
+ "import math\n",
"# Given that\n",
"s = 6.76 # Entropy of saturated steam in kJ/kgK\n",
"print \"\\n Example 9.2\"\n",
@@ -107,7 +108,7 @@
},
{
"cell_type": "code",
- "execution_count": 2,
+ "execution_count": 3,
"metadata": {
"collapsed": false
},
@@ -125,7 +126,7 @@
}
],
"source": [
- "\n",
+ "import math\n",
"v = 0.09 # Specific volume of substance at a point in m**3/kg\n",
"vf = 0.001177 # Specific volume of fluid in m**3/kg\n",
"vg = 0.09963 # Specific volume of gas in m**3/kg\n",
@@ -153,7 +154,7 @@
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": 4,
"metadata": {
"collapsed": false
},
@@ -182,7 +183,7 @@
}
],
"source": [
- "\n",
+ "import math\n",
"Psat = 3.973 # Saturation pressure in MPa\n",
"vf = 0.0012512 # specific volume of fluid in m**3/kg\n",
"vg = 0.05013 # Specific volume of gas in m**3/kg\n",
@@ -228,7 +229,7 @@
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": 5,
"metadata": {
"collapsed": false
},
@@ -245,7 +246,7 @@
}
],
"source": [
- "\n",
+ "import math\n",
"# At T = 40 degree\n",
"Psat = 7.384 # Saturation pressure in kPa\n",
"sf = 0.5725 # Entropy of fluid in kJ/kgK\n",
@@ -272,7 +273,7 @@
},
{
"cell_type": "code",
- "execution_count": 2,
+ "execution_count": 6,
"metadata": {
"collapsed": false
},
@@ -291,7 +292,7 @@
}
],
"source": [
- "\n",
+ "import math\n",
"h2 = 2716.2 # Enthalpy at turbine inlet in kJ/kg\n",
"hf = 844.89 # Enthalpy of fluid in kJ/kg\n",
"hfg = 1947.3 # Latent heat of vaporization in kJ/kg\n",
@@ -313,7 +314,7 @@
},
{
"cell_type": "code",
- "execution_count": 3,
+ "execution_count": 7,
"metadata": {
"collapsed": false
},
@@ -330,7 +331,7 @@
}
],
"source": [
- "\n",
+ "import math\n",
"# At 0.1Mpa, 110 degree\n",
"h2 = 2696.2 # Enthalpy at turbine inlet in kJ/kg\n",
"hf = 844.89 # Enthalpy of fluid in kJ/kg\n",
@@ -357,7 +358,7 @@
},
{
"cell_type": "code",
- "execution_count": 4,
+ "execution_count": 8,
"metadata": {
"collapsed": false
},
@@ -374,7 +375,7 @@
}
],
"source": [
- "\n",
+ "import math\n",
"# P = 1MPa\n",
"vf = 0.001127 # specific volume of fluid in m**3/kg\n",
"vg = 0.1944# specific volume of gas in m**3/kg\n",
@@ -407,7 +408,7 @@
},
{
"cell_type": "code",
- "execution_count": 5,
+ "execution_count": 10,
"metadata": {
"collapsed": false
},
@@ -417,23 +418,18 @@
"output_type": "stream",
"text": [
"\n",
- " Example 9.12\n"
- ]
- },
- {
- "ename": "NameError",
- "evalue": "name 'math' is not defined",
- "output_type": "error",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
- "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-5-4824fe7bf0c8>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 14\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"\\n Example 9.12\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 15\u001b[0m \u001b[0mV1\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mm\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mv1\u001b[0m \u001b[1;31m# total volume at point 1\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 16\u001b[1;33m \u001b[0mVd\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mmath\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpi\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;36m4\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m*\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0md\u001b[0m\u001b[1;33m*\u001b[0m\u001b[1;36m1e-3\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m**\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0ml\u001b[0m\u001b[1;33m*\u001b[0m\u001b[1;36m1e-3\u001b[0m \u001b[1;31m# displaced volume\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 17\u001b[0m \u001b[0mV2\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mV1\u001b[0m\u001b[1;33m+\u001b[0m\u001b[0mVd\u001b[0m \u001b[1;31m# Total volume at point 2\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 18\u001b[0m \u001b[0mn\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mlog\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mP1\u001b[0m\u001b[1;33m/\u001b[0m\u001b[0mP2\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m/\u001b[0m\u001b[0mlog\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mV2\u001b[0m\u001b[1;33m/\u001b[0m\u001b[0mV1\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# polytropic index\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mNameError\u001b[0m: name 'math' is not defined"
+ " Example 9.12\n",
+ "\n",
+ " The value of n is 1.23844995978\n",
+ "\n",
+ " The work done by the steam is 4.72026539673 kJ \n",
+ "\n",
+ " The heat transfer is -1.80091923775 kJ \n"
]
}
],
"source": [
- "\n",
+ "import math\n",
"m = 0.02 # Mass of steam in Kg\n",
"d = 280 # diameter of piston in mm\n",
"l = 305 # Stroke length in mm\n",
@@ -450,7 +446,7 @@
"V1 = m*v1 # total volume at point 1\n",
"Vd = (math.pi/4)*(d*1e-3)**2*l*1e-3 # displaced volume\n",
"V2 = V1+Vd # Total volume at point 2\n",
- "n = log(P1/P2)/log(V2/V1) # polytropic index\n",
+ "n = math.log(P1/P2)/math.log(V2/V1) # polytropic index\n",
"W12 = ((P1*V1)-(P2*V2))*1e6/(n-1) # work done\n",
"print \"\\n The value of n is \",n\n",
"print \"\\n The work done by the steam is \",W12/1e3 ,\"kJ \"\n",
@@ -475,7 +471,7 @@
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": 11,
"metadata": {
"collapsed": false
},
@@ -495,7 +491,7 @@
}
],
"source": [
- "\n",
+ "import math\n",
"x1 = 1 # Steam quality in first vessel\n",
"x2 = 0.8 # Steam quality in second vessel\n",
"# at 0.2MPa\n",
@@ -551,7 +547,7 @@
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": 12,
"metadata": {
"collapsed": false
},
@@ -574,7 +570,7 @@
}
],
"source": [
- "\n",
+ "import math\n",
"# At 6 MPa, 400 degree\n",
"h1 = 3177.2 # Enthalpy in kJ/kg\n",
"s1 = 6.5408 #Entropy in kJ/kgK\n",
@@ -614,7 +610,7 @@
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": 13,
"metadata": {
"collapsed": false
},
@@ -637,7 +633,7 @@
}
],
"source": [
- "\n",
+ "import math\n",
"# At 25 bar, 350 degree\n",
"h1 = 3125.87 # Enthalpy in kJ/kg\n",
"s1 = 6.8481# Entropy in kJ/kgK\n",
@@ -691,7 +687,7 @@
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": 14,
"metadata": {
"collapsed": false
},
@@ -714,7 +710,7 @@
}
],
"source": [
- "\n",
+ "import math\n",
"# At dead state of 1 bar, 300K\n",
"u0 = 113.1 # Internal energy in kJ/kg\n",
"h0 = 113.2 # Enthalpy in kJ/kg\n",
@@ -775,7 +771,7 @@
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": 15,
"metadata": {
"collapsed": false
},
@@ -803,7 +799,7 @@
}
],
"source": [
- "\n",
+ "import math\n",
"# Given\n",
"th1 = 90.0 # Inlet temperature of hot water in degree Celsius\n",
"tc1 = 25.0# Inlet temperature of cold water in degree Celsius\n",
@@ -866,7 +862,7 @@
},
{
"cell_type": "code",
- "execution_count": 26,
+ "execution_count": 16,
"metadata": {
"collapsed": false
},
@@ -883,7 +879,7 @@
}
],
"source": [
- "\n",
+ "import math\n",
"m = 50.0# mass flow rate in kg/h\n",
"Th = 23.0 # Home temperature in degree Celsius\n",
"# State 1\n",