summaryrefslogtreecommitdiff
path: root/_Engineering_Thermodynamics_by__O._Singh/chapter_1_2.ipynb
diff options
context:
space:
mode:
authorThomas Stephen Lee2015-08-28 16:53:23 +0530
committerThomas Stephen Lee2015-08-28 16:53:23 +0530
commit4a1f703f1c1808d390ebf80e80659fe161f69fab (patch)
tree31b43ae8895599f2d13cf19395d84164463615d9 /_Engineering_Thermodynamics_by__O._Singh/chapter_1_2.ipynb
parent9d260e6fae7328d816a514130b691fbd0e9ef81d (diff)
downloadPython-Textbook-Companions-4a1f703f1c1808d390ebf80e80659fe161f69fab.tar.gz
Python-Textbook-Companions-4a1f703f1c1808d390ebf80e80659fe161f69fab.tar.bz2
Python-Textbook-Companions-4a1f703f1c1808d390ebf80e80659fe161f69fab.zip
add books
Diffstat (limited to '_Engineering_Thermodynamics_by__O._Singh/chapter_1_2.ipynb')
-rw-r--r--_Engineering_Thermodynamics_by__O._Singh/chapter_1_2.ipynb1777
1 files changed, 1777 insertions, 0 deletions
diff --git a/_Engineering_Thermodynamics_by__O._Singh/chapter_1_2.ipynb b/_Engineering_Thermodynamics_by__O._Singh/chapter_1_2.ipynb
new file mode 100644
index 00000000..9474d100
--- /dev/null
+++ b/_Engineering_Thermodynamics_by__O._Singh/chapter_1_2.ipynb
@@ -0,0 +1,1777 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# chapter 1:Fundemental concepts and definitions"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.1;page no:22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.1, Page:22 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 1\n",
+ "pressure difference(p)in pa\n",
+ "p= 39755.7\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of pressure difference\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.1, Page:22 \\n \\n\"\n",
+ "print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 1\"\n",
+ "h=30*10**-2;#manometer deflection of mercury in m\n",
+ "g=9.78;#acceleration due to gravity in m/s^2\n",
+ "rho=13550;#density of mercury at room temperature in kg/m^3\n",
+ "print\"pressure difference(p)in pa\"\n",
+ "p=rho*g*h\n",
+ "print\"p=\",round(p,2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.2;page no:22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.2, Page:22 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 2\n",
+ "effort required for lifting the lid(E)in N\n",
+ "E= 7115.48\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of effort required for lifting the lid\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.2, Page:22 \\n \\n\"\n",
+ "print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 2\"\n",
+ "d=30*10**-2;#diameter of cylindrical vessel in m\n",
+ "h=76*10**-2;#atmospheric pressure in m of mercury\n",
+ "g=9.78;#acceleration due to gravity in m/s^2\n",
+ "rho=13550;#density of mercury at room temperature in kg/m^3\n",
+ "print\"effort required for lifting the lid(E)in N\"\n",
+ "E=(rho*g*h)*(3.14*d**2)/4\n",
+ "print\"E=\",round(E,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.3;page no:22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.3, Page:22 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 3\n",
+ "pressure measured by manometer is gauge pressure(Pg)in kpa\n",
+ "Pg=rho*g*h/10^3\n",
+ "actual pressure of the air(P)in kpa\n",
+ "P= 140.76\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of actual pressure of the air\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.3, Page:22 \\n \\n\"\n",
+ "print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 3\"\n",
+ "h=30*10**-2;# pressure of compressed air in m of mercury\n",
+ "Patm=101*10**3;#atmospheric pressure in pa\n",
+ "g=9.78;#acceleration due to gravity in m/s^2\n",
+ "rho=13550;#density of mercury at room temperature in kg/m^3\n",
+ "print\"pressure measured by manometer is gauge pressure(Pg)in kpa\"\n",
+ "print\"Pg=rho*g*h/10^3\"\n",
+ "Pg=rho*g*h/10**3\n",
+ "print\"actual pressure of the air(P)in kpa\"\n",
+ "P=Pg+Patm/10**3\n",
+ "print\"P=\",round(P,2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.4;page no:22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.4, Page:22 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 4\n",
+ "density of oil(RHOoil)in kg/m^3\n",
+ "RHOoil=sg*RHOw\n",
+ "gauge pressure(Pg)in kpa\n",
+ "Pg= 7.848\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of gauge pressure\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.4, Page:22 \\n \\n\"\n",
+ "print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 4\"\n",
+ "h=1;#depth of oil tank in m\n",
+ "sg=0.8;#specific gravity of oil\n",
+ "RHOw=1000;#density of water in kg/m^3\n",
+ "g=9.81;#acceleration due to gravity in m/s^2\n",
+ "print\"density of oil(RHOoil)in kg/m^3\"\n",
+ "print\"RHOoil=sg*RHOw\"\n",
+ "RHOoil=sg*RHOw\n",
+ "print\"gauge pressure(Pg)in kpa\"\n",
+ "Pg=RHOoil*g*h/10**3\n",
+ "print\"Pg=\",round(Pg,3)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.5;page no:22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.5, Page:22 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 5\n",
+ "atmospheric pressure(Patm)in kpa\n",
+ "Patm=rho*g*h2/10^3\n",
+ "pressure due to mercury column at AB(Pab)in kpa\n",
+ "Pab=rho*g*h1/10^3\n",
+ "pressure exerted by gas(Pgas)in kpa\n",
+ "Pgas= 154.76\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of pressure exerted by gas\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.5, Page:22 \\n \\n\"\n",
+ "print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 5\"\n",
+ "rho=13.6*10**3;#density of mercury in kg/m^3\n",
+ "g=9.81;#acceleration due to gravity in m/s^2\n",
+ "h1=40*10**-2;#difference of height in mercury column in m as shown in figure\n",
+ "h2=76*10**-2;#barometer reading of mercury in m\n",
+ "print\"atmospheric pressure(Patm)in kpa\"\n",
+ "print\"Patm=rho*g*h2/10^3\"\n",
+ "Patm=rho*g*h2/10**3\n",
+ "print\"pressure due to mercury column at AB(Pab)in kpa\"\n",
+ "print\"Pab=rho*g*h1/10^3\"\n",
+ "Pab=rho*g*h1/10**3\n",
+ "print\"pressure exerted by gas(Pgas)in kpa\"\n",
+ "Pgas=Patm+Pab\n",
+ "print\"Pgas=\",round(Pgas,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.6;page no:23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.6, Page:23 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 6\n",
+ "by law of conservation of energy\n",
+ "potential energy(m*g*h)in joule = heat required for heating water(m*Cp*deltaT*1000*4.18)in joule\n",
+ "so m*g*h = m*Cp*deltaT*4.18*1000\n",
+ "change in temperature of water(deltaT) in degree celcius\n",
+ "deltaT= 2.35\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of change in temperature of water\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.6, Page:23 \\n \\n\"\n",
+ "print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 6\"\n",
+ "m=1;#mass of water in kg\n",
+ "h=1000;#height from which water fall in m\n",
+ "Cp=1;#specific heat of water in kcal/kg k\n",
+ "g=9.81;#acceleration due to gravity in m/s^2\n",
+ "print\"by law of conservation of energy\"\n",
+ "print\"potential energy(m*g*h)in joule = heat required for heating water(m*Cp*deltaT*1000*4.18)in joule\"\n",
+ "print\"so m*g*h = m*Cp*deltaT*4.18*1000\"\n",
+ "print\"change in temperature of water(deltaT) in degree celcius\"\n",
+ "deltaT=(g*h)/(4.18*1000*Cp)\n",
+ "print\"deltaT=\",round(deltaT,2)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.7;page no:23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.7, Page:23 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 7\n",
+ "mass of object(m)in kg\n",
+ "m=w1/g1\n",
+ "spring balance reading=gravitational force in mass(F)in N\n",
+ "F= 86.65\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of spring balance reading\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.7, Page:23 \\n \\n\"\n",
+ "print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 7\"\n",
+ "w1=100;#weight of object at standard gravitational acceleration in N\n",
+ "g1=9.81;#acceleration due to gravity in m/s^2\n",
+ "g2=8.5;#gravitational acceleration at some location\n",
+ "print\"mass of object(m)in kg\"\n",
+ "print\"m=w1/g1\"\n",
+ "m=w1/g1\n",
+ "print\"spring balance reading=gravitational force in mass(F)in N\"\n",
+ "F=m*g2\n",
+ "print\"F=\",round(F,2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.8;page no:24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.8, Page:24 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 8\n",
+ "pressure measured by manometer(P) in pa\n",
+ "p=rho*g*h\n",
+ "now weight of piston(m*g) = upward thrust by gas(p*math.pi*d^2/4)\n",
+ "mass of piston(m)in kg\n",
+ "so m= 28.84\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of mass of piston\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "import math\n",
+ "print\"Example 1.8, Page:24 \\n \\n\"\n",
+ "print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 8\"\n",
+ "d=15*10**-2;#diameter of cylinder in m\n",
+ "h=12*10**-2;#manometer height difference in m of mercury\n",
+ "rho=13.6*10**3;#density of mercury in kg/m^3\n",
+ "g=9.81;#acceleration due to gravity in m/s^2\n",
+ "print\"pressure measured by manometer(P) in pa\"\n",
+ "print\"p=rho*g*h\"\n",
+ "p=rho*g*h\n",
+ "print\"now weight of piston(m*g) = upward thrust by gas(p*math.pi*d^2/4)\"\n",
+ "print\"mass of piston(m)in kg\"\n",
+ "m=(p*math.pi*d**2)/(4*g)\n",
+ "print\"so m=\",round(m,2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.9;page no:24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.9, Page:24 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 9\n",
+ "balancing pressure at plane BC in figure we get\n",
+ "Psteam+Pwater=Patm+Pmercury\n",
+ "now 1.atmospheric pressure(Patm)in pa\n",
+ "Patm= 101396.16\n",
+ "2.pressure due to water(Pwater)in pa\n",
+ "Pwater= 196.2\n",
+ "3.pressure due to mercury(Pmercury)in pa\n",
+ "Pmercury=RHOm*g*h3 13341.6\n",
+ "using balancing equation\n",
+ "Psteam=Patm+Pmercury-Pwater\n",
+ "so pressure of steam(Psteam)in kpa\n",
+ "Psteam= 114.54\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of pressure due to atmosphere,water,mercury,steam\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.9, Page:24 \\n \\n\"\n",
+ "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 9\")\n",
+ "RHOm=13.6*10**3;#density of mercury in kg/m^3\n",
+ "RHOw=1000;#density of water in kg/m^3\n",
+ "h1=76*10**-2;#barometer reading in m of mercury\n",
+ "h2=2*10**-2;#height raised by water in manometer tube in m \n",
+ "h3=10*10**-2;#height raised by mercury in manometer tube in m \n",
+ "g=9.81;#acceleration due to gravity in m/s^2\n",
+ "print(\"balancing pressure at plane BC in figure we get\")\n",
+ "print(\"Psteam+Pwater=Patm+Pmercury\")\n",
+ "print(\"now 1.atmospheric pressure(Patm)in pa\")\n",
+ "Patm=RHOm*g*h1\n",
+ "print(\"Patm=\"),round(Patm,2)\n",
+ "print(\"2.pressure due to water(Pwater)in pa\")\n",
+ "Pwater=RHOw*g*h2\n",
+ "print(\"Pwater=\"),round(Pwater,2)\n",
+ "print(\"3.pressure due to mercury(Pmercury)in pa\")\n",
+ "Pmercury=RHOm*g*h3\n",
+ "print(\"Pmercury=RHOm*g*h3\"),round(Pmercury,2)\n",
+ "print(\"using balancing equation\")\n",
+ "print(\"Psteam=Patm+Pmercury-Pwater\")\n",
+ "print(\"so pressure of steam(Psteam)in kpa\")\n",
+ "Psteam=(Patm+Pmercury-Pwater)/1000\n",
+ "print(\"Psteam=\"),round(Psteam,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.10;page no:24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.10, Page:24 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 10\n",
+ "atmospheric pressure(Patm)in kpa\n",
+ "absolute temperature in compartment A(Pa) in kpa\n",
+ "Pa= 496.06\n",
+ "absolute temperature in compartment B(Pb) in kpa\n",
+ "Pb= 246.06\n",
+ "absolute pressure in compartments in A & B=496.06 kpa & 246.06 kpa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of \"absolute temperature in compartment A,B\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.10, Page:24 \\n \\n\"\n",
+ "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 10\")\n",
+ "h=720*10**-3;#barometer reading in m of Hg\n",
+ "Pga=400;#gauge pressure in compartment A in kpa\n",
+ "Pgb=150;#gauge pressure in compartment B in kpa\n",
+ "rho=13.6*10**3;#density of mercury in kg/m^3\n",
+ "g=9.81;#acceleration due to gravity in m/s^2\n",
+ "print(\"atmospheric pressure(Patm)in kpa\")\n",
+ "Patm=(rho*g*h)/1000\n",
+ "print(\"absolute temperature in compartment A(Pa) in kpa\")\n",
+ "Pa=Pga+Patm\n",
+ "print\"Pa=\",round(Pa,2)\n",
+ "print\"absolute temperature in compartment B(Pb) in kpa\"\n",
+ "Pb=Pgb+Patm\n",
+ "print\"Pb=\",round(Pb,2)\n",
+ "print\"absolute pressure in compartments in A & B=496.06 kpa & 246.06 kpa\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.11;page no:25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.11, Page:25 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 11\n",
+ "the pressure of air in air tank can be obtained by equalising pressures at some reference line\n",
+ "P1+RHOw*g*h1+RHOo*g*h2 = Patm+RHOm*g*h3\n",
+ "so P1 = Patm+RHOm*g*h3-RHOw*g*h1-RHOo*g*h2\n",
+ "air pressure(P1)in kpa 139.81\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of air pressure\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.11, Page:25 \\n \\n\"\n",
+ "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 11\")\n",
+ "Patm=90*10**3;#atmospheric pressure in pa\n",
+ "RHOw=1000;#density of water in kg/m^3\n",
+ "RHOm=13600;#density of mercury in kg/m^3\n",
+ "RHOo=850;#density of oil in kg/m^3\n",
+ "g=9.81;#acceleration due to ggravity in m/s^2\n",
+ "h1=.15;#height difference between water column in m\n",
+ "h2=.25;#height difference between oil column in m\n",
+ "h3=.4;#height difference between mercury column in m\n",
+ "print\"the pressure of air in air tank can be obtained by equalising pressures at some reference line\"\n",
+ "print\"P1+RHOw*g*h1+RHOo*g*h2 = Patm+RHOm*g*h3\"\n",
+ "print\"so P1 = Patm+RHOm*g*h3-RHOw*g*h1-RHOo*g*h2\"\n",
+ "P1=(Patm+RHOm*g*h3-RHOw*g*h1-RHOo*g*h2)/1000\n",
+ "print\"air pressure(P1)in kpa\",round(P1,2)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.12;page no:26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.12, Page:26 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 12\n",
+ "mass of object(m)in kg\n",
+ "m=F/g\n",
+ "kinetic energy(E)in J is given by\n",
+ "E= 140625000.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of kinetic energy\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.12, Page:26 \\n \\n\"\n",
+ "print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 12\"\n",
+ "v=750;#relative velocity of object with respect to earth in m/sec\n",
+ "F=4000;#gravitational force in N\n",
+ "g=8;#acceleration due to gravity in m/s^2\n",
+ "print\"mass of object(m)in kg\"\n",
+ "print\"m=F/g\"\n",
+ "m=F/g\n",
+ "print\"kinetic energy(E)in J is given by\"\n",
+ "E=m*v**2/2\n",
+ "print\"E=\",round(E)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.13;page no:26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.13, Page:26 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 13\n",
+ "characteristics gas constant(R2)in kJ/kg k\n",
+ "molecular weight of gas(m)in kg/kg mol= 16.63\n",
+ "NOTE=>Their is some calculation mistake while calaulating gas constant in book,which is corrected above hence answer may vary.\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of molecular weight of gas\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.13, Page:26 \\n \\n\"\n",
+ "print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 13\"\n",
+ "Cp=2.286;#specific heat at constant pressure in kJ/kg k\n",
+ "Cv=1.786;#specific heat at constant volume in kJ/kg k\n",
+ "R1=8.3143;#universal gas constant in kJ/kg k\n",
+ "print\"characteristics gas constant(R2)in kJ/kg k\"\n",
+ "R2=Cp-Cv\n",
+ "m=R1/R2\n",
+ "print\"molecular weight of gas(m)in kg/kg mol=\",round(m,2)\n",
+ "print\"NOTE=>Their is some calculation mistake while calaulating gas constant in book,which is corrected above hence answer may vary.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.14;page no:26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.14, Page:26 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 14\n",
+ "using perfect gas equation\n",
+ "P1*V1/T1 = P2*V2/T2\n",
+ "=>T2=(P2*V2*T1)/(P1*V1)\n",
+ "so final temperature of gas(T2)in k\n",
+ "or final temperature of gas(T2)in degree celcius= 127.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of final temperature of gas\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.14, Page:26 \\n \\n\"\n",
+ "print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 14\"\n",
+ "P1=750*10**3;#initial pressure of gas in pa\n",
+ "V1=0.2;#initial volume of gas in m^3\n",
+ "T1=600;#initial temperature of gas in k\n",
+ "P2=2*10**5;#final pressure of gas i pa\n",
+ "V2=0.5;#final volume of gas in m^3\n",
+ "print\"using perfect gas equation\"\n",
+ "print\"P1*V1/T1 = P2*V2/T2\"\n",
+ "print\"=>T2=(P2*V2*T1)/(P1*V1)\"\n",
+ "print\"so final temperature of gas(T2)in k\"\n",
+ "T2=(P2*V2*T1)/(P1*V1)\n",
+ "T2=T2-273\n",
+ "print\"or final temperature of gas(T2)in degree celcius=\",round(T2,2)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.15;page no:27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.15, Page:27 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 15\n",
+ "from perfect gas equation we get\n",
+ "initial mass of air(m1 in kg)=(P1*V1)/(R*T1)\n",
+ "m1= 5.807\n",
+ "final mass of air(m2 in kg)=(P2*V2)/(R*T2)\n",
+ "m2= 3.111\n",
+ "mass of air removed(m)in kg 2.696\n",
+ "volume of this mass of air(V) at initial states in m^3= 2.32\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of volume of this mass of air(V) at initial states\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.15, Page:27 \\n \\n\"\n",
+ "print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 15\"\n",
+ "P1=100*10**3;#initial pressure of air in pa\n",
+ "V1=5.;#initial volume of air in m^3\n",
+ "T1=300.;#initial temperature of gas in k\n",
+ "P2=50*10**3;#final pressure of air in pa\n",
+ "V2=5.;#final volume of air in m^3\n",
+ "T2=(280.);#final temperature of air in K\n",
+ "R=287.;#gas constant on J/kg k\n",
+ "print\"from perfect gas equation we get\"\n",
+ "print\"initial mass of air(m1 in kg)=(P1*V1)/(R*T1)\"\n",
+ "m1=(P1*V1)/(R*T1)\n",
+ "print(\"m1=\"),round(m1,3)\n",
+ "print\"final mass of air(m2 in kg)=(P2*V2)/(R*T2)\"\n",
+ "m2=(P2*V2)/(R*T2)\n",
+ "print(\"m2=\"),round(m2,3)\n",
+ "m=m1-m2\n",
+ "print\"mass of air removed(m)in kg\",round(m,3)\n",
+ "V=m*R*T1/P1\n",
+ "print\"volume of this mass of air(V) at initial states in m^3=\",round(V,2)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.16;page no:27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.16, Page:27 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 16\n",
+ "here V1=V2\n",
+ "so P1/T1=P2/T2\n",
+ "final temperature of hydrogen gas(T2)in k\n",
+ "=>T2=P2*T1/P1\n",
+ "now R=(Cp-Cv) in KJ/kg k\n",
+ "And volume of cylinder(V1)in m^3\n",
+ "V1=(math.pi*d^2*l)/4\n",
+ "mass of hydrogen gas(m)in kg\n",
+ "m= 0.254\n",
+ "now heat supplied(Q)in KJ\n",
+ "Q= 193.93\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of heat supplied\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "import math\n",
+ "print\"Example 1.16, Page:27 \\n \\n\"\n",
+ "print\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 16\"\n",
+ "d=1;#diameter of cylinder in m\n",
+ "l=4;#length of cylinder in m\n",
+ "P1=100*10**3;#initial pressureof hydrogen gas in pa\n",
+ "T1=(27+273);#initial temperature of hydrogen gas in k\n",
+ "P2=125*10**3;#final pressureof hydrogen gas in pa\n",
+ "Cp=14.307;#specific heat at constant pressure in KJ/kg k\n",
+ "Cv=10.183;#specific heat at constant volume in KJ/kg k\n",
+ "print\"here V1=V2\"\n",
+ "print\"so P1/T1=P2/T2\"\n",
+ "print\"final temperature of hydrogen gas(T2)in k\"\n",
+ "print\"=>T2=P2*T1/P1\"\n",
+ "T2=P2*T1/P1\n",
+ "print\"now R=(Cp-Cv) in KJ/kg k\"\n",
+ "R=Cp-Cv\n",
+ "print\"And volume of cylinder(V1)in m^3\"\n",
+ "print\"V1=(math.pi*d^2*l)/4\"\n",
+ "V1=(math.pi*d**2*l)/4\n",
+ "print\"mass of hydrogen gas(m)in kg\"\n",
+ "m=(P1*V1)/(1000*R*T1)\n",
+ "print\"m=\",round(m,3)\n",
+ "print\"now heat supplied(Q)in KJ\"\n",
+ "Q=m*Cv*(T2-T1)\n",
+ "print\"Q=\",round(Q,2)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.17;page no:28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.17, Page:28 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 17\n",
+ "final total volume(V)in m^3\n",
+ "V=V1*V2\n",
+ "total mass of air(m)in kg\n",
+ "m=m1+m2\n",
+ "final pressure of air(P)in kpa\n",
+ "using perfect gas equation\n",
+ "P= 516.6\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of final pressure\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.17, Page:28 \\n \\n\"\n",
+ "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 17\")\n",
+ "V1=2.;#volume of first cylinder in m^3\n",
+ "V2=2.;#volume of second cylinder in m^3\n",
+ "T=(27+273);#temperature of system in k\n",
+ "m1=20.;#mass of air in first vessel in kg\n",
+ "m2=4.;#mass of air in second vessel in kg\n",
+ "R=287.;#gas constant J/kg k\n",
+ "print(\"final total volume(V)in m^3\")\n",
+ "print(\"V=V1*V2\")\n",
+ "V=V1*V2\n",
+ "print(\"total mass of air(m)in kg\")\n",
+ "print(\"m=m1+m2\")\n",
+ "m=m1+m2\n",
+ "print(\"final pressure of air(P)in kpa\")\n",
+ "print(\"using perfect gas equation\")\n",
+ "P=(m*R*T)/(1000*V)\n",
+ "print\"P=\",round(P,2)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.18;page no:28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.18, Page:28 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 18\n",
+ "1.By considering it as a PERFECT GAS\n",
+ "gas constant for CO2(Rco2)\n",
+ "Rco2=(J/Kg.k) 188.9\n",
+ "Also P*V=M*Rco2*T\n",
+ "pressure of CO2 as perfect gas(P)in N/m^2\n",
+ "P=(m*Rco2*T)/V 141683.71\n",
+ "2.By considering as a REAL GAS\n",
+ "values of vanderwaal constants a,b can be seen from the table which are\n",
+ "a=(N m^4/(kg mol)^2) 362850.0\n",
+ "b=(m^3/kg mol) 0.03\n",
+ "now specific volume(v)in m^3/kg mol\n",
+ "v= 17.604\n",
+ "now substituting the value of all variables in vanderwaal equation\n",
+ "(P+(a/v^2))*(v-b)=R*T\n",
+ "pressure of CO2 as real gas(P)in N/m^2\n",
+ "P= 140766.02\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of pressure of CO2 as perfect,real gas\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.18, Page:28 \\n \\n\"\n",
+ "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 18\")\n",
+ "m=5;#mass of CO2 in kg\n",
+ "V=2;#volume of vesssel in m^3\n",
+ "T=(27+273);#temperature of vessel in k\n",
+ "R=8.314*10**3;#universal gas constant in J/kg k\n",
+ "M=44.01;#molecular weight of CO2 \n",
+ "print(\"1.By considering it as a PERFECT GAS\")\n",
+ "print(\"gas constant for CO2(Rco2)\")\n",
+ "Rco2=R/M\n",
+ "print(\"Rco2=(J/Kg.k)\"),round(Rco2,1)\n",
+ "print(\"Also P*V=M*Rco2*T\")\n",
+ "print(\"pressure of CO2 as perfect gas(P)in N/m^2\")\n",
+ "P=(m*Rco2*T)/V\n",
+ "print(\"P=(m*Rco2*T)/V \"),round(P,2)\n",
+ "print(\"2.By considering as a REAL GAS\")\n",
+ "print(\"values of vanderwaal constants a,b can be seen from the table which are\")\n",
+ "a=3628.5*10**2#vanderwall constant in N m^4/(kg mol)^2\n",
+ "b=3.14*10**-2# vanderwall constant in m^3/kg mol\n",
+ "print(\"a=(N m^4/(kg mol)^2) \"),round(a,2)\n",
+ "print(\"b=(m^3/kg mol)\"),round(b,2)\n",
+ "print(\"now specific volume(v)in m^3/kg mol\")\n",
+ "v=V*M/m\n",
+ "print(\"v=\"),round(v,3)\n",
+ "print(\"now substituting the value of all variables in vanderwaal equation\")\n",
+ "print(\"(P+(a/v^2))*(v-b)=R*T\")\n",
+ "print(\"pressure of CO2 as real gas(P)in N/m^2\")\n",
+ "P=((R*T)/(v-b))-(a/v**2)\n",
+ "print(\"P=\"),round(P,2)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.19;page no:29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.19, Page:29 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 19\n",
+ "1.considering as perfect gas\n",
+ "specific volume(V)in m^3/kg\n",
+ "V= 0.0186\n",
+ "2.considering compressibility effects\n",
+ "reduced pressure(P)in pa\n",
+ "p= 0.8\n",
+ "reduced temperature(t)in k\n",
+ "t= 1.1\n",
+ "from generalised compressibility chart,compressibility factor(Z)can be seen for reduced pressure and reduced temperatures of 0.8 and 1.1\n",
+ "we get Z=0.785\n",
+ "now actual specific volume(v)in m^3/kg\n",
+ "v= 0.0146\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of specific volume of steam\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.19, Page:29 \\n \\n\"\n",
+ "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 19\")\n",
+ "P=17672;#pressure of steam on kpa\n",
+ "T=712;#temperature of steam in k\n",
+ "Pc=22.09;#critical pressure of steam in Mpa\n",
+ "Tc=647.3;#critical temperature of steam in k\n",
+ "R=0.4615;#gas constant for steam in KJ/kg k\n",
+ "print(\"1.considering as perfect gas\")\n",
+ "print(\"specific volume(V)in m^3/kg\")\n",
+ "V=R*T/P\n",
+ "print(\"V=\"),round(V,4)\n",
+ "print(\"2.considering compressibility effects\")\n",
+ "print(\"reduced pressure(P)in pa\")\n",
+ "p=P/(Pc*1000)\n",
+ "print(\"p=\"),round(p,2)\n",
+ "print(\"reduced temperature(t)in k\")\n",
+ "t=T/Tc\n",
+ "print(\"t=\"),round(t,2)\n",
+ "print(\"from generalised compressibility chart,compressibility factor(Z)can be seen for reduced pressure and reduced temperatures of 0.8 and 1.1\")\n",
+ "print(\"we get Z=0.785\")\n",
+ "Z=0.785;#compressibility factor\n",
+ "print(\"now actual specific volume(v)in m^3/kg\")\n",
+ "v=Z*V\n",
+ "print(\"v=\"),round(v,4)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.20;page no:30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.20, Page:30 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 20\n",
+ "volume of ballon(V1)in m^3\n",
+ "V1= 65.45\n",
+ "molecular mass of hydrogen(M)\n",
+ "M=2\n",
+ "gas constant for H2(R1)in J/kg k\n",
+ "R1= 4157.0\n",
+ "mass of H2 in ballon(m1)in kg\n",
+ "m1= 5.316\n",
+ "volume of air printlaced(V2)=volume of ballon(V1)\n",
+ "mass of air printlaced(m2)in kg\n",
+ "m2= 79.66\n",
+ "gas constant for air(R2)=0.287 KJ/kg k\n",
+ "load lifting capacity due to buoyant force(m)in kg\n",
+ "m= 74.343\n"
+ ]
+ }
+ ],
+ "source": [
+ "#estimation of maximum load that can be lifted \n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "import math\n",
+ "print\"Example 1.20, Page:30 \\n \\n\"\n",
+ "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 20\")\n",
+ "d=5.;#diameter of ballon in m\n",
+ "T1=(27.+273.);#temperature of hydrogen in k\n",
+ "P=1.013*10**5;#atmospheric pressure in pa\n",
+ "T2=(17.+273.);#temperature of surrounding air in k\n",
+ "R=8.314*10**3;#gas constant in J/kg k\n",
+ "print(\"volume of ballon(V1)in m^3\")\n",
+ "V1=(4./3.)*math.pi*((d/2)**3)\n",
+ "print(\"V1=\"),round(V1,2)\n",
+ "print(\"molecular mass of hydrogen(M)\")\n",
+ "print(\"M=2\")\n",
+ "M=2;#molecular mass of hydrogen\n",
+ "print(\"gas constant for H2(R1)in J/kg k\")\n",
+ "R1=R/M\n",
+ "print(\"R1=\"),round(R1,2)\n",
+ "print(\"mass of H2 in ballon(m1)in kg\")\n",
+ "m1=(P*V1)/(R1*T1)\n",
+ "print(\"m1=\"),round(m1,3)\n",
+ "print(\"volume of air printlaced(V2)=volume of ballon(V1)\")\n",
+ "print(\"mass of air printlaced(m2)in kg\")\n",
+ "R2=0.287*1000;#gas constant for air in J/kg k\n",
+ "m2=(P*V1)/(R2*T2)\n",
+ "print(\"m2=\"),round(m2,2)\n",
+ "print(\"gas constant for air(R2)=0.287 KJ/kg k\")\n",
+ "print(\"load lifting capacity due to buoyant force(m)in kg\")\n",
+ "m=m2-m1\n",
+ "print(\"m=\"),round(m,3)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.21;page no:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.21, Page:31 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 21\n",
+ "let initial receiver pressure(p1)=1 in pa\n",
+ "so final receiver pressure(p2)=in pa 0.25\n",
+ "perfect gas equation,p*V*m=m*R*T\n",
+ "differentiating and then integrating equation w.r.t to time(t) \n",
+ "we get t=-(V/v)*log(p2/p1)\n",
+ "so time(t)in min 110.9\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of time required\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "import math\n",
+ "print\"Example 1.21, Page:31 \\n \\n\"\n",
+ "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 21\")\n",
+ "v=0.25;#volume sucking rate of pump in m^3/min\n",
+ "V=20.;#volume of air vessel in m^3\n",
+ "p1=1.;#initial receiver pressure in pa\n",
+ "print(\"let initial receiver pressure(p1)=1 in pa\")\n",
+ "p2=p1/4.\n",
+ "print(\"so final receiver pressure(p2)=in pa\"),round(p2,2)\n",
+ "print(\"perfect gas equation,p*V*m=m*R*T\")\n",
+ "print(\"differentiating and then integrating equation w.r.t to time(t) \")\n",
+ "print(\"we get t=-(V/v)*log(p2/p1)\")\n",
+ "t=-(V/v)*math.log(p2/p1)\n",
+ "print(\"so time(t)in min\"),round(t,2)\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.22;page no:32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.22, Page:32 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 22\n",
+ "first calculate gas constants for different gases in j/kg k\n",
+ "for nitrogen,R1= 296.9\n",
+ "for oxygen,R2= 259.8\n",
+ "for carbon dioxide,R3= 188.95\n",
+ "so the gas constant for mixture(Rm)in j/kg k\n",
+ "Rm= 288.09\n",
+ "now the specific heat at constant pressure for constituent gases in KJ/kg k\n",
+ "for nitrogen,Cp1= 1.039\n",
+ "for oxygen,Cp2= 0.909\n",
+ "for carbon dioxide,Cp3= 0.819\n",
+ "so the specific heat at constant pressure for mixture(Cpm)in KJ/kg k\n",
+ "Cpm= 1.0115\n",
+ "now no. of moles of constituents gases\n",
+ "for nitrogen,n1=m1/M1 in mol,where m1=f1*m in kg 0.143\n",
+ "for oxygen,n2=m2/M2 in mol,where m2=f2*m in kg 0.028\n",
+ "for carbon dioxide,n3=m3/M3 in mol,where m3=f3*m in kg 0.0023\n",
+ "total no. of moles in mixture in mol\n",
+ "n= 0.1733\n",
+ "now mole fraction of constituent gases\n",
+ "for nitrogen,x1= 0.825\n",
+ "for oxygen,x2= 0.162\n",
+ "for carbon dioxide,x3= 0.0131\n",
+ "now the molecular weight of mixture(Mm)in kg/kmol\n",
+ "Mm= 28.86\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of specific heat at constant pressure for constituent gases \n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.22, Page:32 \\n \\n\"\n",
+ "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 22\")\n",
+ "m=5;#mass of mixture of gas in kg\n",
+ "P=1.013*10**5;#pressure of mixture in pa\n",
+ "T=300;#temperature of mixture in k\n",
+ "M1=28.;#molecular weight of nitrogen(N2)\n",
+ "M2=32.;#molecular weight of oxygen(O2)\n",
+ "M3=44.;#molecular weight of carbon dioxide(CO2)\n",
+ "f1=0.80;#fraction of N2 in mixture\n",
+ "f2=0.18;#fraction of O2 in mixture\n",
+ "f3=0.02;#fraction of CO2 in mixture\n",
+ "k1=1.4;#ratio of specific heat capacities for N2\n",
+ "k2=1.4;#ratio of specific heat capacities for O2\n",
+ "k3=1.3;#ratio of specific heat capacities for CO2\n",
+ "R=8314;#universal gas constant in J/kg k\n",
+ "print(\"first calculate gas constants for different gases in j/kg k\")\n",
+ "R1=R/M1\n",
+ "print(\"for nitrogen,R1=\"),round(R1,1)\n",
+ "R2=R/M2\n",
+ "print(\"for oxygen,R2=\"),round(R2,1)\n",
+ "R3=R/M3\n",
+ "print(\"for carbon dioxide,R3=\"),round(R3,2)\n",
+ "print(\"so the gas constant for mixture(Rm)in j/kg k\")\n",
+ "Rm=f1*R1+f2*R2+f3*R3\n",
+ "print(\"Rm=\"),round(Rm,2)\n",
+ "print(\"now the specific heat at constant pressure for constituent gases in KJ/kg k\")\n",
+ "Cp1=((k1/(k1-1))*R1)/1000\n",
+ "print(\"for nitrogen,Cp1=\"),round(Cp1,3)\n",
+ "Cp2=((k2/(k2-1))*R2)/1000\n",
+ "print(\"for oxygen,Cp2=\"),round(Cp2,3)\n",
+ "Cp3=((k3/(k3-1))*R3)/1000\n",
+ "print(\"for carbon dioxide,Cp3=\"),round(Cp3,3)\n",
+ "print(\"so the specific heat at constant pressure for mixture(Cpm)in KJ/kg k\")\n",
+ "Cpm=f1*Cp1+f2*Cp2+f3*Cp3\n",
+ "print(\"Cpm=\"),round(Cpm,4)\n",
+ "print(\"now no. of moles of constituents gases\")\n",
+ "m1=f1*m\n",
+ "n1=m1/M1\n",
+ "print(\"for nitrogen,n1=m1/M1 in mol,where m1=f1*m in kg\"),round(n1,3)\n",
+ "m2=f2*m\n",
+ "n2=m2/M2\n",
+ "print(\"for oxygen,n2=m2/M2 in mol,where m2=f2*m in kg\"),round(n2,3)\n",
+ "m3=f3*m\n",
+ "n3=m3/M3\n",
+ "print(\"for carbon dioxide,n3=m3/M3 in mol,where m3=f3*m in kg\"),round(n3,4)\n",
+ "print(\"total no. of moles in mixture in mol\")\n",
+ "n=n1+n2+n3\n",
+ "print(\"n=\"),round(n,4)\n",
+ "print(\"now mole fraction of constituent gases\")\n",
+ "x1=n1/n\n",
+ "print(\"for nitrogen,x1=\"),round(x1,3)\n",
+ "x2=n2/n\n",
+ "print(\"for oxygen,x2=\"),round(x2,3)\n",
+ "x3=n3/n\n",
+ "print(\"for carbon dioxide,x3=\"),round(x3,4)\n",
+ "print(\"now the molecular weight of mixture(Mm)in kg/kmol\")\n",
+ "Mm=M1*x1+M2*x2+M3*x3\n",
+ "print(\"Mm=\"),round(Mm,2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.23;page no:33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.23, Page:33 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 23\n",
+ "mole fraction of constituent gases\n",
+ "x=(ni/n)=(Vi/V)\n",
+ "take volume of mixture(V)=1 m^3\n",
+ "mole fraction of O2(x1)\n",
+ "x1= 0.18\n",
+ "mole fraction of N2(x2)\n",
+ "x2= 0.75\n",
+ "mole fraction of CO2(x3)\n",
+ "x3= 0.07\n",
+ "now molecular weight of mixture = molar mass(m)\n",
+ "m= 29.84\n",
+ "now gravimetric analysis refers to the mass fraction analysis\n",
+ "mass fraction of constituents\n",
+ "y=xi*Mi/m\n",
+ "mole fraction of O2\n",
+ "y1= 0.193\n",
+ "mole fraction of N2\n",
+ "y2= 0.704\n",
+ "mole fraction of CO2\n",
+ "y3= 0.103\n",
+ "now partial pressure of constituents = volume fraction * pressure of mixture\n",
+ "Pi=xi*P\n",
+ "partial pressure of O2(P1)in Mpa\n",
+ "P1= 0.09\n",
+ "partial pressure of N2(P2)in Mpa\n",
+ "P2= 0.375\n",
+ "partial pressure of CO2(P3)in Mpa\n",
+ "P3= 0.04\n",
+ "NOTE=>Their is some calculation mistake for partial pressure of CO2(i.e 0.35Mpa)which is given wrong in book so it is corrected above hence answers may vary.\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of pressure difference\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.23, Page:33 \\n \\n\"\n",
+ "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 23\")\n",
+ "V1=0.18;#volume fraction of O2 in m^3\n",
+ "V2=0.75;#volume fraction of N2 in m^3\n",
+ "V3=0.07;#volume fraction of CO2 in m^3\n",
+ "P=0.5;#pressure of mixture in Mpa\n",
+ "T=(107+273);#temperature of mixture in k\n",
+ "M1=32;#molar mass of O2\n",
+ "M2=28;#molar mass of N2\n",
+ "M3=44;#molar mass of CO2\n",
+ "print(\"mole fraction of constituent gases\")\n",
+ "print(\"x=(ni/n)=(Vi/V)\")\n",
+ "V=1;# volume of mixture in m^3\n",
+ "print(\"take volume of mixture(V)=1 m^3\")\n",
+ "print(\"mole fraction of O2(x1)\")\n",
+ "x1=V1/V\n",
+ "print(\"x1=\"),round(x1,2)\n",
+ "print(\"mole fraction of N2(x2)\")\n",
+ "x2=V2/V\n",
+ "print(\"x2=\"),round(x2,2)\n",
+ "print(\"mole fraction of CO2(x3)\")\n",
+ "x3=V3/V\n",
+ "print(\"x3=\"),round(x3,2)\n",
+ "print(\"now molecular weight of mixture = molar mass(m)\")\n",
+ "m=x1*M1+x2*M2+x3*M3\n",
+ "print(\"m=\"),round(m,2)\n",
+ "print(\"now gravimetric analysis refers to the mass fraction analysis\")\n",
+ "print(\"mass fraction of constituents\")\n",
+ "print(\"y=xi*Mi/m\")\n",
+ "print(\"mole fraction of O2\")\n",
+ "y1=x1*M1/m\n",
+ "print(\"y1=\"),round(y1,3)\n",
+ "print(\"mole fraction of N2\")\n",
+ "y2=x2*M2/m\n",
+ "print(\"y2=\"),round(y2,3)\n",
+ "print(\"mole fraction of CO2\")\n",
+ "y3=x3*M3/m\n",
+ "print(\"y3=\"),round(y3,3)\n",
+ "print(\"now partial pressure of constituents = volume fraction * pressure of mixture\")\n",
+ "print(\"Pi=xi*P\")\n",
+ "print(\"partial pressure of O2(P1)in Mpa\")\n",
+ "p1=x1*P\n",
+ "print(\"P1=\"),round(p1,2)\n",
+ "print(\"partial pressure of N2(P2)in Mpa\")\n",
+ "P2=x2*P\n",
+ "print(\"P2=\"),round(P2,3)\n",
+ "P3=x3*P\n",
+ "print(\"partial pressure of CO2(P3)in Mpa\")\n",
+ "print(\"P3=\"),round(P3,2)\n",
+ "print(\"NOTE=>Their is some calculation mistake for partial pressure of CO2(i.e 0.35Mpa)which is given wrong in book so it is corrected above hence answers may vary.\")\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.24;page no:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.24, Page:34 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 24\n",
+ "volume of tank of N2(V1) in m^3= 3.0\n",
+ "volume of tank of CO2(V2) in m^3= 3.0\n",
+ "taking the adiabatic condition\n",
+ "no. of moles of N2(n1)\n",
+ "n1= 0.6\n",
+ "no. of moles of CO2(n2)\n",
+ "n2= 0.37\n",
+ "total no. of moles of mixture(n)in mol\n",
+ "n= 0.97\n",
+ "gas constant for N2(R1)in J/kg k\n",
+ "R1= 296.93\n",
+ "gas constant for CO2(R2)in J/kg k\n",
+ "R2=R/M2 188.95\n",
+ "specific heat of N2 at constant volume (Cv1) in J/kg k\n",
+ "Cv1= 742.32\n",
+ "specific heat of CO2 at constant volume (Cv2) in J/kg k\n",
+ "Cv2= 629.85\n",
+ "mass of N2(m1)in kg\n",
+ "m1= 16.84\n",
+ "mass of CO2(m2)in kg\n",
+ "m2= 16.28\n",
+ "let us consider the equilibrium temperature of mixture after adiabatic mixing at T\n",
+ "applying energy conservation principle\n",
+ "m1*Cv1*(T-T1) = m2*Cv2*(T-T2)\n",
+ "equlibrium temperature(T)in k\n",
+ "=>T= 439.44\n",
+ "so the equlibrium pressure(P)in kpa\n",
+ "P= 591.55\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of equilibrium temperature,pressure of mixture\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.24, Page:34 \\n \\n\"\n",
+ "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 24\")\n",
+ "V=6;#volume of tank in m^3\n",
+ "P1=800*10**3;#pressure of N2 gas tank in pa\n",
+ "T1=480.;#temperature of N2 gas tank in k\n",
+ "P2=400*10**3;#pressure of CO2 gas tank in pa\n",
+ "T2=390.;#temperature of CO2 gas tank in k\n",
+ "k1=1.4;#ratio of specific heat capacity for N2\n",
+ "k2=1.3;#ratio of specific heat capacity for CO2\n",
+ "R=8314.;#universal gas constant in J/kg k\n",
+ "M1=28.;#molecular weight of N2\n",
+ "M2=44.;#molecular weight of CO2\n",
+ "V1=V/2\n",
+ "print(\"volume of tank of N2(V1) in m^3=\"),round(V1,2)\n",
+ "V2=V/2\n",
+ "print(\"volume of tank of CO2(V2) in m^3=\"),round(V2,2)\n",
+ "print(\"taking the adiabatic condition\")\n",
+ "print(\"no. of moles of N2(n1)\")\n",
+ "n1=(P1*V1)/(R*T1)\n",
+ "print(\"n1=\"),round(n1,2)\n",
+ "print(\"no. of moles of CO2(n2)\")\n",
+ "n2=(P2*V2)/(R*T2)\n",
+ "print(\"n2=\"),round(n2,2)\n",
+ "print(\"total no. of moles of mixture(n)in mol\")\n",
+ "n=n1+n2\n",
+ "print(\"n=\"),round(n,2)\n",
+ "print(\"gas constant for N2(R1)in J/kg k\")\n",
+ "R1=R/M1\n",
+ "print(\"R1=\"),round(R1,2)\n",
+ "print(\"gas constant for CO2(R2)in J/kg k\")\n",
+ "R2=R/M2\n",
+ "print(\"R2=R/M2\"),round(R2,2)\n",
+ "print(\"specific heat of N2 at constant volume (Cv1) in J/kg k\")\n",
+ "Cv1=R1/(k1-1)\n",
+ "print(\"Cv1=\"),round(Cv1,2)\n",
+ "print(\"specific heat of CO2 at constant volume (Cv2) in J/kg k\")\n",
+ "Cv2=R2/(k2-1)\n",
+ "print(\"Cv2=\"),round(Cv2,2)\n",
+ "print(\"mass of N2(m1)in kg\")\n",
+ "m1=n1*M1\n",
+ "print(\"m1=\"),round(m1,2)\n",
+ "print(\"mass of CO2(m2)in kg\")\n",
+ "m2=n2*M2\n",
+ "print(\"m2=\"),round(m2,2)\n",
+ "print(\"let us consider the equilibrium temperature of mixture after adiabatic mixing at T\")\n",
+ "print(\"applying energy conservation principle\")\n",
+ "print(\"m1*Cv1*(T-T1) = m2*Cv2*(T-T2)\")\n",
+ "print(\"equlibrium temperature(T)in k\")\n",
+ "T=((m1*Cv1*T1)+(m2*Cv2*T2))/((m1*Cv1)+(m2*Cv2))\n",
+ "print(\"=>T=\"),round(T,2)\n",
+ "print(\"so the equlibrium pressure(P)in kpa\")\n",
+ "P=(n*R*T)/(1000*V)\n",
+ "print(\"P=\"),round(P,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.25;page no:35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.25, Page:35 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 25\n",
+ "since two gases are non reacting therefore specific heat of final mixture(Cp)in KJ/kg k can be obtained by following for adiabatic mixing\n",
+ "so the specific heat at constant pressure(Cp)in KJ/kg k\n",
+ "Cp= 7.608\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of specific heat of final mixture\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.25, Page:35 \\n \\n\"\n",
+ "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 25\")\n",
+ "m1=2;#mass of H2 in kg\n",
+ "m2=3;#mass of He in kg\n",
+ "T=100;#temperature of container in k\n",
+ "Cp1=11.23;#specific heat at constant pressure for H2 in KJ/kg k\n",
+ "Cp2=5.193;#specific heat at constant pressure for He in KJ/kg k\n",
+ "print(\"since two gases are non reacting therefore specific heat of final mixture(Cp)in KJ/kg k can be obtained by following for adiabatic mixing\")\n",
+ "print(\"so the specific heat at constant pressure(Cp)in KJ/kg k\")\n",
+ "Cp=((Cp1*m1)+Cp2*m2)/(m1+m2)\n",
+ "print(\"Cp=\"),round(Cp,3)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.26;page no:35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.26, Page:35 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 26\n",
+ "gas constant for H2(R1)in KJ/kg k\n",
+ "R1= 4.157\n",
+ "gas constant for N2(R2)in KJ/kg k\n",
+ "R2= 0.297\n",
+ "gas constant for CO2(R3)in KJ/kg k\n",
+ "R3= 0.189\n",
+ "so now gas constant for mixture(Rm)in KJ/kg k\n",
+ "Rm= 2.606\n",
+ "considering gas to be perfect gas\n",
+ "total mass of mixture(m)in kg\n",
+ "m= 30.0\n",
+ "capacity of vessel(V)in m^3\n",
+ "V= 231.57\n",
+ "now final temperature(Tf) is twice of initial temperature(Ti)\n",
+ "so take k=Tf/Ti=2\n",
+ "for constant volume heating,final pressure(Pf)in kpa shall be\n",
+ "Pf= 202.65\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of capacity and pressure in the vessel\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.26, Page:35 \\n \\n\"\n",
+ "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 26\")\n",
+ "m1=18.;#mass of hydrogen(H2) in kg\n",
+ "m2=10.;#mass of nitrogen(N2) in kg\n",
+ "m3=2.;#mass of carbon dioxide(CO2) in kg\n",
+ "R=8.314;#universal gas constant in KJ/kg k\n",
+ "Pi=101.325;#atmospheric pressure in kpa\n",
+ "T=(27+273.15);#ambient temperature in k\n",
+ "M1=2;#molar mass of H2\n",
+ "M2=28;#molar mass of N2\n",
+ "M3=44;#molar mass of CO2\n",
+ "print(\"gas constant for H2(R1)in KJ/kg k\")\n",
+ "R1=R/M1\n",
+ "print(\"R1=\"),round(R1,3)\n",
+ "print(\"gas constant for N2(R2)in KJ/kg k\")\n",
+ "R2=R/M2\n",
+ "print(\"R2=\"),round(R2,3)\n",
+ "print(\"gas constant for CO2(R3)in KJ/kg k\")\n",
+ "R3=R/M3\n",
+ "print(\"R3=\"),round(R3,3)\n",
+ "print(\"so now gas constant for mixture(Rm)in KJ/kg k\")\n",
+ "Rm=(m1*R1+m2*R2+m3*R3)/(m1+m2+m3)\n",
+ "print(\"Rm=\"),round(Rm,3)\n",
+ "print(\"considering gas to be perfect gas\")\n",
+ "print(\"total mass of mixture(m)in kg\")\n",
+ "m=m1+m2+m3\n",
+ "print(\"m=\"),round(m,2)\n",
+ "print(\"capacity of vessel(V)in m^3\")\n",
+ "V=(m*Rm*T)/Pi\n",
+ "print(\"V=\"),round(V,2)\n",
+ "print(\"now final temperature(Tf) is twice of initial temperature(Ti)\")\n",
+ "k=2;#ratio of initial to final temperature\n",
+ "print(\"so take k=Tf/Ti=2\") \n",
+ "print(\"for constant volume heating,final pressure(Pf)in kpa shall be\")\n",
+ "Pf=Pi*k\n",
+ "print(\"Pf=\"),round(Pf,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.27;page no:36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.27, Page:36 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 27\n",
+ "let inlet state be 1 and exit state be 2\n",
+ "by charles law volume and temperature can be related as\n",
+ "(V1/T1)=(V2/T2)\n",
+ "(V2/V1)=(T2/T1)\n",
+ "or (((math.pi*D2^2)/4)*V2)/(((math.pi*D1^2)/4)*V1)=T2/T1\n",
+ "since change in K.E=0\n",
+ "so (D2^2/D1^2)=T2/T1\n",
+ "D2/D1=sqrt(T2/T1)\n",
+ "say(D2/D1)=k\n",
+ "so exit to inlet diameter ratio(k) 1.29\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of exit to inlet diameter ratio\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "import math\n",
+ "print\"Example 1.27, Page:36 \\n \\n\"\n",
+ "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 27\")\n",
+ "T1=(27.+273.);#initial temperature of air in k\n",
+ "T2=500.;#final temperature of air in k\n",
+ "print(\"let inlet state be 1 and exit state be 2\")\n",
+ "print(\"by charles law volume and temperature can be related as\")\n",
+ "print(\"(V1/T1)=(V2/T2)\")\n",
+ "print(\"(V2/V1)=(T2/T1)\")\n",
+ "print(\"or (((math.pi*D2^2)/4)*V2)/(((math.pi*D1^2)/4)*V1)=T2/T1\")\n",
+ "print(\"since change in K.E=0\")\n",
+ "print(\"so (D2^2/D1^2)=T2/T1\")\n",
+ "print(\"D2/D1=sqrt(T2/T1)\")\n",
+ "print(\"say(D2/D1)=k\")\n",
+ "k=math.sqrt(T2/T1)\n",
+ "print(\"so exit to inlet diameter ratio(k)\"),round(k,2)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##example 1.28;page no:37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Example 1.28, Page:37 \n",
+ " \n",
+ "\n",
+ "Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 28\n",
+ "gas constant for H2(R1)in KJ/kg k\n",
+ "R1= 4.157\n",
+ "say initial and final ststes are given by 1 and 2\n",
+ "mass of hydrogen pumped out shall be difference of initial and final mass inside vessel\n",
+ "final pressure of hydrogen(P2)in cm of Hg\n",
+ "P2= 6.0\n",
+ "therefore pressure difference(P)in kpa\n",
+ "P= 93.33\n",
+ "mass pumped out(m)in kg\n",
+ "m=((P1*V1)/(R1*T1))-((P2*V2)/(R1*T2))\n",
+ "here V1=V2=V and T1=T2=T\n",
+ "so m= 0.15\n",
+ "now during cooling upto 10 degree celcius,the process may be consider as constant volume process\n",
+ "say state before and after cooling are denoted by suffix 2 and 3\n",
+ "final pressure after cooling(P3)in kpa\n",
+ "P3= 7.546\n"
+ ]
+ }
+ ],
+ "source": [
+ "#cal of final pressure\n",
+ "#intiation of all variables\n",
+ "# Chapter 1\n",
+ "print\"Example 1.28, Page:37 \\n \\n\"\n",
+ "print(\"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 28\")\n",
+ "V=2;#volume of vessel in m^3\n",
+ "P1=76;#initial pressure or atmospheric pressure in cm of Hg\n",
+ "T=(27+273.15);#temperature of vessel in k\n",
+ "p=70;#final pressure in cm of Hg vaccum\n",
+ "R=8.314;#universal gas constant in KJ/kg k\n",
+ "M=2;#molecular weight of H2\n",
+ "print(\"gas constant for H2(R1)in KJ/kg k\")\n",
+ "R1=R/M\n",
+ "print(\"R1=\"),round(R1,3)\n",
+ "print(\"say initial and final ststes are given by 1 and 2\")\n",
+ "print(\"mass of hydrogen pumped out shall be difference of initial and final mass inside vessel\")\n",
+ "print(\"final pressure of hydrogen(P2)in cm of Hg\")\n",
+ "P2=P1-p\n",
+ "print(\"P2=\"),round(P2,2)\n",
+ "print(\"therefore pressure difference(P)in kpa\")\n",
+ "P=((P1-P2)*101.325)/76\n",
+ "print(\"P=\"),round(P,2)\n",
+ "print(\"mass pumped out(m)in kg\")\n",
+ "print(\"m=((P1*V1)/(R1*T1))-((P2*V2)/(R1*T2))\")\n",
+ "print(\"here V1=V2=V and T1=T2=T\")\n",
+ "m=(V*P)/(R1*T)\n",
+ "print(\"so m=\"),round(m,2)\n",
+ "print(\"now during cooling upto 10 degree celcius,the process may be consider as constant volume process\")\n",
+ "print(\"say state before and after cooling are denoted by suffix 2 and 3\")\n",
+ "T3=(10+273.15);#final temperature after cooling in k\n",
+ "print(\"final pressure after cooling(P3)in kpa\")\n",
+ "P3=(T3/T)*P2*(101.325/76)\n",
+ "print(\"P3=\"),round(P3,3)\n",
+ "\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}