summaryrefslogtreecommitdiff
path: root/3825/CH10/EX10.6/Ex10_6.sce
blob: 197b2eac0aa01f339922d0ee01716525b250fb6a (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
clc
P1=100 //pressure in kPa
V=2 //in metre-cube
R=8.314*10^3
T0=300 //in kelvin
N1=(P1*10^3*V)/(R*T0)
mprintf("N1=%fkmol\n",N1)//ans vary due to roundoff error
NHe0=0.0401
Nair0=0.0401
CvHe=12.4717
Cvair=20.7889
U0=((NHe0*CvHe)+(Nair0*Cvair))*T0
mprintf("Uo=%fkJ\n",U0)//ans vary due to roundoff error
Pf=4 //pressure in MPa
a=(Pf*10^6*V)/R
CPHe=20.786
THe=600
Nairf=0.0401
b=a/(CPHe*THe)
c=-NHe0+(U0/(CPHe*THe))
d=c+Nairf-(CvHe*b)
e=(Nairf*c)-(Nairf*Cvair*b)
f=1
//the above are the coefficients of quadratic equation formed for NHEf obtained from equation formed in book
NHef=(-d+sqrt(d^2-4*f*e))/(2*f)
mprintf("NHe=%fkmol\n",NHef)//ans vary due to roundoff error
Tf=a/(NHef+Nairf)
mprintf("Tf=%fK\n",Tf)//ans vary due to roundoff error
yHe=NHef/(NHef+Nairf)
mprintf("yHe=%f\n",yHe)//ans vary due to roundoff error
yair=Nairf/(NHef+Nairf)
mprintf("yair=%f\n",yair)//ans vary due to roundoff error
mprintf("Helium that enters tank=%fkmol",NHef-Nairf)//ans vary due to roundoff error