FoxModel2002Modified.hpp

Go to the documentation of this file.
00001 #ifndef _FoxModel2002Modified_
00002 #define _FoxModel2002Modified_
00003 
00015 #include <cmath>
00016 #include <cassert>
00017 #include "AbstractCardiacCell.hpp"
00018 #include "Exception.hpp"
00019 #include "AbstractStimulusFunction.hpp"
00020 #include "OdeSystemInformation.hpp"
00021 
00025 class FoxModel2002Modified : public AbstractCardiacCell
00026 {
00027 public:
00028     FoxModel2002Modified(boost::shared_ptr<AbstractIvpOdeSolver> pSolver,
00029                          boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus)
00030         : AbstractCardiacCell(pSolver, 13, 0, pIntracellularStimulus)
00031     {
00032         mpSystemInfo = OdeSystemInformation<FoxModel2002Modified>::Instance();
00033 
00034         Init();
00035 
00036     }
00037 
00038     ~FoxModel2002Modified(void)
00039     {
00040     }
00041 
00042 
00043     double GetIIonic()
00044     {
00045         std::vector<double>& rY = rGetStateVariables();
00046         double var_membrane__V = rY[0];
00047         // Units: millivolt; Initial value: -94.7
00048         double var_fast_sodium_current_m_gate__m = rY[1];
00049         // Units: dimensionless; Initial value: 0.00024676
00050         double var_fast_sodium_current_h_gate__h = rY[2];
00051         // Units: dimensionless; Initial value: 0.99869
00052         double var_fast_sodium_current_j_gate__j = rY[3];
00053         // Units: dimensionless; Initial value: 0.99887
00054         double var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__X_kr = rY[4];
00055         // Units: dimensionless; Initial value: 0.229
00056         double var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__X_ks = rY[5];
00057         // Units: dimensionless; Initial value: 0.0001
00058         double var_transient_outward_potassium_current_X_to_gate__X_to = rY[6];
00059         // Units: dimensionless; Initial value: 0.00003742
00060         double var_transient_outward_potassium_current_Y_to_gate__Y_to = rY[7];
00061         // Units: dimensionless; Initial value: 1
00062         double var_L_type_Ca_current_f_gate__f = rY[8];
00063         // Units: dimensionless; Initial value: 0.983
00064         double var_L_type_Ca_current_d_gate__d = rY[9];
00065         // Units: dimensionless; Initial value: 0.0001
00066         double var_L_type_Ca_current_f_Ca_gate__f_Ca = rY[10];
00067         // Units: dimensionless; Initial value: 0.942
00068         double var_calcium_dynamics__Ca_i = rY[11];
00069         // Units: micromolar; Initial value: 0.0472
00070 
00071         const double var_membrane__R = 8.314;
00072         const double var_membrane__T = 310.0;
00073         const double var_membrane__F = 96.5;
00074         double var_fast_sodium_current__h = var_fast_sodium_current_h_gate__h;
00075         const double var_fast_sodium_current__g_Na = 12.8;
00076         double var_fast_sodium_current__j = var_fast_sodium_current_j_gate__j;
00077         double var_fast_sodium_current__T = var_membrane__T;
00078         double var_fast_sodium_current__R = var_membrane__R;
00079         const double var_standard_ionic_concentrations__Na_i = 10.0;
00080         double var_fast_sodium_current__Na_i = var_standard_ionic_concentrations__Na_i;
00081         const double var_standard_ionic_concentrations__Na_o = 138.0;
00082         double var_fast_sodium_current__Na_o = var_standard_ionic_concentrations__Na_o;
00083         double var_fast_sodium_current__F = var_membrane__F;
00084         double 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);
00085         double var_fast_sodium_current__V = var_membrane__V;
00086         double var_fast_sodium_current__m = var_fast_sodium_current_m_gate__m;
00087         double 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);
00088         double var_membrane__i_Na = var_fast_sodium_current__i_Na;
00089         const double var_L_type_Ca_current__P_Ca = 1.26e-05; // was 2.26e-05;
00090         double var_L_type_Ca_current__V = var_membrane__V;
00091         const double var_standard_ionic_concentrations__Ca_o = 2000.0;
00092         double var_L_type_Ca_current__Ca_o = var_standard_ionic_concentrations__Ca_o;
00093         double var_L_type_Ca_current__T = var_membrane__T;
00094         const double var_L_type_Ca_current__C_sc = 1.0;
00095         double var_L_type_Ca_current__Ca_i = var_calcium_dynamics__Ca_i;
00096         double var_L_type_Ca_current__R = var_membrane__R;
00097         double var_L_type_Ca_current__F = var_membrane__F;
00098         double 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);
00099         double var_L_type_Ca_current__d = var_L_type_Ca_current_d_gate__d;
00100         double var_L_type_Ca_current__f = var_L_type_Ca_current_f_gate__f;
00101         double var_L_type_Ca_current__f_Ca = var_L_type_Ca_current_f_Ca_gate__f_Ca;
00102         double 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;
00103         double var_membrane__i_Ca = var_L_type_Ca_current__i_Ca;
00104         const double var_standard_ionic_concentrations__K_o = 4.0;
00105         double var_L_type_Ca_current__K_o = var_standard_ionic_concentrations__K_o;
00106         const double var_L_type_Ca_current__i_Ca_half =  -0.265;
00107         const double var_L_type_Ca_current__P_CaK = 5.79e-07;
00108         const double var_standard_ionic_concentrations__K_i = 149.4;
00109         double var_L_type_Ca_current__K_i = var_standard_ionic_concentrations__K_i;
00110         double 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);
00111         double var_membrane__i_CaK = var_L_type_Ca_current__i_CaK;
00112         double var_rapid_activating_delayed_rectifiyer_K_current__V = var_membrane__V;
00113         double 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))));
00114         double var_rapid_activating_delayed_rectifiyer_K_current__X_kr = var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__X_kr;
00115         double var_rapid_activating_delayed_rectifiyer_K_current__R = var_membrane__R;
00116         double var_rapid_activating_delayed_rectifiyer_K_current__K_o = var_standard_ionic_concentrations__K_o;
00117         double var_rapid_activating_delayed_rectifiyer_K_current__T = var_membrane__T;
00118         double var_rapid_activating_delayed_rectifiyer_K_current__K_i = var_standard_ionic_concentrations__K_i;
00119         double var_rapid_activating_delayed_rectifiyer_K_current__F = var_membrane__F;
00120         double 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);
00121         const double var_rapid_activating_delayed_rectifiyer_K_current__g_Kr = 0.0136;
00122         double 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);
00123         double var_membrane__i_Kr = var_rapid_activating_delayed_rectifiyer_K_current__i_Kr;
00124         const double var_slow_activating_delayed_rectifiyer_K_current__g_Ks = 0.0245;
00125         double var_slow_activating_delayed_rectifiyer_K_current__V = var_membrane__V;
00126         double var_slow_activating_delayed_rectifiyer_K_current__K_i = var_standard_ionic_concentrations__K_i;
00127         double var_slow_activating_delayed_rectifiyer_K_current__F = var_membrane__F;
00128         double var_slow_activating_delayed_rectifiyer_K_current__K_o = var_standard_ionic_concentrations__K_o;
00129         double var_slow_activating_delayed_rectifiyer_K_current__T = var_membrane__T;
00130         double var_slow_activating_delayed_rectifiyer_K_current__Na_o = var_standard_ionic_concentrations__Na_o;
00131         double var_slow_activating_delayed_rectifiyer_K_current__R = var_membrane__R;
00132         double var_slow_activating_delayed_rectifiyer_K_current__Na_i = var_standard_ionic_concentrations__Na_i;
00133         double 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)));
00134         double var_slow_activating_delayed_rectifiyer_K_current__X_ks = var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__X_ks;
00135         double 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);
00136         double var_membrane__i_Ks = var_slow_activating_delayed_rectifiyer_K_current__i_Ks;
00137         const double var_transient_outward_potassium_current__g_to = 0.23815;
00138         double var_transient_outward_potassium_current__V = var_membrane__V;
00139         double var_transient_outward_potassium_current__X_to = var_transient_outward_potassium_current_X_to_gate__X_to;
00140         double var_transient_outward_potassium_current__E_K = var_rapid_activating_delayed_rectifiyer_K_current__E_K;
00141         double var_transient_outward_potassium_current__Y_to = var_transient_outward_potassium_current_Y_to_gate__Y_to;
00142         double 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);
00143         double var_membrane__i_to = var_transient_outward_potassium_current__i_to;
00144         const double var_time_independent_potassium_current__g_K1 = 2.8;
00145         double var_time_independent_potassium_current__F = var_membrane__F;
00146         double var_time_independent_potassium_current_K1_gate__F = var_time_independent_potassium_current__F;
00147         double var_time_independent_potassium_current__V = var_membrane__V;
00148         double var_time_independent_potassium_current_K1_gate__V = var_time_independent_potassium_current__V;
00149         double var_time_independent_potassium_current__T = var_membrane__T;
00150         double var_time_independent_potassium_current_K1_gate__T = var_time_independent_potassium_current__T;
00151         double var_time_independent_potassium_current__R = var_membrane__R;
00152         double var_time_independent_potassium_current_K1_gate__R = var_time_independent_potassium_current__R;
00153         double var_time_independent_potassium_current__E_K = var_rapid_activating_delayed_rectifiyer_K_current__E_K;
00154         double var_time_independent_potassium_current_K1_gate__E_K = var_time_independent_potassium_current__E_K;
00155         double 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)));
00156         double var_time_independent_potassium_current__K1_infinity = var_time_independent_potassium_current_K1_gate__K1_infinity;
00157         double var_time_independent_potassium_current__K_o = var_standard_ionic_concentrations__K_o;
00158         const double var_time_independent_potassium_current__K_mK1 = 13.0;
00159         double 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);
00160         double var_membrane__i_K1 = var_time_independent_potassium_current__i_K1;
00161         double var_plateau_potassium_current__V = var_membrane__V;
00162         double var_plateau_potassium_current__E_K = var_rapid_activating_delayed_rectifiyer_K_current__E_K;
00163         const double var_plateau_potassium_current__g_Kp = 0.002216;
00164         double var_plateau_potassium_current_Kp_gate__V = var_plateau_potassium_current__V;
00165         double var_plateau_potassium_current_Kp_gate__Kp_V = 1.0 / (1.0 + exp((7.488 - var_plateau_potassium_current_Kp_gate__V) / 5.98));
00166         double var_plateau_potassium_current__Kp_V = var_plateau_potassium_current_Kp_gate__Kp_V;
00167         double 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);
00168         double var_membrane__i_Kp = var_plateau_potassium_current__i_Kp;
00169         double var_Na_Ca_exchanger__Na_o = var_standard_ionic_concentrations__Na_o;
00170         const double var_Na_Ca_exchanger__K_NaCa = 1500.0;
00171         double var_Na_Ca_exchanger__V = var_membrane__V;
00172         double var_Na_Ca_exchanger__Ca_o = var_standard_ionic_concentrations__Ca_o;
00173         const double var_Na_Ca_exchanger__eta = 0.35;
00174         double var_Na_Ca_exchanger__Na_i = var_standard_ionic_concentrations__Na_i;
00175         double var_Na_Ca_exchanger__T = var_membrane__T;
00176         double var_Na_Ca_exchanger__R = var_membrane__R;
00177         const double var_Na_Ca_exchanger__K_sat = 0.2;
00178         const double var_Na_Ca_exchanger__K_mCa = 1380.0;
00179         double var_Na_Ca_exchanger__F = var_membrane__F;
00180         const double var_Na_Ca_exchanger__K_mNa = 87.5;
00181         double var_Na_Ca_exchanger__Ca_i = var_calcium_dynamics__Ca_i;
00182         double 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));
00183         double var_membrane__i_NaCa = var_Na_Ca_exchanger__i_NaCa;
00184         double var_sodium_potassium_pump__Na_i = var_standard_ionic_concentrations__Na_i;
00185         double var_sodium_potassium_pump__K_o = var_standard_ionic_concentrations__K_o;
00186         const double var_sodium_potassium_pump__i_NaK_max = 0.693;
00187         const double var_sodium_potassium_pump__K_mNai = 10.0;
00188         double var_sodium_potassium_pump__T = var_membrane__T;
00189         double var_sodium_potassium_pump__R = var_membrane__R;
00190         double var_sodium_potassium_pump__Na_o = var_standard_ionic_concentrations__Na_o;
00191         double var_sodium_potassium_pump__sigma = (1.0 / 7.0) * (exp(var_sodium_potassium_pump__Na_o / 67.3) - 1.0);
00192         double var_sodium_potassium_pump__V = var_membrane__V;
00193         double var_sodium_potassium_pump__F = var_membrane__F;
00194         double 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))));
00195         const double var_sodium_potassium_pump__K_mKo = 1.5;
00196         double 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);
00197         double var_membrane__i_NaK = var_sodium_potassium_pump__i_NaK;
00198         const double var_sarcolemmal_calcium_pump__i_pCa_max = 0.05;
00199         double var_sarcolemmal_calcium_pump__Ca_i = var_calcium_dynamics__Ca_i;
00200         const double var_sarcolemmal_calcium_pump__K_mpCa = 0.05;
00201         double 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);
00202         double var_membrane__i_p_Ca = var_sarcolemmal_calcium_pump__i_p_Ca;
00203         const double var_calcium_background_current__g_Cab = 0.0003842;
00204         double var_calcium_background_current__R = var_membrane__R;
00205         double var_calcium_background_current__Ca_i = var_calcium_dynamics__Ca_i;
00206         double var_calcium_background_current__F = var_membrane__F;
00207         double var_calcium_background_current__Ca_o = var_standard_ionic_concentrations__Ca_o;
00208         double var_calcium_background_current__T = var_membrane__T;
00209         double 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);
00210         double var_calcium_background_current__V = var_membrane__V;
00211         double var_calcium_background_current__i_Ca_b = var_calcium_background_current__g_Cab * (var_calcium_background_current__V - var_calcium_background_current__E_Ca);
00212         double var_membrane__i_Ca_b = var_calcium_background_current__i_Ca_b;
00213         double var_sodium_background_current__V = var_membrane__V;
00214         const double var_sodium_background_current__g_Nab = 0.0031;
00215         double var_sodium_background_current__E_Na = var_fast_sodium_current__E_Na;
00216         double var_sodium_background_current__i_Na_b = var_sodium_background_current__g_Nab * (var_sodium_background_current__V - var_sodium_background_current__E_Na);
00217         double var_membrane__i_Na_b = var_sodium_background_current__i_Na_b;
00218 
00219         return 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_Ca_b+var_membrane__i_Na_b;
00220     }
00221 
00222     void EvaluateYDerivatives (
00223             double var_environment__time,
00224             const std::vector<double> &rY,
00225             std::vector<double> &rDY)
00226     {
00227         // Inputs:
00228         // Time units: millisecond
00229         double var_membrane__V = rY[0];
00230         // Units: millivolt; Initial value: -94.7
00231         double var_fast_sodium_current_m_gate__m = rY[1];
00232         // Units: dimensionless; Initial value: 0.00024676
00233         double var_fast_sodium_current_h_gate__h = rY[2];
00234         // Units: dimensionless; Initial value: 0.99869
00235         double var_fast_sodium_current_j_gate__j = rY[3];
00236         // Units: dimensionless; Initial value: 0.99887
00237         double var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__X_kr = rY[4];
00238         // Units: dimensionless; Initial value: 0.229
00239         double var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__X_ks = rY[5];
00240         // Units: dimensionless; Initial value: 0.0001
00241         double var_transient_outward_potassium_current_X_to_gate__X_to = rY[6];
00242         // Units: dimensionless; Initial value: 0.00003742
00243         double var_transient_outward_potassium_current_Y_to_gate__Y_to = rY[7];
00244         // Units: dimensionless; Initial value: 1
00245         double var_L_type_Ca_current_f_gate__f = rY[8];
00246         // Units: dimensionless; Initial value: 0.983
00247         double var_L_type_Ca_current_d_gate__d = rY[9];
00248         // Units: dimensionless; Initial value: 0.0001
00249         double var_L_type_Ca_current_f_Ca_gate__f_Ca = rY[10];
00250         // Units: dimensionless; Initial value: 0.942
00251         double var_calcium_dynamics__Ca_i = rY[11];
00252         // Units: micromolar; Initial value: 0.0472
00253         double var_calcium_dynamics__Ca_SR = rY[12];
00254         // Units: micromolar; Initial value: 320
00255 
00256         //#ifndef NDEBUG
00257         #define COVERAGE_IGNORE
00258         //Iterate over gating variables
00259         for (unsigned index=1; index<=10; index++)
00260         {
00261             if (!(0.0<=rY[index] && rY[index]<=1.0))
00262             {
00263                 EXCEPTION(DumpState(rGetVariableNames()[index] +
00264                           " gate has gone out of range. Check model parameters, for example spatial stepsize"));
00265             }
00266         }
00267         #undef COVERAGE_IGNORE
00268         //#endif //NDEBUG
00269 
00270         // Mathematics
00271         const double var_membrane__R = 8.314;
00272         const double var_membrane__T = 310.0;
00273         const double var_membrane__F = 96.5;
00274         double var_membrane__time = var_environment__time;
00275         double var_fast_sodium_current__h = var_fast_sodium_current_h_gate__h;
00276         const double var_fast_sodium_current__g_Na = 12.8;
00277         double var_fast_sodium_current__j = var_fast_sodium_current_j_gate__j;
00278         double var_fast_sodium_current__T = var_membrane__T;
00279         double var_fast_sodium_current__R = var_membrane__R;
00280         const double var_standard_ionic_concentrations__Na_i = 10.0;
00281         double var_fast_sodium_current__Na_i = var_standard_ionic_concentrations__Na_i;
00282         const double var_standard_ionic_concentrations__Na_o = 138.0;
00283         double var_fast_sodium_current__Na_o = var_standard_ionic_concentrations__Na_o;
00284         double var_fast_sodium_current__F = var_membrane__F;
00285         double 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);
00286         double var_fast_sodium_current__V = var_membrane__V;
00287         double var_fast_sodium_current__m = var_fast_sodium_current_m_gate__m;
00288         double 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);
00289         double var_membrane__i_Na = var_fast_sodium_current__i_Na;
00290         const double var_L_type_Ca_current__P_Ca = 1.26e-05; // was 2.26e-05;
00291         double var_L_type_Ca_current__V = var_membrane__V;
00292         const double var_standard_ionic_concentrations__Ca_o = 2000.0;
00293         double var_L_type_Ca_current__Ca_o = var_standard_ionic_concentrations__Ca_o;
00294         double var_L_type_Ca_current__T = var_membrane__T;
00295         const double var_L_type_Ca_current__C_sc = 1.0;
00296         double var_L_type_Ca_current__Ca_i = var_calcium_dynamics__Ca_i;
00297         double var_L_type_Ca_current__R = var_membrane__R;
00298         double var_L_type_Ca_current__F = var_membrane__F;
00299         double 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);
00300         double var_L_type_Ca_current__d = var_L_type_Ca_current_d_gate__d;
00301         double var_L_type_Ca_current__f = var_L_type_Ca_current_f_gate__f;
00302         double var_L_type_Ca_current__f_Ca = var_L_type_Ca_current_f_Ca_gate__f_Ca;
00303         double 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;
00304         double var_membrane__i_Ca = var_L_type_Ca_current__i_Ca;
00305         const double var_standard_ionic_concentrations__K_o = 4.0;
00306         double var_L_type_Ca_current__K_o = var_standard_ionic_concentrations__K_o;
00307         const double var_L_type_Ca_current__i_Ca_half =  -0.265;
00308         const double var_L_type_Ca_current__P_CaK = 5.79e-07;
00309         const double var_standard_ionic_concentrations__K_i = 149.4;
00310         double var_L_type_Ca_current__K_i = var_standard_ionic_concentrations__K_i;
00311         double 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);
00312         double var_membrane__i_CaK = var_L_type_Ca_current__i_CaK;
00313         double var_rapid_activating_delayed_rectifiyer_K_current__V = var_membrane__V;
00314         double 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))));
00315         double var_rapid_activating_delayed_rectifiyer_K_current__X_kr = var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__X_kr;
00316         double var_rapid_activating_delayed_rectifiyer_K_current__R = var_membrane__R;
00317         double var_rapid_activating_delayed_rectifiyer_K_current__K_o = var_standard_ionic_concentrations__K_o;
00318         double var_rapid_activating_delayed_rectifiyer_K_current__T = var_membrane__T;
00319         double var_rapid_activating_delayed_rectifiyer_K_current__K_i = var_standard_ionic_concentrations__K_i;
00320         double var_rapid_activating_delayed_rectifiyer_K_current__F = var_membrane__F;
00321         double 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);
00322         const double var_rapid_activating_delayed_rectifiyer_K_current__g_Kr = 0.0136;
00323         double 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);
00324         double var_membrane__i_Kr = var_rapid_activating_delayed_rectifiyer_K_current__i_Kr;
00325         const double var_slow_activating_delayed_rectifiyer_K_current__g_Ks = 0.0245;
00326         double var_slow_activating_delayed_rectifiyer_K_current__V = var_membrane__V;
00327         double var_slow_activating_delayed_rectifiyer_K_current__K_i = var_standard_ionic_concentrations__K_i;
00328         double var_slow_activating_delayed_rectifiyer_K_current__F = var_membrane__F;
00329         double var_slow_activating_delayed_rectifiyer_K_current__K_o = var_standard_ionic_concentrations__K_o;
00330         double var_slow_activating_delayed_rectifiyer_K_current__T = var_membrane__T;
00331         double var_slow_activating_delayed_rectifiyer_K_current__Na_o = var_standard_ionic_concentrations__Na_o;
00332         double var_slow_activating_delayed_rectifiyer_K_current__R = var_membrane__R;
00333         double var_slow_activating_delayed_rectifiyer_K_current__Na_i = var_standard_ionic_concentrations__Na_i;
00334         double 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)));
00335         double var_slow_activating_delayed_rectifiyer_K_current__X_ks = var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__X_ks;
00336         double 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);
00337         double var_membrane__i_Ks = var_slow_activating_delayed_rectifiyer_K_current__i_Ks;
00338         const double var_transient_outward_potassium_current__g_to = 0.23815;
00339         double var_transient_outward_potassium_current__V = var_membrane__V;
00340         double var_transient_outward_potassium_current__X_to = var_transient_outward_potassium_current_X_to_gate__X_to;
00341         double var_transient_outward_potassium_current__E_K = var_rapid_activating_delayed_rectifiyer_K_current__E_K;
00342         double var_transient_outward_potassium_current__Y_to = var_transient_outward_potassium_current_Y_to_gate__Y_to;
00343         double 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);
00344         double var_membrane__i_to = var_transient_outward_potassium_current__i_to;
00345         const double var_time_independent_potassium_current__g_K1 = 2.8;
00346         double var_time_independent_potassium_current__F = var_membrane__F;
00347         double var_time_independent_potassium_current_K1_gate__F = var_time_independent_potassium_current__F;
00348         double var_time_independent_potassium_current__V = var_membrane__V;
00349         double var_time_independent_potassium_current_K1_gate__V = var_time_independent_potassium_current__V;
00350         double var_time_independent_potassium_current__T = var_membrane__T;
00351         double var_time_independent_potassium_current_K1_gate__T = var_time_independent_potassium_current__T;
00352         double var_time_independent_potassium_current__R = var_membrane__R;
00353         double var_time_independent_potassium_current_K1_gate__R = var_time_independent_potassium_current__R;
00354         double var_time_independent_potassium_current__E_K = var_rapid_activating_delayed_rectifiyer_K_current__E_K;
00355         double var_time_independent_potassium_current_K1_gate__E_K = var_time_independent_potassium_current__E_K;
00356         double 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)));
00357         double var_time_independent_potassium_current__K1_infinity = var_time_independent_potassium_current_K1_gate__K1_infinity;
00358         double var_time_independent_potassium_current__K_o = var_standard_ionic_concentrations__K_o;
00359         const double var_time_independent_potassium_current__K_mK1 = 13.0;
00360         double 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);
00361         double var_membrane__i_K1 = var_time_independent_potassium_current__i_K1;
00362         double var_plateau_potassium_current__V = var_membrane__V;
00363         double var_plateau_potassium_current__E_K = var_rapid_activating_delayed_rectifiyer_K_current__E_K;
00364         const double var_plateau_potassium_current__g_Kp = 0.002216;
00365         double var_plateau_potassium_current_Kp_gate__V = var_plateau_potassium_current__V;
00366         double var_plateau_potassium_current_Kp_gate__Kp_V = 1.0 / (1.0 + exp((7.488 - var_plateau_potassium_current_Kp_gate__V) / 5.98));
00367         double var_plateau_potassium_current__Kp_V = var_plateau_potassium_current_Kp_gate__Kp_V;
00368         double 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);
00369         double var_membrane__i_Kp = var_plateau_potassium_current__i_Kp;
00370         double var_Na_Ca_exchanger__Na_o = var_standard_ionic_concentrations__Na_o;
00371         const double var_Na_Ca_exchanger__K_NaCa = 1500.0;
00372         double var_Na_Ca_exchanger__V = var_membrane__V;
00373         double var_Na_Ca_exchanger__Ca_o = var_standard_ionic_concentrations__Ca_o;
00374         const double var_Na_Ca_exchanger__eta = 0.35;
00375         double var_Na_Ca_exchanger__Na_i = var_standard_ionic_concentrations__Na_i;
00376         double var_Na_Ca_exchanger__T = var_membrane__T;
00377         double var_Na_Ca_exchanger__R = var_membrane__R;
00378         const double var_Na_Ca_exchanger__K_sat = 0.2;
00379         const double var_Na_Ca_exchanger__K_mCa = 1380.0;
00380         double var_Na_Ca_exchanger__F = var_membrane__F;
00381         const double var_Na_Ca_exchanger__K_mNa = 87.5;
00382         double var_Na_Ca_exchanger__Ca_i = var_calcium_dynamics__Ca_i;
00383         double 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));
00384         double var_membrane__i_NaCa = var_Na_Ca_exchanger__i_NaCa;
00385         double var_sodium_potassium_pump__Na_i = var_standard_ionic_concentrations__Na_i;
00386         double var_sodium_potassium_pump__K_o = var_standard_ionic_concentrations__K_o;
00387         const double var_sodium_potassium_pump__i_NaK_max = 0.693;
00388         const double var_sodium_potassium_pump__K_mNai = 10.0;
00389         double var_sodium_potassium_pump__T = var_membrane__T;
00390         double var_sodium_potassium_pump__R = var_membrane__R;
00391         double var_sodium_potassium_pump__Na_o = var_standard_ionic_concentrations__Na_o;
00392         double var_sodium_potassium_pump__sigma = (1.0 / 7.0) * (exp(var_sodium_potassium_pump__Na_o / 67.3) - 1.0);
00393         double var_sodium_potassium_pump__V = var_membrane__V;
00394         double var_sodium_potassium_pump__F = var_membrane__F;
00395         double 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))));
00396         const double var_sodium_potassium_pump__K_mKo = 1.5;
00397         double 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);
00398         double var_membrane__i_NaK = var_sodium_potassium_pump__i_NaK;
00399         const double var_sarcolemmal_calcium_pump__i_pCa_max = 0.05;
00400         double var_sarcolemmal_calcium_pump__Ca_i = var_calcium_dynamics__Ca_i;
00401         const double var_sarcolemmal_calcium_pump__K_mpCa = 0.05;
00402         double 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);
00403         double var_membrane__i_p_Ca = var_sarcolemmal_calcium_pump__i_p_Ca;
00404         const double var_calcium_background_current__g_Cab = 0.0003842;
00405         double var_calcium_background_current__R = var_membrane__R;
00406         double var_calcium_background_current__Ca_i = var_calcium_dynamics__Ca_i;
00407         double var_calcium_background_current__F = var_membrane__F;
00408         double var_calcium_background_current__Ca_o = var_standard_ionic_concentrations__Ca_o;
00409         double var_calcium_background_current__T = var_membrane__T;
00410         double 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);
00411         double var_calcium_background_current__V = var_membrane__V;
00412         double var_calcium_background_current__i_Ca_b = var_calcium_background_current__g_Cab * (var_calcium_background_current__V - var_calcium_background_current__E_Ca);
00413         double var_membrane__i_Ca_b = var_calcium_background_current__i_Ca_b;
00414         double var_sodium_background_current__V = var_membrane__V;
00415         const double var_sodium_background_current__g_Nab = 0.0031;
00416         double var_sodium_background_current__E_Na = var_fast_sodium_current__E_Na;
00417         double var_sodium_background_current__i_Na_b = var_sodium_background_current__g_Nab * (var_sodium_background_current__V - var_sodium_background_current__E_Na);
00418         double var_membrane__i_Na_b = var_sodium_background_current__i_Na_b;
00419         double var_membrane__i_Stim = GetStimulus(var_membrane__time);
00420         double var_fast_sodium_current_m_gate__V = var_fast_sodium_current__V;
00421         double var_fast_sodium_current_m_gate__E0_m = var_fast_sodium_current_m_gate__V + 47.13;
00422         double 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));
00423         double var_fast_sodium_current_m_gate__beta_m = 0.08 * exp((-var_fast_sodium_current_m_gate__V) / 11.0);
00424         double var_fast_sodium_current_h_gate__V = var_fast_sodium_current__V;
00425         double var_fast_sodium_current_h_gate__alpha_h = 0.135 * exp((var_fast_sodium_current_h_gate__V + 80.0) / (-6.8));
00426         double var_fast_sodium_current_h_gate__beta_h = 7.5 / (1.0 + exp((-0.1) * (var_fast_sodium_current_h_gate__V + 11.0)));
00427         double var_fast_sodium_current_j_gate__V = var_fast_sodium_current__V;
00428         double 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)));
00429         double var_fast_sodium_current_j_gate__beta_j = 0.3 / (1.0 + exp((-0.1) * (var_fast_sodium_current_j_gate__V + 32.0)));
00430         double var_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__V = var_rapid_activating_delayed_rectifiyer_K_current__V;
00431         double 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)));
00432         double 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))));
00433         double var_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__V = var_slow_activating_delayed_rectifiyer_K_current__V;
00434         double 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)));
00435         double 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)));
00436         double var_transient_outward_potassium_current_X_to_gate__V = var_transient_outward_potassium_current__V;
00437         double 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);
00438         double 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);
00439         double var_transient_outward_potassium_current_Y_to_gate__V = var_transient_outward_potassium_current__V;
00440         double 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))));
00441         double 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)));
00442         double var_L_type_Ca_current_f_gate__V = var_L_type_Ca_current__V;
00443         double 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));
00444         double 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)));
00445         double var_L_type_Ca_current_d_gate__V = var_L_type_Ca_current__V;
00446         double 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)));
00447         double var_L_type_Ca_current_d_gate__E0_m = var_L_type_Ca_current_d_gate__V + 40.0;
00448         double 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))));
00449         double var_L_type_Ca_current_f_Ca_gate__tau_f_Ca = 30.0;
00450         double var_L_type_Ca_current_f_Ca_gate__Ca_i = var_L_type_Ca_current__Ca_i;
00451         const double var_L_type_Ca_current_f_Ca_gate__K_mfCa = 0.18;
00452         double 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));
00453         const double var_calcium_dynamics__K_mCMDN = 2.0;
00454         const double var_calcium_dynamics__CMDN_tot = 10.0;
00455         double 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)));
00456         const double var_calcium_dynamics__V_myo = 2.584e-05;
00457         double var_calcium_dynamics__F = var_membrane__F;
00458         double var_calcium_dynamics__C_sc = var_L_type_Ca_current__C_sc;
00459         const double var_calcium_dynamics__A_Cap = 0.0001534;
00460         double var_calcium_dynamics__d = var_L_type_Ca_current__d;
00461         double var_calcium_dynamics__V = var_membrane__V;
00462         const double var_calcium_dynamics__P_rel = 6.0;
00463         double var_calcium_dynamics__gamma = 1.0 / (1.0 + pow(2000.0 / var_calcium_dynamics__Ca_SR, 3.0));
00464         double var_calcium_dynamics__f = var_L_type_Ca_current__f;
00465         double var_calcium_dynamics__f_Ca = var_L_type_Ca_current__f_Ca;
00466         double 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)));
00467         const double var_calcium_dynamics__P_leak = 1e-06;
00468         double var_calcium_dynamics__J_leak = var_calcium_dynamics__P_leak * (var_calcium_dynamics__Ca_SR - var_calcium_dynamics__Ca_i);
00469         const double var_calcium_dynamics__V_up = 0.1;
00470         const double var_calcium_dynamics__K_mup = 0.32;
00471         double 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));
00472         double var_calcium_dynamics__i_Ca = var_L_type_Ca_current__i_Ca;
00473         double var_calcium_dynamics__i_Ca_b = var_calcium_background_current__i_Ca_b;
00474         double var_calcium_dynamics__i_p_Ca = var_sarcolemmal_calcium_pump__i_p_Ca;
00475         double var_calcium_dynamics__i_NaCa = var_Na_Ca_exchanger__i_NaCa;
00476         const double var_calcium_dynamics__K_mCSQN = 600.0;
00477         const double var_calcium_dynamics__CSQN_tot = 10000.0;
00478         const double var_calcium_dynamics__V_SR = 2e-06;
00479         double 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)));
00480         double d_dt_membrane__V = -(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);
00481 
00482         // do not update voltage if the mSetVoltageDerivativeToZero flag has been set
00483         if (mSetVoltageDerivativeToZero)
00484         {
00485             d_dt_membrane__V = 0;
00486         }
00487 
00488         double d_dt_fast_sodium_current_m_gate__m = (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);
00489         double d_dt_fast_sodium_current_h_gate__h = (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);
00490         double d_dt_fast_sodium_current_j_gate__j = (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);
00491         double d_dt_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__X_kr = (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;
00492         double d_dt_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__X_ks = (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;
00493         double d_dt_transient_outward_potassium_current_X_to_gate__X_to = (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);
00494         double d_dt_transient_outward_potassium_current_Y_to_gate__Y_to = (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);
00495         double d_dt_L_type_Ca_current_f_gate__f = (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;
00496         double d_dt_L_type_Ca_current_d_gate__d = (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;
00497         double d_dt_L_type_Ca_current_f_Ca_gate__f_Ca = (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;
00498         double d_dt_calcium_dynamics__Ca_SR = (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;
00499         double d_dt_calcium_dynamics__Ca_i = 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))));
00500 
00501         rDY[0] = d_dt_membrane__V;
00502         rDY[1] = d_dt_fast_sodium_current_m_gate__m;
00503         rDY[2] = d_dt_fast_sodium_current_h_gate__h;
00504         rDY[3] = d_dt_fast_sodium_current_j_gate__j;
00505         rDY[4] = d_dt_rapid_activating_delayed_rectifiyer_K_current_X_kr_gate__X_kr;
00506         rDY[5] = d_dt_slow_activating_delayed_rectifiyer_K_current_X_ks_gate__X_ks;
00507         rDY[6] = d_dt_transient_outward_potassium_current_X_to_gate__X_to;
00508         rDY[7] = d_dt_transient_outward_potassium_current_Y_to_gate__Y_to;
00509         rDY[8] = d_dt_L_type_Ca_current_f_gate__f;
00510         rDY[9] = d_dt_L_type_Ca_current_d_gate__d;
00511         rDY[10] = d_dt_L_type_Ca_current_f_Ca_gate__f_Ca;
00512         rDY[11] = d_dt_calcium_dynamics__Ca_i;
00513         rDY[12] = d_dt_calcium_dynamics__Ca_SR;
00514     }
00515 };
00516 
00517 
00518 
00519 template<>
00520 void OdeSystemInformation<FoxModel2002Modified>::Initialise(void)
00521 {
00522     // Time units: millisecond
00523 
00524     this->mVariableNames.push_back("V");
00525     this->mVariableUnits.push_back("millivolt");
00526     this->mInitialConditions.push_back(-94.7);
00527 
00528     this->mVariableNames.push_back("m");
00529     this->mVariableUnits.push_back("dimensionless");
00530     this->mInitialConditions.push_back(0.00024676);
00531 
00532     this->mVariableNames.push_back("h");
00533     this->mVariableUnits.push_back("dimensionless");
00534     this->mInitialConditions.push_back(0.99869);
00535 
00536     this->mVariableNames.push_back("j");
00537     this->mVariableUnits.push_back("dimensionless");
00538     this->mInitialConditions.push_back(0.99887);
00539 
00540     this->mVariableNames.push_back("X_kr");
00541     this->mVariableUnits.push_back("dimensionless");
00542     this->mInitialConditions.push_back(0.229);
00543 
00544     this->mVariableNames.push_back("X_ks");
00545     this->mVariableUnits.push_back("dimensionless");
00546     this->mInitialConditions.push_back(0.0001);
00547 
00548     this->mVariableNames.push_back("X_to");
00549     this->mVariableUnits.push_back("dimensionless");
00550     this->mInitialConditions.push_back(0.00003742);
00551 
00552     this->mVariableNames.push_back("Y_to");
00553     this->mVariableUnits.push_back("dimensionless");
00554     this->mInitialConditions.push_back(1);
00555 
00556     this->mVariableNames.push_back("f");
00557     this->mVariableUnits.push_back("dimensionless");
00558     this->mInitialConditions.push_back(0.983);
00559 
00560     this->mVariableNames.push_back("d");
00561     this->mVariableUnits.push_back("dimensionless");
00562     this->mInitialConditions.push_back(0.0001);
00563 
00564     this->mVariableNames.push_back("f_Ca");
00565     this->mVariableUnits.push_back("dimensionless");
00566     this->mInitialConditions.push_back(0.942);
00567 
00568     this->mVariableNames.push_back("CaI");
00569     this->mVariableUnits.push_back("micromolar");
00570     this->mInitialConditions.push_back(0.0472);
00571 
00572     this->mVariableNames.push_back("Ca_SR");
00573     this->mVariableUnits.push_back("micromolar");
00574     this->mInitialConditions.push_back(320);
00575 
00576     this->mInitialised = true;
00577 }
00578 
00579 #endif

Generated on Tue Aug 4 16:10:22 2009 for Chaste by  doxygen 1.5.5