/* There are a total of 45 entries in the algebraic variable array. There are a total of 17 entries in each of the rate and state variable arrays. There are a total of 59 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 Cm in component membrane (microF). * ALGEBRAIC[27] is i_K1 in component time_independent_potassium_current (nanoA). * ALGEBRAIC[38] is i_to in component transient_outward_current (nanoA). * ALGEBRAIC[29] is i_K in component time_dependent_potassium_current (nanoA). * ALGEBRAIC[34] is i_Ca_L_K in component L_type_Ca_channel (nanoA). * ALGEBRAIC[30] is i_b_K in component potassium_background_current (nanoA). * ALGEBRAIC[39] is i_NaK in component sodium_potassium_pump (nanoA). * ALGEBRAIC[31] is i_Na in component fast_sodium_current (nanoA). * ALGEBRAIC[32] is i_b_Na in component sodium_background_current (nanoA). * ALGEBRAIC[35] is i_Ca_L_Na in component L_type_Ca_channel (nanoA). * ALGEBRAIC[40] is i_NaCa in component sodium_calcium_exchanger (nanoA). * ALGEBRAIC[33] is i_Ca_L_Ca in component L_type_Ca_channel (nanoA). * ALGEBRAIC[37] is i_b_Ca in component calcium_background_current (nanoA). * ALGEBRAIC[6] 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). * ALGEBRAIC[15] is E_Na in component reversal_potentials (millivolt). * ALGEBRAIC[21] is E_K in component reversal_potentials (millivolt). * ALGEBRAIC[24] is E_Ca in component reversal_potentials (millivolt). * ALGEBRAIC[26] is E_mh in component reversal_potentials (millivolt). * CONSTANTS[9] is K_o in component extracellular_potassium_concentration (millimolar). * CONSTANTS[10] is Na_o in component extracellular_sodium_concentration (millimolar). * STATES[1] is K_i in component intracellular_potassium_concentration (millimolar). * STATES[2] is Na_i in component intracellular_sodium_concentration (millimolar). * CONSTANTS[11] is Ca_o in component extracellular_calcium_concentration (millimolar). * STATES[3] is Ca_i in component intracellular_calcium_concentration (millimolar). * CONSTANTS[12] is K_mk1 in component time_independent_potassium_current (millimolar). * CONSTANTS[13] is g_K1 in component time_independent_potassium_current (microS). * ALGEBRAIC[28] is I_K in component time_dependent_potassium_current (nanoA). * CONSTANTS[14] 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[0] is E0xa in component time_dependent_potassium_current_x_gate (millivolt). * ALGEBRAIC[17] is E0xb in component time_dependent_potassium_current_x_gate (millivolt). * ALGEBRAIC[9] is alpha_x in component time_dependent_potassium_current_x_gate (per_second). * ALGEBRAIC[23] is beta_x in component time_dependent_potassium_current_x_gate (per_second). * CONSTANTS[15] is g_bk in component potassium_background_current (microS). * CONSTANTS[16] is g_Na in component fast_sodium_current (microS). * STATES[5] is m in component fast_sodium_current_m_gate (dimensionless). * STATES[6] is h in component fast_sodium_current_h_gate (dimensionless). * ALGEBRAIC[10] is alpha_m in component fast_sodium_current_m_gate (per_second). * ALGEBRAIC[18] is beta_m in component fast_sodium_current_m_gate (per_second). * CONSTANTS[17] is delta_m in component fast_sodium_current_m_gate (millivolt). * ALGEBRAIC[1] is E0_m in component fast_sodium_current_m_gate (millivolt). * ALGEBRAIC[2] is alpha_h in component fast_sodium_current_h_gate (per_second). * ALGEBRAIC[11] is beta_h in component fast_sodium_current_h_gate (per_second). * CONSTANTS[18] is shift_h in component fast_sodium_current_h_gate (millivolt). * CONSTANTS[19] is g_bna in component sodium_background_current (microS). * ALGEBRAIC[36] is i_Ca_L in component L_type_Ca_channel (nanoA). * CONSTANTS[20] is P_Ca_L in component L_type_Ca_channel (nanoA_per_millimolar). * CONSTANTS[21] is P_CaK in component L_type_Ca_channel (dimensionless). * CONSTANTS[22] is P_CaNa in component L_type_Ca_channel (dimensionless). * STATES[7] is d in component L_type_Ca_channel_d_gate (dimensionless). * STATES[8] is f in component L_type_Ca_channel_f_gate (dimensionless). * ALGEBRAIC[12] is alpha_d in component L_type_Ca_channel_d_gate (per_second). * ALGEBRAIC[19] is beta_d in component L_type_Ca_channel_d_gate (per_second). * ALGEBRAIC[3] is E0_d in component L_type_Ca_channel_d_gate (millivolt). * CONSTANTS[23] is speed_d in component L_type_Ca_channel_d_gate (dimensionless). * ALGEBRAIC[13] is alpha_f in component L_type_Ca_channel_f_gate (per_second). * ALGEBRAIC[20] is beta_f in component L_type_Ca_channel_f_gate (per_second). * CONSTANTS[24] is speed_f in component L_type_Ca_channel_f_gate (dimensionless). * CONSTANTS[25] is delta_f in component L_type_Ca_channel_f_gate (millivolt). * ALGEBRAIC[4] is E0_f in component L_type_Ca_channel_f_gate (millivolt). * CONSTANTS[26] is g_bca in component calcium_background_current (microS). * CONSTANTS[27] is g_to in component transient_outward_current (microS). * CONSTANTS[28] is g_tos in component transient_outward_current (dimensionless). * STATES[9] is s in component transient_outward_current_s_gate (dimensionless). * STATES[10] is r in component transient_outward_current_r_gate (dimensionless). * ALGEBRAIC[5] is alpha_s in component transient_outward_current_s_gate (per_second). * ALGEBRAIC[14] is beta_s in component transient_outward_current_s_gate (per_second). * CONSTANTS[29] is i_NaK_max in component sodium_potassium_pump (nanoA). * CONSTANTS[30] is K_mK in component sodium_potassium_pump (millimolar). * CONSTANTS[31] is K_mNa in component sodium_potassium_pump (millimolar). * CONSTANTS[32] is k_NaCa in component sodium_calcium_exchanger (nanoA). * CONSTANTS[33] is n_NaCa in component sodium_calcium_exchanger (dimensionless). * CONSTANTS[34] is d_NaCa in component sodium_calcium_exchanger (dimensionless). * CONSTANTS[35] is gamma in component sodium_calcium_exchanger (dimensionless). * ALGEBRAIC[42] is i_up in component sarcoplasmic_reticulum_calcium_pump (millimolar_per_second). * CONSTANTS[56] is K_1 in component sarcoplasmic_reticulum_calcium_pump (dimensionless). * ALGEBRAIC[41] is K_2 in component sarcoplasmic_reticulum_calcium_pump (millimolar). * CONSTANTS[36] is K_cyca in component sarcoplasmic_reticulum_calcium_pump (millimolar). * CONSTANTS[37] is K_xcs in component sarcoplasmic_reticulum_calcium_pump (dimensionless). * CONSTANTS[38] is K_srca in component sarcoplasmic_reticulum_calcium_pump (millimolar). * CONSTANTS[39] is alpha_up in component sarcoplasmic_reticulum_calcium_pump (millimolar_per_second). * CONSTANTS[40] is beta_up in component sarcoplasmic_reticulum_calcium_pump (millimolar_per_second). * STATES[11] is Ca_up in component intracellular_calcium_concentration (millimolar). * ALGEBRAIC[43] is i_trans in component calcium_translocation (millimolar_per_second). * STATES[12] is Ca_rel in component intracellular_calcium_concentration (millimolar). * ALGEBRAIC[44] is i_rel in component calcium_release (millimolar_per_second). * ALGEBRAIC[7] is VoltDep in component calcium_release (dimensionless). * ALGEBRAIC[8] is RegBindSite in component calcium_release (dimensionless). * ALGEBRAIC[16] is ActRate in component calcium_release (per_second). * ALGEBRAIC[22] is InactRate in component calcium_release (per_second). * CONSTANTS[41] is K_leak_rate in component calcium_release (per_second). * CONSTANTS[42] is K_m_Ca in component calcium_release (millimolar). * CONSTANTS[43] is K_m_rel in component calcium_release (per_second). * ALGEBRAIC[25] is PrecFrac in component calcium_release (dimensionless). * STATES[13] is ActFrac in component calcium_release (dimensionless). * STATES[14] is ProdFrac in component calcium_release (dimensionless). * CONSTANTS[58] is V_i in component intracellular_calcium_concentration (micrometre3). * STATES[15] is Ca_Calmod in component intracellular_calcium_concentration (millimolar). * STATES[16] is Ca_Trop in component intracellular_calcium_concentration (millimolar). * CONSTANTS[44] is Calmod in component intracellular_calcium_concentration (millimolar). * CONSTANTS[45] is Trop in component intracellular_calcium_concentration (millimolar). * CONSTANTS[46] is alpha_Calmod in component intracellular_calcium_concentration (per_millimolar_second). * CONSTANTS[47] is beta_Calmod in component intracellular_calcium_concentration (per_second). * CONSTANTS[48] is alpha_Trop in component intracellular_calcium_concentration (per_millimolar_second). * CONSTANTS[49] is beta_Trop in component intracellular_calcium_concentration (per_second). * CONSTANTS[50] is radius in component intracellular_calcium_concentration (micrometre). * CONSTANTS[51] is length in component intracellular_calcium_concentration (micrometre). * CONSTANTS[55] is V_Cell in component intracellular_calcium_concentration (micrometre3). * CONSTANTS[57] is V_i_ratio in component intracellular_calcium_concentration (dimensionless). * CONSTANTS[52] is V_rel_ratio in component intracellular_calcium_concentration (dimensionless). * CONSTANTS[53] is V_e_ratio in component intracellular_calcium_concentration (dimensionless). * CONSTANTS[54] is V_up_ratio in component intracellular_calcium_concentration (dimensionless). * RATES[0] is d/dt V in component membrane (millivolt). * RATES[4] is d/dt x in component time_dependent_potassium_current_x_gate (dimensionless). * RATES[5] is d/dt m in component fast_sodium_current_m_gate (dimensionless). * RATES[6] is d/dt h in component fast_sodium_current_h_gate (dimensionless). * RATES[7] is d/dt d in component L_type_Ca_channel_d_gate (dimensionless). * RATES[8] is d/dt f in component L_type_Ca_channel_f_gate (dimensionless). * RATES[9] is d/dt s in component transient_outward_current_s_gate (dimensionless). * RATES[10] is d/dt r in component transient_outward_current_r_gate (dimensionless). * RATES[13] is d/dt ActFrac in component calcium_release (dimensionless). * RATES[14] is d/dt ProdFrac in component calcium_release (dimensionless). * RATES[2] is d/dt Na_i in component intracellular_sodium_concentration (millimolar). * RATES[1] is d/dt K_i in component intracellular_potassium_concentration (millimolar). * RATES[3] is d/dt Ca_i in component intracellular_calcium_concentration (millimolar). * RATES[15] is d/dt Ca_Calmod in component intracellular_calcium_concentration (millimolar). * RATES[16] is d/dt Ca_Trop in component intracellular_calcium_concentration (millimolar). * 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). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = -93.7400119196694; CONSTANTS[0] = 8314.472; CONSTANTS[1] = 310; CONSTANTS[2] = 96485.3415; CONSTANTS[3] = 9.5e-5; CONSTANTS[4] = 0.1; CONSTANTS[5] = 100; CONSTANTS[6] = 1; CONSTANTS[7] = 0.002; CONSTANTS[8] = -6; CONSTANTS[9] = 4; CONSTANTS[10] = 140; STATES[1] = 136.604284305878; STATES[2] = 7.50547214142684; CONSTANTS[11] = 2; STATES[3] = 1.34858164771406e-5; CONSTANTS[12] = 10; CONSTANTS[13] = 1; CONSTANTS[14] = 1; STATES[4] = 0.00938586574433011; CONSTANTS[15] = 0.0006; CONSTANTS[16] = 2.5; STATES[5] = 0.00143405969732302; STATES[6] = 0.995414125415674; CONSTANTS[17] = 1e-5; CONSTANTS[18] = 0; CONSTANTS[19] = 0.0006; CONSTANTS[20] = 0.25; CONSTANTS[21] = 0.002; CONSTANTS[22] = 0.01; STATES[7] = 1.91821833548952e-8; STATES[8] = 0.999999956287155; CONSTANTS[23] = 3; CONSTANTS[24] = 0.5; CONSTANTS[25] = 0.0001; CONSTANTS[26] = 0.00025; CONSTANTS[27] = 0.005; CONSTANTS[28] = 0; STATES[9] = 0.997644968939185; STATES[10] = 1.60424507876553e-8; CONSTANTS[29] = 0.7; CONSTANTS[30] = 1; CONSTANTS[31] = 40; CONSTANTS[32] = 0.0005; CONSTANTS[33] = 3; CONSTANTS[34] = 0; CONSTANTS[35] = 0.5; CONSTANTS[36] = 0.0003; CONSTANTS[37] = 0.4; CONSTANTS[38] = 0.5; CONSTANTS[39] = 0.4; CONSTANTS[40] = 0.03; STATES[11] = 0.59333810408885; STATES[12] = 0.591323137897127; CONSTANTS[41] = 0; CONSTANTS[42] = 0.0005; CONSTANTS[43] = 250; STATES[13] = 0.00267040300939318; STATES[14] = 0.522949441962453; STATES[15] = 0.000524570960945961; STATES[16] = 0.00033477224086766; CONSTANTS[44] = 0.02; CONSTANTS[45] = 0.05; CONSTANTS[46] = 100000; CONSTANTS[47] = 50; CONSTANTS[48] = 100000; CONSTANTS[49] = 200; CONSTANTS[50] = 0.012; CONSTANTS[51] = 0.074; CONSTANTS[52] = 0.1; CONSTANTS[53] = 0.4; CONSTANTS[54] = 0.01; CONSTANTS[55] = 3.14159*pow(CONSTANTS[50], 2.00000)*CONSTANTS[51]; CONSTANTS[56] = ( CONSTANTS[36]*CONSTANTS[37])/CONSTANTS[38]; CONSTANTS[57] = ((1.00000 - CONSTANTS[53]) - CONSTANTS[54]) - CONSTANTS[52]; CONSTANTS[58] = CONSTANTS[55]*CONSTANTS[57]; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { RATES[10] = 333.000*(1.00000/(1.00000+exp(- (STATES[0]+4.00000)/5.00000)) - STATES[10]); ALGEBRAIC[2] = 20.0000*exp( - 0.125000*((STATES[0]+75.0000) - CONSTANTS[18])); ALGEBRAIC[11] = 2000.00/(1.00000+ 320.000*exp( - 0.100000*((STATES[0]+75.0000) - CONSTANTS[18]))); RATES[6] = ALGEBRAIC[2]*(1.00000 - STATES[6]) - ALGEBRAIC[11]*STATES[6]; ALGEBRAIC[5] = 0.0330000*exp(- STATES[0]/17.0000); ALGEBRAIC[14] = 33.0000/(1.00000+exp( - 0.125000*(STATES[0]+10.0000))); RATES[9] = ALGEBRAIC[5]*(1.00000 - STATES[9]) - ALGEBRAIC[14]*STATES[9]; ALGEBRAIC[1] = STATES[0]+41.0000; ALGEBRAIC[10] = (fabs(ALGEBRAIC[1])=CONSTANTS[4]&&VOI<=CONSTANTS[5]&&(VOI - CONSTANTS[4]) - floor((VOI - CONSTANTS[4])/CONSTANTS[6])*CONSTANTS[6]<=CONSTANTS[7] ? CONSTANTS[8] : 0.00000); RATES[0] = (- 1.00000/CONSTANTS[3])*(ALGEBRAIC[6]+ALGEBRAIC[27]+ALGEBRAIC[38]+ALGEBRAIC[29]+ALGEBRAIC[30]+ALGEBRAIC[39]+ALGEBRAIC[31]+ALGEBRAIC[32]+ALGEBRAIC[35]+ALGEBRAIC[40]+ALGEBRAIC[33]+ALGEBRAIC[34]+ALGEBRAIC[37]); RATES[2] = (- 1.00000/( 1.00000*CONSTANTS[58]*CONSTANTS[2]))*(ALGEBRAIC[31]+ALGEBRAIC[32]+ 3.00000*ALGEBRAIC[39]+ 3.00000*ALGEBRAIC[40]+ALGEBRAIC[35]); ALGEBRAIC[41] = STATES[3]+ STATES[11]*CONSTANTS[56]+ CONSTANTS[36]*CONSTANTS[37]+CONSTANTS[36]; ALGEBRAIC[42] = (STATES[3]/ALGEBRAIC[41])*CONSTANTS[39] - (( STATES[11]*CONSTANTS[56])/ALGEBRAIC[41])*CONSTANTS[40]; ALGEBRAIC[43] = 50.0000*(STATES[11] - STATES[12]); RATES[11] = (CONSTANTS[57]/CONSTANTS[54])*ALGEBRAIC[42] - ALGEBRAIC[43]; RATES[15] = CONSTANTS[46]*STATES[3]*(CONSTANTS[44] - STATES[15]) - CONSTANTS[47]*STATES[15]; ALGEBRAIC[44] = ( pow(STATES[13]/(STATES[13]+0.250000), 2.00000)*CONSTANTS[43]+CONSTANTS[41])*STATES[12]; RATES[12] = (CONSTANTS[54]/CONSTANTS[52])*ALGEBRAIC[43] - ALGEBRAIC[44]; RATES[16] = CONSTANTS[48]*STATES[3]*(CONSTANTS[45] - STATES[16]) - CONSTANTS[49]*STATES[16]; RATES[3] = ((( (- 1.00000/( 2.00000*1.00000*CONSTANTS[58]*CONSTANTS[2]))*((ALGEBRAIC[33]+ALGEBRAIC[37]) - 2.00000*ALGEBRAIC[40])+( ALGEBRAIC[44]*CONSTANTS[52])/CONSTANTS[57]) - RATES[15]) - RATES[16]) - ALGEBRAIC[42]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[2] = 20.0000*exp( - 0.125000*((STATES[0]+75.0000) - CONSTANTS[18])); ALGEBRAIC[11] = 2000.00/(1.00000+ 320.000*exp( - 0.100000*((STATES[0]+75.0000) - CONSTANTS[18]))); ALGEBRAIC[5] = 0.0330000*exp(- STATES[0]/17.0000); ALGEBRAIC[14] = 33.0000/(1.00000+exp( - 0.125000*(STATES[0]+10.0000))); ALGEBRAIC[1] = STATES[0]+41.0000; ALGEBRAIC[10] = (fabs(ALGEBRAIC[1])=CONSTANTS[4]&&VOI<=CONSTANTS[5]&&(VOI - CONSTANTS[4]) - floor((VOI - CONSTANTS[4])/CONSTANTS[6])*CONSTANTS[6]<=CONSTANTS[7] ? CONSTANTS[8] : 0.00000); ALGEBRAIC[41] = STATES[3]+ STATES[11]*CONSTANTS[56]+ CONSTANTS[36]*CONSTANTS[37]+CONSTANTS[36]; ALGEBRAIC[42] = (STATES[3]/ALGEBRAIC[41])*CONSTANTS[39] - (( STATES[11]*CONSTANTS[56])/ALGEBRAIC[41])*CONSTANTS[40]; ALGEBRAIC[43] = 50.0000*(STATES[11] - STATES[12]); ALGEBRAIC[44] = ( pow(STATES[13]/(STATES[13]+0.250000), 2.00000)*CONSTANTS[43]+CONSTANTS[41])*STATES[12]; ALGEBRAIC[7] = exp( 0.0800000*(STATES[0] - 40.0000)); ALGEBRAIC[36] = ALGEBRAIC[33]+ALGEBRAIC[34]+ALGEBRAIC[35]; }