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

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

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

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

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

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

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

function [LEGEND_STATES, LEGEND_ALGEBRAIC, LEGEND_VOI, LEGEND_CONSTANTS] = createLegends()
LEGEND_STATES = ''; LEGEND_ALGEBRAIC = ''; LEGEND_VOI = ''; LEGEND_CONSTANTS = '';
LEGEND_VOI = strpad('time in component environment (second)');
LEGEND_STATES(:,1) = strpad('V in component membrane (millivolt)');
LEGEND_CONSTANTS(:,1) = strpad('R in component membrane (joule_per_kilomole_kelvin)');
LEGEND_CONSTANTS(:,2) = strpad('T in component membrane (kelvin)');
LEGEND_CONSTANTS(:,3) = strpad('F in component membrane (coulomb_per_mole)');
LEGEND_CONSTANTS(:,4) = strpad('Cm in component membrane (microF)');
LEGEND_ALGEBRAIC(:,57) = strpad('i_Na in component sodium_current (nanoA)');
LEGEND_ALGEBRAIC(:,37) = strpad('i_Ca_T in component T_type_Ca_channel (nanoA)');
LEGEND_ALGEBRAIC(:,35) = strpad('i_Ca_L in component L_type_Ca_channel (nanoA)');
LEGEND_ALGEBRAIC(:,60) = strpad('i_K in component delayed_rectifying_potassium_current (nanoA)');
LEGEND_ALGEBRAIC(:,40) = strpad('i_f in component hyperpolarisation_activated_current (nanoA)');
LEGEND_ALGEBRAIC(:,64) = strpad('i_B in component linear_background_current (nanoA)');
LEGEND_ALGEBRAIC(:,41) = strpad('i_NaK in component sodium_potassium_pump (nanoA)');
LEGEND_ALGEBRAIC(:,43) = strpad('i_NaCa in component sodium_calcium_pump (nanoA)');
LEGEND_ALGEBRAIC(:,42) = strpad('i_Ca_P in component calcium_pump_current (nanoA)');
LEGEND_CONSTANTS(:,5) = strpad('P_Na in component sodium_current (mul_per_second)');
LEGEND_ALGEBRAIC(:,55) = strpad('E_Na in component reversal_potentials (millivolt)');
LEGEND_STATES(:,2) = strpad('Na_c in component cleft_space_equations (millimolar)');
LEGEND_STATES(:,3) = strpad('m in component sodium_current_m_gate (dimensionless)');
LEGEND_STATES(:,4) = strpad('h1 in component sodium_current_h_gate (dimensionless)');
LEGEND_STATES(:,5) = strpad('h2 in component sodium_current_h_gate (dimensionless)');
LEGEND_ALGEBRAIC(:,22) = strpad('m_infinity in component sodium_current_m_gate (dimensionless)');
LEGEND_ALGEBRAIC(:,28) = strpad('tau_m in component sodium_current_m_gate (second)');
LEGEND_ALGEBRAIC(:,1) = strpad('alpha_m in component sodium_current_m_gate (per_second)');
LEGEND_ALGEBRAIC(:,12) = strpad('beta_m in component sodium_current_m_gate (per_second)');
LEGEND_ALGEBRAIC(:,23) = strpad('h1_infinity in component sodium_current_h_gate (dimensionless)');
LEGEND_ALGEBRAIC(:,34) = strpad('h2_infinity in component sodium_current_h_gate (dimensionless)');
LEGEND_ALGEBRAIC(:,29) = strpad('tau_h1 in component sodium_current_h_gate (second)');
LEGEND_ALGEBRAIC(:,36) = strpad('tau_h2 in component sodium_current_h_gate (second)');
LEGEND_ALGEBRAIC(:,2) = strpad('alpha_h1 in component sodium_current_h_gate (per_second)');
LEGEND_ALGEBRAIC(:,13) = strpad('beta_h1 in component sodium_current_h_gate (per_second)');
LEGEND_CONSTANTS(:,6) = strpad('g_Ca_L in component L_type_Ca_channel (microS)');
LEGEND_CONSTANTS(:,7) = strpad('E_Ca_L in component L_type_Ca_channel (millivolt)');
LEGEND_STATES(:,6) = strpad('d_L in component L_type_Ca_channel_d_gate (dimensionless)');
LEGEND_ALGEBRAIC(:,33) = strpad('d_L_infinity in component L_type_Ca_channel_d_gate (dimensionless)');
LEGEND_STATES(:,7) = strpad('f_L in component L_type_Ca_channel_f_gate (dimensionless)');
LEGEND_ALGEBRAIC(:,9) = strpad('alpha_d_L in component L_type_Ca_channel_d_gate (per_second)');
LEGEND_ALGEBRAIC(:,20) = strpad('beta_d_L in component L_type_Ca_channel_d_gate (per_second)');
LEGEND_ALGEBRAIC(:,27) = strpad('tau_d_L in component L_type_Ca_channel_d_gate (second)');
LEGEND_ALGEBRAIC(:,3) = strpad('alpha_f_L in component L_type_Ca_channel_f_gate (per_second)');
LEGEND_ALGEBRAIC(:,14) = strpad('beta_f_L in component L_type_Ca_channel_f_gate (per_second)');
LEGEND_ALGEBRAIC(:,30) = strpad('f_L_infinity in component L_type_Ca_channel_f_gate (dimensionless)');
LEGEND_ALGEBRAIC(:,24) = strpad('tau_f_L in component L_type_Ca_channel_f_gate (second)');
LEGEND_CONSTANTS(:,8) = strpad('g_Ca_T in component T_type_Ca_channel (microS)');
LEGEND_CONSTANTS(:,9) = strpad('E_Ca_T in component T_type_Ca_channel (millivolt)');
LEGEND_STATES(:,8) = strpad('d_T in component T_type_Ca_channel_d_gate (dimensionless)');
LEGEND_STATES(:,9) = strpad('f_T in component T_type_Ca_channel_f_gate (dimensionless)');
LEGEND_ALGEBRAIC(:,4) = strpad('alpha_d_T in component T_type_Ca_channel_d_gate (per_second)');
LEGEND_ALGEBRAIC(:,15) = strpad('beta_d_T in component T_type_Ca_channel_d_gate (per_second)');
LEGEND_ALGEBRAIC(:,31) = strpad('d_T_infinity in component T_type_Ca_channel_d_gate (dimensionless)');
LEGEND_ALGEBRAIC(:,25) = strpad('tau_d_T in component T_type_Ca_channel_d_gate (second)');
LEGEND_ALGEBRAIC(:,5) = strpad('alpha_f_T in component T_type_Ca_channel_f_gate (per_second)');
LEGEND_ALGEBRAIC(:,16) = strpad('beta_f_T in component T_type_Ca_channel_f_gate (per_second)');
LEGEND_ALGEBRAIC(:,32) = strpad('f_T_infinity in component T_type_Ca_channel_f_gate (dimensionless)');
LEGEND_ALGEBRAIC(:,26) = strpad('tau_f_T in component T_type_Ca_channel_f_gate (second)');
LEGEND_CONSTANTS(:,35) = strpad('g_K in component delayed_rectifying_potassium_current (microS)');
LEGEND_ALGEBRAIC(:,59) = strpad('E_K in component reversal_potentials (millivolt)');
LEGEND_CONSTANTS(:,10) = strpad('K_b in component cleft_space_equations (millimolar)');
LEGEND_STATES(:,10) = strpad('P_a in component delayed_rectifying_potassium_current_P_a_gate (dimensionless)');
LEGEND_STATES(:,11) = strpad('P_i in component delayed_rectifying_potassium_current_P_i_gate (dimensionless)');
LEGEND_ALGEBRAIC(:,17) = strpad('tau_P_a in component delayed_rectifying_potassium_current_P_a_gate (second)');
LEGEND_ALGEBRAIC(:,6) = strpad('P_a_infinity in component delayed_rectifying_potassium_current_P_a_gate (dimensionless)');
LEGEND_ALGEBRAIC(:,7) = strpad('alpha_P_i in component delayed_rectifying_potassium_current_P_i_gate (per_second)');
LEGEND_ALGEBRAIC(:,18) = strpad('beta_P_i in component delayed_rectifying_potassium_current_P_i_gate (per_second)');
LEGEND_ALGEBRAIC(:,58) = strpad('i_B_Na in component linear_background_current (nanoA)');
LEGEND_ALGEBRAIC(:,63) = strpad('i_B_Ca in component linear_background_current (nanoA)');
LEGEND_ALGEBRAIC(:,61) = strpad('i_B_K in component linear_background_current (nanoA)');
LEGEND_CONSTANTS(:,11) = strpad('g_B_Na in component linear_background_current (microS)');
LEGEND_CONSTANTS(:,12) = strpad('g_B_Ca in component linear_background_current (microS)');
LEGEND_CONSTANTS(:,13) = strpad('g_B_K in component linear_background_current (microS)');
LEGEND_ALGEBRAIC(:,62) = strpad('E_Ca in component reversal_potentials (millivolt)');
LEGEND_ALGEBRAIC(:,38) = strpad('i_f_Na in component hyperpolarisation_activated_current (nanoA)');
LEGEND_ALGEBRAIC(:,39) = strpad('i_f_K in component hyperpolarisation_activated_current (nanoA)');
LEGEND_CONSTANTS(:,14) = strpad('g_f_Na in component hyperpolarisation_activated_current (microS)');
LEGEND_CONSTANTS(:,15) = strpad('g_f_K in component hyperpolarisation_activated_current (microS)');
LEGEND_STATES(:,12) = strpad('y in component hyperpolarisation_activated_current_y_gate (dimensionless)');
LEGEND_ALGEBRAIC(:,8) = strpad('y_infinity in component hyperpolarisation_activated_current_y_gate (dimensionless)');
LEGEND_ALGEBRAIC(:,19) = strpad('tau_y in component hyperpolarisation_activated_current_y_gate (second)');
LEGEND_CONSTANTS(:,16) = strpad('K_m_Na in component sodium_potassium_pump (millimolar)');
LEGEND_CONSTANTS(:,17) = strpad('K_m_K in component sodium_potassium_pump (millimolar)');
LEGEND_CONSTANTS(:,18) = strpad('i_NaK_max in component sodium_potassium_pump (nanoA)');
LEGEND_STATES(:,13) = strpad('Na_i in component intracellular_concentrations_and_buffer_equations (millimolar)');
LEGEND_STATES(:,14) = strpad('K_c in component cleft_space_equations (millimolar)');
LEGEND_CONSTANTS(:,19) = strpad('i_Ca_P_max in component calcium_pump_current (nanoA)');
LEGEND_STATES(:,15) = strpad('Ca_i in component intracellular_concentrations_and_buffer_equations (millimolar)');
LEGEND_CONSTANTS(:,20) = strpad('K_NaCa in component sodium_calcium_pump (nanoA)');
LEGEND_CONSTANTS(:,21) = strpad('d_NaCa in component sodium_calcium_pump (dimensionless)');
LEGEND_CONSTANTS(:,22) = strpad('gamma in component sodium_calcium_pump (dimensionless)');
LEGEND_STATES(:,16) = strpad('Ca_c in component cleft_space_equations (millimolar)');
LEGEND_STATES(:,17) = strpad('K_i in component intracellular_concentrations_and_buffer_equations (millimolar)');
LEGEND_STATES(:,18) = strpad('Ca_Calmod in component intracellular_concentrations_and_buffer_equations (dimensionless)');
LEGEND_STATES(:,19) = strpad('Ca_Trop in component intracellular_concentrations_and_buffer_equations (dimensionless)');
LEGEND_STATES(:,20) = strpad('Ca_Mg_Trop in component intracellular_concentrations_and_buffer_equations (dimensionless)');
LEGEND_STATES(:,21) = strpad('Mg_Mg_Trop in component intracellular_concentrations_and_buffer_equations (dimensionless)');
LEGEND_ALGEBRAIC(:,44) = strpad('phi_C in component intracellular_concentrations_and_buffer_equations (per_second)');
LEGEND_ALGEBRAIC(:,45) = strpad('phi_TC in component intracellular_concentrations_and_buffer_equations (per_second)');
LEGEND_ALGEBRAIC(:,46) = strpad('phi_TMgC in component intracellular_concentrations_and_buffer_equations (per_second)');
LEGEND_ALGEBRAIC(:,10) = strpad('phi_TMgM in component intracellular_concentrations_and_buffer_equations (per_second)');
LEGEND_ALGEBRAIC(:,50) = strpad('phi_B in component intracellular_concentrations_and_buffer_equations (millimolar_per_second)');
LEGEND_CONSTANTS(:,23) = strpad('Mg_i in component intracellular_concentrations_and_buffer_equations (millimolar)');
LEGEND_ALGEBRAIC(:,47) = strpad('F_C in component intracellular_concentrations_and_buffer_equations (millimolar_per_second)');
LEGEND_ALGEBRAIC(:,48) = strpad('F_TC in component intracellular_concentrations_and_buffer_equations (millimolar_per_second)');
LEGEND_ALGEBRAIC(:,49) = strpad('F_TMgC in component intracellular_concentrations_and_buffer_equations (millimolar_per_second)');
LEGEND_CONSTANTS(:,24) = strpad('Vol in component cleft_space_equations (microLitre)');
LEGEND_CONSTANTS(:,36) = strpad('V_i in component intracellular_concentrations_and_buffer_equations (microLitre)');
LEGEND_ALGEBRAIC(:,53) = strpad('i_up in component SR_Ca_uptake_and_release (nanoA)');
LEGEND_ALGEBRAIC(:,54) = strpad('i_rel in component SR_Ca_uptake_and_release (nanoA)');
LEGEND_CONSTANTS(:,25) = strpad('Na_b in component cleft_space_equations (millimolar)');
LEGEND_CONSTANTS(:,26) = strpad('Ca_b in component cleft_space_equations (millimolar)');
LEGEND_CONSTANTS(:,37) = strpad('V_c in component cleft_space_equations (microLitre)');
LEGEND_CONSTANTS(:,27) = strpad('tau_p in component cleft_space_equations (second)');
LEGEND_ALGEBRAIC(:,56) = strpad('i_tr in component SR_Ca_uptake_and_release (nanoA)');
LEGEND_STATES(:,22) = strpad('Ca_up in component SR_Ca_uptake_and_release (millimolar)');
LEGEND_STATES(:,23) = strpad('Ca_rel in component SR_Ca_uptake_and_release (millimolar)');
LEGEND_CONSTANTS(:,28) = strpad('alpha_up in component SR_Ca_uptake_and_release (nanoA)');
LEGEND_CONSTANTS(:,29) = strpad('beta_up in component SR_Ca_uptake_and_release (nanoA)');
LEGEND_CONSTANTS(:,30) = strpad('alpha_rel in component SR_Ca_uptake_and_release (nanoA_per_millimolar)');
LEGEND_CONSTANTS(:,38) = strpad('K1 in component SR_Ca_uptake_and_release (dimensionless)');
LEGEND_ALGEBRAIC(:,52) = strpad('K2 in component SR_Ca_uptake_and_release (millimolar)');
LEGEND_CONSTANTS(:,31) = strpad('k_cyca in component SR_Ca_uptake_and_release (millimolar)');
LEGEND_CONSTANTS(:,32) = strpad('k_xcs in component SR_Ca_uptake_and_release (dimensionless)');
LEGEND_CONSTANTS(:,33) = strpad('k_SRCa in component SR_Ca_uptake_and_release (millimolar)');
LEGEND_CONSTANTS(:,34) = strpad('k_rel in component SR_Ca_uptake_and_release (millimolar)');
LEGEND_ALGEBRAIC(:,11) = strpad('r_act in component SR_Ca_uptake_and_release (per_second)');
LEGEND_ALGEBRAIC(:,21) = strpad('r_inact in component SR_Ca_uptake_and_release (per_second)');
LEGEND_STATES(:,24) = strpad('Ca_Calse in component SR_Ca_uptake_and_release (dimensionless)');
LEGEND_ALGEBRAIC(:,51) = strpad('phi_Calse in component SR_Ca_uptake_and_release (per_second)');
LEGEND_STATES(:,25) = strpad('F1 in component SR_Ca_uptake_and_release (dimensionless)');
LEGEND_STATES(:,26) = strpad('F2 in component SR_Ca_uptake_and_release (dimensionless)');
LEGEND_STATES(:,27) = strpad('F3 in component SR_Ca_uptake_and_release (dimensionless)');
LEGEND_CONSTANTS(:,39) = strpad('V_up in component SR_Ca_uptake_and_release (microLitre)');
LEGEND_CONSTANTS(:,40) = strpad('V_rel in component SR_Ca_uptake_and_release (microLitre)');
LEGEND_RATES(:,1) = strpad('d/dt V in component membrane (millivolt)');
LEGEND_RATES(:,3) = strpad('d/dt m in component sodium_current_m_gate (dimensionless)');
LEGEND_RATES(:,4) = strpad('d/dt h1 in component sodium_current_h_gate (dimensionless)');
LEGEND_RATES(:,5) = strpad('d/dt h2 in component sodium_current_h_gate (dimensionless)');
LEGEND_RATES(:,6) = strpad('d/dt d_L in component L_type_Ca_channel_d_gate (dimensionless)');
LEGEND_RATES(:,7) = strpad('d/dt f_L in component L_type_Ca_channel_f_gate (dimensionless)');
LEGEND_RATES(:,8) = strpad('d/dt d_T in component T_type_Ca_channel_d_gate (dimensionless)');
LEGEND_RATES(:,9) = strpad('d/dt f_T in component T_type_Ca_channel_f_gate (dimensionless)');
LEGEND_RATES(:,10) = strpad('d/dt P_a in component delayed_rectifying_potassium_current_P_a_gate (dimensionless)');
LEGEND_RATES(:,11) = strpad('d/dt P_i in component delayed_rectifying_potassium_current_P_i_gate (dimensionless)');
LEGEND_RATES(:,12) = strpad('d/dt y in component hyperpolarisation_activated_current_y_gate (dimensionless)');
LEGEND_RATES(:,18) = strpad('d/dt Ca_Calmod in component intracellular_concentrations_and_buffer_equations (dimensionless)');
LEGEND_RATES(:,19) = strpad('d/dt Ca_Trop in component intracellular_concentrations_and_buffer_equations (dimensionless)');
LEGEND_RATES(:,20) = strpad('d/dt Ca_Mg_Trop in component intracellular_concentrations_and_buffer_equations (dimensionless)');
LEGEND_RATES(:,21) = strpad('d/dt Mg_Mg_Trop in component intracellular_concentrations_and_buffer_equations (dimensionless)');
LEGEND_RATES(:,13) = strpad('d/dt Na_i in component intracellular_concentrations_and_buffer_equations (millimolar)');
LEGEND_RATES(:,17) = strpad('d/dt K_i in component intracellular_concentrations_and_buffer_equations (millimolar)');
LEGEND_RATES(:,15) = strpad('d/dt Ca_i in component intracellular_concentrations_and_buffer_equations (millimolar)');
LEGEND_RATES(:,2) = strpad('d/dt Na_c in component cleft_space_equations (millimolar)');
LEGEND_RATES(:,14) = strpad('d/dt K_c in component cleft_space_equations (millimolar)');
LEGEND_RATES(:,16) = strpad('d/dt Ca_c in component cleft_space_equations (millimolar)');
LEGEND_RATES(:,24) = strpad('d/dt Ca_Calse in component SR_Ca_uptake_and_release (dimensionless)');
LEGEND_RATES(:,25) = strpad('d/dt F1 in component SR_Ca_uptake_and_release (dimensionless)');
LEGEND_RATES(:,26) = strpad('d/dt F2 in component SR_Ca_uptake_and_release (dimensionless)');
LEGEND_RATES(:,27) = strpad('d/dt F3 in component SR_Ca_uptake_and_release (dimensionless)');
LEGEND_RATES(:,22) = strpad('d/dt Ca_up in component SR_Ca_uptake_and_release (millimolar)');
LEGEND_RATES(:,23) = strpad('d/dt Ca_rel in component SR_Ca_uptake_and_release (millimolar)');
LEGEND_STATES  = LEGEND_STATES';
LEGEND_ALGEBRAIC = LEGEND_ALGEBRAIC';
LEGEND_RATES = LEGEND_RATES';
LEGEND_CONSTANTS = LEGEND_CONSTANTS';
end

