 %  DOQCS : http://doqcs.ncbs.res.in/ 
 %  Accession Name = MAPK_MKP1_oscillation 
 %  Accession Number = 9 
 %  Transcriber = Upinder S. Bhalla, NCBS 
 %  Developer = Upinder S. Bhalla, NCBS 
 %  Species = Generic mammalian 
 %  Tissue = NIH 3T3 Expression 
 %  Cell Compartment = Surface - Nucleus 
 %  Notes =  This model relates to figure 5 in <a href=http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=12779455>Bhalla US, Iyengar R. Chaos (2001) 11(1):221-226</a>. It includes the model used for figures 2-4 and also has MKP-1 induction by MAPK activity in the synapse. PP2A is set to 0.16 uM and MKP synthesis is varied from 5x to 40 x basal to get a range of interesting behaviours. 
 
   % Note: All the concentrations are in micro Mole (uM)

function moose_convert
%Matlab simulation for chemical kinetics

% Saved on Mon Jul 16 10:50:36 2007
% Automatically generated from kkit model in MOOSE by conv_matlab

global buff;
global t;
global y;

% Define Tables here
tspan=[0, 5000];
% Molecule names
molnames = {
'1 /kinetics/PKC/PKC-Ca'
'2 /kinetics/PKC/PKC-DAG-AA*'
'3 /kinetics/PKC/PKC-Ca-AA*'
'4 /kinetics/PKC/PKC-Ca-memb*'
'5 /kinetics/PKC/PKC-DAG-memb*'
'6 /kinetics/PKC/PKC-basal*'
'7 /kinetics/PKC/PKC-AA*'
'8 /kinetics/PKC/PKC-Ca-DAG'
'9 /kinetics/PKC/PKC-DAG'
'10 /kinetics/PKC/PKC-DAG-AA'
'11 /kinetics/PKC/PKC-cytosolic'
'12 /kinetics/AA'
'13 /kinetics/PKC-active/PKC-act-raf/PKC-act-raf_cplx'
'14 /kinetics/PKC-active/PKC-inact-GAP/PKC-inact-GAP_cplx'
'15 /kinetics/PKC-active/PKC-act-GEF/PKC-act-GEF_cplx'
'16 /kinetics/MAPK/craf-1'
'17 /kinetics/MAPK/craf-1*'
'18 /kinetics/MAPK/MAPKK'
'19 /kinetics/MAPK/MAPK'
'20 /kinetics/MAPK/craf-1**'
'21 /kinetics/MAPK/MAPK-tyr'
'22 /kinetics/MAPK/MAPKK*'
'23 /kinetics/MAPK/MAPKK*/MAPKKtyr/MAPKKtyr_cplx'
'24 /kinetics/MAPK/MAPKK*/MAPKKthr/MAPKKthr_cplx'
'25 /kinetics/MAPK/MAPKK-ser'
'26 /kinetics/MAPK/Raf-GTP-Ras*'
'27 /kinetics/MAPK/Raf-GTP-Ras*/Raf-GTP-Ras*.1/Raf-GTP-Ras*.1_cplx'
'28 /kinetics/MAPK/Raf-GTP-Ras*/Raf-GTP-Ras*.2/Raf-GTP-Ras*.2_cplx'
'29 /kinetics/MAPK/RGR'
'30 /kinetics/MAPK/RGR/RGR.1/RGR.1_cplx'
'31 /kinetics/MAPK/RGR/RGR.2/RGR.2_cplx'
'32 /kinetics/MAPK/MKP-1-ser359*'
'33 /kinetics/MAPK/MKP-1**'
'34 /kinetics/MAPK/nuc_MAPK*'
'35 /kinetics/MAPK/nuc_MAPK*/MKP-1-synthesis/MKP-1-synthesis_cplx'
'36 /kinetics/MAPK*'
'37 /kinetics/MAPK*/MAPK*-feedback/MAPK*-feedback_cplx'
'38 /kinetics/MAPK*/MAPK*/MAPK*_cplx'
'39 /kinetics/MAPK*/MKP-1-phosph/MKP-1-phosph_cplx'
'40 /kinetics/MAPK*/MKP-1-phosph2/MKP-1-phosph2_cplx'
'41 /kinetics/MKP-1'
'42 /kinetics/PPhosphatase2A'
'43 /kinetics/PPhosphatase2A/craf-deph/craf-deph_cplx'
'44 /kinetics/PPhosphatase2A/MAPKK-deph/MAPKK-deph_cplx'
'45 /kinetics/PPhosphatase2A/MAPKK-deph-ser/MAPKK-deph-ser_cplx'
'46 /kinetics/PPhosphatase2A/craf**-deph/craf**-deph_cplx'
'47 /kinetics/PLA2/PLA2-cytosolic'
'48 /kinetics/PLA2/PLA2-Ca*'
'49 /kinetics/PLA2/PLA2-Ca*/kenz/kenz_cplx'
'50 /kinetics/PLA2/PIP2-PLA2*'
'51 /kinetics/PLA2/PIP2-PLA2*/kenz/kenz_cplx'
'52 /kinetics/PLA2/PIP2-Ca-PLA2*'
'53 /kinetics/PLA2/PIP2-Ca-PLA2*/kenz/kenz_cplx'
'54 /kinetics/PLA2/DAG-Ca-PLA2*'
'55 /kinetics/PLA2/DAG-Ca-PLA2*/kenz/kenz_cplx'
'56 /kinetics/PLA2/PLA2*-Ca'
'57 /kinetics/PLA2/PLA2*-Ca/kenz/kenz_cplx'
'58 /kinetics/PLA2/PLA2*'
'59 /kinetics/Ras/inact-GEF'
'60 /kinetics/Ras/GEF*'
'61 /kinetics/Ras/GEF*/GEF*-act-ras/GEF*-act-ras_cplx'
'62 /kinetics/Ras/GTP-Ras'
'63 /kinetics/Ras/GDP-Ras'
'64 /kinetics/Ras/GAP*'
'65 /kinetics/Ras/GAP'
'66 /kinetics/Ras/GAP/GAP-inact-ras/GAP-inact-ras_cplx'
};

