 %  DOQCS : http://doqcs.ncbs.res.in/ 
 %  Accession Name = Ajay_Bhalla_2007_PKM 
 %  Accession Number = 80 
 %  Transcriber = Upinder S. Bhalla, NCBS 
 %  Developer = Upinder S. Bhalla, NCBS 
 %  Species = Rat 
 %  Tissue = Hippocampal CA1 
 %  Cell Compartment = Dendrite 
 %  Notes =  This is a non-bistable model of ERKII signaling that also incorporates PKM synthesis triggered by Ca influx. It is a simplified variant of the model of <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 16:52:23 2007
% Automatically generated from kkit model in MOOSE by conv_matlab

global buff;
global t;
global y;

% Define Tables here
tspan=[0, 2000];
% Molecule names
molnames = {
'1 /kinetics/PKC/PKC-Ca'
'2 /kinetics/PKC/PKC-Ca-memb*'
'3 /kinetics/PKC/PKC-DAG-memb*'
'4 /kinetics/PKC/PKC-Ca-DAG'
'5 /kinetics/PKC/PKC-DAG'
'6 /kinetics/PKC/PKC-cytosolic'
'7 /kinetics/PKC/PKM-zeta'
'8 /kinetics/PKC-active/PKC-act-raf/PKC-act-raf_cplx'
'9 /kinetics/PKC-active/PKC-inact-GAP/PKC-inact-GAP_cplx'
'10 /kinetics/PKC-active/PKC-act-GEF/PKC-act-GEF_cplx'
'11 /kinetics/MAPK*'
'12 /kinetics/MAPK*/MAPK*-feedback/MAPK*-feedback_cplx'
'13 /kinetics/MAPK/craf-1'
'14 /kinetics/MAPK/craf-1*'
'15 /kinetics/MAPK/MAPKK'
'16 /kinetics/MAPK/MAPK'
'17 /kinetics/MAPK/craf-1**'
'18 /kinetics/MAPK/MAPK-tyr'
'19 /kinetics/MAPK/MAPKK*'
'20 /kinetics/MAPK/MAPKK*/MAPKKtyr/MAPKKtyr_cplx'
'21 /kinetics/MAPK/MAPKK*/MAPKKthr/MAPKKthr_cplx'
'22 /kinetics/MAPK/MAPKK-ser'
'23 /kinetics/MAPK/Raf-GTP-Ras'
'24 /kinetics/MAPK/Raf-GTP-Ras/Raf-GTP-Ras.1/Raf-GTP-Ras.1_cplx'
'25 /kinetics/MAPK/Raf-GTP-Ras/Raf-GTP-Ras.2/Raf-GTP-Ras.2_cplx'
'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/MKP-1'
'30 /kinetics/MKP-1/MKP1-tyr-deph/MKP1-tyr-deph_cplx'
'31 /kinetics/MKP-1/MKP1-thr-deph/MKP1-thr-deph_cplx'
'32 /kinetics/PPhosphatase2A'
'33 /kinetics/PPhosphatase2A/craf-deph/craf-deph_cplx'
'34 /kinetics/PPhosphatase2A/MAPKK-deph/MAPKK-deph_cplx'
'35 /kinetics/PPhosphatase2A/MAPKK-deph-ser/MAPKK-deph-ser_cplx'
'36 /kinetics/PPhosphatase2A/craf**-deph/craf**-deph_cplx'
'37 /kinetics/Ras/inact-GEF'
'38 /kinetics/Ras/inact-GEF/basal_GEF_activity/basal_GEF_activity_cplx'
'39 /kinetics/Ras/GEF*'
'40 /kinetics/Ras/GEF*/GEF*-act-ras/GEF*-act-ras_cplx'
'41 /kinetics/Ras/GTP-Ras'
'42 /kinetics/Ras/GDP-Ras'
'43 /kinetics/Ras/GAP*'
'44 /kinetics/Ras/GAP'
'45 /kinetics/Ras/GAP/GAP-inact-ras/GAP-inact-ras_cplx'
'46 /kinetics/Ras/CaM-GEF'
'47 /kinetics/Ras/CaM-GEF/CaM-GEF-act-ras/CaM-GEF-act-ras_cplx'
'48 /kinetics/CaM/CaM'
'49 /kinetics/CaM/CaM-Ca3'
'50 /kinetics/CaM/CaM-Ca4'
'51 /kinetics/CaM/CaM-Ca2'
'52 /kinetics/CaM/CaM-Ca'
'53 /kinetics/Ca'
'54 /kinetics/PKM/Ca_detector'
'55 /kinetics/PKM/PKM_synthesis'
'56 /kinetics/PKM/PKM_synthesis/kenz/kenz_cplx'
'57 /kinetics/PKM/Ca.detector_complex'
'58 /kinetics/PKM/Ca.detector_complex/kenz/kenz_cplx'
'59 /kinetics/PKM/PKM_activator'
};

