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 124 entries in the constant variable array.
 */
/*
 * ALGEBRAIC[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[0] is epi in component parameters (dimensionless).
 * CONSTANTS[1] is R in component parameters (joule_per_kelvin_per_kilomole).
 * CONSTANTS[95] is Frdy in component parameters (coulomb_per_mole).
 * CONSTANTS[105] is Temp in component parameters (kelvin).
 * CONSTANTS[109] is FoRT in component parameters (per_mV).
 * CONSTANTS[2] is Cmem in component parameters (farad).
 * CONSTANTS[110] is Qpow in component parameters (dimensionless).
 * CONSTANTS[3] is cellLength in component parameters (um).
 * CONSTANTS[96] is cellRadius in component parameters (um).
 * CONSTANTS[4] is junctionLength in component parameters (um).
 * CONSTANTS[97] is junctionRadius in component parameters (um).
 * CONSTANTS[5] is distSLcyto in component parameters (um).
 * CONSTANTS[6] is distJuncSL in component parameters (um).
 * CONSTANTS[7] is DcaJuncSL in component parameters (cm2_per_sec).
 * CONSTANTS[8] is DcaSLcyto in component parameters (cm2_per_sec).
 * CONSTANTS[9] is DnaJuncSL in component parameters (cm2_per_sec).
 * CONSTANTS[10] is DnaSLcyto in component parameters (cm2_per_sec).
 * CONSTANTS[106] is Vcell in component parameters (liter).
 * CONSTANTS[111] is Vmyo in component parameters (liter).
 * CONSTANTS[112] is Vsr in component parameters (liter).
 * CONSTANTS[113] is Vsl in component parameters (liter).
 * CONSTANTS[114] is Vjunc in component parameters (liter).
 * CONSTANTS[107] is SAjunc in component parameters (um2).
 * CONSTANTS[108] is SAsl in component parameters (um2).
 * CONSTANTS[11] is J_ca_juncsl in component parameters (liters_per_msec).
 * CONSTANTS[12] is J_ca_slmyo in component parameters (liters_per_msec).
 * CONSTANTS[13] is J_na_juncsl in component parameters (liters_per_msec).
 * CONSTANTS[14] is J_na_slmyo in component parameters (liters_per_msec).
 * CONSTANTS[15] is Fjunc in component parameters (dimensionless).
 * CONSTANTS[98] is Fsl in component parameters (dimensionless).
 * CONSTANTS[16] is Fjunc_CaL in component parameters (dimensionless).
 * CONSTANTS[99] is Fsl_CaL in component parameters (dimensionless).
 * CONSTANTS[115] is Cli in component parameters (mM).
 * CONSTANTS[116] is Clo in component parameters (mM).
 * CONSTANTS[17] is Ko in component parameters (mM).
 * CONSTANTS[18] is Nao in component parameters (mM).
 * CONSTANTS[19] is Cao in component parameters (mM).
 * CONSTANTS[20] is Mgi in component parameters (mM).
 * ALGEBRAIC[1] is ena_junc in component parameters (mV).
 * ALGEBRAIC[2] is ena_sl in component parameters (mV).
 * ALGEBRAIC[3] is ek in component parameters (mV).
 * ALGEBRAIC[4] is eca_junc in component parameters (mV).
 * ALGEBRAIC[5] is eca_sl in component parameters (mV).
 * CONSTANTS[122] is ecl in component parameters (mV).
 * CONSTANTS[21] is GNa in component parameters (mS_per_uF).
 * CONSTANTS[22] is GNaB in component parameters (mS_per_uF).
 * CONSTANTS[23] is IbarNaK in component parameters (uA_per_uF).
 * CONSTANTS[24] is KmNaip in component parameters (mM).
 * CONSTANTS[25] is KmKo in component parameters (mM).
 * CONSTANTS[26] is Q10NaK in component parameters (dimensionless).
 * CONSTANTS[27] is Q10KmNai in component parameters (dimensionless).
 * CONSTANTS[28] is pNaK in component parameters (dimensionless).
 * CONSTANTS[29] is gkp in component parameters (mS_per_uF).
 * CONSTANTS[30] is GClCa in component parameters (mS_per_uF).
 * CONSTANTS[31] is GClB in component parameters (mS_per_uF).
 * CONSTANTS[32] is KdClCa in component parameters (mM).
 * CONSTANTS[33] is pNa in component parameters (cm_per_sec).
 * CONSTANTS[34] is pCa in component parameters (cm_per_sec).
 * CONSTANTS[35] is pK in component parameters (cm_per_sec).
 * CONSTANTS[36] is Q10CaL in component parameters (dimensionless).
 * CONSTANTS[37] is IbarNCX in component parameters (uA_per_uF).
 * CONSTANTS[38] is KmCai in component parameters (mM).
 * CONSTANTS[39] is KmCao in component parameters (mM).
 * CONSTANTS[40] is KmNai in component parameters (mM).
 * CONSTANTS[41] is KmNao in component parameters (mM).
 * CONSTANTS[42] is ksat in component parameters (dimensionless).
 * CONSTANTS[43] is nu in component parameters (dimensionless).
 * CONSTANTS[44] is Kdact in component parameters (mM).
 * CONSTANTS[45] is Q10NCX in component parameters (dimensionless).
 * CONSTANTS[46] is IbarSLCaP in component parameters (uA_per_uF).
 * CONSTANTS[47] is KmPCa in component parameters (mM).
 * CONSTANTS[48] is GCaB in component parameters (mS_per_uF).
 * CONSTANTS[49] is Q10SLCaP in component parameters (dimensionless).
 * CONSTANTS[50] is Q10SRCaP in component parameters (dimensionless).
 * CONSTANTS[51] is Vmax_SRCaP in component parameters (mM_per_msec).
 * CONSTANTS[52] is Kmf in component parameters (mM).
 * CONSTANTS[53] is Kmr in component parameters (mM).
 * CONSTANTS[54] is hillSRCaP in component parameters (dimensionless).
 * CONSTANTS[55] is ks in component parameters (per_msec).
 * CONSTANTS[56] is koCa in component parameters (per_mM2_per_msec).
 * CONSTANTS[57] is kom in component parameters (per_msec).
 * CONSTANTS[104] is kiCa in component parameters (per_mM_per_msec).
 * CONSTANTS[58] is kim in component parameters (per_msec).
 * CONSTANTS[59] is ec50SR in component parameters (mM).
 * CONSTANTS[60] is Bmax_Naj in component parameters (mM).
 * CONSTANTS[61] is Bmax_Nasl in component parameters (mM).
 * CONSTANTS[62] is koff_na in component parameters (per_msec).
 * CONSTANTS[63] is kon_na in component parameters (per_mM_per_msec).
 * CONSTANTS[64] is Bmax_TnClow in component parameters (mM).
 * CONSTANTS[65] is koff_tncl in component parameters (per_msec).
 * CONSTANTS[66] is kon_tncl in component parameters (per_mM_per_msec).
 * CONSTANTS[67] is Bmax_TnChigh in component parameters (mM).
 * CONSTANTS[68] is koff_tnchca in component parameters (per_msec).
 * CONSTANTS[69] is kon_tnchca in component parameters (per_mM_per_msec).
 * CONSTANTS[70] is koff_tnchmg in component parameters (per_msec).
 * CONSTANTS[71] is kon_tnchmg in component parameters (per_mM_per_msec).
 * CONSTANTS[72] is Bmax_CaM in component parameters (mM).
 * CONSTANTS[73] is koff_cam in component parameters (per_msec).
 * CONSTANTS[74] is kon_cam in component parameters (per_mM_per_msec).
 * CONSTANTS[75] is Bmax_myosin in component parameters (mM).
 * CONSTANTS[76] is koff_myoca in component parameters (per_msec).
 * CONSTANTS[77] is kon_myoca in component parameters (per_mM_per_msec).
 * CONSTANTS[78] is koff_myomg in component parameters (per_msec).
 * CONSTANTS[79] is kon_myomg in component parameters (per_mM_per_msec).
 * CONSTANTS[80] is Bmax_SR in component parameters (mM).
 * CONSTANTS[81] is koff_sr in component parameters (per_msec).
 * CONSTANTS[82] is kon_sr in component parameters (per_mM_per_msec).
 * CONSTANTS[117] is Bmax_SLlowsl in component parameters (mM).
 * CONSTANTS[118] is Bmax_SLlowj in component parameters (mM).
 * CONSTANTS[83] is koff_sll in component parameters (per_msec).
 * CONSTANTS[84] is kon_sll in component parameters (per_mM_per_msec).
 * CONSTANTS[119] is Bmax_SLhighsl in component parameters (mM).
 * CONSTANTS[120] is Bmax_SLhighj in component parameters (mM).
 * CONSTANTS[85] is koff_slh in component parameters (per_msec).
 * CONSTANTS[86] is kon_slh in component parameters (per_mM_per_msec).
 * CONSTANTS[121] is Bmax_Csqn in component parameters (mM).
 * CONSTANTS[87] is koff_csqn in component parameters (per_msec).
 * CONSTANTS[88] 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[6] is mss in component I_Na (dimensionless).
 * ALGEBRAIC[7] is taum in component I_Na (msec).
 * ALGEBRAIC[8] is ah in component I_Na (dimensionless).
 * ALGEBRAIC[9] is bh in component I_Na (dimensionless).
 * ALGEBRAIC[10] is tauh in component I_Na (msec).
 * ALGEBRAIC[11] is hss in component I_Na (dimensionless).
 * ALGEBRAIC[12] is aj in component I_Na (dimensionless).
 * ALGEBRAIC[13] is bj in component I_Na (dimensionless).
 * ALGEBRAIC[14] is tauj in component I_Na (msec).
 * ALGEBRAIC[15] 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[16] is I_Na_junc in component I_Na (uA_per_uF).
 * ALGEBRAIC[17] is I_Na_sl in component I_Na (uA_per_uF).
 * ALGEBRAIC[18] is I_Na in component I_Na (uA_per_uF).
 * ALGEBRAIC[19] is I_nabk_junc in component I_NaBK (uA_per_uF).
 * ALGEBRAIC[20] is I_nabk_sl in component I_NaBK (uA_per_uF).
 * ALGEBRAIC[21] is I_nabk in component I_NaBK (uA_per_uF).
 * CONSTANTS[100] is sigma in component I_NaK (dimensionless).
 * ALGEBRAIC[22] is fnak in component I_NaK (dimensionless).
 * ALGEBRAIC[23] is I_nak_junc in component I_NaK (uA_per_uF).
 * ALGEBRAIC[24] is I_nak_sl in component I_NaK (uA_per_uF).
 * ALGEBRAIC[25] is I_nak in component I_NaK (uA_per_uF).
 * CONSTANTS[101] is gkr in component I_Kr (mS_per_uF).
 * ALGEBRAIC[26] is xrss in component I_Kr (dimensionless).
 * ALGEBRAIC[27] is tauxr in component I_Kr (msec).
 * STATES[9] is x_kr in component I_Kr (dimensionless).
 * ALGEBRAIC[28] is rkr in component I_Kr (dimensionless).
 * ALGEBRAIC[29] is I_kr in component I_Kr (uA_per_uF).
 * ALGEBRAIC[30] is kp_kp in component I_Kp (dimensionless).
 * ALGEBRAIC[31] is I_kp_junc in component I_Kp (uA_per_uF).
 * ALGEBRAIC[32] is I_kp_sl in component I_Kp (uA_per_uF).
 * ALGEBRAIC[33] is I_kp in component I_Kp (uA_per_uF).
 * ALGEBRAIC[34] is eks in component I_Ks (mV).
 * CONSTANTS[89] is gks_junc in component I_Ks (mS_per_uF).
 * CONSTANTS[90] is gks_sl in component I_Ks (mS_per_uF).
 * ALGEBRAIC[35] is xsss in component I_Ks (dimensionless).
 * ALGEBRAIC[36] is tauxs in component I_Ks (msec).
 * STATES[10] is x_ks in component I_Ks (dimensionless).
 * ALGEBRAIC[37] is I_ks_junc in component I_Ks (uA_per_uF).
 * ALGEBRAIC[38] is I_ks_sl in component I_Ks (uA_per_uF).
 * ALGEBRAIC[39] is I_ks in component I_Ks (uA_per_uF).
 * STATES[11] is Na_i in component Na_Concentrations (mM).
 * CONSTANTS[102] is GtoSlow in component I_to (mS_per_uF).
 * CONSTANTS[103] is GtoFast in component I_to (mS_per_uF).
 * ALGEBRAIC[40] is xtoss in component I_to (dimensionless).
 * ALGEBRAIC[41] is ytoss in component I_to (dimensionless).
 * ALGEBRAIC[42] is tauxtos in component I_to (msec).
 * ALGEBRAIC[43] 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[44] is I_tos in component I_to (uA_per_uF).
 * ALGEBRAIC[45] is tauxtof in component I_to (msec).
 * ALGEBRAIC[46] 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[47] is I_tof in component I_to (uA_per_uF).
 * ALGEBRAIC[48] is I_to in component I_to (uA_per_uF).
 * ALGEBRAIC[49] is aki in component I_Ki (dimensionless).
 * ALGEBRAIC[50] is bki in component I_Ki (dimensionless).
 * ALGEBRAIC[51] is kiss in component I_Ki (dimensionless).
 * ALGEBRAIC[52] is I_ki in component I_Ki (uA_per_uF).
 * ALGEBRAIC[53] is I_ClCa_junc in component I_ClCa (uA_per_uF).
 * ALGEBRAIC[54] is I_ClCa_sl in component I_ClCa (uA_per_uF).
 * ALGEBRAIC[55] is I_ClCa in component I_ClCa (uA_per_uF).
 * ALGEBRAIC[56] is I_Clbk in component I_ClCa (uA_per_uF).
 * ALGEBRAIC[57] is fss in component I_Ca (dimensionless).
 * ALGEBRAIC[58] is dss in component I_Ca (dimensionless).
 * ALGEBRAIC[59] is taud in component I_Ca (msec).
 * ALGEBRAIC[60] 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[91] is fcaCaMSL in component I_Ca (dimensionless).
 * CONSTANTS[92] is fcaCaj in component I_Ca (dimensionless).
 * ALGEBRAIC[61] is ibarca_j in component I_Ca (uA_per_uF).
 * ALGEBRAIC[62] is ibarca_sl in component I_Ca (uA_per_uF).
 * ALGEBRAIC[63] is ibark in component I_Ca (uA_per_uF).
 * ALGEBRAIC[64] is ibarna_j in component I_Ca (uA_per_uF).
 * ALGEBRAIC[65] is ibarna_sl in component I_Ca (uA_per_uF).
 * ALGEBRAIC[66] is I_Ca_junc in component I_Ca (uA_per_uF).
 * ALGEBRAIC[67] is I_Ca_sl in component I_Ca (uA_per_uF).
 * ALGEBRAIC[68] is I_Ca in component I_Ca (uA_per_uF).
 * ALGEBRAIC[69] is I_CaK in component I_Ca (uA_per_uF).
 * ALGEBRAIC[70] is I_CaNa_junc in component I_Ca (uA_per_uF).
 * ALGEBRAIC[71] is I_CaNa_sl in component I_Ca (uA_per_uF).
 * ALGEBRAIC[72] is I_CaNa in component I_Ca (uA_per_uF).
 * ALGEBRAIC[73] is I_Catot in component I_Ca (uA_per_uF).
 * ALGEBRAIC[74] is Ka_junc in component I_NCX (dimensionless).
 * ALGEBRAIC[75] is Ka_sl in component I_NCX (dimensionless).
 * ALGEBRAIC[76] is s1_junc in component I_NCX (mM4).
 * ALGEBRAIC[77] is s1_sl in component I_NCX (mM4).
 * ALGEBRAIC[78] is s2_junc in component I_NCX (mM4).
 * ALGEBRAIC[79] is s3_junc in component I_NCX (mM4).
 * ALGEBRAIC[80] is s2_sl in component I_NCX (mM4).
 * ALGEBRAIC[81] is s3_sl in component I_NCX (mM4).
 * ALGEBRAIC[82] is I_ncx_junc in component I_NCX (uA_per_uF).
 * ALGEBRAIC[83] is I_ncx_sl in component I_NCX (uA_per_uF).
 * ALGEBRAIC[84] is I_ncx in component I_NCX (uA_per_uF).
 * ALGEBRAIC[85] is I_pca_junc in component I_PCa (uA_per_uF).
 * ALGEBRAIC[86] is I_pca_sl in component I_PCa (uA_per_uF).
 * ALGEBRAIC[87] is I_pca in component I_PCa (uA_per_uF).
 * ALGEBRAIC[88] is I_cabk_junc in component I_CaBK (uA_per_uF).
 * ALGEBRAIC[89] is I_cabk_sl in component I_CaBK (uA_per_uF).
 * ALGEBRAIC[90] is I_cabk in component I_CaBK (uA_per_uF).
 * CONSTANTS[93] is MaxSR in component SR_Fluxes (dimensionless).
 * CONSTANTS[94] is MinSR in component SR_Fluxes (dimensionless).
 * ALGEBRAIC[91] is kCaSR in component SR_Fluxes (dimensionless).
 * ALGEBRAIC[92] is koSRCa in component SR_Fluxes (per_mM2_per_msec).
 * ALGEBRAIC[93] is kiSRCa in component SR_Fluxes (per_mM_per_msec).
 * ALGEBRAIC[94] 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[95] is J_SRCarel in component SR_Fluxes (mM_per_msec).
 * ALGEBRAIC[96] is J_serca in component SR_Fluxes (mM_per_msec).
 * ALGEBRAIC[97] 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[98] is dNa_Bj_dt in component Na_Buffers (mM_per_msec).
 * ALGEBRAIC[99] 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[100] 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[101] is J_CaB_junction in component Junctional_and_SL_Ca_Buffers (mM_per_msec).
 * ALGEBRAIC[102] 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[103] is I_Na_tot_junc in component Na_Concentrations (uA_per_uF).
 * ALGEBRAIC[104] is I_Na_tot_sl in component Na_Concentrations (uA_per_uF).
 * ALGEBRAIC[105] is I_Na_tot_sl2 in component Na_Concentrations (uA_per_uF).
 * ALGEBRAIC[106] is I_Na_tot_junc2 in component Na_Concentrations (uA_per_uF).
 * ALGEBRAIC[107] is I_K_tot in component K_Concentration (uA_per_uF).
 * ALGEBRAIC[108] is I_Ca_tot_junc in component Ca_Concentrations (uA_per_uF).
 * ALGEBRAIC[109] 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).
 * 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 9 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
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[0] = 1.00000;
CONSTANTS[1] = 8314.00;
CONSTANTS[2] = 1.38100e-10;
CONSTANTS[3] = 100.000;
CONSTANTS[4] = 0.160000;
CONSTANTS[5] = 0.450000;
CONSTANTS[6] = 0.500000;
CONSTANTS[7] = 1.64000e-06;
CONSTANTS[8] = 1.22000e-06;
CONSTANTS[9] = 1.09000e-05;
CONSTANTS[10] = 1.79000e-05;
CONSTANTS[11] = 8.24130e-13;
CONSTANTS[12] = 3.27430e-12;
CONSTANTS[13] = 1.83130e-14;
CONSTANTS[14] = 1.63860e-12;
CONSTANTS[15] = 0.110000;
CONSTANTS[16] = 0.900000;
CONSTANTS[17] = 5.40000;
CONSTANTS[18] = 140.000;
CONSTANTS[19] = 1.80000;
CONSTANTS[20] = 1.00000;
CONSTANTS[21] = 23.0000;
CONSTANTS[22] = 0.000597000;
CONSTANTS[23] =  1.00000*1.80000;
CONSTANTS[24] = 11.0000;
CONSTANTS[25] = 1.50000;
CONSTANTS[26] = 1.63000;
CONSTANTS[27] = 1.39000;
CONSTANTS[28] = 0.0183300;
CONSTANTS[29] =  2.00000*0.00100000;
CONSTANTS[30] =  0.500000*0.109625;
CONSTANTS[31] =  1.00000*0.00900000;
CONSTANTS[32] = 0.100000;
CONSTANTS[33] =  0.500000*1.50000e-08;
CONSTANTS[34] =  0.500000*0.000540000;
CONSTANTS[35] =  0.500000*2.70000e-07;
CONSTANTS[36] = 1.80000;
CONSTANTS[37] =  1.00000*4.50000;
CONSTANTS[38] = 0.00359000;
CONSTANTS[39] = 1.30000;
CONSTANTS[40] = 12.2900;
CONSTANTS[41] = 87.5000;
CONSTANTS[42] = 0.320000;
CONSTANTS[43] = 0.270000;
CONSTANTS[44] = 0.000150000;
CONSTANTS[45] = 1.57000;
CONSTANTS[46] = 0.0673000;
CONSTANTS[47] = 0.000500000;
CONSTANTS[48] = 0.000551300;
CONSTANTS[49] = 2.35000;
CONSTANTS[50] = 2.60000;
CONSTANTS[51] = 0.00531140;
CONSTANTS[52] = 0.000246000;
CONSTANTS[53] = 1.70000;
CONSTANTS[54] = 1.78700;
CONSTANTS[55] = 25.0000;
CONSTANTS[56] = 10.0000;
CONSTANTS[57] = 0.0600000;
CONSTANTS[58] = 0.00500000;
CONSTANTS[59] = 0.450000;
CONSTANTS[60] = 7.56100;
CONSTANTS[61] = 1.65000;
CONSTANTS[62] = 0.00100000;
CONSTANTS[63] = 0.000100000;
CONSTANTS[64] = 0.0700000;
CONSTANTS[65] = 0.0196000;
CONSTANTS[66] = 32.7000;
CONSTANTS[67] = 0.140000;
CONSTANTS[68] = 3.20000e-05;
CONSTANTS[69] = 2.37000;
CONSTANTS[70] = 0.00333000;
CONSTANTS[71] = 0.00300000;
CONSTANTS[72] = 0.0240000;
CONSTANTS[73] = 0.238000;
CONSTANTS[74] = 34.0000;
CONSTANTS[75] = 0.140000;
CONSTANTS[76] = 0.000460000;
CONSTANTS[77] = 13.8000;
CONSTANTS[78] = 5.70000e-05;
CONSTANTS[79] = 0.0157000;
CONSTANTS[80] =  19.0000*0.000900000;
CONSTANTS[81] = 0.0600000;
CONSTANTS[82] = 100.000;
CONSTANTS[83] = 1.30000;
CONSTANTS[84] = 100.000;
CONSTANTS[85] = 0.0300000;
CONSTANTS[86] = 100.000;
CONSTANTS[87] = 65.0000;
CONSTANTS[88] = 100.000;
CONSTANTS[89] = 0.00350000;
CONSTANTS[90] = 0.00350000;
CONSTANTS[91] = 0.00000;
CONSTANTS[92] = 0.00000;
CONSTANTS[93] = 15.0000;
CONSTANTS[94] = 1.00000;
CONSTANTS[123] = 0.00000;
CONSTANTS[95] = 96485.0;
CONSTANTS[96] = 10.2500;
CONSTANTS[97] = 0.0150000;
CONSTANTS[98] = 1.00000 - CONSTANTS[15];
CONSTANTS[99] = 1.00000 - CONSTANTS[16];
CONSTANTS[100] = (exp(CONSTANTS[18]/67.3000) - 1.00000)/7.00000;
CONSTANTS[101] =  0.0350000* pow((CONSTANTS[17]/5.40000), 1.0 / 2);
CONSTANTS[102] = (CONSTANTS[0]==1.00000 ?  1.00000*0.130000*0.120000 :  0.130000*0.300000*0.964000);
CONSTANTS[103] = (CONSTANTS[0]==1.00000 ?  1.00000*0.130000*0.880000 :  0.130000*0.300000*0.0360000);
CONSTANTS[104] = 0.500000;
CONSTANTS[105] = 310.000;
CONSTANTS[106] =   3.14159265358979*pow(CONSTANTS[96], 2.00000)*CONSTANTS[3]*1.00000e-15;
CONSTANTS[107] =  20150.0* 3.14159265358979*2.00000*CONSTANTS[4]*CONSTANTS[97];
CONSTANTS[108] =   3.14159265358979*2.00000*CONSTANTS[96]*CONSTANTS[3];
CONSTANTS[109] = CONSTANTS[95]/( CONSTANTS[1]*CONSTANTS[105]);
CONSTANTS[110] = (CONSTANTS[105] - 310.000)/10.0000;
CONSTANTS[111] =  0.650000*CONSTANTS[106];
CONSTANTS[112] =  0.0350000*CONSTANTS[106];
CONSTANTS[113] =  0.0200000*CONSTANTS[106];
CONSTANTS[114] =  0.0539000*0.0100000*CONSTANTS[106];
CONSTANTS[115] = 15.0000;
CONSTANTS[116] = 150.000;
CONSTANTS[117] = ( 0.0374000*CONSTANTS[111])/CONSTANTS[113];
CONSTANTS[118] =  (( 0.00460000*CONSTANTS[111])/CONSTANTS[114])*0.100000;
CONSTANTS[119] = ( 0.0134000*CONSTANTS[111])/CONSTANTS[113];
CONSTANTS[120] =  (( 0.00165000*CONSTANTS[111])/CONSTANTS[114])*0.100000;
CONSTANTS[121] = ( 0.140000*CONSTANTS[111])/CONSTANTS[112];
CONSTANTS[122] =  (1.00000/CONSTANTS[109])*log(CONSTANTS[115]/CONSTANTS[116]);
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[123] = 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[6] - STATES[6])/ALGEBRAIC[7];
resid[1] = RATES[7] - (ALGEBRAIC[11] - STATES[7])/ALGEBRAIC[10];
resid[2] = RATES[8] - (ALGEBRAIC[15] - STATES[8])/ALGEBRAIC[14];
resid[3] = RATES[9] - (ALGEBRAIC[26] - STATES[9])/ALGEBRAIC[27];
resid[4] = RATES[10] - (ALGEBRAIC[35] - STATES[10])/ALGEBRAIC[36];
resid[5] = RATES[12] - (ALGEBRAIC[40] - STATES[12])/ALGEBRAIC[42];
resid[6] = RATES[13] - (ALGEBRAIC[41] - STATES[13])/ALGEBRAIC[43];
resid[7] = RATES[14] - (ALGEBRAIC[40] - STATES[14])/ALGEBRAIC[45];
resid[8] = RATES[15] - (ALGEBRAIC[41] - STATES[15])/ALGEBRAIC[46];
resid[9] = RATES[16] - (ALGEBRAIC[58] - STATES[16])/ALGEBRAIC[59];
resid[10] = RATES[17] - (ALGEBRAIC[57] - STATES[17])/ALGEBRAIC[60];
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[58]*ALGEBRAIC[94] -  ALGEBRAIC[93]*STATES[4]*STATES[20]) - ( ALGEBRAIC[92]*pow(STATES[4], 2.00000)*STATES[20] -  CONSTANTS[57]*STATES[21]);
resid[14] = RATES[21] - ( ALGEBRAIC[92]*pow(STATES[4], 2.00000)*STATES[20] -  CONSTANTS[57]*STATES[21]) - ( ALGEBRAIC[93]*STATES[4]*STATES[21] -  CONSTANTS[58]*STATES[22]);
resid[15] = RATES[22] - ( ALGEBRAIC[93]*STATES[4]*STATES[21] -  CONSTANTS[58]*STATES[22]) - ( CONSTANTS[57]*STATES[22] -  ALGEBRAIC[92]*pow(STATES[4], 2.00000)*ALGEBRAIC[94]);
resid[16] = RATES[25] - ALGEBRAIC[98];
resid[17] = RATES[26] - ALGEBRAIC[99];
resid[18] = RATES[27] -  CONSTANTS[66]*STATES[24]*(CONSTANTS[64] - STATES[27]) -  CONSTANTS[65]*STATES[27];
resid[19] = RATES[28] -  CONSTANTS[69]*STATES[24]*((CONSTANTS[67] - STATES[28]) - STATES[29]) -  CONSTANTS[68]*STATES[28];
resid[20] = RATES[29] -  CONSTANTS[71]*CONSTANTS[20]*((CONSTANTS[67] - STATES[28]) - STATES[29]) -  CONSTANTS[70]*STATES[29];
resid[21] = RATES[30] -  CONSTANTS[74]*STATES[24]*(CONSTANTS[72] - STATES[30]) -  CONSTANTS[73]*STATES[30];
resid[22] = RATES[31] -  CONSTANTS[77]*STATES[24]*((CONSTANTS[75] - STATES[31]) - STATES[32]) -  CONSTANTS[76]*STATES[31];
resid[23] = RATES[32] -  CONSTANTS[79]*CONSTANTS[20]*((CONSTANTS[75] - STATES[31]) - STATES[32]) -  CONSTANTS[78]*STATES[32];
resid[24] = RATES[33] -  CONSTANTS[82]*STATES[24]*(CONSTANTS[80] - STATES[33]) -  CONSTANTS[81]*STATES[33];
resid[25] = RATES[34] -  CONSTANTS[84]*STATES[4]*(CONSTANTS[118] - STATES[34]) -  CONSTANTS[83]*STATES[34];
resid[26] = RATES[35] -  CONSTANTS[84]*STATES[5]*(CONSTANTS[117] - STATES[35]) -  CONSTANTS[83]*STATES[35];
resid[27] = RATES[36] -  CONSTANTS[86]*STATES[4]*(CONSTANTS[120] - STATES[36]) -  CONSTANTS[85]*STATES[36];
resid[28] = RATES[37] -  CONSTANTS[86]*STATES[5]*(CONSTANTS[119] - STATES[37]) -  CONSTANTS[85]*STATES[37];
resid[29] = RATES[38] -  CONSTANTS[88]*STATES[23]*(CONSTANTS[121] - STATES[38]) -  CONSTANTS[87]*STATES[38];
resid[30] = RATES[23] - (ALGEBRAIC[96] - (( ALGEBRAIC[97]*CONSTANTS[111])/CONSTANTS[112]+ALGEBRAIC[95])) - ( CONSTANTS[88]*STATES[23]*(CONSTANTS[121] - STATES[38]) -  CONSTANTS[87]*STATES[38]);
resid[31] = RATES[1] - (( - ALGEBRAIC[103]*CONSTANTS[2])/( CONSTANTS[114]*CONSTANTS[95])+ (CONSTANTS[13]/CONSTANTS[114])*(STATES[2] - STATES[1])) - ALGEBRAIC[98];
resid[32] = RATES[2] - (( - ALGEBRAIC[104]*CONSTANTS[2])/( CONSTANTS[113]*CONSTANTS[95])+ (CONSTANTS[13]/CONSTANTS[113])*(STATES[1] - STATES[2])+ (CONSTANTS[14]/CONSTANTS[113])*(STATES[11] - STATES[2])) - ALGEBRAIC[99];
resid[33] = RATES[11] -  (CONSTANTS[14]/CONSTANTS[111])*(STATES[2] - STATES[11]);
resid[34] = RATES[4] - ((( - ALGEBRAIC[108]*CONSTANTS[2])/( CONSTANTS[114]*2.00000*CONSTANTS[95])+ (CONSTANTS[11]/CONSTANTS[114])*(STATES[5] - STATES[4])) - ALGEBRAIC[101])+( ALGEBRAIC[95]*CONSTANTS[112])/CONSTANTS[114]+( ALGEBRAIC[97]*CONSTANTS[111])/CONSTANTS[114];
resid[35] = RATES[5] - (( - ALGEBRAIC[109]*CONSTANTS[2])/( CONSTANTS[113]*2.00000*CONSTANTS[95])+ (CONSTANTS[11]/CONSTANTS[113])*(STATES[4] - STATES[5])+ (CONSTANTS[12]/CONSTANTS[113])*(STATES[24] - STATES[5])) - ALGEBRAIC[102];
resid[36] = RATES[24] - (( - ALGEBRAIC[96]*CONSTANTS[112])/CONSTANTS[111] - ALGEBRAIC[100])+ (CONSTANTS[12]/CONSTANTS[111])*(STATES[5] - STATES[24]);
resid[37] = RATES[0] - - (ALGEBRAIC[113] - ALGEBRAIC[0]);
resid[38] = RATES[3] - CONSTANTS[123];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[18] = ALGEBRAIC[16]+ALGEBRAIC[17];
ALGEBRAIC[21] = ALGEBRAIC[19]+ALGEBRAIC[20];
ALGEBRAIC[68] = ALGEBRAIC[66]+ALGEBRAIC[67];
ALGEBRAIC[72] = ALGEBRAIC[70]+ALGEBRAIC[71];
ALGEBRAIC[73] = ALGEBRAIC[68]+ALGEBRAIC[69]+ALGEBRAIC[72];
ALGEBRAIC[84] = ALGEBRAIC[82]+ALGEBRAIC[83];
ALGEBRAIC[87] = ALGEBRAIC[85]+ALGEBRAIC[86];
ALGEBRAIC[90] = ALGEBRAIC[88]+ALGEBRAIC[89];
ALGEBRAIC[105] =  3.00000*ALGEBRAIC[83]+ 3.00000*ALGEBRAIC[24]+ALGEBRAIC[71];
ALGEBRAIC[106] =  3.00000*ALGEBRAIC[82]+ 3.00000*ALGEBRAIC[23]+ALGEBRAIC[70];
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = (CONDVAR[0]>0.00000&&CONDVAR[1]<0.00000&&CONDVAR[2]<=0.00000 ? 10.0000 : CONDVAR[3]>0.00000&&CONDVAR[4]<=0.00000 ? 10.0000 : 0.00000);
ALGEBRAIC[6] = 1.00000/pow(1.00000+exp(- (56.8600+STATES[0])/9.03000), 2.00000);
ALGEBRAIC[7] =  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[8] = (CONDVAR[5]>=0.00000 ? 0.00000 :  0.0570000*exp(- (STATES[0]+80.0000)/6.80000));
ALGEBRAIC[9] = (CONDVAR[6]>=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[10] = 1.00000/(ALGEBRAIC[8]+ALGEBRAIC[9]);
ALGEBRAIC[11] = 1.00000/pow(1.00000+exp((STATES[0]+71.5500)/7.43000), 2.00000);
ALGEBRAIC[12] = (CONDVAR[7]>=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[13] = (CONDVAR[8]>=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[14] = 1.00000/(ALGEBRAIC[12]+ALGEBRAIC[13]);
ALGEBRAIC[15] = 1.00000/pow(1.00000+exp((STATES[0]+71.5500)/7.43000), 2.00000);
ALGEBRAIC[26] = 1.00000/(1.00000+exp(- (STATES[0]+10.0000)/5.00000));
ALGEBRAIC[27] = ( (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[35] = 1.00000/(1.00000+exp(- (STATES[0]+3.80000)/14.2500));
ALGEBRAIC[36] = 990.100/(1.00000+exp(- (STATES[0]+2.43600)/14.1200));
ALGEBRAIC[40] = 1.00000/(1.00000+exp(- (STATES[0] - 19.0000)/13.0000));
ALGEBRAIC[41] = 1.00000/(1.00000+exp((STATES[0]+19.5000)/5.00000));
ALGEBRAIC[42] = 9.00000/(1.00000+exp((STATES[0]+3.00000)/15.0000))+0.500000;
ALGEBRAIC[43] = 800.000/(1.00000+exp((STATES[0]+60.0000)/10.0000))+30.0000;
ALGEBRAIC[45] =  8.50000*exp(- pow((STATES[0]+45.0000)/50.0000, 2.00000))+0.500000;
ALGEBRAIC[46] =  85.0000*exp(- pow(STATES[0]+40.0000, 2.00000)/220.000)+7.00000;
ALGEBRAIC[57] = 1.00000/(1.00000+exp((STATES[0]+35.0000)/9.00000))+0.600000/(1.00000+exp((50.0000 - STATES[0])/20.0000));
ALGEBRAIC[58] = 1.00000/(1.00000+exp(- (STATES[0]+5.00000)/6.00000));
ALGEBRAIC[59] = ( 1.00000*ALGEBRAIC[58]*(1.00000 - exp(- (STATES[0]+5.00000)/6.00000)))/( 0.0350000*(STATES[0]+5.00000));
ALGEBRAIC[60] = 1.00000/( 0.0197000*exp(- pow( 0.0337000*(STATES[0]+14.5000), 2.00000))+0.0200000);
ALGEBRAIC[91] = CONSTANTS[93] - (CONSTANTS[93] - CONSTANTS[94])/(1.00000+pow(CONSTANTS[59]/STATES[23], 2.50000));
ALGEBRAIC[92] = CONSTANTS[56]/ALGEBRAIC[91];
ALGEBRAIC[93] =  CONSTANTS[104]*ALGEBRAIC[91];
ALGEBRAIC[94] = ((1.00000 - STATES[20]) - STATES[21]) - STATES[22];
ALGEBRAIC[95] =  (( CONSTANTS[55]*STATES[21])/1.00000)*(STATES[23] - STATES[4]);
ALGEBRAIC[96] = ( pow(CONSTANTS[50], CONSTANTS[110])*CONSTANTS[51]*(pow(STATES[24]/CONSTANTS[52], CONSTANTS[54]) - pow(STATES[23]/CONSTANTS[53], CONSTANTS[54])))/(1.00000+pow(STATES[24]/CONSTANTS[52], CONSTANTS[54])+pow(STATES[23]/CONSTANTS[53], CONSTANTS[54]));
ALGEBRAIC[97] =  5.34800e-06*(STATES[23] - STATES[4]);
ALGEBRAIC[98] =  CONSTANTS[63]*STATES[1]*(CONSTANTS[60] - STATES[25]) -  CONSTANTS[62]*STATES[25];
ALGEBRAIC[99] =  CONSTANTS[63]*STATES[2]*(CONSTANTS[61] - STATES[26]) -  CONSTANTS[62]*STATES[26];
ALGEBRAIC[100] = ((((((((((( CONSTANTS[66]*STATES[24]*(CONSTANTS[64] - STATES[27]) -  CONSTANTS[65]*STATES[27])+ CONSTANTS[69]*STATES[24]*((CONSTANTS[67] - STATES[28]) - STATES[29])) -  CONSTANTS[68]*STATES[28])+ CONSTANTS[71]*CONSTANTS[20]*((CONSTANTS[67] - STATES[28]) - STATES[29])) -  CONSTANTS[70]*STATES[29])+ CONSTANTS[74]*STATES[24]*(CONSTANTS[72] - STATES[30])) -  CONSTANTS[73]*STATES[30])+ CONSTANTS[77]*STATES[24]*((CONSTANTS[75] - STATES[31]) - STATES[32])) -  CONSTANTS[76]*STATES[31])+ CONSTANTS[79]*CONSTANTS[20]*((CONSTANTS[75] - STATES[31]) - STATES[32])) -  CONSTANTS[78]*STATES[32])+( CONSTANTS[82]*STATES[24]*(CONSTANTS[80] - STATES[33]) -  CONSTANTS[81]*STATES[33]);
ALGEBRAIC[101] = ( CONSTANTS[84]*STATES[4]*(CONSTANTS[118] - STATES[34]) -  CONSTANTS[83]*STATES[34])+( CONSTANTS[86]*STATES[4]*(CONSTANTS[120] - STATES[36]) -  CONSTANTS[85]*STATES[36]);
ALGEBRAIC[102] = ( CONSTANTS[84]*STATES[5]*(CONSTANTS[117] - STATES[35]) -  CONSTANTS[83]*STATES[35])+( CONSTANTS[86]*STATES[5]*(CONSTANTS[119] - STATES[37]) -  CONSTANTS[85]*STATES[37]);
ALGEBRAIC[1] =  (1.00000/CONSTANTS[109])*log(CONSTANTS[18]/STATES[1]);
ALGEBRAIC[16] =  CONSTANTS[15]*CONSTANTS[21]*pow(STATES[6], 3.00000)*STATES[7]*STATES[8]*(STATES[0] - ALGEBRAIC[1]);
ALGEBRAIC[19] =  CONSTANTS[15]*CONSTANTS[22]*(STATES[0] - ALGEBRAIC[1]);
ALGEBRAIC[22] = 1.00000/(1.00000+ 0.124500*exp( - 0.100000*STATES[0]*CONSTANTS[109])+ 0.0365000*CONSTANTS[100]*exp( - STATES[0]*CONSTANTS[109]));
ALGEBRAIC[23] = (( CONSTANTS[15]*CONSTANTS[23]*ALGEBRAIC[22]*CONSTANTS[17])/(1.00000+pow(CONSTANTS[24]/STATES[1], 4.00000)))/(CONSTANTS[17]+CONSTANTS[25]);
ALGEBRAIC[64] = ( CONSTANTS[33]*STATES[0]*CONSTANTS[95]*CONSTANTS[109]*( 0.750000*STATES[1]*exp( STATES[0]*CONSTANTS[109]) -  0.750000*CONSTANTS[18]))/(exp( STATES[0]*CONSTANTS[109]) - 1.00000);
ALGEBRAIC[70] =  CONSTANTS[16]*ALGEBRAIC[64]*STATES[16]*STATES[17]*((1.00000 - STATES[18])+CONSTANTS[92])*pow(CONSTANTS[36], CONSTANTS[110])*0.450000*1.00000;
ALGEBRAIC[74] = 1.00000/(1.00000+pow(CONSTANTS[44]/STATES[4], 2.00000));
ALGEBRAIC[76] =  exp( CONSTANTS[43]*STATES[0]*CONSTANTS[109])*pow(STATES[1], 3.00000)*CONSTANTS[19];
ALGEBRAIC[78] =  exp( (CONSTANTS[43] - 1.00000)*STATES[0]*CONSTANTS[109])*pow(CONSTANTS[18], 3.00000)*STATES[4];
ALGEBRAIC[79] =  CONSTANTS[38]*pow(CONSTANTS[18], 3.00000)*(1.00000+pow(STATES[1]/CONSTANTS[40], 3.00000))+ pow(CONSTANTS[41], 3.00000)*STATES[4]*(1.00000+STATES[4]/CONSTANTS[38])+ CONSTANTS[39]*pow(STATES[1], 3.00000)+ pow(STATES[1], 3.00000)*CONSTANTS[19]+ pow(CONSTANTS[18], 3.00000)*STATES[4];
ALGEBRAIC[82] = (( CONSTANTS[15]*CONSTANTS[37]*pow(CONSTANTS[45], CONSTANTS[110])*ALGEBRAIC[74]*(ALGEBRAIC[76] - ALGEBRAIC[78]))/ALGEBRAIC[79])/(1.00000+ CONSTANTS[42]*exp( (CONSTANTS[43] - 1.00000)*STATES[0]*CONSTANTS[109]));
ALGEBRAIC[103] = ALGEBRAIC[16]+ALGEBRAIC[19]+ 3.00000*ALGEBRAIC[82]+ 3.00000*ALGEBRAIC[23]+ALGEBRAIC[70];
ALGEBRAIC[2] =  (1.00000/CONSTANTS[109])*log(CONSTANTS[18]/STATES[2]);
ALGEBRAIC[17] =  CONSTANTS[98]*CONSTANTS[21]*pow(STATES[6], 3.00000)*STATES[7]*STATES[8]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[20] =  CONSTANTS[98]*CONSTANTS[22]*(STATES[0] - ALGEBRAIC[2]);
ALGEBRAIC[24] = (( CONSTANTS[98]*CONSTANTS[23]*ALGEBRAIC[22]*CONSTANTS[17])/(1.00000+pow(CONSTANTS[24]/STATES[2], 4.00000)))/(CONSTANTS[17]+CONSTANTS[25]);
ALGEBRAIC[65] = ( CONSTANTS[33]*STATES[0]*CONSTANTS[95]*CONSTANTS[109]*( 0.750000*STATES[2]*exp( STATES[0]*CONSTANTS[109]) -  0.750000*CONSTANTS[18]))/(exp( STATES[0]*CONSTANTS[109]) - 1.00000);
ALGEBRAIC[71] =  CONSTANTS[99]*ALGEBRAIC[65]*STATES[16]*STATES[17]*((1.00000 - STATES[19])+CONSTANTS[91])*pow(CONSTANTS[36], CONSTANTS[110])*0.450000*1.00000;
ALGEBRAIC[75] = 1.00000/(1.00000+pow(CONSTANTS[44]/STATES[5], 2.00000));
ALGEBRAIC[77] =  exp( CONSTANTS[43]*STATES[0]*CONSTANTS[109])*pow(STATES[2], 3.00000)*CONSTANTS[19];
ALGEBRAIC[80] =  exp( (CONSTANTS[43] - 1.00000)*STATES[0]*CONSTANTS[109])*pow(CONSTANTS[18], 3.00000)*STATES[5];
ALGEBRAIC[81] =  CONSTANTS[38]*pow(CONSTANTS[18], 3.00000)*(1.00000+pow(STATES[2]/CONSTANTS[40], 3.00000))+ pow(CONSTANTS[41], 3.00000)*STATES[5]*(1.00000+STATES[5]/CONSTANTS[38])+ CONSTANTS[39]*pow(STATES[2], 3.00000)+ pow(STATES[2], 3.00000)*CONSTANTS[19]+ pow(CONSTANTS[18], 3.00000)*STATES[5];
ALGEBRAIC[83] = (( CONSTANTS[98]*CONSTANTS[37]*pow(CONSTANTS[45], CONSTANTS[110])*ALGEBRAIC[75]*(ALGEBRAIC[77] - ALGEBRAIC[80]))/ALGEBRAIC[81])/(1.00000+ CONSTANTS[42]*exp( (CONSTANTS[43] - 1.00000)*STATES[0]*CONSTANTS[109]));
ALGEBRAIC[104] = ALGEBRAIC[17]+ALGEBRAIC[20]+ 3.00000*ALGEBRAIC[83]+ 3.00000*ALGEBRAIC[24]+ALGEBRAIC[71];
ALGEBRAIC[61] = ( CONSTANTS[34]*4.00000*STATES[0]*CONSTANTS[95]*CONSTANTS[109]*( 0.341000*STATES[4]*exp( 2.00000*STATES[0]*CONSTANTS[109]) -  0.341000*CONSTANTS[19]))/(exp( 2.00000*STATES[0]*CONSTANTS[109]) - 1.00000);
ALGEBRAIC[66] =  CONSTANTS[16]*ALGEBRAIC[61]*STATES[16]*STATES[17]*((1.00000 - STATES[18])+CONSTANTS[92])*pow(CONSTANTS[36], CONSTANTS[110])*0.450000*1.00000;
ALGEBRAIC[85] = ( CONSTANTS[15]*pow(CONSTANTS[49], CONSTANTS[110])*CONSTANTS[46]*pow(STATES[4], 1.60000))/(pow(CONSTANTS[47], 1.60000)+pow(STATES[4], 1.60000));
ALGEBRAIC[4] =  ((1.00000/CONSTANTS[109])/2.00000)*log(CONSTANTS[19]/STATES[4]);
ALGEBRAIC[88] =  CONSTANTS[15]*CONSTANTS[48]*(STATES[0] - ALGEBRAIC[4]);
ALGEBRAIC[108] = (ALGEBRAIC[66]+ALGEBRAIC[88]+ALGEBRAIC[85]) -  2.00000*ALGEBRAIC[82];
ALGEBRAIC[62] = ( CONSTANTS[34]*4.00000*STATES[0]*CONSTANTS[95]*CONSTANTS[109]*( 0.341000*STATES[5]*exp( 2.00000*STATES[0]*CONSTANTS[109]) -  0.341000*CONSTANTS[19]))/(exp( 2.00000*STATES[0]*CONSTANTS[109]) - 1.00000);
ALGEBRAIC[67] =  CONSTANTS[99]*ALGEBRAIC[62]*STATES[16]*STATES[17]*((1.00000 - STATES[19])+CONSTANTS[91])*pow(CONSTANTS[36], CONSTANTS[110])*0.450000*1.00000;
ALGEBRAIC[86] = ( CONSTANTS[98]*pow(CONSTANTS[49], CONSTANTS[110])*CONSTANTS[46]*pow(STATES[5], 1.60000))/(pow(CONSTANTS[47], 1.60000)+pow(STATES[5], 1.60000));
ALGEBRAIC[5] =  ((1.00000/CONSTANTS[109])/2.00000)*log(CONSTANTS[19]/STATES[5]);
ALGEBRAIC[89] =  CONSTANTS[98]*CONSTANTS[48]*(STATES[0] - ALGEBRAIC[5]);
ALGEBRAIC[109] = (ALGEBRAIC[67]+ALGEBRAIC[89]+ALGEBRAIC[86]) -  2.00000*ALGEBRAIC[83];
ALGEBRAIC[25] = ALGEBRAIC[23]+ALGEBRAIC[24];
ALGEBRAIC[3] =  (1.00000/CONSTANTS[109])*log(CONSTANTS[17]/STATES[3]);
ALGEBRAIC[28] = 1.00000/(1.00000+exp((STATES[0]+74.0000)/24.0000));
ALGEBRAIC[29] =  CONSTANTS[101]*STATES[9]*ALGEBRAIC[28]*(STATES[0] - ALGEBRAIC[3]);
ALGEBRAIC[30] = 1.00000/(1.00000+exp(7.48800 - STATES[0]/5.98000));
ALGEBRAIC[31] =  CONSTANTS[15]*CONSTANTS[29]*ALGEBRAIC[30]*(STATES[0] - ALGEBRAIC[3]);
ALGEBRAIC[32] =  CONSTANTS[98]*CONSTANTS[29]*ALGEBRAIC[30]*(STATES[0] - ALGEBRAIC[3]);
ALGEBRAIC[33] = ALGEBRAIC[31]+ALGEBRAIC[32];
ALGEBRAIC[34] =  (1.00000/CONSTANTS[109])*log((CONSTANTS[17]+ CONSTANTS[28]*CONSTANTS[18])/(STATES[3]+ CONSTANTS[28]*STATES[11]));
ALGEBRAIC[37] =  CONSTANTS[15]*CONSTANTS[89]*pow(STATES[10], 2.00000)*(STATES[0] - ALGEBRAIC[34]);
ALGEBRAIC[38] =  CONSTANTS[98]*CONSTANTS[90]*pow(STATES[10], 2.00000)*(STATES[0] - ALGEBRAIC[34]);
ALGEBRAIC[39] = ALGEBRAIC[37]+ALGEBRAIC[38];
ALGEBRAIC[44] =  CONSTANTS[102]*STATES[12]*STATES[13]*(STATES[0] - ALGEBRAIC[3]);
ALGEBRAIC[47] =  CONSTANTS[103]*STATES[14]*STATES[15]*(STATES[0] - ALGEBRAIC[3]);
ALGEBRAIC[48] = ALGEBRAIC[44]+ALGEBRAIC[47];
ALGEBRAIC[49] = 1.02000/(1.00000+exp( 0.238500*((STATES[0] - ALGEBRAIC[3]) - 59.2150)));
ALGEBRAIC[50] = ( 0.491240*exp( 0.0803200*((STATES[0]+5.47600) - ALGEBRAIC[3]))+exp( 0.0617500*((STATES[0] - ALGEBRAIC[3]) - 594.310)))/(1.00000+exp( - 0.514300*((STATES[0] - ALGEBRAIC[3])+4.75300)));
ALGEBRAIC[51] = ALGEBRAIC[49]/(ALGEBRAIC[49]+ALGEBRAIC[50]);
ALGEBRAIC[52] =  1.00000*0.350000* pow((CONSTANTS[17]/5.40000), 1.0 / 2)*ALGEBRAIC[51]*(STATES[0] - ALGEBRAIC[3]);
ALGEBRAIC[63] = ( CONSTANTS[35]*STATES[0]*CONSTANTS[95]*CONSTANTS[109]*( 0.750000*STATES[3]*exp( STATES[0]*CONSTANTS[109]) -  0.750000*CONSTANTS[17]))/(exp( STATES[0]*CONSTANTS[109]) - 1.00000);
ALGEBRAIC[69] =  ALGEBRAIC[63]*STATES[16]*STATES[17]*( CONSTANTS[16]*(CONSTANTS[92]+(1.00000 - STATES[18]))+ CONSTANTS[99]*(CONSTANTS[91]+(1.00000 - STATES[19])))*pow(CONSTANTS[36], CONSTANTS[110])*0.450000*1.00000;
ALGEBRAIC[107] = ((ALGEBRAIC[48]+ALGEBRAIC[29]+ALGEBRAIC[39]+ALGEBRAIC[52]) -  2.00000*ALGEBRAIC[25])+ALGEBRAIC[69]+ALGEBRAIC[33];
ALGEBRAIC[110] = ALGEBRAIC[103]+ALGEBRAIC[104];
ALGEBRAIC[53] =  (( CONSTANTS[15]*CONSTANTS[30])/(1.00000+CONSTANTS[32]/STATES[4]))*(STATES[0] - CONSTANTS[122]);
ALGEBRAIC[54] =  (( CONSTANTS[98]*CONSTANTS[30])/(1.00000+CONSTANTS[32]/STATES[5]))*(STATES[0] - CONSTANTS[122]);
ALGEBRAIC[55] = ALGEBRAIC[53]+ALGEBRAIC[54];
ALGEBRAIC[56] =  CONSTANTS[31]*(STATES[0] - CONSTANTS[122]);
ALGEBRAIC[111] = ALGEBRAIC[55]+ALGEBRAIC[56];
ALGEBRAIC[112] = ALGEBRAIC[108]+ALGEBRAIC[109];
ALGEBRAIC[113] = ALGEBRAIC[110]+ALGEBRAIC[111]+ALGEBRAIC[112]+ALGEBRAIC[107];
}
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] = VOI - 1000.00;
CONDVAR[1] = VOI - 2000.00;
CONDVAR[2] =  (int)(VOI+900.000) % (int)(25.0000) - 5.00000;
CONDVAR[3] = VOI - 2000.00;
CONDVAR[4] =  (int)(VOI+900.000) % (int)(250.000) - 5.00000;
CONDVAR[5] = STATES[0] - - 40.0000;
CONDVAR[6] = STATES[0] - - 40.0000;
CONDVAR[7] = STATES[0] - - 40.0000;
CONDVAR[8] = STATES[0] - - 40.0000;
}