summaryrefslogtreecommitdiff
path: root/3825/CH10/EX10.2/Ex10_2.sce
blob: e86812a9646241e654a92bea4ae396efc742a13b (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
clc
y1=0.2 //O2
y2=0.5 //N2
y3=0.1 //H2O
y4=0.2 //CO2
P=100 //in kPa
p1=P*y1
p2=P*y2
p3=P*y3
p4=P*y4
mprintf("pi=.(in kPa)\n%f\n%f\n%f\n%f\n",p1,p2,p3,p4)
M1=32
M2=28
M3=18
M4=44
M=(y1*M1)+(y2*M2)+(y3*M3)+(y4*M4)
mprintf("Molar mass of mixture=%ikg/kmol\n",M)
m1=M1*y1
m2=M2*y2
m3=M3*y3
m4=M4*y4
mprintf("mi=.(kg*10^3)\n%f\n%f\n%f\n%f\n",m1,m2,m3,m4)
phi1=m1/M
phi2=m2/M
phi3=m3/M
phi4=m4/M
mprintf("phi i=.\n%f\n%f\n%f\n%f\n",phi1,phi2,phi3,phi4)
P=p1+p2+p3
mprintf("Final pressure=%ikPa\n",P)
y1=p1/P
y2=p2/P
y3=p3/P
mprintf("yi=.\n%f\n%f\n%f\n",y1,y2,y3)
m1=M1*y1
m2=M2*y2
m3=M3*y3
mprintf("mi=.\n%f\n%f\n%f\n",m1,m2,m3)
phi1=m1/M
phi2=m2/M
phi3=m3/M
mprintf("phi i=.\n%f\n%f\n%f\n",phi1,phi2,phi3)
M=(y1*M1)+(y2*M2)+(y3*M3)
mprintf("Molar mass=%f\n",M)//ans vary due to roundoff error