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 86 entries in the algebraic variable array.
   There are a total of 41 entries in each of the rate and state variable arrays.
   There are a total of 90 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * CONSTANTS[0] is R in component model_parameters (joule_per_kilomole_kelvin).
 * CONSTANTS[1] is T in component model_parameters (kelvin).
 * CONSTANTS[2] is F in component model_parameters (coulomb_per_mole).
 * CONSTANTS[3] is Nae in component model_parameters (millimolar).
 * CONSTANTS[4] is Cae in component model_parameters (millimolar).
 * CONSTANTS[5] is Ke in component model_parameters (millimolar).
 * CONSTANTS[87] is Vt in component model_parameters (cm3).
 * CONSTANTS[54] is Vd in component model_parameters (cm3).
 * CONSTANTS[56] is Vmyo in component model_parameters (cm3).
 * CONSTANTS[58] is Sms in component model_parameters (cm2).
 * CONSTANTS[59] is Smt in component model_parameters (cm2).
 * CONSTANTS[89] is Cms in component model_parameters (microF).
 * CONSTANTS[88] is Cmt in component model_parameters (microF).
 * CONSTANTS[86] is Rst in component model_parameters (ohm).
 * CONSTANTS[55] is VSRrel in component model_parameters (cm3).
 * CONSTANTS[57] is VSRup in component model_parameters (cm3).
 * CONSTANTS[51] is Vc in component model_parameters (cm3).
 * CONSTANTS[84] is pt in component model_parameters (dimensionless).
 * CONSTANTS[85] is Lt in component model_parameters (cm).
 * CONSTANTS[6] is Rot in component model_parameters (ohm_cm).
 * CONSTANTS[7] is radiust in component model_parameters (cm).
 * CONSTANTS[8] is ptcm in component model_parameters (per_cm2).
 * CONSTANTS[9] is Smtot in component model_parameters (cm2).
 * ALGEBRAIC[0] is i_circ in component i_circ (microA).
 * STATES[0] is Vms in component Vms (millivolt).
 * STATES[1] is Vmt in component Vmt (millivolt).
 * ALGEBRAIC[2] is i_Stim in component i_Stim (microA).
 * CONSTANTS[10] is stim_offset in component i_Stim (second).
 * CONSTANTS[11] is stim_period in component i_Stim (second).
 * CONSTANTS[12] is stim_duration in component i_Stim (second).
 * CONSTANTS[13] is stim_amplitude in component i_Stim (microA).
 * ALGEBRAIC[1] is past in component i_Stim (second).
 * CONSTANTS[60] is gNas in component membrane_permeabilities (milliS).
 * CONSTANTS[61] is gCas in component membrane_permeabilities (cm3_per_second).
 * CONSTANTS[62] is gKfs in component membrane_permeabilities (milliS).
 * CONSTANTS[63] is gKsts in component membrane_permeabilities (milliS).
 * CONSTANTS[64] is gK1s in component membrane_permeabilities (milliS).
 * CONSTANTS[65] is gKbs in component membrane_permeabilities (milliS).
 * CONSTANTS[66] is gKtos in component membrane_permeabilities (milliS).
 * CONSTANTS[67] is gNabs in component membrane_permeabilities (milliS).
 * CONSTANTS[68] is gCabs in component membrane_permeabilities (milliS).
 * CONSTANTS[69] is i_pCa_maxs in component membrane_permeabilities (microA).
 * CONSTANTS[70] is i_NaK_maxs in component membrane_permeabilities (microA).
 * CONSTANTS[71] is i_NaCa_maxs in component membrane_permeabilities (microA).
 * CONSTANTS[72] is gNat in component membrane_permeabilities (milliS).
 * CONSTANTS[73] is gCat in component membrane_permeabilities (cm3_per_second).
 * CONSTANTS[74] is gKft in component membrane_permeabilities (milliS).
 * CONSTANTS[75] is gKstt in component membrane_permeabilities (milliS).
 * CONSTANTS[76] is gK1t in component membrane_permeabilities (milliS).
 * CONSTANTS[77] is gKbt in component membrane_permeabilities (milliS).
 * CONSTANTS[78] is gKtot in component membrane_permeabilities (milliS).
 * CONSTANTS[79] is gNabt in component membrane_permeabilities (milliS).
 * CONSTANTS[80] is gCabt in component membrane_permeabilities (milliS).
 * CONSTANTS[81] is i_pCa_maxt in component membrane_permeabilities (microA).
 * CONSTANTS[82] is i_NaK_maxt in component membrane_permeabilities (microA).
 * CONSTANTS[83] is i_NaCa_maxt in component membrane_permeabilities (microA).
 * CONSTANTS[14] is gNa in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[15] is fNat in component membrane_permeabilities (dimensionless).
 * CONSTANTS[16] is gKf in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[17] is fKft in component membrane_permeabilities (dimensionless).
 * CONSTANTS[18] is gKst in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[19] is fKstt in component membrane_permeabilities (dimensionless).
 * CONSTANTS[20] is gK1 in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[21] is fK1t in component membrane_permeabilities (dimensionless).
 * CONSTANTS[22] is gKb in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[23] is fKbt in component membrane_permeabilities (dimensionless).
 * CONSTANTS[24] is gKto in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[25] is fKtot in component membrane_permeabilities (dimensionless).
 * CONSTANTS[26] is gNab in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[27] is fNabt in component membrane_permeabilities (dimensionless).
 * CONSTANTS[28] is gCab in component membrane_permeabilities (milliS_per_cm2).
 * CONSTANTS[29] is fCabt in component membrane_permeabilities (dimensionless).
 * CONSTANTS[30] is gCa in component membrane_permeabilities (cm_per_second).
 * CONSTANTS[31] is fCat in component membrane_permeabilities (dimensionless).
 * CONSTANTS[32] is i_NaCa_max in component membrane_permeabilities (microA_per_cm2).
 * CONSTANTS[33] is fNaCat in component membrane_permeabilities (dimensionless).
 * CONSTANTS[34] is i_NaK_max in component membrane_permeabilities (microA_per_cm2).
 * CONSTANTS[35] is fNaKt in component membrane_permeabilities (dimensionless).
 * CONSTANTS[36] is i_pCa_max in component membrane_permeabilities (microA_per_cm2).
 * CONSTANTS[37] is fpCat in component membrane_permeabilities (dimensionless).
 * ALGEBRAIC[4] is i_Nas in component i_Nas (microA).
 * ALGEBRAIC[3] is E_Nas in component i_Nas (millivolt).
 * STATES[2] is Nai in component ion_concentrations (millimolar).
 * STATES[3] is Ki in component ion_concentrations (millimolar).
 * STATES[4] is m in component i_Nas_m_gate (dimensionless).
 * STATES[5] is h in component i_Nas_h_gate (dimensionless).
 * ALGEBRAIC[5] is alpha_m in component i_Nas_m_gate (per_second).
 * ALGEBRAIC[6] is beta_m in component i_Nas_m_gate (per_second).
 * ALGEBRAIC[7] is alpha_h in component i_Nas_h_gate (per_second).
 * ALGEBRAIC[8] is beta_h in component i_Nas_h_gate (per_second).
 * ALGEBRAIC[10] is i_Nat in component i_Nat (microA).
 * ALGEBRAIC[9] is E_Nat in component i_Nat (millivolt).
 * STATES[6] is Nat in component ion_concentrations (millimolar).
 * STATES[7] is Kt in component ion_concentrations (millimolar).
 * STATES[8] is m in component i_Nat_m_gate (dimensionless).
 * STATES[9] is h in component i_Nat_h_gate (dimensionless).
 * ALGEBRAIC[11] is alpha_m in component i_Nat_m_gate (per_second).
 * ALGEBRAIC[12] is beta_m in component i_Nat_m_gate (per_second).
 * ALGEBRAIC[13] is alpha_h in component i_Nat_h_gate (per_second).
 * ALGEBRAIC[14] is beta_h in component i_Nat_h_gate (per_second).
 * ALGEBRAIC[23] is i_Cas in component i_Cas (microA).
 * ALGEBRAIC[15] is E_Cas in component i_Cas (millivolt).
 * STATES[10] is Co in component i_Cas (dimensionless).
 * STATES[11] is C1 in component i_Cas (dimensionless).
 * STATES[12] is C2 in component i_Cas (dimensionless).
 * ALGEBRAIC[17] is tauCo in component i_Cas (second).
 * CONSTANTS[38] is tauCcast in component i_Cas (second).
 * ALGEBRAIC[19] is tauC1 in component i_Cas (second).
 * ALGEBRAIC[21] is tauC2 in component i_Cas (second).
 * STATES[13] is Ccast in component i_Cas (dimensionless).
 * ALGEBRAIC[16] is Coinf in component i_Cas (dimensionless).
 * ALGEBRAIC[22] is Ccastinf in component i_Cas (dimensionless).
 * ALGEBRAIC[18] is C1inf in component i_Cas (dimensionless).
 * ALGEBRAIC[20] is C2inf in component i_Cas (dimensionless).
 * STATES[14] is Cass in component ion_concentrations (millimolar).
 * STATES[15] is Cai in component ion_concentrations (millimolar).
 * ALGEBRAIC[32] is i_Cat in component i_Cat (microA).
 * ALGEBRAIC[24] is E_Cat in component i_Cat (millivolt).
 * STATES[16] is Co in component i_Cat (dimensionless).
 * STATES[17] is C1 in component i_Cat (dimensionless).
 * STATES[18] is C2 in component i_Cat (dimensionless).
 * ALGEBRAIC[26] is tauCo in component i_Cat (second).
 * CONSTANTS[39] is tauCcast in component i_Cat (second).
 * ALGEBRAIC[28] is tauC1 in component i_Cat (second).
 * ALGEBRAIC[30] is tauC2 in component i_Cat (second).
 * ALGEBRAIC[25] is Coinf in component i_Cat (dimensionless).
 * STATES[19] is Ccast in component i_Cat (dimensionless).
 * ALGEBRAIC[31] is Ccastinf in component i_Cat (dimensionless).
 * ALGEBRAIC[27] is C1inf in component i_Cat (dimensionless).
 * ALGEBRAIC[29] is C2inf in component i_Cat (dimensionless).
 * STATES[20] is Cat in component ion_concentrations (millimolar).
 * ALGEBRAIC[85] is i_Ktos in component i_Ktos (microA).
 * ALGEBRAIC[33] is E_Ks in component i_Ktos (millivolt).
 * STATES[21] is rs in component i_Ktos_rs_gate (dimensionless).
 * STATES[22] is ss in component i_Ktos_ss_gate (dimensionless).
 * STATES[23] is sss in component i_Ktos_sss_gate (dimensionless).
 * ALGEBRAIC[35] is taurs in component i_Ktos_rs_gate (second).
 * ALGEBRAIC[34] is rinfs in component i_Ktos_rs_gate (dimensionless).
 * ALGEBRAIC[37] is tauss in component i_Ktos_ss_gate (second).
 * ALGEBRAIC[36] is sinfs in component i_Ktos_ss_gate (dimensionless).
 * ALGEBRAIC[39] is tausss in component i_Ktos_sss_gate (second).
 * ALGEBRAIC[38] is ssinfs in component i_Ktos_sss_gate (dimensionless).
 * ALGEBRAIC[41] is i_Ktot in component i_Ktot (microA).
 * ALGEBRAIC[40] is E_Kt in component i_Ktot (millivolt).
 * STATES[24] is rt in component i_Ktot_rt_gate (dimensionless).
 * STATES[25] is st in component i_Ktot_st_gate (dimensionless).
 * STATES[26] is sst in component i_Ktot_sst_gate (dimensionless).
 * ALGEBRAIC[43] is taurt in component i_Ktot_rt_gate (second).
 * ALGEBRAIC[42] is rinft in component i_Ktot_rt_gate (dimensionless).
 * ALGEBRAIC[45] is taust in component i_Ktot_st_gate (second).
 * ALGEBRAIC[44] is sinft in component i_Ktot_st_gate (dimensionless).
 * ALGEBRAIC[47] is tausst in component i_Ktot_sst_gate (second).
 * ALGEBRAIC[46] is ssinft in component i_Ktot_sst_gate (dimensionless).
 * ALGEBRAIC[48] is i_Ksts in component i_Ksts (microA).
 * STATES[27] is rsts in component i_Ksts_rsts_gate (dimensionless).
 * STATES[28] is ssts in component i_Ksts_ssts_gate (dimensionless).
 * ALGEBRAIC[50] is taursts in component i_Ksts_rsts_gate (second).
 * ALGEBRAIC[49] is rstinfs in component i_Ksts_rsts_gate (dimensionless).
 * CONSTANTS[40] is taussts in component i_Ksts_ssts_gate (second).
 * ALGEBRAIC[51] is sstinfs in component i_Ksts_ssts_gate (dimensionless).
 * ALGEBRAIC[52] is i_Kstt in component i_Kstt (microA).
 * STATES[29] is rstt in component i_Kstt_rstt_gate (dimensionless).
 * STATES[30] is sstt in component i_Kstt_sstt_gate (dimensionless).
 * ALGEBRAIC[54] is taurstt in component i_Kstt_rstt_gate (second).
 * ALGEBRAIC[53] is rstinft in component i_Kstt_rstt_gate (dimensionless).
 * CONSTANTS[41] is tausstt in component i_Kstt_sstt_gate (second).
 * ALGEBRAIC[55] is sstinft in component i_Kstt_sstt_gate (dimensionless).
 * ALGEBRAIC[56] is i_Kfs in component i_Kfs (microA).
 * STATES[31] is qs in component i_Kfs_qs_gate (dimensionless).
 * ALGEBRAIC[58] is tauqs in component i_Kfs_qs_gate (second).
 * ALGEBRAIC[57] is qinfs in component i_Kfs_qs_gate (dimensionless).
 * ALGEBRAIC[59] is i_Kft in component i_Kft (microA).
 * STATES[32] is qt in component i_Kft_qt_gate (dimensionless).
 * ALGEBRAIC[61] is tauqt in component i_Kft_qt_gate (second).
 * ALGEBRAIC[60] is qinft in component i_Kft_qt_gate (dimensionless).
 * ALGEBRAIC[62] is i_K1s in component i_K1s (microA).
 * ALGEBRAIC[63] is i_K1t in component i_K1t (microA).
 * ALGEBRAIC[64] is i_Nabs in component i_Nabs (microA).
 * ALGEBRAIC[65] is i_Nabt in component i_Nabt (microA).
 * ALGEBRAIC[66] is i_Cabs in component i_Cabs (microA).
 * ALGEBRAIC[67] is i_Cabt in component i_Cabt (microA).
 * ALGEBRAIC[68] is i_Kbs in component i_Kbs (microA).
 * ALGEBRAIC[69] is i_Kbt in component i_Kbt (microA).
 * ALGEBRAIC[70] is i_NaCas in component i_NaCas (microA).
 * ALGEBRAIC[71] is i_NaCat in component i_NaCat (microA).
 * ALGEBRAIC[72] is i_NaKs in component i_NaKs (microA).
 * ALGEBRAIC[73] is i_NaKt in component i_NaKt (microA).
 * ALGEBRAIC[74] is i_pCas in component i_pCas (microA).
 * ALGEBRAIC[75] is i_pCat in component i_pCat (microA).
 * ALGEBRAIC[76] is JteNa in component t_tubular_ion_fluxes (millimolar_per_second).
 * ALGEBRAIC[77] is JteCa in component t_tubular_ion_fluxes (millimolar_per_second).
 * ALGEBRAIC[78] is JteK in component t_tubular_ion_fluxes (millimolar_per_second).
 * CONSTANTS[42] is tauNa in component t_tubular_ion_fluxes (second).
 * CONSTANTS[43] is tauCa in component t_tubular_ion_fluxes (second).
 * CONSTANTS[44] is tauK in component t_tubular_ion_fluxes (second).
 * ALGEBRAIC[79] is JCaSRup in component JCaSRup (millimolar_per_second).
 * STATES[33] is CaSRup in component CaSRup (millimolar).
 * ALGEBRAIC[80] is Jtr in component Jtr (millimolar_per_second).
 * CONSTANTS[45] is tautr in component Jtr (second).
 * STATES[34] is CaSRrel in component CaSRrel (millimolar).
 * ALGEBRAIC[81] is JCaSRrel in component JCaSRrel (millimolar_per_second).
 * CONSTANTS[52] is kap in component JCaSRrel (per_millimolar4_per_second).
 * CONSTANTS[46] is kam in component JCaSRrel (per_second).
 * CONSTANTS[53] is kbp in component JCaSRrel (per_millimolar3_per_second).
 * CONSTANTS[47] is kbm in component JCaSRrel (per_second).
 * CONSTANTS[48] is kcp in component JCaSRrel (per_second).
 * CONSTANTS[49] is kcm in component JCaSRrel (per_second).
 * STATES[35] is F1 in component JCaSRrel (dimensionless).
 * STATES[36] is F2 in component JCaSRrel (dimensionless).
 * STATES[37] is F3 in component JCaSRrel (dimensionless).
 * STATES[38] is F4 in component JCaSRrel (dimensionless).
 * ALGEBRAIC[82] is JCad in component JCad (millimolar_per_second).
 * CONSTANTS[50] is taud in component JCad (second).
 * STATES[39] is BTRH in component ion_concentrations (millimolar).
 * STATES[40] is BTRL in component ion_concentrations (millimolar).
 * ALGEBRAIC[83] is dBTRH in component ion_concentrations (millimolar_per_second).
 * ALGEBRAIC[84] is dBTRL in component ion_concentrations (millimolar_per_second).
 * RATES[4] is d/dt m in component i_Nas_m_gate (dimensionless).
 * RATES[5] is d/dt h in component i_Nas_h_gate (dimensionless).
 * RATES[8] is d/dt m in component i_Nat_m_gate (dimensionless).
 * RATES[9] is d/dt h in component i_Nat_h_gate (dimensionless).
 * RATES[11] is d/dt C1 in component i_Cas (dimensionless).
 * RATES[12] is d/dt C2 in component i_Cas (dimensionless).
 * RATES[10] is d/dt Co in component i_Cas (dimensionless).
 * RATES[13] is d/dt Ccast in component i_Cas (dimensionless).
 * RATES[17] is d/dt C1 in component i_Cat (dimensionless).
 * RATES[18] is d/dt C2 in component i_Cat (dimensionless).
 * RATES[16] is d/dt Co in component i_Cat (dimensionless).
 * RATES[19] is d/dt Ccast in component i_Cat (dimensionless).
 * RATES[21] is d/dt rs in component i_Ktos_rs_gate (dimensionless).
 * RATES[22] is d/dt ss in component i_Ktos_ss_gate (dimensionless).
 * RATES[23] is d/dt sss in component i_Ktos_sss_gate (dimensionless).
 * RATES[24] is d/dt rt in component i_Ktot_rt_gate (dimensionless).
 * RATES[25] is d/dt st in component i_Ktot_st_gate (dimensionless).
 * RATES[26] is d/dt sst in component i_Ktot_sst_gate (dimensionless).
 * RATES[27] is d/dt rsts in component i_Ksts_rsts_gate (dimensionless).
 * RATES[28] is d/dt ssts in component i_Ksts_ssts_gate (dimensionless).
 * RATES[29] is d/dt rstt in component i_Kstt_rstt_gate (dimensionless).
 * RATES[30] is d/dt sstt in component i_Kstt_sstt_gate (dimensionless).
 * RATES[31] is d/dt qs in component i_Kfs_qs_gate (dimensionless).
 * RATES[32] is d/dt qt in component i_Kft_qt_gate (dimensionless).
 * RATES[35] is d/dt F1 in component JCaSRrel (dimensionless).
 * RATES[36] is d/dt F2 in component JCaSRrel (dimensionless).
 * RATES[37] is d/dt F3 in component JCaSRrel (dimensionless).
 * RATES[38] is d/dt F4 in component JCaSRrel (dimensionless).
 * RATES[33] is d/dt CaSRup in component CaSRup (millimolar).
 * RATES[34] is d/dt CaSRrel in component CaSRrel (millimolar).
 * RATES[39] is d/dt BTRH in component ion_concentrations (millimolar).
 * RATES[40] is d/dt BTRL in component ion_concentrations (millimolar).
 * RATES[14] is d/dt Cass in component ion_concentrations (millimolar).
 * RATES[15] is d/dt Cai in component ion_concentrations (millimolar).
 * RATES[2] is d/dt Nai in component ion_concentrations (millimolar).
 * RATES[3] is d/dt Ki in component ion_concentrations (millimolar).
 * RATES[6] is d/dt Nat in component ion_concentrations (millimolar).
 * RATES[20] is d/dt Cat in component ion_concentrations (millimolar).
 * RATES[7] is d/dt Kt in component ion_concentrations (millimolar).
 * RATES[0] is d/dt Vms in component Vms (millivolt).
 * RATES[1] is d/dt Vmt in component Vmt (millivolt).
 * There are a total of 2 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 8310;
