kill(all)$

cubic equations of state  'REDLICH-KWONG'   (version 1.0)        ('cubic form') ,part 7
practical  values = a,b
=>                  peter.vlasschaert@gmail.com,14/07/2017

cubic equation:  x^3+a*x^2+b*x+c=0

p1:x^3+a*x^2+b*x+c=0;

solve : x^3+a*x^2+b*x+c=0

cubic : general  solution of cubic equation   =>       x={x1,x2,x3}

sol:solve(p1,x)$
x1:part(sol,1);
x2:part(sol,2);
x3:part(sol,3);

VAN DER WAALS EQUATION  OF STATE =>  V^3+a1*V^2+b1*V+c1=0

given : P_c,T_c,V_c,R,T,P
------------------------------------
P =pressure
T = temperature
V= volume
P_c,V_c,T_c ,R   => index c: crtical

find : a1,b1,c1 from above equation

a) VAN DER WAALS EQUATION  OF STATE
start :

p1:P=(R.T)/(V-b)-a/(sqrt(T)*V*(V+b));

p2:rhs(p1)-lhs(p1)=0;
p3:ratsimp(p2);
p4:expand(num(part(p3,1)));
p5:coeff(p4,V,3);
p6:coeff(p4,V,2);
p7:coeff(p4,V,1);
p8:coeff(p4,V,0);

b)     a1,b1,c1

p9:a1=p6/p5;
p10:b1=p7/p5;
p11:c1=p8/p5;

c)  given  a,b
P_c,V_c,T_c ,R   => index c: crtical

see :website a,b practical values

p12: a=(0.42748*R^2*(T_c)^2.5)/(P_c);
p13:b=(0.08664*R*T_c)/(P_c);

d)  solve :   V^3+a1*V^2+b1*V+c1=0

p14:V^3+part(p9,2)*V^2+part(p10,2)*V+part(p11,2)=0;

p15:ev(p14,p12,p13);

general  solution of cubic equation  'p15'  =>       V={V1,V2,V3}

sol_V:solve(p15,V)$
V1:part(sol_V,1);
V2:part(sol_V,2);
V3:part(sol_V,3);