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 =256;
end
% There are a total of 67 entries in each of the rate and state variable arrays.
% There are a total of 186 entries in the constant variable array.
%

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

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

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

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

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

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

function [LEGEND_STATES, LEGEND_ALGEBRAIC, LEGEND_VOI, LEGEND_CONSTANTS] = createLegends()
    LEGEND_STATES = ''; LEGEND_ALGEBRAIC = ''; LEGEND_VOI = ''; LEGEND_CONSTANTS = '';
    LEGEND_VOI = strpad('time in component environment (ms)');
    LEGEND_CONSTANTS(:,1) = strpad('iso in component environment (dimensionless)');
    LEGEND_CONSTANTS(:,2) = strpad('CSQN2 in component environment (dimensionless)');
    LEGEND_CONSTANTS(:,3) = strpad('RyR2 in component environment (dimensionless)');
    LEGEND_CONSTANTS(:,156) = strpad('a1 in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (F_M_per_coulomb)');
    LEGEND_CONSTANTS(:,161) = strpad('a2 in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (F_M_per_coulomb)');
    LEGEND_CONSTANTS(:,4) = strpad('Faraday in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (coulomb_per_millimole)');
    LEGEND_CONSTANTS(:,5) = strpad('Temp in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (kelvin)');
    LEGEND_CONSTANTS(:,6) = strpad('Rgas in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (joule_per_mole_kelvin)');
    LEGEND_CONSTANTS(:,125) = strpad('RT_over_F in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mV)');
    LEGEND_CONSTANTS(:,7) = strpad('Acap in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (cm2)');
    LEGEND_CONSTANTS(:,136) = strpad('C in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mF)');
    LEGEND_CONSTANTS(:,8) = strpad('Vmyo in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (uL)');
    LEGEND_CONSTANTS(:,9) = strpad('VJSR in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (uL)');
    LEGEND_CONSTANTS(:,10) = strpad('VNSR in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (uL)');
    LEGEND_CONSTANTS(:,11) = strpad('VSS in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (uL)');
    LEGEND_STATES(:,1) = strpad('Nai in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mM)');
    LEGEND_STATES(:,2) = strpad('Ki in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mM)');
    LEGEND_STATES(:,3) = strpad('Cai in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mM)');
    LEGEND_STATES(:,4) = strpad('CaSS in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mM)');
    LEGEND_STATES(:,5) = strpad('CaJSR in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mM)');
    LEGEND_STATES(:,6) = strpad('CaNSR in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mM)');
    LEGEND_STATES(:,7) = strpad('V in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mV)');
    LEGEND_ALGEBRAIC(:,132) = strpad('INa in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,229) = strpad('INab in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,244) = strpad('INaCa in component COMPUTE_INaK_INaCa_ICab_IpCa (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,240) = strpad('INaK in component COMPUTE_INaK_INaCa_ICab_IpCa (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,207) = strpad('IKv14_Na in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,136) = strpad('IKr in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,140) = strpad('IKs in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,227) = strpad('IK1 in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,255) = strpad('ICaK in component COMPUTE_ICa_ICaK (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,250) = strpad('ICa in component COMPUTE_ICa_ICaK (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,221) = strpad('Ito1 in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,12) = strpad('i_Stim in component I_stimulus (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,145) = strpad('IKv43 in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,189) = strpad('IKv14_K in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,231) = strpad('ICab in component COMPUTE_INaK_INaCa_ICab_IpCa (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,233) = strpad('IpCa in component COMPUTE_INaK_INaCa_ICab_IpCa (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,61) = strpad('Jxfer in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (mM_per_ms)');
    LEGEND_ALGEBRAIC(:,43) = strpad('Jup in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (mM_per_ms)');
    LEGEND_ALGEBRAIC(:,92) = strpad('Jtrpn in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (mM_per_ms)');
    LEGEND_ALGEBRAIC(:,52) = strpad('Jrel in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (mM_per_ms)');
    LEGEND_ALGEBRAIC(:,62) = strpad('Jtr in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (mM_per_ms)');
    LEGEND_ALGEBRAIC(:,102) = strpad('beta_SS in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (dimensionless)');
    LEGEND_ALGEBRAIC(:,72) = strpad('beta_JSR in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (dimensionless)');
    LEGEND_ALGEBRAIC(:,112) = strpad('beta_i in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (dimensionless)');
    LEGEND_ALGEBRAIC(:,256) = strpad('i_tot in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (uA_per_uF)');
    LEGEND_CONSTANTS(:,12) = strpad('Ko in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mM)');
    LEGEND_CONSTANTS(:,13) = strpad('Nao in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mM)');
    LEGEND_CONSTANTS(:,14) = strpad('Cao in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mM)');
    LEGEND_CONSTANTS(:,15) = strpad('stim_period in component I_stimulus (ms)');
    LEGEND_CONSTANTS(:,16) = strpad('stim_duration in component I_stimulus (ms)');
    LEGEND_CONSTANTS(:,17) = strpad('stim_amplitude in component I_stimulus (uA_per_uF)');
    LEGEND_CONSTANTS(:,18) = strpad('stim_offset in component I_stimulus (ms)');
    LEGEND_ALGEBRAIC(:,1) = strpad('past in component I_stimulus (ms)');
    LEGEND_ALGEBRAIC(:,23) = strpad('fb in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (dimensionless)');
    LEGEND_CONSTANTS(:,19) = strpad('Kfb in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (mM)');
    LEGEND_CONSTANTS(:,20) = strpad('Nfb in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (dimensionless)');
    LEGEND_ALGEBRAIC(:,34) = strpad('rb in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (dimensionless)');
    LEGEND_CONSTANTS(:,21) = strpad('Krb in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (mM)');
    LEGEND_CONSTANTS(:,22) = strpad('Nrb in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (dimensionless)');
    LEGEND_CONSTANTS(:,23) = strpad('KSR in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (mM)');
    LEGEND_CONSTANTS(:,24) = strpad('vmaxf in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (per_ms)');
    LEGEND_CONSTANTS(:,25) = strpad('vmaxr in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (per_ms)');
    LEGEND_CONSTANTS(:,26) = strpad('v1 in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (per_ms)');
    LEGEND_STATES(:,8) = strpad('O1_RyR in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_STATES(:,9) = strpad('O2_RyR in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,27) = strpad('tautr in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (ms)');
    LEGEND_CONSTANTS(:,28) = strpad('tauxfer in component COMPUTE_INTRACELLULAR_CALCIUM_FLUXES (ms)');
    LEGEND_CONSTANTS(:,29) = strpad('LTRPNtot in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (mM)');
    LEGEND_CONSTANTS(:,30) = strpad('HTRPNtot in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (mM)');
    LEGEND_CONSTANTS(:,31) = strpad('khtrpn_plus in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (per_mM_per_ms)');
    LEGEND_CONSTANTS(:,32) = strpad('khtrpn_minus in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (per_ms)');
    LEGEND_CONSTANTS(:,33) = strpad('kltrpn_plus in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (per_mM_per_ms)');
    LEGEND_CONSTANTS(:,34) = strpad('kltrpn_minus in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (per_ms)');
    LEGEND_CONSTANTS(:,35) = strpad('CMDNtot in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (mM)');
    LEGEND_CONSTANTS(:,126) = strpad('CSQNtot in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (mM)');
    LEGEND_CONSTANTS(:,36) = strpad('EGTAtot in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (mM)');
    LEGEND_CONSTANTS(:,37) = strpad('KmCMDN in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (mM)');
    LEGEND_CONSTANTS(:,38) = strpad('KmCSQN in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (mM)');
    LEGEND_CONSTANTS(:,39) = strpad('KmEGTA in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (mM)');
    LEGEND_ALGEBRAIC(:,71) = strpad('dLTRPNCa in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (per_ms)');
    LEGEND_ALGEBRAIC(:,82) = strpad('dHTRPNCa in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (per_ms)');
    LEGEND_STATES(:,10) = strpad('LTRPNCa in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (dimensionless)');
    LEGEND_STATES(:,11) = strpad('HTRPNCa in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (dimensionless)');
    LEGEND_CONSTANTS(:,40) = strpad('kaplus in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (per_uM4_per_ms)');
    LEGEND_CONSTANTS(:,41) = strpad('kaminus in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (per_ms)');
    LEGEND_CONSTANTS(:,42) = strpad('kbplus in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (per_uM3_per_ms)');
    LEGEND_CONSTANTS(:,43) = strpad('kbminus in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (per_ms)');
    LEGEND_CONSTANTS(:,44) = strpad('kcplus in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (per_ms)');
    LEGEND_CONSTANTS(:,45) = strpad('kcminus in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (per_ms)');
    LEGEND_CONSTANTS(:,46) = strpad('ncoop in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,47) = strpad('mcoop in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,48) = strpad('kryr in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,2) = strpad('klumenC1O1 in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,13) = strpad('klumenO1C2 in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,24) = strpad('klumenC2O1 in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,49) = strpad('HmaxC1O1 in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,127) = strpad('HmaxO1C2 in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,50) = strpad('HmaxC2O1 in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,51) = strpad('Hmin in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,52) = strpad('H50C1O1 in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (mM)');
    LEGEND_CONSTANTS(:,53) = strpad('H50O1C2 in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (mM)');
    LEGEND_CONSTANTS(:,128) = strpad('H50C2O1 in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (mM)');
    LEGEND_CONSTANTS(:,54) = strpad('HN in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,35) = strpad('dC1_RyR in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,44) = strpad('dO2_RyR in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,53) = strpad('dC2_RyR in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,63) = strpad('dO1_RyR in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (per_ms)');
    LEGEND_STATES(:,12) = strpad('C1_RyR in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_STATES(:,13) = strpad('C2_RyR in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,55) = strpad('fL in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,56) = strpad('gL in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,57) = strpad('bL in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,58) = strpad('aL in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,54) = strpad('C0_to_C1 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,64) = strpad('C1_to_C2 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,73) = strpad('C2_to_C3 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,83) = strpad('C3_to_C4 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,125) = strpad('C1_to_C0 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,129) = strpad('C2_to_C1 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,133) = strpad('C3_to_C2 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,137) = strpad('C4_to_C3 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,93) = strpad('CCa0_to_CCa1 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,103) = strpad('CCa1_to_CCa2 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,113) = strpad('CCa2_to_CCa3 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,121) = strpad('CCa3_to_CCa4 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,141) = strpad('CCa1_to_CCa0 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,146) = strpad('CCa2_to_CCa1 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,152) = strpad('CCa3_to_CCa2 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,160) = strpad('CCa4_to_CCa3 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,170) = strpad('C0_to_CCa0 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,179) = strpad('C1_to_CCa1 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,190) = strpad('C2_to_CCa2 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,201) = strpad('C3_to_CCa3 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,208) = strpad('C4_to_CCa4 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,144) = strpad('CCa0_to_C0 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,160) = strpad('CCa1_to_C1 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,163) = strpad('CCa2_to_C2 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,169) = strpad('CCa3_to_C3 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,174) = strpad('CCa4_to_C4 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,3) = strpad('alpha in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,14) = strpad('beta in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,25) = strpad('alpha_prime in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,36) = strpad('beta_prime in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,45) = strpad('gamma in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,129) = strpad('omega in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,180) = strpad('a1_Ca0 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,191) = strpad('a2_Ca0 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,192) = strpad('a1_Ca1 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,202) = strpad('a2_Ca1 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,203) = strpad('a1_Ca2 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,209) = strpad('a2_Ca2 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,210) = strpad('a1_Ca3 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,215) = strpad('a2_Ca3 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,216) = strpad('a1_Ca4 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,222) = strpad('a2_Ca4 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,181) = strpad('a1_C0 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,193) = strpad('a2_C0 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,194) = strpad('a1_C1 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,204) = strpad('a2_C1 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,205) = strpad('a1_C2 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,211) = strpad('a2_C2 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,212) = strpad('a1_C3 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,217) = strpad('a2_C3 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,218) = strpad('a1_C4 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,223) = strpad('a2_C4 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (per_ms)');
    LEGEND_STATES(:,14) = strpad('C0 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,15) = strpad('C1 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,16) = strpad('C2 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,17) = strpad('C3 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,18) = strpad('C4 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,19) = strpad('CCa0 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,20) = strpad('CCa1 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,21) = strpad('CCa2 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,22) = strpad('CCa3 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,23) = strpad('CCa4 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,24) = strpad('Open in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,25) = strpad('yCa in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,130) = strpad('a1_Cainf in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,4) = strpad('yCa_inf in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,15) = strpad('tau_yCa in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (ms)');
    LEGEND_ALGEBRAIC(:,5) = strpad('alpha_act43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,16) = strpad('beta_act43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,26) = strpad('alpha_inact43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,37) = strpad('beta_inact43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,46) = strpad('C0Kv43_to_C1Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,55) = strpad('C1Kv43_to_C2Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,65) = strpad('C2Kv43_to_C3Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,74) = strpad('C3Kv43_to_OKv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,84) = strpad('CI0Kv43_to_CI1Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,94) = strpad('CI1Kv43_to_CI2Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,104) = strpad('CI2Kv43_to_CI3Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,114) = strpad('CI3Kv43_to_OIKv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,122) = strpad('C1Kv43_to_C0Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,126) = strpad('C2Kv43_to_C1Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,130) = strpad('C3Kv43_to_C2Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,134) = strpad('OKv43_to_C3Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,138) = strpad('CI1Kv43_to_CI0Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,143) = strpad('CI2Kv43_to_CI1Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,148) = strpad('CI3Kv43_to_CI2Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,154) = strpad('OIKv43_to_CI3Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,142) = strpad('C0Kv43_to_CI0Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,147) = strpad('C1Kv43_to_CI1Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,153) = strpad('C2Kv43_to_CI2Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,161) = strpad('C3Kv43_to_CI3Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,162) = strpad('OKv43_to_OIKv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,149) = strpad('CI0Kv43_to_C0Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,155) = strpad('CI1Kv43_to_C1Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,163) = strpad('CI2Kv43_to_C2Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,171) = strpad('CI3Kv43_to_C3Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,172) = strpad('OIKv43_to_OKv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_STATES(:,26) = strpad('C0Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,27) = strpad('C1Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,28) = strpad('C2Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,29) = strpad('C3Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,30) = strpad('OKv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,31) = strpad('CI0Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,32) = strpad('CI1Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,33) = strpad('CI2Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,34) = strpad('CI3Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_STATES(:,35) = strpad('OIKv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,156) = strpad('a1_C043 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,164) = strpad('a2_C043 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,165) = strpad('a1_C143 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,173) = strpad('a2_C143 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,174) = strpad('a1_C243 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,182) = strpad('a2_C243 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,183) = strpad('a1_C343 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,195) = strpad('a2_C343 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,184) = strpad('a1_O43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,196) = strpad('a2_O43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,157) = strpad('a1_I043 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,166) = strpad('a2_I043 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,167) = strpad('a1_I143 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,175) = strpad('a2_I143 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,176) = strpad('a1_I243 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,185) = strpad('a2_I243 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,186) = strpad('a1_I343 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,197) = strpad('a2_I343 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,187) = strpad('a1_OI43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,198) = strpad('a2_OI43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,59) = strpad('alphaa0Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,60) = strpad('aaKv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_mV)');
    LEGEND_CONSTANTS(:,61) = strpad('betaa0Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,62) = strpad('baKv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_mV)');
    LEGEND_CONSTANTS(:,63) = strpad('alphai0Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,64) = strpad('aiKv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_mV)');
    LEGEND_CONSTANTS(:,65) = strpad('betai0Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,66) = strpad('biKv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (per_mV)');
    LEGEND_CONSTANTS(:,67) = strpad('f1Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,68) = strpad('f2Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,69) = strpad('f3Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,70) = strpad('f4Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,71) = strpad('b1Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,72) = strpad('b2Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,73) = strpad('b3Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,74) = strpad('b4Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,75) = strpad('f1Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,76) = strpad('f2Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,77) = strpad('f3Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,78) = strpad('f4Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,79) = strpad('b1Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,80) = strpad('b2Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,81) = strpad('b3Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,82) = strpad('b4Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_CONSTANTS(:,83) = strpad('alphaa0Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,84) = strpad('aaKv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_mV)');
    LEGEND_CONSTANTS(:,85) = strpad('betaa0Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,86) = strpad('baKv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_mV)');
    LEGEND_CONSTANTS(:,87) = strpad('alphai0Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,88) = strpad('betai0Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,6) = strpad('alpha_act14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,17) = strpad('beta_act14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,131) = strpad('alpha_inact14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,132) = strpad('beta_inact14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,27) = strpad('C0Kv14_to_C1Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,38) = strpad('C1Kv14_to_C2Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,47) = strpad('C2Kv14_to_C3Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,56) = strpad('C3Kv14_to_OKv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,28) = strpad('CI0Kv14_to_CI1Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,39) = strpad('CI1Kv14_to_CI2Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,48) = strpad('CI2Kv14_to_CI3Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,57) = strpad('CI3Kv14_to_OIKv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,66) = strpad('C1Kv14_to_C0Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,75) = strpad('C2Kv14_to_C1Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,85) = strpad('C3Kv14_to_C2Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,95) = strpad('OKv14_to_C3Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,67) = strpad('CI1Kv14_to_CI0Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,76) = strpad('CI2Kv14_to_CI1Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,86) = strpad('CI3Kv14_to_CI2Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,96) = strpad('OIKv14_to_CI3Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,145) = strpad('C0Kv14_to_CI0Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,146) = strpad('C1Kv14_to_CI1Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,147) = strpad('C2Kv14_to_CI2Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,148) = strpad('C3Kv14_to_CI3Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,149) = strpad('OKv14_to_OIKv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,150) = strpad('CI0Kv14_to_C0Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,151) = strpad('CI1Kv14_to_C1Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,152) = strpad('CI2Kv14_to_C2Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,153) = strpad('CI3Kv14_to_C3Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_CONSTANTS(:,154) = strpad('OIKv14_to_OKv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,77) = strpad('a1_C0 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,87) = strpad('a2_C0 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_STATES(:,36) = strpad('C0Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,88) = strpad('a1_C1 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,97) = strpad('a2_C1 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_STATES(:,37) = strpad('C1Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,98) = strpad('a1_C2 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,105) = strpad('a2_C2 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_STATES(:,38) = strpad('C2Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,106) = strpad('a1_C3 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,115) = strpad('a2_C3 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_STATES(:,39) = strpad('C3Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,107) = strpad('a1_O in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,116) = strpad('a2_O in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_STATES(:,40) = strpad('OKv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,78) = strpad('a1_CI0 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,89) = strpad('a2_CI0 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_STATES(:,41) = strpad('CI0Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,90) = strpad('a1_CI1 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,99) = strpad('a2_CI1 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_STATES(:,42) = strpad('CI1Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,100) = strpad('a1_CI2 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,108) = strpad('a2_CI2 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_STATES(:,43) = strpad('CI2Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,109) = strpad('a1_CI3 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,117) = strpad('a2_CI3 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_STATES(:,44) = strpad('CI3Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,110) = strpad('a1_OI in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_ALGEBRAIC(:,118) = strpad('a2_OI in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (per_ms)');
    LEGEND_STATES(:,45) = strpad('OIKv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_ALGEBRAIC(:,120) = strpad('ENa in component COMPUTE_REVERSAL_POTENTIALS (mV)');
    LEGEND_ALGEBRAIC(:,124) = strpad('EK in component COMPUTE_REVERSAL_POTENTIALS (mV)');
    LEGEND_ALGEBRAIC(:,18) = strpad('EKs in component COMPUTE_REVERSAL_POTENTIALS (mV)');
    LEGEND_ALGEBRAIC(:,128) = strpad('ECa in component COMPUTE_REVERSAL_POTENTIALS (mV)');
    LEGEND_CONSTANTS(:,155) = strpad('a1 in component COMPUTE_REVERSAL_POTENTIALS (mM)');
    LEGEND_ALGEBRAIC(:,7) = strpad('a2 in component COMPUTE_REVERSAL_POTENTIALS (mM)');
    LEGEND_CONSTANTS(:,89) = strpad('GKr in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (mS_per_uF)');
    LEGEND_CONSTANTS(:,90) = strpad('GKs in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (mS_per_uF)');
    LEGEND_CONSTANTS(:,91) = strpad('GK1 in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (mS_per_uF)');
    LEGEND_CONSTANTS(:,92) = strpad('GNa in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (mS_per_uF)');
    LEGEND_CONSTANTS(:,93) = strpad('GNab in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (mS_per_uF)');
    LEGEND_CONSTANTS(:,94) = strpad('KvScale in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (dimensionless)');
    LEGEND_CONSTANTS(:,95) = strpad('Kv43Frac in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (dimensionless)');
    LEGEND_CONSTANTS(:,133) = strpad('GKv43 in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (mS_per_uF)');
    LEGEND_CONSTANTS(:,134) = strpad('PKv14 in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (litre_per_farad_second)');
    LEGEND_STATES(:,46) = strpad('na6 in component INa (dimensionless)');
    LEGEND_STATES(:,47) = strpad('na7 in component INa (dimensionless)');
    LEGEND_STATES(:,48) = strpad('OHerg in component IKr (dimensionless)');
    LEGEND_STATES(:,49) = strpad('O1ks in component IKs (dimensionless)');
    LEGEND_STATES(:,50) = strpad('O2ks in component IKs (dimensionless)');
    LEGEND_CONSTANTS(:,135) = strpad('fKo in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (dimensionless)');
    LEGEND_ALGEBRAIC(:,151) = strpad('VF_over_RT in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (dimensionless)');
    LEGEND_ALGEBRAIC(:,159) = strpad('VFsq_over_RT in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (coulomb_per_millimole)');
    LEGEND_ALGEBRAIC(:,169) = strpad('a1_K in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (mM)');
    LEGEND_ALGEBRAIC(:,178) = strpad('a2 in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (dimensionless)');
    LEGEND_ALGEBRAIC(:,200) = strpad('a1_Na in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (mM)');
    LEGEND_ALGEBRAIC(:,225) = strpad('K1_inf in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (dimensionless)');
    LEGEND_ALGEBRAIC(:,214) = strpad('IKv14 in component COMPUTE_INa_IKr_IKs_Ito1_IK1_INab_IKp (uA_per_uF)');
    LEGEND_CONSTANTS(:,96) = strpad('kNaCa in component COMPUTE_INaK_INaCa_ICab_IpCa (uA_per_uF)');
    LEGEND_CONSTANTS(:,97) = strpad('KmNa in component COMPUTE_INaK_INaCa_ICab_IpCa (mM)');
    LEGEND_CONSTANTS(:,98) = strpad('KmCa in component COMPUTE_INaK_INaCa_ICab_IpCa (mM)');
    LEGEND_CONSTANTS(:,99) = strpad('ksat in component COMPUTE_INaK_INaCa_ICab_IpCa (dimensionless)');
    LEGEND_CONSTANTS(:,100) = strpad('eta in component COMPUTE_INaK_INaCa_ICab_IpCa (dimensionless)');
    LEGEND_CONSTANTS(:,101) = strpad('INaKmax in component COMPUTE_INaK_INaCa_ICab_IpCa (uA_per_uF)');
    LEGEND_CONSTANTS(:,102) = strpad('KmNai in component COMPUTE_INaK_INaCa_ICab_IpCa (mM)');
    LEGEND_CONSTANTS(:,103) = strpad('KmKo in component COMPUTE_INaK_INaCa_ICab_IpCa (mM)');
    LEGEND_CONSTANTS(:,104) = strpad('IpCamax in component COMPUTE_INaK_INaCa_ICab_IpCa (uA_per_uF)');
    LEGEND_CONSTANTS(:,105) = strpad('KmpCa in component COMPUTE_INaK_INaCa_ICab_IpCa (mM)');
    LEGEND_CONSTANTS(:,106) = strpad('GCab in component COMPUTE_INaK_INaCa_ICab_IpCa (mS_per_uF)');
    LEGEND_ALGEBRAIC(:,235) = strpad('VF_over_RT in component COMPUTE_INaK_INaCa_ICab_IpCa (dimensionless)');
    LEGEND_CONSTANTS(:,164) = strpad('sigma in component COMPUTE_INaK_INaCa_ICab_IpCa (dimensionless)');
    LEGEND_ALGEBRAIC(:,236) = strpad('a1_Na in component COMPUTE_INaK_INaCa_ICab_IpCa (dimensionless)');
    LEGEND_ALGEBRAIC(:,237) = strpad('a2_Na in component COMPUTE_INaK_INaCa_ICab_IpCa (dimensionless)');
    LEGEND_ALGEBRAIC(:,238) = strpad('fNaK in component COMPUTE_INaK_INaCa_ICab_IpCa (dimensionless)');
    LEGEND_CONSTANTS(:,168) = strpad('a1_K in component COMPUTE_INaK_INaCa_ICab_IpCa (dimensionless)');
    LEGEND_ALGEBRAIC(:,239) = strpad('a2_K in component COMPUTE_INaK_INaCa_ICab_IpCa (dimensionless)');
    LEGEND_ALGEBRAIC(:,241) = strpad('a1_ncx in component COMPUTE_INaK_INaCa_ICab_IpCa (mM4)');
    LEGEND_ALGEBRAIC(:,242) = strpad('a2_ncx in component COMPUTE_INaK_INaCa_ICab_IpCa (mM4)');
    LEGEND_ALGEBRAIC(:,243) = strpad('a3_ncx in component COMPUTE_INaK_INaCa_ICab_IpCa (dimensionless)');
    LEGEND_CONSTANTS(:,173) = strpad('a4_ncx in component COMPUTE_INaK_INaCa_ICab_IpCa (mM)');
    LEGEND_CONSTANTS(:,176) = strpad('a5_ncx in component COMPUTE_INaK_INaCa_ICab_IpCa (mM3)');
    LEGEND_ALGEBRAIC(:,252) = strpad('PKprime in component COMPUTE_ICa_ICaK (litre_per_farad_second)');
    LEGEND_ALGEBRAIC(:,245) = strpad('VF_over_RT in component COMPUTE_ICa_ICaK (dimensionless)');
    LEGEND_ALGEBRAIC(:,246) = strpad('VFsq_over_RT in component COMPUTE_ICa_ICaK (coulomb_per_millimole)');
    LEGEND_ALGEBRAIC(:,247) = strpad('a1_Ca in component COMPUTE_ICa_ICaK (mM)');
    LEGEND_ALGEBRAIC(:,248) = strpad('a2_Ca in component COMPUTE_ICa_ICaK (dimensionless)');
    LEGEND_ALGEBRAIC(:,253) = strpad('a1_K in component COMPUTE_ICa_ICaK (mM)');
    LEGEND_ALGEBRAIC(:,254) = strpad('a2_K in component COMPUTE_ICa_ICaK (dimensionless)');
    LEGEND_ALGEBRAIC(:,249) = strpad('ICamax in component COMPUTE_ICa_ICaK (uA_per_uF)');
    LEGEND_ALGEBRAIC(:,251) = strpad('Icabar in component COMPUTE_ICa_ICaK (uA_per_uF)');
    LEGEND_CONSTANTS(:,157) = strpad('PCa in component COMPUTE_ICa_ICaK (litre_per_farad_second)');
    LEGEND_CONSTANTS(:,137) = strpad('PK in component COMPUTE_ICa_ICaK (litre_per_farad_second)');
    LEGEND_CONSTANTS(:,107) = strpad('ICahalf in component COMPUTE_ICa_ICaK (uA_per_uF)');
    LEGEND_CONSTANTS(:,108) = strpad('Pscale in component COMPUTE_ICa_ICaK (dimensionless)');
    LEGEND_CONSTANTS(:,162) = strpad('Temp_Scale in component INa (dimensionless)');
    LEGEND_ALGEBRAIC(:,8) = strpad('alpha1 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,19) = strpad('beta1 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,29) = strpad('gamma1 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,40) = strpad('Delta1 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,49) = strpad('On in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,58) = strpad('Of in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,68) = strpad('GammaGamma in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,79) = strpad('DeltaDelta in component INa (per_ms)');
    LEGEND_CONSTANTS(:,166) = strpad('epsilon in component INa (per_ms)');
    LEGEND_CONSTANTS(:,167) = strpad('omega_na in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,91) = strpad('rho in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,101) = strpad('mu in component INa (per_ms)');
    LEGEND_CONSTANTS(:,165) = strpad('Cn in component INa (per_ms)');
    LEGEND_CONSTANTS(:,170) = strpad('Cf in component INa (per_ms)');
    LEGEND_CONSTANTS(:,175) = strpad('parameter_a in component INa (dimensionless)');
    LEGEND_ALGEBRAIC(:,111) = strpad('k12 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,119) = strpad('k23 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,123) = strpad('k34 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,127) = strpad('k45 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,131) = strpad('k56 in component INa (per_ms)');
    LEGEND_CONSTANTS(:,171) = strpad('k67 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,135) = strpad('k89 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,139) = strpad('k910 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,144) = strpad('k1011 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,150) = strpad('k1112 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,158) = strpad('k1213 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,168) = strpad('k57 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,177) = strpad('k21 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,188) = strpad('k32 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,199) = strpad('k43 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,206) = strpad('k54 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,213) = strpad('k65 in component INa (per_ms)');
    LEGEND_CONSTANTS(:,172) = strpad('k76 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,219) = strpad('k98 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,224) = strpad('k109 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,226) = strpad('k1110 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,228) = strpad('k1211 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,230) = strpad('k1312 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,220) = strpad('k75 in component INa (per_ms)');
    LEGEND_CONSTANTS(:,177) = strpad('k81 in component INa (per_ms)');
    LEGEND_CONSTANTS(:,179) = strpad('k92 in component INa (per_ms)');
    LEGEND_CONSTANTS(:,181) = strpad('k103 in component INa (per_ms)');
    LEGEND_CONSTANTS(:,183) = strpad('k114 in component INa (per_ms)');
    LEGEND_CONSTANTS(:,185) = strpad('k125 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,232) = strpad('k136 in component INa (per_ms)');
    LEGEND_CONSTANTS(:,178) = strpad('k18 in component INa (per_ms)');
    LEGEND_CONSTANTS(:,180) = strpad('k29 in component INa (per_ms)');
    LEGEND_CONSTANTS(:,182) = strpad('k310 in component INa (per_ms)');
    LEGEND_CONSTANTS(:,184) = strpad('k411 in component INa (per_ms)');
    LEGEND_CONSTANTS(:,186) = strpad('k512 in component INa (per_ms)');
    LEGEND_ALGEBRAIC(:,234) = strpad('k613 in component INa (per_ms)');
    LEGEND_STATES(:,51) = strpad('na1 in component INa (dimensionless)');
    LEGEND_STATES(:,52) = strpad('na2 in component INa (dimensionless)');
    LEGEND_STATES(:,53) = strpad('na3 in component INa (dimensionless)');
    LEGEND_STATES(:,54) = strpad('na4 in component INa (dimensionless)');
    LEGEND_STATES(:,55) = strpad('na5 in component INa (dimensionless)');
    LEGEND_STATES(:,56) = strpad('na8 in component INa (dimensionless)');
    LEGEND_STATES(:,57) = strpad('na9 in component INa (dimensionless)');
    LEGEND_STATES(:,58) = strpad('na10 in component INa (dimensionless)');
    LEGEND_STATES(:,59) = strpad('na11 in component INa (dimensionless)');
    LEGEND_STATES(:,60) = strpad('na12 in component INa (dimensionless)');
    LEGEND_STATES(:,61) = strpad('na13 in component INa (dimensionless)');
    LEGEND_CONSTANTS(:,109) = strpad('TNa in component INa (kelvin)');
    LEGEND_CONSTANTS(:,138) = strpad('KToverH in component INa (per_ms)');
    LEGEND_CONSTANTS(:,159) = strpad('FoverRT in component INa (per_mV)');
    LEGEND_CONSTANTS(:,158) = strpad('RTNa in component INa (joule_per_mole)');
    LEGEND_CONSTANTS(:,139) = strpad('RTNaF in component INa (mV)');
    LEGEND_CONSTANTS(:,110) = strpad('T_Const_HERG in component IKr (dimensionless)');
    LEGEND_CONSTANTS(:,111) = strpad('A0_HERG in component IKr (per_ms)');
    LEGEND_CONSTANTS(:,112) = strpad('B0_HERG in component IKr (per_mV)');
    LEGEND_CONSTANTS(:,113) = strpad('A1_HERG in component IKr (per_ms)');
    LEGEND_CONSTANTS(:,114) = strpad('B1_HERG in component IKr (per_mV)');
    LEGEND_CONSTANTS(:,115) = strpad('A2_HERG in component IKr (per_ms)');
    LEGEND_CONSTANTS(:,116) = strpad('B2_HERG in component IKr (per_mV)');
    LEGEND_CONSTANTS(:,117) = strpad('A3_HERG in component IKr (per_ms)');
    LEGEND_CONSTANTS(:,118) = strpad('B3_HERG in component IKr (per_mV)');
    LEGEND_CONSTANTS(:,119) = strpad('A4_HERG in component IKr (per_ms)');
    LEGEND_CONSTANTS(:,120) = strpad('B4_HERG in component IKr (per_mV)');
    LEGEND_CONSTANTS(:,121) = strpad('A5_HERG in component IKr (per_ms)');
    LEGEND_CONSTANTS(:,122) = strpad('B5_HERG in component IKr (per_mV)');
    LEGEND_CONSTANTS(:,123) = strpad('A6_HERG in component IKr (per_ms)');
    LEGEND_CONSTANTS(:,124) = strpad('B6_HERG in component IKr (per_mV)');
    LEGEND_CONSTANTS(:,140) = strpad('C2H_to_C3H in component IKr (per_ms)');
    LEGEND_CONSTANTS(:,141) = strpad('C3H_to_C2H in component IKr (per_ms)');
    LEGEND_ALGEBRAIC(:,9) = strpad('C1H_to_C2H in component IKr (per_ms)');
    LEGEND_ALGEBRAIC(:,20) = strpad('C2H_to_C1H in component IKr (per_ms)');
    LEGEND_ALGEBRAIC(:,10) = strpad('C3H_to_OH in component IKr (per_ms)');
    LEGEND_ALGEBRAIC(:,21) = strpad('OH_to_C3H in component IKr (per_ms)');
    LEGEND_ALGEBRAIC(:,30) = strpad('OH_to_IH in component IKr (per_ms)');
    LEGEND_ALGEBRAIC(:,41) = strpad('IH_to_OH in component IKr (per_ms)');
    LEGEND_ALGEBRAIC(:,50) = strpad('C3H_to_IH in component IKr (per_ms)');
    LEGEND_ALGEBRAIC(:,59) = strpad('IH_to_C3H in component IKr (per_ms)');
    LEGEND_STATES(:,62) = strpad('C1Herg in component IKr (dimensionless)');
    LEGEND_ALGEBRAIC(:,31) = strpad('a1_C2 in component IKr (per_ms)');
    LEGEND_ALGEBRAIC(:,42) = strpad('a2_C2 in component IKr (per_ms)');
    LEGEND_STATES(:,63) = strpad('C2Herg in component IKr (dimensionless)');
    LEGEND_ALGEBRAIC(:,69) = strpad('a1_C3 in component IKr (per_ms)');
    LEGEND_ALGEBRAIC(:,80) = strpad('a2_C3 in component IKr (per_ms)');
    LEGEND_STATES(:,64) = strpad('C3Herg in component IKr (dimensionless)');
    LEGEND_ALGEBRAIC(:,51) = strpad('a1_O in component IKr (per_ms)');
    LEGEND_ALGEBRAIC(:,60) = strpad('a2_O in component IKr (per_ms)');
    LEGEND_ALGEBRAIC(:,70) = strpad('a1_I in component IKr (per_ms)');
    LEGEND_ALGEBRAIC(:,81) = strpad('a2_I in component IKr (per_ms)');
    LEGEND_STATES(:,65) = strpad('IHerg in component IKr (dimensionless)');
    LEGEND_CONSTANTS(:,142) = strpad('C0ks_C1ks in component IKs (per_ms)');
    LEGEND_CONSTANTS(:,143) = strpad('C1ks_O1ks in component IKs (per_ms)');
    LEGEND_ALGEBRAIC(:,11) = strpad('O1ks_O2ks in component IKs (per_ms)');
    LEGEND_ALGEBRAIC(:,22) = strpad('O1ks_C1ks in component IKs (per_ms)');
    LEGEND_ALGEBRAIC(:,32) = strpad('O2ks_O1ks in component IKs (per_ms)');
    LEGEND_ALGEBRAIC(:,33) = strpad('C1ks_C0ks in component IKs (per_ms)');
    LEGEND_STATES(:,66) = strpad('C0ks in component IKs (dimensionless)');
    LEGEND_STATES(:,67) = strpad('C1ks in component IKs (dimensionless)');
    LEGEND_RATES(:,1) = strpad('d/dt Nai in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mM)');
    LEGEND_RATES(:,2) = strpad('d/dt Ki in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mM)');
    LEGEND_RATES(:,3) = strpad('d/dt Cai in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mM)');
    LEGEND_RATES(:,4) = strpad('d/dt CaSS in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mM)');
    LEGEND_RATES(:,5) = strpad('d/dt CaJSR in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mM)');
    LEGEND_RATES(:,6) = strpad('d/dt CaNSR in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mM)');
    LEGEND_RATES(:,7) = strpad('d/dt V in component COMPUTE_CONCENTRATION_AND_VOLTAGE_DERIVATIVES (mV)');
    LEGEND_RATES(:,10) = strpad('d/dt LTRPNCa in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (dimensionless)');
    LEGEND_RATES(:,11) = strpad('d/dt HTRPNCa in component COMPUTE_Jtrpn_and_BUFFER_SCALE_FACTORS (dimensionless)');
    LEGEND_RATES(:,12) = strpad('d/dt C1_RyR in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_RATES(:,9) = strpad('d/dt O2_RyR in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_RATES(:,13) = strpad('d/dt C2_RyR in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_RATES(:,8) = strpad('d/dt O1_RyR in component COMPUTE_DERIVATIVES_OF_RyR_RECEPTOR_STATES (dimensionless)');
    LEGEND_RATES(:,14) = strpad('d/dt C0 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,15) = strpad('d/dt C1 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,16) = strpad('d/dt C2 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,17) = strpad('d/dt C3 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,18) = strpad('d/dt C4 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,24) = strpad('d/dt Open in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,19) = strpad('d/dt CCa0 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,20) = strpad('d/dt CCa1 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,21) = strpad('d/dt CCa2 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,22) = strpad('d/dt CCa3 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,23) = strpad('d/dt CCa4 in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,25) = strpad('d/dt yCa in component COMPUTE_DERIVATIVES_OF_LTYPE_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,26) = strpad('d/dt C0Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,27) = strpad('d/dt C1Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,28) = strpad('d/dt C2Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,29) = strpad('d/dt C3Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,30) = strpad('d/dt OKv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,31) = strpad('d/dt CI0Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,32) = strpad('d/dt CI1Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,33) = strpad('d/dt CI2Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,34) = strpad('d/dt CI3Kv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,35) = strpad('d/dt OIKv43 in component COMPUTE_DERIVATIVES_OF_Kv4_3_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,36) = strpad('d/dt C0Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,37) = strpad('d/dt C1Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,38) = strpad('d/dt C2Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,39) = strpad('d/dt C3Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,40) = strpad('d/dt OKv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,41) = strpad('d/dt CI0Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,42) = strpad('d/dt CI1Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,43) = strpad('d/dt CI2Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,44) = strpad('d/dt CI3Kv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,45) = strpad('d/dt OIKv14 in component COMPUTE_DERIVATIVES_OF_Kv1_4_CHANNEL_STATES (dimensionless)');
    LEGEND_RATES(:,51) = strpad('d/dt na1 in component INa (dimensionless)');
    LEGEND_RATES(:,52) = strpad('d/dt na2 in component INa (dimensionless)');
    LEGEND_RATES(:,53) = strpad('d/dt na3 in component INa (dimensionless)');
    LEGEND_RATES(:,54) = strpad('d/dt na4 in component INa (dimensionless)');
    LEGEND_RATES(:,55) = strpad('d/dt na5 in component INa (dimensionless)');
    LEGEND_RATES(:,46) = strpad('d/dt na6 in component INa (dimensionless)');
    LEGEND_RATES(:,47) = strpad('d/dt na7 in component INa (dimensionless)');
    LEGEND_RATES(:,56) = strpad('d/dt na8 in component INa (dimensionless)');
    LEGEND_RATES(:,57) = strpad('d/dt na9 in component INa (dimensionless)');
    LEGEND_RATES(:,58) = strpad('d/dt na10 in component INa (dimensionless)');
    LEGEND_RATES(:,59) = strpad('d/dt na11 in component INa (dimensionless)');
    LEGEND_RATES(:,60) = strpad('d/dt na12 in component INa (dimensionless)');
    LEGEND_RATES(:,61) = strpad('d/dt na13 in component INa (dimensionless)');
    LEGEND_RATES(:,62) = strpad('d/dt C1Herg in component IKr (dimensionless)');
    LEGEND_RATES(:,63) = strpad('d/dt C2Herg in component IKr (dimensionless)');
    LEGEND_RATES(:,64) = strpad('d/dt C3Herg in component IKr (dimensionless)');
    LEGEND_RATES(:,48) = strpad('d/dt OHerg in component IKr (dimensionless)');
    LEGEND_RATES(:,65) = strpad('d/dt IHerg in component IKr (dimensionless)');
    LEGEND_RATES(:,66) = strpad('d/dt C0ks in component IKs (dimensionless)');
    LEGEND_RATES(:,67) = strpad('d/dt C1ks in component IKs (dimensionless)');
    LEGEND_RATES(:,49) = strpad('d/dt O1ks in component IKs (dimensionless)');
    LEGEND_RATES(:,50) = strpad('d/dt O2ks in component IKs (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) = 0;
    CONSTANTS(:,2) = 0;
    CONSTANTS(:,3) = 0;
    CONSTANTS(:,4) = 96.5;
    CONSTANTS(:,5) = 310;
    CONSTANTS(:,6) = 8.315;
    CONSTANTS(:,7) = 0.0001534;
    CONSTANTS(:,8) = 2.584e-5;
    CONSTANTS(:,9) = 1.6e-7;
    CONSTANTS(:,10) = 2.1e-6;
    CONSTANTS(:,11) = 1.2e-9;
    STATES(:,1) = 9.85573275838928;
    STATES(:,2) = 125.427082712469;
    STATES(:,3) = 0.000363968672182656;
    STATES(:,4) = 0.000506604278037024;
    STATES(:,5) = 0.421936980515042;
    STATES(:,6) = 0.423551621440241;
    STATES(:,7) = -86.7261544519706;
    CONSTANTS(:,12) = 4;
    CONSTANTS(:,13) = 138;
    CONSTANTS(:,14) = 2;
    CONSTANTS(:,15) = 500;
    CONSTANTS(:,16) = 3;
    CONSTANTS(:,17) = -15;
    CONSTANTS(:,18) = 100;
    CONSTANTS(:,19) = 0.000168;
    CONSTANTS(:,20) = 1.2;
    CONSTANTS(:,21) = 3.29;
    CONSTANTS(:,22) = 1;
    CONSTANTS(:,23) = 1.2;
    CONSTANTS(:,24) = 7.48e-5;
    CONSTANTS(:,25) = 0.000318;
    CONSTANTS(:,26) = 1.8;
    STATES(:,8) = 0.00113684728532807;
    STATES(:,9) = 3.11350788541838e-7;
    CONSTANTS(:,27) = 0.5747;
    CONSTANTS(:,28) = 26.7;
    CONSTANTS(:,29) = 0.07;
    CONSTANTS(:,30) = 0.14;
    CONSTANTS(:,31) = 20;
    CONSTANTS(:,32) = 6.6e-5;
    CONSTANTS(:,33) = 40;
    CONSTANTS(:,34) = 0.04;
    CONSTANTS(:,35) = 0.05;
    CONSTANTS(:,36) = 0;
    CONSTANTS(:,37) = 0.00238;
    CONSTANTS(:,38) = 0.8;
    CONSTANTS(:,39) = 0.00015;
    STATES(:,10) = 0.280466039150394;
    STATES(:,11) = 0.99347761599363;
    CONSTANTS(:,40) = 0.01215;
    CONSTANTS(:,41) = 0.576;
    CONSTANTS(:,42) = 0.00405;
    CONSTANTS(:,43) = 1.93;
    CONSTANTS(:,44) = 0.1;
    CONSTANTS(:,45) = 0.0008;
    CONSTANTS(:,46) = 4;
    CONSTANTS(:,47) = 3;
    CONSTANTS(:,48) = 1;
    CONSTANTS(:,49) = 0.5;
    CONSTANTS(:,50) = 0.5;
    CONSTANTS(:,51) = 5;
    CONSTANTS(:,52) = 1;
    CONSTANTS(:,53) = 1;
    CONSTANTS(:,54) = 2.5;
    STATES(:,12) = 0.132070890861418;
    STATES(:,13) = 0.866791951404883;
    CONSTANTS(:,55) = 0.3;
    CONSTANTS(:,56) = 4;
    CONSTANTS(:,57) = 2;
    CONSTANTS(:,58) = 2;
    STATES(:,14) = 0.465679150104636;
    STATES(:,15) = 0.00834457719966281;
    STATES(:,16) = 5.60736209083906e-5;
    STATES(:,17) = 1.6747092904465e-7;
    STATES(:,18) = 1.87571666668874e-10;
    STATES(:,19) = 0.489846779190386;
    STATES(:,20) = 0.035111008610982;
    STATES(:,21) = 0.000943745917866092;
    STATES(:,22) = 1.12741202215634e-5;
    STATES(:,23) = 5.05056944609524e-8;
    STATES(:,24) = 1.40806027419488e-11;
    STATES(:,25) = 0.995434385054729;
    STATES(:,26) = 0.908189132330738;
    STATES(:,27) = 0.0343385704915328;
    STATES(:,28) = 0.000487654173162347;
    STATES(:,29) = 3.11550715247964e-6;
    STATES(:,30) = 7.42911977991342e-9;
    STATES(:,31) = 0.0349937004781012;
    STATES(:,32) = 0.0171163265867255;
    STATES(:,33) = 0.00428471710061031;
    STATES(:,34) = 0.000564724236640674;
    STATES(:,35) = 2.19603439704397e-5;
    CONSTANTS(:,59) = 0.543708;
    CONSTANTS(:,60) = 0.028983;
    CONSTANTS(:,61) = 0.080185;
    CONSTANTS(:,62) = 0.0468437;
    CONSTANTS(:,63) = 0.0498424;
    CONSTANTS(:,64) = 0.000373016;
    CONSTANTS(:,65) = 0.000819482;
    CONSTANTS(:,66) = 5.374e-8;
    CONSTANTS(:,67) = 1.8936;
    CONSTANTS(:,68) = 14.224647456;
    CONSTANTS(:,69) = 158.574378389;
    CONSTANTS(:,70) = 142.936645351;
    CONSTANTS(:,71) = 6.77348;
    CONSTANTS(:,72) = 15.6212705152;
    CONSTANTS(:,73) = 28.7532603313;
    CONSTANTS(:,74) = 524.576206679;
    CONSTANTS(:,75) = 0.52465073996;
    CONSTANTS(:,76) = 17.51885408639;
    CONSTANTS(:,77) = 938.58764534556;
    CONSTANTS(:,78) = 54749.194733326;
    CONSTANTS(:,79) = 1.00947847105;
    CONSTANTS(:,80) = 1.17100540567;
    CONSTANTS(:,81) = 0.63902768758;
    CONSTANTS(:,82) = 2.12035379095;
    CONSTANTS(:,83) = 1.84002414554;
    CONSTANTS(:,84) = 0.00768548031;
    CONSTANTS(:,85) = 0.0108174834;
    CONSTANTS(:,86) = 0.07793378174;
    CONSTANTS(:,87) = 0.00305767916;
    CONSTANTS(:,88) = 2.44936e-6;
    STATES(:,36) = 0.149374350989705;
    STATES(:,37) = 0.0606794865684932;
    STATES(:,38) = 0.00930314185504921;
    STATES(:,39) = 0.000676403999474111;
    STATES(:,40) = 3.85187206387239e-5;
    STATES(:,41) = 0.0442722560882536;
    STATES(:,42) = 0.00952432663172288;
    STATES(:,43) = 0.0567396669678271;
    STATES(:,44) = 0.113122845136053;
    STATES(:,45) = 0.556269044084734;
    CONSTANTS(:,89) = 0.0186;
    CONSTANTS(:,90) = 0.0035;
    CONSTANTS(:,91) = 0.125305126118808;
    CONSTANTS(:,92) = 56.32;
    CONSTANTS(:,93) = 0.001;
    CONSTANTS(:,94) = 0.872;
    CONSTANTS(:,95) = 0.889;
    STATES(:,46) = 1.02118700961583e-7;
    STATES(:,47) = 1.93499158844817e-8;
    STATES(:,48) = 0.00120284688677794;
    STATES(:,49) = 5.65460174551007e-7;
    STATES(:,50) = 0.0258818770122187;
    CONSTANTS(:,96) = 0.44;
    CONSTANTS(:,97) = 87.5;
    CONSTANTS(:,98) = 1.38;
    CONSTANTS(:,99) = 0.2;
    CONSTANTS(:,100) = 0.35;
    CONSTANTS(:,101) = 2.387;
    CONSTANTS(:,102) = 20;
    CONSTANTS(:,103) = 1.5;
    CONSTANTS(:,104) = 0.05;
    CONSTANTS(:,105) = 0.0005;
    CONSTANTS(:,106) = 7.684e-5;
    CONSTANTS(:,107) = -0.265;
    CONSTANTS(:,108) = 7;
    STATES(:,51) = 0.111284526171411;
    STATES(:,52) = 0.0481019786429977;
    STATES(:,53) = 0.00779692701457915;
    STATES(:,54) = 0.000561699600929369;
    STATES(:,55) = 1.51746424723121e-5;
    STATES(:,56) = 0.368582741846592;
    STATES(:,57) = 0.312463212648791;
    STATES(:,58) = 0.0993398770493615;
    STATES(:,59) = 0.0140431688972267;
    STATES(:,60) = 0.000750073829883749;
    STATES(:,61) = 0.0370604970714329;
    CONSTANTS(:,109) = 294.16;
    CONSTANTS(:,110) = 5.320000001;
    CONSTANTS(:,111) = 0.017147641733086;
    CONSTANTS(:,112) = 0.03304608038835;
    CONSTANTS(:,113) = 0.03969328381141;
    CONSTANTS(:,114) = -0.0430605416398;
    CONSTANTS(:,115) = 0.02057448605977;
    CONSTANTS(:,116) = 0.02617412715118;
    CONSTANTS(:,117) = 0.00134366604423;
    CONSTANTS(:,118) = -0.02691385498399;
    CONSTANTS(:,119) = 0.10666316491288;
    CONSTANTS(:,120) = 0.00568908859717;
    CONSTANTS(:,121) = 0.00646393910049;
    CONSTANTS(:,122) = -0.04536642959543;
    CONSTANTS(:,123) = 8.039374403e-5;
    CONSTANTS(:,124) = 6.9808924e-7;
    STATES(:,62) = 0.994948338598163;
    STATES(:,63) = 0.000595653663190548;
    STATES(:,64) = 0.000228183228829573;
    STATES(:,65) = 0.000243789721526602;
    STATES(:,66) = 0.938064990549233;
    STATES(:,67) = 0.0360525668093578;
    CONSTANTS(:,125) = ( CONSTANTS(:,6).*CONSTANTS(:,5))./CONSTANTS(:,4);
    CONSTANTS(:,126) = piecewise({CONSTANTS(:,3)==1.00000, 15.0000 },  0.500000.*15.0000);
    CONSTANTS(:,127) = piecewise({CONSTANTS(:,2)==1.00000, 0.200000 }, 0.500000);
    CONSTANTS(:,128) = piecewise({CONSTANTS(:,2)==1.00000, 0.500000 }, 1.00000);
    CONSTANTS(:,129) =  0.250000.*0.0100000;
    CONSTANTS(:,130) = 0.820000;
    CONSTANTS(:,131) = CONSTANTS(:,87);
    CONSTANTS(:,132) = CONSTANTS(:,88);
    CONSTANTS(:,133) =  CONSTANTS(:,95).*CONSTANTS(:,94).*0.100000;
    CONSTANTS(:,134) =  (1.00000 - CONSTANTS(:,95)).*CONSTANTS(:,94).*4.29860e-07;
    CONSTANTS(:,135) = power((CONSTANTS(:,12)./4.00000), 1.0 ./ 2);
    CONSTANTS(:,136) =  CONSTANTS(:,7).*0.00100000;
    CONSTANTS(:,137) =  CONSTANTS(:,108).*4.57400e-07;
    CONSTANTS(:,138) = ( 1.38100e-23.*CONSTANTS(:,109))./6.62600e-31;
    CONSTANTS(:,139) = ( CONSTANTS(:,6).*CONSTANTS(:,109))./CONSTANTS(:,4);
    CONSTANTS(:,140) =  CONSTANTS(:,110).*0.0260836;
    CONSTANTS(:,141) =  CONSTANTS(:,110).*0.148330;
    CONSTANTS(:,142) = 0.00795601;
    CONSTANTS(:,143) = 0.0396672;
    CONSTANTS(:,144) = CONSTANTS(:,129);
    CONSTANTS(:,145) = CONSTANTS(:,132);
    CONSTANTS(:,146) =  CONSTANTS(:,75).*CONSTANTS(:,132);
    CONSTANTS(:,147) =  CONSTANTS(:,76).*CONSTANTS(:,132);
    CONSTANTS(:,148) =  CONSTANTS(:,77).*CONSTANTS(:,132);
    CONSTANTS(:,149) =  CONSTANTS(:,78).*CONSTANTS(:,132);
    CONSTANTS(:,150) = CONSTANTS(:,131);
    CONSTANTS(:,151) = CONSTANTS(:,131)./CONSTANTS(:,79);
    CONSTANTS(:,152) = CONSTANTS(:,131)./CONSTANTS(:,80);
    CONSTANTS(:,153) = CONSTANTS(:,131)./CONSTANTS(:,81);
    CONSTANTS(:,154) = CONSTANTS(:,131)./CONSTANTS(:,82);
    CONSTANTS(:,155) = CONSTANTS(:,12)+ 0.0183300.*CONSTANTS(:,13);
    CONSTANTS(:,156) = CONSTANTS(:,136)./( CONSTANTS(:,8).*CONSTANTS(:,4));
    CONSTANTS(:,157) = piecewise({CONSTANTS(:,1)==0.00000,  CONSTANTS(:,108).*0.000246900 },  1.50000.*CONSTANTS(:,108).*0.000246900);
    CONSTANTS(:,158) =  CONSTANTS(:,6).*CONSTANTS(:,109);
    CONSTANTS(:,159) = 1.00000./CONSTANTS(:,125);
    CONSTANTS(:,160) = CONSTANTS(:,144)./CONSTANTS(:,57);
    CONSTANTS(:,161) = CONSTANTS(:,136)./( 2.00000.*CONSTANTS(:,11).*CONSTANTS(:,4));
    CONSTANTS(:,162) = 1.38862;
    CONSTANTS(:,163) = CONSTANTS(:,160)./CONSTANTS(:,57);
    CONSTANTS(:,164) = (exp(CONSTANTS(:,13)./67.3000) - 1.00000)./7.00000;
    CONSTANTS(:,165) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 287913../CONSTANTS(:,158)+786.217./CONSTANTS(:,6));
    CONSTANTS(:,166) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 85800.4./CONSTANTS(:,158)+70.0780./CONSTANTS(:,6));
    CONSTANTS(:,167) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 121955../CONSTANTS(:,158)+225.175./CONSTANTS(:,6));
    CONSTANTS(:,168) = CONSTANTS(:,12)./(CONSTANTS(:,12)+CONSTANTS(:,103));
    CONSTANTS(:,169) = CONSTANTS(:,163)./CONSTANTS(:,57);
    CONSTANTS(:,170) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 59565.2./CONSTANTS(:,158)+0.00711000./CONSTANTS(:,6));
    CONSTANTS(:,171) = CONSTANTS(:,166);
    CONSTANTS(:,172) = CONSTANTS(:,167);
    CONSTANTS(:,173) = CONSTANTS(:,98)+CONSTANTS(:,14);
    CONSTANTS(:,174) = CONSTANTS(:,169)./CONSTANTS(:,57);
    CONSTANTS(:,175) = 1.40043;
    CONSTANTS(:,176) = (power(CONSTANTS(:,97), 3.00000)+power(CONSTANTS(:,13), 3.00000))./5000.00;
    CONSTANTS(:,177) = CONSTANTS(:,170);
    CONSTANTS(:,178) = CONSTANTS(:,165);
    CONSTANTS(:,179) = CONSTANTS(:,177)./CONSTANTS(:,175);
    CONSTANTS(:,180) =  CONSTANTS(:,178).*CONSTANTS(:,175);
    CONSTANTS(:,181) = CONSTANTS(:,179)./CONSTANTS(:,175);
    CONSTANTS(:,182) =  CONSTANTS(:,180).*CONSTANTS(:,175);
    CONSTANTS(:,183) = CONSTANTS(:,181)./CONSTANTS(:,175);
    CONSTANTS(:,184) =  CONSTANTS(:,182).*CONSTANTS(:,175);
    CONSTANTS(:,185) = CONSTANTS(:,183)./CONSTANTS(:,175);
    CONSTANTS(:,186) =  CONSTANTS(:,184).*CONSTANTS(:,175);
    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(:,24) =  CONSTANTS(:,55).*STATES(:,18) -  CONSTANTS(:,56).*STATES(:,24);
    ALGEBRAIC(:,4) = (CONSTANTS(:,130)./(1.00000+exp((STATES(:,7)+28.5000)./7.80000))+1.00000) - CONSTANTS(:,130);
    ALGEBRAIC(:,15) = 1.00000./(0.00336336./(0.500000+exp(STATES(:,7)./ - 5.53900))+ 0.00779047.*exp(STATES(:,7)./ - 49.5104));
    RATES(:,25) = (ALGEBRAIC(:,4) - STATES(:,25))./ALGEBRAIC(:,15);
    ALGEBRAIC(:,9) =  CONSTANTS(:,110).*CONSTANTS(:,111).*exp( CONSTANTS(:,112).*STATES(:,7));
    ALGEBRAIC(:,20) =  CONSTANTS(:,110).*CONSTANTS(:,113).*exp( CONSTANTS(:,114).*STATES(:,7));
    RATES(:,62) =  ALGEBRAIC(:,20).*STATES(:,63) -  ALGEBRAIC(:,9).*STATES(:,62);
    ALGEBRAIC(:,33) =  0.216256.*exp(  - 1.88912e-05.*STATES(:,7));
    RATES(:,66) =   - CONSTANTS(:,142).*STATES(:,66)+ ALGEBRAIC(:,33).*STATES(:,67);
    ALGEBRAIC(:,22) =  0.00700807.*exp(  - 0.149998.*STATES(:,7));
    RATES(:,67) = ( CONSTANTS(:,142).*STATES(:,66) -  (ALGEBRAIC(:,33)+CONSTANTS(:,143)).*STATES(:,67))+ ALGEBRAIC(:,22).*STATES(:,49);
    ALGEBRAIC(:,11) =  0.00767254.*exp( 0.0866295.*STATES(:,7));
    ALGEBRAIC(:,32) =  0.00379738.*exp(  - 0.0142567.*STATES(:,7));
    RATES(:,49) = ( CONSTANTS(:,143).*STATES(:,67) -  (ALGEBRAIC(:,22)+ALGEBRAIC(:,11)).*STATES(:,49))+ ALGEBRAIC(:,32).*STATES(:,50);
    RATES(:,50) =  ALGEBRAIC(:,11).*STATES(:,49) -  ALGEBRAIC(:,32).*STATES(:,50);
    ALGEBRAIC(:,2) = CONSTANTS(:,49) - (CONSTANTS(:,49) - CONSTANTS(:,51))./(1.00000+power(CONSTANTS(:,52)./STATES(:,5), CONSTANTS(:,54)));
    ALGEBRAIC(:,35) =   - CONSTANTS(:,40).*ALGEBRAIC(:,2).*power( STATES(:,4).*1000.00,  CONSTANTS(:,46).*CONSTANTS(:,48)).*STATES(:,12)+ CONSTANTS(:,41).*STATES(:,8);
    RATES(:,12) = ALGEBRAIC(:,35);
    ALGEBRAIC(:,31) =  ALGEBRAIC(:,9).*STATES(:,62)+ CONSTANTS(:,141).*STATES(:,64);
    ALGEBRAIC(:,42) =  (ALGEBRAIC(:,20)+CONSTANTS(:,140)).*STATES(:,63);
    RATES(:,63) = ALGEBRAIC(:,31) - ALGEBRAIC(:,42);
    ALGEBRAIC(:,44) =  CONSTANTS(:,42).*power( STATES(:,4).*1000.00,  CONSTANTS(:,47).*CONSTANTS(:,48)).*STATES(:,8) -  CONSTANTS(:,43).*STATES(:,9);
    RATES(:,9) = ALGEBRAIC(:,44);
    ALGEBRAIC(:,13) = CONSTANTS(:,127) - (CONSTANTS(:,127) - CONSTANTS(:,51))./(1.00000+power(CONSTANTS(:,53)./STATES(:,5), CONSTANTS(:,54)));
    ALGEBRAIC(:,24) = CONSTANTS(:,50) - (CONSTANTS(:,50) - CONSTANTS(:,51))./(1.00000+power(CONSTANTS(:,128)./STATES(:,5), CONSTANTS(:,54)));
    ALGEBRAIC(:,53) =  (CONSTANTS(:,44)./ALGEBRAIC(:,13)).*STATES(:,8) -  CONSTANTS(:,45).*ALGEBRAIC(:,24).*STATES(:,13);
    RATES(:,13) = ALGEBRAIC(:,53);
    ALGEBRAIC(:,10) =  CONSTANTS(:,110).*CONSTANTS(:,115).*exp( CONSTANTS(:,116).*STATES(:,7));
    ALGEBRAIC(:,41) =  CONSTANTS(:,110).*CONSTANTS(:,121).*exp( CONSTANTS(:,122).*STATES(:,7));
    ALGEBRAIC(:,51) =  ALGEBRAIC(:,10).*STATES(:,64)+ ALGEBRAIC(:,41).*STATES(:,65);
    ALGEBRAIC(:,21) =  CONSTANTS(:,110).*CONSTANTS(:,117).*exp( CONSTANTS(:,118).*STATES(:,7));
    ALGEBRAIC(:,30) =  CONSTANTS(:,110).*CONSTANTS(:,119).*exp( CONSTANTS(:,120).*STATES(:,7));
    ALGEBRAIC(:,60) =  (ALGEBRAIC(:,21)+ALGEBRAIC(:,30)).*STATES(:,48);
    RATES(:,48) = ALGEBRAIC(:,51) - ALGEBRAIC(:,60);
    ALGEBRAIC(:,23) = power(STATES(:,3)./CONSTANTS(:,19), CONSTANTS(:,20));
    ALGEBRAIC(:,34) = power(STATES(:,6)./CONSTANTS(:,21), CONSTANTS(:,22));
    ALGEBRAIC(:,43) = piecewise({CONSTANTS(:,1)==0.00000, ( CONSTANTS(:,23).*( CONSTANTS(:,24).*ALGEBRAIC(:,23) -  CONSTANTS(:,25).*ALGEBRAIC(:,34)))./(1.00000+ALGEBRAIC(:,23)+ALGEBRAIC(:,34)) }, ( 1.50000.*CONSTANTS(:,23).*( CONSTANTS(:,24).*ALGEBRAIC(:,23) -  CONSTANTS(:,25).*ALGEBRAIC(:,34)))./(1.00000+ALGEBRAIC(:,23)+ALGEBRAIC(:,34)));
    ALGEBRAIC(:,62) = (STATES(:,6) - STATES(:,5))./CONSTANTS(:,27);
    RATES(:,6) = ( ALGEBRAIC(:,43).*CONSTANTS(:,8))./CONSTANTS(:,10) - ( ALGEBRAIC(:,62).*CONSTANTS(:,9))./CONSTANTS(:,10);
    ALGEBRAIC(:,63) =  - (ALGEBRAIC(:,35)+ALGEBRAIC(:,44)+ALGEBRAIC(:,53));
    RATES(:,8) = ALGEBRAIC(:,63);
    ALGEBRAIC(:,52) =  CONSTANTS(:,26).*(STATES(:,8)+STATES(:,9)).*(STATES(:,5) - STATES(:,4));
    ALGEBRAIC(:,72) = 1.00000./(1.00000+( CONSTANTS(:,126).*CONSTANTS(:,38))./power(STATES(:,5)+CONSTANTS(:,38), 2.00000));
    RATES(:,5) =  ALGEBRAIC(:,72).*(ALGEBRAIC(:,62) - ALGEBRAIC(:,52));
    ALGEBRAIC(:,71) =  CONSTANTS(:,33).*STATES(:,3).*(1.00000 - STATES(:,10)) -  CONSTANTS(:,34).*STATES(:,10);
    RATES(:,10) = ALGEBRAIC(:,71);
    ALGEBRAIC(:,50) =  CONSTANTS(:,110).*CONSTANTS(:,123).*exp( CONSTANTS(:,124).*STATES(:,7));
    ALGEBRAIC(:,59) = ( ALGEBRAIC(:,21).*ALGEBRAIC(:,41).*ALGEBRAIC(:,50))./( ALGEBRAIC(:,10).*ALGEBRAIC(:,30));
    ALGEBRAIC(:,69) =  CONSTANTS(:,140).*STATES(:,63)+ ALGEBRAIC(:,21).*STATES(:,48)+ ALGEBRAIC(:,59).*STATES(:,65);
    ALGEBRAIC(:,80) =  (ALGEBRAIC(:,50)+ALGEBRAIC(:,10)+CONSTANTS(:,141)).*STATES(:,64);
    RATES(:,64) = ALGEBRAIC(:,69) - ALGEBRAIC(:,80);
    ALGEBRAIC(:,70) =  ALGEBRAIC(:,50).*STATES(:,64)+ ALGEBRAIC(:,30).*STATES(:,48);
    ALGEBRAIC(:,81) =  (ALGEBRAIC(:,59)+ALGEBRAIC(:,41)).*STATES(:,65);
    RATES(:,65) = ALGEBRAIC(:,70) - ALGEBRAIC(:,81);
    ALGEBRAIC(:,82) =  CONSTANTS(:,31).*STATES(:,3).*(1.00000 - STATES(:,11)) -  CONSTANTS(:,32).*STATES(:,11);
    RATES(:,11) = ALGEBRAIC(:,82);
    ALGEBRAIC(:,6) =  CONSTANTS(:,83).*exp( CONSTANTS(:,84).*STATES(:,7));
    ALGEBRAIC(:,27) =  4.00000.*ALGEBRAIC(:,6);
    ALGEBRAIC(:,77) =  (ALGEBRAIC(:,27)+CONSTANTS(:,145)).*STATES(:,36);
    ALGEBRAIC(:,17) =  CONSTANTS(:,85).*exp(  - CONSTANTS(:,86).*STATES(:,7));
    ALGEBRAIC(:,66) = ALGEBRAIC(:,17);
    ALGEBRAIC(:,87) =  ALGEBRAIC(:,66).*STATES(:,37)+ CONSTANTS(:,150).*STATES(:,41);
    RATES(:,36) = ALGEBRAIC(:,87) - ALGEBRAIC(:,77);
    ALGEBRAIC(:,28) =  4.00000.*CONSTANTS(:,79).*ALGEBRAIC(:,6);
    ALGEBRAIC(:,78) =  (CONSTANTS(:,150)+ALGEBRAIC(:,28)).*STATES(:,41);
    ALGEBRAIC(:,67) = ALGEBRAIC(:,17)./CONSTANTS(:,75);
    ALGEBRAIC(:,89) =  CONSTANTS(:,145).*STATES(:,36)+ ALGEBRAIC(:,67).*STATES(:,42);
    RATES(:,41) = ALGEBRAIC(:,89) - ALGEBRAIC(:,78);
    ALGEBRAIC(:,38) =  3.00000.*ALGEBRAIC(:,6);
    ALGEBRAIC(:,88) =  (ALGEBRAIC(:,38)+ALGEBRAIC(:,66)+CONSTANTS(:,146)).*STATES(:,37);
    ALGEBRAIC(:,75) =  2.00000.*ALGEBRAIC(:,17);
    ALGEBRAIC(:,97) =  ALGEBRAIC(:,75).*STATES(:,38)+ CONSTANTS(:,151).*STATES(:,42)+ ALGEBRAIC(:,27).*STATES(:,36);
    RATES(:,37) = ALGEBRAIC(:,97) - ALGEBRAIC(:,88);
    ALGEBRAIC(:,39) = ( 3.00000.*CONSTANTS(:,80).*ALGEBRAIC(:,6))./CONSTANTS(:,79);
    ALGEBRAIC(:,90) =  (ALGEBRAIC(:,39)+CONSTANTS(:,151)+ALGEBRAIC(:,67)).*STATES(:,42);
    ALGEBRAIC(:,76) = ( 2.00000.*CONSTANTS(:,75).*ALGEBRAIC(:,17))./CONSTANTS(:,76);
    ALGEBRAIC(:,99) =  ALGEBRAIC(:,76).*STATES(:,43)+ CONSTANTS(:,146).*STATES(:,37)+ ALGEBRAIC(:,28).*STATES(:,41);
    RATES(:,42) = ALGEBRAIC(:,99) - ALGEBRAIC(:,90);
    ALGEBRAIC(:,47) =  2.00000.*ALGEBRAIC(:,6);
    ALGEBRAIC(:,98) =  (ALGEBRAIC(:,47)+ALGEBRAIC(:,75)+CONSTANTS(:,147)).*STATES(:,38);
    ALGEBRAIC(:,85) =  3.00000.*ALGEBRAIC(:,17);
    ALGEBRAIC(:,105) =  ALGEBRAIC(:,85).*STATES(:,39)+ CONSTANTS(:,152).*STATES(:,43)+ ALGEBRAIC(:,38).*STATES(:,37);
    RATES(:,38) = ALGEBRAIC(:,105) - ALGEBRAIC(:,98);
    ALGEBRAIC(:,48) = ( 2.00000.*CONSTANTS(:,81).*ALGEBRAIC(:,6))./CONSTANTS(:,80);
    ALGEBRAIC(:,100) =  (ALGEBRAIC(:,48)+CONSTANTS(:,152)+ALGEBRAIC(:,76)).*STATES(:,43);
    ALGEBRAIC(:,86) = ( 3.00000.*CONSTANTS(:,76).*ALGEBRAIC(:,17))./CONSTANTS(:,77);
    ALGEBRAIC(:,108) =  ALGEBRAIC(:,86).*STATES(:,44)+ CONSTANTS(:,147).*STATES(:,38)+ ALGEBRAIC(:,39).*STATES(:,42);
    RATES(:,43) = ALGEBRAIC(:,108) - ALGEBRAIC(:,100);
    ALGEBRAIC(:,56) = ALGEBRAIC(:,6);
    ALGEBRAIC(:,106) =  (ALGEBRAIC(:,56)+ALGEBRAIC(:,85)+CONSTANTS(:,148)).*STATES(:,39);
    ALGEBRAIC(:,95) =  4.00000.*ALGEBRAIC(:,17);
    ALGEBRAIC(:,115) =  ALGEBRAIC(:,95).*STATES(:,40)+ CONSTANTS(:,153).*STATES(:,44)+ ALGEBRAIC(:,47).*STATES(:,38);
    RATES(:,39) = ALGEBRAIC(:,115) - ALGEBRAIC(:,106);
    ALGEBRAIC(:,107) =  (ALGEBRAIC(:,95)+CONSTANTS(:,149)).*STATES(:,40);
    ALGEBRAIC(:,116) =  ALGEBRAIC(:,56).*STATES(:,39)+ CONSTANTS(:,154).*STATES(:,45);
    RATES(:,40) = ALGEBRAIC(:,116) - ALGEBRAIC(:,107);
    ALGEBRAIC(:,57) = ( CONSTANTS(:,82).*ALGEBRAIC(:,6))./CONSTANTS(:,81);
    ALGEBRAIC(:,109) =  (ALGEBRAIC(:,57)+CONSTANTS(:,153)+ALGEBRAIC(:,86)).*STATES(:,44);
    ALGEBRAIC(:,96) = ( 4.00000.*CONSTANTS(:,77).*ALGEBRAIC(:,17))./CONSTANTS(:,78);
    ALGEBRAIC(:,117) =  ALGEBRAIC(:,96).*STATES(:,45)+ CONSTANTS(:,148).*STATES(:,39)+ ALGEBRAIC(:,48).*STATES(:,43);
    RATES(:,44) = ALGEBRAIC(:,117) - ALGEBRAIC(:,109);
    ALGEBRAIC(:,110) =  (CONSTANTS(:,154)+ALGEBRAIC(:,96)).*STATES(:,45);
    ALGEBRAIC(:,118) =  CONSTANTS(:,149).*STATES(:,40)+ ALGEBRAIC(:,57).*STATES(:,44);
    RATES(:,45) = ALGEBRAIC(:,118) - ALGEBRAIC(:,110);
    ALGEBRAIC(:,5) =  CONSTANTS(:,59).*exp( CONSTANTS(:,60).*STATES(:,7));
    ALGEBRAIC(:,46) =  4.00000.*ALGEBRAIC(:,5);
    ALGEBRAIC(:,37) =  CONSTANTS(:,65).*exp( CONSTANTS(:,66).*STATES(:,7));
    ALGEBRAIC(:,142) = ALGEBRAIC(:,37);
    ALGEBRAIC(:,156) =  (ALGEBRAIC(:,46)+ALGEBRAIC(:,142)).*STATES(:,26);
    ALGEBRAIC(:,16) =  CONSTANTS(:,61).*exp(  - CONSTANTS(:,62).*STATES(:,7));
    ALGEBRAIC(:,122) = ALGEBRAIC(:,16);
    ALGEBRAIC(:,26) =  CONSTANTS(:,63).*exp(  - CONSTANTS(:,64).*STATES(:,7));
    ALGEBRAIC(:,149) = ALGEBRAIC(:,26);
    ALGEBRAIC(:,164) =  ALGEBRAIC(:,122).*STATES(:,27)+ ALGEBRAIC(:,149).*STATES(:,31);
    RATES(:,26) = ALGEBRAIC(:,164) - ALGEBRAIC(:,156);
    ALGEBRAIC(:,84) =  4.00000.*CONSTANTS(:,71).*ALGEBRAIC(:,5);
    ALGEBRAIC(:,157) =  (ALGEBRAIC(:,149)+ALGEBRAIC(:,84)).*STATES(:,31);
    ALGEBRAIC(:,138) = ALGEBRAIC(:,16)./CONSTANTS(:,67);
    ALGEBRAIC(:,166) =  ALGEBRAIC(:,142).*STATES(:,26)+ ALGEBRAIC(:,138).*STATES(:,32);
    RATES(:,31) = ALGEBRAIC(:,166) - ALGEBRAIC(:,157);
    ALGEBRAIC(:,55) =  3.00000.*ALGEBRAIC(:,5);
    ALGEBRAIC(:,147) =  CONSTANTS(:,67).*ALGEBRAIC(:,37);
    ALGEBRAIC(:,165) =  (ALGEBRAIC(:,55)+ALGEBRAIC(:,122)+ALGEBRAIC(:,147)).*STATES(:,27);
    ALGEBRAIC(:,126) =  2.00000.*ALGEBRAIC(:,16);
    ALGEBRAIC(:,155) = ALGEBRAIC(:,26)./CONSTANTS(:,71);
    ALGEBRAIC(:,173) =  ALGEBRAIC(:,126).*STATES(:,28)+ ALGEBRAIC(:,155).*STATES(:,32)+ ALGEBRAIC(:,46).*STATES(:,26);
    RATES(:,27) = ALGEBRAIC(:,173) - ALGEBRAIC(:,165);
    ALGEBRAIC(:,94) = ( 3.00000.*CONSTANTS(:,72).*ALGEBRAIC(:,5))./CONSTANTS(:,71);
    ALGEBRAIC(:,167) =  (ALGEBRAIC(:,94)+ALGEBRAIC(:,155)+ALGEBRAIC(:,138)).*STATES(:,32);
    ALGEBRAIC(:,143) = ( 2.00000.*CONSTANTS(:,67).*ALGEBRAIC(:,16))./CONSTANTS(:,68);
    ALGEBRAIC(:,175) =  ALGEBRAIC(:,143).*STATES(:,33)+ ALGEBRAIC(:,147).*STATES(:,27)+ ALGEBRAIC(:,84).*STATES(:,31);
    RATES(:,32) = ALGEBRAIC(:,175) - ALGEBRAIC(:,167);
    ALGEBRAIC(:,8) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 114007../CONSTANTS(:,158)+224.114./CONSTANTS(:,6)+( 0.286374.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,111) =  4.00000.*ALGEBRAIC(:,8);
    ALGEBRAIC(:,19) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 272470../CONSTANTS(:,158)+708.146./CONSTANTS(:,6)+(  - 2.28528.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,177) = ALGEBRAIC(:,19);
    RATES(:,51) =   - (CONSTANTS(:,178)+ALGEBRAIC(:,111)).*STATES(:,51)+ ALGEBRAIC(:,177).*STATES(:,52)+ CONSTANTS(:,177).*STATES(:,56);
    ALGEBRAIC(:,65) =  2.00000.*ALGEBRAIC(:,5);
    ALGEBRAIC(:,153) =  CONSTANTS(:,68).*ALGEBRAIC(:,37);
    ALGEBRAIC(:,174) =  (ALGEBRAIC(:,65)+ALGEBRAIC(:,126)+ALGEBRAIC(:,153)).*STATES(:,28);
    ALGEBRAIC(:,130) =  3.00000.*ALGEBRAIC(:,16);
    ALGEBRAIC(:,163) = ALGEBRAIC(:,26)./CONSTANTS(:,72);
    ALGEBRAIC(:,182) =  ALGEBRAIC(:,130).*STATES(:,29)+ ALGEBRAIC(:,163).*STATES(:,33)+ ALGEBRAIC(:,55).*STATES(:,27);
    RATES(:,28) = ALGEBRAIC(:,182) - ALGEBRAIC(:,174);
    ALGEBRAIC(:,104) = ( 2.00000.*CONSTANTS(:,73).*ALGEBRAIC(:,5))./CONSTANTS(:,72);
    ALGEBRAIC(:,176) =  (ALGEBRAIC(:,104)+ALGEBRAIC(:,163)+ALGEBRAIC(:,143)).*STATES(:,33);
    ALGEBRAIC(:,148) = ( 3.00000.*CONSTANTS(:,68).*ALGEBRAIC(:,16))./CONSTANTS(:,69);
    ALGEBRAIC(:,185) =  ALGEBRAIC(:,148).*STATES(:,34)+ ALGEBRAIC(:,153).*STATES(:,28)+ ALGEBRAIC(:,94).*STATES(:,32);
    RATES(:,33) = ALGEBRAIC(:,185) - ALGEBRAIC(:,176);
    ALGEBRAIC(:,119) =  3.00000.*ALGEBRAIC(:,8);
    ALGEBRAIC(:,188) =  2.00000.*ALGEBRAIC(:,19);
    RATES(:,52) = ( ALGEBRAIC(:,111).*STATES(:,51) -  (ALGEBRAIC(:,177)+ALGEBRAIC(:,119)+CONSTANTS(:,180)).*STATES(:,52))+ ALGEBRAIC(:,188).*STATES(:,53)+ CONSTANTS(:,179).*STATES(:,57);
    ALGEBRAIC(:,3) =  4.00000.*1.20000.*0.416000.*exp( 0.0120000.*(STATES(:,7) - 35.0000));
    ALGEBRAIC(:,54) =  4.00000.*ALGEBRAIC(:,3);
    ALGEBRAIC(:,45) =  0.600000.*0.0923300.*STATES(:,4);
    ALGEBRAIC(:,170) = ALGEBRAIC(:,45);
    ALGEBRAIC(:,181) =  (ALGEBRAIC(:,54)+ALGEBRAIC(:,170)).*STATES(:,14);
    ALGEBRAIC(:,14) =  4.00000.*0.450000.*0.0490000.*exp(  - 0.0650000.*(STATES(:,7) - 22.0000));
    ALGEBRAIC(:,125) = ALGEBRAIC(:,14);
    ALGEBRAIC(:,193) =  ALGEBRAIC(:,125).*STATES(:,15)+ CONSTANTS(:,144).*STATES(:,19);
    RATES(:,14) = ALGEBRAIC(:,193) - ALGEBRAIC(:,181);
    ALGEBRAIC(:,25) =  CONSTANTS(:,58).*ALGEBRAIC(:,3);
    ALGEBRAIC(:,93) =  4.00000.*ALGEBRAIC(:,25);
    ALGEBRAIC(:,180) =  (ALGEBRAIC(:,93)+CONSTANTS(:,144)).*STATES(:,19);
    ALGEBRAIC(:,36) = ALGEBRAIC(:,14)./CONSTANTS(:,57);
    ALGEBRAIC(:,141) = ALGEBRAIC(:,36);
    ALGEBRAIC(:,191) =  ALGEBRAIC(:,141).*STATES(:,20)+ ALGEBRAIC(:,170).*STATES(:,14);
    RATES(:,19) = ALGEBRAIC(:,191) - ALGEBRAIC(:,180);
    ALGEBRAIC(:,74) = ALGEBRAIC(:,5);
    ALGEBRAIC(:,161) =  CONSTANTS(:,69).*ALGEBRAIC(:,37);
    ALGEBRAIC(:,183) =  (ALGEBRAIC(:,74)+ALGEBRAIC(:,130)+ALGEBRAIC(:,161)).*STATES(:,29);
    ALGEBRAIC(:,134) =  4.00000.*ALGEBRAIC(:,16);
    ALGEBRAIC(:,171) = ALGEBRAIC(:,26)./CONSTANTS(:,73);
    ALGEBRAIC(:,195) =  ALGEBRAIC(:,134).*STATES(:,30)+ ALGEBRAIC(:,171).*STATES(:,34)+ ALGEBRAIC(:,65).*STATES(:,28);
    RATES(:,29) = ALGEBRAIC(:,195) - ALGEBRAIC(:,183);
    ALGEBRAIC(:,162) =  CONSTANTS(:,70).*ALGEBRAIC(:,37);
    ALGEBRAIC(:,184) =  (ALGEBRAIC(:,134)+ALGEBRAIC(:,162)).*STATES(:,30);
    ALGEBRAIC(:,172) = ALGEBRAIC(:,26)./CONSTANTS(:,74);
    ALGEBRAIC(:,196) =  ALGEBRAIC(:,74).*STATES(:,29)+ ALGEBRAIC(:,172).*STATES(:,35);
    RATES(:,30) = ALGEBRAIC(:,196) - ALGEBRAIC(:,184);
    ALGEBRAIC(:,114) = ( CONSTANTS(:,74).*ALGEBRAIC(:,5))./CONSTANTS(:,73);
    ALGEBRAIC(:,186) =  (ALGEBRAIC(:,114)+ALGEBRAIC(:,171)+ALGEBRAIC(:,148)).*STATES(:,34);
    ALGEBRAIC(:,154) = ( 4.00000.*CONSTANTS(:,69).*ALGEBRAIC(:,16))./CONSTANTS(:,70);
    ALGEBRAIC(:,197) =  ALGEBRAIC(:,154).*STATES(:,35)+ ALGEBRAIC(:,161).*STATES(:,29)+ ALGEBRAIC(:,104).*STATES(:,33);
    RATES(:,34) = ALGEBRAIC(:,197) - ALGEBRAIC(:,186);
    ALGEBRAIC(:,187) =  (ALGEBRAIC(:,172)+ALGEBRAIC(:,154)).*STATES(:,35);
    ALGEBRAIC(:,198) =  ALGEBRAIC(:,162).*STATES(:,30)+ ALGEBRAIC(:,114).*STATES(:,34);
    RATES(:,35) = ALGEBRAIC(:,198) - ALGEBRAIC(:,187);
    ALGEBRAIC(:,123) =  2.00000.*ALGEBRAIC(:,8);
    ALGEBRAIC(:,199) =  3.00000.*ALGEBRAIC(:,19);
    RATES(:,53) = ( ALGEBRAIC(:,119).*STATES(:,52) -  (ALGEBRAIC(:,188)+ALGEBRAIC(:,123)+CONSTANTS(:,182)).*STATES(:,53))+ ALGEBRAIC(:,199).*STATES(:,54)+ CONSTANTS(:,181).*STATES(:,58);
    ALGEBRAIC(:,64) =  3.00000.*ALGEBRAIC(:,3);
    ALGEBRAIC(:,179) =  CONSTANTS(:,58).*ALGEBRAIC(:,170);
    ALGEBRAIC(:,194) =  (ALGEBRAIC(:,125)+ALGEBRAIC(:,64)+ALGEBRAIC(:,179)).*STATES(:,15);
    ALGEBRAIC(:,129) =  2.00000.*ALGEBRAIC(:,14);
    ALGEBRAIC(:,204) =  ALGEBRAIC(:,54).*STATES(:,14)+ ALGEBRAIC(:,129).*STATES(:,16)+ CONSTANTS(:,160).*STATES(:,20);
    RATES(:,15) = ALGEBRAIC(:,204) - ALGEBRAIC(:,194);
    ALGEBRAIC(:,103) =  3.00000.*ALGEBRAIC(:,25);
    ALGEBRAIC(:,192) =  (ALGEBRAIC(:,141)+ALGEBRAIC(:,103)+CONSTANTS(:,160)).*STATES(:,20);
    ALGEBRAIC(:,146) =  2.00000.*ALGEBRAIC(:,36);
    ALGEBRAIC(:,202) =  ALGEBRAIC(:,93).*STATES(:,19)+ ALGEBRAIC(:,146).*STATES(:,21)+ ALGEBRAIC(:,179).*STATES(:,15);
    RATES(:,20) = ALGEBRAIC(:,202) - ALGEBRAIC(:,192);
    ALGEBRAIC(:,127) = ALGEBRAIC(:,8);
    ALGEBRAIC(:,206) =  4.00000.*ALGEBRAIC(:,19);
    RATES(:,54) = ( ALGEBRAIC(:,123).*STATES(:,53) -  (ALGEBRAIC(:,199)+ALGEBRAIC(:,127)+CONSTANTS(:,184)).*STATES(:,54))+ ALGEBRAIC(:,206).*STATES(:,55)+ CONSTANTS(:,183).*STATES(:,59);
    ALGEBRAIC(:,73) =  2.00000.*ALGEBRAIC(:,3);
    ALGEBRAIC(:,190) =  CONSTANTS(:,58).*ALGEBRAIC(:,179);
    ALGEBRAIC(:,205) =  (ALGEBRAIC(:,129)+ALGEBRAIC(:,73)+ALGEBRAIC(:,190)).*STATES(:,16);
    ALGEBRAIC(:,133) =  3.00000.*ALGEBRAIC(:,14);
    ALGEBRAIC(:,211) =  ALGEBRAIC(:,64).*STATES(:,15)+ ALGEBRAIC(:,133).*STATES(:,17)+ CONSTANTS(:,163).*STATES(:,21);
    RATES(:,16) = ALGEBRAIC(:,211) - ALGEBRAIC(:,205);
    ALGEBRAIC(:,113) =  2.00000.*ALGEBRAIC(:,25);
    ALGEBRAIC(:,203) =  (ALGEBRAIC(:,146)+ALGEBRAIC(:,113)+CONSTANTS(:,163)).*STATES(:,21);
    ALGEBRAIC(:,152) =  3.00000.*ALGEBRAIC(:,36);
    ALGEBRAIC(:,209) =  ALGEBRAIC(:,103).*STATES(:,20)+ ALGEBRAIC(:,152).*STATES(:,22)+ ALGEBRAIC(:,190).*STATES(:,16);
    RATES(:,21) = ALGEBRAIC(:,209) - ALGEBRAIC(:,203);
    ALGEBRAIC(:,83) = ALGEBRAIC(:,3);
    ALGEBRAIC(:,201) =  CONSTANTS(:,58).*ALGEBRAIC(:,190);
    ALGEBRAIC(:,212) =  (ALGEBRAIC(:,133)+ALGEBRAIC(:,83)+ALGEBRAIC(:,201)).*STATES(:,17);
    ALGEBRAIC(:,137) =  4.00000.*ALGEBRAIC(:,14);
    ALGEBRAIC(:,217) =  ALGEBRAIC(:,73).*STATES(:,16)+ ALGEBRAIC(:,137).*STATES(:,18)+ CONSTANTS(:,169).*STATES(:,22);
    RATES(:,17) = ALGEBRAIC(:,217) - ALGEBRAIC(:,212);
    ALGEBRAIC(:,121) = ALGEBRAIC(:,25);
    ALGEBRAIC(:,210) =  (ALGEBRAIC(:,152)+ALGEBRAIC(:,121)+CONSTANTS(:,169)).*STATES(:,22);
    ALGEBRAIC(:,160) =  4.00000.*ALGEBRAIC(:,36);
    ALGEBRAIC(:,215) =  ALGEBRAIC(:,113).*STATES(:,21)+ ALGEBRAIC(:,160).*STATES(:,23)+ ALGEBRAIC(:,201).*STATES(:,17);
    RATES(:,22) = ALGEBRAIC(:,215) - ALGEBRAIC(:,210);
    ALGEBRAIC(:,29) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 196337../CONSTANTS(:,158)+529.952./CONSTANTS(:,6)+( 2.78085.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,131) = ALGEBRAIC(:,29);
    ALGEBRAIC(:,91) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 147814../CONSTANTS(:,158)+338.915./CONSTANTS(:,6)+( 2.13600.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,168) = ALGEBRAIC(:,91);
    ALGEBRAIC(:,40) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 133690../CONSTANTS(:,158)+229.205./CONSTANTS(:,6)+(  - 1.55804.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,213) = ALGEBRAIC(:,40);
    ALGEBRAIC(:,101) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 121322../CONSTANTS(:,158)+193.265./CONSTANTS(:,6)+(  - 1.74290.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,220) = ALGEBRAIC(:,101);
    RATES(:,55) = ( ALGEBRAIC(:,127).*STATES(:,54) -  (ALGEBRAIC(:,206)+ALGEBRAIC(:,131)+ALGEBRAIC(:,168)+CONSTANTS(:,186)).*STATES(:,55))+ ALGEBRAIC(:,213).*STATES(:,46)+ ALGEBRAIC(:,220).*STATES(:,47)+ CONSTANTS(:,185).*STATES(:,60);
    RATES(:,47) = ( ALGEBRAIC(:,168).*STATES(:,55)+ CONSTANTS(:,171).*STATES(:,46)) -  (ALGEBRAIC(:,220)+CONSTANTS(:,172)).*STATES(:,47);
    ALGEBRAIC(:,135) =  ALGEBRAIC(:,111).*CONSTANTS(:,175);
    ALGEBRAIC(:,219) = ALGEBRAIC(:,177)./CONSTANTS(:,175);
    RATES(:,56) = ( CONSTANTS(:,178).*STATES(:,51) -  (CONSTANTS(:,177)+ALGEBRAIC(:,135)).*STATES(:,56))+ ALGEBRAIC(:,219).*STATES(:,57);
    ALGEBRAIC(:,208) =  CONSTANTS(:,58).*ALGEBRAIC(:,201);
    ALGEBRAIC(:,218) =  (ALGEBRAIC(:,137)+CONSTANTS(:,55)+ALGEBRAIC(:,208)).*STATES(:,18);
    ALGEBRAIC(:,223) =  ALGEBRAIC(:,83).*STATES(:,17)+ CONSTANTS(:,56).*STATES(:,24)+ CONSTANTS(:,174).*STATES(:,23);
    RATES(:,18) = ALGEBRAIC(:,223) - ALGEBRAIC(:,218);
    ALGEBRAIC(:,216) =  (ALGEBRAIC(:,160)+CONSTANTS(:,174)).*STATES(:,23);
    ALGEBRAIC(:,222) =  ALGEBRAIC(:,121).*STATES(:,22)+ ALGEBRAIC(:,208).*STATES(:,18);
    RATES(:,23) = ALGEBRAIC(:,222) - ALGEBRAIC(:,216);
    ALGEBRAIC(:,139) =  ALGEBRAIC(:,119).*CONSTANTS(:,175);
    ALGEBRAIC(:,224) = ALGEBRAIC(:,188)./CONSTANTS(:,175);
    RATES(:,57) = (( CONSTANTS(:,180).*STATES(:,52)+ ALGEBRAIC(:,135).*STATES(:,56)) -  (ALGEBRAIC(:,219)+CONSTANTS(:,179)+ALGEBRAIC(:,139)).*STATES(:,57))+ ALGEBRAIC(:,224).*STATES(:,58);
    ALGEBRAIC(:,144) =  ALGEBRAIC(:,123).*CONSTANTS(:,175);
    ALGEBRAIC(:,226) = ALGEBRAIC(:,199)./CONSTANTS(:,175);
    RATES(:,58) = (( CONSTANTS(:,182).*STATES(:,53)+ ALGEBRAIC(:,139).*STATES(:,57)) -  (ALGEBRAIC(:,144)+CONSTANTS(:,181)+ALGEBRAIC(:,224)).*STATES(:,58))+ ALGEBRAIC(:,226).*STATES(:,59);
    ALGEBRAIC(:,150) =  ALGEBRAIC(:,127).*CONSTANTS(:,175);
    ALGEBRAIC(:,228) = ALGEBRAIC(:,206)./CONSTANTS(:,175);
    RATES(:,59) = (( CONSTANTS(:,184).*STATES(:,54)+ ALGEBRAIC(:,144).*STATES(:,58)) -  (ALGEBRAIC(:,226)+CONSTANTS(:,183)+ALGEBRAIC(:,150)).*STATES(:,59))+ ALGEBRAIC(:,228).*STATES(:,60);
    ALGEBRAIC(:,68) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp(116431../CONSTANTS(:,158)+ - 578.317./CONSTANTS(:,6)+( 0.764126.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,158) = ALGEBRAIC(:,68);
    ALGEBRAIC(:,79) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 55700.7./CONSTANTS(:,158)+ - 130.639./CONSTANTS(:,6)+(  - 3.64982.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,230) = ALGEBRAIC(:,79);
    RATES(:,60) = (( CONSTANTS(:,186).*STATES(:,55)+ ALGEBRAIC(:,150).*STATES(:,59)) -  (ALGEBRAIC(:,228)+CONSTANTS(:,185)+ALGEBRAIC(:,158)).*STATES(:,60))+ ALGEBRAIC(:,230).*STATES(:,61);
    ALGEBRAIC(:,58) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 97657.8./CONSTANTS(:,158)+1.51000./CONSTANTS(:,6)+( 0.0684862.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,232) = ALGEBRAIC(:,58);
    ALGEBRAIC(:,49) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 62123.1./CONSTANTS(:,158)+39.2950./CONSTANTS(:,6)+( 0.288816.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,234) = ALGEBRAIC(:,49);
    RATES(:,46) = ( ALGEBRAIC(:,131).*STATES(:,55) -  (ALGEBRAIC(:,213)+CONSTANTS(:,171)+ALGEBRAIC(:,234)).*STATES(:,46))+ CONSTANTS(:,172).*STATES(:,47)+ ALGEBRAIC(:,232).*STATES(:,61);
    RATES(:,61) = ( ALGEBRAIC(:,234).*STATES(:,46)+ ALGEBRAIC(:,158).*STATES(:,60)) -  (ALGEBRAIC(:,230)+ALGEBRAIC(:,232)).*STATES(:,61);
    ALGEBRAIC(:,120) =  CONSTANTS(:,125).*log(CONSTANTS(:,13)./STATES(:,1));
    ALGEBRAIC(:,132) =  CONSTANTS(:,92).*(STATES(:,46)+STATES(:,47)).*(STATES(:,7) - ALGEBRAIC(:,120));
    ALGEBRAIC(:,229) =  CONSTANTS(:,93).*(STATES(:,7) - ALGEBRAIC(:,120));
    ALGEBRAIC(:,235) = STATES(:,7)./CONSTANTS(:,125);
    ALGEBRAIC(:,241) =  exp( CONSTANTS(:,100).*ALGEBRAIC(:,235)).*power(STATES(:,1), 3.00000).*CONSTANTS(:,14);
    ALGEBRAIC(:,242) =  exp( (CONSTANTS(:,100) - 1.00000).*ALGEBRAIC(:,235)).*power(CONSTANTS(:,13), 3.00000).*STATES(:,3);
    ALGEBRAIC(:,243) = 1.00000+ CONSTANTS(:,99).*exp( (CONSTANTS(:,100) - 1.00000).*ALGEBRAIC(:,235));
    ALGEBRAIC(:,244) = ( CONSTANTS(:,96).*(ALGEBRAIC(:,241) - ALGEBRAIC(:,242)))./( CONSTANTS(:,173).*ALGEBRAIC(:,243).*CONSTANTS(:,176));
    ALGEBRAIC(:,236) = 1.00000+ 0.124500.*exp(  - 0.100000.*ALGEBRAIC(:,235));
    ALGEBRAIC(:,237) =  0.0365000.*CONSTANTS(:,164).*exp(  - 1.33000.*ALGEBRAIC(:,235));
    ALGEBRAIC(:,238) = 1.00000./(ALGEBRAIC(:,236)+ALGEBRAIC(:,237));
    ALGEBRAIC(:,239) = 1.00000+power(CONSTANTS(:,102)./STATES(:,1), 1.50000);
    ALGEBRAIC(:,240) = ( CONSTANTS(:,101).*ALGEBRAIC(:,238).*CONSTANTS(:,168))./ALGEBRAIC(:,239);
    ALGEBRAIC(:,151) = STATES(:,7)./CONSTANTS(:,125);
    ALGEBRAIC(:,159) =  1000.00.*CONSTANTS(:,4).*ALGEBRAIC(:,151);
    ALGEBRAIC(:,178) = exp(ALGEBRAIC(:,151)) - 1.00000;
    ALGEBRAIC(:,200) =  STATES(:,1).*exp(ALGEBRAIC(:,151)) - CONSTANTS(:,13);
    ALGEBRAIC(:,207) = ( 0.0200000.*CONSTANTS(:,134).*STATES(:,40).*ALGEBRAIC(:,159).*ALGEBRAIC(:,200))./ALGEBRAIC(:,178);
    RATES(:,1) =   - (ALGEBRAIC(:,132)+ALGEBRAIC(:,229)+ 3.00000.*(ALGEBRAIC(:,244)+ALGEBRAIC(:,240))+ALGEBRAIC(:,207)).*CONSTANTS(:,156);
    ALGEBRAIC(:,128) =  0.500000.*CONSTANTS(:,125).*log(CONSTANTS(:,14)./STATES(:,3));
    ALGEBRAIC(:,231) =  CONSTANTS(:,106).*(STATES(:,7) - ALGEBRAIC(:,128));
    ALGEBRAIC(:,233) = ( CONSTANTS(:,104).*STATES(:,3))./(CONSTANTS(:,105)+STATES(:,3));
    ALGEBRAIC(:,61) = (STATES(:,4) - STATES(:,3))./CONSTANTS(:,28);
    ALGEBRAIC(:,92) =  CONSTANTS(:,29).*ALGEBRAIC(:,71)+ CONSTANTS(:,30).*ALGEBRAIC(:,82);
    ALGEBRAIC(:,112) = 1.00000./(1.00000+( CONSTANTS(:,35).*CONSTANTS(:,37))./power(STATES(:,3)+CONSTANTS(:,37), 2.00000)+( CONSTANTS(:,36).*CONSTANTS(:,39))./power(STATES(:,3)+CONSTANTS(:,39), 2.00000));
    RATES(:,3) =  ALGEBRAIC(:,112).*(((ALGEBRAIC(:,61) - ALGEBRAIC(:,43)) - ALGEBRAIC(:,92)) -  ((ALGEBRAIC(:,231) -  2.00000.*ALGEBRAIC(:,244))+ALGEBRAIC(:,233)).*0.500000.*CONSTANTS(:,156));
    ALGEBRAIC(:,245) = STATES(:,7)./CONSTANTS(:,125);
    ALGEBRAIC(:,246) =  1000.00.*CONSTANTS(:,4).*ALGEBRAIC(:,245);
    ALGEBRAIC(:,247) =  0.00100000.*exp( 2.00000.*ALGEBRAIC(:,245)) -  CONSTANTS(:,14).*0.341000;
    ALGEBRAIC(:,248) = exp( 2.00000.*ALGEBRAIC(:,245)) - 1.00000;
    ALGEBRAIC(:,249) = ( CONSTANTS(:,157).*4.00000.*ALGEBRAIC(:,246).*ALGEBRAIC(:,247))./ALGEBRAIC(:,248);
    ALGEBRAIC(:,250) =  ALGEBRAIC(:,249).*STATES(:,25).*STATES(:,24);
    ALGEBRAIC(:,102) = 1.00000./(1.00000+( CONSTANTS(:,35).*CONSTANTS(:,37))./power(STATES(:,4)+CONSTANTS(:,37), 2.00000)+( CONSTANTS(:,36).*CONSTANTS(:,39))./power(STATES(:,4)+CONSTANTS(:,39), 2.00000));
    RATES(:,4) =  ALGEBRAIC(:,102).*((( ALGEBRAIC(:,52).*CONSTANTS(:,9))./CONSTANTS(:,11) - ( ALGEBRAIC(:,61).*CONSTANTS(:,8))./CONSTANTS(:,11)) -  ALGEBRAIC(:,250).*CONSTANTS(:,161));
    ALGEBRAIC(:,124) =  CONSTANTS(:,125).*log(CONSTANTS(:,12)./STATES(:,2));
    ALGEBRAIC(:,136) =  CONSTANTS(:,89).*CONSTANTS(:,135).*STATES(:,48).*(STATES(:,7) - ALGEBRAIC(:,124));
    ALGEBRAIC(:,140) =  CONSTANTS(:,90).*(STATES(:,49)+STATES(:,50)).*(STATES(:,7) - ALGEBRAIC(:,124));
    ALGEBRAIC(:,225) = 1.00000./(0.940000+exp( (1.26000./CONSTANTS(:,125)).*(STATES(:,7) - ALGEBRAIC(:,124))));
    ALGEBRAIC(:,227) =  CONSTANTS(:,91).*power((CONSTANTS(:,12)./1.00000), 1.0 ./ 2).*ALGEBRAIC(:,225).*(STATES(:,7) - ALGEBRAIC(:,124));
    ALGEBRAIC(:,251) = piecewise({ALGEBRAIC(:,249)>=0.00000, 0.00000 }, ALGEBRAIC(:,249));
    ALGEBRAIC(:,252) = CONSTANTS(:,137)./(1.00000+ALGEBRAIC(:,251)./CONSTANTS(:,107));
    ALGEBRAIC(:,253) =  STATES(:,2).*exp(ALGEBRAIC(:,245)) - CONSTANTS(:,12);
    ALGEBRAIC(:,254) = exp(ALGEBRAIC(:,245)) - 1.00000;
    ALGEBRAIC(:,255) = ( ALGEBRAIC(:,252).*STATES(:,24).*STATES(:,25).*ALGEBRAIC(:,246).*ALGEBRAIC(:,253))./ALGEBRAIC(:,254);
    ALGEBRAIC(:,1) =  floor(VOI./CONSTANTS(:,15)).*CONSTANTS(:,15);
    ALGEBRAIC(:,12) = piecewise({VOI - ALGEBRAIC(:,1)>=CONSTANTS(:,18)&VOI - ALGEBRAIC(:,1)<=CONSTANTS(:,18)+CONSTANTS(:,16), CONSTANTS(:,17) }, 0.00000);
    ALGEBRAIC(:,145) =  CONSTANTS(:,133).*STATES(:,30).*(STATES(:,7) - ALGEBRAIC(:,124));
    ALGEBRAIC(:,169) =  STATES(:,2).*exp(ALGEBRAIC(:,151)) - CONSTANTS(:,12);
    ALGEBRAIC(:,189) = ( CONSTANTS(:,134).*STATES(:,40).*ALGEBRAIC(:,159).*ALGEBRAIC(:,169))./ALGEBRAIC(:,178);
    RATES(:,2) =   - (((ALGEBRAIC(:,136)+ALGEBRAIC(:,140)+ALGEBRAIC(:,227)+ALGEBRAIC(:,255)+ALGEBRAIC(:,12)) -  2.00000.*ALGEBRAIC(:,240))+ALGEBRAIC(:,145)+ALGEBRAIC(:,189)).*CONSTANTS(:,156);
    ALGEBRAIC(:,214) = ALGEBRAIC(:,189)+ALGEBRAIC(:,207);
    ALGEBRAIC(:,221) = ALGEBRAIC(:,145)+ALGEBRAIC(:,214);
    ALGEBRAIC(:,256) = ALGEBRAIC(:,132)+ALGEBRAIC(:,250)+ALGEBRAIC(:,255)+ALGEBRAIC(:,136)+ALGEBRAIC(:,140)+ALGEBRAIC(:,227)+ALGEBRAIC(:,244)+ALGEBRAIC(:,240)+ALGEBRAIC(:,221)+ALGEBRAIC(:,233)+ALGEBRAIC(:,231)+ALGEBRAIC(:,229)+ALGEBRAIC(:,12);
    RATES(:,7) =  - ALGEBRAIC(:,256);
   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(:,4) = (CONSTANTS(:,130)./(1.00000+exp((STATES(:,7)+28.5000)./7.80000))+1.00000) - CONSTANTS(:,130);
    ALGEBRAIC(:,15) = 1.00000./(0.00336336./(0.500000+exp(STATES(:,7)./ - 5.53900))+ 0.00779047.*exp(STATES(:,7)./ - 49.5104));
    ALGEBRAIC(:,9) =  CONSTANTS(:,110).*CONSTANTS(:,111).*exp( CONSTANTS(:,112).*STATES(:,7));
    ALGEBRAIC(:,20) =  CONSTANTS(:,110).*CONSTANTS(:,113).*exp( CONSTANTS(:,114).*STATES(:,7));
    ALGEBRAIC(:,33) =  0.216256.*exp(  - 1.88912e-05.*STATES(:,7));
    ALGEBRAIC(:,22) =  0.00700807.*exp(  - 0.149998.*STATES(:,7));
    ALGEBRAIC(:,11) =  0.00767254.*exp( 0.0866295.*STATES(:,7));
    ALGEBRAIC(:,32) =  0.00379738.*exp(  - 0.0142567.*STATES(:,7));
    ALGEBRAIC(:,2) = CONSTANTS(:,49) - (CONSTANTS(:,49) - CONSTANTS(:,51))./(1.00000+power(CONSTANTS(:,52)./STATES(:,5), CONSTANTS(:,54)));
    ALGEBRAIC(:,35) =   - CONSTANTS(:,40).*ALGEBRAIC(:,2).*power( STATES(:,4).*1000.00,  CONSTANTS(:,46).*CONSTANTS(:,48)).*STATES(:,12)+ CONSTANTS(:,41).*STATES(:,8);
    ALGEBRAIC(:,31) =  ALGEBRAIC(:,9).*STATES(:,62)+ CONSTANTS(:,141).*STATES(:,64);
    ALGEBRAIC(:,42) =  (ALGEBRAIC(:,20)+CONSTANTS(:,140)).*STATES(:,63);
    ALGEBRAIC(:,44) =  CONSTANTS(:,42).*power( STATES(:,4).*1000.00,  CONSTANTS(:,47).*CONSTANTS(:,48)).*STATES(:,8) -  CONSTANTS(:,43).*STATES(:,9);
    ALGEBRAIC(:,13) = CONSTANTS(:,127) - (CONSTANTS(:,127) - CONSTANTS(:,51))./(1.00000+power(CONSTANTS(:,53)./STATES(:,5), CONSTANTS(:,54)));
    ALGEBRAIC(:,24) = CONSTANTS(:,50) - (CONSTANTS(:,50) - CONSTANTS(:,51))./(1.00000+power(CONSTANTS(:,128)./STATES(:,5), CONSTANTS(:,54)));
    ALGEBRAIC(:,53) =  (CONSTANTS(:,44)./ALGEBRAIC(:,13)).*STATES(:,8) -  CONSTANTS(:,45).*ALGEBRAIC(:,24).*STATES(:,13);
    ALGEBRAIC(:,10) =  CONSTANTS(:,110).*CONSTANTS(:,115).*exp( CONSTANTS(:,116).*STATES(:,7));
    ALGEBRAIC(:,41) =  CONSTANTS(:,110).*CONSTANTS(:,121).*exp( CONSTANTS(:,122).*STATES(:,7));
    ALGEBRAIC(:,51) =  ALGEBRAIC(:,10).*STATES(:,64)+ ALGEBRAIC(:,41).*STATES(:,65);
    ALGEBRAIC(:,21) =  CONSTANTS(:,110).*CONSTANTS(:,117).*exp( CONSTANTS(:,118).*STATES(:,7));
    ALGEBRAIC(:,30) =  CONSTANTS(:,110).*CONSTANTS(:,119).*exp( CONSTANTS(:,120).*STATES(:,7));
    ALGEBRAIC(:,60) =  (ALGEBRAIC(:,21)+ALGEBRAIC(:,30)).*STATES(:,48);
    ALGEBRAIC(:,23) = power(STATES(:,3)./CONSTANTS(:,19), CONSTANTS(:,20));
    ALGEBRAIC(:,34) = power(STATES(:,6)./CONSTANTS(:,21), CONSTANTS(:,22));
    ALGEBRAIC(:,43) = piecewise({CONSTANTS(:,1)==0.00000, ( CONSTANTS(:,23).*( CONSTANTS(:,24).*ALGEBRAIC(:,23) -  CONSTANTS(:,25).*ALGEBRAIC(:,34)))./(1.00000+ALGEBRAIC(:,23)+ALGEBRAIC(:,34)) }, ( 1.50000.*CONSTANTS(:,23).*( CONSTANTS(:,24).*ALGEBRAIC(:,23) -  CONSTANTS(:,25).*ALGEBRAIC(:,34)))./(1.00000+ALGEBRAIC(:,23)+ALGEBRAIC(:,34)));
    ALGEBRAIC(:,62) = (STATES(:,6) - STATES(:,5))./CONSTANTS(:,27);
    ALGEBRAIC(:,63) =  - (ALGEBRAIC(:,35)+ALGEBRAIC(:,44)+ALGEBRAIC(:,53));
    ALGEBRAIC(:,52) =  CONSTANTS(:,26).*(STATES(:,8)+STATES(:,9)).*(STATES(:,5) - STATES(:,4));
    ALGEBRAIC(:,72) = 1.00000./(1.00000+( CONSTANTS(:,126).*CONSTANTS(:,38))./power(STATES(:,5)+CONSTANTS(:,38), 2.00000));
    ALGEBRAIC(:,71) =  CONSTANTS(:,33).*STATES(:,3).*(1.00000 - STATES(:,10)) -  CONSTANTS(:,34).*STATES(:,10);
    ALGEBRAIC(:,50) =  CONSTANTS(:,110).*CONSTANTS(:,123).*exp( CONSTANTS(:,124).*STATES(:,7));
    ALGEBRAIC(:,59) = ( ALGEBRAIC(:,21).*ALGEBRAIC(:,41).*ALGEBRAIC(:,50))./( ALGEBRAIC(:,10).*ALGEBRAIC(:,30));
    ALGEBRAIC(:,69) =  CONSTANTS(:,140).*STATES(:,63)+ ALGEBRAIC(:,21).*STATES(:,48)+ ALGEBRAIC(:,59).*STATES(:,65);
    ALGEBRAIC(:,80) =  (ALGEBRAIC(:,50)+ALGEBRAIC(:,10)+CONSTANTS(:,141)).*STATES(:,64);
    ALGEBRAIC(:,70) =  ALGEBRAIC(:,50).*STATES(:,64)+ ALGEBRAIC(:,30).*STATES(:,48);
    ALGEBRAIC(:,81) =  (ALGEBRAIC(:,59)+ALGEBRAIC(:,41)).*STATES(:,65);
    ALGEBRAIC(:,82) =  CONSTANTS(:,31).*STATES(:,3).*(1.00000 - STATES(:,11)) -  CONSTANTS(:,32).*STATES(:,11);
    ALGEBRAIC(:,6) =  CONSTANTS(:,83).*exp( CONSTANTS(:,84).*STATES(:,7));
    ALGEBRAIC(:,27) =  4.00000.*ALGEBRAIC(:,6);
    ALGEBRAIC(:,77) =  (ALGEBRAIC(:,27)+CONSTANTS(:,145)).*STATES(:,36);
    ALGEBRAIC(:,17) =  CONSTANTS(:,85).*exp(  - CONSTANTS(:,86).*STATES(:,7));
    ALGEBRAIC(:,66) = ALGEBRAIC(:,17);
    ALGEBRAIC(:,87) =  ALGEBRAIC(:,66).*STATES(:,37)+ CONSTANTS(:,150).*STATES(:,41);
    ALGEBRAIC(:,28) =  4.00000.*CONSTANTS(:,79).*ALGEBRAIC(:,6);
    ALGEBRAIC(:,78) =  (CONSTANTS(:,150)+ALGEBRAIC(:,28)).*STATES(:,41);
    ALGEBRAIC(:,67) = ALGEBRAIC(:,17)./CONSTANTS(:,75);
    ALGEBRAIC(:,89) =  CONSTANTS(:,145).*STATES(:,36)+ ALGEBRAIC(:,67).*STATES(:,42);
    ALGEBRAIC(:,38) =  3.00000.*ALGEBRAIC(:,6);
    ALGEBRAIC(:,88) =  (ALGEBRAIC(:,38)+ALGEBRAIC(:,66)+CONSTANTS(:,146)).*STATES(:,37);
    ALGEBRAIC(:,75) =  2.00000.*ALGEBRAIC(:,17);
    ALGEBRAIC(:,97) =  ALGEBRAIC(:,75).*STATES(:,38)+ CONSTANTS(:,151).*STATES(:,42)+ ALGEBRAIC(:,27).*STATES(:,36);
    ALGEBRAIC(:,39) = ( 3.00000.*CONSTANTS(:,80).*ALGEBRAIC(:,6))./CONSTANTS(:,79);
    ALGEBRAIC(:,90) =  (ALGEBRAIC(:,39)+CONSTANTS(:,151)+ALGEBRAIC(:,67)).*STATES(:,42);
    ALGEBRAIC(:,76) = ( 2.00000.*CONSTANTS(:,75).*ALGEBRAIC(:,17))./CONSTANTS(:,76);
    ALGEBRAIC(:,99) =  ALGEBRAIC(:,76).*STATES(:,43)+ CONSTANTS(:,146).*STATES(:,37)+ ALGEBRAIC(:,28).*STATES(:,41);
    ALGEBRAIC(:,47) =  2.00000.*ALGEBRAIC(:,6);
    ALGEBRAIC(:,98) =  (ALGEBRAIC(:,47)+ALGEBRAIC(:,75)+CONSTANTS(:,147)).*STATES(:,38);
    ALGEBRAIC(:,85) =  3.00000.*ALGEBRAIC(:,17);
    ALGEBRAIC(:,105) =  ALGEBRAIC(:,85).*STATES(:,39)+ CONSTANTS(:,152).*STATES(:,43)+ ALGEBRAIC(:,38).*STATES(:,37);
    ALGEBRAIC(:,48) = ( 2.00000.*CONSTANTS(:,81).*ALGEBRAIC(:,6))./CONSTANTS(:,80);
    ALGEBRAIC(:,100) =  (ALGEBRAIC(:,48)+CONSTANTS(:,152)+ALGEBRAIC(:,76)).*STATES(:,43);
    ALGEBRAIC(:,86) = ( 3.00000.*CONSTANTS(:,76).*ALGEBRAIC(:,17))./CONSTANTS(:,77);
    ALGEBRAIC(:,108) =  ALGEBRAIC(:,86).*STATES(:,44)+ CONSTANTS(:,147).*STATES(:,38)+ ALGEBRAIC(:,39).*STATES(:,42);
    ALGEBRAIC(:,56) = ALGEBRAIC(:,6);
    ALGEBRAIC(:,106) =  (ALGEBRAIC(:,56)+ALGEBRAIC(:,85)+CONSTANTS(:,148)).*STATES(:,39);
    ALGEBRAIC(:,95) =  4.00000.*ALGEBRAIC(:,17);
    ALGEBRAIC(:,115) =  ALGEBRAIC(:,95).*STATES(:,40)+ CONSTANTS(:,153).*STATES(:,44)+ ALGEBRAIC(:,47).*STATES(:,38);
    ALGEBRAIC(:,107) =  (ALGEBRAIC(:,95)+CONSTANTS(:,149)).*STATES(:,40);
    ALGEBRAIC(:,116) =  ALGEBRAIC(:,56).*STATES(:,39)+ CONSTANTS(:,154).*STATES(:,45);
    ALGEBRAIC(:,57) = ( CONSTANTS(:,82).*ALGEBRAIC(:,6))./CONSTANTS(:,81);
    ALGEBRAIC(:,109) =  (ALGEBRAIC(:,57)+CONSTANTS(:,153)+ALGEBRAIC(:,86)).*STATES(:,44);
    ALGEBRAIC(:,96) = ( 4.00000.*CONSTANTS(:,77).*ALGEBRAIC(:,17))./CONSTANTS(:,78);
    ALGEBRAIC(:,117) =  ALGEBRAIC(:,96).*STATES(:,45)+ CONSTANTS(:,148).*STATES(:,39)+ ALGEBRAIC(:,48).*STATES(:,43);
    ALGEBRAIC(:,110) =  (CONSTANTS(:,154)+ALGEBRAIC(:,96)).*STATES(:,45);
    ALGEBRAIC(:,118) =  CONSTANTS(:,149).*STATES(:,40)+ ALGEBRAIC(:,57).*STATES(:,44);
    ALGEBRAIC(:,5) =  CONSTANTS(:,59).*exp( CONSTANTS(:,60).*STATES(:,7));
    ALGEBRAIC(:,46) =  4.00000.*ALGEBRAIC(:,5);
    ALGEBRAIC(:,37) =  CONSTANTS(:,65).*exp( CONSTANTS(:,66).*STATES(:,7));
    ALGEBRAIC(:,142) = ALGEBRAIC(:,37);
    ALGEBRAIC(:,156) =  (ALGEBRAIC(:,46)+ALGEBRAIC(:,142)).*STATES(:,26);
    ALGEBRAIC(:,16) =  CONSTANTS(:,61).*exp(  - CONSTANTS(:,62).*STATES(:,7));
    ALGEBRAIC(:,122) = ALGEBRAIC(:,16);
    ALGEBRAIC(:,26) =  CONSTANTS(:,63).*exp(  - CONSTANTS(:,64).*STATES(:,7));
    ALGEBRAIC(:,149) = ALGEBRAIC(:,26);
    ALGEBRAIC(:,164) =  ALGEBRAIC(:,122).*STATES(:,27)+ ALGEBRAIC(:,149).*STATES(:,31);
    ALGEBRAIC(:,84) =  4.00000.*CONSTANTS(:,71).*ALGEBRAIC(:,5);
    ALGEBRAIC(:,157) =  (ALGEBRAIC(:,149)+ALGEBRAIC(:,84)).*STATES(:,31);
    ALGEBRAIC(:,138) = ALGEBRAIC(:,16)./CONSTANTS(:,67);
    ALGEBRAIC(:,166) =  ALGEBRAIC(:,142).*STATES(:,26)+ ALGEBRAIC(:,138).*STATES(:,32);
    ALGEBRAIC(:,55) =  3.00000.*ALGEBRAIC(:,5);
    ALGEBRAIC(:,147) =  CONSTANTS(:,67).*ALGEBRAIC(:,37);
    ALGEBRAIC(:,165) =  (ALGEBRAIC(:,55)+ALGEBRAIC(:,122)+ALGEBRAIC(:,147)).*STATES(:,27);
    ALGEBRAIC(:,126) =  2.00000.*ALGEBRAIC(:,16);
    ALGEBRAIC(:,155) = ALGEBRAIC(:,26)./CONSTANTS(:,71);
    ALGEBRAIC(:,173) =  ALGEBRAIC(:,126).*STATES(:,28)+ ALGEBRAIC(:,155).*STATES(:,32)+ ALGEBRAIC(:,46).*STATES(:,26);
    ALGEBRAIC(:,94) = ( 3.00000.*CONSTANTS(:,72).*ALGEBRAIC(:,5))./CONSTANTS(:,71);
    ALGEBRAIC(:,167) =  (ALGEBRAIC(:,94)+ALGEBRAIC(:,155)+ALGEBRAIC(:,138)).*STATES(:,32);
    ALGEBRAIC(:,143) = ( 2.00000.*CONSTANTS(:,67).*ALGEBRAIC(:,16))./CONSTANTS(:,68);
    ALGEBRAIC(:,175) =  ALGEBRAIC(:,143).*STATES(:,33)+ ALGEBRAIC(:,147).*STATES(:,27)+ ALGEBRAIC(:,84).*STATES(:,31);
    ALGEBRAIC(:,8) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 114007../CONSTANTS(:,158)+224.114./CONSTANTS(:,6)+( 0.286374.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,111) =  4.00000.*ALGEBRAIC(:,8);
    ALGEBRAIC(:,19) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 272470../CONSTANTS(:,158)+708.146./CONSTANTS(:,6)+(  - 2.28528.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,177) = ALGEBRAIC(:,19);
    ALGEBRAIC(:,65) =  2.00000.*ALGEBRAIC(:,5);
    ALGEBRAIC(:,153) =  CONSTANTS(:,68).*ALGEBRAIC(:,37);
    ALGEBRAIC(:,174) =  (ALGEBRAIC(:,65)+ALGEBRAIC(:,126)+ALGEBRAIC(:,153)).*STATES(:,28);
    ALGEBRAIC(:,130) =  3.00000.*ALGEBRAIC(:,16);
    ALGEBRAIC(:,163) = ALGEBRAIC(:,26)./CONSTANTS(:,72);
    ALGEBRAIC(:,182) =  ALGEBRAIC(:,130).*STATES(:,29)+ ALGEBRAIC(:,163).*STATES(:,33)+ ALGEBRAIC(:,55).*STATES(:,27);
    ALGEBRAIC(:,104) = ( 2.00000.*CONSTANTS(:,73).*ALGEBRAIC(:,5))./CONSTANTS(:,72);
    ALGEBRAIC(:,176) =  (ALGEBRAIC(:,104)+ALGEBRAIC(:,163)+ALGEBRAIC(:,143)).*STATES(:,33);
    ALGEBRAIC(:,148) = ( 3.00000.*CONSTANTS(:,68).*ALGEBRAIC(:,16))./CONSTANTS(:,69);
    ALGEBRAIC(:,185) =  ALGEBRAIC(:,148).*STATES(:,34)+ ALGEBRAIC(:,153).*STATES(:,28)+ ALGEBRAIC(:,94).*STATES(:,32);
    ALGEBRAIC(:,119) =  3.00000.*ALGEBRAIC(:,8);
    ALGEBRAIC(:,188) =  2.00000.*ALGEBRAIC(:,19);
    ALGEBRAIC(:,3) =  4.00000.*1.20000.*0.416000.*exp( 0.0120000.*(STATES(:,7) - 35.0000));
    ALGEBRAIC(:,54) =  4.00000.*ALGEBRAIC(:,3);
    ALGEBRAIC(:,45) =  0.600000.*0.0923300.*STATES(:,4);
    ALGEBRAIC(:,170) = ALGEBRAIC(:,45);
    ALGEBRAIC(:,181) =  (ALGEBRAIC(:,54)+ALGEBRAIC(:,170)).*STATES(:,14);
    ALGEBRAIC(:,14) =  4.00000.*0.450000.*0.0490000.*exp(  - 0.0650000.*(STATES(:,7) - 22.0000));
    ALGEBRAIC(:,125) = ALGEBRAIC(:,14);
    ALGEBRAIC(:,193) =  ALGEBRAIC(:,125).*STATES(:,15)+ CONSTANTS(:,144).*STATES(:,19);
    ALGEBRAIC(:,25) =  CONSTANTS(:,58).*ALGEBRAIC(:,3);
    ALGEBRAIC(:,93) =  4.00000.*ALGEBRAIC(:,25);
    ALGEBRAIC(:,180) =  (ALGEBRAIC(:,93)+CONSTANTS(:,144)).*STATES(:,19);
    ALGEBRAIC(:,36) = ALGEBRAIC(:,14)./CONSTANTS(:,57);
    ALGEBRAIC(:,141) = ALGEBRAIC(:,36);
    ALGEBRAIC(:,191) =  ALGEBRAIC(:,141).*STATES(:,20)+ ALGEBRAIC(:,170).*STATES(:,14);
    ALGEBRAIC(:,74) = ALGEBRAIC(:,5);
    ALGEBRAIC(:,161) =  CONSTANTS(:,69).*ALGEBRAIC(:,37);
    ALGEBRAIC(:,183) =  (ALGEBRAIC(:,74)+ALGEBRAIC(:,130)+ALGEBRAIC(:,161)).*STATES(:,29);
    ALGEBRAIC(:,134) =  4.00000.*ALGEBRAIC(:,16);
    ALGEBRAIC(:,171) = ALGEBRAIC(:,26)./CONSTANTS(:,73);
    ALGEBRAIC(:,195) =  ALGEBRAIC(:,134).*STATES(:,30)+ ALGEBRAIC(:,171).*STATES(:,34)+ ALGEBRAIC(:,65).*STATES(:,28);
    ALGEBRAIC(:,162) =  CONSTANTS(:,70).*ALGEBRAIC(:,37);
    ALGEBRAIC(:,184) =  (ALGEBRAIC(:,134)+ALGEBRAIC(:,162)).*STATES(:,30);
    ALGEBRAIC(:,172) = ALGEBRAIC(:,26)./CONSTANTS(:,74);
    ALGEBRAIC(:,196) =  ALGEBRAIC(:,74).*STATES(:,29)+ ALGEBRAIC(:,172).*STATES(:,35);
    ALGEBRAIC(:,114) = ( CONSTANTS(:,74).*ALGEBRAIC(:,5))./CONSTANTS(:,73);
    ALGEBRAIC(:,186) =  (ALGEBRAIC(:,114)+ALGEBRAIC(:,171)+ALGEBRAIC(:,148)).*STATES(:,34);
    ALGEBRAIC(:,154) = ( 4.00000.*CONSTANTS(:,69).*ALGEBRAIC(:,16))./CONSTANTS(:,70);
    ALGEBRAIC(:,197) =  ALGEBRAIC(:,154).*STATES(:,35)+ ALGEBRAIC(:,161).*STATES(:,29)+ ALGEBRAIC(:,104).*STATES(:,33);
    ALGEBRAIC(:,187) =  (ALGEBRAIC(:,172)+ALGEBRAIC(:,154)).*STATES(:,35);
    ALGEBRAIC(:,198) =  ALGEBRAIC(:,162).*STATES(:,30)+ ALGEBRAIC(:,114).*STATES(:,34);
    ALGEBRAIC(:,123) =  2.00000.*ALGEBRAIC(:,8);
    ALGEBRAIC(:,199) =  3.00000.*ALGEBRAIC(:,19);
    ALGEBRAIC(:,64) =  3.00000.*ALGEBRAIC(:,3);
    ALGEBRAIC(:,179) =  CONSTANTS(:,58).*ALGEBRAIC(:,170);
    ALGEBRAIC(:,194) =  (ALGEBRAIC(:,125)+ALGEBRAIC(:,64)+ALGEBRAIC(:,179)).*STATES(:,15);
    ALGEBRAIC(:,129) =  2.00000.*ALGEBRAIC(:,14);
    ALGEBRAIC(:,204) =  ALGEBRAIC(:,54).*STATES(:,14)+ ALGEBRAIC(:,129).*STATES(:,16)+ CONSTANTS(:,160).*STATES(:,20);
    ALGEBRAIC(:,103) =  3.00000.*ALGEBRAIC(:,25);
    ALGEBRAIC(:,192) =  (ALGEBRAIC(:,141)+ALGEBRAIC(:,103)+CONSTANTS(:,160)).*STATES(:,20);
    ALGEBRAIC(:,146) =  2.00000.*ALGEBRAIC(:,36);
    ALGEBRAIC(:,202) =  ALGEBRAIC(:,93).*STATES(:,19)+ ALGEBRAIC(:,146).*STATES(:,21)+ ALGEBRAIC(:,179).*STATES(:,15);
    ALGEBRAIC(:,127) = ALGEBRAIC(:,8);
    ALGEBRAIC(:,206) =  4.00000.*ALGEBRAIC(:,19);
    ALGEBRAIC(:,73) =  2.00000.*ALGEBRAIC(:,3);
    ALGEBRAIC(:,190) =  CONSTANTS(:,58).*ALGEBRAIC(:,179);
    ALGEBRAIC(:,205) =  (ALGEBRAIC(:,129)+ALGEBRAIC(:,73)+ALGEBRAIC(:,190)).*STATES(:,16);
    ALGEBRAIC(:,133) =  3.00000.*ALGEBRAIC(:,14);
    ALGEBRAIC(:,211) =  ALGEBRAIC(:,64).*STATES(:,15)+ ALGEBRAIC(:,133).*STATES(:,17)+ CONSTANTS(:,163).*STATES(:,21);
    ALGEBRAIC(:,113) =  2.00000.*ALGEBRAIC(:,25);
    ALGEBRAIC(:,203) =  (ALGEBRAIC(:,146)+ALGEBRAIC(:,113)+CONSTANTS(:,163)).*STATES(:,21);
    ALGEBRAIC(:,152) =  3.00000.*ALGEBRAIC(:,36);
    ALGEBRAIC(:,209) =  ALGEBRAIC(:,103).*STATES(:,20)+ ALGEBRAIC(:,152).*STATES(:,22)+ ALGEBRAIC(:,190).*STATES(:,16);
    ALGEBRAIC(:,83) = ALGEBRAIC(:,3);
    ALGEBRAIC(:,201) =  CONSTANTS(:,58).*ALGEBRAIC(:,190);
    ALGEBRAIC(:,212) =  (ALGEBRAIC(:,133)+ALGEBRAIC(:,83)+ALGEBRAIC(:,201)).*STATES(:,17);
    ALGEBRAIC(:,137) =  4.00000.*ALGEBRAIC(:,14);
    ALGEBRAIC(:,217) =  ALGEBRAIC(:,73).*STATES(:,16)+ ALGEBRAIC(:,137).*STATES(:,18)+ CONSTANTS(:,169).*STATES(:,22);
    ALGEBRAIC(:,121) = ALGEBRAIC(:,25);
    ALGEBRAIC(:,210) =  (ALGEBRAIC(:,152)+ALGEBRAIC(:,121)+CONSTANTS(:,169)).*STATES(:,22);
    ALGEBRAIC(:,160) =  4.00000.*ALGEBRAIC(:,36);
    ALGEBRAIC(:,215) =  ALGEBRAIC(:,113).*STATES(:,21)+ ALGEBRAIC(:,160).*STATES(:,23)+ ALGEBRAIC(:,201).*STATES(:,17);
    ALGEBRAIC(:,29) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 196337../CONSTANTS(:,158)+529.952./CONSTANTS(:,6)+( 2.78085.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,131) = ALGEBRAIC(:,29);
    ALGEBRAIC(:,91) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 147814../CONSTANTS(:,158)+338.915./CONSTANTS(:,6)+( 2.13600.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,168) = ALGEBRAIC(:,91);
    ALGEBRAIC(:,40) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 133690../CONSTANTS(:,158)+229.205./CONSTANTS(:,6)+(  - 1.55804.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,213) = ALGEBRAIC(:,40);
    ALGEBRAIC(:,101) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 121322../CONSTANTS(:,158)+193.265./CONSTANTS(:,6)+(  - 1.74290.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,220) = ALGEBRAIC(:,101);
    ALGEBRAIC(:,135) =  ALGEBRAIC(:,111).*CONSTANTS(:,175);
    ALGEBRAIC(:,219) = ALGEBRAIC(:,177)./CONSTANTS(:,175);
    ALGEBRAIC(:,208) =  CONSTANTS(:,58).*ALGEBRAIC(:,201);
    ALGEBRAIC(:,218) =  (ALGEBRAIC(:,137)+CONSTANTS(:,55)+ALGEBRAIC(:,208)).*STATES(:,18);
    ALGEBRAIC(:,223) =  ALGEBRAIC(:,83).*STATES(:,17)+ CONSTANTS(:,56).*STATES(:,24)+ CONSTANTS(:,174).*STATES(:,23);
    ALGEBRAIC(:,216) =  (ALGEBRAIC(:,160)+CONSTANTS(:,174)).*STATES(:,23);
    ALGEBRAIC(:,222) =  ALGEBRAIC(:,121).*STATES(:,22)+ ALGEBRAIC(:,208).*STATES(:,18);
    ALGEBRAIC(:,139) =  ALGEBRAIC(:,119).*CONSTANTS(:,175);
    ALGEBRAIC(:,224) = ALGEBRAIC(:,188)./CONSTANTS(:,175);
    ALGEBRAIC(:,144) =  ALGEBRAIC(:,123).*CONSTANTS(:,175);
    ALGEBRAIC(:,226) = ALGEBRAIC(:,199)./CONSTANTS(:,175);
    ALGEBRAIC(:,150) =  ALGEBRAIC(:,127).*CONSTANTS(:,175);
    ALGEBRAIC(:,228) = ALGEBRAIC(:,206)./CONSTANTS(:,175);
    ALGEBRAIC(:,68) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp(116431../CONSTANTS(:,158)+ - 578.317./CONSTANTS(:,6)+( 0.764126.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,158) = ALGEBRAIC(:,68);
    ALGEBRAIC(:,79) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 55700.7./CONSTANTS(:,158)+ - 130.639./CONSTANTS(:,6)+(  - 3.64982.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,230) = ALGEBRAIC(:,79);
    ALGEBRAIC(:,58) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 97657.8./CONSTANTS(:,158)+1.51000./CONSTANTS(:,6)+( 0.0684862.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,232) = ALGEBRAIC(:,58);
    ALGEBRAIC(:,49) =  CONSTANTS(:,162).*CONSTANTS(:,138).*exp( - 62123.1./CONSTANTS(:,158)+39.2950./CONSTANTS(:,6)+( 0.288816.*STATES(:,7))./CONSTANTS(:,139));
    ALGEBRAIC(:,234) = ALGEBRAIC(:,49);
    ALGEBRAIC(:,120) =  CONSTANTS(:,125).*log(CONSTANTS(:,13)./STATES(:,1));
    ALGEBRAIC(:,132) =  CONSTANTS(:,92).*(STATES(:,46)+STATES(:,47)).*(STATES(:,7) - ALGEBRAIC(:,120));
    ALGEBRAIC(:,229) =  CONSTANTS(:,93).*(STATES(:,7) - ALGEBRAIC(:,120));
    ALGEBRAIC(:,235) = STATES(:,7)./CONSTANTS(:,125);
    ALGEBRAIC(:,241) =  exp( CONSTANTS(:,100).*ALGEBRAIC(:,235)).*power(STATES(:,1), 3.00000).*CONSTANTS(:,14);
    ALGEBRAIC(:,242) =  exp( (CONSTANTS(:,100) - 1.00000).*ALGEBRAIC(:,235)).*power(CONSTANTS(:,13), 3.00000).*STATES(:,3);
    ALGEBRAIC(:,243) = 1.00000+ CONSTANTS(:,99).*exp( (CONSTANTS(:,100) - 1.00000).*ALGEBRAIC(:,235));
    ALGEBRAIC(:,244) = ( CONSTANTS(:,96).*(ALGEBRAIC(:,241) - ALGEBRAIC(:,242)))./( CONSTANTS(:,173).*ALGEBRAIC(:,243).*CONSTANTS(:,176));
    ALGEBRAIC(:,236) = 1.00000+ 0.124500.*exp(  - 0.100000.*ALGEBRAIC(:,235));
    ALGEBRAIC(:,237) =  0.0365000.*CONSTANTS(:,164).*exp(  - 1.33000.*ALGEBRAIC(:,235));
    ALGEBRAIC(:,238) = 1.00000./(ALGEBRAIC(:,236)+ALGEBRAIC(:,237));
    ALGEBRAIC(:,239) = 1.00000+power(CONSTANTS(:,102)./STATES(:,1), 1.50000);
    ALGEBRAIC(:,240) = ( CONSTANTS(:,101).*ALGEBRAIC(:,238).*CONSTANTS(:,168))./ALGEBRAIC(:,239);
    ALGEBRAIC(:,151) = STATES(:,7)./CONSTANTS(:,125);
    ALGEBRAIC(:,159) =  1000.00.*CONSTANTS(:,4).*ALGEBRAIC(:,151);
    ALGEBRAIC(:,178) = exp(ALGEBRAIC(:,151)) - 1.00000;
    ALGEBRAIC(:,200) =  STATES(:,1).*exp(ALGEBRAIC(:,151)) - CONSTANTS(:,13);
    ALGEBRAIC(:,207) = ( 0.0200000.*CONSTANTS(:,134).*STATES(:,40).*ALGEBRAIC(:,159).*ALGEBRAIC(:,200))./ALGEBRAIC(:,178);
    ALGEBRAIC(:,128) =  0.500000.*CONSTANTS(:,125).*log(CONSTANTS(:,14)./STATES(:,3));
    ALGEBRAIC(:,231) =  CONSTANTS(:,106).*(STATES(:,7) - ALGEBRAIC(:,128));
    ALGEBRAIC(:,233) = ( CONSTANTS(:,104).*STATES(:,3))./(CONSTANTS(:,105)+STATES(:,3));
    ALGEBRAIC(:,61) = (STATES(:,4) - STATES(:,3))./CONSTANTS(:,28);
    ALGEBRAIC(:,92) =  CONSTANTS(:,29).*ALGEBRAIC(:,71)+ CONSTANTS(:,30).*ALGEBRAIC(:,82);
    ALGEBRAIC(:,112) = 1.00000./(1.00000+( CONSTANTS(:,35).*CONSTANTS(:,37))./power(STATES(:,3)+CONSTANTS(:,37), 2.00000)+( CONSTANTS(:,36).*CONSTANTS(:,39))./power(STATES(:,3)+CONSTANTS(:,39), 2.00000));
    ALGEBRAIC(:,245) = STATES(:,7)./CONSTANTS(:,125);
    ALGEBRAIC(:,246) =  1000.00.*CONSTANTS(:,4).*ALGEBRAIC(:,245);
    ALGEBRAIC(:,247) =  0.00100000.*exp( 2.00000.*ALGEBRAIC(:,245)) -  CONSTANTS(:,14).*0.341000;
    ALGEBRAIC(:,248) = exp( 2.00000.*ALGEBRAIC(:,245)) - 1.00000;
    ALGEBRAIC(:,249) = ( CONSTANTS(:,157).*4.00000.*ALGEBRAIC(:,246).*ALGEBRAIC(:,247))./ALGEBRAIC(:,248);
    ALGEBRAIC(:,250) =  ALGEBRAIC(:,249).*STATES(:,25).*STATES(:,24);
    ALGEBRAIC(:,102) = 1.00000./(1.00000+( CONSTANTS(:,35).*CONSTANTS(:,37))./power(STATES(:,4)+CONSTANTS(:,37), 2.00000)+( CONSTANTS(:,36).*CONSTANTS(:,39))./power(STATES(:,4)+CONSTANTS(:,39), 2.00000));
    ALGEBRAIC(:,124) =  CONSTANTS(:,125).*log(CONSTANTS(:,12)./STATES(:,2));
    ALGEBRAIC(:,136) =  CONSTANTS(:,89).*CONSTANTS(:,135).*STATES(:,48).*(STATES(:,7) - ALGEBRAIC(:,124));
    ALGEBRAIC(:,140) =  CONSTANTS(:,90).*(STATES(:,49)+STATES(:,50)).*(STATES(:,7) - ALGEBRAIC(:,124));
    ALGEBRAIC(:,225) = 1.00000./(0.940000+exp( (1.26000./CONSTANTS(:,125)).*(STATES(:,7) - ALGEBRAIC(:,124))));
    ALGEBRAIC(:,227) =  CONSTANTS(:,91).*power((CONSTANTS(:,12)./1.00000), 1.0 ./ 2).*ALGEBRAIC(:,225).*(STATES(:,7) - ALGEBRAIC(:,124));
    ALGEBRAIC(:,251) = piecewise({ALGEBRAIC(:,249)>=0.00000, 0.00000 }, ALGEBRAIC(:,249));
    ALGEBRAIC(:,252) = CONSTANTS(:,137)./(1.00000+ALGEBRAIC(:,251)./CONSTANTS(:,107));
    ALGEBRAIC(:,253) =  STATES(:,2).*exp(ALGEBRAIC(:,245)) - CONSTANTS(:,12);
    ALGEBRAIC(:,254) = exp(ALGEBRAIC(:,245)) - 1.00000;
    ALGEBRAIC(:,255) = ( ALGEBRAIC(:,252).*STATES(:,24).*STATES(:,25).*ALGEBRAIC(:,246).*ALGEBRAIC(:,253))./ALGEBRAIC(:,254);
    ALGEBRAIC(:,1) =  floor(VOI./CONSTANTS(:,15)).*CONSTANTS(:,15);
    ALGEBRAIC(:,12) = piecewise({VOI - ALGEBRAIC(:,1)>=CONSTANTS(:,18)&VOI - ALGEBRAIC(:,1)<=CONSTANTS(:,18)+CONSTANTS(:,16), CONSTANTS(:,17) }, 0.00000);
    ALGEBRAIC(:,145) =  CONSTANTS(:,133).*STATES(:,30).*(STATES(:,7) - ALGEBRAIC(:,124));
    ALGEBRAIC(:,169) =  STATES(:,2).*exp(ALGEBRAIC(:,151)) - CONSTANTS(:,12);
    ALGEBRAIC(:,189) = ( CONSTANTS(:,134).*STATES(:,40).*ALGEBRAIC(:,159).*ALGEBRAIC(:,169))./ALGEBRAIC(:,178);
    ALGEBRAIC(:,214) = ALGEBRAIC(:,189)+ALGEBRAIC(:,207);
    ALGEBRAIC(:,221) = ALGEBRAIC(:,145)+ALGEBRAIC(:,214);
    ALGEBRAIC(:,256) = ALGEBRAIC(:,132)+ALGEBRAIC(:,250)+ALGEBRAIC(:,255)+ALGEBRAIC(:,136)+ALGEBRAIC(:,140)+ALGEBRAIC(:,227)+ALGEBRAIC(:,244)+ALGEBRAIC(:,240)+ALGEBRAIC(:,221)+ALGEBRAIC(:,233)+ALGEBRAIC(:,231)+ALGEBRAIC(:,229)+ALGEBRAIC(:,12);
    ALGEBRAIC(:,7) = STATES(:,2)+ 0.0183300.*STATES(:,1);
    ALGEBRAIC(:,18) =  CONSTANTS(:,125).*log(CONSTANTS(:,155)./ALGEBRAIC(:,7));
end

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

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