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 120 entries in the algebraic variable array.
   There are a total of 46 entries in each of the rate and state variable arrays.
   There are a total of 99 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (ms).
 * CONSTANTS[0] is F in component model_parameters (C_per_mole).
 * CONSTANTS[1] is T in component model_parameters (kelvin).
 * CONSTANTS[2] is R in component model_parameters (J_per_kmole_K).
 * CONSTANTS[3] is K_o in component model_parameters (mM).
 * CONSTANTS[4] is Ca_o in component model_parameters (mM).
 * CONSTANTS[5] is Na_o in component model_parameters (mM).
 * CONSTANTS[6] is Cl_o in component model_parameters (mM).
 * CONSTANTS[93] is Vmyo in component cell_geometry (uL).
 * CONSTANTS[94] is Vnsr in component cell_geometry (uL).
 * CONSTANTS[89] is Vsr in component cell_geometry (uL).
 * CONSTANTS[95] is Vjsr in component cell_geometry (uL).
 * CONSTANTS[96] is Vss_sr in component cell_geometry (uL).
 * CONSTANTS[97] is Vss_CaL in component cell_geometry (uL).
 * CONSTANTS[91] is Acap in component cell_geometry (cm2).
 * CONSTANTS[92] is AF in component cell_geometry (uF_mole_per_C).
 * CONSTANTS[7] is l in component cell_geometry (cm).
 * CONSTANTS[8] is a in component cell_geometry (cm).
 * CONSTANTS[86] is vcell in component cell_geometry (uL).
 * CONSTANTS[90] is ageo in component cell_geometry (cm2).
 * STATES[0] is Vm in component membrane (mV).
 * ALGEBRAIC[1] is i_Stim in component membrane (uA_per_uF).
 * CONSTANTS[9] is stim_offset in component membrane (ms).
 * CONSTANTS[10] is stim_period in component membrane (ms).
 * CONSTANTS[11] is stim_duration in component membrane (ms).
 * CONSTANTS[12] is stim_amplitude in component membrane (uA_per_uF).
 * ALGEBRAIC[0] is past in component membrane (ms).
 * ALGEBRAIC[107] is caiont in component membrane (uA_per_uF).
 * ALGEBRAIC[108] is naiont in component membrane (uA_per_uF).
 * ALGEBRAIC[109] is kiont in component membrane (uA_per_uF).
 * ALGEBRAIC[110] is clont in component membrane (uA_per_uF).
 * ALGEBRAIC[94] is INa in component INa (uA_per_uF).
 * ALGEBRAIC[92] is ICaL in component ICaL (uA_per_uF).
 * ALGEBRAIC[99] is IK1 in component IK1 (uA_per_uF).
 * ALGEBRAIC[96] is IKp in component IKp (uA_per_uF).
 * ALGEBRAIC[91] is IKs in component IKs (uA_per_uF).
 * ALGEBRAIC[100] is IKr in component IKr (uA_per_uF).
 * ALGEBRAIC[48] is IpCa in component IpCa (uA_per_uF).
 * ALGEBRAIC[49] is ICab in component ICab (uA_per_uF).
 * ALGEBRAIC[46] is INaCa in component INaCa (uA_per_uF).
 * ALGEBRAIC[44] is INaCa_ss_sr in component INaCa (uA_per_uF).
 * ALGEBRAIC[95] is INaK in component INaK (uA_per_uF).
 * ALGEBRAIC[101] is Ito1 in component Ito1 (uA_per_uF).
 * ALGEBRAIC[102] is Ito2 in component Ito2 (uA_per_uF).
 * ALGEBRAIC[97] is IClb in component IClb (uA_per_uF).
 * ALGEBRAIC[98] is INaL in component INaL (uA_per_uF).
 * ALGEBRAIC[51] is INab in component INab (uA_per_uF).
 * ALGEBRAIC[2] is gKs in component IKs (mS_per_uF).
 * CONSTANTS[13] is gKs_max in component IKs (mS_per_uF).
 * STATES[1] is C1 in component IKs (dimensionless).
 * STATES[2] is C2 in component IKs (dimensionless).
 * STATES[3] is C3 in component IKs (dimensionless).
 * STATES[4] is C4 in component IKs (dimensionless).
 * STATES[5] is C5 in component IKs (dimensionless).
 * STATES[6] is C6 in component IKs (dimensionless).
 * STATES[7] is C7 in component IKs (dimensionless).
 * STATES[8] is C8 in component IKs (dimensionless).
 * STATES[9] is C9 in component IKs (dimensionless).
 * STATES[10] is C10 in component IKs (dimensionless).
 * STATES[11] is C11 in component IKs (dimensionless).
 * STATES[12] is C12 in component IKs (dimensionless).
 * STATES[13] is C13 in component IKs (dimensionless).
 * STATES[14] is C14 in component IKs (dimensionless).
 * STATES[15] is C15 in component IKs (dimensionless).
 * STATES[16] is O1 in component IKs (dimensionless).
 * ALGEBRAIC[3] is O2 in component IKs (dimensionless).
 * ALGEBRAIC[4] is OKs in component IKs (dimensionless).
 * ALGEBRAIC[5] is alpha in component IKs (per_ms).
 * ALGEBRAIC[6] is beta in component IKs (per_ms).
 * ALGEBRAIC[8] is delta in component IKs (per_ms).
 * ALGEBRAIC[7] is gamma in component IKs (per_ms).
 * ALGEBRAIC[9] is eta in component IKs (per_ms).
 * CONSTANTS[85] is theta in component IKs (per_ms).
 * ALGEBRAIC[10] is omega in component IKs (per_ms).
 * ALGEBRAIC[11] is psi in component IKs (per_ms).
 * ALGEBRAIC[57] is EKs in component reversal_potentials (mV).
 * STATES[17] is Ca_i in component Ca (mM).
 * ALGEBRAIC[13] is ICaL_max in component ICaL (uA_per_uF).
 * CONSTANTS[14] is PCa in component ICaL (L_per_F_ms).
 * STATES[18] is C in component ICaL (dimensionless).
 * STATES[19] is O in component ICaL (dimensionless).
 * STATES[20] is C_star in component ICaL (dimensionless).
 * STATES[21] is O_star in component ICaL (dimensionless).
 * STATES[22] is CI in component ICaL (dimensionless).
 * STATES[23] is OI in component ICaL (dimensionless).
 * STATES[24] is CI_star in component ICaL (dimensionless).
 * ALGEBRAIC[12] is OI_star in component ICaL (dimensionless).
 * ALGEBRAIC[14] is ACT_tau in component ICaL (ms).
 * ALGEBRAIC[19] is IV_tau in component ICaL (ms).
 * ALGEBRAIC[111] is IV_tau_star in component ICaL (ms).
 * ALGEBRAIC[15] is ACT_infinity in component ICaL (dimensionless).
 * ALGEBRAIC[18] is IV_infinity in component ICaL (dimensionless).
 * ALGEBRAIC[22] is IV_infinity_star in component ICaL (dimensionless).
 * ALGEBRAIC[93] is IV_beta_star in component ICaL (dimensionless).
 * ALGEBRAIC[23] is IV_beta_infinity_star in component ICaL (dimensionless).
 * ALGEBRAIC[16] is alpha in component ICaL (per_ms).
 * ALGEBRAIC[17] is beta in component ICaL (per_ms).
 * ALGEBRAIC[24] is delta in component ICaL (per_ms).
 * ALGEBRAIC[20] is x in component ICaL (per_ms).
 * ALGEBRAIC[21] is y in component ICaL (per_ms).
 * CONSTANTS[15] is theta in component ICaL (per_ms).
 * ALGEBRAIC[114] is delta_I in component ICaL (per_ms).
 * ALGEBRAIC[112] is x_star in component ICaL (per_ms).
 * ALGEBRAIC[113] is y_star in component ICaL (per_ms).
 * CONSTANTS[16] is theta_I in component ICaL (per_ms).
 * CONSTANTS[17] is gamma_Cai in component ICaL (dimensionless).
 * CONSTANTS[18] is gamma_Cao in component ICaL (dimensionless).
 * STATES[25] is Ca_ss_CaL in component Ca (mM).
 * CONSTANTS[19] is g_Na in component INa (mS_per_uF).
 * ALGEBRAIC[55] is ENa in component reversal_potentials (mV).
 * STATES[26] is m in component INa_m_gate (dimensionless).
 * STATES[27] is h in component INa_h_gate (dimensionless).
 * STATES[28] is j in component INa_j_gate (dimensionless).
 * ALGEBRAIC[25] is am in component INa_m_gate (per_ms).
 * ALGEBRAIC[26] is bm in component INa_m_gate (per_ms).
 * ALGEBRAIC[27] is ah in component INa_h_gate (per_ms).
 * ALGEBRAIC[28] is bh in component INa_h_gate (per_ms).
 * ALGEBRAIC[29] is aj in component INa_j_gate (per_ms).
 * ALGEBRAIC[30] is bj in component INa_j_gate (per_ms).
 * CONSTANTS[20] is kmnai in component INaK (mM).
 * CONSTANTS[21] is kmko in component INaK (mM).
 * CONSTANTS[22] is ibarnak in component INaK (uA_per_uF).
 * CONSTANTS[23] is sigma in component INaK (dimensionless).
 * CONSTANTS[24] is V_half in component INaK (mV).
 * ALGEBRAIC[31] is phi in component INaK (dimensionless).
 * ALGEBRAIC[32] is fv in component INaK (dimensionless).
 * CONSTANTS[98] is PK in component INaK (dimensionless).
 * ALGEBRAIC[33] is PNa in component INaK (dimensionless).
 * STATES[29] is Na_i in component Na (mM).
 * ALGEBRAIC[45] is INaCa_cai in component INaCa (uA_per_uF).
 * CONSTANTS[25] is KmCa_act in component INaCa (mM).
 * CONSTANTS[26] is Vmax in component INaCa (uA_per_uF).
 * CONSTANTS[27] is ksat in component INaCa (dimensionless).
 * CONSTANTS[28] is eta in component INaCa (dimensionless).
 * CONSTANTS[29] is KmNai in component INaCa (mM).
 * CONSTANTS[30] is KmNao in component INaCa (mM).
 * CONSTANTS[31] is KmCai in component INaCa (mM).
 * CONSTANTS[32] is KmCao in component INaCa (mM).
 * STATES[30] is Ca_ss_sr in component Ca (mM).
 * STATES[31] is Na_ss_sr in component Na (mM).
 * ALGEBRAIC[34] is numerator in component INaCa (mM4_uA_per_uF).
 * ALGEBRAIC[39] is num_ss in component INaCa (mM4_uA_per_uF).
 * ALGEBRAIC[35] is denom_1 in component INaCa (dimensionless).
 * ALGEBRAIC[36] is denom_2 in component INaCa (dimensionless).
 * ALGEBRAIC[37] is denom_3 in component INaCa (mM4).
 * ALGEBRAIC[38] is denom_4 in component INaCa (mM4).
 * ALGEBRAIC[40] is denom_ss_1 in component INaCa (dimensionless).
 * ALGEBRAIC[41] is denom_ss_2 in component INaCa (dimensionless).
 * ALGEBRAIC[42] is denom_ss_3 in component INaCa (mM4).
 * ALGEBRAIC[43] is denom_ss_4 in component INaCa (mM4).
 * CONSTANTS[33] is gKp in component IKp (mS_per_uF).
 * ALGEBRAIC[47] is Kp in component IKp (dimensionless).
 * ALGEBRAIC[56] is EK in component reversal_potentials (mV).
 * CONSTANTS[34] is gpCa in component IpCa (uA_per_uF).
 * CONSTANTS[35] is KmpCa in component IpCa (mM).
 * CONSTANTS[36] is PCab in component ICab (L_per_F_ms).
 * CONSTANTS[37] is gamma_Ca_i in component ICab (dimensionless).
 * CONSTANTS[38] is gamma_Ca_o in component ICab (dimensionless).
 * CONSTANTS[39] is PNab in component INab (L_per_F_ms).
 * ALGEBRAIC[50] is phi in component INab (dimensionless).
 * CONSTANTS[40] is gClb in component IClb (mS_per_uF).
 * ALGEBRAIC[58] is ECl in component reversal_potentials (mV).
 * CONSTANTS[41] is gNaL in component INaL (mS_per_uF).
 * STATES[32] is mL in component INaL_mL_gate (dimensionless).
 * STATES[33] is hL in component INaL_hL_gate (dimensionless).
 * ALGEBRAIC[52] is amL in component INaL_mL_gate (per_ms).
 * ALGEBRAIC[53] is bmL in component INaL_mL_gate (per_ms).
 * CONSTANTS[42] is tau_hL in component INaL_hL_gate (ms).
 * ALGEBRAIC[54] is hL_infinity in component INaL_hL_gate (dimensionless).
 * CONSTANTS[43] is prnak in component reversal_potentials (dimensionless).
 * STATES[34] is K_i in component K (mM).
 * STATES[35] is Cl_i in component Cl (mM).
 * CONSTANTS[44] is g_K1_max in component IK1 (mS_per_uF).
 * CONSTANTS[87] is gK1 in component IK1 (mS_per_uF).
 * ALGEBRAIC[61] is K1 in component IK1_K1_gate (dimensionless).
 * ALGEBRAIC[59] is alpha_k1 in component IK1_K1_gate (dimensionless).
 * ALGEBRAIC[60] is beta_k1 in component IK1_K1_gate (dimensionless).
 * ALGEBRAIC[62] is CT_Na_Cl in component CT_Na_Cl (mM_per_ms).
 * CONSTANTS[45] is CT_Na_Cl_max in component CT_Na_Cl (mM_per_ms).
 * ALGEBRAIC[63] is CT_K_Cl in component CT_K_Cl (mM_per_ms).
 * CONSTANTS[46] is CT_K_Cl_max in component CT_K_Cl (mM_per_ms).
 * CONSTANTS[88] is gKr in component IKr (mS_per_uF).
 * CONSTANTS[47] is gKr_max in component IKr (mS_per_uF).
 * ALGEBRAIC[66] is r in component IKr_r_gate (dimensionless).
 * STATES[36] is xr in component IKr_xr_gate (dimensionless).
 * ALGEBRAIC[64] is xr_infinity in component IKr_xr_gate (dimensionless).
 * ALGEBRAIC[65] is tau_xr in component IKr_xr_gate (ms).
 * CONSTANTS[48] is gto1 in component Ito1 (mS_per_uF).
 * ALGEBRAIC[67] is rto1 in component Ito1 (dimensionless).
 * STATES[37] is a in component Ito1_a_gate (dimensionless).
 * STATES[38] is i1f in component Ito1_i1f_gate (dimensionless).
 * STATES[39] is i1s in component Ito1_i1s_gate (dimensionless).
 * ALGEBRAIC[68] is alpha_a in component Ito1_a_gate (per_ms).
 * ALGEBRAIC[69] is beta_a in component Ito1_a_gate (per_ms).
 * ALGEBRAIC[70] is tau_a in component Ito1_a_gate (ms).
 * ALGEBRAIC[71] is a_infinity in component Ito1_a_gate (dimensionless).
 * ALGEBRAIC[73] is alpha_i1f in component Ito1_i1f_gate (per_ms).
 * ALGEBRAIC[72] is beta_i1f in component Ito1_i1f_gate (per_ms).
 * ALGEBRAIC[75] is alpha_i1s in component Ito1_i1s_gate (per_ms).
 * ALGEBRAIC[74] is beta_i1s in component Ito1_i1s_gate (per_ms).
 * CONSTANTS[49] is PCl in component Ito2 (L_per_F_ms).
 * CONSTANTS[50] is zCl in component Ito2 (dimensionless).
 * ALGEBRAIC[76] is Ito2_max in component Ito2 (uA_per_uF).
 * CONSTANTS[51] is Ito2_max_scaling_factor in component Ito2 (dimensionless).
 * ALGEBRAIC[77] is KCa_ito2 in component Ito2 (dimensionless).
 * CONSTANTS[52] is kCa_ito2 in component Ito2 (mM_per_ms).
 * STATES[40] is Irel in component Irel (mM_per_ms).
 * STATES[41] is i2f in component Ito2_i2f_gate (dimensionless).
 * ALGEBRAIC[79] is alpha_i2f in component Ito2_i2f_gate (per_ms).
 * ALGEBRAIC[78] is beta_i2f in component Ito2_i2f_gate (per_ms).
 * ALGEBRAIC[103] is i2f_infinity in component Ito2_i2f_gate (dimensionless).
 * CONSTANTS[53] is tau_i2f in component Ito2_i2f_gate (ms).
 * ALGEBRAIC[119] is rel_infinity in component Irel (mM_per_ms).
 * ALGEBRAIC[116] is tau_rel in component Irel (ms).
 * CONSTANTS[54] is Krel_infinity in component Irel (mM).
 * ALGEBRAIC[118] is alpha_rel in component Irel (mM_per_uA_per_uF_per_ms).
 * ALGEBRAIC[115] is beta_tau in component Irel (ms).
 * CONSTANTS[55] is beta_0 in component Irel (ms).
 * CONSTANTS[56] is kappa in component Irel (mM_per_uA_per_uF_per_ms_per_ms).
 * CONSTANTS[57] is h_rel in component Irel (dimensionless).
 * CONSTANTS[58] is h_beta in component Irel (dimensionless).
 * ALGEBRAIC[104] is delta_beta_CaMK in component Irel (dimensionless).
 * CONSTANTS[59] is delta_beta_0 in component Irel (dimensionless).
 * CONSTANTS[60] is K_beta in component Irel (mM).
 * CONSTANTS[61] is Krel_tau in component Irel (mM).
 * STATES[42] is Ca_JSR in component Ca (mM).
 * ALGEBRAIC[90] is CaMK_active in component CaMK_active (dimensionless).
 * ALGEBRAIC[117] is Iup in component Iup (mM_per_ms).
 * CONSTANTS[62] is kmup in component Iup (mM).
 * ALGEBRAIC[106] is delta_kmPLB in component Iup (mM).
 * CONSTANTS[63] is delta_kmPLB_bar in component Iup (mM).
 * CONSTANTS[64] is iupbar in component Iup (mM_per_ms).
 * ALGEBRAIC[105] is delta_iupCaMK in component Iup (dimensionless).
 * CONSTANTS[65] is delta_iupCaMK_bar in component Iup (dimensionless).
 * CONSTANTS[66] is kmCaMK in component Iup (mM).
 * ALGEBRAIC[80] is Ileak in component Ileak (mM_per_ms).
 * CONSTANTS[67] is nsrbar in component Ileak (mM).
 * STATES[43] is Ca_NSR in component Ca (mM).
 * ALGEBRAIC[81] is Itr in component Itr (mM_per_ms).
 * CONSTANTS[68] is tautr in component Itr (ms).
 * CONSTANTS[69] is tau_diff in component Ca (ms).
 * CONSTANTS[70] is tau_diff_ss in component Ca (ms).
 * ALGEBRAIC[82] is Idiff in component Ca (mM_per_ms).
 * ALGEBRAIC[83] is Idiff_ss in component Ca (mM_per_ms).
 * ALGEBRAIC[84] is bmyo in component Ca (dimensionless).
 * ALGEBRAIC[85] is bss_sr in component Ca (dimensionless).
 * ALGEBRAIC[86] is bss_cal in component Ca (dimensionless).
 * ALGEBRAIC[87] is bcsqn in component Ca (dimensionless).
 * CONSTANTS[71] is cmdn_bar in component Ca (mM).
 * CONSTANTS[72] is trpn_bar in component Ca (mM).
 * CONSTANTS[73] is km_cmdn in component Ca (mM).
 * CONSTANTS[74] is km_trpn in component Ca (mM).
 * CONSTANTS[75] is kmcsqn in component Ca (mM).
 * CONSTANTS[76] is csqnbar in component Ca (mM).
 * CONSTANTS[77] is BSRmax in component Ca (mM).
 * CONSTANTS[78] is KmBSR in component Ca (mM).
 * CONSTANTS[79] is BSLmax in component Ca (mM).
 * CONSTANTS[80] is KmBSL in component Ca (mM).
 * ALGEBRAIC[88] is Idiff_Na in component Na (mM_per_ms).
 * STATES[44] is Cl_ss in component Cl (mM).
 * ALGEBRAIC[89] is Idiff_Cl in component Cl (mM_per_ms).
 * CONSTANTS[81] is Km in component CaMK_active (mM).
 * STATES[45] is CaMK_trap in component CaMK_active (dimensionless).
 * CONSTANTS[82] is alpha_CaMK in component CaMK_active (per_ms).
 * CONSTANTS[83] is beta_CaMK in component CaMK_active (per_ms).
 * CONSTANTS[84] is CaMK_0 in component CaMK_active (dimensionless).
 * RATES[0] is d/dt Vm in component membrane (mV).
 * RATES[1] is d/dt C1 in component IKs (dimensionless).
 * RATES[2] is d/dt C2 in component IKs (dimensionless).
 * RATES[3] is d/dt C3 in component IKs (dimensionless).
 * RATES[4] is d/dt C4 in component IKs (dimensionless).
 * RATES[5] is d/dt C5 in component IKs (dimensionless).
 * RATES[6] is d/dt C6 in component IKs (dimensionless).
 * RATES[7] is d/dt C7 in component IKs (dimensionless).
 * RATES[8] is d/dt C8 in component IKs (dimensionless).
 * RATES[9] is d/dt C9 in component IKs (dimensionless).
 * RATES[10] is d/dt C10 in component IKs (dimensionless).
 * RATES[11] is d/dt C11 in component IKs (dimensionless).
 * RATES[12] is d/dt C12 in component IKs (dimensionless).
 * RATES[13] is d/dt C13 in component IKs (dimensionless).
 * RATES[14] is d/dt C14 in component IKs (dimensionless).
 * RATES[15] is d/dt C15 in component IKs (dimensionless).
 * RATES[16] is d/dt O1 in component IKs (dimensionless).
 * RATES[18] is d/dt C in component ICaL (dimensionless).
 * RATES[19] is d/dt O in component ICaL (dimensionless).
 * RATES[20] is d/dt C_star in component ICaL (dimensionless).
 * RATES[21] is d/dt O_star in component ICaL (dimensionless).
 * RATES[22] is d/dt CI in component ICaL (dimensionless).
 * RATES[23] is d/dt OI in component ICaL (dimensionless).
 * RATES[24] is d/dt CI_star in component ICaL (dimensionless).
 * RATES[26] is d/dt m in component INa_m_gate (dimensionless).
 * RATES[27] is d/dt h in component INa_h_gate (dimensionless).
 * RATES[28] is d/dt j in component INa_j_gate (dimensionless).
 * RATES[32] is d/dt mL in component INaL_mL_gate (dimensionless).
 * RATES[33] is d/dt hL in component INaL_hL_gate (dimensionless).
 * RATES[36] is d/dt xr in component IKr_xr_gate (dimensionless).
 * RATES[37] is d/dt a in component Ito1_a_gate (dimensionless).
 * RATES[38] is d/dt i1f in component Ito1_i1f_gate (dimensionless).
 * RATES[39] is d/dt i1s in component Ito1_i1s_gate (dimensionless).
 * RATES[41] is d/dt i2f in component Ito2_i2f_gate (dimensionless).
 * RATES[40] is d/dt Irel in component Irel (mM_per_ms).
 * RATES[17] is d/dt Ca_i in component Ca (mM).
 * RATES[30] is d/dt Ca_ss_sr in component Ca (mM).
 * RATES[25] is d/dt Ca_ss_CaL in component Ca (mM).
 * RATES[43] is d/dt Ca_NSR in component Ca (mM).
 * RATES[42] is d/dt Ca_JSR in component Ca (mM).
 * RATES[29] is d/dt Na_i in component Na (mM).
 * RATES[31] is d/dt Na_ss_sr in component Na (mM).
 * RATES[35] is d/dt Cl_i in component Cl (mM).
 * RATES[44] is d/dt Cl_ss in component Cl (mM).
 * RATES[34] is d/dt K_i in component K (mM).
 * RATES[45] is d/dt CaMK_trap in component CaMK_active (dimensionless).
 * There are a total of 6 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 96485;
