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 82 entries in the algebraic variable array.
   There are a total of 68 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 L_totmax in component b1_AR_Gs_parameters (uM).
 * CONSTANTS[1] is sum_b1_AR in component b1_AR_Gs_parameters (uM).
 * CONSTANTS[2] is Gs_tot in component b1_AR_Gs_parameters (uM).
 * CONSTANTS[3] is Kl in component b1_AR_Gs_parameters (uM).
 * CONSTANTS[4] is Kr in component b1_AR_Gs_parameters (uM).
 * CONSTANTS[5] is Kc in component b1_AR_Gs_parameters (uM).
 * CONSTANTS[6] is k_bar_kp in component b1_AR_Gs_parameters (per_sec).
 * CONSTANTS[7] is k_bar_km in component b1_AR_Gs_parameters (per_sec).
 * CONSTANTS[8] is k_p_kap in component b1_AR_Gs_parameters (per_uM_per_sec).
 * CONSTANTS[9] is k_p_kam in component b1_AR_Gs_parameters (per_sec).
 * CONSTANTS[10] is k_g_act in component b1_AR_Gs_parameters (per_sec).
 * CONSTANTS[11] is k_hyd in component b1_AR_Gs_parameters (per_sec).
 * CONSTANTS[12] is k_reassoc in component b1_AR_Gs_parameters (per_uM_per_sec).
 * CONSTANTS[13] is AC_tot in component cAMP_parameters (uM).
 * CONSTANTS[14] is ATP in component cAMP_parameters (uM).
 * CONSTANTS[15] is PDE_tot in component cAMP_parameters (uM).
 * CONSTANTS[16] is IBMX_tot in component cAMP_parameters (uM).
 * CONSTANTS[17] is Fsk_tot in component cAMP_parameters (uM).
 * CONSTANTS[18] is k_ac_basal in component cAMP_parameters (per_sec).
 * CONSTANTS[19] is k_ac_gsa in component cAMP_parameters (per_sec).
 * CONSTANTS[20] is k_ac_fsk in component cAMP_parameters (per_sec).
 * CONSTANTS[21] is k_pde in component cAMP_parameters (per_sec).
 * CONSTANTS[22] is Km_basal in component cAMP_parameters (uM).
 * CONSTANTS[23] is Km_gsa in component cAMP_parameters (uM).
 * CONSTANTS[24] is Km_fsk in component cAMP_parameters (uM).
 * CONSTANTS[25] is Km_pde in component cAMP_parameters (uM).
 * CONSTANTS[26] is K_gsa in component cAMP_parameters (uM).
 * CONSTANTS[27] is K_fsk in component cAMP_parameters (uM).
 * CONSTANTS[28] is Ki_ibmx in component cAMP_parameters (uM).
 * CONSTANTS[29] is PKAI_tot in component PKA_parameters (uM).
 * CONSTANTS[30] is PKAII_tot in component PKA_parameters (uM).
 * CONSTANTS[31] is PKI_tot in component PKA_parameters (uM).
 * CONSTANTS[32] is K_a in component PKA_parameters (uM).
 * CONSTANTS[33] is K_b in component PKA_parameters (uM).
 * CONSTANTS[34] is K_d in component PKA_parameters (uM).
 * CONSTANTS[35] is Ki_pki in component PKA_parameters (uM).
 * CONSTANTS[36] is PLB_tot in component PLB_parameters (uM).
 * CONSTANTS[37] is PP1_tot in component PLB_parameters (uM).
 * CONSTANTS[38] is Inhib1_tot in component PLB_parameters (uM).
 * CONSTANTS[39] is k_pka_plb in component PLB_parameters (per_sec).
 * CONSTANTS[40] is Km_pka_plb in component PLB_parameters (uM).
 * CONSTANTS[41] is k_pp1_plb in component PLB_parameters (per_sec).
 * CONSTANTS[42] is Km_pp1_plb in component PLB_parameters (uM).
 * CONSTANTS[43] is k_pka_i1 in component PLB_parameters (per_sec).
 * CONSTANTS[44] is Km_pka_i1 in component PLB_parameters (uM).
 * CONSTANTS[45] is Vmax_pp2a_i1 in component PLB_parameters (uM_per_sec).
 * CONSTANTS[46] is Km_pp2a_i1 in component PLB_parameters (uM).
 * CONSTANTS[47] is Ki_inhib1 in component PLB_parameters (uM).
 * CONSTANTS[48] is epsilon in component LCC_parameters (dimensionless).
 * CONSTANTS[49] is LCC_tot in component LCC_parameters (uM).
 * CONSTANTS[50] is PP1_lcc_tot in component LCC_parameters (uM).
 * CONSTANTS[51] is PP2A_lcc_tot in component LCC_parameters (uM).
 * CONSTANTS[52] is k_pka_lcc in component LCC_parameters (per_sec).
 * CONSTANTS[53] is Km_pka_lcc in component LCC_parameters (uM).
 * CONSTANTS[54] is k_pp1_lcc in component LCC_parameters (per_sec).
 * CONSTANTS[55] is Km_pp1_lcc in component LCC_parameters (uM).
 * CONSTANTS[56] is k_pp2a_lcc in component LCC_parameters (per_sec).
 * CONSTANTS[57] is Km_pp2a_lcc in component LCC_parameters (uM).
 * CONSTANTS[58] is V_myo in component EC_Coupling_Parameters (uL).
 * CONSTANTS[59] is V_nsr in component EC_Coupling_Parameters (uL).
 * CONSTANTS[60] is V_jsr in component EC_Coupling_Parameters (uL).
 * CONSTANTS[61] is A_Cap in component EC_Coupling_Parameters (cm2).
 * CONSTANTS[62] is Temp in component EC_Coupling_Parameters (kelvin).
 * CONSTANTS[63] is Na_ext in component EC_Coupling_Parameters (mM).
 * CONSTANTS[64] is K_ext in component EC_Coupling_Parameters (mM).
 * CONSTANTS[65] is Ca_ext in component EC_Coupling_Parameters (mM).
 * CONSTANTS[66] is G_Na in component EC_Coupling_Parameters (mS_per_uF).
 * CONSTANTS[67] is G_to in component EC_Coupling_Parameters (mS_per_uF).
 * CONSTANTS[68] is G_ss in component EC_Coupling_Parameters (mS_per_uF).
 * CONSTANTS[69] is G_Ki_bar in component EC_Coupling_Parameters (mS_per_uF).
 * CONSTANTS[70] is G_Kp in component EC_Coupling_Parameters (mS_per_uF).
 * CONSTANTS[71] is f in component EC_Coupling_Parameters (per_sec).
 * CONSTANTS[72] is g in component EC_Coupling_Parameters (per_sec).
 * CONSTANTS[73] is gamma_o in component EC_Coupling_Parameters (per_mM_per_sec).
 * CONSTANTS[74] is omega in component EC_Coupling_Parameters (per_sec).
 * CONSTANTS[75] is p_Ca in component EC_Coupling_Parameters (cm_per_sec).
 * CONSTANTS[76] is p_K in component EC_Coupling_Parameters (cm_per_sec).
 * CONSTANTS[77] is N_lcc in component EC_Coupling_Parameters (dimensionless).
 * CONSTANTS[78] is I_Ca05 in component EC_Coupling_Parameters (uA_per_uF).
 * CONSTANTS[79] is k_NaCa in component EC_Coupling_Parameters (uA_per_uF).
 * CONSTANTS[80] is Km_Na in component EC_Coupling_Parameters (mM).
 * CONSTANTS[81] is Km_Ca in component EC_Coupling_Parameters (mM).
 * CONSTANTS[82] is k_sat in component EC_Coupling_Parameters (dimensionless).
 * CONSTANTS[83] is eta in component EC_Coupling_Parameters (dimensionless).
 * CONSTANTS[84] is I_bar_NaK in component EC_Coupling_Parameters (uA_per_uF).
 * CONSTANTS[85] is Km_Nai in component EC_Coupling_Parameters (mM).
 * CONSTANTS[86] is Km_Ko in component EC_Coupling_Parameters (mM).
 * CONSTANTS[87] is I_bar_PCa in component EC_Coupling_Parameters (uA_per_uF).
 * CONSTANTS[88] is Km_PCa in component EC_Coupling_Parameters (mM).
 * CONSTANTS[89] is G_CaB in component EC_Coupling_Parameters (uA_per_uF).
 * CONSTANTS[90] is G_NaB in component EC_Coupling_Parameters (uA_per_uF).
 * CONSTANTS[91] is Pns in component EC_Coupling_Parameters (dimensionless).
 * CONSTANTS[92] is Km_NS in component EC_Coupling_Parameters (mM).
 * CONSTANTS[93] is I_up_bar in component EC_Coupling_Parameters (mM_per_sec).
 * CONSTANTS[94] is Km_up0 in component EC_Coupling_Parameters (mM).
 * CONSTANTS[95] is NSR_bar in component EC_Coupling_Parameters (mM).
 * CONSTANTS[96] is tau_on in component EC_Coupling_Parameters (second).
 * CONSTANTS[97] is tau_off in component EC_Coupling_Parameters (second).
 * CONSTANTS[98] is G_max_rel in component EC_Coupling_Parameters (mM_per_sec).
 * CONSTANTS[99] is d_Cai_th in component EC_Coupling_Parameters (mM).
 * CONSTANTS[100] is Km_rel in component EC_Coupling_Parameters (mM).
 * CONSTANTS[101] is CSQN_th in component EC_Coupling_Parameters (mM).
 * CONSTANTS[102] is CSQN_bar in component EC_Coupling_Parameters (mM).
 * CONSTANTS[103] is Km_CSQN in component EC_Coupling_Parameters (mM).
 * CONSTANTS[104] is tau_tr in component EC_Coupling_Parameters (second).
 * CONSTANTS[105] is TRPN_bar in component EC_Coupling_Parameters (mM).
 * CONSTANTS[106] is CMDN_bar in component EC_Coupling_Parameters (mM).
 * CONSTANTS[107] is INDO_bar in component EC_Coupling_Parameters (mM).
 * CONSTANTS[108] is Km_TRPN in component EC_Coupling_Parameters (mM).
 * CONSTANTS[109] is Km_CMDN in component EC_Coupling_Parameters (mM).
 * CONSTANTS[110] is Km_INDO in component EC_Coupling_Parameters (mM).
 * STATES[31] is LR in component b1_AR_module (uM).
 * STATES[32] is LRG in component b1_AR_module (uM).
 * STATES[33] is RG in component b1_AR_module (uM).
 * STATES[34] is BARK_DESENS in component b1_AR_module (uM_per_sec).
 * ALGEBRAIC[0] is BARK_RESENS in component b1_AR_module (uM_per_sec).
 * STATES[35] is PKA_DESENS in component b1_AR_module (uM_per_sec).
 * ALGEBRAIC[1] is PKA_RESENS in component b1_AR_module (uM_per_sec).
 * STATES[36] is G_ACT in component b1_AR_module (uM_per_sec).
 * ALGEBRAIC[2] is HYD in component b1_AR_module (uM_per_sec).
 * ALGEBRAIC[3] is REASSOC in component b1_AR_module (per_sec).
 * STATES[37] is L in component b1_AR_module (uM).
 * STATES[38] is R in component b1_AR_module (uM).
 * STATES[39] is Gs in component b1_AR_module (uM).
 * STATES[0] is b1_AR_tot in component b1_AR_module (uM).
 * STATES[1] is b1_AR_d in component b1_AR_module (uM).
 * STATES[2] is b1_AR_p in component b1_AR_module (uM).
 * STATES[3] is Gs_agtp_tot in component b1_AR_module (uM).
 * STATES[4] is Gs_agdp in component b1_AR_module (uM).
 * STATES[5] is Gs_bg in component b1_AR_module (uM).
 * STATES[40] is PKAC_I in component PKA_module (uM).
 * STATES[41] is cAMP in component PKA_module (uM).
 * STATES[42] is Gsa_GTP in component cAMP_module (uM).
 * STATES[43] is Fsk in component cAMP_module (uM).
 * STATES[44] is AC in component cAMP_module (uM).
 * CONSTANTS[127] is PDE in component cAMP_module (uM).
 * CONSTANTS[128] is IBMX in component cAMP_module (uM).
 * STATES[6] is cAMP_tot in component cAMP_module (uM).
 * STATES[45] is Gsa_GTP_AC in component cAMP_module (uM).
 * STATES[46] is Fsk_AC in component cAMP_module (uM).
 * STATES[47] is AC_ACT_GSA in component cAMP_module (uM).
 * STATES[48] is AC_ACT_BASAL in component cAMP_module (uM).
 * STATES[49] is AC_ACT_FSK in component cAMP_module (uM).
 * STATES[50] is PDE_ACT in component cAMP_module (uM).
 * CONSTANTS[129] is PDE_IBMX in component cAMP_module (uM).
 * STATES[51] is PKI in component PKA_module (uM).
 * STATES[52] is A2RC_I in component PKA_module (uM).
 * STATES[53] is A2R_I in component PKA_module (uM).
 * STATES[54] is A2RC_II in component PKA_module (uM).
 * STATES[55] is A2R_II in component PKA_module (uM).
 * STATES[56] is ARC_I in component PKA_module (uM).
 * STATES[57] is ARC_II in component PKA_module (uM).
 * STATES[58] is PKA_temp in component PKA_module (uM).
 * STATES[59] is PKAC_II in component PKA_module (uM).
 * ALGEBRAIC[4] is PLB in component PLB_module (uM).
 * STATES[60] is PLB_PHOSPH in component PLB_module (uM_per_sec).
 * STATES[61] is PLB_DEPHOSPH in component PLB_module (uM_per_sec).
 * ALGEBRAIC[5] is Inhib1 in component PLB_module (uM).
 * STATES[62] is Inhib1p_PP1 in component PLB_module (uM).
 * STATES[63] is Inhib1_PHOSPH in component PLB_module (uM_per_sec).
 * ALGEBRAIC[6] is Inhib1_DEPHOSPH in component PLB_module (uM_per_sec).
 * STATES[7] is PLB_p in component PLB_module (uM).
 * STATES[8] is Inhib1p_tot in component PLB_module (uM).
 * STATES[64] is Inhib1p in component PLB_module (uM).
 * STATES[65] is PP1 in component PLB_module (uM).
 * ALGEBRAIC[7] is frac_PLB_p in component PLB_module (dimensionless).
 * ALGEBRAIC[8] is frac_PLB in component PLB_module (dimensionless).
 * CONSTANTS[119] is frac_PLB_o in component PLB_module (dimensionless).
 * ALGEBRAIC[9] is LCCa in component LCC_module (uM).
 * STATES[66] is LCCa_PHOSPH in component LCC_module (uM_per_sec).
 * ALGEBRAIC[10] is LCCa_DEPHOSPH in component LCC_module (uM_per_sec).
 * ALGEBRAIC[11] is LCCb in component LCC_module (uM).
 * STATES[67] is LCCb_PHOSPH in component LCC_module (uM_per_sec).
 * ALGEBRAIC[12] is LCCb_DEPHOSPH in component LCC_module (uM_per_sec).
 * STATES[9] is LCCa_p in component LCC_module (uM).
 * STATES[10] is LCCb_p in component LCC_module (uM).
 * ALGEBRAIC[13] is frac_LCCa_p in component LCC_module (dimensionless).
 * CONSTANTS[120] is frac_LCCa_po in component LCC_module (dimensionless).
 * ALGEBRAIC[14] is frac_LCCb_p in component LCC_module (dimensionless).
 * CONSTANTS[121] is frac_LCCb_po in component LCC_module (dimensionless).
 * ALGEBRAIC[15] is E_Na in component Nernst_Potentials (mV).
 * ALGEBRAIC[16] is E_K in component Nernst_Potentials (mV).
 * ALGEBRAIC[17] is E_Ca in component Nernst_Potentials (mV).
 * CONSTANTS[122] is E_Cl in component Nernst_Potentials (mV).
 * CONSTANTS[111] is R in component Nernst_Potentials (joules_per_mole_kelvin).
 * CONSTANTS[112] is Frdy in component Nernst_Potentials (coulombs_per_mole).
 * CONSTANTS[123] is FoRT in component Nernst_Potentials (per_mV).
 * CONSTANTS[113] is z_Na in component Nernst_Potentials (dimensionless).
 * CONSTANTS[114] is z_K in component Nernst_Potentials (dimensionless).
 * CONSTANTS[115] is z_Ca in component Nernst_Potentials (dimensionless).
 * STATES[11] is Na_i in component Ion_Concentrations_and_Membrane_Potential (mM).
 * STATES[12] is K_i in component Ion_Concentrations_and_Membrane_Potential (mM).
 * STATES[13] is Ca_i in component Ion_Concentrations_and_Membrane_Potential (mM).
 * ALGEBRAIC[18] is am in component Fast_Na_Current (per_sec).
 * ALGEBRAIC[19] is bm in component Fast_Na_Current (per_sec).
 * ALGEBRAIC[20] is ah in component Fast_Na_Current (per_sec).
 * ALGEBRAIC[21] is aj in component Fast_Na_Current (per_sec).
 * ALGEBRAIC[22] is bh in component Fast_Na_Current (per_sec).
 * ALGEBRAIC[23] is bj in component Fast_Na_Current (per_sec).
 * STATES[14] is m in component Fast_Na_Current (dimensionless).
 * STATES[15] is h in component Fast_Na_Current (dimensionless).
 * STATES[16] is j in component Fast_Na_Current (dimensionless).
 * ALGEBRAIC[24] is I_Na in component Fast_Na_Current (uA_per_uF).
 * STATES[17] is V_m in component Ion_Concentrations_and_Membrane_Potential (mV).
 * ALGEBRAIC[25] is a_lcc in component L_Type_Calcium_Current (per_sec).
 * ALGEBRAIC[26] is b_lcc in component L_Type_Calcium_Current (per_sec).
 * ALGEBRAIC[27] is f_lcc in component L_Type_Calcium_Current (dimensionless).
 * ALGEBRAIC[28] is y_lcc_inf in component L_Type_Calcium_Current (dimensionless).
 * ALGEBRAIC[29] is tau_y_lcc in component L_Type_Calcium_Current (second).
 * ALGEBRAIC[30] is gamma in component L_Type_Calcium_Current (per_mM_per_sec).
 * ALGEBRAIC[31] is v_gamma in component L_Type_Calcium_Current (per_mM_per_sec).
 * ALGEBRAIC[32] is v_omega in component L_Type_Calcium_Current (dimensionless).
 * STATES[18] is v in component L_Type_Calcium_Current (dimensionless).
 * STATES[19] is w in component L_Type_Calcium_Current (dimensionless).
 * STATES[20] is x in component L_Type_Calcium_Current (dimensionless).
 * STATES[21] is y in component L_Type_Calcium_Current (dimensionless).
 * STATES[22] is z in component L_Type_Calcium_Current (dimensionless).
 * ALGEBRAIC[33] is i_bar_Ca in component L_Type_Calcium_Current (dimensionless).
 * ALGEBRAIC[34] is i_bar_K in component L_Type_Calcium_Current (dimensionless).
 * ALGEBRAIC[35] is f_avail in component L_Type_Calcium_Current (dimensionless).
 * ALGEBRAIC[36] is I_Ca in component L_Type_Calcium_Current (uA_per_uF).
 * ALGEBRAIC[37] is I_CaK in component L_Type_Calcium_Current (uA_per_uF).
 * ALGEBRAIC[38] is I_Ca_tot in component L_Type_Calcium_Current (uA_per_uF).
 * ALGEBRAIC[39] is r_toss in component Transient_Outward_K_Current (dimensionless).
 * ALGEBRAIC[40] is s_toss in component Transient_Outward_K_Current (dimensionless).
 * ALGEBRAIC[41] is tau_r_to in component Transient_Outward_K_Current (second).
 * ALGEBRAIC[42] is tau_s_to in component Transient_Outward_K_Current (second).
 * ALGEBRAIC[43] is tau_ss_to in component Transient_Outward_K_Current (second).
 * STATES[23] is r_to in component Transient_Outward_K_Current (dimensionless).
 * STATES[24] is s_to in component Transient_Outward_K_Current (dimensionless).
 * STATES[25] is ss_to in component Transient_Outward_K_Current (dimensionless).
 * ALGEBRAIC[44] is I_to in component Transient_Outward_K_Current (uA_per_uF).
 * ALGEBRAIC[45] is r_ss_inf in component Steady_State_K_Current (dimensionless).
 * ALGEBRAIC[46] is tau_r_ss in component Steady_State_K_Current (second).
 * ALGEBRAIC[47] is s_ss_inf in component Steady_State_K_Current (dimensionless).
 * CONSTANTS[124] is tau_s_ss in component Steady_State_K_Current (second).
 * STATES[26] is r_ss in component Steady_State_K_Current (dimensionless).
 * STATES[27] is s_ss in component Steady_State_K_Current (dimensionless).
 * ALGEBRAIC[48] is I_ss in component Steady_State_K_Current (uA_per_uF).
 * ALGEBRAIC[49] is a_Ki in component Time_Independent_K_Current (dimensionless).
 * ALGEBRAIC[50] is b_Ki in component Time_Independent_K_Current (dimensionless).
 * ALGEBRAIC[51] is Ki_ss in component Time_Independent_K_Current (dimensionless).
 * ALGEBRAIC[52] is I_Ki in component Time_Independent_K_Current (uA_per_uF).
 * ALGEBRAIC[53] is Kp in component Plateau_K_Current (dimensionless).
 * ALGEBRAIC[54] is I_Kp in component Plateau_K_Current (uA_per_uF).
 * ALGEBRAIC[55] is s4 in component Na_Ca_Exchanger_Current (dimensionless).
 * ALGEBRAIC[56] is s5 in component Na_Ca_Exchanger_Current (dimensionless).
 * ALGEBRAIC[57] is I_NCX in component Na_Ca_Exchanger_Current (uA_per_uF).
 * CONSTANTS[125] is sigma in component Na_K_Pump_Current (dimensionless).
 * ALGEBRAIC[58] is f_NaK in component Na_K_Pump_Current (dimensionless).
 * ALGEBRAIC[59] is I_NaK in component Na_K_Pump_Current (uA_per_uF).
 * ALGEBRAIC[60] is I_PCa in component Sarcolemmal_Ca_Pump_Current (uA_per_uF).
 * ALGEBRAIC[61] is I_CaB in component Ca_Background_Current (uA_per_uF).
 * ALGEBRAIC[62] is I_NaB in component Na_Background_Current (uA_per_uF).
 * ALGEBRAIC[63] is I_Na_tot in component Total_Membrane_Currents (uA_per_uF).
 * ALGEBRAIC[64] is I_K_tot in component Total_Membrane_Currents (uA_per_uF).
 * ALGEBRAIC[65] is I_Ca_tot in component Total_Membrane_Currents (uA_per_uF).
 * ALGEBRAIC[66] is t_rel in component Calcium_Induced_Calcium_Release (second).
 * ALGEBRAIC[67] is ryr_on in component Calcium_Induced_Calcium_Release (dimensionless).
 * ALGEBRAIC[68] is ryr_off in component Calcium_Induced_Calcium_Release (dimensionless).
 * ALGEBRAIC[69] is g_rel in component Calcium_Induced_Calcium_Release (per_sec).
 * ALGEBRAIC[70] is I_rel in component Calcium_Induced_Calcium_Release (mM_per_sec).
 * STATES[28] is Ca_jsr in component Other_SR_Fluxes_and_Concentrations (mM).
 * STATES[29] is trel in component Ion_Concentrations_and_Membrane_Potential (second).
 * ALGEBRAIC[71] is Km_up in component Other_SR_Fluxes_and_Concentrations (mM).
 * ALGEBRAIC[72] is I_up in component Other_SR_Fluxes_and_Concentrations (mM_per_sec).
 * ALGEBRAIC[73] is I_leak in component Other_SR_Fluxes_and_Concentrations (mM_per_sec).
 * ALGEBRAIC[74] is I_tr in component Other_SR_Fluxes_and_Concentrations (mM_per_sec).
 * ALGEBRAIC[75] is B_jsr in component Other_SR_Fluxes_and_Concentrations (dimensionless).
 * STATES[30] is Ca_nsr in component Other_SR_Fluxes_and_Concentrations (mM).
 * ALGEBRAIC[76] is SR_content in component Other_SR_Fluxes_and_Concentrations (uM).
 * ALGEBRAIC[77] is b_trpn in component Cytoplasmic_Calcium_Buffering (dimensionless).
 * ALGEBRAIC[78] is b_cmdn in component Cytoplasmic_Calcium_Buffering (dimensionless).
 * ALGEBRAIC[79] is b_indo in component Cytoplasmic_Calcium_Buffering (dimensionless).
 * ALGEBRAIC[80] is B_myo in component Cytoplasmic_Calcium_Buffering (dimensionless).
 * CONSTANTS[126] is I_app in component Ion_Concentrations_and_Membrane_Potential (uA_per_uF).
 * CONSTANTS[116] is V_hold in component Ion_Concentrations_and_Membrane_Potential (mV).
 * CONSTANTS[117] is V_test in component Ion_Concentrations_and_Membrane_Potential (mV).
 * ALGEBRAIC[81] is V_clamp in component Ion_Concentrations_and_Membrane_Potential (mV).
 * CONSTANTS[118] is R_clamp in component Ion_Concentrations_and_Membrane_Potential (dimensionless).
 * RATES[0] is d/dt b1_AR_tot in component b1_AR_module (uM).
 * RATES[1] is d/dt b1_AR_d in component b1_AR_module (uM).
 * RATES[2] is d/dt b1_AR_p in component b1_AR_module (uM).
 * RATES[3] is d/dt Gs_agtp_tot in component b1_AR_module (uM).
 * RATES[4] is d/dt Gs_agdp in component b1_AR_module (uM).
 * RATES[5] is d/dt Gs_bg in component b1_AR_module (uM).
 * RATES[6] is d/dt cAMP_tot in component cAMP_module (uM).
 * RATES[7] is d/dt PLB_p in component PLB_module (uM).
 * RATES[8] is d/dt Inhib1p_tot in component PLB_module (uM).
 * RATES[9] is d/dt LCCa_p in component LCC_module (uM).
 * RATES[10] is d/dt LCCb_p in component LCC_module (uM).
 * RATES[14] is d/dt m in component Fast_Na_Current (dimensionless).
 * RATES[15] is d/dt h in component Fast_Na_Current (dimensionless).
 * RATES[16] is d/dt j in component Fast_Na_Current (dimensionless).
 * RATES[18] is d/dt v in component L_Type_Calcium_Current (dimensionless).
 * RATES[19] is d/dt w in component L_Type_Calcium_Current (dimensionless).
 * RATES[20] is d/dt x in component L_Type_Calcium_Current (dimensionless).
 * RATES[21] is d/dt y in component L_Type_Calcium_Current (dimensionless).
 * RATES[22] is d/dt z in component L_Type_Calcium_Current (dimensionless).
 * RATES[23] is d/dt r_to in component Transient_Outward_K_Current (dimensionless).
 * RATES[24] is d/dt s_to in component Transient_Outward_K_Current (dimensionless).
 * RATES[25] is d/dt ss_to in component Transient_Outward_K_Current (dimensionless).
 * RATES[26] is d/dt r_ss in component Steady_State_K_Current (dimensionless).
 * RATES[27] is d/dt s_ss in component Steady_State_K_Current (dimensionless).
 * RATES[30] is d/dt Ca_nsr in component Other_SR_Fluxes_and_Concentrations (mM).
 * RATES[28] is d/dt Ca_jsr in component Other_SR_Fluxes_and_Concentrations (mM).
 * RATES[11] is d/dt Na_i in component Ion_Concentrations_and_Membrane_Potential (mM).
 * RATES[12] is d/dt K_i in component Ion_Concentrations_and_Membrane_Potential (mM).
 * RATES[13] is d/dt Ca_i in component Ion_Concentrations_and_Membrane_Potential (mM).
 * RATES[17] is d/dt V_m in component Ion_Concentrations_and_Membrane_Potential (mV).
 * RATES[29] is d/dt trel in component Ion_Concentrations_and_Membrane_Potential (second).
 * There are a total of 7 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 1;
