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 93 entries in the algebraic variable array.
   There are a total of 41 entries in each of the rate and state variable arrays.
   There are a total of 148 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[145] is Vt in component model_parameters (cm3).
 * CONSTANTS[112] is Vd in component model_parameters (cm3).
 * CONSTANTS[113] is Vmyo in component model_parameters (cm3).
 * CONSTANTS[116] is Sms in component model_parameters (cm2).
 * CONSTANTS[117] is Smt in component model_parameters (cm2).
 * CONSTANTS[147] is Cms in component model_parameters (microF).
 * CONSTANTS[146] is Cmt in component model_parameters (microF).
 * CONSTANTS[106] is Vc in component model_parameters (cm3).
 * CONSTANTS[114] is VSRup in component model_parameters (cm3).
 * CONSTANTS[115] is VSRrel in component model_parameters (cm3).
 * CONSTANTS[118] is pt in component model_parameters (dimensionless).
 * CONSTANTS[143] is Lt in component model_parameters (cm).
 * CONSTANTS[144] is Rst in component model_parameters (ohm).
 * CONSTANTS[6] is Rot in component model_parameters (ohm_per_cm2).
 * CONSTANTS[7] is radiust in component model_parameters (cm).
 * CONSTANTS[8] is ptcm in component model_parameters (per_cm).
 * CONSTANTS[9] is Smtot in component model_parameters (cm2).
 * ALGEBRAIC[0] is i_circ in component common_current (microA).
 * CONSTANTS[10] is R_st in component common_current (kilo_ohm).
 * STATES[0] is Vm_s in component membrane (millivolt).
 * STATES[1] is Vm_t in component membrane (millivolt).
 * ALGEBRAIC[1] is J_CaSRrel in component SR_Ca_release_channel (millimolar_per_second).
 * CONSTANTS[11] is kap in component SR_Ca_release_channel (per_millimolar4_per_second).
 * CONSTANTS[12] is kam in component SR_Ca_release_channel (per_second).
 * CONSTANTS[13] is kbp in component SR_Ca_release_channel (per_millimolar3_per_second).
 * CONSTANTS[14] is kbm in component SR_Ca_release_channel (per_second).
 * CONSTANTS[15] is kcp in component SR_Ca_release_channel (per_second).
 * CONSTANTS[16] is kcm in component SR_Ca_release_channel (per_second).
 * STATES[2] is F2 in component SR_Ca_release_channel (dimensionless).
 * STATES[3] is F3 in component SR_Ca_release_channel (dimensionless).
 * STATES[4] is F1 in component SR_Ca_release_channel (dimensionless).
 * STATES[5] is F4 in component SR_Ca_release_channel (dimensionless).
 * STATES[6] is Ca_ss in component ion_concentrations (millimolar).
 * STATES[7] is CaSRrel in component ion_concentrations (millimolar).
 * ALGEBRAIC[4] is J_CaSRup in component SERCA2a_pump (millimolar_per_second).
 * CONSTANTS[17] is K_fb in component SERCA2a_pump (millimolar).
 * CONSTANTS[18] is K_rb in component SERCA2a_pump (millimolar).
 * ALGEBRAIC[2] is fb in component SERCA2a_pump (dimensionless).
 * ALGEBRAIC[3] is rb in component SERCA2a_pump (dimensionless).
 * CONSTANTS[19] is Vmaxf in component SERCA2a_pump (millimolar_per_second).
 * CONSTANTS[20] is Vmaxr in component SERCA2a_pump (millimolar_per_second).
 * CONSTANTS[21] is K_SR in component SERCA2a_pump (dimensionless).
 * CONSTANTS[22] is N_fb in component SERCA2a_pump (dimensionless).
 * CONSTANTS[23] is N_rb in component SERCA2a_pump (dimensionless).
 * STATES[8] is Ca_i in component ion_concentrations (millimolar).
 * STATES[9] is CaSRup in component ion_concentrations (millimolar).
 * ALGEBRAIC[5] is J_tr in component intracellular_and_SR_Ca_fluxes (millimolar_per_second).
 * ALGEBRAIC[6] is J_xfer in component intracellular_and_SR_Ca_fluxes (millimolar_per_second).
 * ALGEBRAIC[9] is J_trpn in component intracellular_and_SR_Ca_fluxes (millimolar_per_second).
 * ALGEBRAIC[7] is J_BTRH in component intracellular_and_SR_Ca_fluxes (millimolar_per_second).
 * ALGEBRAIC[8] is J_BTRL in component intracellular_and_SR_Ca_fluxes (millimolar_per_second).
 * CONSTANTS[24] is BTRHmax in component intracellular_and_SR_Ca_fluxes (millimolar).
 * CONSTANTS[25] is BTRLmax in component intracellular_and_SR_Ca_fluxes (millimolar).
 * CONSTANTS[26] is tau_tr in component intracellular_and_SR_Ca_fluxes (second).
 * CONSTANTS[27] is tau_xfer in component intracellular_and_SR_Ca_fluxes (second).
 * STATES[10] is BTRH in component intracellular_and_SR_Ca_fluxes (millimolar).
 * STATES[11] is BTRL in component intracellular_and_SR_Ca_fluxes (millimolar).
 * CONSTANTS[28] is k_htrpn_plus in component intracellular_and_SR_Ca_fluxes (per_millimolar_per_second).
 * CONSTANTS[29] is k_htrpn_minus in component intracellular_and_SR_Ca_fluxes (per_second).
 * CONSTANTS[30] is k_ltrpn_plus in component intracellular_and_SR_Ca_fluxes (per_millimolar_per_second).
 * CONSTANTS[31] is k_ltrpn_minus in component intracellular_and_SR_Ca_fluxes (per_second).
 * STATES[12] is Na_i in component ion_concentrations (millimolar).
 * STATES[13] is K_i in component ion_concentrations (millimolar).
 * STATES[14] is Na_t in component ion_concentrations (millimolar).
 * STATES[15] is Ca_t in component ion_concentrations (millimolar).
 * STATES[16] is K_t in component ion_concentrations (millimolar).
 * ALGEBRAIC[10] is i_Kext in component ion_concentrations (microA).
 * CONSTANTS[32] is K_mCMDN in component ion_concentrations (millimolar).
 * CONSTANTS[33] is K_mCSQN in component ion_concentrations (millimolar).
 * CONSTANTS[34] is K_mEGTA in component ion_concentrations (millimolar).
 * CONSTANTS[35] is CMDN_tot in component ion_concentrations (millimolar).
 * CONSTANTS[36] is CSQN_tot in component ion_concentrations (millimolar).
 * CONSTANTS[37] is EGTA_tot in component ion_concentrations (millimolar).
 * CONSTANTS[38] is tau_d in component ion_concentrations (second).
 * CONSTANTS[39] is STIMULATION in component ion_concentrations (dimensionless).
 * CONSTANTS[40] is time0 in component ion_concentrations (second).
 * ALGEBRAIC[15] is i_Na_s in component sodium_current (microA).
 * ALGEBRAIC[27] is i_Ca_s in component calcium_current (microA).
 * ALGEBRAIC[46] is i_BNa_s in component background_currents (microA).
 * ALGEBRAIC[52] is i_NaCa_s in component Na_Ca_ion_exchanger_current (microA).
 * ALGEBRAIC[50] is i_NaK_s in component sodium_potassium_pump (microA).
 * ALGEBRAIC[41] is i_fNa_s in component hyperpolarisation_activated_current (microA).
 * ALGEBRAIC[42] is i_fK_s in component hyperpolarisation_activated_current (microA).
 * ALGEBRAIC[48] is i_BK_s in component background_currents (microA).
 * ALGEBRAIC[40] is i_K1_s in component inward_rectifier (microA).
 * ALGEBRAIC[29] is i_Kto_s in component Ca_independent_transient_outward_K_current (microA).
 * ALGEBRAIC[36] is i_Kss_s in component steady_state_outward_K_current (microA).
 * ALGEBRAIC[51] is i_CaP_s in component sarcolemmal_calcium_pump_current (microA).
 * ALGEBRAIC[47] is i_BCa_s in component background_currents (microA).
 * ALGEBRAIC[54] is i_Na_t in component sodium_current (microA).
 * ALGEBRAIC[66] is i_Ca_t in component calcium_current (microA).
 * ALGEBRAIC[85] is i_BNa_t in component background_currents (microA).
 * ALGEBRAIC[92] is i_NaCa_t in component Na_Ca_ion_exchanger_current (microA).
 * ALGEBRAIC[90] is i_NaK_t in component sodium_potassium_pump (microA).
 * ALGEBRAIC[80] is i_fNa_t in component hyperpolarisation_activated_current (microA).
 * ALGEBRAIC[81] is i_fK_t in component hyperpolarisation_activated_current (microA).
 * ALGEBRAIC[87] is i_BK_t in component background_currents (microA).
 * ALGEBRAIC[79] is i_K1_t in component inward_rectifier (microA).
 * ALGEBRAIC[68] is i_Kto_t in component Ca_independent_transient_outward_K_current (microA).
 * ALGEBRAIC[75] is i_Kss_t in component steady_state_outward_K_current (microA).
 * ALGEBRAIC[91] is i_CaP_t in component sarcolemmal_calcium_pump_current (microA).
 * ALGEBRAIC[86] is i_BCa_t in component background_currents (microA).
 * ALGEBRAIC[11] is Jte_Na in component t_tubular_ion_fluxes (millimolar_per_second).
 * ALGEBRAIC[12] is Jte_Ca in component t_tubular_ion_fluxes (millimolar_per_second).
 * ALGEBRAIC[13] is Jte_K in component t_tubular_ion_fluxes (millimolar_per_second).
 * CONSTANTS[41] is tau_Na in component t_tubular_ion_fluxes (second).
 * CONSTANTS[42] is tau_Ca in component t_tubular_ion_fluxes (second).
 * CONSTANTS[43] is tau_K in component t_tubular_ion_fluxes (second).
 * ALGEBRAIC[43] is i_f_s in component hyperpolarisation_activated_current (microA).
 * ALGEBRAIC[49] is i_B_s in component background_currents (microA).
 * ALGEBRAIC[14] is E_Na in component sodium_current (millivolt).
 * CONSTANTS[44] is g_Na in component sodium_current (milliS_per_cm2).
 * CONSTANTS[119] is g_Nas in component sodium_current (milliS).
 * CONSTANTS[45] is fNat in component sodium_current (dimensionless).
 * STATES[17] is m in component sodium_current_m_gate (dimensionless).
 * STATES[18] is h in component sodium_current_h_gate (dimensionless).
 * ALGEBRAIC[16] is alpha_m in component sodium_current_m_gate (per_second).
 * ALGEBRAIC[17] is beta_m in component sodium_current_m_gate (per_second).
 * ALGEBRAIC[18] is alpha_h in component sodium_current_h_gate (per_second).
 * ALGEBRAIC[19] is beta_h in component sodium_current_h_gate (per_second).
 * STATES[19] is Co in component calcium_current (dimensionless).
 * STATES[20] is C_cast in component calcium_current (dimensionless).
 * STATES[21] is C1 in component calcium_current (dimensionless).
 * STATES[22] is C2 in component calcium_current (dimensionless).
 * ALGEBRAIC[21] is tauCo in component calcium_current (second).
 * CONSTANTS[46] is tauC_cast in component calcium_current (second).
 * ALGEBRAIC[23] is tauC1 in component calcium_current (second).
 * ALGEBRAIC[25] is tauC2 in component calcium_current (second).
 * ALGEBRAIC[20] is Co_inf in component calcium_current (dimensionless).
 * ALGEBRAIC[26] is C_cast_inf in component calcium_current (dimensionless).
 * ALGEBRAIC[22] is C1_inf in component calcium_current (dimensionless).
 * ALGEBRAIC[24] is C2_inf in component calcium_current (dimensionless).
 * CONSTANTS[47] is g_Ca in component calcium_current (cm_per_second).
 * CONSTANTS[120] is g_Cas in component calcium_current (cm3_per_second).
 * CONSTANTS[48] is fCat in component calcium_current (dimensionless).
 * ALGEBRAIC[28] is E_K in component Ca_independent_transient_outward_K_current (millivolt).
 * CONSTANTS[49] is a in component Ca_independent_transient_outward_K_current (dimensionless).
 * CONSTANTS[50] is b in component Ca_independent_transient_outward_K_current (dimensionless).
 * CONSTANTS[51] is g_Kto in component Ca_independent_transient_outward_K_current (milliS_per_cm2).
 * CONSTANTS[121] is g_Ktos in component Ca_independent_transient_outward_K_current (milliS).
 * CONSTANTS[52] is fKtot in component Ca_independent_transient_outward_K_current (dimensionless).
 * STATES[23] is r in component Ca_independent_transient_outward_K_current_r_gate (dimensionless).
 * STATES[24] is s in component Ca_independent_transient_outward_K_current_s_gate (dimensionless).
 * STATES[25] is s_slow in component Ca_independent_transient_outward_K_current_s_slow_gate (dimensionless).
 * ALGEBRAIC[31] is tau_r in component Ca_independent_transient_outward_K_current_r_gate (second).
 * ALGEBRAIC[30] is r_max in component Ca_independent_transient_outward_K_current_r_gate (dimensionless).
 * ALGEBRAIC[33] is tau_s in component Ca_independent_transient_outward_K_current_s_gate (second).
 * ALGEBRAIC[32] is s_max in component Ca_independent_transient_outward_K_current_s_gate (dimensionless).
 * ALGEBRAIC[35] is tau_s_slow in component Ca_independent_transient_outward_K_current_s_slow_gate (second).
 * ALGEBRAIC[34] is s_slow_max in component Ca_independent_transient_outward_K_current_s_slow_gate (dimensionless).
 * CONSTANTS[53] is g_Kss in component steady_state_outward_K_current (milliS_per_cm2).
 * CONSTANTS[122] is g_Ksss in component steady_state_outward_K_current (milliS).
 * CONSTANTS[54] is fKsst in component steady_state_outward_K_current (dimensionless).
 * STATES[26] is r_ss in component steady_state_outward_K_current_r_ss_gate (dimensionless).
 * STATES[27] is s_ss in component steady_state_outward_K_current_s_ss_gate (dimensionless).
 * ALGEBRAIC[38] is tau_r_ss in component steady_state_outward_K_current_r_ss_gate (second).
 * ALGEBRAIC[37] is r_ss_max in component steady_state_outward_K_current_r_ss_gate (dimensionless).
 * CONSTANTS[107] is tau_s_ss in component steady_state_outward_K_current_s_ss_gate (second).
 * ALGEBRAIC[39] is s_ss_max in component steady_state_outward_K_current_s_ss_gate (dimensionless).
 * CONSTANTS[55] is g_K1 in component inward_rectifier (milliS_per_cm2).
 * CONSTANTS[123] is g_K1s in component inward_rectifier (milliS).
 * CONSTANTS[56] is fK1t in component inward_rectifier (dimensionless).
 * CONSTANTS[57] is g_f in component hyperpolarisation_activated_current (milliS_per_cm2).
 * CONSTANTS[124] is g_fs in component hyperpolarisation_activated_current (milliS).
 * CONSTANTS[58] is fft in component hyperpolarisation_activated_current (dimensionless).
 * CONSTANTS[59] is f_Na in component hyperpolarisation_activated_current (dimensionless).
 * CONSTANTS[108] is f_K in component hyperpolarisation_activated_current (dimensionless).
 * STATES[28] is y in component hyperpolarisation_activated_current_y_gate (dimensionless).
 * ALGEBRAIC[45] is tau_y in component hyperpolarisation_activated_current_y_gate (second).
 * ALGEBRAIC[44] is y_infinity in component hyperpolarisation_activated_current_y_gate (dimensionless).
 * CONSTANTS[60] is g_B_Ca in component background_currents (milliS_per_cm2).
 * CONSTANTS[61] is g_B_Na in component background_currents (milliS_per_cm2).
 * CONSTANTS[62] is g_B_K in component background_currents (milliS_per_cm2).
 * CONSTANTS[125] is g_B_Cas in component background_currents (milliS).
 * CONSTANTS[126] is g_B_Nas in component background_currents (milliS).
 * CONSTANTS[127] is g_B_Ks in component background_currents (milliS).
 * CONSTANTS[63] is fCabt in component background_currents (dimensionless).
 * CONSTANTS[64] is fNabt in component background_currents (dimensionless).
 * CONSTANTS[65] is fKbt in component background_currents (dimensionless).
 * CONSTANTS[66] is E_Ca in component background_currents (millivolt).
 * CONSTANTS[67] is i_NaK_max in component sodium_potassium_pump (microA_per_cm2).
 * CONSTANTS[128] is i_NaK_max_s in component sodium_potassium_pump (microA).
 * CONSTANTS[68] is fNaKt in component sodium_potassium_pump (dimensionless).
 * CONSTANTS[69] is K_m_K in component sodium_potassium_pump (millimolar).
 * CONSTANTS[70] is K_m_Na in component sodium_potassium_pump (millimolar).
 * CONSTANTS[109] is sigma in component sodium_potassium_pump (dimensionless).
 * CONSTANTS[71] is i_CaP_max in component sarcolemmal_calcium_pump_current (microA_per_cm2).
 * CONSTANTS[129] is i_CaP_max_s in component sarcolemmal_calcium_pump_current (microA).
 * CONSTANTS[72] is fCaPt in component sarcolemmal_calcium_pump_current (dimensionless).
 * CONSTANTS[73] is i_NaCa_max in component Na_Ca_ion_exchanger_current (microA_per_cm2).
 * CONSTANTS[130] is i_NaCa_max_s in component Na_Ca_ion_exchanger_current (microA).
 * CONSTANTS[74] is fNaCat in component Na_Ca_ion_exchanger_current (dimensionless).
 * ALGEBRAIC[82] is i_f_t in component hyperpolarisation_activated_current (microA).
 * ALGEBRAIC[88] is i_B_t in component background_currents (microA).
 * ALGEBRAIC[53] is E_Na in component sodium_current (millivolt).
 * CONSTANTS[75] is g_Na in component sodium_current (milliS_per_cm2).
 * CONSTANTS[131] is g_Nat in component sodium_current (milliS).
 * CONSTANTS[76] is fNat in component sodium_current (dimensionless).
 * STATES[29] is m in component sodium_current_m_gate (dimensionless).
 * STATES[30] is h in component sodium_current_h_gate (dimensionless).
 * ALGEBRAIC[55] is alpha_m in component sodium_current_m_gate (per_second).
 * ALGEBRAIC[56] is beta_m in component sodium_current_m_gate (per_second).
 * ALGEBRAIC[57] is alpha_h in component sodium_current_h_gate (per_second).
 * ALGEBRAIC[58] is beta_h in component sodium_current_h_gate (per_second).
 * STATES[31] is Co in component calcium_current (dimensionless).
 * STATES[32] is C_cast in component calcium_current (dimensionless).
 * STATES[33] is C1 in component calcium_current (dimensionless).
 * STATES[34] is C2 in component calcium_current (dimensionless).
 * ALGEBRAIC[60] is tauCo in component calcium_current (second).
 * CONSTANTS[77] is tauC_cast in component calcium_current (second).
 * ALGEBRAIC[62] is tauC1 in component calcium_current (second).
 * ALGEBRAIC[64] is tauC2 in component calcium_current (second).
 * ALGEBRAIC[59] is Co_inf in component calcium_current (dimensionless).
 * ALGEBRAIC[65] is C_cast_inf in component calcium_current (dimensionless).
 * ALGEBRAIC[61] is C1_inf in component calcium_current (dimensionless).
 * ALGEBRAIC[63] is C2_inf in component calcium_current (dimensionless).
 * CONSTANTS[78] is g_Ca in component calcium_current (cm_per_second).
 * CONSTANTS[132] is g_Cat in component calcium_current (cm3_per_second).
 * CONSTANTS[79] is fCat in component calcium_current (dimensionless).
 * ALGEBRAIC[67] is E_K in component Ca_independent_transient_outward_K_current (millivolt).
 * CONSTANTS[80] is a in component Ca_independent_transient_outward_K_current (dimensionless).
 * CONSTANTS[81] is b in component Ca_independent_transient_outward_K_current (dimensionless).
 * CONSTANTS[82] is g_Kto in component Ca_independent_transient_outward_K_current (milliS_per_cm2).
 * CONSTANTS[133] is g_Ktot in component Ca_independent_transient_outward_K_current (milliS).
 * CONSTANTS[83] is fKtot in component Ca_independent_transient_outward_K_current (dimensionless).
 * STATES[35] is r in component Ca_independent_transient_outward_K_current_r_gate (dimensionless).
 * STATES[36] is s in component Ca_independent_transient_outward_K_current_s_gate (dimensionless).
 * STATES[37] is s_slow in component Ca_independent_transient_outward_K_current_s_slow_gate (dimensionless).
 * ALGEBRAIC[70] is tau_r in component Ca_independent_transient_outward_K_current_r_gate (second).
 * ALGEBRAIC[69] is r_max in component Ca_independent_transient_outward_K_current_r_gate (dimensionless).
 * ALGEBRAIC[72] is tau_t in component Ca_independent_transient_outward_K_current_s_gate (second).
 * ALGEBRAIC[71] is s_max in component Ca_independent_transient_outward_K_current_s_gate (dimensionless).
 * ALGEBRAIC[74] is tau_s_slow in component Ca_independent_transient_outward_K_current_s_slow_gate (second).
 * ALGEBRAIC[73] is s_slow_max in component Ca_independent_transient_outward_K_current_s_slow_gate (dimensionless).
 * CONSTANTS[84] is g_Kss in component steady_state_outward_K_current (milliS_per_cm2).
 * CONSTANTS[134] is g_Ksst in component steady_state_outward_K_current (milliS).
 * CONSTANTS[85] is fKsst in component steady_state_outward_K_current (dimensionless).
 * STATES[38] is r_ss in component steady_state_outward_K_current_r_ss_gate (dimensionless).
 * STATES[39] is s_ss in component steady_state_outward_K_current_s_ss_gate (dimensionless).
 * ALGEBRAIC[77] is tau_r_ss in component steady_state_outward_K_current_r_ss_gate (second).
 * ALGEBRAIC[76] is r_ss_max in component steady_state_outward_K_current_r_ss_gate (dimensionless).
 * CONSTANTS[110] is tau_s_ss in component steady_state_outward_K_current_s_ss_gate (second).
 * ALGEBRAIC[78] is s_ss_max in component steady_state_outward_K_current_s_ss_gate (dimensionless).
 * CONSTANTS[86] is g_K1 in component inward_rectifier (milliS_per_cm2).
 * CONSTANTS[135] is g_K1t in component inward_rectifier (milliS).
 * CONSTANTS[87] is fK1t in component inward_rectifier (dimensionless).
 * CONSTANTS[88] is g_f in component hyperpolarisation_activated_current (milliS_per_cm2).
 * CONSTANTS[136] is g_ft in component hyperpolarisation_activated_current (milliS).
 * CONSTANTS[89] is fft in component hyperpolarisation_activated_current (dimensionless).
 * CONSTANTS[90] is f_Na in component hyperpolarisation_activated_current (dimensionless).
 * CONSTANTS[111] is f_K in component hyperpolarisation_activated_current (dimensionless).
 * STATES[40] is y in component hyperpolarisation_activated_current_y_gate (dimensionless).
 * ALGEBRAIC[84] is tau_y in component hyperpolarisation_activated_current_y_gate (second).
 * ALGEBRAIC[83] is y_infinity in component hyperpolarisation_activated_current_y_gate (dimensionless).
 * CONSTANTS[91] is g_B_Ca in component background_currents (milliS_per_cm2).
 * CONSTANTS[92] is g_B_Na in component background_currents (milliS_per_cm2).
 * CONSTANTS[93] is g_B_K in component background_currents (milliS_per_cm2).
 * CONSTANTS[137] is g_B_Cat in component background_currents (milliS).
 * CONSTANTS[138] is g_B_Nat in component background_currents (milliS).
 * CONSTANTS[139] is g_B_Kt in component background_currents (milliS).
 * CONSTANTS[94] is fCabt in component background_currents (dimensionless).
 * CONSTANTS[95] is fNabt in component background_currents (dimensionless).
 * CONSTANTS[96] is fKbt in component background_currents (dimensionless).
 * CONSTANTS[97] is E_Ca in component background_currents (millivolt).
 * CONSTANTS[98] is i_NaK_max in component sodium_potassium_pump (microA_per_cm2).
 * CONSTANTS[140] is i_NaK_max_t in component sodium_potassium_pump (microA).
 * CONSTANTS[99] is fNaKt in component sodium_potassium_pump (dimensionless).
 * CONSTANTS[100] is K_m_K in component sodium_potassium_pump (millimolar).
 * CONSTANTS[101] is K_m_Na in component sodium_potassium_pump (millimolar).
 * ALGEBRAIC[89] is sigma in component sodium_potassium_pump (dimensionless).
 * CONSTANTS[102] is i_CaP_max in component sarcolemmal_calcium_pump_current (microA_per_cm2).
 * CONSTANTS[141] is i_CaP_max_t in component sarcolemmal_calcium_pump_current (microA).
 * CONSTANTS[103] is fCaPt in component sarcolemmal_calcium_pump_current (dimensionless).
 * CONSTANTS[104] is i_NaCa_max in component Na_Ca_ion_exchanger_current (microA_per_cm2).
 * CONSTANTS[142] is i_NaCa_max_t in component Na_Ca_ion_exchanger_current (microA).
 * CONSTANTS[105] is fNaCat in component Na_Ca_ion_exchanger_current (dimensionless).
 * RATES[4] is d/dt F1 in component SR_Ca_release_channel (dimensionless).
 * RATES[2] is d/dt F2 in component SR_Ca_release_channel (dimensionless).
 * RATES[3] is d/dt F3 in component SR_Ca_release_channel (dimensionless).
 * RATES[5] is d/dt F4 in component SR_Ca_release_channel (dimensionless).
 * RATES[10] is d/dt BTRH in component intracellular_and_SR_Ca_fluxes (millimolar).
 * RATES[11] is d/dt BTRL in component intracellular_and_SR_Ca_fluxes (millimolar).
 * RATES[12] is d/dt Na_i in component ion_concentrations (millimolar).
 * RATES[14] is d/dt Na_t in component ion_concentrations (millimolar).
 * RATES[13] is d/dt K_i in component ion_concentrations (millimolar).
 * RATES[16] is d/dt K_t in component ion_concentrations (millimolar).
 * RATES[8] is d/dt Ca_i in component ion_concentrations (millimolar).
 * RATES[15] is d/dt Ca_t in component ion_concentrations (millimolar).
 * RATES[6] is d/dt Ca_ss in component ion_concentrations (millimolar).
 * RATES[7] is d/dt CaSRrel in component ion_concentrations (millimolar).
 * RATES[9] is d/dt CaSRup in component ion_concentrations (millimolar).
 * RATES[0] is d/dt Vm_s in component membrane (millivolt).
 * RATES[17] is d/dt m in component sodium_current_m_gate (dimensionless).
 * RATES[18] is d/dt h in component sodium_current_h_gate (dimensionless).
 * RATES[19] is d/dt Co in component calcium_current (dimensionless).
 * RATES[21] is d/dt C1 in component calcium_current (dimensionless).
 * RATES[22] is d/dt C2 in component calcium_current (dimensionless).
 * RATES[20] is d/dt C_cast in component calcium_current (dimensionless).
 * RATES[23] is d/dt r in component Ca_independent_transient_outward_K_current_r_gate (dimensionless).
 * RATES[24] is d/dt s in component Ca_independent_transient_outward_K_current_s_gate (dimensionless).
 * RATES[25] is d/dt s_slow in component Ca_independent_transient_outward_K_current_s_slow_gate (dimensionless).
 * RATES[26] is d/dt r_ss in component steady_state_outward_K_current_r_ss_gate (dimensionless).
 * RATES[27] is d/dt s_ss in component steady_state_outward_K_current_s_ss_gate (dimensionless).
 * RATES[28] is d/dt y in component hyperpolarisation_activated_current_y_gate (dimensionless).
 * RATES[1] is d/dt Vm_t in component membrane (millivolt).
 * RATES[29] is d/dt m in component sodium_current_m_gate (dimensionless).
 * RATES[30] is d/dt h in component sodium_current_h_gate (dimensionless).
 * RATES[31] is d/dt Co in component calcium_current (dimensionless).
 * RATES[33] is d/dt C1 in component calcium_current (dimensionless).
 * RATES[34] is d/dt C2 in component calcium_current (dimensionless).
 * RATES[32] is d/dt C_cast in component calcium_current (dimensionless).
 * RATES[35] is d/dt r in component Ca_independent_transient_outward_K_current_r_gate (dimensionless).
 * RATES[36] is d/dt s in component Ca_independent_transient_outward_K_current_s_gate (dimensionless).
 * RATES[37] is d/dt s_slow in component Ca_independent_transient_outward_K_current_s_slow_gate (dimensionless).
 * RATES[38] is d/dt r_ss in component steady_state_outward_K_current_r_ss_gate (dimensionless).
 * RATES[39] is d/dt s_ss in component steady_state_outward_K_current_s_ss_gate (dimensionless).
 * RATES[40] is d/dt y in component hyperpolarisation_activated_current_y_gate (dimensionless).
 * There are a total of 1 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 8310;
