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 108 entries in the algebraic variable array.
   There are a total of 55 entries in each of the rate and state variable arrays.
   There are a total of 130 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * CONSTANTS[0] is R in component model_parameters (joule_per_kilomole_kelvin).
 * CONSTANTS[1] is T in component model_parameters (kelvin).
 * CONSTANTS[2] is F in component model_parameters (coulomb_per_mole).
 * CONSTANTS[3] is Na_e in component model_parameters (millimolar).
 * CONSTANTS[4] is Ca_e in component model_parameters (millimolar).
 * CONSTANTS[5] is K_e in component model_parameters (millimolar).
 * CONSTANTS[6] is ATP_i in component model_parameters (millimolar).
 * CONSTANTS[127] is Vt in component model_parameters (cm3).
 * CONSTANTS[84] is Vd in component model_parameters (cm3).
 * CONSTANTS[86] is Vmyo in component model_parameters (cm3).
 * CONSTANTS[80] is Sms in component model_parameters (cm2).
 * CONSTANTS[90] is Smt in component model_parameters (cm2).
 * CONSTANTS[129] is Cms in component model_parameters (microF).
 * CONSTANTS[128] is Cmt in component model_parameters (microF).
 * CONSTANTS[89] is Rst in component model_parameters (ohm).
 * CONSTANTS[87] is VSRup in component model_parameters (cm3).
 * CONSTANTS[85] is VSRrel in component model_parameters (cm3).
 * CONSTANTS[83] is Vc in component model_parameters (cm3).
 * CONSTANTS[88] is pt in component model_parameters (dimensionless).
 * CONSTANTS[7] is Rot in component model_parameters (ohm_cm).
 * CONSTANTS[8] is rt in component model_parameters (cm).
 * CONSTANTS[9] is Lt in component model_parameters (cm).
 * CONSTANTS[10] is rc in component model_parameters (cm).
 * CONSTANTS[11] is Lc in component model_parameters (cm).
 * CONSTANTS[12] is ptcm in component model_parameters (per_cm2).
 * ALGEBRAIC[0] is i_circ in component i_circ (microA).
 * STATES[0] is Vm_s in component Vm_s (millivolt).
 * STATES[1] is Vm_t in component Vm_t (millivolt).
 * CONSTANTS[91] is g_Na_s in component membrane_permeabilities (milliS).
 * CONSTANTS[92] is g_Naps_s in component membrane_permeabilities (milliS).
 * CONSTANTS[93] is q_Kr_s in component membrane_permeabilities (milliS).
 * CONSTANTS[94] is q_Ks_s in component membrane_permeabilities (milliS).
 * CONSTANTS[95] is g_Kp_s in component membrane_permeabilities (milliS).
 * CONSTANTS[96] is g_Kto_s in component membrane_permeabilities (milliS).
 * CONSTANTS[97] is g_K1_s in component membrane_permeabilities (milliS).
 * CONSTANTS[98] is g_KNa_s in component membrane_permeabilities (milliS).
 * CONSTANTS[99] is g_KATP_s in component membrane_permeabilities (milliS).
 * CONSTANTS[100] is g_Nab_s in component membrane_permeabilities (milliS).
 * CONSTANTS[101] is g_Cab_s in component membrane_permeabilities (milliS).
 * CONSTANTS[102] is i_pCa_max_s in component membrane_permeabilities (microA).
 * CONSTANTS[103] is i_NaK_max_s in component membrane_permeabilities (microA).
 * CONSTANTS[104] is i_NaCa_max_s in component membrane_permeabilities (microA).
 * CONSTANTS[105] is P_CaL_s in component membrane_permeabilities (litre_per_second).
 * CONSTANTS[106] is P_KL_s in component membrane_permeabilities (litre_per_second).
 * CONSTANTS[107] is P_nsNa_s in component membrane_permeabilities (litre_per_second).
 * CONSTANTS[108] is P_nsK_s in component membrane_permeabilities (litre_per_second).
 * CONSTANTS[109] is g_Na_t in component membrane_permeabilities (milliS).
 * CONSTANTS[110] is g_Naps_t in component membrane_permeabilities (milliS).
 * CONSTANTS[111] is q_Kr_t in component membrane_permeabilities (milliS).
 * CONSTANTS[112] is q_Ks_t in component membrane_permeabilities (milliS).
 * CONSTANTS[113] is g_Kp_t in component membrane_permeabilities (milliS).
 * CONSTANTS[114] is g_Kto_t in component membrane_permeabilities (milliS).
 * CONSTANTS[115] is g_K1_t in component membrane_permeabilities (milliS).
 * CONSTANTS[116] is g_KNa_t in component membrane_permeabilities (milliS).
 * CONSTANTS[117] is g_KATP_t in component membrane_permeabilities (milliS).
 * CONSTANTS[118] is g_Nab_t in component membrane_permeabilities (milliS).
 * CONSTANTS[119] is g_Cab_t in component membrane_permeabilities (milliS).
 * CONSTANTS[120] is i_pCa_max_t in component membrane_permeabilities (microA).
 * CONSTANTS[121] is i_NaK_max_t in component membrane_permeabilities (microA).
 * CONSTANTS[122] is i_NaCa_max_t in component membrane_permeabilities (microA).
 * CONSTANTS[123] is P_CaL_t in component membrane_permeabilities (litre_per_second).
 * CONSTANTS[124] is P_KL_t in component membrane_permeabilities (litre_per_second).
 * CONSTANTS[125] is P_nsNa_t in component membrane_permeabilities (litre_per_second).
 * CONSTANTS[126] is P_nsK_t in component membrane_permeabilities (litre_per_second).
 * CONSTANTS[13] is g_Na in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[14] is fNat in component membrane_permeabilities (dimensionless).
 * CONSTANTS[15] is g_Naps in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[16] is fNapst in component membrane_permeabilities (dimensionless).
 * CONSTANTS[17] is q_Kr in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[18] is fKrt in component membrane_permeabilities (dimensionless).
 * CONSTANTS[19] is q_Ks in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[20] is fKst in component membrane_permeabilities (dimensionless).
 * CONSTANTS[21] is g_Kp in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[22] is fKpt in component membrane_permeabilities (dimensionless).
 * CONSTANTS[23] is g_Kto in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[24] is fKtot in component membrane_permeabilities (dimensionless).
 * CONSTANTS[25] is g_K1 in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[26] is fK1t in component membrane_permeabilities (dimensionless).
 * CONSTANTS[27] is g_KNa in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[28] is fKNat in component membrane_permeabilities (dimensionless).
 * CONSTANTS[29] is g_KATP in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[30] is fKATPt in component membrane_permeabilities (dimensionless).
 * CONSTANTS[31] is g_Nab in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[32] is fNabt in component membrane_permeabilities (dimensionless).
 * CONSTANTS[33] is g_Cab in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[34] is fCabt in component membrane_permeabilities (dimensionless).
 * CONSTANTS[35] is P_CaL in component membrane_permeabilities (litre_per_second_cm2).
 * CONSTANTS[36] is fCaLt in component membrane_permeabilities (dimensionless).
 * CONSTANTS[37] is P_KL in component membrane_permeabilities (litre_per_second_cm2).
 * CONSTANTS[38] is P_nsNa in component membrane_permeabilities (litre_per_second_cm2).
 * CONSTANTS[39] is fnsNat in component membrane_permeabilities (dimensionless).
 * CONSTANTS[40] is P_nsK in component membrane_permeabilities (litre_per_second_cm2).
 * CONSTANTS[41] is fnsKt in component membrane_permeabilities (dimensionless).
 * CONSTANTS[42] is i_NaCa_max in component membrane_permeabilities (microA_per_cm2).
 * CONSTANTS[43] is fNaCat in component membrane_permeabilities (dimensionless).
 * CONSTANTS[44] is i_NaK_max in component membrane_permeabilities (microA_per_cm2).
 * CONSTANTS[45] is fNaKt in component membrane_permeabilities (dimensionless).
 * CONSTANTS[46] is i_pCa_max in component membrane_permeabilities (microA_per_cm2).
 * CONSTANTS[47] is fpCat in component membrane_permeabilities (dimensionless).
 * ALGEBRAIC[1] is i_Kext in component i_Kext (microA).
 * CONSTANTS[48] is stim_Period in component i_Kext (second).
 * ALGEBRAIC[3] is i_Na_s in component i_Na_s (microA).
 * ALGEBRAIC[2] is E_Na_s in component i_Na_s (millivolt).
 * STATES[2] is Na_i in component ion_concentrations (millimolar).
 * STATES[3] is K_i in component ion_concentrations (millimolar).
 * STATES[4] is m in component i_Na_s_m_gate (dimensionless).
 * STATES[5] is h in component i_Na_s_h_gate (dimensionless).
 * ALGEBRAIC[4] is m_infinity in component i_Na_s_m_gate (dimensionless).
 * ALGEBRAIC[5] is tau_m in component i_Na_s_m_gate (second).
 * ALGEBRAIC[6] is h_infinity in component i_Na_s_h_gate (dimensionless).
 * ALGEBRAIC[7] is tau_h in component i_Na_s_h_gate (second).
 * ALGEBRAIC[9] is i_Na_t in component i_Na_t (microA).
 * ALGEBRAIC[8] is E_Na_t in component i_Na_t (millivolt).
 * STATES[6] is Na_t in component ion_concentrations (millimolar).
 * STATES[7] is K_t in component ion_concentrations (millimolar).
 * STATES[8] is m in component i_Na_t_m_gate (dimensionless).
 * STATES[9] is h in component i_Na_t_h_gate (dimensionless).
 * ALGEBRAIC[10] is m_infinity in component i_Na_t_m_gate (dimensionless).
 * ALGEBRAIC[11] is tau_m in component i_Na_t_m_gate (second).
 * ALGEBRAIC[12] is h_infinity in component i_Na_t_h_gate (dimensionless).
 * ALGEBRAIC[13] is tau_h in component i_Na_t_h_gate (second).
 * ALGEBRAIC[14] is i_Naps_s in component i_Naps_s (microA).
 * ALGEBRAIC[15] is i_Naps_t in component i_Naps_t (microA).
 * ALGEBRAIC[16] is i_CaL_s in component i_CaL_s (microA).
 * ALGEBRAIC[91] is i_KL_s in component i_CaL_s (microA).
 * ALGEBRAIC[17] is alfas in component i_CaL_s (per_second).
 * ALGEBRAIC[18] is betas in component i_CaL_s (per_second).
 * ALGEBRAIC[19] is gama in component i_CaL_s (per_second).
 * CONSTANTS[49] is omega in component i_CaL_s (per_second).
 * CONSTANTS[50] is a in component i_CaL_s (dimensionless).
 * CONSTANTS[51] is b in component i_CaL_s (dimensionless).
 * CONSTANTS[52] is f in component i_CaL_s (per_second).
 * CONSTANTS[53] is g in component i_CaL_s (per_second).
 * CONSTANTS[54] is f2 in component i_CaL_s (per_second).
 * CONSTANTS[55] is g2 in component i_CaL_s (per_second).
 * ALGEBRAIC[20] is alfa2s in component i_CaL_s (per_second).
 * ALGEBRAIC[21] is beta2s in component i_CaL_s (per_second).
 * STATES[10] is Cst in component i_CaL_s (dimensionless).
 * STATES[11] is C1 in component i_CaL_s (dimensionless).
 * STATES[12] is C2 in component i_CaL_s (dimensionless).
 * STATES[13] is C3 in component i_CaL_s (dimensionless).
 * STATES[14] is C4 in component i_CaL_s (dimensionless).
 * STATES[15] is Co in component i_CaL_s (dimensionless).
 * STATES[16] is Ccast in component i_CaL_s (dimensionless).
 * STATES[17] is Cca1 in component i_CaL_s (dimensionless).
 * STATES[18] is Cca2 in component i_CaL_s (dimensionless).
 * STATES[19] is Cca3 in component i_CaL_s (dimensionless).
 * STATES[20] is Cca4 in component i_CaL_s (dimensionless).
 * STATES[21] is Ccao in component i_CaL_s (dimensionless).
 * STATES[22] is Ca_ss in component ion_concentrations (millimolar).
 * ALGEBRAIC[24] is i_CaL_t in component i_CaL_t (microA).
 * STATES[23] is y in component i_CaL_s_y_gate (dimensionless).
 * ALGEBRAIC[22] is y_infinity in component i_CaL_s_y_gate (dimensionless).
 * ALGEBRAIC[23] is tau_y in component i_CaL_s_y_gate (second).
 * ALGEBRAIC[25] is i_KL_t in component i_CaL_t (microA).
 * ALGEBRAIC[27] is alfat in component i_CaL_t (per_second).
 * ALGEBRAIC[28] is betat in component i_CaL_t (per_second).
 * ALGEBRAIC[26] is gama in component i_CaL_t (per_second).
 * CONSTANTS[56] is omega in component i_CaL_t (per_second).
 * CONSTANTS[57] is a in component i_CaL_t (dimensionless).
 * CONSTANTS[58] is b in component i_CaL_t (dimensionless).
 * CONSTANTS[59] is f in component i_CaL_t (per_second).
 * CONSTANTS[60] is g in component i_CaL_t (per_second).
 * CONSTANTS[61] is f2 in component i_CaL_t (per_second).
 * CONSTANTS[62] is g2 in component i_CaL_t (per_second).
 * ALGEBRAIC[29] is alfa2t in component i_CaL_t (per_second).
 * ALGEBRAIC[30] is beta2t in component i_CaL_t (per_second).
 * STATES[24] is TCst in component i_CaL_t (dimensionless).
 * STATES[25] is TC1 in component i_CaL_t (dimensionless).
 * STATES[26] is TC2 in component i_CaL_t (dimensionless).
 * STATES[27] is TC3 in component i_CaL_t (dimensionless).
 * STATES[28] is TC4 in component i_CaL_t (dimensionless).
 * STATES[29] is TCo in component i_CaL_t (dimensionless).
 * STATES[30] is TCcast in component i_CaL_t (dimensionless).
 * STATES[31] is TCca1 in component i_CaL_t (dimensionless).
 * STATES[32] is TCca2 in component i_CaL_t (dimensionless).
 * STATES[33] is TCca3 in component i_CaL_t (dimensionless).
 * STATES[34] is TCca4 in component i_CaL_t (dimensionless).
 * STATES[35] is TCcao in component i_CaL_t (dimensionless).
 * STATES[36] is Ca_t in component ion_concentrations (millimolar).
 * STATES[37] is y in component i_CaL_t_y_gate (dimensionless).
 * ALGEBRAIC[31] is y_infinity in component i_CaL_t_y_gate (dimensionless).
 * ALGEBRAIC[32] is tau_y in component i_CaL_t_y_gate (second).
 * ALGEBRAIC[92] is i_Kr_s in component i_Kr_s (microA).
 * ALGEBRAIC[33] is E_Kr_s in component i_Kr_s (millivolt).
 * STATES[38] is xr in component i_Kr_s_xr_gate (dimensionless).
 * ALGEBRAIC[36] is xri in component i_Kr_s_xri_gate (dimensionless).
 * ALGEBRAIC[34] is xr_infinity in component i_Kr_s_xr_gate (dimensionless).
 * ALGEBRAIC[35] is tau_xr in component i_Kr_s_xr_gate (second).
 * ALGEBRAIC[93] is i_Kr_t in component i_Kr_t (microA).
 * ALGEBRAIC[37] is E_Kr_t in component i_Kr_t (millivolt).
 * STATES[39] is xr in component i_Kr_t_xr_gate (dimensionless).
 * ALGEBRAIC[40] is xri in component i_Kr_t_xri_gate (dimensionless).
 * ALGEBRAIC[38] is xr_infinity in component i_Kr_t_xr_gate (dimensionless).
 * ALGEBRAIC[39] is tau_xr in component i_Kr_t_xr_gate (second).
 * ALGEBRAIC[94] is i_Ks_s in component i_Ks_s (microA).
 * ALGEBRAIC[41] is E_Ks_s in component i_Ks_s (millivolt).
 * CONSTANTS[63] is PRNaK in component i_Ks_s (dimensionless).
 * STATES[40] is Ca_i in component ion_concentrations (millimolar).
 * STATES[41] is xs in component i_Ks_s_xs_gate (dimensionless).
 * ALGEBRAIC[42] is xs_infinity in component i_Ks_s_xs_gate (dimensionless).
 * ALGEBRAIC[43] is tau_xs in component i_Ks_s_xs_gate (second).
 * ALGEBRAIC[95] is i_Ks_t in component i_Ks_t (microA).
 * ALGEBRAIC[44] is E_Ks_t in component i_Ks_t (millivolt).
 * CONSTANTS[64] is PRNaK in component i_Ks_t (dimensionless).
 * STATES[42] is xs in component i_Ks_t_xs_gate (dimensionless).
 * ALGEBRAIC[45] is xs_infinity in component i_Ks_t_xs_gate (dimensionless).
 * ALGEBRAIC[46] is tau_xs in component i_Ks_t_xs_gate (second).
 * ALGEBRAIC[96] is i_K1_s in component i_K1_s (microA).
 * ALGEBRAIC[47] is E_K1_s in component i_K1_s (millivolt).
 * ALGEBRAIC[48] is aK1s in component i_K1_s (dimensionless).
 * ALGEBRAIC[49] is bK1s in component i_K1_s (dimensionless).
 * ALGEBRAIC[97] is i_K1_t in component i_K1_t (microA).
 * ALGEBRAIC[50] is E_K1_t in component i_K1_t (millivolt).
 * ALGEBRAIC[51] is aK1t in component i_K1_t (dimensionless).
 * ALGEBRAIC[52] is bK1t in component i_K1_t (dimensionless).
 * ALGEBRAIC[98] is i_Kp_s in component i_Kp_s (microA).
 * ALGEBRAIC[54] is kps in component i_Kp_s (dimensionless).
 * ALGEBRAIC[53] is E_Kp_s in component i_Kp_s (millivolt).
 * ALGEBRAIC[99] is i_Kp_t in component i_Kp_t (microA).
 * ALGEBRAIC[56] is kpt in component i_Kp_t (dimensionless).
 * ALGEBRAIC[55] is E_Kp_t in component i_Kp_t (millivolt).
 * ALGEBRAIC[100] is i_Kto_s in component i_Kto_s (microA).
 * CONSTANTS[65] is fr2 in component i_Kto_s (dimensionless).
 * ALGEBRAIC[57] is E_Kto_s in component i_Kto_s (millivolt).
 * STATES[43] is r2 in component i_Kto_s_r2_gate (dimensionless).
 * STATES[44] is r3 in component i_Kto_s_r3_gate (dimensionless).
 * CONSTANTS[66] is tau_r2 in component i_Kto_s_r2_gate (second).
 * ALGEBRAIC[58] is r2_infinity in component i_Kto_s_r2_gate (dimensionless).
 * CONSTANTS[67] is tau_r3 in component i_Kto_s_r3_gate (second).
 * ALGEBRAIC[59] is r3_infinity in component i_Kto_s_r3_gate (dimensionless).
 * ALGEBRAIC[101] is i_Kto_t in component i_Kto_t (microA).
 * CONSTANTS[68] is fr2 in component i_Kto_t (dimensionless).
 * ALGEBRAIC[60] is E_Kto_t in component i_Kto_t (millivolt).
 * STATES[45] is r2 in component i_Kto_t_r2_gate (dimensionless).
 * STATES[46] is r3 in component i_Kto_t_r3_gate (dimensionless).
 * CONSTANTS[69] is tau_r2 in component i_Kto_t_r2_gate (second).
 * ALGEBRAIC[61] is r2_infinity in component i_Kto_t_r2_gate (dimensionless).
 * ALGEBRAIC[62] is r3_infinity in component i_Kto_t_r3_gate (dimensionless).
 * CONSTANTS[70] is tau_r3 in component i_Kto_t_r3_gate (second).
 * ALGEBRAIC[102] is i_KNa_s in component i_KNa_s (microA).
 * ALGEBRAIC[63] is E_KNa_s in component i_KNa_s (millivolt).
 * ALGEBRAIC[103] is i_KNa_t in component i_KNa_t (microA).
 * ALGEBRAIC[64] is E_KNa_t in component i_KNa_t (millivolt).
 * ALGEBRAIC[65] is i_nsNa_s in component i_nsNa_s (microA).
 * ALGEBRAIC[66] is i_nsNa_t in component i_nsNa_t (microA).
 * ALGEBRAIC[67] is i_nsK_s in component i_nsK_s (microA).
 * ALGEBRAIC[68] is i_nsK_t in component i_nsK_t (microA).
 * ALGEBRAIC[69] is i_Nab_s in component i_Nab_s (microA).
 * ALGEBRAIC[70] is i_Nab_t in component i_Nab_t (microA).
 * ALGEBRAIC[104] is i_Cab_s in component i_Cab_s (microA).
 * ALGEBRAIC[71] is E_Ca_s in component i_Cab_s (millivolt).
 * ALGEBRAIC[105] is i_Cab_t in component i_Cab_t (microA).
 * ALGEBRAIC[72] is E_Ca_t in component i_Cab_t (millivolt).
 * ALGEBRAIC[73] is i_NaCa_s in component i_NaCa_s (microA).
 * ALGEBRAIC[74] is i_NaCa_t in component i_NaCa_t (microA).
 * ALGEBRAIC[75] is i_NaK_s in component i_NaK_s (microA).
 * ALGEBRAIC[76] is i_NaK_t in component i_NaK_t (microA).
 * ALGEBRAIC[77] is i_pCa_s in component i_pCa_s (microA).
 * ALGEBRAIC[78] is i_pCa_t in component i_pCa_t (microA).
 * ALGEBRAIC[106] is i_KATP_s in component i_KATP_s (microA).
 * ALGEBRAIC[79] is E_KATP_s in component i_KATP_s (millivolt).
 * ALGEBRAIC[107] is i_KATP_t in component i_KATP_t (microA).
 * ALGEBRAIC[80] is E_KATP_t in component i_KATP_t (millivolt).
 * ALGEBRAIC[81] is JteNa in component t_tubular_ion_fluxes (millimolar_per_second).
 * ALGEBRAIC[82] is JteCa in component t_tubular_ion_fluxes (millimolar_per_second).
 * ALGEBRAIC[83] is JteK in component t_tubular_ion_fluxes (millimolar_per_second).
 * CONSTANTS[71] is tau_Na in component t_tubular_ion_fluxes (second).
 * CONSTANTS[72] is tau_Ca in component t_tubular_ion_fluxes (second).
 * CONSTANTS[73] is tau_K in component t_tubular_ion_fluxes (second).
 * ALGEBRAIC[84] is JCaSRup in component JCaSRup (millimolar_per_second).
 * ALGEBRAIC[85] is JCaSRleak in component JCaSRleak (millimolar_per_second).
 * STATES[47] is CaSRup in component CaSRup (millimolar).
 * ALGEBRAIC[86] is Jtr in component Jtr (millimolar_per_second).
 * CONSTANTS[74] is tau_tr in component Jtr (second).
 * STATES[48] is CaSRrel in component CaSRrel (millimolar).
 * ALGEBRAIC[87] is JCaSRrel in component JCaSRrel (millimolar_per_second).
 * CONSTANTS[81] is kap in component JCaSRrel (per_millimolar4_per_second).
 * CONSTANTS[75] is kam in component JCaSRrel (per_second).
 * CONSTANTS[82] is kbp in component JCaSRrel (per_millimolar3_per_second).
 * CONSTANTS[76] is kbm in component JCaSRrel (per_second).
 * CONSTANTS[77] is kcp in component JCaSRrel (per_second).
 * CONSTANTS[78] is kcm in component JCaSRrel (per_second).
 * STATES[49] is F1 in component JCaSRrel (dimensionless).
 * STATES[50] is F2 in component JCaSRrel (dimensionless).
 * STATES[51] is F3 in component JCaSRrel (dimensionless).
 * STATES[52] is F4 in component JCaSRrel (dimensionless).
 * ALGEBRAIC[88] is JCad in component JCad (millimolar_per_second).
 * CONSTANTS[79] is tau_d in component JCad (second).
 * STATES[53] is BTRH in component ion_concentrations (millimolar).
 * STATES[54] is BTRL in component ion_concentrations (millimolar).
 * ALGEBRAIC[89] is dBTRH in component ion_concentrations (millimolar_per_second).
 * ALGEBRAIC[90] is dBTRL in component ion_concentrations (millimolar_per_second).
 * RATES[4] is d/dt m in component i_Na_s_m_gate (dimensionless).
 * RATES[5] is d/dt h in component i_Na_s_h_gate (dimensionless).
 * RATES[8] is d/dt m in component i_Na_t_m_gate (dimensionless).
 * RATES[9] is d/dt h in component i_Na_t_h_gate (dimensionless).
 * RATES[10] is d/dt Cst in component i_CaL_s (dimensionless).
 * RATES[11] is d/dt C1 in component i_CaL_s (dimensionless).
 * RATES[12] is d/dt C2 in component i_CaL_s (dimensionless).
 * RATES[13] is d/dt C3 in component i_CaL_s (dimensionless).
 * RATES[14] is d/dt C4 in component i_CaL_s (dimensionless).
 * RATES[15] is d/dt Co in component i_CaL_s (dimensionless).
 * RATES[16] is d/dt Ccast in component i_CaL_s (dimensionless).
 * RATES[17] is d/dt Cca1 in component i_CaL_s (dimensionless).
 * RATES[18] is d/dt Cca2 in component i_CaL_s (dimensionless).
 * RATES[19] is d/dt Cca3 in component i_CaL_s (dimensionless).
 * RATES[20] is d/dt Cca4 in component i_CaL_s (dimensionless).
 * RATES[21] is d/dt Ccao in component i_CaL_s (dimensionless).
 * RATES[23] is d/dt y in component i_CaL_s_y_gate (dimensionless).
 * RATES[24] is d/dt TCst in component i_CaL_t (dimensionless).
 * RATES[25] is d/dt TC1 in component i_CaL_t (dimensionless).
 * RATES[26] is d/dt TC2 in component i_CaL_t (dimensionless).
 * RATES[27] is d/dt TC3 in component i_CaL_t (dimensionless).
 * RATES[28] is d/dt TC4 in component i_CaL_t (dimensionless).
 * RATES[29] is d/dt TCo in component i_CaL_t (dimensionless).
 * RATES[30] is d/dt TCcast in component i_CaL_t (dimensionless).
 * RATES[31] is d/dt TCca1 in component i_CaL_t (dimensionless).
 * RATES[32] is d/dt TCca2 in component i_CaL_t (dimensionless).
 * RATES[33] is d/dt TCca3 in component i_CaL_t (dimensionless).
 * RATES[34] is d/dt TCca4 in component i_CaL_t (dimensionless).
 * RATES[35] is d/dt TCcao in component i_CaL_t (dimensionless).
 * RATES[37] is d/dt y in component i_CaL_t_y_gate (dimensionless).
 * RATES[38] is d/dt xr in component i_Kr_s_xr_gate (dimensionless).
 * RATES[39] is d/dt xr in component i_Kr_t_xr_gate (dimensionless).
 * RATES[41] is d/dt xs in component i_Ks_s_xs_gate (dimensionless).
 * RATES[42] is d/dt xs in component i_Ks_t_xs_gate (dimensionless).
 * RATES[43] is d/dt r2 in component i_Kto_s_r2_gate (dimensionless).
 * RATES[44] is d/dt r3 in component i_Kto_s_r3_gate (dimensionless).
 * RATES[45] is d/dt r2 in component i_Kto_t_r2_gate (dimensionless).
 * RATES[46] is d/dt r3 in component i_Kto_t_r3_gate (dimensionless).
 * RATES[49] is d/dt F1 in component JCaSRrel (dimensionless).
 * RATES[50] is d/dt F2 in component JCaSRrel (dimensionless).
 * RATES[51] is d/dt F3 in component JCaSRrel (dimensionless).
 * RATES[52] is d/dt F4 in component JCaSRrel (dimensionless).
 * RATES[48] is d/dt CaSRrel in component CaSRrel (millimolar).
 * RATES[47] is d/dt CaSRup in component CaSRup (millimolar).
 * RATES[22] is d/dt Ca_ss in component ion_concentrations (millimolar).
 * RATES[40] is d/dt Ca_i in component ion_concentrations (millimolar).
 * RATES[53] is d/dt BTRH in component ion_concentrations (millimolar).
 * RATES[54] is d/dt BTRL in component ion_concentrations (millimolar).
 * RATES[2] is d/dt Na_i in component ion_concentrations (millimolar).
 * RATES[3] is d/dt K_i in component ion_concentrations (millimolar).
 * RATES[6] is d/dt Na_t in component ion_concentrations (millimolar).
 * RATES[36] is d/dt Ca_t in component ion_concentrations (millimolar).
 * RATES[7] is d/dt K_t in component ion_concentrations (millimolar).
 * RATES[0] is d/dt Vm_s in component Vm_s (millivolt).
 * RATES[1] is d/dt Vm_t in component Vm_t (millivolt).
 * There are a total of 2 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 8310;
