/* There are a total of 44 entries in the algebraic variable array. There are a total of 15 entries in each of the rate and state variable arrays. There are a total of 48 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[43] is RTONF in component membrane (millivolt). * ALGEBRAIC[25] is i_f in component hyperpolarising_activated_current (nanoA). * ALGEBRAIC[27] is i_K in component time_dependent_potassium_current (nanoA). * ALGEBRAIC[28] is i_K1 in component time_independent_potassium_current (nanoA). * ALGEBRAIC[29] is i_Na_b in component sodium_background_current (nanoA). * ALGEBRAIC[31] is i_Ca_b in component calcium_background_current (nanoA). * ALGEBRAIC[32] is i_p in component sodium_potassium_pump (nanoA). * ALGEBRAIC[33] is i_NaCa in component Na_Ca_exchanger (nanoA). * ALGEBRAIC[35] is i_Na in component fast_sodium_current (nanoA). * ALGEBRAIC[42] is i_si in component second_inward_current (nanoA). * ALGEBRAIC[22] 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[24] 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). * STATES[1] is Kc in component extracellular_potassium_concentration (millimolar). * STATES[2] is Ki in component intracellular_potassium_concentration (millimolar). * STATES[3] is Nai in component intracellular_sodium_concentration (millimolar). * CONSTANTS[7] is Nao in component extracellular_sodium_concentration (millimolar). * STATES[4] is y in component hyperpolarising_activated_current_y_gate (dimensionless). * ALGEBRAIC[10] is alpha_y in component hyperpolarising_activated_current_y_gate (per_second). * ALGEBRAIC[17] is beta_y in component hyperpolarising_activated_current_y_gate (per_second). * CONSTANTS[8] is delta_y in component hyperpolarising_activated_current_y_gate (millivolt). * ALGEBRAIC[1] is E0_y in component hyperpolarising_activated_current_y_gate (millivolt). * CONSTANTS[9] is speed_y in component hyperpolarising_activated_current_y_gate (dimensionless). * ALGEBRAIC[26] is I_K in component time_dependent_potassium_current (nanoA). * CONSTANTS[10] is i_K_max in component time_dependent_potassium_current (nanoA). * STATES[5] is x in component time_dependent_potassium_current_x_gate (dimensionless). * ALGEBRAIC[11] is alpha_x in component time_dependent_potassium_current_x_gate (per_second). * ALGEBRAIC[18] is beta_x in component time_dependent_potassium_current_x_gate (per_second). * CONSTANTS[11] is delta_x in component time_dependent_potassium_current_x_gate (millivolt). * ALGEBRAIC[2] is E0_x in component time_dependent_potassium_current_x_gate (millivolt). * CONSTANTS[12] is g_K1 in component time_independent_potassium_current (microS). * CONSTANTS[13] is Km_K1 in component time_independent_potassium_current (millimolar). * CONSTANTS[14] is g_Nab in component sodium_background_current (microS). * ALGEBRAIC[30] is E_Ca in component calcium_background_current (millivolt). * CONSTANTS[15] is g_Cab in component calcium_background_current (microS). * STATES[6] is Cai in component intracellular_calcium_concentration (millimolar). * CONSTANTS[16] is Cao in component extracellular_calcium_concentration (millimolar). * CONSTANTS[17] is I_p in component sodium_potassium_pump (nanoA). * CONSTANTS[18] is K_mK in component sodium_potassium_pump (millimolar). * CONSTANTS[19] is K_mNa in component sodium_potassium_pump (millimolar). * CONSTANTS[20] is n_NaCa in component Na_Ca_exchanger (dimensionless). * CONSTANTS[21] is K_NaCa in component Na_Ca_exchanger (nanoA). * CONSTANTS[22] is d_NaCa in component Na_Ca_exchanger (dimensionless). * CONSTANTS[23] is gamma in component Na_Ca_exchanger (dimensionless). * CONSTANTS[24] is g_Na in component fast_sodium_current (microS). * ALGEBRAIC[34] is E_mh in component fast_sodium_current (millivolt). * STATES[7] is m in component fast_sodium_current_m_gate (dimensionless). * STATES[8] 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[19] is beta_m in component fast_sodium_current_m_gate (per_second). * CONSTANTS[25] 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[36] is i_siCa in component second_inward_current (nanoA). * ALGEBRAIC[37] is i_siK in component second_inward_current (nanoA). * ALGEBRAIC[39] is i_siNa in component second_inward_current (nanoA). * CONSTANTS[26] is P_si in component second_inward_current (nanoA_per_millimolar). * STATES[9] is d in component second_inward_current_d_gate (dimensionless). * STATES[10] is f in component second_inward_current_f_gate (dimensionless). * STATES[11] 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[20] is beta_d in component second_inward_current_d_gate (per_second). * CONSTANTS[27] 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[21] is beta_f in component second_inward_current_f_gate (per_second). * CONSTANTS[28] 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[29] 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[30] is K_mf2 in component second_inward_current_f2_gate (millimolar). * CONSTANTS[31] is radius in component intracellular_sodium_concentration (micrometre). * CONSTANTS[32] is length in component intracellular_sodium_concentration (micrometre). * CONSTANTS[33] is V_e_ratio in component intracellular_sodium_concentration (dimensionless). * CONSTANTS[44] is V_Cell in component intracellular_sodium_concentration (micrometre3). * CONSTANTS[45] is Vi in component intracellular_sodium_concentration (micrometre3). * CONSTANTS[46] is V_up in component intracellular_calcium_concentration (micrometre3). * CONSTANTS[47] is V_rel in component intracellular_calcium_concentration (micrometre3). * ALGEBRAIC[38] is i_up in component intracellular_calcium_concentration (nanoA). * ALGEBRAIC[40] is i_tr in component intracellular_calcium_concentration (nanoA). * ALGEBRAIC[43] is i_rel in component intracellular_calcium_concentration (nanoA). * STATES[12] is Ca_up in component intracellular_calcium_concentration (millimolar). * STATES[13] is Ca_rel in component intracellular_calcium_concentration (millimolar). * CONSTANTS[34] is Ca_up_max in component intracellular_calcium_concentration (millimolar). * CONSTANTS[35] is K_mCa in component intracellular_calcium_concentration (millimolar). * STATES[14] is p in component intracellular_calcium_concentration (dimensionless). * ALGEBRAIC[16] is alpha_p in component intracellular_calcium_concentration (per_second). * ALGEBRAIC[23] is beta_p in component intracellular_calcium_concentration (per_second). * ALGEBRAIC[8] is E0_p in component intracellular_calcium_concentration (millivolt). * CONSTANTS[36] is tau_up in component intracellular_calcium_concentration (second). * CONSTANTS[37] is tau_rep in component intracellular_calcium_concentration (second). * CONSTANTS[38] is tau_rel in component intracellular_calcium_concentration (second). * CONSTANTS[39] is rCa in component intracellular_calcium_concentration (dimensionless). * CONSTANTS[40] is V_e in component extracellular_potassium_concentration (micrometre3). * CONSTANTS[41] is Kb in component extracellular_potassium_concentration (millimolar). * ALGEBRAIC[41] is i_mK in component extracellular_potassium_concentration (nanoA). * CONSTANTS[42] is pf in component extracellular_potassium_concentration (per_second). * RATES[0] is d/dt V in component membrane (millivolt). * RATES[4] is d/dt y in component hyperpolarising_activated_current_y_gate (dimensionless). * RATES[5] is d/dt x in component time_dependent_potassium_current_x_gate (dimensionless). * RATES[7] is d/dt m in component fast_sodium_current_m_gate (dimensionless). * RATES[8] is d/dt h in component fast_sodium_current_h_gate (dimensionless). * RATES[9] is d/dt d in component second_inward_current_d_gate (dimensionless). * RATES[10] is d/dt f in component second_inward_current_f_gate (dimensionless). * RATES[11] is d/dt f2 in component second_inward_current_f2_gate (dimensionless). * RATES[3] is d/dt Nai in component intracellular_sodium_concentration (millimolar). * RATES[14] is d/dt p in component intracellular_calcium_concentration (dimensionless). * RATES[12] is d/dt Ca_up in component intracellular_calcium_concentration (millimolar). * RATES[13] is d/dt Ca_rel in component intracellular_calcium_concentration (millimolar). * RATES[6] is d/dt Cai in component intracellular_calcium_concentration (millimolar). * RATES[1] is d/dt Kc in component extracellular_potassium_concentration (millimolar). * RATES[2] is d/dt Ki in component intracellular_potassium_concentration (millimolar). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = -60; CONSTANTS[0] = 8314.472; CONSTANTS[1] = 310; CONSTANTS[2] = 96485.3415; CONSTANTS[3] = 0.006; CONSTANTS[4] = 6; CONSTANTS[5] = 6; CONSTANTS[6] = 45; STATES[1] = 3; STATES[2] = 140; STATES[3] = 7.5; CONSTANTS[7] = 140; STATES[4] = 0.007; CONSTANTS[8] = 1e-5; CONSTANTS[9] = 2; CONSTANTS[10] = 20; STATES[5] = 0.54; CONSTANTS[11] = 0.0001; CONSTANTS[12] = 0.75; CONSTANTS[13] = 10; CONSTANTS[14] = 0.07; CONSTANTS[15] = 0.01; STATES[6] = 5.8e-5; CONSTANTS[16] = 2; CONSTANTS[17] = 50; CONSTANTS[18] = 1; CONSTANTS[19] = 40; CONSTANTS[20] = 3; CONSTANTS[21] = 0.002; CONSTANTS[22] = 0.0001; CONSTANTS[23] = 0.5; CONSTANTS[24] = 1.25; STATES[7] = 0.076; STATES[8] = 0.015; CONSTANTS[25] = 1e-5; CONSTANTS[26] = 7.5; STATES[9] = 0.0011; STATES[10] = 0.785; STATES[11] = 0.785; CONSTANTS[27] = 0.0001; CONSTANTS[28] = 0.0001; CONSTANTS[29] = 10; CONSTANTS[30] = 0.0005; CONSTANTS[31] = 0.08; CONSTANTS[32] = 0.08; CONSTANTS[33] = 0.1; STATES[12] = 1.98; STATES[13] = 0.55; CONSTANTS[34] = 5; CONSTANTS[35] = 0.002; STATES[14] = 0.785; CONSTANTS[36] = 0.005; CONSTANTS[37] = 0.2; CONSTANTS[38] = 0.01; CONSTANTS[39] = 2; CONSTANTS[40] = 0.00016077; CONSTANTS[41] = 3; CONSTANTS[42] = 1; CONSTANTS[43] = ( CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2]; CONSTANTS[44] = 3.14159*pow(CONSTANTS[31], 2.00000)*CONSTANTS[32]; CONSTANTS[45] = CONSTANTS[44]*(1.00000 - CONSTANTS[33]); CONSTANTS[46] = CONSTANTS[45]*0.0500000; CONSTANTS[47] = CONSTANTS[45]*0.0200000; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[7] = ( STATES[6]*CONSTANTS[29])/CONSTANTS[30]; RATES[11] = CONSTANTS[29] - STATES[11]*(CONSTANTS[29]+ALGEBRAIC[7]); 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[8] = ALGEBRAIC[4]*(1.00000 - STATES[8]) - ALGEBRAIC[13]*STATES[8]; ALGEBRAIC[1] = STATES[0]+52.0000; ALGEBRAIC[10] = 0.0500000*exp( - 0.0670000*ALGEBRAIC[1]); ALGEBRAIC[17] = (fabs(ALGEBRAIC[1])