Generated Code

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

The raw code is available.

/*
   There are a total of 57 entries in the algebraic variable array.
   There are a total of 36 entries in each of the rate and state variable arrays.
   There are a total of 79 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * STATES[0] is V in component membrane (millivolt).
 * CONSTANTS[0] is R in component membrane (joule_per_mole_kelvin).
 * CONSTANTS[1] is T in component membrane (kelvin).
 * CONSTANTS[2] is F in component membrane (coulomb_per_millimole).
 * CONSTANTS[3] is C_sc in component membrane (microF_per_cm2).
 * ALGEBRAIC[2] is i_Na in component fast_sodium_current (microA_per_microF).
 * ALGEBRAIC[54] is i_Ca in component L_type_Ca_current (microA_per_microF).
 * ALGEBRAIC[56] is i_Ca_K in component L_type_Ca_current (microA_per_microF).
 * ALGEBRAIC[12] is i_Kr in component rapid_activating_delayed_rectifiyer_K_current (microA_per_microF).
 * ALGEBRAIC[18] is i_Ks in component slow_activating_delayed_rectifiyer_K_current (microA_per_microF).
 * ALGEBRAIC[21] is i_to1 in component transient_outward_potassium_current (microA_per_microF).
 * ALGEBRAIC[52] is i_K1 in component time_independent_potassium_current (microA_per_microF).
 * ALGEBRAIC[53] is i_Kp in component plateau_potassium_current (microA_per_microF).
 * ALGEBRAIC[28] is i_NaCa in component Na_Ca_exchanger (microA_per_microF).
 * ALGEBRAIC[30] is i_NaK in component sodium_potassium_pump (microA_per_microF).
 * ALGEBRAIC[31] is i_p_Ca in component sarcolemmal_calcium_pump (microA_per_microF).
 * ALGEBRAIC[33] is i_Ca_b in component calcium_background_current (microA_per_microF).
 * ALGEBRAIC[34] is i_Na_b in component sodium_background_current (microA_per_microF).
 * ALGEBRAIC[0] is i_Stim in component membrane (microA_per_microF).
 * CONSTANTS[4] is stim_start in component membrane (second).
 * CONSTANTS[5] is stim_end in component membrane (second).
 * CONSTANTS[6] is stim_period in component membrane (second).
 * CONSTANTS[7] is stim_duration in component membrane (second).
 * CONSTANTS[8] is stim_amplitude in component membrane (microA_per_microF).
 * ALGEBRAIC[1] is E_Na in component fast_sodium_current (millivolt).
 * CONSTANTS[9] is g_Na in component fast_sodium_current (milliS_per_microF).
 * CONSTANTS[10] is Nao in component standard_ionic_concentrations (millimolar).
 * STATES[1] is Nai in component intracellular_ion_concentrations (millimolar).
 * STATES[2] is m in component fast_sodium_current_m_gate (dimensionless).
 * STATES[3] is h in component fast_sodium_current_h_gate (dimensionless).
 * STATES[4] is j in component fast_sodium_current_j_gate (dimensionless).
 * ALGEBRAIC[4] is alpha_m in component fast_sodium_current_m_gate (per_second).
 * ALGEBRAIC[5] is beta_m in component fast_sodium_current_m_gate (per_second).
 * ALGEBRAIC[3] is E0_m in component fast_sodium_current_m_gate (millivolt).
 * ALGEBRAIC[6] is alpha_h in component fast_sodium_current_h_gate (per_second).
 * ALGEBRAIC[7] is beta_h in component fast_sodium_current_h_gate (per_second).
 * ALGEBRAIC[8] is alpha_j in component fast_sodium_current_j_gate (per_second).
 * ALGEBRAIC[9] is beta_j in component fast_sodium_current_j_gate (per_second).
 * ALGEBRAIC[10] is E_K in component rapid_activating_delayed_rectifiyer_K_current (millivolt).
 * CONSTANTS[11] is g_Kr in component rapid_activating_delayed_rectifiyer_K_current (milliS_per_microF).
 * CONSTANTS[77] is f_Ko in component rapid_activating_delayed_rectifiyer_K_current (dimensionless).
 * ALGEBRAIC[11] is R_V in component rapid_activating_delayed_rectifiyer_K_current (dimensionless).
 * CONSTANTS[12] is Ko in component standard_ionic_concentrations (millimolar).
 * STATES[5] is Ki in component intracellular_ion_concentrations (millimolar).
 * STATES[6] is X_kr in component rapid_activating_delayed_rectifiyer_K_current_X_kr_gate (dimensionless).
 * ALGEBRAIC[13] is K12 in component rapid_activating_delayed_rectifiyer_K_current_X_kr_gate (dimensionless).
 * ALGEBRAIC[14] is K21 in component rapid_activating_delayed_rectifiyer_K_current_X_kr_gate (dimensionless).
 * ALGEBRAIC[15] is X_kr_inf in component rapid_activating_delayed_rectifiyer_K_current_X_kr_gate (dimensionless).
 * ALGEBRAIC[16] is tau_X_kr in component rapid_activating_delayed_rectifiyer_K_current_X_kr_gate (second).
 * CONSTANTS[13] is tau_factor in component rapid_activating_delayed_rectifiyer_K_current_X_kr_gate (dimensionless).
 * CONSTANTS[14] is g_Ks in component slow_activating_delayed_rectifiyer_K_current (milliS_per_microF).
 * ALGEBRAIC[17] is E_Ks in component slow_activating_delayed_rectifiyer_K_current (millivolt).
 * STATES[7] is X_ks in component slow_activating_delayed_rectifiyer_K_current_X_ks_gate (dimensionless).
 * ALGEBRAIC[20] is tau_X_ks in component slow_activating_delayed_rectifiyer_K_current_X_ks_gate (second).
 * ALGEBRAIC[19] is X_ks_infinity in component slow_activating_delayed_rectifiyer_K_current_X_ks_gate (dimensionless).
 * CONSTANTS[15] is g_to1 in component transient_outward_potassium_current (milliS_per_microF).
 * STATES[8] is X_to1 in component transient_outward_potassium_current_X_to1_gate (dimensionless).
 * STATES[9] is Y_to1 in component transient_outward_potassium_current_Y_to1_gate (dimensionless).
 * ALGEBRAIC[22] is alpha_X_to1 in component transient_outward_potassium_current_X_to1_gate (per_second).
 * ALGEBRAIC[23] is beta_X_to1 in component transient_outward_potassium_current_X_to1_gate (per_second).
 * ALGEBRAIC[24] is alpha_Y_to1 in component transient_outward_potassium_current_Y_to1_gate (per_second).
 * ALGEBRAIC[25] is beta_Y_to1 in component transient_outward_potassium_current_Y_to1_gate (per_second).
 * CONSTANTS[16] is g_K1 in component time_independent_potassium_current (milliS_per_microF).
 * CONSTANTS[17] is K_mK1 in component time_independent_potassium_current (millimolar).
 * ALGEBRAIC[26] is K1_infinity_V in component time_independent_potassium_current_K1_gate (dimensionless).
 * CONSTANTS[18] is g_Kp in component plateau_potassium_current (milliS_per_microF).
 * ALGEBRAIC[27] is Kp_V in component plateau_potassium_current_Kp_gate (dimensionless).
 * CONSTANTS[19] is K_mCa in component Na_Ca_exchanger (millimolar).
 * CONSTANTS[20] is K_mNa in component Na_Ca_exchanger (millimolar).
 * CONSTANTS[21] is K_NaCa in component Na_Ca_exchanger (microA_per_microF).
 * CONSTANTS[22] is K_sat in component Na_Ca_exchanger (dimensionless).
 * CONSTANTS[23] is eta in component Na_Ca_exchanger (dimensionless).
 * STATES[10] is Cai in component intracellular_ion_concentrations (millimolar).
 * CONSTANTS[24] is Cao in component standard_ionic_concentrations (millimolar).
 * CONSTANTS[25] is I_NaK in component sodium_potassium_pump (microA_per_microF).
 * ALGEBRAIC[29] is f_NaK in component sodium_potassium_pump (dimensionless).
 * CONSTANTS[26] is K_mNai in component sodium_potassium_pump (millimolar).
 * CONSTANTS[27] is K_mKo in component sodium_potassium_pump (millimolar).
 * CONSTANTS[78] is sigma in component sodium_potassium_pump (dimensionless).
 * CONSTANTS[28] is K_mpCa in component sarcolemmal_calcium_pump (millimolar).
 * CONSTANTS[29] is I_pCa in component sarcolemmal_calcium_pump (microA_per_microF).
 * CONSTANTS[30] is g_Cab in component calcium_background_current (milliS_per_microF).
 * ALGEBRAIC[32] is E_Ca in component calcium_background_current (millivolt).
 * CONSTANTS[31] is g_Nab in component sodium_background_current (milliS_per_microF).
 * CONSTANTS[32] is P_Ca in component L_type_Ca_current (cm_per_second).
 * CONSTANTS[33] is P_K in component L_type_Ca_current (cm_per_second).
 * ALGEBRAIC[55] is p_prime_k in component L_type_Ca_current (cm_per_second).
 * CONSTANTS[34] is i_Ca_half in component L_type_Ca_current (microA_per_microF).
 * ALGEBRAIC[35] is i_Ca_max in component L_type_Ca_current (microA_per_microF).
 * STATES[11] is O in component L_type_Ca_current (dimensionless).
 * STATES[12] is O_Ca in component L_type_Ca_current (dimensionless).
 * ALGEBRAIC[36] is alpha in component L_type_Ca_current (per_second).
 * ALGEBRAIC[37] is beta in component L_type_Ca_current (per_second).
 * ALGEBRAIC[40] is gamma in component L_type_Ca_current (per_second).
 * ALGEBRAIC[38] is alpha_a in component L_type_Ca_current (per_second).
 * ALGEBRAIC[39] is beta_b in component L_type_Ca_current (per_second).
 * CONSTANTS[35] is a in component L_type_Ca_current (dimensionless).
 * CONSTANTS[36] is b in component L_type_Ca_current (dimensionless).
 * CONSTANTS[37] is g in component L_type_Ca_current (per_second).
 * CONSTANTS[38] is f in component L_type_Ca_current (per_second).
 * CONSTANTS[39] is gprime in component L_type_Ca_current (per_second).
 * CONSTANTS[40] is fprime in component L_type_Ca_current (per_second).
 * CONSTANTS[41] is omega in component L_type_Ca_current (per_second).
 * STATES[13] is C0 in component L_type_Ca_current (dimensionless).
 * STATES[14] is C1 in component L_type_Ca_current (dimensionless).
 * STATES[15] is C2 in component L_type_Ca_current (dimensionless).
 * STATES[16] is C3 in component L_type_Ca_current (dimensionless).
 * STATES[17] is C4 in component L_type_Ca_current (dimensionless).
 * STATES[18] is C_Ca0 in component L_type_Ca_current (dimensionless).
 * STATES[19] is C_Ca1 in component L_type_Ca_current (dimensionless).
 * STATES[20] is C_Ca2 in component L_type_Ca_current (dimensionless).
 * STATES[21] is C_Ca3 in component L_type_Ca_current (dimensionless).
 * STATES[22] is C_Ca4 in component L_type_Ca_current (dimensionless).
 * STATES[23] is Ca_ss in component intracellular_ion_concentrations (millimolar).
 * STATES[24] is y in component L_type_Ca_current_y_gate (dimensionless).
 * ALGEBRAIC[41] is y_infinity in component L_type_Ca_current_y_gate (dimensionless).
 * ALGEBRAIC[42] is tau_y in component L_type_Ca_current_y_gate (second).
 * ALGEBRAIC[43] is J_rel in component RyR_channel (millimolar_per_second).
 * CONSTANTS[42] is v1 in component RyR_channel (per_second).
 * CONSTANTS[43] is k_a_plus in component RyR_channel (millimolar4_per_second).
 * CONSTANTS[44] is k_a_minus in component RyR_channel (per_second).
 * CONSTANTS[45] is k_b_plus in component RyR_channel (millimolar3_per_second).
 * CONSTANTS[46] is k_b_minus in component RyR_channel (per_second).
 * CONSTANTS[47] is k_c_plus in component RyR_channel (per_second).
 * CONSTANTS[48] is k_c_minus in component RyR_channel (per_second).
 * STATES[25] is P_O1 in component RyR_channel (dimensionless).
 * STATES[26] is P_O2 in component RyR_channel (dimensionless).
 * STATES[27] is P_C1 in component RyR_channel (dimensionless).
 * STATES[28] is P_C2 in component RyR_channel (dimensionless).
 * CONSTANTS[49] is n in component RyR_channel (dimensionless).
 * CONSTANTS[50] is m in component RyR_channel (dimensionless).
 * STATES[29] is Ca_JSR in component intracellular_ion_concentrations (millimolar).
 * ALGEBRAIC[46] is J_up in component SERCA2a_pump (millimolar_per_second).
 * CONSTANTS[51] is K_fb in component SERCA2a_pump (millimolar).
 * CONSTANTS[52] is K_rb in component SERCA2a_pump (millimolar).
 * ALGEBRAIC[44] is fb in component SERCA2a_pump (dimensionless).
 * ALGEBRAIC[45] is rb in component SERCA2a_pump (dimensionless).
 * CONSTANTS[53] is Vmaxf in component SERCA2a_pump (millimolar_per_second).
 * CONSTANTS[54] is Vmaxr in component SERCA2a_pump (millimolar_per_second).
 * CONSTANTS[55] is K_SR in component SERCA2a_pump (dimensionless).
 * CONSTANTS[56] is N_fb in component SERCA2a_pump (dimensionless).
 * CONSTANTS[57] is N_rb in component SERCA2a_pump (dimensionless).
 * STATES[30] is Ca_NSR in component intracellular_ion_concentrations (millimolar).
 * ALGEBRAIC[47] is J_tr in component intracellular_Ca_fluxes (millimolar_per_second).
 * ALGEBRAIC[48] is J_xfer in component intracellular_Ca_fluxes (millimolar_per_second).
 * STATES[33] is J_trpn in component intracellular_Ca_fluxes (millimolar_per_second).
 * CONSTANTS[58] is tau_tr in component intracellular_Ca_fluxes (second).
 * CONSTANTS[59] is tau_xfer in component intracellular_Ca_fluxes (second).
 * STATES[31] is HTRPNCa in component intracellular_Ca_fluxes (millimolar).
 * STATES[32] is LTRPNCa in component intracellular_Ca_fluxes (millimolar).
 * STATES[34] is J_HTRPNCa in component intracellular_Ca_fluxes (millimolar_per_second).
 * STATES[35] is J_LTRPNCa in component intracellular_Ca_fluxes (millimolar_per_second).
 * CONSTANTS[60] is HTRPN_tot in component intracellular_Ca_fluxes (dimensionless).
 * CONSTANTS[61] is LTRPN_tot in component intracellular_Ca_fluxes (dimensionless).
 * CONSTANTS[62] is k_htrpn_plus in component intracellular_Ca_fluxes (per_millimolar_second).
 * CONSTANTS[63] is k_htrpn_minus in component intracellular_Ca_fluxes (per_second).
 * CONSTANTS[64] is k_ltrpn_plus in component intracellular_Ca_fluxes (per_millimolar_second).
 * CONSTANTS[65] is k_ltrpn_minus in component intracellular_Ca_fluxes (per_second).
 * CONSTANTS[66] is A_cap in component intracellular_ion_concentrations (cm2).
 * CONSTANTS[67] is V_myo in component intracellular_ion_concentrations (micro_litre).
 * CONSTANTS[68] is V_JSR in component intracellular_ion_concentrations (micro_litre).
 * CONSTANTS[69] is V_NSR in component intracellular_ion_concentrations (micro_litre).
 * CONSTANTS[70] is V_SS in component intracellular_ion_concentrations (micro_litre).
 * CONSTANTS[71] is K_mCMDN in component intracellular_ion_concentrations (millimolar).
 * CONSTANTS[72] is K_mEGTA in component intracellular_ion_concentrations (millimolar).
 * CONSTANTS[73] is K_mCSQN in component intracellular_ion_concentrations (millimolar).
 * CONSTANTS[74] is CMDN_tot in component intracellular_ion_concentrations (millimolar).
 * CONSTANTS[75] is EGTA_tot in component intracellular_ion_concentrations (millimolar).
 * CONSTANTS[76] is CSQN_tot in component intracellular_ion_concentrations (millimolar).
 * ALGEBRAIC[49] is beta_i in component intracellular_ion_concentrations (dimensionless).
 * ALGEBRAIC[50] is beta_SS in component intracellular_ion_concentrations (dimensionless).
 * ALGEBRAIC[51] is beta_JSR in component intracellular_ion_concentrations (dimensionless).
 * RATES[0] is d/dt V in component membrane (millivolt).
 * RATES[2] is d/dt m in component fast_sodium_current_m_gate (dimensionless).
 * RATES[3] is d/dt h in component fast_sodium_current_h_gate (dimensionless).
 * RATES[4] is d/dt j in component fast_sodium_current_j_gate (dimensionless).
 * RATES[6] is d/dt X_kr in component rapid_activating_delayed_rectifiyer_K_current_X_kr_gate (dimensionless).
 * RATES[7] is d/dt X_ks in component slow_activating_delayed_rectifiyer_K_current_X_ks_gate (dimensionless).
 * RATES[8] is d/dt X_to1 in component transient_outward_potassium_current_X_to1_gate (dimensionless).
 * RATES[9] is d/dt Y_to1 in component transient_outward_potassium_current_Y_to1_gate (dimensionless).
 * RATES[13] is d/dt C0 in component L_type_Ca_current (dimensionless).
 * RATES[14] is d/dt C1 in component L_type_Ca_current (dimensionless).
 * RATES[15] is d/dt C2 in component L_type_Ca_current (dimensionless).
 * RATES[16] is d/dt C3 in component L_type_Ca_current (dimensionless).
 * RATES[17] is d/dt C4 in component L_type_Ca_current (dimensionless).
 * RATES[11] is d/dt O in component L_type_Ca_current (dimensionless).
 * RATES[18] is d/dt C_Ca0 in component L_type_Ca_current (dimensionless).
 * RATES[19] is d/dt C_Ca1 in component L_type_Ca_current (dimensionless).
 * RATES[20] is d/dt C_Ca2 in component L_type_Ca_current (dimensionless).
 * RATES[21] is d/dt C_Ca3 in component L_type_Ca_current (dimensionless).
 * RATES[22] is d/dt C_Ca4 in component L_type_Ca_current (dimensionless).
 * RATES[12] is d/dt O_Ca in component L_type_Ca_current (dimensionless).
 * RATES[24] is d/dt y in component L_type_Ca_current_y_gate (dimensionless).
 * RATES[27] is d/dt P_C1 in component RyR_channel (dimensionless).
 * RATES[25] is d/dt P_O1 in component RyR_channel (dimensionless).
 * RATES[26] is d/dt P_O2 in component RyR_channel (dimensionless).
 * RATES[28] is d/dt P_C2 in component RyR_channel (dimensionless).
 * RATES[31] is d/dt HTRPNCa in component intracellular_Ca_fluxes (millimolar).
 * RATES[32] is d/dt LTRPNCa in component intracellular_Ca_fluxes (millimolar).
 * RATES[10] is d/dt Cai in component intracellular_ion_concentrations (millimolar).
 * RATES[1] is d/dt Nai in component intracellular_ion_concentrations (millimolar).
 * RATES[5] is d/dt Ki in component intracellular_ion_concentrations (millimolar).
 * RATES[23] is d/dt Ca_ss in component intracellular_ion_concentrations (millimolar).
 * RATES[29] is d/dt Ca_JSR in component intracellular_ion_concentrations (millimolar).
 * RATES[30] is d/dt Ca_NSR in component intracellular_ion_concentrations (millimolar).
 * There are a total of 9 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = -96.1638;
CONSTANTS[0] = 8.314472;
CONSTANTS[1] = 310;
CONSTANTS[2] = 96.4853415;
CONSTANTS[3] = 0.001;
CONSTANTS[4] = 0.1;
CONSTANTS[5] = 100000000;
CONSTANTS[6] = 1;
CONSTANTS[7] = 0.002;
CONSTANTS[8] = -21.1268;
CONSTANTS[9] = 12.8;
CONSTANTS[10] = 138;
STATES[1] = 10;
STATES[2] = 0.0328302;
STATES[3] = 0.988354;
STATES[4] = 0.99254;
CONSTANTS[11] = 0.0034;
CONSTANTS[12] = 4;
STATES[5] = 157.8;
STATES[6] = 0.51;
CONSTANTS[13] = 1;
CONSTANTS[14] = 0.0027134;
STATES[7] = 0.264;
CONSTANTS[15] = 0.23815;
STATES[8] = 2.63;
STATES[9] = 0.99;
CONSTANTS[16] = 2.8;
CONSTANTS[17] = 13;
CONSTANTS[18] = 0.002216;
CONSTANTS[19] = 1.38;
CONSTANTS[20] = 87.5;
CONSTANTS[21] = 0.3;
CONSTANTS[22] = 0.2;
CONSTANTS[23] = 0.35;
STATES[10] = 0.00008;
CONSTANTS[24] = 2;
CONSTANTS[25] = 0.693;
CONSTANTS[26] = 10;
CONSTANTS[27] = 1.5;
CONSTANTS[28] = 0.00005;
CONSTANTS[29] = 0.05;
CONSTANTS[30] = 0.0003842;
CONSTANTS[31] = 0.0031;
CONSTANTS[32] = 3.125e-4;
CONSTANTS[33] = 5.79e-7;
CONSTANTS[34] = -0.265;
STATES[11] = 9.84546e-21;
STATES[12] = 0;
CONSTANTS[35] = 2;
CONSTANTS[36] = 2;
CONSTANTS[37] = 2000;
CONSTANTS[38] = 300;
CONSTANTS[39] = 7000;
CONSTANTS[40] = 7;
CONSTANTS[41] = 10;
STATES[13] = 0.997208;
STATES[14] = 6.38897e-5;
STATES[15] = 1.535e-9;
STATES[16] = 1.63909e-14;
STATES[17] = 6.56337e-20;
STATES[18] = 0.00272826;
STATES[19] = 6.99215e-7;
STATES[20] = 6.71989e-11;
STATES[21] = 2.87031e-15;
STATES[22] = 4.59752e-20;
STATES[23] = 0.00011;
STATES[24] = 0.798;
CONSTANTS[42] = 1800;
CONSTANTS[43] = 1.215e13;
CONSTANTS[44] = 576;
CONSTANTS[45] = 4.05e9;
CONSTANTS[46] = 1930;
CONSTANTS[47] = 100;
CONSTANTS[48] = 0.8;
STATES[25] = 0;
STATES[26] = 0;
STATES[27] = 0.47;
STATES[28] = 0.53;
CONSTANTS[49] = 4;
CONSTANTS[50] = 3;
STATES[29] = 0.257;
CONSTANTS[51] = 0.000168;
CONSTANTS[52] = 3.29;
CONSTANTS[53] = 0.0813;
CONSTANTS[54] = 0.318;
CONSTANTS[55] = 1;
CONSTANTS[56] = 1.2;
CONSTANTS[57] = 1;
STATES[30] = 0.257;
CONSTANTS[58] = 0.0005747;
CONSTANTS[59] = 0.0267;
STATES[31] = 0.98;
STATES[32] = 0.078;
CONSTANTS[60] = 0.14;
CONSTANTS[61] = 0.07;
CONSTANTS[62] = 20000;
CONSTANTS[63] = 0.066;
CONSTANTS[64] = 40000;
CONSTANTS[65] = 40;
CONSTANTS[66] = 0.0001534;
CONSTANTS[67] = 0.00002584;
CONSTANTS[68] = 0.00000016;
CONSTANTS[69] = 0.0000021;
CONSTANTS[70] = 0.0000000012;
CONSTANTS[71] = 0.00238;
CONSTANTS[72] = 0.00015;
CONSTANTS[73] = 0.8;
CONSTANTS[74] = 0.05;
CONSTANTS[75] = 0;
CONSTANTS[76] = 15;
CONSTANTS[77] =  pow((CONSTANTS[12]/4.00000), 1.0 / 2);
CONSTANTS[78] =  (1.00000/7.00000)*(exp(CONSTANTS[10]/67.3000) - 1.00000);
STATES[33] = 0.1001;
STATES[34] = 0.1001;
STATES[35] = 0.1001;
RATES[0] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[4] = 0.1001;
RATES[6] = 0.1001;
RATES[7] = 0.1001;
RATES[8] = 0.1001;
RATES[9] = 0.1001;
RATES[13] = 0.1001;
RATES[14] = 0.1001;
RATES[15] = 0.1001;
RATES[16] = 0.1001;
RATES[17] = 0.1001;
RATES[11] = 0.1001;
RATES[18] = 0.1001;
RATES[19] = 0.1001;
RATES[20] = 0.1001;
RATES[21] = 0.1001;
RATES[22] = 0.1001;
RATES[12] = 0.1001;
RATES[24] = 0.1001;
RATES[27] = 0.1001;
RATES[25] = 0.1001;
RATES[26] = 0.1001;
RATES[28] = 0.1001;
RATES[31] = 0.1001;
RATES[32] = 0.1001;
RATES[10] = 0.1001;
RATES[1] = 0.1001;
RATES[5] = 0.1001;
RATES[23] = 0.1001;
RATES[29] = 0.1001;
RATES[30] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - ( - 1.00000*1.00000*(ALGEBRAIC[2]+ALGEBRAIC[54]+ALGEBRAIC[56]+ALGEBRAIC[12]+ALGEBRAIC[18]+ALGEBRAIC[21]+ALGEBRAIC[52]+ALGEBRAIC[53]+ALGEBRAIC[28]+ALGEBRAIC[30]+ALGEBRAIC[31]+ALGEBRAIC[34]+ALGEBRAIC[33]+ALGEBRAIC[0]))/CONSTANTS[3];
resid[1] = RATES[2] - (CONDVAR[4]>=0.00000 ?  ALGEBRAIC[4]*(1.00000 - STATES[2]) -  ALGEBRAIC[5]*STATES[2] : 0.00000);
resid[2] = RATES[3] -  ALGEBRAIC[6]*(1.00000 - STATES[3]) -  ALGEBRAIC[7]*STATES[3];
resid[3] = RATES[4] -  ALGEBRAIC[8]*(1.00000 - STATES[4]) -  ALGEBRAIC[9]*STATES[4];
resid[4] = RATES[6] - (ALGEBRAIC[15] - STATES[6])/ALGEBRAIC[16];
resid[5] = RATES[7] - (ALGEBRAIC[19] - STATES[7])/ALGEBRAIC[20];
resid[6] = RATES[8] -  ALGEBRAIC[22]*(1.00000 - STATES[8]) -  ALGEBRAIC[23]*STATES[8];
resid[7] = RATES[9] -  ALGEBRAIC[24]*(1.00000 - STATES[9]) -  ALGEBRAIC[25]*STATES[9];
resid[8] = RATES[13] - ( ALGEBRAIC[37]*STATES[14]+ CONSTANTS[41]*STATES[18]) -  ( 4.00000*ALGEBRAIC[36]+ALGEBRAIC[40])*STATES[13];
resid[9] = RATES[14] - ( 4.00000*ALGEBRAIC[36]*STATES[13]+ 2.00000*ALGEBRAIC[37]*STATES[15]+ (CONSTANTS[41]/CONSTANTS[36])*STATES[19]) -  (ALGEBRAIC[37]+ 3.00000*ALGEBRAIC[36]+ ALGEBRAIC[40]*CONSTANTS[35])*STATES[14];
resid[10] = RATES[15] - ( 3.00000*ALGEBRAIC[36]*STATES[14]+ 3.00000*ALGEBRAIC[37]*STATES[16]+ (CONSTANTS[41]/pow(CONSTANTS[36], 2.00000))*STATES[20]) -  ( ALGEBRAIC[37]*2.00000+ 2.00000*ALGEBRAIC[36]+ ALGEBRAIC[40]*pow(CONSTANTS[35], 2.00000))*STATES[15];
resid[11] = RATES[16] - ( 2.00000*ALGEBRAIC[36]*STATES[15]+ 4.00000*ALGEBRAIC[37]*STATES[17]+ (CONSTANTS[41]/pow(CONSTANTS[36], 3.00000))*STATES[21]) -  ( ALGEBRAIC[37]*3.00000+ALGEBRAIC[36]+ ALGEBRAIC[40]*pow(CONSTANTS[35], 3.00000))*STATES[16];
resid[12] = RATES[17] - ( ALGEBRAIC[36]*STATES[16]+ CONSTANTS[37]*STATES[11]+ (CONSTANTS[41]/pow(CONSTANTS[36], 4.00000))*STATES[22]) -  ( ALGEBRAIC[37]*4.00000+CONSTANTS[38]+ ALGEBRAIC[40]*pow(CONSTANTS[35], 4.00000))*STATES[17];
resid[13] = RATES[11] -  CONSTANTS[38]*STATES[17] -  CONSTANTS[37]*STATES[11];
resid[14] = RATES[18] - ( ALGEBRAIC[39]*STATES[19]+ ALGEBRAIC[40]*STATES[13]) -  ( 4.00000*ALGEBRAIC[38]+CONSTANTS[41])*STATES[18];
resid[15] = RATES[19] - ( 4.00000*ALGEBRAIC[38]*STATES[18]+ 2.00000*ALGEBRAIC[39]*STATES[20]+ ALGEBRAIC[40]*CONSTANTS[35]*STATES[14]) -  (ALGEBRAIC[39]+ 3.00000*ALGEBRAIC[38]+CONSTANTS[41]/CONSTANTS[36])*STATES[19];
resid[16] = RATES[20] - ( 3.00000*ALGEBRAIC[38]*STATES[19]+ 3.00000*ALGEBRAIC[39]*STATES[21]+ ALGEBRAIC[40]*pow(CONSTANTS[35], 2.00000)*STATES[15]) -  ( ALGEBRAIC[39]*2.00000+ 2.00000*ALGEBRAIC[38]+CONSTANTS[41]/pow(CONSTANTS[36], 2.00000))*STATES[20];
resid[17] = RATES[21] - ( 2.00000*ALGEBRAIC[38]*STATES[20]+ 4.00000*ALGEBRAIC[39]*STATES[22]+ ALGEBRAIC[40]*pow(CONSTANTS[35], 3.00000)*STATES[16]) -  ( ALGEBRAIC[39]*3.00000+ALGEBRAIC[38]+CONSTANTS[41]/pow(CONSTANTS[36], 3.00000))*STATES[21];
resid[18] = RATES[22] - ( ALGEBRAIC[38]*STATES[21]+ CONSTANTS[39]*STATES[12]+ ALGEBRAIC[40]*pow(CONSTANTS[35], 4.00000)*STATES[17]) -  ( ALGEBRAIC[39]*4.00000+CONSTANTS[40]+CONSTANTS[41]/pow(CONSTANTS[36], 4.00000))*STATES[22];
resid[19] = RATES[12] -  CONSTANTS[40]*STATES[22] -  CONSTANTS[39]*STATES[12];
resid[20] = RATES[24] - (ALGEBRAIC[41] - STATES[24])/ALGEBRAIC[42];
resid[21] = RATES[27] -  - CONSTANTS[43]*pow(STATES[23], CONSTANTS[49])*STATES[27]+ CONSTANTS[44]*STATES[25];
resid[22] = RATES[25] - ( CONSTANTS[43]*pow(STATES[23], CONSTANTS[49])*STATES[27] - ( CONSTANTS[44]*STATES[25]+ CONSTANTS[45]*pow(STATES[23], CONSTANTS[50])*STATES[25]+ CONSTANTS[47]*STATES[25]))+ CONSTANTS[46]*STATES[26]+ CONSTANTS[48]*STATES[28];
resid[23] = RATES[26] -  CONSTANTS[45]*pow(STATES[23], CONSTANTS[50])*STATES[25] -  CONSTANTS[46]*STATES[26];
resid[24] = RATES[28] -  CONSTANTS[47]*STATES[25] -  CONSTANTS[48]*STATES[28];
resid[25] = STATES[33] -  CONSTANTS[60]*STATES[34]+ CONSTANTS[61]*STATES[35];
resid[26] = STATES[34] - RATES[31];
resid[27] = RATES[31] -  CONSTANTS[62]*STATES[10]*(1.00000 - STATES[31]) -  CONSTANTS[63]*STATES[31];
resid[28] = STATES[35] - RATES[32];
resid[29] = RATES[32] -  CONSTANTS[64]*STATES[10]*(1.00000 - STATES[32]) -  CONSTANTS[65]*STATES[32];
resid[30] = RATES[10] -  ALGEBRAIC[49]*((ALGEBRAIC[48] - (ALGEBRAIC[46]+STATES[33]))+( ( 2.00000*ALGEBRAIC[28] - (ALGEBRAIC[31]+ALGEBRAIC[33]))*CONSTANTS[66]*1.00000)/( 2.00000*CONSTANTS[67]*CONSTANTS[2]));
resid[31] = RATES[1] - ( - 0.00000*(ALGEBRAIC[2]+ALGEBRAIC[34]+ ALGEBRAIC[28]*3.00000+ ALGEBRAIC[30]*3.00000)*CONSTANTS[66]*1.00000)/( CONSTANTS[67]*CONSTANTS[2]);
resid[32] = RATES[5] - ( - 0.00000*(ALGEBRAIC[56]+ALGEBRAIC[12]+ALGEBRAIC[18]+ALGEBRAIC[52]+ALGEBRAIC[53]+ALGEBRAIC[21]+ ALGEBRAIC[30]*- 2.00000)*CONSTANTS[66]*1.00000)/( CONSTANTS[67]*CONSTANTS[2]);
resid[33] = RATES[23] -  ALGEBRAIC[50]*((( ALGEBRAIC[43]*CONSTANTS[68])/CONSTANTS[70] - ( ALGEBRAIC[48]*CONSTANTS[67])/CONSTANTS[70]) - ( ALGEBRAIC[54]*CONSTANTS[66]*1.00000)/( 2.00000*CONSTANTS[70]*CONSTANTS[2]));
resid[34] = RATES[29] -  ALGEBRAIC[51]*(ALGEBRAIC[47] - ALGEBRAIC[43]);
resid[35] = RATES[30] - ( ALGEBRAIC[46]*CONSTANTS[67])/CONSTANTS[69] - ( ALGEBRAIC[47]*CONSTANTS[68])/CONSTANTS[69];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = (CONDVAR[0]>=0.00000&&CONDVAR[1]<=0.00000&&CONDVAR[2]<=0.00000 ? CONSTANTS[8] : 0.00000);
ALGEBRAIC[1] =  (( CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2])*log(CONSTANTS[10]/STATES[1]);
ALGEBRAIC[2] =  CONSTANTS[9]*pow(STATES[2], 3.00000)*STATES[3]*STATES[4]*(STATES[0] - ALGEBRAIC[1]);
ALGEBRAIC[3] = STATES[0]+47.1300;
ALGEBRAIC[4] = (CONDVAR[3]<0.00000 ? 1000.00/(0.100000 -  0.00500000*ALGEBRAIC[3]) : ( 320.000*ALGEBRAIC[3])/(1.00000 - exp( - 0.100000*ALGEBRAIC[3])));
ALGEBRAIC[5] =  80.0000*exp(- STATES[0]/11.0000);
ALGEBRAIC[6] = (CONDVAR[5]<0.00000 ?  135.000*exp((80.0000+STATES[0])/- 6.80000) : 0.00000);
ALGEBRAIC[7] = (CONDVAR[6]<0.00000 ?  3560.00*exp( 0.0790000*STATES[0])+ 310000.*exp( 0.350000*STATES[0]) : 1000.00/( 0.130000*(1.00000+exp((STATES[0]+10.6600)/- 11.1000))));
ALGEBRAIC[8] = (CONDVAR[7]<0.00000 ? ( 1000.00*- ( 127140.*exp( 0.244400*STATES[0])+ 3.47400e-05*exp( - 0.0439100*STATES[0]))*(STATES[0]+37.7800))/(1.00000+exp( 0.311000*(STATES[0]+79.2300))) : 0.00000);
ALGEBRAIC[9] = (CONDVAR[8]<0.00000 ? ( 121.200*exp( - 0.0105200*STATES[0]))/(1.00000+exp( - 0.137800*(STATES[0]+40.1400))) : ( 300.000*exp( - 2.53500e-07*STATES[0]))/(1.00000+exp( - 0.100000*(STATES[0]+32.0000))));
ALGEBRAIC[10] =  (( CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2])*log(CONSTANTS[12]/STATES[5]);
ALGEBRAIC[11] = 1.00000/(1.00000+ 1.49450*exp( 0.0446000*STATES[0]));
ALGEBRAIC[12] =  CONSTANTS[11]*CONSTANTS[77]*ALGEBRAIC[11]*STATES[6]*(STATES[0] - ALGEBRAIC[10]);
ALGEBRAIC[13] = exp(- 5.49500+ 0.169100*STATES[0]);
ALGEBRAIC[14] = exp(- 7.67700 -  0.0128000*STATES[0]);
ALGEBRAIC[15] = ALGEBRAIC[13]/(ALGEBRAIC[13]+ALGEBRAIC[14]);
ALGEBRAIC[16] = 0.00100000/(ALGEBRAIC[13]+ALGEBRAIC[14])+ CONSTANTS[13]*0.0270000;
ALGEBRAIC[17] =  (( CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2])*log((CONSTANTS[12]+ 0.0183300*CONSTANTS[10])/(STATES[5]+ 0.0183300*STATES[1]));
ALGEBRAIC[18] =  CONSTANTS[14]*pow(STATES[7], 2.00000)*(STATES[0] - ALGEBRAIC[17]);
ALGEBRAIC[19] = 1.00000/(1.00000+exp(- (STATES[0] - 24.7000)/13.6000));
ALGEBRAIC[20] = 0.00100000/(( 7.19000e-05*(STATES[0] - 10.0000))/(1.00000 - exp( - 0.148000*(STATES[0] - 10.0000)))+( 0.000131000*(STATES[0] - 10.0000))/(exp( 0.0687000*(STATES[0] - 10.0000)) - 1.00000));
ALGEBRAIC[21] =  CONSTANTS[15]*STATES[8]*STATES[9]*(STATES[0] - ALGEBRAIC[10]);
ALGEBRAIC[22] =  45.1600*exp( 0.0357700*STATES[0]);
ALGEBRAIC[23] =  98.9000*exp( - 0.0623700*STATES[0]);
ALGEBRAIC[24] = ( 5.41500*exp(- (STATES[0]+33.5000)/5.00000))/(1.00000+ 0.0513350*exp(- (STATES[0]+33.5000)/5.00000));
ALGEBRAIC[25] = ( 5.41500*exp((STATES[0]+33.5000)/5.00000))/(1.00000+ 0.0513350*exp((STATES[0]+33.5000)/5.00000));
ALGEBRAIC[28] =  (( CONSTANTS[21]*5000.00)/( (pow(CONSTANTS[20], 3.00000)+pow(CONSTANTS[10], 3.00000))*(CONSTANTS[19]+CONSTANTS[24])*(1.00000+ CONSTANTS[22]*exp(( (CONSTANTS[23] - 1.00000)*STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])))))*( exp(( CONSTANTS[23]*STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))*pow(STATES[1], 3.00000)*CONSTANTS[24] -  exp(( (CONSTANTS[23] - 1.00000)*STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))*pow(CONSTANTS[10], 3.00000)*STATES[10]);
ALGEBRAIC[29] = 1.00000/(1.00000+ 0.124500*exp(( - 0.100000*STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))+ 0.0365000*CONSTANTS[78]*exp(( - STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])));
ALGEBRAIC[30] = ( (( CONSTANTS[25]*ALGEBRAIC[29])/(1.00000+pow(CONSTANTS[26]/STATES[1], 1.50000)))*CONSTANTS[12])/(CONSTANTS[12]+CONSTANTS[27]);
ALGEBRAIC[31] = ( CONSTANTS[29]*STATES[10])/(CONSTANTS[28]+STATES[10]);
ALGEBRAIC[32] =  (( CONSTANTS[0]*CONSTANTS[1])/( 2.00000*CONSTANTS[2]))*log(CONSTANTS[24]/STATES[10]);
ALGEBRAIC[33] =  CONSTANTS[30]*(STATES[0] - ALGEBRAIC[32]);
ALGEBRAIC[34] =  CONSTANTS[31]*(STATES[0] - ALGEBRAIC[1]);
ALGEBRAIC[36] =  400.000*exp((STATES[0]+2.00000)/10.0000);
ALGEBRAIC[37] =  50.0000*exp(- (STATES[0]+2.00000)/13.0000);
ALGEBRAIC[38] =  ALGEBRAIC[36]*CONSTANTS[35];
ALGEBRAIC[39] = ALGEBRAIC[37]/CONSTANTS[36];
ALGEBRAIC[40] = ( 103.750*STATES[23])/1.00000;
ALGEBRAIC[41] = 0.800000/(1.00000+exp((STATES[0]+12.5000)/5.00000))+0.200000;
ALGEBRAIC[42] = (20.0000+600.000/(1.00000+exp((STATES[0]+20.0000)/9.50000)))/1000.00;
ALGEBRAIC[43] =  CONSTANTS[42]*(STATES[25]+STATES[26])*(STATES[29] - STATES[23]);
ALGEBRAIC[44] = pow(STATES[10]/CONSTANTS[51], CONSTANTS[56]);
ALGEBRAIC[45] = pow(STATES[30]/CONSTANTS[52], CONSTANTS[57]);
ALGEBRAIC[46] = ( CONSTANTS[55]*( CONSTANTS[53]*ALGEBRAIC[44] -  CONSTANTS[54]*ALGEBRAIC[45]))/(1.00000+ALGEBRAIC[44]+ALGEBRAIC[45]);
ALGEBRAIC[47] = (STATES[30] - STATES[29])/CONSTANTS[58];
ALGEBRAIC[48] = (STATES[23] - STATES[10])/CONSTANTS[59];
ALGEBRAIC[49] = 1.00000/(1.00000+( CONSTANTS[74]*CONSTANTS[71])/pow(CONSTANTS[71]+STATES[10], 2.00000)+( CONSTANTS[75]*CONSTANTS[72])/pow(CONSTANTS[72]+STATES[10], 2.00000));
ALGEBRAIC[50] = 1.00000/(1.00000+( CONSTANTS[74]*CONSTANTS[71])/pow(CONSTANTS[71]+STATES[23], 2.00000)+( CONSTANTS[75]*CONSTANTS[72])/pow(CONSTANTS[72]+STATES[23], 2.00000));
ALGEBRAIC[51] = 1.00000/(1.00000+( CONSTANTS[76]*CONSTANTS[73])/pow(CONSTANTS[73]+STATES[29], 2.00000));
ALGEBRAIC[26] = 1.00000/(2.00000+exp( (( 1.50000*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))*(STATES[0] - ALGEBRAIC[10])));
ALGEBRAIC[52] =  (( CONSTANTS[16]*ALGEBRAIC[26]*CONSTANTS[12])/(CONSTANTS[12]+CONSTANTS[17]))*(STATES[0] - ALGEBRAIC[10]);
ALGEBRAIC[27] = 1.00000/(1.00000+exp((7.48800 - STATES[0])/5.98000));
ALGEBRAIC[53] =  CONSTANTS[18]*ALGEBRAIC[27]*(STATES[0] - ALGEBRAIC[10]);
ALGEBRAIC[35] = ( (( (CONSTANTS[32]/( 1.00000*1.00000))*4.00000*STATES[0]*pow(CONSTANTS[2], 2.00000)*1000.00)/( CONSTANTS[0]*CONSTANTS[1]))*( 0.00100000*exp(( 2.00000*STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) -  0.341000*CONSTANTS[24]))/(exp(( 2.00000*STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) - 1.00000);
ALGEBRAIC[54] =  ALGEBRAIC[35]*STATES[24]*(STATES[11]+STATES[12]);
ALGEBRAIC[55] = CONSTANTS[33]/(1.00000+ALGEBRAIC[35]/CONSTANTS[34]);
ALGEBRAIC[56] = ( (( (ALGEBRAIC[55]/( 1.00000*1.00000))*STATES[24]*(STATES[11]+STATES[12])*STATES[0]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1]))*( STATES[5]*exp(( STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) - CONSTANTS[12]))/(exp(( STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) - 1.00000);
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
SI[1] = 1.0;
SI[2] = 1.0;
SI[3] = 1.0;
SI[4] = 1.0;
SI[5] = 1.0;
SI[6] = 1.0;
SI[7] = 1.0;
SI[8] = 1.0;
SI[9] = 1.0;
SI[10] = 1.0;
SI[11] = 1.0;
SI[12] = 1.0;
SI[13] = 1.0;
SI[14] = 1.0;
SI[15] = 1.0;
SI[16] = 1.0;
SI[17] = 1.0;
SI[18] = 1.0;
SI[19] = 1.0;
SI[20] = 1.0;
SI[21] = 1.0;
SI[22] = 1.0;
SI[23] = 1.0;
SI[24] = 1.0;
SI[25] = 1.0;
SI[26] = 1.0;
SI[27] = 1.0;
SI[28] = 1.0;
SI[29] = 1.0;
SI[30] = 1.0;
SI[33] = 0.0;
SI[31] = 1.0;
SI[32] = 1.0;
SI[34] = 0.0;
SI[35] = 0.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
CONDVAR[0] = VOI - CONSTANTS[4];
CONDVAR[1] = VOI - CONSTANTS[5];
CONDVAR[2] = ((VOI - CONSTANTS[4]) -  floor((VOI - CONSTANTS[4])/CONSTANTS[6])*CONSTANTS[6]) - CONSTANTS[7];
CONDVAR[3] = fabs(ALGEBRAIC[3]) - 1.00000e-05;
CONDVAR[4] = STATES[0] - - 90.0000;
CONDVAR[5] = STATES[0] - - 40.0000;
CONDVAR[6] = STATES[0] - - 40.0000;
CONDVAR[7] = STATES[0] - - 40.0000;
CONDVAR[8] = STATES[0] - - 40.0000;
}