/* There are a total of 42 entries in the algebraic variable array. There are a total of 14 entries in each of the rate and state variable arrays. There are a total of 44 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[39] is RTONF in component membrane (millivolt). * ALGEBRAIC[23] is i_f in component hyperpolarising_activated_current (nanoA). * ALGEBRAIC[25] is i_K in component time_dependent_potassium_current (nanoA). * ALGEBRAIC[26] is i_K1 in component time_independent_potassium_current (nanoA). * ALGEBRAIC[27] is i_Na_b in component sodium_background_current (nanoA). * ALGEBRAIC[29] is i_Ca_b in component calcium_background_current (nanoA). * ALGEBRAIC[30] is i_p in component sodium_potassium_pump (nanoA). * ALGEBRAIC[31] is i_NaCa in component Na_Ca_exchanger (nanoA). * ALGEBRAIC[33] is i_Na in component fast_sodium_current (nanoA). * ALGEBRAIC[40] is i_si in component second_inward_current (nanoA). * ALGEBRAIC[20] is i_fNa in component hyperpolarising_activated_current (nanoA). * ALGEBRAIC[0] is E_Na in component hyperpolarising_activated_current (millivolt). * ALGEBRAIC[9] is E_K in component hyperpolarising_activated_current (millivolt). * ALGEBRAIC[22] is i_fK in component hyperpolarising_activated_current (nanoA). * CONSTANTS[4] is g_f_Na in component hyperpolarising_activated_current (microS). * CONSTANTS[5] is g_f_K in component hyperpolarising_activated_current (microS). * CONSTANTS[6] is Km_f in component hyperpolarising_activated_current (millimolar). * CONSTANTS[7] is Kc in component extracellular_potassium_concentration (millimolar). * STATES[1] is Ki in component intracellular_potassium_concentration (millimolar). * STATES[2] is Nai in component intracellular_sodium_concentration (millimolar). * CONSTANTS[8] is Nao in component extracellular_sodium_concentration (millimolar). * STATES[3] is y in component hyperpolarising_activated_current_y_gate (dimensionless). * ALGEBRAIC[1] is alpha_y in component hyperpolarising_activated_current_y_gate (per_second). * ALGEBRAIC[10] is beta_y in component hyperpolarising_activated_current_y_gate (per_second). * CONSTANTS[9] is speed_y in component hyperpolarising_activated_current_y_gate (dimensionless). * ALGEBRAIC[24] is I_K in component time_dependent_potassium_current (nanoA). * CONSTANTS[10] is i_K_max in component time_dependent_potassium_current (nanoA). * STATES[4] is x in component time_dependent_potassium_current_x_gate (dimensionless). * ALGEBRAIC[2] is alpha_x in component time_dependent_potassium_current_x_gate (per_second). * ALGEBRAIC[11] is beta_x in component time_dependent_potassium_current_x_gate (per_second). * CONSTANTS[11] is g_K1 in component time_independent_potassium_current (microS). * CONSTANTS[12] is Km_K1 in component time_independent_potassium_current (millimolar). * CONSTANTS[13] is g_Nab in component sodium_background_current (microS). * ALGEBRAIC[28] is E_Ca in component calcium_background_current (millivolt). * CONSTANTS[14] is g_Cab in component calcium_background_current (microS). * STATES[5] is Cai in component intracellular_calcium_concentration (millimolar). * CONSTANTS[15] is Cao in component extracellular_calcium_concentration (millimolar). * CONSTANTS[16] is I_p in component sodium_potassium_pump (nanoA). * CONSTANTS[17] is K_mK in component sodium_potassium_pump (millimolar). * CONSTANTS[18] is K_mNa in component sodium_potassium_pump (millimolar). * CONSTANTS[19] is n_NaCa in component Na_Ca_exchanger (dimensionless). * CONSTANTS[20] is K_NaCa in component Na_Ca_exchanger (nanoA). * CONSTANTS[21] is d_NaCa in component Na_Ca_exchanger (dimensionless). * CONSTANTS[22] is gamma in component Na_Ca_exchanger (dimensionless). * CONSTANTS[23] is g_Na in component fast_sodium_current (microS). * ALGEBRAIC[32] is E_mh in component fast_sodium_current (millivolt). * STATES[6] is m in component fast_sodium_current_m_gate (dimensionless). * STATES[7] is h in component fast_sodium_current_h_gate (dimensionless). * ALGEBRAIC[12] is alpha_m in component fast_sodium_current_m_gate (per_second). * ALGEBRAIC[17] is beta_m in component fast_sodium_current_m_gate (per_second). * CONSTANTS[24] is delta_m in component fast_sodium_current_m_gate (millivolt). * ALGEBRAIC[3] is E0_m in component fast_sodium_current_m_gate (millivolt). * ALGEBRAIC[4] is alpha_h in component fast_sodium_current_h_gate (per_second). * ALGEBRAIC[13] is beta_h in component fast_sodium_current_h_gate (per_second). * ALGEBRAIC[34] is i_siCa in component second_inward_current (nanoA). * ALGEBRAIC[35] is i_siK in component second_inward_current (nanoA). * ALGEBRAIC[37] is i_siNa in component second_inward_current (nanoA). * CONSTANTS[25] is P_si in component second_inward_current (nanoA_per_millimolar). * STATES[8] is d in component second_inward_current_d_gate (dimensionless). * STATES[9] is f in component second_inward_current_f_gate (dimensionless). * STATES[10] is f2 in component second_inward_current_f2_gate (dimensionless). * ALGEBRAIC[14] is alpha_d in component second_inward_current_d_gate (per_second). * ALGEBRAIC[18] is beta_d in component second_inward_current_d_gate (per_second). * CONSTANTS[26] is delta_d in component second_inward_current_d_gate (millivolt). * ALGEBRAIC[5] is E0_d in component second_inward_current_d_gate (millivolt). * ALGEBRAIC[15] is alpha_f in component second_inward_current_f_gate (per_second). * ALGEBRAIC[19] is beta_f in component second_inward_current_f_gate (per_second). * CONSTANTS[27] is delta_f in component second_inward_current_f_gate (millivolt). * ALGEBRAIC[6] is E0_f in component second_inward_current_f_gate (millivolt). * CONSTANTS[28] is alpha_f2 in component second_inward_current_f2_gate (per_second). * ALGEBRAIC[7] is beta_f2 in component second_inward_current_f2_gate (per_second). * CONSTANTS[29] is K_mf2 in component second_inward_current_f2_gate (millimolar). * CONSTANTS[30] is radius in component intracellular_sodium_concentration (millimetre). * CONSTANTS[31] is length in component intracellular_sodium_concentration (millimetre). * CONSTANTS[32] is V_e_ratio in component intracellular_sodium_concentration (dimensionless). * CONSTANTS[40] is V_Cell in component intracellular_sodium_concentration (millimetre3). * CONSTANTS[41] is Vi in component intracellular_sodium_concentration (millimetre3). * CONSTANTS[42] is V_up in component intracellular_calcium_concentration (millimetre3). * CONSTANTS[43] is V_rel in component intracellular_calcium_concentration (millimetre3). * ALGEBRAIC[36] is i_up in component intracellular_calcium_concentration (nanoA). * ALGEBRAIC[38] is i_tr in component intracellular_calcium_concentration (nanoA). * ALGEBRAIC[41] is i_rel in component intracellular_calcium_concentration (nanoA). * STATES[11] is Ca_up in component intracellular_calcium_concentration (millimolar). * STATES[12] is Ca_rel in component intracellular_calcium_concentration (millimolar). * CONSTANTS[33] is Ca_up_max in component intracellular_calcium_concentration (millimolar). * CONSTANTS[34] is K_mCa in component intracellular_calcium_concentration (millimolar). * STATES[13] is p in component intracellular_calcium_concentration (dimensionless). * ALGEBRAIC[16] is alpha_p in component intracellular_calcium_concentration (per_second). * ALGEBRAIC[21] is beta_p in component intracellular_calcium_concentration (per_second). * ALGEBRAIC[8] is E0_p in component intracellular_calcium_concentration (millivolt). * CONSTANTS[35] is tau_up in component intracellular_calcium_concentration (second). * CONSTANTS[36] is tau_rep in component intracellular_calcium_concentration (second). * CONSTANTS[37] is tau_rel in component intracellular_calcium_concentration (second). * CONSTANTS[38] is rCa in component intracellular_calcium_concentration (dimensionless). * ALGEBRAIC[39] is i_mK in component intracellular_potassium_concentration (nanoA). * RATES[0] is d/dt V in component membrane (millivolt). * RATES[3] is d/dt y in component hyperpolarising_activated_current_y_gate (dimensionless). * RATES[4] is d/dt x in component time_dependent_potassium_current_x_gate (dimensionless). * RATES[6] is d/dt m in component fast_sodium_current_m_gate (dimensionless). * RATES[7] is d/dt h in component fast_sodium_current_h_gate (dimensionless). * RATES[8] is d/dt d in component second_inward_current_d_gate (dimensionless). * RATES[9] is d/dt f in component second_inward_current_f_gate (dimensionless). * RATES[10] is d/dt f2 in component second_inward_current_f2_gate (dimensionless). * RATES[2] is d/dt Nai in component intracellular_sodium_concentration (millimolar). * RATES[13] is d/dt p in component intracellular_calcium_concentration (dimensionless). * RATES[11] is d/dt Ca_up in component intracellular_calcium_concentration (millimolar). * RATES[12] is d/dt Ca_rel in component intracellular_calcium_concentration (millimolar). * RATES[5] is d/dt Cai in component intracellular_calcium_concentration (millimolar). * RATES[1] is d/dt Ki in component intracellular_potassium_concentration (millimolar). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = -67.797059970601; CONSTANTS[0] = 8314.472; CONSTANTS[1] = 310; CONSTANTS[2] = 96485.3415; CONSTANTS[3] = 6e-5; CONSTANTS[4] = 0.06; CONSTANTS[5] = 0.06; CONSTANTS[6] = 45; CONSTANTS[7] = 3; STATES[1] = 139.859968229045; STATES[2] = 7.51007221193712; CONSTANTS[8] = 140; STATES[3] = 0.0743464067197738; CONSTANTS[9] = 2; CONSTANTS[10] = 0.8; STATES[4] = 0.129303443591363; CONSTANTS[11] = 0.0075; CONSTANTS[12] = 10; CONSTANTS[13] = 0.0007; CONSTANTS[14] = 0.0001; STATES[5] = 5.84191784887783e-5; CONSTANTS[15] = 2; CONSTANTS[16] = 0.45; CONSTANTS[17] = 1; CONSTANTS[18] = 40; CONSTANTS[19] = 3; CONSTANTS[20] = 2e-5; CONSTANTS[21] = 0.0001; CONSTANTS[22] = 0.5; CONSTANTS[23] = 0.0125; STATES[6] = 0.042697621819783; STATES[7] = 0.138105285882671; CONSTANTS[24] = 1e-5; CONSTANTS[25] = 0.12; STATES[8] = 1.26333192869164e-5; STATES[9] = 0.999507224159629; STATES[10] = 0.485471180273736; CONSTANTS[26] = 0.0001; CONSTANTS[27] = 0.0001; CONSTANTS[28] = 10; CONSTANTS[29] = 0.0005; CONSTANTS[30] = 0.008; CONSTANTS[31] = 0.11; CONSTANTS[32] = 0.1; STATES[11] = 3.70806465918854; STATES[12] = 0.177741556496929; CONSTANTS[33] = 5; CONSTANTS[34] = 0.002; STATES[13] = 0.176207580044253; CONSTANTS[35] = 0.005; CONSTANTS[36] = 0.2; CONSTANTS[37] = 0.01; CONSTANTS[38] = 2; CONSTANTS[39] = ( CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2]; CONSTANTS[40] = 3.14159*pow(CONSTANTS[30], 2.00000)*CONSTANTS[31]; CONSTANTS[41] = CONSTANTS[40]*(1.00000 - CONSTANTS[32]); CONSTANTS[42] = CONSTANTS[41]*0.0500000; CONSTANTS[43] = CONSTANTS[41]*0.0200000; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[7] = ( STATES[5]*CONSTANTS[28])/CONSTANTS[29]; RATES[10] = CONSTANTS[28] - STATES[10]*(CONSTANTS[28]+ALGEBRAIC[7]); ALGEBRAIC[1] = 0.0140000*exp(- STATES[0]/16.0000); ALGEBRAIC[10] = 9.75000*exp(STATES[0]/19.0000); RATES[3] = CONSTANTS[9]*( ALGEBRAIC[1]*(1.00000 - STATES[3]) - ALGEBRAIC[10]*STATES[3]); ALGEBRAIC[2] = 2.10000*exp(STATES[0]/28.0000); ALGEBRAIC[11] = 0.960000*exp(- STATES[0]/24.0000); RATES[4] = ALGEBRAIC[2]*(1.00000 - STATES[4]) - ALGEBRAIC[11]*STATES[4]; ALGEBRAIC[4] = 20.0000*exp( - 0.125000*(STATES[0]+75.0000)); ALGEBRAIC[13] = 2000.00/( 320.000*exp( - 0.100000*(STATES[0]+75.0000))+1.00000); RATES[7] = ALGEBRAIC[4]*(1.00000 - STATES[7]) - ALGEBRAIC[13]*STATES[7]; ALGEBRAIC[3] = STATES[0]+41.0000; ALGEBRAIC[12] = (fabs(ALGEBRAIC[3])