Está en la página 1de 7

UNIVERSIDAD NACIONAL DEL CENTRO DEL PERÚ

FACULTAD DE INGENIERÍA QUÍMICA

ESCUELA PROFESIONAL DE INGENIERÍA QUÍMICA


Termodinámica de los Procesos Químicos II
Nombre: Cárdenas Arzapalo Jesús Ángel
clc; clear;
disp('=========== Equilibrio Isobárico Líquido-Vapor ==============')
disp('================== ETANOL(1)+ AGUA(2) =======================')
disp('=================== METODO MARGULES =========================')
P=1.01325; %Presión (en bar) de operación del experimento
xlin=linspace(0,1,11); ylin=xlin;
A1=5.33675; B1=1648.220; C1=230.918;
A2=5.11564; B2=1687.537; C2=230.170;
%constantes de MARGULES
A12=0.6848; A21=0.3781;
x1=xlin; x2=1-x1;
syms T
Pv1=10^(A1-B1/(T+C1-273.15));
Pv2=10^(A2-B2/(T+C2-273.15));
for i=1:11
g1(i)=10^(x2(i)^2*(A12+2*x1(i)*(A21-A12))); %Cálculo de Gamma 1
g2(i)=10^(x1(i)^2*(A21+2*x2(i)*(A12-A21))); %Cálculo de Gamma 2
y1(i)=x1(i)*g1(i)*(Pv1)/(P); %
y2(i)=x2(i)*g2(i)*(Pv2)/(P);
end
f=y1+y2-1; %Definir función 'f' para poder hallar un T que haga 0 a la función
Teb1=273.15-C1+(B1/(A1-log10(P))); Teb2=273.15-C2+(B2/(A2-log10(P))); %Temepraturas de
ebullición para 1 y 2
for i=1:11
T0=(Teb1+Teb2)/2;
tol=1e-4; dis=1;
cont=0;
while tol<dis
cont=cont+1;
fxi=subs(f(i),T,T0);
Der(i)=diff(f(i),T);
Dfxi=subs(Der(i),T,T0);
T1=(T0*Dfxi-fxi)/Dfxi;
dis=(abs(subs(f(i),T,T1)));
T0=T1;
if cont>200
break
end
Tcal(i)=T1;
y1cal(i)=(subs(y1(i),T,Tcal(i))); y2cal(i)=(subs(y2(i),T,Tcal(i)));
g1cal(i)=(subs(g1(i),T,Tcal(i))); g2cal(i)=(subs(g2(i),T,Tcal(i)));
end
end
%Valores experimentales de fracción molar x1 y1
x1exp=[0 0.0028 0.0118 0.0144 0.0176 0.0222 0.0246 0.0302 0.0331 0.0519 0.0625 0.0673
0.0715 0.0871 0.126 0.143 0.172 0.206 0.21 0.255 0.284 0.321 0.324 0.345 0.405 0.430
0.449 0.506 0.545 0.663 0.735 0.804 0.917 1];
y1exp=[0 0.032 0.113 0.135 0.156 0.186 0.212 0.231 0.248 0.318 0.339 0.370 0.362 0.406
0.468 0.487 0.505 0.530 0.527 0.552 0.567 0.586 0.583 0.591 0.614 0.628 0.633 0.661
0.673 0.733 0.776 0.815 0.906 1];
%Valores experimentales de Temperatura
Texp2=[100 99.3 96.9 96.0 95.6 94.8 93.8 93.5 92.9 90.5 89.4 88.4 88.6 87.2 85.4 84.5
84.0 83.4 83.0 82.3 82.0 81.4 81.5 81.2 80.9 80.5 80.2 80.0 79.5 78.8 78.5 78.4 78.3
78.3];
n=length(x1exp); Texp=273.15*ones(1,n)+Texp2; %Conversión de celcius a Kelvin
tabla=[x1; Tcal; g1cal; g2cal; y1cal; y2cal; y1cal+y2cal];
fprintf('====================== A %5.4f bar =========================\n',P)
fprintf(' x1cal Tcal gama1 gama2 y1cal y2cal ytot \n');
fprintf('-------------------------------------------------------------\n');
fprintf('%7.4f |%7.2f |%7.4f |%7.4f |%7.4f |%7.4f |%7.4f\n',tabla);
%Gráfica Nro 01 - y(1) vs. x(1)
subplot(1,2,1); plot(x1exp,y1exp,'ro',x1,y1cal,'b-',xlin,ylin,'k-'); v=[0 1 0 1];
axis(v);
hold on; grid on; title('Gráfica y(1) vs x(1)'); xlabel('Fracción molar x(1)');
ylabel('Fracción molar y(1)');
legend('Valores experimentales','Modelo de Margules')
%Gráfica Nro 02 - T(K) vs. y(1) ; x(1)
subplot(1,2,2); plot(x1exp,Texp,'ro',y1exp,Texp,'b^',x1,Tcal,'r-',y1cal,Tcal,'b-');
w=[0 1 Texp(n)-1 Texp(1)+1]; axis(w);
hold on; grid on; title('Gráfica T vs x(1) ; y(1)'); xlabel('Fracción molar x(1) ;
y(1)'); ylabel('Temperatura(T) en K');
legend('Valores exp. x(1)','Valores exp. y(1)','Modelo Margules x(1)','Modelo Margules
y(1)');

=========== Equilibrio Isobárico Líquido-Vapor ==============


================== ETANOL(1)+ AGUA(2) =======================
=================== METODO MARGULES =========================
====================== A 1.0132 bar =========================
x1cal Tcal gama1 gama2 y1cal y2cal ytot
-------------------------------------------------------------
0.0000 | 373.23 | 4.8395 | 1.0000 | 0.0000 | 1.0000 | 1.0000
0.1000 | 359.78 | 3.1989 | 1.0216 | 0.4421 | 0.5579 | 1.0000
0.2000 | 355.96 | 2.2896 | 1.0833 | 0.5472 | 0.4528 | 1.0000
0.3000 | 354.40 | 1.7595 | 1.1822 | 0.5937 | 0.4063 | 1.0000
0.4000 | 353.52 | 1.4395 | 1.3164 | 0.6257 | 0.3743 | 1.0000
0.5000 | 352.85 | 1.2432 | 1.4832 | 0.6580 | 0.3420 | 1.0000
0.6000 | 352.27 | 1.1238 | 1.6767 | 0.6978 | 0.3022 | 1.0000
0.7000 | 351.81 | 1.0544 | 1.8856 | 0.7499 | 0.2501 | 1.0000
0.8000 | 351.50 | 1.0180 | 2.0917 | 0.8174 | 0.1826 | 1.0000
0.9000 | 351.37 | 1.0031 | 2.2696 | 0.9014 | 0.0986 | 1.0000
1.0000 | 351.41 | 1.0000 | 2.3884 | 1.0000 | 0.0000 | 1.0000

GRAFICA METODO MARGULES ETANOL-AGUA


UNIVERSIDAD NACIONAL DEL CENTRO DEL PERÚ
FACULTAD DE INGENIERÍA QUÍMICA
ESCUELA PROFESIONAL DE INGENIERÍA QUÍMICA
Termodinámica de los Procesos Químicos II
Nombre: Cárdenas Arzapalo Jesús Ángel
clc; clear;
disp('=========== Equilibrio Isobárico Líquido-Vapor ==============')
disp('================== ETANOL(1)+ AGUA(2) =======================')
disp('=================== METODO VAAN LAAR =========================')
P=1.01325; %Presión (en bar) de operación del experimento
xlin=linspace(0,1,11); ylin=xlin;
A1=5.33675; B1=1648.220; C1=230.918;
A2=5.11564; B2=1687.537; C2=230.170;
%Constantes de Van Laar
A12=0.7292; A21=0.4104;
x1=xlin; x2=1-x1;
syms T
Pv1=10^(A1-B1/(T+C1-273.15));
Pv2=10^(A2-B2/(T+C2-273.15));
for i=1:11
g1(i)=10^(A12/(1+((x1(i)*A12)/(x2(i)*A21)))^2); %Cálculo de Gamma 1
g2(i)=10^(A21/(1+((x2(i)*A21)/(x1(i)*A12)))^2); %Cálculo de Gamma 2
y1(i)=x1(i)*g1(i)*(Pv1)/(P);
y2(i)=x2(i)*g2(i)*(Pv2)/(P);
end
f=y1+y2-1; %Definir función 'f' para poder hallar un T que haga 0 a la función
Teb1=273.15-C1+(B1/(A1-log10(P))); Teb2=273.15-C2+(B2/(A2-log10(P))); %Temepraturas de
ebullición para 1 y 2
for i=1:11
T0=(Teb1+Teb2)/2;
tol=1e-4; dis=1;
cont=0;
while tol<dis
cont=cont+1;
fxi=subs(f(i),T,T0);
Der(i)=diff(f(i),T);
Dfxi=subs(Der(i),T,T0);
T1=(T0*Dfxi-fxi)/Dfxi;
dis=(abs(subs(f(i),T,T1)));
T0=T1;
if cont>200
break
end
Tcal(i)=T1;
y1cal(i)=(subs(y1(i),T,Tcal(i))); y2cal(i)=(subs(y2(i),T,Tcal(i)));
g1cal(i)=(subs(g1(i),T,Tcal(i))); g2cal(i)=(subs(g2(i),T,Tcal(i)));
end
end
%Valores experimentales de fracción molar x1 y1
x1exp=[0 0.0028 0.0118 0.0144 0.0176 0.0222 0.0246 0.0302 0.0331 0.0519 0.0625 0.0673
0.0715 0.0871 0.126 0.143 0.172 0.206 0.21 0.255 0.284 0.321 0.324 0.345 0.405 0.430
0.449 0.506 0.545 0.663 0.735 0.804 0.917 1];
y1exp=[0 0.032 0.113 0.135 0.156 0.186 0.212 0.231 0.248 0.318 0.339 0.370 0.362 0.406
0.468 0.487 0.505 0.530 0.527 0.552 0.567 0.586 0.583 0.591 0.614 0.628 0.633 0.661
0.673 0.733 0.776 0.815 0.906 1];
%Valores experimentales de Temperatura
Texp2=[100 99.3 96.9 96.0 95.6 94.8 93.8 93.5 92.9 90.5 89.4 88.4 88.6 87.2 85.4 84.5
84.0 83.4 83.0 82.3 82.0 81.4 81.5 81.2 80.9 80.5 80.2 80.0 79.5 78.8 78.5 78.4 78.3
78.3];
n=length(x1exp); Texp=273.15*ones(1,n)+Texp2; %Conversión de celcius a Kelvin
tabla=[x1; Tcal; g1cal; g2cal; y1cal; y2cal; y1cal+y2cal];
fprintf('====================== A %5.4f bar =========================\n',P)
fprintf(' x1cal Tcal gama1 gama2 y1cal y2cal ytot \n');
fprintf('-------------------------------------------------------------\n');
fprintf('%7.4f |%7.2f |%7.4f |%7.4f |%7.4f |%7.4f |%7.4f\n',tabla); %Tabla de valores
necesarios para graficar
%Gráfica Nro 01 - y(1) vs. x(1)
subplot(1,2,1); plot(x1exp,y1exp,'r+',x1,y1cal,'b-',xlin,ylin,'k-'); v=[0 1 0 1];
axis(v);
hold on; grid on; title('Gráfica y(1) vs x(1)'); xlabel('Fracción molar x(1)');
ylabel('Fracción molar y(1)');
legend('Valores experimentales','Modelo de Van-Laar')
%Gráfica Nro 02 - T(K) vs. y(1) ; x(1)
subplot(1,2,2); plot(x1exp,Texp,'rs',y1exp,Texp,'b^',x1,Tcal,'r-',y1cal,Tcal,'b-');
w=[0 1 Texp(n)-1 Texp(1)+1]; axis(w);
hold on; grid on; title('Gráfica T vs x(1) ; y(1)'); xlabel('Fracción molar x(1) ;
y(1)'); ylabel('Temperatura(T) en K');
legend('Valores exp. x(1)','Valores exp. y(1)','Modelo Van-Laar x(1)',' Van-Laar
y(1)');

=========== Equilibrio Isobárico Líquido-Vapor ==============


================== ETANOL(1)+ AGUA(2) =======================
=================== METODO VAAN LAAR =========================
====================== A 1.0132 bar =========================
x1cal Tcal gama1 gama2 y1cal y2cal ytot
-------------------------------------------------------------
0.0000 | 373.23 | 5.3604 | 1.0000 | 0.0000 | 1.0000 | 1.0000
0.1000 | 359.62 | 3.2253 | 1.0260 | 0.4431 | 0.5569 | 1.0000
0.2000 | 356.17 | 2.2367 | 1.0935 | 0.5390 | 0.4610 | 1.0000
0.3000 | 354.66 | 1.7180 | 1.1932 | 0.5856 | 0.4144 | 1.0000
0.4000 | 353.68 | 1.4217 | 1.3203 | 0.6221 | 0.3779 | 1.0000
0.5000 | 352.91 | 1.2433 | 1.4724 | 0.6596 | 0.3404 | 1.0000
0.6000 | 352.26 | 1.1331 | 1.6482 | 0.7031 | 0.2969 | 1.0000
0.7000 | 351.74 | 1.0655 | 1.8467 | 0.7557 | 0.2443 | 1.0000
0.8000 | 351.39 | 1.0259 | 2.0673 | 0.8203 | 0.1798 | 1.0000
0.9000 | 351.26 | 1.0058 | 2.3095 | 0.9001 | 0.0999 | 1.0000
1.0000 | 351.41 | 1.0000 | 2.5728 | 1.0000 | 0.0000 | 1.0000
>>

GRAFICA METODO VAAN LAAR ETANOL-AGUA


UNIVERSIDAD NACIONAL DEL CENTRO DEL PERÚ
FACULTAD DE INGENIERÍA QUÍMICA
ESCUELA PROFESIONAL DE INGENIERÍA QUÍMICA
Termodinámica de los Procesos Químicos II
Nombre: Cárdenas Arzapalo Jesús Ángel
clc; clear;
disp('=========== Equilibrio Isobárico Líquido-Vapor ==============')
disp('================== ETANOL(1)+ AGUA(2) =======================')
disp('=================== METODO WILSON =========================')
fprintf('================= A 760 mmHg =========================\n')
fprintf(' x1 | T,K | gamma1 | gamma2 | Pvp1 | Pvp2 | y1 | y2 |
y1+y2\n');
fprintf('------------------------------------------------------------------------------
-\n');
syms T
P=1.01325; %Presión (en bar) de operación del experimento
x1=linspace(0,1,11); n=length(x1); %Valores de x1 escogidos de forma ordenada y
equiespaciada
ylin=x1; %Línea de referencia para gráfica 1
A1=5.33675; B1=1648.220; C1=230.918;
A2=5.11564; B2=1687.537; C2=230.170;
Teb1=273.15+78.37; %Temepraturas de ebullición para 1
Teb2=273.15+100; %Temepraturas de ebullición para 2
x2=1-x1;
Pv1=10^(A1-B1/(T+C1-273.15)); %Presión de vapor de 1-butanol a diferentes T calculado
Pv2=10^(A2-B2/(T+C2-273.15)); %Presión de vapor de benceno a diferentes T calculado
L12=(18.844/60.356)*exp(-382.30/(1.987*T)); %Cálculo de Lambda 12
L21=(60.356/18.844)*exp(-955.45/(1.987*T)); %Cálculo de Lambda 21
for i=1:n %Cálculo del coeficiente de Actividad
gamma1(i)=exp(-log(x1(i)+L12*x2(i))+x2(i)*(L12/(x1(i)+L12*x2(i))-
L21/(L21*x1(i)+x2(i))));
gamma2(i)=exp(-log(x2(i)+L21*x1(i))-x1(i)*(L12/(x1(i)+L12*x2(i))-
L21/(L21*x1(i)+x2(i))));
y1(i)=x1(i)*gamma1(i)*(Pv1)/(P); %Fracción molar y1 calculado
y2(i)=x2(i)*gamma2(i)*(Pv2)/(P); %Fracción molar y2 calculado
end
f=y1+y2-1; %Definir función 'f' para poder hallar un T que haga 0 a la función
for i=1:n
T0=Teb1*x1(i)+Teb2*x2(i); %Temperatura inicial T0 para cada iteración
tol=1e-5; dis=1;
cont=0; % Contador del número de operaciones
while tol<dis
cont=cont+1;
df(i)=diff(f(i),sym('T'));
T=T0;
fxi=eval(f(i));
Dfxi=eval(df(i));
T1=single((T0*Dfxi-fxi)/Dfxi); %Método de Newoton-Raphson
dis=single(abs(subs(f(i),T1))); %Distancia para bucle
T0=T1;
end
Tcal(i)=T1;
y1cal(i)=single(subs(y1(i),T1)); y2cal(i)=single(subs(y2(i),T1));
Pv1cal(i)=single(subs(Pv1,T1)); Pv2cal(i)=single(subs(Pv2,T1));
g1cal(i)=single(subs(gamma1(i),T1)); g2cal(i)=single(subs(gamma2(i),T1));
fprintf('%7.4f |%7.2f |%7.4f |%7.4f |%7.4f |%7.4f |%7.4f |%7.4f
|%7.4f\n',x1(i),Tcal(i),g1cal(i),g2cal(i),Pv1cal(i),Pv2cal(i),y1cal(i),y2cal(i),y1cal(i
)+y2cal(i))
end
%Valores experimentales de fracción molar x1 y1
x1exp=[0 0.0028 0.0118 0.0144 0.0176 0.0222 0.0246 0.0302 0.0331 0.0519 0.0625 0.0673
0.0715 0.0871 0.126 0.143 0.172 0.206 0.21 0.255 0.284 0.321 0.324 0.345 0.405 0.430
0.449 0.506 0.545 0.663 0.735 0.804 0.917 1];
y1exp=[0 0.032 0.113 0.135 0.156 0.186 0.212 0.231 0.248 0.318 0.339 0.370 0.362 0.406
0.468 0.487 0.505 0.530 0.527 0.552 0.567 0.586 0.583 0.591 0.614 0.628 0.633 0.661
0.673 0.733 0.776 0.815 0.906 1];
%Valores experimentales de Temperatura
TexpC=[100 99.3 96.9 96.0 95.6 94.8 93.8 93.5 92.9 90.5 89.4 88.4 88.6 87.2 85.4 84.5
84.0 83.4 83.0 82.3 82.0 81.4 81.5 81.2 80.9 80.5 80.2 80.0 79.5 78.8 78.5 78.4 78.3
78.3];
Texp=273.15+TexpC; %Conversión de celcius a Kelvin
%Gráfica Nro 01 - y(1) vs. x(1)
subplot(1,2,1); plot(x1exp,y1exp,'rs',x1,y1cal,'b-',x1,ylin,'k-'); v=[0 1 0 1];
axis(v);
hold on; grid on; title('Gráfica y(1) vs x(1)'); xlabel('Fracción molar x(1)');
ylabel('Fracción molar y(1)');
legend('Valores experimentales','Modelo Wilson')
%Gráfica Nro 02 - T(K) vs. y(1) ; x(1)
subplot(1,2,2); plot(x1exp,Texp,'rs',y1exp,Texp,'b^',x1,Tcal,'r-',y1cal,Tcal,'b-');
w=[0 1 Teb1-1 Teb2+1]; axis(w);
hold on; grid on; title('Gráfica T vs x(1) ; y(1)'); xlabel('Fracción molar x(1) ;
y(1)'); ylabel('Temperatura(T) en K');
legend('Valores exp. x(1)','Valores exp. y(1)','Modelo Wilson x(1)','Modelo Wilson
y(1)');

=========== Equilibrio Isobárico Líquido-Vapor ==============

================== ETANOL(1)+ AGUA(2) =======================

=================== METODO WILSON =========================

================= A 760 mmHg =========================

x1 | T,K | gamma1 | gamma2 | Pvp1 | Pvp2 | y1 | y2 | y1+y2

-------------------------------------------------------------------------------

0.0000 | 373.23 | 6.0282 | 1.0000 | 2.2759 | 1.0133 | 0.0000 | 1.0000 | 1.0000

0.1000 | 359.38 | 3.2649 | 1.0329 | 1.3795 | 0.6054 | 0.4445 | 0.5555 | 1.0000

0.2000 | 356.15 | 2.2174 | 1.1064 | 1.2199 | 0.5335 | 0.5339 | 0.4661 | 1.0000

0.3000 | 354.58 | 1.7138 | 1.2064 | 1.1478 | 0.5011 | 0.5824 | 0.4176 | 1.0000

0.4000 | 353.50 | 1.4314 | 1.3303 | 1.1007 | 0.4799 | 0.6219 | 0.3781 | 1.0000

0.5000 | 352.67 | 1.2583 | 1.4797 | 1.0650 | 0.4639 | 0.6613 | 0.3387 | 1.0000

0.6000 | 351.99 | 1.1474 | 1.6580 | 1.0370 | 0.4514 | 0.7045 | 0.2955 | 1.0000

0.7000 | 351.48 | 1.0758 | 1.8705 | 1.0161 | 0.4421 | 0.7552 | 0.2448 | 1.0000

0.8000 | 351.16 | 1.0314 | 2.1236 | 1.0034 | 0.4364 | 0.8171 | 0.1829 | 1.0000

0.9000 | 351.10 | 1.0074 | 2.4252 | 1.0011 | 0.4353 | 0.8958 | 0.1042 | 1.0000

1.0000 | 351.41 | 1.0000 | 2.7835 | 1.0133 | 0.4408 | 1.0000 | 0.0000 | 1.0000

>>
UNIVERSIDAD NACIONAL DEL CENTRO DEL PERÚ
FACULTAD DE INGENIERÍA QUÍMICA
ESCUELA PROFESIONAL DE INGENIERÍA QUÍMICA
Termodinámica de los Procesos Químicos II
Nombre: Cárdenas Arzapalo Jesús Ángel

GRAFICA METODO WILSON ETANOL-AGUA

También podría gustarte