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 114 entries in the algebraic variable array.
   There are a total of 39 entries in each of the rate and state variable arrays.
   There are a total of 128 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (msec).
 * STATES[0] is V_m in component membrane_potential (mV).
 * CONSTANTS[4] is epi in component parameters (dimensionless).
 * CONSTANTS[5] is R in component parameters (joule_per_kelvin_per_kilomole).
 * CONSTANTS[99] is Frdy in component parameters (coulomb_per_mole).
 * CONSTANTS[109] is Temp in component parameters (kelvin).
 * CONSTANTS[113] is FoRT in component parameters (per_mV).
 * CONSTANTS[6] is Cmem in component parameters (farad).
 * CONSTANTS[114] is Qpow in component parameters (dimensionless).
 * CONSTANTS[7] is cellLength in component parameters (um).
 * CONSTANTS[100] is cellRadius in component parameters (um).
 * CONSTANTS[8] is junctionLength in component parameters (um).
 * CONSTANTS[101] is junctionRadius in component parameters (um).
 * CONSTANTS[9] is distSLcyto in component parameters (um).
 * CONSTANTS[10] is distJuncSL in component parameters (um).
 * CONSTANTS[11] is DcaJuncSL in component parameters (cm2_per_sec).
 * CONSTANTS[12] is DcaSLcyto in component parameters (cm2_per_sec).
 * CONSTANTS[13] is DnaJuncSL in component parameters (cm2_per_sec).
 * CONSTANTS[14] is DnaSLcyto in component parameters (cm2_per_sec).
 * CONSTANTS[110] is Vcell in component parameters (liter).
 * CONSTANTS[115] is Vmyo in component parameters (liter).
 * CONSTANTS[116] is Vsr in component parameters (liter).
 * CONSTANTS[117] is Vsl in component parameters (liter).
 * CONSTANTS[118] is Vjunc in component parameters (liter).
 * CONSTANTS[111] is SAjunc in component parameters (um2).
 * CONSTANTS[112] is SAsl in component parameters (um2).
 * CONSTANTS[15] is J_ca_juncsl in component parameters (liters_per_msec).
 * CONSTANTS[16] is J_ca_slmyo in component parameters (liters_per_msec).
 * CONSTANTS[17] is J_na_juncsl in component parameters (liters_per_msec).
 * CONSTANTS[18] is J_na_slmyo in component parameters (liters_per_msec).
 * CONSTANTS[19] is Fjunc in component parameters (dimensionless).
 * CONSTANTS[102] is Fsl in component parameters (dimensionless).
 * CONSTANTS[20] is Fjunc_CaL in component parameters (dimensionless).
 * CONSTANTS[103] is Fsl_CaL in component parameters (dimensionless).
 * CONSTANTS[119] is Cli in component parameters (mM).
 * CONSTANTS[120] is Clo in component parameters (mM).
 * CONSTANTS[21] is Ko in component parameters (mM).
 * CONSTANTS[22] is Nao in component parameters (mM).
 * CONSTANTS[23] is Cao in component parameters (mM).
 * CONSTANTS[24] is Mgi in component parameters (mM).
 * ALGEBRAIC[0] is ena_junc in component parameters (mV).
 * ALGEBRAIC[1] is ena_sl in component parameters (mV).
 * ALGEBRAIC[2] is ek in component parameters (mV).
 * ALGEBRAIC[3] is eca_junc in component parameters (mV).
 * ALGEBRAIC[4] is eca_sl in component parameters (mV).
 * CONSTANTS[126] is ecl in component parameters (mV).
 * CONSTANTS[25] is GNa in component parameters (mS_per_uF).
 * CONSTANTS[26] is GNaB in component parameters (mS_per_uF).
 * CONSTANTS[27] is IbarNaK in component parameters (uA_per_uF).
 * CONSTANTS[28] is KmNaip in component parameters (mM).
 * CONSTANTS[29] is KmKo in component parameters (mM).
 * CONSTANTS[30] is Q10NaK in component parameters (dimensionless).
 * CONSTANTS[31] is Q10KmNai in component parameters (dimensionless).
 * CONSTANTS[32] is pNaK in component parameters (dimensionless).
 * CONSTANTS[33] is gkp in component parameters (mS_per_uF).
 * CONSTANTS[34] is GClCa in component parameters (mS_per_uF).
 * CONSTANTS[35] is GClB in component parameters (mS_per_uF).
 * CONSTANTS[36] is KdClCa in component parameters (mM).
 * CONSTANTS[37] is pNa in component parameters (cm_per_sec).
 * CONSTANTS[38] is pCa in component parameters (cm_per_sec).
 * CONSTANTS[39] is pK in component parameters (cm_per_sec).
 * CONSTANTS[40] is Q10CaL in component parameters (dimensionless).
 * CONSTANTS[41] is IbarNCX in component parameters (uA_per_uF).
 * CONSTANTS[42] is KmCai in component parameters (mM).
 * CONSTANTS[43] is KmCao in component parameters (mM).
 * CONSTANTS[44] is KmNai in component parameters (mM).
 * CONSTANTS[45] is KmNao in component parameters (mM).
 * CONSTANTS[46] is ksat in component parameters (dimensionless).
 * CONSTANTS[47] is nu in component parameters (dimensionless).
 * CONSTANTS[48] is Kdact in component parameters (mM).
 * CONSTANTS[49] is Q10NCX in component parameters (dimensionless).
 * CONSTANTS[50] is IbarSLCaP in component parameters (uA_per_uF).
 * CONSTANTS[51] is KmPCa in component parameters (mM).
 * CONSTANTS[52] is GCaB in component parameters (mS_per_uF).
 * CONSTANTS[53] is Q10SLCaP in component parameters (dimensionless).
 * CONSTANTS[54] is Q10SRCaP in component parameters (dimensionless).
 * CONSTANTS[55] is Vmax_SRCaP in component parameters (mM_per_msec).
 * CONSTANTS[56] is Kmf in component parameters (mM).
 * CONSTANTS[57] is Kmr in component parameters (mM).
 * CONSTANTS[58] is hillSRCaP in component parameters (dimensionless).
 * CONSTANTS[59] is ks in component parameters (per_msec).
 * CONSTANTS[60] is koCa in component parameters (per_mM2_per_msec).
 * CONSTANTS[61] is kom in component parameters (per_msec).
 * CONSTANTS[108] is kiCa in component parameters (per_mM_per_msec).
 * CONSTANTS[62] is kim in component parameters (per_msec).
 * CONSTANTS[63] is ec50SR in component parameters (mM).
 * CONSTANTS[64] is Bmax_Naj in component parameters (mM).
 * CONSTANTS[65] is Bmax_Nasl in component parameters (mM).
 * CONSTANTS[66] is koff_na in component parameters (per_msec).
 * CONSTANTS[67] is kon_na in component parameters (per_mM_per_msec).
 * CONSTANTS[68] is Bmax_TnClow in component parameters (mM).
 * CONSTANTS[69] is koff_tncl in component parameters (per_msec).
 * CONSTANTS[70] is kon_tncl in component parameters (per_mM_per_msec).
 * CONSTANTS[71] is Bmax_TnChigh in component parameters (mM).
 * CONSTANTS[72] is koff_tnchca in component parameters (per_msec).
 * CONSTANTS[73] is kon_tnchca in component parameters (per_mM_per_msec).
 * CONSTANTS[74] is koff_tnchmg in component parameters (per_msec).
 * CONSTANTS[75] is kon_tnchmg in component parameters (per_mM_per_msec).
 * CONSTANTS[76] is Bmax_CaM in component parameters (mM).
 * CONSTANTS[77] is koff_cam in component parameters (per_msec).
 * CONSTANTS[78] is kon_cam in component parameters (per_mM_per_msec).
 * CONSTANTS[79] is Bmax_myosin in component parameters (mM).
 * CONSTANTS[80] is koff_myoca in component parameters (per_msec).
 * CONSTANTS[81] is kon_myoca in component parameters (per_mM_per_msec).
 * CONSTANTS[82] is koff_myomg in component parameters (per_msec).
 * CONSTANTS[83] is kon_myomg in component parameters (per_mM_per_msec).
 * CONSTANTS[84] is Bmax_SR in component parameters (mM).
 * CONSTANTS[85] is koff_sr in component parameters (per_msec).
 * CONSTANTS[86] is kon_sr in component parameters (per_mM_per_msec).
 * CONSTANTS[121] is Bmax_SLlowsl in component parameters (mM).
 * CONSTANTS[122] is Bmax_SLlowj in component parameters (mM).
 * CONSTANTS[87] is koff_sll in component parameters (per_msec).
 * CONSTANTS[88] is kon_sll in component parameters (per_mM_per_msec).
 * CONSTANTS[123] is Bmax_SLhighsl in component parameters (mM).
 * CONSTANTS[124] is Bmax_SLhighj in component parameters (mM).
 * CONSTANTS[89] is koff_slh in component parameters (per_msec).
 * CONSTANTS[90] is kon_slh in component parameters (per_mM_per_msec).
 * CONSTANTS[125] is Bmax_Csqn in component parameters (mM).
 * CONSTANTS[91] is koff_csqn in component parameters (per_msec).
 * CONSTANTS[92] is kon_csqn in component parameters (per_mM_per_msec).
 * STATES[1] is Na_j in component Na_Concentrations (mM).
 * STATES[2] is Na_sl in component Na_Concentrations (mM).
 * STATES[3] is K_i in component K_Concentration (mM).
 * STATES[4] is Ca_j in component Ca_Concentrations (mM).
 * STATES[5] is Ca_sl in component Ca_Concentrations (mM).
 * ALGEBRAIC[5] is mss in component I_Na (dimensionless).
 * ALGEBRAIC[6] is taum in component I_Na (msec).
 * ALGEBRAIC[7] is ah in component I_Na (dimensionless).
 * ALGEBRAIC[8] is bh in component I_Na (dimensionless).
 * ALGEBRAIC[9] is tauh in component I_Na (msec).
 * ALGEBRAIC[10] is hss in component I_Na (dimensionless).
 * ALGEBRAIC[11] is aj in component I_Na (dimensionless).
 * ALGEBRAIC[12] is bj in component I_Na (dimensionless).
 * ALGEBRAIC[13] is tauj in component I_Na (msec).
 * ALGEBRAIC[14] is jss in component I_Na (dimensionless).
 * STATES[6] is m in component I_Na (dimensionless).
 * STATES[7] is h in component I_Na (dimensionless).
 * STATES[8] is j in component I_Na (dimensionless).
 * ALGEBRAIC[15] is I_Na_junc in component I_Na (uA_per_uF).
 * ALGEBRAIC[16] is I_Na_sl in component I_Na (uA_per_uF).
 * ALGEBRAIC[17] is I_Na in component I_Na (uA_per_uF).
 * ALGEBRAIC[18] is I_nabk_junc in component I_NaBK (uA_per_uF).
 * ALGEBRAIC[19] is I_nabk_sl in component I_NaBK (uA_per_uF).
 * ALGEBRAIC[20] is I_nabk in component I_NaBK (uA_per_uF).
 * CONSTANTS[104] is sigma in component I_NaK (dimensionless).
 * ALGEBRAIC[21] is fnak in component I_NaK (dimensionless).
 * ALGEBRAIC[22] is I_nak_junc in component I_NaK (uA_per_uF).
 * ALGEBRAIC[23] is I_nak_sl in component I_NaK (uA_per_uF).
 * ALGEBRAIC[24] is I_nak in component I_NaK (uA_per_uF).
 * CONSTANTS[105] is gkr in component I_Kr (mS_per_uF).
 * ALGEBRAIC[25] is xrss in component I_Kr (dimensionless).
 * ALGEBRAIC[26] is tauxr in component I_Kr (msec).
 * STATES[9] is x_kr in component I_Kr (dimensionless).
 * ALGEBRAIC[27] is rkr in component I_Kr (dimensionless).
 * ALGEBRAIC[28] is I_kr in component I_Kr (uA_per_uF).
 * ALGEBRAIC[29] is kp_kp in component I_Kp (dimensionless).
 * ALGEBRAIC[30] is I_kp_junc in component I_Kp (uA_per_uF).
 * ALGEBRAIC[31] is I_kp_sl in component I_Kp (uA_per_uF).
 * ALGEBRAIC[32] is I_kp in component I_Kp (uA_per_uF).
 * ALGEBRAIC[33] is eks in component I_Ks (mV).
 * CONSTANTS[93] is gks_junc in component I_Ks (mS_per_uF).
 * CONSTANTS[94] is gks_sl in component I_Ks (mS_per_uF).
 * ALGEBRAIC[34] is xsss in component I_Ks (dimensionless).
 * ALGEBRAIC[35] is tauxs in component I_Ks (msec).
 * STATES[10] is x_ks in component I_Ks (dimensionless).
 * ALGEBRAIC[36] is I_ks_junc in component I_Ks (uA_per_uF).
 * ALGEBRAIC[37] is I_ks_sl in component I_Ks (uA_per_uF).
 * ALGEBRAIC[38] is I_ks in component I_Ks (uA_per_uF).
 * STATES[11] is Na_i in component Na_Concentrations (mM).
 * CONSTANTS[106] is GtoSlow in component I_to (mS_per_uF).
 * CONSTANTS[107] is GtoFast in component I_to (mS_per_uF).
 * ALGEBRAIC[39] is xtoss in component I_to (dimensionless).
 * ALGEBRAIC[40] is ytoss in component I_to (dimensionless).
 * ALGEBRAIC[41] is tauxtos in component I_to (msec).
 * ALGEBRAIC[42] is tauytos in component I_to (msec).
 * STATES[12] is x_to_s in component I_to (dimensionless).
 * STATES[13] is y_to_s in component I_to (dimensionless).
 * ALGEBRAIC[43] is I_tos in component I_to (uA_per_uF).
 * ALGEBRAIC[44] is tauxtof in component I_to (msec).
 * ALGEBRAIC[45] is tauytof in component I_to (msec).
 * STATES[14] is x_to_f in component I_to (dimensionless).
 * STATES[15] is y_to_f in component I_to (dimensionless).
 * ALGEBRAIC[46] is I_tof in component I_to (uA_per_uF).
 * ALGEBRAIC[47] is I_to in component I_to (uA_per_uF).
 * ALGEBRAIC[48] is aki in component I_Ki (dimensionless).
 * ALGEBRAIC[49] is bki in component I_Ki (dimensionless).
 * ALGEBRAIC[50] is kiss in component I_Ki (dimensionless).
 * ALGEBRAIC[51] is I_ki in component I_Ki (uA_per_uF).
 * ALGEBRAIC[52] is I_ClCa_junc in component I_ClCa (uA_per_uF).
 * ALGEBRAIC[53] is I_ClCa_sl in component I_ClCa (uA_per_uF).
 * ALGEBRAIC[54] is I_ClCa in component I_ClCa (uA_per_uF).
 * ALGEBRAIC[55] is I_Clbk in component I_ClCa (uA_per_uF).
 * ALGEBRAIC[56] is fss in component I_Ca (dimensionless).
 * ALGEBRAIC[57] is dss in component I_Ca (dimensionless).
 * ALGEBRAIC[58] is taud in component I_Ca (msec).
 * ALGEBRAIC[59] is tauf in component I_Ca (msec).
 * STATES[16] is d in component I_Ca (dimensionless).
 * STATES[17] is f in component I_Ca (dimensionless).
 * STATES[18] is f_Ca_Bj in component I_Ca (dimensionless).
 * STATES[19] is f_Ca_Bsl in component I_Ca (dimensionless).
 * CONSTANTS[95] is fcaCaMSL in component I_Ca (dimensionless).
 * CONSTANTS[96] is fcaCaj in component I_Ca (dimensionless).
 * ALGEBRAIC[60] is ibarca_j in component I_Ca (uA_per_uF).
 * ALGEBRAIC[61] is ibarca_sl in component I_Ca (uA_per_uF).
 * ALGEBRAIC[62] is ibark in component I_Ca (uA_per_uF).
 * ALGEBRAIC[63] is ibarna_j in component I_Ca (uA_per_uF).
 * ALGEBRAIC[64] is ibarna_sl in component I_Ca (uA_per_uF).
 * ALGEBRAIC[65] is I_Ca_junc in component I_Ca (uA_per_uF).
 * ALGEBRAIC[66] is I_Ca_sl in component I_Ca (uA_per_uF).
 * ALGEBRAIC[67] is I_Ca in component I_Ca (uA_per_uF).
 * ALGEBRAIC[68] is I_CaK in component I_Ca (uA_per_uF).
 * ALGEBRAIC[69] is I_CaNa_junc in component I_Ca (uA_per_uF).
 * ALGEBRAIC[70] is I_CaNa_sl in component I_Ca (uA_per_uF).
 * ALGEBRAIC[71] is I_CaNa in component I_Ca (uA_per_uF).
 * ALGEBRAIC[72] is I_Catot in component I_Ca (uA_per_uF).
 * ALGEBRAIC[73] is Ka_junc in component I_NCX (dimensionless).
 * ALGEBRAIC[74] is Ka_sl in component I_NCX (dimensionless).
 * ALGEBRAIC[75] is s1_junc in component I_NCX (mM4).
 * ALGEBRAIC[76] is s1_sl in component I_NCX (mM4).
 * ALGEBRAIC[77] is s2_junc in component I_NCX (mM4).
 * ALGEBRAIC[78] is s3_junc in component I_NCX (mM4).
 * ALGEBRAIC[79] is s2_sl in component I_NCX (mM4).
 * ALGEBRAIC[80] is s3_sl in component I_NCX (mM4).
 * ALGEBRAIC[81] is I_ncx_junc in component I_NCX (uA_per_uF).
 * ALGEBRAIC[82] is I_ncx_sl in component I_NCX (uA_per_uF).
 * ALGEBRAIC[83] is I_ncx in component I_NCX (uA_per_uF).
 * ALGEBRAIC[84] is I_pca_junc in component I_PCa (uA_per_uF).
 * ALGEBRAIC[85] is I_pca_sl in component I_PCa (uA_per_uF).
 * ALGEBRAIC[86] is I_pca in component I_PCa (uA_per_uF).
 * ALGEBRAIC[87] is I_cabk_junc in component I_CaBK (uA_per_uF).
 * ALGEBRAIC[88] is I_cabk_sl in component I_CaBK (uA_per_uF).
 * ALGEBRAIC[89] is I_cabk in component I_CaBK (uA_per_uF).
 * CONSTANTS[97] is MaxSR in component SR_Fluxes (dimensionless).
 * CONSTANTS[98] is MinSR in component SR_Fluxes (dimensionless).
 * ALGEBRAIC[90] is kCaSR in component SR_Fluxes (dimensionless).
 * ALGEBRAIC[91] is koSRCa in component SR_Fluxes (per_mM2_per_msec).
 * ALGEBRAIC[92] is kiSRCa in component SR_Fluxes (per_mM_per_msec).
 * ALGEBRAIC[93] is RI in component SR_Fluxes (mM).
 * STATES[20] is Ry_Rr in component SR_Fluxes (mM).
 * STATES[21] is Ry_Ro in component SR_Fluxes (mM).
 * STATES[22] is Ry_Ri in component SR_Fluxes (mM).
 * ALGEBRAIC[94] is J_SRCarel in component SR_Fluxes (mM_per_msec).
 * ALGEBRAIC[95] is J_serca in component SR_Fluxes (mM_per_msec).
 * ALGEBRAIC[96] is J_SRleak in component SR_Fluxes (mM_per_msec).
 * STATES[23] is Ca_sr in component SR_Ca_Concentrations (mM).
 * STATES[24] is Ca_i in component Ca_Concentrations (mM).
 * STATES[25] is Na_Bj in component Na_Buffers (mM).
 * STATES[26] is Na_Bsl in component Na_Buffers (mM).
 * ALGEBRAIC[97] is dNa_Bj_dt in component Na_Buffers (mM_per_msec).
 * ALGEBRAIC[98] is dNa_Bsl_dt in component Na_Buffers (mM_per_msec).
 * STATES[27] is Tn_CL in component Cytosolic_Ca_Buffers (mM).
 * STATES[28] is Tn_CHc in component Cytosolic_Ca_Buffers (mM).
 * STATES[29] is Tn_CHm in component Cytosolic_Ca_Buffers (mM).
 * STATES[30] is CaM in component Cytosolic_Ca_Buffers (mM).
 * STATES[31] is Myo_c in component Cytosolic_Ca_Buffers (mM).
 * STATES[32] is Myo_m in component Cytosolic_Ca_Buffers (mM).
 * STATES[33] is SRB in component Cytosolic_Ca_Buffers (mM).
 * ALGEBRAIC[99] is J_CaB_cytosol in component Cytosolic_Ca_Buffers (mM_per_msec).
 * STATES[34] is SLL_j in component Junctional_and_SL_Ca_Buffers (mM).
 * STATES[35] is SLL_sl in component Junctional_and_SL_Ca_Buffers (mM).
 * STATES[36] is SLH_j in component Junctional_and_SL_Ca_Buffers (mM).
 * STATES[37] is SLH_sl in component Junctional_and_SL_Ca_Buffers (mM).
 * ALGEBRAIC[100] is J_CaB_junction in component Junctional_and_SL_Ca_Buffers (mM_per_msec).
 * ALGEBRAIC[101] is J_CaB_sl in component Junctional_and_SL_Ca_Buffers (mM_per_msec).
 * STATES[38] is Csqn_b in component SR_Ca_Concentrations (mM).
 * ALGEBRAIC[102] is I_Na_tot_junc in component Na_Concentrations (uA_per_uF).
 * ALGEBRAIC[103] is I_Na_tot_sl in component Na_Concentrations (uA_per_uF).
 * ALGEBRAIC[104] is I_Na_tot_sl2 in component Na_Concentrations (uA_per_uF).
 * ALGEBRAIC[105] is I_Na_tot_junc2 in component Na_Concentrations (uA_per_uF).
 * ALGEBRAIC[106] is I_K_tot in component K_Concentration (uA_per_uF).
 * ALGEBRAIC[107] is I_Ca_tot_junc in component Ca_Concentrations (uA_per_uF).
 * ALGEBRAIC[108] is I_Ca_tot_sl in component Ca_Concentrations (uA_per_uF).
 * ALGEBRAIC[110] is I_Na_tot in component membrane_potential (uA_per_uF).
 * ALGEBRAIC[111] is I_Cl_tot in component membrane_potential (uA_per_uF).
 * ALGEBRAIC[112] is I_Ca_tot in component membrane_potential (uA_per_uF).
 * ALGEBRAIC[113] is I_tot in component membrane_potential (uA_per_uF).
 * ALGEBRAIC[109] is i_Stim in component membrane_potential (uA_per_uF).
 * CONSTANTS[0] is stim_start in component membrane_potential (msec).
 * CONSTANTS[1] is stim_period in component membrane_potential (msec).
 * CONSTANTS[2] is stim_duration in component membrane_potential (msec).
 * CONSTANTS[3] is stim_amplitude in component membrane_potential (uA_per_uF).
 * RATES[6] is d/dt m in component I_Na (dimensionless).
 * RATES[7] is d/dt h in component I_Na (dimensionless).
 * RATES[8] is d/dt j in component I_Na (dimensionless).
 * RATES[9] is d/dt x_kr in component I_Kr (dimensionless).
 * RATES[10] is d/dt x_ks in component I_Ks (dimensionless).
 * RATES[12] is d/dt x_to_s in component I_to (dimensionless).
 * RATES[13] is d/dt y_to_s in component I_to (dimensionless).
 * RATES[14] is d/dt x_to_f in component I_to (dimensionless).
 * RATES[15] is d/dt y_to_f in component I_to (dimensionless).
 * RATES[16] is d/dt d in component I_Ca (dimensionless).
 * RATES[17] is d/dt f in component I_Ca (dimensionless).
 * RATES[18] is d/dt f_Ca_Bj in component I_Ca (dimensionless).
 * RATES[19] is d/dt f_Ca_Bsl in component I_Ca (dimensionless).
 * RATES[20] is d/dt Ry_Rr in component SR_Fluxes (mM).
 * RATES[21] is d/dt Ry_Ro in component SR_Fluxes (mM).
 * RATES[22] is d/dt Ry_Ri in component SR_Fluxes (mM).
 * RATES[25] is d/dt Na_Bj in component Na_Buffers (mM).
 * RATES[26] is d/dt Na_Bsl in component Na_Buffers (mM).
 * RATES[27] is d/dt Tn_CL in component Cytosolic_Ca_Buffers (mM).
 * RATES[28] is d/dt Tn_CHc in component Cytosolic_Ca_Buffers (mM).
 * RATES[29] is d/dt Tn_CHm in component Cytosolic_Ca_Buffers (mM).
 * RATES[30] is d/dt CaM in component Cytosolic_Ca_Buffers (mM).
 * RATES[31] is d/dt Myo_c in component Cytosolic_Ca_Buffers (mM).
 * RATES[32] is d/dt Myo_m in component Cytosolic_Ca_Buffers (mM).
 * RATES[33] is d/dt SRB in component Cytosolic_Ca_Buffers (mM).
 * RATES[34] is d/dt SLL_j in component Junctional_and_SL_Ca_Buffers (mM).
 * RATES[35] is d/dt SLL_sl in component Junctional_and_SL_Ca_Buffers (mM).
 * RATES[36] is d/dt SLH_j in component Junctional_and_SL_Ca_Buffers (mM).
 * RATES[37] is d/dt SLH_sl in component Junctional_and_SL_Ca_Buffers (mM).
 * RATES[38] is d/dt Csqn_b in component SR_Ca_Concentrations (mM).
 * RATES[23] is d/dt Ca_sr in component SR_Ca_Concentrations (mM).
 * RATES[1] is d/dt Na_j in component Na_Concentrations (mM).
 * RATES[2] is d/dt Na_sl in component Na_Concentrations (mM).
 * RATES[11] is d/dt Na_i in component Na_Concentrations (mM).
 * RATES[3] is d/dt K_i in component K_Concentration (mM).
 * RATES[4] is d/dt Ca_j in component Ca_Concentrations (mM).
 * RATES[5] is d/dt Ca_sl in component Ca_Concentrations (mM).
 * RATES[24] is d/dt Ca_i in component Ca_Concentrations (mM).
 * RATES[0] is d/dt V_m in component membrane_potential (mV).
 * There are a total of 6 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = -81.4552030512661;
