summaryrefslogtreecommitdiff
path: root/555/CH5/EX5.2/2.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /555/CH5/EX5.2/2.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '555/CH5/EX5.2/2.sce')
-rw-r--r--555/CH5/EX5.2/2.sce28
1 files changed, 28 insertions, 0 deletions
diff --git a/555/CH5/EX5.2/2.sce b/555/CH5/EX5.2/2.sce
new file mode 100644
index 000000000..508d322da
--- /dev/null
+++ b/555/CH5/EX5.2/2.sce
@@ -0,0 +1,28 @@
+// Implementation of example 5.2
+// Basic and Applied Thermodynamics by P.K.Nag
+
+clc
+clear
+
+//Work done W, Velocity V, Pressure p, Specific volume v, Height Z
+W = 135;//kJ/kg
+Q = - 9;//kJ/kg
+v1 = 0.37; //m^3/kg
+p1 = 600;//kPa
+V1 = 16;//m/s
+Z1 = 32;//m
+v2 = 0.62;
+p2 = 100;
+V2 = 270;
+Z2 = 0;
+g = 9.81;//m/s^2
+//First law:
+//u1 + p1v1 + V1^2/2 + Z1g + dQ/dm = u2+ p2v2 + V2^2/2 + Z2g + dW/dm
+//Change in specific internal energy 'dU'
+dU = (p2*v2 - p1*v1) + (V2^2 - V1^2)*10^(-3)/2 + (Z2 - Z1)*g*10^(-3) + W - Q;
+if(dU>0)
+ printf('Specific internal energy decreases by %0.3f kJ',dU);
+else
+ printf('Specific internal energy increases by %0.3f kJ',-dU);
+end
+// end \ No newline at end of file