48 "Ionic model of human atrial cell electrophysiology.");
86 sigma = 1.0 / 7.0 * (exp(
Na_o / 67.3) - 1);
165 ASSERTL0(inarray.get() != outarray.get(),
166 "Must have different arrays for input and output.");
206 Vmath::Vsub(n, inarray[0], 1, tmp_E_na, 1, tmp_I_Na, 1);
207 Vmath::Vmul(n, inarray[1], 1, tmp_I_Na, 1, tmp_I_Na, 1);
208 Vmath::Vmul(n, inarray[1], 1, tmp_I_Na, 1, tmp_I_Na, 1);
209 Vmath::Vmul(n, inarray[1], 1, tmp_I_Na, 1, tmp_I_Na, 1);
210 Vmath::Vmul(n, inarray[2], 1, tmp_I_Na, 1, tmp_I_Na, 1);
211 Vmath::Vmul(n, inarray[3], 1, tmp_I_Na, 1, tmp_I_Na, 1);
213 Vmath::Vsub(n, outarray[0], 1, tmp_I_Na, 1, outarray[0], 1);
214 Vmath::Smul(n, -1.0, tmp_I_Na, 1, outarray[16], 1);
218 Vmath::Vsub(n, inarray[0], 1, tmp_E_na, 1, tmp_I_b_Na, 1);
220 Vmath::Vsub(n, outarray[0], 1, tmp_I_b_Na, 1, outarray[0], 1);
221 Vmath::Vsub(n, outarray[16], 1, tmp_I_b_Na, 1, outarray[16], 1);
228 Vmath::Vsub(n, inarray[0], 1, tmp_V_E_k, 1, tmp_V_E_k, 1);
236 Vmath::Vdiv(n, tmp_V_E_k, 1, tmp_I_K1, 1, tmp_I_K1, 1);
238 Vmath::Vsub(n, outarray[0], 1, tmp_I_K1, 1, outarray[0], 1);
239 Vmath::Smul(n, -1.0, tmp_I_K1, 1, outarray[18], 1);
243 Vmath::Vmul(n, inarray[5], 1, tmp_V_E_k, 1, tmp_I_to, 1);
244 Vmath::Vmul(n, inarray[4], 1, tmp_I_to, 1, tmp_I_to, 1);
245 Vmath::Vmul(n, inarray[4], 1, tmp_I_to, 1, tmp_I_to, 1);
246 Vmath::Vmul(n, inarray[4], 1, tmp_I_to, 1, tmp_I_to, 1);
248 Vmath::Vsub(n, outarray[0], 1, tmp_I_to, 1, outarray[0], 1);
249 Vmath::Vsub(n, outarray[18], 1, tmp_I_to, 1, outarray[18], 1);
253 Vmath::Sadd(n, -15.0, inarray[0], 1, tmp_I_kur, 1);
254 Vmath::Smul(n, -1.0 / 13.0, tmp_I_kur, 1, tmp_I_kur, 1);
259 Vmath::Vmul(n, tmp_V_E_k, 1, tmp_I_kur, 1, tmp_I_kur, 1);
260 Vmath::Vmul(n, inarray[6], 1, tmp_I_kur, 1, tmp_I_kur, 1);
261 Vmath::Vmul(n, inarray[6], 1, tmp_I_kur, 1, tmp_I_kur, 1);
262 Vmath::Vmul(n, inarray[6], 1, tmp_I_kur, 1, tmp_I_kur, 1);
263 Vmath::Vmul(n, inarray[7], 1, tmp_I_kur, 1, tmp_I_kur, 1);
265 Vmath::Vsub(n, outarray[0], 1, tmp_I_kur, 1, outarray[0], 1);
266 Vmath::Vsub(n, outarray[18], 1, tmp_I_kur, 1, outarray[18], 1);
271 Vmath::Smul(n, 1.0 / 22.4, tmp_I_Kr, 1, tmp_I_Kr, 1);
274 Vmath::Vdiv(n, tmp_V_E_k, 1, tmp_I_Kr, 1, tmp_I_Kr, 1);
275 Vmath::Vmul(n, inarray[8], 1, tmp_I_Kr, 1, tmp_I_Kr, 1);
277 Vmath::Vsub(n, outarray[0], 1, tmp_I_Kr, 1, outarray[0], 1);
278 Vmath::Vsub(n, outarray[18], 1, tmp_I_Kr, 1, outarray[18], 1);
282 Vmath::Vmul(n, inarray[9], 1, tmp_V_E_k, 1, tmp_I_Ks, 1);
283 Vmath::Vmul(n, inarray[9], 1, tmp_I_Ks, 1, tmp_I_Ks, 1);
285 Vmath::Vsub(n, outarray[0], 1, tmp_I_Ks, 1, outarray[0], 1);
286 Vmath::Vsub(n, outarray[18], 1, tmp_I_Ks, 1, outarray[18], 1);
293 Vmath::Vsub(n, inarray[0], 1, tmp_I_b_Ca, 1, tmp_I_b_Ca, 1);
295 Vmath::Vsub(n, outarray[0], 1, tmp_I_b_Ca, 1, outarray[0], 1);
299 Vmath::Sadd(n, -65.0, inarray[0], 1, tmp_I_Ca_L, 1);
300 Vmath::Vmul(n, inarray[10], 1, tmp_I_Ca_L, 1, tmp_I_Ca_L, 1);
301 Vmath::Vmul(n, inarray[11], 1, tmp_I_Ca_L, 1, tmp_I_Ca_L, 1);
302 Vmath::Vmul(n, inarray[12], 1, tmp_I_Ca_L, 1, tmp_I_Ca_L, 1);
304 Vmath::Vsub(n, outarray[0], 1, tmp_I_Ca_L, 1, outarray[0], 1);
313 Vmath::Smul(n, 0.1245, tmp_f_Na_k, 1, tmp_f_Na_k, 1);
314 Vmath::Vadd(n, tmp_f_Na_k, 1, tmp, 1, tmp_f_Na_k, 1);
321 Vmath::Vmul(n, tmp_f_Na_k, 1, tmp_I_Na_K, 1, tmp_I_Na_K, 1);
324 Vmath::Vsub(n, outarray[0], 1, tmp_I_Na_K, 1, outarray[0], 1);
325 Vmath::Svtvp(n, -3.0, tmp_I_Na_K, 1, outarray[16], 1, outarray[16], 1);
326 Vmath::Svtvp(n, 2.0, tmp_I_Na_K, 1, outarray[18], 1, outarray[18], 1);
333 Vmath::Sadd(n, 1.0, tmp_I_Na_Ca, 1, tmp_I_Na_Ca, 1);
336 tmp_I_Na_Ca, 1, tmp_I_Na_Ca, 1);
347 Vmath::Vdiv(n, tmp, 1, tmp_I_Na_Ca, 1, tmp_I_Na_Ca, 1);
348 Vmath::Vsub(n, outarray[0], 1, tmp_I_Na_Ca, 1, outarray[0], 1);
349 Vmath::Svtvp(n, -3.0, tmp_I_Na_Ca, 1, outarray[16], 1, outarray[16], 1);
353 Vmath::Sadd(n, 0.0005, inarray[17], 1, tmp_I_p_Ca, 1);
354 Vmath::Vdiv(n, inarray[17], 1, tmp_I_p_Ca, 1, tmp_I_p_Ca, 1);
356 Vmath::Vsub(n, outarray[0], 1, tmp_I_p_Ca, 1, outarray[0], 1);
367 Vmath::Vsub(n, inarray[20], 1, inarray[19], 1, tmp_I_tr, 1);
383 Vmath::Vsub(n, inarray[19], 1, inarray[17], 1, tmp_I_rel, 1);
384 Vmath::Vmul(n, tmp_I_rel, 1, inarray[13], 1, tmp_I_rel, 1);
385 Vmath::Vmul(n, tmp_I_rel, 1, inarray[13], 1, tmp_I_rel, 1);
386 Vmath::Vmul(n, tmp_I_rel, 1, inarray[14], 1, tmp_I_rel, 1);
387 Vmath::Vmul(n, tmp_I_rel, 1, inarray[15], 1, tmp_I_rel, 1);
392 Vmath::Svtvm(n, 2.0, tmp_I_Na_Ca, 1, tmp_I_p_Ca, 1, tmp_B1, 1);
393 Vmath::Vsub(n, tmp_B1, 1, tmp_I_Ca_L, 1, tmp_B1, 1);
394 Vmath::Vsub(n, tmp_B1, 1, tmp_I_b_Ca, 1, tmp_B1, 1);
413 Vmath::Vdiv(n, tmp_B1, 1, tmp_B2, 1, outarray[17], 1);
416 Vmath::Vsub(n, tmp_I_up, 1, tmp_I_up_leak, 1, outarray[20], 1);
423 Vmath::Vmul(n, outarray[19], 1, outarray[19], 1, outarray[19], 1);
425 Vmath::Sadd(n, 1.0, outarray[19], 1, outarray[19], 1);
426 Vmath::Vdiv(n, tmp, 1, outarray[19], 1, outarray[19], 1);
434 for (i = 0, v = &inarray[0][0], x = &inarray[1][0], x_new = &outarray[1][0],
436 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
438 alpha = (*v == (-47.13)) ? 3.2
439 : (0.32 * (*v + 47.13)) /
440 (1.0 - exp((-0.1) * (*v + 47.13)));
441 beta = 0.08 * exp(-(*v) / 11.0);
442 *x_tau = 1.0 / (alpha +
beta);
443 *x_new = alpha * (*x_tau);
446 for (i = 0, v = &inarray[0][0], x = &inarray[2][0], x_new = &outarray[2][0],
448 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
450 alpha = (*v >= -40.0) ? 0.0 : 0.135 * exp(-((*v) + 80.0) / 6.8);
452 ? 1.0 / (0.13 * (1.0 + exp(-(*v + 10.66) / 11.1)))
453 : 3.56 * exp(0.079 * (*v)) + 310000.0 * exp(0.35 * (*v));
454 *x_tau = 1.0 / (alpha +
beta);
455 *x_new = alpha * (*x_tau);
458 for (i = 0, v = &inarray[0][0], x = &inarray[3][0], x_new = &outarray[3][0],
460 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
465 : (-127140.0 * exp(0.2444 * (*v)) -
466 3.474e-05 * exp(-0.04391 * (*v))) *
467 (((*v) + 37.78) / (1.0 + exp(0.311 * ((*v) + 79.23))));
468 beta = (*v >= -40.0) ? (0.3 * exp(-2.535e-07 * (*v)) /
469 (1.0 + exp(-0.1 * (*v + 32.0))))
470 : 0.1212 * exp(-0.01052 * (*v)) /
471 (1.0 + exp(-0.1378 * (*v + 40.14)));
472 *x_tau = 1.0 / (alpha +
beta);
473 *x_new = alpha * (*x_tau);
476 for (i = 0, v = &inarray[0][0], x = &inarray[4][0], x_new = &outarray[4][0],
478 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
480 alpha = 0.65 / (exp(-(*v + 10.0) / 8.5) + exp(-(*v - 30.0) / 59.0));
481 beta = 0.65 / (2.5 + exp((*v + 82.0) / 17.0));
483 *x_new = (1.0 / (1.0 + exp(-(*v + 20.47) / 17.54)));
486 for (i = 0, v = &inarray[0][0], x = &inarray[5][0], x_new = &outarray[5][0],
488 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
490 alpha = 1.0 / (18.53 + exp((*v + 113.7) / 10.95));
491 beta = 1.0 / (35.56 + exp(-(*v + 1.26) / 7.44));
493 *x_new = (1.0 / (1.0 + exp((*v + 43.1) / 5.3)));
496 for (i = 0, v = &inarray[0][0], x = &inarray[6][0], x_new = &outarray[6][0],
498 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
500 alpha = 0.65 / (exp(-(*v + 10.0) / 8.5) + exp(-(*v - 30.0) / 59.0));
501 beta = 0.65 / (2.5 + exp((*v + 82.0) / 17.0));
503 *x_new = 1.0 / (1.0 + exp(-(*v + 30.3) / 9.6));
506 for (i = 0, v = &inarray[0][0], x = &inarray[7][0], x_new = &outarray[7][0],
508 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
510 alpha = 1.0 / (21.0 + exp(-(*v - 185.0) / 28.0));
511 beta = exp((*v - 158.0) / 16.0);
513 *x_new = 1.0 / (1.0 + exp((*v - 99.45) / 27.48));
516 for (i = 0, v = &inarray[0][0], x = &inarray[8][0], x_new = &outarray[8][0],
518 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
520 alpha = 0.0003 * (*v + 14.1) / (1 - exp(-(*v + 14.1) / 5.0));
521 beta = 7.3898e-5 * (*v - 3.3328) / (exp((*v - 3.3328) / 5.1237) - 1.0);
522 *x_tau = 1.0 / (alpha +
beta);
523 *x_new = 1.0 / (1 + exp(-(*v + 14.1) / 6.5));
526 for (i = 0, v = &inarray[0][0], x = &inarray[9][0], x_new = &outarray[9][0],
528 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
530 alpha = 4e-5 * (*v - 19.9) / (1.0 - exp(-(*v - 19.9) / 17.0));
531 beta = 3.5e-5 * (*v - 19.9) / (exp((*v - 19.9) / 9.0) - 1.0);
532 *x_tau = 0.5 / (alpha +
beta);
533 *x_new = 1.0 /
sqrt(1.0 + exp(-(*v - 19.9) / 12.7));
536 for (i = 0, v = &inarray[0][0], x = &inarray[10][0],
537 x_new = &outarray[10][0], x_tau = &
m_gates_tau[9][0];
538 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
540 *x_tau = (1 - exp(-(*v + 10.0) / 6.24)) /
541 (0.035 * (*v + 10.0) * (1 + exp(-(*v + 10.0) / 6.24)));
542 *x_new = 1.0 / (1.0 + exp(-(*v + 10) / 8.0));
545 for (i = 0, v = &inarray[0][0], x = &inarray[11][0],
546 x_new = &outarray[11][0], x_tau = &
m_gates_tau[10][0];
547 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
552 (0.0197 * exp(-0.0337 * 0.0337 * (*v + 10.0) * (*v + 10.0)) + 0.02);
553 *x_new = exp((-(*v + 28.0)) / 6.9) / (1.0 + exp((-(*v + 28.0)) / 6.9));
556 for (i = 0, v = &inarray[0][0], x = &inarray[12][0],
557 x_new = &outarray[12][0], x_tau = &
m_gates_tau[11][0];
558 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
561 *x_new = 1.0 / (1.0 + inarray[17][i] / 0.00035);
566 tmp_I_Na_Ca, 1, tmp_Fn, 1);
570 for (i = 0, v = &tmp_Fn[0], x = &inarray[13][0], x_new = &outarray[13][0],
572 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
575 *x_new = 1.0 / (1.0 + exp(-(*v - 3.4175e-13) / 1.367e-15));
578 for (i = 0, v = &tmp_Fn[0], x = &inarray[14][0], x_new = &outarray[14][0],
580 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
582 *x_tau = 1.91 + 2.09 / (1.0 + exp(-(*v - 3.4175e-13) / 13.67e-16));
583 *x_new = 1.0 - 1.0 / (1.0 + exp(-(*v - 6.835e-14) / 13.67e-16));
586 for (i = 0, v = &inarray[0][0], x = &inarray[15][0],
587 x_new = &outarray[15][0], x_tau = &
m_gates_tau[14][0];
588 i < n; ++i, ++v, ++x, ++x_new, ++x_tau)
590 *x_tau = 6.0 * (1.0 - exp(-(*v - 7.9) / 5.0)) /
591 (1.0 + 0.3 * exp(-(*v - 7.9) / 5.0)) / (*v - 7.9);
592 *x_new = 1.0 - 1.0 / (1.0 + exp(-(*v - 40.0) / 17.0));
#define ASSERTL0(condition, msg)
Array< OneD, Array< OneD, NekDouble > > m_cellSol
Cell model solution variables.
std::vector< int > m_concentrations
Indices of cell model variables which are concentrations.
std::vector< int > m_gates
Indices of cell model variables which are gates.
size_t m_nq
Number of physical points.
size_t m_nvar
Number of variables in cell model (inc. transmembrane voltage)
Array< OneD, Array< OneD, NekDouble > > m_gates_tau
Storage for gate tau values.
void v_GenerateSummary(SummaryList &s) override
Prints a summary of the model parameters.
void v_SetInitialConditions() override
CourtemancheRamirezNattel98(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
Constructor.
static CellModelSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
Creates an instance of this class.
enum Variants model_variant
void v_Update(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time) override
Computes the reaction terms $f(u,v)$ and $g(u,v)$.
std::string v_GetCellVarName(size_t idx) override
~CourtemancheRamirezNattel98() override
Destructor.
static std::string className
Name of class.
static std::string lookupIds[]
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static std::string RegisterEnumValue(std::string pEnum, std::string pString, int pEnumValue)
Registers an enumeration value.
static std::string RegisterDefaultSolverInfo(const std::string &pName, const std::string &pValue)
Registers the default string value of a solver info property.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
@ beta
Gauss Radau pinned at x=-1,.
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::vector< std::pair< std::string, std::string > > SummaryList
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
CellModelFactory & GetCellModelFactory()
void Svtsvtp(int n, const T alpha, const T *x, int incx, const T beta, const T *y, int incy, T *z, int incz)
Svtsvtp (scalar times vector plus scalar times vector):
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.
void Vlog(int n, const T *x, const int incx, T *y, const int incy)
log y = log(x)
void Vexp(int n, const T *x, const int incx, T *y, const int incy)
exp y = exp(x)
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.
void Svtvm(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Svtvm (scalar times vector minus vector): z = alpha*x - y.
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 Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/x.
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.
void Zero(int n, T *x, const int incx)
Zero vector.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
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.
void Vpow(int n, const T *x, const int incx, const T f, T *y, const int incy)
pow y = pow(x, f)
scalarT< T > sqrt(scalarT< T > in)