CONSTANTS[1] = 295;
CONSTANTS[2] = 96500;
CONSTANTS[3] = 140;
CONSTANTS[4] = 1.2;
CONSTANTS[5] = 5.4;
CONSTANTS[6] = 83.33;
CONSTANTS[7] = 150e-7;
CONSTANTS[8] = 30000000;
CONSTANTS[9] = 0.0001;
CONSTANTS[10] = 20.0;
STATES[0] = -7.9709547e1;
STATES[1] = -7.9709536e1;
CONSTANTS[11] = 12.15e12;
CONSTANTS[12] = 576;
CONSTANTS[13] = 4.05e9;
CONSTANTS[14] = 1930;
CONSTANTS[15] = 100;
CONSTANTS[16] = 0.8;
STATES[2] = 3.8333331e-4;
STATES[3] = 6.4516879e-11;
STATES[4] = 6.7606483e-1;
STATES[5] = 3.2355462e-1;
STATES[6] = 4.3112114e-5;
STATES[7] = 2.2638169e-1;
CONSTANTS[17] = 0.000168;
CONSTANTS[18] = 3.29;
CONSTANTS[19] = 0.4;
CONSTANTS[20] = 0.9;
CONSTANTS[21] = 1;
CONSTANTS[22] = 1.2;
CONSTANTS[23] = 1;
STATES[8] = 3.5486498e-5;
STATES[9] = 2.2755058e-1;
CONSTANTS[24] = 0.14;
CONSTANTS[25] = 0.07;
CONSTANTS[26] = 0.02;
CONSTANTS[27] = 0.008;
STATES[10] = 9.2804169e-1;
STATES[11] = 3.4317829e-2;
CONSTANTS[28] = 20000;
CONSTANTS[29] = 0.07;
CONSTANTS[30] = 40000;
CONSTANTS[31] = 40;
STATES[12] = 6.9435814e0;
STATES[13] = 1.3753311e2;
STATES[14] = 1.4001386e2;
STATES[15] = 1.2271399e0;
STATES[16] = 5.3627676e0;
CONSTANTS[32] = 0.00238;
CONSTANTS[33] = 0.8;
CONSTANTS[34] = 0.00015;
CONSTANTS[35] = 0.05;
CONSTANTS[36] = 15;
CONSTANTS[37] = 10;
CONSTANTS[38] = 0.008;
CONSTANTS[39] = 1;
CONSTANTS[40] = 0;
CONSTANTS[41] = 0.15;
CONSTANTS[42] = 0.5;
CONSTANTS[43] = 0.15;
CONSTANTS[44] = 10.0;
CONSTANTS[45] = 0.56;
STATES[17] = 2.1832558e-6;
STATES[18] = 5.8232781e-1;
STATES[19] = 2.5436465e-6;
STATES[20] = 9.9570063e-1;
STATES[21] = 9.9994546e-1;
STATES[22] = 9.9994546e-1;
CONSTANTS[46] = 0.009;
CONSTANTS[47] = 0.00021;
CONSTANTS[48] = 0.87;
CONSTANTS[49] = 0.886;
CONSTANTS[50] = 0.114;
CONSTANTS[51] = 0.35;
CONSTANTS[52] = 0.56;
STATES[23] = 2.3485072e-3;
STATES[24] = 9.8315843e-1;
STATES[25] = 6.7483370e-1;
CONSTANTS[53] = 0.07;
CONSTANTS[54] = 0.76;
STATES[26] = 3.1079213e-3;
STATES[27] = 3.0773393e-1;
CONSTANTS[55] = 0.24;
CONSTANTS[56] = 0.56;
CONSTANTS[57] = 0.0145;
CONSTANTS[58] = 0.56;
CONSTANTS[59] = 0.2;
STATES[28] = 3.4357356e-3;
CONSTANTS[60] = 0.000648;
CONSTANTS[61] = 0.0008015;
CONSTANTS[62] = 0.00138;
CONSTANTS[63] = 0.56;
CONSTANTS[64] = 0.56;
CONSTANTS[65] = 0.56;
CONSTANTS[66] = 65;
CONSTANTS[67] = 1;
CONSTANTS[68] = 0.59;
CONSTANTS[69] = 1.5;
CONSTANTS[70] = 10;
CONSTANTS[71] = 0.85;
CONSTANTS[72] = 0.56;
CONSTANTS[73] = 1.8e-4;
CONSTANTS[74] = 0.81;
CONSTANTS[75] = 10.0;
CONSTANTS[76] = 0.56;
STATES[29] = 2.1832694e-6;
STATES[30] = 5.8232717e-1;
STATES[31] = 2.5436520e-6;
STATES[32] = 9.9570063e-1;
STATES[33] = 9.9785393e-1;
STATES[34] = 9.9994546e-1;
CONSTANTS[77] = 0.009;
CONSTANTS[78] = 0.00021;
CONSTANTS[79] = 0.87;
CONSTANTS[80] = 0.886;
CONSTANTS[81] = 0.114;
CONSTANTS[82] = 0.35;
CONSTANTS[83] = 0.56;
STATES[35] = 2.3485094e-3;
STATES[36] = 9.8315865e-1;
STATES[37] = 6.7478532e-1;
CONSTANTS[84] = 0.07;
CONSTANTS[85] = 0.76;
STATES[38] = 3.1079241e-3;
STATES[39] = 3.0773368e-1;
CONSTANTS[86] = 0.24;
CONSTANTS[87] = 0.56;
CONSTANTS[88] = 0.0145;
CONSTANTS[89] = 0.56;
CONSTANTS[90] = 0.2;
STATES[40] = 3.4357175e-3;
CONSTANTS[91] = 0.000648;
CONSTANTS[92] = 0.0008015;
CONSTANTS[93] = 0.00138;
CONSTANTS[94] = 0.56;
CONSTANTS[95] = 0.56;
CONSTANTS[96] = 0.56;
CONSTANTS[97] = 65;
CONSTANTS[98] = 1;
CONSTANTS[99] = 0.59;
CONSTANTS[100] = 1.5;
CONSTANTS[101] = 10;
CONSTANTS[102] = 0.85;
CONSTANTS[103] = 0.56;
CONSTANTS[104] = 1.8e-4;
CONSTANTS[105] = 0.81;
CONSTANTS[106] = CONSTANTS[9]/7850.00;
CONSTANTS[107] = 2.10000;
CONSTANTS[108] = 1.00000 - CONSTANTS[59];
CONSTANTS[109] = (exp(CONSTANTS[3]/67.3000) - 1.00000)/7.00000;
CONSTANTS[110] = 2.10000;
CONSTANTS[111] = 1.00000 - CONSTANTS[90];
CONSTANTS[112] =  CONSTANTS[106]*7.50000e-05;
CONSTANTS[113] =  CONSTANTS[106]*0.585000;
CONSTANTS[114] =  CONSTANTS[106]*0.0315000;
CONSTANTS[115] =  CONSTANTS[106]*0.00350000;
CONSTANTS[116] = CONSTANTS[9] -  4400.00*CONSTANTS[106];
CONSTANTS[117] = CONSTANTS[9] - CONSTANTS[116];
CONSTANTS[118] =  CONSTANTS[8]*CONSTANTS[116];
CONSTANTS[119] =  CONSTANTS[44]*(CONSTANTS[116]+CONSTANTS[117])*(1.00000 - CONSTANTS[45]);
CONSTANTS[120] =  CONSTANTS[47]*(CONSTANTS[116]+CONSTANTS[117])*(1.00000 - CONSTANTS[48]);
CONSTANTS[121] =  CONSTANTS[51]*(CONSTANTS[116]+CONSTANTS[117])*(1.00000 - CONSTANTS[52]);
CONSTANTS[122] =  CONSTANTS[53]*(CONSTANTS[116]+CONSTANTS[117])*(1.00000 - CONSTANTS[54]);
CONSTANTS[123] =  CONSTANTS[55]*(CONSTANTS[116]+CONSTANTS[117])*(1.00000 - CONSTANTS[56]);
CONSTANTS[124] =  CONSTANTS[57]*(CONSTANTS[116]+CONSTANTS[117])*(1.00000 - CONSTANTS[58]);
CONSTANTS[125] =  CONSTANTS[60]*(CONSTANTS[116]+CONSTANTS[117])*(1.00000 - CONSTANTS[63]);
CONSTANTS[126] =  CONSTANTS[61]*(CONSTANTS[116]+CONSTANTS[117])*(1.00000 - CONSTANTS[64]);
CONSTANTS[127] =  CONSTANTS[62]*(CONSTANTS[116]+CONSTANTS[117])*(1.00000 - CONSTANTS[65]);
CONSTANTS[128] =  CONSTANTS[67]*(CONSTANTS[116]+CONSTANTS[117])*(1.00000 - CONSTANTS[68]);
CONSTANTS[129] =  CONSTANTS[71]*(CONSTANTS[116]+CONSTANTS[117])*(1.00000 - CONSTANTS[72]);
CONSTANTS[130] =  CONSTANTS[73]*(CONSTANTS[116]+CONSTANTS[117])*(1.00000 - CONSTANTS[74]);
CONSTANTS[131] =  CONSTANTS[75]*(CONSTANTS[116]+CONSTANTS[117])*CONSTANTS[76];
CONSTANTS[132] =  CONSTANTS[78]*(CONSTANTS[116]+CONSTANTS[117])*CONSTANTS[79];
CONSTANTS[133] =  CONSTANTS[82]*(CONSTANTS[116]+CONSTANTS[117])*CONSTANTS[83];
CONSTANTS[134] =  CONSTANTS[84]*(CONSTANTS[116]+CONSTANTS[117])*CONSTANTS[85];
CONSTANTS[135] =  CONSTANTS[86]*(CONSTANTS[116]+CONSTANTS[117])*CONSTANTS[87];
CONSTANTS[136] =  CONSTANTS[88]*(CONSTANTS[116]+CONSTANTS[117])*CONSTANTS[89];
CONSTANTS[137] =  CONSTANTS[91]*(CONSTANTS[116]+CONSTANTS[117])*CONSTANTS[94];
CONSTANTS[138] =  CONSTANTS[92]*(CONSTANTS[116]+CONSTANTS[117])*CONSTANTS[95];
CONSTANTS[139] =  CONSTANTS[93]*(CONSTANTS[116]+CONSTANTS[117])*CONSTANTS[96];
CONSTANTS[140] =  CONSTANTS[98]*(CONSTANTS[116]+CONSTANTS[117])*CONSTANTS[99];
CONSTANTS[141] =  CONSTANTS[102]*(CONSTANTS[116]+CONSTANTS[117])*CONSTANTS[103];
CONSTANTS[142] =  CONSTANTS[104]*(CONSTANTS[116]+CONSTANTS[117])*CONSTANTS[105];
CONSTANTS[143] = CONSTANTS[117]/( 2.00000*3.14159*CONSTANTS[7]*CONSTANTS[118]);
CONSTANTS[144] = ( CONSTANTS[6]*(CONSTANTS[143]/2.00000))/( 3.14159*pow(CONSTANTS[7], 2.00000)*CONSTANTS[118]);
CONSTANTS[145] =  3.14159*pow(CONSTANTS[7], 2.00000)*CONSTANTS[143]*CONSTANTS[118];
CONSTANTS[146] =  CONSTANTS[117]*1.00000;
CONSTANTS[147] =  CONSTANTS[116]*1.00000;
RATES[4] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[5] = 0.1001;
RATES[10] = 0.1001;
RATES[11] = 0.1001;
RATES[12] = 0.1001;
RATES[14] = 0.1001;
RATES[13] = 0.1001;
RATES[16] = 0.1001;
RATES[8] = 0.1001;
RATES[15] = 0.1001;
RATES[6] = 0.1001;
RATES[7] = 0.1001;
RATES[9] = 0.1001;
RATES[0] = 0.1001;
RATES[17] = 0.1001;
RATES[18] = 0.1001;
RATES[19] = 0.1001;
RATES[21] = 0.1001;
RATES[22] = 0.1001;
RATES[20] = 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[1] = 0.1001;
RATES[29] = 0.1001;
RATES[30] = 0.1001;
RATES[31] = 0.1001;
RATES[33] = 0.1001;
RATES[34] = 0.1001;
RATES[32] = 0.1001;
RATES[35] = 0.1001;
RATES[36] = 0.1001;
RATES[37] = 0.1001;
RATES[38] = 0.1001;
RATES[39] = 0.1001;
RATES[40] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[4] -  - CONSTANTS[11]*pow(STATES[6], 4.00000)*STATES[4]+ CONSTANTS[12]*STATES[2];
resid[1] = RATES[2] - ( CONSTANTS[11]*pow(STATES[6], 4.00000)*STATES[4] - ( CONSTANTS[12]*STATES[2]+ CONSTANTS[13]*pow(STATES[6], 3.00000)*STATES[2]+ CONSTANTS[15]*STATES[2]))+ CONSTANTS[14]*STATES[3]+ CONSTANTS[16]*STATES[5];
resid[2] = RATES[3] -  CONSTANTS[13]*pow(STATES[6], 3.00000)*STATES[2] -  CONSTANTS[14]*STATES[3];
resid[3] = RATES[5] -  CONSTANTS[15]*STATES[2] -  CONSTANTS[16]*STATES[5];
resid[4] = RATES[10] - ALGEBRAIC[7];
resid[5] = RATES[11] - ALGEBRAIC[8];
resid[6] = RATES[12] - - (ALGEBRAIC[15]+ALGEBRAIC[54]+ALGEBRAIC[46]+ALGEBRAIC[85]+ ALGEBRAIC[52]*3.00000+ ALGEBRAIC[92]*3.00000+ ALGEBRAIC[50]*3.00000+ ALGEBRAIC[90]*3.00000)/( CONSTANTS[113]*CONSTANTS[2]);
resid[7] = RATES[14] - ((ALGEBRAIC[54]+ALGEBRAIC[85]+ ALGEBRAIC[92]*3.00000+ ALGEBRAIC[90]*3.00000)/(CONSTANTS[2] - ALGEBRAIC[11]))/CONSTANTS[145];
resid[8] = RATES[13] - - (- ALGEBRAIC[10]+ALGEBRAIC[42]+ALGEBRAIC[81]+ALGEBRAIC[36]+ALGEBRAIC[75]+ALGEBRAIC[40]+ALGEBRAIC[79]+ALGEBRAIC[48]+ALGEBRAIC[87]+ ALGEBRAIC[50]*- 2.00000+ ALGEBRAIC[90]*- 2.00000+ALGEBRAIC[29]+ALGEBRAIC[68])/( CONSTANTS[113]*CONSTANTS[2]);
resid[9] = RATES[16] - ((ALGEBRAIC[81]+ALGEBRAIC[75]+ALGEBRAIC[79]+ALGEBRAIC[87]+ ALGEBRAIC[90]*- 2.00000+ALGEBRAIC[68])/(CONSTANTS[2] - ALGEBRAIC[13]))/CONSTANTS[145];
resid[10] = RATES[8] -  (1.00000/(1.00000+ CONSTANTS[35]*(CONSTANTS[32]/pow(CONSTANTS[32]+STATES[8], 2.00000))))*((( -2.00000*(ALGEBRAIC[52]+ALGEBRAIC[92])+(ALGEBRAIC[47]+ALGEBRAIC[86]+ALGEBRAIC[51]+ALGEBRAIC[91]))/( -2.00000*CONSTANTS[113]*CONSTANTS[2])+((( (STATES[6] - STATES[8])*CONSTANTS[113])/CONSTANTS[38]+ALGEBRAIC[1]) - ALGEBRAIC[4])/CONSTANTS[113]) - ( ALGEBRAIC[7]*CONSTANTS[24]+ ALGEBRAIC[8]*CONSTANTS[25]));
resid[11] = RATES[15] - ((ALGEBRAIC[66]+ALGEBRAIC[91]+ALGEBRAIC[86]+ ALGEBRAIC[92]*- 2.00000)/( 2.00000*CONSTANTS[2] - ALGEBRAIC[12]))/CONSTANTS[145];
resid[12] = RATES[6] -  (1.00000/(1.00000+ CONSTANTS[35]*(CONSTANTS[32]/pow(CONSTANTS[32]+STATES[6], 2.00000))))*(- (ALGEBRAIC[27]+ALGEBRAIC[66])/(( 2.00000*CONSTANTS[112]*CONSTANTS[2]+ALGEBRAIC[1]/CONSTANTS[112]) - (( (STATES[6] - STATES[8])*CONSTANTS[113])/CONSTANTS[38])/CONSTANTS[112]));
resid[13] = RATES[7] -  (1.00000/(1.00000+( CONSTANTS[36]*CONSTANTS[33])/pow(CONSTANTS[33]+STATES[7], 2.00000)))*(ALGEBRAIC[5] - ALGEBRAIC[1]);
resid[14] = RATES[9] - ALGEBRAIC[4] - ALGEBRAIC[5];
resid[15] = RATES[0] -  1000.00*(((ALGEBRAIC[10]+ALGEBRAIC[0]) - (ALGEBRAIC[15]+ALGEBRAIC[27]+ALGEBRAIC[29]+ALGEBRAIC[36]+ALGEBRAIC[43]+ALGEBRAIC[40]+ALGEBRAIC[49]+ALGEBRAIC[50]+ALGEBRAIC[52]+ALGEBRAIC[51]))/CONSTANTS[147]);
resid[16] = RATES[17] -  ALGEBRAIC[16]*(1.00000 - STATES[17]) -  ALGEBRAIC[17]*STATES[17];
resid[17] = RATES[18] -  ALGEBRAIC[18]*(1.00000 - STATES[18]) -  ALGEBRAIC[19]*STATES[18];
resid[18] = RATES[19] - (ALGEBRAIC[20] - STATES[19])/ALGEBRAIC[21];
resid[19] = RATES[21] - (ALGEBRAIC[22] - STATES[21])/ALGEBRAIC[23];
resid[20] = RATES[22] - (ALGEBRAIC[24] - STATES[22])/ALGEBRAIC[25];
resid[21] = RATES[20] - (ALGEBRAIC[26] - STATES[20])/CONSTANTS[46];
resid[22] = RATES[23] - (ALGEBRAIC[30] - STATES[23])/ALGEBRAIC[31];
resid[23] = RATES[24] - (ALGEBRAIC[32] - STATES[24])/ALGEBRAIC[33];
resid[24] = RATES[25] - (ALGEBRAIC[34] - STATES[25])/ALGEBRAIC[35];
resid[25] = RATES[26] - (ALGEBRAIC[37] - STATES[26])/ALGEBRAIC[38];
resid[26] = RATES[27] - (ALGEBRAIC[39] - STATES[27])/CONSTANTS[107];
resid[27] = RATES[28] - (ALGEBRAIC[44] - STATES[28])/ALGEBRAIC[45];
resid[28] = RATES[1] -  1000.00*(- (ALGEBRAIC[0]+ALGEBRAIC[54]+ALGEBRAIC[66]+ALGEBRAIC[68]+ALGEBRAIC[75]+ALGEBRAIC[82]+ALGEBRAIC[79]+ALGEBRAIC[88]+ALGEBRAIC[90]+ALGEBRAIC[92]+ALGEBRAIC[91])/CONSTANTS[146]);
resid[29] = RATES[29] -  ALGEBRAIC[55]*(1.00000 - STATES[29]) -  ALGEBRAIC[56]*STATES[29];
resid[30] = RATES[30] -  ALGEBRAIC[57]*(1.00000 - STATES[30]) -  ALGEBRAIC[58]*STATES[30];
resid[31] = RATES[31] - (ALGEBRAIC[59] - STATES[31])/ALGEBRAIC[60];
resid[32] = RATES[33] - (ALGEBRAIC[61] - STATES[33])/ALGEBRAIC[62];
resid[33] = RATES[34] - (ALGEBRAIC[63] - STATES[34])/ALGEBRAIC[64];
resid[34] = RATES[32] - (ALGEBRAIC[65] - STATES[32])/CONSTANTS[77];
resid[35] = RATES[35] - (ALGEBRAIC[69] - STATES[35])/ALGEBRAIC[70];
resid[36] = RATES[36] - (ALGEBRAIC[71] - STATES[36])/ALGEBRAIC[72];
resid[37] = RATES[37] - (ALGEBRAIC[73] - STATES[37])/ALGEBRAIC[74];
resid[38] = RATES[38] - (ALGEBRAIC[76] - STATES[38])/ALGEBRAIC[77];
resid[39] = RATES[39] - (ALGEBRAIC[78] - STATES[39])/CONSTANTS[110];
resid[40] = RATES[40] - (ALGEBRAIC[83] - STATES[40])/ALGEBRAIC[84];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[6] = (STATES[6] - STATES[8])/CONSTANTS[27];
ALGEBRAIC[9] = ALGEBRAIC[7]+ALGEBRAIC[8];
ALGEBRAIC[41] =  CONSTANTS[124]*STATES[28]*CONSTANTS[59]*(STATES[0] - ALGEBRAIC[14]);
ALGEBRAIC[80] =  CONSTANTS[136]*STATES[40]*CONSTANTS[90]*(STATES[1] - ALGEBRAIC[53]);
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] =  1000.00*((STATES[0] - STATES[1])/CONSTANTS[10]);
ALGEBRAIC[1] =  1800.00*(STATES[2]+STATES[3])*(STATES[7] - STATES[6]);
ALGEBRAIC[2] = pow(STATES[8]/CONSTANTS[17], CONSTANTS[22]);
ALGEBRAIC[3] = pow(STATES[9]/CONSTANTS[18], CONSTANTS[23]);
ALGEBRAIC[4] = ( CONSTANTS[21]*( CONSTANTS[19]*ALGEBRAIC[2] -  CONSTANTS[20]*ALGEBRAIC[3]))/(1.00000+ALGEBRAIC[2]+ALGEBRAIC[3]);
ALGEBRAIC[5] = (STATES[9] - STATES[7])/CONSTANTS[26];
ALGEBRAIC[7] =  CONSTANTS[28]*STATES[8]*(1.00000 - STATES[10]) -  CONSTANTS[29]*STATES[10];
ALGEBRAIC[8] =  CONSTANTS[30]*STATES[8]*(1.00000 - STATES[11]) -  CONSTANTS[31]*STATES[11];
ALGEBRAIC[10] = (CONSTANTS[39]==1.00000&&CONDVAR[0]<0.00000 ?  52.0000*(CONSTANTS[116]+CONSTANTS[117]) : 0.00000);
ALGEBRAIC[11] = ( 1.00000*CONSTANTS[145])/( CONSTANTS[41]*(STATES[14] - CONSTANTS[3]));
ALGEBRAIC[12] = ( 1.00000*CONSTANTS[145])/( CONSTANTS[42]*(STATES[15] - CONSTANTS[4]));
ALGEBRAIC[13] = ( 1.00000*CONSTANTS[145])/( CONSTANTS[43]*(STATES[16] - CONSTANTS[5]));
ALGEBRAIC[15] =  CONSTANTS[119]*pow(STATES[17], 3.00000)*STATES[18]*(STATES[0] -  arbitrary_log((CONSTANTS[3]+ 0.120000*CONSTANTS[5])/(STATES[12]+ 0.120000*STATES[13]), 10)*(( CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2]));
ALGEBRAIC[16] = ( 117.260*(STATES[0]+59.3000))/(1.00000 - exp( - 0.550000*(STATES[0]+59.3000)));
ALGEBRAIC[17] =  3800.00*exp( - 0.0720000*(STATES[0]+61.0000));
ALGEBRAIC[18] = 284.400/(1.00000+exp( 0.0812000*(STATES[0]+115.900)));
ALGEBRAIC[19] = ( 18.7700*(STATES[0]+64.4000))/(1.00000 - exp( - 0.220000*(STATES[0]+64.4000)));
ALGEBRAIC[20] = 1.00000/(1.00000+exp((STATES[0]+15.3000)/- 5.00000));
ALGEBRAIC[21] =  0.00305000*exp( - 0.00450000*pow(STATES[0]+7.00000, 2.00000))+ 0.00105000*exp( - 0.00200000*pow(STATES[0] - 18.0000, 2.00000))+0.000250000;
ALGEBRAIC[22] = 1.00000/(1.00000+exp((STATES[0]+26.7000)/5.40000));
ALGEBRAIC[23] =  0.105000*exp(- pow((STATES[0]+45.0000)/12.0000, 2.00000))+0.0400000/(1.00000+exp((- STATES[0]+25.0000)/25.0000))+0.0150000/(1.00000+exp((STATES[0]+75.0000)/25.0000))+0.00170000;
ALGEBRAIC[24] = 1.00000/(1.00000+exp((STATES[0]+26.7000)/5.40000));
ALGEBRAIC[25] =  0.0410000*exp(- pow((STATES[0]+47.0000)/12.0000, 2.00000))+0.0800000/(1.00000+exp((STATES[0]+55.0000)/- 5.00000))+0.0150000/(1.00000+exp((STATES[0]+75.0000)/25.0000))+0.00170000;
ALGEBRAIC[26] = 1.00000/(1.00000+STATES[6]/0.0100000);
ALGEBRAIC[27] =  CONSTANTS[120]*4.00000*(( STATES[0]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1]))*(( STATES[6]*exp(( 2.00000*STATES[0]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1])) -  0.341000*CONSTANTS[4])/(exp(( 2.00000*STATES[0]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1])) - 1.00000))*STATES[19]*( (0.900000+STATES[20]/10.0000)*STATES[21]+ (0.100000+STATES[20]/10.0000)*STATES[22]);
ALGEBRAIC[28] =  (( CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2])*log(CONSTANTS[5]/STATES[13]);
ALGEBRAIC[29] =  CONSTANTS[121]*STATES[23]*( CONSTANTS[49]*STATES[24]+ CONSTANTS[50]*STATES[25])*(STATES[0] - ALGEBRAIC[28]);
ALGEBRAIC[30] = 1.00000/(1.00000+exp((STATES[0]+10.6000)/- 11.4200));
ALGEBRAIC[31] = 1.00000/( 45.1600*exp( 0.0357700*(STATES[0]+50.0000))+ 98.9000*exp( - 0.100000*(STATES[0]+38.0000)));
ALGEBRAIC[32] = 1.00000/(1.00000+exp((STATES[0]+45.3000)/6.88410));
ALGEBRAIC[33] =  0.350000*exp(- pow( 0.0666000*(STATES[0]+70.0000), 2.00000))+0.0350000;
ALGEBRAIC[34] = 1.00000/(1.00000+exp((STATES[0]+45.3000)/6.88410));
ALGEBRAIC[35] =  3.70000*exp(- pow( 0.0333000*(STATES[0]+70.0000), 2.00000))+0.0350000;
ALGEBRAIC[36] =  CONSTANTS[122]*STATES[26]*STATES[27]*(STATES[0] - ALGEBRAIC[28]);
ALGEBRAIC[37] = 1.00000/(1.00000+exp(- (STATES[0]+11.5000)/11.8200));
ALGEBRAIC[38] = 10.0000/( 45.1600*exp( 0.0357700*(STATES[0]+50.0000))+ 98.9000*exp( - 0.100000*(STATES[0]+38.0000)));
ALGEBRAIC[39] = 1.00000/(1.00000+exp((STATES[0]+87.5000)/10.3000));
ALGEBRAIC[40] =  (( CONSTANTS[123]*(STATES[0] - (ALGEBRAIC[28]+1.73000)))/(1.00000+exp( (( 1.61300*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))*(STATES[0] - (ALGEBRAIC[28]+1.73000)))))*(1.00000+exp(- (CONSTANTS[5] - 0.998800)/0.124000));
ALGEBRAIC[42] =  CONSTANTS[124]*STATES[28]*CONSTANTS[108]*(STATES[0] - ALGEBRAIC[28]);
ALGEBRAIC[14] =  (( CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2])*log(CONSTANTS[3]/STATES[12]);
ALGEBRAIC[43] =  CONSTANTS[124]*STATES[28]*( 0.200000*(STATES[0] - ALGEBRAIC[14])+ 0.800000*(STATES[0] - ALGEBRAIC[28]));
ALGEBRAIC[44] = 1.00000/(1.00000+exp((STATES[0]+138.600)/10.4800));
ALGEBRAIC[45] = 1.00000/( 0.118850*exp((STATES[0]+80.0000)/28.3700)+ 0.562300*exp((STATES[0]+80.0000)/- 14.1900));
ALGEBRAIC[46] =  CONSTANTS[126]*(STATES[0] - ALGEBRAIC[14]);
ALGEBRAIC[47] =  CONSTANTS[125]*(STATES[0] - CONSTANTS[66]);
ALGEBRAIC[48] =  CONSTANTS[127]*(STATES[0] - ALGEBRAIC[28]);
ALGEBRAIC[49] = ALGEBRAIC[46]+ALGEBRAIC[47]+ALGEBRAIC[48];
ALGEBRAIC[50] = (( (CONSTANTS[128]/(1.00000+ 0.124500*exp(( - 0.100000*STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))+ 0.0365000*CONSTANTS[109]*exp(( - STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))))*CONSTANTS[5])/(CONSTANTS[5]+CONSTANTS[69]))/(1.00000+pow(CONSTANTS[70]/STATES[12], 1.50000));
ALGEBRAIC[51] = ( CONSTANTS[129]*STATES[8])/(STATES[8]+0.000400000);
ALGEBRAIC[52] = ( CONSTANTS[130]*( exp( 0.0187000*STATES[0])*pow(STATES[12], 3.00000)*CONSTANTS[4] -  exp( -0.0187000*STATES[0])*pow(CONSTANTS[3], 3.00000)*STATES[8]))/(1.00000+ 0.000100000*( STATES[8]*pow(CONSTANTS[3], 3.00000)+ CONSTANTS[4]*pow(STATES[12], 3.00000)));
ALGEBRAIC[54] =  CONSTANTS[131]*pow(STATES[29], 3.00000)*STATES[30]*(STATES[1] -  arbitrary_log((STATES[14]+ 0.120000*STATES[16])/(STATES[12]+ 0.120000*STATES[13]), 10)*(( CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2]));
ALGEBRAIC[55] = ( 117.260*(STATES[1]+59.3000))/(1.00000 - exp( - 0.550000*(STATES[1]+59.3000)));
ALGEBRAIC[56] =  3800.00*exp( - 0.0720000*(STATES[1]+61.0000));
ALGEBRAIC[57] = 284.400/(1.00000+exp( 0.0812000*(STATES[1]+115.900)));
ALGEBRAIC[58] = ( 18.7700*(STATES[1]+64.4000))/(1.00000 - exp( - 0.220000*(STATES[1]+64.4000)));
ALGEBRAIC[59] = 1.00000/(1.00000+exp((STATES[1]+15.3000)/- 5.00000));
ALGEBRAIC[60] =  0.00305000*exp( - 0.00450000*pow(STATES[1]+7.00000, 2.00000))+ 0.00105000*exp( - 0.00200000*pow(STATES[1] - 18.0000, 2.00000))+0.000250000;
ALGEBRAIC[61] = 1.00000/(1.00000+exp((STATES[1]+26.7000)/5.40000));
ALGEBRAIC[62] =  0.105000*exp(- pow((STATES[1]+45.0000)/12.0000, 2.00000))+0.0400000/(1.00000+exp((- STATES[1]+25.0000)/25.0000))+0.0150000/(1.00000+exp((STATES[1]+75.0000)/25.0000))+0.00170000;
ALGEBRAIC[63] = 1.00000/(1.00000+exp((STATES[1]+26.7000)/5.40000));
ALGEBRAIC[64] =  0.0410000*exp(- pow((STATES[1]+47.0000)/12.0000, 2.00000))+0.0800000/(1.00000+exp((STATES[1]+55.0000)/- 5.00000))+0.0150000/(1.00000+exp((STATES[1]+75.0000)/25.0000))+0.00170000;
ALGEBRAIC[65] = 1.00000/(1.00000+STATES[6]/0.0100000);
ALGEBRAIC[66] =  CONSTANTS[132]*4.00000*(( STATES[1]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1]))*(( STATES[6]*exp(( 2.00000*STATES[1]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1])) -  0.341000*STATES[15])/(exp(( 2.00000*STATES[1]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1])) - 1.00000))*STATES[31]*( (0.900000+STATES[32]/10.0000)*STATES[33]+ (0.100000+STATES[32]/10.0000)*STATES[34]);
ALGEBRAIC[67] =  (( CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2])*log(STATES[16]/STATES[13]);
ALGEBRAIC[68] =  CONSTANTS[133]*STATES[35]*( CONSTANTS[80]*STATES[36]+ CONSTANTS[81]*STATES[37])*(STATES[1] - ALGEBRAIC[67]);
ALGEBRAIC[69] = 1.00000/(1.00000+exp((STATES[1]+10.6000)/- 11.4200));
ALGEBRAIC[70] = 1.00000/( 45.1600*exp( 0.0357700*(STATES[1]+50.0000))+ 98.9000*exp( - 0.100000*(STATES[1]+38.0000)));
ALGEBRAIC[71] = 1.00000/(1.00000+exp((STATES[1]+45.3000)/6.88410));
ALGEBRAIC[72] =  0.350000*exp(- pow( 0.0666000*(STATES[1]+70.0000), 2.00000))+0.0350000;
ALGEBRAIC[73] = 1.00000/(1.00000+exp((STATES[1]+45.3000)/6.88410));
ALGEBRAIC[74] =  3.70000*exp(- pow( 0.0333000*(STATES[1]+70.0000), 2.00000))+0.0350000;
ALGEBRAIC[75] =  CONSTANTS[134]*STATES[38]*STATES[39]*(STATES[1] - ALGEBRAIC[67]);
ALGEBRAIC[76] = 1.00000/(1.00000+exp(- (STATES[1]+11.5000)/11.8200));
ALGEBRAIC[77] = 10.0000/( 45.1600*exp( 0.0357700*(STATES[1]+50.0000))+ 98.9000*exp( - 0.100000*(STATES[1]+38.0000)));
ALGEBRAIC[78] = 1.00000/(1.00000+exp((STATES[1]+87.5000)/10.3000));
ALGEBRAIC[79] =  (( CONSTANTS[135]*(STATES[1] - (ALGEBRAIC[67]+1.73000)))/(1.00000+exp( (( 1.61300*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))*(STATES[1] - (ALGEBRAIC[67]+1.73000)))))*(1.00000+exp(- (STATES[16] - 0.998800)/0.124000));
ALGEBRAIC[81] =  CONSTANTS[136]*STATES[40]*CONSTANTS[111]*(STATES[1] - ALGEBRAIC[67]);
ALGEBRAIC[53] =  (( CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2])*log(STATES[14]/STATES[12]);
ALGEBRAIC[82] =  CONSTANTS[136]*STATES[40]*( 0.200000*(STATES[1] - ALGEBRAIC[53])+ 0.800000*(STATES[1] - ALGEBRAIC[67]));
ALGEBRAIC[83] = 1.00000/(1.00000+exp((STATES[1]+138.600)/10.4800));
ALGEBRAIC[84] = 1.00000/( 0.118850*exp((STATES[1]+80.0000)/28.3700)+ 0.562300*exp((STATES[1]+80.0000)/- 14.1900));
ALGEBRAIC[85] =  CONSTANTS[138]*(STATES[1] - ALGEBRAIC[53]);
ALGEBRAIC[86] =  CONSTANTS[137]*(STATES[1] - CONSTANTS[97]);
ALGEBRAIC[87] =  CONSTANTS[139]*(STATES[1] - ALGEBRAIC[67]);
ALGEBRAIC[88] = ALGEBRAIC[85]+ALGEBRAIC[86]+ALGEBRAIC[87];
ALGEBRAIC[89] = (exp(STATES[14]/67.3000) - 1.00000)/7.00000;
ALGEBRAIC[90] = (( (CONSTANTS[140]/(1.00000+ 0.124500*exp(( - 0.100000*STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))+ 0.0365000*ALGEBRAIC[89]*exp(( - STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))))*STATES[16])/(STATES[16]+CONSTANTS[100]))/(1.00000+pow(CONSTANTS[101]/STATES[12], 1.50000));
ALGEBRAIC[91] = ( CONSTANTS[141]*STATES[8])/(STATES[8]+0.000400000);
ALGEBRAIC[92] = ( CONSTANTS[142]*( exp( 0.0187000*STATES[1])*pow(STATES[12], 3.00000)*STATES[15] -  exp( -0.0187000*STATES[1])*pow(STATES[14], 3.00000)*STATES[8]))/(1.00000+ 0.000100000*( STATES[8]*pow(STATES[14], 3.00000)+ STATES[15]*pow(STATES[12], 3.00000)));
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
SI[1] = 1.0;
SI[2] = 1.0;
SI[3] = 1.0;
SI[4] = 1.0;
SI[5] = 1.0;
SI[6] = 1.0;
SI[7] = 1.0;
SI[8] = 1.0;
SI[9] = 1.0;
SI[10] = 1.0;
SI[11] = 1.0;
SI[12] = 1.0;
SI[13] = 1.0;
SI[14] = 1.0;
SI[15] = 1.0;
SI[16] = 1.0;
SI[17] = 1.0;
SI[18] = 1.0;
SI[19] = 1.0;
SI[20] = 1.0;
SI[21] = 1.0;
SI[22] = 1.0;
SI[23] = 1.0;
SI[24] = 1.0;
SI[25] = 1.0;
SI[26] = 1.0;
SI[27] = 1.0;
SI[28] = 1.0;
SI[29] = 1.0;
SI[30] = 1.0;
SI[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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
CONDVAR[0] = (VOI - CONSTANTS[40]) - 0.00100000;
}