Está en la página 1de 3

function WILSON_ISOBARICO

%Equilibrio ELV nHEXANO(1)-BENCENO(2)


%CONSTANTES DE ANTOINE PARA HALLAR PRESSIONES DE VAPOR
%constantes del n-hexano
A1=6.87776;
B1=1171.530;
C1=224.366;
%constantes del benceno
A2=6.90565;
B2=1211.033;
C2=220.790;
P=760;%mmHg
R=1.987;%cal/kmol
%declarar a la temperatura una variable
syms T
%valores de las fracciones molares
x1=[0 0.001 0.101 0.201 0.301 0.401 0.501 0.601 0.701
0.801 0.901 0.999];
x2=[1 0.999 0.899 0.799 0.699 0.599 0.499 0.399 0.299
0.199 0.099 0.001];
%calculo de las presiones de vapor
pvp1=10^(A1-B1/(C1+T));
pvp2=10^(A2-B2/(C2+T));
%calculo de las temperaturas iniciales
T10=B1/(A1-log10(P))-C1;
T20=B2/(A2-log10(P))-C2;
%CONSTANTES DE WILSON
landa11=169.92;
landa22=173.93;
v1=127.301;
v2=86.783;
A12=(v2/v1)*exp(-(landa11)/(R*(T+273.15)));
A21=(v1/v2)*exp(-(landa22)/(R*(T+273.15)));
for i=1:12
landa1(i)=(exp((1-x1(i))*((A12/(x1(i)+A12-
x1(i)*A12))-(A21/(A21*x1(i)+1-x1(i))))))/(x1(i)+A12-
A12*x1(i));
landa2(i)=(exp((-x1(i))*((A12/(x1(i)+A12-
x1(i)*A12))-(A21/(A21*x1(i)+1-x1(i))))))/(1-x1(i)
+A21*x1(i));
y1(i)=x1(i)*landa1(i)*pvp1/P;
y2(i)=x2(i)*landa2(i)*pvp2/P;
end
%Determinación de las temperaturas de equilibrio
disp(' t ,ºC x1 Y1 landa1
landa2');
disp('__________________________________________________
_')
f=y1+y2-1;
for i = 1:12
xo=(T10+T20)/2;%valor inicial para la temperatura
e=10^-4;%criterio de convergencia
distancia=1;
while distancia > e
fxi=subs(f(i),sym('T'),xo);
derivada=diff(f(i),sym('T'));
Dxfxi=subs(derivada,sym('T'),xo);
x_1=single(xo-(fxi/Dxfxi));
distancia=single(abs(subs(f(i),sym('T'),x_1)));
xo=x_1;
end
Tm(i)=x_1;
t(i)=Tm(i);
Y1(i)=single(subs(y1(i),sym('T'),Tm(i)));
G1(i)=single(subs(landa1(i),sym('T'),Tm(i)));
G2(i)=single(subs(landa2(i),sym('T'),Tm(i)));
disp([t(i) x1(i) Y1(i) G1(i) G2(i)])
end
%Datos experimentales:
x1e=[0.0513 0.1216 0.2189 0.3108 0.3811 0.503 0.6031
0.7171 0.7982 0.8982 0.9402];
x2e=1-x1e;
y1e=[0.108 0.216 0.334 0.422 0.483 0.579 0.657 0.746
0.814 0.902 0.9402];
y2e=1-y1e;
TeK=[351.1 349.1 347 345.6 344.7 343.6 342.9 342.3 341.9
341.8 341.7];
TeC=TeK-273.15;
Pe=760; %mmHg;
%REALIZANDO LOS GRAFICOS
x=[0 1];
y=[0 1];
subplot(1,2,1),plot(x1,Y1,'-
r',x1e,y1e,'o',x,y);legend('WILSON','DATOS
EXPERIMENTALES');title('Diagrama de nHexano(1)-
Benceno(2)a 760 mmHg; x1vsy1')
subplot(1,2,2),plot(x1,t,Y1,t);hold on
;plot(x1e,TeC,'r--',y1e,TeC,'r--');legend('WILSON-
x1,t','WILSON-y1,t','DATOS
EXPERIMENTALES');title('Diagrama de nHexano(1)-
Benceno(2)a 760 mmHg; t-x1,Y1')

corriendo

>> WILSON_ISOBARICO
t ,ºC x1 Y1 landa1 landa2
___________________________________________________
80.1021 0 0 1.6165 1.0000

80.0606 0.0010 0.0023 1.6143 1.0000

76.7605 0.1010 0.1844 1.4289 1.0067

74.5659 0.2010 0.3119 1.2971 1.0245

72.9900 0.3010 0.4128 1.2024 1.0513

71.7989 0.4010 0.5001 1.1340 1.0855

70.8713 0.5010 0.5808 1.0848 1.1263

70.1422 0.6010 0.6592 1.0499 1.1729

69.5769 0.7010 0.7383 1.0260 1.2248

69.1582 0.8010 0.8203 1.0107 1.2816

68.8795 0.9010 0.9072 1.0025 1.3429

68.7426 0.9990 0.9991 1.0000 1.4071

También podría gustarte