CONSTANTS[1] = 0.0132;
CONSTANTS[2] = 3.83;
CONSTANTS[3] = 0.285;
CONSTANTS[4] = 0.062;
CONSTANTS[5] = 33;
CONSTANTS[6] = 1.1e-3;
CONSTANTS[7] = 2.2e-3;
CONSTANTS[8] = 3.6e-3;
CONSTANTS[9] = 2.2e-3;
CONSTANTS[10] = 16;
CONSTANTS[11] = 0.8;
CONSTANTS[12] = 1.21e3;
CONSTANTS[13] = 49.7e-3;
CONSTANTS[14] = 5e3;
CONSTANTS[15] = 38.9e-3;
CONSTANTS[16] = 0;
CONSTANTS[17] = 0;
CONSTANTS[18] = 0.2;
CONSTANTS[19] = 8.5;
CONSTANTS[20] = 7.3;
CONSTANTS[21] = 5;
CONSTANTS[22] = 1.03e3;
CONSTANTS[23] = 315;
CONSTANTS[24] = 860;
CONSTANTS[25] = 1.3;
CONSTANTS[26] = 0.4;
CONSTANTS[27] = 44;
CONSTANTS[28] = 30;
CONSTANTS[29] = 0.59;
CONSTANTS[30] = 0.025;
CONSTANTS[31] = 0.18;
CONSTANTS[32] = 9.14;
CONSTANTS[33] = 1.64;
CONSTANTS[34] = 4.375;
CONSTANTS[35] = 0.2e-3;
CONSTANTS[36] = 106;
CONSTANTS[37] = 0.89;
CONSTANTS[38] = 0.3;
CONSTANTS[39] = 54;
CONSTANTS[40] = 21;
CONSTANTS[41] = 8.5;
CONSTANTS[42] = 7;
CONSTANTS[43] = 60;
CONSTANTS[44] = 1;
CONSTANTS[45] = 14;
CONSTANTS[46] = 1;
CONSTANTS[47] = 1e-3;
CONSTANTS[48] = 10;
CONSTANTS[49] = 25e-3;
CONSTANTS[50] = 25e-3;
CONSTANTS[51] = 25e-3;
CONSTANTS[52] = 54;
CONSTANTS[53] = 21;
CONSTANTS[54] = 8.52;
CONSTANTS[55] = 3;
CONSTANTS[56] = 10.1;
CONSTANTS[57] = 3;
CONSTANTS[58] = 20.8e-6;
CONSTANTS[59] = 9.88e-7;
CONSTANTS[60] = 9.3e-8;
CONSTANTS[61] = 1.534e-4;
CONSTANTS[62] = 310;
CONSTANTS[63] = 140;
CONSTANTS[64] = 5.4;
CONSTANTS[65] = 1.8;
CONSTANTS[66] = 8;
CONSTANTS[67] = 0.35;
CONSTANTS[68] = 0.07;
CONSTANTS[69] = 0.24;
CONSTANTS[70] = 0.008;
CONSTANTS[71] = 300;
CONSTANTS[72] = 2e3;
CONSTANTS[73] = 5187.5;
CONSTANTS[74] = 10;
CONSTANTS[75] = 1.7469e-8;
CONSTANTS[76] = 3.234e-11;
CONSTANTS[77] = 3e5;
CONSTANTS[78] = -0.458;
CONSTANTS[79] = 1483;
CONSTANTS[80] = 87.5;
CONSTANTS[81] = 1.38;
CONSTANTS[82] = 0.1;
CONSTANTS[83] = 0.35;
CONSTANTS[84] = 1.1;
CONSTANTS[85] = 10;
CONSTANTS[86] = 1.5;
CONSTANTS[87] = 1.15;
CONSTANTS[88] = 0.5e-3;
CONSTANTS[89] = 2.8e-3;
CONSTANTS[90] = 1.18e-3;
CONSTANTS[91] = 0;
CONSTANTS[92] = 1.2e-3;
CONSTANTS[93] = 4.7;
CONSTANTS[94] = 3e-4;
CONSTANTS[95] = 15;
CONSTANTS[96] = 2e-3;
CONSTANTS[97] = 2e-3;
CONSTANTS[98] = 60e3;
CONSTANTS[99] = 0.18e-3;
CONSTANTS[100] = 0.8e-3;
CONSTANTS[101] = 8.75;
CONSTANTS[102] = 15;
CONSTANTS[103] = 0.8;
CONSTANTS[104] = 5.7e-4;
CONSTANTS[105] = 0.07;
CONSTANTS[106] = 0.05;
CONSTANTS[107] = 0.07;
CONSTANTS[108] = 0.5128e-3;
CONSTANTS[109] = 2.38e-3;
CONSTANTS[110] = 8.44e-4;
STATES[0] = 0.01205;
STATES[1] = 0;
STATES[2] = 1.154e-3;
STATES[3] = 0.02505;
STATES[4] = 6.446e-4;
STATES[5] = 0.02569;
STATES[6] = 0.8453;
STATES[7] = 4.105;
STATES[8] = 0.0526;
STATES[9] = 5.103e-3;
STATES[10] = 5.841e-3;
CONSTANTS[111] = 8314;
CONSTANTS[112] = 96485;
CONSTANTS[113] = 1;
CONSTANTS[114] = 1;
CONSTANTS[115] = 2;
STATES[11] = 16;
STATES[12] = 145;
STATES[13] = 1.58e-4;
STATES[14] = 1.4e-3;
STATES[15] = 0.99;
STATES[16] = 0.99;
STATES[17] = -85.66;
STATES[18] = 0;
STATES[19] = 0;
STATES[20] = 0.13;
STATES[21] = 0.96;
STATES[22] = 0.92;
STATES[23] = 1.4e-3;
STATES[24] = 1;
STATES[25] = 0.613;
STATES[26] = 198e-3;
STATES[27] = 0.43;
STATES[28] = 1.92;
STATES[29] = 0.9;
STATES[30] = 1.92;
CONSTANTS[116] = -40;
CONSTANTS[117] = -10;
CONSTANTS[118] = 0.02;
CONSTANTS[119] = 0.961300;
CONSTANTS[120] = 0.204100;
CONSTANTS[121] = 0.233600;
CONSTANTS[122] = - 40.0000;
CONSTANTS[123] = (CONSTANTS[112]/CONSTANTS[111])/CONSTANTS[62];
CONSTANTS[124] = 2.10000;
CONSTANTS[125] = (exp(CONSTANTS[63]/67.3000) - 1.00000)/7.00000;
CONSTANTS[126] = 0.00000;
rootfind_0(VOI, CONSTANTS, RATES, STATES, ALGEBRAIC, pret);
STATES[31] = 0.1001;
STATES[32] = 0.1001;
STATES[33] = 0.1001;
STATES[34] = 0.1001;
STATES[35] = 0.1001;
STATES[36] = 0.1001;
STATES[37] = 0.988;
STATES[38] = 5.5258e-05;
STATES[39] = 3.8182;
STATES[40] = 0.0588;
STATES[41] = 0.227;
STATES[42] = 0.0224;
STATES[43] = 0;
STATES[44] = 0.0471;
STATES[45] = 0.1001;
STATES[46] = 0.1001;
STATES[47] = 0.1001;
STATES[48] = 0.1001;
STATES[49] = 0.1001;
STATES[50] = 0.1001;
STATES[51] = 0.1001;
STATES[52] = 0.1001;
STATES[53] = 0.1001;
STATES[54] = 0.1001;
STATES[55] = 0.1001;
STATES[56] = 0.1001;
STATES[57] = 0.1001;
STATES[58] = 0.1001;
STATES[59] = 0.0083;
STATES[60] = 0.1001;
STATES[61] = 0.1001;
STATES[62] = 0.1001;
STATES[63] = 0.1001;
STATES[64] = 6.2734e-05;
STATES[65] = 0.8375;
STATES[66] = 0.1001;
STATES[67] = 0.1001;
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[4] = 0.1001;
RATES[5] = 0.1001;
RATES[6] = 0.1001;
RATES[7] = 0.1001;
RATES[8] = 0.1001;
RATES[9] = 0.1001;
RATES[10] = 0.1001;
RATES[14] = 0.1001;
RATES[15] = 0.1001;
RATES[16] = 0.1001;
RATES[18] = 0.1001;
RATES[19] = 0.1001;
RATES[20] = 0.1001;
RATES[21] = 0.1001;
RATES[22] = 0.1001;
RATES[23] = 0.1001;
RATES[24] = 0.1001;
RATES[25] = 0.1001;
RATES[26] = 0.1001;
RATES[27] = 0.1001;
RATES[30] = 0.1001;
RATES[28] = 0.1001;
RATES[11] = 0.1001;
RATES[12] = 0.1001;
RATES[13] = 0.1001;
RATES[17] = 0.1001;
RATES[29] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = STATES[31] - ( STATES[37]*STATES[38])/CONSTANTS[3];
resid[1] = STATES[32] - ( STATES[31]*STATES[39])/CONSTANTS[4];
resid[2] = STATES[33] - ( STATES[38]*STATES[39])/CONSTANTS[5];
resid[3] = STATES[34] -  CONSTANTS[6]*(STATES[31]+STATES[32]);
resid[4] = STATES[35] -  CONSTANTS[8]*STATES[40]*STATES[0];
resid[5] = STATES[36] -  CONSTANTS[10]*(STATES[33]+STATES[32]);
resid[6] = STATES[37] - (CONSTANTS[0] - STATES[31]) - STATES[32];
resid[7] = STATES[38] - ((STATES[0] - STATES[31]) - STATES[32]) - STATES[33];
resid[8] = STATES[39] - (CONSTANTS[2] - STATES[32]) - STATES[33];
resid[9] = RATES[0] - (ALGEBRAIC[0] - STATES[34])+(ALGEBRAIC[1] - STATES[35]);
resid[10] = RATES[1] - STATES[34] - ALGEBRAIC[0];
resid[11] = RATES[2] - STATES[35] - ALGEBRAIC[1];
resid[12] = RATES[3] - STATES[36] - ALGEBRAIC[2];
resid[13] = RATES[4] - ALGEBRAIC[2] - ALGEBRAIC[3];
resid[14] = RATES[5] - STATES[36] - ALGEBRAIC[3];
resid[15] = STATES[45] - ( STATES[42]*STATES[44])/CONSTANTS[26];
resid[16] = STATES[46] - ( STATES[43]*STATES[44])/CONSTANTS[27];
resid[17] = STATES[48] - ( CONSTANTS[18]*STATES[44]*CONSTANTS[14])/(CONSTANTS[22]+CONSTANTS[14]);
resid[18] = STATES[47] - ( CONSTANTS[19]*STATES[45]*CONSTANTS[14])/(CONSTANTS[23]+CONSTANTS[14]);
resid[19] = STATES[49] - ( CONSTANTS[20]*STATES[46]*CONSTANTS[14])/(CONSTANTS[24]+CONSTANTS[14]);
resid[20] = STATES[50] - ( CONSTANTS[21]*CONSTANTS[127]*STATES[41])/(CONSTANTS[25]+STATES[41]);
resid[21] = STATES[42] - STATES[3] - STATES[45];
resid[22] = STATES[43] - CONSTANTS[17] - STATES[46];
resid[23] = STATES[44] - CONSTANTS[13] - STATES[45];
resid[24] = RATES[6] - (STATES[48]+STATES[47]+STATES[49]) - STATES[50];
resid[25] = STATES[51] - ( CONSTANTS[31]*CONSTANTS[35])/(CONSTANTS[35]+STATES[40]+STATES[59]);
resid[26] = STATES[52] -  (STATES[40]/CONSTANTS[34])*STATES[40]*(1.00000+STATES[51]/CONSTANTS[35]);
resid[27] = STATES[53] -  STATES[40]*(1.00000+STATES[51]/CONSTANTS[35]);
resid[28] = STATES[54] -  (STATES[59]/CONSTANTS[34])*STATES[59]*(1.00000+STATES[51]/CONSTANTS[35]);
resid[29] = STATES[55] -  STATES[59]*(1.00000+STATES[51]/CONSTANTS[35]);
resid[30] = STATES[56] -  (CONSTANTS[32]/STATES[41])*STATES[52];
resid[31] = STATES[57] -  (CONSTANTS[32]/STATES[41])*STATES[54];
resid[32] = STATES[58] - ( CONSTANTS[32]*CONSTANTS[33])/CONSTANTS[34]+( CONSTANTS[32]*STATES[41])/CONSTANTS[34]+pow(STATES[41], 2.00000)/CONSTANTS[34];
resid[33] = STATES[41] - (STATES[6] - (STATES[56]+ 2.00000*STATES[52]+ 2.00000*STATES[53])) - (STATES[57]+ 2.00000*STATES[54]+ 2.00000*STATES[55]);
resid[34] = 0.00000 -  2.00000*CONSTANTS[29]*pow(STATES[41], 2.00000) -  STATES[40]*(1.00000+STATES[51]/CONSTANTS[35])*( STATES[58]*STATES[40]+pow(STATES[41], 2.00000));
resid[35] = 0.00000 -  2.00000*CONSTANTS[30]*pow(STATES[41], 2.00000) -  STATES[59]*(1.00000+STATES[51]/CONSTANTS[35])*( STATES[58]*STATES[59]+pow(STATES[41], 2.00000));
resid[36] = STATES[60] - ( CONSTANTS[39]*STATES[40]*ALGEBRAIC[4])/(CONSTANTS[40]+ALGEBRAIC[4]);
resid[37] = STATES[61] - ( CONSTANTS[41]*STATES[65]*STATES[7])/(CONSTANTS[42]+STATES[7]);
resid[38] = STATES[62] - ( STATES[64]*STATES[65])/CONSTANTS[47];
resid[39] = STATES[63] - ( CONSTANTS[43]*STATES[40]*ALGEBRAIC[5])/(CONSTANTS[44]+ALGEBRAIC[5]);
resid[40] = RATES[7] - STATES[60] - STATES[61];
resid[41] = RATES[8] - STATES[63] - ALGEBRAIC[6];
resid[42] = STATES[64] - STATES[8] - STATES[62];
resid[43] = STATES[65] - CONSTANTS[37] - STATES[62];
resid[44] = STATES[66] - ( CONSTANTS[48]*CONSTANTS[52]*STATES[59]*ALGEBRAIC[9])/(CONSTANTS[53]+ CONSTANTS[48]*ALGEBRAIC[9]);
resid[45] = STATES[67] - ( CONSTANTS[48]*CONSTANTS[52]*STATES[59]*ALGEBRAIC[11])/(CONSTANTS[53]+ CONSTANTS[48]*ALGEBRAIC[11]);
resid[46] = RATES[9] - STATES[66] - ALGEBRAIC[10];
resid[47] = RATES[10] - STATES[67] - ALGEBRAIC[12];
resid[48] = RATES[14] -  1000.00*( ALGEBRAIC[18]*(1.00000 - STATES[14]) -  ALGEBRAIC[19]*STATES[14]);
resid[49] = RATES[15] -  1000.00*( ALGEBRAIC[20]*(1.00000 - STATES[15]) -  ALGEBRAIC[22]*STATES[15]);
resid[50] = RATES[16] -  1000.00*( ALGEBRAIC[21]*(1.00000 - STATES[16]) -  ALGEBRAIC[23]*STATES[16]);
resid[51] = RATES[18] -  ALGEBRAIC[25]*(1.00000 - STATES[18]) -  ALGEBRAIC[26]*STATES[18];
resid[52] = RATES[19] -  2.00000*ALGEBRAIC[25]*(1.00000 - STATES[19]) -  (ALGEBRAIC[26]/2.00000)*STATES[19];
resid[53] = RATES[20] -  ALGEBRAIC[27]*(1.00000 - STATES[20]) -  CONSTANTS[72]*STATES[20];
resid[54] = RATES[21] - (ALGEBRAIC[28] - STATES[21])/ALGEBRAIC[29];
resid[55] = RATES[22] -  ALGEBRAIC[32]*(1.00000 - STATES[22]) -  ALGEBRAIC[31]*STATES[22];
resid[56] = RATES[23] - (ALGEBRAIC[39] - STATES[23])/ALGEBRAIC[41];
resid[57] = RATES[24] - (ALGEBRAIC[40] - STATES[24])/ALGEBRAIC[42];
resid[58] = RATES[25] - (ALGEBRAIC[40] - STATES[25])/ALGEBRAIC[43];
resid[59] = RATES[26] - (ALGEBRAIC[45] - STATES[26])/ALGEBRAIC[46];
resid[60] = RATES[27] - (ALGEBRAIC[47] - STATES[27])/CONSTANTS[124];
resid[61] = RATES[30] - (ALGEBRAIC[72] - ALGEBRAIC[73]) - ( ALGEBRAIC[74]*CONSTANTS[60])/CONSTANTS[59];
resid[62] = RATES[28] -  ALGEBRAIC[75]*(ALGEBRAIC[74] - ALGEBRAIC[70]);
resid[63] = RATES[11] - ( - 1000.00*ALGEBRAIC[63]*CONSTANTS[61])/( CONSTANTS[58]*CONSTANTS[113]*CONSTANTS[112]);
resid[64] = RATES[12] - ( - 1000.00*ALGEBRAIC[64]*CONSTANTS[61])/( CONSTANTS[58]*CONSTANTS[114]*CONSTANTS[112]);
resid[65] = RATES[13] -  - ALGEBRAIC[80]*((( 1000.00*ALGEBRAIC[65]*CONSTANTS[61])/( CONSTANTS[58]*CONSTANTS[115]*CONSTANTS[112])+( (ALGEBRAIC[72] - ALGEBRAIC[73])*CONSTANTS[59])/CONSTANTS[58]) - ( ALGEBRAIC[70]*CONSTANTS[60])/CONSTANTS[58]);
resid[66] = RATES[17] -  - 1000.00*((ALGEBRAIC[65]+ALGEBRAIC[64]+ALGEBRAIC[63]) - CONSTANTS[126]);
resid[67] = RATES[29] - (CONDVAR[6]>0.00000 ? 1.00000 -  10000.0*STATES[29] : 1.00000);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[7] = STATES[7]/CONSTANTS[36];
ALGEBRAIC[38] = ALGEBRAIC[36]+ALGEBRAIC[37];
ALGEBRAIC[76] =  1000.00*(( (STATES[28]+STATES[28]/ALGEBRAIC[75])*CONSTANTS[60])/CONSTANTS[58]+( STATES[30]*CONSTANTS[59])/CONSTANTS[58]);
ALGEBRAIC[81] = (CONDVAR[4]>0.00000&&CONDVAR[5]<0.00000 ? CONSTANTS[117] : CONSTANTS[116]);
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] =  CONSTANTS[7]*STATES[1];
ALGEBRAIC[1] =  CONSTANTS[9]*STATES[2];
ALGEBRAIC[2] =  CONSTANTS[11]*STATES[3];
ALGEBRAIC[3] =  CONSTANTS[12]*STATES[4]*STATES[5];
ALGEBRAIC[4] = CONSTANTS[36] - STATES[7];
ALGEBRAIC[5] = CONSTANTS[38] - STATES[8];
ALGEBRAIC[6] = ( CONSTANTS[45]*STATES[8])/(CONSTANTS[46]+STATES[8]);
ALGEBRAIC[9] = CONSTANTS[49] - STATES[9];
ALGEBRAIC[10] = ( CONSTANTS[48]*CONSTANTS[56]*CONSTANTS[51]*STATES[9])/(CONSTANTS[57]+ CONSTANTS[48]*STATES[9]);
ALGEBRAIC[11] = CONSTANTS[49] - STATES[10];
ALGEBRAIC[12] = ( CONSTANTS[48]*CONSTANTS[54]*CONSTANTS[50]*STATES[10])/(CONSTANTS[55]+ CONSTANTS[48]*STATES[10]);
ALGEBRAIC[18] = ( 0.320000*(STATES[17]+47.1300))/(1.00000 - exp( - 0.100000*(STATES[17]+47.1300)));
ALGEBRAIC[19] =  0.0800000*exp(- STATES[17]/11.0000);
ALGEBRAIC[20] = (CONDVAR[0]>=0.00000 ? 0.00000 :  0.135000*exp((80.0000+STATES[17])/- 6.80000));
ALGEBRAIC[21] = (CONDVAR[1]>=0.00000 ? 0.00000 : ( ( - 127140.*exp( 0.244400*STATES[17]) -  3.47400e-05*exp( - 0.0439100*STATES[17]))*(STATES[17]+37.7800))/(1.00000+exp( 0.311000*(STATES[17]+79.2300))));
ALGEBRAIC[22] = (CONDVAR[2]>=0.00000 ? 1.00000/( 0.130000*(1.00000+exp(- (STATES[17]+10.6600)/11.1000))) :  3.56000*exp( 0.0790000*STATES[17])+ 310000.*exp( 0.350000*STATES[17]));
ALGEBRAIC[23] = (CONDVAR[3]>=0.00000 ? ( 0.300000*exp( - 2.57500e-07*STATES[17]))/(1.00000+exp( - 0.100000*(STATES[17]+32.0000))) : ( 0.121200*exp( - 0.0105200*STATES[17]))/(1.00000+exp( - 0.137800*(STATES[17]+40.1400))));
ALGEBRAIC[25] =  400.000*exp((STATES[17]+2.00000)/10.0000);
ALGEBRAIC[26] =  50.0000*exp(( - 1.00000*(STATES[17]+2.00000))/13.0000);
ALGEBRAIC[13] = STATES[9]/CONSTANTS[49];
ALGEBRAIC[27] =  CONSTANTS[71]*(( 0.375000*ALGEBRAIC[13])/CONSTANTS[120]+0.625000);
ALGEBRAIC[28] = 1.00000/(1.00000+exp((STATES[17]+55.0000)/7.50000))+0.100000/(1.00000+exp((- STATES[17]+21.0000)/6.00000));
ALGEBRAIC[29] = 0.0200000+0.300000/(1.00000+exp((STATES[17]+30.0000)/9.50000));
ALGEBRAIC[30] =  CONSTANTS[73]*STATES[13];
ALGEBRAIC[31] =  ALGEBRAIC[30]*(pow(1.00000 - STATES[18], 4.00000)+ 2.00000*STATES[18]*pow(1.00000 - STATES[18], 3.00000)+ 4.00000*pow(STATES[18], 2.00000)*pow(1.00000 - STATES[18], 2.00000)+ 8.00000*pow(STATES[18], 3.00000)*(1.00000 - STATES[18])+ 16.0000*pow(STATES[18], 4.00000)*(1.00000 - ALGEBRAIC[27]/CONSTANTS[72]));
ALGEBRAIC[32] =  CONSTANTS[74]*(pow(1.00000 - STATES[19], 4.00000)+ 0.500000*STATES[19]*pow(1.00000 - STATES[19], 3.00000)+ 0.250000*pow(STATES[19], 2.00000)*pow(1.00000 - STATES[19], 2.00000)+ 0.125000*pow(STATES[19], 3.00000)*(1.00000 - STATES[19])+ 0.0625000*pow(STATES[19], 4.00000));
ALGEBRAIC[39] = 1.00000/(1.00000+exp((STATES[17]+10.6000)/- 11.4200));
ALGEBRAIC[40] = 1.00000/(1.00000+exp((STATES[17]+43.5000)/6.88410));
ALGEBRAIC[41] = 1.00000/( 45.1600*exp( 0.0357700*(STATES[17]+50.0000))+ 98.9000*exp( - 0.100000*(STATES[17]+38.0000)));
ALGEBRAIC[42] =  0.350000*exp( - 1.00000*pow((STATES[17]+70.0000)/15.0000, 2.00000))+0.0350000;
ALGEBRAIC[43] =  3.70000*exp( - 1.00000*pow((STATES[17]+70.0000)/30.0000, 2.00000))+0.0350000;
ALGEBRAIC[45] = 1.00000/(1.00000+exp((STATES[17]+11.5000)/- 11.8200));
ALGEBRAIC[46] = 10.0000/( 45.1600*exp( 0.0357700*(STATES[17]+50.0000))+ 98.9000*exp( - 0.100000*(STATES[17]+38.0000)));
ALGEBRAIC[47] = 1.00000/(1.00000+exp((STATES[17]+87.5000)/10.3000));
ALGEBRAIC[15] =  (1.00000/( CONSTANTS[123]*CONSTANTS[113]))*log(CONSTANTS[63]/STATES[11]);
ALGEBRAIC[24] =  CONSTANTS[66]*pow(STATES[14], 3.00000)*STATES[15]*STATES[16]*(STATES[17] - ALGEBRAIC[15]);
ALGEBRAIC[55] =  exp( CONSTANTS[83]*STATES[17]*CONSTANTS[123])*pow(STATES[11], 3.00000)*CONSTANTS[65];
ALGEBRAIC[56] =  exp( (CONSTANTS[83] - 1.00000)*STATES[17]*CONSTANTS[123])*pow(CONSTANTS[63], 3.00000)*STATES[13];
ALGEBRAIC[57] =  (CONSTANTS[79]/( (pow(CONSTANTS[80], 3.00000)+pow(CONSTANTS[63], 3.00000))*(CONSTANTS[81]+CONSTANTS[65])*(1.00000+ CONSTANTS[82]*exp( (CONSTANTS[83] - 1.00000)*STATES[17]*CONSTANTS[123]))))*(ALGEBRAIC[55] - ALGEBRAIC[56]);
ALGEBRAIC[58] = 1.00000/(1.00000+ 0.124500*exp( - 0.100000*STATES[17]*CONSTANTS[123])+ 0.0365000*CONSTANTS[125]*exp( - STATES[17]*CONSTANTS[123]));
ALGEBRAIC[59] = ( (( CONSTANTS[84]*ALGEBRAIC[58])/(1.00000+pow(CONSTANTS[85]/STATES[11], 1.50000)))*CONSTANTS[64])/(CONSTANTS[64]+CONSTANTS[86]);
ALGEBRAIC[62] =  CONSTANTS[90]*(STATES[17] - ALGEBRAIC[15]);
ALGEBRAIC[63] = ALGEBRAIC[24]+ALGEBRAIC[62]+ 3.00000*ALGEBRAIC[57]+ 3.00000*ALGEBRAIC[59];
ALGEBRAIC[34] = ( CONSTANTS[76]*STATES[17]*CONSTANTS[112]*CONSTANTS[123]*( STATES[12]*exp( STATES[17]*CONSTANTS[123]) - CONSTANTS[64]))/(exp( STATES[17]*CONSTANTS[123]) - 1.00000);
ALGEBRAIC[14] = STATES[10]/CONSTANTS[49];
ALGEBRAIC[35] =  0.500000*(( 0.400000*ALGEBRAIC[14])/CONSTANTS[121]+0.600000);
ALGEBRAIC[33] = ( CONSTANTS[75]*4.00000*STATES[17]*CONSTANTS[112]*CONSTANTS[123]*( 0.00100000*exp( 2.00000*STATES[17]*CONSTANTS[123]) -  0.341000*CONSTANTS[65]))/(exp( 2.00000*STATES[17]*CONSTANTS[123]) - 1.00000);
ALGEBRAIC[36] =  ALGEBRAIC[33]*CONSTANTS[77]*ALGEBRAIC[35]*pow(STATES[18], 4.00000)*STATES[20]*STATES[21]*STATES[22];
ALGEBRAIC[37] =  (ALGEBRAIC[34]/(1.00000+ALGEBRAIC[36]/CONSTANTS[78]))*CONSTANTS[77]*ALGEBRAIC[35]*pow(STATES[18], 4.00000)*STATES[20]*STATES[21]*STATES[22];
ALGEBRAIC[16] =  (1.00000/( CONSTANTS[123]*CONSTANTS[114]))*log(CONSTANTS[64]/STATES[12]);
ALGEBRAIC[44] =  CONSTANTS[67]*STATES[23]*( 0.886000*STATES[24]+ 0.114000*STATES[25])*(STATES[17] - ALGEBRAIC[16]);
ALGEBRAIC[48] =  CONSTANTS[68]*STATES[26]*STATES[27]*(STATES[17] - ALGEBRAIC[16]);
ALGEBRAIC[49] = 1.02000/(1.00000+exp( 0.238500*((STATES[17] - ALGEBRAIC[16]) - 59.2150)));
ALGEBRAIC[50] = ( 0.491240*exp( 0.0803200*((STATES[17]+5.47600) - ALGEBRAIC[16]))+exp( 0.0617500*((STATES[17] - ALGEBRAIC[16]) - 594.310)))/(1.00000+exp( - 0.514300*((STATES[17] - ALGEBRAIC[16])+4.75300)));
ALGEBRAIC[51] = ALGEBRAIC[49]/(ALGEBRAIC[49]+ALGEBRAIC[50]);
ALGEBRAIC[52] =  CONSTANTS[69]* pow((CONSTANTS[64]/5.40000), 1.0 / 2)*ALGEBRAIC[51]*(STATES[17] - ALGEBRAIC[16]);
ALGEBRAIC[53] = 1.00000/(1.00000+exp((7.48800 - STATES[17])/5.98000));
ALGEBRAIC[54] =  CONSTANTS[70]*ALGEBRAIC[53]*(STATES[17] - ALGEBRAIC[16]);
ALGEBRAIC[64] = ((ALGEBRAIC[44]+ALGEBRAIC[48]+ALGEBRAIC[52]+ALGEBRAIC[54]) -  2.00000*ALGEBRAIC[59])+ALGEBRAIC[37];
ALGEBRAIC[60] = ( CONSTANTS[87]*STATES[13])/(CONSTANTS[88]+STATES[13]);
ALGEBRAIC[17] =  (1.00000/( CONSTANTS[123]*CONSTANTS[115]))*log(CONSTANTS[65]/STATES[13]);
ALGEBRAIC[61] =  CONSTANTS[89]*(STATES[17] - ALGEBRAIC[17]);
ALGEBRAIC[65] = (ALGEBRAIC[36]+ALGEBRAIC[61]+ALGEBRAIC[60]) -  2.00000*ALGEBRAIC[57];
ALGEBRAIC[66] = STATES[29]+0.00200000;
ALGEBRAIC[67] = 1.00000 - exp(- ALGEBRAIC[66]/CONSTANTS[96]);
ALGEBRAIC[68] = exp(- ALGEBRAIC[66]/CONSTANTS[97]);
ALGEBRAIC[69] = CONSTANTS[98]/(1.00000+exp((ALGEBRAIC[65]+5.00000)/0.900000));
ALGEBRAIC[70] =  ALGEBRAIC[69]*ALGEBRAIC[67]*ALGEBRAIC[68]*(STATES[28] - STATES[13]);
ALGEBRAIC[8] = ALGEBRAIC[4]/CONSTANTS[36];
ALGEBRAIC[71] = ( CONSTANTS[94]*(1.00000+ 2.00000*ALGEBRAIC[8]))/(1.00000+ 2.00000*CONSTANTS[119]);
ALGEBRAIC[72] = ( CONSTANTS[93]*pow(STATES[13], 2.00000))/(pow(ALGEBRAIC[71], 2.00000)+pow(STATES[13], 2.00000));
ALGEBRAIC[73] = ( CONSTANTS[93]*STATES[30])/CONSTANTS[95];
ALGEBRAIC[74] = (STATES[30] - STATES[28])/CONSTANTS[104];
ALGEBRAIC[75] = 1.00000/(1.00000+( CONSTANTS[102]*CONSTANTS[103])/pow(CONSTANTS[103]+STATES[28], 2.00000));
ALGEBRAIC[77] = ( CONSTANTS[105]*CONSTANTS[108])/pow(CONSTANTS[108]+STATES[13], 2.00000);
ALGEBRAIC[78] = ( CONSTANTS[106]*CONSTANTS[109])/pow(CONSTANTS[109]+STATES[13], 2.00000);
ALGEBRAIC[79] = ( CONSTANTS[107]*CONSTANTS[110])/pow(CONSTANTS[110]+STATES[13], 2.00000);
ALGEBRAIC[80] = 1.00000/(1.00000+ALGEBRAIC[78]+ALGEBRAIC[77]+ALGEBRAIC[77]+ALGEBRAIC[79]);
}
void
getStateInformation(double* SI)
{
SI[31] = 0.0;
SI[32] = 0.0;
SI[33] = 0.0;
SI[34] = 0.0;
SI[35] = 0.0;
SI[36] = 0.0;
SI[37] = 0.0;
SI[38] = 0.0;
SI[39] = 0.0;
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[40] = 0.0;
SI[41] = 0.0;
SI[42] = 0.0;
SI[43] = 0.0;
SI[44] = 0.0;
SI[6] = 1.0;
SI[45] = 0.0;
SI[46] = 0.0;
SI[47] = 0.0;
SI[48] = 0.0;
SI[49] = 0.0;
SI[50] = 0.0;
SI[51] = 0.0;
SI[52] = 0.0;
SI[53] = 0.0;
SI[54] = 0.0;
SI[55] = 0.0;
SI[56] = 0.0;
SI[57] = 0.0;
SI[58] = 0.0;
SI[59] = 0.0;
SI[60] = 0.0;
SI[61] = 0.0;
SI[62] = 0.0;
SI[63] = 0.0;
SI[7] = 1.0;
SI[8] = 1.0;
SI[64] = 0.0;
SI[65] = 0.0;
SI[66] = 0.0;
SI[67] = 0.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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
CONDVAR[0] = STATES[17] - - 40.0000;
CONDVAR[1] = STATES[17] - - 40.0000;
CONDVAR[2] = STATES[17] - - 40.0000;
CONDVAR[3] = STATES[17] - - 40.0000;
CONDVAR[4] = VOI - 59.1000;
CONDVAR[5] = VOI - 59.5000;
CONDVAR[6] =  - 1000.00*((ALGEBRAIC[65]+ALGEBRAIC[64]+ALGEBRAIC[63]) - CONSTANTS[126]) - 30000.0;
}

