 %  DOQCS : http://doqcs.ncbs.res.in/ 
 %  Accession Name = CaMKII_2003 
 %  Accession Number = 49 
 %  Transcriber = Upinder S. Bhalla, NCBS 
 %  Developer = Upinder S. Bhalla, NCBS 
 %  Species = Generic mammalian 
 %  Tissue = Brain - Neuronal 
 %  Cell Compartment = Synapse 
 %  Notes =  Model of regulation of CaMKII by Calcium, including parallel excitatory input from CaM and inhibitory input from PP1 as regulated by Calcineurin and PKA. Cell type: neuronal. <br><a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=15298882&query_hl=11">Bhalla US. Biophys J. 2004 Aug;87(2):733-44.</a> 
 
   % Note: All the concentrations are in micro Mole (uM)

function moose_convert
%Matlab simulation for chemical kinetics

% Saved on Tue Jul 24 13:08:03 2007
% Automatically generated from kkit model in MOOSE by conv_matlab

global buff;
global t;
global y;

% Define Tables here
tspan=[0, 500];
% Molecule names
molnames = {
'1 /kinetics/PKC-active/PKC-phosph-neurogranin/PKC-phosph-neurogranin_cplx'
'2 /kinetics/PKC-active/PKC-phosph-ng-CaM/PKC-phosph-ng-CaM_cplx'
'3 /kinetics/PKA-active/PKA-phosph-I1/PKA-phosph-I1_cplx'
'4 /kinetics/PKA-active/phosph-PDE/phosph-PDE_cplx'
'5 /kinetics/CaM-Ca4'
'6 /kinetics/CaMKII/CaMKII'
'7 /kinetics/CaMKII/CaMKII-CaM'
'8 /kinetics/CaMKII/CaMKII-thr286*-CaM'
'9 /kinetics/CaMKII/CaMKII***'
'10 /kinetics/CaMKII/CaMKII-thr286'
'11 /kinetics/CaMKII/CaMK-thr306'
'12 /kinetics/CaMKII/tot_CaM_CaMKII/CaM_act_305/CaM_act_305_cplx'
'13 /kinetics/CaMKII/tot_CaM_CaMKII/CaM_act_286/CaM_act_286_cplx'
'14 /kinetics/CaMKII/tot_autonomous_CaMKII/auton_305/auton_305_cplx'
'15 /kinetics/CaMKII/tot_autonomous_CaMKII/auton_286/auton_286_cplx'
'16 /kinetics/PP1-active'
'17 /kinetics/PP1-active/Deph-thr286/Deph-thr286_cplx'
'18 /kinetics/PP1-active/Deph-thr305/Deph-thr305_cplx'
'19 /kinetics/PP1-active/Deph-thr306/Deph-thr306_cplx'
'20 /kinetics/PP1-active/Deph-thr286c/Deph-thr286c_cplx'
'21 /kinetics/PP1-active/Deph_thr286b/Deph_thr286b_cplx'
'22 /kinetics/CaM/CaM'
'23 /kinetics/CaM/neurogranin-CaM'
'24 /kinetics/CaM/neurogranin*'
'25 /kinetics/CaM/neurogranin'
'26 /kinetics/CaM-Ca3'
'27 /kinetics/CaM-TR2-Ca2'
'28 /kinetics/CaM(Ca)n-CaNAB/dephosph_neurogranin/dephosph_neurogranin_cplx'
'29 /kinetics/CaM(Ca)n-CaNAB/dephosph_inhib1/dephosph_inhib1_cplx'
'30 /kinetics/CaM(Ca)n-CaNAB/dephosph-PP1-I*/dephosph-PP1-I*_cplx'
'31 /kinetics/PP1/I1'
'32 /kinetics/PP1/I1*'
'33 /kinetics/PP1/PP1-I1*'
'34 /kinetics/PP1/PP1-I1'
'35 /kinetics/PP2A'
'36 /kinetics/PP2A/PP2A-dephosph-I1/PP2A-dephosph-I1_cplx'
'37 /kinetics/PP2A/PP2A-dephosph-PP1-I*/PP2A-dephosph-PP1-I*_cplx'
'38 /kinetics/CaNAB-Ca4'
'39 /kinetics/CaNAB-Ca4/dephosph_inhib1_noCaM/dephosph_inhib1_noCaM_cplx'
'40 /kinetics/PP2B/CaNAB'
'41 /kinetics/PP2B/CaNAB-Ca2'
'42 /kinetics/PP2B/CaMCa3-CaNAB'
'43 /kinetics/PP2B/CaMCa2-CANAB'
'44 /kinetics/PP2B/CaMCa4-CaNAB'
};

