blob: 619a71d6522b4f11ba8c303dec4e20ce63e9c391 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
clc
clear
//Initialization of variables
cv=0.175 //Btu/lbm R
R0=1.986
M=29
T2=1040 //R
T1=520 //R
//calculations
cp=cv+R0/M
sab=cv*log(T2/T1)
sac=cp*log(T2/T1)
dqab=cv*(T2-T1)
dqca=cp*(T1-T2)
dqrev=T2*(sac-sab)
eta=(dqab+dqrev+dqca)/(dqab+dqrev)
//results
printf("Entropy in ab part = %.4f Btu/lbm R",sab)
printf("\n Entropy in ac part = %.4f Btu/lbm R",sac)
printf("\n Efficiency = %.2f percent",eta*100)
disp("The answers are a bit different due to rounding off error in textbook")
|