summaryrefslogtreecommitdiff
path: root/779/CH4/EX4.5/4_5.sce
blob: ae1d1ee99e8f08842e7e9f3a7b44711682a71c62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
V1 = 0.03;
P1 = 170e03;
P2 = 400e03;
V2 = 0.06;
U = 3.15*(P2*V2-P1*V1);
B = [P1 P2]';
A = [1 V1; 1 V2];
x = inv(A)*B;
a = x(1); b = x(2);
function P = pressure(V) 
  P = a+b*V;
endfunction;
W = intg(V1,V2,pressure); 
Q = U+W;
disp("J",W,"The work done by the system is")
disp("J",U,"The internal energy change of the system is")
disp("J",Q,"The heat flow into the system is")