STATES[1] = 8.40537012592918;
STATES[2] = 8.40491910001025;
STATES[3] = 120;
STATES[4] = 0.000175882395147342;
STATES[5] = 0.000106779509977354;
STATES[6] = 0.003793087414436;
STATES[7] = 0.626221949492493;
STATES[8] = 0.624553572490432;
STATES[9] = 0.0210022533039071;
STATES[10] = 0.00428016666258923;
STATES[11] = 8.40513364344858;
STATES[12] = 0.000440445885642567;
STATES[13] = 0.785115828275182;
STATES[14] = 0.000440438103758954;
STATES[15] = 0.999995844038706;
STATES[16] = 2.92407183949469e-6;
STATES[17] = 0.995135796703515;
STATES[18] = 0.0246760872105795;
STATES[19] = 0.0152723084239416;
STATES[20] = 0.890806040818203;
STATES[21] = 7.40481128853622e-7;
STATES[22] = 9.07666168960848e-8;
STATES[23] = 0.554760499828172;
STATES[24] = 8.72509677797499e-5;
STATES[25] = 3.4543773303328;
STATES[26] = 0.753740951477775;
STATES[27] = 0.00893455096919132;
STATES[28] = 0.117412025936615;
STATES[29] = 0.0106160166692932;
STATES[30] = 0.000295573424135051;
STATES[31] = 0.00192322252438022;
STATES[32] = 0.137560495022823;
STATES[33] = 0.00217360235649355;
STATES[34] = 0.00740524521680039;
STATES[35] = 0.00990339304377132;
STATES[36] = 0.0735890020284214;
STATES[37] = 0.114583623436917;
STATES[38] = 1.19723145924432;
CONSTANTS[0] = 10;
CONSTANTS[1] = 1000;
CONSTANTS[2] = 5;
CONSTANTS[3] = 9.5;
CONSTANTS[4] = 1.00000;
CONSTANTS[5] = 8314.00;
CONSTANTS[6] = 1.38100e-10;
CONSTANTS[7] = 100.000;
CONSTANTS[8] = 0.160000;
CONSTANTS[9] = 0.450000;
CONSTANTS[10] = 0.500000;
CONSTANTS[11] = 1.64000e-06;
CONSTANTS[12] = 1.22000e-06;
CONSTANTS[13] = 1.09000e-05;
CONSTANTS[14] = 1.79000e-05;
CONSTANTS[15] = 8.24130e-13;
CONSTANTS[16] = 3.72430e-12;
CONSTANTS[17] = 1.83130e-14;
CONSTANTS[18] = 1.63860e-12;
CONSTANTS[19] = 0.110000;
CONSTANTS[20] = 0.900000;
CONSTANTS[21] = 5.40000;
CONSTANTS[22] = 140.000;
CONSTANTS[23] = 1.80000;
CONSTANTS[24] = 1.00000;
CONSTANTS[25] = 23.0000;
CONSTANTS[26] = 0.000597000;
CONSTANTS[27] =  1.00000*1.80000;
CONSTANTS[28] = 11.0000;
CONSTANTS[29] = 1.50000;
CONSTANTS[30] = 1.63000;
CONSTANTS[31] = 1.39000;
CONSTANTS[32] = 0.0183300;
CONSTANTS[33] =  2.00000*0.00100000;
CONSTANTS[34] =  0.500000*0.109625;
CONSTANTS[35] =  1.00000*0.00900000;
CONSTANTS[36] = 0.100000;
CONSTANTS[37] =  0.500000*1.50000e-08;
CONSTANTS[38] =  0.500000*0.000540000;
CONSTANTS[39] =  0.500000*2.70000e-07;
CONSTANTS[40] = 1.80000;
CONSTANTS[41] =  1.00000*4.50000;
CONSTANTS[42] = 0.00359000;
CONSTANTS[43] = 1.30000;
CONSTANTS[44] = 12.2900;
CONSTANTS[45] = 87.5000;
CONSTANTS[46] = 0.320000;
CONSTANTS[47] = 0.270000;
CONSTANTS[48] = 0.000150000;
CONSTANTS[49] = 1.57000;
CONSTANTS[50] = 0.0673000;
CONSTANTS[51] = 0.000500000;
CONSTANTS[52] = 0.000551300;
CONSTANTS[53] = 2.35000;
CONSTANTS[54] = 2.60000;
CONSTANTS[55] = 0.00531140;
CONSTANTS[56] = 0.000246000;
CONSTANTS[57] = 1.70000;
CONSTANTS[58] = 1.78700;
CONSTANTS[59] = 25.0000;
CONSTANTS[60] = 10.0000;
CONSTANTS[61] = 0.0600000;
CONSTANTS[62] = 0.00500000;
CONSTANTS[63] = 0.450000;
CONSTANTS[64] = 7.56100;
CONSTANTS[65] = 1.65000;
CONSTANTS[66] = 0.00100000;
CONSTANTS[67] = 0.000100000;
CONSTANTS[68] = 0.0700000;
CONSTANTS[69] = 0.0196000;
CONSTANTS[70] = 32.7000;
CONSTANTS[71] = 0.140000;
CONSTANTS[72] = 3.20000e-05;
CONSTANTS[73] = 2.37000;
CONSTANTS[74] = 0.00333000;
CONSTANTS[75] = 0.00300000;
CONSTANTS[76] = 0.0240000;
CONSTANTS[77] = 0.238000;
CONSTANTS[78] = 34.0000;
CONSTANTS[79] = 0.140000;
CONSTANTS[80] = 0.000460000;
CONSTANTS[81] = 13.8000;
CONSTANTS[82] = 5.70000e-05;
CONSTANTS[83] = 0.0157000;
CONSTANTS[84] =  19.0000*0.000900000;
CONSTANTS[85] = 0.0600000;
CONSTANTS[86] = 100.000;
CONSTANTS[87] = 1.30000;
CONSTANTS[88] = 100.000;
CONSTANTS[89] = 0.0300000;
CONSTANTS[90] = 100.000;
CONSTANTS[91] = 65.0000;
CONSTANTS[92] = 100.000;
CONSTANTS[93] = 0.00350000;
CONSTANTS[94] = 0.00350000;
CONSTANTS[95] = 0.00000;
CONSTANTS[96] = 0.00000;
CONSTANTS[97] = 15.0000;
CONSTANTS[98] = 1.00000;
CONSTANTS[127] = 0.00000;
CONSTANTS[99] = 96485.0;
CONSTANTS[100] = 10.2500;
CONSTANTS[101] = 0.0150000;
CONSTANTS[102] = 1.00000 - CONSTANTS[19];
CONSTANTS[103] = 1.00000 - CONSTANTS[20];
CONSTANTS[104] = (exp(CONSTANTS[22]/67.3000) - 1.00000)/7.00000;
CONSTANTS[105] =  0.0350000* pow((CONSTANTS[21]/5.40000), 1.0 / 2);
CONSTANTS[106] = (CONSTANTS[4]==1.00000 ?  1.00000*0.130000*0.120000 :  0.130000*0.300000*0.964000);
CONSTANTS[107] = (CONSTANTS[4]==1.00000 ?  1.00000*0.130000*0.880000 :  0.130000*0.300000*0.0360000);
CONSTANTS[108] = 0.500000;
CONSTANTS[109] = 310.000;
CONSTANTS[110] =   3.14159265358979*pow(CONSTANTS[100], 2.00000)*CONSTANTS[7]*1.00000e-15;
CONSTANTS[111] =  20150.0* 3.14159265358979*2.00000*CONSTANTS[8]*CONSTANTS[101];
CONSTANTS[112] =   3.14159265358979*2.00000*CONSTANTS[100]*CONSTANTS[7];
CONSTANTS[113] = CONSTANTS[99]/( CONSTANTS[5]*CONSTANTS[109]);
CONSTANTS[114] = (CONSTANTS[109] - 310.000)/10.0000;
CONSTANTS[115] =  0.650000*CONSTANTS[110];
CONSTANTS[116] =  0.0350000*CONSTANTS[110];
CONSTANTS[117] =  0.0200000*CONSTANTS[110];
CONSTANTS[118] =  0.0539000*0.0100000*CONSTANTS[110];
CONSTANTS[119] = 15.0000;
CONSTANTS[120] = 150.000;
CONSTANTS[121] = ( 0.0374000*CONSTANTS[115])/CONSTANTS[117];
CONSTANTS[122] =  (( 0.00460000*CONSTANTS[115])/CONSTANTS[118])*0.100000;
CONSTANTS[123] = ( 0.0134000*CONSTANTS[115])/CONSTANTS[117];
CONSTANTS[124] =  (( 0.00165000*CONSTANTS[115])/CONSTANTS[118])*0.100000;
CONSTANTS[125] = ( 0.140000*CONSTANTS[115])/CONSTANTS[116];
CONSTANTS[126] =  (1.00000/CONSTANTS[113])*log(CONSTANTS[119]/CONSTANTS[120]);
RATES[6] = 0.1;
RATES[7] = 0.1;
RATES[8] = 0.1;
RATES[9] = 0.1;
RATES[10] = 0.1;
RATES[12] = 0.1;
RATES[13] = 0.1;
RATES[14] = 0.1;
RATES[15] = 0.1;
RATES[16] = 0.1;
RATES[17] = 0.1;
RATES[18] = 0.1;
RATES[19] = 0.1;
RATES[20] = 0.1;
RATES[21] = 0.1;
RATES[22] = 0.1;
RATES[25] = 0.1;
RATES[26] = 0.1;
RATES[27] = 0.1;
RATES[28] = 0.1;
RATES[29] = 0.1;
RATES[30] = 0.1;
RATES[31] = 0.1;
RATES[32] = 0.1;
RATES[33] = 0.1;
RATES[34] = 0.1;
RATES[35] = 0.1;
RATES[36] = 0.1;
RATES[37] = 0.1;
RATES[38] = 0.1;
RATES[23] = 0.1;
RATES[1] = 0.1;
RATES[2] = 0.1;
RATES[11] = 0.1;
CONSTANTS[127] = 0.1;
RATES[4] = 0.1;
RATES[5] = 0.1;
RATES[24] = 0.1;
RATES[0] = 0.1;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[6] - (ALGEBRAIC[5] - STATES[6])/ALGEBRAIC[6];
resid[1] = RATES[7] - (ALGEBRAIC[10] - STATES[7])/ALGEBRAIC[9];
resid[2] = RATES[8] - (ALGEBRAIC[14] - STATES[8])/ALGEBRAIC[13];
resid[3] = RATES[9] - (ALGEBRAIC[25] - STATES[9])/ALGEBRAIC[26];
resid[4] = RATES[10] - (ALGEBRAIC[34] - STATES[10])/ALGEBRAIC[35];
resid[5] = RATES[12] - (ALGEBRAIC[39] - STATES[12])/ALGEBRAIC[41];
resid[6] = RATES[13] - (ALGEBRAIC[40] - STATES[13])/ALGEBRAIC[42];
resid[7] = RATES[14] - (ALGEBRAIC[39] - STATES[14])/ALGEBRAIC[44];
resid[8] = RATES[15] - (ALGEBRAIC[40] - STATES[15])/ALGEBRAIC[45];
resid[9] = RATES[16] - (ALGEBRAIC[57] - STATES[16])/ALGEBRAIC[58];
resid[10] = RATES[17] - (ALGEBRAIC[56] - STATES[17])/ALGEBRAIC[59];
resid[11] = RATES[18] -  (( 1.70000*STATES[4])/1.00000)*(1.00000 - STATES[18]) -  0.0119000*STATES[18];
resid[12] = RATES[19] -  (( 1.70000*STATES[5])/1.00000)*(1.00000 - STATES[19]) -  0.0119000*STATES[19];
resid[13] = RATES[20] - ( CONSTANTS[62]*ALGEBRAIC[93] -  ALGEBRAIC[92]*STATES[4]*STATES[20]) - ( ALGEBRAIC[91]*pow(STATES[4], 2.00000)*STATES[20] -  CONSTANTS[61]*STATES[21]);
resid[14] = RATES[21] - ( ALGEBRAIC[91]*pow(STATES[4], 2.00000)*STATES[20] -  CONSTANTS[61]*STATES[21]) - ( ALGEBRAIC[92]*STATES[4]*STATES[21] -  CONSTANTS[62]*STATES[22]);
resid[15] = RATES[22] - ( ALGEBRAIC[92]*STATES[4]*STATES[21] -  CONSTANTS[62]*STATES[22]) - ( CONSTANTS[61]*STATES[22] -  ALGEBRAIC[91]*pow(STATES[4], 2.00000)*ALGEBRAIC[93]);
resid[16] = RATES[25] - ALGEBRAIC[97];
resid[17] = RATES[26] - ALGEBRAIC[98];
resid[18] = RATES[27] -  CONSTANTS[70]*STATES[24]*(CONSTANTS[68] - STATES[27]) -  CONSTANTS[69]*STATES[27];
resid[19] = RATES[28] -  CONSTANTS[73]*STATES[24]*((CONSTANTS[71] - STATES[28]) - STATES[29]) -  CONSTANTS[72]*STATES[28];
resid[20] = RATES[29] -  CONSTANTS[75]*CONSTANTS[24]*((CONSTANTS[71] - STATES[28]) - STATES[29]) -  CONSTANTS[74]*STATES[29];
resid[21] = RATES[30] -  CONSTANTS[78]*STATES[24]*(CONSTANTS[76] - STATES[30]) -  CONSTANTS[77]*STATES[30];
resid[22] = RATES[31] -  CONSTANTS[81]*STATES[24]*((CONSTANTS[79] - STATES[31]) - STATES[32]) -  CONSTANTS[80]*STATES[31];
resid[23] = RATES[32] -  CONSTANTS[83]*CONSTANTS[24]*((CONSTANTS[79] - STATES[31]) - STATES[32]) -  CONSTANTS[82]*STATES[32];
resid[24] = RATES[33] -  CONSTANTS[86]*STATES[24]*(CONSTANTS[84] - STATES[33]) -  CONSTANTS[85]*STATES[33];
resid[25] = RATES[34] -  CONSTANTS[88]*STATES[4]*(CONSTANTS[122] - STATES[34]) -  CONSTANTS[87]*STATES[34];
resid[26] = RATES[35] -  CONSTANTS[88]*STATES[5]*(CONSTANTS[121] - STATES[35]) -  CONSTANTS[87]*STATES[35];
resid[27] = RATES[36] -  CONSTANTS[90]*STATES[4]*(CONSTANTS[124] - STATES[36]) -  CONSTANTS[89]*STATES[36];
resid[28] = RATES[37] -  CONSTANTS[90]*STATES[5]*(CONSTANTS[123] - STATES[37]) -  CONSTANTS[89]*STATES[37];
resid[29] = RATES[38] -  CONSTANTS[92]*STATES[23]*(CONSTANTS[125] - STATES[38]) -  CONSTANTS[91]*STATES[38];
resid[30] = RATES[23] - (ALGEBRAIC[95] - (( ALGEBRAIC[96]*CONSTANTS[115])/CONSTANTS[116]+ALGEBRAIC[94])) - ( CONSTANTS[92]*STATES[23]*(CONSTANTS[125] - STATES[38]) -  CONSTANTS[91]*STATES[38]);
resid[31] = RATES[1] - (( - ALGEBRAIC[102]*CONSTANTS[6])/( CONSTANTS[118]*CONSTANTS[99])+ (CONSTANTS[17]/CONSTANTS[118])*(STATES[2] - STATES[1])) - ALGEBRAIC[97];
resid[32] = RATES[2] - (( - ALGEBRAIC[103]*CONSTANTS[6])/( CONSTANTS[117]*CONSTANTS[99])+ (CONSTANTS[17]/CONSTANTS[117])*(STATES[1] - STATES[2])+ (CONSTANTS[18]/CONSTANTS[117])*(STATES[11] - STATES[2])) - ALGEBRAIC[98];
resid[33] = RATES[11] -  (CONSTANTS[18]/CONSTANTS[115])*(STATES[2] - STATES[11]);
resid[34] = RATES[4] - ((( - ALGEBRAIC[107]*CONSTANTS[6])/( CONSTANTS[118]*2.00000*CONSTANTS[99])+ (CONSTANTS[15]/CONSTANTS[118])*(STATES[5] - STATES[4])) - ALGEBRAIC[100])+( ALGEBRAIC[94]*CONSTANTS[116])/CONSTANTS[118]+( ALGEBRAIC[96]*CONSTANTS[115])/CONSTANTS[118];
resid[35] = RATES[5] - (( - ALGEBRAIC[108]*CONSTANTS[6])/( CONSTANTS[117]*2.00000*CONSTANTS[99])+ (CONSTANTS[15]/CONSTANTS[117])*(STATES[4] - STATES[5])+ (CONSTANTS[16]/CONSTANTS[117])*(STATES[24] - STATES[5])) - ALGEBRAIC[101];
resid[36] = RATES[24] - (( - ALGEBRAIC[95]*CONSTANTS[116])/CONSTANTS[115] - ALGEBRAIC[99])+ (CONSTANTS[16]/CONSTANTS[115])*(STATES[5] - STATES[24]);
resid[37] = RATES[0] - - (ALGEBRAIC[113]+ALGEBRAIC[109]);
resid[38] = RATES[3] - CONSTANTS[127];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[17] = ALGEBRAIC[15]+ALGEBRAIC[16];
ALGEBRAIC[20] = ALGEBRAIC[18]+ALGEBRAIC[19];
ALGEBRAIC[67] = ALGEBRAIC[65]+ALGEBRAIC[66];
ALGEBRAIC[71] = ALGEBRAIC[69]+ALGEBRAIC[70];
ALGEBRAIC[72] = ALGEBRAIC[67]+ALGEBRAIC[68]+ALGEBRAIC[71];
ALGEBRAIC[83] = ALGEBRAIC[81]+ALGEBRAIC[82];
ALGEBRAIC[86] = ALGEBRAIC[84]+ALGEBRAIC[85];
ALGEBRAIC[89] = ALGEBRAIC[87]+ALGEBRAIC[88];
ALGEBRAIC[104] =  3.00000*ALGEBRAIC[82]+ 3.00000*ALGEBRAIC[23]+ALGEBRAIC[70];
ALGEBRAIC[105] =  3.00000*ALGEBRAIC[81]+ 3.00000*ALGEBRAIC[22]+ALGEBRAIC[69];
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[5] = 1.00000/pow(1.00000+exp(- (56.8600+STATES[0])/9.03000), 2.00000);
ALGEBRAIC[6] =  0.129200*exp(- pow((STATES[0]+45.7900)/15.5400, 2.00000))+ 0.0648700*exp(- pow((STATES[0] - 4.82300)/51.1200, 2.00000));
ALGEBRAIC[7] = (CONDVAR[0]>=0.00000 ? 0.00000 :  0.0570000*exp(- (STATES[0]+80.0000)/6.80000));
ALGEBRAIC[8] = (CONDVAR[1]>=0.00000 ? 0.770000/( 0.130000*(1.00000+exp(- (STATES[0]+10.6600)/11.1000))) :  2.70000*exp( 0.0790000*STATES[0])+ 310000.*exp( 0.348500*STATES[0]));
ALGEBRAIC[9] = 1.00000/(ALGEBRAIC[7]+ALGEBRAIC[8]);
ALGEBRAIC[10] = 1.00000/pow(1.00000+exp((STATES[0]+71.5500)/7.43000), 2.00000);
ALGEBRAIC[11] = (CONDVAR[2]>=0.00000 ? 0.00000 : ( ( - 25428.0*exp( 0.244400*STATES[0]) -  6.94800e-06*exp( - 0.0439100*STATES[0]))*(STATES[0]+37.7800))/(1.00000+exp( 0.311000*(STATES[0]+79.2300))));
ALGEBRAIC[12] = (CONDVAR[3]>=0.00000 ? ( 0.600000*exp( 0.0570000*STATES[0]))/(1.00000+exp( - 0.100000*(STATES[0]+32.0000))) : ( 0.0242400*exp( - 0.0105200*STATES[0]))/(1.00000+exp( - 0.137800*(STATES[0]+40.1400))));
ALGEBRAIC[13] = 1.00000/(ALGEBRAIC[11]+ALGEBRAIC[12]);
ALGEBRAIC[14] = 1.00000/pow(1.00000+exp((STATES[0]+71.5500)/7.43000), 2.00000);
ALGEBRAIC[25] = 1.00000/(1.00000+exp(- (STATES[0]+10.0000)/5.00000));
ALGEBRAIC[26] = ( (550.000/(1.00000+exp((- 22.0000 - STATES[0])/9.00000)))*6.00000)/(1.00000+exp((STATES[0] - - 11.0000)/9.00000))+230.000/(1.00000+exp((STATES[0] - - 40.0000)/20.0000));
ALGEBRAIC[34] = 1.00000/(1.00000+exp(- (STATES[0]+3.80000)/14.2500));
ALGEBRAIC[35] = 990.100/(1.00000+exp(- (STATES[0]+2.43600)/14.1200));
ALGEBRAIC[39] = 1.00000/(1.00000+exp(- (STATES[0] - 19.0000)/13.0000));
ALGEBRAIC[40] = 1.00000/(1.00000+exp((STATES[0]+19.5000)/5.00000));
ALGEBRAIC[41] = 9.00000/(1.00000+exp((STATES[0]+3.00000)/15.0000))+0.500000;
ALGEBRAIC[42] = 800.000/(1.00000+exp((STATES[0]+60.0000)/10.0000))+30.0000;
ALGEBRAIC[44] =  8.50000*exp(- pow((STATES[0]+45.0000)/50.0000, 2.00000))+0.500000;
ALGEBRAIC[45] =  85.0000*exp(- pow(STATES[0]+40.0000, 2.00000)/220.000)+7.00000;
ALGEBRAIC[56] = 1.00000/(1.00000+exp((STATES[0]+35.0000)/9.00000))+0.600000/(1.00000+exp((50.0000 - STATES[0])/20.0000));
ALGEBRAIC[57] = 1.00000/(1.00000+exp(- (STATES[0]+5.00000)/6.00000));
ALGEBRAIC[58] = ( 1.00000*ALGEBRAIC[57]*(1.00000 - exp(- (STATES[0]+5.00000)/6.00000)))/( 0.0350000*(STATES[0]+5.00000));
ALGEBRAIC[59] = 1.00000/( 0.0197000*exp(- pow( 0.0337000*(STATES[0]+14.5000), 2.00000))+0.0200000);
ALGEBRAIC[90] = CONSTANTS[97] - (CONSTANTS[97] - CONSTANTS[98])/(1.00000+pow(CONSTANTS[63]/STATES[23], 2.50000));
ALGEBRAIC[91] = CONSTANTS[60]/ALGEBRAIC[90];
ALGEBRAIC[92] =  CONSTANTS[108]*ALGEBRAIC[90];
ALGEBRAIC[93] = ((1.00000 - STATES[20]) - STATES[21]) - STATES[22];
ALGEBRAIC[94] =  (( CONSTANTS[59]*STATES[21])/1.00000)*(STATES[23] - STATES[4]);
ALGEBRAIC[95] = ( pow(CONSTANTS[54], CONSTANTS[114])*CONSTANTS[55]*(pow(STATES[24]/CONSTANTS[56], CONSTANTS[58]) - pow(STATES[23]/CONSTANTS[57], CONSTANTS[58])))/(1.00000+pow(STATES[24]/CONSTANTS[56], CONSTANTS[58])+pow(STATES[23]/CONSTANTS[57], CONSTANTS[58]));
ALGEBRAIC[96] =  5.34800e-06*(STATES[23] - STATES[4]);
ALGEBRAIC[97] =  CONSTANTS[67]*STATES[1]*(CONSTANTS[64] - STATES[25]) -  CONSTANTS[66]*STATES[25];
ALGEBRAIC[98] =  CONSTANTS[67]*STATES[2]*(CONSTANTS[65] - STATES[26]) -  CONSTANTS[66]*STATES[26];
ALGEBRAIC[99] = ((((((((((( CONSTANTS[70]*STATES[24]*(CONSTANTS[68] - STATES[27]) -  CONSTANTS[69]*STATES[27])+ CONSTANTS[73]*STATES[24]*((CONSTANTS[71] - STATES[28]) - STATES[29])) -  CONSTANTS[72]*STATES[28])+ CONSTANTS[75]*CONSTANTS[24]*((CONSTANTS[71] - STATES[28]) - STATES[29])) -  CONSTANTS[74]*STATES[29])+ CONSTANTS[78]*STATES[24]*(CONSTANTS[76] - STATES[30])) -  CONSTANTS[77]*STATES[30])+ CONSTANTS[81]*STATES[24]*((CONSTANTS[79] - STATES[31]) - STATES[32])) -  CONSTANTS[80]*STATES[31])+ CONSTANTS[83]*CONSTANTS[24]*((CONSTANTS[79] - STATES[31]) - STATES[32])) -  CONSTANTS[82]*STATES[32])+( CONSTANTS[86]*STATES[24]*(CONSTANTS[84] - STATES[33]) -  CONSTANTS[85]*STATES[33]);
ALGEBRAIC[100] = ( CONSTANTS[88]*STATES[4]*(CONSTANTS[122] - STATES[34]) -  CONSTANTS[87]*STATES[34])+( CONSTANTS[90]*STATES[4]*(CONSTANTS[124] - STATES[36]) -  CONSTANTS[89]*STATES[36]);
ALGEBRAIC[101] = ( CONSTANTS[88]*STATES[5]*(CONSTANTS[121] - STATES[35]) -  CONSTANTS[87]*STATES[35])+( CONSTANTS[90]*STATES[5]*(CONSTANTS[123] - STATES[37]) -  CONSTANTS[89]*STATES[37]);
ALGEBRAIC[0] =  (1.00000/CONSTANTS[113])*log(CONSTANTS[22]/STATES[1]);
ALGEBRAIC[15] =  CONSTANTS[19]*CONSTANTS[25]*pow(STATES[6], 3.00000)*STATES[7]*STATES[8]*(STATES[0] - ALGEBRAIC[0]);
ALGEBRAIC[18] =  CONSTANTS[19]*CONSTANTS[26]*(STATES[0] - ALGEBRAIC[0]);
ALGEBRAIC[21] = 1.00000/(1.00000+ 0.124500*exp( - 0.100000*STATES[0]*CONSTANTS[113])+ 0.0365000*CONSTANTS[104]*exp( - STATES[0]*CONSTANTS[113]));
ALGEBRAIC[22] = (( CONSTANTS[19]*CONSTANTS[27]*ALGEBRAIC[21]*CONSTANTS[21])/(1.00000+pow(CONSTANTS[28]/STATES[1], 4.00000)))/(CONSTANTS[21]+CONSTANTS[29]);
ALGEBRAIC[63] = ( CONSTANTS[37]*STATES[0]*CONSTANTS[99]*CONSTANTS[113]*( 0.750000*STATES[1]*exp( STATES[0]*CONSTANTS[113]) -  0.750000*CONSTANTS[22]))/(exp( STATES[0]*CONSTANTS[113]) - 1.00000);
ALGEBRAIC[69] =  CONSTANTS[20]*ALGEBRAIC[63]*STATES[16]*STATES[17]*((1.00000 - STATES[18])+CONSTANTS[96])*pow(CONSTANTS[40], CONSTANTS[114])*0.450000*1.00000;
ALGEBRAIC[73] = 1.00000/(1.00000+pow(CONSTANTS[48]/STATES[4], 2.00000));
ALGEBRAIC[75] =  exp( CONSTANTS[47]*STATES[0]*CONSTANTS[113])*pow(STATES[1], 3.00000)*CONSTANTS[23];
ALGEBRAIC[77] =  exp( (CONSTANTS[47] - 1.00000)*STATES[0]*CONSTANTS[113])*pow(CONSTANTS[22], 3.00000)*STATES[4];
ALGEBRAIC[78] =  CONSTANTS[42]*pow(CONSTANTS[22], 3.00000)*(1.00000+pow(STATES[1]/CONSTANTS[44], 3.00000))+ pow(CONSTANTS[45], 3.00000)*STATES[4]*(1.00000+STATES[4]/CONSTANTS[42])+ CONSTANTS[43]*pow(STATES[1], 3.00000)+ pow(STATES[1], 3.00000)*CONSTANTS[23]+ pow(CONSTANTS[22], 3.00000)*STATES[4];
ALGEBRAIC[81] = (( CONSTANTS[19]*CONSTANTS[41]*pow(CONSTANTS[49], CONSTANTS[114])*ALGEBRAIC[73]*(ALGEBRAIC[75] - ALGEBRAIC[77]))/ALGEBRAIC[78])/(1.00000+ CONSTANTS[46]*exp( (CONSTANTS[47] - 1.00000)*STATES[0]*CONSTANTS[113]));
ALGEBRAIC[102] = ALGEBRAIC[15]+ALGEBRAIC[18]+ 3.00000*ALGEBRAIC[81]+ 3.00000*ALGEBRAIC[22]+ALGEBRAIC[69];
ALGEBRAIC[1] =  (1.00000/CONSTANTS[113])*log(CONSTANTS[22]/STATES[2]);
ALGEBRAIC[16] =  CONSTANTS[102]*CONSTANTS[25]*pow(STATES[6], 3.00000)*STATES[7]*STATES[8]*(STATES[0] - ALGEBRAIC[1]);
ALGEBRAIC[19] =  CONSTANTS[102]*CONSTANTS[26]*(STATES[0] - ALGEBRAIC[1]);
ALGEBRAIC[23] = (( CONSTANTS[102]*CONSTANTS[27]*ALGEBRAIC[21]*CONSTANTS[21])/(1.00000+pow(CONSTANTS[28]/STATES[2], 4.00000)))/(CONSTANTS[21]+CONSTANTS[29]);
ALGEBRAIC[64] = ( CONSTANTS[37]*STATES[0]*CONSTANTS[99]*CONSTANTS[113]*( 0.750000*STATES[2]*exp( STATES[0]*CONSTANTS[113]) -  0.750000*CONSTANTS[22]))/(exp( STATES[0]*CONSTANTS[113]) - 1.00000);
ALGEBRAIC[70] =  CONSTANTS[103]*ALGEBRAIC[64]*STATES[16]*STATES[17]*((1.00000 - STATES[19])+CONSTANTS[95])*pow(CONSTANTS[40], CONSTANTS[114])*0.450000*1.00000;
ALGEBRAIC[74] = 1.00000/(1.00000+pow(CONSTANTS[48]/STATES[5], 2.00000));
ALGEBRAIC[76] =  exp( CONSTANTS[47]*STATES[0]*CONSTANTS[113])*pow(STATES[2], 3.00000)*CONSTANTS[23];
ALGEBRAIC[79] =  exp( (CONSTANTS[47] - 1.00000)*STATES[0]*CONSTANTS[113])*pow(CONSTANTS[22], 3.00000)*STATES[5];
ALGEBRAIC[80] =  CONSTANTS[42]*pow(CONSTANTS[22], 3.00000)*(1.00000+pow(STATES[2]/CONSTANTS[44], 3.00000))+ pow(CONSTANTS[45], 3.00000)*STATES[5]*(1.00000+STATES[5]/CONSTANTS[42])+ CONSTANTS[43]*pow(STATES[2], 3.00000)+ pow(STATES[2], 3.00000)*CONSTANTS[23]+ pow(CONSTANTS[22], 3.00000)*STATES[5];
ALGEBRAIC[82] = (( CONSTANTS[102]*CONSTANTS[41]*pow(CONSTANTS[49], CONSTANTS[114])*ALGEBRAIC[74]*(ALGEBRAIC[76] - ALGEBRAIC[79]))/ALGEBRAIC[80])/(1.00000+ CONSTANTS[46]*exp( (CONSTANTS[47] - 1.00000)*STATES[0]*CONSTANTS[113]));
ALGEBRAIC[103] = ALGEBRAIC[16]+ALGEBRAIC[19]+ 3.00000*ALGEBRAIC[82]+ 3.00000*ALGEBRAIC[23]+ALGEBRAIC[70];
ALGEBRAIC[60] = ( CONSTANTS[38]*4.00000*STATES[0]*CONSTANTS[99]*CONSTANTS[113]*( 0.341000*STATES[4]*exp( 2.00000*STATES[0]*CONSTANTS[113]) -  0.341000*CONSTANTS[23]))/(exp( 2.00000*STATES[0]*CONSTANTS[113]) - 1.00000);
ALGEBRAIC[65] =  CONSTANTS[20]*ALGEBRAIC[60]*STATES[16]*STATES[17]*((1.00000 - STATES[18])+CONSTANTS[96])*pow(CONSTANTS[40], CONSTANTS[114])*0.450000*1.00000;
ALGEBRAIC[84] = ( CONSTANTS[19]*pow(CONSTANTS[53], CONSTANTS[114])*CONSTANTS[50]*pow(STATES[4], 1.60000))/(pow(CONSTANTS[51], 1.60000)+pow(STATES[4], 1.60000));
ALGEBRAIC[3] =  ((1.00000/CONSTANTS[113])/2.00000)*log(CONSTANTS[23]/STATES[4]);
ALGEBRAIC[87] =  CONSTANTS[19]*CONSTANTS[52]*(STATES[0] - ALGEBRAIC[3]);
ALGEBRAIC[107] = (ALGEBRAIC[65]+ALGEBRAIC[87]+ALGEBRAIC[84]) -  2.00000*ALGEBRAIC[81];
ALGEBRAIC[61] = ( CONSTANTS[38]*4.00000*STATES[0]*CONSTANTS[99]*CONSTANTS[113]*( 0.341000*STATES[5]*exp( 2.00000*STATES[0]*CONSTANTS[113]) -  0.341000*CONSTANTS[23]))/(exp( 2.00000*STATES[0]*CONSTANTS[113]) - 1.00000);
ALGEBRAIC[66] =  CONSTANTS[103]*ALGEBRAIC[61]*STATES[16]*STATES[17]*((1.00000 - STATES[19])+CONSTANTS[95])*pow(CONSTANTS[40], CONSTANTS[114])*0.450000*1.00000;
ALGEBRAIC[85] = ( CONSTANTS[102]*pow(CONSTANTS[53], CONSTANTS[114])*CONSTANTS[50]*pow(STATES[5], 1.60000))/(pow(CONSTANTS[51], 1.60000)+pow(STATES[5], 1.60000));
ALGEBRAIC[4] =  ((1.00000/CONSTANTS[113])/2.00000)*log(CONSTANTS[23]/STATES[5]);
ALGEBRAIC[88] =  CONSTANTS[102]*CONSTANTS[52]*(STATES[0] - ALGEBRAIC[4]);
ALGEBRAIC[108] = (ALGEBRAIC[66]+ALGEBRAIC[88]+ALGEBRAIC[85]) -  2.00000*ALGEBRAIC[82];
ALGEBRAIC[109] = (CONDVAR[4]>=0.00000&&CONDVAR[5]<=0.00000 ? - CONSTANTS[3] : 0.00000);
ALGEBRAIC[24] = ALGEBRAIC[22]+ALGEBRAIC[23];
ALGEBRAIC[2] =  (1.00000/CONSTANTS[113])*log(CONSTANTS[21]/STATES[3]);
ALGEBRAIC[27] = 1.00000/(1.00000+exp((STATES[0]+74.0000)/24.0000));
ALGEBRAIC[28] =  CONSTANTS[105]*STATES[9]*ALGEBRAIC[27]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[29] = 1.00000/(1.00000+exp(7.48800 - STATES[0]/5.98000));
ALGEBRAIC[30] =  CONSTANTS[19]*CONSTANTS[33]*ALGEBRAIC[29]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[31] =  CONSTANTS[102]*CONSTANTS[33]*ALGEBRAIC[29]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[32] = ALGEBRAIC[30]+ALGEBRAIC[31];
ALGEBRAIC[33] =  (1.00000/CONSTANTS[113])*log((CONSTANTS[21]+ CONSTANTS[32]*CONSTANTS[22])/(STATES[3]+ CONSTANTS[32]*STATES[11]));
ALGEBRAIC[36] =  CONSTANTS[19]*CONSTANTS[93]*pow(STATES[10], 2.00000)*(STATES[0] - ALGEBRAIC[33]);
ALGEBRAIC[37] =  CONSTANTS[102]*CONSTANTS[94]*pow(STATES[10], 2.00000)*(STATES[0] - ALGEBRAIC[33]);
ALGEBRAIC[38] = ALGEBRAIC[36]+ALGEBRAIC[37];
ALGEBRAIC[43] =  CONSTANTS[106]*STATES[12]*STATES[13]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[46] =  CONSTANTS[107]*STATES[14]*STATES[15]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[47] = ALGEBRAIC[43]+ALGEBRAIC[46];
ALGEBRAIC[48] = 1.02000/(1.00000+exp( 0.238500*((STATES[0] - ALGEBRAIC[2]) - 59.2150)));
ALGEBRAIC[49] = ( 0.491240*exp( 0.0803200*((STATES[0]+5.47600) - ALGEBRAIC[2]))+exp( 0.0617500*((STATES[0] - ALGEBRAIC[2]) - 594.310)))/(1.00000+exp( - 0.514300*((STATES[0] - ALGEBRAIC[2])+4.75300)));
ALGEBRAIC[50] = ALGEBRAIC[48]/(ALGEBRAIC[48]+ALGEBRAIC[49]);
ALGEBRAIC[51] =  1.00000*0.350000* pow((CONSTANTS[21]/5.40000), 1.0 / 2)*ALGEBRAIC[50]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[62] = ( CONSTANTS[39]*STATES[0]*CONSTANTS[99]*CONSTANTS[113]*( 0.750000*STATES[3]*exp( STATES[0]*CONSTANTS[113]) -  0.750000*CONSTANTS[21]))/(exp( STATES[0]*CONSTANTS[113]) - 1.00000);
ALGEBRAIC[68] =  ALGEBRAIC[62]*STATES[16]*STATES[17]*( CONSTANTS[20]*(CONSTANTS[96]+(1.00000 - STATES[18]))+ CONSTANTS[103]*(CONSTANTS[95]+(1.00000 - STATES[19])))*pow(CONSTANTS[40], CONSTANTS[114])*0.450000*1.00000;
ALGEBRAIC[106] = ((ALGEBRAIC[47]+ALGEBRAIC[28]+ALGEBRAIC[38]+ALGEBRAIC[51]) -  2.00000*ALGEBRAIC[24])+ALGEBRAIC[68]+ALGEBRAIC[32];
ALGEBRAIC[110] = ALGEBRAIC[102]+ALGEBRAIC[103];
ALGEBRAIC[52] =  (( CONSTANTS[19]*CONSTANTS[34])/(1.00000+CONSTANTS[36]/STATES[4]))*(STATES[0] - CONSTANTS[126]);
ALGEBRAIC[53] =  (( CONSTANTS[102]*CONSTANTS[34])/(1.00000+CONSTANTS[36]/STATES[5]))*(STATES[0] - CONSTANTS[126]);
ALGEBRAIC[54] = ALGEBRAIC[52]+ALGEBRAIC[53];
ALGEBRAIC[55] =  CONSTANTS[35]*(STATES[0] - CONSTANTS[126]);
ALGEBRAIC[111] = ALGEBRAIC[54]+ALGEBRAIC[55];
ALGEBRAIC[112] = ALGEBRAIC[107]+ALGEBRAIC[108];
ALGEBRAIC[113] = ALGEBRAIC[110]+ALGEBRAIC[111]+ALGEBRAIC[112]+ALGEBRAIC[106];
}
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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
CONDVAR[0] = STATES[0] - - 40.0000;
CONDVAR[1] = STATES[0] - - 40.0000;
CONDVAR[2] = STATES[0] - - 40.0000;
CONDVAR[3] = STATES[0] - - 40.0000;
CONDVAR[4] = (VOI -  floor(VOI/CONSTANTS[1])*CONSTANTS[1]) - CONSTANTS[0];
CONDVAR[5] = (VOI -  floor(VOI/CONSTANTS[1])*CONSTANTS[1]) - (CONSTANTS[0]+CONSTANTS[2]);
}