Computes the reaction terms $f(u,v)$ and $g(u,v)$.
{
for (
unsigned int i = 0; i <
m_nq; ++i)
{
NekDouble var_chaste_interface__membrane__V = inarray[0][i];
NekDouble var_chaste_interface__fast_sodium_current_m_gate__m = inarray[1][i];
NekDouble var_chaste_interface__fast_sodium_current_h_gate__h = inarray[2][i];
NekDouble var_chaste_interface__fast_sodium_current_j_gate__j = inarray[3][i];
NekDouble var_chaste_interface__rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__X_kr = inarray[4][i];
NekDouble var_chaste_interface__slow_activating_delayed_rectifiyer_K_current_X_ks_gate__X_ks = inarray[5][i];
NekDouble var_chaste_interface__transient_outward_potassium_current_X_to_gate__X_to = inarray[6][i];
NekDouble var_chaste_interface__transient_outward_potassium_current_Y_to_gate__Y_to = inarray[7][i];
NekDouble var_chaste_interface__L_type_Ca_current_f_gate__f = inarray[8][i];
NekDouble var_chaste_interface__L_type_Ca_current_d_gate__d = inarray[9][i];
NekDouble var_chaste_interface__L_type_Ca_current_f_Ca_gate__f_Ca = inarray[10][i];
NekDouble var_chaste_interface__calcium_dynamics__Ca_i = inarray[11][i];
NekDouble var_chaste_interface__calcium_dynamics__Ca_SR = inarray[12][i];
NekDouble d_dt_chaste_interface__membrane__V;
const NekDouble var_fast_sodium_current__j = var_chaste_interface__fast_sodium_current_j_gate__j;
const NekDouble var_fast_sodium_current__h = var_chaste_interface__fast_sodium_current_h_gate__h;
const NekDouble var_fast_sodium_current__m = var_chaste_interface__fast_sodium_current_m_gate__m;
const NekDouble var_fast_sodium_current__V = var_chaste_interface__membrane__V;
const NekDouble var_standard_ionic_concentrations__Na_o = 138.0;
const NekDouble var_standard_ionic_concentrations__Na_i = 10.0;
const NekDouble var_L_type_Ca_current__f = var_chaste_interface__L_type_Ca_current_f_gate__f;
const NekDouble var_L_type_Ca_current__f_Ca = var_chaste_interface__L_type_Ca_current_f_Ca_gate__f_Ca;
const NekDouble var_L_type_Ca_current__F = var_membrane__F;
const NekDouble var_L_type_Ca_current__P_Ca = 1.26e-05;
const NekDouble var_L_type_Ca_current__V = var_chaste_interface__membrane__V;
const NekDouble var_L_type_Ca_current__C_sc = 1.0;
const NekDouble var_L_type_Ca_current__T = var_membrane__T;
const NekDouble var_standard_ionic_concentrations__Ca_o = 2000.0;
const NekDouble var_L_type_Ca_current__Ca_o = var_standard_ionic_concentrations__Ca_o;
const NekDouble var_L_type_Ca_current__R = var_membrane__R;
const NekDouble var_L_type_Ca_current__Ca_i = var_chaste_interface__calcium_dynamics__Ca_i;
const NekDouble var_L_type_Ca_current__i_Ca_max = ((((var_L_type_Ca_current__P_Ca / var_L_type_Ca_current__C_sc) * 4.0 * var_L_type_Ca_current__V * pow(var_L_type_Ca_current__F, 2.0)) / (var_L_type_Ca_current__R * var_L_type_Ca_current__T)) * ((var_L_type_Ca_current__Ca_i * exp((2.0 * var_L_type_Ca_current__V * var_L_type_Ca_current__F) / (var_L_type_Ca_current__R * var_L_type_Ca_current__T))) - (0.341 * var_L_type_Ca_current__Ca_o))) / (exp((2.0 * var_L_type_Ca_current__V * var_L_type_Ca_current__F) / (var_L_type_Ca_current__R * var_L_type_Ca_current__T)) - 1.0);
const NekDouble var_L_type_Ca_current__d = var_chaste_interface__L_type_Ca_current_d_gate__d;
const NekDouble var_L_type_Ca_current__i_Ca = var_L_type_Ca_current__i_Ca_max * var_L_type_Ca_current__f * var_L_type_Ca_current__d * var_L_type_Ca_current__f_Ca;
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current__V = var_chaste_interface__membrane__V;
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current__X_kr = var_chaste_interface__rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__X_kr;
const NekDouble var_slow_activating_delayed_rectifiyer_K_current__V = var_chaste_interface__membrane__V;
const NekDouble var_slow_activating_delayed_rectifiyer_K_current__X_ks = var_chaste_interface__slow_activating_delayed_rectifiyer_K_current_X_ks_gate__X_ks;
const NekDouble var_transient_outward_potassium_current__Y_to = var_chaste_interface__transient_outward_potassium_current_Y_to_gate__Y_to;
const NekDouble var_transient_outward_potassium_current__X_to = var_chaste_interface__transient_outward_potassium_current_X_to_gate__X_to;
const NekDouble var_transient_outward_potassium_current__V = var_chaste_interface__membrane__V;
const NekDouble var_Na_Ca_exchanger__Na_o = var_standard_ionic_concentrations__Na_o;
const NekDouble var_Na_Ca_exchanger__K_sat = 0.2;
const NekDouble var_Na_Ca_exchanger__Ca_i = var_chaste_interface__calcium_dynamics__Ca_i;
const NekDouble var_Na_Ca_exchanger__K_mNa = 87.5;
const NekDouble var_Na_Ca_exchanger__Ca_o = var_standard_ionic_concentrations__Ca_o;
const NekDouble var_Na_Ca_exchanger__K_NaCa = 1500.0;
const NekDouble var_Na_Ca_exchanger__T = var_membrane__T;
const NekDouble var_Na_Ca_exchanger__V = var_chaste_interface__membrane__V;
const NekDouble var_Na_Ca_exchanger__Na_i = var_standard_ionic_concentrations__Na_i;
const NekDouble var_Na_Ca_exchanger__eta = 0.35;
const NekDouble var_Na_Ca_exchanger__K_mCa = 1380.0;
const NekDouble var_Na_Ca_exchanger__F = var_membrane__F;
const NekDouble var_Na_Ca_exchanger__R = var_membrane__R;
const NekDouble var_Na_Ca_exchanger__i_NaCa = (var_Na_Ca_exchanger__K_NaCa / ((pow(var_Na_Ca_exchanger__K_mNa, 3.0) + pow(var_Na_Ca_exchanger__Na_o, 3.0)) * (var_Na_Ca_exchanger__K_mCa + var_Na_Ca_exchanger__Ca_o) * (1.0 + (var_Na_Ca_exchanger__K_sat * exp(((var_Na_Ca_exchanger__eta - 1.0) * var_Na_Ca_exchanger__V * var_Na_Ca_exchanger__F) / (var_Na_Ca_exchanger__R * var_Na_Ca_exchanger__T)))))) * ((exp((var_Na_Ca_exchanger__eta * var_Na_Ca_exchanger__V * var_Na_Ca_exchanger__F) / (var_Na_Ca_exchanger__R * var_Na_Ca_exchanger__T)) * pow(var_Na_Ca_exchanger__Na_i, 3.0) * var_Na_Ca_exchanger__Ca_o) - (exp(((var_Na_Ca_exchanger__eta - 1.0) * var_Na_Ca_exchanger__V * var_Na_Ca_exchanger__F) / (var_Na_Ca_exchanger__R * var_Na_Ca_exchanger__T)) * pow(var_Na_Ca_exchanger__Na_o, 3.0) * var_Na_Ca_exchanger__Ca_i));
const NekDouble var_sarcolemmal_calcium_pump__Ca_i = var_chaste_interface__calcium_dynamics__Ca_i;
const NekDouble var_sarcolemmal_calcium_pump__i_pCa_max = 0.05;
const NekDouble var_sarcolemmal_calcium_pump__K_mpCa = 0.05;
const NekDouble var_sarcolemmal_calcium_pump__i_p_Ca = (var_sarcolemmal_calcium_pump__i_pCa_max * var_sarcolemmal_calcium_pump__Ca_i) / (var_sarcolemmal_calcium_pump__K_mpCa + var_sarcolemmal_calcium_pump__Ca_i);
const NekDouble var_calcium_background_current__R = var_membrane__R;
const NekDouble var_calcium_background_current__Ca_i = var_chaste_interface__calcium_dynamics__Ca_i;
const NekDouble var_calcium_background_current__F = var_membrane__F;
const NekDouble var_calcium_background_current__T = var_membrane__T;
const NekDouble var_calcium_background_current__Ca_o = var_standard_ionic_concentrations__Ca_o;
const NekDouble var_calcium_background_current__E_Ca = ((var_calcium_background_current__R * var_calcium_background_current__T) / (2.0 * var_calcium_background_current__F)) * log(var_calcium_background_current__Ca_o / var_calcium_background_current__Ca_i);
const NekDouble var_calcium_background_current__g_Cab = 0.0003842;
const NekDouble var_calcium_background_current__V = var_chaste_interface__membrane__V;
const NekDouble var_calcium_background_current__i_Ca_b = var_calcium_background_current__g_Cab * (var_calcium_background_current__V - var_calcium_background_current__E_Ca);
const NekDouble var_fast_sodium_current_m_gate__m = var_fast_sodium_current__m;
const NekDouble var_fast_sodium_current_m_gate__V = var_fast_sodium_current__V;
const NekDouble var_fast_sodium_current_m_gate__E0_m = var_fast_sodium_current_m_gate__V + 47.13;
const NekDouble var_fast_sodium_current_m_gate__alpha_m = (0.32 * var_fast_sodium_current_m_gate__E0_m) / (1.0 - exp((-0.1) * var_fast_sodium_current_m_gate__E0_m));
const NekDouble var_fast_sodium_current_m_gate__beta_m = 0.08 * exp((-var_fast_sodium_current_m_gate__V) / 11.0);
const NekDouble var_fast_sodium_current_m_gate__d_m_d_environment__time = (var_fast_sodium_current_m_gate__alpha_m * (1.0 - var_fast_sodium_current_m_gate__m)) - (var_fast_sodium_current_m_gate__beta_m * var_fast_sodium_current_m_gate__m);
const NekDouble var_fast_sodium_current__fast_sodium_current_m_gate__d_m_d_environment__time = var_fast_sodium_current_m_gate__d_m_d_environment__time;
const NekDouble var_fast_sodium_current_h_gate__V = var_fast_sodium_current__V;
const NekDouble var_fast_sodium_current_h_gate__beta_h = 7.5 / (1.0 + exp((-0.1) * (var_fast_sodium_current_h_gate__V + 11.0)));
const NekDouble var_fast_sodium_current_h_gate__alpha_h = 0.135 * exp((var_fast_sodium_current_h_gate__V + 80.0) / (-6.8));
const NekDouble var_fast_sodium_current_h_gate__h = var_fast_sodium_current__h;
const NekDouble var_fast_sodium_current_h_gate__d_h_d_environment__time = (var_fast_sodium_current_h_gate__alpha_h * (1.0 - var_fast_sodium_current_h_gate__h)) - (var_fast_sodium_current_h_gate__beta_h * var_fast_sodium_current_h_gate__h);
const NekDouble var_fast_sodium_current__fast_sodium_current_h_gate__d_h_d_environment__time = var_fast_sodium_current_h_gate__d_h_d_environment__time;
const NekDouble var_fast_sodium_current_j_gate__V = var_fast_sodium_current__V;
const NekDouble var_fast_sodium_current_j_gate__alpha_j = (0.175 * exp((var_fast_sodium_current_j_gate__V + 100.0) / (-23.0))) / (1.0 + exp(0.15 * (var_fast_sodium_current_j_gate__V + 79.0)));
const NekDouble var_fast_sodium_current_j_gate__beta_j = 0.3 / (1.0 + exp((-0.1) * (var_fast_sodium_current_j_gate__V + 32.0)));
const NekDouble var_fast_sodium_current_j_gate__j = var_fast_sodium_current__j;
const NekDouble var_fast_sodium_current_j_gate__d_j_d_environment__time = (var_fast_sodium_current_j_gate__alpha_j * (1.0 - var_fast_sodium_current_j_gate__j)) - (var_fast_sodium_current_j_gate__beta_j * var_fast_sodium_current_j_gate__j);
const NekDouble var_fast_sodium_current__fast_sodium_current_j_gate__d_j_d_environment__time = var_fast_sodium_current_j_gate__d_j_d_environment__time;
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__V = var_rapid_activating_delayed_rectifiyer_K_current__V;
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__tau_X_kr = 43.0 + (1.0 / (exp((-5.495) + (0.1691 * var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__V)) + exp((-7.677) - (0.0128 * var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__V))));
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__X_kr = var_rapid_activating_delayed_rectifiyer_K_current__X_kr;
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__X_kr_inf = 1.0 / (1.0 + exp((-2.182) - (0.1819 * var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__V)));
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__d_X_kr_d_environment__time = (var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__X_kr_inf - var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__X_kr) / var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__tau_X_kr;
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current__rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__d_X_kr_d_environment__time = var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__d_X_kr_d_environment__time;
const NekDouble var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__V = var_slow_activating_delayed_rectifiyer_K_current__V;
const NekDouble var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__tau_X_ks = 1.0 / (((7.19e-05 * (var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__V - 10.0)) / (1.0 - exp((-0.148) * (var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__V - 10.0)))) + ((0.000131 * (var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__V - 10.0)) / (exp(0.0687 * (var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__V - 10.0)) - 1.0)));
const NekDouble var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__X_ks_infinity = 1.0 / (1.0 + exp((var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__V - 16.0) / (-13.6)));
const NekDouble var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__X_ks = var_slow_activating_delayed_rectifiyer_K_current__X_ks;
const NekDouble var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__d_X_ks_d_environment__time = (var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__X_ks_infinity - var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__X_ks) / var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__tau_X_ks;
const NekDouble var_slow_activating_delayed_rectifiyer_K_current__slow_activating_delayed_rectifiyer_K_current_X_ks_gate__d_X_ks_d_environment__time = var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__d_X_ks_d_environment__time;
const NekDouble var_transient_outward_potassium_current_X_to_gate__V = var_transient_outward_potassium_current__V;
const NekDouble var_transient_outward_potassium_current_X_to_gate__alpha_X_to = 0.04516 * exp(0.03577 * var_transient_outward_potassium_current_X_to_gate__V);
const NekDouble var_transient_outward_potassium_current_X_to_gate__X_to = var_transient_outward_potassium_current__X_to;
const NekDouble var_transient_outward_potassium_current_X_to_gate__beta_X_to = 0.0989 * exp((-0.06237) * var_transient_outward_potassium_current_X_to_gate__V);
const NekDouble var_transient_outward_potassium_current_X_to_gate__d_X_to_d_environment__time = (var_transient_outward_potassium_current_X_to_gate__alpha_X_to * (1.0 - var_transient_outward_potassium_current_X_to_gate__X_to)) - (var_transient_outward_potassium_current_X_to_gate__beta_X_to * var_transient_outward_potassium_current_X_to_gate__X_to);
const NekDouble var_transient_outward_potassium_current__transient_outward_potassium_current_X_to_gate__d_X_to_d_environment__time = var_transient_outward_potassium_current_X_to_gate__d_X_to_d_environment__time;
const NekDouble var_transient_outward_potassium_current_Y_to_gate__V = var_transient_outward_potassium_current__V;
const NekDouble var_transient_outward_potassium_current_Y_to_gate__beta_Y_to = (0.005415 * exp((var_transient_outward_potassium_current_Y_to_gate__V + 33.5) / 5.0)) / (1.0 + (0.051335 * exp((var_transient_outward_potassium_current_Y_to_gate__V + 33.5) / 5.0)));
const NekDouble var_transient_outward_potassium_current_Y_to_gate__alpha_Y_to = (0.005415 * exp((var_transient_outward_potassium_current_Y_to_gate__V + 33.5) / (-5.0))) / (1.0 + (0.051335 * exp((var_transient_outward_potassium_current_Y_to_gate__V + 33.5) / (-5.0))));
const NekDouble var_transient_outward_potassium_current_Y_to_gate__Y_to = var_transient_outward_potassium_current__Y_to;
const NekDouble var_transient_outward_potassium_current_Y_to_gate__d_Y_to_d_environment__time = (var_transient_outward_potassium_current_Y_to_gate__alpha_Y_to * (1.0 - var_transient_outward_potassium_current_Y_to_gate__Y_to)) - (var_transient_outward_potassium_current_Y_to_gate__beta_Y_to * var_transient_outward_potassium_current_Y_to_gate__Y_to);
const NekDouble var_transient_outward_potassium_current__transient_outward_potassium_current_Y_to_gate__d_Y_to_d_environment__time = var_transient_outward_potassium_current_Y_to_gate__d_Y_to_d_environment__time;
const NekDouble var_L_type_Ca_current_f_gate__V = var_L_type_Ca_current__V;
const NekDouble var_L_type_Ca_current_f_gate__tau_f = 30.0 + (200.0 / (1.0 + exp((var_L_type_Ca_current_f_gate__V + 20.0) / 9.5)));
const NekDouble var_L_type_Ca_current_f_gate__f = var_L_type_Ca_current__f;
const NekDouble var_L_type_Ca_current_f_gate__f_infinity = 1.0 / (1.0 + exp((var_L_type_Ca_current_f_gate__V + 12.5) / 5.0));
const NekDouble var_L_type_Ca_current_f_gate__d_f_d_environment__time = (var_L_type_Ca_current_f_gate__f_infinity - var_L_type_Ca_current_f_gate__f) / var_L_type_Ca_current_f_gate__tau_f;
const NekDouble var_L_type_Ca_current__L_type_Ca_current_f_gate__d_f_d_environment__time = var_L_type_Ca_current_f_gate__d_f_d_environment__time;
const NekDouble var_L_type_Ca_current_d_gate__V = var_L_type_Ca_current__V;
const NekDouble var_L_type_Ca_current_d_gate__E0_m = var_L_type_Ca_current_d_gate__V + 40.0;
const NekDouble var_L_type_Ca_current_d_gate__tau_d = 1.0 / (((0.25 * exp((-0.01) * var_L_type_Ca_current_d_gate__V)) / (1.0 + exp((-0.07) * var_L_type_Ca_current_d_gate__V))) + ((0.07 * exp((-0.05) * var_L_type_Ca_current_d_gate__E0_m)) / (1.0 + exp(0.05 * var_L_type_Ca_current_d_gate__E0_m))));
const NekDouble var_L_type_Ca_current_d_gate__d = var_L_type_Ca_current__d;
const NekDouble var_L_type_Ca_current_d_gate__d_infinity = 1.0 / (1.0 + exp((var_L_type_Ca_current_d_gate__V + 10.0) / (-6.24)));
const NekDouble var_L_type_Ca_current_d_gate__d_d_d_environment__time = (var_L_type_Ca_current_d_gate__d_infinity - var_L_type_Ca_current_d_gate__d) / var_L_type_Ca_current_d_gate__tau_d;
const NekDouble var_L_type_Ca_current__L_type_Ca_current_d_gate__d_d_d_environment__time = var_L_type_Ca_current_d_gate__d_d_d_environment__time;
const NekDouble var_L_type_Ca_current_f_Ca_gate__f_Ca = var_L_type_Ca_current__f_Ca;
const NekDouble var_L_type_Ca_current_f_Ca_gate__K_mfCa = 0.18;
const NekDouble var_L_type_Ca_current_f_Ca_gate__Ca_i = var_L_type_Ca_current__Ca_i;
const NekDouble var_L_type_Ca_current_f_Ca_gate__f_Ca_infinity = 1.0 / (1.0 + pow(var_L_type_Ca_current_f_Ca_gate__Ca_i / var_L_type_Ca_current_f_Ca_gate__K_mfCa, 3.0));
const NekDouble var_L_type_Ca_current_f_Ca_gate__tau_f_Ca = 30.0;
const NekDouble var_L_type_Ca_current_f_Ca_gate__d_f_Ca_d_environment__time = (var_L_type_Ca_current_f_Ca_gate__f_Ca_infinity - var_L_type_Ca_current_f_Ca_gate__f_Ca) / var_L_type_Ca_current_f_Ca_gate__tau_f_Ca;
const NekDouble var_L_type_Ca_current__L_type_Ca_current_f_Ca_gate__d_f_Ca_d_environment__time = var_L_type_Ca_current_f_Ca_gate__d_f_Ca_d_environment__time;
const NekDouble var_calcium_dynamics__Ca_i = var_chaste_interface__calcium_dynamics__Ca_i;
const NekDouble var_calcium_dynamics__CMDN_tot = 10.0;
const NekDouble var_calcium_dynamics__K_mCMDN = 2.0;
const NekDouble var_calcium_dynamics__beta_i = 1.0 / (1.0 + ((var_calcium_dynamics__CMDN_tot * var_calcium_dynamics__K_mCMDN) / pow(var_calcium_dynamics__K_mCMDN + var_calcium_dynamics__Ca_i, 2.0)));
const NekDouble var_calcium_dynamics__V_myo = 2.584e-05;
const NekDouble var_calcium_dynamics__F = var_membrane__F;
const NekDouble var_calcium_dynamics__C_sc = var_L_type_Ca_current__C_sc;
const NekDouble var_calcium_dynamics__A_Cap = 0.0001534;
const NekDouble var_calcium_dynamics__Ca_SR = var_chaste_interface__calcium_dynamics__Ca_SR;
const NekDouble var_calcium_dynamics__P_rel = 6.0;
const NekDouble var_calcium_dynamics__V = var_chaste_interface__membrane__V;
const NekDouble var_calcium_dynamics__f_Ca = var_chaste_interface__L_type_Ca_current_f_Ca_gate__f_Ca;
const NekDouble var_calcium_dynamics__gamma = 1.0 / (1.0 + pow(2000.0 / var_calcium_dynamics__Ca_SR, 3.0));
const NekDouble var_calcium_dynamics__d = var_chaste_interface__L_type_Ca_current_d_gate__d;
const NekDouble var_calcium_dynamics__f = var_chaste_interface__L_type_Ca_current_f_gate__f;
const NekDouble var_calcium_dynamics__J_rel = (var_calcium_dynamics__P_rel * var_calcium_dynamics__f * var_calcium_dynamics__d * var_calcium_dynamics__f_Ca * ((var_calcium_dynamics__gamma * var_calcium_dynamics__Ca_SR) - var_calcium_dynamics__Ca_i)) / (1.0 + (1.65 * exp(var_calcium_dynamics__V / 20.0)));
const NekDouble var_calcium_dynamics__P_leak = 1e-06;
const NekDouble var_calcium_dynamics__J_leak = var_calcium_dynamics__P_leak * (var_calcium_dynamics__Ca_SR - var_calcium_dynamics__Ca_i);
const NekDouble var_calcium_dynamics__K_mup = 0.32;
const NekDouble var_calcium_dynamics__V_up = 0.1;
const NekDouble var_calcium_dynamics__J_up = var_calcium_dynamics__V_up / (1.0 + pow(var_calcium_dynamics__K_mup / var_calcium_dynamics__Ca_i, 2.0));
const NekDouble var_calcium_dynamics__i_Ca = var_L_type_Ca_current__i_Ca;
const NekDouble var_calcium_dynamics__i_Ca_b = var_calcium_background_current__i_Ca_b;
const NekDouble var_calcium_dynamics__i_p_Ca = var_sarcolemmal_calcium_pump__i_p_Ca;
const NekDouble var_calcium_dynamics__i_NaCa = var_Na_Ca_exchanger__i_NaCa;
const NekDouble var_calcium_dynamics__K_mCSQN = 600.0;
const NekDouble var_calcium_dynamics__CSQN_tot = 10000.0;
const NekDouble var_calcium_dynamics__V_SR = 2e-06;
const NekDouble var_calcium_dynamics__beta_SR = 1.0 / (1.0 + ((var_calcium_dynamics__CSQN_tot * var_calcium_dynamics__K_mCSQN) / pow(var_calcium_dynamics__K_mCSQN + var_calcium_dynamics__Ca_SR, 2.0)));
const NekDouble var_calcium_dynamics__d_Ca_i_d_environment__time = var_calcium_dynamics__beta_i * (((var_calcium_dynamics__J_rel + var_calcium_dynamics__J_leak) - var_calcium_dynamics__J_up) - (((var_calcium_dynamics__A_Cap * var_calcium_dynamics__C_sc) / (2.0 * var_calcium_dynamics__F * var_calcium_dynamics__V_myo)) * ((var_calcium_dynamics__i_Ca + var_calcium_dynamics__i_Ca_b + var_calcium_dynamics__i_p_Ca) - (2.0 * var_calcium_dynamics__i_NaCa))));
const NekDouble var_calcium_dynamics__d_Ca_SR_d_environment__time = (var_calcium_dynamics__beta_SR * ((var_calcium_dynamics__J_up - var_calcium_dynamics__J_leak) - var_calcium_dynamics__J_rel) * var_calcium_dynamics__V_myo) / var_calcium_dynamics__V_SR;
const NekDouble var_chaste_interface__fast_sodium_current_m_gate__d_m_d_environment__time = var_fast_sodium_current__fast_sodium_current_m_gate__d_m_d_environment__time;
const NekDouble var_chaste_interface__fast_sodium_current_h_gate__d_h_d_environment__time = var_fast_sodium_current__fast_sodium_current_h_gate__d_h_d_environment__time;
const NekDouble var_chaste_interface__fast_sodium_current_j_gate__d_j_d_environment__time = var_fast_sodium_current__fast_sodium_current_j_gate__d_j_d_environment__time;
const NekDouble var_chaste_interface__rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__d_X_kr_d_environment__time = var_rapid_activating_delayed_rectifiyer_K_current__rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__d_X_kr_d_environment__time;
const NekDouble var_chaste_interface__slow_activating_delayed_rectifiyer_K_current_X_ks_gate__d_X_ks_d_environment__time = var_slow_activating_delayed_rectifiyer_K_current__slow_activating_delayed_rectifiyer_K_current_X_ks_gate__d_X_ks_d_environment__time;
const NekDouble var_chaste_interface__transient_outward_potassium_current_X_to_gate__d_X_to_d_environment__time = var_transient_outward_potassium_current__transient_outward_potassium_current_X_to_gate__d_X_to_d_environment__time;
const NekDouble var_chaste_interface__transient_outward_potassium_current_Y_to_gate__d_Y_to_d_environment__time = var_transient_outward_potassium_current__transient_outward_potassium_current_Y_to_gate__d_Y_to_d_environment__time;
const NekDouble var_chaste_interface__L_type_Ca_current_f_gate__d_f_d_environment__time = var_L_type_Ca_current__L_type_Ca_current_f_gate__d_f_d_environment__time;
const NekDouble var_chaste_interface__L_type_Ca_current_d_gate__d_d_d_environment__time = var_L_type_Ca_current__L_type_Ca_current_d_gate__d_d_d_environment__time;
const NekDouble var_chaste_interface__L_type_Ca_current_f_Ca_gate__d_f_Ca_d_environment__time = var_L_type_Ca_current__L_type_Ca_current_f_Ca_gate__d_f_Ca_d_environment__time;
const NekDouble var_chaste_interface__calcium_dynamics__d_Ca_i_d_environment__time = var_calcium_dynamics__d_Ca_i_d_environment__time;
const NekDouble var_chaste_interface__calcium_dynamics__d_Ca_SR_d_environment__time = var_calcium_dynamics__d_Ca_SR_d_environment__time;
const NekDouble d_dt_chaste_interface__fast_sodium_current_m_gate__m = var_chaste_interface__fast_sodium_current_m_gate__d_m_d_environment__time;
const NekDouble d_dt_chaste_interface__fast_sodium_current_h_gate__h = var_chaste_interface__fast_sodium_current_h_gate__d_h_d_environment__time;
const NekDouble d_dt_chaste_interface__fast_sodium_current_j_gate__j = var_chaste_interface__fast_sodium_current_j_gate__d_j_d_environment__time;
const NekDouble d_dt_chaste_interface__rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__X_kr = var_chaste_interface__rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__d_X_kr_d_environment__time;
const NekDouble d_dt_chaste_interface__slow_activating_delayed_rectifiyer_K_current_X_ks_gate__X_ks = var_chaste_interface__slow_activating_delayed_rectifiyer_K_current_X_ks_gate__d_X_ks_d_environment__time;
const NekDouble d_dt_chaste_interface__transient_outward_potassium_current_X_to_gate__X_to = var_chaste_interface__transient_outward_potassium_current_X_to_gate__d_X_to_d_environment__time;
const NekDouble d_dt_chaste_interface__transient_outward_potassium_current_Y_to_gate__Y_to = var_chaste_interface__transient_outward_potassium_current_Y_to_gate__d_Y_to_d_environment__time;
const NekDouble d_dt_chaste_interface__L_type_Ca_current_f_gate__f = var_chaste_interface__L_type_Ca_current_f_gate__d_f_d_environment__time;
const NekDouble d_dt_chaste_interface__L_type_Ca_current_d_gate__d = var_chaste_interface__L_type_Ca_current_d_gate__d_d_d_environment__time;
const NekDouble d_dt_chaste_interface__L_type_Ca_current_f_Ca_gate__f_Ca = var_chaste_interface__L_type_Ca_current_f_Ca_gate__d_f_Ca_d_environment__time;
const NekDouble d_dt_chaste_interface__calcium_dynamics__Ca_i = var_chaste_interface__calcium_dynamics__d_Ca_i_d_environment__time;
const NekDouble d_dt_chaste_interface__calcium_dynamics__Ca_SR = var_chaste_interface__calcium_dynamics__d_Ca_SR_d_environment__time;
const NekDouble var_fast_sodium_current__g_Na = 12.8;
const NekDouble var_fast_sodium_current__R = var_membrane__R;
const NekDouble var_fast_sodium_current__Na_o = var_standard_ionic_concentrations__Na_o;
const NekDouble var_fast_sodium_current__F = var_membrane__F;
const NekDouble var_fast_sodium_current__T = var_membrane__T;
const NekDouble var_fast_sodium_current__Na_i = var_standard_ionic_concentrations__Na_i;
const NekDouble var_fast_sodium_current__E_Na = ((var_fast_sodium_current__R * var_fast_sodium_current__T) / var_fast_sodium_current__F) * log(var_fast_sodium_current__Na_o / var_fast_sodium_current__Na_i);
const NekDouble var_fast_sodium_current__i_Na = var_fast_sodium_current__g_Na * pow(var_fast_sodium_current__m, 3.0) * var_fast_sodium_current__h * var_fast_sodium_current__j * (var_fast_sodium_current__V - var_fast_sodium_current__E_Na);
const NekDouble var_membrane__i_Na = var_fast_sodium_current__i_Na;
const NekDouble var_membrane__i_Ca = var_L_type_Ca_current__i_Ca;
const NekDouble var_L_type_Ca_current__P_CaK = 5.79e-07;
const NekDouble var_standard_ionic_concentrations__K_o = 4.0;
const NekDouble var_L_type_Ca_current__K_o = var_standard_ionic_concentrations__K_o;
const NekDouble var_L_type_Ca_current__i_Ca_half = -0.265;
const NekDouble var_standard_ionic_concentrations__K_i = 149.4;
const NekDouble var_L_type_Ca_current__K_i = var_standard_ionic_concentrations__K_i;
const NekDouble var_L_type_Ca_current__i_CaK = ((((((var_L_type_Ca_current__P_CaK / var_L_type_Ca_current__C_sc) * var_L_type_Ca_current__f * var_L_type_Ca_current__d * var_L_type_Ca_current__f_Ca) / (1.0 + (var_L_type_Ca_current__i_Ca_max / var_L_type_Ca_current__i_Ca_half))) * 1000.0 * var_L_type_Ca_current__V * pow(var_L_type_Ca_current__F, 2.0)) / (var_L_type_Ca_current__R * var_L_type_Ca_current__T)) * ((var_L_type_Ca_current__K_i * exp((var_L_type_Ca_current__V * var_L_type_Ca_current__F) / (var_L_type_Ca_current__R * var_L_type_Ca_current__T))) - var_L_type_Ca_current__K_o)) / (exp((var_L_type_Ca_current__V * var_L_type_Ca_current__F) / (var_L_type_Ca_current__R * var_L_type_Ca_current__T)) - 1.0);
const NekDouble var_membrane__i_CaK = var_L_type_Ca_current__i_CaK;
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current__K_o = var_standard_ionic_concentrations__K_o;
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current__R = var_membrane__R;
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current__F = var_membrane__F;
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current__K_i = var_standard_ionic_concentrations__K_i;
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current__T = var_membrane__T;
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current__E_K = ((var_rapid_activating_delayed_rectifiyer_K_current__R * var_rapid_activating_delayed_rectifiyer_K_current__T) / var_rapid_activating_delayed_rectifiyer_K_current__F) * log(var_rapid_activating_delayed_rectifiyer_K_current__K_o / var_rapid_activating_delayed_rectifiyer_K_current__K_i);
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current__R_V = 1.0 / (1.0 + (2.5 * exp(0.1 * (var_rapid_activating_delayed_rectifiyer_K_current__V + 28.0))));
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current__g_Kr = 0.0136;
const NekDouble var_rapid_activating_delayed_rectifiyer_K_current__i_Kr = var_rapid_activating_delayed_rectifiyer_K_current__g_Kr * var_rapid_activating_delayed_rectifiyer_K_current__R_V * var_rapid_activating_delayed_rectifiyer_K_current__X_kr * sqrt(var_rapid_activating_delayed_rectifiyer_K_current__K_o / 4.0) * (var_rapid_activating_delayed_rectifiyer_K_current__V - var_rapid_activating_delayed_rectifiyer_K_current__E_K);
const NekDouble var_membrane__i_Kr = var_rapid_activating_delayed_rectifiyer_K_current__i_Kr;
const NekDouble var_slow_activating_delayed_rectifiyer_K_current__g_Ks = 0.0245;
const NekDouble var_slow_activating_delayed_rectifiyer_K_current__T = var_membrane__T;
const NekDouble var_slow_activating_delayed_rectifiyer_K_current__K_o = var_standard_ionic_concentrations__K_o;
const NekDouble var_slow_activating_delayed_rectifiyer_K_current__R = var_membrane__R;
const NekDouble var_slow_activating_delayed_rectifiyer_K_current__Na_o = var_standard_ionic_concentrations__Na_o;
const NekDouble var_slow_activating_delayed_rectifiyer_K_current__Na_i = var_standard_ionic_concentrations__Na_i;
const NekDouble var_slow_activating_delayed_rectifiyer_K_current__K_i = var_standard_ionic_concentrations__K_i;
const NekDouble var_slow_activating_delayed_rectifiyer_K_current__F = var_membrane__F;
const NekDouble var_slow_activating_delayed_rectifiyer_K_current__E_Ks = ((var_slow_activating_delayed_rectifiyer_K_current__R * var_slow_activating_delayed_rectifiyer_K_current__T) / var_slow_activating_delayed_rectifiyer_K_current__F) * log((var_slow_activating_delayed_rectifiyer_K_current__K_o + (0.01833 * var_slow_activating_delayed_rectifiyer_K_current__Na_o)) / (var_slow_activating_delayed_rectifiyer_K_current__K_i + (0.01833 * var_slow_activating_delayed_rectifiyer_K_current__Na_i)));
const NekDouble var_slow_activating_delayed_rectifiyer_K_current__i_Ks = var_slow_activating_delayed_rectifiyer_K_current__g_Ks * pow(var_slow_activating_delayed_rectifiyer_K_current__X_ks, 2.0) * (var_slow_activating_delayed_rectifiyer_K_current__V - var_slow_activating_delayed_rectifiyer_K_current__E_Ks);
const NekDouble var_membrane__i_Ks = var_slow_activating_delayed_rectifiyer_K_current__i_Ks;
const NekDouble var_transient_outward_potassium_current__g_to = 0.23815;
const NekDouble var_transient_outward_potassium_current__E_K = var_rapid_activating_delayed_rectifiyer_K_current__E_K;
const NekDouble var_transient_outward_potassium_current__i_to = var_transient_outward_potassium_current__g_to * var_transient_outward_potassium_current__X_to * var_transient_outward_potassium_current__Y_to * (var_transient_outward_potassium_current__V - var_transient_outward_potassium_current__E_K);
const NekDouble var_membrane__i_to = var_transient_outward_potassium_current__i_to;
const NekDouble var_time_independent_potassium_current__E_K = var_rapid_activating_delayed_rectifiyer_K_current__E_K;
const NekDouble var_time_independent_potassium_current__K_o = var_standard_ionic_concentrations__K_o;
const NekDouble var_time_independent_potassium_current__g_K1 = 2.8;
const NekDouble var_time_independent_potassium_current__F = var_membrane__F;
const NekDouble var_time_independent_potassium_current_K1_gate__F = var_time_independent_potassium_current__F;
const NekDouble var_time_independent_potassium_current__V = var_chaste_interface__membrane__V;
const NekDouble var_time_independent_potassium_current_K1_gate__V = var_time_independent_potassium_current__V;
const NekDouble var_time_independent_potassium_current__T = var_membrane__T;
const NekDouble var_time_independent_potassium_current_K1_gate__T = var_time_independent_potassium_current__T;
const NekDouble var_time_independent_potassium_current_K1_gate__E_K = var_time_independent_potassium_current__E_K;
const NekDouble var_time_independent_potassium_current__R = var_membrane__R;
const NekDouble var_time_independent_potassium_current_K1_gate__R = var_time_independent_potassium_current__R;
const NekDouble var_time_independent_potassium_current_K1_gate__K1_infinity = 1.0 / (2.0 + exp(((1.62 * var_time_independent_potassium_current_K1_gate__F) / (var_time_independent_potassium_current_K1_gate__R * var_time_independent_potassium_current_K1_gate__T)) * (var_time_independent_potassium_current_K1_gate__V - var_time_independent_potassium_current_K1_gate__E_K)));
const NekDouble var_time_independent_potassium_current__K1_infinity = var_time_independent_potassium_current_K1_gate__K1_infinity;
const NekDouble var_time_independent_potassium_current__K_mK1 = 13.0;
const NekDouble var_time_independent_potassium_current__i_K1 = ((var_time_independent_potassium_current__g_K1 * var_time_independent_potassium_current__K1_infinity * var_time_independent_potassium_current__K_o) / (var_time_independent_potassium_current__K_o + var_time_independent_potassium_current__K_mK1)) * (var_time_independent_potassium_current__V - var_time_independent_potassium_current__E_K);
const NekDouble var_membrane__i_K1 = var_time_independent_potassium_current__i_K1;
const NekDouble var_plateau_potassium_current__g_Kp = 0.002216;
const NekDouble var_plateau_potassium_current__V = var_chaste_interface__membrane__V;
const NekDouble var_plateau_potassium_current_Kp_gate__V = var_plateau_potassium_current__V;
const NekDouble var_plateau_potassium_current_Kp_gate__Kp_V = 1.0 / (1.0 + exp((7.488 - var_plateau_potassium_current_Kp_gate__V) / 5.98));
const NekDouble var_plateau_potassium_current__Kp_V = var_plateau_potassium_current_Kp_gate__Kp_V;
const NekDouble var_plateau_potassium_current__E_K = var_rapid_activating_delayed_rectifiyer_K_current__E_K;
const NekDouble var_plateau_potassium_current__i_Kp = var_plateau_potassium_current__g_Kp * var_plateau_potassium_current__Kp_V * (var_plateau_potassium_current__V - var_plateau_potassium_current__E_K);
const NekDouble var_membrane__i_Kp = var_plateau_potassium_current__i_Kp;
const NekDouble var_membrane__i_NaCa = var_Na_Ca_exchanger__i_NaCa;
const NekDouble var_sodium_potassium_pump__K_mNai = 10.0;
const NekDouble var_sodium_potassium_pump__V = var_chaste_interface__membrane__V;
const NekDouble var_sodium_potassium_pump__F = var_membrane__F;
const NekDouble var_sodium_potassium_pump__T = var_membrane__T;
const NekDouble var_sodium_potassium_pump__Na_o = var_standard_ionic_concentrations__Na_o;
const NekDouble var_sodium_potassium_pump__sigma = (1.0 / 7.0) * (exp(var_sodium_potassium_pump__Na_o / 67.3) - 1.0);
const NekDouble var_sodium_potassium_pump__R = var_membrane__R;
const NekDouble var_sodium_potassium_pump__f_NaK = 1.0 / (1.0 + (0.1245 * exp(((-0.1) * var_sodium_potassium_pump__V * var_sodium_potassium_pump__F) / (var_sodium_potassium_pump__R * var_sodium_potassium_pump__T))) + (0.0365 * var_sodium_potassium_pump__sigma * exp(((-var_sodium_potassium_pump__V) * var_sodium_potassium_pump__F) / (var_sodium_potassium_pump__R * var_sodium_potassium_pump__T))));
const NekDouble var_sodium_potassium_pump__i_NaK_max = 0.693;
const NekDouble var_sodium_potassium_pump__K_o = var_standard_ionic_concentrations__K_o;
const NekDouble var_sodium_potassium_pump__Na_i = var_standard_ionic_concentrations__Na_i;
const NekDouble var_sodium_potassium_pump__K_mKo = 1.5;
const NekDouble var_sodium_potassium_pump__i_NaK = (((var_sodium_potassium_pump__i_NaK_max * var_sodium_potassium_pump__f_NaK) / (1.0 + pow(var_sodium_potassium_pump__K_mNai / var_sodium_potassium_pump__Na_i, 1.5))) * var_sodium_potassium_pump__K_o) / (var_sodium_potassium_pump__K_o + var_sodium_potassium_pump__K_mKo);
const NekDouble var_membrane__i_NaK = var_sodium_potassium_pump__i_NaK;
const NekDouble var_membrane__i_p_Ca = var_sarcolemmal_calcium_pump__i_p_Ca;
const NekDouble var_membrane__i_Ca_b = var_calcium_background_current__i_Ca_b;
const NekDouble var_sodium_background_current__g_Nab = 0.0031;
const NekDouble var_sodium_background_current__V = var_chaste_interface__membrane__V;
const NekDouble var_sodium_background_current__E_Na = var_fast_sodium_current__E_Na;
const NekDouble var_sodium_background_current__i_Na_b = var_sodium_background_current__g_Nab * (var_sodium_background_current__V - var_sodium_background_current__E_Na);
const NekDouble var_membrane__i_Na_b = var_sodium_background_current__i_Na_b;
const NekDouble var_chaste_interface__membrane__i_Stim = 0.0;
const NekDouble var_membrane__i_Stim_converter = var_chaste_interface__membrane__i_Stim;
const NekDouble var_membrane__chaste_interface__chaste_membrane_capacitance = 1.0;
const NekDouble var_membrane__i_Stim = var_membrane__i_Stim_converter / var_membrane__chaste_interface__chaste_membrane_capacitance;
const NekDouble var_membrane__d_V_d_environment__time = -(var_membrane__i_Na + var_membrane__i_Ca + var_membrane__i_CaK + var_membrane__i_Kr + var_membrane__i_Ks + var_membrane__i_to + var_membrane__i_K1 + var_membrane__i_Kp + var_membrane__i_NaCa + var_membrane__i_NaK + var_membrane__i_p_Ca + var_membrane__i_Na_b + var_membrane__i_Ca_b + var_membrane__i_Stim);
const NekDouble var_chaste_interface__membrane__d_V_d_environment__time = var_membrane__d_V_d_environment__time;
d_dt_chaste_interface__membrane__V = var_chaste_interface__membrane__d_V_d_environment__time;
outarray[0][i] = d_dt_chaste_interface__membrane__V;
outarray[1][i] = d_dt_chaste_interface__fast_sodium_current_m_gate__m;
outarray[2][i] = d_dt_chaste_interface__fast_sodium_current_h_gate__h;
outarray[3][i] = d_dt_chaste_interface__fast_sodium_current_j_gate__j;
outarray[4][i] = d_dt_chaste_interface__rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__X_kr;
outarray[5][i] = d_dt_chaste_interface__slow_activating_delayed_rectifiyer_K_current_X_ks_gate__X_ks;
outarray[6][i] = d_dt_chaste_interface__transient_outward_potassium_current_X_to_gate__X_to;
outarray[7][i] = d_dt_chaste_interface__transient_outward_potassium_current_Y_to_gate__Y_to;
outarray[8][i] = d_dt_chaste_interface__L_type_Ca_current_f_gate__f;
outarray[9][i] = d_dt_chaste_interface__L_type_Ca_current_d_gate__d;
outarray[10][i] = d_dt_chaste_interface__L_type_Ca_current_f_Ca_gate__f_Ca;
outarray[11][i] = d_dt_chaste_interface__calcium_dynamics__Ca_i;
outarray[12][i] = d_dt_chaste_interface__calcium_dynamics__Ca_SR;
}
}