CONSTANTS[1] = 295;
CONSTANTS[2] = 96500;
CONSTANTS[3] = 140;
CONSTANTS[4] = 1.2;
CONSTANTS[5] = 5.4;
CONSTANTS[6] = 83.33;
CONSTANTS[7] = 150e-7;
CONSTANTS[8] = 30000000;
CONSTANTS[9] = 0.0001;
STATES[0] = -7.9709547e1;
STATES[1] = -7.9709536e1;
CONSTANTS[10] = 0;
CONSTANTS[11] = 1;
CONSTANTS[12] = 0.001;
CONSTANTS[13] = 0.0052;
CONSTANTS[14] = 10;
CONSTANTS[15] = 0.56;
CONSTANTS[16] = 0.0145;
CONSTANTS[17] = 0.56;
CONSTANTS[18] = 0.07;
CONSTANTS[19] = 0.76;
CONSTANTS[20] = 0.24;
CONSTANTS[21] = 0.56;
CONSTANTS[22] = 0.00138;
CONSTANTS[23] = 0.56;
CONSTANTS[24] = 0.35;
CONSTANTS[25] = 0.56;
CONSTANTS[26] = 0.0008015;
CONSTANTS[27] = 0.56;
CONSTANTS[28] = 0.000648;
CONSTANTS[29] = 0.56;
CONSTANTS[30] = 0.00021;
CONSTANTS[31] = 0.87;
CONSTANTS[32] = 0.00018;
CONSTANTS[33] = 0.81;
CONSTANTS[34] = 1;
CONSTANTS[35] = 0.59;
CONSTANTS[36] = 0.85;
CONSTANTS[37] = 0.56;
STATES[2] = 6.9435814e0;
STATES[3] = 1.3753311e2;
STATES[4] = 2.1832558e-6;
STATES[5] = 5.8232781e-1;
STATES[6] = 1.4001386e2;
STATES[7] = 5.3627676e0;
STATES[8] = 2.1832694e-6;
STATES[9] = 5.8232717e-1;
STATES[10] = 2.5436465e-6;
STATES[11] = 9.9994546e-1;
STATES[12] = 9.9994546e-1;
CONSTANTS[38] = 0.009;
STATES[13] = 9.9570063e-1;
STATES[14] = 4.3112114e-5;
STATES[15] = 3.5486498e-5;
STATES[16] = 2.543652e-6;
STATES[17] = 9.9994546e-1;
STATES[18] = 9.9994546e-1;
CONSTANTS[39] = 0.009;
STATES[19] = 9.9570063e-1;
STATES[20] = 1.2271399e0;
STATES[21] = 2.3485072e-3;
STATES[22] = 9.8315843e-1;
STATES[23] = 6.748337e-1;
STATES[24] = 2.3485094e-3;
STATES[25] = 9.8315865e-1;
STATES[26] = 6.7478532e-1;
STATES[27] = 3.1079213e-3;
STATES[28] = 3.0773393e-1;
CONSTANTS[40] = 2.1;
STATES[29] = 3.1079241e-3;
STATES[30] = 3.0773368e-1;
CONSTANTS[41] = 2.1;
STATES[31] = 3.4357356e-3;
STATES[32] = 3.4357175e-3;
CONSTANTS[42] = 0.15;
CONSTANTS[43] = 0.5;
CONSTANTS[44] = 0.15;
STATES[33] = 2.2755058e-1;
CONSTANTS[45] = 0.03448;
STATES[34] = 2.2638169e-1;
CONSTANTS[46] = 576;
CONSTANTS[47] = 1930;
CONSTANTS[48] = 18;
CONSTANTS[49] = 0.8;
STATES[35] = 6.7606483e-1;
STATES[36] = 3.8333331e-4;
STATES[37] = 6.4516879e-11;
STATES[38] = 3.2355462e-1;
CONSTANTS[50] = 0.003125;
STATES[39] = 9.2804169e-1;
STATES[40] = 3.4317829e-2;
CONSTANTS[51] = CONSTANTS[9]/7850.00;
CONSTANTS[52] = 1.21500e+13;
CONSTANTS[53] = 4.05000e+09;
CONSTANTS[54] =  CONSTANTS[51]*7.50000e-05;
CONSTANTS[55] =  CONSTANTS[51]*0.00350000;
CONSTANTS[56] =  CONSTANTS[51]*0.585000;
CONSTANTS[57] =  CONSTANTS[51]*0.0315000;
CONSTANTS[58] = CONSTANTS[9] -  4400.00*CONSTANTS[51];
CONSTANTS[59] = CONSTANTS[9] - CONSTANTS[58];
CONSTANTS[60] =  CONSTANTS[14]*(CONSTANTS[58]+CONSTANTS[59])*(1.00000 - CONSTANTS[15]);
CONSTANTS[61] =  CONSTANTS[30]*(CONSTANTS[58]+CONSTANTS[59])*(1.00000 - CONSTANTS[31]);
CONSTANTS[62] =  CONSTANTS[16]*(CONSTANTS[58]+CONSTANTS[59])*(1.00000 - CONSTANTS[17]);
CONSTANTS[63] =  CONSTANTS[18]*(CONSTANTS[58]+CONSTANTS[59])*(1.00000 - CONSTANTS[19]);
CONSTANTS[64] =  CONSTANTS[20]*(CONSTANTS[58]+CONSTANTS[59])*(1.00000 - CONSTANTS[21]);
CONSTANTS[65] =  CONSTANTS[22]*(CONSTANTS[58]+CONSTANTS[59])*(1.00000 - CONSTANTS[23]);
CONSTANTS[66] =  CONSTANTS[24]*(CONSTANTS[58]+CONSTANTS[59])*(1.00000 - CONSTANTS[25]);
CONSTANTS[67] =  CONSTANTS[26]*(CONSTANTS[58]+CONSTANTS[59])*(1.00000 - CONSTANTS[27]);
CONSTANTS[68] =  CONSTANTS[28]*(CONSTANTS[58]+CONSTANTS[59])*(1.00000 - CONSTANTS[29]);
CONSTANTS[69] =  CONSTANTS[36]*(CONSTANTS[58]+CONSTANTS[59])*(1.00000 - CONSTANTS[37]);
CONSTANTS[70] =  CONSTANTS[34]*(CONSTANTS[58]+CONSTANTS[59])*(1.00000 - CONSTANTS[35]);
CONSTANTS[71] =  CONSTANTS[32]*(CONSTANTS[58]+CONSTANTS[59])*(1.00000 - CONSTANTS[33]);
CONSTANTS[72] =  CONSTANTS[14]*(CONSTANTS[58]+CONSTANTS[59])*CONSTANTS[15];
CONSTANTS[73] =  CONSTANTS[30]*(CONSTANTS[58]+CONSTANTS[59])*CONSTANTS[31];
CONSTANTS[74] =  CONSTANTS[16]*(CONSTANTS[58]+CONSTANTS[59])*CONSTANTS[17];
CONSTANTS[75] =  CONSTANTS[18]*(CONSTANTS[58]+CONSTANTS[59])*CONSTANTS[19];
CONSTANTS[76] =  CONSTANTS[20]*(CONSTANTS[58]+CONSTANTS[59])*CONSTANTS[21];
CONSTANTS[77] =  CONSTANTS[22]*(CONSTANTS[58]+CONSTANTS[59])*CONSTANTS[23];
CONSTANTS[78] =  CONSTANTS[24]*(CONSTANTS[58]+CONSTANTS[59])*CONSTANTS[25];
CONSTANTS[79] =  CONSTANTS[26]*(CONSTANTS[58]+CONSTANTS[59])*CONSTANTS[27];
CONSTANTS[80] =  CONSTANTS[28]*(CONSTANTS[58]+CONSTANTS[59])*CONSTANTS[29];
CONSTANTS[81] =  CONSTANTS[36]*(CONSTANTS[58]+CONSTANTS[59])*CONSTANTS[37];
CONSTANTS[82] =  CONSTANTS[34]*(CONSTANTS[58]+CONSTANTS[59])*CONSTANTS[35];
CONSTANTS[83] =  CONSTANTS[32]*(CONSTANTS[58]+CONSTANTS[59])*CONSTANTS[33];
CONSTANTS[84] =  CONSTANTS[8]*CONSTANTS[58];
CONSTANTS[85] = CONSTANTS[59]/( 2.00000*3.14159*CONSTANTS[7]*CONSTANTS[84]);
CONSTANTS[86] = (( CONSTANTS[6]*CONSTANTS[85])/2.00000)/( 3.14159*pow(CONSTANTS[7], 2.00000)*CONSTANTS[84]);
CONSTANTS[87] =  3.14159*pow(CONSTANTS[7], 2.00000)*CONSTANTS[85]*CONSTANTS[84];
CONSTANTS[88] =  CONSTANTS[59]*1.00000;
CONSTANTS[89] =  CONSTANTS[58]*1.00000;
RATES[4] = 0.1001;
RATES[5] = 0.1001;
RATES[8] = 0.1001;
RATES[9] = 0.1001;
RATES[11] = 0.1001;
RATES[12] = 0.1001;
RATES[10] = 0.1001;
RATES[13] = 0.1001;
RATES[17] = 0.1001;
RATES[18] = 0.1001;
RATES[16] = 0.1001;
RATES[19] = 0.1001;
RATES[21] = 0.1001;
RATES[22] = 0.1001;
RATES[23] = 0.1001;
RATES[24] = 0.1001;
RATES[25] = 0.1001;
RATES[26] = 0.1001;
RATES[27] = 0.1001;
RATES[28] = 0.1001;
RATES[29] = 0.1001;
RATES[30] = 0.1001;
RATES[31] = 0.1001;
RATES[32] = 0.1001;
RATES[35] = 0.1001;
RATES[36] = 0.1001;
RATES[37] = 0.1001;
RATES[38] = 0.1001;
RATES[33] = 0.1001;
RATES[34] = 0.1001;
RATES[39] = 0.1001;
RATES[40] = 0.1001;
RATES[14] = 0.1001;
RATES[15] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[6] = 0.1001;
RATES[20] = 0.1001;
RATES[7] = 0.1001;
RATES[0] = 0.1001;
RATES[1] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[4] -  ALGEBRAIC[5]*(1.00000 - STATES[4]) -  ALGEBRAIC[6]*STATES[4];
resid[1] = RATES[5] -  ALGEBRAIC[7]*(1.00000 - STATES[5]) -  ALGEBRAIC[8]*STATES[5];
resid[2] = RATES[8] -  ALGEBRAIC[11]*(1.00000 - STATES[8]) -  ALGEBRAIC[12]*STATES[8];
resid[3] = RATES[9] -  ALGEBRAIC[13]*(1.00000 - STATES[9]) -  ALGEBRAIC[14]*STATES[9];
resid[4] = RATES[11] - (ALGEBRAIC[18] - STATES[11])/ALGEBRAIC[19];
resid[5] = RATES[12] - (ALGEBRAIC[20] - STATES[12])/ALGEBRAIC[21];
resid[6] = RATES[10] - (ALGEBRAIC[16] - STATES[10])/ALGEBRAIC[17];
resid[7] = RATES[13] - (ALGEBRAIC[22] - STATES[13])/CONSTANTS[38];
resid[8] = RATES[17] - (ALGEBRAIC[27] - STATES[17])/ALGEBRAIC[28];
resid[9] = RATES[18] - (ALGEBRAIC[29] - STATES[18])/ALGEBRAIC[30];
resid[10] = RATES[16] - (ALGEBRAIC[25] - STATES[16])/ALGEBRAIC[26];
resid[11] = RATES[19] - (ALGEBRAIC[31] - STATES[19])/CONSTANTS[39];
resid[12] = RATES[21] - (ALGEBRAIC[34] - STATES[21])/ALGEBRAIC[35];
resid[13] = RATES[22] - (ALGEBRAIC[36] - STATES[22])/ALGEBRAIC[37];
resid[14] = RATES[23] - (ALGEBRAIC[38] - STATES[23])/ALGEBRAIC[39];
resid[15] = RATES[24] - (ALGEBRAIC[42] - STATES[24])/ALGEBRAIC[43];
resid[16] = RATES[25] - (ALGEBRAIC[44] - STATES[25])/ALGEBRAIC[45];
resid[17] = RATES[26] - (ALGEBRAIC[46] - STATES[26])/ALGEBRAIC[47];
resid[18] = RATES[27] - (ALGEBRAIC[49] - STATES[27])/ALGEBRAIC[50];
resid[19] = RATES[28] - (ALGEBRAIC[51] - STATES[28])/CONSTANTS[40];
resid[20] = RATES[29] - (ALGEBRAIC[53] - STATES[29])/ALGEBRAIC[54];
resid[21] = RATES[30] - (ALGEBRAIC[55] - STATES[30])/CONSTANTS[41];
resid[22] = RATES[31] - (ALGEBRAIC[57] - STATES[31])/ALGEBRAIC[58];
resid[23] = RATES[32] - (ALGEBRAIC[60] - STATES[32])/ALGEBRAIC[61];
resid[24] = RATES[35] -  STATES[36]*CONSTANTS[46] -  STATES[35]*CONSTANTS[52]*pow(STATES[14], 4.00000);
resid[25] = RATES[36] - ( STATES[35]*CONSTANTS[52]*pow(STATES[14], 4.00000)+ STATES[37]*CONSTANTS[47]+ STATES[38]*CONSTANTS[49]) -  STATES[36]*(CONSTANTS[46]+ CONSTANTS[53]*pow(STATES[14], 3.00000)+CONSTANTS[48]);
resid[26] = RATES[37] -  STATES[36]*CONSTANTS[53]*pow(STATES[14], 3.00000) -  STATES[37]*CONSTANTS[47];
resid[27] = RATES[38] -  STATES[36]*CONSTANTS[48] -  STATES[38]*CONSTANTS[49];
resid[28] = RATES[33] - (ALGEBRAIC[79] - ALGEBRAIC[80])/( 1.00000*CONSTANTS[57]);
resid[29] = RATES[34] - ( (1.00000/(1.00000+( 15.0000*0.800000)/pow(0.800000+STATES[34], 2.00000)))*(ALGEBRAIC[80] - ALGEBRAIC[81]))/CONSTANTS[55];
resid[30] = RATES[39] - ALGEBRAIC[83];
resid[31] = RATES[40] - ALGEBRAIC[84];
resid[32] = RATES[14] -  (1.00000/(1.00000+( 0.0500000*0.00238000)/pow(0.00238000+STATES[14], 2.00000)))*((- (ALGEBRAIC[23]+ALGEBRAIC[32])/( 2.00000*CONSTANTS[2]*CONSTANTS[54])+( 1.00000*ALGEBRAIC[81])/CONSTANTS[54]) - ( 1.00000*ALGEBRAIC[82])/CONSTANTS[54]);
resid[33] = RATES[15] -  (1.00000/(1.00000+( 0.0500000*0.00238000)/pow(0.00238000+STATES[15], 2.00000)))*(((( - 2.00000*(ALGEBRAIC[70]+ALGEBRAIC[71])+ALGEBRAIC[66]+ALGEBRAIC[67]+ALGEBRAIC[74]+ALGEBRAIC[75])/( - 2.00000*CONSTANTS[2]*CONSTANTS[56])+( 1.00000*(ALGEBRAIC[82] - ALGEBRAIC[79]))/CONSTANTS[56]) -  ALGEBRAIC[83]*0.140000) -  ALGEBRAIC[84]*0.0700000);
resid[34] = RATES[2] - - (ALGEBRAIC[4]+ALGEBRAIC[10]+ALGEBRAIC[64]+ALGEBRAIC[65]+ 3.00000*ALGEBRAIC[70]+ 3.00000*ALGEBRAIC[71]+ 3.00000*ALGEBRAIC[72]+ 3.00000*ALGEBRAIC[73])/( CONSTANTS[2]*CONSTANTS[56]);
resid[35] = RATES[3] - - ((((- ALGEBRAIC[2]+ALGEBRAIC[56]+ALGEBRAIC[59]+ALGEBRAIC[48]+ALGEBRAIC[52]+ALGEBRAIC[62]+ALGEBRAIC[63]+ALGEBRAIC[68]+ALGEBRAIC[69]) -  2.00000*ALGEBRAIC[72]) -  2.00000*ALGEBRAIC[73])+ALGEBRAIC[85]+ALGEBRAIC[41])/( CONSTANTS[2]*CONSTANTS[56]);
resid[36] = RATES[6] - ((ALGEBRAIC[10]+ALGEBRAIC[65]+ 3.00000*ALGEBRAIC[71]+ 3.00000*ALGEBRAIC[73])/CONSTANTS[2] -  1.00000*ALGEBRAIC[76])/CONSTANTS[87];
resid[37] = RATES[20] - (( - 2.00000*ALGEBRAIC[71]+ALGEBRAIC[32]+ALGEBRAIC[67]+ALGEBRAIC[75])/( 2.00000*CONSTANTS[2]) -  1.00000*ALGEBRAIC[77])/CONSTANTS[87];
resid[38] = RATES[7] - ((((ALGEBRAIC[59]+ALGEBRAIC[52]+ALGEBRAIC[63]+ALGEBRAIC[69]) -  2.00000*ALGEBRAIC[73])+ALGEBRAIC[41])/CONSTANTS[2] -  1.00000*ALGEBRAIC[78])/CONSTANTS[87];
resid[39] = RATES[0] - ( 1000.00*((ALGEBRAIC[2]+ALGEBRAIC[0]) - (ALGEBRAIC[4]+ALGEBRAIC[23]+ALGEBRAIC[85]+ALGEBRAIC[48]+ALGEBRAIC[56]+ALGEBRAIC[62]+ALGEBRAIC[64]+ALGEBRAIC[66]+ALGEBRAIC[68]+ALGEBRAIC[72]+ALGEBRAIC[70]+ALGEBRAIC[74])))/CONSTANTS[89];
resid[40] = RATES[1] - ( 1000.00*- (ALGEBRAIC[0]+ALGEBRAIC[10]+ALGEBRAIC[32]+ALGEBRAIC[41]+ALGEBRAIC[52]+ALGEBRAIC[59]+ALGEBRAIC[63]+ALGEBRAIC[65]+ALGEBRAIC[67]+ALGEBRAIC[69]+ALGEBRAIC[73]+ALGEBRAIC[71]+ALGEBRAIC[75]))/CONSTANTS[88];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] =  1000.00*(STATES[1]/CONSTANTS[86] - STATES[0]/CONSTANTS[86]);
ALGEBRAIC[1] =  floor(VOI/CONSTANTS[11])*CONSTANTS[11];
ALGEBRAIC[2] = (CONDVAR[0]>=0.00000&&CONDVAR[1]<=0.00000 ? CONSTANTS[13] : 0.00000);
ALGEBRAIC[4] =  CONSTANTS[60]*pow(STATES[4], 3.00000)*STATES[5]*(STATES[0] - ( log((CONSTANTS[3]+ 0.120000*CONSTANTS[5])/(STATES[2]+ 0.120000*STATES[3]))*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2]);
ALGEBRAIC[5] = ( 117.260*(STATES[0]+59.3000))/(1.00000 - exp( - 0.550000*(STATES[0]+59.3000)));
ALGEBRAIC[6] =  3800.00*exp( - 0.0720000*(STATES[0]+61.0000));
ALGEBRAIC[7] = 284.400/(1.00000+exp( 0.0812000*(STATES[0]+115.900)));
ALGEBRAIC[8] = ( 18.7700*(STATES[0]+64.4000))/(1.00000 - exp( - 0.220000*(STATES[0]+64.4000)));
ALGEBRAIC[10] =  CONSTANTS[72]*pow(STATES[8], 3.00000)*STATES[9]*(STATES[1] - ( log((STATES[6]+ 0.120000*STATES[7])/(STATES[2]+ 0.120000*STATES[3]))*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2]);
ALGEBRAIC[11] = ( 117.260*(STATES[1]+59.3000))/(1.00000 - exp( - 0.550000*(STATES[1]+59.3000)));
ALGEBRAIC[12] =  3800.00*exp( - 0.0720000*(STATES[1]+61.0000));
ALGEBRAIC[13] = 284.400/(1.00000+exp( 0.0812000*(STATES[1]+115.900)));
ALGEBRAIC[14] = ( 18.7700*(STATES[1]+64.4000))/(1.00000 - exp( - 0.220000*(STATES[1]+64.4000)));
ALGEBRAIC[16] = 1.00000/(1.00000+exp(- (STATES[0]+15.3000)/5.00000));
ALGEBRAIC[17] = 0.000250000+ 0.00305000*exp( - 0.00450000*pow(STATES[0]+7.00000, 2.00000))+ 0.00105000*exp( - 0.00200000*pow(STATES[0] - 18.0000, 2.00000));
ALGEBRAIC[18] = 1.00000/(1.00000+exp((STATES[0]+26.7000)/5.40000));
ALGEBRAIC[19] =  0.105000*exp(- pow((STATES[0]+45.0000)/12.0000, 2.00000))+0.0400000/(1.00000+exp((- STATES[0]+25.0000)/25.0000))+0.0150000/(1.00000+exp((STATES[0]+75.0000)/25.0000));
ALGEBRAIC[20] = ALGEBRAIC[18];
ALGEBRAIC[21] =  0.0410000*exp(- pow((STATES[0]+47.0000)/12.0000, 2.00000))+0.0800000/(1.00000+exp(- (STATES[0]+55.0000)/5.00000))+0.0150000/(1.00000+exp((STATES[0]+75.0000)/25.0000));
ALGEBRAIC[22] = 1.00000/(1.00000+STATES[14]/0.0100000);
ALGEBRAIC[23] =  (( (( CONSTANTS[61]*4.00000*STATES[0]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1]))*( STATES[14]*exp(( 2.00000*STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) -  0.341000*CONSTANTS[4]))/(exp(( 2.00000*STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) - 1.00000))*STATES[10]*( (0.900000+STATES[13]/10.0000)*STATES[11]+ (0.100000 - STATES[13]/10.0000)*STATES[12]);
ALGEBRAIC[25] = 1.00000/(1.00000+exp(- (STATES[1]+15.3000)/5.00000));
ALGEBRAIC[26] = 0.000250000+ 0.00305000*exp( - 0.00450000*pow(STATES[1]+7.00000, 2.00000))+ 0.00105000*exp( - 0.00200000*pow(STATES[1] - 18.0000, 2.00000));
ALGEBRAIC[27] = 1.00000/(1.00000+exp((STATES[1]+26.7000)/5.40000));
ALGEBRAIC[28] =  0.105000*exp(- pow((STATES[1]+45.0000)/12.0000, 2.00000))+0.0400000/(1.00000+exp((- STATES[1]+25.0000)/25.0000))+0.0150000/(1.00000+exp((STATES[1]+75.0000)/25.0000));
ALGEBRAIC[29] = ALGEBRAIC[27];
ALGEBRAIC[30] =  0.0410000*exp(- pow((STATES[1]+47.0000)/12.0000, 2.00000))+0.0800000/(1.00000+exp(- (STATES[1]+55.0000)/5.00000))+0.0150000/(1.00000+exp((STATES[1]+75.0000)/25.0000));
ALGEBRAIC[31] = 1.00000/(1.00000+STATES[14]/0.0100000);
ALGEBRAIC[32] =  (( (( CONSTANTS[73]*4.00000*STATES[1]*pow(CONSTANTS[2], 2.00000))/( CONSTANTS[0]*CONSTANTS[1]))*( STATES[14]*exp(( 2.00000*STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) -  0.341000*STATES[20]))/(exp(( 2.00000*STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1])) - 1.00000))*STATES[16]*( (0.900000+STATES[19]/10.0000)*STATES[17]+ (0.100000 - STATES[19]/10.0000)*STATES[18]);
ALGEBRAIC[34] = 1.00000/(1.00000+exp((STATES[0]+10.6000)/- 11.4200));
ALGEBRAIC[35] = 1.00000/( 45.1600*exp( 0.0357700*(STATES[0]+50.0000))+ 98.9000*exp( - 0.100000*(STATES[0]+38.0000)));
ALGEBRAIC[36] = 1.00000/(1.00000+exp((STATES[0]+45.3000)/6.88410));
ALGEBRAIC[37] =  0.350000*exp(- pow( 0.0666000*(STATES[0]+70.0000), 2.00000))+0.0350000;
ALGEBRAIC[38] = 1.00000/(1.00000+exp((STATES[0]+45.3000)/6.88410));
ALGEBRAIC[39] =  3.70000*exp(- pow( 0.0333000*(STATES[0]+70.0000), 2.00000))+0.0350000;
ALGEBRAIC[40] = ( log(STATES[7]/STATES[3])*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2];
ALGEBRAIC[41] =  CONSTANTS[78]*STATES[24]*( 0.886000*STATES[25]+ 0.114000*STATES[26])*(STATES[1] - ALGEBRAIC[40]);
ALGEBRAIC[42] = 1.00000/(1.00000+exp((STATES[1]+10.6000)/- 11.4200));
ALGEBRAIC[43] = 1.00000/( 45.1600*exp( 0.0357700*(STATES[1]+50.0000))+ 98.9000*exp( - 0.100000*(STATES[1]+38.0000)));
ALGEBRAIC[44] = 1.00000/(1.00000+exp((STATES[1]+45.3000)/6.88410));
ALGEBRAIC[45] =  0.350000*exp(- pow( 0.0666000*(STATES[1]+70.0000), 2.00000))+0.0350000;
ALGEBRAIC[46] = 1.00000/(1.00000+exp((STATES[1]+45.3000)/6.88410));
ALGEBRAIC[47] =  3.70000*exp(- pow( 0.0333000*(STATES[1]+70.0000), 2.00000))+0.0350000;
ALGEBRAIC[33] = ( log(CONSTANTS[5]/STATES[3])*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2];
ALGEBRAIC[48] =  CONSTANTS[63]*STATES[27]*STATES[28]*(STATES[0] - ALGEBRAIC[33]);
ALGEBRAIC[49] = 1.00000/(1.00000+exp(- (STATES[0]+11.5000)/11.8200));
ALGEBRAIC[50] = 10.0000/( 45.1600*exp( 0.0357700*(STATES[0]+50.0000))+ 98.9000*exp( - 0.100000*(STATES[0]+38.0000)));
ALGEBRAIC[51] = 1.00000/(1.00000+exp((STATES[0]+87.5000)/10.3000));
ALGEBRAIC[52] =  CONSTANTS[75]*STATES[29]*STATES[30]*(STATES[1] - ALGEBRAIC[40]);
ALGEBRAIC[53] = 1.00000/(1.00000+exp(- (STATES[1]+11.5000)/11.8200));
ALGEBRAIC[54] = 10.0000/( 45.1600*exp( 0.0357700*(STATES[1]+50.0000))+ 98.9000*exp( - 0.100000*(STATES[1]+38.0000)));
ALGEBRAIC[55] = 1.00000/(1.00000+exp((STATES[1]+87.5000)/10.3000));
ALGEBRAIC[3] = ( log(CONSTANTS[3]/STATES[2])*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2];
ALGEBRAIC[56] =  CONSTANTS[62]*STATES[31]*( 0.200000*(STATES[0] - ALGEBRAIC[3])+ 0.800000*(STATES[0] - ALGEBRAIC[33]));
ALGEBRAIC[57] = 1.00000/(1.00000+exp((STATES[0]+138.600)/10.4800));
ALGEBRAIC[58] = 1.00000/( 0.118850*exp((STATES[0]+80.0000)/28.3700)+ 0.562300*exp(- (STATES[0]+80.0000)/14.1900));
ALGEBRAIC[9] = ( log(STATES[6]/STATES[2])*CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2];
ALGEBRAIC[59] =  CONSTANTS[74]*STATES[32]*( 0.200000*(STATES[1] - ALGEBRAIC[9])+ 0.800000*(STATES[1] - ALGEBRAIC[40]));
ALGEBRAIC[60] = 1.00000/(1.00000+exp((STATES[1]+138.600)/10.4800));
ALGEBRAIC[61] = 1.00000/( 0.118850*exp((STATES[1]+80.0000)/28.3700)+ 0.562300*exp(- (STATES[1]+80.0000)/14.1900));
ALGEBRAIC[62] = ( CONSTANTS[64]*((STATES[0] - ALGEBRAIC[33]) - 1.73000))/(1.00000+ exp( (( 1.61300*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))*((STATES[0] - ALGEBRAIC[33]) - 1.73000))*(1.00000+exp((CONSTANTS[5] - 0.998800)/- 0.124000)));
ALGEBRAIC[63] = ( CONSTANTS[76]*((STATES[1] - ALGEBRAIC[40]) - 1.73000))/(1.00000+ exp( (( 1.61300*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))*((STATES[1] - ALGEBRAIC[40]) - 1.73000))*(1.00000+exp((STATES[7] - 0.998800)/- 0.124000)));
ALGEBRAIC[64] =  CONSTANTS[67]*(STATES[0] - ALGEBRAIC[3]);
ALGEBRAIC[65] =  CONSTANTS[79]*(STATES[1] - ALGEBRAIC[9]);
ALGEBRAIC[15] = ( log(CONSTANTS[4]/STATES[15])*CONSTANTS[0]*CONSTANTS[1])/( 2.00000*CONSTANTS[2]);
ALGEBRAIC[66] =  CONSTANTS[68]*(STATES[0] - ALGEBRAIC[15]);
ALGEBRAIC[24] = ( log(STATES[20]/STATES[15])*CONSTANTS[0]*CONSTANTS[1])/( 2.00000*CONSTANTS[2]);
ALGEBRAIC[67] =  CONSTANTS[80]*(STATES[1] - ALGEBRAIC[24]);
ALGEBRAIC[68] =  CONSTANTS[65]*(STATES[0] - ALGEBRAIC[33]);
ALGEBRAIC[69] =  CONSTANTS[77]*(STATES[1] - ALGEBRAIC[40]);
ALGEBRAIC[70] = ( CONSTANTS[71]*( exp( 0.0187000*STATES[0])*pow(STATES[2], 3.00000)*CONSTANTS[4] -  exp( - 0.0187000*STATES[0])*pow(CONSTANTS[3], 3.00000)*STATES[15]))/(1.00000+ 0.000100000*( pow(CONSTANTS[3], 3.00000)*STATES[15]+ pow(STATES[2], 3.00000)*CONSTANTS[4]));
ALGEBRAIC[71] = ( CONSTANTS[83]*( exp( 0.0187000*STATES[1])*pow(STATES[2], 3.00000)*STATES[20] -  exp( - 0.0187000*STATES[1])*pow(STATES[6], 3.00000)*STATES[15]))/(1.00000+ 0.000100000*( pow(STATES[6], 3.00000)*STATES[15]+ pow(STATES[2], 3.00000)*STATES[20]));
ALGEBRAIC[72] = ( (( (CONSTANTS[70]/(1.00000+ 0.124500*exp(( - 0.100000*STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))+ (( 0.0365000*1.00000)/7.00000)*(exp(CONSTANTS[3]/67.3000) - 1.00000)*exp(( - STATES[0]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))))*1.00000)/(1.00000+pow(10.0000/STATES[2], 1.50000)))*CONSTANTS[5])/(CONSTANTS[5]+1.50000);
ALGEBRAIC[73] = ( (( (CONSTANTS[82]/(1.00000+ 0.124500*exp(( - 0.100000*STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))+ (( 0.0365000*1.00000)/7.00000)*(exp(STATES[6]/67.3000) - 1.00000)*exp(( - STATES[1]*CONSTANTS[2])/( CONSTANTS[0]*CONSTANTS[1]))))*1.00000)/(1.00000+pow(10.0000/STATES[2], 1.50000)))*STATES[7])/(STATES[7]+1.50000);
ALGEBRAIC[74] = ( CONSTANTS[69]*STATES[15])/(0.000400000+STATES[15]);
ALGEBRAIC[75] = ( CONSTANTS[81]*STATES[15])/(0.000400000+STATES[15]);
ALGEBRAIC[76] =  (( 1.00000*CONSTANTS[87])/CONSTANTS[42])*(STATES[6] - CONSTANTS[3]);
ALGEBRAIC[77] =  (( 1.00000*CONSTANTS[87])/CONSTANTS[43])*(STATES[20] - CONSTANTS[4]);
ALGEBRAIC[78] =  (( 1.00000*CONSTANTS[87])/CONSTANTS[44])*(STATES[7] - CONSTANTS[5]);
ALGEBRAIC[79] = ( 1.00000*CONSTANTS[56]*( 0.0400000*10.0000*pow(STATES[15]/0.000168000, 1.20000) - ( 0.900000*STATES[33])/3.29000))/(1.00000+pow(STATES[15]/0.000168000, 1.20000)+STATES[33]/3.29000);
ALGEBRAIC[80] =  (( 1.00000*CONSTANTS[55])/CONSTANTS[45])*(STATES[33] - STATES[34]);
ALGEBRAIC[81] =  1800.00*CONSTANTS[55]*(STATES[36]+STATES[37])*(STATES[34] - STATES[14]);
ALGEBRAIC[82] = ( 1.00000*(STATES[14] - STATES[15])*CONSTANTS[56])/CONSTANTS[50];
ALGEBRAIC[83] =  20000.0*STATES[15]*(1.00000 - STATES[39]) -  0.0700000*STATES[39];
ALGEBRAIC[84] =  40000.0*STATES[15]*(1.00000 - STATES[40]) -  STATES[40]*40.0000;
ALGEBRAIC[85] =  CONSTANTS[66]*STATES[21]*( 0.886000*STATES[22]+ 0.114000*STATES[23])*(STATES[0] - ALGEBRAIC[33]);
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
SI[1] = 1.0;
SI[2] = 1.0;
SI[3] = 1.0;
SI[4] = 1.0;
SI[5] = 1.0;
SI[6] = 1.0;
SI[7] = 1.0;
SI[8] = 1.0;
SI[9] = 1.0;
SI[10] = 1.0;
SI[11] = 1.0;
SI[12] = 1.0;
SI[13] = 1.0;
SI[14] = 1.0;
SI[15] = 1.0;
SI[16] = 1.0;
SI[17] = 1.0;
SI[18] = 1.0;
SI[19] = 1.0;
SI[20] = 1.0;
SI[21] = 1.0;
SI[22] = 1.0;
SI[23] = 1.0;
SI[24] = 1.0;
SI[25] = 1.0;
SI[26] = 1.0;
SI[27] = 1.0;
SI[28] = 1.0;
SI[29] = 1.0;
SI[30] = 1.0;
SI[31] = 1.0;
SI[32] = 1.0;
SI[33] = 1.0;
SI[34] = 1.0;
SI[35] = 1.0;
SI[36] = 1.0;
SI[37] = 1.0;
SI[38] = 1.0;
SI[39] = 1.0;
SI[40] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
CONDVAR[0] = (VOI - ALGEBRAIC[1]) - CONSTANTS[10];
CONDVAR[1] = (VOI - ALGEBRAIC[1]) - (CONSTANTS[10]+CONSTANTS[12]);
}