summaryrefslogtreecommitdiff
path: root/551/CH5/EX5.24/24.sce
blob: 100ce8a939ff4da5fa49e7aaea6abb37d25d38c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
clc
p1=1.05*10^5; //N/m^2
V1=0.04; //m^3
T1=288; //K
p2=4.8*10^5;
T2=T1;
R0=8314;
M=28;


disp("(i) The change of entropy =")
R=R0/M;
m=p1*V1/R/T1;
dS=m*R*log(p1/p2)
disp("Decrease in entropy =")
disp(-dS)
disp("J/K")


disp("(ii)Heat rejected = ")
Q=T1*(-dS);
disp("Q=")
disp(Q)
disp("J")


W=Q;
disp("Work done = ")
disp(W)
disp("J")

V2=p1*V1/p2;
v1=V1/m; //specific volume
v2=V2/m; //specific volume

v=v2:0.01:v1;
function p=f(v)
    p=p1*v1/v
endfunction

plot(v,f)

p=p1
plot(v,p,'--')

p=[0 p2]
v=[v2 v2]
plot(v,p,'--')

p=[0 p1]
v=[v1 v1]
plot(v,p,'--')

xtitle("p-v diagram", "v(m^3/kg)", "p(N/m^2)")

xset('window', 1)

T=[288 288]
s=[10 (10-dS)]
plot(s,T)

s=[10 10]
T=[0 288]
plot(s,T,'--')

s=[(10-dS) (10-dS)]
T=[0 288]
plot(s,T,'--')

xtitle("T-s diagram", "s(kJ/kg K)", "T(K)")