luo_rudy_1991Cvode.cpp

00001 #ifdef CHASTE_CVODE
00013 
00014 #include "luo_rudy_1991Cvode.hpp"
00015 #include <cmath>
00016 #include <cassert>
00017 #include "Exception.hpp"
00018 #include "OdeSystemInformation.hpp"
00019 
00020     Cellluo_rudy_1991FromCellMLCvode::Cellluo_rudy_1991FromCellMLCvode(boost::shared_ptr<AbstractIvpOdeSolver> pOdeSolver /* unused; should be empty */, boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus)
00021         : AbstractCvodeCell(
00022                 pOdeSolver,
00023                 8,
00024                 0,
00025                 pIntracellularStimulus)
00026     {
00027         // Time units: millisecond
00028         // 
00029         mpSystemInfo = OdeSystemInformation<Cellluo_rudy_1991FromCellMLCvode>::Instance();
00030         Init();
00031 
00032     }
00033     
00034     Cellluo_rudy_1991FromCellMLCvode::~Cellluo_rudy_1991FromCellMLCvode()
00035     {
00036     }
00037     
00038     void Cellluo_rudy_1991FromCellMLCvode::VerifyStateVariables()
00039     {}
00040 
00041     double Cellluo_rudy_1991FromCellMLCvode::GetIIonic()
00042     {
00043         N_Vector rY = rGetStateVariables();
00044         double var_membrane__V = NV_Ith_S(rY, 0);
00045         // Units: millivolt; Initial value: -83.853
00046         double var_fast_sodium_current_m_gate__m = NV_Ith_S(rY, 1);
00047         // Units: dimensionless; Initial value: 0.00187018
00048         double var_fast_sodium_current_h_gate__h = NV_Ith_S(rY, 2);
00049         // Units: dimensionless; Initial value: 0.9804713
00050         double var_fast_sodium_current_j_gate__j = NV_Ith_S(rY, 3);
00051         // Units: dimensionless; Initial value: 0.98767124
00052         double var_slow_inward_current_d_gate__d = NV_Ith_S(rY, 4);
00053         // Units: dimensionless; Initial value: 0.00316354
00054         double var_slow_inward_current_f_gate__f = NV_Ith_S(rY, 5);
00055         // Units: dimensionless; Initial value: 0.99427859
00056         double var_time_dependent_potassium_current_X_gate__X = NV_Ith_S(rY, 6);
00057         // Units: dimensionless; Initial value: 0.16647703
00058         double var_intracellular_calcium_concentration__Cai = NV_Ith_S(rY, 7);
00059         // Units: millimolar; Initial value: 0.0002
00060         
00061         const double var_membrane__R = 8314.0;
00062         const double var_membrane__T = 310.0;
00063         const double var_membrane__F = 96484.6;
00064         const double var_fast_sodium_current__j = var_fast_sodium_current_j_gate__j;
00065         const double var_fast_sodium_current__h = var_fast_sodium_current_h_gate__h;
00066         const double var_fast_sodium_current__g_Na = 23.0;
00067         const double var_fast_sodium_current__m = var_fast_sodium_current_m_gate__m;
00068         const double var_fast_sodium_current__V = var_membrane__V;
00069         const double var_fast_sodium_current__R = var_membrane__R;
00070         const double var_fast_sodium_current__F = var_membrane__F;
00071         const double var_ionic_concentrations__Nao = 140.0;
00072         const double var_fast_sodium_current__Nao = var_ionic_concentrations__Nao;
00073         const double var_ionic_concentrations__Nai = 18.0;
00074         const double var_fast_sodium_current__Nai = var_ionic_concentrations__Nai;
00075         const double var_fast_sodium_current__T = var_membrane__T;
00076         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);
00077         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);
00078         const double var_membrane__i_Na = var_fast_sodium_current__i_Na;
00079         const double var_slow_inward_current__d = var_slow_inward_current_d_gate__d;
00080         const double var_slow_inward_current__f = var_slow_inward_current_f_gate__f;
00081         const double var_slow_inward_current__V = var_membrane__V;
00082         const double var_slow_inward_current__Cai = var_intracellular_calcium_concentration__Cai;
00083         const double var_slow_inward_current__E_si = 7.7 - (13.0287 * log(var_slow_inward_current__Cai / 1.0));
00084         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);
00085         const double var_membrane__i_si = var_slow_inward_current__i_si;
00086         const double var_time_dependent_potassium_current__V = var_membrane__V;
00087         const double var_time_dependent_potassium_current_Xi_gate__V = var_time_dependent_potassium_current__V;
00088         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;
00089         const double var_time_dependent_potassium_current__Xi = var_time_dependent_potassium_current_Xi_gate__Xi;
00090         const double var_ionic_concentrations__Ko = 5.4;
00091         const double var_time_dependent_potassium_current__Ko = var_ionic_concentrations__Ko;
00092         const double var_time_dependent_potassium_current__g_K = 0.282 * sqrt(var_time_dependent_potassium_current__Ko / 5.4);
00093         const double var_time_dependent_potassium_current__X = var_time_dependent_potassium_current_X_gate__X;
00094         const double var_time_dependent_potassium_current__PR_NaK = 0.01833;
00095         const double var_time_dependent_potassium_current__F = var_membrane__F;
00096         const double var_time_dependent_potassium_current__Nao = var_ionic_concentrations__Nao;
00097         const double var_ionic_concentrations__Ki = 145.0;
00098         const double var_time_dependent_potassium_current__Ki = var_ionic_concentrations__Ki;
00099         const double var_time_dependent_potassium_current__Nai = var_ionic_concentrations__Nai;
00100         const double var_time_dependent_potassium_current__T = var_membrane__T;
00101         const double var_time_dependent_potassium_current__R = var_membrane__R;
00102         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)));
00103         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);
00104         const double var_membrane__i_K = var_time_dependent_potassium_current__i_K;
00105         const double var_time_independent_potassium_current__V = var_membrane__V;
00106         const double var_time_independent_potassium_current_K1_gate__V = var_time_independent_potassium_current__V;
00107         const double var_time_independent_potassium_current__Ki = var_ionic_concentrations__Ki;
00108         const double var_time_independent_potassium_current__R = var_membrane__R;
00109         const double var_time_independent_potassium_current__F = var_membrane__F;
00110         const double var_time_independent_potassium_current__Ko = var_ionic_concentrations__Ko;
00111         const double var_time_independent_potassium_current__T = var_membrane__T;
00112         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);
00113         const double var_time_independent_potassium_current_K1_gate__E_K1 = var_time_independent_potassium_current__E_K1;
00114         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)));
00115         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)));
00116         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);
00117         const double var_time_independent_potassium_current__K1_infinity = var_time_independent_potassium_current_K1_gate__K1_infinity;
00118         const double var_time_independent_potassium_current__g_K1 = 0.6047 * sqrt(var_time_independent_potassium_current__Ko / 5.4);
00119         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);
00120         const double var_membrane__i_K1 = var_time_independent_potassium_current__i_K1;
00121         const double var_plateau_potassium_current__g_Kp = 0.0183;
00122         const double var_plateau_potassium_current__V = var_membrane__V;
00123         const double var_plateau_potassium_current__Kp = 1.0 / (1.0 + exp((7.488 - var_plateau_potassium_current__V) / 5.98));
00124         const double var_plateau_potassium_current__E_K1 = var_time_independent_potassium_current__E_K1;
00125         const double var_plateau_potassium_current__E_Kp = var_plateau_potassium_current__E_K1;
00126         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);
00127         const double var_membrane__i_Kp = var_plateau_potassium_current__i_Kp;
00128         const double var_background_current__E_b =  -59.87;
00129         const double var_background_current__g_b = 0.03921;
00130         const double var_background_current__V = var_membrane__V;
00131         const double var_background_current__i_b = var_background_current__g_b * (var_background_current__V - var_background_current__E_b);
00132         const double var_membrane__i_b = var_background_current__i_b;
00133         
00134         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);
00135     }
00136     
00137     void Cellluo_rudy_1991FromCellMLCvode::EvaluateRhs(double var_environment__time, const N_Vector rY, N_Vector rDY)
00138     {
00139         // Inputs:
00140         // Time units: millisecond
00141         var_environment__time *= 1.0;
00142         double var_membrane__V = NV_Ith_S(rY, 0);
00143         // Units: millivolt; Initial value: -83.853
00144         double var_fast_sodium_current_m_gate__m = NV_Ith_S(rY, 1);
00145         // Units: dimensionless; Initial value: 0.00187018
00146         double var_fast_sodium_current_h_gate__h = NV_Ith_S(rY, 2);
00147         // Units: dimensionless; Initial value: 0.9804713
00148         double var_fast_sodium_current_j_gate__j = NV_Ith_S(rY, 3);
00149         // Units: dimensionless; Initial value: 0.98767124
00150         double var_slow_inward_current_d_gate__d = NV_Ith_S(rY, 4);
00151         // Units: dimensionless; Initial value: 0.00316354
00152         double var_slow_inward_current_f_gate__f = NV_Ith_S(rY, 5);
00153         // Units: dimensionless; Initial value: 0.99427859
00154         double var_time_dependent_potassium_current_X_gate__X = NV_Ith_S(rY, 6);
00155         // Units: dimensionless; Initial value: 0.16647703
00156         double var_intracellular_calcium_concentration__Cai = NV_Ith_S(rY, 7);
00157         // Units: millimolar; Initial value: 0.0002
00158         
00159         
00160         // Mathematics
00161         const double var_membrane__R = 8314.0;
00162         const double var_membrane__T = 310.0;
00163         const double var_membrane__F = 96484.6;
00164         const double var_membrane__C = 1.0;
00165         const double var_membrane__I_stim = GetStimulus((1.0/1)*var_environment__time);
00166         const double var_fast_sodium_current__j = var_fast_sodium_current_j_gate__j;
00167         const double var_fast_sodium_current__h = var_fast_sodium_current_h_gate__h;
00168         const double var_fast_sodium_current__g_Na = 23.0;
00169         const double var_fast_sodium_current__m = var_fast_sodium_current_m_gate__m;
00170         const double var_fast_sodium_current__V = var_membrane__V;
00171         const double var_fast_sodium_current__R = var_membrane__R;
00172         const double var_fast_sodium_current__F = var_membrane__F;
00173         const double var_ionic_concentrations__Nao = 140.0;
00174         const double var_fast_sodium_current__Nao = var_ionic_concentrations__Nao;
00175         const double var_ionic_concentrations__Nai = 18.0;
00176         const double var_fast_sodium_current__Nai = var_ionic_concentrations__Nai;
00177         const double var_fast_sodium_current__T = var_membrane__T;
00178         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);
00179         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);
00180         const double var_membrane__i_Na = var_fast_sodium_current__i_Na;
00181         const double var_slow_inward_current__d = var_slow_inward_current_d_gate__d;
00182         const double var_slow_inward_current__f = var_slow_inward_current_f_gate__f;
00183         const double var_slow_inward_current__V = var_membrane__V;
00184         const double var_slow_inward_current__Cai = var_intracellular_calcium_concentration__Cai;
00185         const double var_slow_inward_current__E_si = 7.7 - (13.0287 * log(var_slow_inward_current__Cai / 1.0));
00186         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);
00187         const double var_membrane__i_si = var_slow_inward_current__i_si;
00188         const double var_time_dependent_potassium_current__V = var_membrane__V;
00189         const double var_time_dependent_potassium_current_Xi_gate__V = var_time_dependent_potassium_current__V;
00190         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;
00191         const double var_time_dependent_potassium_current__Xi = var_time_dependent_potassium_current_Xi_gate__Xi;
00192         const double var_ionic_concentrations__Ko = 5.4;
00193         const double var_time_dependent_potassium_current__Ko = var_ionic_concentrations__Ko;
00194         const double var_time_dependent_potassium_current__g_K = 0.282 * sqrt(var_time_dependent_potassium_current__Ko / 5.4);
00195         const double var_time_dependent_potassium_current__X = var_time_dependent_potassium_current_X_gate__X;
00196         const double var_time_dependent_potassium_current__PR_NaK = 0.01833;
00197         const double var_time_dependent_potassium_current__F = var_membrane__F;
00198         const double var_time_dependent_potassium_current__Nao = var_ionic_concentrations__Nao;
00199         const double var_ionic_concentrations__Ki = 145.0;
00200         const double var_time_dependent_potassium_current__Ki = var_ionic_concentrations__Ki;
00201         const double var_time_dependent_potassium_current__Nai = var_ionic_concentrations__Nai;
00202         const double var_time_dependent_potassium_current__T = var_membrane__T;
00203         const double var_time_dependent_potassium_current__R = var_membrane__R;
00204         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)));
00205         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);
00206         const double var_membrane__i_K = var_time_dependent_potassium_current__i_K;
00207         const double var_time_independent_potassium_current__V = var_membrane__V;
00208         const double var_time_independent_potassium_current_K1_gate__V = var_time_independent_potassium_current__V;
00209         const double var_time_independent_potassium_current__Ki = var_ionic_concentrations__Ki;
00210         const double var_time_independent_potassium_current__R = var_membrane__R;
00211         const double var_time_independent_potassium_current__F = var_membrane__F;
00212         const double var_time_independent_potassium_current__Ko = var_ionic_concentrations__Ko;
00213         const double var_time_independent_potassium_current__T = var_membrane__T;
00214         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);
00215         const double var_time_independent_potassium_current_K1_gate__E_K1 = var_time_independent_potassium_current__E_K1;
00216         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)));
00217         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)));
00218         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);
00219         const double var_time_independent_potassium_current__K1_infinity = var_time_independent_potassium_current_K1_gate__K1_infinity;
00220         const double var_time_independent_potassium_current__g_K1 = 0.6047 * sqrt(var_time_independent_potassium_current__Ko / 5.4);
00221         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);
00222         const double var_membrane__i_K1 = var_time_independent_potassium_current__i_K1;
00223         const double var_plateau_potassium_current__g_Kp = 0.0183;
00224         const double var_plateau_potassium_current__V = var_membrane__V;
00225         const double var_plateau_potassium_current__Kp = 1.0 / (1.0 + exp((7.488 - var_plateau_potassium_current__V) / 5.98));
00226         const double var_plateau_potassium_current__E_K1 = var_time_independent_potassium_current__E_K1;
00227         const double var_plateau_potassium_current__E_Kp = var_plateau_potassium_current__E_K1;
00228         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);
00229         const double var_membrane__i_Kp = var_plateau_potassium_current__i_Kp;
00230         const double var_background_current__E_b =  -59.87;
00231         const double var_background_current__g_b = 0.03921;
00232         const double var_background_current__V = var_membrane__V;
00233         const double var_background_current__i_b = var_background_current__g_b * (var_background_current__V - var_background_current__E_b);
00234         const double var_membrane__i_b = var_background_current__i_b;
00235         const double var_fast_sodium_current_m_gate__V = var_fast_sodium_current__V;
00236         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)));
00237         const double var_fast_sodium_current_m_gate__beta_m = 0.08 * exp((-var_fast_sodium_current_m_gate__V) / 11.0);
00238         const double var_fast_sodium_current_h_gate__V = var_fast_sodium_current__V;
00239         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;
00240         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)))));
00241         const double var_fast_sodium_current_j_gate__V = var_fast_sodium_current__V;
00242         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;
00243         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))));
00244         const double var_slow_inward_current_d_gate__V = var_slow_inward_current__V;
00245         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)));
00246         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)));
00247         const double var_slow_inward_current_f_gate__V = var_slow_inward_current__V;
00248         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)));
00249         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)));
00250         const double var_time_dependent_potassium_current_X_gate__V = var_time_dependent_potassium_current__V;
00251         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)));
00252         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)));
00253         const double var_intracellular_calcium_concentration__i_si = var_slow_inward_current__i_si;
00254         
00255         double d_dt_membrane__V;
00256         if (mSetVoltageDerivativeToZero)
00257         {
00258             d_dt_membrane__V = 0.0;
00259         }
00260         else
00261         {
00262             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);
00263         }
00264         
00265         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);
00266         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);
00267         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);
00268         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);
00269         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);
00270         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);
00271         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));
00272         
00273         NV_Ith_S(rDY, 0) = 1.0*d_dt_membrane__V;
00274         NV_Ith_S(rDY, 1) = 1.0*d_dt_fast_sodium_current_m_gate__m;
00275         NV_Ith_S(rDY, 2) = 1.0*d_dt_fast_sodium_current_h_gate__h;
00276         NV_Ith_S(rDY, 3) = 1.0*d_dt_fast_sodium_current_j_gate__j;
00277         NV_Ith_S(rDY, 4) = 1.0*d_dt_slow_inward_current_d_gate__d;
00278         NV_Ith_S(rDY, 5) = 1.0*d_dt_slow_inward_current_f_gate__f;
00279         NV_Ith_S(rDY, 6) = 1.0*d_dt_time_dependent_potassium_current_X_gate__X;
00280         NV_Ith_S(rDY, 7) = 1.0*d_dt_intracellular_calcium_concentration__Cai;
00281     }
00282     
00283 template<>
00284 void OdeSystemInformation<Cellluo_rudy_1991FromCellMLCvode>::Initialise(void)
00285 {
00286     // Time units: millisecond
00287     // 
00288     this->mVariableNames.push_back("V");
00289     this->mVariableUnits.push_back("millivolt");
00290     this->mInitialConditions.push_back(-83.853);
00291 
00292     this->mVariableNames.push_back("m");
00293     this->mVariableUnits.push_back("dimensionless");
00294     this->mInitialConditions.push_back(0.00187018);
00295 
00296     this->mVariableNames.push_back("h");
00297     this->mVariableUnits.push_back("dimensionless");
00298     this->mInitialConditions.push_back(0.9804713);
00299 
00300     this->mVariableNames.push_back("j");
00301     this->mVariableUnits.push_back("dimensionless");
00302     this->mInitialConditions.push_back(0.98767124);
00303 
00304     this->mVariableNames.push_back("d");
00305     this->mVariableUnits.push_back("dimensionless");
00306     this->mInitialConditions.push_back(0.00316354);
00307 
00308     this->mVariableNames.push_back("f");
00309     this->mVariableUnits.push_back("dimensionless");
00310     this->mInitialConditions.push_back(0.99427859);
00311 
00312     this->mVariableNames.push_back("X");
00313     this->mVariableUnits.push_back("dimensionless");
00314     this->mInitialConditions.push_back(0.16647703);
00315 
00316     this->mVariableNames.push_back("Cai");
00317     this->mVariableUnits.push_back("millimolar");
00318     this->mInitialConditions.push_back(0.0002);
00319 
00320     this->mInitialised = true;
00321 }
00322 
00323 
00324 #endif // CHASTE_CVODE

Generated by  doxygen 1.6.2