summaryrefslogtreecommitdiff
path: root/2090/CH2/EX2.5/Chapter2_example5.sce
diff options
context:
space:
mode:
Diffstat (limited to '2090/CH2/EX2.5/Chapter2_example5.sce')
-rwxr-xr-x2090/CH2/EX2.5/Chapter2_example5.sce23
1 files changed, 23 insertions, 0 deletions
diff --git a/2090/CH2/EX2.5/Chapter2_example5.sce b/2090/CH2/EX2.5/Chapter2_example5.sce
new file mode 100755
index 000000000..483d22229
--- /dev/null
+++ b/2090/CH2/EX2.5/Chapter2_example5.sce
@@ -0,0 +1,23 @@
+clc
+clear
+//Input data
+Pm=7;//The mean effective pressure of a diesel cycle in bar
+r=12;//The compression ratio
+P1=1;//Initial pressure in bar
+g=1.4;//Isentropic index
+
+//Calculations
+function[f] = F(x);//function definition
+ f = 45.4*x- 12*x^1.4 -64.2;
+endfunction
+x = 1;//Initial guss
+function[z] = D(x)//Derivative
+ z= 3*x^2 - 3;
+endfunction
+y = fsolve(x,F, D);
+C=y;//The cut off ratio
+na=[1-(1/(r^(g-1)))*[((C^g)-1)/(g*(C-1))]]*100;//Air standard efficiency
+
+//Output
+printf('The cut off ratio = %3.1f \n The air standard efficiency = %3.2f percent ',C,na)
+