blob: 3d0e1de9528311d6a735affa94199a07e07cd960 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
clc
clear
//Initialization of variables
cp=0.25 //Btu/lbm R
T0=520 //R
T1=3460 //R
dG=21069 //Btu/lbm
dH=21502 //Btu/lbm
//calculations
dq=cp*(T0-T1)
ds=cp*log(T0/T1)
dE=dq-T0*ds
eta=dE/dq
dw=eta*dH
de=-dG+dw
//results
printf("Loss of available energy = %d Btu/lbm",de)
|