Compressibility factor from the RK equation - one solution |POLVER05_1 f(z)=z^3-z^2-Q*z-r # P = 200 # Pc=33.5 # T= 631 # Tc=126.2 # Pr=P/Pc # Tr=T/Tc # Asqr=0.4278*Pr/(Tr^2.5) # B=0.0867*Pr/Tr # Q=B^2+B-Asqr # r=Asqr*B # p=(-3*Q-1)/3 # q=(-27*r-9*Q-2)/27 # R=(p/3)^3+(q/2)^2 # V=if(R>0)then((-q/2+sqrt(R))^(1/3))else(0) # WW=if(R>0)then(-q/2-sqrt(R))else(0) # psi1 = if(R<0)then(arccos(sqrt((q^2/4)/(-p^3/27))))else(0) # W = if(R>0)then(sign(WW)*(abs(WW))^(1/3))else(0) # z1 = if(R<0)then(2*sqrt(-p/3)*cos((psi1/3)+2*3.1416*0/3)+1/3)else(0) # z2 = if(R<0)then(2*sqrt(-p/3)*cos((psi1/3)+2*3.1416*1/3)+1/3)else(0) # z3 = if(R<0)then(2*sqrt(-p/3)*cos((psi1/3)+2*3.1416*2/3)+1/3)else(0) # z0=if(R>0)then(V+W+1/3)else(0) # z(min)=-0.5, z(max)=1.2