diff options
Diffstat (limited to '1919/CH1/EX1.12/Ex1_12.sce')
-rwxr-xr-x | 1919/CH1/EX1.12/Ex1_12.sce | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/1919/CH1/EX1.12/Ex1_12.sce b/1919/CH1/EX1.12/Ex1_12.sce new file mode 100755 index 000000000..f622c01d3 --- /dev/null +++ b/1919/CH1/EX1.12/Ex1_12.sce @@ -0,0 +1,26 @@ +// Theory and Problems of Thermodynamics
+// Chapter 1
+// Basic Concepts
+// Example 12
+
+clear ;clc;
+
+//Given data
+V1 = 0.1 //initial volume in m^3
+P1 = 200 //initial pressure in kPa
+Pa = 100 //ambient atmosphere pressure in kPa
+V2 = 0.2 //final volume in m^3
+P2 = 600 //final pressure in kPa
+
+//Calculate work done by gas
+// force balance at any instance gives
+// W = integrate('P','V',1,2) where P = Pa + K*(V-V0)/(A^2)
+// W = integrate('Pa + K*(V-V0)/(A^2)','V',1,2)
+// W = Pa*(V2-V1) + K*((V2-V0)^2 - (V1-V0)^2)/(2*A^2)
+// W = Pa*(V2-V1) + K*(V2-V1)*((V2-V0) + (V1-V0))/(2*A^2)
+// W = (V2-V1) * (Pa + (P2-Pa+P1-Pa)/2)
+
+W = (V2 - V1)*(P1 + P2)/2 //work done by gas in kJ
+
+// Results
+mprintf('Work done by gas = %2.0f kJ', W)
|