 %  DOQCS : http://doqcs.ncbs.res.in/ 
 %  Accession Name = Ajay_Bhalla_2007_Bistable 
 %  Accession Number = 79 
 %  Transcriber = Upinder S. Bhalla, NCBS 
 %  Developer = Upinder S. Bhalla, NCBS 
 %  Species = Rat 
 %  Tissue = Hippocampal CA1 
 %  Cell Compartment = Dendrite 
 %  Notes =  This is a model of ERKII signaling which is bistable due to feedback. The feedback occurs through ERKII phosphorylation of phospholipase A2 (PLA2), leading to increased production of arachidonic acid (AA), which activates protein kinase C (PKC) which activates c-Raf which is upstream of ERKII.<br> The model is a highly simplified variant of more detailed bistable models of MAPK signaling (<a href=http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=AbstractPlus&list_uids=9888852&query_hl=4&itool=pubmed_docsum>Bhalla US, Iyengar R. Science. 1999 Jan 15;283(5400):381-7</a>, <a href=http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=pubmed&cmd=Retrieve&dopt=AbstractPlus&list_uids=15548210&query_hl=2&itool=pubmed_docsum>Ajay SM, Bhalla US. Eur J Neurosci. 2004 Nov;20(10):2671-80</a>) 
 
   % Note: All the concentrations are in micro Mole (uM)

function moose_convert
%Matlab simulation for chemical kinetics

% Saved on Thu Jul 26 15:29:57 2007
% Automatically generated from kkit model in MOOSE by conv_matlab

global buff;
global t;
global y;

% Define Tables here
tspan=[0, 2500];
% 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/PLA2/PLA2-cytosolic'
'14 /kinetics/PLA2/PLA2-Ca*'
'15 /kinetics/PLA2/PLA2-Ca*/kenz/kenz_cplx'
'16 /kinetics/PLA2/PIP2-PLA2*'
'17 /kinetics/PLA2/PIP2-PLA2*/kenz/kenz_cplx'
'18 /kinetics/PLA2/PIP2-Ca-PLA2*'
'19 /kinetics/PLA2/PIP2-Ca-PLA2*/kenz/kenz_cplx'
'20 /kinetics/PLA2/DAG-Ca-PLA2*'
'21 /kinetics/PLA2/DAG-Ca-PLA2*/kenz/kenz_cplx'
'22 /kinetics/PLA2/PLA2*-Ca'
'23 /kinetics/PLA2/PLA2*-Ca/kenz/kenz_cplx'
'24 /kinetics/PLA2/PLA2*'
'25 /kinetics/MAPK/craf-1'
'26 /kinetics/MAPK/craf-1*'
'27 /kinetics/MAPK/MAPKK'
'28 /kinetics/MAPK/MAPK'
'29 /kinetics/MAPK/craf-1**'
'30 /kinetics/MAPK/MAPK-tyr'
'31 /kinetics/MAPK/MAPKK*'
'32 /kinetics/MAPK/MAPKK*/MAPKKtyr/MAPKKtyr_cplx'
'33 /kinetics/MAPK/MAPKK*/MAPKKthr/MAPKKthr_cplx'
'34 /kinetics/MAPK/MAPKK-ser'
'35 /kinetics/MAPK/Raf-GTP-Ras'
'36 /kinetics/MAPK/Raf-GTP-Ras/Raf-GTP-Ras.1/Raf-GTP-Ras.1_cplx'
'37 /kinetics/MAPK/Raf-GTP-Ras/Raf-GTP-Ras.2/Raf-GTP-Ras.2_cplx'
'38 /kinetics/MAPK/Raf*-GTP-Ras'
'39 /kinetics/MAPK/Raf*-GTP-Ras/Raf*-GTP-Ras.1/Raf*-GTP-Ras.1_cplx'
'40 /kinetics/MAPK/Raf*-GTP-Ras/Raf*-GTP-Ras.2/Raf*-GTP-Ras.2_cplx'
'41 /kinetics/Ras/inact-GEF'
'42 /kinetics/Ras/inact-GEF/basal_GEF_activity/basal_GEF_activity_cplx'
'43 /kinetics/Ras/GEF*'
'44 /kinetics/Ras/GEF*/GEF*-act-ras/GEF*-act-ras_cplx'
'45 /kinetics/Ras/GTP-Ras'
'46 /kinetics/Ras/GDP-Ras'
'47 /kinetics/Ras/GAP*'
'48 /kinetics/Ras/GAP'
'49 /kinetics/Ras/GAP/GAP-inact-ras/GAP-inact-ras_cplx'
'50 /kinetics/Ras/CaM-GEF'
'51 /kinetics/Ras/CaM-GEF/CaM-GEF-act-ras/CaM-GEF-act-ras_cplx'
'52 /kinetics/Ca'
'53 /kinetics/PKC-active/PKC-act-raf/PKC-act-raf_cplx'
'54 /kinetics/PKC-active/PKC-inact-GAP/PKC-inact-GAP_cplx'
'55 /kinetics/PKC-active/PKC-act-GEF/PKC-act-GEF_cplx'
'56 /kinetics/PKC-active/phosph-AC2/phosph-AC2_cplx'
'57 /kinetics/MAPK*'
'58 /kinetics/MAPK*/MAPK*/MAPK*_cplx'
'59 /kinetics/MAPK*/MAPK*-feedback/MAPK*-feedback_cplx'
'60 /kinetics/MKP-1'
'61 /kinetics/MKP-1/MKP1-tyr-deph/MKP1-tyr-deph_cplx'
'62 /kinetics/MKP-1/MKP1-thr-deph/MKP1-thr-deph_cplx'
'63 /kinetics/PPhosphatase2A'
'64 /kinetics/PPhosphatase2A/craf-deph/craf-deph_cplx'
'65 /kinetics/PPhosphatase2A/MAPKK-deph/MAPKK-deph_cplx'
'66 /kinetics/PPhosphatase2A/MAPKK-deph-ser/MAPKK-deph-ser_cplx'
'67 /kinetics/PPhosphatase2A/craf**-deph/craf**-deph_cplx'
'68 /kinetics/CaM/CaM'
'69 /kinetics/CaM/CaM-Ca3'
'70 /kinetics/CaM/CaM-TR2-Ca2'
'71 /kinetics/CaM/CaM-Ca4'
};

