summaryrefslogtreecommitdiff
path: root/443/CH2/EX2.3/2_3.sce
blob: fc01eb298f012221ce4d9fe94de4330cad6f79d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
pathname=get_absolute_file_path('2_3.sce')
filename=pathname+filesep()+'2_3_data.sci'
exec(filename)
//For N2
p1=(m1*RN2*T)/V
//For O2
p2=(m2*RO2*T)/V
//For CO2
p3=(m3*RCO2*T)/V
//Total pressure of the mixture
p=p1+p2+p3
//Gas constant of the mixture
R=(m1*RN2+m2*RO2+m3*RCO2)/(m1+m2+m3)
printf("\n\nRESULTS\n\n")
printf("\npressure for N2:%f\n",p1)
printf("\npressure for O2:%f\n",p2)
printf("\npressure for CO2:%f\n",p3)
printf("\ntotal pressure:%f\n",p)
printf("\ngas consant of the mixture:%f\n",R)