summaryrefslogtreecommitdiff
path: root/1922/CH4/EX4.22/4_22.sce
diff options
context:
space:
mode:
Diffstat (limited to '1922/CH4/EX4.22/4_22.sce')
-rwxr-xr-x1922/CH4/EX4.22/4_22.sce27
1 files changed, 27 insertions, 0 deletions
diff --git a/1922/CH4/EX4.22/4_22.sce b/1922/CH4/EX4.22/4_22.sce
new file mode 100755
index 000000000..053f6233b
--- /dev/null
+++ b/1922/CH4/EX4.22/4_22.sce
@@ -0,0 +1,27 @@
+clc
+clear
+//Initialization of variables
+pr=4
+k=1.4
+ta=298 //K
+pa=0.1 //Mpa
+pdr=0.01
+tc=900 //K
+pri=0.005 //Mpa
+//calculations
+pb=pr*pa
+nji=1- (pr)^((1-k)/k)
+tb=ta*(pb/pa)^((k-1)/k)
+pc=pb-pdr
+pd=pa+pri
+td=tc*(pd/pc)^((k-1)/k)
+//results
+p=[pa pb pc pd]
+t=[ta tb tc td]
+printf("ideal thermal efficiency = %.3f ",nji)
+disp("pressure (Mpa) = ")
+format('v',6);p
+disp(p)
+disp("temperature (K) = ")
+format('v',6);t
+disp(t)