bufnames = {
'1 /kinetics/PKC-active'
'2 /kinetics/PKA-active'
'3 /kinetics/Ca'
};

sumtotnames = {
'1 /kinetics/CaMKII/tot_CaM_CaMKII'
'2 /kinetics/CaMKII/tot_autonomous_CaMKII'
'3 /kinetics/CaM(Ca)n-CaNAB'
};

% Initial concs of 44 molecules
y0(1) = 0;
y0(2) = 0;
y0(3) = 0;
y0(4) = 0;
y0(5) = 0;
y0(6) = 70;
y0(7) = 0;
y0(8) = 0;
y0(9) = 0;
y0(10) = 0;
y0(11) = 0;
y0(12) = 0;
y0(13) = 0;
y0(14) = 0;
y0(15) = 0;
y0(16) = 1.8;
y0(17) = 0;
y0(18) = 0;
y0(19) = 0;
y0(20) = 0;
y0(21) = 0;
y0(22) = 20;
y0(23) = 0;
y0(24) = 0;
y0(25) = 10;
y0(26) = 0;
y0(27) = 0;
y0(28) = 0;
y0(29) = 0;
y0(30) = 0;
y0(31) = 1.8;
y0(32) = 0.001;
y0(33) = 0;
y0(34) = 0;
y0(35) = 0.12;
y0(36) = 0;
y0(37) = 0;
y0(38) = 0;
y0(39) = 0;
y0(40) = 1;
y0(41) = 0;
y0(42) = 0;
y0(43) = 0;
y0(44) = 0;
buff(1) = 0.09;
buff(2) = 0.015;
buff(3) = 0.08;
% Sumtotal eqn for /kinetics/CaMKII/tot_CaM_CaMKII: sumtot(1) =  (y(7) + y(8) )
% Sumtotal eqn for /kinetics/CaMKII/tot_autonomous_CaMKII: sumtot(2) =  (y(10) + y(9) )
% Sumtotal eqn for /kinetics/CaM(Ca)n-CaNAB: sumtot(3) =  (y(44) + y(42) + y(43) )

