FoxModel2002Modified.cpp

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

Generated by  doxygen 1.6.2