CEPS  24.01
Cardiac ElectroPhysiology Simulator
TTP06.cpp
Go to the documentation of this file.
1 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2  This file is part of CEPS.
3 
4  CEPS is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  CEPS is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with CEPS (see file LICENSE at root of project).
16  If not, see <https://www.gnu.org/licenses/>.
17 
18 
19  Copyright 2019-2024 Inria, Universite de Bordeaux
20 
21  Authors, in alphabetical order:
22 
23  Pierre-Elliott BECUE, Florian CARO, Yves COUDIERE(*), Andjela DAVIDOVIC,
24  Charlie DOUANLA-LONTSI, Marc FUENTES, Mehdi JUHOOR, Michael LEGUEBE(*),
25  Pauline MIGERDITICHAN, Valentin PANNETIER(*), Nejib ZEMZEMI.
26  * : currently active authors
27 
28 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
31 
33  const TTP06::Type& type,
34  Unknown* u,
35  const CepsSet<CepsAttribute>& attrs,
36  InputParameters* params
37 ):
38  AbstractIonicModel(u,attrs),
39  m_type(type)
40 {
41  if (m_type == Type::Endo)
42  m_name = "TenTusscher Panfilov 2006 (endocardium)";
43  else if (m_type == Type::MidMyo)
44  m_name = "TenTusscher Panvilov 2006 (mid myocardium)";
45  else
46  m_name = "TenTusscher Panvilov 2006 (epicardium)";
47 
48  m_nStateVars = 18;
49  m_stateVarNames = {
50  "K_i [millimolar]",
51  "Na_i [millimolar]",
52  "Ca_i [millimolar]",
53  "xr1 [adim]",
54  "xr2 [adim]",
55  "xs [adim]",
56  "m [adim]",
57  "h [adim]",
58  "j [adim]",
59  "Ca_ss [millimolar]",
60  "d [adim]",
61  "f [adim]",
62  "f2 [adim]",
63  "f_Ca_ss [adim]",
64  "s [adim]",
65  "r [adim]",
66  "Ca_sr [millimolar]",
67  "R_prime [adim]"
68  };
69 
70  // ================================================================================
71  // Default parameters
72  m_constants = new CepsReal[53];
73  m_constants[_R ] = 8314.472;
74  m_constants[_T ] = 310;
75  m_constants[_F ] = 96485.3415;
76  m_constants[_vc ] = 0.016404;
77  m_constants[_pkna ] = 0.03;
78  m_constants[_ko ] = 5.4;
79  m_constants[_nao ] = 140;
80  m_constants[_cao ] = 2;
81  m_constants[_gk1 ] = 5.405;
82  m_constants[_gkr ] = 0.153;
83  m_constants[_gna ] = 14.838;
84  m_constants[_gbna ] = 0.00029;
85  m_constants[_gcal ] = 0.0000398;
86  m_constants[_gbca ] = 0.000592;
87  m_constants[_pnak ] = 2.724;
88  m_constants[_kmk ] = 1;
89  m_constants[_kmna ] = 40;
90  m_constants[_knaca ] = 1000;
91  m_constants[_ksat ] = 0.1;
92  m_constants[_alpha ] = 2.5;
93  m_constants[_gamma ] = 0.35;
94  m_constants[_kmca ] = 1.38;
95  m_constants[_kmnai ] = 87.5;
96  m_constants[_gpca ] = 0.1238;
97  m_constants[_kpca ] = 0.0005;
98  m_constants[_gpk ] = 0.0146;
99  m_constants[_k1prime] = 0.15;
100  m_constants[_k2prime] = 0.045;
101  m_constants[_k3 ] = 0.06;
102  m_constants[_k4 ] = 0.005;
103  m_constants[_ec ] = 1.5;
104  m_constants[_maxsr ] = 2.5;
105  m_constants[_minsr ] = 1;
106  m_constants[_vrel ] = 0.102;
107  m_constants[_vxfer ] = 0.0038;
108  m_constants[_kup ] = 0.00025;
109  m_constants[_vleak ] = 0.00036;
110  m_constants[_vmaxup ] = 0.006375;
111  m_constants[_bufc ] = 0.2;
112  m_constants[_kbufc ] = 0.001;
113  m_constants[_bufsr ] = 10;
114  m_constants[_kbuf ] = 0.3;
115  m_constants[_bufss ] = 0.4;
116  m_constants[_kbufss ] = 0.00025;
117  m_constants[_vsr ] = 0.001094;
118  m_constants[_vss ] = 0.00005468;
119  m_constants[_gks ] = m_type == Type::MidMyo ? 0.098 : 0.392;
120  m_constants[_gto ] = m_type == Type::Endo ? 0.073 : 0.294;
121 
122  // ================================================================================
123  // Parameters from text inputs, if any
124  if (ceps::isValidPtr(params))
125  setupWithParameters(params,nullptr);
126 
127  // The cited paper mentions a surface to volume ratio of 0.2 um-1
128  m_cellSurface = 0.2*m_constants[_vc]*1.e-8; // from um2 to cm2
129  // However the model mentions "per surface unit" for all constants. Surface unit is unclear.
130  // so m_cellSurface is not used...
131 
132  m_paperCm = 0.185;
133  m_paperStim = 52*m_paperCm; //
134 
135 
136 }
137 
138 void
140 {
141 
142  if (m_type == Type::Endo)
143  {
144  *v = -86.709;
145  y[_ki ] = 138.4;
146  y[_nai ] = 10.355;
147  y[_cai ] = 0.00013;
148  y[_xr1 ] = 0.00448;
149  y[_xr2 ] = 0.476;
150  y[_xs ] = 0.0087;
151  y[_m ] = 0.00155;
152  y[_h ] = 0.7573;
153  y[_j ] = 0.7225;
154  y[_cass ] = 0.00036;
155  y[_d ] = 3.164e-5;
156  y[_f ] = 0.8009;
157  y[_f2 ] = 0.9778;
158  y[_fcass ] = 0.9953;
159  y[_s ] = 0.3212;
160  y[_r ] = 2.235e-8;
161  y[_casr ] = 3.715;
162  y[_rprime] = 0.9068;
163  }
164  else if (m_type == Type::MidMyo)
165  {
166  *v = -85.423;
167  y[_ki ] = 138.52;
168  y[_nai ] = 10.132;
169  y[_cai ] = 0.000153;
170  y[_xr1 ] = 0.0165;
171  y[_xr2 ] = 0.473;
172  y[_xs ] = 0.0174;
173  y[_m ] = 0.00165;
174  y[_h ] = 0.749;
175  y[_j ] = 0.6788;
176  y[_cass ] = 0.00042;
177  y[_d ] = 3.288e-5;
178  y[_f ] = 0.7026;
179  y[_f2 ] = 0.9526;
180  y[_fcass ] = 0.9942;
181  y[_s ] = 0.999998;
182  y[_r ] = 2.347e-8;
183  y[_casr ] = 4.272;
184  y[_rprime] = 0.8978;
185  }
186  else
187  {
188  *v = -85.23;
189  y[_ki ] = 136.89;
190  y[_nai ] = 8.604;
191  y[_cai ] = 0.000126;
192  y[_xr1 ] = 0.00621;
193  y[_xr2 ] = 0.4712;
194  y[_xs ] = 0.0095;
195  y[_m ] = 0.00172;
196  y[_h ] = 0.7444;
197  y[_j ] = 0.7045;
198  y[_cass ] = 0.00036;
199  y[_d ] = 3.373e-5;
200  y[_f ] = 0.7888;
201  y[_f2 ] = 0.9755;
202  y[_fcass ] = 0.9953;
203  y[_s ] = 0.9999998;
204  y[_r ] = 2.42e-8;
205  y[_casr ] = 3.64;
206  y[_rprime] = 0.9073;
207  }
208 
209 }
210 
211 void
213  CepsReal t,
214  CepsReal* y,
215  CepsReal* vm,
216  CepsReal* dtyLin,
217  CepsReal* dtyNLin,
218  CepsReal* dtv,
219  DegreeOfFreedom* dof
220 ) const
221 {
222 
223  using std::exp;
224  using std::expm1;
225  using std::pow;
226  using ceps::approxEquals;
227 
228  CepsReal* c = m_constants;
229  CepsReal v = *vm;
230 
231  CepsReal cm = getCmInternal(t,dof);
232  CepsReal RTF = c[_R]*c[_T]/c[_F];
233 
234  CepsReal a7 = sigmoid(v,-20,7);
235  CepsReal a20 = 1102.5*gaussian(v,-27,225) +200*sigmoid(v,13,-10) +180*sigmoid(v,-30,10) + 20;
236  dtyLin [_f] = -1/a20;
237  dtyNLin[_f] = a7/a20;
238 
239  CepsReal a8 = 0.67*sigmoid(v,-35,7) + 0.33;
240  CepsReal a21 = 562.*gaussian(v,-27,240) +31*sigmoid(v,25,-10) +80*sigmoid(v,-30,10);
241  dtyLin [_f2] = -1/a21;
242  dtyNLin[_f2] = a8/a21;
243 
244  CepsReal a9 = 0.6/(1+pow(y[_cass]/0.05,2)) +0.4;
245  CepsReal a22 = 80./(1+pow(y[_cass]/0.05,2)) +2.0;
246  dtyLin [_fcass] = -1/a22;
247  dtyNLin[_fcass] = a9/a22;
248 
249  CepsReal a10 = m_type == Type::Endo ? sigmoid(v,-28,5) : sigmoid(v,-20.,5.);
250  CepsReal a23 = m_type == Type::Endo ? 8. + 1000.*gaussian(v,-67.,1000.)
251  : 85.*gaussian(v,-45.,320.) +5.*sigmoid(v,20.,5.) +3;
252  dtyLin [_s] = -1/a23;
253  dtyNLin[_s] = a10/a23;
254 
255  CepsReal a11 = sigmoid(v,20,-6);
256  CepsReal a24 = 9.5*gaussian(v,-40,1800) + 0.8;
257  dtyLin [_r] = -1/a24;
258  dtyNLin[_r] = a11/a24;
259 
260  CepsReal a0 = sigmoid(v,-26,-7);
261  CepsReal a13 = 450*sigmoid(v,-45,-10);
262  CepsReal a26 = 6*sigmoid(v,-30,11.5);
263  CepsReal a34 = a13*a26;
264  dtyLin [_xr1] = -1/a34;
265  dtyNLin[_xr1] = a0/a34;
266 
267  CepsReal a1 = sigmoid(v,-88,24);
268  CepsReal a14 = 3*sigmoid(v,-60,-20);
269  CepsReal a27 = 1.12*sigmoid(v,60,20);
270  CepsReal a35 = a14*a27;
271  dtyLin [_xr2] = -1/a35;
272  dtyNLin[_xr2] = a1/a35;
273 
274  CepsReal a2 = sigmoid(v,-5,-14);
275  CepsReal a15 = 1400*std::sqrt(sigmoid(v,5,-6));
276  CepsReal a28 = sigmoid(v,35,15);
277  CepsReal a36 = a15*a28+80;
278  dtyLin [_xs] = -1/a36;
279  dtyNLin[_xs] = a2/a36;
280 
281  CepsReal a3 = pow(sigmoid(v,-56.86,-9.03),2);
282  CepsReal a16 = sigmoid(v,-60,-5);
283  CepsReal a29 = 0.1*sigmoid(v,-35,5) + 0.1*sigmoid(v,50,200);
284  CepsReal a37 = a16*a29;
285  dtyLin [_m] = -1/a37;
286  dtyNLin[_m] = a3/a37;
287 
288  CepsReal a4 = pow(sigmoid(v,-71.55,7.43),2);
289  CepsReal a17 = v<-40 ? 0.057*exp(-(v+80)/6.8) : 0;
290  CepsReal a30 = v<-40 ? 2.7*exp(0.079*v) +3.1e5*exp(0.3485*v) : 0.77/0.13*sigmoid(v,-10.66,-11.1);
291  CepsReal a38 = 1/(a17+a30);
292  dtyLin [_h] = -1/a38;
293  dtyNLin[_h] = a4/a38;
294 
295  CepsReal a5 = a4;
296  CepsReal a18 = v<-40 ? (-25428*exp(0.2444*v)-6.948e-6*exp(-0.04391*v))*(v+37.78)*sigmoid(v,-79.23,1/0.311) : 0;
297  CepsReal a31 = v<-40 ? 0.02424*exp(-0.01052*v)*sigmoid(v,-40.14,-1/0.1378) : 0.6*exp(0.057*v)*sigmoid(v,-32,-10);
298  CepsReal a39 = 1/(a18+a31);
299  dtyLin [_j] = -1/a39;
300  dtyNLin[_j] = a5/a39;
301 
302  CepsReal a6 = sigmoid(v,-8,-7.5);
303  CepsReal a19 = 1.4*sigmoid(v,-35,-13) + 0.25;
304  CepsReal a32 = 1.4*sigmoid(v,-5,5);
305  CepsReal a40 = sigmoid(v,50,-20);
306  CepsReal a42 = a19*a32+a40;
307  dtyLin [_d] = -1/a42;
308  dtyNLin[_d] = a6/a42;
309 
310  CepsReal texp = exp(-v/RTF);
311  CepsReal a55 = c[_pnak]*c[_ko]/(c[_ko]+c[_kmk]) *y[_nai]/(y[_nai]+c[_kmna])
312  / (1 +0.1245*pow(texp,0.1) +0.0353*texp);
313  CepsReal a25 = RTF*std::log(c[_nao]/y[_nai]);
314  CepsReal a50 = c[_gna]*y[_m]*y[_m]*y[_m]*y[_h]*y[_j]*(v-a25);
315  CepsReal a51 = c[_gbna]*(v-a25);
316  CepsReal a56a = c[_cao]*pow(texp,-c[_gamma])*pow(y[_nai],3);
317  CepsReal a56b = c[_alpha]*y[_cai]*pow(texp,1-c[_gamma])*pow(c[_nao],3);
318  CepsReal a56c = (pow(c[_kmnai],3)+pow(c[_nao],3))*(c[_kmca]+c[_cao]);
319  CepsReal a56d = 1+c[_ksat]*pow(texp,1-c[_gamma]);
320  CepsReal a56 = c[_knaca]*(a56a-a56b)/a56c/a56d;
321  dtyLin [_nai] = 0.;
322  dtyNLin[_nai] = -cm*(a50+a51+3*a55+3*a56)/c[_vc]/c[_F];
323 
324  CepsReal a33 = RTF*std::log(c[_ko]/y[_ki]);
325  CepsReal a44 = 0.1*sigmoid(v,a33+200,1/0.06);
326  CepsReal a45 = (3*exp(2e-4*(v-a33+100)) +exp(0.1*(v-a33-10)))*sigmoid(v,a33,-2);
327  CepsReal a46 = a44/(a44+a45);
328  CepsReal a47 = c[_gk1]*a46*std::sqrt(c[_ko]/5.4)*(v-a33);
329  CepsReal a54 = c[_gto]*y[_r]*y[_s]*(v-a33);
330  CepsReal a48 = c[_gkr]*std::sqrt(c[_ko]/5.4)*y[_xr1]*y[_xr2]*(v-a33);
331 
332  CepsReal a41 = RTF*std::log( (c[_ko]+c[_pkna]*c[_nao])/(y[_ki]+c[_pkna]*y[_nai]) );
333  CepsReal a49 = c[_gks]*y[_xs]*y[_xs]*(v-a41);
334  //CepsReal a52a = c[_gcal]*y[_d]*y[_f]*y[_f2]*y[_fcass]*4*(v-15)*c[_F]/RTF;
335  //CepsReal a52b = 0.25*y[_cass]*exp(2*(v-15)/RTF)-c[_cao];
336  //CepsReal a52c = expm1(2*(v-15)/RTF);
337  //CepsReal a52 = a52a*a52b/a52c;
338  CepsReal a52a = c[_gcal]*y[_d]*y[_f]*y[_f2]*y[_fcass]*2*c[_F]*uOverExpm1u(2*(v-15)/RTF);
339  CepsReal a52b = 0.25*y[_cass]*exp(2*(v-15)/RTF)-c[_cao];
340  CepsReal a52 = a52a*a52b;
341 
342  CepsReal a43 = 0.5*RTF*std::log(c[_cao]/y[_cai]);
343  CepsReal a53 = c[_gbca]*(v-a43);
344  CepsReal a58 = c[_gpk]*(v-a33)*sigmoid(v,25,-5.98);
345  CepsReal a57 = c[_gpca]*y[_cai]/(y[_cai]+c[_kpca]);
346 
347  CepsReal iStim = getStimulation(dof,t)/cm;
348  CepsReal iIon = -(a47+a54+a48+a49+a52+a55+a50+a51+a56+a53+a58+a57);
349  #ifdef DEBUG
350  ceps::checkNanOrInf(iIon,
351  "Ionic current on DoF " + CepsString(dof->getGlobalIndex() + " at time" + CepsString(t))
352  );
353  #endif
354 
355  *dtv = iIon + iStim;
356 
357  dtyLin [_ki] = 0.;
358  dtyNLin[_ki] = -cm*(a47+a54+a48+a49+a58+iStim-2*a55)/(c[_vc]*c[_F]);
359 
360  CepsReal a59 = c[_vmaxup]/(1+c[_kup]*c[_kup]/y[_cai]/y[_cai]);
361  CepsReal a60 = c[_vleak]*(y[_casr]-y[_cai]);
362  CepsReal a61 = c[_vxfer]*(y[_cass]-y[_cai]);
363  CepsReal a63 = 1/(1+c[_bufc]*c[_kbufc]/pow(y[_cai]+c[_kbufc],2));
364  dtyLin [_cai] = 0.;
365  dtyNLin[_cai] = a63*((a61+(a60-a59)*c[_vsr]/c[_vc]) - cm*(a53+a57-2*a56)/(2*c[_vc]*c[_F]));
366 
367  CepsReal a62 = c[_maxsr]-(c[_maxsr]-c[_minsr])/(1+pow(c[_ec]/y[_casr],2));
368  CepsReal a65 = c[_k2prime]*a62;
369  dtyLin [_rprime] = -c[_k4];
370  dtyNLin[_rprime] = c[_k4]-a65*y[_cass]*y[_rprime];
371 
372  CepsReal a64 = c[_k1prime]/a62;
373  CepsReal a66 = a64*y[_cass]*y[_cass]*y[_rprime]/(c[_k3]+a64*y[_cass]*y[_cass]);
374  CepsReal a67 = c[_vrel]*a66*(y[_casr]-y[_cass]);
375  CepsReal a68 = 1/(1+c[_bufsr]*c[_kbuf]/pow(y[_casr]+c[_kbuf],2));
376  dtyLin [_casr] = 0.;
377  dtyNLin[_casr] = a68*(a59-a67-a60);
378 
379  CepsReal a69 = 1/(1+c[_bufss]*c[_kbufss]/pow(y[_cass]+c[_kbufss],2));
380  dtyLin [_cass] = 0.;
381  dtyNLin[_cass] = a69*( (-a52*cm/(2*c[_vss]*c[_F]) +a67*c[_vsr]/c[_vss]) -a61*c[_vc]/c[_vss]);
382 
383 }
384 
385 void
387 {
388 
389  CepsString key = "TTP06_";
390  if (m_type==Type::Endo)
391  key += "endo ";
392  if (m_type==Type::Epi)
393  key += "epi ";
394  if (m_type==Type::MidMyo)
395  key += "midmyo ";
396 
397  m_constants[_R ] = p->getReal(key+"R ",m_constants[_R ]);
398  m_constants[_T ] = p->getReal(key+"T ",m_constants[_T ]);
399  m_constants[_F ] = p->getReal(key+"F ",m_constants[_F ]);
400  m_constants[_vc ] = p->getReal(key+"vc ",m_constants[_vc ]);
401  m_constants[_pkna ] = p->getReal(key+"pkna ",m_constants[_pkna ]);
402  m_constants[_ko ] = p->getReal(key+"ko ",m_constants[_ko ]);
403  m_constants[_nao ] = p->getReal(key+"nao ",m_constants[_nao ]);
404  m_constants[_cao ] = p->getReal(key+"cao ",m_constants[_cao ]);
405  m_constants[_gk1 ] = p->getReal(key+"gk1 ",m_constants[_gk1 ]);
406  m_constants[_gkr ] = p->getReal(key+"gkr ",m_constants[_gkr ]);
407  m_constants[_gks ] = p->getReal(key+"gks ",m_constants[_gks ]);
408  m_constants[_gna ] = p->getReal(key+"gna ",m_constants[_gna ]);
409  m_constants[_gbna ] = p->getReal(key+"gbna ",m_constants[_gbna ]);
410  m_constants[_gcal ] = p->getReal(key+"gcal ",m_constants[_gcal ]);
411  m_constants[_gbca ] = p->getReal(key+"gbca ",m_constants[_gbca ]);
412  m_constants[_gto ] = p->getReal(key+"gto ",m_constants[_gto ]);
413  m_constants[_pnak ] = p->getReal(key+"pnak ",m_constants[_pnak ]);
414  m_constants[_kmk ] = p->getReal(key+"kmk ",m_constants[_kmk ]);
415  m_constants[_kmna ] = p->getReal(key+"kmna ",m_constants[_kmna ]);
416  m_constants[_knaca ] = p->getReal(key+"knaca ",m_constants[_knaca ]);
417  m_constants[_ksat ] = p->getReal(key+"ksat ",m_constants[_ksat ]);
418  m_constants[_alpha ] = p->getReal(key+"alpha ",m_constants[_alpha ]);
419  m_constants[_gamma ] = p->getReal(key+"gamma ",m_constants[_gamma ]);
420  m_constants[_kmca ] = p->getReal(key+"kmca ",m_constants[_kmca ]);
421  m_constants[_kmna ] = p->getReal(key+"kmna ",m_constants[_kmna ]);
422  m_constants[_gpca ] = p->getReal(key+"gpca ",m_constants[_gpca ]);
423  m_constants[_kpca ] = p->getReal(key+"kpca ",m_constants[_kpca ]);
424  m_constants[_gpk ] = p->getReal(key+"gpk ",m_constants[_gpk ]);
425  m_constants[_k1prime] = p->getReal(key+"k1prime",m_constants[_k1prime]);
426  m_constants[_k2prime] = p->getReal(key+"k2prime",m_constants[_k2prime]);
427  m_constants[_k3 ] = p->getReal(key+"k3 ",m_constants[_k3 ]);
428  m_constants[_k4 ] = p->getReal(key+"k4 ",m_constants[_k4 ]);
429  m_constants[_ec ] = p->getReal(key+"ec ",m_constants[_ec ]);
430  m_constants[_maxsr ] = p->getReal(key+"maxsr ",m_constants[_maxsr ]);
431  m_constants[_minsr ] = p->getReal(key+"minsr ",m_constants[_minsr ]);
432  m_constants[_vrel ] = p->getReal(key+"vrel ",m_constants[_vrel ]);
433  m_constants[_vxfer ] = p->getReal(key+"vxfer ",m_constants[_vxfer ]);
434  m_constants[_kup ] = p->getReal(key+"kup ",m_constants[_kup ]);
435  m_constants[_vleak ] = p->getReal(key+"vleak ",m_constants[_vleak ]);
436  m_constants[_vmaxup ] = p->getReal(key+"vmaxup ",m_constants[_vmaxup ]);
437  m_constants[_bufc ] = p->getReal(key+"bufc ",m_constants[_bufc ]);
438  m_constants[_kbufc ] = p->getReal(key+"kbufc ",m_constants[_kbufc ]);
439  m_constants[_bufsr ] = p->getReal(key+"bufsr ",m_constants[_bufsr ]);
440  m_constants[_kbuf ] = p->getReal(key+"kbuf ",m_constants[_kbuf ]);
441  m_constants[_bufss ] = p->getReal(key+"bufss ",m_constants[_bufss ]);
442  m_constants[_kbufss ] = p->getReal(key+"kbufss ",m_constants[_kbufss ]);
443  m_constants[_vsr ] = p->getReal(key+"vsr ",m_constants[_vsr ]);
444  m_constants[_vss ] = p->getReal(key+"vss ",m_constants[_vss ]);
445 }
std::basic_string< CepsChar > CepsString
C++ format string.
Definition: CepsTypes.hpp:128
std::set< _Type, _Compare, _Alloc > CepsSet
C++ set.
Definition: CepsTypes.hpp:209
float CepsReal
Need single precision floating point.
Definition: CepsTypes.hpp:100
Represents a ionic model for a group of cells, i.e. multiple systems of ODEs.
CepsReal gaussian(CepsReal x, CepsReal c, CepsReal s) const
Function often used in rates evaluations.
CepsReal m_paperStim
Original stim amplitude.
CepsUInt m_nStateVars
Dimensionality of the ODE system, -1 for vm.
CepsReal * m_constants
Constant parameters of the model, from inputs.
CepsReal getStimulation(DegreeOfFreedom *x, CepsReal t) const
Get the sum of all stimulations at time t and dof x.
CepsReal uOverExpm1u(CepsReal u) const
Functions u/(1-exp(u)) that returns 2 (from expansion around 0)
CepsVector< CepsString > m_stateVarNames
Names of state variables.
CepsReal getCmInternal(CepsReal t, DegreeOfFreedom *dof) const
Get either the value of cm on dof, or the default value from the paper.
CepsReal m_paperCm
Original value of Cm.
CepsReal sigmoid(CepsReal x, CepsReal c, CepsReal k) const
Function often used in rates evaluations.
CepsString m_name
A label for display.
A degree of freedom for any kind of problem The dof can be associated to a geometrical element or not...
FunctionDictionary that holds functions which can be used to define source terms, boundary conditions...
Reads and stores simulation configuration.
CepsReal getReal(const keyType &key) const
Reads a floating point value from configuration.
static constexpr const CepsInt _pnak
Index alias.
Definition: TTP06.hpp:140
static constexpr const CepsInt _T
Index alias.
Definition: TTP06.hpp:125
CepsReal m_cellSurface
Surface of cell for unit conversion.
Definition: TTP06.hpp:101
static constexpr const CepsInt _rprime
Index alias.
Definition: TTP06.hpp:121
static constexpr const CepsInt _h
Index alias.
Definition: TTP06.hpp:111
static constexpr const CepsInt _kbuf
Index alias.
Definition: TTP06.hpp:167
static constexpr const CepsInt _k3
Index alias.
Definition: TTP06.hpp:154
static constexpr const CepsInt _xs
Index alias.
Definition: TTP06.hpp:109
static constexpr const CepsInt _gbca
Index alias.
Definition: TTP06.hpp:138
static constexpr const CepsInt _ki
Index alias.
Definition: TTP06.hpp:104
void getInitialCondition(CepsReal *v, CepsReal *y) const final
Sets initial values of state variables and transmembrane voltage for a single point....
Definition: TTP06.cpp:139
static constexpr const CepsInt _k4
Index alias.
Definition: TTP06.hpp:155
static constexpr const CepsInt _vleak
Index alias.
Definition: TTP06.hpp:162
void computeRates(CepsReal t, CepsReal *y, CepsReal *v, CepsReal *dtyL, CepsReal *dtyNL, CepsReal *dtv, DegreeOfFreedom *dof) const final
Get the linear and non linear part of the evolution function f. Also computes the ionic current.
Definition: TTP06.cpp:212
static constexpr const CepsInt _kbufss
Index alias.
Definition: TTP06.hpp:169
static constexpr const CepsInt _gbna
Index alias.
Definition: TTP06.hpp:136
static constexpr const CepsInt _gks
Index alias.
Definition: TTP06.hpp:134
static constexpr const CepsInt _kup
Index alias.
Definition: TTP06.hpp:161
static constexpr const CepsInt _gk1
Index alias.
Definition: TTP06.hpp:132
static constexpr const CepsInt _nao
Index alias.
Definition: TTP06.hpp:130
static constexpr const CepsInt _f
Index alias.
Definition: TTP06.hpp:115
static constexpr const CepsInt _gpk
Index alias.
Definition: TTP06.hpp:151
static constexpr const CepsInt _bufss
Index alias.
Definition: TTP06.hpp:168
static constexpr const CepsInt _F
Index alias.
Definition: TTP06.hpp:126
Type
Model variant selector.
Definition: TTP06.hpp:55
@ Epi
Model variant selector.
@ MidMyo
Model variant selector.
@ Endo
Model variant selector.
static constexpr const CepsInt _nai
Index alias.
Definition: TTP06.hpp:105
static constexpr const CepsInt _R
Index alias.
Definition: TTP06.hpp:124
static constexpr const CepsInt _kpca
Index alias.
Definition: TTP06.hpp:150
static constexpr const CepsInt _kmca
Index alias.
Definition: TTP06.hpp:147
static constexpr const CepsInt _vss
Index alias.
Definition: TTP06.hpp:171
static constexpr const CepsInt _vsr
Index alias.
Definition: TTP06.hpp:170
static constexpr const CepsInt _gkr
Index alias.
Definition: TTP06.hpp:133
static constexpr const CepsInt _kmna
Index alias.
Definition: TTP06.hpp:142
static constexpr const CepsInt _vrel
Index alias.
Definition: TTP06.hpp:159
Type m_type
Endo, midmyo or epi.
Definition: TTP06.hpp:99
static constexpr const CepsInt _bufc
Index alias.
Definition: TTP06.hpp:164
static constexpr const CepsInt _gcal
Index alias.
Definition: TTP06.hpp:137
static constexpr const CepsInt _f2
Index alias.
Definition: TTP06.hpp:116
static constexpr const CepsInt _knaca
Index alias.
Definition: TTP06.hpp:143
static constexpr const CepsInt _j
Index alias.
Definition: TTP06.hpp:112
static constexpr const CepsInt _gamma
Index alias.
Definition: TTP06.hpp:146
static constexpr const CepsInt _ko
Index alias.
Definition: TTP06.hpp:129
static constexpr const CepsInt _kmnai
Index alias.
Definition: TTP06.hpp:148
static constexpr const CepsInt _gpca
Index alias.
Definition: TTP06.hpp:149
static constexpr const CepsInt _vxfer
Index alias.
Definition: TTP06.hpp:160
static constexpr const CepsInt _k2prime
Index alias.
Definition: TTP06.hpp:153
TTP06(const Type &type, Unknown *u, const CepsSet< CepsAttribute > &attrs={}, InputParameters *params=nullptr)
Constructor (sets constant parameters)
Definition: TTP06.cpp:32
static constexpr const CepsInt _ksat
Index alias.
Definition: TTP06.hpp:144
static constexpr const CepsInt _vmaxup
Index alias.
Definition: TTP06.hpp:163
static constexpr const CepsInt _gto
Index alias.
Definition: TTP06.hpp:139
static constexpr const CepsInt _kmk
Index alias.
Definition: TTP06.hpp:141
static constexpr const CepsInt _ec
Index alias.
Definition: TTP06.hpp:156
static constexpr const CepsInt _gna
Index alias.
Definition: TTP06.hpp:135
static constexpr const CepsInt _d
Index alias.
Definition: TTP06.hpp:114
static constexpr const CepsInt _xr2
Index alias.
Definition: TTP06.hpp:108
static constexpr const CepsInt _cass
Index alias.
Definition: TTP06.hpp:113
static constexpr const CepsInt _k1prime
Index alias.
Definition: TTP06.hpp:152
static constexpr const CepsInt _fcass
Index alias.
Definition: TTP06.hpp:117
static constexpr const CepsInt _cai
Index alias.
Definition: TTP06.hpp:106
static constexpr const CepsInt _alpha
Index alias.
Definition: TTP06.hpp:145
static constexpr const CepsInt _r
Index alias.
Definition: TTP06.hpp:119
void setupWithParameters(InputParameters *p, FunctionDictionary *dico)
Sets the constants and the space dependant parameters from text inputs.
Definition: TTP06.cpp:386
static constexpr const CepsInt _minsr
Index alias.
Definition: TTP06.hpp:158
static constexpr const CepsInt _pkna
Index alias.
Definition: TTP06.hpp:128
static constexpr const CepsInt _vc
Index alias.
Definition: TTP06.hpp:127
static constexpr const CepsInt _m
Index alias.
Definition: TTP06.hpp:110
static constexpr const CepsInt _casr
Index alias.
Definition: TTP06.hpp:120
static constexpr const CepsInt _xr1
Index alias.
Definition: TTP06.hpp:107
static constexpr const CepsInt _s
Index alias.
Definition: TTP06.hpp:118
static constexpr const CepsInt _bufsr
Index alias.
Definition: TTP06.hpp:166
static constexpr const CepsInt _kbufc
Index alias.
Definition: TTP06.hpp:165
static constexpr const CepsInt _cao
Index alias.
Definition: TTP06.hpp:131
static constexpr const CepsInt _maxsr
Index alias.
Definition: TTP06.hpp:157
A class used to defined an unknown of a PDE problem The unknown can be defined on a specific region,...
Definition: Unknown.hpp:45
const CepsGlobalIndex & getGlobalIndex() const
Get the index
CepsBool approxEquals(CepsReal a, CepsReal b, CepsReal epsilon)
Approximate equality with epsilon tolerance.
Definition: Precision.hpp:67
CepsBool isValidPtr(_Type *ptr)
Tells if pointer is not null.
Definition: CepsMemory.hpp:61
void checkNanOrInf(CepsReal v, CepsString message="")
Stops if value is NaN or infty.