/* There are a total of 42 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 45 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_Caf 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). * 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[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). * ALGEBRAIC[24] is I_K in component time_dependent_potassium_current (nanoA). * CONSTANTS[8] 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[11] is beta_x in component time_dependent_potassium_current_x_gate (per_second). * CONSTANTS[9] is g_K1 in component time_independent_potassium_current (microS). * CONSTANTS[10] is Km_K1 in component time_independent_potassium_current (millimolar). * CONSTANTS[11] is g_Nab in component sodium_background_current (microS). * ALGEBRAIC[28] is E_Ca in component calcium_background_current (millivolt). * CONSTANTS[12] is g_Cab in component calcium_background_current (microS). * STATES[6] is Cai in component intracellular_calcium_concentration (millimolar). * CONSTANTS[13] is Cao in component extracellular_calcium_concentration (millimolar). * CONSTANTS[14] is I_p in component sodium_potassium_pump (nanoA). * CONSTANTS[15] is K_mK in component sodium_potassium_pump (millimolar). * CONSTANTS[16] is K_mNa in component sodium_potassium_pump (millimolar). * CONSTANTS[17] is n_NaCa in component Na_Ca_exchanger (dimensionless). * CONSTANTS[18] is K_NaCa in component Na_Ca_exchanger (nanoA). * CONSTANTS[19] is d_NaCa in component Na_Ca_exchanger (dimensionless). * CONSTANTS[20] is gamma in component Na_Ca_exchanger (dimensionless). * CONSTANTS[21] is g_Na in component fast_sodium_current (microS). * ALGEBRAIC[32] 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[17] is beta_m in component fast_sodium_current_m_gate (per_second). * CONSTANTS[22] 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[23] 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[18] is beta_d in component second_inward_current_d_gate (per_second). * CONSTANTS[24] 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[25] 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[26] 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[27] is K_mf2 in component second_inward_current_f2_gate (millimolar). * CONSTANTS[28] is radius in component intracellular_sodium_concentration (millimetre). * CONSTANTS[29] is length in component intracellular_sodium_concentration (millimetre). * CONSTANTS[30] 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[43] is V_up in component intracellular_calcium_concentration (millimetre3). * CONSTANTS[44] 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[12] is Ca_up in component intracellular_calcium_concentration (millimolar). * STATES[13] is Ca_rel in component intracellular_calcium_concentration (millimolar). * CONSTANTS[31] is Ca_up_max in component intracellular_calcium_concentration (millimolar). * CONSTANTS[32] 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[21] is beta_p in component intracellular_calcium_concentration (per_second). * ALGEBRAIC[8] is E0_p in component intracellular_calcium_concentration (millivolt). * CONSTANTS[33] is tau_up in component intracellular_calcium_concentration (second). * CONSTANTS[34] is tau_rep in component intracellular_calcium_concentration (second). * CONSTANTS[35] is tau_rel in component intracellular_calcium_concentration (second). * CONSTANTS[36] is rCa in component intracellular_calcium_concentration (dimensionless). * CONSTANTS[42] is V_e in component extracellular_potassium_concentration (millimetre3). * CONSTANTS[37] is Kb in component extracellular_potassium_concentration (millimolar). * ALGEBRAIC[39] is i_mK in component extracellular_potassium_concentration (nanoA). * CONSTANTS[38] 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] = -50; CONSTANTS[0] = 8314.472; CONSTANTS[1] = 310; CONSTANTS[2] = 96485.3415; CONSTANTS[3] = 0.000027; CONSTANTS[4] = 0.06; CONSTANTS[5] = 0.06; CONSTANTS[6] = 45; STATES[1] = 3; STATES[2] = 140; STATES[3] = 7.5; CONSTANTS[7] = 140; STATES[4] = 0.0822; CONSTANTS[8] = 0.8; STATES[5] = 0.225; CONSTANTS[9] = 0.0075; CONSTANTS[10] = 10; CONSTANTS[11] = 0.0007; CONSTANTS[12] = 0.0001; STATES[6] = 5.6e-5; CONSTANTS[13] = 2; CONSTANTS[14] = 0.5; CONSTANTS[15] = 1; CONSTANTS[16] = 40; CONSTANTS[17] = 3; CONSTANTS[18] = 0.00002; CONSTANTS[19] = 0.0001; CONSTANTS[20] = 0.5; CONSTANTS[21] = 0.0125; STATES[7] = 0.0365; STATES[8] = 0.1969; CONSTANTS[22] = 1e-5; CONSTANTS[23] = 0.12; STATES[9] = 0; STATES[10] = 0.9997; STATES[11] = 0.5765; CONSTANTS[24] = 0.0001; CONSTANTS[25] = 0.0001; CONSTANTS[26] = 10; CONSTANTS[27] = 0.0005; CONSTANTS[28] = 0.008; CONSTANTS[29] = 0.11; CONSTANTS[30] = 0.1; STATES[12] = 1.98; STATES[13] = 0.55; CONSTANTS[31] = 5; CONSTANTS[32] = 0.002; STATES[14] = 0.237; CONSTANTS[33] = 0.005; CONSTANTS[34] = 0.2; CONSTANTS[35] = 0.01; CONSTANTS[36] = 2; CONSTANTS[37] = 3; CONSTANTS[38] = 1; CONSTANTS[39] = ( CONSTANTS[0]*CONSTANTS[1])/CONSTANTS[2]; CONSTANTS[40] = 3.14159*pow(CONSTANTS[28], 2.00000)*CONSTANTS[29]; CONSTANTS[41] = CONSTANTS[40]*(1.00000 - CONSTANTS[30]); CONSTANTS[42] = CONSTANTS[40]*CONSTANTS[30]; CONSTANTS[43] = CONSTANTS[41]*0.0500000; CONSTANTS[44] = CONSTANTS[41]*0.0200000; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[7] = ( STATES[6]*CONSTANTS[26])/CONSTANTS[27]; RATES[11] = CONSTANTS[26] - STATES[11]*(CONSTANTS[26]+ALGEBRAIC[7]); ALGEBRAIC[1] = 0.0200000*exp(- STATES[0]/18.0000); ALGEBRAIC[10] = 19.5000*exp(STATES[0]/19.0000); RATES[4] = ALGEBRAIC[1]*(1.00000 - STATES[4]) - ALGEBRAIC[10]*STATES[4]; ALGEBRAIC[2] = 2.10000*exp(STATES[0]/28.0000); ALGEBRAIC[11] = 0.960000*exp(- STATES[0]/24.0000); RATES[5] = ALGEBRAIC[2]*(1.00000 - STATES[5]) - ALGEBRAIC[11]*STATES[5]; 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[3] = STATES[0]+41.0000; ALGEBRAIC[12] = (fabs(ALGEBRAIC[3])