summaryrefslogtreecommitdiff
path: root/1919/CH2/EX2.7
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1919/CH2/EX2.7
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '1919/CH2/EX2.7')
-rwxr-xr-x1919/CH2/EX2.7/Ex2_7.sce27
1 files changed, 27 insertions, 0 deletions
diff --git a/1919/CH2/EX2.7/Ex2_7.sce b/1919/CH2/EX2.7/Ex2_7.sce
new file mode 100755
index 000000000..0f57b2e59
--- /dev/null
+++ b/1919/CH2/EX2.7/Ex2_7.sce
@@ -0,0 +1,27 @@
+// Theory and Problems of Thermodynamics
+// Chapter 2
+// First Law of Thermodynamics
+// Example 7
+
+clear ;clc;
+
+//Given data
+T1 = 300 // initial temperature in K
+P1 = 100 // initial pressure in kPa
+P2 = 1.5 // initial pressure in MPa
+r = 1.4 // r = CP/CV
+n = 1.2 //P(V^1.2) = constant
+R = 8.314 // gas constant in J/K
+
+// determine work done and energy transferred as heat
+P2 = P2 * 1000 // units conversion MPa to kPa
+V_12 = (P2/P1)^(1/1.2) //ratio of V1 and V2
+T2 = P2 * T1 / (P1 * V_12) // final temperature in K
+
+W = R * (T1 - T2)/(n-1); // work done on gas
+W = W/1000; // units conversion J to kJ
+Q = (R * (T1-T2)/(r-1))/1000 + W // energy transferred as heat
+
+// Results
+mprintf('Work done on gas = %5.4f kJ', W)
+mprintf('\n Energy transfered as heat = %5.3f kJ', Q)