CONSTANTS[1] = 310;
CONSTANTS[2] = 96500;
CONSTANTS[3] = 140;
CONSTANTS[4] = 1.8;
CONSTANTS[5] = 5.4;
CONSTANTS[6] = 6.8;
CONSTANTS[7] = 83.33;
CONSTANTS[8] = 148.15e-7;
CONSTANTS[9] = 5.93e-4;
CONSTANTS[10] = 5.93e-4;
CONSTANTS[11] = 0.013;
CONSTANTS[12] = 21028875;
STATES[0] = -8.5207812e1;
STATES[1] = -8.5208034e1;
CONSTANTS[13] = 30;
CONSTANTS[14] = 0.64;
CONSTANTS[15] = 0.0053;
CONSTANTS[16] = 0.526;
CONSTANTS[17] = 0.8;
CONSTANTS[18] = 0.526;
CONSTANTS[19] = 0.1975;
CONSTANTS[20] = 0.526;
CONSTANTS[21] = 0.006;
CONSTANTS[22] = 0.526;
CONSTANTS[23] = 0;
CONSTANTS[24] = 0.526;
CONSTANTS[25] = 0.75;
CONSTANTS[26] = 0.8;
CONSTANTS[27] = 0.12848;
CONSTANTS[28] = 0.526;
CONSTANTS[29] = 1;
CONSTANTS[30] = 0.526;
CONSTANTS[31] = 0.00075;
CONSTANTS[32] = 0.526;
CONSTANTS[33] = 0.0021;
CONSTANTS[34] = 0.526;
CONSTANTS[35] = 48e-4;
CONSTANTS[36] = 0.64;
CONSTANTS[37] = 48e-7;
CONSTANTS[38] = 1.75e-7;
CONSTANTS[39] = 0.526;
CONSTANTS[40] = 1.75e-7;
CONSTANTS[41] = 0.526;
CONSTANTS[42] = 0.00025;
CONSTANTS[43] = 0.526;
CONSTANTS[44] = 1.5;
CONSTANTS[45] = 0.526;
CONSTANTS[46] = 1.15;
CONSTANTS[47] = 0.2;
CONSTANTS[48] = 1;
STATES[2] = 1.1120279e1;
STATES[3] = 1.3678926e2;
STATES[4] = 3.4130493e-3;
STATES[5] = 8.2699973e-1;
STATES[6] = 1.3993239e2;
STATES[7] = 5.4140321e0;
STATES[8] = 3.4129472e-3;
STATES[9] = 8.2700551e-1;
CONSTANTS[49] = 10;
CONSTANTS[50] = 2;
CONSTANTS[51] = 2;
CONSTANTS[52] = 300;
CONSTANTS[53] = 2000;
CONSTANTS[54] = 5;
CONSTANTS[55] = 7000;
STATES[10] = 9.9797984e-1;
STATES[11] = 7.5722514e-5;
STATES[12] = 2.1545646e-9;
STATES[13] = 2.7463178e-14;
STATES[14] = -5.7569102e-17;
STATES[15] = -1.3496934e-17;
STATES[16] = 1.9155065e-3;
STATES[17] = 5.8135383e-7;
STATES[18] = 6.615513e-11;
STATES[19] = 3.3426555e-15;
STATES[20] = 4.6640361e-19;
STATES[21] = 3.7986638e-22;
STATES[22] = 9.5977033e-5;
STATES[23] = 7.8134852e-1;
CONSTANTS[56] = 10;
CONSTANTS[57] = 2;
CONSTANTS[58] = 2;
CONSTANTS[59] = 300;
CONSTANTS[60] = 2000;
CONSTANTS[61] = 5;
CONSTANTS[62] = 7000;
STATES[24] = 9.9798934e-1;
STATES[25] = 7.5720257e-5;
STATES[26] = 2.1544156e-9;
STATES[27] = 2.7459475e-14;
STATES[28] = -5.7367189e-17;
STATES[29] = -1.3449454e-17;
STATES[30] = 1.9155245e-3;
STATES[31] = 5.8133643e-7;
STATES[32] = 6.6150547e-11;
STATES[33] = 3.3423167e-15;
STATES[34] = 4.6165955e-19;
STATES[35] = 3.75926e-22;
STATES[36] = 1.8476402e0;
STATES[37] = 7.813477e-1;
STATES[38] = 2.0469344e-4;
STATES[39] = 2.0469344e-4;
CONSTANTS[63] = 0.01833;
STATES[40] = 8.8787034e-5;
STATES[41] = 6.1359896e-3;
CONSTANTS[64] = 0.01833;
STATES[42] = 6.1359896e-3;
CONSTANTS[65] = 1;
STATES[43] = 9.625701e-1;
STATES[44] = 9.6250049e-1;
CONSTANTS[66] = 0.02;
CONSTANTS[67] = 0.08;
CONSTANTS[68] = 1;
STATES[45] = 9.625701e-1;
STATES[46] = 9.6250049e-1;
CONSTANTS[69] = 0.02;
CONSTANTS[70] = 0.08;
CONSTANTS[71] = 0.2;
CONSTANTS[72] = 0.24;
CONSTANTS[73] = 0.2;
STATES[47] = 1.0200296e0;
CONSTANTS[74] = 0.03448;
STATES[48] = 1.0326252e0;
CONSTANTS[75] = 576;
CONSTANTS[76] = 1930;
CONSTANTS[77] = 18;
CONSTANTS[78] = 0.8;
STATES[49] = 8.053082e-1;
STATES[50] = 2.6639195e-4;
STATES[51] = 4.9455459e-10;
STATES[52] = 1.9442578e-1;
CONSTANTS[79] = 0.003125;
STATES[53] = 9.6700747e-1;
STATES[54] = 8.1740868e-2;
CONSTANTS[80] =  2.00000*3.14159*pow(CONSTANTS[10], 2.00000)+ 2.00000*3.14159*CONSTANTS[10]*CONSTANTS[11];
CONSTANTS[81] =  3.00000*1.21500e+13;
CONSTANTS[82] = 4.05000e+09;
CONSTANTS[83] =  3.14159*pow(CONSTANTS[10], 2.00000)*CONSTANTS[11];
CONSTANTS[84] =  CONSTANTS[83]*0.680000*6.00000e-05;
CONSTANTS[85] =  CONSTANTS[83]*0.00316000;
CONSTANTS[86] =  CONSTANTS[83]*0.680000;
CONSTANTS[87] =  CONSTANTS[83]*0.0550000;
CONSTANTS[88] =  CONSTANTS[12]*2.00000*3.14159*CONSTANTS[10]*CONSTANTS[11];
CONSTANTS[89] = (( CONSTANTS[7]*CONSTANTS[9])/2.00000)/( 3.14159*pow(CONSTANTS[8], 2.00000)*CONSTANTS[88]);
CONSTANTS[90] =  2.00000*3.14159*CONSTANTS[8]*CONSTANTS[9]*CONSTANTS[88];
CONSTANTS[91] =  CONSTANTS[13]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[14]);
CONSTANTS[92] =  CONSTANTS[15]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[16]);
CONSTANTS[93] =  CONSTANTS[17]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[18]);
CONSTANTS[94] =  CONSTANTS[19]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[20]);
CONSTANTS[95] =  CONSTANTS[21]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[22]);
CONSTANTS[96] =  CONSTANTS[23]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[24]);
CONSTANTS[97] =  CONSTANTS[25]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[26]);
CONSTANTS[98] =  CONSTANTS[27]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[28]);
CONSTANTS[99] =  CONSTANTS[29]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[30]);
CONSTANTS[100] =  CONSTANTS[31]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[32]);
CONSTANTS[101] =  CONSTANTS[33]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[34]);
CONSTANTS[102] =  CONSTANTS[46]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[47]);
CONSTANTS[103] =  CONSTANTS[44]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[45]);
CONSTANTS[104] =  CONSTANTS[42]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[43]);
CONSTANTS[105] =  CONSTANTS[35]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[36]);
CONSTANTS[106] =  CONSTANTS[37]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[36]);
CONSTANTS[107] =  CONSTANTS[38]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[39]);
CONSTANTS[108] =  CONSTANTS[40]*(CONSTANTS[80]+CONSTANTS[90])*(1.00000 - CONSTANTS[41]);
CONSTANTS[109] =  CONSTANTS[13]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[14];
CONSTANTS[110] =  CONSTANTS[15]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[16];
CONSTANTS[111] =  CONSTANTS[17]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[18];
CONSTANTS[112] =  CONSTANTS[19]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[20];
CONSTANTS[113] =  CONSTANTS[21]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[22];
CONSTANTS[114] =  CONSTANTS[23]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[24];
CONSTANTS[115] =  CONSTANTS[25]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[26];
CONSTANTS[116] =  CONSTANTS[27]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[28];
CONSTANTS[117] =  CONSTANTS[29]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[30];
CONSTANTS[118] =  CONSTANTS[31]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[32];
CONSTANTS[119] =  CONSTANTS[33]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[34];
CONSTANTS[120] =  CONSTANTS[46]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[47];
CONSTANTS[121] =  CONSTANTS[44]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[45];
CONSTANTS[122] =  CONSTANTS[42]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[43];
CONSTANTS[123] =  CONSTANTS[35]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[36];
CONSTANTS[124] =  CONSTANTS[37]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[36];
CONSTANTS[125] =  CONSTANTS[38]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[39];
CONSTANTS[126] =  CONSTANTS[40]*(CONSTANTS[80]+CONSTANTS[90])*CONSTANTS[41];
CONSTANTS[127] =  3.14159*pow(CONSTANTS[8], 2.00000)*CONSTANTS[9]*CONSTANTS[88];
CONSTANTS[128] =  CONSTANTS[90]*1.00000;
CONSTANTS[129] =  CONSTANTS[80]*1.00000;
RATES[4] = 0.1001;
RATES[5] = 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[23] = 0.1001;
RATES[24] = 0.1001;
RATES[25] = 0.1001;
RATES[26] = 0.1001;
RATES[27] = 0.1001;
RATES[28] = 0.1001;
RATES[29] = 0.1001;
RATES[30] = 0.1001;
RATES[31] = 0.1001;
RATES[32] = 0.1001;
RATES[33] = 0.1001;
RATES[34] = 0.1001;
RATES[35] = 0.1001;
RATES[37] = 0.1001;
RATES[38] = 0.1001;
RATES[39] = 0.1001;
RATES[41] = 0.1001;
RATES[42] = 0.1001;
RATES[43] = 0.1001;
RATES[44] = 0.1001;
RATES[45] = 0.1001;
RATES[46] = 0.1001;
RATES[49] = 0.1001;
RATES[50] = 0.1001;
RATES[51] = 0.1001;
RATES[52] = 0.1001;
RATES[48] = 0.1001;
RATES[47] = 0.1001;
RATES[22] = 0.1001;
RATES[40] = 0.1001;
RATES[53] = 0.1001;
RATES[54] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[6] = 0.1001;
RATES[36] = 0.1001;
RATES[7] = 0.1001;
RATES[0] = 0.1001;
RATES[1] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[4] - (ALGEBRAIC[4] - STATES[4])/ALGEBRAIC[5];
resid[1] = RATES[5] - (ALGEBRAIC[6] - STATES[5])/ALGEBRAIC[7];
resid[2] = RATES[8] - (ALGEBRAIC[10] - STATES[8])/ALGEBRAIC[11];
resid[3] = RATES[9] - (ALGEBRAIC[12] - STATES[9])/ALGEBRAIC[13];
resid[4] = RATES[10] - ( ALGEBRAIC[18]*STATES[11]+ CONSTANTS[49]*STATES[16]) -  ( 4.00000*ALGEBRAIC[17]+ALGEBRAIC[19])*STATES[10];
resid[5] = RATES[11] - ( 4.00000*ALGEBRAIC[17]*STATES[10]+ 2.00000*ALGEBRAIC[18]*STATES[12]+ (CONSTANTS[49]/CONSTANTS[51])*STATES[17]) -  (ALGEBRAIC[18]+ 3.00000*ALGEBRAIC[17]+ ALGEBRAIC[19]*CONSTANTS[50])*STATES[11];
resid[6] = RATES[12] - ( 3.00000*ALGEBRAIC[17]*STATES[11]+ 3.00000*ALGEBRAIC[18]*STATES[13]+ (CONSTANTS[49]/pow(CONSTANTS[51], 2.00000))*STATES[18]) -  ( 2.00000*ALGEBRAIC[18]+ 2.00000*ALGEBRAIC[17]+ ALGEBRAIC[19]*pow(CONSTANTS[50], 2.00000))*STATES[12];
resid[7] = RATES[13] - ( 2.00000*ALGEBRAIC[17]*STATES[12]+ 4.00000*ALGEBRAIC[18]*STATES[14]+ (CONSTANTS[49]/pow(CONSTANTS[51], 3.00000))*STATES[19]) -  ( 3.00000*ALGEBRAIC[18]+ALGEBRAIC[17]+ ALGEBRAIC[19]*pow(CONSTANTS[50], 3.00000))*STATES[13];
resid[8] = RATES[14] - ( ALGEBRAIC[17]*STATES[13]+ CONSTANTS[53]*STATES[15]+ (CONSTANTS[49]/pow(CONSTANTS[51], 4.00000))*STATES[20]) -  ( 4.00000*ALGEBRAIC[18]+CONSTANTS[52]+ ALGEBRAIC[19]*pow(CONSTANTS[50], 4.00000))*STATES[14];
resid[9] = RATES[15] -  CONSTANTS[52]*STATES[14] -  CONSTANTS[53]*STATES[15];
resid[10] = RATES[16] - ( ALGEBRAIC[21]*STATES[17]+ ALGEBRAIC[19]*STATES[10]) -  ( 4.00000*ALGEBRAIC[20]+CONSTANTS[49])*STATES[16];
resid[11] = RATES[17] - ( 4.00000*ALGEBRAIC[20]*STATES[16]+ 2.00000*ALGEBRAIC[21]*STATES[18]+ ALGEBRAIC[19]*CONSTANTS[50]*STATES[11]) -  (ALGEBRAIC[21]+ 3.00000*ALGEBRAIC[20]+CONSTANTS[49]/CONSTANTS[51])*STATES[17];
resid[12] = RATES[18] - ( 3.00000*ALGEBRAIC[20]*STATES[17]+ 3.00000*ALGEBRAIC[21]*STATES[19]+ ALGEBRAIC[19]*pow(CONSTANTS[50], 2.00000)*STATES[12]) -  ( 2.00000*ALGEBRAIC[21]+ 2.00000*ALGEBRAIC[20]+CONSTANTS[49]/pow(CONSTANTS[51], 2.00000))*STATES[18];
resid[13] = RATES[19] - ( 2.00000*ALGEBRAIC[20]*STATES[18]+ 4.00000*ALGEBRAIC[21]*STATES[20]+ ALGEBRAIC[19]*pow(CONSTANTS[50], 3.00000)*STATES[13]) -  ( 3.00000*ALGEBRAIC[21]+ALGEBRAIC[20]+CONSTANTS[49]/pow(CONSTANTS[51], 3.00000))*STATES[19];
resid[14] = RATES[20] - ( ALGEBRAIC[20]*STATES[19]+ CONSTANTS[55]*STATES[21]+ ALGEBRAIC[19]*pow(CONSTANTS[50], 4.00000)*STATES[14]) -  ( 4.00000*ALGEBRAIC[21]+CONSTANTS[54]+CONSTANTS[49]/pow(CONSTANTS[51], 4.00000))*STATES[20];
resid[15] = RATES[21] -  CONSTANTS[54]*STATES[20] -  CONSTANTS[55]*STATES[21];
resid[16] = RATES[23] - (ALGEBRAIC[22] - STATES[23])/ALGEBRAIC[23];
resid[17] = RATES[24] - ( ALGEBRAIC[28]*STATES[25]+ CONSTANTS[56]*STATES[30]) -  ( 4.00000*ALGEBRAIC[27]+ALGEBRAIC[26])*STATES[24];
resid[18] = RATES[25] - ( 4.00000*ALGEBRAIC[27]*STATES[24]+ 2.00000*ALGEBRAIC[28]*STATES[26]+ (CONSTANTS[56]/CONSTANTS[58])*STATES[31]) -  (ALGEBRAIC[28]+ 3.00000*ALGEBRAIC[27]+ ALGEBRAIC[26]*CONSTANTS[57])*STATES[25];
resid[19] = RATES[26] - ( 3.00000*ALGEBRAIC[27]*STATES[25]+ 3.00000*ALGEBRAIC[28]*STATES[27]+ (CONSTANTS[56]/pow(CONSTANTS[58], 2.00000))*STATES[32]) -  ( 2.00000*ALGEBRAIC[28]+ 2.00000*ALGEBRAIC[27]+ ALGEBRAIC[26]*pow(CONSTANTS[57], 2.00000))*STATES[26];
resid[20] = RATES[27] - ( 2.00000*ALGEBRAIC[27]*STATES[26]+ 4.00000*ALGEBRAIC[28]*STATES[28]+ (CONSTANTS[56]/pow(CONSTANTS[58], 3.00000))*STATES[33]) -  ( 3.00000*ALGEBRAIC[28]+ALGEBRAIC[27]+ ALGEBRAIC[26]*pow(CONSTANTS[57], 3.00000))*STATES[27];
resid[21] = RATES[28] - ( ALGEBRAIC[27]*STATES[27]+ CONSTANTS[60]*STATES[29]+ (CONSTANTS[56]/pow(CONSTANTS[58], 4.00000))*STATES[34]) -  ( 4.00000*ALGEBRAIC[28]+CONSTANTS[59]+ ALGEBRAIC[26]*pow(CONSTANTS[57], 4.00000))*STATES[28];
resid[22] = RATES[29] -  CONSTANTS[59]*STATES[28] -  CONSTANTS[60]*STATES[29];
resid[23] = RATES[30] - ( ALGEBRAIC[30]*STATES[31]+ ALGEBRAIC[26]*STATES[24]) -  ( 4.00000*ALGEBRAIC[29]+CONSTANTS[56])*STATES[30];
resid[24] = RATES[31] - ( 4.00000*ALGEBRAIC[29]*STATES[30]+ 2.00000*ALGEBRAIC[30]*STATES[32]+ ALGEBRAIC[26]*CONSTANTS[57]*STATES[25]) -  (ALGEBRAIC[30]+ 3.00000*ALGEBRAIC[29]+CONSTANTS[56]/CONSTANTS[58])*STATES[31];
resid[25] = RATES[32] - ( 3.00000*ALGEBRAIC[29]*STATES[31]+ 3.00000*ALGEBRAIC[30]*STATES[33]+ ALGEBRAIC[26]*pow(CONSTANTS[57], 2.00000)*STATES[26]) -  ( 2.00000*ALGEBRAIC[30]+ 2.00000*ALGEBRAIC[29]+CONSTANTS[56]/pow(CONSTANTS[58], 2.00000))*STATES[32];
resid[26] = RATES[33] - ( 2.00000*ALGEBRAIC[29]*STATES[32]+ 4.00000*ALGEBRAIC[30]*STATES[34]+ ALGEBRAIC[26]*pow(CONSTANTS[57], 3.00000)*STATES[27]) -  ( 3.00000*ALGEBRAIC[30]+ALGEBRAIC[29]+CONSTANTS[56]/pow(CONSTANTS[58], 3.00000))*STATES[33];
resid[27] = RATES[34] - ( ALGEBRAIC[29]*STATES[33]+ CONSTANTS[62]*STATES[35]+ ALGEBRAIC[26]*pow(CONSTANTS[57], 4.00000)*STATES[28]) -  ( 4.00000*ALGEBRAIC[30]+CONSTANTS[61]+CONSTANTS[56]/pow(CONSTANTS[58], 4.00000))*STATES[34];
resid[28] = RATES[35] -  CONSTANTS[61]*STATES[34] -  CONSTANTS[62]*STATES[35];
resid[29] = RATES[37] - (ALGEBRAIC[31] - STATES[37])/ALGEBRAIC[32];
resid[30] = RATES[38] - (ALGEBRAIC[34] - STATES[38])/ALGEBRAIC[35];
resid[31] = RATES[39] - (ALGEBRAIC[38] - STATES[39])/ALGEBRAIC[39];
resid[32] = RATES[41] - (ALGEBRAIC[42] - STATES[41])/ALGEBRAIC[43];
resid[33] = RATES[42] - (ALGEBRAIC[45] - STATES[42])/ALGEBRAIC[46];
resid[34] = RATES[43] - (ALGEBRAIC[58] - STATES[43])/CONSTANTS[66];
resid[35] = RATES[44] - (ALGEBRAIC[59] - STATES[44])/CONSTANTS[67];
resid[36] = RATES[45] - (ALGEBRAIC[61] - STATES[45])/CONSTANTS[69];
resid[37] = RATES[46] - (ALGEBRAIC[62] - STATES[46])/CONSTANTS[70];
resid[38] = RATES[49] -  STATES[50]*CONSTANTS[75] -  STATES[49]*CONSTANTS[81]*pow(STATES[22], 4.00000);
resid[39] = RATES[50] - ( STATES[49]*CONSTANTS[81]*pow(STATES[22], 4.00000)+ STATES[51]*CONSTANTS[76]+ STATES[52]*CONSTANTS[78]) -  STATES[50]*(CONSTANTS[75]+ CONSTANTS[82]*pow(STATES[22], 3.00000)+CONSTANTS[77]);
resid[40] = RATES[51] -  STATES[50]*CONSTANTS[82]*pow(STATES[22], 3.00000) -  STATES[51]*CONSTANTS[76];
resid[41] = RATES[52] -  STATES[50]*CONSTANTS[77] -  STATES[52]*CONSTANTS[78];
resid[42] = RATES[48] - ( (1.00000/(1.00000+( 15.0000*0.800000)/pow(0.800000+STATES[48], 2.00000)))*(ALGEBRAIC[86] - ALGEBRAIC[87]))/CONSTANTS[85];
resid[43] = RATES[47] - ((ALGEBRAIC[84] - ALGEBRAIC[85]) - ALGEBRAIC[86])/( 1.00000*CONSTANTS[87]);
resid[44] = RATES[22] -  (1.00000/(1.00000+( 0.0500000*0.00238000)/pow(0.00238000+STATES[22], 2.00000)))*((- (ALGEBRAIC[16]+ALGEBRAIC[24])/( 2.00000*CONSTANTS[2]*CONSTANTS[84])+( 1.00000*ALGEBRAIC[87])/CONSTANTS[84]) - ( 1.00000*ALGEBRAIC[88])/CONSTANTS[84]);
resid[45] = RATES[40] -  (1.00000/(1.00000+( 0.0500000*0.00238000)/pow(0.00238000+STATES[40], 2.00000)))*(((( - 2.00000*(ALGEBRAIC[73]+ALGEBRAIC[74])+ALGEBRAIC[104]+ALGEBRAIC[105]+ALGEBRAIC[77]+ALGEBRAIC[78])/( - 2.00000*CONSTANTS[2]*CONSTANTS[86])+( 1.00000*((ALGEBRAIC[88]+ALGEBRAIC[85]) - ALGEBRAIC[84]))/CONSTANTS[86]) -  ALGEBRAIC[89]*0.140000) -  ALGEBRAIC[90]*0.0700000);
resid[46] = RATES[53] - ALGEBRAIC[89];
resid[47] = RATES[54] - ALGEBRAIC[90];
resid[48] = RATES[2] - - (ALGEBRAIC[3]+ALGEBRAIC[9]+ALGEBRAIC[14]+ALGEBRAIC[15]+ALGEBRAIC[65]+ALGEBRAIC[66]+ALGEBRAIC[69]+ALGEBRAIC[70]+ 3.00000*ALGEBRAIC[73]+ 3.00000*ALGEBRAIC[74]+ 3.00000*ALGEBRAIC[75]+ 3.00000*ALGEBRAIC[76])/( CONSTANTS[2]*CONSTANTS[86]);
resid[49] = RATES[3] - - (((( - 0.00000*ALGEBRAIC[1]+ALGEBRAIC[94]+ALGEBRAIC[95]+ALGEBRAIC[92]+ALGEBRAIC[93]+ALGEBRAIC[96]+ALGEBRAIC[97]+ALGEBRAIC[98]+ALGEBRAIC[99]+ALGEBRAIC[91]+ALGEBRAIC[25]+ALGEBRAIC[102]+ALGEBRAIC[103]+ALGEBRAIC[67]+ALGEBRAIC[68]) -  2.00000*ALGEBRAIC[75]) -  2.00000*ALGEBRAIC[76])+ALGEBRAIC[106]+ALGEBRAIC[107]+ALGEBRAIC[100]+ALGEBRAIC[101])/( CONSTANTS[2]*CONSTANTS[86]);
resid[50] = RATES[6] - ((ALGEBRAIC[9]+ALGEBRAIC[15]+ALGEBRAIC[66]+ALGEBRAIC[70]+ 3.00000*ALGEBRAIC[74]+ 3.00000*ALGEBRAIC[76])/CONSTANTS[2] -  1.00000*ALGEBRAIC[81])/CONSTANTS[127];
resid[51] = RATES[36] - (( - 2.00000*ALGEBRAIC[74]+ALGEBRAIC[24]+ALGEBRAIC[105]+ALGEBRAIC[78])/( 2.00000*CONSTANTS[2]) -  1.00000*ALGEBRAIC[82])/CONSTANTS[127];
resid[52] = RATES[7] - ((((ALGEBRAIC[95]+ALGEBRAIC[93]+ALGEBRAIC[97]+ALGEBRAIC[99]+ALGEBRAIC[103]+ALGEBRAIC[25]+ALGEBRAIC[68]) -  2.00000*ALGEBRAIC[76])+ALGEBRAIC[107]+ALGEBRAIC[101])/CONSTANTS[2] -  1.00000*ALGEBRAIC[83])/CONSTANTS[127];
resid[53] = RATES[0] - ( 1000.00*(((((((((((((((((((ALGEBRAIC[1]+ALGEBRAIC[0]) - ALGEBRAIC[3]) - ALGEBRAIC[14]) - ALGEBRAIC[16]) - ALGEBRAIC[91]) - ALGEBRAIC[94]) - ALGEBRAIC[92]) - ALGEBRAIC[96]) - ALGEBRAIC[98]) - ALGEBRAIC[102]) - ALGEBRAIC[106]) - ALGEBRAIC[65]) - ALGEBRAIC[67]) - ALGEBRAIC[69]) - ALGEBRAIC[104]) - ALGEBRAIC[73]) - ALGEBRAIC[75]) - ALGEBRAIC[77]) - ALGEBRAIC[100]))/CONSTANTS[129];
resid[54] = RATES[1] - ( 1000.00*((((((((((((((((((- ALGEBRAIC[0] - ALGEBRAIC[9]) - ALGEBRAIC[15]) - ALGEBRAIC[24]) - ALGEBRAIC[25]) - ALGEBRAIC[95]) - ALGEBRAIC[93]) - ALGEBRAIC[97]) - ALGEBRAIC[99]) - ALGEBRAIC[103]) - ALGEBRAIC[107]) - ALGEBRAIC[66]) - ALGEBRAIC[68]) - ALGEBRAIC[70]) - ALGEBRAIC[105]) - ALGEBRAIC[74]) - ALGEBRAIC[76]) - ALGEBRAIC[78]) - ALGEBRAIC[101]))/CONSTANTS[128];
}
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] =  1000.00*(STATES[1]/CONSTANTS[89] - STATES[0]/CONSTANTS[89]);
ALGEBRAIC[1] = (CONDVAR[0]>=0.00000&&CONDVAR[1]<=0.00000 ?  45.0000*(CONSTANTS[80]+CONSTANTS[90]) : 0.00000);
ALGEBRAIC[3] =  CONSTANTS[91]*pow(STATES[4], 3.00000)*STATES[5]*(STATES[0] - ( log((CONSTANTS[3]+ 0.120000*CONSTANTS[5])/(STATES[2]+ 0.120000*STATES[3]))*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2]);
ALGEBRAIC[4] = 1.00000/(1.00000+exp(((STATES[0]+52.2000) - 9.00000)/- 7.40000));
ALGEBRAIC[5] = (0.00100000/( 101.600*exp( STATES[0]*0.113500)+ 0.0226800*exp( - 0.0717000*STATES[0]))+0.000100000)/4.83000;
ALGEBRAIC[6] = 1.00000/(1.00000+exp(((STATES[0]+85.6000) - 9.00000)/5.50000));
ALGEBRAIC[7] = (0.00100000/( 1.13810e-06*exp( - 0.101700*STATES[0])+ 6.53700*exp( STATES[0]*0.0801600))+0.000500000)/4.83000;
ALGEBRAIC[9] =  CONSTANTS[109]*pow(STATES[8], 3.00000)*STATES[9]*(STATES[1] - ( log((STATES[6]+ 0.120000*STATES[7])/(STATES[2]+ 0.120000*STATES[3]))*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2]);
ALGEBRAIC[10] = 1.00000/(1.00000+exp(((STATES[1]+52.2000) - 9.00000)/- 7.40000));
ALGEBRAIC[11] = (0.00100000/( 101.600*exp( STATES[1]*0.113500)+ 0.0226800*exp( - 0.0717000*STATES[1]))+0.000100000)/4.83000;
ALGEBRAIC[12] = 1.00000/(1.00000+exp(((STATES[1]+85.6000) - 9.00000)/5.50000));
ALGEBRAIC[13] = (0.00100000/( 1.13810e-06*exp( - 0.101700*STATES[1])+ 6.53700*exp( STATES[1]*0.0801600))+0.000500000)/4.83000;
ALGEBRAIC[14] =  (CONSTANTS[92]/(1.00000+exp((- 54.0000 - STATES[0])/8.00000)))*(STATES[0] - ( log((CONSTANTS[3]+ 0.120000*CONSTANTS[5])/(STATES[2]+ 0.120000*STATES[3]))*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2]);
ALGEBRAIC[15] =  (CONSTANTS[110]/(1.00000+exp((- 54.0000 - STATES[1])/8.00000)))*(STATES[1] - ( log((STATES[6]+ 0.120000*STATES[7])/(STATES[2]+ 0.120000*STATES[3]))*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2]);
ALGEBRAIC[16] = ( (( 1.00000*CONSTANTS[105]*4.00000*(STATES[15]+STATES[21])*STATES[23]*STATES[0]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1]))*( 0.00100000*exp(( 2.00000*STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) -  0.341000*CONSTANTS[4]))/(exp(( 2.00000*STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) - 1.00000);
ALGEBRAIC[17] =  400.000*exp((STATES[0]+12.0000)/10.0000);
ALGEBRAIC[18] =  50.0000*exp(- (STATES[0]+12.0000)/13.0000);
ALGEBRAIC[19] =  187.500*STATES[22];
ALGEBRAIC[20] =  ALGEBRAIC[17]*CONSTANTS[50];
ALGEBRAIC[21] = ALGEBRAIC[18]/CONSTANTS[51];
ALGEBRAIC[22] = 1.00000/(1.00000+exp((STATES[0]+35.0000)/6.00000));
ALGEBRAIC[23] = 0.00100000/(0.0200000+ 0.0197000*exp(- pow( (STATES[0]+10.0000)*0.0337000, 2.00000)))+0.550000/(1.00000+exp( ((STATES[0]+40.0000)/9.50000)*4.00000));
ALGEBRAIC[24] = ( (( 1.00000*CONSTANTS[123]*4.00000*(STATES[29]+STATES[35])*STATES[37]*STATES[1]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1]))*( 0.00100000*exp(( 2.00000*STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) -  0.341000*STATES[36]))/(exp(( 2.00000*STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) - 1.00000);
ALGEBRAIC[25] = ( (( (( 1.00000*CONSTANTS[124])/(1.00000 - (ALGEBRAIC[16]+ALGEBRAIC[24])/( 0.458000*(CONSTANTS[80]+CONSTANTS[90]))))*(STATES[29]+STATES[35])*STATES[37]*STATES[1]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1]))*( STATES[3]*exp(( STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) - STATES[7]))/(exp(( STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) - 1.00000);
ALGEBRAIC[26] =  187.500*STATES[22];
ALGEBRAIC[27] =  400.000*exp((STATES[1]+12.0000)/10.0000);
ALGEBRAIC[28] =  50.0000*exp(- (STATES[1]+12.0000)/13.0000);
ALGEBRAIC[29] =  ALGEBRAIC[27]*CONSTANTS[57];
ALGEBRAIC[30] = ALGEBRAIC[28]/CONSTANTS[58];
ALGEBRAIC[31] = 1.00000/(1.00000+exp((STATES[1]+35.0000)/6.00000));
ALGEBRAIC[32] = 0.00100000/(0.0200000+ 0.0197000*exp(- pow( (STATES[1]+10.0000)*0.0337000, 2.00000)))+0.550000/(1.00000+exp( ((STATES[1]+40.0000)/9.50000)*4.00000));
ALGEBRAIC[34] = 1.00000/(1.00000+exp(- (STATES[0]+21.5000)/7.50000));
ALGEBRAIC[35] = 0.00100000/(( 0.00138000*(STATES[0]+14.2000))/(1.00000 - exp( - 0.123000*(STATES[0]+14.2000)))+( 0.000610000*(STATES[0]+38.9000))/(exp( 0.145000*(STATES[0]+38.9000)) - 1.00000));
ALGEBRAIC[38] = 1.00000/(1.00000+exp(- (STATES[1]+21.5000)/7.50000));
ALGEBRAIC[39] = 0.00100000/(( 0.00138000*(STATES[1]+14.2000))/(1.00000 - exp( - 0.123000*(STATES[1]+14.2000)))+( 0.000610000*(STATES[1]+38.9000))/(exp( 0.145000*(STATES[1]+38.9000)) - 1.00000));
ALGEBRAIC[42] = 1.00000/(1.00000+exp(- (STATES[0] - 1.50000)/16.7000));
ALGEBRAIC[43] = 0.00100000/(( 7.19000e-05*(STATES[0]+30.0000))/(1.00000 - exp( - 0.148000*(STATES[0]+30.0000)))+( 0.000131000*(STATES[0]+30.0000))/(exp( 0.0687000*(STATES[0]+30.0000)) - 1.00000));
ALGEBRAIC[45] = 1.00000/(1.00000+exp(- (STATES[1] - 1.50000)/16.7000));
ALGEBRAIC[46] = 0.00100000/(( 7.19000e-05*(STATES[1]+30.0000))/(1.00000 - exp( - 0.148000*(STATES[1]+30.0000)))+( 0.000131000*(STATES[1]+30.0000))/(exp( 0.0687000*(STATES[1]+30.0000)) - 1.00000));
ALGEBRAIC[58] = 1.00600/(1.00000+exp((STATES[0]+36.6900+10.0000)/12.4300));
ALGEBRAIC[59] = ALGEBRAIC[58];
ALGEBRAIC[61] = 1.00600/(1.00000+exp((STATES[1]+36.6900+10.0000)/12.4300));
ALGEBRAIC[62] = ALGEBRAIC[61];
ALGEBRAIC[65] = (( (( 1.00000*CONSTANTS[107]*STATES[0]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1]))*( 0.750000*STATES[2]*exp(( STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) -  0.750000*CONSTANTS[3]))/(exp(( STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) - 1.00000))/(1.00000+pow(0.00250000/STATES[40], 3.00000));
ALGEBRAIC[66] = (( (( 1.00000*CONSTANTS[125]*STATES[1]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1]))*( 0.750000*STATES[2]*exp(( STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) -  0.750000*STATES[6]))/(exp(( STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) - 1.00000))/(1.00000+pow(0.00250000/STATES[40], 3.00000));
ALGEBRAIC[67] = (( (( 1.00000*CONSTANTS[108]*STATES[0]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1]))*( 0.750000*STATES[3]*exp(( STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) -  0.750000*CONSTANTS[5]))/(exp(( STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) - 1.00000))/(1.00000+pow(0.00250000/STATES[40], 3.00000));
ALGEBRAIC[68] = (( (( 1.00000*CONSTANTS[126]*STATES[1]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1]))*( 0.750000*STATES[3]*exp(( STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) -  0.750000*STATES[7]))/(exp(( STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) - 1.00000))/(1.00000+pow(0.00250000/STATES[40], 3.00000));
ALGEBRAIC[2] = ( log(CONSTANTS[3]/STATES[2])*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2];
ALGEBRAIC[69] =  CONSTANTS[100]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[8] = ( log(STATES[6]/STATES[2])*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2];
ALGEBRAIC[70] =  CONSTANTS[118]*(STATES[1] - ALGEBRAIC[8]);
ALGEBRAIC[73] = ( CONSTANTS[104]*exp(( - 0.850000*STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))*( exp(( STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))*pow(STATES[2], 3.00000)*CONSTANTS[4] -  pow(CONSTANTS[3], 3.00000)*STATES[40]))/(1.00000+ 0.000100000*exp(( - 0.850000*STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))*( exp(( STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))*pow(STATES[2], 3.00000)*CONSTANTS[4]+ pow(CONSTANTS[3], 3.00000)*STATES[40]));
ALGEBRAIC[74] = ( CONSTANTS[122]*exp(( - 0.850000*STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))*( exp(( STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))*pow(STATES[2], 3.00000)*STATES[36] -  pow(STATES[6], 3.00000)*STATES[40]))/(1.00000+ 0.000100000*exp(( - 0.850000*STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))*( exp(( STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))*pow(STATES[2], 3.00000)*STATES[36]+ pow(STATES[6], 3.00000)*STATES[40]));
ALGEBRAIC[75] = ( (( (CONSTANTS[103]/(1.00000+ 0.124500*exp(( - 0.100000*STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))+ (( 0.0365000*1.00000)/7.00000)*(exp(CONSTANTS[3]/67.3000) - 1.00000)*exp(( - STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))))*1.00000)/(1.00000+pow(10.0000/STATES[2], 1.50000)))*CONSTANTS[5])/(CONSTANTS[5]+1.50000);
ALGEBRAIC[76] = ( (( (CONSTANTS[121]/(1.00000+ 0.124500*exp(( - 0.100000*STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))+ (( 0.0365000*1.00000)/7.00000)*(exp(STATES[6]/67.3000) - 1.00000)*exp(( - STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))))*1.00000)/(1.00000+pow(10.0000/STATES[2], 1.50000)))*STATES[7])/(STATES[7]+1.50000);
ALGEBRAIC[77] = ( CONSTANTS[102]*STATES[40])/(0.000500000+STATES[40]);
ALGEBRAIC[78] = ( CONSTANTS[120]*STATES[40])/(0.000500000+STATES[40]);
ALGEBRAIC[81] =  (( 1.00000*CONSTANTS[127])/CONSTANTS[71])*(STATES[6] - CONSTANTS[3]);
ALGEBRAIC[82] =  (( 1.00000*CONSTANTS[127])/CONSTANTS[72])*(STATES[36] - CONSTANTS[4]);
ALGEBRAIC[83] =  (( 1.00000*CONSTANTS[127])/CONSTANTS[73])*(STATES[7] - CONSTANTS[5]);
ALGEBRAIC[84] = ( 1.00000*1000.00*CONSTANTS[86]*0.00180000*pow(STATES[40], 2.00000))/(pow(STATES[40], 2.00000)+pow(0.000500000, 2.00000));
ALGEBRAIC[85] =  1250.00*CONSTANTS[86]*5.80000e-05*(STATES[47] - STATES[40]);
ALGEBRAIC[86] =  (( 1.00000*CONSTANTS[85])/CONSTANTS[74])*(STATES[47] - STATES[48]);
ALGEBRAIC[87] =  1800.00*CONSTANTS[85]*(STATES[50]+STATES[51])*(STATES[48] - STATES[22]);
ALGEBRAIC[88] = ( 1.00000*(STATES[22] - STATES[40])*CONSTANTS[86])/CONSTANTS[79];
ALGEBRAIC[89] =  20000.0*STATES[40]*(1.00000 - STATES[53]) -  0.0700000*STATES[53];
ALGEBRAIC[90] =  40000.0*STATES[40]*(1.00000 - STATES[54]) -  STATES[54]*40.0000;
ALGEBRAIC[91] = ( (( (( 1.00000*CONSTANTS[106])/(1.00000 - (ALGEBRAIC[16]+ALGEBRAIC[24])/( 0.458000*(CONSTANTS[80]+CONSTANTS[90]))))*(STATES[15]+STATES[21])*STATES[23]*STATES[0]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1]))*( STATES[3]*exp(( STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) - CONSTANTS[5]))/(exp(( STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) - 1.00000);
ALGEBRAIC[33] = ( log(CONSTANTS[5]/STATES[3])*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2];
ALGEBRAIC[36] = 1.00000/(1.00000+exp((STATES[0]+9.00000)/22.4000));
ALGEBRAIC[92] =  CONSTANTS[93]*0.0261400* pow((CONSTANTS[5]/5.40000), 1.0 / 2)*STATES[38]*ALGEBRAIC[36]*(STATES[0] - ALGEBRAIC[33]);
ALGEBRAIC[37] = ( log(STATES[7]/STATES[3])*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2];
ALGEBRAIC[40] = 1.00000/(1.00000+exp((STATES[1]+9.00000)/22.4000));
ALGEBRAIC[93] =  CONSTANTS[111]*0.0261400* pow((STATES[7]/5.40000), 1.0 / 2)*STATES[39]*ALGEBRAIC[40]*(STATES[1] - ALGEBRAIC[37]);
ALGEBRAIC[41] = ( log((CONSTANTS[5]+ CONSTANTS[63]*CONSTANTS[3])/(STATES[3]+ CONSTANTS[63]*STATES[2]))*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2];
ALGEBRAIC[94] =  CONSTANTS[94]*(0.230800+0.769200/(1.00000+exp((- arbitrary_log( 1.00000*STATES[40], 10) - 4.20000)/0.600000)))*pow(STATES[41], 2.00000)*(STATES[0] - ALGEBRAIC[41]);
ALGEBRAIC[44] = ( log((STATES[7]+ CONSTANTS[64]*STATES[6])/(STATES[3]+ CONSTANTS[64]*STATES[2]))*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2];
ALGEBRAIC[95] =  CONSTANTS[112]*(0.230800+0.769200/(1.00000+exp((- arbitrary_log( 1.00000*STATES[40], 10) - 4.20000)/0.600000)))*pow(STATES[42], 2.00000)*(STATES[1] - ALGEBRAIC[44]);
ALGEBRAIC[47] = ALGEBRAIC[33];
ALGEBRAIC[48] = 1020.00/(1.00000+exp( 0.238500*((STATES[0] - ALGEBRAIC[47]) - 59.2150)));
ALGEBRAIC[49] = ( 1000.00*( 0.491240*exp( 0.0803200*((STATES[0] - ALGEBRAIC[47])+5.47600))+exp( 0.0617500*((STATES[0] - ALGEBRAIC[47]) - 594.310))))/(1.00000+exp( - 0.514300*((STATES[0] - ALGEBRAIC[47])+4.75300)));
ALGEBRAIC[96] =  (( CONSTANTS[97]* pow((CONSTANTS[5]/5.40000), 1.0 / 2)*ALGEBRAIC[48])/(ALGEBRAIC[48]+ALGEBRAIC[49]))*(STATES[0] - ALGEBRAIC[47]);
ALGEBRAIC[50] = ALGEBRAIC[37];
ALGEBRAIC[51] = 1020.00/(1.00000+exp( 0.238500*((STATES[1] - ALGEBRAIC[50]) - 59.2150)));
ALGEBRAIC[52] = ( 1000.00*( 0.491240*exp( 0.0803200*((STATES[1] - ALGEBRAIC[50])+5.47600))+exp( 0.0617500*((STATES[1] - ALGEBRAIC[50]) - 594.310))))/(1.00000+exp( - 0.514300*((STATES[1] - ALGEBRAIC[50])+4.75300)));
ALGEBRAIC[97] =  (( CONSTANTS[115]* pow((STATES[7]/5.40000), 1.0 / 2)*ALGEBRAIC[51])/(ALGEBRAIC[51]+ALGEBRAIC[52]))*(STATES[1] - ALGEBRAIC[50]);
ALGEBRAIC[54] = 1.00000/(1.00000+exp((20.0000 - STATES[0])/5.00000));
ALGEBRAIC[53] = ALGEBRAIC[33];
ALGEBRAIC[98] =  CONSTANTS[95]*ALGEBRAIC[54]*(STATES[0] - ALGEBRAIC[53]);
ALGEBRAIC[56] = 1.00000/(1.00000+exp((20.0000 - STATES[1])/5.00000));
ALGEBRAIC[55] = ALGEBRAIC[37];
ALGEBRAIC[99] =  CONSTANTS[113]*ALGEBRAIC[56]*(STATES[1] - ALGEBRAIC[55]);
ALGEBRAIC[57] = ALGEBRAIC[33];
ALGEBRAIC[100] =  (CONSTANTS[96]/( (1.00000+exp((STATES[0]+57.5300)/- 5.86300))*(1.00000+exp((STATES[0] - 45.8000)/25.8700))))*( STATES[43]*CONSTANTS[65]+ STATES[44]*(1.00000 - CONSTANTS[65]))*(STATES[0] - ALGEBRAIC[57]);
ALGEBRAIC[60] = ALGEBRAIC[37];
ALGEBRAIC[101] =  (CONSTANTS[114]/( (1.00000+exp((STATES[1]+57.5300)/- 5.86300))*(1.00000+exp((STATES[1] - 45.8000)/25.8700))))*( STATES[45]*CONSTANTS[68]+ STATES[46]*(1.00000 - CONSTANTS[68]))*(STATES[1] - ALGEBRAIC[60]);
ALGEBRAIC[63] = ALGEBRAIC[33];
ALGEBRAIC[102] =  (( CONSTANTS[98]*(0.800000 - 0.650000/(1.00000+exp((STATES[0]+125.000)/15.0000)))*0.850000)/(1.00000+pow(66.0000/STATES[2], 2.80000)))*(STATES[0] - ALGEBRAIC[63]);
ALGEBRAIC[64] = ALGEBRAIC[37];
ALGEBRAIC[103] =  (( CONSTANTS[116]*(0.800000 - 0.650000/(1.00000+exp((STATES[1]+125.000)/15.0000)))*0.850000)/(1.00000+pow(66.0000/STATES[2], 2.80000)))*(STATES[1] - ALGEBRAIC[64]);
ALGEBRAIC[71] = ( log(CONSTANTS[4]/STATES[40])*CONSTANTS[0]*CONSTANTS[1])/( 2.00000*CONSTANTS[2]);
ALGEBRAIC[104] =  CONSTANTS[101]*(STATES[0] - ALGEBRAIC[71]);
ALGEBRAIC[72] = ( log(STATES[36]/STATES[40])*CONSTANTS[0]*CONSTANTS[1])/( 2.00000*CONSTANTS[2]);
ALGEBRAIC[105] =  CONSTANTS[119]*(STATES[1] - ALGEBRAIC[72]);
ALGEBRAIC[79] = ALGEBRAIC[33];
ALGEBRAIC[106] =  (( CONSTANTS[99]*1.00000)/(1.00000+pow(CONSTANTS[6]/0.114000, 2.00000)))*pow(CONSTANTS[5]/4.00000, 0.240000)*(STATES[0] - ALGEBRAIC[79]);
ALGEBRAIC[80] = ALGEBRAIC[37];
ALGEBRAIC[107] =  (( CONSTANTS[117]*1.00000)/(1.00000+pow(CONSTANTS[6]/0.114000, 2.00000)))*pow(STATES[7]/4.00000, 0.240000)*(STATES[1] - ALGEBRAIC[80]);
}
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;
SI[48] = 1.0;
SI[49] = 1.0;
SI[50] = 1.0;
SI[51] = 1.0;
SI[52] = 1.0;
SI[53] = 1.0;
SI[54] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
CONDVAR[0] = (VOI -  floor(VOI/CONSTANTS[48])*CONSTANTS[48]) - 0.00000;
CONDVAR[1] = (VOI -  floor(VOI/CONSTANTS[48])*CONSTANTS[48]) - 0.00100000;
}