A0=5;
X0=5*10^(-4);
Y0=10^(-5);
B0=0;
k1=0.1;
k2=0.1;
k3=0.05;
t0=0;
tN=200;
h=0.01
N=(tN-t0)/h;
t=t0:h:tN;
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;
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.*X(i).*A(i));
end


hold on

plot(t,X)
plot(t,Y,'r')
plot(t,B,'y')
plot(t,A,'g')
 
hold off


%falta poner leyenda
