summaryrefslogtreecommitdiff
path: root/1808/CH3/EX3.31/Chapter3_Exampl31.sce
blob: e00d2b8f210a462629132a004347756b2cd8a500 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
clc
clear
//INPUT DATA
t1=300;//temperature in Degree C
t2=700;//temperature in Degree C
p1=1;//pressure in bar
p3=12;//pressure in bar
R=0.287;//gas constant

//CALCULATIONS
ns=(1-(t1/t2))*100;//Thermal efficiency in percentage
Rc=((p3/p1)*(t1/t2));//compression ratio
wn=R*log(Rc)*(t2-t1);//net work done in kJ/kg
vs=(R*t1*(1-(1/Rc)))/(p1);//swept volume in m^3/kg
pm=wn/vs;//mean effective pressure in bar

//OUTPUT
printf('(i)Thermal efficiency is %3.2f percentage \n (ii)The mean effective pressure is %3.2f bar',ns,pm)