function [STATES, CONSTANTS] = initConsts()
VOI = 0; CONSTANTS = []; STATES = []; ALGEBRAIC = [];
STATES(:,1) = -49.54105;
CONSTANTS(:,1) = 8314.472;
CONSTANTS(:,2) = 310;
CONSTANTS(:,3) = 96485.3415;
CONSTANTS(:,4) = 5.5e-5;
CONSTANTS(:,5) = 0.00344;
STATES(:,2) = 139.9988;
STATES(:,3) = 0.250113;
STATES(:,4) = 0.001386897;
STATES(:,5) = 0.002065463;
CONSTANTS(:,6) = 0.02115;
CONSTANTS(:,7) = 46.4;
STATES(:,6) = 0.002572773;
STATES(:,7) = 0.98651;
CONSTANTS(:,8) = 0.02521;
CONSTANTS(:,9) = 45;
STATES(:,8) = 0.02012114;
STATES(:,9) = 0.1945111;
CONSTANTS(:,10) = 5.4;
STATES(:,10) = 0.02302278;
STATES(:,11) = 0.3777728;
CONSTANTS(:,11) = 0.00016;
CONSTANTS(:,12) = 0.0000364;
CONSTANTS(:,13) = 0.0000694;
CONSTANTS(:,14) = 0.0067478;
CONSTANTS(:,15) = 0.0128821;
STATES(:,12) = 0.09227776;
CONSTANTS(:,16) = 5.46;
CONSTANTS(:,17) = 0.621;
CONSTANTS(:,18) = 0.2192;
STATES(:,13) = 9.701621;
STATES(:,14) = 5.389014;
CONSTANTS(:,19) = 0.02869;
STATES(:,15) = 3.787018e-4;
CONSTANTS(:,20) = 0.00001248;
CONSTANTS(:,21) = 0.0001;
CONSTANTS(:,22) = 0.5;
STATES(:,16) = 2.00474;
STATES(:,17) = 1.407347e2;
STATES(:,18) = 0.1411678;
STATES(:,19) = 0.07331396;
STATES(:,20) = 0.7618549;
STATES(:,21) = 0.2097049;
CONSTANTS(:,23) = 2.5;
CONSTANTS(:,24) = 3.497e-6;
CONSTANTS(:,25) = 140;
CONSTANTS(:,26) = 2;
CONSTANTS(:,27) = 0.01;
STATES(:,22) = 16.95311;
STATES(:,23) = 16.85024;
CONSTANTS(:,28) = 0.08;
CONSTANTS(:,29) = 0.072;
CONSTANTS(:,30) = 0.5;
CONSTANTS(:,31) = 0.00005;
CONSTANTS(:,32) = 0.9;
CONSTANTS(:,33) = 22;
CONSTANTS(:,34) = 0.004;
STATES(:,24) = 0.9528726;
STATES(:,25) = 0.1133251;
STATES(:,26) = 0.0007594214;
STATES(:,27) = 0.8859153;
CONSTANTS(:,35) =  0.00693000.*power(CONSTANTS(:,10)./1.00000, 0.590000);
CONSTANTS(:,36) =  0.465000.*CONSTANTS(:,24);
CONSTANTS(:,37) =  0.136000.*CONSTANTS(:,24);
CONSTANTS(:,38) = ( CONSTANTS(:,31).*CONSTANTS(:,32))./CONSTANTS(:,33);
CONSTANTS(:,39) =  0.0116600.*CONSTANTS(:,36);
CONSTANTS(:,40) =  0.00129600.*CONSTANTS(:,36);
if (isempty(STATES)), warning('Initial values for states not set');, end
end

