Reacciones con Autocatálisis (A5)
| Trabajo realizado por estudiantes | |
|---|---|
| Título | Reacciones con Autocatálisis. Grupo 5A |
| Asignatura | Ecuaciones Diferenciales |
| Curso | Curso 2014-15 |
| Autores | Javier Blanco Villarroel Marta Cavero Guillén Alba Bringas Gil Irene Bendala Sugrañes Paula Botella Andreu |
| Este artículo ha sido escrito por estudiantes como parte de su evaluación en la asignatura | |
Consideraremos una reacción química irreversible en una solución bien mezclada.
Supondremos que la reacción ocurre para un volumen y temperatura constantes.
Al inicio se encuentran dos reactivos A y B que van formando un producto C en lo que se
conoce como una reacción bimolecular, es decir, una molécula de A y una de B producen una de C,
[math] A + B \rightarrow C [/math]
Supondremos también que se satisface la ley de acción de masas que establece que la velocidad de
reacción es proporcional al producto de las concentraciones de los reactivos.
En nuestro caso analizaremos el caso particular en el que A se transforma en B pero suponiendo
que la presencia de B hace de efecto catalítico en la reacción. Escribiremos este proceso como una
reacción bimolecular
[math] A + B \rightarrow k . 2B [/math]
en la que B hace al mismo tiempo papel de reactivo y producto.
Llamaremos:
[math] x= A+B[/math]
[math] y= 2B[/math]
Despejando el sistema obtenemos que:
[math] B=\frac{y}{2}[/math]
[math] A=x-\frac{y}{2}[/math]
A partir del principio de conservación de masas sabemos que [math] x+y= cte [/math] por lo que [math] x'+ y' = 0[/math] , quedando demostrada la primera ecuación.
La velocidad de reacción [math] v= k.A.B[/math] y además sabemos que [math]v= y' = -x'[/math]
Del sistema anterior obtenemos que [math] AB=\frac{y}{2}. (x-\frac{y}{2})[/math], sustituyendo:
[math]y' = k.\frac{y}{2}.(x-\frac{y}{2}) [/math]
y como [math] x=cte-y[/math] podemos decir que [math]y' = k.\frac{y}{2}.(cte-y-\frac{y}{2}) \rightarrow [/math]
%Ejercicio 2.2 Euler
t0=0
tn=10
n=100
h=(tn-t0)/n;
t=t0:h:tn;
y0=1
y=zeros(1,n+1);
y(1)=y0;
yy=y0;
k=1
x0=0.01
x=zeros(1,n+1);
x(1)=x0;
xx=x0;
for i=1:n
yy=yy+h*(-k*xx.*yy);
xx=xx+h*k*(xx.*yy);
y(i+1)=yy;
x(i+1)=xx;
end
plot(t,y,'g','linewidth',2)
title('Concentración - Tiempo','FontName','Berlin sans FB','FontSize', 20);
xlabel('Tiempo (s)','FontSize', 11);
ylabel('Concentración (mol/L)','FontSize', 11);
legend('Concentración de B','Concentración de A','location','east')
%Ejercicio 2.3 trapecio
t0=0
tn=10
n=100
h=(tn-t0)/n;
t=t0:h:tn;
y0=1
y=zeros(1,n+1);
y(1)=y0;
yy=y0;
k=1
x0=0.01;
x=zeros(1,n+1);
x(1)=x0;
xx=x0;
for i=1:n
yy=(((2*yy)/(-k*h))+xx.*yy)/((-2/(k*h))+(-k*xx));
xx=(((2*xx)/(k*h))+xx.*yy)/((2/(k*h))-(k*yy));
y(i+1)=yy;
x(i+1)=xx;
end
plot(t,x,'k','linewidth',2)
hold on
plot(t,y,'c','linewidth',2)
title('Concentración - Tiempo (Trapecio)','FontName','Berlin sans FB','FontSize', 20);
xlabel('Tiempo (s)','FontSize', 11);
ylabel('Concentración (mol/L)','FontSize', 11);
legend('Concentración de B','Concentración de A','location','best'
%Ejercicio 2.3 Runge Kutta
t0=0
tn=10
n=100
h=(tn-t0)/n;
t=t0:h:tn;
y0=1
y=zeros(1,n+1);
y(1)=y0;
yy=y0;
k=1
x0=0.01
x=zeros(1,n+1);
x(1)=x0;
xx=x0;
for i =1:n
k1A=(-k*xx.*yy);
k1B=(k*xx.*yy);
y1=yy+h*k1A/2;
x1=xx+h*k1B/2
k2A=(-k*x1.*y1);
k2B=(k*x1.*y1);
y2=yy+h*k2A/2;
x2=xx+h*k2B/2;
k3A=(-k*x2.*y2);
k3B=(k*x2.*y2);
y3=yy+h*k3A/2;
x3=xx+h*k3B/2;
k4A=(-k*x3.*y3);
k4B=(k*x3.*y3);
yy=yy+((h/6)*(k1A+2*k2A+2*k3A+k4A));
xx=xx+((h/6)*(k1B+2*k2B+2*k3B+k4B));
y(i+1)=yy;
x(i+1)=xx;
end
figure(1)
plot(t,x,'y','linewidth',2)
hold on
plot(t,y,'m','linewidth',2)
title('Concentración - Tiempo (Runge-Kutta)','FontName','Berlin sans FB','FontSize', 20);
xlabel('Tiempo (s)','FontSize', 11);
ylabel('Concentración (mol/L)','FontSize', 11);
legend('Concentración de B','Concentración de A','location','best')
- Línea con sangría
1 Apartado 4
t0=0; tf=10;
w0=[1;0.01];
h=0.1; N=(tf-t0)/h;
t=t0:h:tf;
w=zeros(2,N+1); %las filas es el número de incógnitas en el sistema
w(:,1)=w0;
ww=w0;
%Euler
for n=1:N
F=[-1*ww(1)*ww(2);1*ww(1)*ww(2)];
ww=ww+h*F;
w(:,n+1)=ww;
end
subplot(1,2,1)
plot(t,w,'*'); %MATLAB dibuja una grágica para cada columna, NO poner color para que nos ponga cada una de un colo
legend('Concentración de A','Concentración de B', 'location','best')
xlabel('Tiempo (s)','FontSize', 11);
ylabel('Concentración (mol/L)','FontSize', 11);
title('Concentración - Tiempo (Euler)','FontName','Berlin sans FB','FontSize', 10);
%Runge Kutta
z0=[1;0.01]; %para volver a empezar
z=zeros(2,N+1); %las filas es el número de incógnitas en el sistema
z(:,1)=z0;
zz=z0;
for n=1:N
F=[-1*zz(1)*zz(2);1*zz(1)*zz(2)];
k1=F;
z1=F+(1/2)*k1*h;
k2=z1;
z2=F+(1/2)*k2*h;
k3=z2;
z3=F+k3*h;
k4=z3;
zz=zz+(h/6)*(k1+2*k2+2*k3+k4);
z(:,n+1)=zz;
end
subplot(1,2,2)
plot(t,z,'o')
legend('Concentración de A','Concentración de B', 'location','best')
xlabel('Tiempo (s)','FontSize', 11);
ylabel('Concentración (mol/L)','FontSize', 11);
title('Concentración - Tiempo (Runge-Kutta)','FontName','Berlin sans FB','FontSize', 10);
2 Apartado 6
t0=0;
tf=200;
h=0.01;
N=(tf-t0)/h;
t=t0:h:tf;
A0=5;
X0=5*(10^-4);
Y0=10^(-5);
B0=0;
A=zeros(1,N+1);
X=zeros(1,N+1);
Y=zeros(1,N+1);
B=zeros(1,N+1);
A(1)=A0;
X(1)=X0;
Y(1)=Y0;
B(1)=B0;
K1=0.1; K2=K1; K3=K1/2;
for i=1:N
X(i+1)=X(i)+h*(K1*A(i)*X(i)-K2*X(i)*Y(i));
Y(i+1)=Y(i)+h*(K2*X(i)*Y(i)-K3*Y(i));
B(i+1)=B(i)+h*(K3*Y(i));
A(i+1)= A(i)+h*(-K1*A(i)*X(i));
end
hold on
plot(t,A,'-r');
plot(t,X,'-g');
plot(t,Y,'-y');
plot(t,B,'-');
hold off
xlabel('Tiempo (s)','FontSize', 11);
ylabel('Concentración (mol/L)','FontSize', 11);
title('Concentración - Tiempo (Euler)','FontName','Berlin sans FB','FontSize', 20);
legend('Concentración de A','Concentración de X', 'Concentración de Y', 'Concentración de B', 'location','east')t0=0;
tf=200;
h=0.001;
N=(tf-t0)/h;
t=t0:h:tf;
A0=5;
X0=5*(10^-4);
Y0=10^(-5);
B0=0;
A=zeros(1,N+1);
X=zeros(1,N+1);
Y=zeros(1,N+1);
B=zeros(1,N+1);
A(1)=A0;
X(1)=X0;
Y(1)=Y0;
B(1)=B0;
K1=0.1; K2=K1; K3=K1/2;
for i=1:N
X(i+1)=X(i)+h*(K1*A(i)*X(i)-K2*X(i)*Y(i));
Y(i+1)=Y(i)+h*(K2*X(i)*Y(i)-K3*Y(i));
B(i+1)=B(i)+h*(K3*Y(i));
A(i+1)= A(i)+h*(-K1*A(i)*X(i));
end
hold on
plot(t,A,'-r');
plot(t,X,'-g');
plot(t,Y,'-y');
plot(t,B,'-');
hold off
xlabel('Tiempo (s)','FontSize', 11);
ylabel('Concentración (mol/L)','FontSize', 11);
title('Concentración - Tiempo (Euler)','FontName','Berlin sans FB','FontSize', 20);
legend('Concentración de A','Concentración de X', 'Concentración de Y', 'Concentración de B', 'location','east')
3 Apartado 7
t0=0; tf=200;
h=0.01; N=(tf-t0)/h;
t=t0:h:tf;
A0=5; X0=5*(10^-4); Y0=10^(-5); B0=0;
A=zeros(1,N+1);
X=zeros(1,N+1);
Y=zeros(1,N+1);
B=zeros(1,N+1);
A(1)=A0; X(1)=X0; Y(1)=Y0; B(1)=B0;
aa=A0; xx=X0; yy=Y0; bb=B0;
K1=0.1; K2=K1; K3=K1/2;
for n=1:N
K1A=-K1*aa*xx;
K2A=K1A+K1A*h;
K1X=K1*aa*xx-K2*xx*yy;
K2X=K1X+K1X*h;
K1Y=K2*xx*yy-K3*yy;
K2Y=K1Y+K1Y*h;
K1B=K3*yy;
K2B=K1B+K1B*h;
aa=aa+0.5*h*(K1A+K2A);
xx=xx+0.5*h*(K1X+K2X);
yy=yy+0.5*h*(K1Y+K2Y);
bb=bb+0.5*h*(K1B+K2B);
A(n+1)=aa;
X(n+1)=xx;
Y(n+1)=yy;
B(n+1)=bb;
end
plot(t,A,'*r');
hold on
plot(t,X,'*g');
plot(t,Y,'*y');
plot(t,B,'*');
hold off
xlabel('Tiempo (s)','FontSize', 11);
ylabel('Concentración (mol/L)','FontSize', 11);
title('Concentración - Tiempo (Heun)','FontName','Berlin sans FB','FontSize', 20);
legend('Concentración de A','Concentración de X', 'Concentración de Y', 'Concentración de B', 'location','best')