summaryrefslogtreecommitdiff
path: root/1427/CH25/EX25.14/25_14.sce
blob: 49b5f74824b2f707d3592d07c8aeafacebe88406 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//ques-25.14
//Calculating pressure for ammonia gas using ideal gas equation and van der Waals equation
clc
n=0.6;//moles of NH3
V=3;//volume (in L)
T=273+25;//temperature (in K)
a=4.17;//(in L^2 atm/mol^2)
b=0.0371;//(in L/mol)
//Van der Waal's
P1=(n*0.0821*T)/(V-n*b)-(a*n^2)/V^2;
//Ideal Gas'
P2=(n*0.0821*T)/V;
printf("The value of pressure according to ideal gas equation is %.3f atm and according to van der Waals equation is %.3f atm.",P2,P1);