global k1 km1 k2 e0 x0 = [1;0.1;0;0]; % column array of substrate,enzyme,complex,product % x0 is representative of the variables s0, e0, es0/c0, and p0 t = 0:0.1:100; k1 = 1; km1 = 1; k2 = 5; K = (km1+k2)/k1; e0 = x0(2); [tt,xx] = ode45('catalysis',t,x0); y0 = x0(1); [ts,ys] = ode45('michaelis_menten',t,y0); % defined in catalysis and now using program to produce solution % ode45 assumes column vector but MATLAB assumes row vector cs = e0*ys./(ys+K); figure plot(tt,xx),legend('substrate','enzyme','complex','product'); % tt = column vector version of t % xx = array where #rows is the #time points, #cols=4 % col.1=scons,col.2=e,col.3=c,col.4=p figure plot(tt,[xx(:,1),xx(:,3),ys,cs]),legend('substrate','complex','MM substrate','MM complex'); z0 = [x0(1);x0(4)]; (tz,zz)= ode45('michaelis_menten_product'); figure plot(tz,zz), legend ('substrate','product');