% 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 enzyme kinetic example 
%
% We would appreciate a citation if these files are used by others.


% R1: E + S --k1--> ES
% R2: ES    --k2--> E + S
% R3: ES    --k3--> E + P

% Parameters

x0 = [0.5; 1; 0; 0];   
D = [ -1   1   1    
      -1   1   0    
       1  -1  -1   
       0   0   1 ];
L = -D.*(D < 0);
k = 60*[10 2 0.02];

% ODE Construction

M1s = ones(size(k));
V = @(t,x) D*(k.*prod(x(:,M1s).^L)).';

% Solution and Display

[t,x] = ode15s(V, [0 10], 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(ax,t,x);
set(h,{'LineWidth'},{1.5;1.5;1.2;1.5},{'LineStyle'},{'--';':';'-';'-.'},{'Color'},{'b';'k';'r';'m'});

xlabel(ax,'time  (min)');
ylabel(ax,'concentration  (nM)');
legend(ax,{'E','S','ES','P'},'FontName','Times','FontSize',8);
legend(ax,'boxoff')

% print  -depsc 'figures\enzymkin.eps'