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 113 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 125 entries in the constant variable array.
 */
/*
 * CONSTANTS[0] is I_app in component Protocol (uA_per_uF).
 * VOI is time in component environment (msec).
 * STATES[0] is V_m in component membrane_potential (mV).
 * CONSTANTS[1] is epi in component parameters (dimensionless).
 * CONSTANTS[2] is R in component parameters (joule_per_kelvin_per_kilomole).
 * CONSTANTS[96] is Frdy in component parameters (coulomb_per_mole).
 * CONSTANTS[106] is Temp in component parameters (kelvin).
 * CONSTANTS[110] is FoRT in component parameters (per_mV).
 * CONSTANTS[3] is Cmem in component parameters (farad).
 * CONSTANTS[111] is Qpow in component parameters (dimensionless).
 * CONSTANTS[4] is cellLength in component parameters (um).
 * CONSTANTS[97] is cellRadius in component parameters (um).
 * CONSTANTS[5] is junctionLength in component parameters (um).
 * CONSTANTS[98] is junctionRadius in component parameters (um).
 * CONSTANTS[6] is distSLcyto in component parameters (um).
 * CONSTANTS[7] is distJuncSL in component parameters (um).
 * CONSTANTS[8] is DcaJuncSL in component parameters (cm2_per_sec).
 * CONSTANTS[9] is DcaSLcyto in component parameters (cm2_per_sec).
 * CONSTANTS[10] is DnaJuncSL in component parameters (cm2_per_sec).
 * CONSTANTS[11] is DnaSLcyto in component parameters (cm2_per_sec).
 * CONSTANTS[107] is Vcell in component parameters (liter).
 * CONSTANTS[112] is Vmyo in component parameters (liter).
 * CONSTANTS[113] is Vsr in component parameters (liter).
 * CONSTANTS[114] is Vsl in component parameters (liter).
 * CONSTANTS[115] is Vjunc in component parameters (liter).
 * CONSTANTS[108] is SAjunc in component parameters (um2).
 * CONSTANTS[109] is SAsl in component parameters (um2).
 * CONSTANTS[12] is J_ca_juncsl in component parameters (liters_per_msec).
 * CONSTANTS[13] is J_ca_slmyo in component parameters (liters_per_msec).
 * CONSTANTS[14] is J_na_juncsl in component parameters (liters_per_msec).
 * CONSTANTS[15] is J_na_slmyo in component parameters (liters_per_msec).
 * CONSTANTS[16] is Fjunc in component parameters (dimensionless).
 * CONSTANTS[99] is Fsl in component parameters (dimensionless).
 * CONSTANTS[17] is Fjunc_CaL in component parameters (dimensionless).
 * CONSTANTS[100] is Fsl_CaL in component parameters (dimensionless).
 * CONSTANTS[116] is Cli in component parameters (mM).
 * CONSTANTS[117] is Clo in component parameters (mM).
 * CONSTANTS[18] is Ko in component parameters (mM).
 * CONSTANTS[19] is Nao in component parameters (mM).
 * CONSTANTS[20] is Cao in component parameters (mM).
 * CONSTANTS[21] 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[123] is ecl in component parameters (mV).
 * CONSTANTS[22] is GNa in component parameters (mS_per_uF).
 * CONSTANTS[23] is GNaB in component parameters (mS_per_uF).
 * CONSTANTS[24] is IbarNaK in component parameters (uA_per_uF).
 * CONSTANTS[25] is KmNaip in component parameters (mM).
 * CONSTANTS[26] is KmKo in component parameters (mM).
 * CONSTANTS[27] is Q10NaK in component parameters (dimensionless).
 * CONSTANTS[28] is Q10KmNai in component parameters (dimensionless).
 * CONSTANTS[29] is pNaK in component parameters (dimensionless).
 * CONSTANTS[30] is gkp in component parameters (mS_per_uF).
 * CONSTANTS[31] is GClCa in component parameters (mS_per_uF).
 * CONSTANTS[32] is GClB in component parameters (mS_per_uF).
 * CONSTANTS[33] is KdClCa in component parameters (mM).
 * CONSTANTS[34] is pNa in component parameters (cm_per_sec).
 * CONSTANTS[35] is pCa in component parameters (cm_per_sec).
 * CONSTANTS[36] is pK in component parameters (cm_per_sec).
 * CONSTANTS[37] is Q10CaL in component parameters (dimensionless).
 * CONSTANTS[38] is IbarNCX in component parameters (uA_per_uF).
 * CONSTANTS[39] is KmCai in component parameters (mM).
 * CONSTANTS[40] is KmCao in component parameters (mM).
 * CONSTANTS[41] is KmNai in component parameters (mM).
 * CONSTANTS[42] is KmNao in component parameters (mM).
 * CONSTANTS[43] is ksat in component parameters (dimensionless).
 * CONSTANTS[44] is nu in component parameters (dimensionless).
 * CONSTANTS[45] is Kdact in component parameters (mM).
 * CONSTANTS[46] is Q10NCX in component parameters (dimensionless).
 * CONSTANTS[47] is IbarSLCaP in component parameters (uA_per_uF).
 * CONSTANTS[48] is KmPCa in component parameters (mM).
 * CONSTANTS[49] is GCaB in component parameters (mS_per_uF).
 * CONSTANTS[50] is Q10SLCaP in component parameters (dimensionless).
 * CONSTANTS[51] is Q10SRCaP in component parameters (dimensionless).
 * CONSTANTS[52] is Vmax_SRCaP in component parameters (mM_per_msec).
 * CONSTANTS[53] is Kmf in component parameters (mM).
 * CONSTANTS[54] is Kmr in component parameters (mM).
 * CONSTANTS[55] is hillSRCaP in component parameters (dimensionless).
 * CONSTANTS[56] is ks in component parameters (per_msec).
 * CONSTANTS[57] is koCa in component parameters (per_mM2_per_msec).
 * CONSTANTS[58] is kom in component parameters (per_msec).
 * CONSTANTS[105] is kiCa in component parameters (per_mM_per_msec).
 * CONSTANTS[59] is kim in component parameters (per_msec).
 * CONSTANTS[60] is ec50SR in component parameters (mM).
 * CONSTANTS[61] is Bmax_Naj in component parameters (mM).
 * CONSTANTS[62] is Bmax_Nasl in component parameters (mM).
 * CONSTANTS[63] is koff_na in component parameters (per_msec).
 * CONSTANTS[64] is kon_na in component parameters (per_mM_per_msec).
 * CONSTANTS[65] is Bmax_TnClow in component parameters (mM).
 * CONSTANTS[66] is koff_tncl in component parameters (per_msec).
 * CONSTANTS[67] is kon_tncl in component parameters (per_mM_per_msec).
 * CONSTANTS[68] is Bmax_TnChigh in component parameters (mM).
 * CONSTANTS[69] is koff_tnchca in component parameters (per_msec).
 * CONSTANTS[70] is kon_tnchca in component parameters (per_mM_per_msec).
 * CONSTANTS[71] is koff_tnchmg in component parameters (per_msec).
 * CONSTANTS[72] is kon_tnchmg in component parameters (per_mM_per_msec).
 * CONSTANTS[73] is Bmax_CaM in component parameters (mM).
 * CONSTANTS[74] is koff_cam in component parameters (per_msec).
 * CONSTANTS[75] is kon_cam in component parameters (per_mM_per_msec).
 * CONSTANTS[76] is Bmax_myosin in component parameters (mM).
 * CONSTANTS[77] is koff_myoca in component parameters (per_msec).
 * CONSTANTS[78] is kon_myoca in component parameters (per_mM_per_msec).
 * CONSTANTS[79] is koff_myomg in component parameters (per_msec).
 * CONSTANTS[80] is kon_myomg in component parameters (per_mM_per_msec).
 * CONSTANTS[81] is Bmax_SR in component parameters (mM).
 * CONSTANTS[82] is koff_sr in component parameters (per_msec).
 * CONSTANTS[83] is kon_sr in component parameters (per_mM_per_msec).
 * CONSTANTS[118] is Bmax_SLlowsl in component parameters (mM).
 * CONSTANTS[119] is Bmax_SLlowj in component parameters (mM).
 * CONSTANTS[84] is koff_sll in component parameters (per_msec).
 * CONSTANTS[85] is kon_sll in component parameters (per_mM_per_msec).
 * CONSTANTS[120] is Bmax_SLhighsl in component parameters (mM).
 * CONSTANTS[121] is Bmax_SLhighj in component parameters (mM).
 * CONSTANTS[86] is koff_slh in component parameters (per_msec).
 * CONSTANTS[87] is kon_slh in component parameters (per_mM_per_msec).
 * CONSTANTS[122] is Bmax_Csqn in component parameters (mM).
 * CONSTANTS[88] is koff_csqn in component parameters (per_msec).
 * CONSTANTS[89] 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[101] 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[102] 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[90] is gks_junc in component I_Ks (mS_per_uF).
 * CONSTANTS[91] 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[103] is GtoSlow in component I_to (mS_per_uF).
 * CONSTANTS[104] 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[92] is fcaCaMSL in component I_Ca (dimensionless).
 * CONSTANTS[93] 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[94] is MaxSR in component SR_Fluxes (dimensionless).
 * CONSTANTS[95] 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[109] is I_Na_tot in component membrane_potential (uA_per_uF).
 * ALGEBRAIC[110] is I_Cl_tot in component membrane_potential (uA_per_uF).
 * ALGEBRAIC[111] is I_Ca_tot in component membrane_potential (uA_per_uF).
 * ALGEBRAIC[112] is I_tot 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 4 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 0;
STATES[0] = -8.09763e1;
STATES[1] = 9.06;
STATES[2] = 9.06;
STATES[3] = 120;
STATES[4] = 1.737475e-4;
STATES[5] = 1.031812e-4;
STATES[6] = 1.405627e-3;
STATES[7] = 9.867005e-1;
STATES[8] = 9.91562e-1;
STATES[9] = 8.641386e-3;
STATES[10] = 5.412034e-3;
STATES[11] = 9.06;
STATES[12] = 4.051574e-3;
STATES[13] = 9.945511e-1;
STATES[14] = 4.051574e-3;
STATES[15] = 9.945511e-1;
STATES[16] = 7.175662e-6;
STATES[17] = 1.000681;
STATES[18] = 2.421991e-2;
STATES[19] = 1.452605e-2;
STATES[20] = 8.884332e-1;
STATES[21] = 8.156628e-7;
STATES[22] = 1.024274e-7;
STATES[23] = 0.1e-1;
STATES[24] = 8.597401e-5;
STATES[25] = 3.539892;
STATES[26] = 7.720854e-1;
STATES[27] = 8.773191e-3;
STATES[28] = 1.078283e-1;
STATES[29] = 1.524002e-2;
STATES[30] = 2.911916e-4;
STATES[31] = 1.298754e-3;
STATES[32] = 1.381982e-1;
STATES[33] = 2.143165e-3;
STATES[34] = 9.566355e-3;
STATES[35] = 1.110363e-1;
STATES[36] = 7.347888e-3;
STATES[37] = 7.297378e-2;
STATES[38] = 1.242988;
CONSTANTS[1] = 1.00000;
CONSTANTS[2] = 8314.00;
CONSTANTS[3] = 1.38100e-10;
CONSTANTS[4] = 100.000;
CONSTANTS[5] = 0.160000;
CONSTANTS[6] = 0.450000;
CONSTANTS[7] = 0.500000;
CONSTANTS[8] = 1.64000e-06;
CONSTANTS[9] = 1.22000e-06;
CONSTANTS[10] = 1.09000e-05;
CONSTANTS[11] = 1.79000e-05;
CONSTANTS[12] = 8.24130e-13;
CONSTANTS[13] = 3.27430e-12;
CONSTANTS[14] = 1.83130e-14;
CONSTANTS[15] = 1.63860e-12;
CONSTANTS[16] = 0.110000;
CONSTANTS[17] = 0.900000;
CONSTANTS[18] = 5.40000;
CONSTANTS[19] = 140.000;
CONSTANTS[20] = 1.80000;
CONSTANTS[21] = 1.00000;
CONSTANTS[22] = 23.0000;
CONSTANTS[23] = 0.000597000;
CONSTANTS[24] =  1.00000*1.80000;
CONSTANTS[25] = 11.0000;
CONSTANTS[26] = 1.50000;
CONSTANTS[27] = 1.63000;
CONSTANTS[28] = 1.39000;
CONSTANTS[29] = 0.0183300;
CONSTANTS[30] =  2.00000*0.00100000;
CONSTANTS[31] =  0.500000*0.109625;
CONSTANTS[32] =  1.00000*0.00900000;
CONSTANTS[33] = 0.100000;
CONSTANTS[34] =  0.500000*1.50000e-08;
CONSTANTS[35] =  0.500000*0.000540000;
CONSTANTS[36] =  0.500000*2.70000e-07;
CONSTANTS[37] = 1.80000;
CONSTANTS[38] =  1.00000*4.50000;
CONSTANTS[39] = 0.00359000;
CONSTANTS[40] = 1.30000;
CONSTANTS[41] = 12.2900;
CONSTANTS[42] = 87.5000;
CONSTANTS[43] = 0.320000;
CONSTANTS[44] = 0.270000;
CONSTANTS[45] = 0.000150000;
CONSTANTS[46] = 1.57000;
CONSTANTS[47] = 0.0673000;
CONSTANTS[48] = 0.000500000;
CONSTANTS[49] = 0.000551300;
CONSTANTS[50] = 2.35000;
CONSTANTS[51] = 2.60000;
CONSTANTS[52] = 0.00531140;
CONSTANTS[53] = 0.000246000;
CONSTANTS[54] = 1.70000;
CONSTANTS[55] = 1.78700;
CONSTANTS[56] = 25.0000;
CONSTANTS[57] = 10.0000;
CONSTANTS[58] = 0.0600000;
CONSTANTS[59] = 0.00500000;
CONSTANTS[60] = 0.450000;
CONSTANTS[61] = 7.56100;
CONSTANTS[62] = 1.65000;
CONSTANTS[63] = 0.00100000;
CONSTANTS[64] = 0.000100000;
CONSTANTS[65] = 0.0700000;
CONSTANTS[66] = 0.0196000;
CONSTANTS[67] = 32.7000;
CONSTANTS[68] = 0.140000;
CONSTANTS[69] = 3.20000e-05;
CONSTANTS[70] = 2.37000;
CONSTANTS[71] = 0.00333000;
CONSTANTS[72] = 0.00300000;
CONSTANTS[73] = 0.0240000;
CONSTANTS[74] = 0.238000;
CONSTANTS[75] = 34.0000;
CONSTANTS[76] = 0.140000;
CONSTANTS[77] = 0.000460000;
CONSTANTS[78] = 13.8000;
CONSTANTS[79] = 5.70000e-05;
CONSTANTS[80] = 0.0157000;
CONSTANTS[81] =  19.0000*0.000900000;
CONSTANTS[82] = 0.0600000;
CONSTANTS[83] = 100.000;
CONSTANTS[84] = 1.30000;
CONSTANTS[85] = 100.000;
CONSTANTS[86] = 0.0300000;
CONSTANTS[87] = 100.000;
CONSTANTS[88] = 65.0000;
CONSTANTS[89] = 100.000;
CONSTANTS[90] = 0.00350000;
CONSTANTS[91] = 0.00350000;
CONSTANTS[92] = 0.00000;
CONSTANTS[93] = 0.00000;
CONSTANTS[94] = 15.0000;
CONSTANTS[95] = 1.00000;
CONSTANTS[124] = 0.00000;
CONSTANTS[96] = 96485.0;
CONSTANTS[97] = 10.2500;
CONSTANTS[98] = 0.0150000;
CONSTANTS[99] = 1.00000 - CONSTANTS[16];
CONSTANTS[100] = 1.00000 - CONSTANTS[17];
CONSTANTS[101] = (exp(CONSTANTS[19]/67.3000) - 1.00000)/7.00000;
CONSTANTS[102] =  0.0350000* pow((CONSTANTS[18]/5.40000), 1.0 / 2);
CONSTANTS[103] = (CONSTANTS[1]==1.00000 ?  1.00000*0.130000*0.120000 :  0.130000*0.300000*0.964000);
CONSTANTS[104] = (CONSTANTS[1]==1.00000 ?  1.00000*0.130000*0.880000 :  0.130000*0.300000*0.0360000);
CONSTANTS[105] = 0.500000;
CONSTANTS[106] = 310.000;
CONSTANTS[107] =   3.14159265358979*pow(CONSTANTS[97], 2.00000)*CONSTANTS[4]*1.00000e-15;
CONSTANTS[108] =  20150.0* 3.14159265358979*2.00000*CONSTANTS[5]*CONSTANTS[98];
CONSTANTS[109] =   3.14159265358979*2.00000*CONSTANTS[97]*CONSTANTS[4];
CONSTANTS[110] = CONSTANTS[96]/( CONSTANTS[2]*CONSTANTS[106]);
CONSTANTS[111] = (CONSTANTS[106] - 310.000)/10.0000;
CONSTANTS[112] =  0.650000*CONSTANTS[107];
CONSTANTS[113] =  0.0350000*CONSTANTS[107];
CONSTANTS[114] =  0.0200000*CONSTANTS[107];
CONSTANTS[115] =  0.0539000*0.0100000*CONSTANTS[107];
CONSTANTS[116] = 15.0000;
CONSTANTS[117] = 150.000;
CONSTANTS[118] = ( 0.0374000*CONSTANTS[112])/CONSTANTS[114];
CONSTANTS[119] =  (( 0.00460000*CONSTANTS[112])/CONSTANTS[115])*0.100000;
CONSTANTS[120] = ( 0.0134000*CONSTANTS[112])/CONSTANTS[114];
CONSTANTS[121] =  (( 0.00165000*CONSTANTS[112])/CONSTANTS[115])*0.100000;
CONSTANTS[122] = ( 0.140000*CONSTANTS[112])/CONSTANTS[113];
CONSTANTS[123] =  (1.00000/CONSTANTS[110])*log(CONSTANTS[116]/CONSTANTS[117]);
RATES[6] = 0.1001;
RATES[7] = 0.1001;
RATES[8] = 0.1001;
RATES[9] = 0.1001;
RATES[10] = 0.1001;
RATES[12] = 0.1001;
RATES[13] = 0.1001;
RATES[14] = 0.1001;
RATES[15] = 0.1001;
RATES[16] = 0.1001;
RATES[17] = 0.1001;
RATES[18] = 0.1001;
RATES[19] = 0.1001;
RATES[20] = 0.1001;
RATES[21] = 0.1001;
RATES[22] = 0.1001;
RATES[25] = 0.1001;
RATES[26] = 0.1001;
RATES[27] = 0.1001;
RATES[28] = 0.1001;
RATES[29] = 0.1001;
RATES[30] = 0.1001;
RATES[31] = 0.1001;
RATES[32] = 0.1001;
RATES[33] = 0.1001;
RATES[34] = 0.1001;
RATES[35] = 0.1001;
RATES[36] = 0.1001;
RATES[37] = 0.1001;
RATES[38] = 0.1001;
RATES[23] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 0.1001;
RATES[11] = 0.1001;
RATES[4] = 0.1001;
RATES[5] = 0.1001;
RATES[24] = 0.1001;
RATES[0] = 0.1001;
}
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[59]*ALGEBRAIC[93] -  ALGEBRAIC[92]*STATES[4]*STATES[20]) - ( ALGEBRAIC[91]*pow(STATES[4], 2.00000)*STATES[20] -  CONSTANTS[58]*STATES[21]);
resid[14] = RATES[21] - ( ALGEBRAIC[91]*pow(STATES[4], 2.00000)*STATES[20] -  CONSTANTS[58]*STATES[21]) - ( ALGEBRAIC[92]*STATES[4]*STATES[21] -  CONSTANTS[59]*STATES[22]);
resid[15] = RATES[22] - ( ALGEBRAIC[92]*STATES[4]*STATES[21] -  CONSTANTS[59]*STATES[22]) - ( CONSTANTS[58]*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[67]*STATES[24]*(CONSTANTS[65] - STATES[27]) -  CONSTANTS[66]*STATES[27];
resid[19] = RATES[28] -  CONSTANTS[70]*STATES[24]*((CONSTANTS[68] - STATES[28]) - STATES[29]) -  CONSTANTS[69]*STATES[28];
resid[20] = RATES[29] -  CONSTANTS[72]*CONSTANTS[21]*((CONSTANTS[68] - STATES[28]) - STATES[29]) -  CONSTANTS[71]*STATES[29];
resid[21] = RATES[30] -  CONSTANTS[75]*STATES[24]*(CONSTANTS[73] - STATES[30]) -  CONSTANTS[74]*STATES[30];
resid[22] = RATES[31] -  CONSTANTS[78]*STATES[24]*((CONSTANTS[76] - STATES[31]) - STATES[32]) -  CONSTANTS[77]*STATES[31];
resid[23] = RATES[32] -  CONSTANTS[80]*CONSTANTS[21]*((CONSTANTS[76] - STATES[31]) - STATES[32]) -  CONSTANTS[79]*STATES[32];
resid[24] = RATES[33] -  CONSTANTS[83]*STATES[24]*(CONSTANTS[81] - STATES[33]) -  CONSTANTS[82]*STATES[33];
resid[25] = RATES[34] -  CONSTANTS[85]*STATES[4]*(CONSTANTS[119] - STATES[34]) -  CONSTANTS[84]*STATES[34];
resid[26] = RATES[35] -  CONSTANTS[85]*STATES[5]*(CONSTANTS[118] - STATES[35]) -  CONSTANTS[84]*STATES[35];
resid[27] = RATES[36] -  CONSTANTS[87]*STATES[4]*(CONSTANTS[121] - STATES[36]) -  CONSTANTS[86]*STATES[36];
resid[28] = RATES[37] -  CONSTANTS[87]*STATES[5]*(CONSTANTS[120] - STATES[37]) -  CONSTANTS[86]*STATES[37];
resid[29] = RATES[38] -  CONSTANTS[89]*STATES[23]*(CONSTANTS[122] - STATES[38]) -  CONSTANTS[88]*STATES[38];
resid[30] = RATES[23] - (ALGEBRAIC[95] - (( ALGEBRAIC[96]*CONSTANTS[112])/CONSTANTS[113]+ALGEBRAIC[94])) - ( CONSTANTS[89]*STATES[23]*(CONSTANTS[122] - STATES[38]) -  CONSTANTS[88]*STATES[38]);
resid[31] = RATES[1] - (( - ALGEBRAIC[102]*CONSTANTS[3])/( CONSTANTS[115]*CONSTANTS[96])+ (CONSTANTS[14]/CONSTANTS[115])*(STATES[2] - STATES[1])) - ALGEBRAIC[97];
resid[32] = RATES[2] - (( - ALGEBRAIC[103]*CONSTANTS[3])/( CONSTANTS[114]*CONSTANTS[96])+ (CONSTANTS[14]/CONSTANTS[114])*(STATES[1] - STATES[2])+ (CONSTANTS[15]/CONSTANTS[114])*(STATES[11] - STATES[2])) - ALGEBRAIC[98];
resid[33] = RATES[11] -  (CONSTANTS[15]/CONSTANTS[112])*(STATES[2] - STATES[11]);
resid[34] = RATES[4] - ((( - ALGEBRAIC[107]*CONSTANTS[3])/( CONSTANTS[115]*2.00000*CONSTANTS[96])+ (CONSTANTS[12]/CONSTANTS[115])*(STATES[5] - STATES[4])) - ALGEBRAIC[100])+( ALGEBRAIC[94]*CONSTANTS[113])/CONSTANTS[115]+( ALGEBRAIC[96]*CONSTANTS[112])/CONSTANTS[115];
resid[35] = RATES[5] - (( - ALGEBRAIC[108]*CONSTANTS[3])/( CONSTANTS[114]*2.00000*CONSTANTS[96])+ (CONSTANTS[12]/CONSTANTS[114])*(STATES[4] - STATES[5])+ (CONSTANTS[13]/CONSTANTS[114])*(STATES[24] - STATES[5])) - ALGEBRAIC[101];
resid[36] = RATES[24] - (( - ALGEBRAIC[95]*CONSTANTS[113])/CONSTANTS[112] - ALGEBRAIC[99])+ (CONSTANTS[13]/CONSTANTS[112])*(STATES[5] - STATES[24]);
resid[37] = RATES[0] - - (ALGEBRAIC[112] - CONSTANTS[0]);
resid[38] = RATES[3] - CONSTANTS[124];
}
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[94] - (CONSTANTS[94] - CONSTANTS[95])/(1.00000+pow(CONSTANTS[60]/STATES[23], 2.50000));
ALGEBRAIC[91] = CONSTANTS[57]/ALGEBRAIC[90];
ALGEBRAIC[92] =  CONSTANTS[105]*ALGEBRAIC[90];
ALGEBRAIC[93] = ((1.00000 - STATES[20]) - STATES[21]) - STATES[22];
ALGEBRAIC[94] =  (( CONSTANTS[56]*STATES[21])/1.00000)*(STATES[23] - STATES[4]);
ALGEBRAIC[95] = ( pow(CONSTANTS[51], CONSTANTS[111])*CONSTANTS[52]*(pow(STATES[24]/CONSTANTS[53], CONSTANTS[55]) - pow(STATES[23]/CONSTANTS[54], CONSTANTS[55])))/(1.00000+pow(STATES[24]/CONSTANTS[53], CONSTANTS[55])+pow(STATES[23]/CONSTANTS[54], CONSTANTS[55]));
ALGEBRAIC[96] =  5.34800e-06*(STATES[23] - STATES[4]);
ALGEBRAIC[97] =  CONSTANTS[64]*STATES[1]*(CONSTANTS[61] - STATES[25]) -  CONSTANTS[63]*STATES[25];
ALGEBRAIC[98] =  CONSTANTS[64]*STATES[2]*(CONSTANTS[62] - STATES[26]) -  CONSTANTS[63]*STATES[26];
ALGEBRAIC[99] = ((((((((((( CONSTANTS[67]*STATES[24]*(CONSTANTS[65] - STATES[27]) -  CONSTANTS[66]*STATES[27])+ CONSTANTS[70]*STATES[24]*((CONSTANTS[68] - STATES[28]) - STATES[29])) -  CONSTANTS[69]*STATES[28])+ CONSTANTS[72]*CONSTANTS[21]*((CONSTANTS[68] - STATES[28]) - STATES[29])) -  CONSTANTS[71]*STATES[29])+ CONSTANTS[75]*STATES[24]*(CONSTANTS[73] - STATES[30])) -  CONSTANTS[74]*STATES[30])+ CONSTANTS[78]*STATES[24]*((CONSTANTS[76] - STATES[31]) - STATES[32])) -  CONSTANTS[77]*STATES[31])+ CONSTANTS[80]*CONSTANTS[21]*((CONSTANTS[76] - STATES[31]) - STATES[32])) -  CONSTANTS[79]*STATES[32])+( CONSTANTS[83]*STATES[24]*(CONSTANTS[81] - STATES[33]) -  CONSTANTS[82]*STATES[33]);
ALGEBRAIC[100] = ( CONSTANTS[85]*STATES[4]*(CONSTANTS[119] - STATES[34]) -  CONSTANTS[84]*STATES[34])+( CONSTANTS[87]*STATES[4]*(CONSTANTS[121] - STATES[36]) -  CONSTANTS[86]*STATES[36]);
ALGEBRAIC[101] = ( CONSTANTS[85]*STATES[5]*(CONSTANTS[118] - STATES[35]) -  CONSTANTS[84]*STATES[35])+( CONSTANTS[87]*STATES[5]*(CONSTANTS[120] - STATES[37]) -  CONSTANTS[86]*STATES[37]);
ALGEBRAIC[0] =  (1.00000/CONSTANTS[110])*log(CONSTANTS[19]/STATES[1]);
ALGEBRAIC[15] =  CONSTANTS[16]*CONSTANTS[22]*pow(STATES[6], 3.00000)*STATES[7]*STATES[8]*(STATES[0] - ALGEBRAIC[0]);
ALGEBRAIC[18] =  CONSTANTS[16]*CONSTANTS[23]*(STATES[0] - ALGEBRAIC[0]);
ALGEBRAIC[21] = 1.00000/(1.00000+ 0.124500*exp( - 0.100000*STATES[0]*CONSTANTS[110])+ 0.0365000*CONSTANTS[101]*exp( - STATES[0]*CONSTANTS[110]));
ALGEBRAIC[22] = (( CONSTANTS[16]*CONSTANTS[24]*ALGEBRAIC[21]*CONSTANTS[18])/(1.00000+pow(CONSTANTS[25]/STATES[1], 4.00000)))/(CONSTANTS[18]+CONSTANTS[26]);
ALGEBRAIC[63] = ( CONSTANTS[34]*STATES[0]*CONSTANTS[96]*CONSTANTS[110]*( 0.750000*STATES[1]*exp( STATES[0]*CONSTANTS[110]) -  0.750000*CONSTANTS[19]))/(exp( STATES[0]*CONSTANTS[110]) - 1.00000);
ALGEBRAIC[69] =  CONSTANTS[17]*ALGEBRAIC[63]*STATES[16]*STATES[17]*((1.00000 - STATES[18])+CONSTANTS[93])*pow(CONSTANTS[37], CONSTANTS[111])*0.450000*1.00000;
ALGEBRAIC[73] = 1.00000/(1.00000+pow(CONSTANTS[45]/STATES[4], 2.00000));
ALGEBRAIC[75] =  exp( CONSTANTS[44]*STATES[0]*CONSTANTS[110])*pow(STATES[1], 3.00000)*CONSTANTS[20];
ALGEBRAIC[77] =  exp( (CONSTANTS[44] - 1.00000)*STATES[0]*CONSTANTS[110])*pow(CONSTANTS[19], 3.00000)*STATES[4];
ALGEBRAIC[78] =  CONSTANTS[39]*pow(CONSTANTS[19], 3.00000)*(1.00000+pow(STATES[1]/CONSTANTS[41], 3.00000))+ pow(CONSTANTS[42], 3.00000)*STATES[4]*(1.00000+STATES[4]/CONSTANTS[39])+ CONSTANTS[40]*pow(STATES[1], 3.00000)+ pow(STATES[1], 3.00000)*CONSTANTS[20]+ pow(CONSTANTS[19], 3.00000)*STATES[4];
ALGEBRAIC[81] = (( CONSTANTS[16]*CONSTANTS[38]*pow(CONSTANTS[46], CONSTANTS[111])*ALGEBRAIC[73]*(ALGEBRAIC[75] - ALGEBRAIC[77]))/ALGEBRAIC[78])/(1.00000+ CONSTANTS[43]*exp( (CONSTANTS[44] - 1.00000)*STATES[0]*CONSTANTS[110]));
ALGEBRAIC[102] = ALGEBRAIC[15]+ALGEBRAIC[18]+ 3.00000*ALGEBRAIC[81]+ 3.00000*ALGEBRAIC[22]+ALGEBRAIC[69];
ALGEBRAIC[1] =  (1.00000/CONSTANTS[110])*log(CONSTANTS[19]/STATES[2]);
ALGEBRAIC[16] =  CONSTANTS[99]*CONSTANTS[22]*pow(STATES[6], 3.00000)*STATES[7]*STATES[8]*(STATES[0] - ALGEBRAIC[1]);
ALGEBRAIC[19] =  CONSTANTS[99]*CONSTANTS[23]*(STATES[0] - ALGEBRAIC[1]);
ALGEBRAIC[23] = (( CONSTANTS[99]*CONSTANTS[24]*ALGEBRAIC[21]*CONSTANTS[18])/(1.00000+pow(CONSTANTS[25]/STATES[2], 4.00000)))/(CONSTANTS[18]+CONSTANTS[26]);
ALGEBRAIC[64] = ( CONSTANTS[34]*STATES[0]*CONSTANTS[96]*CONSTANTS[110]*( 0.750000*STATES[2]*exp( STATES[0]*CONSTANTS[110]) -  0.750000*CONSTANTS[19]))/(exp( STATES[0]*CONSTANTS[110]) - 1.00000);
ALGEBRAIC[70] =  CONSTANTS[100]*ALGEBRAIC[64]*STATES[16]*STATES[17]*((1.00000 - STATES[19])+CONSTANTS[92])*pow(CONSTANTS[37], CONSTANTS[111])*0.450000*1.00000;
ALGEBRAIC[74] = 1.00000/(1.00000+pow(CONSTANTS[45]/STATES[5], 2.00000));
ALGEBRAIC[76] =  exp( CONSTANTS[44]*STATES[0]*CONSTANTS[110])*pow(STATES[2], 3.00000)*CONSTANTS[20];
ALGEBRAIC[79] =  exp( (CONSTANTS[44] - 1.00000)*STATES[0]*CONSTANTS[110])*pow(CONSTANTS[19], 3.00000)*STATES[5];
ALGEBRAIC[80] =  CONSTANTS[39]*pow(CONSTANTS[19], 3.00000)*(1.00000+pow(STATES[2]/CONSTANTS[41], 3.00000))+ pow(CONSTANTS[42], 3.00000)*STATES[5]*(1.00000+STATES[5]/CONSTANTS[39])+ CONSTANTS[40]*pow(STATES[2], 3.00000)+ pow(STATES[2], 3.00000)*CONSTANTS[20]+ pow(CONSTANTS[19], 3.00000)*STATES[5];
ALGEBRAIC[82] = (( CONSTANTS[99]*CONSTANTS[38]*pow(CONSTANTS[46], CONSTANTS[111])*ALGEBRAIC[74]*(ALGEBRAIC[76] - ALGEBRAIC[79]))/ALGEBRAIC[80])/(1.00000+ CONSTANTS[43]*exp( (CONSTANTS[44] - 1.00000)*STATES[0]*CONSTANTS[110]));
ALGEBRAIC[103] = ALGEBRAIC[16]+ALGEBRAIC[19]+ 3.00000*ALGEBRAIC[82]+ 3.00000*ALGEBRAIC[23]+ALGEBRAIC[70];
ALGEBRAIC[60] = ( CONSTANTS[35]*4.00000*STATES[0]*CONSTANTS[96]*CONSTANTS[110]*( 0.341000*STATES[4]*exp( 2.00000*STATES[0]*CONSTANTS[110]) -  0.341000*CONSTANTS[20]))/(exp( 2.00000*STATES[0]*CONSTANTS[110]) - 1.00000);
ALGEBRAIC[65] =  CONSTANTS[17]*ALGEBRAIC[60]*STATES[16]*STATES[17]*((1.00000 - STATES[18])+CONSTANTS[93])*pow(CONSTANTS[37], CONSTANTS[111])*0.450000*1.00000;
ALGEBRAIC[84] = ( CONSTANTS[16]*pow(CONSTANTS[50], CONSTANTS[111])*CONSTANTS[47]*pow(STATES[4], 1.60000))/(pow(CONSTANTS[48], 1.60000)+pow(STATES[4], 1.60000));
ALGEBRAIC[3] =  ((1.00000/CONSTANTS[110])/2.00000)*log(CONSTANTS[20]/STATES[4]);
ALGEBRAIC[87] =  CONSTANTS[16]*CONSTANTS[49]*(STATES[0] - ALGEBRAIC[3]);
ALGEBRAIC[107] = (ALGEBRAIC[65]+ALGEBRAIC[87]+ALGEBRAIC[84]) -  2.00000*ALGEBRAIC[81];
ALGEBRAIC[61] = ( CONSTANTS[35]*4.00000*STATES[0]*CONSTANTS[96]*CONSTANTS[110]*( 0.341000*STATES[5]*exp( 2.00000*STATES[0]*CONSTANTS[110]) -  0.341000*CONSTANTS[20]))/(exp( 2.00000*STATES[0]*CONSTANTS[110]) - 1.00000);
ALGEBRAIC[66] =  CONSTANTS[100]*ALGEBRAIC[61]*STATES[16]*STATES[17]*((1.00000 - STATES[19])+CONSTANTS[92])*pow(CONSTANTS[37], CONSTANTS[111])*0.450000*1.00000;
ALGEBRAIC[85] = ( CONSTANTS[99]*pow(CONSTANTS[50], CONSTANTS[111])*CONSTANTS[47]*pow(STATES[5], 1.60000))/(pow(CONSTANTS[48], 1.60000)+pow(STATES[5], 1.60000));
ALGEBRAIC[4] =  ((1.00000/CONSTANTS[110])/2.00000)*log(CONSTANTS[20]/STATES[5]);
ALGEBRAIC[88] =  CONSTANTS[99]*CONSTANTS[49]*(STATES[0] - ALGEBRAIC[4]);
ALGEBRAIC[108] = (ALGEBRAIC[66]+ALGEBRAIC[88]+ALGEBRAIC[85]) -  2.00000*ALGEBRAIC[82];
ALGEBRAIC[24] = ALGEBRAIC[22]+ALGEBRAIC[23];
ALGEBRAIC[2] =  (1.00000/CONSTANTS[110])*log(CONSTANTS[18]/STATES[3]);
ALGEBRAIC[27] = 1.00000/(1.00000+exp((STATES[0]+74.0000)/24.0000));
ALGEBRAIC[28] =  CONSTANTS[102]*STATES[9]*ALGEBRAIC[27]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[29] = 1.00000/(1.00000+exp(7.48800 - STATES[0]/5.98000));
ALGEBRAIC[30] =  CONSTANTS[16]*CONSTANTS[30]*ALGEBRAIC[29]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[31] =  CONSTANTS[99]*CONSTANTS[30]*ALGEBRAIC[29]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[32] = ALGEBRAIC[30]+ALGEBRAIC[31];
ALGEBRAIC[33] =  (1.00000/CONSTANTS[110])*log((CONSTANTS[18]+ CONSTANTS[29]*CONSTANTS[19])/(STATES[3]+ CONSTANTS[29]*STATES[11]));
ALGEBRAIC[36] =  CONSTANTS[16]*CONSTANTS[90]*pow(STATES[10], 2.00000)*(STATES[0] - ALGEBRAIC[33]);
ALGEBRAIC[37] =  CONSTANTS[99]*CONSTANTS[91]*pow(STATES[10], 2.00000)*(STATES[0] - ALGEBRAIC[33]);
ALGEBRAIC[38] = ALGEBRAIC[36]+ALGEBRAIC[37];
ALGEBRAIC[43] =  CONSTANTS[103]*STATES[12]*STATES[13]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[46] =  CONSTANTS[104]*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[18]/5.40000), 1.0 / 2)*ALGEBRAIC[50]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[62] = ( CONSTANTS[36]*STATES[0]*CONSTANTS[96]*CONSTANTS[110]*( 0.750000*STATES[3]*exp( STATES[0]*CONSTANTS[110]) -  0.750000*CONSTANTS[18]))/(exp( STATES[0]*CONSTANTS[110]) - 1.00000);
ALGEBRAIC[68] =  ALGEBRAIC[62]*STATES[16]*STATES[17]*( CONSTANTS[17]*(CONSTANTS[93]+(1.00000 - STATES[18]))+ CONSTANTS[100]*(CONSTANTS[92]+(1.00000 - STATES[19])))*pow(CONSTANTS[37], CONSTANTS[111])*0.450000*1.00000;
ALGEBRAIC[106] = ((ALGEBRAIC[47]+ALGEBRAIC[28]+ALGEBRAIC[38]+ALGEBRAIC[51]) -  2.00000*ALGEBRAIC[24])+ALGEBRAIC[68]+ALGEBRAIC[32];
ALGEBRAIC[109] = ALGEBRAIC[102]+ALGEBRAIC[103];
ALGEBRAIC[52] =  (( CONSTANTS[16]*CONSTANTS[31])/(1.00000+CONSTANTS[33]/STATES[4]))*(STATES[0] - CONSTANTS[123]);
ALGEBRAIC[53] =  (( CONSTANTS[99]*CONSTANTS[31])/(1.00000+CONSTANTS[33]/STATES[5]))*(STATES[0] - CONSTANTS[123]);
ALGEBRAIC[54] = ALGEBRAIC[52]+ALGEBRAIC[53];
ALGEBRAIC[55] =  CONSTANTS[32]*(STATES[0] - CONSTANTS[123]);
ALGEBRAIC[110] = ALGEBRAIC[54]+ALGEBRAIC[55];
ALGEBRAIC[111] = ALGEBRAIC[107]+ALGEBRAIC[108];
ALGEBRAIC[112] = ALGEBRAIC[109]+ALGEBRAIC[110]+ALGEBRAIC[111]+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;
}