bufnames = {
'1 /kinetics/DAG'
'2 /kinetics/Ca'
'3 /kinetics/MAPK/MKP-1-gene'
'4 /kinetics/MAPK/Ubiquitination'
'5 /kinetics/PLA2/APC'
'6 /kinetics/temp-PIP2'
};

sumtotnames = {
'1 /kinetics/PKC-active'
};

% Initial concs of 66 molecules
y0(1) = 3.72083e-17;
y0(2) = 4.91367e-18;
y0(3) = 1.75e-16;
y0(4) = 1.3896e-17;
y0(5) = 9.43517e-21;
y0(6) = 0.02;
y0(7) = 1.81333e-17;
y0(8) = 8.46317e-23;
y0(9) = 1.16102e-16;
y0(10) = 2.51883e-19;
y0(11) = 1;
y0(12) = 6.12;
y0(13) = 0;
y0(14) = 0;
y0(15) = 0;
y0(16) = 0.2;
y0(17) = 0;
y0(18) = 0.18;
y0(19) = 0.36;
y0(20) = 0;
y0(21) = 0;
y0(22) = 0;
y0(23) = 0;
y0(24) = 0;
y0(25) = 0;
y0(26) = 0;
y0(27) = 0;
y0(28) = 0;
y0(29) = 0;
y0(30) = 0;
y0(31) = 0;
y0(32) = 0;
y0(33) = 0;
y0(34) = 0;
y0(35) = 0;
y0(36) = 0;
y0(37) = 0;
y0(38) = 0;
y0(39) = 0;
y0(40) = 0;
y0(41) = 0.0027;
y0(42) = 0.224;
y0(43) = 0;
y0(44) = 0;
y0(45) = 0;
y0(46) = 0;
y0(47) = 0.4;
y0(48) = 0;
y0(49) = 0;
y0(50) = 0;
y0(51) = 0;
y0(52) = 0;
y0(53) = 0;
y0(54) = 0;
y0(55) = 0;
y0(56) = 0;
y0(57) = 0;
y0(58) = 0;
y0(59) = 0.1;
y0(60) = 0;
y0(61) = 0;
y0(62) = 0;
y0(63) = 0.2;
y0(64) = 0;
y0(65) = 0.002;
y0(66) = 0;
buff(1) = 11.661;
buff(2) = 0.08;
buff(3) = 1;
buff(4) = 0;
buff(5) = 30;
buff(6) = 2.5;
% Sumtotal eqn for /kinetics/PKC-active: sumtot(1) =  (y(2) + y(4) + y(3) + y(5) + y(6) + y(7) - y(13) - y(14) - y(15) )

