blob: 6b331133acfc07d55b98b05aae6a2fea7d8d0ebc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
clc
clear
//Initialization of variables
tc=32 //F
th=80 //F
mw=5 //lbm
mi=1 //lbm
P=14.7 //psia
cp=1
//calculations
t= (-144*mi+tc*mi+th*mw)/(mw+mi)
ds1=144/(tc+460)
ds2=cp*log((460+t)/(460+tc))
dsice=ds1+ds2
dswater=mw*cp*log((t+460)/(460+th))
ds=dsice+dswater
//results
printf("Change in entropy of the process = %.4f Btu/R",ds)
disp("The answer is a bit different due to rounding off error in textbook")
|