summaryrefslogtreecommitdiff
path: root/1919/CH1/EX1.4/Ex1_4.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1919/CH1/EX1.4/Ex1_4.sce
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/CH1/EX1.4/Ex1_4.sce')
-rwxr-xr-x1919/CH1/EX1.4/Ex1_4.sce21
1 files changed, 21 insertions, 0 deletions
diff --git a/1919/CH1/EX1.4/Ex1_4.sce b/1919/CH1/EX1.4/Ex1_4.sce
new file mode 100755
index 000000000..40ddc0109
--- /dev/null
+++ b/1919/CH1/EX1.4/Ex1_4.sce
@@ -0,0 +1,21 @@
+// Theory and Problems of Thermodynamics
+// Chapter 1
+// Basic Concepts
+// Example 4
+
+clear ;clc;
+
+//Given data
+Pf = 0.4 //Pf = pressure of the gas in MPa
+Pa = 0.1 //Pa = atmospheric pressure in MPa
+A = 10^-2 // A = cross-sectional area of piston in m^2
+Vi = 0.1 // initial volume in m^3
+Vf = 0.2 // final volume in m^3
+
+//Calculate spring force constant
+Pf = Pf * 10^6; // units conversion MPa to Pa
+Pa = Pa * 10^6; // units conversion MPa to Pa
+K = (Pf-Pa)*A^2/(Vf-Vi); //spring force constant
+
+// Results
+mprintf('Spring force constant = %3.0f N/m', K)