bufnames = {
'1 /kinetics/DAG'
'2 /kinetics/PKM/AA_pool'
'3 /kinetics/PKM/degraded_PKM'
'4 /kinetics/Ca_input'
};

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

% Initial concs of 59 molecules
y0(1) = 3.72076e-17;
y0(2) = 1.38955e-17;
y0(3) = 9.43516e-21;
y0(4) = 8.46314e-23;
y0(5) = 1.16101e-16;
y0(6) = 1;
y0(7) = 0.01;
y0(8) = 0;
y0(9) = 0;
y0(10) = 0;
y0(11) = 0;
y0(12) = 0;
y0(13) = 0.5;
y0(14) = 0;
y0(15) = 0.5;
y0(16) = 3.59997;
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;
y0(26) = 0;
y0(27) = 0;
y0(28) = 0;
y0(29) = 0.02;
y0(30) = 0;
y0(31) = 0;
y0(32) = 1;
y0(33) = 0;
y0(34) = 0;
y0(35) = 0;
y0(36) = 0;
y0(37) = 0.1;
y0(38) = 0;
y0(39) = 0;
y0(40) = 0;
y0(41) = 0;
y0(42) = 0.5;
y0(43) = 0;
y0(44) = 0.01;
y0(45) = 0;
y0(46) = 0;
y0(47) = 0;
y0(48) = 20;
y0(49) = 0;
y0(50) = 0;
y0(51) = 0;
y0(52) = 0;
y0(53) = 0.08;
y0(54) = 1;
y0(55) = 0.001;
y0(56) = 0;
y0(57) = 0;
y0(58) = 0;
y0(59) = 0.2;
buff(1) = 12.1999;
buff(2) = 1;
buff(3) = 0;
buff(4) = 0.08;
% Sumtotal eqn for /kinetics/PKC-active: sumtot(1) =  (y(2) + y(3) + 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(:,2) + y(:,3) + y(:,7) ));
plot(t,y(:,1));
plot(t,buff(:,1)*ones(size(t)));

