summaryrefslogtreecommitdiff
path: root/32/CH7/EX7.14
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /32/CH7/EX7.14
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 '32/CH7/EX7.14')
-rwxr-xr-x32/CH7/EX7.14/7_14.sce33
1 files changed, 33 insertions, 0 deletions
diff --git a/32/CH7/EX7.14/7_14.sce b/32/CH7/EX7.14/7_14.sce
new file mode 100755
index 000000000..66c910907
--- /dev/null
+++ b/32/CH7/EX7.14/7_14.sce
@@ -0,0 +1,33 @@
+//pathname=get_absolute_file_path('7.14.sce')
+//filename=pathname+filesep()+'7.14-data.sci'
+//exec(filename)
+//Volume of compartment A(in m^3):
+Va=6
+//Volume of compartment B(in m^3):
+Vb=4
+//Pressure in compartment A(in bar):
+p1=6
+//Temperature in compartment A(in K):
+T1=600
+//Atmosheric pressure(in bar):
+p0=1
+//Atmosheric temperature(in K):
+T0=300
+//Adiabatic index of compression:
+r=1.4
+//Gas constant(in J/kg.K):
+R=0.287
+//Value of Cv(in kJ/kg.K):
+Cv=0.718
+//Final volume(in m^3):
+V2=Va+Vb
+//Final temperature(in K):
+T2=T1*(Va/V2)^(r-1)
+//Mass of air(in kg):
+m=p1*10^5*Va/(R*10^3*T1)
+//Change in entropy of control system(in kJ/kg.K):
+dSs=m*(Cv*log(T2/T1)+R*log(V2/Va))
+//Loss of available energy or irreversibilty(in kJ):
+I=T0*dSs
+printf("\nRESULT")
+printf("\nLoss of available energy = %f kJ",-I) \ No newline at end of file