diff options
Diffstat (limited to '555/CH1')
-rw-r--r-- | 555/CH1/EX1.1/1.sce | 16 | ||||
-rw-r--r-- | 555/CH1/EX1.2/2.sce | 21 |
2 files changed, 37 insertions, 0 deletions
diff --git a/555/CH1/EX1.1/1.sce b/555/CH1/EX1.1/1.sce new file mode 100644 index 000000000..725617258 --- /dev/null +++ b/555/CH1/EX1.1/1.sce @@ -0,0 +1,16 @@ +// Implementation of example 1.1
+// Basic and Applied Thermodynamics by P.K.Nag
+// page 20
+clc
+clear
+
+z=562 // (difference in height of mercury in two limbs in mm)
+g=9.79 // (acceleration due to gravity in m/s^2)
+z0=761 // (barometer reading in mm Hg)
+d=13640 // (density of mercury in kg/m^3)
+
+// p= p0 + (d*g*z) & p0=(d*g*z)so
+p=(d*g)*(z+z0)/1000; // division by 1000 is done to convert mm to m
+p=(p/100000); // here division by 100000 is done to convert kPa to atm
+printf("The gas pressure = %.2f bar",p);
+// end
\ No newline at end of file diff --git a/555/CH1/EX1.2/2.sce b/555/CH1/EX1.2/2.sce new file mode 100644 index 000000000..4115e6b23 --- /dev/null +++ b/555/CH1/EX1.2/2.sce @@ -0,0 +1,21 @@ +// Implementation of example 1.2
+// Basic and Applied Thermodynamics by P.K.Nag
+// page 21
+
+clc
+clear
+
+gp=1.4d6 // (gauge pressure in Pa)
+z=710 // (vacuum in mm Hg)
+z0=772 // (barometric pressure in mm Hg)
+d=13.6d3 // (density of mercury)
+
+p0=(d*g*z0)/1000; // division by 1000 is done to convert mm to m
+sp=(gp+p0);
+sp=sp/1d6;
+printf("Inlet steam pressure = %.2f Mpa",sp);
+printf("\n");
+cp=(z0-z)*(g*d)/1000; // division by 1000 is done to convert mm to m
+cp=cp/1000; // division by 1000 is done to convert Pa to kPa
+printf("Condenser pressure = %.2f kPa",cp);
+// end
\ No newline at end of file |