% Evaluation function
function dydt = f(t, y)
global buff;
dydt = [
 + 0.600004 * y(6) * y(53) - 0.5 * y(1) - 0.0079998 * buff(1) * y(1) + 8.6348 * y(4) - 1.2705 * y(1) + 3.5026 * y(2)
 + 1.2705 * y(1) - 3.5026 * y(2)
 + 1 * y(4) - 0.1 * y(3)
 + 0.0079998 * buff(1) * y(1) - 8.6348 * y(4) - 1 * y(4) + 0.1 * y(3)
 + 0.000600004 * y(6) * buff(1) - 0.1 * y(5)
 - 0.600004 * y(6) * y(53) + 0.5 * y(1) - 0.000600004 * y(6) * buff(1) + 0.1 * y(5)
 + 0.05 * y(56) - 0.0005 * y(7)
 + 0.999994 * y(13) *  (y(2) + y(3) + y(7) ) - 16 * y(8) - 4 * y(8)
 + 6.00004 * y(44) *  (y(2) + y(3) + y(7) ) - 16 * y(9) - 4 * y(9)
 + 6.00004 * y(37) *  (y(2) + y(3) + y(7) ) - 16 * y(10) - 4 * y(10)
 - 1.95006 * y(14) * y(11) + 40 * y(12) + 10 * y(12) + 0.3 * y(21) - 2.85714 * y(11) * y(29) + 16 * y(31)
 + 1.95006 * y(14) * y(11) - 40 * y(12) - 10 * y(12)
 - 0.999994 * y(13) *  (y(2) + y(3) + y(7) ) + 16 * y(8) + 6 * y(33)
 + 4 * y(8) - 1.95006 * y(14) * y(11) + 40 * y(12) - 1.91612 * y(14) * y(32) + 24 * y(33) + 6 * y(36) - 9.99994 * y(14) * y(41) + 0.5 * y(26)
 + 6 * y(35) - 9.42825 * y(15) * y(26) + 1.2 * y(27) - 9.42825 * y(15) * y(23) + 1.2 * y(24)
 - 32.3997 * y(16) * y(19) + 1.2 * y(20) + 4 * y(30)
 + 10 * y(12) - 1.91612 * y(17) * y(32) + 24 * y(36)
 + 0.3 * y(20) - 32.3997 * y(18) * y(19) + 1.2 * y(21) - 2.85714 * y(18) * y(29) + 16 * y(30) + 4 * y(31)
 - 32.3997 * y(16) * y(19) + 1.2 * y(20) + 0.3 * y(20) - 32.3997 * y(18) * y(19) + 1.2 * y(21) + 0.3 * y(21) - 1.91612 * y(19) * y(32) + 24 * y(34) + 0.3 * y(28) + 0.3 * y(25)
 + 32.3997 * y(16) * y(19) - 1.2 * y(20) - 0.3 * y(20)
 + 32.3997 * y(18) * y(19) - 1.2 * y(21) - 0.3 * y(21)
 + 6 * y(34) - 1.91612 * y(22) * y(32) + 24 * y(35) + 0.3 * y(27) - 9.42825 * y(22) * y(26) + 1.2 * y(28) + 0.3 * y(24) - 9.42825 * y(22) * y(23) + 1.2 * y(25)
 - 9.42825 * y(15) * y(23) + 1.2 * y(24) + 0.3 * y(24) - 9.42825 * y(22) * y(23) + 1.2 * y(25) + 0.3 * y(25)
 + 9.42825 * y(15) * y(23) - 1.2 * y(24) - 0.3 * y(24)
 + 9.42825 * y(22) * y(23) - 1.2 * y(25) - 0.3 * y(25)
 + 9.99994 * y(14) * y(41) - 0.5 * y(26) - 9.42825 * y(15) * y(26) + 1.2 * y(27) + 0.3 * y(27) - 9.42825 * y(22) * y(26) + 1.2 * y(28) + 0.3 * y(28)
 + 9.42825 * y(15) * y(26) - 1.2 * y(27) - 0.3 * y(27)
 + 9.42825 * y(22) * y(26) - 1.2 * y(28) - 0.3 * y(28)
 - 2.85714 * y(18) * y(29) + 16 * y(30) + 4 * y(30) - 2.85714 * y(11) * y(29) + 16 * y(31) + 4 * y(31)
 + 2.85714 * y(18) * y(29) - 16 * y(30) - 4 * y(30)
 + 2.85714 * y(11) * y(29) - 16 * y(31) - 4 * y(31)
 - 1.91612 * y(14) * y(32) + 24 * y(33) + 6 * y(33) - 1.91612 * y(19) * y(32) + 24 * y(34) + 6 * y(34) - 1.91612 * y(22) * y(32) + 24 * y(35) + 6 * y(35) - 1.91612 * y(17) * y(32) + 24 * y(36) + 6 * y(36)
 + 1.91612 * y(14) * y(32) - 24 * y(33) - 6 * y(33)
 + 1.91612 * y(19) * y(32) - 24 * y(34) - 6 * y(34)
 + 1.91612 * y(22) * y(32) - 24 * y(35) - 6 * y(35)
 + 1.91612 * y(17) * y(32) - 24 * y(36) - 6 * y(36)
 - 6.00004 * y(37) *  (y(2) + y(3) + y(7) ) + 16 * y(10) + 1 * y(39) - 199.999 * y(37) * y(50) + 1 * y(46) - 0.00989963 * y(42) * y(37) + 0.08 * y(38) + 0.02 * y(38)
 + 0.00989963 * y(42) * y(37) - 0.08 * y(38) - 0.02 * y(38)
 + 4 * y(10) - 1 * y(39) - 0.198 * y(42) * y(39) + 0.08 * y(40) + 0.02 * y(40)
 + 0.198 * y(42) * y(39) - 0.08 * y(40) - 0.02 * y(40)
 - 49.4853 * y(41) * y(44) + 40 * y(45) - 0.0001 * y(41) + 0.02 * y(40) + 0.2 * y(47) - 9.99994 * y(14) * y(41) + 0.5 * y(26) + 0.02 * y(38)
 + 10 * y(45) + 0.0001 * y(41) - 0.198 * y(42) * y(39) + 0.08 * y(40) - 1.98 * y(42) * y(46) + 0.8 * y(47) - 0.00989963 * y(42) * y(37) + 0.08 * y(38)
 + 4 * y(9) - 0.1 * y(43)
 - 49.4853 * y(41) * y(44) + 40 * y(45) + 10 * y(45) - 6.00004 * y(44) *  (y(2) + y(3) + y(7) ) + 16 * y(9) + 0.1 * y(43)
 + 49.4853 * y(41) * y(44) - 40 * y(45) - 10 * y(45)
 + 199.999 * y(37) * y(50) - 1 * y(46) - 1.98 * y(42) * y(46) + 0.8 * y(47) + 0.2 * y(47)
 + 1.98 * y(42) * y(46) - 0.8 * y(47) - 0.2 * y(47)
 - 8.48475 * y(48) * y(53) + 8.4853 * y(52)
 + 3.60002 * y(51) * y(53) - 10 * y(49) - 0.465002 * y(49) * y(53) + 10 * y(50)
 - 199.999 * y(37) * y(50) + 1 * y(46) + 0.465002 * y(49) * y(53) - 10 * y(50) - 9.99994 * y(54) * y(50) + 1 * y(57)
 - 3.60002 * y(51) * y(53) + 10 * y(49) + 8.48475 * y(52) * y(53) - 8.4853 * y(51)
 + 8.48475 * y(48) * y(53) - 8.4853 * y(52) - 8.48475 * y(52) * y(53) + 8.4853 * y(51)
 - 0.600004 * y(6) * y(53) + 0.5 * y(1) - 8.48475 * y(48) * y(53) + 8.4853 * y(52) - 3.60002 * y(51) * y(53) + 10 * y(49) - 0.465002 * y(49) * y(53) + 10 * y(50) + 5 * buff(4) - 5 * y(53) - 8.48475 * y(52) * y(53) + 8.4853 * y(51)
 - 9.99994 * y(54) * y(50) + 1 * y(57)
 - 0.0250002 * buff(2) * y(55) + 0.2 * y(56) + 0.05 * y(56) + 0.2 * y(58) - 0.001 * y(55)
 + 0.0250002 * buff(2) * y(55) - 0.2 * y(56) - 0.05 * y(56)
 - 0.199999 * y(59) * y(57) + 0.8 * y(58) + 0.2 * y(58) + 9.99994 * y(54) * y(50) - 1 * y(57)
 + 0.199999 * y(59) * y(57) - 0.8 * y(58) - 0.2 * y(58)
 - 0.199999 * y(59) * y(57) + 0.8 * y(58) + 0.001 * y(55)
];

% end of model
