0% found this document useful (0 votes)
28 views

Reactor T Variable Informe

This document defines variables and parameters for modeling a reactor system with two tanks. It initializes the variables, develops the model equations to calculate concentrations and temperatures over time in each tank, and generates plots of the results. The model considers mass transfer between tanks and chemical reactions occurring within each tank that are temperature dependent.

Uploaded by

Iván Acaro
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Reactor T Variable Informe

This document defines variables and parameters for modeling a reactor system with two tanks. It initializes the variables, develops the model equations to calculate concentrations and temperatures over time in each tank, and generates plots of the results. The model considers mass transfer between tanks and chemical reactions occurring within each tank that are temperature dependent.

Uploaded by

Iván Acaro
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Reactor t variable

%Definicion de Variables
clc
clear
i=5000;
Ca1=zeros(i,1);
Ca2=zeros(i,1);
Cb1=zeros(i,1);
Cb2=zeros(i,1);
Cc1=zeros(i,1);
Cc2=zeros(i,1);
V1=zeros(i,1);
V2=zeros(i,1);
T1=zeros(i,1);
Tc=zeros(i,1);
T2=zeros(i,1);
k1=zeros(i,1);
k2=zeros(i,1);
t=zeros(i,1);
t1=zeros(i,1);

%Parametros
Fo=10;
F1=7;
F2=4;
Cao=25;
To=300;
U=20;
D=0.5;
den=1000;
cp=4.18;
deltaRx1=350;
deltaRx2=200;
Fc=3;
A1=0.02;
A2=0.03;
Ea1=300;
Ea2=200;
R=8314;
cpc=4.18;
denc=1000;
Vc=50;
deltat=0.1;
tretraso=10;

%Inicializacion de Variables
Ca1(1)=Cao;
Ca2(1)=Ca1(1);
Cb1(1)=0;
Cb2(1)=Cb1(1);
Cc1(1)=0;
Cc2(1)=Cc1(2);
V1(1)=150;
V2(1)=100;
k1(1)=0.05;
k2(2)=0.07;
t(1)=0;
T1(1)=To;
Tc(1)=283;
t1(1)=tretraso;

%desarrollo del modelo

for k=1:i

%Tanque 1
funcionV1=Fo-F1;
k1(k)=A1*exp(-(Ea1/(R*T1(k))));
k2(k)=A2*exp(-(Ea2/(R*T2(k))));
V1(k+1)=V1(k)+funcionV1*deltat;

funcionCa1=(((Fo*Cao)-(F1*Ca1(k))-(Ca1(k)*funcionV1))/V1(k))-
(k1(k)*Ca1(k))-(k2(k)*(Ca1(k))^0.8);
Ca1(k+1)=Ca1(k)+funcionCa1*deltat;

funcionCb1=((-(F1*Cb1(k))-(Cb1(k)*funcionV1))/V1(k))+(k1(k)*Ca1(k));
Cb1(k+1)=Cb1(k)+deltat*funcionCb1;

funcionCc1=((-(F1*Cc1(k))-
(Cc1(k)*funcionV1))/V1(k))+(2*k2(k)*(Ca1(k))^0.8);
Cc1(k+1)=Cc1(k)+deltat*funcionCb1;

funcionT1=-U*(4/D)*(T1(k)-Tc(k))/(den*cp)+(Fo*To)/V1(k)-
(F1*T1(k))/V1(k)+(deltaRx1*k1(k)*Ca1(k))/(den*cp)+(deltaRx2*k2(k)*(Ca1(k)
)^0.8)/(den*cp)-funcionV1*T1(k)/V1(k);
T1(k+1)=T1(k)+deltat*funcionT1;

funcionTc=(Fc*(Tc(1)-Tc(k)))/Vc+(U*(4/D)*V1(k)*(T1(k)-
Tc(k)))/(denc*cpc*Vc);
Tc(k+1)=Tc(k)+deltat*funcionTc;
t(k+1)=t(k)+deltat;

%Tanque 2

funcionV2=F1-F2;
V2(k+1)=V2(k)+funcionV2*deltat;

funcionCa2=(((F1*Ca1(k))-(F2*Ca2(k))-(Ca2(k)*funcionV2))/(V2(k)))-
(k1(k)*Ca2(k))-(k2(k)*(Ca2(k))^0.8);
Ca2(k+1)=Ca2(k)+funcionCa2*deltat;

funcionCb2=(((F1*Cb1(k))-(F2*Cb2(k))-
(Cb2(k)*funcionV2))/V2(k))+k1(k)*Ca2(k);
Cb2(k+1)=Cb2(k)+deltat*funcionCb2;

