summaryrefslogtreecommitdiff
path: root/2870/CH8/EX8.7/Ex8_7.sce
blob: 3b2e0f1ed043a89980d2d182007ab16f353281aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
clc;clear;
//Example 8.7

//given data
P1=1000;
V=200;
T1=300;
T0=T1;
P0=100;

//constants used
R=0.287;//in kPa m^3/kg K

//calculations
m1=P1*V/(R*T1);
O1=R*T0*(P0/P1-1)+R*T0*log(P1/P0);// O refers to exergy
X1=m1*O1/1000;//factor of 1000 for converting kJ into MJ
X1=round(X1);
disp(X1,'work obtained in MJ')