46     std::string CourtemancheRamirezNattel98::className
 
   48                         "CourtemancheRamirezNattel98",
 
   49                         CourtemancheRamirezNattel98::create,
 
   50                          "Ionic model of human atrial cell electrophysiology.");
 
   53     std::string CourtemancheRamirezNattel98::lookupIds[2] = {
 
   54             LibUtilities::SessionReader::RegisterEnumValue(
"CellModelVariant",
 
   55                     "Original", CourtemancheRamirezNattel98::eOriginal),
 
   56             LibUtilities::SessionReader::RegisterEnumValue(
"CellModelVariant",
 
   57                     "AF", CourtemancheRamirezNattel98::eAF)
 
   61     std::string CourtemancheRamirezNattel98::def =
 
   62             LibUtilities::SessionReader::RegisterDefaultSolverInfo(
 
   63                     "CellModelVariant", 
"Original");
 
   68     CourtemancheRamirezNattel98::CourtemancheRamirezNattel98(
 
  171         ASSERTL0(inarray.get() != outarray.get(),
 
  172                 "Must have different arrays for input and output.");
 
  212         Vmath::Vsub(n, inarray[0], 1, tmp_E_na, 1, tmp_I_Na, 1);
 
  213         Vmath::Vmul(n, inarray[1], 1, tmp_I_Na, 1, tmp_I_Na, 1);
 
  214         Vmath::Vmul(n, inarray[1], 1, tmp_I_Na, 1, tmp_I_Na, 1);
 
  215         Vmath::Vmul(n, inarray[1], 1, tmp_I_Na, 1, tmp_I_Na, 1);
 
  216         Vmath::Vmul(n, inarray[2], 1, tmp_I_Na, 1, tmp_I_Na, 1);
 
  217         Vmath::Vmul(n, inarray[3], 1, tmp_I_Na, 1, tmp_I_Na, 1);
 
  219         Vmath::Vsub(n, outarray[0], 1, tmp_I_Na, 1, outarray[0], 1);
 
  220         Vmath::Smul(n, -1.0, tmp_I_Na, 1, outarray[16], 1);
 
  224         Vmath::Vsub(n, inarray[0], 1, tmp_E_na, 1, tmp_I_b_Na, 1);
 
  226         Vmath::Vsub(n, outarray[0], 1, tmp_I_b_Na, 1, outarray[0], 1);
 
  227         Vmath::Vsub(n, outarray[16], 1, tmp_I_b_Na, 1, outarray[16], 1);
 
  234         Vmath::Vsub(n, inarray[0], 1, tmp_V_E_k, 1, tmp_V_E_k, 1);
 
  242         Vmath::Vdiv(n, tmp_V_E_k, 1, tmp_I_K1, 1, tmp_I_K1, 1);
 
  244         Vmath::Vsub(n, outarray[0], 1, tmp_I_K1, 1, outarray[0], 1);
 
  245         Vmath::Smul(n, -1.0, tmp_I_K1, 1, outarray[18], 1);
 
  249         Vmath::Vmul(n, inarray[5], 1, tmp_V_E_k, 1, tmp_I_to, 1);
 
  250         Vmath::Vmul(n, inarray[4], 1, tmp_I_to, 1, tmp_I_to, 1);
 
  251         Vmath::Vmul(n, inarray[4], 1, tmp_I_to, 1, tmp_I_to, 1);
 
  252         Vmath::Vmul(n, inarray[4], 1, tmp_I_to, 1, tmp_I_to, 1);
 
  254         Vmath::Vsub(n, outarray[0], 1, tmp_I_to, 1, outarray[0], 1);
 
  255         Vmath::Vsub(n, outarray[18], 1, tmp_I_to, 1, outarray[18], 1);
 
  259         Vmath::Sadd(n, -15.0, inarray[0], 1, tmp_I_kur, 1);
 
  260         Vmath::Smul(n, -1.0/13.0, tmp_I_kur, 1, tmp_I_kur, 1);
 
  265         Vmath::Vmul(n, tmp_V_E_k,  1, tmp_I_kur, 1, tmp_I_kur, 1);
 
  266         Vmath::Vmul(n, inarray[6], 1, tmp_I_kur, 1, tmp_I_kur, 1);
 
  267         Vmath::Vmul(n, inarray[6], 1, tmp_I_kur, 1, tmp_I_kur, 1);
 
  268         Vmath::Vmul(n, inarray[6], 1, tmp_I_kur, 1, tmp_I_kur, 1);
 
  269         Vmath::Vmul(n, inarray[7], 1, tmp_I_kur, 1, tmp_I_kur, 1);
 
  271         Vmath::Vsub(n, outarray[0], 1, tmp_I_kur, 1, outarray[0], 1);
 
  272         Vmath::Vsub(n, outarray[18], 1, tmp_I_kur, 1, outarray[18], 1);
 
  277         Vmath::Smul(n, 1.0/22.4, tmp_I_Kr, 1, tmp_I_Kr, 1);
 
  280         Vmath::Vdiv(n, tmp_V_E_k, 1, tmp_I_Kr, 1, tmp_I_Kr, 1);
 
  281         Vmath::Vmul(n, inarray[8], 1, tmp_I_Kr, 1, tmp_I_Kr, 1);
 
  283         Vmath::Vsub(n, outarray[0], 1, tmp_I_Kr, 1, outarray[0], 1);
 
  284         Vmath::Vsub(n, outarray[18], 1, tmp_I_Kr, 1, outarray[18], 1);
 
  288         Vmath::Vmul(n, inarray[9], 1, tmp_V_E_k, 1, tmp_I_Ks, 1);
 
  289         Vmath::Vmul(n, inarray[9], 1, tmp_I_Ks, 1, tmp_I_Ks, 1);
 
  291         Vmath::Vsub(n, outarray[0], 1, tmp_I_Ks, 1, outarray[0], 1);
 
  292         Vmath::Vsub(n, outarray[18], 1, tmp_I_Ks, 1, outarray[18], 1);
 
  299         Vmath::Vsub(n, inarray[0], 1, tmp_I_b_Ca, 1, tmp_I_b_Ca, 1);
 
  301         Vmath::Vsub(n, outarray[0], 1, tmp_I_b_Ca, 1, outarray[0], 1);
 
  305         Vmath::Sadd(n, -65.0, inarray[0], 1, tmp_I_Ca_L, 1);
 
  306         Vmath::Vmul(n, inarray[10], 1, tmp_I_Ca_L, 1, tmp_I_Ca_L, 1);
 
  307         Vmath::Vmul(n, inarray[11], 1, tmp_I_Ca_L, 1, tmp_I_Ca_L, 1);
 
  308         Vmath::Vmul(n, inarray[12], 1, tmp_I_Ca_L, 1, tmp_I_Ca_L, 1);
 
  310         Vmath::Vsub(n, outarray[0], 1, tmp_I_Ca_L, 1, outarray[0], 1);
 
  319         Vmath::Smul(n, 0.1245, tmp_f_Na_k, 1, tmp_f_Na_k, 1);
 
  320         Vmath::Vadd(n, tmp_f_Na_k, 1, tmp, 1, tmp_f_Na_k, 1);
 
  327         Vmath::Vmul(n, tmp_f_Na_k, 1, tmp_I_Na_K, 1, tmp_I_Na_K, 1);
 
  329         Vmath::Vsub(n, outarray[0], 1, tmp_I_Na_K, 1, outarray[0], 1);
 
  330         Vmath::Svtvp(n, -3.0, tmp_I_Na_K, 1, outarray[16], 1, outarray[16], 1);
 
  331         Vmath::Svtvp(n, 2.0, tmp_I_Na_K, 1, outarray[18], 1, outarray[18], 1);
 
  338         Vmath::Sadd(n, 1.0, tmp_I_Na_Ca, 1, tmp_I_Na_Ca, 1);
 
  350         Vmath::Vdiv(n, tmp, 1, tmp_I_Na_Ca, 1, tmp_I_Na_Ca, 1);
 
  351         Vmath::Vsub(n, outarray[0], 1, tmp_I_Na_Ca, 1, outarray[0], 1);
 
  352         Vmath::Svtvp(n, -3.0, tmp_I_Na_Ca, 1, outarray[16], 1, outarray[16], 1);
 
  356         Vmath::Sadd(n, 0.0005, inarray[17], 1, tmp_I_p_Ca, 1);
 
  357         Vmath::Vdiv(n, inarray[17], 1, tmp_I_p_Ca, 1, tmp_I_p_Ca, 1);
 
  359         Vmath::Vsub(n, outarray[0], 1, tmp_I_p_Ca, 1, outarray[0], 1);
 
  370         Vmath::Vsub(n, inarray[20], 1, inarray[19], 1, tmp_I_tr, 1);
 
  385         Vmath::Vsub(n, inarray[19], 1, inarray[17], 1, tmp_I_rel, 1);
 
  386         Vmath::Vmul(n, tmp_I_rel, 1, inarray[13], 1, tmp_I_rel, 1);
 
  387         Vmath::Vmul(n, tmp_I_rel, 1, inarray[13], 1, tmp_I_rel, 1);
 
  388         Vmath::Vmul(n, tmp_I_rel, 1, inarray[14], 1, tmp_I_rel, 1);
 
  389         Vmath::Vmul(n, tmp_I_rel, 1, inarray[15], 1, tmp_I_rel, 1);
 
  394         Vmath::Svtvm(n, 2.0, tmp_I_Na_Ca, 1, tmp_I_p_Ca, 1, tmp_B1, 1);
 
  395         Vmath::Vsub(n, tmp_B1, 1, tmp_I_Ca_L, 1, tmp_B1, 1);
 
  396         Vmath::Vsub(n, tmp_B1, 1, tmp_I_b_Ca, 1, tmp_B1, 1);
 
  415         Vmath::Vdiv(n, tmp_B1, 1, tmp_B2, 1, outarray[17], 1);
 
  418         Vmath::Vsub(n, tmp_I_up, 1, tmp_I_up_leak, 1, outarray[20], 1);
 
  424         Vmath::Vmul(n, outarray[19], 1, outarray[19], 1, outarray[19], 1);
 
  426         Vmath::Sadd(n, 1.0, outarray[19], 1, outarray[19], 1);
 
  427         Vmath::Vdiv(n, tmp, 1, outarray[19], 1, outarray[19], 1);
 
  435         for (i = 0, v = &inarray[0][0], x = &inarray[1][0], x_new = &outarray[1][0], x_tau = &
m_gates_tau[0][0];
 
  436                 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
 
  438             alpha = (*v == (-47.13)) ? 3.2 : (0.32*(*v+47.13))/(1.0-exp((-0.1)*(*v + 47.13)));
 
  439             beta  = 0.08*exp(-(*v)/11.0);
 
  440             *x_tau = 1.0/(alpha + beta);
 
  441             *x_new = alpha*(*x_tau);
 
  444         for (i = 0, v = &inarray[0][0], x = &inarray[2][0], x_new = &outarray[2][0], x_tau = &
m_gates_tau[1][0];
 
  445                 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
 
  447             alpha = (*v >= -40.0) ? 0.0 : 0.135*exp(-((*v)+80.0)/6.8);
 
  448             beta  = (*v >= -40.0) ? 1.0/(0.13*(1.0+exp(-(*v + 10.66)/11.1)))
 
  449                     : 3.56*exp(0.079*(*v))+310000.0*exp(0.35*(*v));
 
  450             *x_tau = 1.0/(alpha + beta);
 
  451             *x_new = alpha*(*x_tau);
 
  454         for (i = 0, v = &inarray[0][0], x = &inarray[3][0], x_new = &outarray[3][0], x_tau = &
m_gates_tau[2][0];
 
  455                 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
 
  457             alpha = (*v >= -40.0) ? 0.0
 
  458                     : (-127140.0*exp(0.2444*(*v))-3.474e-05*exp(-0.04391*(*v)))*(((*v)+37.78)/(1.0+exp(0.311*((*v)+79.23))));
 
  459             beta  = (*v >= -40.0) ? (0.3*exp(-2.535e-07*(*v))/(1.0+exp(-0.1*(*v+32.0))))
 
  460                     : 0.1212*exp(-0.01052*(*v))/(1.0+exp(-0.1378*(*v+40.14)));
 
  461             *x_tau = 1.0/(alpha + beta);
 
  462             *x_new = alpha*(*x_tau);
 
  465         for (i = 0, v = &inarray[0][0], x = &inarray[4][0], x_new = &outarray[4][0], x_tau = &
m_gates_tau[3][0];
 
  466                 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
 
  468             alpha = 0.65/(exp(-(*v+10.0)/8.5) + exp(-(*v-30.0)/59.0));
 
  469             beta  = 0.65/(2.5 + exp((*v+82.0)/17.0));
 
  470             *x_tau = 1.0/
K_Q10/(alpha + beta);
 
  471             *x_new = (1.0/(1.0+exp(-(*v+20.47)/17.54)));
 
  474         for (i = 0, v = &inarray[0][0], x = &inarray[5][0], x_new = &outarray[5][0], x_tau = &
m_gates_tau[4][0];
 
  475                 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
 
  477             alpha = 1.0/(18.53 + exp((*v+113.7)/10.95));
 
  478             beta  = 1.0/(35.56 + exp(-(*v+1.26)/7.44));
 
  479             *x_tau = 1.0/
K_Q10/(alpha + beta);
 
  480             *x_new = (1.0/(1.0+exp((*v+43.1)/5.3)));
 
  483         for (i = 0, v = &inarray[0][0], x = &inarray[6][0], x_new = &outarray[6][0], x_tau = &
m_gates_tau[5][0];
 
  484                 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
 
  486             alpha = 0.65/(exp(-(*v+10.0)/8.5)+exp(-(*v-30.0)/59.0));
 
  487             beta  = 0.65/(2.5+exp((*v+82.0)/17.0));
 
  488             *x_tau = 1.0/
K_Q10/(alpha + beta);
 
  489             *x_new = 1.0/(1.0+exp(-(*v+30.3)/9.6));
 
  492         for (i = 0, v = &inarray[0][0], x = &inarray[7][0], x_new = &outarray[7][0], x_tau = &
m_gates_tau[6][0];
 
  493                 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
 
  495             alpha = 1.0/(21.0 + exp(-(*v-185.0)/28.0));
 
  496             beta  = exp((*v-158.0)/16.0);
 
  497             *x_tau = 1.0/
K_Q10/(alpha + beta);
 
  498             *x_new = 1.0/(1.0+exp((*v-99.45)/27.48));
 
  501         for (i = 0, v = &inarray[0][0], x = &inarray[8][0], x_new = &outarray[8][0], x_tau = &
m_gates_tau[7][0];
 
  502                 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
 
  504             alpha = 0.0003*(*v+14.1)/(1-exp(-(*v+14.1)/5.0));
 
  505             beta  = 7.3898e-5*(*v-3.3328)/(exp((*v-3.3328)/5.1237)-1.0);
 
  506             *x_tau = 1.0/(alpha + beta);
 
  507             *x_new = 1.0/(1+exp(-(*v+14.1)/6.5));
 
  510         for (i = 0, v = &inarray[0][0], x = &inarray[9][0], x_new = &outarray[9][0], x_tau = &
m_gates_tau[8][0];
 
  511                 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
 
  513             alpha = 4e-5*(*v-19.9)/(1.0-exp(-(*v-19.9)/17.0));
 
  514             beta  = 3.5e-5*(*v-19.9)/(exp((*v-19.9)/9.0)-1.0);
 
  515             *x_tau = 0.5/(alpha + beta);
 
  516             *x_new = 1.0/sqrt(1.0+exp(-(*v-19.9)/12.7));
 
  519         for (i = 0, v = &inarray[0][0], x = &inarray[10][0], x_new = &outarray[10][0], x_tau = &
m_gates_tau[9][0];
 
  520                 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
 
  522             *x_tau  = (1-exp(-(*v+10.0)/6.24))/(0.035*(*v+10.0)*(1+exp(-(*v+10.0)/6.24)));
 
  523             *x_new = 1.0/(1.0 + exp(-(*v+10)/8.0));
 
  526         for (i = 0, v = &inarray[0][0], x = &inarray[11][0], x_new = &outarray[11][0], x_tau = &
m_gates_tau[10][0];
 
  527                 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
 
  530             *x_tau  = 9.0/(0.0197*exp(-0.0337*0.0337*(*v+10.0)*(*v+10.0))+0.02);
 
  531             *x_new = exp((-(*v + 28.0)) / 6.9) / (1.0 + exp((-(*v + 28.0)) / 6.9));
 
  534         for (i = 0, v = &inarray[0][0], x = &inarray[12][0], x_new = &outarray[12][0], x_tau = &
m_gates_tau[11][0];
 
  535                 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
 
  538             *x_new = 1.0/(1.0+inarray[17][i]/0.00035);
 
  542         Vmath::Svtsvtp(n, 0.5*5e-13/
F, tmp_I_Ca_L, 1, -0.2*5e-13/
F, tmp_I_Na_Ca, 1, tmp_Fn, 1);
 
  546         for (i = 0, v = &tmp_Fn[0], x = &inarray[13][0], x_new = &outarray[13][0], x_tau = &
m_gates_tau[12][0];
 
  547                 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
 
  550             *x_new = 1.0/(1.0 + exp(-(*v - 3.4175e-13)/1.367e-15));
 
  553         for (i = 0, v = &tmp_Fn[0], x = &inarray[14][0], x_new = &outarray[14][0], x_tau = &
m_gates_tau[13][0];
 
  554                 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
 
  556             *x_tau  = 1.91 + 2.09/(1.0+exp(-(*v - 3.4175e-13)/13.67e-16));
 
  557             *x_new = 1.0 - 1.0/(1.0 + exp(-(*v - 6.835e-14)/13.67e-16));
 
  560         for (i = 0, v = &inarray[0][0], x = &inarray[15][0], x_new = &outarray[15][0], x_tau = &
m_gates_tau[14][0];
 
  561                 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
 
  563             *x_tau  = 6.0*(1.0-exp(-(*v-7.9)/5.0))/(1.0+0.3*exp(-(*v-7.9)/5.0))/(*v-7.9);
 
  564             *x_new = 1.0 - 1.0/(1.0 + exp(-(*v - 40.0)/17.0));
 
  613             case 4:  
return "o_a";
 
  614             case 5:  
return "o_i";
 
  615             case 6:  
return "u_a";
 
  616             case 7:  
return "u_i";
 
  617             case 8:  
return "x_r";
 
  618             case 9: 
return "x_s";
 
  621             case 12: 
return "f_Ca";
 
  625             case 16: 
return "Na_i";
 
  626             case 17: 
return "Ca_i";
 
  627             case 18: 
return "K_i";
 
  628             case 19: 
return "Ca_rel";
 
  629             case 20: 
return "Ca_up";
 
  630             default: 
return "unknown";
 
#define ASSERTL0(condition, msg)
 
void Vpow(int n, const T *x, const int incx, const T f, T *y, const int incy)
 
int m_nq
Number of physical points. 
 
std::vector< std::pair< std::string, std::string > > SummaryList
 
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value. 
 
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y 
 
virtual void v_SetInitialConditions()
 
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/y. 
 
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y. 
 
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
 
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y. 
 
std::vector< int > m_concentrations
Indices of cell model variables which are concentrations. 
 
Array< OneD, Array< OneD, NekDouble > > m_gates_tau
Storage for gate tau values. 
 
virtual std::string v_GetCellVarName(unsigned int idx)
 
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list. 
 
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object. 
 
void Vexp(int n, const T *x, const int incx, T *y, const int incy)
 
void Svtvm(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x - y 
 
Array< OneD, Array< OneD, NekDouble > > m_cellSol
Cell model solution variables. 
 
int m_nvar
Number of variables in cell model (inc. transmembrane voltage) 
 
std::vector< int > m_gates
Indices of cell model variables which are gates. 
 
virtual ~CourtemancheRamirezNattel98()
Destructor. 
 
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x. 
 
virtual void v_GenerateSummary(SummaryList &s)
Prints a summary of the model parameters. 
 
CellModelFactory & GetCellModelFactory()
 
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y. 
 
enum Variants model_variant
 
void Vlog(int n, const T *x, const int incx, T *y, const int incy)
 
void Svtsvtp(int n, const T alpha, const T *x, int incx, const T beta, const T *y, int incy, T *z, int incz)
vvtvvtp (scalar times vector plus scalar times vector): 
 
virtual void v_Update(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Computes the reaction terms $f(u,v)$ and $g(u,v)$. 
 
void Zero(int n, T *x, const int incx)
Zero vector. 
 
static std::string lookupIds[]
 
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y. 
 
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y. 
 
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.