function [RATES, ALGEBRAIC] = computeRates(VOI, STATES, CONSTANTS)
global algebraicVariableCount;
statesSize = size(STATES);
statesColumnCount = statesSize(2);
if ( statesColumnCount == 1)
STATES = STATES';
ALGEBRAIC = zeros(1, algebraicVariableCount);
utilOnes = 1;
else
statesRowCount = statesSize(1);
ALGEBRAIC = zeros(statesRowCount, algebraicVariableCount);
RATES = zeros(statesRowCount, statesColumnCount);
utilOnes = ones(statesRowCount, 1);
end
ALGEBRAIC(:,10) =  1290.00.*CONSTANTS(:,23).*(1.00000 - (STATES(:,20)+STATES(:,21))) -  429.000.*STATES(:,21);
RATES(:,21) = ALGEBRAIC(:,10);
ALGEBRAIC(:,11) =  240.000.*exp( (STATES(:,1) - 40.0000).*0.0800000)+ 240.000.*power(STATES(:,15)./(STATES(:,15)+CONSTANTS(:,34)), 4.00000);
RATES(:,25) =  0.960000.*STATES(:,27) -  ALGEBRAIC(:,11).*STATES(:,25);
ALGEBRAIC(:,17) = 1.00000./( 17.0000.*exp( 0.0398000.*STATES(:,1))+ 2.11000.*exp(  - 0.0510000.*STATES(:,1)));
ALGEBRAIC(:,6) = 1.00000./(1.00000+exp((STATES(:,1)+5.10000)./ - 7.40000));
RATES(:,10) = (ALGEBRAIC(:,6) - STATES(:,10))./ALGEBRAIC(:,17);
ALGEBRAIC(:,7) =  100.000.*exp(  - 0.0183000.*STATES(:,1));
ALGEBRAIC(:,18) =  656.000.*exp( 0.00942000.*STATES(:,1));
RATES(:,11) =  ALGEBRAIC(:,7).*(1.00000 - STATES(:,11)) -  ALGEBRAIC(:,18).*STATES(:,11);
ALGEBRAIC(:,8) = 1.00000./(1.00000+exp((STATES(:,1)+72.2000)./9.00000));
ALGEBRAIC(:,19) = 1.00000./( 1.64830.*exp((STATES(:,1)+54.0600)./ - 24.3300)+14.0106./(0.700000+exp((STATES(:,1)+60.0000)./ - 5.50000)));
RATES(:,12) = (ALGEBRAIC(:,8) - STATES(:,12))./ALGEBRAIC(:,19);
ALGEBRAIC(:,21) = 40.0000+ 240.000.*power(STATES(:,15)./(STATES(:,15)+CONSTANTS(:,34)), 4.00000);
RATES(:,26) =  ALGEBRAIC(:,11).*STATES(:,25) -  ALGEBRAIC(:,21).*STATES(:,26);
RATES(:,27) =  ALGEBRAIC(:,21).*STATES(:,26) -  0.960000.*STATES(:,27);
ALGEBRAIC(:,1) = (  - 824.000.*(STATES(:,1)+51.9000))./(exp((STATES(:,1)+51.9000)./ - 8.90000) - 1.00000);
ALGEBRAIC(:,12) =  32960.0.*exp((STATES(:,1)+51.9000)./ - 8.90000);
ALGEBRAIC(:,22) = ALGEBRAIC(:,1)./(ALGEBRAIC(:,1)+ALGEBRAIC(:,12));
ALGEBRAIC(:,28) = 1.00000./(ALGEBRAIC(:,1)+ALGEBRAIC(:,12))+1.50000e-05;
RATES(:,3) = (ALGEBRAIC(:,22) - STATES(:,3))./ALGEBRAIC(:,28);
ALGEBRAIC(:,2) =  165.000.*exp((STATES(:,1)+101.300)./ - 12.6000);
ALGEBRAIC(:,13) = 12360.0./( 320.000.*exp((STATES(:,1)+101.300)./ - 12.6000)+1.00000);
ALGEBRAIC(:,23) = ALGEBRAIC(:,2)./(ALGEBRAIC(:,2)+ALGEBRAIC(:,13));
ALGEBRAIC(:,29) = 1.00000./(ALGEBRAIC(:,2)+ALGEBRAIC(:,13));
RATES(:,4) = (ALGEBRAIC(:,23) - STATES(:,4))./ALGEBRAIC(:,29);
ALGEBRAIC(:,33) = 1.00000./(1.00000+exp((STATES(:,1)+14.1000)./ - 6.00000));
ALGEBRAIC(:,9) = (  - 28.3900.*(STATES(:,1)+35.0000))./(exp((STATES(:,1)+35.0000)./ - 2.50000) - 1.00000)+(  - 84.9000.*STATES(:,1))./(exp(  - 0.208000.*STATES(:,1)) - 1.00000);
ALGEBRAIC(:,20) = ( 11.4300.*(STATES(:,1) - 5.00000))./(exp( 0.400000.*(STATES(:,1) - 5.00000)) - 1.00000);
ALGEBRAIC(:,27) = 1.00000./(ALGEBRAIC(:,9)+ALGEBRAIC(:,20));
RATES(:,6) = (ALGEBRAIC(:,33) - STATES(:,6))./ALGEBRAIC(:,27);
ALGEBRAIC(:,30) = 1.00000./(1.00000+exp((STATES(:,1)+30.0000)./5.00000));
ALGEBRAIC(:,3) = ( 3.75000.*(STATES(:,1)+28.0000))./(exp((STATES(:,1)+28.0000)./4.00000) - 1.00000);
ALGEBRAIC(:,14) = 30.0000./(1.00000+exp((STATES(:,1)+28.0000)./ - 4.00000));
ALGEBRAIC(:,24) = 1.00000./(ALGEBRAIC(:,3)+ALGEBRAIC(:,14));
RATES(:,7) = (ALGEBRAIC(:,30) - STATES(:,7))./ALGEBRAIC(:,24);
ALGEBRAIC(:,31) = 1.00000./(1.00000+exp((STATES(:,1)+26.3000)./ - 6.00000));
ALGEBRAIC(:,4) =  1068.00.*exp((STATES(:,1)+26.3000)./30.0000);
ALGEBRAIC(:,15) =  1068.00.*exp((STATES(:,1)+26.3000)./ - 30.0000);
ALGEBRAIC(:,25) = 1.00000./(ALGEBRAIC(:,4)+ALGEBRAIC(:,15));
RATES(:,8) = (ALGEBRAIC(:,31) - STATES(:,8))./ALGEBRAIC(:,25);
ALGEBRAIC(:,32) = 1.00000./(1.00000+exp((STATES(:,1)+61.7000)./5.60000));
ALGEBRAIC(:,5) =  15.3000.*exp((STATES(:,1)+61.7000)./ - 83.3000);
ALGEBRAIC(:,16) =  15.0000.*exp((STATES(:,1)+61.7000)./15.3800);
ALGEBRAIC(:,26) = 1.00000./(ALGEBRAIC(:,5)+ALGEBRAIC(:,16));
RATES(:,9) = (ALGEBRAIC(:,32) - STATES(:,9))./ALGEBRAIC(:,26);
ALGEBRAIC(:,34) = ALGEBRAIC(:,23);
ALGEBRAIC(:,36) =  20.0000.*ALGEBRAIC(:,29);
RATES(:,5) = (ALGEBRAIC(:,34) - STATES(:,5))./ALGEBRAIC(:,36);
ALGEBRAIC(:,44) =  129000..*STATES(:,15).*(1.00000 - STATES(:,18)) -  307.000.*STATES(:,18);
RATES(:,18) = ALGEBRAIC(:,44);
ALGEBRAIC(:,45) =  50500.0.*STATES(:,15).*(1.00000 - STATES(:,19)) -  252.000.*STATES(:,19);
RATES(:,19) = ALGEBRAIC(:,45);
ALGEBRAIC(:,46) =  129000..*STATES(:,15).*(1.00000 - (STATES(:,20)+STATES(:,21))) -  4.25000.*STATES(:,20);
RATES(:,20) = ALGEBRAIC(:,46);
ALGEBRAIC(:,51) =  770.000.*STATES(:,23).*(1.00000 - STATES(:,24)) -  641.000.*STATES(:,24);
RATES(:,24) = ALGEBRAIC(:,51);
ALGEBRAIC(:,52) = STATES(:,15)+ STATES(:,22).*CONSTANTS(:,38)+ CONSTANTS(:,31).*CONSTANTS(:,32)+CONSTANTS(:,31);
ALGEBRAIC(:,53) = ( CONSTANTS(:,28).*STATES(:,15) -  CONSTANTS(:,29).*STATES(:,22).*CONSTANTS(:,38))./ALGEBRAIC(:,52);
ALGEBRAIC(:,56) = ( (STATES(:,22) - STATES(:,23)).*2.00000.*CONSTANTS(:,3).*CONSTANTS(:,39))./0.0641800;
RATES(:,22) = (ALGEBRAIC(:,53) - ALGEBRAIC(:,56))./( 2.00000.*CONSTANTS(:,39).*CONSTANTS(:,3));
ALGEBRAIC(:,54) =  CONSTANTS(:,30).*power(STATES(:,26)./(STATES(:,26)+0.250000), 2.00000).*STATES(:,23);
RATES(:,23) = (ALGEBRAIC(:,56) - ALGEBRAIC(:,54))./( 2.00000.*CONSTANTS(:,40).*CONSTANTS(:,3)) -  11.4800.*ALGEBRAIC(:,51);
ALGEBRAIC(:,55) =  (( CONSTANTS(:,1).*CONSTANTS(:,2))./CONSTANTS(:,3)).*log(STATES(:,2)./STATES(:,13));
ALGEBRAIC(:,57) = ( (( CONSTANTS(:,5).*power(STATES(:,3), 3.00000).*STATES(:,4).*STATES(:,5).*STATES(:,2).*STATES(:,1).*power(CONSTANTS(:,3), 2.00000))./( CONSTANTS(:,1).*CONSTANTS(:,2))).*(exp(( (STATES(:,1) - ALGEBRAIC(:,55)).*CONSTANTS(:,3))./( CONSTANTS(:,1).*CONSTANTS(:,2))) - 1.00000))./(exp(( STATES(:,1).*CONSTANTS(:,3))./( CONSTANTS(:,1).*CONSTANTS(:,2))) - 1.00000);
ALGEBRAIC(:,41) = ( CONSTANTS(:,18).*power(STATES(:,13)./(CONSTANTS(:,16)+STATES(:,13)), 3.00000).*power(STATES(:,14)./(CONSTANTS(:,17)+STATES(:,14)), 2.00000).*1.60000)./(1.50000+exp((STATES(:,1)+60.0000)./ - 40.0000));
ALGEBRAIC(:,43) = ( CONSTANTS(:,20).*( power(STATES(:,13), 3.00000).*STATES(:,16).*exp( 0.0374300.*STATES(:,1).*CONSTANTS(:,22)) -  power(STATES(:,2), 3.00000).*STATES(:,15).*exp( 0.0374300.*STATES(:,1).*(CONSTANTS(:,22) - 1.00000))))./(1.00000+ CONSTANTS(:,21).*( STATES(:,15).*power(STATES(:,2), 3.00000)+ STATES(:,16).*power(STATES(:,13), 3.00000)));
ALGEBRAIC(:,58) =  CONSTANTS(:,11).*(STATES(:,1) - ALGEBRAIC(:,55));
ALGEBRAIC(:,38) =  CONSTANTS(:,14).*power(STATES(:,12), 2.00000).*(STATES(:,1) - 75.0000);
RATES(:,13) =  - ( 3.00000.*ALGEBRAIC(:,41)+ 3.00000.*ALGEBRAIC(:,43)+ALGEBRAIC(:,58)+ALGEBRAIC(:,38)+ALGEBRAIC(:,57))./( CONSTANTS(:,3).*CONSTANTS(:,36));
RATES(:,2) = (CONSTANTS(:,25) - STATES(:,2))./CONSTANTS(:,27)+(ALGEBRAIC(:,57)+ 3.00000.*ALGEBRAIC(:,43)+ 3.00000.*ALGEBRAIC(:,41)+ALGEBRAIC(:,58)+ALGEBRAIC(:,38))./( CONSTANTS(:,3).*CONSTANTS(:,37));
ALGEBRAIC(:,59) =  (( CONSTANTS(:,1).*CONSTANTS(:,2))./CONSTANTS(:,3)).*log(STATES(:,14)./STATES(:,17));
ALGEBRAIC(:,60) =  CONSTANTS(:,35).*STATES(:,10).*STATES(:,11).*(STATES(:,1) - ALGEBRAIC(:,59));
ALGEBRAIC(:,61) =  CONSTANTS(:,13).*(STATES(:,1) - ALGEBRAIC(:,59));
ALGEBRAIC(:,39) =  CONSTANTS(:,15).*power(STATES(:,12), 2.00000).*(STATES(:,1)+85.0000);
RATES(:,17) = ( 2.00000.*ALGEBRAIC(:,41) - (ALGEBRAIC(:,60)+ALGEBRAIC(:,39)+ALGEBRAIC(:,61)))./( CONSTANTS(:,3).*CONSTANTS(:,36));
RATES(:,14) = (CONSTANTS(:,10) - STATES(:,14))./CONSTANTS(:,27)+(  - 2.00000.*ALGEBRAIC(:,41)+ALGEBRAIC(:,60)+ALGEBRAIC(:,61)+ALGEBRAIC(:,39))./( CONSTANTS(:,3).*CONSTANTS(:,37));
ALGEBRAIC(:,37) =  CONSTANTS(:,8).*STATES(:,8).*STATES(:,9).*(STATES(:,1) - CONSTANTS(:,9));
ALGEBRAIC(:,35) =  CONSTANTS(:,6).*( STATES(:,7).*STATES(:,6)+ 0.0950000.*ALGEBRAIC(:,33)).*(STATES(:,1) - CONSTANTS(:,7));
ALGEBRAIC(:,42) = ( CONSTANTS(:,19).*STATES(:,15))./(STATES(:,15)+0.000400000);
ALGEBRAIC(:,62) =  (( 0.500000.*CONSTANTS(:,1).*CONSTANTS(:,2))./CONSTANTS(:,3)).*log(STATES(:,16)./STATES(:,15));
ALGEBRAIC(:,63) =  CONSTANTS(:,12).*(STATES(:,1) - ALGEBRAIC(:,62));
ALGEBRAIC(:,47) =  0.0900000.*ALGEBRAIC(:,44);
ALGEBRAIC(:,48) =  0.0310000.*ALGEBRAIC(:,45);
ALGEBRAIC(:,49) =  0.0620000.*ALGEBRAIC(:,46);
ALGEBRAIC(:,50) = ALGEBRAIC(:,47)+ALGEBRAIC(:,48)+ALGEBRAIC(:,49);
RATES(:,15) = (( 2.00000.*ALGEBRAIC(:,43)+ALGEBRAIC(:,54)) - (ALGEBRAIC(:,35)+ALGEBRAIC(:,37)+ALGEBRAIC(:,42)+ALGEBRAIC(:,63)+ALGEBRAIC(:,53)))./( 2.00000.*CONSTANTS(:,36).*CONSTANTS(:,3)) - ALGEBRAIC(:,50);
RATES(:,16) = (CONSTANTS(:,26) - STATES(:,16))./CONSTANTS(:,27)+(  - 2.00000.*ALGEBRAIC(:,43)+ALGEBRAIC(:,35)+ALGEBRAIC(:,37)+ALGEBRAIC(:,42)+ALGEBRAIC(:,63))./( 2.00000.*CONSTANTS(:,3).*CONSTANTS(:,37));
ALGEBRAIC(:,40) = ALGEBRAIC(:,38)+ALGEBRAIC(:,39);
ALGEBRAIC(:,64) = ALGEBRAIC(:,58)+ALGEBRAIC(:,63)+ALGEBRAIC(:,61);
RATES(:,1) =  - (ALGEBRAIC(:,57)+ALGEBRAIC(:,37)+ALGEBRAIC(:,35)+ALGEBRAIC(:,60)+ALGEBRAIC(:,40)+ALGEBRAIC(:,64)+ALGEBRAIC(:,41)+ALGEBRAIC(:,43)+ALGEBRAIC(:,42))./CONSTANTS(:,4);
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(:,10) =  1290.00.*CONSTANTS(:,23).*(1.00000 - (STATES(:,20)+STATES(:,21))) -  429.000.*STATES(:,21);
ALGEBRAIC(:,11) =  240.000.*exp( (STATES(:,1) - 40.0000).*0.0800000)+ 240.000.*power(STATES(:,15)./(STATES(:,15)+CONSTANTS(:,34)), 4.00000);
ALGEBRAIC(:,17) = 1.00000./( 17.0000.*exp( 0.0398000.*STATES(:,1))+ 2.11000.*exp(  - 0.0510000.*STATES(:,1)));
ALGEBRAIC(:,6) = 1.00000./(1.00000+exp((STATES(:,1)+5.10000)./ - 7.40000));
ALGEBRAIC(:,7) =  100.000.*exp(  - 0.0183000.*STATES(:,1));
ALGEBRAIC(:,18) =  656.000.*exp( 0.00942000.*STATES(:,1));
ALGEBRAIC(:,8) = 1.00000./(1.00000+exp((STATES(:,1)+72.2000)./9.00000));
ALGEBRAIC(:,19) = 1.00000./( 1.64830.*exp((STATES(:,1)+54.0600)./ - 24.3300)+14.0106./(0.700000+exp((STATES(:,1)+60.0000)./ - 5.50000)));
ALGEBRAIC(:,21) = 40.0000+ 240.000.*power(STATES(:,15)./(STATES(:,15)+CONSTANTS(:,34)), 4.00000);
ALGEBRAIC(:,1) = (  - 824.000.*(STATES(:,1)+51.9000))./(exp((STATES(:,1)+51.9000)./ - 8.90000) - 1.00000);
ALGEBRAIC(:,12) =  32960.0.*exp((STATES(:,1)+51.9000)./ - 8.90000);
ALGEBRAIC(:,22) = ALGEBRAIC(:,1)./(ALGEBRAIC(:,1)+ALGEBRAIC(:,12));
ALGEBRAIC(:,28) = 1.00000./(ALGEBRAIC(:,1)+ALGEBRAIC(:,12))+1.50000e-05;
ALGEBRAIC(:,2) =  165.000.*exp((STATES(:,1)+101.300)./ - 12.6000);
ALGEBRAIC(:,13) = 12360.0./( 320.000.*exp((STATES(:,1)+101.300)./ - 12.6000)+1.00000);
ALGEBRAIC(:,23) = ALGEBRAIC(:,2)./(ALGEBRAIC(:,2)+ALGEBRAIC(:,13));
ALGEBRAIC(:,29) = 1.00000./(ALGEBRAIC(:,2)+ALGEBRAIC(:,13));
ALGEBRAIC(:,33) = 1.00000./(1.00000+exp((STATES(:,1)+14.1000)./ - 6.00000));
ALGEBRAIC(:,9) = (  - 28.3900.*(STATES(:,1)+35.0000))./(exp((STATES(:,1)+35.0000)./ - 2.50000) - 1.00000)+(  - 84.9000.*STATES(:,1))./(exp(  - 0.208000.*STATES(:,1)) - 1.00000);
ALGEBRAIC(:,20) = ( 11.4300.*(STATES(:,1) - 5.00000))./(exp( 0.400000.*(STATES(:,1) - 5.00000)) - 1.00000);
ALGEBRAIC(:,27) = 1.00000./(ALGEBRAIC(:,9)+ALGEBRAIC(:,20));
ALGEBRAIC(:,30) = 1.00000./(1.00000+exp((STATES(:,1)+30.0000)./5.00000));
ALGEBRAIC(:,3) = ( 3.75000.*(STATES(:,1)+28.0000))./(exp((STATES(:,1)+28.0000)./4.00000) - 1.00000);
ALGEBRAIC(:,14) = 30.0000./(1.00000+exp((STATES(:,1)+28.0000)./ - 4.00000));
ALGEBRAIC(:,24) = 1.00000./(ALGEBRAIC(:,3)+ALGEBRAIC(:,14));
ALGEBRAIC(:,31) = 1.00000./(1.00000+exp((STATES(:,1)+26.3000)./ - 6.00000));
ALGEBRAIC(:,4) =  1068.00.*exp((STATES(:,1)+26.3000)./30.0000);
ALGEBRAIC(:,15) =  1068.00.*exp((STATES(:,1)+26.3000)./ - 30.0000);
ALGEBRAIC(:,25) = 1.00000./(ALGEBRAIC(:,4)+ALGEBRAIC(:,15));
ALGEBRAIC(:,32) = 1.00000./(1.00000+exp((STATES(:,1)+61.7000)./5.60000));
ALGEBRAIC(:,5) =  15.3000.*exp((STATES(:,1)+61.7000)./ - 83.3000);
ALGEBRAIC(:,16) =  15.0000.*exp((STATES(:,1)+61.7000)./15.3800);
ALGEBRAIC(:,26) = 1.00000./(ALGEBRAIC(:,5)+ALGEBRAIC(:,16));
ALGEBRAIC(:,34) = ALGEBRAIC(:,23);
ALGEBRAIC(:,36) =  20.0000.*ALGEBRAIC(:,29);
ALGEBRAIC(:,44) =  129000..*STATES(:,15).*(1.00000 - STATES(:,18)) -  307.000.*STATES(:,18);
ALGEBRAIC(:,45) =  50500.0.*STATES(:,15).*(1.00000 - STATES(:,19)) -  252.000.*STATES(:,19);
ALGEBRAIC(:,46) =  129000..*STATES(:,15).*(1.00000 - (STATES(:,20)+STATES(:,21))) -  4.25000.*STATES(:,20);
ALGEBRAIC(:,51) =  770.000.*STATES(:,23).*(1.00000 - STATES(:,24)) -  641.000.*STATES(:,24);
ALGEBRAIC(:,52) = STATES(:,15)+ STATES(:,22).*CONSTANTS(:,38)+ CONSTANTS(:,31).*CONSTANTS(:,32)+CONSTANTS(:,31);
ALGEBRAIC(:,53) = ( CONSTANTS(:,28).*STATES(:,15) -  CONSTANTS(:,29).*STATES(:,22).*CONSTANTS(:,38))./ALGEBRAIC(:,52);
ALGEBRAIC(:,56) = ( (STATES(:,22) - STATES(:,23)).*2.00000.*CONSTANTS(:,3).*CONSTANTS(:,39))./0.0641800;
ALGEBRAIC(:,54) =  CONSTANTS(:,30).*power(STATES(:,26)./(STATES(:,26)+0.250000), 2.00000).*STATES(:,23);
ALGEBRAIC(:,55) =  (( CONSTANTS(:,1).*CONSTANTS(:,2))./CONSTANTS(:,3)).*log(STATES(:,2)./STATES(:,13));
ALGEBRAIC(:,57) = ( (( CONSTANTS(:,5).*power(STATES(:,3), 3.00000).*STATES(:,4).*STATES(:,5).*STATES(:,2).*STATES(:,1).*power(CONSTANTS(:,3), 2.00000))./( CONSTANTS(:,1).*CONSTANTS(:,2))).*(exp(( (STATES(:,1) - ALGEBRAIC(:,55)).*CONSTANTS(:,3))./( CONSTANTS(:,1).*CONSTANTS(:,2))) - 1.00000))./(exp(( STATES(:,1).*CONSTANTS(:,3))./( CONSTANTS(:,1).*CONSTANTS(:,2))) - 1.00000);
ALGEBRAIC(:,41) = ( CONSTANTS(:,18).*power(STATES(:,13)./(CONSTANTS(:,16)+STATES(:,13)), 3.00000).*power(STATES(:,14)./(CONSTANTS(:,17)+STATES(:,14)), 2.00000).*1.60000)./(1.50000+exp((STATES(:,1)+60.0000)./ - 40.0000));
ALGEBRAIC(:,43) = ( CONSTANTS(:,20).*( power(STATES(:,13), 3.00000).*STATES(:,16).*exp( 0.0374300.*STATES(:,1).*CONSTANTS(:,22)) -  power(STATES(:,2), 3.00000).*STATES(:,15).*exp( 0.0374300.*STATES(:,1).*(CONSTANTS(:,22) - 1.00000))))./(1.00000+ CONSTANTS(:,21).*( STATES(:,15).*power(STATES(:,2), 3.00000)+ STATES(:,16).*power(STATES(:,13), 3.00000)));
ALGEBRAIC(:,58) =  CONSTANTS(:,11).*(STATES(:,1) - ALGEBRAIC(:,55));
ALGEBRAIC(:,38) =  CONSTANTS(:,14).*power(STATES(:,12), 2.00000).*(STATES(:,1) - 75.0000);
ALGEBRAIC(:,59) =  (( CONSTANTS(:,1).*CONSTANTS(:,2))./CONSTANTS(:,3)).*log(STATES(:,14)./STATES(:,17));
ALGEBRAIC(:,60) =  CONSTANTS(:,35).*STATES(:,10).*STATES(:,11).*(STATES(:,1) - ALGEBRAIC(:,59));
ALGEBRAIC(:,61) =  CONSTANTS(:,13).*(STATES(:,1) - ALGEBRAIC(:,59));
ALGEBRAIC(:,39) =  CONSTANTS(:,15).*power(STATES(:,12), 2.00000).*(STATES(:,1)+85.0000);
ALGEBRAIC(:,37) =  CONSTANTS(:,8).*STATES(:,8).*STATES(:,9).*(STATES(:,1) - CONSTANTS(:,9));
ALGEBRAIC(:,35) =  CONSTANTS(:,6).*( STATES(:,7).*STATES(:,6)+ 0.0950000.*ALGEBRAIC(:,33)).*(STATES(:,1) - CONSTANTS(:,7));
ALGEBRAIC(:,42) = ( CONSTANTS(:,19).*STATES(:,15))./(STATES(:,15)+0.000400000);
ALGEBRAIC(:,62) =  (( 0.500000.*CONSTANTS(:,1).*CONSTANTS(:,2))./CONSTANTS(:,3)).*log(STATES(:,16)./STATES(:,15));
ALGEBRAIC(:,63) =  CONSTANTS(:,12).*(STATES(:,1) - ALGEBRAIC(:,62));
ALGEBRAIC(:,47) =  0.0900000.*ALGEBRAIC(:,44);
ALGEBRAIC(:,48) =  0.0310000.*ALGEBRAIC(:,45);
ALGEBRAIC(:,49) =  0.0620000.*ALGEBRAIC(:,46);
ALGEBRAIC(:,50) = ALGEBRAIC(:,47)+ALGEBRAIC(:,48)+ALGEBRAIC(:,49);
ALGEBRAIC(:,40) = ALGEBRAIC(:,38)+ALGEBRAIC(:,39);
ALGEBRAIC(:,64) = ALGEBRAIC(:,58)+ALGEBRAIC(:,63)+ALGEBRAIC(:,61);
end

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

Source
Derived from workspace Demir, Clark, Giles, Murphey, 1994 at changeset 1808cdc3fbc7.
Collaboration
To begin collaborating on this work, please use your git client and issue this command: