blob: 771787855e21e02b8dc275a8eaef80b42738a32f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
//ques-25.17
//Calculating pressure for carbon dioxide using ideal gas equation and van der Waals equation
clc
V=8;//volume (in L)
m=88;//mass of CO2 (in g)
M=44;//molar mass of CO2 (in g/mol)
T=273+27;//temperature (in K)
a=3.6;//(in L^2 atm/mol^2)
b=0.043;//(in L/mol)
R=0.0821;//(in L atm/K/mol)
n=m/M;//moles of CO2
//Ideal Gas equation
P1=(n*R*T)/V;
//Van der Waals equation
P2=(n*R*T)/(V-n*b)-(a*n^2)/V^2;
printf("The pressure for carbon dioxide using ideal gas equation is %.2f atm and using van der Waals equation is %.3f atm.",P1,P2);
|