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 128 entries in the algebraic variable array.
   There are a total of 48 entries in each of the rate and state variable arrays.
   There are a total of 94 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[88] is Vmyo in component cell_geometry (uL).
 * CONSTANTS[89] is Vnsr in component cell_geometry (uL).
 * CONSTANTS[84] is Vsr in component cell_geometry (uL).
 * CONSTANTS[90] is Vjsr in component cell_geometry (uL).
 * CONSTANTS[91] is Vss_sr in component cell_geometry (uL).
 * CONSTANTS[92] is Vss_CaL in component cell_geometry (uL).
 * CONSTANTS[86] is Acap in component cell_geometry (cm2).
 * CONSTANTS[87] 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[81] is vcell in component cell_geometry (uL).
 * CONSTANTS[85] 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[120] is caiont in component membrane (uA_per_uF).
 * ALGEBRAIC[112] is naiont in component membrane (uA_per_uF).
 * ALGEBRAIC[121] is kiont in component membrane (uA_per_uF).
 * ALGEBRAIC[113] is clont in component membrane (uA_per_uF).
 * ALGEBRAIC[84] is INa in component INa (uA_per_uF).
 * ALGEBRAIC[115] is ICaL in component ICaL (uA_per_uF).
 * ALGEBRAIC[101] is IK1 in component IK1 (uA_per_uF).
 * ALGEBRAIC[96] is IKp in component IKp (uA_per_uF).
 * ALGEBRAIC[114] is IKs in component IKs (uA_per_uF).
 * ALGEBRAIC[102] is IKr in component IKr (uA_per_uF).
 * ALGEBRAIC[97] is IpCa in component IpCa (uA_per_uF).
 * ALGEBRAIC[98] is ICab in component ICab (uA_per_uF).
 * ALGEBRAIC[94] is INaCa in component INaCa (uA_per_uF).
 * ALGEBRAIC[95] is INaCa_ss_sr in component INaCa (uA_per_uF).
 * ALGEBRAIC[85] is INaK in component INaK (uA_per_uF).
 * ALGEBRAIC[103] is Ito1 in component Ito1 (uA_per_uF).
 * ALGEBRAIC[104] is Ito2 in component Ito2 (uA_per_uF).
 * ALGEBRAIC[99] is IClb in component IClb (uA_per_uF).
 * ALGEBRAIC[100] is INaL in component INaL (uA_per_uF).
 * ALGEBRAIC[32] is INab in component INab (uA_per_uF).
 * ALGEBRAIC[80] is gKs 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).
 * STATES[17] is O2 in component IKs (dimensionless).
 * ALGEBRAIC[2] is OKs in component IKs (dimensionless).
 * ALGEBRAIC[3] is alpha in component IKs (per_ms).
 * ALGEBRAIC[4] is beta in component IKs (per_ms).
 * ALGEBRAIC[6] is delta in component IKs (per_ms).
 * ALGEBRAIC[5] is gamma in component IKs (per_ms).
 * ALGEBRAIC[7] is eta in component IKs (per_ms).
 * CONSTANTS[80] is theta in component IKs (per_ms).
 * ALGEBRAIC[8] is omega in component IKs (per_ms).
 * ALGEBRAIC[9] is psi in component IKs (per_ms).
 * ALGEBRAIC[38] is EKs in component reversal_potentials (mV).
 * ALGEBRAIC[65] is Ca_i in component Ca_buffering (mM).
 * ALGEBRAIC[81] is ICaL_max in component ICaL (uA_per_uF).
 * CONSTANTS[13] 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).
 * STATES[25] is OI_star in component ICaL (dimensionless).
 * ALGEBRAIC[10] is ACT_tau in component ICaL (ms).
 * ALGEBRAIC[15] is IV_tau in component ICaL (ms).
 * ALGEBRAIC[122] is IV_tau_star in component ICaL (ms).
 * ALGEBRAIC[11] is ACT_infinity in component ICaL (dimensionless).
 * ALGEBRAIC[14] is IV_infinity in component ICaL (dimensionless).
 * ALGEBRAIC[18] is IV_infinity_star in component ICaL (dimensionless).
 * ALGEBRAIC[116] is IV_beta_star in component ICaL (dimensionless).
 * ALGEBRAIC[82] is IV_beta_infinity_star in component ICaL (dimensionless).
 * ALGEBRAIC[12] is alpha in component ICaL (per_ms).
 * ALGEBRAIC[13] is beta in component ICaL (per_ms).
 * ALGEBRAIC[83] is delta in component ICaL (per_ms).
 * ALGEBRAIC[16] is x in component ICaL (per_ms).
 * ALGEBRAIC[17] is y in component ICaL (per_ms).
 * CONSTANTS[14] is theta in component ICaL (per_ms).
 * ALGEBRAIC[125] is delta_I in component ICaL (per_ms).
 * ALGEBRAIC[123] is x_star in component ICaL (per_ms).
 * ALGEBRAIC[124] is y_star in component ICaL (per_ms).
 * CONSTANTS[15] is theta_I in component ICaL (per_ms).
 * CONSTANTS[16] is gamma_Cai in component ICaL (dimensionless).
 * CONSTANTS[17] is gamma_Cao in component ICaL (dimensionless).
 * ALGEBRAIC[72] is Ca_ss_CaL in component Ca_ss_buffering (mM).
 * CONSTANTS[18] is g_Na in component INa (mS_per_uF).
 * ALGEBRAIC[36] 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[19] is am in component INa_m_gate (per_ms).
 * ALGEBRAIC[20] is bm in component INa_m_gate (per_ms).
 * ALGEBRAIC[21] is ah in component INa_h_gate (per_ms).
 * ALGEBRAIC[22] is bh in component INa_h_gate (per_ms).
 * ALGEBRAIC[23] is aj in component INa_j_gate (per_ms).
 * ALGEBRAIC[24] is bj in component INa_j_gate (per_ms).
 * CONSTANTS[19] is kmnai in component INaK (mM).
 * CONSTANTS[20] is kmko in component INaK (mM).
 * CONSTANTS[21] is ibarnak in component INaK (uA_per_uF).
 * CONSTANTS[22] is sigma in component INaK (dimensionless).
 * CONSTANTS[23] is V_half in component INaK (mV).
 * ALGEBRAIC[25] is phi in component INaK (dimensionless).
 * ALGEBRAIC[26] is fv in component INaK (dimensionless).
 * CONSTANTS[93] is PK in component INaK (dimensionless).
 * ALGEBRAIC[27] is PNa in component INaK (dimensionless).
 * STATES[29] is Na_i in component Na (mM).
 * CONSTANTS[24] is KmCa_act in component INaCa (mM).
 * CONSTANTS[25] is Vmax in component INaCa (uA_per_uF).
 * CONSTANTS[26] is ksat in component INaCa (dimensionless).
 * CONSTANTS[27] is eta in component INaCa (dimensionless).
 * CONSTANTS[28] is KmNai in component INaCa (mM).
 * CONSTANTS[29] is KmNao in component INaCa (mM).
 * CONSTANTS[30] is KmCai in component INaCa (mM).
 * CONSTANTS[31] is KmCao in component INaCa (mM).
 * ALGEBRAIC[73] is Ca_ss_sr in component Ca_ss_buffering (mM).
 * STATES[30] is Na_ss_sr in component Na (mM).
 * ALGEBRAIC[86] is num in component INaCa (mM4_uA_per_uF).
 * ALGEBRAIC[90] is num_ss in component INaCa (mM4_uA_per_uF).
 * ALGEBRAIC[87] is denom_1 in component INaCa (dimensionless).
 * ALGEBRAIC[28] is denom_2 in component INaCa (dimensionless).
 * ALGEBRAIC[88] is denom_3 in component INaCa (mM4).
 * ALGEBRAIC[89] is denom_4 in component INaCa (mM4).
 * ALGEBRAIC[91] is denom_ss_1 in component INaCa (dimensionless).
 * ALGEBRAIC[29] is denom_ss_2 in component INaCa (dimensionless).
 * ALGEBRAIC[92] is denom_ss_3 in component INaCa (mM4).
 * ALGEBRAIC[93] is denom_ss_4 in component INaCa (mM4).
 * CONSTANTS[32] is gKp in component IKp (mS_per_uF).
 * ALGEBRAIC[30] is Kp in component IKp (dimensionless).
 * ALGEBRAIC[37] is EK in component reversal_potentials (mV).
 * CONSTANTS[33] is gpCa in component IpCa (uA_per_uF).
 * CONSTANTS[34] is KmpCa in component IpCa (mM).
 * CONSTANTS[35] is PCab in component ICab (L_per_F_ms).
 * CONSTANTS[36] is gamma_Ca_i in component ICab (dimensionless).
 * CONSTANTS[37] is gamma_Ca_o in component ICab (dimensionless).
 * CONSTANTS[38] is PNab in component INab (L_per_F_ms).
 * ALGEBRAIC[31] is phi in component INab (dimensionless).
 * CONSTANTS[39] is gClb in component IClb (mS_per_uF).
 * ALGEBRAIC[39] is ECl in component reversal_potentials (mV).
 * CONSTANTS[40] is gNaL in component INaL (mS_per_uF).
 * STATES[31] is mL in component INaL_mL_gate (dimensionless).
 * STATES[32] is hL in component INaL_hL_gate (dimensionless).
 * ALGEBRAIC[33] is amL in component INaL_mL_gate (per_ms).
 * ALGEBRAIC[34] is bmL in component INaL_mL_gate (per_ms).
 * CONSTANTS[41] is tau_hL in component INaL_hL_gate (ms).
 * ALGEBRAIC[35] is hL_infinity in component INaL_hL_gate (dimensionless).
 * CONSTANTS[42] is prnak in component reversal_potentials (dimensionless).
 * STATES[33] is K_i in component K (mM).
 * STATES[34] is Cl_i in component Cl (mM).
 * CONSTANTS[82] is gK1 in component IK1 (mS_per_uF).
 * ALGEBRAIC[42] is K1 in component IK1_K1_gate (dimensionless).
 * ALGEBRAIC[40] is alpha_k1 in component IK1_K1_gate (dimensionless).
 * ALGEBRAIC[41] is beta_k1 in component IK1_K1_gate (dimensionless).
 * ALGEBRAIC[43] is CT_Na_Cl in component CT_Na_Cl (mM_per_ms).
 * CONSTANTS[43] is CT_Na_Cl_max in component CT_Na_Cl (mM_per_ms).
 * ALGEBRAIC[44] is CT_K_Cl in component CT_K_Cl (mM_per_ms).
 * CONSTANTS[44] is CT_K_Cl_max in component CT_K_Cl (mM_per_ms).
 * CONSTANTS[83] is gKr in component IKr (mS_per_uF).
 * ALGEBRAIC[47] is r in component IKr_r_gate (dimensionless).
 * STATES[35] is xr in component IKr_xr_gate (dimensionless).
 * ALGEBRAIC[45] is xr_infinity in component IKr_xr_gate (dimensionless).
 * ALGEBRAIC[46] is tau_xr in component IKr_xr_gate (ms).
 * CONSTANTS[45] is gto1 in component Ito1 (mS_per_uF).
 * ALGEBRAIC[48] is rto1 in component Ito1 (dimensionless).
 * STATES[36] is a in component Ito1_a_gate (dimensionless).
 * STATES[37] is i1f in component Ito1_i1f_gate (dimensionless).
 * STATES[38] is i1s in component Ito1_i1s_gate (dimensionless).
 * ALGEBRAIC[49] is alpha_a in component Ito1_a_gate (per_ms).
 * ALGEBRAIC[50] is beta_a in component Ito1_a_gate (per_ms).
 * ALGEBRAIC[51] is tau_a in component Ito1_a_gate (ms).
 * ALGEBRAIC[52] is a_infinity in component Ito1_a_gate (dimensionless).
 * ALGEBRAIC[54] is alpha_i1f in component Ito1_i1f_gate (per_ms).
 * ALGEBRAIC[53] is beta_i1f in component Ito1_i1f_gate (per_ms).
 * ALGEBRAIC[56] is alpha_i1s in component Ito1_i1s_gate (per_ms).
 * ALGEBRAIC[55] is beta_i1s in component Ito1_i1s_gate (per_ms).
 * CONSTANTS[46] is PCl in component Ito2 (L_per_F_ms).
 * CONSTANTS[47] is zCl in component Ito2 (dimensionless).
 * ALGEBRAIC[57] is Ito2_max in component Ito2 (uA_per_uF).
 * ALGEBRAIC[58] is KCa_ito2 in component Ito2 (dimensionless).
 * CONSTANTS[48] is kCa_ito2 in component Ito2 (mM_per_ms).
 * STATES[39] is Irel in component Irel (mM_per_ms).
 * STATES[40] is i2f in component Ito2_i2f_gate (dimensionless).
 * ALGEBRAIC[60] is alpha_i2f in component Ito2_i2f_gate (per_ms).
 * ALGEBRAIC[59] is beta_i2f in component Ito2_i2f_gate (per_ms).
 * ALGEBRAIC[105] is i2f_infinity in component Ito2_i2f_gate (dimensionless).
 * CONSTANTS[49] is tau_i2f in component Ito2_i2f_gate (ms).
 * ALGEBRAIC[127] is rel_infinity in component Irel (mM_per_ms).
 * ALGEBRAIC[118] is tau_rel in component Irel (ms).
 * CONSTANTS[50] is Krel_infinity in component Irel (mM).
 * ALGEBRAIC[126] is alpha_rel in component Irel (mM_per_uA_per_uF_per_ms).
 * ALGEBRAIC[117] is beta_tau in component Irel (ms).
 * CONSTANTS[51] is beta_0 in component Irel (ms).
 * CONSTANTS[52] is kappa in component Irel (mM_per_uA_per_uF_per_ms_per_ms).
 * CONSTANTS[53] is h_rel in component Irel (dimensionless).
 * CONSTANTS[54] is h_beta in component Irel (dimensionless).
 * ALGEBRAIC[106] is delta_beta_CaMK in component Irel (dimensionless).
 * CONSTANTS[55] is delta_beta_0 in component Irel (dimensionless).
 * CONSTANTS[56] is K_beta in component Irel (mM).
 * CONSTANTS[57] is Krel_tau in component Irel (mM).
 * ALGEBRAIC[76] is Ca_JSR in component Ca_JSR_buffering (mM).
 * ALGEBRAIC[79] is CaMK_active in component CaMK_active (dimensionless).
 * ALGEBRAIC[119] is Iup in component Iup (mM_per_ms).
 * CONSTANTS[58] is kmup in component Iup (mM).
 * ALGEBRAIC[108] is delta_kmPLB in component Iup (mM).
 * CONSTANTS[59] is delta_kmPLB_bar in component Iup (mM).
 * CONSTANTS[60] is iupbar in component Iup (mM_per_ms).
 * ALGEBRAIC[107] is delta_iupCaMK in component Iup (dimensionless).
 * CONSTANTS[61] is delta_iupCaMK_bar in component Iup (dimensionless).
 * CONSTANTS[62] is kmCaMK in component CaMK_active (mM).
 * ALGEBRAIC[61] is Ileak in component Ileak (mM_per_ms).
 * CONSTANTS[63] is nsrbar in component Ileak (mM).
 * STATES[41] is Ca_NSR in component Ca (mM).
 * ALGEBRAIC[109] is Itr in component Itr (mM_per_ms).
 * CONSTANTS[64] is tautr in component Itr (ms).
 * STATES[42] is Ca_JSR_0 in component Ca (mM).
 * STATES[43] is Ca_i_0 in component Ca (mM).
 * STATES[44] is Ca_ss_sr_0 in component Ca (mM).
 * STATES[45] is Ca_ss_CaL_0 in component Ca (mM).
 * CONSTANTS[65] is tau_diff_ss in component Ca (ms).
 * CONSTANTS[66] is tau_diff in component Ca (ms).
 * ALGEBRAIC[110] is Idiff in component Ca (mM_per_ms).
 * ALGEBRAIC[111] is Idiff_ss in component Ca (mM_per_ms).
 * ALGEBRAIC[62] is b_myo in component Ca_buffering (mM).
 * ALGEBRAIC[63] is c_myo in component Ca_buffering (mM2).
 * ALGEBRAIC[64] is d_myo in component Ca_buffering (mM3).
 * CONSTANTS[67] is cmdn_bar in component Ca_buffering (mM).
 * CONSTANTS[68] is trpn_bar in component Ca_buffering (mM).
 * CONSTANTS[69] is km_cmdn in component Ca_buffering (mM).
 * CONSTANTS[70] is km_trpn in component Ca_buffering (mM).
 * ALGEBRAIC[66] is b_myo1 in component Ca_ss_buffering (mM).
 * ALGEBRAIC[67] is c_myo1 in component Ca_ss_buffering (mM2).
 * ALGEBRAIC[68] is d_myo1 in component Ca_ss_buffering (mM3).
 * ALGEBRAIC[69] is b_myo2 in component Ca_ss_buffering (mM).
 * ALGEBRAIC[70] is c_myo2 in component Ca_ss_buffering (mM2).
 * ALGEBRAIC[71] is d_myo2 in component Ca_ss_buffering (mM3).
 * CONSTANTS[71] is BSL_max in component Ca_ss_buffering (mM).
 * CONSTANTS[72] is BSR_max in component Ca_ss_buffering (mM).
 * CONSTANTS[73] is Km_BSR in component Ca_ss_buffering (mM).
 * CONSTANTS[74] is Km_BSL in component Ca_ss_buffering (mM).
 * ALGEBRAIC[74] is b in component Ca_JSR_buffering (mM).
 * ALGEBRAIC[75] is c in component Ca_JSR_buffering (mM2).
 * CONSTANTS[75] is csqn_bar in component Ca_JSR_buffering (mM).
 * CONSTANTS[76] is km_csqn in component Ca_JSR_buffering (mM).
 * ALGEBRAIC[77] is Idiff_Na in component Na (mM_per_ms).
 * STATES[46] is Cl_ss in component Cl (mM).
 * ALGEBRAIC[78] is Idiff_Cl in component Cl (mM_per_ms).
 * STATES[47] is CaMK_trap in component CaMK_active (dimensionless).
 * CONSTANTS[77] is alpha_CaMK in component CaMK_active (per_ms).
 * CONSTANTS[78] is beta_CaMK in component CaMK_active (per_ms).
 * CONSTANTS[79] 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[17] is d/dt O2 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[25] is d/dt OI_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[31] is d/dt mL in component INaL_mL_gate (dimensionless).
 * RATES[32] is d/dt hL in component INaL_hL_gate (dimensionless).
 * RATES[35] is d/dt xr in component IKr_xr_gate (dimensionless).
 * RATES[36] is d/dt a in component Ito1_a_gate (dimensionless).
 * RATES[37] is d/dt i1f in component Ito1_i1f_gate (dimensionless).
 * RATES[38] is d/dt i1s in component Ito1_i1s_gate (dimensionless).
 * RATES[40] is d/dt i2f in component Ito2_i2f_gate (dimensionless).
 * RATES[39] is d/dt Irel in component Irel (mM_per_ms).
 * RATES[43] is d/dt Ca_i_0 in component Ca (mM).
 * RATES[44] is d/dt Ca_ss_sr_0 in component Ca (mM).
 * RATES[45] is d/dt Ca_ss_CaL_0 in component Ca (mM).
 * RATES[41] is d/dt Ca_NSR in component Ca (mM).
 * RATES[42] is d/dt Ca_JSR_0 in component Ca (mM).
 * RATES[29] is d/dt Na_i in component Na (mM).
 * RATES[30] is d/dt Na_ss_sr in component Na (mM).
 * RATES[34] is d/dt Cl_i in component Cl (mM).
 * RATES[46] is d/dt Cl_ss in component Cl (mM).
 * RATES[33] is d/dt K_i in component K (mM).
 * RATES[47] 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] = 96487;
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.472528;
CONSTANTS[9] = 0;
CONSTANTS[10] = 1e3;
CONSTANTS[11] = 0.5;
CONSTANTS[12] = -80;
STATES[1] = 0.476653873938053;
STATES[2] = 0.2551771850026437;
STATES[3] = 0.05122852186842027;
STATES[4] = 0.004570874421666423;
STATES[5] = 0.0001529389211563687;
STATES[6] = 0.1328281770413747;
STATES[7] = 0.05333228495514583;
STATES[8] = 0.007137874613383642;
STATES[9] = 0.0003184390970637536;
STATES[10] = 0.01388061042363991;
STATES[11] = 0.003715500164470033;
STATES[12] = 0.0002486371465457659;
STATES[13] = 0.0006446803014431032;
STATES[14] = 8.628258026770862e-5;
STATES[15] = 1.122823524761588e-5;
STATES[16] = 1.051906959485266e-5;
STATES[17] = 2.372219883411999e-6;
CONSTANTS[13] = 1.5552e-4;
STATES[18] = 0.9999613782488198;
STATES[19] = 2.27419494597377e-5;
STATES[20] = 5.936477396599124e-11;
STATES[21] = 1.350122566369778e-15;
STATES[22] = 1.587938121237188e-5;
STATES[23] = 3.611420243201921e-10;
STATES[24] = 0;
STATES[25] = 0;
CONSTANTS[14] = 1;
CONSTANTS[15] = 0.000001;
CONSTANTS[16] = 1;
CONSTANTS[17] = 0.341;
CONSTANTS[18] = 9.075;
STATES[26] = 0.001022252813581797;
STATES[27] = 0.9913109066867;
STATES[28] = 0.9970771239754529;
CONSTANTS[19] = 2.6;
CONSTANTS[20] = 1.5;
CONSTANTS[21] = 1.4;
CONSTANTS[22] = 1;
CONSTANTS[23] = -92;
STATES[29] = 6.935575;
CONSTANTS[24] = 1.25e-4;
CONSTANTS[25] = 4.5;
CONSTANTS[26] = 0.32;
CONSTANTS[27] = 0.27;
CONSTANTS[28] = 12.3;
CONSTANTS[29] = 87.5;
CONSTANTS[30] = 0.0036;
CONSTANTS[31] = 1.3;
STATES[30] = 6.935607;
CONSTANTS[32] = 0.00276;
CONSTANTS[33] = 0.0575;
CONSTANTS[34] = 0.5e-3;
CONSTANTS[35] = 1.995084e-7;
CONSTANTS[36] = 1;
CONSTANTS[37] = 0.341;
CONSTANTS[38] = 0.32e-8;
CONSTANTS[39] = 2.25e-4;
CONSTANTS[40] = 0.0065;
STATES[31] = 0.001022252813581797;
STATES[32] = 0.3593255076983574;
CONSTANTS[41] = 600;
CONSTANTS[42] = 0.01833;
STATES[33] = 145.5689;
STATES[34] = 20.26842;
CONSTANTS[43] = 2.46108e-5;
CONSTANTS[44] = 1.77e-5;
STATES[35] = 1.235996442041028e-8;
CONSTANTS[45] = 0.4975;
STATES[36] = 1.773318268499115e-5;
STATES[37] = 0.9979722;
STATES[38] = 0.9874435;
CONSTANTS[46] = 9e-7;
CONSTANTS[47] = -1;
CONSTANTS[48] = 0.4;
STATES[39] = 0.00107332;
STATES[40] = 0.9960352;
CONSTANTS[49] = 8;
CONSTANTS[50] = 1;
CONSTANTS[51] = 4.75;
CONSTANTS[52] = 0.1125;
CONSTANTS[53] = 8;
CONSTANTS[54] = 10;
CONSTANTS[55] = 1;
CONSTANTS[56] = 0.28;
CONSTANTS[57] = 0.0123;
CONSTANTS[58] = 0.00092;
CONSTANTS[59] = 1.7e-4;
CONSTANTS[60] = 0.004375;
CONSTANTS[61] = 0.75;
CONSTANTS[62] = 0.15;
CONSTANTS[63] = 15;
STATES[41] = 1.159939;
CONSTANTS[64] = 25;
STATES[42] = 6.99469048;
STATES[43] = 0.013408;
STATES[44] = 0.02414815;
STATES[45] = 0.02510283;
CONSTANTS[65] = 2;
CONSTANTS[66] = 0.2;
CONSTANTS[67] = 0.05;
CONSTANTS[68] = 0.07;
CONSTANTS[69] = 0.00238;
CONSTANTS[70] = 0.0005;
CONSTANTS[71] = 1.124;
CONSTANTS[72] = 0.047;
CONSTANTS[73] = 0.00087;
CONSTANTS[74] = 0.0087;
CONSTANTS[75] = 10;
CONSTANTS[76] = 0.8;
STATES[46] = 20.26842;
STATES[47] = 0.0018861341;
CONSTANTS[77] = 0.05;
CONSTANTS[78] = 0.00068;
CONSTANTS[79] = 0.05;
CONSTANTS[80] = 0.0895380;
CONSTANTS[81] =  1000.00* 3.14159265358979*CONSTANTS[8]*CONSTANTS[8]*CONSTANTS[7];
CONSTANTS[82] =  0.500000* pow((CONSTANTS[3]/5.40000), 1.0 / 2);
CONSTANTS[83] =  0.0138542* pow((CONSTANTS[3]/5.40000), 1.0 / 2);
CONSTANTS[84] =  CONSTANTS[81]*0.0600000;
CONSTANTS[85] =  2.00000* 3.14159265358979*CONSTANTS[8]*CONSTANTS[8]+ 2.00000* 3.14159265358979*CONSTANTS[8]*CONSTANTS[7];
CONSTANTS[86] =  CONSTANTS[85]*2.00000;
CONSTANTS[87] = ( 1.00000*1.00000*CONSTANTS[86])/( CONSTANTS[0]*1.00000);
CONSTANTS[88] =  CONSTANTS[81]*0.678000;
CONSTANTS[89] =  CONSTANTS[81]*0.0552000;
CONSTANTS[90] =  CONSTANTS[81]*0.00480000;
CONSTANTS[91] =  CONSTANTS[81]*0.0200000;
CONSTANTS[92] =  CONSTANTS[81]*0.00200000;
CONSTANTS[93] = CONSTANTS[3]/(CONSTANTS[3]+CONSTANTS[20]);
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[4] = 0.1001;
RATES[5] = 0.1001;
RATES[6] = 0.1001;
RATES[7] = 0.1001;
RATES[8] = 0.1001;
RATES[9] = 0.1001;
RATES[10] = 0.1001;
RATES[11] = 0.1001;
RATES[12] = 0.1001;
RATES[13] = 0.1001;
RATES[14] = 0.1001;
RATES[15] = 0.1001;
RATES[16] = 0.1001;
RATES[17] = 0.1001;
RATES[18] = 0.1001;
RATES[19] = 0.1001;
RATES[20] = 0.1001;
RATES[21] = 0.1001;
RATES[22] = 0.1001;
RATES[23] = 0.1001;
RATES[24] = 0.1001;
RATES[25] = 0.1001;
RATES[26] = 0.1001;
RATES[27] = 0.1001;
RATES[28] = 0.1001;
RATES[31] = 0.1001;
RATES[32] = 0.1001;
RATES[35] = 0.1001;
RATES[36] = 0.1001;
RATES[37] = 0.1001;
RATES[38] = 0.1001;
RATES[40] = 0.1001;
RATES[39] = 0.1001;
RATES[43] = 0.1001;
RATES[44] = 0.1001;
RATES[45] = 0.1001;
RATES[41] = 0.1001;
RATES[42] = 0.1001;
RATES[29] = 0.1001;
RATES[30] = 0.1001;
RATES[34] = 0.1001;
RATES[46] = 0.1001;
RATES[33] = 0.1001;
RATES[47] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - - (ALGEBRAIC[112]+ALGEBRAIC[121]+ALGEBRAIC[120]+ALGEBRAIC[113]);
resid[1] = RATES[1] -  - 4.00000*ALGEBRAIC[3]*STATES[1]+ ALGEBRAIC[4]*STATES[2];
resid[2] = RATES[2] -  - ( 3.00000*ALGEBRAIC[3]+ALGEBRAIC[4]+ALGEBRAIC[5])*STATES[2]+ 4.00000*ALGEBRAIC[3]*STATES[1]+ 2.00000*ALGEBRAIC[4]*STATES[3]+ ALGEBRAIC[6]*STATES[6];
resid[3] = RATES[3] -  - ( 2.00000*ALGEBRAIC[3]+ 2.00000*ALGEBRAIC[4]+ 2.00000*ALGEBRAIC[5])*STATES[3]+ 3.00000*ALGEBRAIC[3]*STATES[2]+ 3.00000*ALGEBRAIC[4]*STATES[4]+ ALGEBRAIC[6]*STATES[7];
resid[4] = RATES[4] -  - (ALGEBRAIC[3]+ 3.00000*ALGEBRAIC[4]+ 3.00000*ALGEBRAIC[5])*STATES[4]+ 2.00000*ALGEBRAIC[3]*STATES[3]+ 4.00000*ALGEBRAIC[4]*STATES[5]+ ALGEBRAIC[6]*STATES[8];
resid[5] = RATES[5] -  - ( 4.00000*ALGEBRAIC[4]+ 4.00000*ALGEBRAIC[5])*STATES[5]+ ALGEBRAIC[3]*STATES[4]+ ALGEBRAIC[6]*STATES[9];
resid[6] = RATES[6] -  - ( 3.00000*ALGEBRAIC[3]+ALGEBRAIC[6])*STATES[6]+ ALGEBRAIC[4]*STATES[7]+ ALGEBRAIC[5]*STATES[2];
resid[7] = RATES[7] -  - ( 2.00000*ALGEBRAIC[3]+ALGEBRAIC[4]+ALGEBRAIC[5]+ALGEBRAIC[6])*STATES[7]+ 3.00000*ALGEBRAIC[3]*STATES[6]+ 2.00000*ALGEBRAIC[4]*STATES[8]+ 2.00000*ALGEBRAIC[5]*STATES[3]+ 2.00000*ALGEBRAIC[6]*STATES[10];
resid[8] = RATES[8] -  - (ALGEBRAIC[3]+ 2.00000*ALGEBRAIC[4]+ 2.00000*ALGEBRAIC[5]+ALGEBRAIC[6])*STATES[8]+ 2.00000*ALGEBRAIC[3]*STATES[7]+ 3.00000*ALGEBRAIC[4]*STATES[9]+ 3.00000*ALGEBRAIC[5]*STATES[4]+ 2.00000*ALGEBRAIC[6]*STATES[11];
resid[9] = RATES[9] -  - ( 3.00000*ALGEBRAIC[4]+ 3.00000*ALGEBRAIC[5]+ALGEBRAIC[6])*STATES[9]+ ALGEBRAIC[3]*STATES[8]+ 4.00000*ALGEBRAIC[5]*STATES[5]+ 2.00000*ALGEBRAIC[6]*STATES[12];
resid[10] = RATES[10] -  - ( 2.00000*ALGEBRAIC[3]+ 2.00000*ALGEBRAIC[6])*STATES[10]+ ALGEBRAIC[4]*STATES[11]+ ALGEBRAIC[5]*STATES[7];
resid[11] = RATES[11] -  - (ALGEBRAIC[3]+ALGEBRAIC[4]+ALGEBRAIC[5]+ 2.00000*ALGEBRAIC[6])*STATES[11]+ 2.00000*ALGEBRAIC[3]*STATES[10]+ 2.00000*ALGEBRAIC[4]*STATES[12]+ 2.00000*ALGEBRAIC[5]*STATES[8]+ 3.00000*ALGEBRAIC[6]*STATES[13];
resid[12] = RATES[12] -  - ( 2.00000*ALGEBRAIC[4]+ 2.00000*ALGEBRAIC[5]+ 2.00000*ALGEBRAIC[6])*STATES[12]+ ALGEBRAIC[3]*STATES[11]+ 3.00000*ALGEBRAIC[5]*STATES[9]+ 3.00000*ALGEBRAIC[6]*STATES[14];
resid[13] = RATES[13] -  - (ALGEBRAIC[3]+ 3.00000*ALGEBRAIC[6])*STATES[13]+ ALGEBRAIC[4]*STATES[14]+ ALGEBRAIC[5]*STATES[11];
resid[14] = RATES[14] -  - (ALGEBRAIC[4]+ALGEBRAIC[5]+ 3.00000*ALGEBRAIC[6])*STATES[14]+ ALGEBRAIC[3]*STATES[13]+ 2.00000*ALGEBRAIC[5]*STATES[12]+ 4.00000*ALGEBRAIC[6]*STATES[15];
resid[15] = RATES[15] -  - ( 4.00000*ALGEBRAIC[6]+CONSTANTS[80])*STATES[15]+ ALGEBRAIC[5]*STATES[14]+ ALGEBRAIC[7]*STATES[16];
resid[16] = RATES[16] -  - (ALGEBRAIC[7]+ALGEBRAIC[9])*STATES[16]+ ALGEBRAIC[8]*STATES[17]+ CONSTANTS[80]*STATES[15];
resid[17] = RATES[17] -  - ALGEBRAIC[8]*STATES[17]+ ALGEBRAIC[9]*STATES[16];
resid[18] = RATES[18] -  - (ALGEBRAIC[12]+ALGEBRAIC[83]+ALGEBRAIC[17])*STATES[18]+ ALGEBRAIC[13]*STATES[19]+ CONSTANTS[14]*STATES[20]+ ALGEBRAIC[16]*STATES[22];
resid[19] = RATES[19] -  - (ALGEBRAIC[13]+ALGEBRAIC[83]+ALGEBRAIC[17])*STATES[19]+ ALGEBRAIC[12]*STATES[18]+ CONSTANTS[14]*STATES[21]+ ALGEBRAIC[16]*STATES[23];
resid[20] = RATES[20] -  - (ALGEBRAIC[12]+CONSTANTS[14]+ALGEBRAIC[124])*STATES[20]+ ALGEBRAIC[83]*STATES[18]+ ALGEBRAIC[13]*STATES[21]+ ALGEBRAIC[123]*STATES[24];
resid[21] = RATES[21] -  - (ALGEBRAIC[13]+CONSTANTS[14]+ALGEBRAIC[124])*STATES[21]+ ALGEBRAIC[83]*STATES[19]+ ALGEBRAIC[12]*STATES[20]+ ALGEBRAIC[123]*STATES[25];
resid[22] = RATES[22] -  - (ALGEBRAIC[12]+ALGEBRAIC[125]+ALGEBRAIC[16])*STATES[22]+ ALGEBRAIC[17]*STATES[18]+ CONSTANTS[15]*STATES[24]+ ALGEBRAIC[13]*STATES[23];
resid[23] = RATES[23] -  - (ALGEBRAIC[13]+ALGEBRAIC[125]+ALGEBRAIC[16])*STATES[23]+ ALGEBRAIC[17]*STATES[19]+ CONSTANTS[15]*STATES[25]+ ALGEBRAIC[12]*STATES[22];
resid[24] = RATES[24] -  - (ALGEBRAIC[12]+CONSTANTS[15]+ALGEBRAIC[123])*STATES[24]+ ALGEBRAIC[125]*STATES[22]+ ALGEBRAIC[124]*STATES[20]+ ALGEBRAIC[13]*STATES[25];
resid[25] = RATES[25] -  - (ALGEBRAIC[13]+CONSTANTS[15]+ALGEBRAIC[123])*STATES[25]+ ALGEBRAIC[125]*STATES[23]+ ALGEBRAIC[124]*STATES[21]+ ALGEBRAIC[12]*STATES[24];
resid[26] = RATES[26] -  ALGEBRAIC[19]*(1.00000 - STATES[26]) -  ALGEBRAIC[20]*STATES[26];
resid[27] = RATES[27] -  ALGEBRAIC[21]*(1.00000 - STATES[27]) -  ALGEBRAIC[22]*STATES[27];
resid[28] = RATES[28] -  ALGEBRAIC[23]*(1.00000 - STATES[28]) -  ALGEBRAIC[24]*STATES[28];
resid[29] = RATES[31] -  ALGEBRAIC[33]*(1.00000 - STATES[31]) -  ALGEBRAIC[34]*STATES[31];
resid[30] = RATES[32] - (ALGEBRAIC[35] - STATES[32])/CONSTANTS[41];
resid[31] = RATES[35] - (ALGEBRAIC[45] - STATES[35])/ALGEBRAIC[46];
resid[32] = RATES[36] - (ALGEBRAIC[52] - STATES[36])/ALGEBRAIC[51];
resid[33] = RATES[37] -  ALGEBRAIC[54]*(1.00000 - STATES[37]) -  ALGEBRAIC[53]*STATES[37];
resid[34] = RATES[38] -  ALGEBRAIC[56]*(1.00000 - STATES[38]) -  ALGEBRAIC[55]*STATES[38];
resid[35] = RATES[40] - (ALGEBRAIC[105] - STATES[40])/CONSTANTS[49];
resid[36] = RATES[39] - - (ALGEBRAIC[127]+STATES[39])/ALGEBRAIC[118];
resid[37] = RATES[43] - (( - ((ALGEBRAIC[98]+ALGEBRAIC[97]) -  2.00000*ALGEBRAIC[94])*CONSTANTS[87])/( 2.00000*CONSTANTS[88])+( (ALGEBRAIC[119] - ALGEBRAIC[61])*CONSTANTS[89])/CONSTANTS[88]) - ( ALGEBRAIC[110]*CONSTANTS[91])/CONSTANTS[88];
resid[38] = RATES[44] - - ((ALGEBRAIC[110]+ALGEBRAIC[111]) - (( 2.00000*ALGEBRAIC[95]*CONSTANTS[87])/( 2.00000*CONSTANTS[91])+( STATES[39]*CONSTANTS[90])/CONSTANTS[91]));
resid[39] = RATES[45] - - (( ALGEBRAIC[115]*CONSTANTS[87])/( 2.00000*CONSTANTS[92]) - ( ALGEBRAIC[111]*CONSTANTS[91])/CONSTANTS[92]);
resid[40] = RATES[41] - ALGEBRAIC[119] - (ALGEBRAIC[61]+( ALGEBRAIC[109]*CONSTANTS[90])/CONSTANTS[89]);
resid[41] = RATES[42] - ALGEBRAIC[109] - STATES[39];
resid[42] = RATES[29] - - (( ( 3.00000*ALGEBRAIC[94]+ 3.00000*ALGEBRAIC[85]+ALGEBRAIC[84]+ALGEBRAIC[100]+ALGEBRAIC[32])*CONSTANTS[87])/CONSTANTS[88] - (ALGEBRAIC[43]+( ALGEBRAIC[77]*CONSTANTS[91])/CONSTANTS[88]));
resid[43] = RATES[30] - - (( 3.00000*ALGEBRAIC[95]*CONSTANTS[87])/CONSTANTS[91]+ALGEBRAIC[77]);
resid[44] = RATES[34] - - (( ALGEBRAIC[99]*CONSTANTS[87])/( - 1.00000*CONSTANTS[88]) - (ALGEBRAIC[43]+ALGEBRAIC[44]+( ALGEBRAIC[78]*CONSTANTS[91])/CONSTANTS[88]));
resid[45] = RATES[46] - - (( ALGEBRAIC[104]*CONSTANTS[87])/( - 1.00000*CONSTANTS[91])+ALGEBRAIC[78]);
resid[46] = RATES[33] - - (( ((ALGEBRAIC[114]+ALGEBRAIC[102]+ALGEBRAIC[101]+ALGEBRAIC[103]+ALGEBRAIC[96]+ALGEBRAIC[1]) -  2.00000*ALGEBRAIC[85])*CONSTANTS[87])/CONSTANTS[88] - ALGEBRAIC[44]);
resid[47] = RATES[47] -  CONSTANTS[77]*ALGEBRAIC[79]*(ALGEBRAIC[79] - STATES[47]) -  CONSTANTS[78]*STATES[47];
}
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] =  0.0148640*exp(( 0.0298770*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[4] =  0.0839860*exp(( - 0.0554610*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[5] =  0.0146010*exp(( 0.244650*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[6] =  0.00311730*exp(( - 0.426250*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[7] =  0.0773200*exp(( - 0.0647260*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[8] =  0.794050*exp(( - 0.0801740*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[9] =  0.586380*exp(( 0.282060*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[10] = 0.590000+( 0.800000*exp( 0.0520000*(STATES[0]+13.0000)))/(1.00000+exp( 0.132000*(STATES[0]+13.0000)));
ALGEBRAIC[11] = 1.00000/(1.00000+exp(- (STATES[0] - 13.5600)/9.45000));
ALGEBRAIC[12] = ALGEBRAIC[11]/ALGEBRAIC[10];
ALGEBRAIC[13] = (1.00000 - ALGEBRAIC[11])/ALGEBRAIC[10];
ALGEBRAIC[15] = 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[14] = (1.00000/(1.00000+exp((STATES[0]+17.5000)/3.00000))+0.250000)/1.25000;
ALGEBRAIC[16] = ALGEBRAIC[14]/ALGEBRAIC[15];
ALGEBRAIC[17] = (1.00000 - ALGEBRAIC[14])/ALGEBRAIC[15];
ALGEBRAIC[19] = ( 0.320000*(STATES[0]+47.1300))/(1.00000 - exp( - 0.100000*(STATES[0]+47.1300)));
ALGEBRAIC[20] =  0.0800000*exp(- STATES[0]/11.0000);
ALGEBRAIC[21] = (CONDVAR[2]>=0.00000 ? 0.00000 :  0.135000*exp((80.0000+STATES[0])/- 6.80000));
ALGEBRAIC[22] = (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[23] = (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[24] = (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[31] = ( CONSTANTS[0]*STATES[0])/( CONSTANTS[2]*CONSTANTS[1]);
ALGEBRAIC[32] = ( CONSTANTS[0]*CONSTANTS[38]*ALGEBRAIC[31]*( STATES[29]*exp(ALGEBRAIC[31]) - CONSTANTS[5]))/(exp(ALGEBRAIC[31]) - 1.00000);
ALGEBRAIC[33] = ( 0.320000*(STATES[0]+47.1300))/(1.00000 - exp( - 0.100000*(STATES[0]+47.1300)));
ALGEBRAIC[34] =  0.0800000*exp(- STATES[0]/11.0000);
ALGEBRAIC[35] = 1.00000/(1.00000+exp((STATES[0]+91.0000)/6.10000));
ALGEBRAIC[36] =  (( CONSTANTS[2]*CONSTANTS[1])/CONSTANTS[0])*log(CONSTANTS[5]/STATES[29]);
ALGEBRAIC[39] =  (( - CONSTANTS[2]*CONSTANTS[1])/CONSTANTS[0])*log(CONSTANTS[6]/STATES[34]);
ALGEBRAIC[43] = ( CONSTANTS[43]*pow(ALGEBRAIC[36] - ALGEBRAIC[39], 4.00000))/(pow(ALGEBRAIC[36] - ALGEBRAIC[39], 4.00000)+pow(87.8251, 4.00000));
ALGEBRAIC[37] =  (( CONSTANTS[2]*CONSTANTS[1])/CONSTANTS[0])*log(CONSTANTS[3]/STATES[33]);
ALGEBRAIC[44] = ( CONSTANTS[44]*(ALGEBRAIC[37] - ALGEBRAIC[39]))/((ALGEBRAIC[37]+87.8251) - ALGEBRAIC[39]);
ALGEBRAIC[45] = 1.00000/(1.00000+exp(- (STATES[0]+10.0850)/4.25000));
ALGEBRAIC[46] = 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[49] = 1.00000/( 1.20890*(1.00000+exp((STATES[0] - 18.4099)/- 29.3814)));
ALGEBRAIC[50] = 3.50000/(1.00000+exp((STATES[0]+100.000)/29.3814));
ALGEBRAIC[51] = 1.00000/(ALGEBRAIC[49]+ALGEBRAIC[50]);
ALGEBRAIC[52] = 1.00000/(1.00000+exp((STATES[0]+9.43700)/- 7.13300));
ALGEBRAIC[53] = 1.00000/( 9.79530*(1.00000+exp((STATES[0]+19.0000)/- 9.00000)));
ALGEBRAIC[54] = 0.0250000/(1.00000+exp((STATES[0]+58.0000)/5.00000));
ALGEBRAIC[55] = 1.00000/( 9.79530*(1.00000+exp((STATES[0]+19.0000)/- 9.00000)));
ALGEBRAIC[56] = 1.00000/( 250.000*(1.00000+exp((STATES[0]+60.0000)/5.00000)));
ALGEBRAIC[61] =  (0.00437500/CONSTANTS[63])*STATES[41];
ALGEBRAIC[77] = (STATES[30] - STATES[29])/CONSTANTS[66];
ALGEBRAIC[78] = (STATES[46] - STATES[34])/CONSTANTS[66];
ALGEBRAIC[69] = ((CONSTANTS[71]+CONSTANTS[72]) - STATES[44])+CONSTANTS[73]+CONSTANTS[74];
ALGEBRAIC[70] = ( CONSTANTS[74]*CONSTANTS[73] -  STATES[44]*(CONSTANTS[73]+CONSTANTS[74]))+ CONSTANTS[72]*CONSTANTS[74]+ CONSTANTS[71]*CONSTANTS[73];
ALGEBRAIC[71] =  - CONSTANTS[73]*CONSTANTS[74]*STATES[44];
ALGEBRAIC[73] =  (( 2.00000* pow((pow(ALGEBRAIC[69], 2.00000) -  3.00000*ALGEBRAIC[70]), 1.0 / 2))/3.00000)*cos(acos((( 9.00000*ALGEBRAIC[69]*ALGEBRAIC[70] -  2.00000*pow(ALGEBRAIC[69], 3.00000)) -  27.0000*ALGEBRAIC[71])/( 2.00000*pow(pow(ALGEBRAIC[69], 2.00000) -  3.00000*ALGEBRAIC[70], 1.50000)))/3.00000) - ALGEBRAIC[69]/3.00000;
ALGEBRAIC[79] = ( CONSTANTS[79]*(1.00000 - STATES[47])*1.00000)/(1.00000+CONSTANTS[62]/ALGEBRAIC[73]);
ALGEBRAIC[66] = ((CONSTANTS[71]+CONSTANTS[72]) - STATES[45])+CONSTANTS[73]+CONSTANTS[74];
ALGEBRAIC[67] = ( CONSTANTS[74]*CONSTANTS[73] -  STATES[45]*(CONSTANTS[73]+CONSTANTS[74]))+ CONSTANTS[72]*CONSTANTS[74]+ CONSTANTS[71]*CONSTANTS[73];
ALGEBRAIC[68] =  - CONSTANTS[73]*CONSTANTS[74]*STATES[45];
ALGEBRAIC[72] =  (( 2.00000* pow((pow(ALGEBRAIC[66], 2.00000) -  3.00000*ALGEBRAIC[67]), 1.0 / 2))/3.00000)*cos(acos((( 9.00000*ALGEBRAIC[66]*ALGEBRAIC[67] -  2.00000*pow(ALGEBRAIC[66], 3.00000)) -  27.0000*ALGEBRAIC[68])/( 2.00000*pow(pow(ALGEBRAIC[66], 2.00000) -  3.00000*ALGEBRAIC[67], 1.50000)))/3.00000) - ALGEBRAIC[66]/3.00000;
ALGEBRAIC[83] = 3.00000/(1.00000+pow(0.00300000/ALGEBRAIC[72], 4.00000));
ALGEBRAIC[84] =  CONSTANTS[18]*pow(STATES[26], 3.00000)*STATES[27]*STATES[28]*(STATES[0] - ALGEBRAIC[36]);
ALGEBRAIC[25] = ( CONSTANTS[22]*(STATES[0] - CONSTANTS[23])*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]);
ALGEBRAIC[26] = 1.00000/(1.00000+exp(- ALGEBRAIC[25]));
ALGEBRAIC[27] = pow(STATES[29]/(STATES[29]+CONSTANTS[19]), 3.00000);
ALGEBRAIC[85] =  CONSTANTS[21]*ALGEBRAIC[26]*CONSTANTS[93]*ALGEBRAIC[27];
ALGEBRAIC[62] = ((CONSTANTS[67]+CONSTANTS[68]) - STATES[43])+CONSTANTS[70]+CONSTANTS[69];
ALGEBRAIC[63] = ( CONSTANTS[70]*CONSTANTS[69] -  STATES[43]*(CONSTANTS[70]+CONSTANTS[69]))+ CONSTANTS[68]*CONSTANTS[69]+ CONSTANTS[67]*CONSTANTS[70];
ALGEBRAIC[64] =  - CONSTANTS[70]*CONSTANTS[69]*STATES[43];
ALGEBRAIC[65] =  (( 2.00000* pow((pow(ALGEBRAIC[62], 2.00000) -  3.00000*ALGEBRAIC[63]), 1.0 / 2))/3.00000)*cos(acos((( 9.00000*ALGEBRAIC[62]*ALGEBRAIC[63] -  2.00000*pow(ALGEBRAIC[62], 3.00000)) -  27.0000*ALGEBRAIC[64])/( 2.00000*pow(pow(ALGEBRAIC[62], 2.00000) -  3.00000*ALGEBRAIC[63], 1.50000)))/3.00000) - ALGEBRAIC[62]/3.00000;
ALGEBRAIC[86] =  0.800000*CONSTANTS[25]*( pow(STATES[29], 3.00000)*CONSTANTS[4]*exp(( CONSTANTS[27]*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])) -  pow(CONSTANTS[5], 3.00000)*ALGEBRAIC[65]*exp(( (CONSTANTS[27] - 1.00000)*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])));
ALGEBRAIC[87] = 1.00000+pow(CONSTANTS[24]/ALGEBRAIC[65], 2.00000);
ALGEBRAIC[28] = 1.00000+ CONSTANTS[26]*exp(( (CONSTANTS[27] - 1.00000)*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[88] =  CONSTANTS[31]*pow(STATES[29], 3.00000)+ pow(CONSTANTS[29], 3.00000)*ALGEBRAIC[65]+ pow(CONSTANTS[28], 3.00000)*CONSTANTS[4]*(1.00000+ALGEBRAIC[65]/CONSTANTS[30]);
ALGEBRAIC[89] =  CONSTANTS[30]*pow(CONSTANTS[5], 3.00000)*(1.00000+pow(STATES[29]/CONSTANTS[28], 3.00000))+ pow(STATES[29], 3.00000)*CONSTANTS[4]+ pow(CONSTANTS[5], 3.00000)*ALGEBRAIC[65];
ALGEBRAIC[94] = ALGEBRAIC[86]/( ALGEBRAIC[87]*ALGEBRAIC[28]*(ALGEBRAIC[88]+ALGEBRAIC[89]));
ALGEBRAIC[90] =  0.200000*CONSTANTS[25]*( pow(STATES[30], 3.00000)*CONSTANTS[4]*exp(( CONSTANTS[27]*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])) -  pow(CONSTANTS[5], 3.00000)*ALGEBRAIC[73]*exp(( (CONSTANTS[27] - 1.00000)*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])));
ALGEBRAIC[91] = 1.00000+pow(CONSTANTS[24]/ALGEBRAIC[73], 2.00000);
ALGEBRAIC[29] = 1.00000+ CONSTANTS[26]*exp(( (CONSTANTS[27] - 1.00000)*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]));
ALGEBRAIC[92] =  CONSTANTS[31]*pow(STATES[30], 3.00000)+ pow(CONSTANTS[29], 3.00000)*ALGEBRAIC[73]+ pow(CONSTANTS[28], 3.00000)*CONSTANTS[4]*(1.00000+ALGEBRAIC[73]/CONSTANTS[30]);
ALGEBRAIC[93] =  CONSTANTS[30]*pow(CONSTANTS[5], 3.00000)*(1.00000+pow(STATES[30]/CONSTANTS[28], 3.00000))+ pow(STATES[30], 3.00000)*CONSTANTS[4]+ pow(CONSTANTS[5], 3.00000)*ALGEBRAIC[73];
ALGEBRAIC[95] = ALGEBRAIC[90]/( ALGEBRAIC[91]*ALGEBRAIC[29]*(ALGEBRAIC[92]+ALGEBRAIC[93]));
ALGEBRAIC[30] = 1.00000/(1.00000+exp((7.48800 - STATES[0])/5.98000));
ALGEBRAIC[96] =  CONSTANTS[32]*ALGEBRAIC[30]*(STATES[0] - ALGEBRAIC[37]);
ALGEBRAIC[97] = ( CONSTANTS[33]*ALGEBRAIC[65])/(CONSTANTS[34]+ALGEBRAIC[65]);
ALGEBRAIC[98] = ( (( CONSTANTS[35]*4.00000*STATES[0]*pow(CONSTANTS[0], 2.00000))/( CONSTANTS[2]*CONSTANTS[1]))*( CONSTANTS[36]*ALGEBRAIC[65]*exp(( 2.00000*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])) -  CONSTANTS[37]*CONSTANTS[4]))/(exp(( 2.00000*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])) - 1.00000);
ALGEBRAIC[99] =  CONSTANTS[39]*(STATES[0] - ALGEBRAIC[39]);
ALGEBRAIC[100] =  CONSTANTS[40]*pow(STATES[31], 3.00000)*STATES[32]*(STATES[0] - ALGEBRAIC[36]);
ALGEBRAIC[40] = 1.02000/(1.00000+exp( 0.238500*((STATES[0] - ALGEBRAIC[37]) - 59.2150)));
ALGEBRAIC[41] = ( 0.491240*exp( 0.0803200*((STATES[0] - ALGEBRAIC[37])+5.47600))+exp( 0.0617500*((STATES[0] - ALGEBRAIC[37]) - 594.310)))/(1.00000+exp( - 0.514300*((STATES[0] - ALGEBRAIC[37])+4.75300)));
ALGEBRAIC[42] = ALGEBRAIC[40]/(ALGEBRAIC[40]+ALGEBRAIC[41]);
ALGEBRAIC[101] =  CONSTANTS[82]*ALGEBRAIC[42]*(STATES[0] - ALGEBRAIC[37]);
ALGEBRAIC[47] = 1.00000/(1.00000+exp((STATES[0]+10.0000)/15.4000));
ALGEBRAIC[102] =  CONSTANTS[83]*STATES[35]*ALGEBRAIC[47]*(STATES[0] - ALGEBRAIC[37]);
ALGEBRAIC[48] = exp(STATES[0]/550.000);
ALGEBRAIC[103] =  CONSTANTS[45]*pow(STATES[36], 3.00000)*STATES[37]*STATES[38]*ALGEBRAIC[48]*(STATES[0] - ALGEBRAIC[37]);
ALGEBRAIC[57] = ( (( CONSTANTS[46]*pow(CONSTANTS[47], 2.00000)*STATES[0]*pow(CONSTANTS[0], 2.00000))/( CONSTANTS[2]*CONSTANTS[1]))*(STATES[34] -  CONSTANTS[6]*exp(( STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1]))))/(1.00000 - exp(( STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])));
ALGEBRAIC[58] = 1.00000 - 1.00000/(1.00000+pow(STATES[39]/CONSTANTS[48], 2.00000));
ALGEBRAIC[104] =  ALGEBRAIC[57]*STATES[40]*ALGEBRAIC[58];
ALGEBRAIC[60] = 0.0250000/(1.00000+exp((STATES[0]+58.0000)/5.00000));
ALGEBRAIC[59] = 1.00000/( 5.00000*(1.00000+exp((STATES[0]+19.0000)/- 9.00000)));
ALGEBRAIC[105] = ALGEBRAIC[60]/(ALGEBRAIC[60]+ALGEBRAIC[59]);
ALGEBRAIC[74] = (CONSTANTS[75]+CONSTANTS[76]) - STATES[42];
ALGEBRAIC[75] =  STATES[42]*CONSTANTS[76];
ALGEBRAIC[76] = - ALGEBRAIC[74]/2.00000+ pow((pow(ALGEBRAIC[74], 2.00000)+ 4.00000*ALGEBRAIC[75]), 1.0 / 2)/2.00000;
ALGEBRAIC[109] = (STATES[41] - ALGEBRAIC[76])/CONSTANTS[64];
ALGEBRAIC[110] = (ALGEBRAIC[73] - ALGEBRAIC[65])/CONSTANTS[66];
ALGEBRAIC[111] = (ALGEBRAIC[73] - ALGEBRAIC[72])/CONSTANTS[65];
ALGEBRAIC[112] = ALGEBRAIC[84]+ 3.00000*(ALGEBRAIC[94]+ALGEBRAIC[95])+ 3.00000*ALGEBRAIC[85]+ALGEBRAIC[100]+ALGEBRAIC[32];
ALGEBRAIC[113] = ALGEBRAIC[99]+ALGEBRAIC[104];
ALGEBRAIC[80] =  0.0826000*(1.00000+0.600000/(1.00000+pow(3.80000e-05/ALGEBRAIC[65], 1.40000)));
ALGEBRAIC[2] = STATES[16]+STATES[17];
ALGEBRAIC[38] =  (( CONSTANTS[2]*CONSTANTS[1])/CONSTANTS[0])*log((CONSTANTS[3]+ CONSTANTS[42]*CONSTANTS[5])/(STATES[33]+ CONSTANTS[42]*STATES[29]));
ALGEBRAIC[114] =  ALGEBRAIC[80]*ALGEBRAIC[2]*(STATES[0] - ALGEBRAIC[38]);
ALGEBRAIC[81] = ( (( CONSTANTS[13]*4.00000*STATES[0]*pow(CONSTANTS[0], 2.00000))/( CONSTANTS[2]*CONSTANTS[1]))*( CONSTANTS[16]*ALGEBRAIC[72]*exp(( 2.00000*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])) -  CONSTANTS[17]*CONSTANTS[4]))/(exp(( 2.00000*STATES[0]*CONSTANTS[0])/( CONSTANTS[2]*CONSTANTS[1])) - 1.00000);
ALGEBRAIC[115] =  ALGEBRAIC[81]*(STATES[19]+STATES[21]);
ALGEBRAIC[106] = CONSTANTS[55]/(1.00000+pow(CONSTANTS[56]/( 1.00000*ALGEBRAIC[79]), CONSTANTS[54]));
ALGEBRAIC[117] =  CONSTANTS[51]*(1.00000+ALGEBRAIC[106]);
ALGEBRAIC[118] = ALGEBRAIC[117]/(1.00000+CONSTANTS[57]/ALGEBRAIC[76]);
ALGEBRAIC[108] = ( CONSTANTS[59]*ALGEBRAIC[79]*1.00000)/(CONSTANTS[62]+ ALGEBRAIC[79]*1.00000);
ALGEBRAIC[107] = ( CONSTANTS[61]*ALGEBRAIC[79]*1.00000)/(CONSTANTS[62]+ ALGEBRAIC[79]*1.00000);
ALGEBRAIC[119] = ( (ALGEBRAIC[107]+1.00000)*CONSTANTS[60]*ALGEBRAIC[65])/((ALGEBRAIC[65]+CONSTANTS[58]) - ALGEBRAIC[108]);
ALGEBRAIC[120] = (ALGEBRAIC[115]+ALGEBRAIC[98]+ALGEBRAIC[97]) -  2.00000*(ALGEBRAIC[94]+ALGEBRAIC[95]);
ALGEBRAIC[121] = ALGEBRAIC[102]+ALGEBRAIC[114]+ALGEBRAIC[101]+ALGEBRAIC[96]+ - 2.00000*ALGEBRAIC[85]+ALGEBRAIC[103]+ALGEBRAIC[1];
ALGEBRAIC[82] = 25.0000 - 17.5000/(1.00000+pow(0.00300000/ALGEBRAIC[72], 4.00000));
ALGEBRAIC[116] = 1.00000/( ALGEBRAIC[82]*(1.00000+exp(- (STATES[0]+0.213000)/10.8070)));
ALGEBRAIC[122] = 1.00000/(1.00000/( 24.8280*(1.00000+exp((STATES[0]+49.1000)/10.3490)))+ALGEBRAIC[116]);
ALGEBRAIC[18] = (1.00000/(1.00000+exp((STATES[0]+17.5000)/3.00000))+0.000100000)/1.00010;
ALGEBRAIC[123] = ALGEBRAIC[18]/ALGEBRAIC[122];
ALGEBRAIC[124] = (1.00000 - ALGEBRAIC[18])/ALGEBRAIC[122];
ALGEBRAIC[125] = ( CONSTANTS[15]*ALGEBRAIC[16]*ALGEBRAIC[124]*ALGEBRAIC[83])/( ALGEBRAIC[17]*ALGEBRAIC[123]*CONSTANTS[14]);
ALGEBRAIC[126] =  ALGEBRAIC[117]*CONSTANTS[52];
ALGEBRAIC[127] = ( ALGEBRAIC[115]*ALGEBRAIC[126])/(1.00000+pow(CONSTANTS[50]/ALGEBRAIC[76], CONSTANTS[53]));
}
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;
SI[46] = 1.0;
SI[47] = 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;
}