%
% Supplementary Matlab files for the paper:
%
% " Deterministic Modelling and Stochastic Simulation of Pathways using Matlab"
% by M.Ullah, H.Schmidt, K-H.Cho and O.Wolkenhauer
%
% This script file simulates the MAPK pathway using Michaelis-Menten Kinetics and generates the temporal
% evolution of three important concentrations
%
% We would appreciate a citation if these files are used by others.

function kholodenko
k = [2.5 .25;.025 .75;.025 .75;.025 .5;.025 .5];
Km = [10 8;15 15;15 15;15 15;15 15];
[xT,x0,KI,n,u] = deal([100;300;300],zeros(5,1),9,1,1);
    function xd = rate(t,x)
        s = [xT(1)-x(1);xT(2)-x(2)-x(3);x(2);xT(3)-x(4)-x(5);x(4)];
        e = [u/(1+(x(5)/KI)^n);x([1;1;3;3])];
        V = [k(:,1).*e.*s./(Km(:,1)+s)  k(:,2).*x./(Km(:,2)+x)];
        xd = V(:,1) - V(:,2);
        xd([2 4]) = xd([2 4])-xd([3 5]);
    end
[t,x] = ode15s(@rate, [0 150*60], x0);

fig = figure('PaperPosition',[2 2 8 6.3],'PaperType','A4');
 
ax = axes('FontName','cmr','FontSize',8,'Position',[0.1264 0.15 0.7879 0.7643],'Parent',fig);

h = plot(t/60,x(:,[1 3 5]));
set(h,{'LineWidth'},{1.5;1.5;1.2},{'LineStyle'},{'--';':';'-'},{'Color'},{'b';'k';'r'});

xlabel(ax,'time  (min)');
ylabel(ax,'concentration  (nM)');
legend(ax,{' MAPK',' MAPKK',' MAPKKK'},'FontName','Times','FontSize',8);
legend(ax,'boxoff')
axis([0 150 0 350])
% print  -depsc 'figures\kholodenko.eps'
end