Generated Code
The following is c_ida code generated by the CellML API from this CellML file. (Back to language selection)
The raw code is available.
/* There are a total of 82 entries in the algebraic variable array. There are a total of 29 entries in each of the rate and state variable arrays. There are a total of 63 entries in the constant variable array. */ /* * VOI is time in component environment (second). * STATES[0] is V in component membrane (millivolt). * CONSTANTS[0] is R in component membrane (joule_per_kilomole_kelvin). * CONSTANTS[1] is T in component membrane (kelvin). * CONSTANTS[2] is F in component membrane (coulomb_per_mole). * CONSTANTS[3] is C in component membrane (microF). * CONSTANTS[53] is RTONF in component membrane (millivolt). * ALGEBRAIC[30] is i_Na in component fast_sodium_current (nanoA). * ALGEBRAIC[81] is i_CaL in component L_type_calcium_current (nanoA). * ALGEBRAIC[50] is i_to in component transient_outward_potassium_current (nanoA). * ALGEBRAIC[4] is i_Kr in component rapid_delayed_rectifier_potassium_current (nanoA). * ALGEBRAIC[1] is i_f in component hyperpolarising_activated_current (nanoA). * ALGEBRAIC[57] is i_st in component sustained_outward_potassium_current (nanoA). * ALGEBRAIC[14] is i_K1 in component time_independent_potassium_current (nanoA). * ALGEBRAIC[29] is i_NaCa in component sodium_calcium_exchange_current (nanoA). * ALGEBRAIC[16] is i_p in component sodium_potassium_pump (nanoA). * ALGEBRAIC[15] is i_b in component background_current (nanoA). * ALGEBRAIC[67] is i_ACh in component acetylcholine_sensitive_current (nanoA). * ALGEBRAIC[0] is i_Stim in component membrane (nanoA). * CONSTANTS[4] is stim_start in component membrane (second). * CONSTANTS[5] is stim_end in component membrane (second). * CONSTANTS[6] is stim_period in component membrane (second). * CONSTANTS[7] is stim_duration in component membrane (second). * CONSTANTS[8] is stim_amplitude in component membrane (nanoA). * CONSTANTS[9] is g_f in component hyperpolarising_activated_current (microS). * CONSTANTS[10] is ACh in component acetylcholine_sensitive_current (millimolar). * STATES[1] is y in component hyperpolarising_activated_current_y_gate (dimensionless). * ALGEBRAIC[2] is y_inf in component hyperpolarising_activated_current_y_gate (dimensionless). * ALGEBRAIC[3] is tau_y in component hyperpolarising_activated_current_y_gate (second). * CONSTANTS[11] is g_Kr in component rapid_delayed_rectifier_potassium_current (microS). * CONSTANTS[55] is E_K in component rapid_delayed_rectifier_potassium_current (millivolt). * CONSTANTS[12] is Ki in component intracellular_potassium_concentration (millimolar). * CONSTANTS[13] is Kc in component extracellular_potassium_concentration (millimolar). * STATES[2] is paf in component rapid_delayed_rectifier_potassium_current_paf_gate (dimensionless). * STATES[3] is pas in component rapid_delayed_rectifier_potassium_current_pas_gate (dimensionless). * STATES[4] is pik in component rapid_delayed_rectifier_potassium_current_pik_gate (dimensionless). * ALGEBRAIC[5] is paf_infinity in component rapid_delayed_rectifier_potassium_current_paf_gate (dimensionless). * ALGEBRAIC[6] is tau_paf in component rapid_delayed_rectifier_potassium_current_paf_gate (second). * ALGEBRAIC[7] is pas_infinity in component rapid_delayed_rectifier_potassium_current_pas_gate (dimensionless). * ALGEBRAIC[8] is tau_pas in component rapid_delayed_rectifier_potassium_current_pas_gate (second). * ALGEBRAIC[9] is pik_infinity in component rapid_delayed_rectifier_potassium_current_pik_gate (dimensionless). * ALGEBRAIC[10] is alpha_pik in component rapid_delayed_rectifier_potassium_current_pik_gate (per_second). * ALGEBRAIC[11] is beta_pik in component rapid_delayed_rectifier_potassium_current_pik_gate (per_second). * ALGEBRAIC[12] is tau_pik in component rapid_delayed_rectifier_potassium_current_pik_gate (second). * CONSTANTS[14] is g_K1 in component time_independent_potassium_current (microS). * ALGEBRAIC[13] is g_K1_prime in component time_independent_potassium_current (microS). * CONSTANTS[15] is g_b in component background_current (microS). * CONSTANTS[16] is E_b in component background_current (millivolt). * CONSTANTS[17] is I_p in component sodium_potassium_pump (nanoA). * CONSTANTS[18] is Nai in component intracellular_sodium_concentration (millimolar). * CONSTANTS[19] is kNaCa in component sodium_calcium_exchange_current (nanoA). * ALGEBRAIC[25] is x1 in component sodium_calcium_exchange_current (dimensionless). * ALGEBRAIC[26] is x2 in component sodium_calcium_exchange_current (dimensionless). * ALGEBRAIC[27] is x3 in component sodium_calcium_exchange_current (dimensionless). * ALGEBRAIC[28] is x4 in component sodium_calcium_exchange_current (dimensionless). * ALGEBRAIC[22] is k41 in component sodium_calcium_exchange_current (dimensionless). * CONSTANTS[54] is k34 in component sodium_calcium_exchange_current (dimensionless). * ALGEBRAIC[19] is k23 in component sodium_calcium_exchange_current (dimensionless). * ALGEBRAIC[20] is k21 in component sodium_calcium_exchange_current (dimensionless). * ALGEBRAIC[18] is k32 in component sodium_calcium_exchange_current (dimensionless). * CONSTANTS[58] is k43 in component sodium_calcium_exchange_current (dimensionless). * ALGEBRAIC[24] is k12 in component sodium_calcium_exchange_current (dimensionless). * ALGEBRAIC[23] is k14 in component sodium_calcium_exchange_current (dimensionless). * CONSTANTS[20] is Qci in component sodium_calcium_exchange_current (dimensionless). * CONSTANTS[21] is Qn in component sodium_calcium_exchange_current (dimensionless). * CONSTANTS[22] is Qco in component sodium_calcium_exchange_current (dimensionless). * CONSTANTS[23] is Kci in component sodium_calcium_exchange_current (millimolar). * CONSTANTS[24] is K1ni in component sodium_calcium_exchange_current (millimolar). * CONSTANTS[25] is K2ni in component sodium_calcium_exchange_current (millimolar). * CONSTANTS[26] is K3ni in component sodium_calcium_exchange_current (millimolar). * CONSTANTS[27] is Kcni in component sodium_calcium_exchange_current (millimolar). * CONSTANTS[28] is K3no in component sodium_calcium_exchange_current (millimolar). * CONSTANTS[29] is K1no in component sodium_calcium_exchange_current (millimolar). * CONSTANTS[30] is K2no in component sodium_calcium_exchange_current (millimolar). * CONSTANTS[31] is Kco in component sodium_calcium_exchange_current (millimolar). * ALGEBRAIC[17] is do in component sodium_calcium_exchange_current (dimensionless). * ALGEBRAIC[21] is di in component sodium_calcium_exchange_current (dimensionless). * CONSTANTS[32] is Cao in component extracellular_calcium_concentration (millimolar). * CONSTANTS[33] is Nao in component extracellular_sodium_concentration (millimolar). * STATES[5] is Casub in component intracellular_calcium_concentration (millimolar). * CONSTANTS[34] is g_Na in component fast_sodium_current (microlitre_per_second). * CONSTANTS[56] is E_Na in component fast_sodium_current (millivolt). * STATES[6] is m in component fast_sodium_current_m_gate (dimensionless). * STATES[7] is h1 in component fast_sodium_current_h1_gate (dimensionless). * STATES[8] is h2 in component fast_sodium_current_h2_gate (dimensionless). * ALGEBRAIC[32] is alpha_m in component fast_sodium_current_m_gate (per_second). * ALGEBRAIC[33] is beta_m in component fast_sodium_current_m_gate (per_second). * CONSTANTS[35] is delta_m in component fast_sodium_current_m_gate (millivolt). * ALGEBRAIC[31] is E0_m in component fast_sodium_current_m_gate (millivolt). * ALGEBRAIC[34] is alpha_h1 in component fast_sodium_current_h1_gate (per_second). * ALGEBRAIC[35] is beta_h1 in component fast_sodium_current_h1_gate (per_second). * ALGEBRAIC[36] is h1_inf in component fast_sodium_current_h1_gate (dimensionless). * ALGEBRAIC[37] is tau_h1 in component fast_sodium_current_h1_gate (second). * ALGEBRAIC[38] is alpha_h2 in component fast_sodium_current_h2_gate (per_second). * ALGEBRAIC[39] is beta_h2 in component fast_sodium_current_h2_gate (per_second). * ALGEBRAIC[40] is h2_inf in component fast_sodium_current_h2_gate (dimensionless). * ALGEBRAIC[41] is tau_h2 in component fast_sodium_current_h2_gate (second). * CONSTANTS[36] is g_CaL in component L_type_calcium_current (microS). * CONSTANTS[37] is E_CaL in component L_type_calcium_current (millivolt). * STATES[9] is d in component L_type_calcium_current_d_gate (dimensionless). * STATES[10] is f in component L_type_calcium_current_f_gate (dimensionless). * STATES[11] is f2 in component L_type_calcium_current_f2_gate (dimensionless). * ALGEBRAIC[42] is alpha_d in component L_type_calcium_current_d_gate (per_second). * ALGEBRAIC[43] is beta_d in component L_type_calcium_current_d_gate (per_second). * ALGEBRAIC[44] is d_inf in component L_type_calcium_current_d_gate (dimensionless). * ALGEBRAIC[45] is tau_d in component L_type_calcium_current_d_gate (second). * CONSTANTS[38] is act_shift in component L_type_calcium_current_d_gate (millivolt). * CONSTANTS[39] is slope_factor_act in component L_type_calcium_current_d_gate (millivolt). * ALGEBRAIC[46] is f_inf in component L_type_calcium_current_f_gate (dimensionless). * ALGEBRAIC[47] is tau_f in component L_type_calcium_current_f_gate (second). * CONSTANTS[40] is inact_shift in component L_type_calcium_current_f_gate (millivolt). * ALGEBRAIC[48] is f2_inf in component L_type_calcium_current_f2_gate (dimensionless). * ALGEBRAIC[49] is tau_f2 in component L_type_calcium_current_f2_gate (second). * CONSTANTS[41] is inact_shift in component L_type_calcium_current_f2_gate (millivolt). * CONSTANTS[57] is E_K in component transient_outward_potassium_current (millivolt). * CONSTANTS[42] is g_to in component transient_outward_potassium_current (microS). * STATES[12] is r in component transient_outward_potassium_current_r_gate (dimensionless). * STATES[13] is q_fast in component transient_outward_potassium_current_qfast_gate (dimensionless). * STATES[14] is q_slow in component transient_outward_potassium_current_qslow_gate (dimensionless). * ALGEBRAIC[52] is tau_r in component transient_outward_potassium_current_r_gate (second). * ALGEBRAIC[51] is r_infinity in component transient_outward_potassium_current_r_gate (dimensionless). * ALGEBRAIC[54] is tau_qfast in component transient_outward_potassium_current_qfast_gate (second). * ALGEBRAIC[53] is qfast_infinity in component transient_outward_potassium_current_qfast_gate (dimensionless). * ALGEBRAIC[56] is tau_qslow in component transient_outward_potassium_current_qslow_gate (second). * ALGEBRAIC[55] is qslow_infinity in component transient_outward_potassium_current_qslow_gate (dimensionless). * CONSTANTS[43] is E_st in component sustained_outward_potassium_current (millivolt). * CONSTANTS[44] is g_st in component sustained_outward_potassium_current (microS). * STATES[15] is qa in component sustained_outward_potassium_current_qa_gate (dimensionless). * STATES[16] is qi in component sustained_outward_potassium_current_qi_gate (dimensionless). * ALGEBRAIC[61] is tau_qa in component sustained_outward_potassium_current_qa_gate (second). * ALGEBRAIC[58] is qa_infinity in component sustained_outward_potassium_current_qa_gate (dimensionless). * ALGEBRAIC[59] is alpha_qa in component sustained_outward_potassium_current_qa_gate (per_second). * ALGEBRAIC[60] is beta_qa in component sustained_outward_potassium_current_qa_gate (per_second). * ALGEBRAIC[65] is tau_qi in component sustained_outward_potassium_current_qi_gate (second). * ALGEBRAIC[62] is alpha_qi in component sustained_outward_potassium_current_qi_gate (per_second). * ALGEBRAIC[63] is beta_qi in component sustained_outward_potassium_current_qi_gate (per_second). * ALGEBRAIC[64] is qi_infinity in component sustained_outward_potassium_current_qi_gate (dimensionless). * ALGEBRAIC[66] is g_ACh in component acetylcholine_sensitive_current (microS). * CONSTANTS[45] is g_ACh_max in component acetylcholine_sensitive_current (microS). * CONSTANTS[46] is K_ACh in component acetylcholine_sensitive_current (millimolar). * STATES[17] is achf in component acetylcholine_sensitive_current_achf_gate (dimensionless). * STATES[18] is achs in component acetylcholine_sensitive_current_achs_gate (dimensionless). * CONSTANTS[47] is alpha_achf in component acetylcholine_sensitive_current_achf_gate (per_second). * ALGEBRAIC[68] is beta_achf in component acetylcholine_sensitive_current_achf_gate (per_second). * CONSTANTS[48] is alpha_achs in component acetylcholine_sensitive_current_achs_gate (per_second). * ALGEBRAIC[69] is beta_achs in component acetylcholine_sensitive_current_achs_gate (per_second). * STATES[19] is Cai in component intracellular_calcium_concentration (millimolar). * CONSTANTS[59] is V_up in component intracellular_calcium_concentration (micrometre3). * CONSTANTS[60] is V_rel in component intracellular_calcium_concentration (micrometre3). * CONSTANTS[61] is V_sub in component intracellular_calcium_concentration (micrometre3). * CONSTANTS[62] is Vi in component intracellular_calcium_concentration (micrometre3). * CONSTANTS[49] is V_cell in component intracellular_calcium_concentration (micrometre3). * ALGEBRAIC[71] is i_up in component intracellular_calcium_concentration (millimolar_per_second). * ALGEBRAIC[72] is i_tr in component intracellular_calcium_concentration (millimolar_per_second). * ALGEBRAIC[73] is i_rel in component intracellular_calcium_concentration (millimolar_per_second). * ALGEBRAIC[70] is i_diff in component intracellular_calcium_concentration (millimolar_per_second). * STATES[20] is Ca_up in component intracellular_calcium_concentration (millimolar). * STATES[21] is Ca_rel in component intracellular_calcium_concentration (millimolar). * CONSTANTS[50] is P_rel in component intracellular_calcium_concentration (per_second). * CONSTANTS[51] is K_up in component intracellular_calcium_concentration (millimolar). * CONSTANTS[52] is tau_tr in component intracellular_calcium_concentration (second). * STATES[22] is f_TC in component intracellular_calcium_concentration (dimensionless). * STATES[23] is f_TMC in component intracellular_calcium_concentration (dimensionless). * STATES[24] is f_TMM in component intracellular_calcium_concentration (dimensionless). * STATES[25] is f_CMi in component intracellular_calcium_concentration (dimensionless). * STATES[26] is f_CMs in component intracellular_calcium_concentration (dimensionless). * STATES[27] is f_CQ in component intracellular_calcium_concentration (dimensionless). * STATES[28] is f_CSL in component intracellular_calcium_concentration (dimensionless). * ALGEBRAIC[74] is diff_f_TC in component intracellular_calcium_concentration (per_second). * ALGEBRAIC[75] is diff_f_TMC in component intracellular_calcium_concentration (per_second). * ALGEBRAIC[76] is diff_f_TMM in component intracellular_calcium_concentration (per_second). * ALGEBRAIC[77] is diff_f_CMi in component intracellular_calcium_concentration (per_second). * ALGEBRAIC[78] is diff_f_CMs in component intracellular_calcium_concentration (per_second). * ALGEBRAIC[79] is diff_f_CQ in component intracellular_calcium_concentration (per_second). * ALGEBRAIC[80] is diff_f_CSL in component intracellular_calcium_concentration (per_second). * RATES[0] is d/dt V in component membrane (millivolt). * RATES[1] is d/dt y in component hyperpolarising_activated_current_y_gate (dimensionless). * RATES[2] is d/dt paf in component rapid_delayed_rectifier_potassium_current_paf_gate (dimensionless). * RATES[3] is d/dt pas in component rapid_delayed_rectifier_potassium_current_pas_gate (dimensionless). * RATES[4] is d/dt pik in component rapid_delayed_rectifier_potassium_current_pik_gate (dimensionless). * RATES[6] is d/dt m in component fast_sodium_current_m_gate (dimensionless). * RATES[7] is d/dt h1 in component fast_sodium_current_h1_gate (dimensionless). * RATES[8] is d/dt h2 in component fast_sodium_current_h2_gate (dimensionless). * RATES[9] is d/dt d in component L_type_calcium_current_d_gate (dimensionless). * RATES[10] is d/dt f in component L_type_calcium_current_f_gate (dimensionless). * RATES[11] is d/dt f2 in component L_type_calcium_current_f2_gate (dimensionless). * RATES[12] is d/dt r in component transient_outward_potassium_current_r_gate (dimensionless). * RATES[13] is d/dt q_fast in component transient_outward_potassium_current_qfast_gate (dimensionless). * RATES[14] is d/dt q_slow in component transient_outward_potassium_current_qslow_gate (dimensionless). * RATES[15] is d/dt qa in component sustained_outward_potassium_current_qa_gate (dimensionless). * RATES[16] is d/dt qi in component sustained_outward_potassium_current_qi_gate (dimensionless). * RATES[17] is d/dt achf in component acetylcholine_sensitive_current_achf_gate (dimensionless). * RATES[18] is d/dt achs in component acetylcholine_sensitive_current_achs_gate (dimensionless). * RATES[20] is d/dt Ca_up in component intracellular_calcium_concentration (millimolar). * RATES[21] is d/dt Ca_rel in component intracellular_calcium_concentration (millimolar). * RATES[19] is d/dt Cai in component intracellular_calcium_concentration (millimolar). * RATES[5] is d/dt Casub in component intracellular_calcium_concentration (millimolar). * RATES[22] is d/dt f_TC in component intracellular_calcium_concentration (dimensionless). * RATES[23] is d/dt f_TMC in component intracellular_calcium_concentration (dimensionless). * RATES[24] is d/dt f_TMM in component intracellular_calcium_concentration (dimensionless). * RATES[25] is d/dt f_CMi in component intracellular_calcium_concentration (dimensionless). * RATES[26] is d/dt f_CMs in component intracellular_calcium_concentration (dimensionless). * RATES[27] is d/dt f_CQ in component intracellular_calcium_concentration (dimensionless). * RATES[28] is d/dt f_CSL in component intracellular_calcium_concentration (dimensionless). * There are a total of 4 condition variables. */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = -71.5535452525735; CONSTANTS[0] = 8314.472; CONSTANTS[1] = 310; CONSTANTS[2] = 96485.3415; CONSTANTS[3] = 4e-5; CONSTANTS[4] = 0.1; CONSTANTS[5] = 99999; CONSTANTS[6] = 1; CONSTANTS[7] = 0.001; CONSTANTS[8] = -2; CONSTANTS[9] = 0; CONSTANTS[10] = 0; STATES[1] = 0.231892950445813; CONSTANTS[11] = 0.0015; CONSTANTS[12] = 140; CONSTANTS[13] = 5.4; STATES[2] = 0.000907827363439979; STATES[3] = 0.00289901267127429; STATES[4] = 0.987889953123897; CONSTANTS[14] = 0.0125; CONSTANTS[15] = 0.0018; CONSTANTS[16] = -52.5; CONSTANTS[17] = 0.0246; CONSTANTS[18] = 8; CONSTANTS[19] = 5.916; CONSTANTS[20] = 0.1369; CONSTANTS[21] = 0.4315; CONSTANTS[22] = 0; CONSTANTS[23] = 0.0207; CONSTANTS[24] = 395.3; CONSTANTS[25] = 2.289; CONSTANTS[26] = 26.44; CONSTANTS[27] = 26.44; CONSTANTS[28] = 4.663; CONSTANTS[29] = 1628; CONSTANTS[30] = 561.4; CONSTANTS[31] = 3.663; CONSTANTS[32] = 2; CONSTANTS[33] = 140; STATES[5] = 2.86962804165375e-5; CONSTANTS[34] = 5e-7; STATES[6] = 0.0104794040295793; STATES[7] = 0.792210965943567; STATES[8] = 0.78834840378483; CONSTANTS[35] = 1e-5; CONSTANTS[36] = 0.0185; CONSTANTS[37] = 62.5; STATES[9] = 3.2286733432613e-5; STATES[10] = 0.998822085003546; STATES[11] = 0.998815467202695; CONSTANTS[38] = 0; CONSTANTS[39] = -6.61; CONSTANTS[40] = -5; CONSTANTS[41] = -5; CONSTANTS[42] = 0.02; STATES[12] = 0.00802880907824072; STATES[13] = 0.995494395556732; STATES[14] = 0.547966933708077; CONSTANTS[43] = -37.4; CONSTANTS[44] = 0; STATES[15] = 0.0758461021803425; STATES[16] = 0.943345608766177; CONSTANTS[45] = 0.0198; CONSTANTS[46] = 0.00035; STATES[17] = 0.760265641624297; STATES[18] = 0.764664867332735; CONSTANTS[47] = 73.1; CONSTANTS[48] = 3.7; STATES[19] = 3.10430405261017e-5; CONSTANTS[49] = 4.39823e-6; STATES[20] = 0.667220893111124; STATES[21] = 0.557458998353581; CONSTANTS[50] = 1805.6; CONSTANTS[51] = 0.0006; CONSTANTS[52] = 0.06; STATES[22] = 0.0061557815047835; STATES[23] = 0.112200926320798; STATES[24] = 0.784309464255762; STATES[25] = 0.012895686161953; STATES[26] = 0.0119201823967662; STATES[27] = 0.400684024879925; STATES[28] = 8.91124266400812e-6; CONSTANTS[53] = ( CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2]; CONSTANTS[54] = CONSTANTS[33]/(CONSTANTS[28]+CONSTANTS[33]); CONSTANTS[55] = CONSTANTS[53]*log(CONSTANTS[13]/CONSTANTS[12]); CONSTANTS[56] = CONSTANTS[53]*log(CONSTANTS[33]/CONSTANTS[18]); CONSTANTS[57] = CONSTANTS[53]*log(CONSTANTS[13]/CONSTANTS[12]); CONSTANTS[58] = CONSTANTS[18]/(CONSTANTS[26]+CONSTANTS[18]); CONSTANTS[59] = 0.0116000*CONSTANTS[49]; CONSTANTS[60] = 0.00120000*CONSTANTS[49]; CONSTANTS[61] = 0.0100000*CONSTANTS[49]; CONSTANTS[62] = 0.460000*CONSTANTS[49] - CONSTANTS[61]; RATES[0] = 0.1001; RATES[1] = 0.1001; RATES[2] = 0.1001; RATES[3] = 0.1001; RATES[4] = 0.1001; RATES[6] = 0.1001; RATES[7] = 0.1001; RATES[8] = 0.1001; RATES[9] = 0.1001; RATES[10] = 0.1001; RATES[11] = 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[20] = 0.1001; RATES[21] = 0.1001; RATES[19] = 0.1001; RATES[5] = 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; } void computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { resid[0] = RATES[0] - - (ALGEBRAIC[30]+ALGEBRAIC[81]+ALGEBRAIC[50]+ALGEBRAIC[4]+ALGEBRAIC[1]+ALGEBRAIC[57]+ALGEBRAIC[14]+ALGEBRAIC[29]+ALGEBRAIC[16]+ALGEBRAIC[15]+ALGEBRAIC[67]+ALGEBRAIC[0])/CONSTANTS[3]; resid[1] = RATES[1] - (ALGEBRAIC[2] - STATES[1])/ALGEBRAIC[3]; resid[2] = RATES[2] - (ALGEBRAIC[5] - STATES[2])/ALGEBRAIC[6]; resid[3] = RATES[3] - (ALGEBRAIC[7] - STATES[3])/ALGEBRAIC[8]; resid[4] = RATES[4] - (ALGEBRAIC[9] - STATES[4])/ALGEBRAIC[12]; resid[5] = RATES[6] - ALGEBRAIC[32]*(1.00000 - STATES[6]) - ALGEBRAIC[33]*STATES[6]; resid[6] = RATES[7] - (ALGEBRAIC[36] - STATES[7])/ALGEBRAIC[37]; resid[7] = RATES[8] - (ALGEBRAIC[40] - STATES[8])/ALGEBRAIC[41]; resid[8] = RATES[9] - (ALGEBRAIC[44] - STATES[9])/ALGEBRAIC[45]; resid[9] = RATES[10] - (ALGEBRAIC[46] - STATES[10])/ALGEBRAIC[47]; resid[10] = RATES[11] - (ALGEBRAIC[48] - STATES[11])/ALGEBRAIC[49]; resid[11] = RATES[12] - (ALGEBRAIC[51] - STATES[12])/ALGEBRAIC[52]; resid[12] = RATES[13] - (ALGEBRAIC[53] - STATES[13])/ALGEBRAIC[54]; resid[13] = RATES[14] - (ALGEBRAIC[55] - STATES[14])/ALGEBRAIC[56]; resid[14] = RATES[15] - (ALGEBRAIC[58] - STATES[15])/ALGEBRAIC[61]; resid[15] = RATES[16] - (ALGEBRAIC[64] - STATES[16])/ALGEBRAIC[65]; resid[16] = RATES[17] - CONSTANTS[47]*(1.00000 - STATES[17]) - ALGEBRAIC[68]*STATES[17]; resid[17] = RATES[18] - CONSTANTS[48]*(1.00000 - STATES[18]) - ALGEBRAIC[69]*STATES[18]; resid[18] = RATES[20] - ALGEBRAIC[71] - ( ALGEBRAIC[72]*CONSTANTS[60])/CONSTANTS[59]; resid[19] = RATES[21] - (ALGEBRAIC[72] - ALGEBRAIC[73]) - 10.0000*ALGEBRAIC[79]; resid[20] = RATES[19] - ( ALGEBRAIC[70]*CONSTANTS[61] - ALGEBRAIC[71]*CONSTANTS[59])/CONSTANTS[62] - ( 0.0450000*ALGEBRAIC[77]+ 0.0310000*ALGEBRAIC[74]+ 0.0620000*ALGEBRAIC[75]); resid[21] = RATES[5] - (((- (ALGEBRAIC[81] - 2.00000*ALGEBRAIC[29])/( 2.00000*CONSTANTS[2])+ ALGEBRAIC[73]*CONSTANTS[60])/CONSTANTS[61] - ALGEBRAIC[70]) - 0.0450000*ALGEBRAIC[78]) - (0.0310000/1.20000)*ALGEBRAIC[80]; resid[22] = RATES[22] - ALGEBRAIC[74]; resid[23] = RATES[23] - ALGEBRAIC[75]; resid[24] = RATES[24] - ALGEBRAIC[76]; resid[25] = RATES[25] - ALGEBRAIC[77]; resid[26] = RATES[26] - ALGEBRAIC[78]; resid[27] = RATES[27] - ALGEBRAIC[79]; resid[28] = RATES[28] - ALGEBRAIC[80]; } 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] = (CONDVAR[0]>=0.00000&&CONDVAR[1]<=0.00000&&CONDVAR[2]<=0.00000 ? CONSTANTS[8] : 0.00000); ALGEBRAIC[1] = STATES[1]*CONSTANTS[9]*(STATES[0] - - 30.0000); ALGEBRAIC[2] = 1.00000/(1.00000+exp(((STATES[0]+83.1900) - ( - 7.20000*pow(CONSTANTS[10], 0.690000))/(pow(1.26000e-05, 0.690000)+pow(CONSTANTS[10], 0.690000)))/13.5600)); ALGEBRAIC[3] = 0.250000+ 2.00000*exp(- pow(STATES[0]+70.0000, 2.00000)/500.000); ALGEBRAIC[4] = CONSTANTS[11]*( 0.900000*STATES[2]+ 0.100000*STATES[3])*STATES[4]*(STATES[0] - CONSTANTS[55]); ALGEBRAIC[5] = 1.00000/(1.00000+exp((STATES[0]+10.2200)/- 8.50000)); ALGEBRAIC[6] = 1.00000/( 17.0000*exp( 0.0398000*STATES[0])+ 0.211000*exp( - 0.0510000*STATES[0])); ALGEBRAIC[7] = 1.00000/(1.00000+exp((STATES[0]+10.2200)/- 8.50000)); ALGEBRAIC[8] = 0.335810+ 0.906730*exp(- pow(STATES[0]+10.0000, 2.00000)/988.050); ALGEBRAIC[9] = (1.00000/(1.00000+exp((STATES[0]+4.90000)/15.1400)))*(1.00000 - 0.300000*exp(- pow(STATES[0], 2.00000)/500.000)); ALGEBRAIC[10] = 92.0100*exp( - 0.0183000*STATES[0]); ALGEBRAIC[11] = 603.600*exp( 0.00942000*STATES[0]); ALGEBRAIC[12] = 1.00000/(ALGEBRAIC[10]+ALGEBRAIC[11]); ALGEBRAIC[13] = CONSTANTS[14]*(0.500000+0.500000/(1.00000+exp((STATES[0]+30.0000)/5.00000))); ALGEBRAIC[14] = ( ALGEBRAIC[13]*pow(CONSTANTS[13]/(CONSTANTS[13]+0.590000), 3.00000)*(STATES[0]+81.9000))/(1.00000+exp(( 1.39300*(STATES[0]+81.9000+3.60000))/CONSTANTS[53])); ALGEBRAIC[15] = CONSTANTS[15]*(STATES[0] - CONSTANTS[16]); ALGEBRAIC[16] = ( CONSTANTS[17]*pow(CONSTANTS[18]/(5.64000+CONSTANTS[18]), 3.00000)*pow(CONSTANTS[13]/(0.621000+CONSTANTS[13]), 2.00000)*1.60000)/(1.50000+exp(- (STATES[0]+60.0000)/40.0000)); ALGEBRAIC[22] = exp(( - CONSTANTS[21]*STATES[0])/( 2.00000*CONSTANTS[53])); ALGEBRAIC[17] = 1.00000+ (CONSTANTS[32]/CONSTANTS[31])*(1.00000+exp(( CONSTANTS[22]*STATES[0])/CONSTANTS[53]))+CONSTANTS[33]/CONSTANTS[29]+pow(CONSTANTS[33], 2.00000)/( CONSTANTS[29]*CONSTANTS[30])+pow(CONSTANTS[33], 3.00000)/( CONSTANTS[29]*CONSTANTS[30]*CONSTANTS[28]); ALGEBRAIC[19] = ( (pow(CONSTANTS[33], 2.00000)/( CONSTANTS[29]*CONSTANTS[30])+pow(CONSTANTS[33], 3.00000)/( CONSTANTS[29]*CONSTANTS[30]*CONSTANTS[28]))*exp(( - CONSTANTS[21]*STATES[0])/( 2.00000*CONSTANTS[53])))/ALGEBRAIC[17]; ALGEBRAIC[20] = ( (CONSTANTS[32]/CONSTANTS[31])*exp(( - CONSTANTS[22]*STATES[0])/CONSTANTS[53]))/ALGEBRAIC[17]; ALGEBRAIC[18] = exp(( CONSTANTS[21]*STATES[0])/( 2.00000*CONSTANTS[53])); ALGEBRAIC[25] = ALGEBRAIC[22]*CONSTANTS[54]*(ALGEBRAIC[19]+ALGEBRAIC[20])+ ALGEBRAIC[20]*ALGEBRAIC[18]*(CONSTANTS[58]+ALGEBRAIC[22]); ALGEBRAIC[21] = 1.00000+ (STATES[5]/CONSTANTS[23])*(1.00000+exp(( - CONSTANTS[20]*STATES[0])/CONSTANTS[53])+CONSTANTS[18]/CONSTANTS[27])+CONSTANTS[18]/CONSTANTS[24]+pow(CONSTANTS[18], 2.00000)/( CONSTANTS[24]*CONSTANTS[25])+pow(CONSTANTS[18], 3.00000)/( CONSTANTS[24]*CONSTANTS[25]*CONSTANTS[26]); ALGEBRAIC[24] = ( (STATES[5]/CONSTANTS[23])*exp(( - CONSTANTS[20]*STATES[0])/CONSTANTS[53]))/ALGEBRAIC[21]; ALGEBRAIC[23] = ( (pow(CONSTANTS[18], 2.00000)/( CONSTANTS[24]*CONSTANTS[25])+pow(CONSTANTS[18], 3.00000)/( CONSTANTS[24]*CONSTANTS[25]*CONSTANTS[26]))*exp(( CONSTANTS[21]*STATES[0])/( 2.00000*CONSTANTS[53])))/ALGEBRAIC[21]; ALGEBRAIC[26] = ALGEBRAIC[18]*CONSTANTS[58]*(ALGEBRAIC[23]+ALGEBRAIC[24])+ ALGEBRAIC[22]*ALGEBRAIC[24]*(CONSTANTS[54]+ALGEBRAIC[18]); ALGEBRAIC[27] = ALGEBRAIC[23]*CONSTANTS[58]*(ALGEBRAIC[19]+ALGEBRAIC[20])+ ALGEBRAIC[24]*ALGEBRAIC[19]*(CONSTANTS[58]+ALGEBRAIC[22]); ALGEBRAIC[28] = ALGEBRAIC[19]*CONSTANTS[54]*(ALGEBRAIC[23]+ALGEBRAIC[24])+ ALGEBRAIC[23]*ALGEBRAIC[20]*(CONSTANTS[54]+ALGEBRAIC[18]); ALGEBRAIC[29] = ( CONSTANTS[19]*( ALGEBRAIC[26]*ALGEBRAIC[20] - ALGEBRAIC[25]*ALGEBRAIC[24]))/(ALGEBRAIC[25]+ALGEBRAIC[26]+ALGEBRAIC[27]+ALGEBRAIC[28]); ALGEBRAIC[30] = ( (( CONSTANTS[34]*pow(STATES[6], 3.00000)*( 0.635000*STATES[7]+ 0.365000*STATES[8])*CONSTANTS[33]*STATES[0]*CONSTANTS[2])/CONSTANTS[53])*(exp((STATES[0] - CONSTANTS[56])/CONSTANTS[53]) - 1.00000))/(exp(STATES[0]/CONSTANTS[53]) - 1.00000); ALGEBRAIC[31] = STATES[0]+44.4000; ALGEBRAIC[32] = (CONDVAR[3]<0.00000 ? ( - 460.000*- 12.6730)/exp(ALGEBRAIC[31]/- 12.6730) : ( - 460.000*ALGEBRAIC[31])/(exp(ALGEBRAIC[31]/- 12.6730) - 1.00000)); ALGEBRAIC[33] = 18400.0*exp(ALGEBRAIC[31]/- 12.6730); ALGEBRAIC[34] = 44.9000*exp((STATES[0]+66.9000)/- 5.57000); ALGEBRAIC[35] = 1491.00/(1.00000+ 323.300*exp((STATES[0]+94.6000)/- 12.9000)); ALGEBRAIC[36] = ALGEBRAIC[34]/(ALGEBRAIC[34]+ALGEBRAIC[35]); ALGEBRAIC[37] = 0.0300000/(1.00000+exp((STATES[0]+40.0000)/6.00000))+0.000350000; ALGEBRAIC[38] = 44.9000*exp((STATES[0]+66.9000)/- 5.57000); ALGEBRAIC[39] = 1491.00/(1.00000+ 323.300*exp((STATES[0]+94.6000)/- 12.9000)); ALGEBRAIC[40] = ALGEBRAIC[38]/(ALGEBRAIC[38]+ALGEBRAIC[39]); ALGEBRAIC[41] = 0.120000/(1.00000+exp((STATES[0]+60.0000)/2.00000))+0.00295000; ALGEBRAIC[44] = 1.00000/(1.00000+exp((STATES[0] - (- 3.20000+CONSTANTS[38]))/CONSTANTS[39])); ALGEBRAIC[42] = ( - 26.1200*(STATES[0]+35.0000))/(exp((STATES[0]+35.0000)/- 2.50000) - 1.00000)+( - 78.1100*STATES[0])/(exp( - 0.208000*STATES[0]) - 1.00000); ALGEBRAIC[43] = ( 10.5200*(STATES[0] - 5.00000))/(exp( 0.400000*(STATES[0] - 5.00000)) - 1.00000); ALGEBRAIC[45] = 1.00000/(ALGEBRAIC[42]+ALGEBRAIC[43]); ALGEBRAIC[46] = 1.00000/(1.00000+exp((STATES[0] - (- 24.0000+CONSTANTS[40]))/6.31000)); ALGEBRAIC[47] = 0.0100000+ 0.153900*exp(- pow(STATES[0]+40.0000, 2.00000)/185.670); ALGEBRAIC[48] = 1.00000/(1.00000+exp((STATES[0] - (- 24.0000+CONSTANTS[41]))/6.31000)); ALGEBRAIC[49] = 0.0600000+ 0.480760*2.25000*exp(- pow(STATES[0] - - 40.0000, 2.00000)/138.040); ALGEBRAIC[50] = CONSTANTS[42]*STATES[12]*( 0.450000*STATES[13]+ 0.550000*STATES[14])*(STATES[0] - CONSTANTS[57]); ALGEBRAIC[51] = 1.00000/(1.00000+exp((STATES[0] - 7.44000)/- 16.4000)); ALGEBRAIC[52] = 0.000596000+0.00311800/( 1.03700*exp( 0.0900000*(STATES[0]+30.6100))+ 0.396000*exp( - 0.120000*(STATES[0]+23.8400))); ALGEBRAIC[53] = 1.00000/(1.00000+exp((STATES[0]+33.8000)/6.12000)); ALGEBRAIC[54] = 0.0126600+4.72716/(1.00000+exp((STATES[0]+154.500)/23.9600)); ALGEBRAIC[55] = 1.00000/(1.00000+exp((STATES[0]+33.8000)/6.12000)); ALGEBRAIC[56] = 0.100000+ 4.00000*exp(- pow(STATES[0]+65.0000, 2.00000)/500.000); ALGEBRAIC[57] = CONSTANTS[44]*STATES[15]*STATES[16]*(STATES[0] - CONSTANTS[43]); ALGEBRAIC[58] = 1.00000/(1.00000+exp((STATES[0] - - 49.1000)/- 8.98000)); ALGEBRAIC[59] = 1.00000/( 0.150000*exp(- STATES[0]/11.0000)+ 0.200000*exp(- STATES[0]/700.000)); ALGEBRAIC[60] = 1.00000/( 16.0000*exp(STATES[0]/8.00000)+ 15.0000*exp(STATES[0]/50.0000)); ALGEBRAIC[61] = 0.00100000/(ALGEBRAIC[59]+ALGEBRAIC[60]); ALGEBRAIC[62] = 0.150400/( 3100.00*exp(STATES[0]/13.0000)+ 700.000*exp(STATES[0]/70.0000)); ALGEBRAIC[63] = 0.150400/( 95.0000*exp(- STATES[0]/10.0000)+ 50.0000*exp(- STATES[0]/700.000))+0.000229000/(1.00000+exp(- STATES[0]/5.00000)); ALGEBRAIC[64] = ALGEBRAIC[62]/(ALGEBRAIC[62]+ALGEBRAIC[63]); ALGEBRAIC[65] = 0.00100000/(ALGEBRAIC[62]+ALGEBRAIC[63]); ALGEBRAIC[66] = ( CONSTANTS[45]*STATES[17]*STATES[18]*pow(CONSTANTS[10], 1.50000))/(pow(CONSTANTS[46], 1.50000)+pow(CONSTANTS[10], 1.50000)); ALGEBRAIC[67] = ( (( ALGEBRAIC[66]*CONSTANTS[13])/(10.0000+CONSTANTS[13]))*(STATES[0] - CONSTANTS[55]))/(1.00000+exp(((STATES[0] - CONSTANTS[55]) - 140.000)/( 2.50000*CONSTANTS[53]))); ALGEBRAIC[68] = 120.000/(1.00000+exp(- (STATES[0]+50.0000)/15.0000)); ALGEBRAIC[69] = 5.82000/(1.00000+exp(- (STATES[0]+50.0000)/15.0000)); ALGEBRAIC[70] = (STATES[5] - STATES[19])/4.00000e-05; ALGEBRAIC[71] = 5.00000/(1.00000+CONSTANTS[51]/STATES[19]); ALGEBRAIC[72] = (STATES[20] - STATES[21])/CONSTANTS[52]; ALGEBRAIC[73] = ( CONSTANTS[50]*(STATES[21] - STATES[5]))/(1.00000+pow(0.00120000/STATES[5], 2.00000)); ALGEBRAIC[74] = 88800.0*STATES[19]*(1.00000 - STATES[22]) - 446.000*STATES[22]; ALGEBRAIC[75] = 227700.*STATES[19]*((1.00000 - STATES[23]) - STATES[24]) - 7.51000*STATES[23]; ALGEBRAIC[76] = 2277.00*2.50000*((1.00000 - STATES[23]) - STATES[24]) - 751.000*STATES[24]; ALGEBRAIC[77] = 227700.*STATES[19]*(1.00000 - STATES[25]) - 542.000*STATES[25]; ALGEBRAIC[78] = 227700.*STATES[5]*(1.00000 - STATES[26]) - 542.000*STATES[26]; ALGEBRAIC[79] = 534.000*STATES[21]*(1.00000 - STATES[27]) - 445.000*STATES[27]; ALGEBRAIC[80] = 0.00100000*( 115.000*STATES[5]*(1.00000 - STATES[28]) - 1000.00*STATES[28]); ALGEBRAIC[81] = CONSTANTS[36]*STATES[9]*( 0.675000*STATES[10]+ 0.325000*STATES[11])*(STATES[0] - CONSTANTS[37])*(1.00000 - (( ALGEBRAIC[67]*CONSTANTS[10])/(9.00000e-05+CONSTANTS[10]))/1.00000); } 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; } void computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { CONDVAR[0] = VOI - CONSTANTS[4]; CONDVAR[1] = VOI - CONSTANTS[5]; CONDVAR[2] = ((VOI - CONSTANTS[4]) - floor((VOI - CONSTANTS[4])/CONSTANTS[6])*CONSTANTS[6]) - CONSTANTS[7]; CONDVAR[3] = fabs(ALGEBRAIC[31]) - CONSTANTS[35]; }