# Generated Code

The following is matlab code generated by the CellML API from this CellML file. (Back to language selection)

The raw code is available.

```function [VOI, STATES, ALGEBRAIC, CONSTANTS] = mainFunction()
% This is the "main function".  In Matlab, things work best if you rename this function to match the filename.
[VOI, STATES, ALGEBRAIC, CONSTANTS] = solveModel();
end

function [algebraicVariableCount] = getAlgebraicVariableCount()
% Used later when setting a global variable with the number of algebraic variables.
% Note: This is not the "main method".
algebraicVariableCount =0;
end
% There are a total of 66 entries in each of the rate and state variable arrays.
% There are a total of 255 entries in the constant variable array.
%

function [VOI, STATES, ALGEBRAIC, CONSTANTS] = solveModel()
% Create ALGEBRAIC of correct size
global algebraicVariableCount;  algebraicVariableCount = getAlgebraicVariableCount();
% Initialise constants and state variables
[INIT_STATES, CONSTANTS] = initConsts;

% Set timespan to solve over
tspan = [0, 10];

% Set numerical accuracy options for ODE solver
options = odeset('RelTol', 1e-06, 'AbsTol', 1e-06, 'MaxStep', 1);

% Solve model with ODE solver
[VOI, STATES] = ode15s(@(VOI, STATES)computeRates(VOI, STATES, CONSTANTS), tspan, INIT_STATES, options);

% Compute algebraic variables
[RATES, ALGEBRAIC] = computeRates(VOI, STATES, CONSTANTS);
ALGEBRAIC = computeAlgebraic(ALGEBRAIC, CONSTANTS, STATES, VOI);

% Plot state variables against variable of integration
[LEGEND_STATES, LEGEND_ALGEBRAIC, LEGEND_VOI, LEGEND_CONSTANTS] = createLegends();
figure();
plot(VOI, STATES);
xlabel(LEGEND_VOI);
l = legend(LEGEND_STATES);
set(l,'Interpreter','none');
end

function [LEGEND_STATES, LEGEND_ALGEBRAIC, LEGEND_VOI, LEGEND_CONSTANTS] = createLegends()
LEGEND_STATES = ''; LEGEND_ALGEBRAIC = ''; LEGEND_VOI = ''; LEGEND_CONSTANTS = '';
LEGEND_VOI = strpad('time in component environment (hour)');
LEGEND_STATES(:,1) = strpad('AP1 in component AP1 (micromolar)');
LEGEND_CONSTANTS(:,1) = strpad('v_sap1 in component model_parameters (flux)');
LEGEND_CONSTANTS(:,2) = strpad('GF in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,3) = strpad('K_agf in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,4) = strpad('k_dap1 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,5) = strpad('eps in component model_parameters (dimensionless)');
LEGEND_STATES(:,2) = strpad('pRB in component pRB (micromolar)');
LEGEND_CONSTANTS(:,6) = strpad('v_sprb in component model_parameters (flux)');
LEGEND_CONSTANTS(:,7) = strpad('k_pc1 in component model_parameters (second_order_rate_constant)');
LEGEND_STATES(:,3) = strpad('E2F in component E2F (micromolar)');
LEGEND_CONSTANTS(:,8) = strpad('k_pc2 in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,4) = strpad('pRBc1 in component pRBc1 (micromolar)');
LEGEND_CONSTANTS(:,9) = strpad('V_1 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,10) = strpad('K_1 in component model_parameters (micromolar)');
LEGEND_STATES(:,5) = strpad('Md in component Md (micromolar)');
LEGEND_STATES(:,6) = strpad('Mdp27 in component Mdp27 (micromolar)');
LEGEND_CONSTANTS(:,11) = strpad('V_2 in component model_parameters (flux)');
LEGEND_STATES(:,7) = strpad('pRBp in component pRBp (micromolar)');
LEGEND_CONSTANTS(:,12) = strpad('K_2 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,13) = strpad('k_dprb in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,14) = strpad('V_3 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,15) = strpad('K_3 in component model_parameters (micromolar)');
LEGEND_STATES(:,8) = strpad('Me in component Me (micromolar)');
LEGEND_CONSTANTS(:,16) = strpad('V_4 in component model_parameters (flux)');
LEGEND_STATES(:,9) = strpad('pRBpp in component pRBpp (micromolar)');
LEGEND_CONSTANTS(:,17) = strpad('K_4 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,18) = strpad('k_pc3 in component model_parameters (second_order_rate_constant)');
LEGEND_CONSTANTS(:,19) = strpad('k_pc4 in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,10) = strpad('pRBc2 in component pRBc2 (micromolar)');
LEGEND_CONSTANTS(:,20) = strpad('k_dpRBp in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,21) = strpad('k_dpRBpp in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,22) = strpad('v_se2f in component model_parameters (flux)');
LEGEND_CONSTANTS(:,23) = strpad('V_1e2f in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,11) = strpad('Ma in component Ma (micromolar)');
LEGEND_CONSTANTS(:,24) = strpad('K_1e2f in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,25) = strpad('V_2e2f in component model_parameters (flux)');
LEGEND_STATES(:,12) = strpad('E2Fp in component E2Fp (micromolar)');
LEGEND_CONSTANTS(:,26) = strpad('K_2e2f in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,27) = strpad('k_de2f in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,28) = strpad('k_de2fp in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,13) = strpad('Cd in component Cd (micromolar)');
LEGEND_CONSTANTS(:,29) = strpad('k_cd1 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,30) = strpad('k_cd2 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,31) = strpad('K_i7 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,32) = strpad('K_i8 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,33) = strpad('k_com1 in component model_parameters (second_order_rate_constant)');
LEGEND_CONSTANTS(:,34) = strpad('Cdk4_tot in component model_parameters (micromolar)');
LEGEND_STATES(:,14) = strpad('Mdi in component Mdi (micromolar)');
LEGEND_CONSTANTS(:,35) = strpad('k_decom1 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,36) = strpad('V_dd in component model_parameters (flux)');
LEGEND_CONSTANTS(:,37) = strpad('K_dd in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,38) = strpad('k_ddd in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,39) = strpad('V_m2d in component model_parameters (flux)');
LEGEND_CONSTANTS(:,40) = strpad('K_2d in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,41) = strpad('V_m1d in component model_parameters (flux)');
LEGEND_CONSTANTS(:,42) = strpad('K_1d in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,43) = strpad('k_c1 in component model_parameters (second_order_rate_constant)');
LEGEND_STATES(:,15) = strpad('p27 in component p27 (micromolar)');
LEGEND_CONSTANTS(:,44) = strpad('k_c2 in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,16) = strpad('Ce in component Ce (micromolar)');
LEGEND_CONSTANTS(:,45) = strpad('k_ce in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,46) = strpad('K_i9 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,47) = strpad('K_i10 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,48) = strpad('k_com2 in component model_parameters (second_order_rate_constant)');
LEGEND_CONSTANTS(:,49) = strpad('Cdk2_tot in component model_parameters (micromolar)');
LEGEND_STATES(:,17) = strpad('Mei in component Mei (micromolar)');
LEGEND_STATES(:,18) = strpad('Mep27 in component Mep27 (micromolar)');
LEGEND_STATES(:,19) = strpad('Mai in component Mai (micromolar)');
LEGEND_STATES(:,20) = strpad('Map27 in component Map27 (micromolar)');
LEGEND_CONSTANTS(:,50) = strpad('k_decom2 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,51) = strpad('V_de in component model_parameters (flux)');
LEGEND_STATES(:,21) = strpad('Skp2 in component Skp2 (micromolar)');
LEGEND_CONSTANTS(:,52) = strpad('K_dceskp2 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,53) = strpad('K_de in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,54) = strpad('k_dde in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,55) = strpad('V_m2e in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,22) = strpad('Wee1 in component Wee1 (micromolar)');
LEGEND_CONSTANTS(:,56) = strpad('i_b1 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,57) = strpad('K_2e in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,58) = strpad('V_m1e in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,23) = strpad('Pe in component Pe (micromolar)');
LEGEND_CONSTANTS(:,59) = strpad('K_1e in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,60) = strpad('k_c3 in component model_parameters (second_order_rate_constant)');
LEGEND_CONSTANTS(:,61) = strpad('k_c4 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,62) = strpad('v_sskp2 in component model_parameters (flux)');
LEGEND_CONSTANTS(:,63) = strpad('V_dskp2 in component model_parameters (flux)');
LEGEND_CONSTANTS(:,64) = strpad('K_dskp2 in component model_parameters (micromolar)');
LEGEND_STATES(:,24) = strpad('Cdh1a in component Cdh1a (micromolar)');
LEGEND_CONSTANTS(:,65) = strpad('K_cdh1 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,66) = strpad('k_ddskp2 in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,25) = strpad('Pei in component Pei (micromolar)');
LEGEND_CONSTANTS(:,67) = strpad('v_spei in component model_parameters (flux)');
LEGEND_CONSTANTS(:,68) = strpad('V_6e in component model_parameters (flux)');
LEGEND_CONSTANTS(:,69) = strpad('x_e1 in component model_parameters (dimensionless)');
LEGEND_CONSTANTS(:,70) = strpad('x_e2 in component model_parameters (per_micromolar)');
LEGEND_STATES(:,26) = strpad('Chk1 in component Chk1 (micromolar)');
LEGEND_CONSTANTS(:,71) = strpad('K_6e in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,72) = strpad('V_m5e in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,73) = strpad('a_e in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,74) = strpad('K_5e in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,75) = strpad('k_dpei in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,76) = strpad('k_dpe in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,27) = strpad('Ca in component Ca (micromolar)');
LEGEND_CONSTANTS(:,77) = strpad('k_ca in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,78) = strpad('K_i11 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,79) = strpad('K_i12 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,80) = strpad('k_com3 in component model_parameters (second_order_rate_constant)');
LEGEND_CONSTANTS(:,81) = strpad('k_decom3 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,82) = strpad('V_da in component model_parameters (flux)');
LEGEND_CONSTANTS(:,83) = strpad('K_da in component model_parameters (micromolar)');
LEGEND_STATES(:,28) = strpad('Cdc20a in component Cdc20a (micromolar)');
LEGEND_CONSTANTS(:,84) = strpad('K_acdc20 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,85) = strpad('k_dda in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,86) = strpad('V_m2a in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,87) = strpad('i_b2 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,88) = strpad('K_2a in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,89) = strpad('V_m1a in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,29) = strpad('Pa in component Pa (micromolar)');
LEGEND_CONSTANTS(:,90) = strpad('K_1a in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,91) = strpad('k_c5 in component model_parameters (second_order_rate_constant)');
LEGEND_CONSTANTS(:,92) = strpad('k_c6 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,93) = strpad('v_s1p27 in component model_parameters (flux)');
LEGEND_CONSTANTS(:,94) = strpad('v_s2p27 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,95) = strpad('K_i13 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,96) = strpad('K_i14 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,97) = strpad('k_c7 in component model_parameters (second_order_rate_constant)');
LEGEND_STATES(:,30) = strpad('Mb in component Mb (micromolar)');
LEGEND_CONSTANTS(:,98) = strpad('k_c8 in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,31) = strpad('Mbp27 in component Mbp27 (micromolar)');
LEGEND_CONSTANTS(:,99) = strpad('V_1p27 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,100) = strpad('K_1p27 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,101) = strpad('V_2p27 in component model_parameters (flux)');
LEGEND_CONSTANTS(:,102) = strpad('K_2p27 in component model_parameters (micromolar)');
LEGEND_STATES(:,32) = strpad('p27p in component p27p (micromolar)');
LEGEND_CONSTANTS(:,103) = strpad('k_ddp27 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,104) = strpad('V_dp27p in component model_parameters (flux)');
LEGEND_CONSTANTS(:,105) = strpad('K_dp27skp2 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,106) = strpad('K_dp27p in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,107) = strpad('k_ddp27p in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,33) = strpad('Cdh1i in component Cdh1i (micromolar)');
LEGEND_CONSTANTS(:,108) = strpad('V_2cdh1 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,109) = strpad('K_2cdh1 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,110) = strpad('V_1cdh1 in component model_parameters (flux)');
LEGEND_CONSTANTS(:,111) = strpad('K_1cdh1 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,112) = strpad('k_dcdh1i in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,113) = strpad('v_scdh1a in component model_parameters (flux)');
LEGEND_CONSTANTS(:,114) = strpad('k_dcdh1a in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,34) = strpad('Pai in component Pai (micromolar)');
LEGEND_CONSTANTS(:,115) = strpad('v_spai in component model_parameters (flux)');
LEGEND_CONSTANTS(:,116) = strpad('V_6a in component model_parameters (flux)');
LEGEND_CONSTANTS(:,117) = strpad('x_a1 in component model_parameters (dimensionless)');
LEGEND_CONSTANTS(:,118) = strpad('x_a2 in component model_parameters (per_micromolar)');
LEGEND_CONSTANTS(:,119) = strpad('K_6a in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,120) = strpad('V_m5a in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,121) = strpad('a_a in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,122) = strpad('K_5a in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,123) = strpad('k_dpai in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,124) = strpad('k_dpa in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,35) = strpad('Cb in component Cb (micromolar)');
LEGEND_CONSTANTS(:,125) = strpad('v_cb in component model_parameters (flux)');
LEGEND_CONSTANTS(:,126) = strpad('k_com4 in component model_parameters (second_order_rate_constant)');
LEGEND_CONSTANTS(:,127) = strpad('Cdk1_tot in component model_parameters (micromolar)');
LEGEND_STATES(:,36) = strpad('Mbi in component Mbi (micromolar)');
LEGEND_CONSTANTS(:,128) = strpad('k_decom4 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,129) = strpad('V_db in component model_parameters (flux)');
LEGEND_CONSTANTS(:,130) = strpad('K_db in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,131) = strpad('K_dbcdc20 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,132) = strpad('K_dbcdh1 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,133) = strpad('k_ddb in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,134) = strpad('V_m2b in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,135) = strpad('i_b3 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,136) = strpad('K_2b in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,137) = strpad('V_m1b in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,37) = strpad('Pb in component Pb (micromolar)');
LEGEND_CONSTANTS(:,138) = strpad('K_1b in component model_parameters (micromolar)');
LEGEND_STATES(:,38) = strpad('Cdc20i in component Cdc20i (micromolar)');
LEGEND_CONSTANTS(:,139) = strpad('v_scdc20i in component model_parameters (flux)');
LEGEND_CONSTANTS(:,140) = strpad('V_m3b in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,141) = strpad('K_3b in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,142) = strpad('V_m4b in component model_parameters (flux)');
LEGEND_CONSTANTS(:,143) = strpad('K_4b in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,144) = strpad('k_dcdc20i in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,145) = strpad('k_dcdc20a in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,39) = strpad('Pbi in component Pbi (micromolar)');
LEGEND_CONSTANTS(:,146) = strpad('v_spbi in component model_parameters (flux)');
LEGEND_CONSTANTS(:,147) = strpad('V_6b in component model_parameters (flux)');
LEGEND_CONSTANTS(:,148) = strpad('x_b1 in component model_parameters (dimensionless)');
LEGEND_CONSTANTS(:,149) = strpad('x_b2 in component model_parameters (per_micromolar)');
LEGEND_CONSTANTS(:,150) = strpad('K_6b in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,151) = strpad('V_m5b in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,152) = strpad('a_b in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,153) = strpad('K_5b in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,154) = strpad('k_dpbi in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,155) = strpad('k_dpb in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,156) = strpad('v_swee1 in component model_parameters (flux)');
LEGEND_CONSTANTS(:,157) = strpad('k_sw in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,40) = strpad('Mw in component Mw (micromolar)');
LEGEND_CONSTANTS(:,158) = strpad('V_m7b in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,159) = strpad('i_b in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,160) = strpad('K_7b in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,161) = strpad('V_m8b in component model_parameters (flux)');
LEGEND_STATES(:,41) = strpad('Wee1p in component Wee1p (micromolar)');
LEGEND_CONSTANTS(:,162) = strpad('K_8b in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,163) = strpad('k_dwee1 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,164) = strpad('k_dwee1p in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,42) = strpad('Cdc45 in component Cdc45 (micromolar)');
LEGEND_CONSTANTS(:,165) = strpad('V_1cdc45 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,166) = strpad('Cdc45_tot in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,167) = strpad('K_1cdc45 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,168) = strpad('V_2cdc45 in component model_parameters (flux)');
LEGEND_CONSTANTS(:,169) = strpad('K_2cdc45 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,170) = strpad('k_spol in component model_parameters (second_order_rate_constant)');
LEGEND_CONSTANTS(:,171) = strpad('Pol_tot in component model_parameters (micromolar)');
LEGEND_STATES(:,43) = strpad('Pol in component Pol (micromolar)');
LEGEND_CONSTANTS(:,172) = strpad('k_dpol in component model_parameters (first_order_rate_constant)');
LEGEND_STATES(:,44) = strpad('Primer in component Primer (micromolar)');
LEGEND_CONSTANTS(:,173) = strpad('k_sprim in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,174) = strpad('k_dprim in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,175) = strpad('k_aatr in component model_parameters (second_order_rate_constant)');
LEGEND_CONSTANTS(:,176) = strpad('ATR_tot in component model_parameters (micromolar)');
LEGEND_STATES(:,45) = strpad('ATR in component ATR (micromolar)');
LEGEND_CONSTANTS(:,177) = strpad('k_datr in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,178) = strpad('V_1chk in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,179) = strpad('Chk1_tot in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,180) = strpad('K_1chk in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,181) = strpad('V_2chk in component model_parameters (flux)');
LEGEND_CONSTANTS(:,182) = strpad('K_2chk in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,183) = strpad('v_sw in component model_parameters (flux)');
LEGEND_STATES(:,46) = strpad('BN in component BN (nanomolar)');
LEGEND_CONSTANTS(:,184) = strpad('n_gerard in component model_parameters (dimensionless)');
LEGEND_CONSTANTS(:,185) = strpad('K_iw in component model_parameters (nanomolar)');
LEGEND_CONSTANTS(:,186) = strpad('v_dw in component model_parameters (flux)');
LEGEND_CONSTANTS(:,187) = strpad('K_dw in component model_parameters (micromolar)');
LEGEND_STATES(:,47) = strpad('X in component X (micromolar)');
LEGEND_CONSTANTS(:,188) = strpad('V_1x in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,189) = strpad('X_tot in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,190) = strpad('K_1x in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,191) = strpad('V_2x in component model_parameters (flux)');
LEGEND_CONSTANTS(:,192) = strpad('K_2x in component model_parameters (micromolar)');
LEGEND_STATES(:,48) = strpad('CbA in component CbA (micromolar)');
LEGEND_STATES(:,49) = strpad('MP in component MP (nanomolar)');
LEGEND_CONSTANTS(:,193) = strpad('vsP in component MP (nano_flux)');
LEGEND_CONSTANTS(:,194) = strpad('vmP in component MP (nano_flux)');
LEGEND_CONSTANTS(:,195) = strpad('kdmp in component MP (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,196) = strpad('KAP in component MP (nanomolar)');
LEGEND_CONSTANTS(:,197) = strpad('KmP in component MP (nanomolar)');
LEGEND_CONSTANTS(:,198) = strpad('n in component model_parameters (dimensionless)');
LEGEND_STATES(:,50) = strpad('MC in component MC (nanomolar)');
LEGEND_CONSTANTS(:,199) = strpad('vsC in component MC (nano_flux)');
LEGEND_CONSTANTS(:,200) = strpad('vmC in component MC (nano_flux)');
LEGEND_CONSTANTS(:,201) = strpad('kdmc in component MC (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,202) = strpad('KAC in component MC (nanomolar)');
LEGEND_CONSTANTS(:,203) = strpad('KmC in component MC (nanomolar)');
LEGEND_STATES(:,51) = strpad('MB in component MB (nanomolar)');
LEGEND_CONSTANTS(:,204) = strpad('vsB in component MB (nano_flux)');
LEGEND_CONSTANTS(:,205) = strpad('vmB in component MB (nano_flux)');
LEGEND_CONSTANTS(:,206) = strpad('kdmb in component MB (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,207) = strpad('KIB in component MB (nanomolar)');
LEGEND_CONSTANTS(:,208) = strpad('KmB in component MB (nanomolar)');
LEGEND_CONSTANTS(:,209) = strpad('m in component model_parameters (dimensionless)');
LEGEND_STATES(:,52) = strpad('RN in component RN (nanomolar)');
LEGEND_STATES(:,53) = strpad('MR in component MR (nanomolar)');
LEGEND_CONSTANTS(:,210) = strpad('vsR in component MR (nano_flux)');
LEGEND_CONSTANTS(:,211) = strpad('vmR in component MR (nano_flux)');
LEGEND_CONSTANTS(:,212) = strpad('kdmr in component MR (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,213) = strpad('KAR in component MR (nanomolar)');
LEGEND_CONSTANTS(:,214) = strpad('KmR in component MR (nanomolar)');
LEGEND_CONSTANTS(:,215) = strpad('h in component model_parameters (dimensionless)');
LEGEND_STATES(:,54) = strpad('PC in component PC (nanomolar)');
LEGEND_CONSTANTS(:,216) = strpad('ksP in component model_parameters (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,217) = strpad('Kp in component model_parameters (nanomolar)');
LEGEND_CONSTANTS(:,218) = strpad('Kdp in component model_parameters (nanomolar)');
LEGEND_CONSTANTS(:,219) = strpad('k3 in component model_parameters (second_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,220) = strpad('k4 in component model_parameters (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,221) = strpad('kdn in component model_parameters (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,222) = strpad('V1P in component model_parameters (nano_flux)');
LEGEND_CONSTANTS(:,223) = strpad('V2P in component model_parameters (nano_flux)');
LEGEND_STATES(:,55) = strpad('PCP in component PCP (nanomolar)');
LEGEND_STATES(:,56) = strpad('PCC in component PCC (nanomolar)');
LEGEND_STATES(:,57) = strpad('CC in component CC (nanomolar)');
LEGEND_CONSTANTS(:,224) = strpad('ksC in component model_parameters (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,225) = strpad('kdnc in component model_parameters (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,226) = strpad('V1C in component model_parameters (nano_flux)');
LEGEND_CONSTANTS(:,227) = strpad('V2C in component model_parameters (nano_flux)');
LEGEND_STATES(:,58) = strpad('CCP in component CCP (nanomolar)');
LEGEND_STATES(:,59) = strpad('RC in component RC (nanomolar)');
LEGEND_CONSTANTS(:,228) = strpad('ksR in component model_parameters (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,229) = strpad('Kd in component model_parameters (nanomolar)');
LEGEND_CONSTANTS(:,230) = strpad('k9 in component model_parameters (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,231) = strpad('k10 in component model_parameters (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,232) = strpad('vdRC in component model_parameters (nano_flux)');
LEGEND_CONSTANTS(:,233) = strpad('vdPC in component model_parameters (nano_flux)');
LEGEND_CONSTANTS(:,234) = strpad('vdCC in component model_parameters (nano_flux)');
LEGEND_CONSTANTS(:,235) = strpad('k1 in component model_parameters (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,236) = strpad('k2 in component model_parameters (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,237) = strpad('V1PC in component model_parameters (nano_flux)');
LEGEND_CONSTANTS(:,238) = strpad('V2PC in component model_parameters (nano_flux)');
LEGEND_STATES(:,60) = strpad('PCCP in component PCCP (nanomolar)');
LEGEND_STATES(:,61) = strpad('PCN in component PCN (nanomolar)');
LEGEND_CONSTANTS(:,239) = strpad('k7 in component model_parameters (second_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,240) = strpad('k8 in component model_parameters (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,241) = strpad('V3PC in component model_parameters (nano_flux)');
LEGEND_CONSTANTS(:,242) = strpad('V4PC in component model_parameters (nano_flux)');
LEGEND_STATES(:,62) = strpad('PCNP in component PCNP (nanomolar)');
LEGEND_STATES(:,63) = strpad('IN in component IN (nanomolar)');
LEGEND_CONSTANTS(:,243) = strpad('vdRN in component model_parameters (nano_flux)');
LEGEND_CONSTANTS(:,244) = strpad('vdPCC in component model_parameters (nano_flux)');
LEGEND_CONSTANTS(:,245) = strpad('vdPCN in component model_parameters (nano_flux)');
LEGEND_STATES(:,64) = strpad('BC in component BC (nanomolar)');
LEGEND_CONSTANTS(:,246) = strpad('ksB in component model_parameters (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,247) = strpad('k5 in component model_parameters (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,248) = strpad('k6 in component model_parameters (first_order_rate_constant_nano)');
LEGEND_CONSTANTS(:,249) = strpad('V1B in component model_parameters (nano_flux)');
LEGEND_CONSTANTS(:,250) = strpad('V2B in component model_parameters (nano_flux)');
LEGEND_STATES(:,65) = strpad('BCP in component BCP (nanomolar)');
LEGEND_CONSTANTS(:,251) = strpad('vdBC in component model_parameters (nano_flux)');
LEGEND_CONSTANTS(:,252) = strpad('V3B in component model_parameters (nano_flux)');
LEGEND_CONSTANTS(:,253) = strpad('V4B in component model_parameters (nano_flux)');
LEGEND_STATES(:,66) = strpad('BNP in component BNP (nanomolar)');
LEGEND_CONSTANTS(:,254) = strpad('vdBN in component model_parameters (nano_flux)');
LEGEND_CONSTANTS(:,255) = strpad('vdIN in component model_parameters (nano_flux)');
LEGEND_RATES(:,1) = strpad('d/dt AP1 in component AP1 (micromolar)');
LEGEND_RATES(:,2) = strpad('d/dt pRB in component pRB (micromolar)');
LEGEND_RATES(:,4) = strpad('d/dt pRBc1 in component pRBc1 (micromolar)');
LEGEND_RATES(:,7) = strpad('d/dt pRBp in component pRBp (micromolar)');
LEGEND_RATES(:,10) = strpad('d/dt pRBc2 in component pRBc2 (micromolar)');
LEGEND_RATES(:,9) = strpad('d/dt pRBpp in component pRBpp (micromolar)');
LEGEND_RATES(:,3) = strpad('d/dt E2F in component E2F (micromolar)');
LEGEND_RATES(:,12) = strpad('d/dt E2Fp in component E2Fp (micromolar)');
LEGEND_RATES(:,13) = strpad('d/dt Cd in component Cd (micromolar)');
LEGEND_RATES(:,14) = strpad('d/dt Mdi in component Mdi (micromolar)');
LEGEND_RATES(:,5) = strpad('d/dt Md in component Md (micromolar)');
LEGEND_RATES(:,6) = strpad('d/dt Mdp27 in component Mdp27 (micromolar)');
LEGEND_RATES(:,16) = strpad('d/dt Ce in component Ce (micromolar)');
LEGEND_RATES(:,17) = strpad('d/dt Mei in component Mei (micromolar)');
LEGEND_RATES(:,8) = strpad('d/dt Me in component Me (micromolar)');
LEGEND_RATES(:,21) = strpad('d/dt Skp2 in component Skp2 (micromolar)');
LEGEND_RATES(:,18) = strpad('d/dt Mep27 in component Mep27 (micromolar)');
LEGEND_RATES(:,25) = strpad('d/dt Pei in component Pei (micromolar)');
LEGEND_RATES(:,23) = strpad('d/dt Pe in component Pe (micromolar)');
LEGEND_RATES(:,27) = strpad('d/dt Ca in component Ca (micromolar)');
LEGEND_RATES(:,19) = strpad('d/dt Mai in component Mai (micromolar)');
LEGEND_RATES(:,11) = strpad('d/dt Ma in component Ma (micromolar)');
LEGEND_RATES(:,20) = strpad('d/dt Map27 in component Map27 (micromolar)');
LEGEND_RATES(:,15) = strpad('d/dt p27 in component p27 (micromolar)');
LEGEND_RATES(:,32) = strpad('d/dt p27p in component p27p (micromolar)');
LEGEND_RATES(:,33) = strpad('d/dt Cdh1i in component Cdh1i (micromolar)');
LEGEND_RATES(:,24) = strpad('d/dt Cdh1a in component Cdh1a (micromolar)');
LEGEND_RATES(:,34) = strpad('d/dt Pai in component Pai (micromolar)');
LEGEND_RATES(:,29) = strpad('d/dt Pa in component Pa (micromolar)');
LEGEND_RATES(:,35) = strpad('d/dt Cb in component Cb (micromolar)');
LEGEND_RATES(:,36) = strpad('d/dt Mbi in component Mbi (micromolar)');
LEGEND_RATES(:,30) = strpad('d/dt Mb in component Mb (micromolar)');
LEGEND_RATES(:,31) = strpad('d/dt Mbp27 in component Mbp27 (micromolar)');
LEGEND_RATES(:,38) = strpad('d/dt Cdc20i in component Cdc20i (micromolar)');
LEGEND_RATES(:,28) = strpad('d/dt Cdc20a in component Cdc20a (micromolar)');
LEGEND_RATES(:,39) = strpad('d/dt Pbi in component Pbi (micromolar)');
LEGEND_RATES(:,37) = strpad('d/dt Pb in component Pb (micromolar)');
LEGEND_RATES(:,22) = strpad('d/dt Wee1 in component Wee1 (micromolar)');
LEGEND_RATES(:,41) = strpad('d/dt Wee1p in component Wee1p (micromolar)');
LEGEND_RATES(:,42) = strpad('d/dt Cdc45 in component Cdc45 (micromolar)');
LEGEND_RATES(:,43) = strpad('d/dt Pol in component Pol (micromolar)');
LEGEND_RATES(:,44) = strpad('d/dt Primer in component Primer (micromolar)');
LEGEND_RATES(:,45) = strpad('d/dt ATR in component ATR (micromolar)');
LEGEND_RATES(:,26) = strpad('d/dt Chk1 in component Chk1 (micromolar)');
LEGEND_RATES(:,40) = strpad('d/dt Mw in component Mw (micromolar)');
LEGEND_RATES(:,47) = strpad('d/dt X in component X (micromolar)');
LEGEND_RATES(:,48) = strpad('d/dt CbA in component CbA (micromolar)');
LEGEND_RATES(:,49) = strpad('d/dt MP in component MP (nanomolar)');
LEGEND_RATES(:,50) = strpad('d/dt MC in component MC (nanomolar)');
LEGEND_RATES(:,51) = strpad('d/dt MB in component MB (nanomolar)');
LEGEND_RATES(:,53) = strpad('d/dt MR in component MR (nanomolar)');
LEGEND_RATES(:,54) = strpad('d/dt PC in component PC (nanomolar)');
LEGEND_RATES(:,57) = strpad('d/dt CC in component CC (nanomolar)');
LEGEND_RATES(:,59) = strpad('d/dt RC in component RC (nanomolar)');
LEGEND_RATES(:,55) = strpad('d/dt PCP in component PCP (nanomolar)');
LEGEND_RATES(:,58) = strpad('d/dt CCP in component CCP (nanomolar)');
LEGEND_RATES(:,56) = strpad('d/dt PCC in component PCC (nanomolar)');
LEGEND_RATES(:,61) = strpad('d/dt PCN in component PCN (nanomolar)');
LEGEND_RATES(:,52) = strpad('d/dt RN in component RN (nanomolar)');
LEGEND_RATES(:,60) = strpad('d/dt PCCP in component PCCP (nanomolar)');
LEGEND_RATES(:,62) = strpad('d/dt PCNP in component PCNP (nanomolar)');
LEGEND_RATES(:,64) = strpad('d/dt BC in component BC (nanomolar)');
LEGEND_RATES(:,65) = strpad('d/dt BCP in component BCP (nanomolar)');
LEGEND_RATES(:,46) = strpad('d/dt BN in component BN (nanomolar)');
LEGEND_RATES(:,66) = strpad('d/dt BNP in component BNP (nanomolar)');
LEGEND_RATES(:,63) = strpad('d/dt IN in component IN (nanomolar)');
LEGEND_STATES  = LEGEND_STATES';
LEGEND_ALGEBRAIC = LEGEND_ALGEBRAIC';
LEGEND_RATES = LEGEND_RATES';
LEGEND_CONSTANTS = LEGEND_CONSTANTS';
end

function [STATES, CONSTANTS] = initConsts()
VOI = 0; CONSTANTS = []; STATES = []; ALGEBRAIC = [];
STATES(:,1) = 0.01;
CONSTANTS(:,1) = 1;
CONSTANTS(:,2) = 1;
CONSTANTS(:,3) = 0.1;
CONSTANTS(:,4) = 0.15;
CONSTANTS(:,5) = 17;
STATES(:,2) = 1;
CONSTANTS(:,6) = 0.8;
CONSTANTS(:,7) = 0.05;
STATES(:,3) = 0.01;
CONSTANTS(:,8) = 0.5;
STATES(:,4) = 0.1;
CONSTANTS(:,9) = 2.2;
CONSTANTS(:,10) = 0.1;
STATES(:,5) = 0.01;
STATES(:,6) = 0.01;
CONSTANTS(:,11) = 2;
STATES(:,7) = 0.25;
CONSTANTS(:,12) = 0.1;
CONSTANTS(:,13) = 0.01;
CONSTANTS(:,14) = 1;
CONSTANTS(:,15) = 0.1;
STATES(:,8) = 0.01;
CONSTANTS(:,16) = 2;
STATES(:,9) = 0.1;
CONSTANTS(:,17) = 0.1;
CONSTANTS(:,18) = 0.025;
CONSTANTS(:,19) = 0.5;
STATES(:,10) = 0.05;
CONSTANTS(:,20) = 0.06;
CONSTANTS(:,21) = 0.04;
CONSTANTS(:,22) = 0.17;
CONSTANTS(:,23) = 4;
STATES(:,11) = 0.01;
CONSTANTS(:,24) = 5;
CONSTANTS(:,25) = 0.75;
STATES(:,12) = 0.01;
CONSTANTS(:,26) = 5;
CONSTANTS(:,27) = 0.002;
CONSTANTS(:,28) = 1.1;
STATES(:,13) = 0.01;
CONSTANTS(:,29) = 0.4;
CONSTANTS(:,30) = 0.005;
CONSTANTS(:,31) = 0.1;
CONSTANTS(:,32) = 2;
CONSTANTS(:,33) = 0.175;
CONSTANTS(:,34) = 1.5;
STATES(:,14) = 0.01;
CONSTANTS(:,35) = 0.1;
CONSTANTS(:,36) = 5;
CONSTANTS(:,37) = 0.1;
CONSTANTS(:,38) = 0.005;
CONSTANTS(:,39) = 0.2;
CONSTANTS(:,40) = 0.1;
CONSTANTS(:,41) = 1;
CONSTANTS(:,42) = 0.1;
CONSTANTS(:,43) = 0.15;
STATES(:,15) = 0.01;
CONSTANTS(:,44) = 0.05;
STATES(:,16) = 0.01;
CONSTANTS(:,45) = 0.29;
CONSTANTS(:,46) = 0.1;
CONSTANTS(:,47) = 2;
CONSTANTS(:,48) = 0.2;
CONSTANTS(:,49) = 2;
STATES(:,17) = 0.01;
STATES(:,18) = 0.01;
STATES(:,19) = 0.01;
STATES(:,20) = 0.01;
CONSTANTS(:,50) = 0.1;
CONSTANTS(:,51) = 3;
STATES(:,21) = 0.01;
CONSTANTS(:,52) = 2;
CONSTANTS(:,53) = 0.1;
CONSTANTS(:,54) = 0.005;
CONSTANTS(:,55) = 1.4;
STATES(:,22) = 0.1;
CONSTANTS(:,56) = 0.5;
CONSTANTS(:,57) = 0.1;
CONSTANTS(:,58) = 2;
STATES(:,23) = 0.01;
CONSTANTS(:,59) = 0.1;
CONSTANTS(:,60) = 0.2;
CONSTANTS(:,61) = 0.1;
CONSTANTS(:,62) = 0.15;
CONSTANTS(:,63) = 1.1;
CONSTANTS(:,64) = 0.5;
STATES(:,24) = 0.01;
CONSTANTS(:,65) = 0.4;
CONSTANTS(:,66) = 0.005;
STATES(:,25) = 0.01;
CONSTANTS(:,67) = 0.13;
CONSTANTS(:,68) = 0.8;
CONSTANTS(:,69) = 1;
CONSTANTS(:,70) = 1;
STATES(:,26) = 0.01;
CONSTANTS(:,71) = 0.1;
CONSTANTS(:,72) = 5;
CONSTANTS(:,73) = 0.25;
CONSTANTS(:,74) = 0.1;
CONSTANTS(:,75) = 0.15;
CONSTANTS(:,76) = 0.075;
STATES(:,27) = 0.01;
CONSTANTS(:,77) = 0.0375;
CONSTANTS(:,78) = 0.1;
CONSTANTS(:,79) = 2;
CONSTANTS(:,80) = 0.2;
CONSTANTS(:,81) = 0.1;
CONSTANTS(:,82) = 2.5;
CONSTANTS(:,83) = 1.1;
STATES(:,28) = 0.01;
CONSTANTS(:,84) = 2;
CONSTANTS(:,85) = 0.005;
CONSTANTS(:,86) = 1.85;
CONSTANTS(:,87) = 0.5;
CONSTANTS(:,88) = 0.1;
CONSTANTS(:,89) = 2;
STATES(:,29) = 0.01;
CONSTANTS(:,90) = 0.1;
CONSTANTS(:,91) = 0.15;
CONSTANTS(:,92) = 0.125;
CONSTANTS(:,93) = 0.8;
CONSTANTS(:,94) = 0.1;
CONSTANTS(:,95) = 0.1;
CONSTANTS(:,96) = 2;
CONSTANTS(:,97) = 0.12;
STATES(:,30) = 0.01;
CONSTANTS(:,98) = 0.2;
STATES(:,31) = 0.01;
CONSTANTS(:,99) = 100;
CONSTANTS(:,100) = 0.5;
CONSTANTS(:,101) = 0.1;
CONSTANTS(:,102) = 0.5;
STATES(:,32) = 0.01;
CONSTANTS(:,103) = 0.06;
CONSTANTS(:,104) = 5;
CONSTANTS(:,105) = 0.1;
CONSTANTS(:,106) = 0.1;
CONSTANTS(:,107) = 0.01;
STATES(:,33) = 0.01;
CONSTANTS(:,108) = 8;
CONSTANTS(:,109) = 0.01;
CONSTANTS(:,110) = 1.25;
CONSTANTS(:,111) = 0.01;
CONSTANTS(:,112) = 0.2;
CONSTANTS(:,113) = 0.11;
CONSTANTS(:,114) = 0.1;
STATES(:,34) = 0.01;
CONSTANTS(:,115) = 0.105;
CONSTANTS(:,116) = 1;
CONSTANTS(:,117) = 1;
CONSTANTS(:,118) = 1;
CONSTANTS(:,119) = 0.1;
CONSTANTS(:,120) = 4;
CONSTANTS(:,121) = 0.2;
CONSTANTS(:,122) = 0.1;
CONSTANTS(:,123) = 0.15;
CONSTANTS(:,124) = 0.075;
STATES(:,35) = 0.01;
CONSTANTS(:,125) = 0.05;
CONSTANTS(:,126) = 0.25;
CONSTANTS(:,127) = 0.5;
STATES(:,36) = 0.01;
CONSTANTS(:,128) = 0.1;
CONSTANTS(:,129) = 0.06;
CONSTANTS(:,130) = 0.005;
CONSTANTS(:,131) = 0.2;
CONSTANTS(:,132) = 0.1;
CONSTANTS(:,133) = 0.005;
CONSTANTS(:,134) = 2.1;
CONSTANTS(:,135) = 0.5;
CONSTANTS(:,136) = 0.1;
CONSTANTS(:,137) = 3.9;
STATES(:,37) = 0.01;
CONSTANTS(:,138) = 0.1;
STATES(:,38) = 0.01;
CONSTANTS(:,139) = 0.1;
CONSTANTS(:,140) = 8;
CONSTANTS(:,141) = 0.1;
CONSTANTS(:,142) = 0.7;
CONSTANTS(:,143) = 0.1;
CONSTANTS(:,144) = 0.14;
CONSTANTS(:,145) = 0.05;
STATES(:,39) = 0.01;
CONSTANTS(:,146) = 0.12;
CONSTANTS(:,147) = 1;
CONSTANTS(:,148) = 1;
CONSTANTS(:,149) = 1;
CONSTANTS(:,150) = 0.1;
CONSTANTS(:,151) = 5;
CONSTANTS(:,152) = 0.11;
CONSTANTS(:,153) = 0.1;
CONSTANTS(:,154) = 0.2;
CONSTANTS(:,155) = 0.1;
CONSTANTS(:,156) = 0.06;
CONSTANTS(:,157) = 5;
STATES(:,40) = 0;
CONSTANTS(:,158) = 1.2;
CONSTANTS(:,159) = 0.75;
CONSTANTS(:,160) = 0.1;
CONSTANTS(:,161) = 1;
STATES(:,41) = 0.01;
CONSTANTS(:,162) = 0.1;
CONSTANTS(:,163) = 0.1;
CONSTANTS(:,164) = 0.2;
STATES(:,42) = 0.01;
CONSTANTS(:,165) = 0.8;
CONSTANTS(:,166) = 0.5;
CONSTANTS(:,167) = 0.02;
CONSTANTS(:,168) = 0.12;
CONSTANTS(:,169) = 0.02;
CONSTANTS(:,170) = 0.8;
CONSTANTS(:,171) = 0.5;
STATES(:,43) = 0.01;
CONSTANTS(:,172) = 0.2;
STATES(:,44) = 0.01;
CONSTANTS(:,173) = 0.05;
CONSTANTS(:,174) = 0.15;
CONSTANTS(:,175) = 0.022;
CONSTANTS(:,176) = 0.5;
STATES(:,45) = 0.01;
CONSTANTS(:,177) = 0.15;
CONSTANTS(:,178) = 4;
CONSTANTS(:,179) = 0.5;
CONSTANTS(:,180) = 0.5;
CONSTANTS(:,181) = 0.1;
CONSTANTS(:,182) = 0.5;
CONSTANTS(:,183) = 0;
STATES(:,46) = 0.1;
CONSTANTS(:,184) = 4;
CONSTANTS(:,185) = 0.5;
CONSTANTS(:,186) = 0.12;
CONSTANTS(:,187) = 0.5;
STATES(:,47) = 0.01;
CONSTANTS(:,188) = 10;
CONSTANTS(:,189) = 1;
CONSTANTS(:,190) = 0.1;
CONSTANTS(:,191) = 2;
CONSTANTS(:,192) = 0.1;
STATES(:,48) = 0.01;
STATES(:,49) = 0.1;
CONSTANTS(:,193) = 2.4;
CONSTANTS(:,194) = 2.2;
CONSTANTS(:,195) = 0.02;
CONSTANTS(:,196) = 0.6;
CONSTANTS(:,197) = 0.3;
CONSTANTS(:,198) = 2;
STATES(:,50) = 1.2;
CONSTANTS(:,199) = 2.2;
CONSTANTS(:,200) = 2;
CONSTANTS(:,201) = 0.02;
CONSTANTS(:,202) = 0.6;
CONSTANTS(:,203) = 0.4;
STATES(:,51) = 9;
CONSTANTS(:,204) = 1.8;
CONSTANTS(:,205) = 1.3;
CONSTANTS(:,206) = 0.02;
CONSTANTS(:,207) = 2.2;
CONSTANTS(:,208) = 0.4;
CONSTANTS(:,209) = 2;
STATES(:,52) = 0.1;
STATES(:,53) = 1.5;
CONSTANTS(:,210) = 1.6;
CONSTANTS(:,211) = 1.6;
CONSTANTS(:,212) = 0.02;
CONSTANTS(:,213) = 0.6;
CONSTANTS(:,214) = 0.4;
CONSTANTS(:,215) = 2;
STATES(:,54) = 0.1;
CONSTANTS(:,216) = 1.2;
CONSTANTS(:,217) = 1.006;
CONSTANTS(:,218) = 0.1;
CONSTANTS(:,219) = 0.8;
CONSTANTS(:,220) = 0.4;
CONSTANTS(:,221) = 0.02;
CONSTANTS(:,222) = 9.6;
CONSTANTS(:,223) = 0.6;
STATES(:,55) = 0.1;
STATES(:,56) = 0.1;
STATES(:,57) = 0.1;
CONSTANTS(:,224) = 3.2;
CONSTANTS(:,225) = 0.02;
CONSTANTS(:,226) = 1.2;
CONSTANTS(:,227) = 0.2;
STATES(:,58) = 0.1;
STATES(:,59) = 0.1;
CONSTANTS(:,228) = 1.7;
CONSTANTS(:,229) = 0.3;
CONSTANTS(:,230) = 0.8;
CONSTANTS(:,231) = 0.4;
CONSTANTS(:,232) = 4.4;
CONSTANTS(:,233) = 3.4;
CONSTANTS(:,234) = 1.4;
CONSTANTS(:,235) = 0.8;
CONSTANTS(:,236) = 0.4;
CONSTANTS(:,237) = 2.4;
CONSTANTS(:,238) = 0.2;
STATES(:,60) = 0.1;
STATES(:,61) = 0.1;
CONSTANTS(:,239) = 1;
CONSTANTS(:,240) = 0.2;
CONSTANTS(:,241) = 2.4;
CONSTANTS(:,242) = 0.2;
STATES(:,62) = 0.1;
STATES(:,63) = 0.1;
CONSTANTS(:,243) = 0.8;
CONSTANTS(:,244) = 1.4;
CONSTANTS(:,245) = 1.4;
STATES(:,64) = 0.1;
CONSTANTS(:,246) = 0.32;
CONSTANTS(:,247) = 0.8;
CONSTANTS(:,248) = 0.4;
CONSTANTS(:,249) = 1.4;
CONSTANTS(:,250) = 0.2;
STATES(:,65) = 0.1;
CONSTANTS(:,251) = 3;
CONSTANTS(:,252) = 1.4;
CONSTANTS(:,253) = 0.4;
STATES(:,66) = 0.1;
CONSTANTS(:,254) = 3;
CONSTANTS(:,255) = 1.6;
if (isempty(STATES)), warning('Initial values for states not set');, end
end

function [RATES, ALGEBRAIC] = computeRates(VOI, STATES, CONSTANTS)
global algebraicVariableCount;
statesSize = size(STATES);
statesColumnCount = statesSize(2);
if ( statesColumnCount == 1)
STATES = STATES';
ALGEBRAIC = zeros(1, algebraicVariableCount);
utilOnes = 1;
else
statesRowCount = statesSize(1);
ALGEBRAIC = zeros(statesRowCount, algebraicVariableCount);
RATES = zeros(statesRowCount, statesColumnCount);
utilOnes = ones(statesRowCount, 1);
end
RATES(:,1) =  (( CONSTANTS(:,1).*CONSTANTS(:,2))./(CONSTANTS(:,3)+CONSTANTS(:,2)) -  CONSTANTS(:,4).*STATES(:,1)).*CONSTANTS(:,5);
RATES(:,2) =  (((((CONSTANTS(:,6) -  CONSTANTS(:,7).*STATES(:,2).*STATES(:,3))+ CONSTANTS(:,8).*STATES(:,4)) -  (( CONSTANTS(:,9).*STATES(:,2))./(CONSTANTS(:,10)+STATES(:,2))).*(STATES(:,5)+STATES(:,6)))+( CONSTANTS(:,11).*STATES(:,7))./(CONSTANTS(:,12)+STATES(:,7))) -  CONSTANTS(:,13).*STATES(:,2)).*CONSTANTS(:,5);
RATES(:,4) =  ( CONSTANTS(:,7).*STATES(:,2).*STATES(:,3) -  CONSTANTS(:,8).*STATES(:,4)).*CONSTANTS(:,5);
RATES(:,7) =  (((((( (( CONSTANTS(:,9).*STATES(:,2))./(CONSTANTS(:,10)+STATES(:,2))).*(STATES(:,5)+STATES(:,6)) - ( CONSTANTS(:,11).*STATES(:,7))./(CONSTANTS(:,12)+STATES(:,7))) -  (( CONSTANTS(:,14).*STATES(:,7))./(CONSTANTS(:,15)+STATES(:,7))).*STATES(:,8))+( CONSTANTS(:,16).*STATES(:,9))./(CONSTANTS(:,17)+STATES(:,9))) -  CONSTANTS(:,18).*STATES(:,7).*STATES(:,3))+ CONSTANTS(:,19).*STATES(:,10)) -  CONSTANTS(:,20).*STATES(:,7)).*CONSTANTS(:,5);
RATES(:,10) =  ( CONSTANTS(:,18).*STATES(:,7).*STATES(:,3) -  CONSTANTS(:,19).*STATES(:,10)).*CONSTANTS(:,5);
RATES(:,9) =  (( (( CONSTANTS(:,14).*STATES(:,7))./(CONSTANTS(:,15)+STATES(:,7))).*STATES(:,8) - ( CONSTANTS(:,16).*STATES(:,9))./(CONSTANTS(:,17)+STATES(:,9))) -  CONSTANTS(:,21).*STATES(:,9)).*CONSTANTS(:,5);
RATES(:,3) =  (((((((CONSTANTS(:,22) -  CONSTANTS(:,7).*STATES(:,2).*STATES(:,3))+ CONSTANTS(:,8).*STATES(:,4)) -  CONSTANTS(:,18).*STATES(:,7).*STATES(:,3))+ CONSTANTS(:,19).*STATES(:,10)) - ( CONSTANTS(:,23).*STATES(:,11).*STATES(:,3))./(CONSTANTS(:,24)+STATES(:,3)))+( CONSTANTS(:,25).*STATES(:,12))./(CONSTANTS(:,26)+STATES(:,12))) -  CONSTANTS(:,27).*STATES(:,3)).*CONSTANTS(:,5);
RATES(:,12) =  ((( CONSTANTS(:,23).*STATES(:,11).*STATES(:,3))./(CONSTANTS(:,24)+STATES(:,3)) - ( CONSTANTS(:,25).*STATES(:,12))./(CONSTANTS(:,26)+STATES(:,12))) -  CONSTANTS(:,28).*STATES(:,12)).*CONSTANTS(:,5);
RATES(:,13) =  ((((( CONSTANTS(:,29).*STATES(:,1)+( (( CONSTANTS(:,30).*STATES(:,3).*CONSTANTS(:,31))./(CONSTANTS(:,31)+STATES(:,2))).*CONSTANTS(:,32))./(CONSTANTS(:,32)+STATES(:,7))) -  CONSTANTS(:,33).*STATES(:,13).*(CONSTANTS(:,34) - (STATES(:,14)+STATES(:,5)+STATES(:,6))))+ CONSTANTS(:,35).*STATES(:,14)) - ( CONSTANTS(:,36).*STATES(:,13))./(CONSTANTS(:,37)+STATES(:,13))) -  CONSTANTS(:,38).*STATES(:,13)).*CONSTANTS(:,5);
RATES(:,14) =  ((( CONSTANTS(:,33).*STATES(:,13).*(CONSTANTS(:,34) - (STATES(:,14)+STATES(:,5)+STATES(:,6))) -  CONSTANTS(:,35).*STATES(:,14))+( CONSTANTS(:,39).*STATES(:,5))./(CONSTANTS(:,40)+STATES(:,5))) - ( CONSTANTS(:,41).*STATES(:,14))./(CONSTANTS(:,42)+STATES(:,14))).*CONSTANTS(:,5);
RATES(:,5) =  (((( CONSTANTS(:,41).*STATES(:,14))./(CONSTANTS(:,42)+STATES(:,14)) - ( CONSTANTS(:,39).*STATES(:,5))./(CONSTANTS(:,40)+STATES(:,5))) -  CONSTANTS(:,43).*STATES(:,5).*STATES(:,15))+ CONSTANTS(:,44).*STATES(:,6)).*CONSTANTS(:,5);
RATES(:,6) =  ( CONSTANTS(:,43).*STATES(:,5).*STATES(:,15) -  CONSTANTS(:,44).*STATES(:,6)).*CONSTANTS(:,5);
RATES(:,16) =  ((((( (( CONSTANTS(:,45).*STATES(:,3).*CONSTANTS(:,46))./(CONSTANTS(:,46)+STATES(:,2))).*CONSTANTS(:,47))./(CONSTANTS(:,47)+STATES(:,7)) -  CONSTANTS(:,48).*STATES(:,16).*(CONSTANTS(:,49) - (STATES(:,17)+STATES(:,8)+STATES(:,18)+STATES(:,19)+STATES(:,11)+STATES(:,20))))+ CONSTANTS(:,50).*STATES(:,17)) - ( (( CONSTANTS(:,51).*STATES(:,21))./(CONSTANTS(:,52)+STATES(:,21))).*STATES(:,16))./(CONSTANTS(:,53)+STATES(:,16))) -  CONSTANTS(:,54).*STATES(:,16)).*CONSTANTS(:,5);
RATES(:,17) =  ((( CONSTANTS(:,48).*STATES(:,16).*(CONSTANTS(:,49) - (STATES(:,17)+STATES(:,8)+STATES(:,18)+STATES(:,19)+STATES(:,11)+STATES(:,20))) -  CONSTANTS(:,50).*STATES(:,17))+( CONSTANTS(:,55).*(STATES(:,22)+CONSTANTS(:,56)).*STATES(:,8))./(CONSTANTS(:,57)+STATES(:,8))) - ( CONSTANTS(:,58).*STATES(:,23).*STATES(:,17))./(CONSTANTS(:,59)+STATES(:,17))).*CONSTANTS(:,5);
RATES(:,8) =  (((( CONSTANTS(:,58).*STATES(:,23).*STATES(:,17))./(CONSTANTS(:,59)+STATES(:,17)) - ( CONSTANTS(:,55).*(STATES(:,22)+CONSTANTS(:,56)).*STATES(:,8))./(CONSTANTS(:,57)+STATES(:,8))) -  CONSTANTS(:,60).*STATES(:,8).*STATES(:,15))+ CONSTANTS(:,61).*STATES(:,18)).*CONSTANTS(:,5);
RATES(:,21) =  ((CONSTANTS(:,62) - ( (( CONSTANTS(:,63).*STATES(:,21))./(CONSTANTS(:,64)+STATES(:,21))).*STATES(:,24))./(CONSTANTS(:,65)+STATES(:,24))) -  CONSTANTS(:,66).*STATES(:,21)).*CONSTANTS(:,5);
RATES(:,18) =  ( CONSTANTS(:,60).*STATES(:,8).*STATES(:,15) -  CONSTANTS(:,61).*STATES(:,18)).*CONSTANTS(:,5);
RATES(:,25) =  (((CONSTANTS(:,67)+( CONSTANTS(:,68).*(CONSTANTS(:,69)+ CONSTANTS(:,70).*STATES(:,26)).*STATES(:,23))./(CONSTANTS(:,71)+STATES(:,23))) - ( CONSTANTS(:,72).*(STATES(:,8)+CONSTANTS(:,73)).*STATES(:,25))./(CONSTANTS(:,74)+STATES(:,25))) -  CONSTANTS(:,75).*STATES(:,25)).*CONSTANTS(:,5);
RATES(:,23) =  (( CONSTANTS(:,72).*(STATES(:,8)+CONSTANTS(:,73)).*(STATES(:,25)./(CONSTANTS(:,74)+STATES(:,25))) -  CONSTANTS(:,68).*(CONSTANTS(:,69)+ CONSTANTS(:,70).*STATES(:,26)).*(STATES(:,23)./(CONSTANTS(:,71)+STATES(:,23)))) -  CONSTANTS(:,76).*STATES(:,23)).*CONSTANTS(:,5);
RATES(:,27) =  ((((( (( CONSTANTS(:,77).*STATES(:,3).*CONSTANTS(:,78))./(CONSTANTS(:,78)+STATES(:,2))).*CONSTANTS(:,79))./(CONSTANTS(:,79)+STATES(:,7)) -  CONSTANTS(:,80).*STATES(:,27).*(CONSTANTS(:,49) - (STATES(:,17)+STATES(:,8)+STATES(:,18)+STATES(:,19)+STATES(:,11)+STATES(:,20))))+ CONSTANTS(:,81).*STATES(:,19)) - ( (( CONSTANTS(:,82).*STATES(:,27))./(CONSTANTS(:,83)+STATES(:,27))).*STATES(:,28))./(CONSTANTS(:,84)+STATES(:,28))) -  CONSTANTS(:,85).*STATES(:,27)).*CONSTANTS(:,5);
RATES(:,19) =  ((( CONSTANTS(:,80).*STATES(:,27).*(CONSTANTS(:,49) - (STATES(:,17)+STATES(:,8)+STATES(:,18)+STATES(:,19)+STATES(:,11)+STATES(:,20))) -  CONSTANTS(:,81).*STATES(:,19))+( CONSTANTS(:,86).*(STATES(:,22)+CONSTANTS(:,87)).*STATES(:,11))./(CONSTANTS(:,88)+STATES(:,11))) - ( CONSTANTS(:,89).*STATES(:,29).*STATES(:,19))./(CONSTANTS(:,90)+STATES(:,19))).*CONSTANTS(:,5);
RATES(:,11) =  (((( CONSTANTS(:,89).*STATES(:,29).*STATES(:,19))./(CONSTANTS(:,90)+STATES(:,19)) - ( CONSTANTS(:,86).*(STATES(:,22)+CONSTANTS(:,87)).*STATES(:,11))./(CONSTANTS(:,88)+STATES(:,11))) -  CONSTANTS(:,91).*STATES(:,11).*STATES(:,15))+ CONSTANTS(:,92).*STATES(:,20)).*CONSTANTS(:,5);
RATES(:,20) =  ( CONSTANTS(:,91).*STATES(:,11).*STATES(:,15) -  CONSTANTS(:,92).*STATES(:,20)).*CONSTANTS(:,5);
RATES(:,15) =  ((((((((((((CONSTANTS(:,93)+( (( CONSTANTS(:,94).*STATES(:,3).*CONSTANTS(:,95))./(CONSTANTS(:,95)+STATES(:,2))).*CONSTANTS(:,96))./(CONSTANTS(:,96)+STATES(:,7))) -  CONSTANTS(:,43).*STATES(:,5).*STATES(:,15))+ CONSTANTS(:,44).*STATES(:,6)) -  CONSTANTS(:,60).*STATES(:,8).*STATES(:,15))+ CONSTANTS(:,61).*STATES(:,18)) -  CONSTANTS(:,91).*STATES(:,11).*STATES(:,15))+ CONSTANTS(:,92).*STATES(:,20)) -  CONSTANTS(:,97).*STATES(:,30).*STATES(:,15))+ CONSTANTS(:,98).*STATES(:,31)) - ( CONSTANTS(:,99).*STATES(:,8).*STATES(:,15))./(CONSTANTS(:,100)+STATES(:,15)))+( CONSTANTS(:,101).*STATES(:,32))./(CONSTANTS(:,102)+STATES(:,32))) -  CONSTANTS(:,103).*STATES(:,15)).*CONSTANTS(:,5);
RATES(:,32) =  (((( CONSTANTS(:,99).*STATES(:,8).*STATES(:,15))./(CONSTANTS(:,100)+STATES(:,15)) - ( CONSTANTS(:,101).*STATES(:,32))./(CONSTANTS(:,102)+STATES(:,32))) - ( (( CONSTANTS(:,104).*STATES(:,21))./(CONSTANTS(:,105)+STATES(:,21))).*STATES(:,32))./(CONSTANTS(:,106)+STATES(:,32))) -  CONSTANTS(:,107).*STATES(:,32)).*CONSTANTS(:,5);
RATES(:,33) =  (( (( CONSTANTS(:,108).*STATES(:,24))./(CONSTANTS(:,109)+STATES(:,24))).*(STATES(:,11)+STATES(:,30)) - ( CONSTANTS(:,110).*STATES(:,33))./(CONSTANTS(:,111)+STATES(:,33))) -  CONSTANTS(:,112).*STATES(:,33)).*CONSTANTS(:,5);
RATES(:,24) =  (((CONSTANTS(:,113)+( CONSTANTS(:,110).*STATES(:,33))./(CONSTANTS(:,111)+STATES(:,33))) -  (( CONSTANTS(:,108).*STATES(:,24))./(CONSTANTS(:,109)+STATES(:,24))).*(STATES(:,11)+STATES(:,30))) -  CONSTANTS(:,114).*STATES(:,24)).*CONSTANTS(:,5);
RATES(:,34) =  (((CONSTANTS(:,115)+( CONSTANTS(:,116).*(CONSTANTS(:,117)+ CONSTANTS(:,118).*STATES(:,26)).*STATES(:,29))./(CONSTANTS(:,119)+STATES(:,29))) - ( CONSTANTS(:,120).*(STATES(:,11)+CONSTANTS(:,121)).*STATES(:,34))./(CONSTANTS(:,122)+STATES(:,34))) -  CONSTANTS(:,123).*STATES(:,34)).*CONSTANTS(:,5);
RATES(:,29) =  ((( CONSTANTS(:,120).*(STATES(:,11)+CONSTANTS(:,121)).*STATES(:,34))./(CONSTANTS(:,122)+STATES(:,34)) - ( CONSTANTS(:,116).*(CONSTANTS(:,117)+ CONSTANTS(:,118).*STATES(:,26)).*STATES(:,29))./(CONSTANTS(:,119)+STATES(:,29))) -  CONSTANTS(:,124).*STATES(:,29)).*CONSTANTS(:,5);
RATES(:,35) =  ((((CONSTANTS(:,125) -  CONSTANTS(:,126).*STATES(:,35).*(CONSTANTS(:,127) - (STATES(:,36)+STATES(:,30)+STATES(:,31))))+ CONSTANTS(:,128).*STATES(:,36)) -  (( CONSTANTS(:,129).*STATES(:,35))./(CONSTANTS(:,130)+STATES(:,35))).*(STATES(:,28)./(CONSTANTS(:,131)+STATES(:,28))+STATES(:,24)./(CONSTANTS(:,132)+STATES(:,24)))) -  CONSTANTS(:,133).*STATES(:,35)).*CONSTANTS(:,5);
RATES(:,36) =  ((( CONSTANTS(:,126).*STATES(:,35).*(CONSTANTS(:,127) - (STATES(:,36)+STATES(:,30)+STATES(:,31))) -  CONSTANTS(:,128).*STATES(:,36))+( CONSTANTS(:,134).*(STATES(:,22)+CONSTANTS(:,135)).*STATES(:,30))./(CONSTANTS(:,136)+STATES(:,30))) - ( CONSTANTS(:,137).*STATES(:,37).*STATES(:,36))./(CONSTANTS(:,138)+STATES(:,36))).*CONSTANTS(:,5);
RATES(:,30) =  (((( CONSTANTS(:,137).*STATES(:,37).*STATES(:,36))./(CONSTANTS(:,138)+STATES(:,36)) - ( CONSTANTS(:,134).*(STATES(:,22)+CONSTANTS(:,135)).*STATES(:,30))./(CONSTANTS(:,136)+STATES(:,30))) -  CONSTANTS(:,97).*STATES(:,30).*STATES(:,15))+ CONSTANTS(:,98).*STATES(:,31)).*CONSTANTS(:,5);
RATES(:,31) =  ( CONSTANTS(:,97).*STATES(:,30).*STATES(:,15) -  CONSTANTS(:,98).*STATES(:,31)).*CONSTANTS(:,5);
RATES(:,38) =  (((CONSTANTS(:,139) - ( CONSTANTS(:,140).*STATES(:,30).*STATES(:,38))./(CONSTANTS(:,141)+STATES(:,38)))+( CONSTANTS(:,142).*STATES(:,28))./(CONSTANTS(:,143)+STATES(:,28))) -  CONSTANTS(:,144).*STATES(:,38)).*CONSTANTS(:,5);
RATES(:,28) =  ((( CONSTANTS(:,140).*STATES(:,30).*STATES(:,38))./(CONSTANTS(:,141)+STATES(:,38)) - ( CONSTANTS(:,142).*STATES(:,28))./(CONSTANTS(:,143)+STATES(:,28))) -  CONSTANTS(:,145).*STATES(:,28)).*CONSTANTS(:,5);
RATES(:,39) =  (((CONSTANTS(:,146)+( CONSTANTS(:,147).*(CONSTANTS(:,148)+ CONSTANTS(:,149).*STATES(:,26)).*STATES(:,37))./(CONSTANTS(:,150)+STATES(:,37))) - ( CONSTANTS(:,151).*(STATES(:,30)+CONSTANTS(:,152)).*STATES(:,39))./(CONSTANTS(:,153)+STATES(:,39))) -  CONSTANTS(:,154).*STATES(:,39)).*CONSTANTS(:,5);
RATES(:,37) =  ((( CONSTANTS(:,151).*(STATES(:,30)+CONSTANTS(:,152)).*STATES(:,39))./(CONSTANTS(:,153)+STATES(:,39)) - ( CONSTANTS(:,147).*(CONSTANTS(:,148)+ CONSTANTS(:,149).*STATES(:,26)).*STATES(:,37))./(CONSTANTS(:,150)+STATES(:,37))) -  CONSTANTS(:,155).*STATES(:,37)).*CONSTANTS(:,5);
RATES(:,22) =  ((((CONSTANTS(:,156)+ CONSTANTS(:,157).*STATES(:,40)) - ( CONSTANTS(:,158).*(STATES(:,30)+CONSTANTS(:,159)).*STATES(:,22))./(CONSTANTS(:,160)+STATES(:,22)))+( CONSTANTS(:,161).*STATES(:,41))./(CONSTANTS(:,162)+STATES(:,41))) -  CONSTANTS(:,163).*STATES(:,22)).*CONSTANTS(:,5);
RATES(:,41) =  ((( CONSTANTS(:,158).*(STATES(:,30)+CONSTANTS(:,159)).*STATES(:,22))./(CONSTANTS(:,160)+STATES(:,22)) - ( CONSTANTS(:,161).*STATES(:,41))./(CONSTANTS(:,162)+STATES(:,41))) -  CONSTANTS(:,164).*STATES(:,41)).*CONSTANTS(:,5);
RATES(:,42) =  (((( CONSTANTS(:,165).*STATES(:,8).*(CONSTANTS(:,166) - STATES(:,42)))./(CONSTANTS(:,167)+(CONSTANTS(:,166) - STATES(:,42))) - ( CONSTANTS(:,168).*STATES(:,42))./(CONSTANTS(:,169)+STATES(:,42))) -  CONSTANTS(:,170).*(CONSTANTS(:,171) - STATES(:,43)).*STATES(:,42))+ CONSTANTS(:,172).*STATES(:,43)).*CONSTANTS(:,5);
RATES(:,43) =  ( CONSTANTS(:,170).*(CONSTANTS(:,171) - STATES(:,43)).*STATES(:,42) -  CONSTANTS(:,172).*STATES(:,43)).*CONSTANTS(:,5);
RATES(:,44) =  ((( CONSTANTS(:,173).*STATES(:,43) -  CONSTANTS(:,174).*STATES(:,44)) -  CONSTANTS(:,175).*(CONSTANTS(:,176) - STATES(:,45)).*STATES(:,44))+ CONSTANTS(:,177).*STATES(:,45)).*CONSTANTS(:,5);
RATES(:,45) =  ( CONSTANTS(:,175).*(CONSTANTS(:,176) - STATES(:,45)).*STATES(:,44) -  CONSTANTS(:,177).*STATES(:,45)).*CONSTANTS(:,5);
RATES(:,26) =  (( CONSTANTS(:,178).*STATES(:,45).*(CONSTANTS(:,179) - STATES(:,26)))./(CONSTANTS(:,180)+(CONSTANTS(:,179) - STATES(:,26))) - ( CONSTANTS(:,181).*STATES(:,26))./(CONSTANTS(:,182)+STATES(:,26))).*CONSTANTS(:,5);
RATES(:,40) = ( CONSTANTS(:,183).*power(STATES(:,46), CONSTANTS(:,184)))./(power(CONSTANTS(:,185), CONSTANTS(:,184))+power(STATES(:,46), CONSTANTS(:,184))) - ( CONSTANTS(:,186).*STATES(:,40))./(CONSTANTS(:,187)+STATES(:,40));
RATES(:,47) =  ( CONSTANTS(:,188).*STATES(:,11).*((CONSTANTS(:,189) - STATES(:,47))./(CONSTANTS(:,190)+(CONSTANTS(:,189) - STATES(:,47)))) -  CONSTANTS(:,191).*(STATES(:,47)./(CONSTANTS(:,192)+STATES(:,47)))).*CONSTANTS(:,5);
RATES(:,48) =  (((( CONSTANTS(:,125).*STATES(:,47).*1.00000 -  CONSTANTS(:,126).*STATES(:,48).*(CONSTANTS(:,127) - (STATES(:,36)+STATES(:,30)+STATES(:,31))))+ CONSTANTS(:,128).*STATES(:,36)) -  CONSTANTS(:,129).*(STATES(:,48)./(CONSTANTS(:,130)+STATES(:,48))).*(STATES(:,28)./(CONSTANTS(:,131)+STATES(:,28))+STATES(:,24)./(CONSTANTS(:,132)+STATES(:,24)))) -  CONSTANTS(:,133).*STATES(:,48)).*CONSTANTS(:,5);
RATES(:,49) = ( CONSTANTS(:,193).*power(STATES(:,46), CONSTANTS(:,198)))./(power(CONSTANTS(:,196), CONSTANTS(:,198))+power(STATES(:,46), CONSTANTS(:,198))) - (( CONSTANTS(:,194).*STATES(:,49))./(CONSTANTS(:,197)+STATES(:,49))+ CONSTANTS(:,195).*STATES(:,49));
RATES(:,50) = ( CONSTANTS(:,199).*power(STATES(:,46), CONSTANTS(:,198)))./(power(CONSTANTS(:,202), CONSTANTS(:,198))+power(STATES(:,46), CONSTANTS(:,198))) - (( CONSTANTS(:,200).*STATES(:,50))./(CONSTANTS(:,203)+STATES(:,50))+ CONSTANTS(:,201).*STATES(:,50));
RATES(:,51) = ( CONSTANTS(:,204).*power(CONSTANTS(:,207), CONSTANTS(:,209)))./(power(CONSTANTS(:,207), CONSTANTS(:,209))+power(STATES(:,52), CONSTANTS(:,209))) - (( CONSTANTS(:,205).*STATES(:,51))./(CONSTANTS(:,208)+STATES(:,51))+ CONSTANTS(:,206).*STATES(:,51));
RATES(:,53) = ( CONSTANTS(:,210).*power(STATES(:,46), CONSTANTS(:,215)))./(power(CONSTANTS(:,213), CONSTANTS(:,215))+power(STATES(:,46), CONSTANTS(:,215))) - (( CONSTANTS(:,211).*STATES(:,53))./(CONSTANTS(:,214)+STATES(:,53))+ CONSTANTS(:,212).*STATES(:,53));
RATES(:,54) = ( CONSTANTS(:,216).*STATES(:,49)+( CONSTANTS(:,223).*STATES(:,55))./(CONSTANTS(:,218)+STATES(:,55))+ CONSTANTS(:,220).*STATES(:,56)) - (( CONSTANTS(:,222).*STATES(:,54))./(CONSTANTS(:,217)+STATES(:,54))+ CONSTANTS(:,219).*STATES(:,54).*STATES(:,57)+ CONSTANTS(:,221).*STATES(:,54));
RATES(:,57) = ( CONSTANTS(:,224).*STATES(:,50)+( CONSTANTS(:,227).*STATES(:,58))./(CONSTANTS(:,218)+STATES(:,58))+ CONSTANTS(:,220).*STATES(:,56)) - (( CONSTANTS(:,226).*STATES(:,57))./(CONSTANTS(:,217)+STATES(:,57))+ CONSTANTS(:,219).*STATES(:,54).*STATES(:,57)+ CONSTANTS(:,225).*STATES(:,57));
RATES(:,59) = ( CONSTANTS(:,228).*STATES(:,53)+ CONSTANTS(:,231).*STATES(:,52)) - ( CONSTANTS(:,230).*STATES(:,59)+( CONSTANTS(:,232).*STATES(:,59))./(CONSTANTS(:,229)+STATES(:,59))+ CONSTANTS(:,221).*STATES(:,59));
RATES(:,55) = ( CONSTANTS(:,222).*STATES(:,54))./(CONSTANTS(:,217)+STATES(:,54)) - (( CONSTANTS(:,223).*STATES(:,55))./(CONSTANTS(:,218)+STATES(:,55))+( CONSTANTS(:,233).*STATES(:,55))./(CONSTANTS(:,229)+STATES(:,55))+ CONSTANTS(:,221).*STATES(:,55));
RATES(:,58) = ( CONSTANTS(:,226).*STATES(:,57))./(CONSTANTS(:,217)+STATES(:,57)) - (( CONSTANTS(:,227).*STATES(:,58))./(CONSTANTS(:,218)+STATES(:,58))+( CONSTANTS(:,234).*STATES(:,58))./(CONSTANTS(:,229)+STATES(:,58))+ CONSTANTS(:,221).*STATES(:,58));
RATES(:,56) = (( CONSTANTS(:,238).*STATES(:,60))./(CONSTANTS(:,218)+STATES(:,60))+ CONSTANTS(:,219).*STATES(:,54).*STATES(:,57)+ CONSTANTS(:,236).*STATES(:,61)) - (( CONSTANTS(:,237).*STATES(:,56))./(CONSTANTS(:,217)+STATES(:,56))+ CONSTANTS(:,220).*STATES(:,56)+ CONSTANTS(:,235).*STATES(:,56)+ CONSTANTS(:,221).*STATES(:,56));
RATES(:,61) = (( CONSTANTS(:,242).*STATES(:,62))./(CONSTANTS(:,218)+STATES(:,62))+ CONSTANTS(:,235).*STATES(:,56)+ CONSTANTS(:,240).*STATES(:,63)) - (( CONSTANTS(:,241).*STATES(:,61))./(CONSTANTS(:,217)+STATES(:,61))+ CONSTANTS(:,236).*STATES(:,61)+ CONSTANTS(:,239).*STATES(:,46).*STATES(:,61)+ CONSTANTS(:,221).*STATES(:,61));
RATES(:,52) =  CONSTANTS(:,230).*STATES(:,59) - ( CONSTANTS(:,231).*STATES(:,52)+( CONSTANTS(:,243).*STATES(:,52))./(CONSTANTS(:,229)+STATES(:,52))+ CONSTANTS(:,221).*STATES(:,52));
RATES(:,60) = ( CONSTANTS(:,237).*STATES(:,56))./(CONSTANTS(:,217)+STATES(:,56)) - (( CONSTANTS(:,238).*STATES(:,60))./(CONSTANTS(:,218)+STATES(:,60))+( CONSTANTS(:,244).*STATES(:,60))./(CONSTANTS(:,229)+STATES(:,60))+ CONSTANTS(:,221).*STATES(:,60));
RATES(:,62) = ( CONSTANTS(:,241).*STATES(:,61))./(CONSTANTS(:,217)+STATES(:,61)) - (( CONSTANTS(:,242).*STATES(:,62))./(CONSTANTS(:,218)+STATES(:,62))+( CONSTANTS(:,245).*STATES(:,62))./(CONSTANTS(:,229)+STATES(:,62))+ CONSTANTS(:,221).*STATES(:,62));
RATES(:,64) = (( CONSTANTS(:,250).*STATES(:,65))./(CONSTANTS(:,218)+STATES(:,65))+ CONSTANTS(:,248).*STATES(:,46)+ CONSTANTS(:,246).*STATES(:,51)) - (( CONSTANTS(:,249).*STATES(:,64))./(CONSTANTS(:,217)+STATES(:,64))+ CONSTANTS(:,247).*STATES(:,64)+ CONSTANTS(:,221).*STATES(:,64));
RATES(:,65) = ( CONSTANTS(:,249).*STATES(:,64))./(CONSTANTS(:,217)+STATES(:,64)) - (( CONSTANTS(:,250).*STATES(:,65))./(CONSTANTS(:,218)+STATES(:,65))+( CONSTANTS(:,251).*STATES(:,65))./(CONSTANTS(:,229)+STATES(:,65))+ CONSTANTS(:,221).*STATES(:,65));
RATES(:,46) = (( CONSTANTS(:,253).*STATES(:,66))./(CONSTANTS(:,218)+STATES(:,66))+ CONSTANTS(:,247).*STATES(:,64)+ CONSTANTS(:,240).*STATES(:,63)) - (( CONSTANTS(:,252).*STATES(:,46))./(CONSTANTS(:,217)+STATES(:,46))+ CONSTANTS(:,248).*STATES(:,46)+ CONSTANTS(:,239).*STATES(:,46).*STATES(:,61)+ CONSTANTS(:,221).*STATES(:,46));
RATES(:,66) = ( CONSTANTS(:,252).*STATES(:,46))./(CONSTANTS(:,217)+STATES(:,46)) - (( CONSTANTS(:,253).*STATES(:,66))./(CONSTANTS(:,218)+STATES(:,66))+( CONSTANTS(:,254).*STATES(:,66))./(CONSTANTS(:,229)+STATES(:,66))+ CONSTANTS(:,221).*STATES(:,66));
RATES(:,63) =  CONSTANTS(:,239).*STATES(:,46).*STATES(:,61) - ( CONSTANTS(:,240).*STATES(:,63)+( CONSTANTS(:,255).*STATES(:,63))./(CONSTANTS(:,229)+STATES(:,63))+ CONSTANTS(:,221).*STATES(:,63));
RATES = RATES';
end

% Calculate algebraic variables
function ALGEBRAIC = computeAlgebraic(ALGEBRAIC, CONSTANTS, STATES, VOI)
statesSize = size(STATES);
statesColumnCount = statesSize(2);
if ( statesColumnCount == 1)
STATES = STATES';
utilOnes = 1;
else
statesRowCount = statesSize(1);
utilOnes = ones(statesRowCount, 1);
end
end

% Pad out or shorten strings to a set length
req_length = 160;
insize = size(strin,2);
if insize > req_length
strout = strin(1:req_length);
else
strout = [strin, blanks(req_length - insize)];
end
end

```
Source
Derived from workspace Gerard and Goldbeter 2009 at changeset 3b84cd0d62e5.
Collaboration
To begin collaborating on this work, please use your git client and issue this command: