summaryrefslogtreecommitdiff
path: root/2090/CH4/EX4.1/Chapter4_Example1.sce
diff options
context:
space:
mode:
Diffstat (limited to '2090/CH4/EX4.1/Chapter4_Example1.sce')
-rwxr-xr-x2090/CH4/EX4.1/Chapter4_Example1.sce12
1 files changed, 12 insertions, 0 deletions
diff --git a/2090/CH4/EX4.1/Chapter4_Example1.sce b/2090/CH4/EX4.1/Chapter4_Example1.sce
new file mode 100755
index 000000000..53b49c86b
--- /dev/null
+++ b/2090/CH4/EX4.1/Chapter4_Example1.sce
@@ -0,0 +1,12 @@
+clc
+clear
+//Input data
+r=8.5;//The compression ratio
+sv=1.4;//The specific heat at constant volume in percent
+
+//Calculations
+n=1-(1/r)^(sv-1);//The efficiency of the otto cycle
+ef=[((1-n)/n)*(sv-1)*(log(r))*(sv/100)]*100;//The percentage change in efficiency of an otto cycle and is negative
+
+//Output
+printf('The efficiency decreases by %3.3f percent ',ef)