#calculate the pressure of the gas using both ideal and vanderwaals cases
#Initialization of variables
m=1 #lbm
T1=212+460. #R
sv=0.193 #ft^3/lbm
M=44
a=924.2 #atm ft^2 /mole^2
b=0.685 #ft^3/mol
R=0.73 #atm ft^3/R mol
#calculations
v=sv*M
p=R*T1/v
p2=R*T1/(v-b) -a/v/v
#results
print '%s %.1f %s' %("In ideal gas case, pressure =",p,"atm")
print '%s %.1f %s' %("\n In vanderwaals equation, pressure =",p2,"atm")
#calculate the volume of the gas
#Initialization of variables
m=1 #lbm
p=50.9 #atm
t=212+460. #R
R=0.73
#calculations
pc=72.9 #atm
tc=87.9 +460 #R
pr=p/pc
Tr=t/tc
z=0.88
v=z*R*t/p
#results
print '%s %.3f %s' %("volume =",v,"ft^3/mole")
#calculate the pressure of the gas
#Initialization of variables
t=212+460. #R
v=0.193 #ft^3/lbm
M=44
R=0.73
#calculations
tc=87.9+460. #F
zc=0.275
vc=1.51 #ft^3/mol
tr=t/tc
vr=v*M/vc
vrd=vr*zc
z=0.88
p=z*R*t/(M*v)
#results
print '%s %.1f %s' %("Pressure =",p,"atm")