funcionCc2=(((F1*Cc1(k))-(F2*Cc2(k))-
(Cc2(k)*funcionV2))/V2(k))+(k2(k)*(Ca2(k))^0.8);
Cc2(k+1)=Cc2(k)+deltat*funcionCc2;
funcionT2=(F1*T1(k))/V2(k)-
(F1*T2(k))/V2(k)+(deltaRx1*k1(k)*Ca2(k))/(den*cp)+(deltaRx2*k2(k)*(Ca2(k)
)^0.8)/(den*cp)-funcionV2*T2(k)/V2(k);
T2(k+1)=T2(k)+deltat*funcionT2;

t1(k+1)=t1(k)+deltat;

end

figure(1)
plot(t,Ca1,t1,Ca2,'LineWidth',2)
title('Concentracion Ca VS tiempo')
xlabel('Tiempo(s)')
ylabel('Concentracion(Kg/m^3)')
grid on
hold on

figure(2)
plot(t,Cb1,t1,Cb1,'LineWidth',2)
title('Concentracion Cb VS tiempo')
xlabel('Tiempo(s)')
ylabel('Concentracion(Kg/m^3)')
grid on
hold on

figure(3)
plot(t,Cc1,t1,Cc1,'LineWidth',2)
title('Concentracion Cc VS tiempo')
xlabel('Tiempo(s)')
ylabel('Concentracion(Kg/m^3)')
grid on
hold on

figure(4)
plot(t,T1,'LineWidth',2)
title('T1 vs tiempo')
xlabel('Tiempo(s)')
ylabel('volumen(m^3)')
grid on
hold on

figure(5)
plot(t,Tc,'LineWidth',2)
title('Tc vs tiempo')
xlabel('Tiempo(s)')
ylabel('volumen(m^3)')
grid on
hold on

figure(6)
plot(t,T2,'LineWidth',2)
title('T2 vs tiempo')
xlabel('Tiempo(s)')
ylabel('volumen(m^3)')
grid on
hold on

CONSTANTES

clear
clc

%Parámetros
Pv11=25;
T1=65.56; %150 F
Pv12=200;
T2=93.33; %200F
Pv21=14.7;
Pv22=60;
Pv31=4;
Pv32=14.7;
Pv41=0.5;
Pv42=5;

%Resolución de ecuaciones no lineales


syms A1 B1
eq1=Pv11==10^(A1-(B1/(T1)));
eq2=Pv12==10^(A1-(B1/(T2)));
[A1 B1 ]=vpasolve([eq1 eq2], [A1 B1])

syms A2 B2
eq3=Pv21==10^(A2-(B2/(T1)));
eq4=Pv22==10^(A2-(B2/(T2)));
[A2 B2 ]=vpasolve([eq3 eq4], [A2 B2])

syms A3 B3
eq5=Pv31==10^(A3-(B3/(T1)));
eq6=Pv32==10^(A3-(B3/(T2)));
[A3 B3 ]=vpasolve([eq5 eq6], [A3 B3])

syms A4 B4
eq7=Pv41==10^(A4-(B4/(T1)));
eq8=Pv42==10^(A4-(B4/(T2)));
[A4 B4 ]=vpasolve([eq7 eq8], [A4 B4])

Temperatura compomnentes

clear
clc

%Parámetros
A=70; %kgmol/h
V=30; %kgmol/h
L=60; %kgmol/h
P=70; %psi

%Parámetros de Antoine
%Componente 1
A1=4.433;
B1=198.983;

%Componente 2
A2=3.220;
B2=134.588;

%Componenete 3
A3=2.502;
B3=124.546;

%Componenete 4
A4=3.059;
B4=220.335;

%Composiciones iniciales de los componente en mol


x1=0.15;
x2=0.45;
x3=0.3;
x4=0.1;

%Resolución de ecuaciones no lineales1


syms T x1L x2L x3L x4L
P1(T)=10^(A1-(B1/(T)));
P2(T)=10^(A2-(B2/(T)));
P3(T)=10^(A3-(B3/(T)));
P4(T)=10^(A4-(B4/(T)));
eq1=x1L*P1+x2L*P2+x3L*P3+x4L*P4==P;
eq2=x1L*L+x1L*P1*V/P==x1*A;
eq3=x2L*L+x2L*P2*V/P==x2*A;
eq4=x3L*L+x3L*P3*V/P==x3*A;
eq5=x4L*L+x4L*P4*V/P==x4*A;

[T x1L x2L x3L x4L]=vpasolve([eq1 eq2 eq3 eq4 eq5], [T x1L x2L x3L x4L])

y1=x1L*P1(T)/P
y2=x2L*P2(T)/P
y3=x3L*P3(T)/P
y4=x4L*P4(T)/P

You might also like