bufnames = {
'1 /kinetics/PLA2/APC'
'2 /kinetics/temp-PIP2'
'3 /kinetics/DAG'
'4 /kinetics/IP3'
'5 /kinetics/Ca_input'
};

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

% Initial concs of 71 molecules
y0(1) = 3.72076e-17;
y0(2) = 4.91368e-18;
y0(3) = 1.75007e-16;
y0(4) = 1.38955e-17;
y0(5) = 9.43516e-21;
y0(6) = 0;
y0(7) = 1.81331e-17;
y0(8) = 8.46314e-23;
y0(9) = 1.16101e-16;
y0(10) = 2.51883e-19;
y0(11) = 1;
y0(12) = 0;
y0(13) = 0.4;
y0(14) = 0;
y0(15) = 0;
y0(16) = 0;
y0(17) = 0;
y0(18) = 0;
y0(19) = 0;
y0(20) = 0;
y0(21) = 0;
y0(22) = 0;
y0(23) = 0;
y0(24) = 0;
y0(25) = 0.5;
y0(26) = 0;
y0(27) = 0.5;
y0(28) = 3.59997;
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.1;
y0(42) = 0;
y0(43) = 0;
y0(44) = 0;
y0(45) = 0;
y0(46) = 0.5;
y0(47) = 0;
y0(48) = 0.01;
y0(49) = 0;
y0(50) = 0;
y0(51) = 0;
y0(52) = 0.08;
y0(53) = 0;
y0(54) = 0;
y0(55) = 0;
y0(56) = 0;
y0(57) = 0;
y0(58) = 0;
y0(59) = 0;
y0(60) = 0.0240003;
y0(61) = 0;
y0(62) = 0;
y0(63) = 1;
y0(64) = 0;
y0(65) = 0;
y0(66) = 0;
y0(67) = 0;
y0(68) = 20;
y0(69) = 0;
y0(70) = 0;
y0(71) = 0;
buff(1) = 30;
buff(2) = 2.5;
buff(3) = 12.1999;
buff(4) = 0.730005;
buff(5) = 0.08;
% Sumtotal eqn for /kinetics/PKC-active: sumtot(1) =  (y(2) + y(4) + y(3) + y(5) + y(6) + y(7) )

