Default Mode
Constants of Antoine Equation ln p_sat = A + B/(T deg Celcius + C) for the calculation of vapour pressures.
A1=14.2724; B1=-2945.47; A2=14.2043; B2=-2972.64; C1=224 C2=209
Pressure Range is 50 kPa to 500 kPa
if(k==1)
T=20;
T1=0;
A1=14.2724;
B1=-2945.47;
A2=14.2043;
B2=-2972.64;
C1=224;
C2=209;
i=1;
for P=50:5:500
j=11;
for x=0:0.1:1
Pcal=0;
while abs(Pcal-P)>=1
if (Pcal>P)
T=T1+((T-T1)/2);
elseif (Pcal<P)
T=T+((T-T1)/2);
end
P1=2.71^((B1/(T+C1))+A1);
P2=2.71^((B2/(T+C2))+A2);
Pcal=P1*x+(P2*(1-x));
end
y=x*P1/Pcal;
Tarray(i,1)=x;
Tarray(i,2)=T;
Tarray(i,3)=P;
Tyarray(j,1)=y;
Tyarray(j,2)=T;
Tyarray(j,3)=P;
j=j-1;
i=i+1;
end
for r=1:11
Tarray(i,:)=Tyarray(r,:);
i=i+1;
end
end
plot3(Tarray(:,1),Tarray(:,2),Tarray(:,3));
title('P-T-x-y plot of a ideal binary mixture Acetonitrile(1)+Nitromethane(2)');
xlabel('x1, y1');
ylabel('Temperature (deg. C)');
zlabel('Pressure (kPa)');