//clc() P1 = 40;//% ( nitrogen ) P2 = 60;//% ( ethane ) T = 325;//K V = 4.5 * 10^-4;//m^3/mol a1 = 0.1365;//N*m^4/mol^2 b1 = 3.86 * 10 ^ -5;//m^3/mol a2 = 0.557;//N*m^4/mol^2 b2 = 6.51 * 10 ^ -5;//m^3/mol Pc1 = 3394;//kPa Tc1 = 126.1;//K Pc2 = 4880;//kPa Tc2 = 305.4;//K R = 8.314; Pideal = R * T / (V * 1000);//kPa disp("kPa",Pideal,"(a)Pressure of Gas by the ideal gas equation = ") y1 = P1/100; y2 = P2/100; a = (y1 * (a1^(1/2)) + y2 * (a2^(1/2)))^2; b = y1 * b1 + y2 * b2; Pv = ((R * T / (V - b)) - a / (V^2))/1000; disp("kPa",Pv,"(b)Pressure of Gas by Van der waals equation = ") Tc = y1*Tc1 + y2*Tc2; Pc = y1*Pc1 + y2*Pc2; Vc = R * Tc / Pc;//Pseudo critical ideal volume Vr = V / Vc;//Pseudo reduced ideal volume Tr = T / Tc;//Pseudo reduced temperature //From fig 5.3, we get Pr = 1.2 Pr = 1.2; Pk = Pr * Pc; disp("kPa",Pk,"(b)Pressure of Gas by the Kays method = ")