blob: ec83422f01875f1ce1c2a76f11e6325e8aeffc40 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
clc
//Initialization of variables
T2=546.6 //R
T1=520 //R
T3=560 //R
v2=1389.2
v1=186.2
R0=1.986
c1=5.02
c2=4.97
n1=1
n2=2
v3=1203
//calculations
ds1=n1*c1*log(T2/T1) + n1*R0*log(v2/v1)
ds2=n2*c2*log(T2/T3)+n2*R0*log(v2/v3)
ds=ds1+ds2
//results
printf("Net change in entropy = %.3f Btu/R",ds)
//The answer is a bit different due to rounding off error in the textbook
|