summaryrefslogtreecommitdiff
path: root/647/CH3/EX3.8/Example3_8.sce
blob: 220e5c9f58f2e93d74dfdee8e82c92d80ccda284 (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
clear;
clc;

// Example: 3.8
// Page: 101

printf("Example: 3.8 - Page: 101\n\n");

// Solution

//*****Data*****//
T = 500;// [K]
P = 8*10^6;// [Pa]
R = 8.314;// [J/mol K]
//*************//

// Solution (a)
// By ideal gas equation of state:
printf("Ideal Equation of State\n")
Vm = R*T/P;// [cubic m/mol]
printf("Molar Volume of gas is %.3e cubic m/mol\n",Vm);
printf("\n");

// Solution (b)
// By Virial Equation of State:
printf("Virial Equation of State\n");
B = -0.265*10^(-3);// [cubic m/mol]
C = 0.3025*10^(-7);// [m^6/square mol]
deff('[y] = f(Vm)','y = (P*Vm/(R*T)) - 1 -(B/Vm) - (C/Vm^2)');
Vm = fsolve(Vm,f);
printf("Molar Volume of gas is %.2e cubic m/mol\n",Vm);