
function tracer(k1,k2,tmax,init)
	function [yd]=systeme(t,y)
		yd(1)=-k1*y(1)
		yd(2)=k1*y(1)-k2*y(2)
		yd(3)=k2*y(2)
	endfunction
	rtol=1d-4;
	atol=[1d-4; 1d-4; 1d-4];
	t=[0:tmax/300:tmax];
	y=ode(init,0,t,rtol,atol,systeme);
	a=y(1,:);
	b=y(2,:);
	c=y(3,:);
	plot2d(t,a,style=color('red')) 
	plot2d(t,b,style=color('seagreen')) 
	plot2d(t,c,style=color('royalblue'))
    legends(["a","b","c"],[color('red'),color('seagreen'),color('royalblue')])
endfunction
            
plotA=scf();
init=[1;0;0]; tmax=10;
tracer(1,1,tmax,init)
xtitle("k1 = 1, k2 = 1","t")
            
plotB=scf();
init=[1;0;0]; tmax=10;
tracer(1,4,tmax,init)
xtitle("k1 = 1, k2 = 4","t")
            
plotC=scf();
init=[1;0;0]; tmax=10;
tracer(1,50,tmax,init)
xtitle("k1 = 1, k2 = 50","t")
            
plotD=scf();
init=[1;0;0]; tmax=5;
tracer(50,1,tmax,init)
xtitle("k1 = 50, k2 = 1","t")
            