void objfunc_0(double *p, double *hx, int m, int n, void *adata)
{
  struct rootfind_info* rfi = (struct rootfind_info*)adata;
#define VOI rfi->aVOI
#define CONSTANTS rfi->aCONSTANTS
#define RATES rfi->aRATES
#define STATES rfi->aSTATES
#define ALGEBRAIC rfi->aALGEBRAIC
#define pret rfi->aPRET
  CONSTANTS[127] = p[0];
  CONSTANTS[128] = p[1];
  CONSTANTS[129] = p[2];
  hx[0] = CONSTANTS[129] - ( CONSTANTS[127]*CONSTANTS[128])/CONSTANTS[28];
  hx[1] = CONSTANTS[127] - (CONSTANTS[15] - CONSTANTS[129]);
  hx[2] = CONSTANTS[128] - (CONSTANTS[16] - CONSTANTS[129]);
#undef VOI
#undef CONSTANTS
#undef RATES
#undef STATES
#undef ALGEBRAIC
#undef pret
}
void rootfind_0(double VOI, double* CONSTANTS, double* RATES,
double* STATES, double* ALGEBRAIC, int* pret)
{
  static double p[3] = {0.0389,0,0.1};
  double bp[3], work[LM_DIF_WORKSZ(3, 3)];
  struct rootfind_info rfi;
  rfi.aVOI = VOI;
  rfi.aCONSTANTS = CONSTANTS;
  rfi.aRATES = RATES;
  rfi.aSTATES = STATES;
  rfi.aALGEBRAIC = ALGEBRAIC;
  rfi.aPRET = pret;
  do_levmar(objfunc_0, p, bp, work, pret, 3, &rfi);
  CONSTANTS[127] = p[0];
  CONSTANTS[128] = p[1];
  CONSTANTS[129] = p[2];
}