CONSTANTS[1] = 310;
CONSTANTS[2] = 8314;
CONSTANTS[3] = 5.4;
CONSTANTS[4] = 1.8;
CONSTANTS[5] = 140;
CONSTANTS[6] = 100;
CONSTANTS[7] = 0.01;
CONSTANTS[8] = 0.0011;
STATES[0] = -87.4947322902196;
CONSTANTS[9] = 0;
CONSTANTS[10] = 1000;
CONSTANTS[11] = 0.5;
CONSTANTS[12] = -80;
CONSTANTS[13] = 0.0826;
STATES[1] = 0.476679784307081;
STATES[2] = 0.255181042718489;
STATES[3] = 0.0512272866698557;
STATES[4] = 0.0045705849736195;
STATES[5] = 0.000152923243503507;
STATES[6] = 0.132814156809568;
STATES[7] = 0.053324572164618;
STATES[8] = 0.00713656414955778;
STATES[9] = 0.000318368292970148;
STATES[10] = 0.0138769647384953;
STATES[11] = 0.00371438476499172;
STATES[12] = 0.000248553788631871;
STATES[13] = 0.000644426171899078;
STATES[14] = 8.62495047666861e-5;
STATES[15] = 1.12344645485893e-5;
STATES[16] = 1.05292905767805e-5;
STATES[17] = 8.38749860095482e-5;
CONSTANTS[14] = 0.00015552;
STATES[18] = 0.99996982093287;
STATES[19] = 2.26882961412491e-5;
STATES[20] = 7.49117189549873e-6;
STATES[21] = 1.23556404128518e-10;
STATES[22] = 5.89853003114132e-11;
STATES[23] = 8.01952813127322e-17;
STATES[24] = 1.9237001017021e-9;
CONSTANTS[15] = 1;
CONSTANTS[16] = 1e-6;
CONSTANTS[17] = 1;
CONSTANTS[18] = 0.341;
STATES[25] = 0.000119239795531548;
CONSTANTS[19] = 9.075;
STATES[26] = 0.00101841101248412;
STATES[27] = 0.991354143386887;
STATES[28] = 0.99709036251243;
CONSTANTS[20] = 2.6;
CONSTANTS[21] = 1.5;
CONSTANTS[22] = 1.4;
CONSTANTS[23] = 1;
CONSTANTS[24] = -92;
STATES[29] = 8.01031392415197;
CONSTANTS[25] = 0.000125;
CONSTANTS[26] = 4.5;
CONSTANTS[27] = 0.32;
CONSTANTS[28] = 0.27;
CONSTANTS[29] = 12.3;
CONSTANTS[30] = 87.5;
CONSTANTS[31] = 0.0036;
CONSTANTS[32] = 1.3;
STATES[30] = 0.00011296707102434;
STATES[31] = 8.01033434859049;
CONSTANTS[33] = 0.00276;
CONSTANTS[34] = 0.0575;
CONSTANTS[35] = 0.0005;
CONSTANTS[36] = 1.99508e-7;
CONSTANTS[37] = 1;
CONSTANTS[38] = 0.341;
CONSTANTS[39] = 3.2e-9;
CONSTANTS[40] = 0.000225;
CONSTANTS[41] = 0.0065;
STATES[32] = 0.00101841101248412;
STATES[33] = 0.319611809402137;
CONSTANTS[42] = 600;
CONSTANTS[43] = 0.01833;
STATES[34] = 144.907134343314;
STATES[35] = 20.6683603724432;
CONSTANTS[44] = 0.5;
CONSTANTS[45] = 2.46108e-5;
CONSTANTS[46] = 1.77e-5;
CONSTANTS[47] = 0.0138542;
STATES[36] = 4.06959064407486e-6;
CONSTANTS[48] = 0.497458;
STATES[37] = 1.76776038804228e-5;
STATES[38] = 0.997976503910799;
STATES[39] = 0.947581184798815;
CONSTANTS[49] = 9e-7;
CONSTANTS[50] = -1;
CONSTANTS[51] = 1;
CONSTANTS[52] = 0.4;
STATES[40] = 0.000714227102027745;
STATES[41] = 0.996044894628276;
CONSTANTS[53] = 8;
CONSTANTS[54] = 1;
CONSTANTS[55] = 4.75;
CONSTANTS[56] = 0.1125;
CONSTANTS[57] = 8;
CONSTANTS[58] = 10;
CONSTANTS[59] = 1;
CONSTANTS[60] = 0.28;
CONSTANTS[61] = 0.0123;
STATES[42] = 0.993914988616979;
CONSTANTS[62] = 0.00092;
CONSTANTS[63] = 0.00017;
CONSTANTS[64] = 0.004375;
CONSTANTS[65] = 0.75;
CONSTANTS[66] = 0.15;
CONSTANTS[67] = 15;
STATES[43] = 1.01475649943057;
CONSTANTS[68] = 25;
CONSTANTS[69] = 0.2;
CONSTANTS[70] = 2;
CONSTANTS[71] = 0.05;
CONSTANTS[72] = 0.07;
CONSTANTS[73] = 0.00238;
CONSTANTS[74] = 0.0005;
CONSTANTS[75] = 0.8;
CONSTANTS[76] = 10;
CONSTANTS[77] = 0.047;
CONSTANTS[78] = 0.00087;
CONSTANTS[79] = 1.124;
CONSTANTS[80] = 0.0087;
STATES[44] = 20.6683605553303;
CONSTANTS[81] = 0.0015;
STATES[45] = 0.0114911034744777;
CONSTANTS[82] = 0.05;
CONSTANTS[83] = 0.00068;
CONSTANTS[84] = 0.05;
CONSTANTS[85] = 0.0895383;
CONSTANTS[86] =  1000.00* 3.14159265358979*CONSTANTS[8]*CONSTANTS[8]*CONSTANTS[7];
CONSTANTS[87] =  CONSTANTS[44]* pow((CONSTANTS[3]/5.40000), 1.0 / 2);
CONSTANTS[88] =  CONSTANTS[47]* pow((CONSTANTS[3]/5.40000), 1.0 / 2);
CONSTANTS[89] =  CONSTANTS[86]*0.0600000;
CONSTANTS[90] =  2.00000* 3.14159265358979*CONSTANTS[8]*CONSTANTS[8]+ 2.00000* 3.14159265358979*CONSTANTS[8]*CONSTANTS[7];
CONSTANTS[91] =  CONSTANTS[90]*2.00000;
CONSTANTS[92] = ( 1.00000*1.00000*CONSTANTS[91])/( CONSTANTS[0]*1.00000);
CONSTANTS[93] =  CONSTANTS[86]*0.678000;
CONSTANTS[94] =  CONSTANTS[86]*0.0552000;
CONSTANTS[95] =  CONSTANTS[86]*0.00480000;
CONSTANTS[96] =  CONSTANTS[86]*0.0200000;
CONSTANTS[97] =  CONSTANTS[86]*0.00200000;
CONSTANTS[98] = CONSTANTS[3]/(CONSTANTS[3]+CONSTANTS[21]);
RATES[0] = 0.1;
RATES[1] = 0.1;
RATES[2] = 0.1;
RATES[3] = 0.1;
RATES[4] = 0.1;
RATES[5] = 0.1;
RATES[6] = 0.1;
RATES[7] = 0.1;
RATES[8] = 0.1;
RATES[9] = 0.1;
RATES[10] = 0.1;
RATES[11] = 0.1;
RATES[12] = 0.1;
RATES[13] = 0.1;
RATES[14] = 0.1;
RATES[15] = 0.1;
RATES[16] = 0.1;
RATES[18] = 0.1;
RATES[19] = 0.1;
RATES[20] = 0.1;
RATES[21] = 0.1;
RATES[22] = 0.1;
RATES[23] = 0.1;
RATES[24] = 0.1;
RATES[26] = 0.1;
RATES[27] = 0.1;
RATES[28] = 0.1;
RATES[32] = 0.1;
RATES[33] = 0.1;
RATES[36] = 0.1;
RATES[37] = 0.1;
RATES[38] = 0.1;
RATES[39] = 0.1;
RATES[41] = 0.1;
RATES[40] = 0.1;
RATES[17] = 0.1;
RATES[30] = 0.1;
RATES[25] = 0.1;
RATES[43] = 0.1;
RATES[42] = 0.1;
RATES[29] = 0.1;
RATES[31] = 0.1;
RATES[35] = 0.1;
RATES[44] = 0.1;
RATES[34] = 0.1;
RATES[45] = 0.1;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - - (ALGEBRAIC[108]+ALGEBRAIC[109]+ALGEBRAIC[107]+ALGEBRAIC[110]);
resid[1] = RATES[1] -  - 4.00000*ALGEBRAIC[5]*STATES[1]+ ALGEBRAIC[6]*STATES[2];
resid[2] = RATES[2] -  - ( 3.00000*ALGEBRAIC[5]+ALGEBRAIC[6]+ALGEBRAIC[7])*STATES[2]+ 4.00000*ALGEBRAIC[5]*STATES[1]+ 2.00000*ALGEBRAIC[6]*STATES[3]+ ALGEBRAIC[8]*STATES[6];
resid[3] = RATES[3] -  - ( 2.00000*ALGEBRAIC[5]+ 2.00000*ALGEBRAIC[6]+ 2.00000*ALGEBRAIC[7])*STATES[3]+ 3.00000*ALGEBRAIC[5]*STATES[2]+ 3.00000*ALGEBRAIC[6]*STATES[4]+ ALGEBRAIC[8]*STATES[7];
resid[4] = RATES[4] -  - (ALGEBRAIC[5]+ 3.00000*ALGEBRAIC[6]+ 3.00000*ALGEBRAIC[7])*STATES[4]+ 2.00000*ALGEBRAIC[5]*STATES[3]+ 4.00000*ALGEBRAIC[6]*STATES[5]+ ALGEBRAIC[8]*STATES[8];
resid[5] = RATES[5] -  - ( 4.00000*ALGEBRAIC[6]+ 4.00000*ALGEBRAIC[7])*STATES[5]+ ALGEBRAIC[5]*STATES[4]+ ALGEBRAIC[8]*STATES[9];
resid[6] = RATES[6] -  - ( 3.00000*ALGEBRAIC[5]+ALGEBRAIC[8])*STATES[6]+ ALGEBRAIC[6]*STATES[7]+ ALGEBRAIC[7]*STATES[2];
resid[7] = RATES[7] -  - ( 2.00000*ALGEBRAIC[5]+ALGEBRAIC[6]+ALGEBRAIC[7]+ALGEBRAIC[8])*STATES[7]+ 3.00000*ALGEBRAIC[5]*STATES[6]+ 2.00000*ALGEBRAIC[6]*STATES[8]+ 2.00000*ALGEBRAIC[7]*STATES[3]+ 2.00000*ALGEBRAIC[8]*STATES[10];
resid[8] = RATES[8] -  - (ALGEBRAIC[5]+ 2.00000*ALGEBRAIC[6]+ 2.00000*ALGEBRAIC[7]+ALGEBRAIC[8])*STATES[8]+ 2.00000*ALGEBRAIC[5]*STATES[7]+ 3.00000*ALGEBRAIC[6]*STATES[9]+ 3.00000*ALGEBRAIC[7]*STATES[4]+ 2.00000*ALGEBRAIC[8]*STATES[11];
resid[9] = RATES[9] -  - ( 3.00000*ALGEBRAIC[6]+ 3.00000*ALGEBRAIC[7]+ALGEBRAIC[8])*STATES[9]+ ALGEBRAIC[5]*STATES[8]+ 4.00000*ALGEBRAIC[7]*STATES[5]+ 2.00000*ALGEBRAIC[8]*STATES[12];
resid[10] = RATES[10] -  - ( 2.00000*ALGEBRAIC[5]+ 2.00000*ALGEBRAIC[8])*STATES[10]+ ALGEBRAIC[6]*STATES[11]+ ALGEBRAIC[7]*STATES[7];
resid[11] = RATES[11] -  - (ALGEBRAIC[5]+ALGEBRAIC[6]+ALGEBRAIC[7]+ 2.00000*ALGEBRAIC[8])*STATES[11]+ 2.00000*ALGEBRAIC[5]*STATES[10]+ 2.00000*ALGEBRAIC[6]*STATES[12]+ 2.00000*ALGEBRAIC[7]*STATES[8]+ 3.00000*ALGEBRAIC[8]*STATES[13];
resid[12] = RATES[12] -  - ( 2.00000*ALGEBRAIC[6]+ 2.00000*ALGEBRAIC[7]+ 2.00000*ALGEBRAIC[8])*STATES[12]+ ALGEBRAIC[5]*STATES[11]+ 3.00000*ALGEBRAIC[7]*STATES[9]+ 3.00000*ALGEBRAIC[8]*STATES[14];
resid[13] = RATES[13] -  - (ALGEBRAIC[5]+ 3.00000*ALGEBRAIC[8])*STATES[13]+ ALGEBRAIC[6]*STATES[14]+ ALGEBRAIC[7]*STATES[11];
resid[14] = RATES[14] -  - (ALGEBRAIC[6]+ALGEBRAIC[7]+ 3.00000*ALGEBRAIC[8])*STATES[14]+ ALGEBRAIC[5]*STATES[13]+ 2.00000*ALGEBRAIC[7]*STATES[12]+ 4.00000*ALGEBRAIC[8]*STATES[15];
resid[15] = RATES[15] -  - ( 4.00000*ALGEBRAIC[8]+CONSTANTS[85])*STATES[15]+ ALGEBRAIC[7]*STATES[14]+ ALGEBRAIC[9]*STATES[16];
resid[16] = RATES[16] -  - (ALGEBRAIC[9]+ALGEBRAIC[11])*STATES[16]+ ALGEBRAIC[10]*ALGEBRAIC[3]+ CONSTANTS[85]*STATES[15];
resid[17] = RATES[18] -  - (ALGEBRAIC[16]+ALGEBRAIC[24]+ALGEBRAIC[21])*STATES[18]+ ALGEBRAIC[17]*STATES[19]+ CONSTANTS[15]*STATES[20]+ ALGEBRAIC[20]*STATES[22];
resid[18] = RATES[19] -  - (ALGEBRAIC[17]+ALGEBRAIC[24]+ALGEBRAIC[21])*STATES[19]+ ALGEBRAIC[16]*STATES[18]+ CONSTANTS[15]*STATES[21]+ ALGEBRAIC[20]*STATES[23];
resid[19] = RATES[20] -  - (ALGEBRAIC[16]+CONSTANTS[15]+ALGEBRAIC[113])*STATES[20]+ ALGEBRAIC[24]*STATES[18]+ ALGEBRAIC[17]*STATES[21]+ ALGEBRAIC[112]*STATES[24];
resid[20] = RATES[21] -  - (ALGEBRAIC[17]+CONSTANTS[15]+ALGEBRAIC[113])*STATES[21]+ ALGEBRAIC[24]*STATES[19]+ ALGEBRAIC[16]*STATES[20]+ ALGEBRAIC[112]*ALGEBRAIC[12];
resid[21] = RATES[22] -  - (ALGEBRAIC[16]+ALGEBRAIC[114]+ALGEBRAIC[20])*STATES[22]+ ALGEBRAIC[21]*STATES[18]+ CONSTANTS[16]*STATES[24]+ ALGEBRAIC[17]*STATES[23];
resid[22] = RATES[23] -  - (ALGEBRAIC[17]+ALGEBRAIC[114]+ALGEBRAIC[20])*STATES[23]+ ALGEBRAIC[21]*STATES[19]+ CONSTANTS[16]*ALGEBRAIC[12]+ ALGEBRAIC[16]*STATES[22];
resid[23] = RATES[24] -  - (ALGEBRAIC[16]+CONSTANTS[16]+ALGEBRAIC[112])*STATES[24]+ ALGEBRAIC[114]*STATES[22]+ ALGEBRAIC[113]*STATES[20]+ ALGEBRAIC[17]*ALGEBRAIC[12];
resid[24] = RATES[26] -  ALGEBRAIC[25]*(1.00000 - STATES[26]) -  ALGEBRAIC[26]*STATES[26];
resid[25] = RATES[27] -  ALGEBRAIC[27]*(1.00000 - STATES[27]) -  ALGEBRAIC[28]*STATES[27];
resid[26] = RATES[28] -  ALGEBRAIC[29]*(1.00000 - STATES[28]) -  ALGEBRAIC[30]*STATES[28];
resid[27] = RATES[32] -  ALGEBRAIC[52]*(1.00000 - STATES[32]) -  ALGEBRAIC[53]*STATES[32];
resid[28] = RATES[33] - (ALGEBRAIC[54] - STATES[33])/CONSTANTS[42];
resid[29] = RATES[36] - (ALGEBRAIC[64] - STATES[36])/ALGEBRAIC[65];
resid[30] = RATES[37] - (ALGEBRAIC[71] - STATES[37])/ALGEBRAIC[70];
resid[31] = RATES[38] -  ALGEBRAIC[73]*(1.00000 - STATES[38]) -  ALGEBRAIC[72]*STATES[38];
resid[32] = RATES[39] -  ALGEBRAIC[75]*(1.00000 - STATES[39]) -  ALGEBRAIC[74]*STATES[39];
resid[33] = RATES[41] - (ALGEBRAIC[103] - STATES[41])/CONSTANTS[53];
resid[34] = RATES[40] - - (ALGEBRAIC[119]+STATES[40])/ALGEBRAIC[116];
resid[35] = RATES[17] -  ALGEBRAIC[84]*(( - ((ALGEBRAIC[49]+ALGEBRAIC[48]) -  2.00000*ALGEBRAIC[46])*CONSTANTS[92])/( CONSTANTS[93]*2.00000)+( (ALGEBRAIC[80] - ALGEBRAIC[117])*CONSTANTS[94])/CONSTANTS[93]+( ALGEBRAIC[82]*CONSTANTS[96])/CONSTANTS[93]);
resid[36] = RATES[30] -  - ALGEBRAIC[85]*((ALGEBRAIC[82]+ALGEBRAIC[83]) - (( 2.00000*ALGEBRAIC[44]*CONSTANTS[92])/( 2.00000*CONSTANTS[96])+( STATES[40]*CONSTANTS[95])/CONSTANTS[96]));
resid[37] = RATES[25] -  - ALGEBRAIC[86]*(( ALGEBRAIC[92]*CONSTANTS[92])/( 2.00000*CONSTANTS[97]) - ( ALGEBRAIC[83]*CONSTANTS[96])/CONSTANTS[97]);
resid[38] = RATES[43] - ALGEBRAIC[117] - (ALGEBRAIC[80]+( ALGEBRAIC[81]*CONSTANTS[95])/CONSTANTS[94]);
resid[39] = RATES[42] -  ALGEBRAIC[87]*(ALGEBRAIC[81] - STATES[40]);
resid[40] = RATES[29] - - (( ( 3.00000*ALGEBRAIC[46]+ 3.00000*ALGEBRAIC[95]+ALGEBRAIC[94]+ALGEBRAIC[98]+ALGEBRAIC[51])*CONSTANTS[92])/CONSTANTS[93] - (ALGEBRAIC[62]+( ALGEBRAIC[88]*CONSTANTS[96])/CONSTANTS[93]));
resid[41] = RATES[31] - - (( 3.00000*ALGEBRAIC[44]*CONSTANTS[92])/CONSTANTS[96]+ALGEBRAIC[88]);
resid[42] = RATES[35] - - (( ALGEBRAIC[97]*CONSTANTS[92])/( - 1.00000*CONSTANTS[93]) - (ALGEBRAIC[62]+ALGEBRAIC[63]+( ALGEBRAIC[89]*CONSTANTS[96])/CONSTANTS[93]));
resid[43] = RATES[44] - - (( ALGEBRAIC[102]*CONSTANTS[92])/( - 1.00000*CONSTANTS[96])+ALGEBRAIC[89]);
resid[44] = RATES[34] - - (( ((ALGEBRAIC[91]+ALGEBRAIC[100]+ALGEBRAIC[99]+ALGEBRAIC[101]+ALGEBRAIC[96]+ALGEBRAIC[1]) -  2.00000*ALGEBRAIC[95])*CONSTANTS[92])/CONSTANTS[93] - ALGEBRAIC[63]);
resid[45] = RATES[45] -  CONSTANTS[82]*ALGEBRAIC[90]*(ALGEBRAIC[90] - STATES[45]) -  CONSTANTS[83]*STATES[45];
}
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] =  floor(VOI/CONSTANTS[10])*CONSTANTS[10];
ALGEBRAIC[1] = (CONDVAR[0]>=0.00000&&CONDVAR[1]<=0.00000 ? CONSTANTS[12] : 0.00000);
ALGEBRAIC[3] = 1.00000 - (STATES[1]+STATES[2]+STATES[3]+STATES[4]+STATES[5]+STATES[6]+STATES[7]+STATES[8]+STATES[9]+STATES[10]+STATES[11]+STATES[12]+STATES[13]+STATES[14]+STATES[15]+STATES[16]);
ALGEBRAIC[5] =  0.0148646*exp(( 0.0298773*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[6] =  0.0839863*exp(( - 0.0554611*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[7] =  0.0146007*exp(( 0.244650*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[8] =  0.00311733*exp(( - 0.426255*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[9] =  0.0773199*exp(( - 0.0647261*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[10] =  0.794055*exp(( - 0.0801738*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[11] =  0.586382*exp(( 0.282056*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[12] = 1.00000 - (STATES[18]+STATES[19]+STATES[20]+STATES[21]+STATES[22]+STATES[23]+STATES[24]);
ALGEBRAIC[14] = 0.590000+( 0.800000*exp( 0.0520000*(STATES[0]+13.0000)))/(1.00000+exp( 0.132000*(STATES[0]+13.0000)));
ALGEBRAIC[15] = 1.00000/(1.00000+exp(- (STATES[0] - 13.5600)/9.45000));
ALGEBRAIC[16] = ALGEBRAIC[15]/ALGEBRAIC[14];
ALGEBRAIC[17] = (1.00000 - ALGEBRAIC[15])/ALGEBRAIC[14];
ALGEBRAIC[19] = 1.00000/(1.00000/( 24.8280*(1.00000+exp((STATES[0]+49.1000)/10.3490)))+1.00000/( 30.5530*(1.00000+exp(- (STATES[0]+0.213000)/10.8070))));
ALGEBRAIC[18] = (1.00000/(1.00000+exp((STATES[0]+17.5000)/3.00000))+0.250000)/1.25000;
ALGEBRAIC[20] = ALGEBRAIC[18]/ALGEBRAIC[19];
ALGEBRAIC[21] = (1.00000 - ALGEBRAIC[18])/ALGEBRAIC[19];
ALGEBRAIC[24] = 3.00000/(1.00000+pow(0.00300000/STATES[25], 4.00000));
ALGEBRAIC[25] = ( 0.320000*(STATES[0]+47.1300))/(1.00000 - exp( - 0.100000*(STATES[0]+47.1300)));
ALGEBRAIC[26] =  0.0800000*exp(- STATES[0]/11.0000);
ALGEBRAIC[27] = (CONDVAR[2]>=0.00000 ? 0.00000 :  0.135000*exp((80.0000+STATES[0])/- 6.80000));
ALGEBRAIC[28] = (CONDVAR[3]>=0.00000 ? 1.00000/( 0.130000*(1.00000+exp((STATES[0]+10.6600)/- 11.1000))) :  3.56000*exp( 0.0790000*STATES[0])+ 310000.*exp( 0.350000*STATES[0]));
ALGEBRAIC[29] = (CONDVAR[4]>=0.00000 ? 0.00000 : ( ( - 127140.*exp( 0.244400*STATES[0]) -  6.94800e-05*exp( - 0.0439100*STATES[0]))*(STATES[0]+37.7800))/(1.00000+exp( 0.311000*(STATES[0]+79.2300))));
ALGEBRAIC[30] = (CONDVAR[5]>=0.00000 ? ( 0.300000*exp( - 2.53500e-07*STATES[0]))/(1.00000+exp( - 0.100000*(STATES[0]+32.0000))) : ( 0.121200*exp( - 0.0105200*STATES[0]))/(1.00000+exp( - 0.137800*(STATES[0]+40.1400))));
ALGEBRAIC[39] =  0.200000*CONSTANTS[26]*( pow(STATES[31], 3.00000)*CONSTANTS[4]*exp(( CONSTANTS[28]*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])) -  pow(CONSTANTS[5], 3.00000)*STATES[30]*exp(( (CONSTANTS[28] - 1.00000)*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])));
ALGEBRAIC[40] = 1.00000+pow(CONSTANTS[25]/STATES[30], 2.00000);
ALGEBRAIC[41] = 1.00000+ CONSTANTS[27]*exp(( (CONSTANTS[28] - 1.00000)*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[42] =  CONSTANTS[32]*pow(STATES[31], 3.00000)+ pow(CONSTANTS[30], 3.00000)*STATES[30]+ pow(CONSTANTS[29], 3.00000)*CONSTANTS[4]*(1.00000+STATES[30]/CONSTANTS[31]);
ALGEBRAIC[43] =  CONSTANTS[31]*pow(CONSTANTS[5], 3.00000)*(1.00000+pow(STATES[31]/CONSTANTS[29], 3.00000))+ pow(STATES[31], 3.00000)*CONSTANTS[4]+ pow(CONSTANTS[5], 3.00000)*STATES[30];
ALGEBRAIC[44] = ALGEBRAIC[39]/( ALGEBRAIC[40]*ALGEBRAIC[41]*(ALGEBRAIC[42]+ALGEBRAIC[43]));
ALGEBRAIC[34] =  0.800000*CONSTANTS[26]*( pow(STATES[29], 3.00000)*CONSTANTS[4]*exp(( CONSTANTS[28]*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])) -  pow(CONSTANTS[5], 3.00000)*STATES[17]*exp(( (CONSTANTS[28] - 1.00000)*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])));
ALGEBRAIC[35] = 1.00000+pow(CONSTANTS[25]/STATES[17], 2.00000);
ALGEBRAIC[36] = 1.00000+ CONSTANTS[27]*exp(( (CONSTANTS[28] - 1.00000)*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[37] =  CONSTANTS[32]*pow(STATES[29], 3.00000)+ pow(CONSTANTS[30], 3.00000)*STATES[17]+ pow(CONSTANTS[29], 3.00000)*CONSTANTS[4]*(1.00000+STATES[17]/CONSTANTS[31]);
ALGEBRAIC[38] =  CONSTANTS[31]*pow(CONSTANTS[5], 3.00000)*(1.00000+pow(STATES[29]/CONSTANTS[29], 3.00000))+ pow(STATES[29], 3.00000)*CONSTANTS[4]+ pow(CONSTANTS[5], 3.00000)*STATES[17];
ALGEBRAIC[45] = ALGEBRAIC[34]/( ALGEBRAIC[35]*ALGEBRAIC[36]*(ALGEBRAIC[37]+ALGEBRAIC[38]));
ALGEBRAIC[46] = ALGEBRAIC[45]+ALGEBRAIC[44];
ALGEBRAIC[48] = ( CONSTANTS[34]*STATES[17])/(CONSTANTS[35]+STATES[17]);
ALGEBRAIC[49] = ( (( CONSTANTS[36]*4.00000*STATES[0]*pow(CONSTANTS[0], 2.00000))/( CONSTANTS[2]*CONSTANTS[1]))*( CONSTANTS[37]*STATES[17]*exp(( 2.00000*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])) -  CONSTANTS[38]*CONSTANTS[4]))/(exp(( 2.00000*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])) - 1.00000);
ALGEBRAIC[50] = ( CONSTANTS[0]*STATES[0])/( CONSTANTS[2]*CONSTANTS[1]);
ALGEBRAIC[51] = ( CONSTANTS[0]*CONSTANTS[39]*ALGEBRAIC[50]*( STATES[29]*exp(ALGEBRAIC[50]) - CONSTANTS[5]))/(exp(ALGEBRAIC[50]) - 1.00000);
ALGEBRAIC[52] = ( 0.320000*(STATES[0]+47.1300))/(1.00000 - exp( - 0.100000*(STATES[0]+47.1300)));
ALGEBRAIC[53] =  0.0800000*exp(- STATES[0]/11.0000);
ALGEBRAIC[54] = 1.00000/(1.00000+exp((STATES[0]+91.0000)/6.10000));
ALGEBRAIC[55] =  (( CONSTANTS[2]*CONSTANTS[1])/CONSTANTS[0])*log(CONSTANTS[5]/STATES[29]);
ALGEBRAIC[58] =  (( - CONSTANTS[2]*CONSTANTS[1])/CONSTANTS[0])*log(CONSTANTS[6]/STATES[35]);
ALGEBRAIC[62] = ( CONSTANTS[45]*pow(ALGEBRAIC[55] - ALGEBRAIC[58], 4.00000))/(pow(ALGEBRAIC[55] - ALGEBRAIC[58], 4.00000)+pow(87.8251, 4.00000));
ALGEBRAIC[56] =  (( CONSTANTS[2]*CONSTANTS[1])/CONSTANTS[0])*log(CONSTANTS[3]/STATES[34]);
ALGEBRAIC[63] = ( CONSTANTS[46]*(ALGEBRAIC[56] - ALGEBRAIC[58]))/((ALGEBRAIC[56]+87.8251) - ALGEBRAIC[58]);
ALGEBRAIC[64] = 1.00000/(1.00000+exp(- (STATES[0]+10.0850)/4.25000));
ALGEBRAIC[65] = 1.00000/(( 0.000600000*(STATES[0] - 1.73840))/(1.00000 - exp( - 0.136000*(STATES[0] - 1.73840)))+( 0.000300000*(STATES[0]+38.3608))/(exp( 0.152200*(STATES[0]+38.3608)) - 1.00000));
ALGEBRAIC[68] = 1.00000/( 1.20890*(1.00000+exp((STATES[0] - 18.4099)/- 29.3814)));
ALGEBRAIC[69] = 3.50000/(1.00000+exp((STATES[0]+100.000)/29.3814));
ALGEBRAIC[70] = 1.00000/(ALGEBRAIC[68]+ALGEBRAIC[69]);
ALGEBRAIC[71] = 1.00000/(1.00000+exp((STATES[0]+9.43700)/- 7.13300));
ALGEBRAIC[72] = 1.00000/( 9.79530*(1.00000+exp((STATES[0]+19.0000)/- 9.00000)));
ALGEBRAIC[73] = 0.0250000/(1.00000+exp((STATES[0]+58.0000)/5.00000));
ALGEBRAIC[74] = 1.00000/( 9.79530*(1.00000+exp((STATES[0]+19.0000)/- 9.00000)));
ALGEBRAIC[75] = 1.00000/( 250.000*(1.00000+exp((STATES[0]+60.0000)/5.00000)));
ALGEBRAIC[80] =  (0.00437500/CONSTANTS[67])*STATES[43];
ALGEBRAIC[81] = (STATES[43] - STATES[42])/CONSTANTS[68];
ALGEBRAIC[82] = (STATES[30] - STATES[17])/CONSTANTS[69];
ALGEBRAIC[83] = (STATES[30] - STATES[25])/CONSTANTS[70];
ALGEBRAIC[84] = 1.00000/(1.00000+( CONSTANTS[71]*CONSTANTS[73])/pow(STATES[17]+CONSTANTS[73], 2.00000)+( CONSTANTS[74]*CONSTANTS[72])/pow(STATES[17]+CONSTANTS[74], 2.00000));
ALGEBRAIC[85] = 1.00000/(1.00000+( CONSTANTS[77]*CONSTANTS[78])/pow(CONSTANTS[78]+STATES[30], 2.00000)+( CONSTANTS[79]*CONSTANTS[80])/pow(CONSTANTS[80]+STATES[30], 2.00000));
ALGEBRAIC[86] = 1.00000/(1.00000+( CONSTANTS[77]*CONSTANTS[78])/pow(CONSTANTS[78]+STATES[25], 2.00000)+( CONSTANTS[79]*CONSTANTS[80])/pow(CONSTANTS[80]+STATES[25], 2.00000));
ALGEBRAIC[87] = 1.00000/(1.00000+( CONSTANTS[75]*CONSTANTS[76])/pow(STATES[42]+CONSTANTS[75], 2.00000));
ALGEBRAIC[88] = (STATES[31] - STATES[29])/CONSTANTS[69];
ALGEBRAIC[89] = (STATES[44] - STATES[35])/CONSTANTS[69];
ALGEBRAIC[90] = ( CONSTANTS[84]*(1.00000 - STATES[45]))/(1.00000+CONSTANTS[81]/STATES[30])+STATES[45];
ALGEBRAIC[2] =  CONSTANTS[13]*(1.00000+0.600000/(1.00000+pow(3.80000e-05/STATES[17], 1.40000)));
ALGEBRAIC[4] = STATES[16]+ALGEBRAIC[3];
ALGEBRAIC[57] =  (( CONSTANTS[2]*CONSTANTS[1])/CONSTANTS[0])*log((CONSTANTS[3]+ CONSTANTS[43]*CONSTANTS[5])/(STATES[34]+ CONSTANTS[43]*STATES[29]));
ALGEBRAIC[91] =  ALGEBRAIC[2]*ALGEBRAIC[4]*(STATES[0] - ALGEBRAIC[57]);
ALGEBRAIC[13] = ( (( CONSTANTS[14]*4.00000*STATES[0]*pow(CONSTANTS[0], 2.00000))/( CONSTANTS[2]*CONSTANTS[1]))*( CONSTANTS[17]*STATES[25]*exp(( 2.00000*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])) -  CONSTANTS[18]*CONSTANTS[4]))/(exp(( 2.00000*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])) - 1.00000);
ALGEBRAIC[92] =  ALGEBRAIC[13]*(STATES[19]+STATES[21]);
ALGEBRAIC[94] =  CONSTANTS[19]*pow(STATES[26], 3.00000)*STATES[27]*STATES[28]*(STATES[0] - ALGEBRAIC[55]);
ALGEBRAIC[31] = ( CONSTANTS[23]*(STATES[0] - CONSTANTS[24])*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]);
ALGEBRAIC[32] = 1.00000/(1.00000+exp(- ALGEBRAIC[31]));
ALGEBRAIC[33] = pow(STATES[29]/(STATES[29]+CONSTANTS[20]), 3.00000);
ALGEBRAIC[95] =  CONSTANTS[22]*ALGEBRAIC[32]*CONSTANTS[98]*ALGEBRAIC[33];
ALGEBRAIC[47] = 1.00000/(1.00000+exp((7.48800 - STATES[0])/5.98000));
ALGEBRAIC[96] =  CONSTANTS[33]*ALGEBRAIC[47]*(STATES[0] - ALGEBRAIC[56]);
ALGEBRAIC[97] =  CONSTANTS[40]*(STATES[0] - ALGEBRAIC[58]);
ALGEBRAIC[98] =  CONSTANTS[41]*pow(STATES[32], 3.00000)*STATES[33]*(STATES[0] - ALGEBRAIC[55]);
ALGEBRAIC[59] = 1.02000/(1.00000+exp( 0.238500*((STATES[0] - ALGEBRAIC[56]) - 59.2150)));
ALGEBRAIC[60] = ( 0.491240*exp( 0.0803200*((STATES[0] - ALGEBRAIC[56])+5.47600))+exp( 0.0617500*((STATES[0] - ALGEBRAIC[56]) - 594.310)))/(1.00000+exp( - 0.514300*((STATES[0] - ALGEBRAIC[56])+4.75300)));
ALGEBRAIC[61] = ALGEBRAIC[59]/(ALGEBRAIC[59]+ALGEBRAIC[60]);
ALGEBRAIC[99] =  CONSTANTS[87]*ALGEBRAIC[61]*(STATES[0] - ALGEBRAIC[56]);
ALGEBRAIC[66] = 1.00000/(1.00000+exp((STATES[0]+10.0000)/15.4000));
ALGEBRAIC[100] =  CONSTANTS[88]*STATES[36]*ALGEBRAIC[66]*(STATES[0] - ALGEBRAIC[56]);
ALGEBRAIC[67] = exp(STATES[0]/550.000);
ALGEBRAIC[101] =  CONSTANTS[48]*pow(STATES[37], 3.00000)*STATES[38]*STATES[39]*ALGEBRAIC[67]*(STATES[0] - ALGEBRAIC[56]);
ALGEBRAIC[76] = ( (( CONSTANTS[49]*pow(CONSTANTS[50], 2.00000)*STATES[0]*pow(CONSTANTS[0], 2.00000))/( CONSTANTS[2]*CONSTANTS[1]))*(STATES[35] -  CONSTANTS[6]*exp(( STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]))))/(1.00000 - exp(( STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])));
ALGEBRAIC[77] = 1.00000 - 1.00000/(1.00000+pow(STATES[40]/CONSTANTS[52], 2.00000));
ALGEBRAIC[102] =  ALGEBRAIC[76]*CONSTANTS[51]*STATES[41]*ALGEBRAIC[77];
ALGEBRAIC[79] = 0.0250000/(1.00000+exp((STATES[0]+58.0000)/5.00000));
ALGEBRAIC[78] = 1.00000/( 5.00000*(1.00000+exp((STATES[0]+19.0000)/- 9.00000)));
ALGEBRAIC[103] = ALGEBRAIC[79]/(ALGEBRAIC[79]+ALGEBRAIC[78]);
ALGEBRAIC[107] = (ALGEBRAIC[92]+ALGEBRAIC[49]+ALGEBRAIC[48]) -  2.00000*(ALGEBRAIC[46]+ALGEBRAIC[44]);
ALGEBRAIC[108] = ALGEBRAIC[94]+ 3.00000*(ALGEBRAIC[46]+ALGEBRAIC[44])+ 3.00000*ALGEBRAIC[95]+ALGEBRAIC[98]+ALGEBRAIC[51];
ALGEBRAIC[109] = ALGEBRAIC[100]+ALGEBRAIC[91]+ALGEBRAIC[99]+ALGEBRAIC[96]+ - 2.00000*ALGEBRAIC[95]+ALGEBRAIC[101]+ALGEBRAIC[1];
ALGEBRAIC[110] = ALGEBRAIC[97]+ALGEBRAIC[102];
ALGEBRAIC[23] = 25.0000 - 17.5000/(1.00000+pow(0.00300000/STATES[25], 4.00000));
ALGEBRAIC[93] = 1.00000/( ALGEBRAIC[23]*(1.00000+exp(- (STATES[0]+0.213000)/10.8070)));
ALGEBRAIC[111] = 1.00000/(1.00000/( 24.8280*(1.00000+exp((STATES[0]+49.1000)/10.3490)))+ALGEBRAIC[93]);
ALGEBRAIC[22] = (1.00000/(1.00000+exp((STATES[0]+17.5000)/3.00000))+0.000100000)/1.00010;
ALGEBRAIC[112] = ALGEBRAIC[22]/ALGEBRAIC[111];
ALGEBRAIC[113] = (1.00000 - ALGEBRAIC[22])/ALGEBRAIC[111];
ALGEBRAIC[114] = ( CONSTANTS[16]*ALGEBRAIC[20]*ALGEBRAIC[113]*ALGEBRAIC[24])/( ALGEBRAIC[21]*ALGEBRAIC[112]*CONSTANTS[15]);
ALGEBRAIC[104] = CONSTANTS[59]/(1.00000+pow(CONSTANTS[60]/( 1.00000*ALGEBRAIC[90]), CONSTANTS[58]));
ALGEBRAIC[115] =  CONSTANTS[55]*(1.00000+ALGEBRAIC[104]);
ALGEBRAIC[116] = ALGEBRAIC[115]/(1.00000+CONSTANTS[61]/STATES[42]);
ALGEBRAIC[106] = ( CONSTANTS[63]*ALGEBRAIC[90]*1.00000)/(CONSTANTS[66]+ ALGEBRAIC[90]*1.00000);
ALGEBRAIC[105] = ( CONSTANTS[65]*ALGEBRAIC[90]*1.00000)/(CONSTANTS[66]+ ALGEBRAIC[90]*1.00000);
ALGEBRAIC[117] = ( (ALGEBRAIC[105]+1.00000)*CONSTANTS[64]*STATES[17])/((STATES[17]+CONSTANTS[62]) - ALGEBRAIC[106]);
ALGEBRAIC[118] =  ALGEBRAIC[115]*CONSTANTS[56];
ALGEBRAIC[119] = ( ALGEBRAIC[92]*ALGEBRAIC[118])/(1.00000+pow(CONSTANTS[54]/STATES[42], CONSTANTS[57]));
}
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[31] = 1.0;
SI[32] = 1.0;
SI[33] = 1.0;
SI[34] = 1.0;
SI[35] = 1.0;
SI[36] = 1.0;
SI[37] = 1.0;
SI[38] = 1.0;
SI[39] = 1.0;
SI[40] = 1.0;
SI[41] = 1.0;
SI[42] = 1.0;
SI[43] = 1.0;
SI[44] = 1.0;
SI[45] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
CONDVAR[0] = (VOI - ALGEBRAIC[0]) - CONSTANTS[9];
CONDVAR[1] = (VOI - ALGEBRAIC[0]) - (CONSTANTS[9]+CONSTANTS[11]);
CONDVAR[2] = STATES[0] - - 40.0000;
CONDVAR[3] = STATES[0] - - 40.0000;
CONDVAR[4] = STATES[0] - - 40.0000;
CONDVAR[5] = STATES[0] - - 40.0000;
}