% 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(:,7) + y(:,8) ));
plot(t, (y(:,10) + y(:,9) ));
plot(t,buff(:,1)*ones(size(t)));
plot(t,buff(:,2)*ones(size(t)));
 
 
% Evaluation function
function dydt = f(t, y)
global buff;
dydt = [
 + 0.102 * y(25) * buff(1) - 2.34 * y(1) - 0.58 * y(1)
 + 0.0612 * y(23) * buff(1) - 1.4 * y(2) - 0.35 * y(2)
 + 6 * y(31) * buff(2) - 36 * y(3) - 9 * y(3)
 - 9 * y(4)
 - 49.9998 * y(5) * y(6) + 5 * y(7) - 1000.2 * y(10) * y(5) + 0.1 * y(8) + 0.465 * y(26) * buff(3) - 10 * y(5) - 600 * y(5) * y(38) + 1 * y(44)
 - 49.9998 * y(5) * y(6) + 5 * y(7) + 0.35 * y(19) + 0.35 * y(21) - 0.003 * y(6)
 + 49.9998 * y(5) * y(6) - 5 * y(7) + 0.35 * y(17) - 0.0220068 * y(7) *  (y(7) + y(8) ) + 2 * y(13) - 0.014286 * y(7) *  (y(10) + y(9) ) + 2 * y(15)
 + 1000.2 * y(10) * y(5) - 0.1 * y(8) - 0.3432 * y(8) * y(16) + 1.4 * y(17) + 0.5 * y(13) + 0.5 * y(15)
 - 0.3432 * y(9) * y(16) + 1.4 * y(18) - 0.3432 * y(9) * y(16) + 1.4 * y(20) + 6 * y(12) + 6 * y(14)
 - 1000.2 * y(10) * y(5) + 0.1 * y(8) + 0.35 * y(18) - 0.3432 * y(10) * y(16) + 1.4 * y(21) + 0.003 * y(6) - 0.264084 * y(10) *  (y(7) + y(8) ) + 24 * y(12) - 0.171426 * y(10) *  (y(10) + y(9) ) + 24 * y(14)
 - 0.3432 * y(11) * y(16) + 1.4 * y(19) + 0.35 * y(20)
 + 0.264084 * y(10) *  (y(7) + y(8) ) - 24 * y(12) - 6 * y(12)
 + 0.0220068 * y(7) *  (y(7) + y(8) ) - 2 * y(13) - 0.5 * y(13)
 + 0.171426 * y(10) *  (y(10) + y(9) ) - 24 * y(14) - 6 * y(14)
 + 0.014286 * y(7) *  (y(10) + y(9) ) - 2 * y(15) - 0.5 * y(15)
 - 0.3432 * y(8) * y(16) + 1.4 * y(17) + 0.35 * y(17) - 0.3432 * y(9) * y(16) + 1.4 * y(18) + 0.35 * y(18) - 0.3432 * y(11) * y(16) + 1.4 * y(19) + 0.35 * y(19) - 0.3432 * y(10) * y(16) + 1.4 * y(21) + 0.35 * y(21) - 0.3432 * y(9) * y(16) + 1.4 * y(20) + 0.35 * y(20) - 499.98 * y(32) * y(16) + 0.1 * y(33) + 1 * y(34)
 + 0.3432 * y(8) * y(16) - 1.4 * y(17) - 0.35 * y(17)
 + 0.3432 * y(9) * y(16) - 1.4 * y(18) - 0.35 * y(18)
 + 0.3432 * y(11) * y(16) - 1.4 * y(19) - 0.35 * y(19)
 + 0.3432 * y(9) * y(16) - 1.4 * y(20) - 0.35 * y(20)
 + 0.3432 * y(10) * y(16) - 1.4 * y(21) - 0.35 * y(21)
 - 72 * y(22) * buff(3)*buff(3) + 72 * y(27) - 0.3 * y(25) * y(22) + 1 * y(23) + 0.35 * y(2)
 + 0.3 * y(25) * y(22) - 1 * y(23) - 0.0612 * y(23) * buff(1) + 1.4 * y(2)
 - 0.3336 * y(24) *  (y(44) + y(42) + y(43) ) + 2.67 * y(28) + 0.58 * y(1) + 0.35 * y(2) - 0.005 * y(24)
 + 0.67 * y(28) - 0.3 * y(25) * y(22) + 1 * y(23) - 0.102 * y(25) * buff(1) + 2.34 * y(1) + 0.005 * y(24)
 + 3.6 * y(27) * buff(3) - 10 * y(26) - 0.465 * y(26) * buff(3) + 10 * y(5) - 2.238 * y(26) * y(38) + 1 * y(42)
 + 72 * y(22) * buff(3)*buff(3) - 72 * y(27) - 3.6 * y(27) * buff(3) + 10 * y(26) - 0.24 * y(38) * y(27) + 1 * y(43)
 + 0.3336 * y(24) *  (y(44) + y(42) + y(43) ) - 2.67 * y(28) - 0.67 * y(28)
 + 0.342 * y(32) *  (y(44) + y(42) + y(43) ) - 1.36 * y(29) - 0.34 * y(29)
 + 0.342 * y(33) *  (y(44) + y(42) + y(43) ) - 1.36 * y(30) - 0.34 * y(30)
 - 6 * y(31) * buff(2) + 36 * y(3) + 0.034 * y(39) + 0.34 * y(29) + 6 * y(36) + 1 * y(34)
 - 499.98 * y(32) * y(16) + 0.1 * y(33) + 9 * y(3) - 0.0342 * y(32) * y(38) + 0.136 * y(39) - 0.342 * y(32) *  (y(44) + y(42) + y(43) ) + 1.36 * y(29) - 3.96 * y(32) * y(35) + 25 * y(36)
 + 499.98 * y(32) * y(16) - 0.1 * y(33) - 3.96 * y(33) * y(35) + 25 * y(37) - 0.342 * y(33) *  (y(44) + y(42) + y(43) ) + 1.36 * y(30)
 - 1 * y(34) + 6 * y(37) + 0.34 * y(30)
 - 3.96 * y(32) * y(35) + 25 * y(36) + 6 * y(36) - 3.96 * y(33) * y(35) + 25 * y(37) + 6 * y(37)
 + 3.96 * y(32) * y(35) - 25 * y(36) - 6 * y(36)
 + 3.96 * y(33) * y(35) - 25 * y(37) - 6 * y(37)
 - 0.0342 * y(32) * y(38) + 0.136 * y(39) + 0.034 * y(39) + 3.6 * buff(3)*buff(3) * y(41) - 1 * y(38) - 0.24 * y(38) * y(27) + 1 * y(43) - 600 * y(5) * y(38) + 1 * y(44) - 2.238 * y(26) * y(38) + 1 * y(42)
 + 0.0342 * y(32) * y(38) - 0.136 * y(39) - 0.034 * y(39)
 - 10008 * y(40) * buff(3)*buff(3) + 1 * y(41)
 + 10008 * y(40) * buff(3)*buff(3) - 1 * y(41) - 3.6 * buff(3)*buff(3) * y(41) + 1 * y(38)
 + 2.238 * y(26) * y(38) - 1 * y(42)
 + 0.24 * y(38) * y(27) - 1 * y(43)
 + 600 * y(5) * y(38) - 1 * y(44)
];

% end of model
