# 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 =134;
end
% There are a total of 51 entries in each of the rate and state variable arrays.
% There are a total of 388 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 time (dimensionless)');
LEGEND_ALGEBRAIC(:,2) = strpad('Istim in component stimulus_current (dimensionless)');
LEGEND_CONSTANTS(:,1) = strpad('stimPeriod in component stimulus_current (dimensionless)');
LEGEND_CONSTANTS(:,2) = strpad('stimDuration in component stimulus_current (dimensionless)');
LEGEND_CONSTANTS(:,3) = strpad('stimCurrent in component stimulus_current (dimensionless)');
LEGEND_CONSTANTS(:,4) = strpad('clamp_ATPi in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,5) = strpad('clamp_ATPi_cyto in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,7) = strpad('R in component parameters (J_per_mol_per_K)');
LEGEND_CONSTANTS(:,8) = strpad('T in component parameters (K)');
LEGEND_CONSTANTS(:,9) = strpad('LHospitalThreshold in component parameters (mV)');
LEGEND_CONSTANTS(:,10) = strpad('kt_2 in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,11) = strpad('kf_2 in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,12) = strpad('kf_3 in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,13) = strpad('keq in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,14) = strpad('CRT_cyto in component parameters (mM)');
LEGEND_CONSTANTS(:,15) = strpad('CRT_mito in component parameters (mM)');
LEGEND_CONSTANTS(:,16) = strpad('VATPase_cyto in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,17) = strpad('Acap in component parameters (cm2)');
LEGEND_CONSTANTS(:,18) = strpad('AcCoA in component parameters (mM)');
LEGEND_CONSTANTS(:,19) = strpad('aL in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,20) = strpad('b in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,21) = strpad('bL in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,22) = strpad('C_m in component parameters (uF_per_cm2)');
LEGEND_CONSTANTS(:,23) = strpad('Cao in component parameters (mM)');
LEGEND_CONSTANTS(:,24) = strpad('CIK in component parameters (mM)');
LEGEND_CONSTANTS(:,25) = strpad('Cm in component parameters (mM)');
LEGEND_CONSTANTS(:,26) = strpad('CMDNtot in component parameters (mM)');
LEGEND_CONSTANTS(:,27) = strpad('Cmito in component parameters (mM_per_mV)');
LEGEND_CONSTANTS(:,28) = strpad('CPN in component parameters (mM)');
LEGEND_CONSTANTS(:,29) = strpad('CoA in component parameters (mM)');
LEGEND_CONSTANTS(:,30) = strpad('CSQNtot in component parameters (mM)');
LEGEND_CONSTANTS(:,31) = strpad('DpH in component parameters (pH_units)');
LEGEND_CONSTANTS(:,32) = strpad('Dpsio in component parameters (mV)');
LEGEND_CONSTANTS(:,33) = strpad('eta in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,34) = strpad('EtCS in component parameters (mM)');
LEGEND_CONSTANTS(:,35) = strpad('EtID in component parameters (mM)');
LEGEND_CONSTANTS(:,36) = strpad('EtKG in component parameters (mM)');
LEGEND_CONSTANTS(:,37) = strpad('EtMD in component parameters (mM)');
LEGEND_CONSTANTS(:,38) = strpad('EtSDH in component parameters (mM)');
LEGEND_CONSTANTS(:,41) = strpad('fL in component parameters (per_ms)');
LEGEND_CONSTANTS(:,42) = strpad('fm in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,43) = strpad('fprime in component parameters (per_ms)');
LEGEND_CONSTANTS(:,44) = strpad('g in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,45) = strpad('G_Cab in component parameters (mS_per_cm2)');
LEGEND_CONSTANTS(:,46) = strpad('G_Kp in component parameters (mS_per_cm2)');
LEGEND_CONSTANTS(:,47) = strpad('G_Na in component parameters (mS_per_cm2)');
LEGEND_CONSTANTS(:,48) = strpad('G_Nab in component parameters (mS_per_cm2)');
LEGEND_CONSTANTS(:,49) = strpad('gh in component parameters (mM_per_ms_per_mV)');
LEGEND_CONSTANTS(:,50) = strpad('gL in component parameters (per_ms)');
LEGEND_CONSTANTS(:,51) = strpad('GLU in component parameters (mM)');
LEGEND_CONSTANTS(:,52) = strpad('gprime in component parameters (per_ms)');
LEGEND_CONSTANTS(:,53) = strpad('H in component parameters (mM)');
LEGEND_CONSTANTS(:,54) = strpad('hm in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,55) = strpad('HTRPNtot in component parameters (mM)');
LEGEND_CONSTANTS(:,56) = strpad('ICahalf in component parameters (uA_per_cm2)');
LEGEND_CONSTANTS(:,57) = strpad('INaKmax in component parameters (uA_per_cm2)');
LEGEND_CONSTANTS(:,58) = strpad('IpCamax in component parameters (uA_per_cm2)');
LEGEND_CONSTANTS(:,59) = strpad('KAATeq in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,60) = strpad('KaCa in component parameters (mM)');
LEGEND_CONSTANTS(:,61) = strpad('KACOeq in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,62) = strpad('kact in component parameters (mM)');
LEGEND_CONSTANTS(:,64) = strpad('kaminus in component parameters (per_ms)');
LEGEND_CONSTANTS(:,65) = strpad('kaplus in component parameters (per_mM4_per_ms)');
LEGEND_CONSTANTS(:,66) = strpad('kbminus in component parameters (per_ms)');
LEGEND_CONSTANTS(:,67) = strpad('kbplus in component parameters (per_mM3_per_ms)');
LEGEND_CONSTANTS(:,68) = strpad('Kca in component parameters (mM)');
LEGEND_CONSTANTS(:,69) = strpad('kcminus in component parameters (per_ms)');
LEGEND_CONSTANTS(:,70) = strpad('kcnsASP in component parameters (per_ms)');
LEGEND_CONSTANTS(:,71) = strpad('kcplus in component parameters (per_ms)');
LEGEND_CONSTANTS(:,72) = strpad('KCS in component parameters (per_ms)');
LEGEND_CONSTANTS(:,73) = strpad('kf1 in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,74) = strpad('kfAAT in component parameters (per_ms)');
LEGEND_CONSTANTS(:,75) = strpad('kfACO in component parameters (per_ms)');
LEGEND_CONSTANTS(:,76) = strpad('Kfb in component parameters (mM)');
LEGEND_CONSTANTS(:,77) = strpad('kfFH in component parameters (per_ms)');
LEGEND_CONSTANTS(:,78) = strpad('KFHeq in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,79) = strpad('kfSL in component parameters (per_mM_per_ms)');
LEGEND_CONSTANTS(:,80) = strpad('kh_1 in component parameters (mM)');
LEGEND_CONSTANTS(:,81) = strpad('kh_2 in component parameters (mM)');
LEGEND_CONSTANTS(:,82) = strpad('Kh1 in component parameters (mM)');
LEGEND_CONSTANTS(:,83) = strpad('Kh2 in component parameters (mM)');
LEGEND_CONSTANTS(:,84) = strpad('Kh3 in component parameters (mM)');
LEGEND_CONSTANTS(:,85) = strpad('Kh4 in component parameters (mM)');
LEGEND_CONSTANTS(:,86) = strpad('khtrpn_minus in component parameters (per_ms)');
LEGEND_CONSTANTS(:,87) = strpad('khtrpn_plus in component parameters (per_mM_per_ms)');
LEGEND_CONSTANTS(:,88) = strpad('Ki_AM in component parameters (mM)');
LEGEND_CONSTANTS(:,89) = strpad('Ki_prime_SR in component parameters (mM)');
LEGEND_CONSTANTS(:,90) = strpad('Ki_SR in component parameters (mM)');
LEGEND_CONSTANTS(:,93) = strpad('kIDH in component parameters (per_ms)');
LEGEND_CONSTANTS(:,95) = strpad('KiFUM in component parameters (mM)');
LEGEND_CONSTANTS(:,96) = strpad('Kioaa in component parameters (mM)');
LEGEND_CONSTANTS(:,97) = strpad('KiOxaa in component parameters (mM)');
LEGEND_CONSTANTS(:,98) = strpad('kKGDH in component parameters (per_ms)');
LEGEND_CONSTANTS(:,99) = strpad('kltrpn_plus in component parameters (per_mM_per_ms)');
LEGEND_CONSTANTS(:,100) = strpad('kltrpn_minus in component parameters (per_ms)');
LEGEND_CONSTANTS(:,101) = strpad('Km1AT_NaK in component parameters (mM)');
LEGEND_CONSTANTS(:,102) = strpad('Km1ATP_CaP in component parameters (mM)');
LEGEND_CONSTANTS(:,103) = strpad('Km2ATP_CaP in component parameters (mM)');
LEGEND_CONSTANTS(:,104) = strpad('KmAcCoA in component parameters (mM)');
LEGEND_CONSTANTS(:,105) = strpad('Kmal in component parameters (mM)');
LEGEND_CONSTANTS(:,106) = strpad('KmATP_AM in component parameters (mM)');
LEGEND_CONSTANTS(:,107) = strpad('KmATP_SR in component parameters (mM)');
LEGEND_CONSTANTS(:,108) = strpad('KmCMDN in component parameters (mM)');
LEGEND_CONSTANTS(:,109) = strpad('KmCa in component parameters (mM)');
LEGEND_CONSTANTS(:,110) = strpad('KmCSQN in component parameters (mM)');
LEGEND_CONSTANTS(:,111) = strpad('kMDH in component parameters (per_ms)');
LEGEND_CONSTANTS(:,112) = strpad('Kmg in component parameters (mM)');
LEGEND_CONSTANTS(:,114) = strpad('Kmiso in component parameters (mM)');
LEGEND_CONSTANTS(:,115) = strpad('KmKG in component parameters (mM)');
LEGEND_CONSTANTS(:,117) = strpad('KmKo in component parameters (mM)');
LEGEND_CONSTANTS(:,119) = strpad('KmNa in component parameters (mM)');
LEGEND_CONSTANTS(:,120) = strpad('KmNai in component parameters (mM)');
LEGEND_CONSTANTS(:,121) = strpad('KmnsCa in component parameters (mM)');
LEGEND_CONSTANTS(:,122) = strpad('KmOaa in component parameters (mM)');
LEGEND_CONSTANTS(:,123) = strpad('KmpCa in component parameters (mM)');
LEGEND_CONSTANTS(:,124) = strpad('KmSucc in component parameters (mM)');
LEGEND_CONSTANTS(:,125) = strpad('Kna in component parameters (mM)');
LEGEND_CONSTANTS(:,126) = strpad('kNaCa in component parameters (uA_per_cm2)');
LEGEND_CONSTANTS(:,127) = strpad('Knca in component parameters (mM)');
LEGEND_CONSTANTS(:,128) = strpad('Ko in component parameters (mM)');
LEGEND_CONSTANTS(:,129) = strpad('Koff in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,130) = strpad('Krb in component parameters (mM)');
LEGEND_CONSTANTS(:,131) = strpad('kres in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,132) = strpad('kresf in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,133) = strpad('ksat in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,134) = strpad('kSDH in component parameters (per_ms)');
LEGEND_CONSTANTS(:,135) = strpad('KSLeq in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,136) = strpad('KSR in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,137) = strpad('ktrans in component parameters (mM)');
LEGEND_CONSTANTS(:,138) = strpad('kTrop_pn in component parameters (per_ms)');
LEGEND_CONSTANTS(:,139) = strpad('L in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,140) = strpad('LTRPNtot in component parameters (mM)');
LEGEND_CONSTANTS(:,141) = strpad('mcoop in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,142) = strpad('Mg in component parameters (mM)');
LEGEND_CONSTANTS(:,143) = strpad('n in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,144) = strpad('na in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,145) = strpad('Nao in component parameters (mM)');
LEGEND_CONSTANTS(:,146) = strpad('ncoop in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,147) = strpad('Nfb in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,148) = strpad('nID in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,149) = strpad('nKG in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,150) = strpad('Nrb in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,151) = strpad('omega in component parameters (per_ms)');
LEGEND_CONSTANTS(:,152) = strpad('p1 in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,153) = strpad('p2 in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,154) = strpad('p3 in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,155) = strpad('pa in component parameters (per_ms)');
LEGEND_CONSTANTS(:,156) = strpad('pb in component parameters (per_ms)');
LEGEND_CONSTANTS(:,157) = strpad('pc1 in component parameters (per_ms)');
LEGEND_CONSTANTS(:,158) = strpad('pc2 in component parameters (per_ms)');
LEGEND_CONSTANTS(:,159) = strpad('PCa in component parameters (cm_per_s)');
LEGEND_CONSTANTS(:,160) = strpad('Pi in component parameters (mM)');
LEGEND_CONSTANTS(:,161) = strpad('PK in component parameters (cm_per_s)');
LEGEND_CONSTANTS(:,162) = strpad('PnsK in component parameters (cm_per_s)');
LEGEND_CONSTANTS(:,163) = strpad('PnsNa in component parameters (cm_per_s)');
LEGEND_CONSTANTS(:,164) = strpad('r1 in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,165) = strpad('r2 in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,166) = strpad('r3 in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,167) = strpad('ra in component parameters (per_ms)');
LEGEND_CONSTANTS(:,168) = strpad('rb in component parameters (per_ms)');
LEGEND_CONSTANTS(:,169) = strpad('rc1 in component parameters (per_ms)');
LEGEND_CONSTANTS(:,170) = strpad('rc2 in component parameters (per_ms)');
LEGEND_CONSTANTS(:,171) = strpad('rhoF1 in component parameters (mM)');
LEGEND_CONSTANTS(:,172) = strpad('rhoREF in component parameters (mM)');
LEGEND_CONSTANTS(:,173) = strpad('rhoREN in component parameters (mM)');
LEGEND_CONSTANTS(:,174) = strpad('tautr in component parameters (ms)');
LEGEND_CONSTANTS(:,175) = strpad('tauxfer in component parameters (ms)');
LEGEND_CONSTANTS(:,176) = strpad('V_AM_scaler in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,177) = strpad('V_AM_max in component parameters (mM_per_ms)');
LEGEND_CONSTANTS(:,178) = strpad('v1 in component parameters (per_ms)');
LEGEND_CONSTANTS(:,179) = strpad('VJSR in component parameters (uL)');
LEGEND_CONSTANTS(:,180) = strpad('vmaxf in component parameters (per_ms)');
LEGEND_CONSTANTS(:,181) = strpad('vmaxr in component parameters (per_ms)');
LEGEND_CONSTANTS(:,182) = strpad('VmDT in component parameters (mM_per_ms)');
LEGEND_CONSTANTS(:,183) = strpad('VmNC in component parameters (mM_per_ms)');
LEGEND_CONSTANTS(:,184) = strpad('Vmuni in component parameters (mM_per_ms)');
LEGEND_CONSTANTS(:,185) = strpad('Vmyo in component parameters (uL)');
LEGEND_CONSTANTS(:,186) = strpad('VNSR in component parameters (uL)');
LEGEND_CONSTANTS(:,187) = strpad('VSS in component parameters (uL)');
LEGEND_CONSTANTS(:,188) = strpad('zeta in component parameters (N_per_mm2)');
LEGEND_CONSTANTS(:,189) = strpad('f_xb in component parameters (per_ms)');
LEGEND_CONSTANTS(:,190) = strpad('SL in component parameters (um)');
LEGEND_CONSTANTS(:,191) = strpad('gmin_xb in component parameters (per_ms)');
LEGEND_CONSTANTS(:,192) = strpad('zNa in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,193) = strpad('zK in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,194) = strpad('zCa in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,195) = strpad('one in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,196) = strpad('p_KNa in component parameters (dimensionless)');
LEGEND_CONSTANTS(:,197) = strpad('ATPi_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,198) = strpad('V_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,199) = strpad('C1_RyR_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,200) = strpad('C2_RyR_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,201) = strpad('O2_RyR_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,202) = strpad('mNa_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,203) = strpad('hNa_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,204) = strpad('jNa_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,205) = strpad('xKs_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,206) = strpad('Open_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,207) = strpad('OCa_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,208) = strpad('yCa_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,209) = strpad('Ki_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,210) = strpad('Nai_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,211) = strpad('Cai_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,213) = strpad('Dpsi_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,215) = strpad('Oaa_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,216) = strpad('AKG_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,217) = strpad('SCoA_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,218) = strpad('Succ_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,219) = strpad('FUM_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,220) = strpad('MAL_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,221) = strpad('ISOC_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,222) = strpad('Cam_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,223) = strpad('CaNSR_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,224) = strpad('CaJSR_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,225) = strpad('CaSS_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,226) = strpad('N1_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,227) = strpad('P0_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,228) = strpad('P1_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,229) = strpad('P2_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,230) = strpad('P3_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,231) = strpad('LTRPNCa_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,232) = strpad('HTRPNCa_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,233) = strpad('C1_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,234) = strpad('CCa0_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,235) = strpad('C0_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,236) = strpad('C2_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,237) = strpad('CCa1_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,238) = strpad('C3_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,239) = strpad('CCa2_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,240) = strpad('C4_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,241) = strpad('CCa3_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,242) = strpad('CCa4_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,243) = strpad('CrPi_mito_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,244) = strpad('CrPi_cyto_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,245) = strpad('ATPi_cyto_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,246) = strpad('ASP_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,247) = strpad('N0_initial in component initial_values (dimensionless)');
LEGEND_CONSTANTS(:,248) = strpad('Vtotal in component computed_constants (uL)');
LEGEND_CONSTANTS(:,304) = strpad('Vmito in component computed_constants (uL)');
LEGEND_CONSTANTS(:,249) = strpad('f_01 in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,305) = strpad('f_12 in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,313) = strpad('f_23 in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,317) = strpad('g0_01 in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,322) = strpad('g0_12 in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,327) = strpad('g0_23 in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,330) = strpad('paths in component computed_constants (per_ms3)');
LEGEND_CONSTANTS(:,333) = strpad('P1max in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,339) = strpad('P2max in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,344) = strpad('P3max in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,346) = strpad('Fmax in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,348) = strpad('fnormmax in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,250) = strpad('SLnorm in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,251) = strpad('Ktrop_Ca in component computed_constants (mM)');
LEGEND_CONSTANTS(:,306) = strpad('Ktrop_half in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,252) = strpad('Ntrop in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,350) = strpad('fnormmax2 in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,352) = strpad('La in component computed_constants (um)');
LEGEND_CONSTANTS(:,354) = strpad('Lm_prime in component computed_constants (um)');
LEGEND_CONSTANTS(:,356) = strpad('Lz in component computed_constants (um)');
LEGEND_CONSTANTS(:,358) = strpad('Lb in component computed_constants (um)');
LEGEND_CONSTANTS(:,360) = strpad('Lm in component computed_constants (um)');
LEGEND_CONSTANTS(:,331) = strpad('mod_factor in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,334) = strpad('g_01_mod in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,335) = strpad('g_12_mod in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,336) = strpad('g_23_mod in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,337) = strpad('g_01_off in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,340) = strpad('g_01_off_mod in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,302) = strpad('RT_over_F in component computed_constants (mV)');
LEGEND_CONSTANTS(:,253) = strpad('G_Ks in component computed_constants (mS_per_cm2)');
LEGEND_CONSTANTS(:,311) = strpad('G_K1 in component computed_constants (mS_per_cm2)');
LEGEND_CONSTANTS(:,254) = strpad('inv_5p98 in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,255) = strpad('Cao_341 in component computed_constants (mM)');
LEGEND_CONSTANTS(:,256) = strpad('ICamax_LHospital in component computed_constants (uA_per_cm2)');
LEGEND_CONSTANTS(:,257) = strpad('Pca_4En3 in component computed_constants (cm_per_ms)');
LEGEND_CONSTANTS(:,320) = strpad('F_over_RT in component computed_constants (per_mV)');
LEGEND_CONSTANTS(:,258) = strpad('inv_ICahalf in component computed_constants (cm2_per_uA)');
LEGEND_CONSTANTS(:,318) = strpad('PKFe3 in component computed_constants (C_cm_per_s_per_mol)');
LEGEND_CONSTANTS(:,325) = strpad('sigma in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,259) = strpad('inv_KmNai in component computed_constants (per_mM)');
LEGEND_CONSTANTS(:,328) = strpad('INaKmax_Ko_Ko_KmKo in component computed_constants (uA_per_cm2)');
LEGEND_CONSTANTS(:,260) = strpad('eta_1 in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,261) = strpad('Nao_p3 in component computed_constants (mM2)');
LEGEND_CONSTANTS(:,262) = strpad('KmCa_Cao in component computed_constants (mM3_cm2_per_uA)');
LEGEND_CONSTANTS(:,307) = strpad('KmCa_Cao_ksat in component computed_constants (mM3_cm2_per_uA)');
LEGEND_CONSTANTS(:,264) = strpad('KmnsCa_p3 in component computed_constants (mM3)');
LEGEND_CONSTANTS(:,319) = strpad('V_AM_scaler_max_1_f_01_12_23 in component computed_constants (mM_per_ms4)');
LEGEND_CONSTANTS(:,265) = strpad('KmATP_AM_Ki_AM in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,308) = strpad('DmuH_Constant in component computed_constants (mV)');
LEGEND_CONSTANTS(:,266) = strpad('VCS_C1 in component computed_constants (mM_per_ms)');
LEGEND_CONSTANTS(:,267) = strpad('one_inv_KACOeq in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,268) = strpad('VIDH_Constant in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,269) = strpad('kIDH_EtID in component computed_constants (mM_per_ms)');
LEGEND_CONSTANTS(:,271) = strpad('inv_KaCa in component computed_constants (per_mM)');
LEGEND_CONSTANTS(:,274) = strpad('Mg_Kmg_1 in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,309) = strpad('Mg_Kmg_1_Kca in component computed_constants (mM)');
LEGEND_CONSTANTS(:,275) = strpad('kKGDH_EtKG in component computed_constants (mM_per_ms)');
LEGEND_CONSTANTS(:,276) = strpad('CoA_KSLeq in component computed_constants (mM)');
LEGEND_CONSTANTS(:,277) = strpad('kSDH_EtSDH in component computed_constants (mM_per_ms)');
LEGEND_CONSTANTS(:,278) = strpad('KmSucc_KiFUM in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,279) = strpad('inv_KiOxaa in component computed_constants (per_mM)');
LEGEND_CONSTANTS(:,280) = strpad('kfFH_KFHeq in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,281) = strpad('kMDH_Fh_EtMD in component computed_constants (mM_per_ms)');
LEGEND_CONSTANTS(:,282) = strpad('Kmal_Kioaa in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,283) = strpad('VAAT_Constant in component computed_constants (mM_per_ms)');
LEGEND_CONSTANTS(:,284) = strpad('kcnsASP_KAATeq_kfAAT in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,285) = strpad('KfAAT_GLU in component computed_constants (per_ms_per_mM)');
LEGEND_CONSTANTS(:,286) = strpad('KfAAT_KAATeq in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,338) = strpad('exp_6_FRT_Dpsio in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,343) = strpad('FRT_6_g in component computed_constants (per_mV)');
LEGEND_CONSTANTS(:,345) = strpad('ra_rc1_exp_6_FRT_Dpsio in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,347) = strpad('r1_exp_6_FRT_Dpsio in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,349) = strpad('rhoREN_ra_rc1_exp_6_FRT_Dpsio in component computed_constants (mM_per_ms)');
LEGEND_CONSTANTS(:,351) = strpad('rhoREN_rc2 in component computed_constants (mM_per_ms)');
LEGEND_CONSTANTS(:,353) = strpad('rhoREN_ra in component computed_constants (mM_per_ms)');
LEGEND_CONSTANTS(:,355) = strpad('rhoRen_6_ra in component computed_constants (mM_per_ms)');
LEGEND_CONSTANTS(:,357) = strpad('rhoRen_6_ra_rb in component computed_constants (mM_per_ms)');
LEGEND_CONSTANTS(:,359) = strpad('AREF in component computed_constants (mV)');
LEGEND_CONSTANTS(:,361) = strpad('exp_AREF_FRT in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,362) = strpad('ra_rc2_exp_AREF_FRT in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,363) = strpad('VFO_C1 in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,365) = strpad('ra_exp_AREF_FRT in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,368) = strpad('ra_rb in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,370) = strpad('VFO_VHFe_C1 in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,371) = strpad('r2_r3_exp_AREF_FRT in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,372) = strpad('exp_3_FRT_Dpsio in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,373) = strpad('FRT_3 in component computed_constants (per_mV)');
LEGEND_CONSTANTS(:,288) = strpad('kf1_Pi in component computed_constants (mM)');
LEGEND_CONSTANTS(:,374) = strpad('VATPase_C1 in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,375) = strpad('pa_pb_3 in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,376) = strpad('pa_300 in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,377) = strpad('p1_exp_3_FRT_Dpsio in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,323) = strpad('hm_F_over_RT in component computed_constants (per_mV)');
LEGEND_CONSTANTS(:,289) = strpad('VmDT_75 in component computed_constants (mM_per_ms)');
LEGEND_CONSTANTS(:,290) = strpad('VmDT_20 in component computed_constants (mM_per_ms)');
LEGEND_CONSTANTS(:,291) = strpad('inv_Kfb in component computed_constants (per_mM)');
LEGEND_CONSTANTS(:,292) = strpad('inv_Krb in component computed_constants (per_mM)');
LEGEND_CONSTANTS(:,293) = strpad('inv_tautr in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,294) = strpad('inv_tauxfer in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,378) = strpad('KmATP_SR_Ki_SR in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,379) = strpad('inv_Ki_prime_SR in component computed_constants (per_mM)');
LEGEND_CONSTANTS(:,366) = strpad('alpha_SL_fnormmax2 in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,367) = strpad('alpha_SL_fnormmax in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,314) = strpad('inv_LTRPNtot_Ktrop_half in component computed_constants (per_mM)');
LEGEND_CONSTANTS(:,310) = strpad('kTrop_pn_f_01 in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,341) = strpad('kTrop_pn_f_12_g_01_mod in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,342) = strpad('f_23_g_12_mod in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,295) = strpad('CMDNtot_KmCMDN in component computed_constants (mM2)');
LEGEND_CONSTANTS(:,296) = strpad('CSQNtot_KmCSQN in component computed_constants (mM2)');
LEGEND_CONSTANTS(:,297) = strpad('inv_ktrans in component computed_constants (per_mM)');
LEGEND_CONSTANTS(:,298) = strpad('inv_kact in component computed_constants (per_mM)');
LEGEND_CONSTANTS(:,299) = strpad('Vmuni_ktrans in component computed_constants (per_ms)');
LEGEND_CONSTANTS(:,324) = strpad('FRT2 in component computed_constants (per_mV)');
LEGEND_CONSTANTS(:,300) = strpad('b_05 in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,380) = strpad('Acap_Vmyo_F in component computed_constants (mmol_per_C_per_cm)');
LEGEND_CONSTANTS(:,381) = strpad('Acap_VSS_F in component computed_constants (mmol_per_C_per_cm)');
LEGEND_CONSTANTS(:,382) = strpad('VJSR_VSS in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,383) = strpad('Vmyo_VSS in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,384) = strpad('Vmyo_VNSR in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,385) = strpad('VJSR_VNSR in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,386) = strpad('inv_C_m in component computed_constants (cm2_per_uF)');
LEGEND_CONSTANTS(:,303) = strpad('inv_bL in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,387) = strpad('inv_Cmito in component computed_constants (mV_per_mM)');
LEGEND_CONSTANTS(:,388) = strpad('two_b in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,301) = strpad('inv_keq in component computed_constants (dimensionless)');
LEGEND_CONSTANTS(:,369) = strpad('zeta_alpha_SL_fnormmax in component computed_constants (N_per_mm2)');
LEGEND_CONSTANTS(:,364) = strpad('alpha_SL in component computed_constants (dimensionless)');
LEGEND_STATES(:,1) = strpad('ATPi in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,16) = strpad('inv_ATPi in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,20) = strpad('VF_over_RT in component model (dimensionless)');
LEGEND_STATES(:,2) = strpad('V in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,23) = strpad('exp_VF_over_RT in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,26) = strpad('VFsq_over_RT in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,28) = strpad('exp2VFRT in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,30) = strpad('O1_RyR in component model (dimensionless)');
LEGEND_STATES(:,3) = strpad('C1_RyR in component model (dimensionless)');
LEGEND_STATES(:,4) = strpad('C2_RyR in component model (dimensionless)');
LEGEND_STATES(:,5) = strpad('O2_RyR in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,1) = strpad('V_30 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,125) = strpad('V_E_K in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,122) = strpad('INa in component model (dimensionless)');
LEGEND_STATES(:,6) = strpad('mNa in component model (dimensionless)');
LEGEND_STATES(:,7) = strpad('hNa in component model (dimensionless)');
LEGEND_STATES(:,8) = strpad('jNa in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,134) = strpad('IKs in component model (dimensionless)');
LEGEND_STATES(:,9) = strpad('xKs in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,126) = strpad('K1Alpha in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,127) = strpad('K1Beta in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,128) = strpad('K1_inf in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,129) = strpad('IK1 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,123) = strpad('INab in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,130) = strpad('IKp in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,32) = strpad('ICamax in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,34) = strpad('ICaK in component model (dimensionless)');
LEGEND_STATES(:,10) = strpad('Open in component model (dimensionless)');
LEGEND_STATES(:,11) = strpad('OCa in component model (dimensionless)');
LEGEND_STATES(:,12) = strpad('yCa in component model (dimensionless)');
LEGEND_STATES(:,13) = strpad('Ki in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,36) = strpad('ICa in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,38) = strpad('NaiP1p5 in component model (dimensionless)');
LEGEND_STATES(:,14) = strpad('Nai in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,40) = strpad('INaK in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,42) = strpad('exp_eta_VF_over_RT in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,44) = strpad('exp_eta1_VF_over_RT in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,46) = strpad('INaCa in component model (dimensionless)');
LEGEND_STATES(:,15) = strpad('Cai in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,132) = strpad('ICab in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,48) = strpad('IpCa in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,50) = strpad('CaiP3 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,52) = strpad('common in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,54) = strpad('InsNa in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,56) = strpad('InsK in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,58) = strpad('InsCa in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,60) = strpad('V_AM in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,62) = strpad('ATPm in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,64) = strpad('DmuH in component model (dimensionless)');
LEGEND_STATES(:,17) = strpad('Dpsi in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,69) = strpad('exp_FRT_6_g_DmuH in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,70) = strpad('FRT2_Dpsi in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,71) = strpad('VCS in component model (dimensionless)');
LEGEND_STATES(:,19) = strpad('Oaa in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,72) = strpad('VACO in component model (dimensionless)');
LEGEND_STATES(:,20) = strpad('AKG in component model (dimensionless)');
LEGEND_STATES(:,21) = strpad('SCoA in component model (dimensionless)');
LEGEND_STATES(:,22) = strpad('Succ in component model (dimensionless)');
LEGEND_STATES(:,23) = strpad('FUM in component model (dimensionless)');
LEGEND_STATES(:,24) = strpad('MAL in component model (dimensionless)');
LEGEND_STATES(:,25) = strpad('ISOC in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,73) = strpad('Fa in component model (dimensionless)');
LEGEND_STATES(:,26) = strpad('Cam in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,74) = strpad('Fi in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,75) = strpad('VIDH in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,76) = strpad('a__1 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,77) = strpad('VKGDH in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,78) = strpad('VSL in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,79) = strpad('VSDH in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,80) = strpad('VFH in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,81) = strpad('VMDH in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,82) = strpad('VAAT in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,83) = strpad('AREN in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,84) = strpad('denominator1 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,87) = strpad('denominator2 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,91) = strpad('denominator3 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,85) = strpad('VNO in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,86) = strpad('VHNe in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,88) = strpad('VHFe in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,89) = strpad('exp_3FRT_DmuH in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,90) = strpad('AF1 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,92) = strpad('VATPase in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,93) = strpad('Vhu in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,96) = strpad('VANT in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,97) = strpad('Vhleak in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,3) = strpad('MAlpha in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,9) = strpad('MBeta in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,14) = strpad('inv_MBeta_MAlpha in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,18) = strpad('tmNa in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,4) = strpad('HAlpha in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,10) = strpad('HBeta in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,5) = strpad('JAlpha in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,11) = strpad('JBeta in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,98) = strpad('fb in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,99) = strpad('rb in component model (per_ms)');
LEGEND_STATES(:,27) = strpad('CaNSR in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,100) = strpad('Jup in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,102) = strpad('Jrel in component model (dimensionless)');
LEGEND_STATES(:,28) = strpad('CaJSR in component model (dimensionless)');
LEGEND_STATES(:,29) = strpad('CaSS in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,103) = strpad('Jtr in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,106) = strpad('Jxfer in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,109) = strpad('P1_N1_P2_P3 in component model (dimensionless)');
LEGEND_STATES(:,30) = strpad('N1 in component model (dimensionless)');
LEGEND_STATES(:,31) = strpad('P0 in component model (dimensionless)');
LEGEND_STATES(:,32) = strpad('P1 in component model (dimensionless)');
LEGEND_STATES(:,33) = strpad('P2 in component model (dimensionless)');
LEGEND_STATES(:,34) = strpad('P3 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,25) = strpad('N1_differential in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,12) = strpad('P0_differential in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,15) = strpad('P1_differential in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,19) = strpad('P2_differential in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,22) = strpad('P3_differential in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,112) = strpad('FN_Ca in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,110) = strpad('force_norm in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,111) = strpad('force in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,6) = strpad('kTrop_np in component model (dimensionless)');
LEGEND_STATES(:,35) = strpad('LTRPNCa in component model (dimensionless)');
LEGEND_STATES(:,36) = strpad('HTRPNCa in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,113) = strpad('LTRPNCa_differential in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,114) = strpad('HTRPNCa_differential in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,115) = strpad('Jtrpn in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,107) = strpad('beta_SS in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,108) = strpad('beta_JSR in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,116) = strpad('beta_i in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,117) = strpad('Cai_ktrans_plus1 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,118) = strpad('Cai_ktrans_plus1_p3 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,119) = strpad('Vuni in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,120) = strpad('VnaCa in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,7) = strpad('alpha in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,13) = strpad('beta in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,17) = strpad('alpha_prime in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,21) = strpad('beta_prime in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,24) = strpad('C0_to_C1 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,27) = strpad('C1_to_C2 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,29) = strpad('C2_to_C3 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,31) = strpad('C3_to_C4 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,33) = strpad('CCa0_to_CCa1 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,35) = strpad('CCa1_to_CCa2 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,37) = strpad('CCa2_to_CCa3 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,39) = strpad('CCa3_to_CCa4 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,41) = strpad('C1_to_C0 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,43) = strpad('C2_to_C1 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,45) = strpad('C3_to_C2 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,47) = strpad('C4_to_C3 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,49) = strpad('CCa1_to_CCa0 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,51) = strpad('CCa2_to_CCa1 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,53) = strpad('CCa3_to_CCa2 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,55) = strpad('CCa4_to_CCa3 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,57) = strpad('gamma in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,59) = strpad('C0_to_CCa0 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,61) = strpad('C1_to_CCa1 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,63) = strpad('C2_to_CCa2 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,65) = strpad('C3_to_CCa3 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,67) = strpad('C4_to_CCa4 in component model (dimensionless)');
LEGEND_CONSTANTS(:,312) = strpad('CCa0_to_C0 in component model (dimensionless)');
LEGEND_CONSTANTS(:,316) = strpad('CCa1_to_C1 in component model (dimensionless)');
LEGEND_CONSTANTS(:,321) = strpad('CCa2_to_C2 in component model (dimensionless)');
LEGEND_CONSTANTS(:,326) = strpad('CCa3_to_C3 in component model (dimensionless)');
LEGEND_CONSTANTS(:,329) = strpad('CCa4_to_C4 in component model (dimensionless)');
LEGEND_STATES(:,37) = strpad('C1 in component model (dimensionless)');
LEGEND_STATES(:,38) = strpad('CCa0 in component model (dimensionless)');
LEGEND_STATES(:,39) = strpad('C0 in component model (dimensionless)');
LEGEND_STATES(:,40) = strpad('C2 in component model (dimensionless)');
LEGEND_STATES(:,41) = strpad('CCa1 in component model (dimensionless)');
LEGEND_STATES(:,42) = strpad('C3 in component model (dimensionless)');
LEGEND_STATES(:,43) = strpad('CCa2 in component model (dimensionless)');
LEGEND_STATES(:,44) = strpad('C4 in component model (dimensionless)');
LEGEND_STATES(:,45) = strpad('CCa3 in component model (dimensionless)');
LEGEND_STATES(:,46) = strpad('CCa4 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,101) = strpad('Vt_CRP2 in component model (dimensionless)');
LEGEND_STATES(:,47) = strpad('CrPi_mito in component model (dimensionless)');
LEGEND_STATES(:,48) = strpad('CrPi_cyto in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,104) = strpad('VCK_cyto in component model (dimensionless)');
LEGEND_STATES(:,49) = strpad('ATPi_cyto in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,105) = strpad('VCK_mito in component model (dimensionless)');
LEGEND_STATES(:,50) = strpad('ASP in component model (dimensionless)');
LEGEND_STATES(:,51) = strpad('N0 in component model (dimensionless)');
LEGEND_ALGEBRAIC(:,124) = strpad('reversal_potential in component one_ion (dimensionless)');
LEGEND_ALGEBRAIC(:,121) = strpad('reversal_potential in component one_ion (dimensionless)');
LEGEND_ALGEBRAIC(:,133) = strpad('reversal_potential in component two_ions (dimensionless)');
LEGEND_ALGEBRAIC(:,131) = strpad('reversal_potential in component one_ion (dimensionless)');
LEGEND_RATES(:,6) = strpad('d/dt mNa in component model (dimensionless)');
LEGEND_RATES(:,7) = strpad('d/dt hNa in component model (dimensionless)');
LEGEND_RATES(:,8) = strpad('d/dt jNa in component model (dimensionless)');
LEGEND_RATES(:,9) = strpad('d/dt xKs in component model (dimensionless)');
LEGEND_RATES(:,31) = strpad('d/dt P0 in component model (dimensionless)');
LEGEND_RATES(:,32) = strpad('d/dt P1 in component model (dimensionless)');
LEGEND_RATES(:,33) = strpad('d/dt P2 in component model (dimensionless)');
LEGEND_RATES(:,34) = strpad('d/dt P3 in component model (dimensionless)');
LEGEND_RATES(:,30) = strpad('d/dt N1 in component model (dimensionless)');
LEGEND_RATES(:,51) = strpad('d/dt N0 in component model (dimensionless)');
LEGEND_RATES(:,35) = strpad('d/dt LTRPNCa in component model (dimensionless)');
LEGEND_RATES(:,36) = strpad('d/dt HTRPNCa in component model (dimensionless)');
LEGEND_RATES(:,14) = strpad('d/dt Nai in component model (dimensionless)');
LEGEND_RATES(:,13) = strpad('d/dt Ki in component model (dimensionless)');
LEGEND_RATES(:,15) = strpad('d/dt Cai in component model (dimensionless)');
LEGEND_RATES(:,29) = strpad('d/dt CaSS in component model (dimensionless)');
LEGEND_RATES(:,28) = strpad('d/dt CaJSR in component model (dimensionless)');
LEGEND_RATES(:,27) = strpad('d/dt CaNSR in component model (dimensionless)');
LEGEND_RATES(:,2) = strpad('d/dt V in component model (dimensionless)');
LEGEND_RATES(:,3) = strpad('d/dt C1_RyR in component model (dimensionless)');
LEGEND_RATES(:,5) = strpad('d/dt O2_RyR in component model (dimensionless)');
LEGEND_RATES(:,4) = strpad('d/dt C2_RyR in component model (dimensionless)');
LEGEND_RATES(:,39) = strpad('d/dt C0 in component model (dimensionless)');
LEGEND_RATES(:,37) = strpad('d/dt C1 in component model (dimensionless)');
LEGEND_RATES(:,40) = strpad('d/dt C2 in component model (dimensionless)');
LEGEND_RATES(:,42) = strpad('d/dt C3 in component model (dimensionless)');
LEGEND_RATES(:,44) = strpad('d/dt C4 in component model (dimensionless)');
LEGEND_RATES(:,10) = strpad('d/dt Open in component model (dimensionless)');
LEGEND_RATES(:,38) = strpad('d/dt CCa0 in component model (dimensionless)');
LEGEND_RATES(:,41) = strpad('d/dt CCa1 in component model (dimensionless)');
LEGEND_RATES(:,43) = strpad('d/dt CCa2 in component model (dimensionless)');
LEGEND_RATES(:,45) = strpad('d/dt CCa3 in component model (dimensionless)');
LEGEND_RATES(:,46) = strpad('d/dt CCa4 in component model (dimensionless)');
LEGEND_RATES(:,12) = strpad('d/dt yCa in component model (dimensionless)');
LEGEND_RATES(:,11) = strpad('d/dt OCa in component model (dimensionless)');
LEGEND_RATES(:,47) = strpad('d/dt CrPi_mito in component model (dimensionless)');
LEGEND_RATES(:,48) = strpad('d/dt CrPi_cyto in component model (dimensionless)');
LEGEND_RATES(:,1) = strpad('d/dt ATPi in component model (dimensionless)');
LEGEND_RATES(:,49) = strpad('d/dt ATPi_cyto in component model (dimensionless)');
LEGEND_RATES(:,26) = strpad('d/dt Cam in component model (dimensionless)');
LEGEND_RATES(:,17) = strpad('d/dt Dpsi in component model (dimensionless)');
LEGEND_RATES(:,25) = strpad('d/dt ISOC in component model (dimensionless)');
LEGEND_RATES(:,20) = strpad('d/dt AKG in component model (dimensionless)');
LEGEND_RATES(:,21) = strpad('d/dt SCoA in component model (dimensionless)');
LEGEND_RATES(:,22) = strpad('d/dt Succ in component model (dimensionless)');
LEGEND_RATES(:,23) = strpad('d/dt FUM in component model (dimensionless)');
LEGEND_RATES(:,24) = strpad('d/dt MAL in component model (dimensionless)');
LEGEND_RATES(:,19) = strpad('d/dt Oaa in component model (dimensionless)');
LEGEND_RATES(:,50) = strpad('d/dt ASP in component model (dimensionless)');
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) = 4e3;
CONSTANTS(:,2) = 0.5;
CONSTANTS(:,3) = -100.0;
CONSTANTS(:,4) = 0.0;
CONSTANTS(:,5) = 0.0;
CONSTANTS(:,6) = 96.5;
CONSTANTS(:,7) = 8.314;
CONSTANTS(:,8) = 310.0;
CONSTANTS(:,9) = 1e-7;
CONSTANTS(:,10) = 2.0e-3;
CONSTANTS(:,11) = 1.4e-4;
CONSTANTS(:,12) = 1.33e-6;
CONSTANTS(:,13) = 0.0095;
CONSTANTS(:,14) = 25.0;
CONSTANTS(:,15) = 25.0;
CONSTANTS(:,16) = 1.0E-5;
CONSTANTS(:,17) = 1.534E-4;
CONSTANTS(:,18) = 1.0;
CONSTANTS(:,19) = 2.0;
CONSTANTS(:,20) = 0.5;
CONSTANTS(:,21) = 2.0;
CONSTANTS(:,22) = 1.0;
CONSTANTS(:,23) = 2.0;
CONSTANTS(:,24) = 1.0;
CONSTANTS(:,25) = 1.5;
CONSTANTS(:,26) = 50E-3;
CONSTANTS(:,27) = 1.812E-3;
CONSTANTS(:,28) = 10.0;
CONSTANTS(:,29) = 0.02;
CONSTANTS(:,30) = 35.0;
CONSTANTS(:,31) = -0.6;
CONSTANTS(:,32) = 50.0;
CONSTANTS(:,33) = 0.35;
CONSTANTS(:,34) = 0.4;
CONSTANTS(:,35) = 0.109;
CONSTANTS(:,36) = 0.5;
CONSTANTS(:,37) = 0.154;
CONSTANTS(:,38) = 0.5;
CONSTANTS(:,39) = 0.01;
CONSTANTS(:,40) = 1.24;
CONSTANTS(:,41) = 0.3;
CONSTANTS(:,42) = 0.0003;
CONSTANTS(:,43) = 0.0;
CONSTANTS(:,44) = 0.85;
CONSTANTS(:,45) = 0.003217;
CONSTANTS(:,46) = 0.00828;
CONSTANTS(:,47) = 12.8;
CONSTANTS(:,48) = 0.000545;
CONSTANTS(:,49) = 2.0E-7;
CONSTANTS(:,50) = 2.0;
CONSTANTS(:,51) = 10.0;
CONSTANTS(:,52) = 0.0;
CONSTANTS(:,53) = 2.5E-5;
CONSTANTS(:,54) = 0.5;
CONSTANTS(:,55) = 140E-3;
CONSTANTS(:,56) = -0.4583;
CONSTANTS(:,57) = 3.147;
CONSTANTS(:,58) = 0.575;
CONSTANTS(:,59) = 6.6;
CONSTANTS(:,60) = 0.0005;
CONSTANTS(:,61) = 2.22;
CONSTANTS(:,62) = 0.00038;
CONSTANTS(:,63) = 0.62;
CONSTANTS(:,64) = 0.576;
CONSTANTS(:,65) = 1.215E10;
CONSTANTS(:,66) = 1.930;
CONSTANTS(:,67) = 4.05E6;
CONSTANTS(:,68) = 0.00127;
CONSTANTS(:,69) = 0.0008;
CONSTANTS(:,70) = 1.5E-6;
CONSTANTS(:,71) = 0.10;
CONSTANTS(:,72) = 0.5;
CONSTANTS(:,73) = 1.71E6;
CONSTANTS(:,74) = 6.44E-4;
CONSTANTS(:,75) = 0.0125;
CONSTANTS(:,76) = 0.00024;
CONSTANTS(:,77) = 0.00332;
CONSTANTS(:,78) = 1.0;
CONSTANTS(:,79) = 0.005;
CONSTANTS(:,80) = 8.1E-5;
CONSTANTS(:,81) = 5.98E-5;
CONSTANTS(:,82) = 1.131E-5;
CONSTANTS(:,83) = 26.7;
CONSTANTS(:,84) = 6.68E-9;
CONSTANTS(:,85) = 5.62E-6;
CONSTANTS(:,86) = 3.3E-4;
CONSTANTS(:,87) = 100.0;
CONSTANTS(:,88) = 0.26;
CONSTANTS(:,89) = 5.1;
CONSTANTS(:,90) = 0.14;
CONSTANTS(:,91) = 0.1;
CONSTANTS(:,92) = 1.0;
CONSTANTS(:,93) = 0.05;
CONSTANTS(:,94) = 0.19;
CONSTANTS(:,95) = 1.3;
CONSTANTS(:,96) = 0.0031;
CONSTANTS(:,97) = 0.15;
CONSTANTS(:,98) = 7.5E-2;
CONSTANTS(:,99) = 100.0;
CONSTANTS(:,100) = 40E-3;
CONSTANTS(:,101) = 0.008;
CONSTANTS(:,102) = 0.012;
CONSTANTS(:,103) = 0.23;
CONSTANTS(:,104) = 0.0126;
CONSTANTS(:,105) = 1.493;
CONSTANTS(:,106) = 0.03;
CONSTANTS(:,107) = 0.01;
CONSTANTS(:,108) = 2.38E-3;
CONSTANTS(:,109) = 1.38;
CONSTANTS(:,110) = 0.8;
CONSTANTS(:,111) = 0.111;
CONSTANTS(:,112) = 0.0308;
CONSTANTS(:,113) = 0.923;
CONSTANTS(:,114) = 1.52;
CONSTANTS(:,115) = 1.94;
CONSTANTS(:,116) = 38.7;
CONSTANTS(:,117) = 1.5;
CONSTANTS(:,118) = 0.2244;
CONSTANTS(:,119) = 87.5;
CONSTANTS(:,120) = 10.0;
CONSTANTS(:,121) = 0.0012;
CONSTANTS(:,122) = 0.00064;
CONSTANTS(:,123) = 0.0005;
CONSTANTS(:,124) = 0.03;
CONSTANTS(:,125) = 9.4;
CONSTANTS(:,126) = 9000.0;
CONSTANTS(:,127) = 3.75E-4;
CONSTANTS(:,128) = 5.4;
CONSTANTS(:,129) = 0.0399;
CONSTANTS(:,130) = 1.64269;
CONSTANTS(:,131) = 1.35E18;
CONSTANTS(:,132) = 5.765E13;
CONSTANTS(:,133) = 0.1;
CONSTANTS(:,134) = 0.005;
CONSTANTS(:,135) = 3.115;
CONSTANTS(:,136) = 2.5;
CONSTANTS(:,137) = 0.019;
CONSTANTS(:,138) = 0.04;
CONSTANTS(:,139) = 110.0;
CONSTANTS(:,140) = 70E-3;
CONSTANTS(:,141) = 3.0;
CONSTANTS(:,142) = 0.4;
CONSTANTS(:,143) = 3.0;
CONSTANTS(:,144) = 2.8;
CONSTANTS(:,145) = 140.0;
CONSTANTS(:,146) = 4.0;
CONSTANTS(:,147) = 1.4;
CONSTANTS(:,148) = 2.0;
CONSTANTS(:,149) = 1.2;
CONSTANTS(:,150) = 1.0;
CONSTANTS(:,151) = 0.01;
CONSTANTS(:,152) = 1.346E-8;
CONSTANTS(:,153) = 7.739E-7;
CONSTANTS(:,154) = 6.65E-15;
CONSTANTS(:,155) = 1.656E-8;
CONSTANTS(:,156) = 3.373E-10;
CONSTANTS(:,157) = 9.651E-17;
CONSTANTS(:,158) = 4.585E-17;
CONSTANTS(:,159) = 0.00124;
CONSTANTS(:,160) = 2.0;
CONSTANTS(:,161) = 1.11E-11;
CONSTANTS(:,162) = 0.0;
CONSTANTS(:,163) = 1.75E-7;
CONSTANTS(:,164) = 2.077E-18;
CONSTANTS(:,165) = 1.728E-9;
CONSTANTS(:,166) = 1.059E-26;
CONSTANTS(:,167) = 6.394E-13;
CONSTANTS(:,168) = 1.762E-16;
CONSTANTS(:,169) = 2.656E-22;
CONSTANTS(:,170) = 8.632E-30;
CONSTANTS(:,171) = 0.05;
CONSTANTS(:,172) = 3.75E-4;
CONSTANTS(:,173) = 1.0E-1;
CONSTANTS(:,174) = 0.574713;
CONSTANTS(:,175) = 9.09091;
CONSTANTS(:,176) = 15.0;
CONSTANTS(:,177) = 0.00048;
CONSTANTS(:,178) = 3.6;
CONSTANTS(:,179) = 0.16E-6;
CONSTANTS(:,180) = 0.29892E-3;
CONSTANTS(:,181) = 0.31793E-3;
CONSTANTS(:,182) = 0.015;
CONSTANTS(:,183) = 0.625E-4;
CONSTANTS(:,184) = 0.0275;
CONSTANTS(:,185) = 25.84E-6;
CONSTANTS(:,186) = 1.4E-6;
CONSTANTS(:,187) = 0.495E-9;
CONSTANTS(:,188) = 0.1;
CONSTANTS(:,189) = 0.05;
CONSTANTS(:,190) = 2.15;
CONSTANTS(:,191) = 0.1;
CONSTANTS(:,192) = 1;
CONSTANTS(:,193) = 1;
CONSTANTS(:,194) = 2;
CONSTANTS(:,195) = 1;
CONSTANTS(:,196) = 0.01833;
CONSTANTS(:,197) = 7.98691;
CONSTANTS(:,198) = -86.4154;
CONSTANTS(:,199) = 0.748798;
CONSTANTS(:,200) = 0.250904;
CONSTANTS(:,201) = 3.5175e-10;
CONSTANTS(:,202) = 0.0327969;
CONSTANTS(:,203) = 0.988991;
CONSTANTS(:,204) = 0.992918;
CONSTANTS(:,205) = 0.000127552;
CONSTANTS(:,206) = 6.96577e-24;
CONSTANTS(:,207) = 0;
CONSTANTS(:,208) = 0.941505;
CONSTANTS(:,209) = 148.065;
CONSTANTS(:,210) = 7.51215;
CONSTANTS(:,211) = 6.71512e-05;
CONSTANTS(:,212) = 0.0258454;
CONSTANTS(:,213) = 164.073;
CONSTANTS(:,214) = 7.76311;
CONSTANTS(:,215) = 1.08962e-07;
CONSTANTS(:,216) = 0.000610554;
CONSTANTS(:,217) = 0.247364;
CONSTANTS(:,218) = 0.000394005;
CONSTANTS(:,219) = 0.0191924;
CONSTANTS(:,220) = 0.00925885;
CONSTANTS(:,221) = 0.496682;
CONSTANTS(:,222) = 0.000137836;
CONSTANTS(:,223) = 0.255288;
CONSTANTS(:,224) = 0.255138;
CONSTANTS(:,225) = 8.25461e-05;
CONSTANTS(:,226) = 5.71121e-05;
CONSTANTS(:,227) = 6.63724e-05;
CONSTANTS(:,228) = 5.73114e-05;
CONSTANTS(:,229) = 0.000106992;
CONSTANTS(:,230) = 9.31884e-05;
CONSTANTS(:,231) = 0.0100663;
CONSTANTS(:,232) = 0.133453;
CONSTANTS(:,233) = 1.04295e-05;
CONSTANTS(:,234) = 0.00156783;
CONSTANTS(:,235) = 0.998424;
CONSTANTS(:,236) = 4.08551e-11;
CONSTANTS(:,237) = 6.55103e-08;
CONSTANTS(:,238) = 7.11287e-17;
CONSTANTS(:,239) = 1.02648e-12;
CONSTANTS(:,240) = 4.64382e-23;
CONSTANTS(:,241) = 7.14846e-18;
CONSTANTS(:,242) = 1.86682e-23;
CONSTANTS(:,243) = 19.4385;
CONSTANTS(:,244) = 19.4302;
CONSTANTS(:,245) = 7.97824;
CONSTANTS(:,246) = 0.0502614;
CONSTANTS(:,247) = 0.999618;
CONSTANTS(:,248) = (CONSTANTS(:,185)+CONSTANTS(:,179)+CONSTANTS(:,186)+CONSTANTS(:,187))./0.640000;
CONSTANTS(:,249) =  3.00000.*CONSTANTS(:,189);
CONSTANTS(:,250) = (CONSTANTS(:,190) - 1.70000)./0.600000;
CONSTANTS(:,251) = CONSTANTS(:,100)./CONSTANTS(:,99);
CONSTANTS(:,252) =  3.50000.*CONSTANTS(:,190) - 2.00000;
CONSTANTS(:,253) =  0.282000.*power((CONSTANTS(:,128)./5.40000), 1.0 ./ 2);
CONSTANTS(:,254) = 1.00000./5.98000;
CONSTANTS(:,255) =  CONSTANTS(:,23).*341.000;
CONSTANTS(:,256) =  2.00000.*CONSTANTS(:,159).*1000.00.*CONSTANTS(:,6).*(1.00000 -  341.000.*CONSTANTS(:,23));
CONSTANTS(:,257) =  4.00000.*0.00100000.*CONSTANTS(:,159);
CONSTANTS(:,258) = 1.00000./CONSTANTS(:,56);
CONSTANTS(:,259) = 1.00000./CONSTANTS(:,120);
CONSTANTS(:,260) = CONSTANTS(:,33) - 1.00000;
CONSTANTS(:,261) = power(CONSTANTS(:,145), 3.00000)./CONSTANTS(:,23);
CONSTANTS(:,262) =  (CONSTANTS(:,109)+CONSTANTS(:,23)).*((power(CONSTANTS(:,119), 3.00000)+power(CONSTANTS(:,145), 3.00000))./( CONSTANTS(:,126).*CONSTANTS(:,23)));
CONSTANTS(:,263) = 1.00000./CONSTANTS(:,92);
CONSTANTS(:,264) = power(CONSTANTS(:,121), 3.00000);
CONSTANTS(:,265) = CONSTANTS(:,106)./CONSTANTS(:,88);
CONSTANTS(:,266) = ( CONSTANTS(:,72).*CONSTANTS(:,34).*CONSTANTS(:,18))./(CONSTANTS(:,104)+CONSTANTS(:,18));
CONSTANTS(:,267) = 1.00000+1.00000./CONSTANTS(:,61);
CONSTANTS(:,268) = 1.00000+CONSTANTS(:,53)./CONSTANTS(:,80)+CONSTANTS(:,81)./CONSTANTS(:,53);
CONSTANTS(:,269) =  CONSTANTS(:,93).*CONSTANTS(:,35);
CONSTANTS(:,270) = 1.00000./CONSTANTS(:,63);
CONSTANTS(:,271) = 1.00000./CONSTANTS(:,60);
CONSTANTS(:,272) = 1.00000./CONSTANTS(:,94);
CONSTANTS(:,273) = CONSTANTS(:,116)./CONSTANTS(:,113);
CONSTANTS(:,274) = CONSTANTS(:,142)./CONSTANTS(:,112)+1.00000;
CONSTANTS(:,275) =  CONSTANTS(:,98).*CONSTANTS(:,36);
CONSTANTS(:,276) = CONSTANTS(:,29)./CONSTANTS(:,135);
CONSTANTS(:,277) =  CONSTANTS(:,134).*CONSTANTS(:,38);
CONSTANTS(:,278) = CONSTANTS(:,124)./CONSTANTS(:,95);
CONSTANTS(:,279) = 1.00000./CONSTANTS(:,97);
CONSTANTS(:,280) = CONSTANTS(:,77)./CONSTANTS(:,78);
CONSTANTS(:,281) =  power(1.00000./(1.00000+CONSTANTS(:,84)./CONSTANTS(:,53)+ CONSTANTS(:,84).*(CONSTANTS(:,85)./power(CONSTANTS(:,53), 2.00000))), 2.00000).*(1.00000./(1.00000+CONSTANTS(:,53)./CONSTANTS(:,82)+power(CONSTANTS(:,53), 2.00000)./( CONSTANTS(:,82).*CONSTANTS(:,83)))+CONSTANTS(:,129)).*CONSTANTS(:,111).*CONSTANTS(:,37);
CONSTANTS(:,282) = CONSTANTS(:,105)./CONSTANTS(:,96);
CONSTANTS(:,283) =  CONSTANTS(:,74).*CONSTANTS(:,51).*CONSTANTS(:,70).*(CONSTANTS(:,59)./CONSTANTS(:,74));
CONSTANTS(:,284) =  CONSTANTS(:,70).*(CONSTANTS(:,59)./CONSTANTS(:,74));
CONSTANTS(:,285) =  CONSTANTS(:,74).*CONSTANTS(:,51);
CONSTANTS(:,286) = CONSTANTS(:,74)./CONSTANTS(:,59);
CONSTANTS(:,287) =  CONSTANTS(:,131).*(CONSTANTS(:,131)./CONSTANTS(:,113));
CONSTANTS(:,288) = CONSTANTS(:,73)./CONSTANTS(:,160);
CONSTANTS(:,289) =  0.750000.*CONSTANTS(:,182);
CONSTANTS(:,290) =  20.0000.*CONSTANTS(:,182);
CONSTANTS(:,291) = 1.00000./CONSTANTS(:,76);
CONSTANTS(:,292) = 1.00000./CONSTANTS(:,130);
CONSTANTS(:,293) = 1.00000./CONSTANTS(:,174);
CONSTANTS(:,294) = 1.00000./CONSTANTS(:,175);
CONSTANTS(:,295) =  CONSTANTS(:,26).*CONSTANTS(:,108);
CONSTANTS(:,296) =  CONSTANTS(:,30).*CONSTANTS(:,110);
CONSTANTS(:,297) = 1.00000./CONSTANTS(:,137);
CONSTANTS(:,298) = 1.00000./CONSTANTS(:,62);
CONSTANTS(:,299) = CONSTANTS(:,184)./CONSTANTS(:,137);
CONSTANTS(:,300) =  CONSTANTS(:,20).*0.500000;
CONSTANTS(:,301) = 1.00000./CONSTANTS(:,13);
CONSTANTS(:,302) = ( CONSTANTS(:,7).*CONSTANTS(:,8))./CONSTANTS(:,6);
CONSTANTS(:,303) = 1.00000./CONSTANTS(:,21);
CONSTANTS(:,304) =  CONSTANTS(:,248).*0.360000;
CONSTANTS(:,305) =  10.0000.*CONSTANTS(:,189);
CONSTANTS(:,306) = 1.00000./(1.00000+CONSTANTS(:,251)./(1.70000./1000.00+ ((0.900000./1000.00 - 1.70000./1000.00)./(2.30000 - 1.70000)).*(CONSTANTS(:,190) - 1.70000)));
CONSTANTS(:,307) =  CONSTANTS(:,262).*CONSTANTS(:,133);
CONSTANTS(:,308) =  -2.30300.*CONSTANTS(:,302).*CONSTANTS(:,31);
CONSTANTS(:,309) = CONSTANTS(:,274)./CONSTANTS(:,68);
CONSTANTS(:,310) =  - CONSTANTS(:,138) - CONSTANTS(:,249);
CONSTANTS(:,311) =  0.750000.*power((CONSTANTS(:,128)./5.40000), 1.0 ./ 2);
CONSTANTS(:,312) = CONSTANTS(:,151);
CONSTANTS(:,313) =  7.00000.*CONSTANTS(:,189);
CONSTANTS(:,314) = 1.00000./( CONSTANTS(:,140).*CONSTANTS(:,306));
CONSTANTS(:,315) =  1000.00.*CONSTANTS(:,6);
CONSTANTS(:,316) =  CONSTANTS(:,312).*CONSTANTS(:,303);
CONSTANTS(:,317) =  1.00000.*CONSTANTS(:,191);
CONSTANTS(:,318) =  CONSTANTS(:,315).*CONSTANTS(:,161);
CONSTANTS(:,319) =  CONSTANTS(:,176).*(CONSTANTS(:,177)./(CONSTANTS(:,249)+CONSTANTS(:,305)+CONSTANTS(:,313)));
CONSTANTS(:,320) = 1.00000./CONSTANTS(:,302);
CONSTANTS(:,321) =  CONSTANTS(:,316).*CONSTANTS(:,303);
CONSTANTS(:,322) =  2.00000.*CONSTANTS(:,191);
CONSTANTS(:,323) =  CONSTANTS(:,54).*CONSTANTS(:,320);
CONSTANTS(:,324) =  2.00000.*CONSTANTS(:,320);
CONSTANTS(:,325) =  0.0365000.*((exp(CONSTANTS(:,145)./67.3000) - 1.00000)./7.00000);
CONSTANTS(:,326) =  CONSTANTS(:,321).*CONSTANTS(:,303);
CONSTANTS(:,327) =  3.00000.*CONSTANTS(:,191);
CONSTANTS(:,328) =  CONSTANTS(:,57).*(CONSTANTS(:,128)./(CONSTANTS(:,128)+CONSTANTS(:,117)));
CONSTANTS(:,329) =  CONSTANTS(:,326).*CONSTANTS(:,303);
CONSTANTS(:,330) =  CONSTANTS(:,317).*CONSTANTS(:,322).*CONSTANTS(:,327)+ CONSTANTS(:,249).*CONSTANTS(:,322).*CONSTANTS(:,327)+ CONSTANTS(:,249).*CONSTANTS(:,305).*CONSTANTS(:,327)+ CONSTANTS(:,249).*CONSTANTS(:,305).*CONSTANTS(:,313);
CONSTANTS(:,331) = 1.00000+(2.30000 - CONSTANTS(:,190))./power((2.30000 - 1.70000)./1.00000, 1.60000);
CONSTANTS(:,332) = 1.00000./CONSTANTS(:,91);
CONSTANTS(:,333) = ( CONSTANTS(:,249).*( 2.00000.*CONSTANTS(:,191)).*( 3.00000.*CONSTANTS(:,191)))./CONSTANTS(:,330);
CONSTANTS(:,334) =  CONSTANTS(:,317).*CONSTANTS(:,331);
CONSTANTS(:,335) =  CONSTANTS(:,322).*CONSTANTS(:,331);
CONSTANTS(:,336) =  CONSTANTS(:,327).*CONSTANTS(:,331);
CONSTANTS(:,337) = 30.0000./1000.00;
CONSTANTS(:,338) = exp( 6.00000.*CONSTANTS(:,32).*CONSTANTS(:,320));
CONSTANTS(:,339) = ( CONSTANTS(:,249).*CONSTANTS(:,305).*( 3.00000.*CONSTANTS(:,191)))./CONSTANTS(:,330);
CONSTANTS(:,340) =  CONSTANTS(:,337).*CONSTANTS(:,331);
CONSTANTS(:,341) =  - (CONSTANTS(:,138)+CONSTANTS(:,305)+CONSTANTS(:,334));
CONSTANTS(:,342) =  - (CONSTANTS(:,313)+CONSTANTS(:,335));
CONSTANTS(:,343) =  6.00000.*CONSTANTS(:,44).*CONSTANTS(:,320);
CONSTANTS(:,344) = ( CONSTANTS(:,249).*CONSTANTS(:,305).*CONSTANTS(:,313))./CONSTANTS(:,330);
CONSTANTS(:,345) = CONSTANTS(:,167)+ CONSTANTS(:,169).*CONSTANTS(:,338);
CONSTANTS(:,346) = CONSTANTS(:,333)+ 2.00000.*CONSTANTS(:,339)+ 3.00000.*CONSTANTS(:,344);
CONSTANTS(:,347) =  CONSTANTS(:,164).*CONSTANTS(:,338);
CONSTANTS(:,348) = CONSTANTS(:,346)./3.00000;
CONSTANTS(:,349) =  0.500000.*CONSTANTS(:,173).*CONSTANTS(:,345);
CONSTANTS(:,350) = CONSTANTS(:,333)+CONSTANTS(:,339)+CONSTANTS(:,344);
CONSTANTS(:,351) =  0.500000.*CONSTANTS(:,173).*CONSTANTS(:,170);
CONSTANTS(:,352) = 1.00000;
CONSTANTS(:,353) =  0.500000.*CONSTANTS(:,173).*CONSTANTS(:,167);
CONSTANTS(:,354) = 1.50000;
CONSTANTS(:,355) =  6.00000.*CONSTANTS(:,173).*CONSTANTS(:,167);
CONSTANTS(:,356) = 0.100000;
CONSTANTS(:,357) =  6.00000.*CONSTANTS(:,173).*(CONSTANTS(:,167)+CONSTANTS(:,168));
CONSTANTS(:,358) = 0.100000;
CONSTANTS(:,359) =  CONSTANTS(:,302).*arbitrary_log( CONSTANTS(:,132).*power((CONSTANTS(:,40)./CONSTANTS(:,39)), 1.0 ./ 2), 10);
CONSTANTS(:,360) = CONSTANTS(:,354) - CONSTANTS(:,358);
CONSTANTS(:,361) = exp( CONSTANTS(:,359).*CONSTANTS(:,320));
CONSTANTS(:,362) =  0.500000.*(CONSTANTS(:,167)+ CONSTANTS(:,170).*CONSTANTS(:,361));
CONSTANTS(:,363) =  (CONSTANTS(:,167)+ CONSTANTS(:,169).*CONSTANTS(:,338)).*CONSTANTS(:,361).*0.500000;
CONSTANTS(:,364) = piecewise({CONSTANTS(:,190)<2.20000, min([utilOnes.*(1.00000), utilOnes.*( ((CONSTANTS(:,190) -  2.00000.*CONSTANTS(:,352))+(CONSTANTS(:,354) - CONSTANTS(:,356)))./CONSTANTS(:,360))],[],2) }, 1.00000 - (CONSTANTS(:,190) - 2.20000)./CONSTANTS(:,360));
CONSTANTS(:,365) =  4.00000.*CONSTANTS(:,167).*CONSTANTS(:,361);
CONSTANTS(:,366) = CONSTANTS(:,364)./CONSTANTS(:,350);
CONSTANTS(:,367) = CONSTANTS(:,364)./( CONSTANTS(:,348).*3.00000);
CONSTANTS(:,368) =  4.00000.*(CONSTANTS(:,167)+CONSTANTS(:,168));
CONSTANTS(:,369) =  CONSTANTS(:,188).*CONSTANTS(:,367);
CONSTANTS(:,370) =  (1.00000+ CONSTANTS(:,164).*CONSTANTS(:,361)).*CONSTANTS(:,338);
CONSTANTS(:,371) = CONSTANTS(:,165)+ CONSTANTS(:,166).*CONSTANTS(:,361);
CONSTANTS(:,372) = exp( 3.00000.*CONSTANTS(:,32).*CONSTANTS(:,320));
CONSTANTS(:,373) =  3.00000.*CONSTANTS(:,320);
CONSTANTS(:,374) =  100.000.*CONSTANTS(:,155)+ CONSTANTS(:,157).*CONSTANTS(:,372);
CONSTANTS(:,375) =  3.00000.*(CONSTANTS(:,155)+CONSTANTS(:,156));
CONSTANTS(:,376) =  300.000.*CONSTANTS(:,155);
CONSTANTS(:,377) =  CONSTANTS(:,152).*CONSTANTS(:,372);
CONSTANTS(:,378) = CONSTANTS(:,107)./CONSTANTS(:,90);
CONSTANTS(:,379) = 1.00000./CONSTANTS(:,89);
CONSTANTS(:,380) = CONSTANTS(:,17)./( CONSTANTS(:,185).*CONSTANTS(:,6).*1000.00);
CONSTANTS(:,381) = CONSTANTS(:,17)./( 2.00000.*CONSTANTS(:,187).*CONSTANTS(:,6).*1000.00);
CONSTANTS(:,382) = CONSTANTS(:,179)./CONSTANTS(:,187);
CONSTANTS(:,383) = CONSTANTS(:,185)./CONSTANTS(:,187);
CONSTANTS(:,384) = CONSTANTS(:,185)./CONSTANTS(:,186);
CONSTANTS(:,385) = CONSTANTS(:,179)./CONSTANTS(:,186);
CONSTANTS(:,386) = 1.00000./CONSTANTS(:,22);
CONSTANTS(:,387) = 1.00000./CONSTANTS(:,27);
CONSTANTS(:,388) =  2.00000.*CONSTANTS(:,20);
STATES(:,1) = CONSTANTS(:,197);
STATES(:,2) = CONSTANTS(:,198);
STATES(:,3) = CONSTANTS(:,199);
STATES(:,4) = CONSTANTS(:,200);
STATES(:,5) = CONSTANTS(:,201);
STATES(:,6) = CONSTANTS(:,202);
STATES(:,7) = CONSTANTS(:,203);
STATES(:,8) = CONSTANTS(:,204);
STATES(:,9) = CONSTANTS(:,205);
STATES(:,10) = CONSTANTS(:,206);
STATES(:,11) = CONSTANTS(:,207);
STATES(:,12) = CONSTANTS(:,208);
STATES(:,13) = CONSTANTS(:,209);
STATES(:,14) = CONSTANTS(:,210);
STATES(:,15) = CONSTANTS(:,211);
STATES(:,16) = CONSTANTS(:,212);
STATES(:,17) = CONSTANTS(:,213);
STATES(:,18) = CONSTANTS(:,214);
STATES(:,19) = CONSTANTS(:,215);
STATES(:,20) = CONSTANTS(:,216);
STATES(:,21) = CONSTANTS(:,217);
STATES(:,22) = CONSTANTS(:,218);
STATES(:,23) = CONSTANTS(:,219);
STATES(:,24) = CONSTANTS(:,220);
STATES(:,25) = CONSTANTS(:,221);
STATES(:,26) = CONSTANTS(:,222);
STATES(:,27) = CONSTANTS(:,223);
STATES(:,28) = CONSTANTS(:,224);
STATES(:,29) = CONSTANTS(:,225);
STATES(:,30) = CONSTANTS(:,226);
STATES(:,31) = CONSTANTS(:,227);
STATES(:,32) = CONSTANTS(:,228);
STATES(:,33) = CONSTANTS(:,229);
STATES(:,34) = CONSTANTS(:,230);
STATES(:,35) = CONSTANTS(:,231);
STATES(:,36) = CONSTANTS(:,232);
STATES(:,37) = CONSTANTS(:,233);
STATES(:,38) = CONSTANTS(:,234);
STATES(:,39) = CONSTANTS(:,235);
STATES(:,40) = CONSTANTS(:,236);
STATES(:,41) = CONSTANTS(:,237);
STATES(:,42) = CONSTANTS(:,238);
STATES(:,43) = CONSTANTS(:,239);
STATES(:,44) = CONSTANTS(:,240);
STATES(:,45) = CONSTANTS(:,241);
STATES(:,46) = CONSTANTS(:,242);
STATES(:,47) = CONSTANTS(:,243);
STATES(:,48) = CONSTANTS(:,244);
STATES(:,49) = CONSTANTS(:,245);
STATES(:,50) = CONSTANTS(:,246);
STATES(:,51) = CONSTANTS(:,247);
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(:,10) =  CONSTANTS(:,41).*STATES(:,44) -  CONSTANTS(:,50).*STATES(:,10);
RATES(:,12) = (1.00000./(1.00000+exp( (STATES(:,2)+55.0000).*(1.00000./7.50000)))+(0.500000./(1.00000+exp( (21.0000 - STATES(:,2)).*(1.00000./6.00000))) - STATES(:,12)))./(20.0000+600.000./(1.00000+exp( (STATES(:,2)+30.0000).*(1.00000./9.50000))));
RATES(:,11) =  CONSTANTS(:,43).*STATES(:,46) -  CONSTANTS(:,52).*STATES(:,11);
ALGEBRAIC(:,1) = STATES(:,2)+30.0000;
RATES(:,9) =  7.19000e-05.*(ALGEBRAIC(:,1)./(1.00000 - exp( -0.148000.*ALGEBRAIC(:,1)))).*(1.00000 - STATES(:,9)) -  0.000131000.*(ALGEBRAIC(:,1)./(exp( 0.0687000.*ALGEBRAIC(:,1)) - 1.00000)).*STATES(:,9);
ALGEBRAIC(:,4) = piecewise({STATES(:,2)<-40.0000,  ( 0.135000.*exp(-80.0000./6.80000)).*exp( (-1.00000./6.80000).*STATES(:,2)) }, 0.00000);
ALGEBRAIC(:,10) = piecewise({STATES(:,2)<-40.0000,  3.56000.*exp( 0.0790000.*STATES(:,2))+ 310000..*exp( 0.350000.*STATES(:,2)) }, 1.00000./(0.130000+ ( 0.130000.*exp( - (10.6600./11.1000))).*exp( STATES(:,2).*(-1.00000./11.1000))));
RATES(:,7) =  ALGEBRAIC(:,4).*(1.00000 - STATES(:,7)) -  ALGEBRAIC(:,10).*STATES(:,7);
ALGEBRAIC(:,5) = piecewise({STATES(:,2)<-40.0000,  ( -127140..*exp( 0.244400.*STATES(:,2)) -  3.47400e-05.*exp( -0.0439100.*STATES(:,2))).*((STATES(:,2)+37.7800)./(1.00000+exp( 0.311000.*(STATES(:,2)+79.2300)))) }, 0.00000);
ALGEBRAIC(:,11) = piecewise({STATES(:,2)<-40.0000,  0.121200.*(exp( -0.0105200.*STATES(:,2))./(1.00000+exp( -0.137800.*(STATES(:,2)+40.1400)))) },  0.300000.*(exp( -2.53500e-07.*STATES(:,2))./(1.00000+exp( -0.100000.*STATES(:,2) - 3.20000))));
RATES(:,8) =  ALGEBRAIC(:,5).*(1.00000 - STATES(:,8)) -  ALGEBRAIC(:,11).*STATES(:,8);
ALGEBRAIC(:,6) =  CONSTANTS(:,138).*power( STATES(:,35).*CONSTANTS(:,314), CONSTANTS(:,252));
ALGEBRAIC(:,12) =  CONSTANTS(:,310).*STATES(:,31)+ ALGEBRAIC(:,6).*STATES(:,51)+ CONSTANTS(:,334).*STATES(:,32);
RATES(:,31) = ALGEBRAIC(:,12);
ALGEBRAIC(:,15) =  CONSTANTS(:,341).*STATES(:,32)+ ALGEBRAIC(:,6).*STATES(:,30)+ CONSTANTS(:,249).*STATES(:,31)+ CONSTANTS(:,335).*STATES(:,33);
RATES(:,32) = ALGEBRAIC(:,15);
ALGEBRAIC(:,3) = piecewise({STATES(:,2)==-47.1300, 3.20000 },  0.320000.*((STATES(:,2)+47.1300)./(1.00000 - exp( -0.100000.*(STATES(:,2)+47.1300)))));
ALGEBRAIC(:,9) =  0.0800000.*exp( - ( STATES(:,2).*(1.00000./11.0000)));
ALGEBRAIC(:,14) = 1.00000./(ALGEBRAIC(:,9)+ALGEBRAIC(:,3));
ALGEBRAIC(:,18) = piecewise({ALGEBRAIC(:,14)<0.0300000,  ALGEBRAIC(:,3).*ALGEBRAIC(:,14) }, STATES(:,6));
RATES(:,6) =  ALGEBRAIC(:,3).*(1.00000 - ALGEBRAIC(:,18)) -  ALGEBRAIC(:,9).*ALGEBRAIC(:,18);
ALGEBRAIC(:,19) =  CONSTANTS(:,342).*STATES(:,33)+ CONSTANTS(:,305).*STATES(:,32)+ CONSTANTS(:,336).*STATES(:,34);
RATES(:,33) = ALGEBRAIC(:,19);
ALGEBRAIC(:,22) =  - ( CONSTANTS(:,336).*STATES(:,34))+ CONSTANTS(:,313).*STATES(:,33);
RATES(:,34) = ALGEBRAIC(:,22);
ALGEBRAIC(:,25) =  CONSTANTS(:,138).*STATES(:,32) -  (ALGEBRAIC(:,6)+CONSTANTS(:,340)).*STATES(:,30);
RATES(:,30) = ALGEBRAIC(:,25);
RATES(:,51) =  - ALGEBRAIC(:,12) - (ALGEBRAIC(:,15)+ALGEBRAIC(:,19)+ALGEBRAIC(:,22)+ALGEBRAIC(:,25));
ALGEBRAIC(:,30) = 1.00000 - (STATES(:,3)+STATES(:,4)+STATES(:,5));
RATES(:,3) =  - ( CONSTANTS(:,65).*power(STATES(:,29), CONSTANTS(:,146)).*STATES(:,3))+ CONSTANTS(:,64).*ALGEBRAIC(:,30);
RATES(:,5) =  CONSTANTS(:,67).*power(STATES(:,29), CONSTANTS(:,141)).*ALGEBRAIC(:,30) -  CONSTANTS(:,66).*STATES(:,5);
RATES(:,4) =  CONSTANTS(:,71).*ALGEBRAIC(:,30) -  CONSTANTS(:,69).*STATES(:,4);
ALGEBRAIC(:,7) =  0.400000.*exp( (STATES(:,2)+2.00000).*0.100000);
ALGEBRAIC(:,24) =  4.00000.*ALGEBRAIC(:,7);
ALGEBRAIC(:,13) =  0.0500000.*exp( (STATES(:,2)+2.00000).*(-1.00000./13.0000));
ALGEBRAIC(:,41) = ALGEBRAIC(:,13);
ALGEBRAIC(:,57) =  0.187500.*STATES(:,29);
ALGEBRAIC(:,59) = ALGEBRAIC(:,57);
RATES(:,39) =  ALGEBRAIC(:,41).*STATES(:,37)+( CONSTANTS(:,312).*STATES(:,38) -  (ALGEBRAIC(:,24)+ALGEBRAIC(:,59)).*STATES(:,39));
ALGEBRAIC(:,17) =  CONSTANTS(:,19).*ALGEBRAIC(:,7);
ALGEBRAIC(:,33) =  4.00000.*ALGEBRAIC(:,17);
ALGEBRAIC(:,21) =  ALGEBRAIC(:,13).*CONSTANTS(:,303);
ALGEBRAIC(:,49) = ALGEBRAIC(:,21);
RATES(:,38) =  ALGEBRAIC(:,49).*STATES(:,41)+( ALGEBRAIC(:,59).*STATES(:,39) -  (ALGEBRAIC(:,33)+CONSTANTS(:,312)).*STATES(:,38));
ALGEBRAIC(:,27) =  3.00000.*ALGEBRAIC(:,7);
ALGEBRAIC(:,43) =  2.00000.*ALGEBRAIC(:,13);
ALGEBRAIC(:,61) =  CONSTANTS(:,19).*ALGEBRAIC(:,59);
RATES(:,37) =  ALGEBRAIC(:,24).*STATES(:,39)+ ALGEBRAIC(:,43).*STATES(:,40)+( CONSTANTS(:,316).*STATES(:,41) -  (ALGEBRAIC(:,41)+ALGEBRAIC(:,27)+ALGEBRAIC(:,61)).*STATES(:,37));
ALGEBRAIC(:,35) =  3.00000.*ALGEBRAIC(:,17);
ALGEBRAIC(:,51) =  2.00000.*ALGEBRAIC(:,21);
RATES(:,41) =  ALGEBRAIC(:,33).*STATES(:,38)+ ALGEBRAIC(:,51).*STATES(:,43)+( ALGEBRAIC(:,61).*STATES(:,37) -  (ALGEBRAIC(:,49)+ALGEBRAIC(:,35)+CONSTANTS(:,316)).*STATES(:,41));
ALGEBRAIC(:,29) =  2.00000.*ALGEBRAIC(:,7);
ALGEBRAIC(:,45) =  3.00000.*ALGEBRAIC(:,13);
ALGEBRAIC(:,63) =  CONSTANTS(:,19).*ALGEBRAIC(:,61);
RATES(:,40) =  ALGEBRAIC(:,27).*STATES(:,37)+ ALGEBRAIC(:,45).*STATES(:,42)+( CONSTANTS(:,321).*STATES(:,43) -  (ALGEBRAIC(:,43)+ALGEBRAIC(:,29)+ALGEBRAIC(:,63)).*STATES(:,40));
ALGEBRAIC(:,37) =  2.00000.*ALGEBRAIC(:,17);
ALGEBRAIC(:,53) =  3.00000.*ALGEBRAIC(:,21);
RATES(:,43) =  ALGEBRAIC(:,35).*STATES(:,41)+ ALGEBRAIC(:,53).*STATES(:,45)+( ALGEBRAIC(:,63).*STATES(:,40) -  (ALGEBRAIC(:,51)+ALGEBRAIC(:,37)+CONSTANTS(:,321)).*STATES(:,43));
ALGEBRAIC(:,31) = ALGEBRAIC(:,7);
ALGEBRAIC(:,47) =  4.00000.*ALGEBRAIC(:,13);
ALGEBRAIC(:,65) =  CONSTANTS(:,19).*ALGEBRAIC(:,63);
RATES(:,42) =  ALGEBRAIC(:,29).*STATES(:,40)+ ALGEBRAIC(:,47).*STATES(:,44)+( CONSTANTS(:,326).*STATES(:,45) -  (ALGEBRAIC(:,45)+ALGEBRAIC(:,31)+ALGEBRAIC(:,65)).*STATES(:,42));
ALGEBRAIC(:,39) = ALGEBRAIC(:,17);
ALGEBRAIC(:,55) =  4.00000.*ALGEBRAIC(:,21);
RATES(:,45) =  ALGEBRAIC(:,37).*STATES(:,43)+ ALGEBRAIC(:,55).*STATES(:,46)+( ALGEBRAIC(:,65).*STATES(:,42) -  (ALGEBRAIC(:,53)+ALGEBRAIC(:,39)+CONSTANTS(:,326)).*STATES(:,45));
ALGEBRAIC(:,67) =  CONSTANTS(:,19).*ALGEBRAIC(:,65);
RATES(:,44) =  ALGEBRAIC(:,31).*STATES(:,42)+ CONSTANTS(:,50).*STATES(:,10)+( CONSTANTS(:,329).*STATES(:,46) -  (ALGEBRAIC(:,47)+CONSTANTS(:,41)+ALGEBRAIC(:,67)).*STATES(:,44));
RATES(:,46) =  ALGEBRAIC(:,39).*STATES(:,45)+ CONSTANTS(:,52).*STATES(:,11)+( ALGEBRAIC(:,67).*STATES(:,44) -  (ALGEBRAIC(:,55)+CONSTANTS(:,43)+CONSTANTS(:,329)).*STATES(:,46));
ALGEBRAIC(:,72) =  CONSTANTS(:,75).*(CONSTANTS(:,24) - (STATES(:,20)+STATES(:,21)+STATES(:,22)+STATES(:,23)+STATES(:,24)+STATES(:,19)+ STATES(:,25).*CONSTANTS(:,267)));
ALGEBRAIC(:,66) = CONSTANTS(:,28) - STATES(:,18);
ALGEBRAIC(:,68) = CONSTANTS(:,113)./ALGEBRAIC(:,66);
ALGEBRAIC(:,73) = 1.00000./( (1.00000+ STATES(:,16).*CONSTANTS(:,270)).*(1.00000+ STATES(:,26).*CONSTANTS(:,271)));
ALGEBRAIC(:,74) = 1.00000+ STATES(:,18).*CONSTANTS(:,272);
ALGEBRAIC(:,75) = CONSTANTS(:,269)./(CONSTANTS(:,268)+ ALGEBRAIC(:,68).*ALGEBRAIC(:,74)+ power(CONSTANTS(:,114)./STATES(:,25), CONSTANTS(:,148)).*ALGEBRAIC(:,73).*(1.00000+ ALGEBRAIC(:,68).*ALGEBRAIC(:,74)));
RATES(:,25) = ALGEBRAIC(:,72) - ALGEBRAIC(:,75);
ALGEBRAIC(:,76) = CONSTANTS(:,274)+ CONSTANTS(:,309).*STATES(:,26);
ALGEBRAIC(:,77) =  CONSTANTS(:,275).*(ALGEBRAIC(:,76)./(ALGEBRAIC(:,76)+power(CONSTANTS(:,115)./STATES(:,20), CONSTANTS(:,149))+ CONSTANTS(:,273).*ALGEBRAIC(:,68)));
ALGEBRAIC(:,62) = CONSTANTS(:,25) - STATES(:,16);
ALGEBRAIC(:,78) =  CONSTANTS(:,79).*( STATES(:,21).*STATES(:,16) -  CONSTANTS(:,276).*STATES(:,22).*ALGEBRAIC(:,62));
RATES(:,21) = ALGEBRAIC(:,77) - ALGEBRAIC(:,78);
ALGEBRAIC(:,79) =  CONSTANTS(:,277).*(STATES(:,22)./(STATES(:,22)+ (CONSTANTS(:,124)+ CONSTANTS(:,278).*STATES(:,23)).*(1.00000+ CONSTANTS(:,279).*STATES(:,19))));
RATES(:,22) = ALGEBRAIC(:,78) - ALGEBRAIC(:,79);
ALGEBRAIC(:,80) =  CONSTANTS(:,77).*STATES(:,23) -  CONSTANTS(:,280).*STATES(:,24);
RATES(:,23) = ALGEBRAIC(:,79) - ALGEBRAIC(:,80);
ALGEBRAIC(:,81) =  CONSTANTS(:,281).*STATES(:,24).*(ALGEBRAIC(:,66)./( (STATES(:,24)+CONSTANTS(:,105)+ STATES(:,19).*CONSTANTS(:,282)).*(CONSTANTS(:,118)+ALGEBRAIC(:,66))));
RATES(:,24) = ALGEBRAIC(:,80) - ALGEBRAIC(:,81);
ALGEBRAIC(:,82) =  CONSTANTS(:,283).*(STATES(:,19)./(CONSTANTS(:,284)+STATES(:,20)));
RATES(:,20) = ALGEBRAIC(:,75)+(ALGEBRAIC(:,82) - ALGEBRAIC(:,77));
ALGEBRAIC(:,71) =  CONSTANTS(:,266).*(STATES(:,19)./(STATES(:,19)+CONSTANTS(:,122)));
RATES(:,19) = ALGEBRAIC(:,81) - (ALGEBRAIC(:,71)+ALGEBRAIC(:,82));
RATES(:,50) = ALGEBRAIC(:,82) -  CONSTANTS(:,70).*STATES(:,50);
ALGEBRAIC(:,64) = CONSTANTS(:,308)+STATES(:,17);
ALGEBRAIC(:,69) = exp( CONSTANTS(:,343).*ALGEBRAIC(:,64));
ALGEBRAIC(:,83) = power(( STATES(:,18).*CONSTANTS(:,287).*ALGEBRAIC(:,68)), 1.0 ./ 2);
ALGEBRAIC(:,84) = 1.00000./((CONSTANTS(:,338)+ CONSTANTS(:,347).*ALGEBRAIC(:,83))+ (CONSTANTS(:,165)+ CONSTANTS(:,166).*ALGEBRAIC(:,83)).*ALGEBRAIC(:,69));
ALGEBRAIC(:,85) =  ( (CONSTANTS(:,349)+ CONSTANTS(:,351).*ALGEBRAIC(:,69)).*ALGEBRAIC(:,83) -  CONSTANTS(:,353).*ALGEBRAIC(:,69)).*ALGEBRAIC(:,84);
RATES(:,18) =  - ALGEBRAIC(:,85)+ALGEBRAIC(:,75)+ALGEBRAIC(:,77)+ALGEBRAIC(:,81);
ALGEBRAIC(:,89) = exp( CONSTANTS(:,373).*ALGEBRAIC(:,64));
ALGEBRAIC(:,90) =  CONSTANTS(:,288).*(ALGEBRAIC(:,62)./STATES(:,16));
ALGEBRAIC(:,91) =  - (CONSTANTS(:,171)./(CONSTANTS(:,372)+ CONSTANTS(:,377).*ALGEBRAIC(:,90)+ (CONSTANTS(:,153)+ CONSTANTS(:,154).*ALGEBRAIC(:,90)).*ALGEBRAIC(:,89)));
ALGEBRAIC(:,92) =  ( (CONSTANTS(:,374)+ CONSTANTS(:,158).*ALGEBRAIC(:,89)).*ALGEBRAIC(:,90) -  CONSTANTS(:,155).*ALGEBRAIC(:,89)).*ALGEBRAIC(:,91);
ALGEBRAIC(:,8) = 8.00000 - STATES(:,1);
ALGEBRAIC(:,94) = STATES(:,1)./ALGEBRAIC(:,8);
ALGEBRAIC(:,95) = STATES(:,16)./ALGEBRAIC(:,62);
ALGEBRAIC(:,96) = (CONSTANTS(:,289) -  CONSTANTS(:,290).*ALGEBRAIC(:,94).*ALGEBRAIC(:,95).*exp( - ( CONSTANTS(:,320).*STATES(:,17))))./( (1.00000+ (10.0000./9.00000).*ALGEBRAIC(:,94).*exp( - ( CONSTANTS(:,323).*STATES(:,17)))).*(1.00000+ 18.0000.*ALGEBRAIC(:,95)));
RATES(:,16) = ALGEBRAIC(:,96) - (ALGEBRAIC(:,92)+ALGEBRAIC(:,78));
ALGEBRAIC(:,16) = 1.00000./STATES(:,1);
ALGEBRAIC(:,98) = power( STATES(:,15).*CONSTANTS(:,291), CONSTANTS(:,147));
ALGEBRAIC(:,99) = power( STATES(:,27).*CONSTANTS(:,292), CONSTANTS(:,150));
ALGEBRAIC(:,100) =  CONSTANTS(:,136).*(( CONSTANTS(:,180).*ALGEBRAIC(:,98) -  CONSTANTS(:,181).*ALGEBRAIC(:,99))./( (1.00000+ALGEBRAIC(:,98)+ALGEBRAIC(:,99)).*( ALGEBRAIC(:,16).*(CONSTANTS(:,107)+ ALGEBRAIC(:,8).*CONSTANTS(:,378))+(1.00000+ ALGEBRAIC(:,8).*CONSTANTS(:,379)))));
ALGEBRAIC(:,103) =  (STATES(:,27) - STATES(:,28)).*CONSTANTS(:,293);
RATES(:,27) =  ALGEBRAIC(:,100).*CONSTANTS(:,384) -  ALGEBRAIC(:,103).*CONSTANTS(:,385);
ALGEBRAIC(:,101) =  CONSTANTS(:,10).*(STATES(:,47) - STATES(:,48));
ALGEBRAIC(:,105) =  CONSTANTS(:,12).*( (CONSTANTS(:,15) - STATES(:,47)).*STATES(:,1) -  STATES(:,47).*ALGEBRAIC(:,8).*CONSTANTS(:,301));
RATES(:,47) = ALGEBRAIC(:,105) - ALGEBRAIC(:,101);
ALGEBRAIC(:,104) =  CONSTANTS(:,11).*( (CONSTANTS(:,14) - STATES(:,48)).*STATES(:,49) -  STATES(:,48).*(8.00000 - STATES(:,49)).*CONSTANTS(:,301));
RATES(:,48) = ALGEBRAIC(:,101)+ALGEBRAIC(:,104);
ALGEBRAIC(:,20) =  STATES(:,2).*CONSTANTS(:,320);
ALGEBRAIC(:,23) = exp(ALGEBRAIC(:,20));
ALGEBRAIC(:,38) = power(( STATES(:,14).*STATES(:,14).*STATES(:,14)), 1.0 ./ 2);
ALGEBRAIC(:,40) =  CONSTANTS(:,328).*(ALGEBRAIC(:,38)./( (ALGEBRAIC(:,38)+power(( CONSTANTS(:,120).*CONSTANTS(:,120).*CONSTANTS(:,120)), 1.0 ./ 2)).*(1.00000+ 0.124500.*exp( -0.100000.*ALGEBRAIC(:,20))+CONSTANTS(:,325)./ALGEBRAIC(:,23)).*(1.00000+ ( CONSTANTS(:,101).*ALGEBRAIC(:,16)).*(1.00000+ ALGEBRAIC(:,8).*CONSTANTS(:,332)))));
ALGEBRAIC(:,48) =  CONSTANTS(:,58).*(STATES(:,15)./(CONSTANTS(:,123)+STATES(:,15))).*(1.00000./(1.00000+ ( CONSTANTS(:,102).*ALGEBRAIC(:,16)).*(1.00000+ ALGEBRAIC(:,8).*CONSTANTS(:,263)))+1.00000./(1.00000+ CONSTANTS(:,103).*ALGEBRAIC(:,16)));
ALGEBRAIC(:,60) =  CONSTANTS(:,319).*(( CONSTANTS(:,249).*STATES(:,31)+ CONSTANTS(:,305).*STATES(:,32)+ CONSTANTS(:,313).*STATES(:,33))./(1.00000+ ALGEBRAIC(:,16).*(CONSTANTS(:,106)+ CONSTANTS(:,265).*ALGEBRAIC(:,8))));
RATES(:,1) =  (1.00000 - CONSTANTS(:,4)).*( 0.615000.*ALGEBRAIC(:,96) - (ALGEBRAIC(:,60)+ 0.500000.*ALGEBRAIC(:,100)+ 6.37100e-05.*(ALGEBRAIC(:,40)+ALGEBRAIC(:,48))+ALGEBRAIC(:,105)));
RATES(:,49) =  (1.00000 - CONSTANTS(:,5)).*( - ALGEBRAIC(:,104) - CONSTANTS(:,16));
ALGEBRAIC(:,26) =  CONSTANTS(:,315).*ALGEBRAIC(:,20);
ALGEBRAIC(:,28) =  ALGEBRAIC(:,23).*ALGEBRAIC(:,23);
ALGEBRAIC(:,32) = piecewise({abs(STATES(:,2))<CONSTANTS(:,9),  CONSTANTS(:,257).*(ALGEBRAIC(:,28) - CONSTANTS(:,255)).*(0.500000 -  0.0200000.*STATES(:,2)) },  CONSTANTS(:,257).*ALGEBRAIC(:,26).*((ALGEBRAIC(:,28) - CONSTANTS(:,255))./(ALGEBRAIC(:,28) - 1.00000)));
ALGEBRAIC(:,36) =  6.00000.*ALGEBRAIC(:,32).*STATES(:,12).*STATES(:,10);
ALGEBRAIC(:,102) =  CONSTANTS(:,178).*(ALGEBRAIC(:,30)+STATES(:,5)).*(STATES(:,28) - STATES(:,29));
ALGEBRAIC(:,106) =  (STATES(:,29) - STATES(:,15)).*CONSTANTS(:,294);
ALGEBRAIC(:,107) = 1.00000./(1.00000+CONSTANTS(:,295)./( (STATES(:,29)+CONSTANTS(:,108)).*(STATES(:,29)+CONSTANTS(:,108))));
RATES(:,29) =  ALGEBRAIC(:,107).*( ALGEBRAIC(:,102).*CONSTANTS(:,382) - ( ALGEBRAIC(:,106).*CONSTANTS(:,383)+ ALGEBRAIC(:,36).*CONSTANTS(:,381)));
ALGEBRAIC(:,108) = 1.00000./(1.00000+CONSTANTS(:,296)./( (STATES(:,28)+CONSTANTS(:,110)).*(STATES(:,28)+CONSTANTS(:,110))));
RATES(:,28) =  ALGEBRAIC(:,108).*(ALGEBRAIC(:,103) - ALGEBRAIC(:,102));
ALGEBRAIC(:,109) = STATES(:,32)+STATES(:,30)+STATES(:,33)+STATES(:,34);
ALGEBRAIC(:,112) =  CONSTANTS(:,366).*ALGEBRAIC(:,109);
ALGEBRAIC(:,113) =  CONSTANTS(:,99).*STATES(:,15).*(CONSTANTS(:,140) - STATES(:,35)) -  ( CONSTANTS(:,100).*STATES(:,35)).*(1.00000 -  (2.00000./3.00000).*ALGEBRAIC(:,112));
RATES(:,35) = ALGEBRAIC(:,113);
ALGEBRAIC(:,114) =  CONSTANTS(:,87).*STATES(:,15).*(CONSTANTS(:,55) - STATES(:,36)) -  CONSTANTS(:,86).*STATES(:,36);
RATES(:,36) = ALGEBRAIC(:,114);
ALGEBRAIC(:,70) =  CONSTANTS(:,324).*(STATES(:,17) - 91.0000);
ALGEBRAIC(:,117) = 1.00000+ STATES(:,15).*CONSTANTS(:,297);
ALGEBRAIC(:,118) =  ALGEBRAIC(:,117).*ALGEBRAIC(:,117).*ALGEBRAIC(:,117);
ALGEBRAIC(:,119) =  CONSTANTS(:,299).*STATES(:,15).*ALGEBRAIC(:,70).*(ALGEBRAIC(:,118)./( ( ALGEBRAIC(:,118).*ALGEBRAIC(:,117)+CONSTANTS(:,139)./power(1.00000+ STATES(:,15).*CONSTANTS(:,298), CONSTANTS(:,144))).*(1.00000 - exp( - ALGEBRAIC(:,70)))));
ALGEBRAIC(:,120) =  CONSTANTS(:,183).*exp( CONSTANTS(:,300).*ALGEBRAIC(:,70)).*(STATES(:,26)./( STATES(:,15).*power(1.00000+CONSTANTS(:,125)./STATES(:,14), CONSTANTS(:,143)).*(1.00000+CONSTANTS(:,127)./STATES(:,26))));
RATES(:,26) =  CONSTANTS(:,42).*(ALGEBRAIC(:,119) - ALGEBRAIC(:,120));
ALGEBRAIC(:,86) =  ( CONSTANTS(:,355).*ALGEBRAIC(:,83) -  CONSTANTS(:,357).*ALGEBRAIC(:,69)).*ALGEBRAIC(:,84);
ALGEBRAIC(:,87) = CONSTANTS(:,172)./(CONSTANTS(:,370)+ CONSTANTS(:,371).*ALGEBRAIC(:,69));
ALGEBRAIC(:,88) =  (CONSTANTS(:,365) -  CONSTANTS(:,368).*ALGEBRAIC(:,69)).*ALGEBRAIC(:,87);
ALGEBRAIC(:,93) =  (CONSTANTS(:,376)+( CONSTANTS(:,376).*ALGEBRAIC(:,90) -  CONSTANTS(:,375).*ALGEBRAIC(:,89))).*ALGEBRAIC(:,91);
ALGEBRAIC(:,97) =  CONSTANTS(:,49).*ALGEBRAIC(:,64);
RATES(:,17) =  - ( (( - ALGEBRAIC(:,86) - ALGEBRAIC(:,88))+ALGEBRAIC(:,93)+ALGEBRAIC(:,96)+ALGEBRAIC(:,97)+ CONSTANTS(:,388).*ALGEBRAIC(:,120)+ 2.00000.*ALGEBRAIC(:,119)).*CONSTANTS(:,387));
ALGEBRAIC(:,121) =  (( CONSTANTS(:,7).*CONSTANTS(:,8))./( CONSTANTS(:,192).*CONSTANTS(:,6))).*log(CONSTANTS(:,145)./STATES(:,14));
ALGEBRAIC(:,122) =  CONSTANTS(:,47).*STATES(:,6).*STATES(:,6).*STATES(:,6).*STATES(:,7).*STATES(:,8).*(STATES(:,2) - ALGEBRAIC(:,121));
ALGEBRAIC(:,123) =  CONSTANTS(:,48).*(STATES(:,2) - ALGEBRAIC(:,121));
ALGEBRAIC(:,42) = exp( CONSTANTS(:,33).*ALGEBRAIC(:,20));
ALGEBRAIC(:,44) = ALGEBRAIC(:,42)./ALGEBRAIC(:,23);
ALGEBRAIC(:,46) = ( ALGEBRAIC(:,42).*STATES(:,14).*STATES(:,14).*STATES(:,14) -  ALGEBRAIC(:,44).*CONSTANTS(:,261).*STATES(:,15))./(CONSTANTS(:,262)+ CONSTANTS(:,307).*ALGEBRAIC(:,44));
ALGEBRAIC(:,50) =  STATES(:,15).*STATES(:,15).*STATES(:,15);
ALGEBRAIC(:,52) = piecewise({abs(STATES(:,2))<CONSTANTS(:,9),  0.750000.*ALGEBRAIC(:,50).*((1.00000 -  0.0200000.*STATES(:,2))./(ALGEBRAIC(:,50)+CONSTANTS(:,264))) },  0.750000.*ALGEBRAIC(:,50).*(ALGEBRAIC(:,26)./( (ALGEBRAIC(:,23) - 1.00000).*(ALGEBRAIC(:,50)+CONSTANTS(:,264)))));
ALGEBRAIC(:,54) =  CONSTANTS(:,163).*ALGEBRAIC(:,52).*( STATES(:,14).*ALGEBRAIC(:,23) - CONSTANTS(:,145));
RATES(:,14) =  - ( (ALGEBRAIC(:,122)+ALGEBRAIC(:,123)+ALGEBRAIC(:,54)+ 3.00000.*(ALGEBRAIC(:,46)+ALGEBRAIC(:,40))).*CONSTANTS(:,380)) -  ALGEBRAIC(:,120).*0.615000;
ALGEBRAIC(:,131) =  (( CONSTANTS(:,7).*CONSTANTS(:,8))./( CONSTANTS(:,194).*CONSTANTS(:,6))).*log(CONSTANTS(:,23)./STATES(:,15));
ALGEBRAIC(:,132) =  CONSTANTS(:,45).*(STATES(:,2) - ALGEBRAIC(:,131));
ALGEBRAIC(:,115) = ALGEBRAIC(:,113)+ALGEBRAIC(:,114);
ALGEBRAIC(:,116) = 1.00000./(1.00000+CONSTANTS(:,295)./( (STATES(:,15)+CONSTANTS(:,108)).*(STATES(:,15)+CONSTANTS(:,108))));
RATES(:,15) =  ALGEBRAIC(:,116).*((ALGEBRAIC(:,106) - (ALGEBRAIC(:,100)+ALGEBRAIC(:,115)+ 0.250000.*CONSTANTS(:,380).*((ALGEBRAIC(:,132) -  2.00000.*ALGEBRAIC(:,46))+ALGEBRAIC(:,48))))+ (ALGEBRAIC(:,120) - ALGEBRAIC(:,119)).*0.615000);
ALGEBRAIC(:,2) = piecewise({ rem(VOI, CONSTANTS(:,1))<CONSTANTS(:,2), CONSTANTS(:,3) }, 0.00000);
ALGEBRAIC(:,133) =  (( CONSTANTS(:,7).*CONSTANTS(:,8))./( CONSTANTS(:,193).*CONSTANTS(:,6))).*log(( CONSTANTS(:,195).*CONSTANTS(:,128)+ CONSTANTS(:,196).*CONSTANTS(:,145))./( CONSTANTS(:,195).*STATES(:,13)+ CONSTANTS(:,196).*STATES(:,14)));
ALGEBRAIC(:,134) =  CONSTANTS(:,253).*STATES(:,9).*STATES(:,9).*((STATES(:,2) - ALGEBRAIC(:,133))./(1.00000+exp((STATES(:,2) - 40.0000)./40.0000)));
ALGEBRAIC(:,124) =  (( CONSTANTS(:,7).*CONSTANTS(:,8))./( CONSTANTS(:,193).*CONSTANTS(:,6))).*log(CONSTANTS(:,128)./STATES(:,13));
ALGEBRAIC(:,125) = STATES(:,2) - ALGEBRAIC(:,124);
ALGEBRAIC(:,126) = 1.02000./(1.00000+exp( 0.238500.*(ALGEBRAIC(:,125) - 59.2150)));
ALGEBRAIC(:,127) = ( 0.491200.*exp( 0.0803200.*(ALGEBRAIC(:,125)+5.47600))+exp( 0.0617500.*(ALGEBRAIC(:,125) - 594.310)))./(1.00000+exp( -0.514300.*((STATES(:,2) - ALGEBRAIC(:,124))+4.75300)));
ALGEBRAIC(:,128) = ALGEBRAIC(:,126)./(ALGEBRAIC(:,126)+ALGEBRAIC(:,127));
ALGEBRAIC(:,129) =  CONSTANTS(:,311).*ALGEBRAIC(:,128).*ALGEBRAIC(:,125);
ALGEBRAIC(:,130) =  CONSTANTS(:,46).*(ALGEBRAIC(:,125)./(1.00000+exp( (7.48800 - STATES(:,2)).*CONSTANTS(:,254))));
ALGEBRAIC(:,34) = piecewise({abs(STATES(:,2))<CONSTANTS(:,9),  CONSTANTS(:,318).*(STATES(:,10)+STATES(:,11)).*STATES(:,12).*( STATES(:,13).*ALGEBRAIC(:,28) - CONSTANTS(:,128)).*((0.500000 -  0.0200000.*STATES(:,2))./(1.00000+ ALGEBRAIC(:,32).*CONSTANTS(:,258))) },  CONSTANTS(:,318).*(STATES(:,10)+STATES(:,11)).*STATES(:,12).*( STATES(:,13).*ALGEBRAIC(:,28) - CONSTANTS(:,128)).*(ALGEBRAIC(:,20)./( (ALGEBRAIC(:,28) - 1.00000).*(1.00000+ ALGEBRAIC(:,32).*CONSTANTS(:,258)))));
ALGEBRAIC(:,56) =  CONSTANTS(:,162).*ALGEBRAIC(:,52).*( STATES(:,13).*ALGEBRAIC(:,23) - CONSTANTS(:,128));
RATES(:,13) =  - ( (ALGEBRAIC(:,56)+ALGEBRAIC(:,134)+ALGEBRAIC(:,129)+ALGEBRAIC(:,130)+ALGEBRAIC(:,34)+(ALGEBRAIC(:,2) -  2.00000.*ALGEBRAIC(:,40))).*CONSTANTS(:,380));
ALGEBRAIC(:,58) = ALGEBRAIC(:,54)+ALGEBRAIC(:,56);
RATES(:,2) =  - ( CONSTANTS(:,386).*(ALGEBRAIC(:,122)+ALGEBRAIC(:,36)+ALGEBRAIC(:,34)+ALGEBRAIC(:,134)+ALGEBRAIC(:,129)+ALGEBRAIC(:,130)+ALGEBRAIC(:,46)+ALGEBRAIC(:,40)+ALGEBRAIC(:,58)+ALGEBRAIC(:,48)+ALGEBRAIC(:,132)+ALGEBRAIC(:,123)+ALGEBRAIC(:,2)));
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(:,1) = STATES(:,2)+30.0000;
ALGEBRAIC(:,4) = piecewise({STATES(:,2)<-40.0000,  ( 0.135000.*exp(-80.0000./6.80000)).*exp( (-1.00000./6.80000).*STATES(:,2)) }, 0.00000);
ALGEBRAIC(:,10) = piecewise({STATES(:,2)<-40.0000,  3.56000.*exp( 0.0790000.*STATES(:,2))+ 310000..*exp( 0.350000.*STATES(:,2)) }, 1.00000./(0.130000+ ( 0.130000.*exp( - (10.6600./11.1000))).*exp( STATES(:,2).*(-1.00000./11.1000))));
ALGEBRAIC(:,5) = piecewise({STATES(:,2)<-40.0000,  ( -127140..*exp( 0.244400.*STATES(:,2)) -  3.47400e-05.*exp( -0.0439100.*STATES(:,2))).*((STATES(:,2)+37.7800)./(1.00000+exp( 0.311000.*(STATES(:,2)+79.2300)))) }, 0.00000);
ALGEBRAIC(:,11) = piecewise({STATES(:,2)<-40.0000,  0.121200.*(exp( -0.0105200.*STATES(:,2))./(1.00000+exp( -0.137800.*(STATES(:,2)+40.1400)))) },  0.300000.*(exp( -2.53500e-07.*STATES(:,2))./(1.00000+exp( -0.100000.*STATES(:,2) - 3.20000))));
ALGEBRAIC(:,6) =  CONSTANTS(:,138).*power( STATES(:,35).*CONSTANTS(:,314), CONSTANTS(:,252));
ALGEBRAIC(:,12) =  CONSTANTS(:,310).*STATES(:,31)+ ALGEBRAIC(:,6).*STATES(:,51)+ CONSTANTS(:,334).*STATES(:,32);
ALGEBRAIC(:,15) =  CONSTANTS(:,341).*STATES(:,32)+ ALGEBRAIC(:,6).*STATES(:,30)+ CONSTANTS(:,249).*STATES(:,31)+ CONSTANTS(:,335).*STATES(:,33);
ALGEBRAIC(:,3) = piecewise({STATES(:,2)==-47.1300, 3.20000 },  0.320000.*((STATES(:,2)+47.1300)./(1.00000 - exp( -0.100000.*(STATES(:,2)+47.1300)))));
ALGEBRAIC(:,9) =  0.0800000.*exp( - ( STATES(:,2).*(1.00000./11.0000)));
ALGEBRAIC(:,14) = 1.00000./(ALGEBRAIC(:,9)+ALGEBRAIC(:,3));
ALGEBRAIC(:,18) = piecewise({ALGEBRAIC(:,14)<0.0300000,  ALGEBRAIC(:,3).*ALGEBRAIC(:,14) }, STATES(:,6));
ALGEBRAIC(:,19) =  CONSTANTS(:,342).*STATES(:,33)+ CONSTANTS(:,305).*STATES(:,32)+ CONSTANTS(:,336).*STATES(:,34);
ALGEBRAIC(:,22) =  - ( CONSTANTS(:,336).*STATES(:,34))+ CONSTANTS(:,313).*STATES(:,33);
ALGEBRAIC(:,25) =  CONSTANTS(:,138).*STATES(:,32) -  (ALGEBRAIC(:,6)+CONSTANTS(:,340)).*STATES(:,30);
ALGEBRAIC(:,30) = 1.00000 - (STATES(:,3)+STATES(:,4)+STATES(:,5));
ALGEBRAIC(:,7) =  0.400000.*exp( (STATES(:,2)+2.00000).*0.100000);
ALGEBRAIC(:,24) =  4.00000.*ALGEBRAIC(:,7);
ALGEBRAIC(:,13) =  0.0500000.*exp( (STATES(:,2)+2.00000).*(-1.00000./13.0000));
ALGEBRAIC(:,41) = ALGEBRAIC(:,13);
ALGEBRAIC(:,57) =  0.187500.*STATES(:,29);
ALGEBRAIC(:,59) = ALGEBRAIC(:,57);
ALGEBRAIC(:,17) =  CONSTANTS(:,19).*ALGEBRAIC(:,7);
ALGEBRAIC(:,33) =  4.00000.*ALGEBRAIC(:,17);
ALGEBRAIC(:,21) =  ALGEBRAIC(:,13).*CONSTANTS(:,303);
ALGEBRAIC(:,49) = ALGEBRAIC(:,21);
ALGEBRAIC(:,27) =  3.00000.*ALGEBRAIC(:,7);
ALGEBRAIC(:,43) =  2.00000.*ALGEBRAIC(:,13);
ALGEBRAIC(:,61) =  CONSTANTS(:,19).*ALGEBRAIC(:,59);
ALGEBRAIC(:,35) =  3.00000.*ALGEBRAIC(:,17);
ALGEBRAIC(:,51) =  2.00000.*ALGEBRAIC(:,21);
ALGEBRAIC(:,29) =  2.00000.*ALGEBRAIC(:,7);
ALGEBRAIC(:,45) =  3.00000.*ALGEBRAIC(:,13);
ALGEBRAIC(:,63) =  CONSTANTS(:,19).*ALGEBRAIC(:,61);
ALGEBRAIC(:,37) =  2.00000.*ALGEBRAIC(:,17);
ALGEBRAIC(:,53) =  3.00000.*ALGEBRAIC(:,21);
ALGEBRAIC(:,31) = ALGEBRAIC(:,7);
ALGEBRAIC(:,47) =  4.00000.*ALGEBRAIC(:,13);
ALGEBRAIC(:,65) =  CONSTANTS(:,19).*ALGEBRAIC(:,63);
ALGEBRAIC(:,39) = ALGEBRAIC(:,17);
ALGEBRAIC(:,55) =  4.00000.*ALGEBRAIC(:,21);
ALGEBRAIC(:,67) =  CONSTANTS(:,19).*ALGEBRAIC(:,65);
ALGEBRAIC(:,72) =  CONSTANTS(:,75).*(CONSTANTS(:,24) - (STATES(:,20)+STATES(:,21)+STATES(:,22)+STATES(:,23)+STATES(:,24)+STATES(:,19)+ STATES(:,25).*CONSTANTS(:,267)));
ALGEBRAIC(:,66) = CONSTANTS(:,28) - STATES(:,18);
ALGEBRAIC(:,68) = CONSTANTS(:,113)./ALGEBRAIC(:,66);
ALGEBRAIC(:,73) = 1.00000./( (1.00000+ STATES(:,16).*CONSTANTS(:,270)).*(1.00000+ STATES(:,26).*CONSTANTS(:,271)));
ALGEBRAIC(:,74) = 1.00000+ STATES(:,18).*CONSTANTS(:,272);
ALGEBRAIC(:,75) = CONSTANTS(:,269)./(CONSTANTS(:,268)+ ALGEBRAIC(:,68).*ALGEBRAIC(:,74)+ power(CONSTANTS(:,114)./STATES(:,25), CONSTANTS(:,148)).*ALGEBRAIC(:,73).*(1.00000+ ALGEBRAIC(:,68).*ALGEBRAIC(:,74)));
ALGEBRAIC(:,76) = CONSTANTS(:,274)+ CONSTANTS(:,309).*STATES(:,26);
ALGEBRAIC(:,77) =  CONSTANTS(:,275).*(ALGEBRAIC(:,76)./(ALGEBRAIC(:,76)+power(CONSTANTS(:,115)./STATES(:,20), CONSTANTS(:,149))+ CONSTANTS(:,273).*ALGEBRAIC(:,68)));
ALGEBRAIC(:,62) = CONSTANTS(:,25) - STATES(:,16);
ALGEBRAIC(:,78) =  CONSTANTS(:,79).*( STATES(:,21).*STATES(:,16) -  CONSTANTS(:,276).*STATES(:,22).*ALGEBRAIC(:,62));
ALGEBRAIC(:,79) =  CONSTANTS(:,277).*(STATES(:,22)./(STATES(:,22)+ (CONSTANTS(:,124)+ CONSTANTS(:,278).*STATES(:,23)).*(1.00000+ CONSTANTS(:,279).*STATES(:,19))));
ALGEBRAIC(:,80) =  CONSTANTS(:,77).*STATES(:,23) -  CONSTANTS(:,280).*STATES(:,24);
ALGEBRAIC(:,81) =  CONSTANTS(:,281).*STATES(:,24).*(ALGEBRAIC(:,66)./( (STATES(:,24)+CONSTANTS(:,105)+ STATES(:,19).*CONSTANTS(:,282)).*(CONSTANTS(:,118)+ALGEBRAIC(:,66))));
ALGEBRAIC(:,82) =  CONSTANTS(:,283).*(STATES(:,19)./(CONSTANTS(:,284)+STATES(:,20)));
ALGEBRAIC(:,71) =  CONSTANTS(:,266).*(STATES(:,19)./(STATES(:,19)+CONSTANTS(:,122)));
ALGEBRAIC(:,64) = CONSTANTS(:,308)+STATES(:,17);
ALGEBRAIC(:,69) = exp( CONSTANTS(:,343).*ALGEBRAIC(:,64));
ALGEBRAIC(:,83) = power(( STATES(:,18).*CONSTANTS(:,287).*ALGEBRAIC(:,68)), 1.0 ./ 2);
ALGEBRAIC(:,84) = 1.00000./((CONSTANTS(:,338)+ CONSTANTS(:,347).*ALGEBRAIC(:,83))+ (CONSTANTS(:,165)+ CONSTANTS(:,166).*ALGEBRAIC(:,83)).*ALGEBRAIC(:,69));
ALGEBRAIC(:,85) =  ( (CONSTANTS(:,349)+ CONSTANTS(:,351).*ALGEBRAIC(:,69)).*ALGEBRAIC(:,83) -  CONSTANTS(:,353).*ALGEBRAIC(:,69)).*ALGEBRAIC(:,84);
ALGEBRAIC(:,89) = exp( CONSTANTS(:,373).*ALGEBRAIC(:,64));
ALGEBRAIC(:,90) =  CONSTANTS(:,288).*(ALGEBRAIC(:,62)./STATES(:,16));
ALGEBRAIC(:,91) =  - (CONSTANTS(:,171)./(CONSTANTS(:,372)+ CONSTANTS(:,377).*ALGEBRAIC(:,90)+ (CONSTANTS(:,153)+ CONSTANTS(:,154).*ALGEBRAIC(:,90)).*ALGEBRAIC(:,89)));
ALGEBRAIC(:,92) =  ( (CONSTANTS(:,374)+ CONSTANTS(:,158).*ALGEBRAIC(:,89)).*ALGEBRAIC(:,90) -  CONSTANTS(:,155).*ALGEBRAIC(:,89)).*ALGEBRAIC(:,91);
ALGEBRAIC(:,8) = 8.00000 - STATES(:,1);
ALGEBRAIC(:,94) = STATES(:,1)./ALGEBRAIC(:,8);
ALGEBRAIC(:,95) = STATES(:,16)./ALGEBRAIC(:,62);
ALGEBRAIC(:,96) = (CONSTANTS(:,289) -  CONSTANTS(:,290).*ALGEBRAIC(:,94).*ALGEBRAIC(:,95).*exp( - ( CONSTANTS(:,320).*STATES(:,17))))./( (1.00000+ (10.0000./9.00000).*ALGEBRAIC(:,94).*exp( - ( CONSTANTS(:,323).*STATES(:,17)))).*(1.00000+ 18.0000.*ALGEBRAIC(:,95)));
ALGEBRAIC(:,16) = 1.00000./STATES(:,1);
ALGEBRAIC(:,98) = power( STATES(:,15).*CONSTANTS(:,291), CONSTANTS(:,147));
ALGEBRAIC(:,99) = power( STATES(:,27).*CONSTANTS(:,292), CONSTANTS(:,150));
ALGEBRAIC(:,100) =  CONSTANTS(:,136).*(( CONSTANTS(:,180).*ALGEBRAIC(:,98) -  CONSTANTS(:,181).*ALGEBRAIC(:,99))./( (1.00000+ALGEBRAIC(:,98)+ALGEBRAIC(:,99)).*( ALGEBRAIC(:,16).*(CONSTANTS(:,107)+ ALGEBRAIC(:,8).*CONSTANTS(:,378))+(1.00000+ ALGEBRAIC(:,8).*CONSTANTS(:,379)))));
ALGEBRAIC(:,103) =  (STATES(:,27) - STATES(:,28)).*CONSTANTS(:,293);
ALGEBRAIC(:,101) =  CONSTANTS(:,10).*(STATES(:,47) - STATES(:,48));
ALGEBRAIC(:,105) =  CONSTANTS(:,12).*( (CONSTANTS(:,15) - STATES(:,47)).*STATES(:,1) -  STATES(:,47).*ALGEBRAIC(:,8).*CONSTANTS(:,301));
ALGEBRAIC(:,104) =  CONSTANTS(:,11).*( (CONSTANTS(:,14) - STATES(:,48)).*STATES(:,49) -  STATES(:,48).*(8.00000 - STATES(:,49)).*CONSTANTS(:,301));
ALGEBRAIC(:,20) =  STATES(:,2).*CONSTANTS(:,320);
ALGEBRAIC(:,23) = exp(ALGEBRAIC(:,20));
ALGEBRAIC(:,38) = power(( STATES(:,14).*STATES(:,14).*STATES(:,14)), 1.0 ./ 2);
ALGEBRAIC(:,40) =  CONSTANTS(:,328).*(ALGEBRAIC(:,38)./( (ALGEBRAIC(:,38)+power(( CONSTANTS(:,120).*CONSTANTS(:,120).*CONSTANTS(:,120)), 1.0 ./ 2)).*(1.00000+ 0.124500.*exp( -0.100000.*ALGEBRAIC(:,20))+CONSTANTS(:,325)./ALGEBRAIC(:,23)).*(1.00000+ ( CONSTANTS(:,101).*ALGEBRAIC(:,16)).*(1.00000+ ALGEBRAIC(:,8).*CONSTANTS(:,332)))));
ALGEBRAIC(:,48) =  CONSTANTS(:,58).*(STATES(:,15)./(CONSTANTS(:,123)+STATES(:,15))).*(1.00000./(1.00000+ ( CONSTANTS(:,102).*ALGEBRAIC(:,16)).*(1.00000+ ALGEBRAIC(:,8).*CONSTANTS(:,263)))+1.00000./(1.00000+ CONSTANTS(:,103).*ALGEBRAIC(:,16)));
ALGEBRAIC(:,60) =  CONSTANTS(:,319).*(( CONSTANTS(:,249).*STATES(:,31)+ CONSTANTS(:,305).*STATES(:,32)+ CONSTANTS(:,313).*STATES(:,33))./(1.00000+ ALGEBRAIC(:,16).*(CONSTANTS(:,106)+ CONSTANTS(:,265).*ALGEBRAIC(:,8))));
ALGEBRAIC(:,26) =  CONSTANTS(:,315).*ALGEBRAIC(:,20);
ALGEBRAIC(:,28) =  ALGEBRAIC(:,23).*ALGEBRAIC(:,23);
ALGEBRAIC(:,32) = piecewise({abs(STATES(:,2))<CONSTANTS(:,9),  CONSTANTS(:,257).*(ALGEBRAIC(:,28) - CONSTANTS(:,255)).*(0.500000 -  0.0200000.*STATES(:,2)) },  CONSTANTS(:,257).*ALGEBRAIC(:,26).*((ALGEBRAIC(:,28) - CONSTANTS(:,255))./(ALGEBRAIC(:,28) - 1.00000)));
ALGEBRAIC(:,36) =  6.00000.*ALGEBRAIC(:,32).*STATES(:,12).*STATES(:,10);
ALGEBRAIC(:,102) =  CONSTANTS(:,178).*(ALGEBRAIC(:,30)+STATES(:,5)).*(STATES(:,28) - STATES(:,29));
ALGEBRAIC(:,106) =  (STATES(:,29) - STATES(:,15)).*CONSTANTS(:,294);
ALGEBRAIC(:,107) = 1.00000./(1.00000+CONSTANTS(:,295)./( (STATES(:,29)+CONSTANTS(:,108)).*(STATES(:,29)+CONSTANTS(:,108))));
ALGEBRAIC(:,108) = 1.00000./(1.00000+CONSTANTS(:,296)./( (STATES(:,28)+CONSTANTS(:,110)).*(STATES(:,28)+CONSTANTS(:,110))));
ALGEBRAIC(:,109) = STATES(:,32)+STATES(:,30)+STATES(:,33)+STATES(:,34);
ALGEBRAIC(:,112) =  CONSTANTS(:,366).*ALGEBRAIC(:,109);
ALGEBRAIC(:,113) =  CONSTANTS(:,99).*STATES(:,15).*(CONSTANTS(:,140) - STATES(:,35)) -  ( CONSTANTS(:,100).*STATES(:,35)).*(1.00000 -  (2.00000./3.00000).*ALGEBRAIC(:,112));
ALGEBRAIC(:,114) =  CONSTANTS(:,87).*STATES(:,15).*(CONSTANTS(:,55) - STATES(:,36)) -  CONSTANTS(:,86).*STATES(:,36);
ALGEBRAIC(:,70) =  CONSTANTS(:,324).*(STATES(:,17) - 91.0000);
ALGEBRAIC(:,117) = 1.00000+ STATES(:,15).*CONSTANTS(:,297);
ALGEBRAIC(:,118) =  ALGEBRAIC(:,117).*ALGEBRAIC(:,117).*ALGEBRAIC(:,117);
ALGEBRAIC(:,119) =  CONSTANTS(:,299).*STATES(:,15).*ALGEBRAIC(:,70).*(ALGEBRAIC(:,118)./( ( ALGEBRAIC(:,118).*ALGEBRAIC(:,117)+CONSTANTS(:,139)./power(1.00000+ STATES(:,15).*CONSTANTS(:,298), CONSTANTS(:,144))).*(1.00000 - exp( - ALGEBRAIC(:,70)))));
ALGEBRAIC(:,120) =  CONSTANTS(:,183).*exp( CONSTANTS(:,300).*ALGEBRAIC(:,70)).*(STATES(:,26)./( STATES(:,15).*power(1.00000+CONSTANTS(:,125)./STATES(:,14), CONSTANTS(:,143)).*(1.00000+CONSTANTS(:,127)./STATES(:,26))));
ALGEBRAIC(:,86) =  ( CONSTANTS(:,355).*ALGEBRAIC(:,83) -  CONSTANTS(:,357).*ALGEBRAIC(:,69)).*ALGEBRAIC(:,84);
ALGEBRAIC(:,87) = CONSTANTS(:,172)./(CONSTANTS(:,370)+ CONSTANTS(:,371).*ALGEBRAIC(:,69));
ALGEBRAIC(:,88) =  (CONSTANTS(:,365) -  CONSTANTS(:,368).*ALGEBRAIC(:,69)).*ALGEBRAIC(:,87);
ALGEBRAIC(:,93) =  (CONSTANTS(:,376)+( CONSTANTS(:,376).*ALGEBRAIC(:,90) -  CONSTANTS(:,375).*ALGEBRAIC(:,89))).*ALGEBRAIC(:,91);
ALGEBRAIC(:,97) =  CONSTANTS(:,49).*ALGEBRAIC(:,64);
ALGEBRAIC(:,121) =  (( CONSTANTS(:,7).*CONSTANTS(:,8))./( CONSTANTS(:,192).*CONSTANTS(:,6))).*log(CONSTANTS(:,145)./STATES(:,14));
ALGEBRAIC(:,122) =  CONSTANTS(:,47).*STATES(:,6).*STATES(:,6).*STATES(:,6).*STATES(:,7).*STATES(:,8).*(STATES(:,2) - ALGEBRAIC(:,121));
ALGEBRAIC(:,123) =  CONSTANTS(:,48).*(STATES(:,2) - ALGEBRAIC(:,121));
ALGEBRAIC(:,42) = exp( CONSTANTS(:,33).*ALGEBRAIC(:,20));
ALGEBRAIC(:,44) = ALGEBRAIC(:,42)./ALGEBRAIC(:,23);
ALGEBRAIC(:,46) = ( ALGEBRAIC(:,42).*STATES(:,14).*STATES(:,14).*STATES(:,14) -  ALGEBRAIC(:,44).*CONSTANTS(:,261).*STATES(:,15))./(CONSTANTS(:,262)+ CONSTANTS(:,307).*ALGEBRAIC(:,44));
ALGEBRAIC(:,50) =  STATES(:,15).*STATES(:,15).*STATES(:,15);
ALGEBRAIC(:,52) = piecewise({abs(STATES(:,2))<CONSTANTS(:,9),  0.750000.*ALGEBRAIC(:,50).*((1.00000 -  0.0200000.*STATES(:,2))./(ALGEBRAIC(:,50)+CONSTANTS(:,264))) },  0.750000.*ALGEBRAIC(:,50).*(ALGEBRAIC(:,26)./( (ALGEBRAIC(:,23) - 1.00000).*(ALGEBRAIC(:,50)+CONSTANTS(:,264)))));
ALGEBRAIC(:,54) =  CONSTANTS(:,163).*ALGEBRAIC(:,52).*( STATES(:,14).*ALGEBRAIC(:,23) - CONSTANTS(:,145));
ALGEBRAIC(:,131) =  (( CONSTANTS(:,7).*CONSTANTS(:,8))./( CONSTANTS(:,194).*CONSTANTS(:,6))).*log(CONSTANTS(:,23)./STATES(:,15));
ALGEBRAIC(:,132) =  CONSTANTS(:,45).*(STATES(:,2) - ALGEBRAIC(:,131));
ALGEBRAIC(:,115) = ALGEBRAIC(:,113)+ALGEBRAIC(:,114);
ALGEBRAIC(:,116) = 1.00000./(1.00000+CONSTANTS(:,295)./( (STATES(:,15)+CONSTANTS(:,108)).*(STATES(:,15)+CONSTANTS(:,108))));
ALGEBRAIC(:,2) = piecewise({ rem(VOI, CONSTANTS(:,1))<CONSTANTS(:,2), CONSTANTS(:,3) }, 0.00000);
ALGEBRAIC(:,133) =  (( CONSTANTS(:,7).*CONSTANTS(:,8))./( CONSTANTS(:,193).*CONSTANTS(:,6))).*log(( CONSTANTS(:,195).*CONSTANTS(:,128)+ CONSTANTS(:,196).*CONSTANTS(:,145))./( CONSTANTS(:,195).*STATES(:,13)+ CONSTANTS(:,196).*STATES(:,14)));
ALGEBRAIC(:,134) =  CONSTANTS(:,253).*STATES(:,9).*STATES(:,9).*((STATES(:,2) - ALGEBRAIC(:,133))./(1.00000+exp((STATES(:,2) - 40.0000)./40.0000)));
ALGEBRAIC(:,124) =  (( CONSTANTS(:,7).*CONSTANTS(:,8))./( CONSTANTS(:,193).*CONSTANTS(:,6))).*log(CONSTANTS(:,128)./STATES(:,13));
ALGEBRAIC(:,125) = STATES(:,2) - ALGEBRAIC(:,124);
ALGEBRAIC(:,126) = 1.02000./(1.00000+exp( 0.238500.*(ALGEBRAIC(:,125) - 59.2150)));
ALGEBRAIC(:,127) = ( 0.491200.*exp( 0.0803200.*(ALGEBRAIC(:,125)+5.47600))+exp( 0.0617500.*(ALGEBRAIC(:,125) - 594.310)))./(1.00000+exp( -0.514300.*((STATES(:,2) - ALGEBRAIC(:,124))+4.75300)));
ALGEBRAIC(:,128) = ALGEBRAIC(:,126)./(ALGEBRAIC(:,126)+ALGEBRAIC(:,127));
ALGEBRAIC(:,129) =  CONSTANTS(:,311).*ALGEBRAIC(:,128).*ALGEBRAIC(:,125);
ALGEBRAIC(:,130) =  CONSTANTS(:,46).*(ALGEBRAIC(:,125)./(1.00000+exp( (7.48800 - STATES(:,2)).*CONSTANTS(:,254))));
ALGEBRAIC(:,34) = piecewise({abs(STATES(:,2))<CONSTANTS(:,9),  CONSTANTS(:,318).*(STATES(:,10)+STATES(:,11)).*STATES(:,12).*( STATES(:,13).*ALGEBRAIC(:,28) - CONSTANTS(:,128)).*((0.500000 -  0.0200000.*STATES(:,2))./(1.00000+ ALGEBRAIC(:,32).*CONSTANTS(:,258))) },  CONSTANTS(:,318).*(STATES(:,10)+STATES(:,11)).*STATES(:,12).*( STATES(:,13).*ALGEBRAIC(:,28) - CONSTANTS(:,128)).*(ALGEBRAIC(:,20)./( (ALGEBRAIC(:,28) - 1.00000).*(1.00000+ ALGEBRAIC(:,32).*CONSTANTS(:,258)))));
ALGEBRAIC(:,56) =  CONSTANTS(:,162).*ALGEBRAIC(:,52).*( STATES(:,13).*ALGEBRAIC(:,23) - CONSTANTS(:,128));
ALGEBRAIC(:,58) = ALGEBRAIC(:,54)+ALGEBRAIC(:,56);
ALGEBRAIC(:,110) =  CONSTANTS(:,367).*(ALGEBRAIC(:,109)+STATES(:,33)+STATES(:,34)+STATES(:,34));
ALGEBRAIC(:,111) =  CONSTANTS(:,369).*(ALGEBRAIC(:,109)+STATES(:,33)+STATES(:,34)+STATES(:,34));
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

% Compute a logarithm to any base" +
function x = arbitrary_log(a, base)
x = log(a) ./ log(base);
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 Cortassa et al (2006) ECME model at changeset c4bd63604cd1.
Collaboration
To begin collaborating on this work, please use your git client and issue this command: