# 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 =105;
end
% There are a total of 45 entries in each of the rate and state variable arrays.
% There are a total of 154 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 (second)');
LEGEND_CONSTANTS(:,1) = strpad('k0B_on in component JCaM_DYAD_SL (second_order_rate_constant)');
LEGEND_CONSTANTS(:,2) = strpad('k0B_off in component JCaM_DYAD_SL (first_order_rate_constant)');
LEGEND_STATES(:,1) = strpad('CaM in component CaM (micromolar)');
LEGEND_ALGEBRAIC(:,31) = strpad('B in component B (micromolar)');
LEGEND_STATES(:,2) = strpad('CaM in component CaM (micromolar)');
LEGEND_CONSTANTS(:,3) = strpad('k2B_on in component JCa2CaM_DYAD_SL (second_order_rate_constant)');
LEGEND_CONSTANTS(:,4) = strpad('k2B_off in component JCa2CaM_DYAD_SL (first_order_rate_constant)');
LEGEND_STATES(:,3) = strpad('Ca2CaM in component Ca2CaM (micromolar)');
LEGEND_STATES(:,4) = strpad('Ca2CaM in component Ca2CaM (micromolar)');
LEGEND_CONSTANTS(:,5) = strpad('k4B_on in component JCa4CaM_DYAD_SL (second_order_rate_constant)');
LEGEND_CONSTANTS(:,6) = strpad('k4B_off in component JCa4CaM_DYAD_SL (first_order_rate_constant)');
LEGEND_STATES(:,5) = strpad('Ca4CaM in component Ca4CaM (micromolar)');
LEGEND_STATES(:,6) = strpad('Ca4CaM in component Ca4CaM (micromolar)');
LEGEND_ALGEBRAIC(:,2) = strpad('JCaM_SL_CYT in component JCaM_SL_CYT (micromole_per_second)');
LEGEND_CONSTANTS(:,7) = strpad('kSLCYT in component model_parameters (litre_per_second)');
LEGEND_STATES(:,7) = strpad('CaM in component CaM (micromolar)');
LEGEND_ALGEBRAIC(:,3) = strpad('JCa2CaM_SL_CYT in component JCa2CaM_SL_CYT (micromole_per_second)');
LEGEND_STATES(:,8) = strpad('Ca2CaM in component Ca2CaM (micromolar)');
LEGEND_ALGEBRAIC(:,4) = strpad('JCa4CaM_SL_CYT in component JCa4CaM_SL_CYT (micromole_per_second)');
LEGEND_STATES(:,9) = strpad('Ca4CaM in component Ca4CaM (micromolar)');
LEGEND_ALGEBRAIC(:,1) = strpad('Reaction_02 in component Reaction_02 (flux)');
LEGEND_CONSTANTS(:,131) = strpad('k02 in component Reaction_02 (third_order_rate_constant)');
LEGEND_CONSTANTS(:,8) = strpad('k20 in component Reaction_02 (first_order_rate_constant)');
LEGEND_CONSTANTS(:,110) = strpad('Kd02 in component Reaction_02 (micromolar2)');
LEGEND_CONSTANTS(:,9) = strpad('K in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,10) = strpad('Mg in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,11) = strpad('Ca in component model_parameters (micromolar)');
LEGEND_ALGEBRAIC(:,22) = strpad('Reaction_24 in component Reaction_24 (flux)');
LEGEND_CONSTANTS(:,132) = strpad('k24 in component Reaction_24 (third_order_rate_constant)');
LEGEND_CONSTANTS(:,12) = strpad('k42 in component Reaction_24 (first_order_rate_constant)');
LEGEND_CONSTANTS(:,111) = strpad('Kd24 in component Reaction_24 (micromolar2)');
LEGEND_ALGEBRAIC(:,25) = strpad('Reaction_02B in component Reaction_02B (flux)');
LEGEND_CONSTANTS(:,137) = strpad('k02B in component Reaction_02B (third_order_rate_constant)');
LEGEND_CONSTANTS(:,13) = strpad('k20B in component Reaction_02B (first_order_rate_constant)');
LEGEND_STATES(:,10) = strpad('CaMB in component CaMB (micromolar)');
LEGEND_STATES(:,11) = strpad('Ca2CaMB in component Ca2CaMB (micromolar)');
LEGEND_ALGEBRAIC(:,28) = strpad('Reaction_24B in component Reaction_24B (flux)');
LEGEND_CONSTANTS(:,138) = strpad('k24B in component Reaction_24B (third_order_rate_constant)');
LEGEND_CONSTANTS(:,112) = strpad('k42B in component Reaction_24B (first_order_rate_constant)');
LEGEND_STATES(:,12) = strpad('Ca4CaMB in component Ca4CaMB (micromolar)');
LEGEND_ALGEBRAIC(:,37) = strpad('Reaction_2B in component Reaction_2B (flux)');
LEGEND_CONSTANTS(:,14) = strpad('k2B_on in component Reaction_2B (second_order_rate_constant)');
LEGEND_CONSTANTS(:,15) = strpad('k2B_off in component Reaction_2B (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,40) = strpad('Reaction_0B in component Reaction_0B (flux)');
LEGEND_CONSTANTS(:,16) = strpad('k0B_on in component Reaction_0B (second_order_rate_constant)');
LEGEND_CONSTANTS(:,17) = strpad('k0B_off in component Reaction_0B (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,43) = strpad('Reaction_4B in component Reaction_4B (flux)');
LEGEND_CONSTANTS(:,18) = strpad('k4B_on in component Reaction_4B (second_order_rate_constant)');
LEGEND_CONSTANTS(:,19) = strpad('k4B_off in component Reaction_4B (first_order_rate_constant)');
LEGEND_CONSTANTS(:,20) = strpad('Btot in component B (micromolar)');
LEGEND_ALGEBRAIC(:,103) = strpad('Reaction_0CaN in component Reaction_0CaN (flux)');
LEGEND_CONSTANTS(:,21) = strpad('CaMKIItot in component model_parameters (micromolar)');
LEGEND_ALGEBRAIC(:,97) = strpad('Reaction_2CaN in component Reaction_2CaN (flux)');
LEGEND_ALGEBRAIC(:,76) = strpad('Reaction_CKt2a in component Reaction_CKt2a (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,61) = strpad('Reaction_CKib2 in component Reaction_CKib2 (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,100) = strpad('Reaction_4CaN in component Reaction_4CaN (flux)');
LEGEND_ALGEBRAIC(:,73) = strpad('Reaction_CKta in component Reaction_CKta (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,67) = strpad('Reaction_CKib in component Reaction_CKib (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,50) = strpad('CaMKIIi in component CaMKIIi (micromolar)');
LEGEND_ALGEBRAIC(:,46) = strpad('Pi in component Pi (dimensionless)');
LEGEND_ALGEBRAIC(:,5) = strpad('CaMKIIb2 in component CaMKIIb2 (micromolar)');
LEGEND_STATES(:,13) = strpad('Pb2 in component Pb2 (dimensionless)');
LEGEND_ALGEBRAIC(:,6) = strpad('CaMKIIb in component CaMKIIb (micromolar)');
LEGEND_STATES(:,14) = strpad('Pb in component Pb (dimensionless)');
LEGEND_ALGEBRAIC(:,7) = strpad('CaMKIIt in component CaMKIIt (micromolar)');
LEGEND_STATES(:,15) = strpad('Pt in component Pt (dimensionless)');
LEGEND_ALGEBRAIC(:,8) = strpad('CaMKIIt2 in component CaMKIIt2 (micromolar)');
LEGEND_STATES(:,16) = strpad('Pt2 in component Pt2 (dimensionless)');
LEGEND_ALGEBRAIC(:,9) = strpad('CaMKIIa in component CaMKIIa (micromolar)');
LEGEND_STATES(:,17) = strpad('Pa in component Pa (dimensionless)');
LEGEND_ALGEBRAIC(:,49) = strpad('T in component T (dimensionless)');
LEGEND_ALGEBRAIC(:,58) = strpad('Reaction_CKbt in component Reaction_CKbt (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,55) = strpad('kbt in component Reaction_CKbt (first_order_rate_constant)');
LEGEND_CONSTANTS(:,22) = strpad('kPP1 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,23) = strpad('KmPP1 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,24) = strpad('PP1tot in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,25) = strpad('kib2 in component Reaction_CKib2 (second_order_rate_constant)');
LEGEND_CONSTANTS(:,26) = strpad('kb2i in component Reaction_CKib2 (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,64) = strpad('Reaction_CKb2b in component Reaction_CKb2b (first_order_rate_constant)');
LEGEND_CONSTANTS(:,139) = strpad('kb24 in component Reaction_CKb2b (third_order_rate_constant)');
LEGEND_CONSTANTS(:,113) = strpad('kb42 in component Reaction_CKb2b (first_order_rate_constant)');
LEGEND_CONSTANTS(:,27) = strpad('kib in component Reaction_CKib (second_order_rate_constant)');
LEGEND_CONSTANTS(:,28) = strpad('kbi in component Reaction_CKib (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,70) = strpad('Reaction_CKtt2 in component Reaction_CKtt2 (first_order_rate_constant)');
LEGEND_CONSTANTS(:,140) = strpad('kt24 in component Reaction_CKtt2 (third_order_rate_constant)');
LEGEND_CONSTANTS(:,114) = strpad('kt42 in component Reaction_CKtt2 (first_order_rate_constant)');
LEGEND_CONSTANTS(:,29) = strpad('kat in component Reaction_CKta (second_order_rate_constant)');
LEGEND_CONSTANTS(:,30) = strpad('kta in component Reaction_CKta (first_order_rate_constant)');
LEGEND_CONSTANTS(:,31) = strpad('kat2 in component Reaction_CKt2a (second_order_rate_constant)');
LEGEND_CONSTANTS(:,32) = strpad('kt2a in component Reaction_CKt2a (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,80) = strpad('Reaction_CKt2b2 in component Reaction_CKt2b2 (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,81) = strpad('Reaction_CKai in component Reaction_CKai (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,79) = strpad('Ca2CaN in component Ca2CaN (micromolar)');
LEGEND_CONSTANTS(:,33) = strpad('CaNtot in component Ca2CaN (micromolar)');
LEGEND_STATES(:,18) = strpad('Ca4CaN in component Ca4CaN (micromolar)');
LEGEND_STATES(:,19) = strpad('CaMCaN in component CaMCaN (micromolar)');
LEGEND_STATES(:,20) = strpad('Ca2CaMCaN in component Ca2CaMCaN (micromolar)');
LEGEND_STATES(:,21) = strpad('Ca4CaMCaN in component Ca4CaMCaN (micromolar)');
LEGEND_ALGEBRAIC(:,88) = strpad('Reaction_Ca4CaN in component Reaction_Ca4CaN (flux)');
LEGEND_CONSTANTS(:,34) = strpad('kCaNCa_on in component Reaction_Ca4CaN (third_order_rate_constant)');
LEGEND_CONSTANTS(:,35) = strpad('kCaNCa_off in component Reaction_Ca4CaN (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,91) = strpad('Reaction_02CaN in component Reaction_02CaN (flux)');
LEGEND_CONSTANTS(:,141) = strpad('k02CaN in component Reaction_02CaN (third_order_rate_constant)');
LEGEND_CONSTANTS(:,115) = strpad('k20CaN in component Reaction_02CaN (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,94) = strpad('Reaction_24CaN in component Reaction_24CaN (flux)');
LEGEND_CONSTANTS(:,142) = strpad('k24CaN in component Reaction_24CaN (third_order_rate_constant)');
LEGEND_CONSTANTS(:,116) = strpad('k42CaN in component Reaction_24CaN (first_order_rate_constant)');
LEGEND_CONSTANTS(:,36) = strpad('kCaN2_on in component Reaction_2CaN (second_order_rate_constant)');
LEGEND_CONSTANTS(:,37) = strpad('kCaN2_off in component Reaction_2CaN (first_order_rate_constant)');
LEGEND_CONSTANTS(:,38) = strpad('kCaN4_on in component Reaction_4CaN (second_order_rate_constant)');
LEGEND_CONSTANTS(:,39) = strpad('kCaN4_off in component Reaction_4CaN (first_order_rate_constant)');
LEGEND_CONSTANTS(:,40) = strpad('kCaN0_on in component Reaction_0CaN (second_order_rate_constant)');
LEGEND_CONSTANTS(:,41) = strpad('kCaN0_off in component Reaction_0CaN (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,10) = strpad('Reaction_02 in component Reaction_02 (flux)');
LEGEND_CONSTANTS(:,133) = strpad('k02 in component Reaction_02 (third_order_rate_constant)');
LEGEND_CONSTANTS(:,42) = strpad('k20 in component Reaction_02 (first_order_rate_constant)');
LEGEND_CONSTANTS(:,117) = strpad('Kd02 in component Reaction_02 (micromolar2)');
LEGEND_CONSTANTS(:,43) = strpad('K in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,44) = strpad('Mg in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,45) = strpad('Ca in component model_parameters (micromolar)');
LEGEND_ALGEBRAIC(:,23) = strpad('Reaction_24 in component Reaction_24 (flux)');
LEGEND_CONSTANTS(:,134) = strpad('k24 in component Reaction_24 (third_order_rate_constant)');
LEGEND_CONSTANTS(:,46) = strpad('k42 in component Reaction_24 (first_order_rate_constant)');
LEGEND_CONSTANTS(:,118) = strpad('Kd24 in component Reaction_24 (micromolar2)');
LEGEND_ALGEBRAIC(:,26) = strpad('Reaction_02B in component Reaction_02B (flux)');
LEGEND_CONSTANTS(:,143) = strpad('k02B in component Reaction_02B (third_order_rate_constant)');
LEGEND_CONSTANTS(:,47) = strpad('k20B in component Reaction_02B (first_order_rate_constant)');
LEGEND_STATES(:,22) = strpad('CaMB in component CaMB (micromolar)');
LEGEND_STATES(:,23) = strpad('Ca2CaMB in component Ca2CaMB (micromolar)');
LEGEND_ALGEBRAIC(:,29) = strpad('Reaction_24B in component Reaction_24B (flux)');
LEGEND_CONSTANTS(:,144) = strpad('k24B in component Reaction_24B (third_order_rate_constant)');
LEGEND_CONSTANTS(:,119) = strpad('k42B in component Reaction_24B (first_order_rate_constant)');
LEGEND_STATES(:,24) = strpad('Ca4CaMB in component Ca4CaMB (micromolar)');
LEGEND_ALGEBRAIC(:,38) = strpad('Reaction_2B in component Reaction_2B (flux)');
LEGEND_CONSTANTS(:,48) = strpad('k2B_on in component Reaction_2B (second_order_rate_constant)');
LEGEND_CONSTANTS(:,49) = strpad('k2B_off in component Reaction_2B (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,32) = strpad('B in component B (micromolar)');
LEGEND_ALGEBRAIC(:,41) = strpad('Reaction_0B in component Reaction_0B (flux)');
LEGEND_CONSTANTS(:,50) = strpad('k0B_on in component Reaction_0B (second_order_rate_constant)');
LEGEND_CONSTANTS(:,51) = strpad('k0B_off in component Reaction_0B (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,44) = strpad('Reaction_4B in component Reaction_4B (flux)');
LEGEND_CONSTANTS(:,52) = strpad('k4B_on in component Reaction_4B (second_order_rate_constant)');
LEGEND_CONSTANTS(:,53) = strpad('k4B_off in component Reaction_4B (first_order_rate_constant)');
LEGEND_CONSTANTS(:,54) = strpad('Btot in component B (micromolar)');
LEGEND_ALGEBRAIC(:,104) = strpad('Reaction_0CaN in component Reaction_0CaN (flux)');
LEGEND_CONSTANTS(:,55) = strpad('CaMKIItot in component model_parameters (micromolar)');
LEGEND_ALGEBRAIC(:,98) = strpad('Reaction_2CaN in component Reaction_2CaN (flux)');
LEGEND_ALGEBRAIC(:,77) = strpad('Reaction_CKt2a in component Reaction_CKt2a (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,62) = strpad('Reaction_CKib2 in component Reaction_CKib2 (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,101) = strpad('Reaction_4CaN in component Reaction_4CaN (flux)');
LEGEND_ALGEBRAIC(:,74) = strpad('Reaction_CKta in component Reaction_CKta (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,68) = strpad('Reaction_CKib in component Reaction_CKib (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,52) = strpad('CaMKIIi in component CaMKIIi (micromolar)');
LEGEND_ALGEBRAIC(:,47) = strpad('Pi in component Pi (dimensionless)');
LEGEND_ALGEBRAIC(:,11) = strpad('CaMKIIb2 in component CaMKIIb2 (micromolar)');
LEGEND_STATES(:,25) = strpad('Pb2 in component Pb2 (dimensionless)');
LEGEND_ALGEBRAIC(:,12) = strpad('CaMKIIb in component CaMKIIb (micromolar)');
LEGEND_STATES(:,26) = strpad('Pb in component Pb (dimensionless)');
LEGEND_ALGEBRAIC(:,13) = strpad('CaMKIIt in component CaMKIIt (micromolar)');
LEGEND_STATES(:,27) = strpad('Pt in component Pt (dimensionless)');
LEGEND_ALGEBRAIC(:,14) = strpad('CaMKIIt2 in component CaMKIIt2 (micromolar)');
LEGEND_STATES(:,28) = strpad('Pt2 in component Pt2 (dimensionless)');
LEGEND_ALGEBRAIC(:,15) = strpad('CaMKIIa in component CaMKIIa (micromolar)');
LEGEND_STATES(:,29) = strpad('Pa in component Pa (dimensionless)');
LEGEND_ALGEBRAIC(:,51) = strpad('T in component T (dimensionless)');
LEGEND_ALGEBRAIC(:,59) = strpad('Reaction_CKbt in component Reaction_CKbt (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,56) = strpad('kbt in component Reaction_CKbt (first_order_rate_constant)');
LEGEND_CONSTANTS(:,56) = strpad('kPP1 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,57) = strpad('KmPP1 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,58) = strpad('PP1tot in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,59) = strpad('kib2 in component Reaction_CKib2 (second_order_rate_constant)');
LEGEND_CONSTANTS(:,60) = strpad('kb2i in component Reaction_CKib2 (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,65) = strpad('Reaction_CKb2b in component Reaction_CKb2b (first_order_rate_constant)');
LEGEND_CONSTANTS(:,145) = strpad('kb24 in component Reaction_CKb2b (third_order_rate_constant)');
LEGEND_CONSTANTS(:,120) = strpad('kb42 in component Reaction_CKb2b (first_order_rate_constant)');
LEGEND_CONSTANTS(:,61) = strpad('kib in component Reaction_CKib (second_order_rate_constant)');
LEGEND_CONSTANTS(:,62) = strpad('kbi in component Reaction_CKib (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,71) = strpad('Reaction_CKtt2 in component Reaction_CKtt2 (first_order_rate_constant)');
LEGEND_CONSTANTS(:,146) = strpad('kt24 in component Reaction_CKtt2 (third_order_rate_constant)');
LEGEND_CONSTANTS(:,121) = strpad('kt42 in component Reaction_CKtt2 (first_order_rate_constant)');
LEGEND_CONSTANTS(:,63) = strpad('kat in component Reaction_CKta (second_order_rate_constant)');
LEGEND_CONSTANTS(:,64) = strpad('kta in component Reaction_CKta (first_order_rate_constant)');
LEGEND_CONSTANTS(:,65) = strpad('kat2 in component Reaction_CKt2a (second_order_rate_constant)');
LEGEND_CONSTANTS(:,66) = strpad('kt2a in component Reaction_CKt2a (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,83) = strpad('Reaction_CKt2b2 in component Reaction_CKt2b2 (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,84) = strpad('Reaction_CKai in component Reaction_CKai (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,82) = strpad('Ca2CaN in component Ca2CaN (micromolar)');
LEGEND_CONSTANTS(:,67) = strpad('CaNtot in component Ca2CaN (micromolar)');
LEGEND_STATES(:,30) = strpad('Ca4CaN in component Ca4CaN (micromolar)');
LEGEND_STATES(:,31) = strpad('CaMCaN in component CaMCaN (micromolar)');
LEGEND_STATES(:,32) = strpad('Ca2CaMCaN in component Ca2CaMCaN (micromolar)');
LEGEND_STATES(:,33) = strpad('Ca4CaMCaN in component Ca4CaMCaN (micromolar)');
LEGEND_ALGEBRAIC(:,89) = strpad('Reaction_Ca4CaN in component Reaction_Ca4CaN (flux)');
LEGEND_CONSTANTS(:,68) = strpad('kCaNCa_on in component Reaction_Ca4CaN (third_order_rate_constant)');
LEGEND_CONSTANTS(:,69) = strpad('kCaNCa_off in component Reaction_Ca4CaN (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,92) = strpad('Reaction_02CaN in component Reaction_02CaN (flux)');
LEGEND_CONSTANTS(:,147) = strpad('k02CaN in component Reaction_02CaN (third_order_rate_constant)');
LEGEND_CONSTANTS(:,122) = strpad('k20CaN in component Reaction_02CaN (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,95) = strpad('Reaction_24CaN in component Reaction_24CaN (flux)');
LEGEND_CONSTANTS(:,148) = strpad('k24CaN in component Reaction_24CaN (third_order_rate_constant)');
LEGEND_CONSTANTS(:,123) = strpad('k42CaN in component Reaction_24CaN (first_order_rate_constant)');
LEGEND_CONSTANTS(:,70) = strpad('kCaN2_on in component Reaction_2CaN (second_order_rate_constant)');
LEGEND_CONSTANTS(:,71) = strpad('kCaN2_off in component Reaction_2CaN (first_order_rate_constant)');
LEGEND_CONSTANTS(:,72) = strpad('kCaN4_on in component Reaction_4CaN (second_order_rate_constant)');
LEGEND_CONSTANTS(:,73) = strpad('kCaN4_off in component Reaction_4CaN (first_order_rate_constant)');
LEGEND_CONSTANTS(:,74) = strpad('kCaN0_on in component Reaction_0CaN (second_order_rate_constant)');
LEGEND_CONSTANTS(:,75) = strpad('kCaN0_off in component Reaction_0CaN (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,16) = strpad('Reaction_02 in component Reaction_02 (flux)');
LEGEND_CONSTANTS(:,135) = strpad('k02 in component Reaction_02 (third_order_rate_constant)');
LEGEND_CONSTANTS(:,76) = strpad('k20 in component Reaction_02 (first_order_rate_constant)');
LEGEND_CONSTANTS(:,124) = strpad('Kd02 in component Reaction_02 (micromolar2)');
LEGEND_CONSTANTS(:,77) = strpad('K in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,78) = strpad('Mg in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,79) = strpad('Ca in component model_parameters (micromolar)');
LEGEND_ALGEBRAIC(:,24) = strpad('Reaction_24 in component Reaction_24 (flux)');
LEGEND_CONSTANTS(:,136) = strpad('k24 in component Reaction_24 (third_order_rate_constant)');
LEGEND_CONSTANTS(:,80) = strpad('k42 in component Reaction_24 (first_order_rate_constant)');
LEGEND_CONSTANTS(:,125) = strpad('Kd24 in component Reaction_24 (micromolar2)');
LEGEND_ALGEBRAIC(:,27) = strpad('Reaction_02B in component Reaction_02B (flux)');
LEGEND_CONSTANTS(:,149) = strpad('k02B in component Reaction_02B (third_order_rate_constant)');
LEGEND_CONSTANTS(:,81) = strpad('k20B in component Reaction_02B (first_order_rate_constant)');
LEGEND_STATES(:,34) = strpad('CaMB in component CaMB (micromolar)');
LEGEND_STATES(:,35) = strpad('Ca2CaMB in component Ca2CaMB (micromolar)');
LEGEND_ALGEBRAIC(:,30) = strpad('Reaction_24B in component Reaction_24B (flux)');
LEGEND_CONSTANTS(:,150) = strpad('k24B in component Reaction_24B (third_order_rate_constant)');
LEGEND_CONSTANTS(:,126) = strpad('k42B in component Reaction_24B (first_order_rate_constant)');
LEGEND_STATES(:,36) = strpad('Ca4CaMB in component Ca4CaMB (micromolar)');
LEGEND_ALGEBRAIC(:,39) = strpad('Reaction_2B in component Reaction_2B (flux)');
LEGEND_CONSTANTS(:,82) = strpad('k2B_on in component Reaction_2B (second_order_rate_constant)');
LEGEND_CONSTANTS(:,83) = strpad('k2B_off in component Reaction_2B (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,33) = strpad('B in component B (micromolar)');
LEGEND_ALGEBRAIC(:,42) = strpad('Reaction_0B in component Reaction_0B (flux)');
LEGEND_CONSTANTS(:,84) = strpad('k0B_on in component Reaction_0B (second_order_rate_constant)');
LEGEND_CONSTANTS(:,85) = strpad('k0B_off in component Reaction_0B (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,45) = strpad('Reaction_4B in component Reaction_4B (flux)');
LEGEND_CONSTANTS(:,86) = strpad('k4B_on in component Reaction_4B (second_order_rate_constant)');
LEGEND_CONSTANTS(:,87) = strpad('k4B_off in component Reaction_4B (first_order_rate_constant)');
LEGEND_CONSTANTS(:,88) = strpad('Btot in component B (micromolar)');
LEGEND_ALGEBRAIC(:,105) = strpad('Reaction_0CaN in component Reaction_0CaN (flux)');
LEGEND_CONSTANTS(:,89) = strpad('CaMKIItot in component model_parameters (micromolar)');
LEGEND_ALGEBRAIC(:,99) = strpad('Reaction_2CaN in component Reaction_2CaN (flux)');
LEGEND_ALGEBRAIC(:,78) = strpad('Reaction_CKt2a in component Reaction_CKt2a (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,63) = strpad('Reaction_CKib2 in component Reaction_CKib2 (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,102) = strpad('Reaction_4CaN in component Reaction_4CaN (flux)');
LEGEND_ALGEBRAIC(:,75) = strpad('Reaction_CKta in component Reaction_CKta (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,69) = strpad('Reaction_CKib in component Reaction_CKib (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,54) = strpad('CaMKIIi in component CaMKIIi (micromolar)');
LEGEND_ALGEBRAIC(:,48) = strpad('Pi in component Pi (dimensionless)');
LEGEND_ALGEBRAIC(:,17) = strpad('CaMKIIb2 in component CaMKIIb2 (micromolar)');
LEGEND_STATES(:,37) = strpad('Pb2 in component Pb2 (dimensionless)');
LEGEND_ALGEBRAIC(:,18) = strpad('CaMKIIb in component CaMKIIb (micromolar)');
LEGEND_STATES(:,38) = strpad('Pb in component Pb (dimensionless)');
LEGEND_ALGEBRAIC(:,19) = strpad('CaMKIIt in component CaMKIIt (micromolar)');
LEGEND_STATES(:,39) = strpad('Pt in component Pt (dimensionless)');
LEGEND_ALGEBRAIC(:,20) = strpad('CaMKIIt2 in component CaMKIIt2 (micromolar)');
LEGEND_STATES(:,40) = strpad('Pt2 in component Pt2 (dimensionless)');
LEGEND_ALGEBRAIC(:,21) = strpad('CaMKIIa in component CaMKIIa (micromolar)');
LEGEND_STATES(:,41) = strpad('Pa in component Pa (dimensionless)');
LEGEND_ALGEBRAIC(:,53) = strpad('T in component T (dimensionless)');
LEGEND_ALGEBRAIC(:,60) = strpad('Reaction_CKbt in component Reaction_CKbt (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,57) = strpad('kbt in component Reaction_CKbt (first_order_rate_constant)');
LEGEND_CONSTANTS(:,90) = strpad('kPP1 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,91) = strpad('KmPP1 in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,92) = strpad('PP1tot in component model_parameters (micromolar)');
LEGEND_CONSTANTS(:,93) = strpad('kib2 in component Reaction_CKib2 (second_order_rate_constant)');
LEGEND_CONSTANTS(:,94) = strpad('kb2i in component Reaction_CKib2 (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,66) = strpad('Reaction_CKb2b in component Reaction_CKb2b (first_order_rate_constant)');
LEGEND_CONSTANTS(:,151) = strpad('kb24 in component Reaction_CKb2b (third_order_rate_constant)');
LEGEND_CONSTANTS(:,127) = strpad('kb42 in component Reaction_CKb2b (first_order_rate_constant)');
LEGEND_CONSTANTS(:,95) = strpad('kib in component Reaction_CKib (second_order_rate_constant)');
LEGEND_CONSTANTS(:,96) = strpad('kbi in component Reaction_CKib (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,72) = strpad('Reaction_CKtt2 in component Reaction_CKtt2 (first_order_rate_constant)');
LEGEND_CONSTANTS(:,152) = strpad('kt24 in component Reaction_CKtt2 (third_order_rate_constant)');
LEGEND_CONSTANTS(:,128) = strpad('kt42 in component Reaction_CKtt2 (first_order_rate_constant)');
LEGEND_CONSTANTS(:,97) = strpad('kat in component Reaction_CKta (second_order_rate_constant)');
LEGEND_CONSTANTS(:,98) = strpad('kta in component Reaction_CKta (first_order_rate_constant)');
LEGEND_CONSTANTS(:,99) = strpad('kat2 in component Reaction_CKt2a (second_order_rate_constant)');
LEGEND_CONSTANTS(:,100) = strpad('kt2a in component Reaction_CKt2a (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,86) = strpad('Reaction_CKt2b2 in component Reaction_CKt2b2 (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,87) = strpad('Reaction_CKai in component Reaction_CKai (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,85) = strpad('Ca2CaN in component Ca2CaN (micromolar)');
LEGEND_CONSTANTS(:,101) = strpad('CaNtot in component Ca2CaN (micromolar)');
LEGEND_STATES(:,42) = strpad('Ca4CaN in component Ca4CaN (micromolar)');
LEGEND_STATES(:,43) = strpad('CaMCaN in component CaMCaN (micromolar)');
LEGEND_STATES(:,44) = strpad('Ca2CaMCaN in component Ca2CaMCaN (micromolar)');
LEGEND_STATES(:,45) = strpad('Ca4CaMCaN in component Ca4CaMCaN (micromolar)');
LEGEND_ALGEBRAIC(:,90) = strpad('Reaction_Ca4CaN in component Reaction_Ca4CaN (flux)');
LEGEND_CONSTANTS(:,102) = strpad('kCaNCa_on in component Reaction_Ca4CaN (third_order_rate_constant)');
LEGEND_CONSTANTS(:,103) = strpad('kCaNCa_off in component Reaction_Ca4CaN (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,93) = strpad('Reaction_02CaN in component Reaction_02CaN (flux)');
LEGEND_CONSTANTS(:,153) = strpad('k02CaN in component Reaction_02CaN (third_order_rate_constant)');
LEGEND_CONSTANTS(:,129) = strpad('k20CaN in component Reaction_02CaN (first_order_rate_constant)');
LEGEND_ALGEBRAIC(:,96) = strpad('Reaction_24CaN in component Reaction_24CaN (flux)');
LEGEND_CONSTANTS(:,154) = strpad('k24CaN in component Reaction_24CaN (third_order_rate_constant)');
LEGEND_CONSTANTS(:,130) = strpad('k42CaN in component Reaction_24CaN (first_order_rate_constant)');
LEGEND_CONSTANTS(:,104) = strpad('kCaN2_on in component Reaction_2CaN (second_order_rate_constant)');
LEGEND_CONSTANTS(:,105) = strpad('kCaN2_off in component Reaction_2CaN (first_order_rate_constant)');
LEGEND_CONSTANTS(:,106) = strpad('kCaN4_on in component Reaction_4CaN (second_order_rate_constant)');
LEGEND_CONSTANTS(:,107) = strpad('kCaN4_off in component Reaction_4CaN (first_order_rate_constant)');
LEGEND_CONSTANTS(:,108) = strpad('kCaN0_on in component Reaction_0CaN (second_order_rate_constant)');
LEGEND_CONSTANTS(:,109) = strpad('kCaN0_off in component Reaction_0CaN (first_order_rate_constant)');
LEGEND_RATES(:,1) = strpad('d/dt CaM in component CaM (micromolar)');
LEGEND_RATES(:,3) = strpad('d/dt Ca2CaM in component Ca2CaM (micromolar)');
LEGEND_RATES(:,5) = strpad('d/dt Ca4CaM in component Ca4CaM (micromolar)');
LEGEND_RATES(:,10) = strpad('d/dt CaMB in component CaMB (micromolar)');
LEGEND_RATES(:,11) = strpad('d/dt Ca2CaMB in component Ca2CaMB (micromolar)');
LEGEND_RATES(:,12) = strpad('d/dt Ca4CaMB in component Ca4CaMB (micromolar)');
LEGEND_RATES(:,13) = strpad('d/dt Pb2 in component Pb2 (dimensionless)');
LEGEND_RATES(:,14) = strpad('d/dt Pb in component Pb (dimensionless)');
LEGEND_RATES(:,15) = strpad('d/dt Pt in component Pt (dimensionless)');
LEGEND_RATES(:,16) = strpad('d/dt Pt2 in component Pt2 (dimensionless)');
LEGEND_RATES(:,17) = strpad('d/dt Pa in component Pa (dimensionless)');
LEGEND_RATES(:,18) = strpad('d/dt Ca4CaN in component Ca4CaN (micromolar)');
LEGEND_RATES(:,19) = strpad('d/dt CaMCaN in component CaMCaN (micromolar)');
LEGEND_RATES(:,20) = strpad('d/dt Ca2CaMCaN in component Ca2CaMCaN (micromolar)');
LEGEND_RATES(:,21) = strpad('d/dt Ca4CaMCaN in component Ca4CaMCaN (micromolar)');
LEGEND_RATES(:,2) = strpad('d/dt CaM in component CaM (micromolar)');
LEGEND_RATES(:,4) = strpad('d/dt Ca2CaM in component Ca2CaM (micromolar)');
LEGEND_RATES(:,6) = strpad('d/dt Ca4CaM in component Ca4CaM (micromolar)');
LEGEND_RATES(:,22) = strpad('d/dt CaMB in component CaMB (micromolar)');
LEGEND_RATES(:,23) = strpad('d/dt Ca2CaMB in component Ca2CaMB (micromolar)');
LEGEND_RATES(:,24) = strpad('d/dt Ca4CaMB in component Ca4CaMB (micromolar)');
LEGEND_RATES(:,25) = strpad('d/dt Pb2 in component Pb2 (dimensionless)');
LEGEND_RATES(:,26) = strpad('d/dt Pb in component Pb (dimensionless)');
LEGEND_RATES(:,27) = strpad('d/dt Pt in component Pt (dimensionless)');
LEGEND_RATES(:,28) = strpad('d/dt Pt2 in component Pt2 (dimensionless)');
LEGEND_RATES(:,29) = strpad('d/dt Pa in component Pa (dimensionless)');
LEGEND_RATES(:,30) = strpad('d/dt Ca4CaN in component Ca4CaN (micromolar)');
LEGEND_RATES(:,31) = strpad('d/dt CaMCaN in component CaMCaN (micromolar)');
LEGEND_RATES(:,32) = strpad('d/dt Ca2CaMCaN in component Ca2CaMCaN (micromolar)');
LEGEND_RATES(:,33) = strpad('d/dt Ca4CaMCaN in component Ca4CaMCaN (micromolar)');
LEGEND_RATES(:,7) = strpad('d/dt CaM in component CaM (micromolar)');
LEGEND_RATES(:,8) = strpad('d/dt Ca2CaM in component Ca2CaM (micromolar)');
LEGEND_RATES(:,9) = strpad('d/dt Ca4CaM in component Ca4CaM (micromolar)');
LEGEND_RATES(:,34) = strpad('d/dt CaMB in component CaMB (micromolar)');
LEGEND_RATES(:,35) = strpad('d/dt Ca2CaMB in component Ca2CaMB (micromolar)');
LEGEND_RATES(:,36) = strpad('d/dt Ca4CaMB in component Ca4CaMB (micromolar)');
LEGEND_RATES(:,37) = strpad('d/dt Pb2 in component Pb2 (dimensionless)');
LEGEND_RATES(:,38) = strpad('d/dt Pb in component Pb (dimensionless)');
LEGEND_RATES(:,39) = strpad('d/dt Pt in component Pt (dimensionless)');
LEGEND_RATES(:,40) = strpad('d/dt Pt2 in component Pt2 (dimensionless)');
LEGEND_RATES(:,41) = strpad('d/dt Pa in component Pa (dimensionless)');
LEGEND_RATES(:,42) = strpad('d/dt Ca4CaN in component Ca4CaN (micromolar)');
LEGEND_RATES(:,43) = strpad('d/dt CaMCaN in component CaMCaN (micromolar)');
LEGEND_RATES(:,44) = strpad('d/dt Ca2CaMCaN in component Ca2CaMCaN (micromolar)');
LEGEND_RATES(:,45) = strpad('d/dt Ca4CaMCaN in component Ca4CaMCaN (micromolar)');
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 = [];
CONSTANTS(:,1) = 0.007;
CONSTANTS(:,2) = 0.0014;
STATES(:,1) = 0.1;
STATES(:,2) = 0.1;
CONSTANTS(:,3) = 0.007;
CONSTANTS(:,4) = 0.000014;
STATES(:,3) = 0.1;
STATES(:,4) = 0.1;
CONSTANTS(:,5) = 0.007;
CONSTANTS(:,6) = 0.000014;
STATES(:,5) = 0.1;
STATES(:,6) = 0.1;
CONSTANTS(:,7) = 8.59E-12;
STATES(:,7) = 0.1;
STATES(:,8) = 0.1;
STATES(:,9) = 0.1;
CONSTANTS(:,8) = 10.0;
CONSTANTS(:,9) = 135;
CONSTANTS(:,10) = 1;
CONSTANTS(:,11) = 1;
CONSTANTS(:,12) = 500.0;
CONSTANTS(:,13) = 0.1;
STATES(:,10) = 0.1;
STATES(:,11) = 0.1;
STATES(:,12) = 0.1;
CONSTANTS(:,14) = 0.007;
CONSTANTS(:,15) = 0.000014;
CONSTANTS(:,16) = 0.007;
CONSTANTS(:,17) = 0.0014;
CONSTANTS(:,18) = 0.007;
CONSTANTS(:,19) = 0.000014;
CONSTANTS(:,20) = 1860.0;
CONSTANTS(:,21) = 120.0;
STATES(:,13) = 0.1;
STATES(:,14) = 0.1;
STATES(:,15) = 0.1;
STATES(:,16) = 0.1;
STATES(:,17) = 0.1;
CONSTANTS(:,22) = 1.72;
CONSTANTS(:,23) = 11.5;
CONSTANTS(:,24) = 96.5;
CONSTANTS(:,25) = 65.67;
CONSTANTS(:,26) = 328.36;
CONSTANTS(:,27) = 6.567;
CONSTANTS(:,28) = 2.2;
CONSTANTS(:,29) = 6.567;
CONSTANTS(:,30) = 0.0022;
CONSTANTS(:,31) = 6.567;
CONSTANTS(:,32) = 32.835;
CONSTANTS(:,33) = 3.62;
STATES(:,18) = 0.1;
STATES(:,19) = 0.1;
STATES(:,20) = 0.1;
STATES(:,21) = 0.1;
CONSTANTS(:,34) = 2.0;
CONSTANTS(:,35) = 1.0;
CONSTANTS(:,36) = 46.0;
CONSTANTS(:,37) = 3.2604;
CONSTANTS(:,38) = 46.0;
CONSTANTS(:,39) = 1.3E-3;
CONSTANTS(:,40) = 46.0;
CONSTANTS(:,41) = 537.966;
CONSTANTS(:,42) = 10.0;
CONSTANTS(:,43) = 135;
CONSTANTS(:,44) = 1;
CONSTANTS(:,45) = 1;
CONSTANTS(:,46) = 500.0;
CONSTANTS(:,47) = 0.1;
STATES(:,22) = 0.1;
STATES(:,23) = 0.1;
STATES(:,24) = 0.1;
CONSTANTS(:,48) = 0.007;
CONSTANTS(:,49) = 0.000014;
CONSTANTS(:,50) = 0.007;
CONSTANTS(:,51) = 0.0014;
CONSTANTS(:,52) = 0.007;
CONSTANTS(:,53) = 0.000014;
CONSTANTS(:,54) = 24.5;
CONSTANTS(:,55) = 0.2;
STATES(:,25) = 0.1;
STATES(:,26) = 0.1;
STATES(:,27) = 0.1;
STATES(:,28) = 0.1;
STATES(:,29) = 0.1;
CONSTANTS(:,56) = 1.72;
CONSTANTS(:,57) = 11.5;
CONSTANTS(:,58) = 0.57;
CONSTANTS(:,59) = 65.67;
CONSTANTS(:,60) = 328.36;
CONSTANTS(:,61) = 6.567;
CONSTANTS(:,62) = 2.2;
CONSTANTS(:,63) = 6.567;
CONSTANTS(:,64) = 0.0022;
CONSTANTS(:,65) = 6.567;
CONSTANTS(:,66) = 32.835;
CONSTANTS(:,67) = 3E-3;
STATES(:,30) = 0.1;
STATES(:,31) = 0.1;
STATES(:,32) = 0.1;
STATES(:,33) = 0.1;
CONSTANTS(:,68) = 2.0;
CONSTANTS(:,69) = 1.0;
CONSTANTS(:,70) = 46.0;
CONSTANTS(:,71) = 3.2604;
CONSTANTS(:,72) = 46.0;
CONSTANTS(:,73) = 1.3E-3;
CONSTANTS(:,74) = 46.0;
CONSTANTS(:,75) = 537.966;
CONSTANTS(:,76) = 10.0;
CONSTANTS(:,77) = 135;
CONSTANTS(:,78) = 1;
CONSTANTS(:,79) = 1;
CONSTANTS(:,80) = 500.0;
CONSTANTS(:,81) = 0.1;
STATES(:,34) = 0.1;
STATES(:,35) = 0.1;
STATES(:,36) = 0.1;
CONSTANTS(:,82) = 0.007;
CONSTANTS(:,83) = 0.000014;
CONSTANTS(:,84) = 0.007;
CONSTANTS(:,85) = 0.0014;
CONSTANTS(:,86) = 0.007;
CONSTANTS(:,87) = 0.000014;
CONSTANTS(:,88) = 24.5;
CONSTANTS(:,89) = 0.2;
STATES(:,37) = 0.1;
STATES(:,38) = 0.1;
STATES(:,39) = 0.1;
STATES(:,40) = 0.1;
STATES(:,41) = 0.1;
CONSTANTS(:,90) = 1.72;
CONSTANTS(:,91) = 11.5;
CONSTANTS(:,92) = 0.57;
CONSTANTS(:,93) = 65.67;
CONSTANTS(:,94) = 328.36;
CONSTANTS(:,95) = 6.567;
CONSTANTS(:,96) = 2.2;
CONSTANTS(:,97) = 6.567;
CONSTANTS(:,98) = 0.0022;
CONSTANTS(:,99) = 6.567;
CONSTANTS(:,100) = 32.835;
CONSTANTS(:,101) = 3E-3;
STATES(:,42) = 0.1;
STATES(:,43) = 0.1;
STATES(:,44) = 0.1;
STATES(:,45) = 0.1;
CONSTANTS(:,102) = 2.0;
CONSTANTS(:,103) = 1.0;
CONSTANTS(:,104) = 46.0;
CONSTANTS(:,105) = 3.2604;
CONSTANTS(:,106) = 46.0;
CONSTANTS(:,107) = 1.3E-3;
CONSTANTS(:,108) = 46.0;
CONSTANTS(:,109) = 537.966;
CONSTANTS(:,110) = piecewise({CONSTANTS(:,10)<=1.00000,  0.00250000.*((1.00000+CONSTANTS(:,9)./0.940000) - CONSTANTS(:,10)./0.0120000).*(1.00000+CONSTANTS(:,9)./8.10000+CONSTANTS(:,10)./0.0220000) },  0.00250000.*((1.00000+CONSTANTS(:,9)./0.940000+(CONSTANTS(:,10) - 1.00000)./0.0600000) - 1.00000./0.0120000).*(1.00000+CONSTANTS(:,9)./8.10000+1.00000./0.0220000+(CONSTANTS(:,10) - 1.00000)./0.0680000));
CONSTANTS(:,111) = piecewise({CONSTANTS(:,10)<=1.00000,  0.128000.*(1.00000+CONSTANTS(:,9)./0.640000+CONSTANTS(:,10)./0.0140000).*((1.00000+CONSTANTS(:,9)./13.0000) - CONSTANTS(:,10)./0.153000) },  0.128000.*(1.00000+CONSTANTS(:,9)./0.640000+(CONSTANTS(:,10) - 1.00000)./0.00500000).*(1.00000./0.0120000).*((1.00000+CONSTANTS(:,9)./13.0000+(CONSTANTS(:,10) - 1.00000)./0.150000) - 1.00000./0.153000));
CONSTANTS(:,112) = CONSTANTS(:,12);
CONSTANTS(:,113) =  CONSTANTS(:,12).*(0.0335000./5.00000);
CONSTANTS(:,114) =  CONSTANTS(:,12).*(3.35000e-05./5.00000);
CONSTANTS(:,115) = CONSTANTS(:,8)./160.000;
CONSTANTS(:,116) = CONSTANTS(:,12)./2508.00;
CONSTANTS(:,117) = piecewise({CONSTANTS(:,44)<=1.00000,  0.00250000.*((1.00000+CONSTANTS(:,43)./0.940000) - CONSTANTS(:,44)./0.0120000).*(1.00000+CONSTANTS(:,43)./8.10000+CONSTANTS(:,44)./0.0220000) },  0.00250000.*((1.00000+CONSTANTS(:,43)./0.940000+(CONSTANTS(:,44) - 1.00000)./0.0600000) - 1.00000./0.0120000).*(1.00000+CONSTANTS(:,43)./8.10000+1.00000./0.0220000+(CONSTANTS(:,44) - 1.00000)./0.0680000));
CONSTANTS(:,118) = piecewise({CONSTANTS(:,44)<=1.00000,  0.128000.*(1.00000+CONSTANTS(:,43)./0.640000+CONSTANTS(:,44)./0.0140000).*((1.00000+CONSTANTS(:,43)./13.0000) - CONSTANTS(:,44)./0.153000) },  0.128000.*(1.00000+CONSTANTS(:,43)./0.640000+(CONSTANTS(:,44) - 1.00000)./0.00500000).*(1.00000./0.0120000).*((1.00000+CONSTANTS(:,43)./13.0000+(CONSTANTS(:,44) - 1.00000)./0.150000) - 1.00000./0.153000));
CONSTANTS(:,119) = CONSTANTS(:,46);
CONSTANTS(:,120) =  CONSTANTS(:,46).*(0.0335000./5.00000);
CONSTANTS(:,121) =  CONSTANTS(:,46).*(3.35000e-05./5.00000);
CONSTANTS(:,122) = CONSTANTS(:,42)./160.000;
CONSTANTS(:,123) = CONSTANTS(:,46)./2508.00;
CONSTANTS(:,124) = piecewise({CONSTANTS(:,78)<=1.00000,  0.00250000.*((1.00000+CONSTANTS(:,77)./0.940000) - CONSTANTS(:,78)./0.0120000).*(1.00000+CONSTANTS(:,77)./8.10000+CONSTANTS(:,78)./0.0220000) },  0.00250000.*((1.00000+CONSTANTS(:,77)./0.940000+(CONSTANTS(:,78) - 1.00000)./0.0600000) - 1.00000./0.0120000).*(1.00000+CONSTANTS(:,77)./8.10000+1.00000./0.0220000+(CONSTANTS(:,78) - 1.00000)./0.0680000));
CONSTANTS(:,125) = piecewise({CONSTANTS(:,78)<=1.00000,  0.128000.*(1.00000+CONSTANTS(:,77)./0.640000+CONSTANTS(:,78)./0.0140000).*((1.00000+CONSTANTS(:,77)./13.0000) - CONSTANTS(:,78)./0.153000) },  0.128000.*(1.00000+CONSTANTS(:,77)./0.640000+(CONSTANTS(:,78) - 1.00000)./0.00500000).*(1.00000./0.0120000).*((1.00000+CONSTANTS(:,77)./13.0000+(CONSTANTS(:,78) - 1.00000)./0.150000) - 1.00000./0.153000));
CONSTANTS(:,126) = CONSTANTS(:,80);
CONSTANTS(:,127) =  CONSTANTS(:,80).*(0.0335000./5.00000);
CONSTANTS(:,128) =  CONSTANTS(:,80).*(3.35000e-05./5.00000);
CONSTANTS(:,129) = CONSTANTS(:,76)./160.000;
CONSTANTS(:,130) = CONSTANTS(:,80)./2508.00;
CONSTANTS(:,131) = CONSTANTS(:,8)./CONSTANTS(:,110);
CONSTANTS(:,132) = CONSTANTS(:,12)./CONSTANTS(:,111);
CONSTANTS(:,133) = CONSTANTS(:,42)./CONSTANTS(:,117);
CONSTANTS(:,134) = CONSTANTS(:,46)./CONSTANTS(:,118);
CONSTANTS(:,135) = CONSTANTS(:,76)./CONSTANTS(:,124);
CONSTANTS(:,136) = CONSTANTS(:,80)./CONSTANTS(:,125);
CONSTANTS(:,137) = CONSTANTS(:,131);
CONSTANTS(:,138) = CONSTANTS(:,132);
CONSTANTS(:,139) = CONSTANTS(:,132);
CONSTANTS(:,140) = CONSTANTS(:,132);
CONSTANTS(:,141) = CONSTANTS(:,131);
CONSTANTS(:,142) = CONSTANTS(:,132);
CONSTANTS(:,143) = CONSTANTS(:,133);
CONSTANTS(:,144) = CONSTANTS(:,134);
CONSTANTS(:,145) = CONSTANTS(:,134);
CONSTANTS(:,146) = CONSTANTS(:,134);
CONSTANTS(:,147) = CONSTANTS(:,133);
CONSTANTS(:,148) = CONSTANTS(:,134);
CONSTANTS(:,149) = CONSTANTS(:,135);
CONSTANTS(:,150) = CONSTANTS(:,136);
CONSTANTS(:,151) = CONSTANTS(:,136);
CONSTANTS(:,152) = CONSTANTS(:,136);
CONSTANTS(:,153) = CONSTANTS(:,135);
CONSTANTS(:,154) = CONSTANTS(:,136);
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
ALGEBRAIC(:,25) =  CONSTANTS(:,137).*power(CONSTANTS(:,11), 2.00000).*STATES(:,10) -  CONSTANTS(:,13).*STATES(:,11);
ALGEBRAIC(:,28) =  CONSTANTS(:,138).*power(CONSTANTS(:,11), 2.00000).*STATES(:,11) -  CONSTANTS(:,112).*STATES(:,12);
ALGEBRAIC(:,31) = CONSTANTS(:,20) - (STATES(:,10)+STATES(:,11)+STATES(:,12));
ALGEBRAIC(:,37) =  CONSTANTS(:,14).*STATES(:,3).*ALGEBRAIC(:,31) -  CONSTANTS(:,15).*STATES(:,11);
RATES(:,11) =  0.00100000.*((ALGEBRAIC(:,25)+ALGEBRAIC(:,37)) - ALGEBRAIC(:,28));
ALGEBRAIC(:,26) =  CONSTANTS(:,143).*power(CONSTANTS(:,45), 2.00000).*STATES(:,22) -  CONSTANTS(:,47).*STATES(:,23);
ALGEBRAIC(:,29) =  CONSTANTS(:,144).*power(CONSTANTS(:,45), 2.00000).*STATES(:,23) -  CONSTANTS(:,119).*STATES(:,24);
ALGEBRAIC(:,32) = CONSTANTS(:,54) - (STATES(:,22)+STATES(:,23)+STATES(:,24));
ALGEBRAIC(:,38) =  CONSTANTS(:,48).*STATES(:,4).*ALGEBRAIC(:,32) -  CONSTANTS(:,49).*STATES(:,23);
RATES(:,23) =  0.00100000.*((ALGEBRAIC(:,26)+ALGEBRAIC(:,38)) - ALGEBRAIC(:,29));
ALGEBRAIC(:,27) =  CONSTANTS(:,149).*power(CONSTANTS(:,79), 2.00000).*STATES(:,34) -  CONSTANTS(:,81).*STATES(:,35);
ALGEBRAIC(:,30) =  CONSTANTS(:,150).*power(CONSTANTS(:,79), 2.00000).*STATES(:,35) -  CONSTANTS(:,126).*STATES(:,36);
ALGEBRAIC(:,33) = CONSTANTS(:,88) - (STATES(:,34)+STATES(:,35)+STATES(:,36));
ALGEBRAIC(:,39) =  CONSTANTS(:,82).*STATES(:,8).*ALGEBRAIC(:,33) -  CONSTANTS(:,83).*STATES(:,35);
RATES(:,35) =  0.00100000.*((ALGEBRAIC(:,27)+ALGEBRAIC(:,39)) - ALGEBRAIC(:,30));
ALGEBRAIC(:,40) =  CONSTANTS(:,16).*STATES(:,1).*ALGEBRAIC(:,31) -  CONSTANTS(:,17).*STATES(:,10);
RATES(:,10) =  0.00100000.*(ALGEBRAIC(:,40) - ALGEBRAIC(:,25));
ALGEBRAIC(:,41) =  CONSTANTS(:,50).*STATES(:,2).*ALGEBRAIC(:,32) -  CONSTANTS(:,51).*STATES(:,22);
RATES(:,22) =  0.00100000.*(ALGEBRAIC(:,41) - ALGEBRAIC(:,26));
ALGEBRAIC(:,42) =  CONSTANTS(:,84).*STATES(:,7).*ALGEBRAIC(:,33) -  CONSTANTS(:,85).*STATES(:,34);
RATES(:,34) =  0.00100000.*(ALGEBRAIC(:,42) - ALGEBRAIC(:,27));
ALGEBRAIC(:,43) =  CONSTANTS(:,18).*STATES(:,5).*ALGEBRAIC(:,31) -  CONSTANTS(:,19).*STATES(:,12);
RATES(:,12) =  0.00100000.*(ALGEBRAIC(:,28)+ALGEBRAIC(:,43));
ALGEBRAIC(:,44) =  CONSTANTS(:,52).*STATES(:,6).*ALGEBRAIC(:,32) -  CONSTANTS(:,53).*STATES(:,24);
RATES(:,24) =  0.00100000.*(ALGEBRAIC(:,29)+ALGEBRAIC(:,44));
ALGEBRAIC(:,45) =  CONSTANTS(:,86).*STATES(:,9).*ALGEBRAIC(:,33) -  CONSTANTS(:,87).*STATES(:,36);
RATES(:,36) =  0.00100000.*(ALGEBRAIC(:,30)+ALGEBRAIC(:,45));
ALGEBRAIC(:,46) = 1.00000 - (STATES(:,14)+STATES(:,13)+STATES(:,15)+STATES(:,16)+STATES(:,17));
ALGEBRAIC(:,67) =  CONSTANTS(:,27).*STATES(:,5).*ALGEBRAIC(:,46) -  CONSTANTS(:,28).*STATES(:,14);
ALGEBRAIC(:,49) = STATES(:,14)+STATES(:,15)+STATES(:,16)+STATES(:,17);
ALGEBRAIC(:,55) =  0.0550000.*ALGEBRAIC(:,49)+ 0.00740000.*power(ALGEBRAIC(:,49), 2.00000)+ 0.0150000.*power(ALGEBRAIC(:,49), 3.00000);
ALGEBRAIC(:,58) =  ALGEBRAIC(:,55).*STATES(:,14) - ( CONSTANTS(:,22).*CONSTANTS(:,24).*STATES(:,15))./(CONSTANTS(:,23)+ CONSTANTS(:,21).*STATES(:,15));
ALGEBRAIC(:,64) =  CONSTANTS(:,139).*power(CONSTANTS(:,11), 2.00000).*STATES(:,13) -  CONSTANTS(:,113).*STATES(:,13);
RATES(:,14) =  0.00100000.*((ALGEBRAIC(:,67)+ALGEBRAIC(:,64)) - ALGEBRAIC(:,58));
ALGEBRAIC(:,47) = 1.00000 - (STATES(:,26)+STATES(:,25)+STATES(:,27)+STATES(:,28)+STATES(:,29));
ALGEBRAIC(:,68) =  CONSTANTS(:,61).*STATES(:,6).*ALGEBRAIC(:,47) -  CONSTANTS(:,62).*STATES(:,26);
ALGEBRAIC(:,51) = STATES(:,26)+STATES(:,27)+STATES(:,28)+STATES(:,29);
ALGEBRAIC(:,56) =  0.0550000.*ALGEBRAIC(:,51)+ 0.00740000.*power(ALGEBRAIC(:,51), 2.00000)+ 0.0150000.*power(ALGEBRAIC(:,51), 3.00000);
ALGEBRAIC(:,59) =  ALGEBRAIC(:,56).*STATES(:,26) - ( CONSTANTS(:,56).*CONSTANTS(:,58).*STATES(:,27))./(CONSTANTS(:,57)+ CONSTANTS(:,55).*STATES(:,27));
ALGEBRAIC(:,65) =  CONSTANTS(:,145).*power(CONSTANTS(:,45), 2.00000).*STATES(:,25) -  CONSTANTS(:,120).*STATES(:,25);
RATES(:,26) =  0.00100000.*((ALGEBRAIC(:,68)+ALGEBRAIC(:,65)) - ALGEBRAIC(:,59));
ALGEBRAIC(:,48) = 1.00000 - (STATES(:,38)+STATES(:,37)+STATES(:,39)+STATES(:,40)+STATES(:,41));
ALGEBRAIC(:,69) =  CONSTANTS(:,95).*STATES(:,9).*ALGEBRAIC(:,48) -  CONSTANTS(:,96).*STATES(:,38);
ALGEBRAIC(:,53) = STATES(:,38)+STATES(:,39)+STATES(:,40)+STATES(:,41);
ALGEBRAIC(:,57) =  0.0550000.*ALGEBRAIC(:,53)+ 0.00740000.*power(ALGEBRAIC(:,53), 2.00000)+ 0.0150000.*power(ALGEBRAIC(:,53), 3.00000);
ALGEBRAIC(:,60) =  ALGEBRAIC(:,57).*STATES(:,38) - ( CONSTANTS(:,90).*CONSTANTS(:,92).*STATES(:,39))./(CONSTANTS(:,91)+ CONSTANTS(:,89).*STATES(:,39));
ALGEBRAIC(:,66) =  CONSTANTS(:,151).*power(CONSTANTS(:,79), 2.00000).*STATES(:,37) -  CONSTANTS(:,127).*STATES(:,37);
RATES(:,38) =  0.00100000.*((ALGEBRAIC(:,69)+ALGEBRAIC(:,66)) - ALGEBRAIC(:,60));
ALGEBRAIC(:,73) =  CONSTANTS(:,30).*STATES(:,15) -  CONSTANTS(:,29).*STATES(:,5).*STATES(:,17);
ALGEBRAIC(:,70) =  CONSTANTS(:,114).*STATES(:,15) -  CONSTANTS(:,140).*power(CONSTANTS(:,11), 2.00000).*STATES(:,16);
RATES(:,15) =  0.00100000.* - (ALGEBRAIC(:,58)+ALGEBRAIC(:,73)+ALGEBRAIC(:,70));
ALGEBRAIC(:,74) =  CONSTANTS(:,64).*STATES(:,27) -  CONSTANTS(:,63).*STATES(:,6).*STATES(:,29);
ALGEBRAIC(:,71) =  CONSTANTS(:,121).*STATES(:,27) -  CONSTANTS(:,146).*power(CONSTANTS(:,45), 2.00000).*STATES(:,28);
RATES(:,27) =  0.00100000.* - (ALGEBRAIC(:,59)+ALGEBRAIC(:,74)+ALGEBRAIC(:,71));
ALGEBRAIC(:,75) =  CONSTANTS(:,98).*STATES(:,39) -  CONSTANTS(:,97).*STATES(:,9).*STATES(:,41);
ALGEBRAIC(:,72) =  CONSTANTS(:,128).*STATES(:,39) -  CONSTANTS(:,152).*power(CONSTANTS(:,79), 2.00000).*STATES(:,40);
RATES(:,39) =  0.00100000.* - (ALGEBRAIC(:,60)+ALGEBRAIC(:,75)+ALGEBRAIC(:,72));
ALGEBRAIC(:,61) =  CONSTANTS(:,25).*STATES(:,3).*ALGEBRAIC(:,46) -  CONSTANTS(:,26).*STATES(:,13);
ALGEBRAIC(:,80) = ( CONSTANTS(:,22).*CONSTANTS(:,24).*STATES(:,16))./(CONSTANTS(:,23)+ CONSTANTS(:,21).*STATES(:,16));
RATES(:,13) =  0.00100000.*(ALGEBRAIC(:,80) - (ALGEBRAIC(:,61)+ALGEBRAIC(:,64)));
ALGEBRAIC(:,76) =  CONSTANTS(:,32).*STATES(:,16) -  CONSTANTS(:,31).*STATES(:,3).*STATES(:,17);
RATES(:,16) =  0.00100000.* - (ALGEBRAIC(:,70)+ALGEBRAIC(:,76)+ALGEBRAIC(:,80));
ALGEBRAIC(:,81) = ( CONSTANTS(:,22).*CONSTANTS(:,24).*STATES(:,17))./(CONSTANTS(:,23)+ CONSTANTS(:,21).*STATES(:,17));
RATES(:,17) =  0.00100000.*((ALGEBRAIC(:,73)+ALGEBRAIC(:,76)) - ALGEBRAIC(:,81));
ALGEBRAIC(:,62) =  CONSTANTS(:,59).*STATES(:,4).*ALGEBRAIC(:,47) -  CONSTANTS(:,60).*STATES(:,25);
ALGEBRAIC(:,83) = ( CONSTANTS(:,56).*CONSTANTS(:,58).*STATES(:,28))./(CONSTANTS(:,57)+ CONSTANTS(:,55).*STATES(:,28));
RATES(:,25) =  0.00100000.*(ALGEBRAIC(:,83) - (ALGEBRAIC(:,62)+ALGEBRAIC(:,65)));
ALGEBRAIC(:,77) =  CONSTANTS(:,66).*STATES(:,28) -  CONSTANTS(:,65).*STATES(:,4).*STATES(:,29);
RATES(:,28) =  0.00100000.* - (ALGEBRAIC(:,71)+ALGEBRAIC(:,77)+ALGEBRAIC(:,83));
ALGEBRAIC(:,84) = ( CONSTANTS(:,56).*CONSTANTS(:,58).*STATES(:,29))./(CONSTANTS(:,57)+ CONSTANTS(:,55).*STATES(:,29));
RATES(:,29) =  0.00100000.*((ALGEBRAIC(:,74)+ALGEBRAIC(:,77)) - ALGEBRAIC(:,84));
ALGEBRAIC(:,63) =  CONSTANTS(:,93).*STATES(:,8).*ALGEBRAIC(:,48) -  CONSTANTS(:,94).*STATES(:,37);
ALGEBRAIC(:,86) = ( CONSTANTS(:,90).*CONSTANTS(:,92).*STATES(:,40))./(CONSTANTS(:,91)+ CONSTANTS(:,89).*STATES(:,40));
RATES(:,37) =  0.00100000.*(ALGEBRAIC(:,86) - (ALGEBRAIC(:,63)+ALGEBRAIC(:,66)));
ALGEBRAIC(:,78) =  CONSTANTS(:,100).*STATES(:,40) -  CONSTANTS(:,99).*STATES(:,8).*STATES(:,41);
RATES(:,40) =  0.00100000.* - (ALGEBRAIC(:,72)+ALGEBRAIC(:,78)+ALGEBRAIC(:,86));
ALGEBRAIC(:,87) = ( CONSTANTS(:,90).*CONSTANTS(:,92).*STATES(:,41))./(CONSTANTS(:,91)+ CONSTANTS(:,89).*STATES(:,41));
RATES(:,41) =  0.00100000.*((ALGEBRAIC(:,75)+ALGEBRAIC(:,78)) - ALGEBRAIC(:,87));
ALGEBRAIC(:,1) =  CONSTANTS(:,131).*power(CONSTANTS(:,11), 2.00000).*STATES(:,1) -  CONSTANTS(:,8).*STATES(:,3);
ALGEBRAIC(:,22) =  CONSTANTS(:,132).*power(CONSTANTS(:,11), 2.00000).*STATES(:,3) -  CONSTANTS(:,12).*STATES(:,5);
ALGEBRAIC(:,97) =  CONSTANTS(:,36).*STATES(:,3).*STATES(:,18) -  CONSTANTS(:,37).*STATES(:,20);
RATES(:,3) =  0.00100000.*(( CONSTANTS(:,21).*(ALGEBRAIC(:,76) - ALGEBRAIC(:,61))+ALGEBRAIC(:,1)) - (ALGEBRAIC(:,22)+ALGEBRAIC(:,37)+ALGEBRAIC(:,97)));
ALGEBRAIC(:,91) =  CONSTANTS(:,141).*power(CONSTANTS(:,11), 2.00000).*STATES(:,19) -  CONSTANTS(:,115).*STATES(:,20);
ALGEBRAIC(:,94) =  CONSTANTS(:,142).*power(CONSTANTS(:,11), 2.00000).*STATES(:,20) -  CONSTANTS(:,116).*STATES(:,21);
RATES(:,20) =  0.00100000.*((ALGEBRAIC(:,97)+ALGEBRAIC(:,91)) - ALGEBRAIC(:,94));
ALGEBRAIC(:,10) =  CONSTANTS(:,133).*power(CONSTANTS(:,45), 2.00000).*STATES(:,2) -  CONSTANTS(:,42).*STATES(:,4);
ALGEBRAIC(:,23) =  CONSTANTS(:,134).*power(CONSTANTS(:,45), 2.00000).*STATES(:,4) -  CONSTANTS(:,46).*STATES(:,6);
ALGEBRAIC(:,98) =  CONSTANTS(:,70).*STATES(:,4).*STATES(:,30) -  CONSTANTS(:,71).*STATES(:,32);
RATES(:,4) =  0.00100000.*(( CONSTANTS(:,55).*(ALGEBRAIC(:,77) - ALGEBRAIC(:,62))+ALGEBRAIC(:,10)) - (ALGEBRAIC(:,23)+ALGEBRAIC(:,38)+ALGEBRAIC(:,98)));
ALGEBRAIC(:,92) =  CONSTANTS(:,147).*power(CONSTANTS(:,45), 2.00000).*STATES(:,31) -  CONSTANTS(:,122).*STATES(:,32);
ALGEBRAIC(:,95) =  CONSTANTS(:,148).*power(CONSTANTS(:,45), 2.00000).*STATES(:,32) -  CONSTANTS(:,123).*STATES(:,33);
RATES(:,32) =  0.00100000.*((ALGEBRAIC(:,98)+ALGEBRAIC(:,92)) - ALGEBRAIC(:,95));
ALGEBRAIC(:,16) =  CONSTANTS(:,135).*power(CONSTANTS(:,79), 2.00000).*STATES(:,7) -  CONSTANTS(:,76).*STATES(:,8);
ALGEBRAIC(:,24) =  CONSTANTS(:,136).*power(CONSTANTS(:,79), 2.00000).*STATES(:,8) -  CONSTANTS(:,80).*STATES(:,9);
ALGEBRAIC(:,99) =  CONSTANTS(:,104).*STATES(:,8).*STATES(:,42) -  CONSTANTS(:,105).*STATES(:,44);
RATES(:,8) =  0.00100000.*(( CONSTANTS(:,89).*(ALGEBRAIC(:,78) - ALGEBRAIC(:,63))+ALGEBRAIC(:,16)) - (ALGEBRAIC(:,24)+ALGEBRAIC(:,39)+ALGEBRAIC(:,99)));
ALGEBRAIC(:,93) =  CONSTANTS(:,153).*power(CONSTANTS(:,79), 2.00000).*STATES(:,43) -  CONSTANTS(:,129).*STATES(:,44);
ALGEBRAIC(:,96) =  CONSTANTS(:,154).*power(CONSTANTS(:,79), 2.00000).*STATES(:,44) -  CONSTANTS(:,130).*STATES(:,45);
RATES(:,44) =  0.00100000.*((ALGEBRAIC(:,99)+ALGEBRAIC(:,93)) - ALGEBRAIC(:,96));
ALGEBRAIC(:,100) =  CONSTANTS(:,38).*STATES(:,5).*STATES(:,18) -  CONSTANTS(:,39).*STATES(:,21);
RATES(:,5) =  0.00100000.*(( CONSTANTS(:,21).*(ALGEBRAIC(:,73) - ALGEBRAIC(:,67))+ALGEBRAIC(:,22)) - (ALGEBRAIC(:,100)+ALGEBRAIC(:,43)));
RATES(:,21) =  0.00100000.*(ALGEBRAIC(:,100)+ALGEBRAIC(:,94));
ALGEBRAIC(:,101) =  CONSTANTS(:,72).*STATES(:,6).*STATES(:,30) -  CONSTANTS(:,73).*STATES(:,33);
RATES(:,6) =  0.00100000.*(( CONSTANTS(:,55).*(ALGEBRAIC(:,74) - ALGEBRAIC(:,68))+ALGEBRAIC(:,23)) - (ALGEBRAIC(:,101)+ALGEBRAIC(:,44)));
RATES(:,33) =  0.00100000.*(ALGEBRAIC(:,101)+ALGEBRAIC(:,95));
ALGEBRAIC(:,102) =  CONSTANTS(:,106).*STATES(:,9).*STATES(:,42) -  CONSTANTS(:,107).*STATES(:,45);
RATES(:,9) =  0.00100000.*(( CONSTANTS(:,89).*(ALGEBRAIC(:,75) - ALGEBRAIC(:,69))+ALGEBRAIC(:,24)) - (ALGEBRAIC(:,102)+ALGEBRAIC(:,45)));
RATES(:,45) =  0.00100000.*(ALGEBRAIC(:,102)+ALGEBRAIC(:,96));
ALGEBRAIC(:,103) =  CONSTANTS(:,40).*STATES(:,1).*STATES(:,18) -  CONSTANTS(:,41).*STATES(:,19);
RATES(:,1) =  0.00100000.* - (ALGEBRAIC(:,1)+ALGEBRAIC(:,40)+ALGEBRAIC(:,103));
ALGEBRAIC(:,79) = CONSTANTS(:,33) - (STATES(:,18)+STATES(:,19)+STATES(:,20)+STATES(:,21));
ALGEBRAIC(:,88) =  CONSTANTS(:,34).*power(CONSTANTS(:,11), 2.00000).*ALGEBRAIC(:,79) -  CONSTANTS(:,35).*STATES(:,18);
RATES(:,18) =  0.00100000.*(ALGEBRAIC(:,88) - (ALGEBRAIC(:,103)+ALGEBRAIC(:,97)+ALGEBRAIC(:,100)));
RATES(:,19) =  0.00100000.*(ALGEBRAIC(:,103) - ALGEBRAIC(:,91));
ALGEBRAIC(:,104) =  CONSTANTS(:,74).*STATES(:,2).*STATES(:,30) -  CONSTANTS(:,75).*STATES(:,31);
RATES(:,2) =  0.00100000.* - (ALGEBRAIC(:,10)+ALGEBRAIC(:,41)+ALGEBRAIC(:,104));
ALGEBRAIC(:,82) = CONSTANTS(:,67) - (STATES(:,30)+STATES(:,31)+STATES(:,32)+STATES(:,33));
ALGEBRAIC(:,89) =  CONSTANTS(:,68).*power(CONSTANTS(:,45), 2.00000).*ALGEBRAIC(:,82) -  CONSTANTS(:,69).*STATES(:,30);
RATES(:,30) =  0.00100000.*(ALGEBRAIC(:,89) - (ALGEBRAIC(:,104)+ALGEBRAIC(:,98)+ALGEBRAIC(:,101)));
RATES(:,31) =  0.00100000.*(ALGEBRAIC(:,104) - ALGEBRAIC(:,92));
ALGEBRAIC(:,105) =  CONSTANTS(:,108).*STATES(:,7).*STATES(:,42) -  CONSTANTS(:,109).*STATES(:,43);
RATES(:,7) =  0.00100000.* - (ALGEBRAIC(:,16)+ALGEBRAIC(:,42)+ALGEBRAIC(:,105));
ALGEBRAIC(:,85) = CONSTANTS(:,101) - (STATES(:,42)+STATES(:,43)+STATES(:,44)+STATES(:,45));
ALGEBRAIC(:,90) =  CONSTANTS(:,102).*power(CONSTANTS(:,79), 2.00000).*ALGEBRAIC(:,85) -  CONSTANTS(:,103).*STATES(:,42);
RATES(:,42) =  0.00100000.*(ALGEBRAIC(:,90) - (ALGEBRAIC(:,105)+ALGEBRAIC(:,99)+ALGEBRAIC(:,102)));
RATES(:,43) =  0.00100000.*(ALGEBRAIC(:,105) - ALGEBRAIC(:,93));
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
ALGEBRAIC(:,25) =  CONSTANTS(:,137).*power(CONSTANTS(:,11), 2.00000).*STATES(:,10) -  CONSTANTS(:,13).*STATES(:,11);
ALGEBRAIC(:,28) =  CONSTANTS(:,138).*power(CONSTANTS(:,11), 2.00000).*STATES(:,11) -  CONSTANTS(:,112).*STATES(:,12);
ALGEBRAIC(:,31) = CONSTANTS(:,20) - (STATES(:,10)+STATES(:,11)+STATES(:,12));
ALGEBRAIC(:,37) =  CONSTANTS(:,14).*STATES(:,3).*ALGEBRAIC(:,31) -  CONSTANTS(:,15).*STATES(:,11);
ALGEBRAIC(:,26) =  CONSTANTS(:,143).*power(CONSTANTS(:,45), 2.00000).*STATES(:,22) -  CONSTANTS(:,47).*STATES(:,23);
ALGEBRAIC(:,29) =  CONSTANTS(:,144).*power(CONSTANTS(:,45), 2.00000).*STATES(:,23) -  CONSTANTS(:,119).*STATES(:,24);
ALGEBRAIC(:,32) = CONSTANTS(:,54) - (STATES(:,22)+STATES(:,23)+STATES(:,24));
ALGEBRAIC(:,38) =  CONSTANTS(:,48).*STATES(:,4).*ALGEBRAIC(:,32) -  CONSTANTS(:,49).*STATES(:,23);
ALGEBRAIC(:,27) =  CONSTANTS(:,149).*power(CONSTANTS(:,79), 2.00000).*STATES(:,34) -  CONSTANTS(:,81).*STATES(:,35);
ALGEBRAIC(:,30) =  CONSTANTS(:,150).*power(CONSTANTS(:,79), 2.00000).*STATES(:,35) -  CONSTANTS(:,126).*STATES(:,36);
ALGEBRAIC(:,33) = CONSTANTS(:,88) - (STATES(:,34)+STATES(:,35)+STATES(:,36));
ALGEBRAIC(:,39) =  CONSTANTS(:,82).*STATES(:,8).*ALGEBRAIC(:,33) -  CONSTANTS(:,83).*STATES(:,35);
ALGEBRAIC(:,40) =  CONSTANTS(:,16).*STATES(:,1).*ALGEBRAIC(:,31) -  CONSTANTS(:,17).*STATES(:,10);
ALGEBRAIC(:,41) =  CONSTANTS(:,50).*STATES(:,2).*ALGEBRAIC(:,32) -  CONSTANTS(:,51).*STATES(:,22);
ALGEBRAIC(:,42) =  CONSTANTS(:,84).*STATES(:,7).*ALGEBRAIC(:,33) -  CONSTANTS(:,85).*STATES(:,34);
ALGEBRAIC(:,43) =  CONSTANTS(:,18).*STATES(:,5).*ALGEBRAIC(:,31) -  CONSTANTS(:,19).*STATES(:,12);
ALGEBRAIC(:,44) =  CONSTANTS(:,52).*STATES(:,6).*ALGEBRAIC(:,32) -  CONSTANTS(:,53).*STATES(:,24);
ALGEBRAIC(:,45) =  CONSTANTS(:,86).*STATES(:,9).*ALGEBRAIC(:,33) -  CONSTANTS(:,87).*STATES(:,36);
ALGEBRAIC(:,46) = 1.00000 - (STATES(:,14)+STATES(:,13)+STATES(:,15)+STATES(:,16)+STATES(:,17));
ALGEBRAIC(:,67) =  CONSTANTS(:,27).*STATES(:,5).*ALGEBRAIC(:,46) -  CONSTANTS(:,28).*STATES(:,14);
ALGEBRAIC(:,49) = STATES(:,14)+STATES(:,15)+STATES(:,16)+STATES(:,17);
ALGEBRAIC(:,55) =  0.0550000.*ALGEBRAIC(:,49)+ 0.00740000.*power(ALGEBRAIC(:,49), 2.00000)+ 0.0150000.*power(ALGEBRAIC(:,49), 3.00000);
ALGEBRAIC(:,58) =  ALGEBRAIC(:,55).*STATES(:,14) - ( CONSTANTS(:,22).*CONSTANTS(:,24).*STATES(:,15))./(CONSTANTS(:,23)+ CONSTANTS(:,21).*STATES(:,15));
ALGEBRAIC(:,64) =  CONSTANTS(:,139).*power(CONSTANTS(:,11), 2.00000).*STATES(:,13) -  CONSTANTS(:,113).*STATES(:,13);
ALGEBRAIC(:,47) = 1.00000 - (STATES(:,26)+STATES(:,25)+STATES(:,27)+STATES(:,28)+STATES(:,29));
ALGEBRAIC(:,68) =  CONSTANTS(:,61).*STATES(:,6).*ALGEBRAIC(:,47) -  CONSTANTS(:,62).*STATES(:,26);
ALGEBRAIC(:,51) = STATES(:,26)+STATES(:,27)+STATES(:,28)+STATES(:,29);
ALGEBRAIC(:,56) =  0.0550000.*ALGEBRAIC(:,51)+ 0.00740000.*power(ALGEBRAIC(:,51), 2.00000)+ 0.0150000.*power(ALGEBRAIC(:,51), 3.00000);
ALGEBRAIC(:,59) =  ALGEBRAIC(:,56).*STATES(:,26) - ( CONSTANTS(:,56).*CONSTANTS(:,58).*STATES(:,27))./(CONSTANTS(:,57)+ CONSTANTS(:,55).*STATES(:,27));
ALGEBRAIC(:,65) =  CONSTANTS(:,145).*power(CONSTANTS(:,45), 2.00000).*STATES(:,25) -  CONSTANTS(:,120).*STATES(:,25);
ALGEBRAIC(:,48) = 1.00000 - (STATES(:,38)+STATES(:,37)+STATES(:,39)+STATES(:,40)+STATES(:,41));
ALGEBRAIC(:,69) =  CONSTANTS(:,95).*STATES(:,9).*ALGEBRAIC(:,48) -  CONSTANTS(:,96).*STATES(:,38);
ALGEBRAIC(:,53) = STATES(:,38)+STATES(:,39)+STATES(:,40)+STATES(:,41);
ALGEBRAIC(:,57) =  0.0550000.*ALGEBRAIC(:,53)+ 0.00740000.*power(ALGEBRAIC(:,53), 2.00000)+ 0.0150000.*power(ALGEBRAIC(:,53), 3.00000);
ALGEBRAIC(:,60) =  ALGEBRAIC(:,57).*STATES(:,38) - ( CONSTANTS(:,90).*CONSTANTS(:,92).*STATES(:,39))./(CONSTANTS(:,91)+ CONSTANTS(:,89).*STATES(:,39));
ALGEBRAIC(:,66) =  CONSTANTS(:,151).*power(CONSTANTS(:,79), 2.00000).*STATES(:,37) -  CONSTANTS(:,127).*STATES(:,37);
ALGEBRAIC(:,73) =  CONSTANTS(:,30).*STATES(:,15) -  CONSTANTS(:,29).*STATES(:,5).*STATES(:,17);
ALGEBRAIC(:,70) =  CONSTANTS(:,114).*STATES(:,15) -  CONSTANTS(:,140).*power(CONSTANTS(:,11), 2.00000).*STATES(:,16);
ALGEBRAIC(:,74) =  CONSTANTS(:,64).*STATES(:,27) -  CONSTANTS(:,63).*STATES(:,6).*STATES(:,29);
ALGEBRAIC(:,71) =  CONSTANTS(:,121).*STATES(:,27) -  CONSTANTS(:,146).*power(CONSTANTS(:,45), 2.00000).*STATES(:,28);
ALGEBRAIC(:,75) =  CONSTANTS(:,98).*STATES(:,39) -  CONSTANTS(:,97).*STATES(:,9).*STATES(:,41);
ALGEBRAIC(:,72) =  CONSTANTS(:,128).*STATES(:,39) -  CONSTANTS(:,152).*power(CONSTANTS(:,79), 2.00000).*STATES(:,40);
ALGEBRAIC(:,61) =  CONSTANTS(:,25).*STATES(:,3).*ALGEBRAIC(:,46) -  CONSTANTS(:,26).*STATES(:,13);
ALGEBRAIC(:,80) = ( CONSTANTS(:,22).*CONSTANTS(:,24).*STATES(:,16))./(CONSTANTS(:,23)+ CONSTANTS(:,21).*STATES(:,16));
ALGEBRAIC(:,76) =  CONSTANTS(:,32).*STATES(:,16) -  CONSTANTS(:,31).*STATES(:,3).*STATES(:,17);
ALGEBRAIC(:,81) = ( CONSTANTS(:,22).*CONSTANTS(:,24).*STATES(:,17))./(CONSTANTS(:,23)+ CONSTANTS(:,21).*STATES(:,17));
ALGEBRAIC(:,62) =  CONSTANTS(:,59).*STATES(:,4).*ALGEBRAIC(:,47) -  CONSTANTS(:,60).*STATES(:,25);
ALGEBRAIC(:,83) = ( CONSTANTS(:,56).*CONSTANTS(:,58).*STATES(:,28))./(CONSTANTS(:,57)+ CONSTANTS(:,55).*STATES(:,28));
ALGEBRAIC(:,77) =  CONSTANTS(:,66).*STATES(:,28) -  CONSTANTS(:,65).*STATES(:,4).*STATES(:,29);
ALGEBRAIC(:,84) = ( CONSTANTS(:,56).*CONSTANTS(:,58).*STATES(:,29))./(CONSTANTS(:,57)+ CONSTANTS(:,55).*STATES(:,29));
ALGEBRAIC(:,63) =  CONSTANTS(:,93).*STATES(:,8).*ALGEBRAIC(:,48) -  CONSTANTS(:,94).*STATES(:,37);
ALGEBRAIC(:,86) = ( CONSTANTS(:,90).*CONSTANTS(:,92).*STATES(:,40))./(CONSTANTS(:,91)+ CONSTANTS(:,89).*STATES(:,40));
ALGEBRAIC(:,78) =  CONSTANTS(:,100).*STATES(:,40) -  CONSTANTS(:,99).*STATES(:,8).*STATES(:,41);
ALGEBRAIC(:,87) = ( CONSTANTS(:,90).*CONSTANTS(:,92).*STATES(:,41))./(CONSTANTS(:,91)+ CONSTANTS(:,89).*STATES(:,41));
ALGEBRAIC(:,1) =  CONSTANTS(:,131).*power(CONSTANTS(:,11), 2.00000).*STATES(:,1) -  CONSTANTS(:,8).*STATES(:,3);
ALGEBRAIC(:,22) =  CONSTANTS(:,132).*power(CONSTANTS(:,11), 2.00000).*STATES(:,3) -  CONSTANTS(:,12).*STATES(:,5);
ALGEBRAIC(:,97) =  CONSTANTS(:,36).*STATES(:,3).*STATES(:,18) -  CONSTANTS(:,37).*STATES(:,20);
ALGEBRAIC(:,91) =  CONSTANTS(:,141).*power(CONSTANTS(:,11), 2.00000).*STATES(:,19) -  CONSTANTS(:,115).*STATES(:,20);
ALGEBRAIC(:,94) =  CONSTANTS(:,142).*power(CONSTANTS(:,11), 2.00000).*STATES(:,20) -  CONSTANTS(:,116).*STATES(:,21);
ALGEBRAIC(:,10) =  CONSTANTS(:,133).*power(CONSTANTS(:,45), 2.00000).*STATES(:,2) -  CONSTANTS(:,42).*STATES(:,4);
ALGEBRAIC(:,23) =  CONSTANTS(:,134).*power(CONSTANTS(:,45), 2.00000).*STATES(:,4) -  CONSTANTS(:,46).*STATES(:,6);
ALGEBRAIC(:,98) =  CONSTANTS(:,70).*STATES(:,4).*STATES(:,30) -  CONSTANTS(:,71).*STATES(:,32);
ALGEBRAIC(:,92) =  CONSTANTS(:,147).*power(CONSTANTS(:,45), 2.00000).*STATES(:,31) -  CONSTANTS(:,122).*STATES(:,32);
ALGEBRAIC(:,95) =  CONSTANTS(:,148).*power(CONSTANTS(:,45), 2.00000).*STATES(:,32) -  CONSTANTS(:,123).*STATES(:,33);
ALGEBRAIC(:,16) =  CONSTANTS(:,135).*power(CONSTANTS(:,79), 2.00000).*STATES(:,7) -  CONSTANTS(:,76).*STATES(:,8);
ALGEBRAIC(:,24) =  CONSTANTS(:,136).*power(CONSTANTS(:,79), 2.00000).*STATES(:,8) -  CONSTANTS(:,80).*STATES(:,9);
ALGEBRAIC(:,99) =  CONSTANTS(:,104).*STATES(:,8).*STATES(:,42) -  CONSTANTS(:,105).*STATES(:,44);
ALGEBRAIC(:,93) =  CONSTANTS(:,153).*power(CONSTANTS(:,79), 2.00000).*STATES(:,43) -  CONSTANTS(:,129).*STATES(:,44);
ALGEBRAIC(:,96) =  CONSTANTS(:,154).*power(CONSTANTS(:,79), 2.00000).*STATES(:,44) -  CONSTANTS(:,130).*STATES(:,45);
ALGEBRAIC(:,100) =  CONSTANTS(:,38).*STATES(:,5).*STATES(:,18) -  CONSTANTS(:,39).*STATES(:,21);
ALGEBRAIC(:,101) =  CONSTANTS(:,72).*STATES(:,6).*STATES(:,30) -  CONSTANTS(:,73).*STATES(:,33);
ALGEBRAIC(:,102) =  CONSTANTS(:,106).*STATES(:,9).*STATES(:,42) -  CONSTANTS(:,107).*STATES(:,45);
ALGEBRAIC(:,103) =  CONSTANTS(:,40).*STATES(:,1).*STATES(:,18) -  CONSTANTS(:,41).*STATES(:,19);
ALGEBRAIC(:,79) = CONSTANTS(:,33) - (STATES(:,18)+STATES(:,19)+STATES(:,20)+STATES(:,21));
ALGEBRAIC(:,88) =  CONSTANTS(:,34).*power(CONSTANTS(:,11), 2.00000).*ALGEBRAIC(:,79) -  CONSTANTS(:,35).*STATES(:,18);
ALGEBRAIC(:,104) =  CONSTANTS(:,74).*STATES(:,2).*STATES(:,30) -  CONSTANTS(:,75).*STATES(:,31);
ALGEBRAIC(:,82) = CONSTANTS(:,67) - (STATES(:,30)+STATES(:,31)+STATES(:,32)+STATES(:,33));
ALGEBRAIC(:,89) =  CONSTANTS(:,68).*power(CONSTANTS(:,45), 2.00000).*ALGEBRAIC(:,82) -  CONSTANTS(:,69).*STATES(:,30);
ALGEBRAIC(:,105) =  CONSTANTS(:,108).*STATES(:,7).*STATES(:,42) -  CONSTANTS(:,109).*STATES(:,43);
ALGEBRAIC(:,85) = CONSTANTS(:,101) - (STATES(:,42)+STATES(:,43)+STATES(:,44)+STATES(:,45));
ALGEBRAIC(:,90) =  CONSTANTS(:,102).*power(CONSTANTS(:,79), 2.00000).*ALGEBRAIC(:,85) -  CONSTANTS(:,103).*STATES(:,42);
ALGEBRAIC(:,2) =  CONSTANTS(:,7).*(STATES(:,2) - STATES(:,7));
ALGEBRAIC(:,3) =  CONSTANTS(:,7).*(STATES(:,4) - STATES(:,8));
ALGEBRAIC(:,4) =  CONSTANTS(:,7).*(STATES(:,6) - STATES(:,9));
ALGEBRAIC(:,5) =  STATES(:,13).*CONSTANTS(:,21);
ALGEBRAIC(:,6) =  STATES(:,14).*CONSTANTS(:,21);
ALGEBRAIC(:,7) =  STATES(:,15).*CONSTANTS(:,21);
ALGEBRAIC(:,8) =  STATES(:,16).*CONSTANTS(:,21);
ALGEBRAIC(:,9) =  STATES(:,17).*CONSTANTS(:,21);
ALGEBRAIC(:,11) =  STATES(:,25).*CONSTANTS(:,55);
ALGEBRAIC(:,12) =  STATES(:,26).*CONSTANTS(:,55);
ALGEBRAIC(:,13) =  STATES(:,27).*CONSTANTS(:,55);
ALGEBRAIC(:,14) =  STATES(:,28).*CONSTANTS(:,55);
ALGEBRAIC(:,15) =  STATES(:,29).*CONSTANTS(:,55);
ALGEBRAIC(:,17) =  STATES(:,37).*CONSTANTS(:,89);
ALGEBRAIC(:,18) =  STATES(:,38).*CONSTANTS(:,89);
ALGEBRAIC(:,19) =  STATES(:,39).*CONSTANTS(:,89);
ALGEBRAIC(:,20) =  STATES(:,40).*CONSTANTS(:,89);
ALGEBRAIC(:,21) =  STATES(:,41).*CONSTANTS(:,89);
ALGEBRAIC(:,34) =  CONSTANTS(:,2).*STATES(:,1) -  CONSTANTS(:,1).*ALGEBRAIC(:,31).*STATES(:,2);
ALGEBRAIC(:,35) =  CONSTANTS(:,4).*STATES(:,3) -  CONSTANTS(:,3).*ALGEBRAIC(:,31).*STATES(:,4);
ALGEBRAIC(:,36) =  CONSTANTS(:,6).*STATES(:,5) -  CONSTANTS(:,5).*ALGEBRAIC(:,31).*STATES(:,6);
ALGEBRAIC(:,50) =  ALGEBRAIC(:,46).*CONSTANTS(:,21);
ALGEBRAIC(:,52) =  ALGEBRAIC(:,47).*CONSTANTS(:,55);
ALGEBRAIC(:,54) =  ALGEBRAIC(:,48).*CONSTANTS(:,89);
end

% Compute result of a piecewise function
function x = piecewise(cases, default)
set = [0];
for i = 1:2:length(cases)
if (length(cases{i+1}) == 1)
x(cases{i} & ~set,:) = cases{i+1};
else
x(cases{i} & ~set,:) = cases{i+1}(cases{i} & ~set);
end
set = set | cases{i};
if(set), break, end
end
if (length(default) == 1)
x(~set,:) = default;
else
x(~set,:) = default(~set);
end
end

% Pad out or shorten strings to a set length
function strout = strpad(strin)
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 Saucerman, Bers, 2008 at changeset ecfeff9a57db.
Collaboration
To begin collaborating on this work, please use your git client and issue this command: