blob: 17be6288cf8bf5b3300169deb1466567f22c1c18 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
////
//Variable Declaration
n = 1.0 //Number of moles of CO2
T = 300.0 //Temeperatures of Water bath, K
vi = 25.0 //Initial and final state Volume of Ideal Gas, L
vf = 10.0
R = 8.314 //Ideal Gas Constant, J/(mol.K)
//Calcualtions
qrev = n*R*T*log(vf/vi)
w = -qrev
dSsys = qrev/T
dSsur = -dSsys
dS = dSsys + dSsur
//Results
printf("\n Entropy change of surrounding is %4.1f J/(mol.K)",dSsur)
printf("\n Entropy change of system is %4.1f J/(mol.K)",dSsys)
printf("\n Total Entropy change is %4.1f J/(mol.K)",dS)
|