/* There are a total of 45 entries in the algebraic variable array. There are a total of 16 entries in each of the rate and state variable arrays. There are a total of 50 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[45] is RTONF in component membrane (millivolt). * CONSTANTS[3] is C in component membrane (microF). * CONSTANTS[4] is i_pulse in component membrane (nanoA). * 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_to in component transient_outward_current (nanoA). * ALGEBRAIC[30] is i_Na_b in component sodium_background_current (nanoA). * ALGEBRAIC[32] is i_Ca_b in component calcium_background_current (nanoA). * ALGEBRAIC[33] is i_p in component sodium_potassium_pump (nanoA). * ALGEBRAIC[34] is i_NaCa in component Na_Ca_exchanger (nanoA). * ALGEBRAIC[36] is i_Na in component fast_sodium_current (nanoA). * ALGEBRAIC[43] is i_si in component second_inward_current (nanoA). * ALGEBRAIC[23] is i_fNa in component hyperpolarising_activated_current (nanoA). * ALGEBRAIC[0] is E_Na in component hyperpolarising_activated_current (millivolt). * ALGEBRAIC[10] is E_K in component hyperpolarising_activated_current (millivolt). * ALGEBRAIC[24] is i_fK in component hyperpolarising_activated_current (nanoA). * CONSTANTS[5] is g_f_Na in component hyperpolarising_activated_current (microS). * CONSTANTS[6] is g_f_K in component hyperpolarising_activated_current (microS). * CONSTANTS[7] 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[8] is Nao in component extracellular_sodium_concentration (millimolar). * STATES[4] 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[19] is beta_y in component hyperpolarising_activated_current_y_gate (per_second). * CONSTANTS[9] is delta_y in component hyperpolarising_activated_current_y_gate (millivolt). * ALGEBRAIC[11] is E0_y in component hyperpolarising_activated_current_y_gate (millivolt). * 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[2] is alpha_x in component time_dependent_potassium_current_x_gate (per_second). * ALGEBRAIC[12] 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 Km_to in component transient_outward_current (millimolar). * CONSTANTS[14] is Km_Ca in component transient_outward_current (millimolar). * CONSTANTS[15] is g_to in component transient_outward_current (microS_per_millimolar). * STATES[6] is Cai in component intracellular_calcium_concentration (millimolar). * STATES[7] is s in component transient_outward_current_s_gate (dimensionless). * ALGEBRAIC[3] is alpha_s in component transient_outward_current_s_gate (per_second). * ALGEBRAIC[13] is beta_s in component transient_outward_current_s_gate (per_second). * CONSTANTS[16] is g_Nab in component sodium_background_current (microS). * ALGEBRAIC[31] is E_Ca in component calcium_background_current (millivolt). * CONSTANTS[17] is g_Cab in component calcium_background_current (microS). * CONSTANTS[18] is Cao in component extracellular_calcium_concentration (millimolar). * CONSTANTS[19] is I_p in component sodium_potassium_pump (nanoA). * CONSTANTS[20] is K_mK in component sodium_potassium_pump (millimolar). * CONSTANTS[21] is K_mNa in component sodium_potassium_pump (millimolar). * CONSTANTS[22] is n_NaCa in component Na_Ca_exchanger (dimensionless). * CONSTANTS[23] is K_NaCa in component Na_Ca_exchanger (nanoA). * CONSTANTS[24] is d_NaCa in component Na_Ca_exchanger (dimensionless). * CONSTANTS[25] is gamma in component Na_Ca_exchanger (dimensionless). * CONSTANTS[26] is g_Na in component fast_sodium_current (microS). * ALGEBRAIC[35] is E_mh in component fast_sodium_current (millivolt). * STATES[8] is m in component fast_sodium_current_m_gate (dimensionless). * STATES[9] is h in component fast_sodium_current_h_gate (dimensionless). * ALGEBRAIC[14] is alpha_m in component fast_sodium_current_m_gate (per_second). * ALGEBRAIC[20] is beta_m in component fast_sodium_current_m_gate (per_second). * CONSTANTS[27] is delta_m in component fast_sodium_current_m_gate (millivolt). * ALGEBRAIC[4] is E0_m in component fast_sodium_current_m_gate (millivolt). * ALGEBRAIC[5] is alpha_h in component fast_sodium_current_h_gate (per_second). * ALGEBRAIC[15] is beta_h in component fast_sodium_current_h_gate (per_second). * ALGEBRAIC[37] is i_siCa in component second_inward_current (nanoA). * ALGEBRAIC[38] is i_siK in component second_inward_current (nanoA). * ALGEBRAIC[40] is i_siNa in component second_inward_current (nanoA). * CONSTANTS[28] is P_si in component second_inward_current (nanoA_per_millimolar). * STATES[10] is d in component second_inward_current_d_gate (dimensionless). * STATES[11] is f in component second_inward_current_f_gate (dimensionless). * STATES[12] is f2 in component second_inward_current_f2_gate (dimensionless). * ALGEBRAIC[16] is alpha_d in component second_inward_current_d_gate (per_second). * ALGEBRAIC[21] is beta_d in component second_inward_current_d_gate (per_second). * CONSTANTS[29] is delta_d in component second_inward_current_d_gate (millivolt). * ALGEBRAIC[6] is E0_d in component second_inward_current_d_gate (millivolt). * ALGEBRAIC[17] is alpha_f in component second_inward_current_f_gate (per_second). * ALGEBRAIC[22] is beta_f in component second_inward_current_f_gate (per_second). * CONSTANTS[30] is delta_f in component second_inward_current_f_gate (millivolt). * ALGEBRAIC[7] is E0_f in component second_inward_current_f_gate (millivolt). * CONSTANTS[31] is alpha_f2 in component second_inward_current_f2_gate (per_second). * ALGEBRAIC[8] is beta_f2 in component second_inward_current_f2_gate (per_second). * CONSTANTS[32] is K_mf2 in component second_inward_current_f2_gate (millimolar). * CONSTANTS[33] is radius in component intracellular_sodium_concentration (micrometre). * CONSTANTS[34] is length in component intracellular_sodium_concentration (micrometre). * CONSTANTS[35] is V_e_ratio in component intracellular_sodium_concentration (dimensionless). * CONSTANTS[46] is V_Cell in component intracellular_sodium_concentration (micrometre3). * CONSTANTS[47] is Vi in component intracellular_sodium_concentration (micrometre3). * CONSTANTS[48] is V_up in component intracellular_calcium_concentration (micrometre3). * CONSTANTS[49] is V_rel in component intracellular_calcium_concentration (micrometre3). * ALGEBRAIC[39] is i_up in component intracellular_calcium_concentration (nanoA). * ALGEBRAIC[41] is i_tr in component intracellular_calcium_concentration (nanoA). * ALGEBRAIC[44] is i_rel in component intracellular_calcium_concentration (nanoA). * STATES[13] is Ca_up in component intracellular_calcium_concentration (millimolar). * STATES[14] is Ca_rel in component intracellular_calcium_concentration (millimolar). * CONSTANTS[36] is Ca_up_max in component intracellular_calcium_concentration (millimolar). * CONSTANTS[37] is K_mCa in component intracellular_calcium_concentration (millimolar). * STATES[15] is p in component intracellular_calcium_concentration (dimensionless). * ALGEBRAIC[9] is alpha_p in component intracellular_calcium_concentration (per_second). * ALGEBRAIC[18] is beta_p in component intracellular_calcium_concentration (per_second). * CONSTANTS[38] is tau_up in component intracellular_calcium_concentration (second). * CONSTANTS[39] is tau_rep in component intracellular_calcium_concentration (second). * CONSTANTS[40] is tau_rel in component intracellular_calcium_concentration (second). * CONSTANTS[41] is rCa in component intracellular_calcium_concentration (dimensionless). * CONSTANTS[42] is Ve in component extracellular_potassium_concentration (micrometre3). * CONSTANTS[43] is Kb in component extracellular_potassium_concentration (millimolar). * ALGEBRAIC[42] is i_mK in component extracellular_potassium_concentration (nanoA). * CONSTANTS[44] 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 s in component transient_outward_current_s_gate (dimensionless). * RATES[8] is d/dt m in component fast_sodium_current_m_gate (dimensionless). * RATES[9] is d/dt h in component fast_sodium_current_h_gate (dimensionless). * RATES[10] is d/dt d in component second_inward_current_d_gate (dimensionless). * RATES[11] is d/dt f in component second_inward_current_f_gate (dimensionless). * RATES[12] 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[15] is d/dt p in component intracellular_calcium_concentration (dimensionless). * RATES[13] is d/dt Ca_up in component intracellular_calcium_concentration (millimolar). * RATES[14] 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] = -87; CONSTANTS[0] = 8314.472; CONSTANTS[1] = 310; CONSTANTS[2] = 96485.3415; CONSTANTS[3] = 0.075; CONSTANTS[4] = 0; CONSTANTS[5] = 3; CONSTANTS[6] = 3; CONSTANTS[7] = 45; STATES[1] = 4; STATES[2] = 140; STATES[3] = 8; CONSTANTS[8] = 140; STATES[4] = 0.2; CONSTANTS[9] = 1e-5; CONSTANTS[10] = 180; STATES[5] = 0.01; CONSTANTS[11] = 920; CONSTANTS[12] = 210; CONSTANTS[13] = 10; CONSTANTS[14] = 0.0005; CONSTANTS[15] = 0.28; STATES[6] = 5e-5; STATES[7] = 1; CONSTANTS[16] = 0.18; CONSTANTS[17] = 0.02; CONSTANTS[18] = 2; CONSTANTS[19] = 125; CONSTANTS[20] = 1; CONSTANTS[21] = 40; CONSTANTS[22] = 3; CONSTANTS[23] = 0.02; CONSTANTS[24] = 0.001; CONSTANTS[25] = 0.5; CONSTANTS[26] = 750; STATES[8] = 0.01; STATES[9] = 0.8; CONSTANTS[27] = 1e-5; CONSTANTS[28] = 15; STATES[10] = 0.005; STATES[11] = 1; STATES[12] = 1; CONSTANTS[29] = 0.0001; CONSTANTS[30] = 0.0001; CONSTANTS[31] = 5; CONSTANTS[32] = 0.001; CONSTANTS[33] = 0.05; CONSTANTS[34] = 2; CONSTANTS[35] = 0.1; STATES[13] = 2; STATES[14] = 1; CONSTANTS[36] = 5; CONSTANTS[37] = 0.001; STATES[15] = 1; CONSTANTS[38] = 0.025; CONSTANTS[39] = 2; CONSTANTS[40] = 0.05; CONSTANTS[41] = 2; CONSTANTS[42] = 0.00157; CONSTANTS[43] = 4; CONSTANTS[44] = 0.7; CONSTANTS[45] = ( CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2]; CONSTANTS[46] = 3.14159*pow(CONSTANTS[33], 2.00000)*CONSTANTS[34]; CONSTANTS[47] = CONSTANTS[46]*(1.00000 - CONSTANTS[35]); CONSTANTS[48] = CONSTANTS[47]*0.0500000; CONSTANTS[49] = CONSTANTS[47]*0.0200000; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[8] = ( STATES[6]*CONSTANTS[31])/CONSTANTS[32]; RATES[12] = CONSTANTS[31] - STATES[12]*(CONSTANTS[31]+ALGEBRAIC[8]); ALGEBRAIC[2] = ( 0.500000*exp( 0.0826000*(STATES[0]+50.0000)))/(1.00000+exp( 0.0570000*(STATES[0]+50.0000))); ALGEBRAIC[12] = ( 1.30000*exp( - 0.0600000*(STATES[0]+20.0000)))/(1.00000+exp( - 0.0400000*(STATES[0]+20.0000))); RATES[5] = ALGEBRAIC[2]*(1.00000 - STATES[5]) - ALGEBRAIC[12]*STATES[5]; ALGEBRAIC[3] = 0.0330000*exp(- STATES[0]/17.0000); ALGEBRAIC[13] = 33.0000/(1.00000+exp(- (STATES[0]+10.0000)/8.00000)); RATES[7] = ALGEBRAIC[3]*(1.00000 - STATES[7]) - ALGEBRAIC[13]*STATES[7]; ALGEBRAIC[5] = 20.0000*exp( - 0.125000*(STATES[0]+75.0000)); ALGEBRAIC[15] = 2000.00/( 320.000*exp( - 0.100000*(STATES[0]+75.0000))+1.00000); RATES[9] = ALGEBRAIC[5]*(1.00000 - STATES[9]) - ALGEBRAIC[15]*STATES[9]; ALGEBRAIC[9] = ( 0.625000*(STATES[0]+34.0000))/(exp((STATES[0]+34.0000)/4.00000) - 1.00000); ALGEBRAIC[18] = 5.00000/(1.00000+exp(( - 1.00000*(STATES[0]+34.0000))/4.00000)); RATES[15] = ALGEBRAIC[9]*(1.00000 - STATES[15]) - ALGEBRAIC[18]*STATES[15]; ALGEBRAIC[1] = 0.0500000*exp( - 0.0670000*((STATES[0]+52.0000) - 10.0000)); ALGEBRAIC[11] = (STATES[0]+52.0000) - 10.0000; ALGEBRAIC[19] = (fabs(ALGEBRAIC[11])