summaryrefslogtreecommitdiff
path: root/2126/CH1/EX1.7/7.sce
blob: bef5ed0ea4e97ed165c29719fe2fc701ffc0540a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
clc
clear

//Input data
Pa=1.3 //Pressure at section-A in bar
Ta=50+273 //Temperature at section-A in K
Pb=1 //Pressure at section-B in bar
Tb=13+273 //Temperature at section-B in K
Cp=1005 //Specific heat capacity at constant pressure in J/kg-K
R=287 //Specific gas constant in J/kg-K

//Calculation
ds=((Cp*log(Tb/Ta))-(R*log(Pb/Pa)))*10^-3 //The change in the entropy is kJ/kg
//+ve sign indicates A to B
//-ve sign indicates B to A

//Output
printf('The change in the entropy is %3.4f kJ/kg\n Since value is -ve, process must takes place from B to A',ds)