% 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(:,1));
plot(t, (y(:,2) + y(:,4) + y(:,3) + y(:,5) + y(:,6) + y(:,7) ));

% Evaluation function
function dydt = f(t, y)
global buff;
dydt = [
 + 0.600004 * y(11) * y(52) - 0.5 * y(1) - 0.0079998 * buff(3) * y(1) + 8.6348 * y(8) - 1.2705 * y(1) + 3.5026 * y(4) - 0.00120001 * y(1) * y(12) + 0.1 * y(3)
 + 2 * y(10) - 0.2 * y(2)
 + 0.00120001 * 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.000120001 * y(12) * y(11) - 0.1 * y(7)
 + 0.0079998 * buff(3) * y(1) - 8.6348 * y(8) - 1 * y(8) + 0.1 * y(5)
 + 0.000600004 * y(11) * buff(3) - 0.1 * y(9) - 0.0179997 * y(9) * y(12) + 2 * y(10)
 + 0.0179997 * y(9) * y(12) - 2 * y(10) - 2 * y(10) + 0.2 * y(2)
 - 0.600004 * y(11) * y(52) + 0.5 * y(1) - 1 * y(11) + 50 * y(6) - 0.000120001 * y(12) * y(11) + 0.1 * y(7) - 0.000600004 * y(11) * buff(3) + 0.1 * y(9)
 - 0.00120001 * y(1) * y(12) + 0.1 * y(3) - 0.000120001 * y(12) * y(11) + 0.1 * y(7) - 0.0179997 * y(9) * y(12) + 2 * y(10) + 5.4 * y(15) + 11.04 * y(17) + 36 * y(19) + 60 * y(21) + 120 * y(23) - 0.4 * y(12)
 - 0.999994 * y(13) * y(52) + 0.1 * y(14) - 0.00120001 * buff(2) * y(13) + 0.5 * y(16) - 1.95006 * y(13) * y(57) + 40 * y(58) + 0.17 * y(24)
 + 0.999994 * y(13) * y(52) - 0.1 * y(14) - 1.35002 * buff(1) * y(14) + 21.6 * y(15) + 5.4 * y(15) - 0.0120001 * buff(2) * y(14) + 0.1 * y(18) - 0.00299998 * buff(3) * y(14) + 4 * y(20)
 + 1.35002 * buff(1) * y(14) - 21.6 * y(15) - 5.4 * y(15)
 + 0.00120001 * buff(2) * y(13) - 0.5 * y(16) - 2.75999 * buff(1) * y(16) + 44.16 * y(17) + 11.04 * y(17)
 + 2.75999 * buff(1) * y(16) - 44.16 * y(17) - 11.04 * y(17)
 + 0.0120001 * buff(2) * y(14) - 0.1 * y(18) - 8.99987 * buff(1) * y(18) + 144 * y(19) + 36 * y(19)
 + 8.99987 * buff(1) * y(18) - 144 * y(19) - 36 * y(19)
 + 0.00299998 * buff(3) * y(14) - 4 * y(20) - 15.0003 * buff(1) * y(20) + 240 * y(21) + 60 * y(21)
 + 15.0003 * buff(1) * y(20) - 240 * y(21) - 60 * y(21)
 - 29.9998 * buff(1) * y(22) + 480 * y(23) + 120 * y(23) + 6.00004 * y(24) * y(52) - 0.1 * y(22)
 + 29.9998 * buff(1) * y(22) - 480 * y(23) - 120 * y(23)
 + 10 * y(58) - 6.00004 * y(24) * y(52) + 0.1 * y(22) - 0.17 * y(24)
 - 0.299998 * y(25) *  (y(2) + y(4) + y(3) + y(5) + y(6) + y(7) ) + 16 * y(53) + 6 * y(64) - 6.00004 * y(25) * y(45) + 1 * y(35)
 + 4 * y(53) - 1.95006 * y(26) * y(57) + 40 * y(59) - 1.91612 * y(26) * y(63) + 24 * y(64) + 6 * y(67) - 9.99994 * y(26) * y(45) + 0.5 * y(38)
 + 6 * y(66) - 9.42825 * y(27) * y(38) + 1.2 * y(39) - 9.42825 * y(27) * y(35) + 1.2 * y(36)
 - 32.3997 * y(28) * y(31) + 1.2 * y(32) + 4 * y(61)
 + 10 * y(59) - 1.91612 * y(29) * y(63) + 24 * y(67)
 + 0.3 * y(32) - 32.3997 * y(30) * y(31) + 1.2 * y(33) - 150.003 * y(30) * y(60) + 16 * y(61) + 4 * y(62)
 - 32.3997 * y(28) * y(31) + 1.2 * y(32) + 0.3 * y(32) - 32.3997 * y(30) * y(31) + 1.2 * y(33) + 0.3 * y(33) - 1.91612 * y(31) * y(63) + 24 * y(65) + 0.3 * y(40) + 0.3 * y(37)
 + 32.3997 * y(28) * y(31) - 1.2 * y(32) - 0.3 * y(32)
 + 32.3997 * y(30) * y(31) - 1.2 * y(33) - 0.3 * y(33)
 + 6 * y(65) - 1.91612 * y(34) * y(63) + 24 * y(66) + 0.3 * y(39) - 9.42825 * y(34) * y(38) + 1.2 * y(40) + 0.3 * y(36) - 9.42825 * y(34) * y(35) + 1.2 * y(37)
 + 6.00004 * y(25) * y(45) - 1 * y(35) - 9.42825 * y(27) * y(35) + 1.2 * y(36) + 0.3 * y(36) - 9.42825 * y(34) * y(35) + 1.2 * y(37) + 0.3 * y(37)
 + 9.42825 * y(27) * y(35) - 1.2 * y(36) - 0.3 * y(36)
 + 9.42825 * y(34) * y(35) - 1.2 * y(37) - 0.3 * y(37)
 + 9.99994 * y(26) * y(45) - 0.5 * y(38) - 9.42825 * y(27) * y(38) + 1.2 * y(39) + 0.3 * y(39) - 9.42825 * y(34) * y(38) + 1.2 * y(40) + 0.3 * y(40)
 + 9.42825 * y(27) * y(38) - 1.2 * y(39) - 0.3 * y(39)
 + 9.42825 * y(34) * y(38) - 1.2 * y(40) - 0.3 * y(40)
 - 6.00004 * y(41) *  (y(2) + y(4) + y(3) + y(5) + y(6) + y(7) ) + 16 * y(55) + 1 * y(43) - 199.999 * y(41) * y(71) + 1 * y(50) - 0.00989963 * y(46) * y(41) + 0.08 * y(42) + 0.02 * y(42)
 + 0.00989963 * y(46) * y(41) - 0.08 * y(42) - 0.02 * y(42)
 + 4 * y(55) - 1 * y(43) - 0.198 * y(46) * y(43) + 0.08 * y(44) + 0.02 * y(44)
 + 0.198 * y(46) * y(43) - 0.08 * y(44) - 0.02 * y(44)
 - 49.4853 * y(45) * y(48) + 40 * y(49) - 0.0001 * y(45) + 0.02 * y(44) + 0.1 * y(51) - 9.99994 * y(26) * y(45) + 0.5 * y(38) - 6.00004 * y(25) * y(45) + 1 * y(35) + 0.02 * y(42)
 + 10 * y(49) + 0.0001 * y(45) - 0.198 * y(46) * y(43) + 0.08 * y(44) - 0.990038 * y(46) * y(50) + 0.4 * y(51) - 0.00989963 * y(46) * y(41) + 0.08 * y(42)
 + 4 * y(54) - 0.1 * y(47)
 - 49.4853 * y(45) * y(48) + 40 * y(49) + 10 * y(49) - 6.00004 * y(48) *  (y(2) + y(4) + y(3) + y(5) + y(6) + y(7) ) + 16 * y(54) + 0.1 * y(47)
 + 49.4853 * y(45) * y(48) - 40 * y(49) - 10 * y(49)
 + 199.999 * y(41) * y(71) - 1 * y(50) - 0.990038 * y(46) * y(50) + 0.4 * y(51) + 0.1 * y(51)
 + 0.990038 * y(46) * y(50) - 0.4 * y(51) - 0.1 * y(51)
 - 0.600004 * y(11) * y(52) + 0.5 * y(1) - 0.999994 * y(13) * y(52) + 0.1 * y(14) - 6.00004 * y(24) * y(52) + 0.1 * y(22) - 144.002 * y(68) * y(52)*y(52) + 144 * y(70) - 3.60002 * y(70) * y(52) + 10 * y(69) - 0.465002 * y(69) * y(52) + 10 * y(71) + 2 * buff(5) - 2 * y(52)
 + 0.299998 * y(25) *  (y(2) + y(4) + y(3) + y(5) + y(6) + y(7) ) - 16 * y(53) - 4 * y(53)
 + 6.00004 * y(48) *  (y(2) + y(4) + y(3) + y(5) + y(6) + y(7) ) - 16 * y(54) - 4 * y(54)
 + 6.00004 * y(41) *  (y(2) + y(4) + y(3) + y(5) + y(6) + y(7) ) - 16 * y(55) - 4 * y(55)
 - 4 * y(56)
 - 1.95006 * y(13) * y(57) + 40 * y(58) + 10 * y(58) - 1.95006 * y(26) * y(57) + 40 * y(59) + 10 * y(59) + 0.3 * y(33) - 150.003 * y(57) * y(60) + 16 * y(62)
 + 1.95006 * y(13) * y(57) - 40 * y(58) - 10 * y(58)
 + 1.95006 * y(26) * y(57) - 40 * y(59) - 10 * y(59)
 - 150.003 * y(30) * y(60) + 16 * y(61) + 4 * y(61) - 150.003 * y(57) * y(60) + 16 * y(62) + 4 * y(62)
 + 150.003 * y(30) * y(60) - 16 * y(61) - 4 * y(61)
 + 150.003 * y(57) * y(60) - 16 * y(62) - 4 * y(62)
 - 1.91612 * y(26) * y(63) + 24 * y(64) + 6 * y(64) - 1.91612 * y(31) * y(63) + 24 * y(65) + 6 * y(65) - 1.91612 * y(34) * y(63) + 24 * y(66) + 6 * y(66) - 1.91612 * y(29) * y(63) + 24 * y(67) + 6 * y(67)
 + 1.91612 * y(26) * y(63) - 24 * y(64) - 6 * y(64)
 + 1.91612 * y(31) * y(63) - 24 * y(65) - 6 * y(65)
 + 1.91612 * y(34) * y(63) - 24 * y(66) - 6 * y(66)
 + 1.91612 * y(29) * y(63) - 24 * y(67) - 6 * y(67)
 - 72.0009 * y(68) * y(52)*y(52) + 72 * y(70)
 + 3.60002 * y(70) * y(52) - 10 * y(69) - 0.465002 * y(69) * y(52) + 10 * y(71)
 + 72.0009 * y(68) * y(52)*y(52) - 72 * y(70) - 3.60002 * y(70) * y(52) + 10 * y(69)
 - 199.999 * y(41) * y(71) + 1 * y(50) + 0.465002 * y(69) * y(52) - 10 * y(71)
];

% end of model
