%
% 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 and generates the
% stimulus-response curve for three important concentrations
%
% We would appreciate a citation if these files are used by others.

clc;clear all;close all
load mapk       
V = gma(D,k);
tspan = [0 50 100];
n = 50;
E1 = logspace(-6,-1,n);
xx = x0(:,ones(1,n));
for i=1:n    
    x0(2) = E1(i);
    [t,x] = ode15s(V,tspan,x0);
    x0 = x(end,:);
    xx(:,i) = x0;
end
xxm = max(xx,[],2);
xx = xx./xxm(:,ones(1,n));

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 = semilogx(E1, xx([4 13 21],:));
set(h,{'LineWidth'},{1.5;1.5;1.2},{'LineStyle'},{'--';':';'-'},{'Color'},{'b';'k';'r'});

xlabel(ax,'input stimulus [E1T]');
ylabel(ax,'steady-state kinase activity');
legend(ax,{' MAPKKK-P',' MAPKK-P',' MAPK-P'},'FontName','Times','FontSize',8);
legend(ax,'boxoff')

% print  -depsc 'figures\stimresp.eps'