summaryrefslogtreecommitdiff
path: root/Engineering_Thermodynamics_by_O_Singh/1-Fundamental_Concepts_And_Definitions.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Engineering_Thermodynamics_by_O_Singh/1-Fundamental_Concepts_And_Definitions.ipynb')
-rw-r--r--Engineering_Thermodynamics_by_O_Singh/1-Fundamental_Concepts_And_Definitions.ipynb1322
1 files changed, 1322 insertions, 0 deletions
diff --git a/Engineering_Thermodynamics_by_O_Singh/1-Fundamental_Concepts_And_Definitions.ipynb b/Engineering_Thermodynamics_by_O_Singh/1-Fundamental_Concepts_And_Definitions.ipynb
new file mode 100644
index 0000000..d297a67
--- /dev/null
+++ b/Engineering_Thermodynamics_by_O_Singh/1-Fundamental_Concepts_And_Definitions.ipynb
@@ -0,0 +1,1322 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1: Fundamental Concepts And Definitions"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.10: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_10.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('atmospheric pressure(Patm)in kpa')\n",
+"Patm=(rho*g*h)/1000\n",
+"disp('absolute temperature in compartment A(Pa) in kpa')\n",
+"disp('Paa=Pga+Patm')\n",
+"Pa=Pga+Patm\n",
+"disp('absolute temperature in compartment B(Pb) in kpa')\n",
+"disp('Pb=Pgb+Patm')\n",
+"Pb=Pgb+Patm\n",
+"disp('absolute pressure in compartments in A & B=496.06 kpa & 246.06 kpa')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.11: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_11.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('the pressure of air in air tank can be obtained by equalising pressures at some reference line')\n",
+"disp('P1+RHOw*g*h1+RHOo*g*h2 = Patm+RHOm*g*h3')\n",
+"disp('so P1 = Patm+RHOm*g*h3-RHOw*g*h1-RHOo*g*h2')\n",
+"disp('air pressure(P1)in kpa')\n",
+"P1=(Patm+RHOm*g*h3-RHOw*g*h1-RHOo*g*h2)/1000"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.12: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_12.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('mass of object(m)in kg')\n",
+"disp('m=F/g')\n",
+"m=F/g\n",
+"disp('kinetic energy(E)in J is given by')\n",
+"disp('E=m*v^2/2')\n",
+"E=m*v^2/2"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.13: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_13.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('characteristics gas constant(R2)in kJ/kg k')\n",
+"R2=Cp-Cv\n",
+"disp('molecular weight of gas(m)in kg/kg mol')\n",
+"m=R1/R2\n",
+"disp('NOTE=>Their is some calculation mistake while calaulating gas constant in book,which is corrected above hence answer may vary.')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.14: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_14.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('using perfect gas equation')\n",
+"disp('P1*V1/T1 = P2*V2/T2')\n",
+"disp('=>T2=(P2*V2*T1)/(P1*V1)')\n",
+"disp('so final temperature of gas(T2)in k')\n",
+"T2=(P2*V2*T1)/(P1*V1)\n",
+"disp('or final temperature of gas(T2)in degree celcius')\n",
+"T2=T2-273"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.15: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_15.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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=(7+273);//final temperature of air in K\n",
+"R=287;//gas constant on J/kg k\n",
+"disp('from perfect gas equation we get')\n",
+"disp('initial mass of air(m1 in kg)=(P1*V1)/(R*T1)')\n",
+"m1=(P1*V1)/(R*T1)\n",
+"disp('final mass of air(m2 in kg)=(P2*V2)/(R*T2)')\n",
+"m2=(P2*V2)/(R*T2)\n",
+"disp('mass of air removed(m)in kg')\n",
+"m=m1-m2\n",
+"disp('volume of this mass of air(V) at initial states in m^3')\n",
+"V=m*R*T1/P1"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.16: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_16.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('here V1=V2')\n",
+"disp('so P1/T1=P2/T2')\n",
+"disp('final temperature of hydrogen gas(T2)in k')\n",
+"disp('=>T2=P2*T1/P1')\n",
+"T2=P2*T1/P1\n",
+"disp('now R=(Cp-Cv) in KJ/kg k')\n",
+"R=Cp-Cv\n",
+"disp('And volume of cylinder(V1)in m^3')\n",
+"disp('V1=(%pi*d^2*l)/4')\n",
+"V1=(%pi*d^2*l)/4\n",
+"disp('mass of hydrogen gas(m)in kg')\n",
+"disp('m=(P1*V1)/(1000*R*T1)')\n",
+"m=(P1*V1)/(1000*R*T1)\n",
+"disp('now heat supplied(Q)in KJ')\n",
+"disp('Q=m*Cv*(T2-T1)')\n",
+"Q=m*Cv*(T2-T1)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.17: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_17.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('final total volume(V)in m^3')\n",
+"disp('V=V1*V2')\n",
+"V=V1*V2\n",
+"disp('total mass of air(m)in kg')\n",
+"disp('m=m1+m2')\n",
+"m=m1+m2\n",
+"disp('final pressure of air(P)in kpa')\n",
+"disp('using perfect gas equation')\n",
+"disp('P=(m*R*T)/(1000*V)')\n",
+"P=(m*R*T)/(1000*V)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.18: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_18.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('1.By considering it as a PERFECT GAS')\n",
+"disp('gas constant for CO2(Rco2)')\n",
+"disp('Rco2=R/M')\n",
+"Rco2=R/M\n",
+"disp('Also P*V=M*Rco2*T')\n",
+"disp('pressure of CO2 as perfect ga(P)in N/m^2')\n",
+"disp('P=(m*Rco2*T)/V ')\n",
+"P=(m*Rco2*T)/V\n",
+"disp('2.By considering as a REAL GAS')\n",
+"disp('values of vanderwaal constants a,b can be seen from the table which are')\n",
+"disp('a=3628.5*10^2 N m^4/(kg mol)^2 ')\n",
+"disp('b=3.14*10^-2 m^3/kg mol')\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",
+"disp('now specific volume(v)in m^3/kg mol')\n",
+"disp('v=V*M/m')\n",
+"v=V*M/m\n",
+"disp('now substituting the value of all variables in vanderwaal equation')\n",
+"disp('(P+(a/v^2))*(v-b)=R*T')\n",
+"disp('pressure of CO2 as real gas(P)in N/m^2')\n",
+"disp('P=((R*T)/(v-b))-(a/v^2)')\n",
+"P=((R*T)/(v-b))-(a/v^2)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.19: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_19.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('1.considering as perfect gas')\n",
+"disp('specific volume(V)in m^3/kg')\n",
+"disp('V=R*T/P')\n",
+"V=R*T/P\n",
+"disp('2.considering compressibility effects')\n",
+"disp('reduced pressure(P)in pa')\n",
+"disp('p=P/(Pc*1000)')\n",
+"p=P/(Pc*1000)\n",
+"disp('reduced temperature(t)in k')\n",
+"disp('t=T/Tc')\n",
+"t=T/Tc\n",
+"disp('from generalised compressibility chart,compressibility factor(Z)can be seen for reduced pressure and reduced temperatures of 0.8 and 1.1')\n",
+"disp('we get Z=0.785')\n",
+"Z=0.785;//compressibility factor\n",
+"disp('now actual specific volume(v)in m^3/kg')\n",
+"disp('v=Z*V')\n",
+"v=Z*V"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.1: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_1.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('pressure difference(p)in pa')\n",
+"disp('p=rho*g*h')\n",
+"p=rho*g*h"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.20: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_20.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('volume of ballon(V1)in m^3')\n",
+"disp('V1=(4/3)*%pi*(d/2)^3')\n",
+"V1=(4/3)*%pi*(d/2)^3\n",
+"disp('molecular mass of hydrogen(M)')\n",
+"disp('M=2')\n",
+"M=2;//molecular mass of hydrogen\n",
+"disp('gas constant for H2(R1)in J/kg k')\n",
+"disp('R1=R/M')\n",
+"R1=R/M\n",
+"disp('mass of H2 in ballon(m1)in kg')\n",
+"disp('m1=(P*V1)/(R1*T1)')\n",
+"m1=(P*V1)/(R1*T1)\n",
+"disp('volume of air displaced(V2)=volume of ballon(V1)')\n",
+"disp('mass of air displaced(m2)in kg')\n",
+"disp('m2=(P*V1)/(R2*T2)')\n",
+"disp('gas constant for air(R2)=0.287 KJ/kg k')\n",
+"R2=0.287*1000;//gas constant for air in J/kg k\n",
+"m2=(P*V1)/(R2*T2)\n",
+"disp('load lifting capacity due to buoyant force(m)in kg')\n",
+"disp('m=m2-m1')\n",
+"m=m2-m1"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.21: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_21.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('let initial receiver pressure(p1)=1 in pa')\n",
+"p1=1;//initial receiver pressure in pa\n",
+"disp('so final receiver pressure(p2)=p1/4 in pa')\n",
+"p2=p1/4\n",
+"disp('perfect gas equation,p*V*m=m*R*T')\n",
+"disp('differentiating and then integrating equation w.r.t to time(t) ')\n",
+"disp('we get t=-(V/v)*log(p2/p1)')\n",
+"disp('so time(t)in min')\n",
+"t=-(V/v)*log(p2/p1)\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.22: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_22.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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.8;//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",
+"disp('first calculate gas constants for different gases in j/kg k')\n",
+"disp('for nitrogen,R1=R/M1')\n",
+"R1=R/M1\n",
+"disp('for oxygen,R2=R/M2')\n",
+"R2=R/M2\n",
+"disp('for carbon dioxide,R3=R/M3')\n",
+"R3=R/M3\n",
+"disp('so the gas constant for mixture(Rm)in j/kg k')\n",
+"disp('Rm=f1*R1+f2*R2+f3*R3')\n",
+"Rm=f1*R1+f2*R2+f3*R3\n",
+"disp('now the specific heat at constant pressure for constituent gases in KJ/kg k')\n",
+"disp('for nitrogen,Cp1=((k1/(k1-1))*R1)/1000')\n",
+"Cp1=((k1/(k1-1))*R1)/1000\n",
+"disp('for oxygen,Cp2=((k2/(k2-1))*R2)/1000')\n",
+"Cp2=((k2/(k2-1))*R2)/1000\n",
+"disp('for carbon dioxide,Cp3=((k3/(k3-1))*R3)/1000')\n",
+"Cp3=((k3/(k3-1))*R3)/1000\n",
+"disp('so the specific heat at constant pressure for mixture(Cpm)in KJ/kg k')\n",
+"disp('Cpm=f1*Cp1+f2*Cp2+f3*Cp3')\n",
+"Cpm=f1*Cp1+f2*Cp2+f3*Cp3\n",
+"disp('now no. of moles of constituents gases')\n",
+"disp('for nitrogen,n1=m1/M1 in mol,where m1=f1*m in kg')\n",
+"m1=f1*m\n",
+"n1=m1/M1\n",
+"disp('for oxygen,n2=m2/M2 in mol,where m2=f2*m in kg')\n",
+"m2=f2*m\n",
+"n2=m2/M2\n",
+"disp('for carbon dioxide,n=m3/M3 in mol,where m3=f3*m in kg')\n",
+"m3=f3*m\n",
+"n3=m3/M3\n",
+"disp('total no. of moles in mixture in mol')\n",
+"disp('n=n1+n2+n3')\n",
+"n=n1+n2+n3\n",
+"disp('now mole fraction of constituent gases')\n",
+"disp('for nitrogen,x1=n1/n')\n",
+"x1=n1/n\n",
+"disp('for oxygen,x2=n2/n')\n",
+"x2=n2/n\n",
+"disp('for carbon dioxide,x3=n3/n')\n",
+"x3=n3/n\n",
+"disp('now the molecular weight of mixture(Mm)in kg/kmol')\n",
+"disp('Mm=M1*x1+M2*x2+M3*x3')\n",
+"Mm=M1*x1+M2*x2+M3*x3\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.23: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_23.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('mole fraction of constituent gases')\n",
+"disp('x=(ni/n)=(Vi/V)')\n",
+"disp('take volume of mixture(V)=1 m^3')\n",
+"V=1;// volume of mixture in m^3\n",
+"disp('mole fraction of O2(x1)')\n",
+"disp('x1=V1/V')\n",
+"x1=V1/V\n",
+"disp('mole fraction of N2(x2)')\n",
+"disp('x2=V2/V')\n",
+"x2=V2/V\n",
+"disp('mole fraction of CO2(x3)')\n",
+"disp('x3=V3/V')\n",
+"x3=V3/V\n",
+"disp('now molecular weight of mixture = molar mass(m)')\n",
+"disp('m=x1*M1+x2*M2+x3*M3')\n",
+"m=x1*M1+x2*M2+x3*M3\n",
+"disp('now gravimetric analysis refers to the mass fraction analysis')\n",
+"disp('mass fraction of constituents')\n",
+"disp('y=xi*Mi/m')\n",
+"disp('mole fraction of O2')\n",
+"disp('y1=x1*M1/m')\n",
+"y1=x1*M1/m\n",
+"disp('mole fraction of N2')\n",
+"disp('y2=x2*M2/m')\n",
+"y2=x2*M2/m\n",
+"disp('mole fraction of CO2')\n",
+"disp('y3=x3*M3/m')\n",
+"y3=x3*M3/m\n",
+"disp('now partial pressure of constituents = volume fraction * pressure of mixture')\n",
+"disp('Pi=xi*P')\n",
+"disp('partial pressure of O2(P1)in Mpa')\n",
+"disp('P1=x1*P')\n",
+"p1=x1*P\n",
+"disp('partial pressure of N2(P2)in Mpa')\n",
+"disp('P2=x2*P')\n",
+"P2=x2*P\n",
+"disp('partial pressure of CO2(P3)in Mpa')\n",
+"disp('P3=x3*P')\n",
+"P3=x3*P\n",
+"disp('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",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.24: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_24.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('volume of tank of N2(V1) in m^3')\n",
+"V1=V/2\n",
+"disp('volume of tank of CO2(V2) in m^3')\n",
+"V2=V/2\n",
+"disp('taking the adiabatic condition')\n",
+"disp('no. of moles of N2(n1)')\n",
+"disp('n1=(P1*V1)/(R*T1)')\n",
+"n1=(P1*V1)/(R*T1)\n",
+"disp('no. of moles of CO2(n2)')\n",
+"disp('n2=(P2*V2)/(R*T2)')\n",
+"n2=(P2*V2)/(R*T2)\n",
+"disp('total no. of moles of mixture(n)in mol')\n",
+"disp('n=n1+n2')\n",
+"n=n1+n2\n",
+"disp('gas constant for N2(R1)in J/kg k')\n",
+"disp('R1=R/M1')\n",
+"R1=R/M1\n",
+"disp('gas constant for CO2(R2)in J/kg k')\n",
+"disp('R2=R/M2')\n",
+"R2=R/M2\n",
+"disp('specific heat of N2 at constant volume (Cv1) in J/kg k')\n",
+"disp('Cv1=R1/(k1-1)')\n",
+"Cv1=R1/(k1-1)\n",
+"disp('specific heat of CO2 at constant volume (Cv2) in J/kg k')\n",
+"disp('Cv2=R2/(k2-1)')\n",
+"Cv2=R2/(k2-1)\n",
+"disp('mass of N2(m1)in kg')\n",
+"disp('m1=n1*M1')\n",
+"m1=n1*M1\n",
+"disp('mass of CO2(m2)in kg')\n",
+"disp('m2=n2*M2')\n",
+"m2=n2*M2\n",
+"disp('let us consider the equilibrium temperature of mixture after adiabatic mixing at T')\n",
+"disp('applying energy conservation principle')\n",
+"disp('m1*Cv1*(T-T1) = m2*Cv2*(T-T2)')\n",
+"disp('equlibrium temperature(T)in k')\n",
+"disp('=>T=((m1*Cv1*T1)+(m2*Cv2*T2))/((m1*Cv1)+(m2*Cv2))')\n",
+"T=((m1*Cv1*T1)+(m2*Cv2*T2))/((m1*Cv1)+(m2*Cv2))\n",
+"disp('so the equlibrium pressure(P)in kpa')\n",
+"disp('P=(n*R*T)/(1000*V)')\n",
+"P=(n*R*T)/(1000*V)\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.25: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_25.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('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",
+"disp('so the specific heat at constant pressure(Cp)in KJ/kg k')\n",
+"disp('Cp=((Cp1*m1)+Cp2*m2)/(m1+m2)')\n",
+"Cp=((Cp1*m1)+Cp2*m2)/(m1+m2)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.26: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_26.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('gas constant for H2(R1)in KJ/kg k')\n",
+"disp('R1=R/M1')\n",
+"R1=R/M1\n",
+"disp('gas constant for N2(R2)in KJ/kg k')\n",
+"disp('R2=R/M2')\n",
+"R2=R/M2\n",
+"disp('gas constant for CO2(R3)in KJ/kg k')\n",
+"disp('R3=R/M3')\n",
+"R3=R/M3\n",
+"disp('so now gas constant for mixture(Rm)in KJ/kg k')\n",
+"disp('Rm=(m1*R1+m2*R2+m3*R3)/(m1+m2+m3)')\n",
+"Rm=(m1*R1+m2*R2+m3*R3)/(m1+m2+m3)\n",
+"disp('considering gas to be perfect gas')\n",
+"disp('total mass of mixture(m)in kg')\n",
+"disp('m=m1+m2+m3')\n",
+"m=m1+m2+m3\n",
+"disp('capacity of vessel(V)in m^3')\n",
+"disp('V=(m*Rm*T)/Pi')\n",
+"V=(m*Rm*T)/Pi\n",
+"disp('now final temperature(Tf) is twice of initial temperature(Ti)')\n",
+"disp('so take k=Tf/Ti=2')\n",
+"k=2;//ratio of initial to final temperature \n",
+"disp('for constant volume heating,final pressure(Pf)in kpa shall be')\n",
+"disp('Pf=Pi*k')\n",
+"Pf=Pi*k\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.27: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_27.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('let inlet state be 1 and exit state be 2')\n",
+"disp('by charles law volume and temperature can be related as')\n",
+"disp('(V1/T1)=(V2/T2)')\n",
+"disp('(V2/V1)=(T2/T1)')\n",
+"disp('or (((%pi*D2^2)/4)*V2)/(((%pi*D1^2)/4)*V1)=T2/T1')\n",
+"disp('since Δ K.E=0')\n",
+"disp('so (D2^2/D1^2)=T2/T1')\n",
+"disp('D2/D1=sqrt(T2/T1)')\n",
+"disp('say(D2/D1)=k')\n",
+"disp('so exit to inlet diameter ratio(k)')\n",
+"k=sqrt(T2/T1)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.28: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_28.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 29')\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",
+"disp('gas constant for H2(R1)in KJ/kg k')\n",
+"disp('R1=R/M')\n",
+"R1=R/M\n",
+"disp('say initial and final ststes are given by 1 and 2')\n",
+"disp('mass of hydrogen pumped out shall be difference of initial and final mass inside vessel')\n",
+"disp('final pressure of hydrogen(P2)in cm of Hg')\n",
+"disp('P2=P1-p')\n",
+"P2=P1-p\n",
+"disp('therefore pressure difference(P)in kpa')\n",
+"disp('P=((P1-P2)*101.325)/76')\n",
+"P=((P1-P2)*101.325)/76\n",
+"disp('mass pumped out(m)in kg')\n",
+"disp('m=((P1*V1)/(R1*T1))-((P2*V2)/(R1*T2))')\n",
+"disp('here V1=V2=V and T1=T2=T')\n",
+"disp('so m=(V*(P1-P2))/(R1*T)')\n",
+"m=(V*P)/(R1*T)\n",
+"disp('now during cooling upto 10 degree celcius,the process may be consider as constant volume process')\n",
+"disp('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",
+"disp('final pressure after cooling(P3)in kpa')\n",
+"disp('P3=(T3/T)*P2*(101.325/76)')\n",
+"P3=(T3/T)*P2*(101.325/76)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.2: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_2.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('effort required for lifting the lid(E)in N')\n",
+"disp('E=(rho*g*h)*(3.14*d^2)/4')\n",
+"E=(rho*g*h)*(3.14*d^2)/4"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.3: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_3.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('pressure measured by manometer is gauge pressure(Pg)in kpa')\n",
+"disp('Pg=rho*g*h/10^3')\n",
+"Pg=rho*g*h/10^3\n",
+"disp('actual pressure of the air(P)in kpa')\n",
+"disp('P=Pg+Patm/10^3')\n",
+"P=Pg+Patm/10^3"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.4: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_4.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('density of oil(RHOoil)in kg/m^3')\n",
+"disp('RHOoil=sg*RHOw')\n",
+"RHOoil=sg*RHOw\n",
+"disp('gauge pressure(Pg)in kpa')\n",
+"disp('Pg=RHOoil*g*h/10^3')\n",
+"Pg=RHOoil*g*h/10^3"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.5: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_5.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('atmospheric pressure(Patm)in kpa')\n",
+"disp('Patm=rho*g*h2/10^3')\n",
+"Patm=rho*g*h2/10^3\n",
+"disp('pressure due to mercury column at AB(Pab)in kpa')\n",
+"disp('Pab=rho*g*h1/10^3')\n",
+"Pab=rho*g*h1/10^3\n",
+"disp('pressure exerted by gas(Pgas)in kpa')\n",
+"disp('Pgas=Patm+Pab')\n",
+"Pgas=Patm+Pab\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.6: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_6.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('by law of conservation of energy')\n",
+"disp('potential energy(m*g*h)in joule = heat required for heating water(m*Cp*deltaT*1000*4.18)in joule')\n",
+"disp('so m*g*h = m*Cp*deltaT*4.18*1000')\n",
+"disp('change in temperature of water(deltaT) in degree celcius')\n",
+"disp('deltaT=(g*h)/(4.18*1000*Cp)')\n",
+"deltaT=(g*h)/(4.18*1000*Cp)\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.7: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_7.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('mass of object(m)in kg')\n",
+"disp('m=w1/g1')\n",
+"m=w1/g1\n",
+"disp('spring balance reading=gravitational force in mass(F)in N')\n",
+"disp('F=m*g2')\n",
+"F=m*g2"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.8: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_8.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('pressure measured by manometer(P) in pa')\n",
+"disp('p=rho*g*h')\n",
+"p=rho*g*h\n",
+"disp('now weight of piston(m*g) = upward thrust by gas(p*%pi*d^2/4)')\n",
+"disp('mass of piston(m)in kg')\n",
+"disp('so m=(p*%pi*d^2)/(4*g)')\n",
+"m=(p*%pi*d^2)/(4*g)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.9: Engineering_Thermodynamics_by_Onkar_Singh_Chapter_1_Example_9.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Display mode\n",
+"mode(0);\n",
+"// Display warning for floating point exception\n",
+"ieee(1);\n",
+"clear;\n",
+"clc;\n",
+"disp('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",
+"disp('balancing pressure at plane BC in figure we get')\n",
+"disp('Psteam+Pwater=Patm+Pmercury')\n",
+"disp('now 1.atmospheric pressure(Patm)in pa')\n",
+"disp('Patm=RHOm*g*h1')\n",
+"Patm=RHOm*g*h1\n",
+"disp('2.pressure due to water(Pwater)in pa')\n",
+"disp('Pwater=RHOw*g*h2')\n",
+"Pwater=RHOw*g*h2\n",
+"disp('3.pressure due to mercury(Pmercury)in pa')\n",
+"disp('Pmercury=RHOm*g*h3')\n",
+"Pmercury=RHOm*g*h3\n",
+"disp('using balancing equation')\n",
+"disp('Psteam=Patm+Pmercury-Pwater')\n",
+"disp('so pressure of steam(Psteam)in kpa')\n",
+"disp('Psteam=(Patm+Pmercury-Pwater)/1000')\n",
+"Psteam=(Patm+Pmercury-Pwater)/1000"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}