% Call the ODE solver and display results
[t, y] = ode23s(@f, tspan, y0);

hold on;
do_plots;


function do_plots()
global t;
global y;
global buff;

 plot(t,y(:,62));
 plot(t,y(:,26));
 plot(t,y(:,22));
 plot(t,y(:,36));
 plot(t,y(:,12));
 plot(t, (y(:,2) + y(:,4) + y(:,3) + y(:,5) + y(:,6) + y(:,7) - y(:,13) - y(:,14) - y(:,15)));
 plot(t,y(:,56));
 plot(t,y(:,58));
 plot(t,y(:,41));
 plot(t,y(:,42));
 plot(t,y(:,29));

% Evaluation function
function dydt = f(t, y)
global buff;
dydt = [
 + 0.6 * y(11) * buff(2) - 0.5 * y(1) - 0.0079998 * buff(1) * y(1) + 8.6348 * y(8) - 1.2705 * y(1) + 3.5026 * y(4) - 0.0012 * y(1) * y(12) + 0.1 * y(3)
 + 2 * y(10) - 0.2 * y(2)
 + 0.0012 * y(1) * y(12) - 0.1 * y(3)
 + 1.2705 * y(1) - 3.5026 * y(4)
 + 1 * y(8) - 0.1 * y(5)
 + 1 * y(11) - 50 * y(6)
 + 0.00012 * y(12) * y(11) - 0.1 * y(7)
 + 0.0079998 * buff(1) * y(1) - 8.6348 * y(8) - 1 * y(8) + 0.1 * y(5)
 + 0.0006 * y(11) * buff(1) - 0.1 * y(9) - 0.018 * y(9) * y(12) + 2 * y(10)
 + 0.018 * y(9) * y(12) - 2 * y(10) - 2 * y(10) + 0.2 * y(2)
 - 0.6 * y(11) * buff(2) + 0.5 * y(1) - 1 * y(11) + 50 * y(6) - 0.00012 * y(12) * y(11) + 0.1 * y(7) - 0.0006 * y(11) * buff(1) + 0.1 * y(9)
 - 0.0012 * y(1) * y(12) + 0.1 * y(3) - 0.00012 * y(12) * y(11) + 0.1 * y(7) - 0.018 * y(9) * y(12) + 2 * y(10) + 5.4 * y(49) + 11.04 * y(51) + 36 * y(53) + 60 * y(55) + 120 * y(57) - 0.4 * y(12)
 + 0.3 * y(16) *  (y(2) + y(4) + y(3) + y(5) + y(6) + y(7) - y(13) - y(14) - y(15) ) - 16 * y(13) - 4 * y(13)
 + 6 * y(65) *  (y(2) + y(4) + y(3) + y(5) + y(6) + y(7) - y(13) - y(14) - y(15) ) - 16 * y(14) - 4 * y(14)
 + 6 * y(59) *  (y(2) + y(4) + y(3) + y(5) + y(6) + y(7) - y(13) - y(14) - y(15) ) - 16 * y(15) - 4 * y(15)
 - 0.3 * y(16) *  (y(2) + y(4) + y(3) + y(5) + y(6) + y(7)  - y(13) - y(14) - y(15)) + 16 * y(13) + 6 * y(43)
 + 4 * y(13) - 1.95 * y(17) * y(36) + 40 * y(37) - 1.98 * y(17) * y(42) + 25 * y(43) + 6 * y(46) - 24 * y(17) * y(62) + 0.5 * y(26)
 + 6 * y(45) - 3.3 * y(18) * y(26) + 0.42 * y(27) - 3.3 * y(18) * y(29) + 0.42 * y(30)
 - 16.2 * y(19) * y(22) + 0.6 * y(23) + 1 * y(41) * y(21) / ( 0.0666667 + y(21) ) + 1 * y(33) * y(21) / ( 0.0666667 + y(21) )
 + 10 * y(37) - 1.98 * y(20) * y(42) + 25 * y(46)
 + 0.15 * y(23) - 16.2 * y(21) * y(22) + 0.6 * y(24) - 1 * y(41) * y(21) / ( 0.0666667 + y(21) ) + 1 * y(41) * y(36) / ( 0.0666667 + y(36) ) - 1 * y(33) * y(21) / ( 0.0666667 + y(21) ) + 1 * y(33) * y(36) / ( 0.0666667 + y(36) )
 - 16.2 * y(19) * y(22) + 0.6 * y(23) + 0.15 * y(23) - 16.2 * y(21) * y(22) + 0.6 * y(24) + 0.15 * y(24) - 1.98 * y(22) * y(42) + 25 * y(44) + 0.105 * y(28) + 0.105 * y(31)
 + 16.2 * y(19) * y(22) - 0.6 * y(23) - 0.15 * y(23)
 + 16.2 * y(21) * y(22) - 0.6 * y(24) - 0.15 * y(24)
 + 6 * y(44) - 1.98 * y(25) * y(42) + 25 * y(45) + 0.105 * y(27) - 3.3 * y(25) * y(26) + 0.42 * y(28) + 0.105 * y(30) - 3.3 * y(25) * y(29) + 0.42 * y(31)
 + 24 * y(17) * y(62) - 0.5 * y(26) - 3.3 * y(18) * y(26) + 0.42 * y(27) + 0.105 * y(27) - 3.3 * y(25) * y(26) + 0.42 * y(28) + 0.105 * y(28)
 + 3.3 * y(18) * y(26) - 0.42 * y(27) - 0.105 * y(27)
 + 3.3 * y(25) * y(26) - 0.42 * y(28) - 0.105 * y(28)
 - 3.3 * y(18) * y(29) + 0.42 * y(30) + 0.105 * y(30) - 3.3 * y(25) * y(29) + 0.42 * y(31) + 0.105 * y(31)
 + 3.3 * y(18) * y(29) - 0.42 * y(30) - 0.105 * y(30)
 + 3.3 * y(25) * y(29) - 0.42 * y(31) - 0.105 * y(31)
 + 1 * y(39) - 0.195 * y(32) * y(36) + 4 * y(40) - 0.0001 * y(32) - 0.01 * y(32) + 0.01 * y(33)
 - 0.0001 * y(33) + 1 * y(40) - 0.01 * y(33)
 + 2e-05 * y(36) - 0.0001 * y(34) - 4.02e-05 * buff(3) * y(34) + 0.001 * y(35) + 0.0001 * y(35)
 + 4.02e-05 * buff(3) * y(34) - 0.001 * y(35) - 0.0001 * y(35)
 - 1.95 * y(17) * y(36) + 40 * y(37) + 10 * y(37) + 0.15 * y(24) - 1 * y(41) * y(36) / ( 0.0666667 + y(36) ) - 3.9 * y(47) * y(36) + 80 * y(38) + 20 * y(38) - 0.195 * y(41) * y(36) + 4 * y(39) + 1 * y(39) - 1 * y(33) * y(36) / ( 0.0666667 + y(36) ) - 0.195 * y(32) * y(36) + 4 * y(40) + 1 * y(40) - 2e-05 * y(36) + 0.0001 * y(34)
 + 1.95 * y(17) * y(36) - 40 * y(37) - 10 * y(37)
 + 3.9 * y(47) * y(36) - 80 * y(38) - 20 * y(38)
 + 0.195 * y(41) * y(36) - 4 * y(39) - 1 * y(39)
 + 0.195 * y(32) * y(36) - 4 * y(40) - 1 * y(40)
 - 0.195 * y(41) * y(36) + 4 * y(39) - 0.00037 * y(41) + 7e-07 * buff(3) + 0.01 * y(32) + 0.0001 * y(35)
 - 1.98 * y(17) * y(42) + 25 * y(43) + 6 * y(43) - 1.98 * y(22) * y(42) + 25 * y(44) + 6 * y(44) - 1.98 * y(25) * y(42) + 25 * y(45) + 6 * y(45) - 1.98 * y(20) * y(42) + 25 * y(46) + 6 * y(46)
 + 1.98 * y(17) * y(42) - 25 * y(43) - 6 * y(43)
 + 1.98 * y(22) * y(42) - 25 * y(44) - 6 * y(44)
 + 1.98 * y(25) * y(42) - 25 * y(45) - 6 * y(45)
 + 1.98 * y(20) * y(42) - 25 * y(46) - 6 * y(46)
 - 1.00002 * y(47) * buff(2) + 0.1 * y(48) - 0.0012 * buff(6) * y(47) + 0.5 * y(50) - 3.9 * y(47) * y(36) + 80 * y(38) + 0.17 * y(58)
 + 1.00002 * y(47) * buff(2) - 0.1 * y(48) - 1.35 * buff(5) * y(48) + 21.6 * y(49) + 5.4 * y(49) - 0.012 * buff(6) * y(48) + 0.1 * y(52) - 0.003 * buff(1) * y(48) + 4 * y(54)
 + 1.35 * buff(5) * y(48) - 21.6 * y(49) - 5.4 * y(49)
 + 0.0012 * buff(6) * y(47) - 0.5 * y(50) - 2.76 * buff(5) * y(50) + 44.16 * y(51) + 11.04 * y(51)
 + 2.76 * buff(5) * y(50) - 44.16 * y(51) - 11.04 * y(51)
 + 0.012 * buff(6) * y(48) - 0.1 * y(52) - 9 * buff(5) * y(52) + 144 * y(53) + 36 * y(53)
 + 9 * buff(5) * y(52) - 144 * y(53) - 36 * y(53)
 + 0.003 * buff(1) * y(48) - 4 * y(54) - 15 * buff(5) * y(54) + 240 * y(55) + 60 * y(55)
 + 15 * buff(5) * y(54) - 240 * y(55) - 60 * y(55)
 - 30 * buff(5) * y(56) + 480 * y(57) + 120 * y(57) + 6 * y(58) * buff(2) - 0.1 * y(56)
 + 30 * buff(5) * y(56) - 480 * y(57) - 120 * y(57)
 + 20 * y(38) - 6 * y(58) * buff(2) + 0.1 * y(56) - 0.17 * y(58)
 - 6 * y(59) *  (y(2) + y(4) + y(3) + y(5) + y(6) + y(7)  - y(13) - y(14) - y(15)) + 16 * y(15) + 1 * y(60)
 + 4 * y(15) - 1 * y(60) - 0.198 * y(63) * y(60) + 0.08 * y(61) + 0.02 * y(61)
 + 0.198 * y(63) * y(60) - 0.08 * y(61) - 0.02 * y(61)
 - 999.6 * y(62) * y(65) + 1000 * y(66) - 0.0001 * y(62) + 0.02 * y(61) - 24 * y(17) * y(62) + 0.5 * y(26)
 + 10 * y(66) + 0.0001 * y(62) - 0.198 * y(63) * y(60) + 0.08 * y(61)
 + 4 * y(14) - 0.1 * y(64)
 - 999.6 * y(62) * y(65) + 1000 * y(66) + 10 * y(66) - 6 * y(65) *  (y(2) + y(4) + y(3) + y(5) + y(6) + y(7) - y(13) - y(14) - y(15) ) + 16 * y(14) + 0.1 * y(64)
 + 999.6 * y(62) * y(65) - 1000 * y(66) - 10 * y(66)
];

% end of model
