luo_rudy_1991.hpp

Go to the documentation of this file.
00001 #ifndef _Cellluo_rudy_1991FromCellML_
00002 #define _Cellluo_rudy_1991FromCellML_
00003 
00015 
00016 #include <boost/serialization/access.hpp>
00017 #include <boost/serialization/base_object.hpp>
00018 #include <cmath>
00019 #include <cassert>
00020 #include "AbstractCardiacCell.hpp"
00021 #include "Exception.hpp"
00022 #include "OdeSystemInformation.hpp"
00023 #include "AbstractStimulusFunction.hpp"
00024 
00025 // Needs to be included last
00026 #include <boost/serialization/export.hpp>
00027 
00028 class Cellluo_rudy_1991FromCellML : public AbstractCardiacCell
00029 {
00030     friend class boost::serialization::access;
00031     template<class Archive>
00032     void serialize(Archive & archive, const unsigned int version)
00033     {
00034         archive & boost::serialization::base_object<AbstractCardiacCell>(*this);
00035     }
00036     
00037 public:
00038     Cellluo_rudy_1991FromCellML(boost::shared_ptr<AbstractIvpOdeSolver> pSolver, 
00039                                 boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus)
00040         : AbstractCardiacCell(pSolver, 8, 0, pIntracellularStimulus)
00041     {
00042         // Time units: millisecond
00043         // 
00044         mpSystemInfo = OdeSystemInformation<Cellluo_rudy_1991FromCellML>::Instance();
00045         Init();
00046 
00047     }
00048     
00049     ~Cellluo_rudy_1991FromCellML(void)
00050     {
00051     }
00052     
00053     void VerifyGatingVariables()
00054     {}
00055 
00056     double GetIIonic()
00057     {
00058         std::vector<double>& rY = rGetStateVariables();
00059         double var_membrane__V = rY[0];
00060         // Units: millivolt; Initial value: -83.853
00061         double var_fast_sodium_current_m_gate__m = rY[1];
00062         // Units: dimensionless; Initial value: 0.00187018
00063         double var_fast_sodium_current_h_gate__h = rY[2];
00064         // Units: dimensionless; Initial value: 0.9804713
00065         double var_fast_sodium_current_j_gate__j = rY[3];
00066         // Units: dimensionless; Initial value: 0.98767124
00067         double var_slow_inward_current_d_gate__d = rY[4];
00068         // Units: dimensionless; Initial value: 0.00316354
00069         double var_slow_inward_current_f_gate__f = rY[5];
00070         // Units: dimensionless; Initial value: 0.99427859
00071         double var_time_dependent_potassium_current_X_gate__X = rY[6];
00072         // Units: dimensionless; Initial value: 0.16647703
00073         double var_intracellular_calcium_concentration__Cai = rY[7];
00074         // Units: millimolar; Initial value: 0.0002
00075         
00076         const double var_membrane__R = 8314.0;
00077         const double var_membrane__T = 310.0;
00078         const double var_membrane__F = 96484.6;
00079         const double var_fast_sodium_current__j = var_fast_sodium_current_j_gate__j;
00080         const double var_fast_sodium_current__h = var_fast_sodium_current_h_gate__h;
00081         const double var_fast_sodium_current__g_Na = 23.0;
00082         const double var_fast_sodium_current__m = var_fast_sodium_current_m_gate__m;
00083         const double var_fast_sodium_current__V = var_membrane__V;
00084         const double var_fast_sodium_current__R = var_membrane__R;
00085         const double var_fast_sodium_current__F = var_membrane__F;
00086         const double var_ionic_concentrations__Nao = 140.0;
00087         const double var_fast_sodium_current__Nao = var_ionic_concentrations__Nao;
00088         const double var_ionic_concentrations__Nai = 18.0;
00089         const double var_fast_sodium_current__Nai = var_ionic_concentrations__Nai;
00090         const double var_fast_sodium_current__T = var_membrane__T;
00091         const 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__Nao / var_fast_sodium_current__Nai);
00092         const 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);
00093         const double var_membrane__i_Na = var_fast_sodium_current__i_Na;
00094         const double var_slow_inward_current__d = var_slow_inward_current_d_gate__d;
00095         const double var_slow_inward_current__f = var_slow_inward_current_f_gate__f;
00096         const double var_slow_inward_current__V = var_membrane__V;
00097         const double var_slow_inward_current__Cai = var_intracellular_calcium_concentration__Cai;
00098         const double var_slow_inward_current__E_si = 7.7 - (13.0287 * log(var_slow_inward_current__Cai / 1.0));
00099         const double var_slow_inward_current__i_si = 0.09 * var_slow_inward_current__d * var_slow_inward_current__f * (var_slow_inward_current__V - var_slow_inward_current__E_si);
00100         const double var_membrane__i_si = var_slow_inward_current__i_si;
00101         const double var_time_dependent_potassium_current__V = var_membrane__V;
00102         const double var_time_dependent_potassium_current_Xi_gate__V = var_time_dependent_potassium_current__V;
00103         const double var_time_dependent_potassium_current_Xi_gate__Xi = (var_time_dependent_potassium_current_Xi_gate__V > (-100.0)) ? ((2.837 * (exp(0.04 * (var_time_dependent_potassium_current_Xi_gate__V + 77.0)) - 1.0)) / ((var_time_dependent_potassium_current_Xi_gate__V + 77.0) * exp(0.04 * (var_time_dependent_potassium_current_Xi_gate__V + 35.0)))) : 1.0;
00104         const double var_time_dependent_potassium_current__Xi = var_time_dependent_potassium_current_Xi_gate__Xi;
00105         const double var_ionic_concentrations__Ko = 5.4;
00106         const double var_time_dependent_potassium_current__Ko = var_ionic_concentrations__Ko;
00107         const double var_time_dependent_potassium_current__g_K = 0.282 * sqrt(var_time_dependent_potassium_current__Ko / 5.4);
00108         const double var_time_dependent_potassium_current__X = var_time_dependent_potassium_current_X_gate__X;
00109         const double var_time_dependent_potassium_current__PR_NaK = 0.01833;
00110         const double var_time_dependent_potassium_current__F = var_membrane__F;
00111         const double var_time_dependent_potassium_current__Nao = var_ionic_concentrations__Nao;
00112         const double var_ionic_concentrations__Ki = 145.0;
00113         const double var_time_dependent_potassium_current__Ki = var_ionic_concentrations__Ki;
00114         const double var_time_dependent_potassium_current__Nai = var_ionic_concentrations__Nai;
00115         const double var_time_dependent_potassium_current__T = var_membrane__T;
00116         const double var_time_dependent_potassium_current__R = var_membrane__R;
00117         const double var_time_dependent_potassium_current__E_K = ((var_time_dependent_potassium_current__R * var_time_dependent_potassium_current__T) / var_time_dependent_potassium_current__F) * log((var_time_dependent_potassium_current__Ko + (var_time_dependent_potassium_current__PR_NaK * var_time_dependent_potassium_current__Nao)) / (var_time_dependent_potassium_current__Ki + (var_time_dependent_potassium_current__PR_NaK * var_time_dependent_potassium_current__Nai)));
00118         const double var_time_dependent_potassium_current__i_K = var_time_dependent_potassium_current__g_K * var_time_dependent_potassium_current__X * var_time_dependent_potassium_current__Xi * (var_time_dependent_potassium_current__V - var_time_dependent_potassium_current__E_K);
00119         const double var_membrane__i_K = var_time_dependent_potassium_current__i_K;
00120         const double var_time_independent_potassium_current__V = var_membrane__V;
00121         const double var_time_independent_potassium_current_K1_gate__V = var_time_independent_potassium_current__V;
00122         const double var_time_independent_potassium_current__Ki = var_ionic_concentrations__Ki;
00123         const double var_time_independent_potassium_current__R = var_membrane__R;
00124         const double var_time_independent_potassium_current__F = var_membrane__F;
00125         const double var_time_independent_potassium_current__Ko = var_ionic_concentrations__Ko;
00126         const double var_time_independent_potassium_current__T = var_membrane__T;
00127         const double var_time_independent_potassium_current__E_K1 = ((var_time_independent_potassium_current__R * var_time_independent_potassium_current__T) / var_time_independent_potassium_current__F) * log(var_time_independent_potassium_current__Ko / var_time_independent_potassium_current__Ki);
00128         const double var_time_independent_potassium_current_K1_gate__E_K1 = var_time_independent_potassium_current__E_K1;
00129         const double var_time_independent_potassium_current_K1_gate__beta_K1 = ((0.49124 * exp(0.08032 * ((var_time_independent_potassium_current_K1_gate__V + 5.476) - var_time_independent_potassium_current_K1_gate__E_K1))) + (1.0 * exp(0.06175 * (var_time_independent_potassium_current_K1_gate__V - (var_time_independent_potassium_current_K1_gate__E_K1 + 594.31))))) / (1.0 + exp((-0.5143) * ((var_time_independent_potassium_current_K1_gate__V - var_time_independent_potassium_current_K1_gate__E_K1) + 4.753)));
00130         const double var_time_independent_potassium_current_K1_gate__alpha_K1 = 1.02 / (1.0 + exp(0.2385 * ((var_time_independent_potassium_current_K1_gate__V - var_time_independent_potassium_current_K1_gate__E_K1) - 59.215)));
00131         const double var_time_independent_potassium_current_K1_gate__K1_infinity = var_time_independent_potassium_current_K1_gate__alpha_K1 / (var_time_independent_potassium_current_K1_gate__alpha_K1 + var_time_independent_potassium_current_K1_gate__beta_K1);
00132         const double var_time_independent_potassium_current__K1_infinity = var_time_independent_potassium_current_K1_gate__K1_infinity;
00133         const double var_time_independent_potassium_current__g_K1 = 0.6047 * sqrt(var_time_independent_potassium_current__Ko / 5.4);
00134         const 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__V - var_time_independent_potassium_current__E_K1);
00135         const double var_membrane__i_K1 = var_time_independent_potassium_current__i_K1;
00136         const double var_plateau_potassium_current__g_Kp = 0.0183;
00137         const double var_plateau_potassium_current__V = var_membrane__V;
00138         const double var_plateau_potassium_current__Kp = 1.0 / (1.0 + exp((7.488 - var_plateau_potassium_current__V) / 5.98));
00139         const double var_plateau_potassium_current__E_K1 = var_time_independent_potassium_current__E_K1;
00140         const double var_plateau_potassium_current__E_Kp = var_plateau_potassium_current__E_K1;
00141         const double var_plateau_potassium_current__i_Kp = var_plateau_potassium_current__g_Kp * var_plateau_potassium_current__Kp * (var_plateau_potassium_current__V - var_plateau_potassium_current__E_Kp);
00142         const double var_membrane__i_Kp = var_plateau_potassium_current__i_Kp;
00143         const double var_background_current__E_b =  -59.87;
00144         const double var_background_current__g_b = 0.03921;
00145         const double var_background_current__V = var_membrane__V;
00146         const double var_background_current__i_b = var_background_current__g_b * (var_background_current__V - var_background_current__E_b);
00147         const double var_membrane__i_b = var_background_current__i_b;
00148         
00149         return (var_membrane__i_Na+var_membrane__i_si+var_membrane__i_K+var_membrane__i_K1+var_membrane__i_Kp+var_membrane__i_b);
00150     }
00151     
00152     void EvaluateYDerivatives(
00153             double var_environment__time,
00154             const std::vector<double> &rY,
00155             std::vector<double> &rDY)
00156     {
00157         // Inputs:
00158         // Time units: millisecond
00159         var_environment__time *= 1.0;
00160         double var_membrane__V = rY[0];
00161         // Units: millivolt; Initial value: -83.853
00162         double var_fast_sodium_current_m_gate__m = rY[1];
00163         // Units: dimensionless; Initial value: 0.00187018
00164         double var_fast_sodium_current_h_gate__h = rY[2];
00165         // Units: dimensionless; Initial value: 0.9804713
00166         double var_fast_sodium_current_j_gate__j = rY[3];
00167         // Units: dimensionless; Initial value: 0.98767124
00168         double var_slow_inward_current_d_gate__d = rY[4];
00169         // Units: dimensionless; Initial value: 0.00316354
00170         double var_slow_inward_current_f_gate__f = rY[5];
00171         // Units: dimensionless; Initial value: 0.99427859
00172         double var_time_dependent_potassium_current_X_gate__X = rY[6];
00173         // Units: dimensionless; Initial value: 0.16647703
00174         double var_intracellular_calcium_concentration__Cai = rY[7];
00175         // Units: millimolar; Initial value: 0.0002
00176         
00177         
00178         // Mathematics
00179         const double var_membrane__R = 8314.0;
00180         const double var_membrane__T = 310.0;
00181         const double var_membrane__F = 96484.6;
00182         const double var_membrane__C = 1.0;
00183         double var_membrane__I_stim = GetStimulus((1.0/1)*var_environment__time);
00184         const double var_fast_sodium_current__j = var_fast_sodium_current_j_gate__j;
00185         const double var_fast_sodium_current__h = var_fast_sodium_current_h_gate__h;
00186         const double var_fast_sodium_current__g_Na = 23.0;
00187         const double var_fast_sodium_current__m = var_fast_sodium_current_m_gate__m;
00188         const double var_fast_sodium_current__V = var_membrane__V;
00189         const double var_fast_sodium_current__R = var_membrane__R;
00190         const double var_fast_sodium_current__F = var_membrane__F;
00191         const double var_ionic_concentrations__Nao = 140.0;
00192         const double var_fast_sodium_current__Nao = var_ionic_concentrations__Nao;
00193         const double var_ionic_concentrations__Nai = 18.0;
00194         const double var_fast_sodium_current__Nai = var_ionic_concentrations__Nai;
00195         const double var_fast_sodium_current__T = var_membrane__T;
00196         const 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__Nao / var_fast_sodium_current__Nai);
00197         const 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);
00198         const double var_membrane__i_Na = var_fast_sodium_current__i_Na;
00199         const double var_slow_inward_current__d = var_slow_inward_current_d_gate__d;
00200         const double var_slow_inward_current__f = var_slow_inward_current_f_gate__f;
00201         const double var_slow_inward_current__V = var_membrane__V;
00202         const double var_slow_inward_current__Cai = var_intracellular_calcium_concentration__Cai;
00203         const double var_slow_inward_current__E_si = 7.7 - (13.0287 * log(var_slow_inward_current__Cai / 1.0));
00204         const double var_slow_inward_current__i_si = 0.09 * var_slow_inward_current__d * var_slow_inward_current__f * (var_slow_inward_current__V - var_slow_inward_current__E_si);
00205         const double var_membrane__i_si = var_slow_inward_current__i_si;
00206         const double var_time_dependent_potassium_current__V = var_membrane__V;
00207         const double var_time_dependent_potassium_current_Xi_gate__V = var_time_dependent_potassium_current__V;
00208         const double var_time_dependent_potassium_current_Xi_gate__Xi = (var_time_dependent_potassium_current_Xi_gate__V > (-100.0)) ? ((2.837 * (exp(0.04 * (var_time_dependent_potassium_current_Xi_gate__V + 77.0)) - 1.0)) / ((var_time_dependent_potassium_current_Xi_gate__V + 77.0) * exp(0.04 * (var_time_dependent_potassium_current_Xi_gate__V + 35.0)))) : 1.0;
00209         const double var_time_dependent_potassium_current__Xi = var_time_dependent_potassium_current_Xi_gate__Xi;
00210         const double var_ionic_concentrations__Ko = 5.4;
00211         const double var_time_dependent_potassium_current__Ko = var_ionic_concentrations__Ko;
00212         const double var_time_dependent_potassium_current__g_K = 0.282 * sqrt(var_time_dependent_potassium_current__Ko / 5.4);
00213         const double var_time_dependent_potassium_current__X = var_time_dependent_potassium_current_X_gate__X;
00214         const double var_time_dependent_potassium_current__PR_NaK = 0.01833;
00215         const double var_time_dependent_potassium_current__F = var_membrane__F;
00216         const double var_time_dependent_potassium_current__Nao = var_ionic_concentrations__Nao;
00217         const double var_ionic_concentrations__Ki = 145.0;
00218         const double var_time_dependent_potassium_current__Ki = var_ionic_concentrations__Ki;
00219         const double var_time_dependent_potassium_current__Nai = var_ionic_concentrations__Nai;
00220         const double var_time_dependent_potassium_current__T = var_membrane__T;
00221         const double var_time_dependent_potassium_current__R = var_membrane__R;
00222         const double var_time_dependent_potassium_current__E_K = ((var_time_dependent_potassium_current__R * var_time_dependent_potassium_current__T) / var_time_dependent_potassium_current__F) * log((var_time_dependent_potassium_current__Ko + (var_time_dependent_potassium_current__PR_NaK * var_time_dependent_potassium_current__Nao)) / (var_time_dependent_potassium_current__Ki + (var_time_dependent_potassium_current__PR_NaK * var_time_dependent_potassium_current__Nai)));
00223         const double var_time_dependent_potassium_current__i_K = var_time_dependent_potassium_current__g_K * var_time_dependent_potassium_current__X * var_time_dependent_potassium_current__Xi * (var_time_dependent_potassium_current__V - var_time_dependent_potassium_current__E_K);
00224         const double var_membrane__i_K = var_time_dependent_potassium_current__i_K;
00225         const double var_time_independent_potassium_current__V = var_membrane__V;
00226         const double var_time_independent_potassium_current_K1_gate__V = var_time_independent_potassium_current__V;
00227         const double var_time_independent_potassium_current__Ki = var_ionic_concentrations__Ki;
00228         const double var_time_independent_potassium_current__R = var_membrane__R;
00229         const double var_time_independent_potassium_current__F = var_membrane__F;
00230         const double var_time_independent_potassium_current__Ko = var_ionic_concentrations__Ko;
00231         const double var_time_independent_potassium_current__T = var_membrane__T;
00232         const double var_time_independent_potassium_current__E_K1 = ((var_time_independent_potassium_current__R * var_time_independent_potassium_current__T) / var_time_independent_potassium_current__F) * log(var_time_independent_potassium_current__Ko / var_time_independent_potassium_current__Ki);
00233         const double var_time_independent_potassium_current_K1_gate__E_K1 = var_time_independent_potassium_current__E_K1;
00234         const double var_time_independent_potassium_current_K1_gate__beta_K1 = ((0.49124 * exp(0.08032 * ((var_time_independent_potassium_current_K1_gate__V + 5.476) - var_time_independent_potassium_current_K1_gate__E_K1))) + (1.0 * exp(0.06175 * (var_time_independent_potassium_current_K1_gate__V - (var_time_independent_potassium_current_K1_gate__E_K1 + 594.31))))) / (1.0 + exp((-0.5143) * ((var_time_independent_potassium_current_K1_gate__V - var_time_independent_potassium_current_K1_gate__E_K1) + 4.753)));
00235         const double var_time_independent_potassium_current_K1_gate__alpha_K1 = 1.02 / (1.0 + exp(0.2385 * ((var_time_independent_potassium_current_K1_gate__V - var_time_independent_potassium_current_K1_gate__E_K1) - 59.215)));
00236         const double var_time_independent_potassium_current_K1_gate__K1_infinity = var_time_independent_potassium_current_K1_gate__alpha_K1 / (var_time_independent_potassium_current_K1_gate__alpha_K1 + var_time_independent_potassium_current_K1_gate__beta_K1);
00237         const double var_time_independent_potassium_current__K1_infinity = var_time_independent_potassium_current_K1_gate__K1_infinity;
00238         const double var_time_independent_potassium_current__g_K1 = 0.6047 * sqrt(var_time_independent_potassium_current__Ko / 5.4);
00239         const 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__V - var_time_independent_potassium_current__E_K1);
00240         const double var_membrane__i_K1 = var_time_independent_potassium_current__i_K1;
00241         const double var_plateau_potassium_current__g_Kp = 0.0183;
00242         const double var_plateau_potassium_current__V = var_membrane__V;
00243         const double var_plateau_potassium_current__Kp = 1.0 / (1.0 + exp((7.488 - var_plateau_potassium_current__V) / 5.98));
00244         const double var_plateau_potassium_current__E_K1 = var_time_independent_potassium_current__E_K1;
00245         const double var_plateau_potassium_current__E_Kp = var_plateau_potassium_current__E_K1;
00246         const double var_plateau_potassium_current__i_Kp = var_plateau_potassium_current__g_Kp * var_plateau_potassium_current__Kp * (var_plateau_potassium_current__V - var_plateau_potassium_current__E_Kp);
00247         const double var_membrane__i_Kp = var_plateau_potassium_current__i_Kp;
00248         const double var_background_current__E_b =  -59.87;
00249         const double var_background_current__g_b = 0.03921;
00250         const double var_background_current__V = var_membrane__V;
00251         const double var_background_current__i_b = var_background_current__g_b * (var_background_current__V - var_background_current__E_b);
00252         const double var_membrane__i_b = var_background_current__i_b;
00253         const double var_fast_sodium_current_m_gate__V = var_fast_sodium_current__V;
00254         const double var_fast_sodium_current_m_gate__alpha_m = (0.32 * (var_fast_sodium_current_m_gate__V + 47.13)) / (1.0 - exp((-0.1) * (var_fast_sodium_current_m_gate__V + 47.13)));
00255         const double var_fast_sodium_current_m_gate__beta_m = 0.08 * exp((-var_fast_sodium_current_m_gate__V) / 11.0);
00256         const double var_fast_sodium_current_h_gate__V = var_fast_sodium_current__V;
00257         const double var_fast_sodium_current_h_gate__alpha_h = (var_fast_sodium_current_h_gate__V < (-40.0)) ? (0.135 * exp((80.0 + var_fast_sodium_current_h_gate__V) / (-6.8))) : 0.0;
00258         const double var_fast_sodium_current_h_gate__beta_h = (var_fast_sodium_current_h_gate__V < (-40.0)) ? ((3.56 * exp(0.079 * var_fast_sodium_current_h_gate__V)) + (310000.0 * exp(0.35 * var_fast_sodium_current_h_gate__V))) : (1.0 / (0.13 * (1.0 + exp((var_fast_sodium_current_h_gate__V + 10.66) / (-11.1)))));
00259         const double var_fast_sodium_current_j_gate__V = var_fast_sodium_current__V;
00260         const double var_fast_sodium_current_j_gate__alpha_j = (var_fast_sodium_current_j_gate__V < (-40.0)) ? (((((-127140.0) * exp(0.2444 * var_fast_sodium_current_j_gate__V)) - (3.474e-05 * exp((-0.04391) * var_fast_sodium_current_j_gate__V))) * (var_fast_sodium_current_j_gate__V + 37.78)) / (1.0 + exp(0.311 * (var_fast_sodium_current_j_gate__V + 79.23)))) : 0.0;
00261         const double var_fast_sodium_current_j_gate__beta_j = (var_fast_sodium_current_j_gate__V < (-40.0)) ? ((0.1212 * exp((-0.01052) * var_fast_sodium_current_j_gate__V)) / (1.0 + exp((-0.1378) * (var_fast_sodium_current_j_gate__V + 40.14)))) : ((0.3 * exp((-2.535e-07) * var_fast_sodium_current_j_gate__V)) / (1.0 + exp((-0.1) * (var_fast_sodium_current_j_gate__V + 32.0))));
00262         const double var_slow_inward_current_d_gate__V = var_slow_inward_current__V;
00263         const double var_slow_inward_current_d_gate__alpha_d = (0.095 * exp((-0.01) * (var_slow_inward_current_d_gate__V - 5.0))) / (1.0 + exp((-0.072) * (var_slow_inward_current_d_gate__V - 5.0)));
00264         const double var_slow_inward_current_d_gate__beta_d = (0.07 * exp((-0.017) * (var_slow_inward_current_d_gate__V + 44.0))) / (1.0 + exp(0.05 * (var_slow_inward_current_d_gate__V + 44.0)));
00265         const double var_slow_inward_current_f_gate__V = var_slow_inward_current__V;
00266         const double var_slow_inward_current_f_gate__alpha_f = (0.012 * exp((-0.008) * (var_slow_inward_current_f_gate__V + 28.0))) / (1.0 + exp(0.15 * (var_slow_inward_current_f_gate__V + 28.0)));
00267         const double var_slow_inward_current_f_gate__beta_f = (0.0065 * exp((-0.02) * (var_slow_inward_current_f_gate__V + 30.0))) / (1.0 + exp((-0.2) * (var_slow_inward_current_f_gate__V + 30.0)));
00268         const double var_time_dependent_potassium_current_X_gate__V = var_time_dependent_potassium_current__V;
00269         const double var_time_dependent_potassium_current_X_gate__alpha_X = (0.0005 * exp(0.083 * (var_time_dependent_potassium_current_X_gate__V + 50.0))) / (1.0 + exp(0.057 * (var_time_dependent_potassium_current_X_gate__V + 50.0)));
00270         const double var_time_dependent_potassium_current_X_gate__beta_X = (0.0013 * exp((-0.06) * (var_time_dependent_potassium_current_X_gate__V + 20.0))) / (1.0 + exp((-0.04) * (var_time_dependent_potassium_current_X_gate__V + 20.0)));
00271         const double var_intracellular_calcium_concentration__i_si = var_slow_inward_current__i_si;
00272         
00273         double d_dt_membrane__V;
00274         if (mSetVoltageDerivativeToZero)
00275         {
00276             d_dt_membrane__V = 0.0;
00277         }
00278         else
00279         {
00280             d_dt_membrane__V = ((-1.0) / var_membrane__C) * (var_membrane__I_stim + var_membrane__i_Na + var_membrane__i_si + var_membrane__i_K + var_membrane__i_K1 + var_membrane__i_Kp + var_membrane__i_b);
00281         }
00282         
00283         const 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);
00284         const 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);
00285         const 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);
00286         const double d_dt_slow_inward_current_d_gate__d = (var_slow_inward_current_d_gate__alpha_d * (1.0 - var_slow_inward_current_d_gate__d)) - (var_slow_inward_current_d_gate__beta_d * var_slow_inward_current_d_gate__d);
00287         const double d_dt_slow_inward_current_f_gate__f = (var_slow_inward_current_f_gate__alpha_f * (1.0 - var_slow_inward_current_f_gate__f)) - (var_slow_inward_current_f_gate__beta_f * var_slow_inward_current_f_gate__f);
00288         const double d_dt_time_dependent_potassium_current_X_gate__X = (var_time_dependent_potassium_current_X_gate__alpha_X * (1.0 - var_time_dependent_potassium_current_X_gate__X)) - (var_time_dependent_potassium_current_X_gate__beta_X * var_time_dependent_potassium_current_X_gate__X);
00289         const double d_dt_intracellular_calcium_concentration__Cai = (((-0.0001) / 1.0) * var_intracellular_calcium_concentration__i_si) + (0.07 * (0.0001 - var_intracellular_calcium_concentration__Cai));
00290         
00291         rDY[0] = 1.0*d_dt_membrane__V;
00292         rDY[1] = 1.0*d_dt_fast_sodium_current_m_gate__m;
00293         rDY[2] = 1.0*d_dt_fast_sodium_current_h_gate__h;
00294         rDY[3] = 1.0*d_dt_fast_sodium_current_j_gate__j;
00295         rDY[4] = 1.0*d_dt_slow_inward_current_d_gate__d;
00296         rDY[5] = 1.0*d_dt_slow_inward_current_f_gate__f;
00297         rDY[6] = 1.0*d_dt_time_dependent_potassium_current_X_gate__X;
00298         rDY[7] = 1.0*d_dt_intracellular_calcium_concentration__Cai;
00299     }
00300     
00301 };
00302 
00303 
00304 template<>
00305 void OdeSystemInformation<Cellluo_rudy_1991FromCellML>::Initialise(void)
00306 {
00307     // Time units: millisecond
00308     // 
00309     this->mVariableNames.push_back("V");
00310     this->mVariableUnits.push_back("millivolt");
00311     this->mInitialConditions.push_back(-83.853);
00312 
00313     this->mVariableNames.push_back("m");
00314     this->mVariableUnits.push_back("dimensionless");
00315     this->mInitialConditions.push_back(0.00187018);
00316 
00317     this->mVariableNames.push_back("h");
00318     this->mVariableUnits.push_back("dimensionless");
00319     this->mInitialConditions.push_back(0.9804713);
00320 
00321     this->mVariableNames.push_back("j");
00322     this->mVariableUnits.push_back("dimensionless");
00323     this->mInitialConditions.push_back(0.98767124);
00324 
00325     this->mVariableNames.push_back("d");
00326     this->mVariableUnits.push_back("dimensionless");
00327     this->mInitialConditions.push_back(0.00316354);
00328 
00329     this->mVariableNames.push_back("f");
00330     this->mVariableUnits.push_back("dimensionless");
00331     this->mInitialConditions.push_back(0.99427859);
00332 
00333     this->mVariableNames.push_back("X");
00334     this->mVariableUnits.push_back("dimensionless");
00335     this->mInitialConditions.push_back(0.16647703);
00336 
00337     this->mVariableNames.push_back("Cai");
00338     this->mVariableUnits.push_back("millimolar");
00339     this->mInitialConditions.push_back(0.0002);
00340 
00341     this->mInitialised = true;
00342 }
00343 
00344 
00345 BOOST_CLASS_EXPORT(Cellluo_rudy_1991FromCellML)
00346 namespace boost
00347 {
00348     namespace serialization
00349     {
00350         template<class Archive>
00351         inline void save_construct_data(
00352             Archive & ar, const Cellluo_rudy_1991FromCellML * t, const unsigned int fileVersion)
00353         {
00354             const boost::shared_ptr<AbstractIvpOdeSolver> p_solver = t->GetSolver();
00355             const boost::shared_ptr<AbstractStimulusFunction> p_stimulus = t->GetStimulusFunction();
00356             ar << p_solver;
00357             ar << p_stimulus;
00358         }
00359         
00360         template<class Archive>
00361         inline void load_construct_data(
00362             Archive & ar, Cellluo_rudy_1991FromCellML * t, const unsigned int fileVersion)
00363         {
00364             boost::shared_ptr<AbstractIvpOdeSolver> p_solver;
00365             boost::shared_ptr<AbstractStimulusFunction> p_stimulus;
00366             ar >> p_solver;
00367             ar >> p_stimulus;
00368             ::new(t)Cellluo_rudy_1991FromCellML(p_solver, p_stimulus);
00369         }
00370         
00371     }
00372     
00373 }
00374 
00375 #endif

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