CEPS  24.01
Cardiac ElectroPhysiology Simulator
ORdmD16.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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
32 
33 using std::exp;
34 using std::expm1;
35 using std::pow;
36 using std::log;
37 using std::sqrt;
38 using ceps::approxEquals;
39 
41  const ORdmD16::Type& type,
42  Unknown* u,
43  const CepsSet<CepsAttribute>& attrs,
44  InputParameters* params
45 ):
46  AbstractIonicModel(u,attrs),
47  m_type(type)
48 {
49 
50  m_name = "O'Hara-Rudy modified 2016";
51  m_nStateVars = 40;
52  m_stateVarNames = {
53  "Na_i []",
54  "Na_ss []",
55  "K_i []",
56  "K_ss []",
57  "Ca_i []",
58  "Ca_ss []",
59  "Ca_nsr []",
60  "Ca_jsr []",
61  "m [adim]",
62  "h_fast [adim]",
63  "h_slow [adim]",
64  "j [adim]",
65  "h_slow_p [adim]",
66  "jp []",
67  "m_late [adim]",
68  "h_late [adim]",
69  "h_late_p [adim]",
70  "a [adim]",
71  "i_fast [adim]",
72  "i_slow [adim]",
73  "a_p [adim]",
74  "i_fast_p [adim]",
75  "i_slow_p [adim]",
76  "d [adim]",
77  "f_fast [adim]",
78  "f_slow [adim]",
79  "fca_fast [adim]",
80  "fca_slow [adim]",
81  "jca [adim]",
82  "nca [adim]",
83  "f_fast_p [adim]",
84  "fca_fast_p [adim]",
85  "xr_fast [adim]",
86  "xr_slow [adim]",
87  "xs1 [adim]",
88  "xs2 [adim]",
89  "xk1 [adim]",
90  "Jrelnp []",
91  "Jrelp []",
92  "CaMKt []",
93  };
94 
95  // ================================================================================
96  // Default parameters
97  m_constants = ceps::newArray<CepsReal>(32);
98  m_dconstants = ceps::newArray<CepsReal>(15);
99  CepsReal* c = m_constants ;
100  CepsReal* dc = m_dconstants;
101  c[_IKr_factor ] = 1.119;
102  c[_IKs_factor ] = 1.648;
103  c[_IK1_factor ] = 1.414;
104  c[_ICaL_factor ] = 1.018;
105  c[_INaL_factor ] = 2.274;
106  c[_nao ] = 140.0;
107  c[_cao ] = 1.8;
108  c[_ko ] = 5.4;
109  c[_R ] = 8314.0;
110  c[_T ] = 310.0;
111  c[_F ] = 96485.0;
112  c[_L ] = 0.01;
113  c[_rad ] = 0.0011;
114  c[_vmyo_fraction] = 0.68;
115  c[_vnsr_fraction] = 0.0552;
116  c[_vjsr_fraction] = 0.0048;
117  c[_vss_fraction ] = 0.02;
118  c[_drug ] = 1448;
119  c[_ICNa ] = 5800;
120  c[_hNa ] = 1;
121  c[_ICNaL ] = 18870;
122  c[_hNaL ] = 0.6;
123  c[_ICto ] = 9266;
124  c[_hto ] = 0.7;
125  c[_ICCal ] = 26349.5;
126  c[_hCal ] = 1.185;
127  c[_ICKr ] = 1500;
128  c[_hKr ] = 0.88;
129  c[_ICKs ] = 20000;
130  c[_hKs ] = 1;
131  c[_ICK1 ] = std::nan("");
132  c[_hK1 ] = std::nan("");
133  c[_PKNa ] = 0.018333;
134 
135  // Parameters from text inputs, if any
136  if (ceps::isValidPtr(params))
137  setupWithParameters(params);
138 
139  dc[_vcell ] = 1000*3.14*c[_rad]*c[_rad]*c[_L]; // 3.14... seriously...
140  dc[_ageo ] = (2.*3.14*c[_rad])*(c[_rad]+c[_L]); // But we stick to the original
141  dc[_acap ] = 2*dc[_ageo];
142  dc[_vmyo ] = c[_vmyo_fraction]*dc[_vcell];
143  dc[_vnsr ] = c[_vnsr_fraction]*dc[_vcell];
144  dc[_vjsr ] = c[_vjsr_fraction]*dc[_vcell];
145  dc[_vss ] = c[ _vss_fraction]*dc[_vcell];
146  dc[_FRT ] = c[_F]/(c[_R]*c[_T]);
147  dc[_gNaFrac ] = (std::isnan(c[_ICNa ]) or std::isnan(c[_hNa ])) ? 1. : 1/(1.+pow(c[_drug]/c[_ICNa ],c[_hNa ]));
148  dc[_gNaLFrac] = (std::isnan(c[_ICNaL]) or std::isnan(c[_hNaL])) ? 1. : 1/(1.+pow(c[_drug]/c[_ICNaL],c[_hNaL]));
149  dc[_gtoFrac ] = (std::isnan(c[_ICto ]) or std::isnan(c[_hto ])) ? 1. : 1/(1.+pow(c[_drug]/c[_ICto ],c[_hto ]));
150  dc[_gCalFrac] = (std::isnan(c[_ICCal]) or std::isnan(c[_hCal])) ? 1. : 1/(1.+pow(c[_drug]/c[_ICCal],c[_hCal]));
151  dc[_gKrFrac ] = (std::isnan(c[_ICKr ]) or std::isnan(c[_hKr ])) ? 1. : 1/(1.+pow(c[_drug]/c[_ICKr ],c[_hKr ]));
152  dc[_gKsFrac ] = (std::isnan(c[_ICKs ]) or std::isnan(c[_hKs ])) ? 1. : 1/(1.+pow(c[_drug]/c[_ICKs ],c[_hKs ]));
153  dc[_gK1Frac ] = (std::isnan(c[_ICK1 ]) or std::isnan(c[_hK1 ])) ? 1. : 1/(1.+pow(c[_drug]/c[_ICK1 ],c[_hK1 ]));
154 
155 
156  // Other constants are deduced from these ones, almost
157  m_paperCm = 1.;
158  m_paperStim = -80;
159 
160 }
161 
162 void
164 {
165  *v = -87.84 ; // mV
166  y[_nai ] = 7.23 ; // mMol
167  y[_nass ] = 7.23 ; // mMol
168  y[_ki ] = 143.79 ; // mMol
169  y[_kss ] = 143.79 ; // mMol
170  y[_cai ] = 8.54e-05 ; // mMol
171  y[_cass ] = 8.43e-05 ; // mMol
172  y[_cansr ] = 1.61 ; // mMol
173  y[_cajsr ] = 1.56 ; // mMol
174  y[_m ] = 0.0074621 ; //
175  y[_hf ] = 0.692591 ; //
176  y[_hs ] = 0.692574 ; //
177  y[_j ] = 0.692477 ; //
178  y[_hsp ] = 0.448501 ; //
179  y[_jp ] = 0.692413 ; //
180  y[_mL ] = 0.000194015 ; //
181  y[_hL ] = 0.496116 ; //
182  y[_hLp ] = 0.265885 ; //
183  y[_a ] = 0.00101185 ; //
184  y[_iF ] = 0.999542 ; //
185  y[_iS ] = 0.589579 ; //
186  y[_ap ] = 0.000515567 ; //
187  y[_iFp ] = 0.999542 ; //
188  y[_iSp ] = 0.641861 ; //
189  y[_d ] = 2.43015e-09 ; //
190  y[_ff ] = 1 ; //
191  y[_fs ] = 0.916071 ; //
192  y[_fcaf ] = 1 ; //
193  y[_fcas ] = 0.99982 ; //
194  y[_jca ] = 0.999977 ; //
195  y[_nca ] = 0.00267171 ; //
196  y[_ffp ] = 1 ; //
197  y[_fcafp ] = 1 ; //
198  y[_xrf ] = 8.26608e-06 ; //
199  y[_xrs ] = 0.453268 ; //
200  y[_xs1 ] = 0.270492 ; //
201  y[_xs2 ] = 0.0001963 ; //
202  y[_xk1 ] = 0.996801 ; //
203  y[_Jrelnp] = 2.53943e-05 ; //
204  y[_Jrelp ] = 3.17262e-07 ; //
205  y[_CaMKt ] = 0.0124065 ; //
206 }
207 
208 void
210  CepsReal t,
211  CepsReal* y,
212  CepsReal* vm,
213  CepsReal* dtyLin,
214  CepsReal* dtyNLin,
215  CepsReal* dtv,
216  DegreeOfFreedom* dof
217 ) const
218 {
219 
220  CepsReal* c = m_constants;
221  CepsReal* d = m_dconstants;
222  CepsReal v = *vm;
223  CepsReal cm = getCmInternal(t,dof);
224 
225  // CaMK
226 
227  CepsReal KmCaMK = 0.15;
228  CepsReal aCaMK = 0.05;
229  CepsReal bCaMK = 6.8e-4;
230  CepsReal CaMKo = 0.05;
231  CepsReal KmCaM = 1.5e-3;
232  CepsReal CaMKb = CaMKo*(1.-y[_CaMKt])/(1.+KmCaM/y[_cass]);
233  CepsReal CaMKa = CaMKb + y[_CaMKt];
234  CepsReal fraction = 1./(1.+KmCaMK/CaMKa);
235 
236  dtyLin [_CaMKt] = -bCaMK;
237  dtyNLin[_CaMKt] = aCaMK*CaMKb*(CaMKb+y[_CaMKt]);
238 
239  // Fast Na+ current, late Na+ current
240  CepsReal INa,INaL;
241  computeINa(&INa,&INaL,v,y,dtyLin,dtyNLin,fraction);
242 
243  // Transient outward K+ current
244  CepsReal Ito;
245  computeIto(&Ito,v,y,dtyLin,dtyNLin,fraction);
246 
247  // L-type Ca2+ channel
248  CepsReal ICaL, ICaNa, ICaK;
249  computeICa(&ICaL,&ICaNa,&ICaK,v,y,dtyLin,dtyNLin,fraction);
250 
251  // Rapid delayed rectifier K+ current
252  CepsReal IKr;
253  computeIKr(&IKr,v,y,dtyLin,dtyNLin);
254 
255  // Slow delayed rectifier K+ current
256  CepsReal IKs;
257  computeIKs(&IKs,v,y,dtyLin,dtyNLin);
258 
259  // Inward Rectifier K+ Current
260  CepsReal IK1;
261  computeIK1(&IK1,v,y,dtyLin,dtyNLin);
262 
263  // Na+/Ca2+ exchanger
264  CepsReal INaCa_i, INaCa_ss;
265  computeINaCa(&INaCa_i,&INaCa_ss,v,y);
266 
267  // Sodium/Potassium ATPase Current
268  CepsReal INaK;
269  computeINaK(&INaK,v,y);
270 
271  // Background currents
272  CepsReal IKb,INab,ICab;
273  computeBgCurrents(&IKb,&INab,&ICab,v,y);
274 
276  CepsReal IpCa;
277  computeIPCa(&IpCa,y);
278 
279  // Potential
280  CepsReal IStim = getStimulation(dof,t);
281  CepsReal Iion = INa+INaL+Ito+ICaL+ICaNa+ICaK+IKr+IKs+IK1+INaCa_i+INaCa_ss+INaK+INab+IKb+IpCa+ICab;
282  #ifdef DEBUG
283  ceps::checkNanOrInf(Iion,
284  "Ionic current on DoF " + CepsString(dof->getGlobalIndex() + " at time" + CepsString(t))
285  );
286  #endif
287  *dtv = -(Iion+IStim)/cm;
288 
289  // Diffusion fluxes
290  CepsReal JdiffNa = (y[_nass]-y[_nai])/2.;
291  CepsReal JdiffK = (y[_kss ]-y[_ki ])/2.;
292  CepsReal JdiffCa = (y[_cass]-y[_cai])/0.2;
293  //ryanodione receptor calcium induced calcium release from the jsr
294  CepsReal Jrel;
295  computeJrel(&Jrel,ICaL,y,dtyLin,dtyNLin,fraction);
296 
297  // Calcium Uptake via SERCA Pump
298  CepsReal Jup;
299  computeJup(&Jup,y,fraction);
300 
301  CepsReal Jtr = (y[_cansr]-y[_cajsr])/100.;
302 
303  // update concentration rates
304  {
305  CepsReal cmdnmax = 0.05;
307  cmdnmax *= 1.3;
308 
309  dtyLin [_nai] = 0.;
310  dtyNLin[_nai] = -(INa+INaL+3.0*INaCa_i+3.0*INaK+INab)*d[_acap]/(c[_F]*d[_vmyo])+JdiffNa*d[_vss]/d[_vmyo];
311 
312  dtyLin [_nass] = 0.;
313  dtyNLin[_nass] = -(ICaNa+3.0*INaCa_ss)*d[_acap]/(c[_F]*d[_vss])-JdiffNa;
314 
315  dtyLin [_ki] = 0.;
316  dtyNLin[_ki] = -(Ito+IKr+IKs+IK1+IKb+IStim-2.0*INaK)*d[_acap]/(c[_F]*d[_vmyo])+JdiffK*d[_vss]/d[_vmyo];
317 
318  dtyLin [_kss] = 0.;
319  dtyNLin[_kss] = -ICaK*d[_acap]/(c[_F]*d[_vss])-JdiffK;
320 
321  CepsReal kmcmdn = 0.00238;
322  CepsReal trpnmax = 0.07;
323  CepsReal kmtrpn = 0.0005;
324  CepsReal csqnmax = 10.0;
325  CepsReal kmcsqn = 0.8;
326  CepsReal Bcai = 1.0/(1.0+cmdnmax*kmcmdn/std::pow(kmcmdn+y[_cai],2.0)
327  +trpnmax*kmtrpn/std::pow(kmtrpn+y[_cai],2.0));
328  dtyLin [_cai] = 0.;
329  dtyNLin[_cai] = Bcai*(-(IpCa+ICab-2.0*INaCa_i)*d[_acap]/(2.0*c[_F]*d[_vmyo])
330  -Jup*d[_vnsr]/d[_vmyo]+JdiffCa*d[_vss]/d[_vmyo]);
331 
332  CepsReal BSRmax = 0.047;
333  CepsReal KmBSR = 0.00087;
334  CepsReal BSLmax = 1.124;
335  CepsReal KmBSL = 0.0087;
336  CepsReal Bcass = 1.0/(1.0+BSRmax*KmBSR/std::pow(KmBSR+y[_cass],2.0)
337  +BSLmax*KmBSL/std::pow(KmBSL+y[_cass],2.0));
338  dtyLin [_cass] = 0.;
339  dtyNLin[_cass] = Bcass*(-(ICaL-2.0*INaCa_ss)*d[_acap]/(2.0*c[_F]*d[_vss])+Jrel*d[_vjsr]/d[_vss]-JdiffCa);
340 
341  dtyLin [_cansr] = 0.;
342  dtyNLin[_cansr] = Jup - Jtr*d[_vjsr]/d[_vnsr];
343 
344  CepsReal Bcajsr = 1/(1+csqnmax*kmcsqn/std::pow(kmcsqn+y[_cajsr],2.0));
345  dtyLin [_cajsr] = 0.;
346  dtyNLin[_cajsr] = Bcajsr*(Jtr-Jrel);
347 
348  }
349 
350 }
351 
352 void
354 {
355 
356  CepsString key = "ORDMD16";
357 
358  m_constants[_IKr_factor ] = params->getReal(key+"IKr_factor ",m_constants[_IKr_factor ]);
359  m_constants[_IKs_factor ] = params->getReal(key+"IKs_factor ",m_constants[_IKs_factor ]);
360  m_constants[_IK1_factor ] = params->getReal(key+"IK1_factor ",m_constants[_IK1_factor ]);
361  m_constants[_ICaL_factor ] = params->getReal(key+"ICaL_factor ",m_constants[_ICaL_factor ]);
362  m_constants[_INaL_factor ] = params->getReal(key+"INaL_factor ",m_constants[_INaL_factor ]);
363  m_constants[_nao ] = params->getReal(key+"nao ",m_constants[_nao ]);
364  m_constants[_cao ] = params->getReal(key+"cao ",m_constants[_cao ]);
365  m_constants[_ko ] = params->getReal(key+"ko ",m_constants[_ko ]);
366  m_constants[_R ] = params->getReal(key+"R ",m_constants[_R ]);
367  m_constants[_T ] = params->getReal(key+"T ",m_constants[_T ]);
368  m_constants[_F ] = params->getReal(key+"F ",m_constants[_F ]);
369  m_constants[_L ] = params->getReal(key+"L ",m_constants[_L ]);
370  m_constants[_rad ] = params->getReal(key+"rad ",m_constants[_rad ]);
371  m_constants[_vmyo_fraction] = params->getReal(key+"vmyo_fraction",m_constants[_vmyo_fraction]);
372  m_constants[_vnsr_fraction] = params->getReal(key+"vnsr_fraction",m_constants[_vnsr_fraction]);
373  m_constants[_vjsr_fraction] = params->getReal(key+"vjsr_fraction",m_constants[_vjsr_fraction]);
374  m_constants[_vss_fraction ] = params->getReal(key+"vss_fraction ",m_constants[_vss_fraction ]);
375  m_constants[_drug ] = params->getReal(key+"drug ",m_constants[_drug ]);
376  m_constants[_ICNa ] = params->getReal(key+"ICNa ",m_constants[_ICNa ]);
377  m_constants[_hNa ] = params->getReal(key+"hNa ",m_constants[_hNa ]);
378  m_constants[_ICNaL ] = params->getReal(key+"ICNaL ",m_constants[_ICNaL ]);
379  m_constants[_hNaL ] = params->getReal(key+"hNaL ",m_constants[_hNaL ]);
380  m_constants[_ICto ] = params->getReal(key+"ICto ",m_constants[_ICto ]);
381  m_constants[_hto ] = params->getReal(key+"hto ",m_constants[_hto ]);
382  m_constants[_ICCal ] = params->getReal(key+"ICCal ",m_constants[_ICCal ]);
383  m_constants[_hCal ] = params->getReal(key+"hCal ",m_constants[_hCal ]);
384  m_constants[_ICKr ] = params->getReal(key+"ICKr ",m_constants[_ICKr ]);
385  m_constants[_hKr ] = params->getReal(key+"hKr ",m_constants[_hKr ]);
386  m_constants[_ICKs ] = params->getReal(key+"ICKs ",m_constants[_ICKs ]);
387  m_constants[_hKs ] = params->getReal(key+"hKs ",m_constants[_hKs ]);
388  m_constants[_ICK1 ] = params->getReal(key+"ICK1 ",m_constants[_ICK1 ]);
389  m_constants[_hK1 ] = params->getReal(key+"hK1 ",m_constants[_hK1 ]);
390  // Other constants are deduced from these ones
391 
392 }
393 
394 void
396  CepsReal* INa,
397  CepsReal* INaL,
398  CepsReal v,
399  CepsReal* y,
400  CepsReal* dtyLin,
401  CepsReal* dtyNLin,
402  CepsReal fraction
403 ) const
404 {
405  CepsReal wInfm = sigmoid(v,-(39.57+9.4),-7.5);
406  CepsReal taum = 1./(6.765*exp((v+11.64)/34.77) +8.552*exp(-(v+77.42)/5.955));
407  dtyLin [_m] = -1./taum;
408  dtyNLin[_m] = wInfm/taum;
409 
410  CepsReal wInfh = sigmoid(v,-78.5,6.22);
411  CepsReal tauhf = 1./(1.432e-5*exp(-(v+1.196)/6.285)+6.149*exp((v+0.5096)/20.27));
412  CepsReal tauhs = 1./(0.009794*exp(-(v+17.95)/28.05)+0.3343*exp((v+5.730)/56.66));
413  dtyLin [_hf] = -1./tauhf;
414  dtyNLin[_hf] = wInfh/tauhf;
415  dtyLin [_hs] = -1./tauhs;
416  dtyNLin[_hs] = wInfh/tauhs;
417 
418  CepsReal Ahf = 0.99;
419  CepsReal h = Ahf*y[_hf] +(1.-Ahf)*y[_hs];
420  CepsReal wInfj = wInfh;
421  CepsReal tauj = 2.038+1.0/(0.02136*exp(-(v+100.6)/8.281)+0.3052*exp((v+0.9941)/38.45));
422  dtyLin [_j] = -1./tauj;
423  dtyNLin[_j] = wInfj/tauj;
424 
425  CepsReal wInfhsp = sigmoid(v,-(78.5+6.2),6.22);
426  CepsReal tauhsp = 3.0*tauhs;
427  dtyLin [_hsp] = -1./tauhsp;
428  dtyNLin[_hsp] = wInfhsp/tauhsp;
429 
430  CepsReal hp = Ahf*y[_hf] + (1.-Ahf)*y[_hsp];
431  CepsReal taujp = 1.46*tauj;
432  dtyLin [_jp] = -1./taujp;
433  dtyNLin[_jp] = wInfj/taujp;
434 
435  CepsReal gNa = 31*m_dconstants[_gNaFrac];
436  CepsReal ENa = log(m_constants[_nao]/y[_nai])/m_dconstants[_FRT];
437  *INa = gNa*(v-ENa)*pow(y[_m],3.)*((1-fraction)*h*y[_j]+fraction*hp*y[_jp]);
438 
439  CepsReal wInfmL = sigmoid(v,-42.85,-5.264);
440  CepsReal taumL = taum;
441  dtyLin [_mL] = -1./taumL;
442  dtyNLin[_mL] = wInfmL/taumL;
443 
444  CepsReal wInfhL = sigmoid(v,-87.61,7.488);
445  CepsReal tauhL = 200.;
446  dtyLin [_hL] = -1./tauhL;
447  dtyNLin[_hL] = wInfhL/tauhL;
448 
449  CepsReal wInfhLp = sigmoid(v,-93.81,7.488);
450  CepsReal tauhLp = 3.*tauhL;
451  dtyLin [_hLp] = -1./tauhLp;
452  dtyNLin[_hLp] = wInfhLp/tauhLp;
453 
456  gNaL *= 0.6;
457  *INaL = gNaL*(v-ENa)*y[_mL]*((1.-fraction)*y[_hL]+fraction*y[_hLp]);
458 
459  return;
460 
461 }
462 
463 void
465  CepsReal* Ito,
466  CepsReal v,
467  CepsReal* y,
468  CepsReal* dtyLin,
469  CepsReal* dtyNLin,
470  CepsReal fraction
471 ) const
472 {
473 
474  CepsReal wInfa = sigmoid(v,14.34,-14.82);
475  CepsReal taua = 1.0515/(sigmoid(v,18.4099,-29.3814)/1.2089 + sigmoid(v,-100,29.3814)*3.5);
476  dtyLin [_a] = -1./taua;
477  dtyNLin[_a] = wInfa/taua;
478 
479  CepsReal wInfi = sigmoid(v,-43.95,5.711);
480  CepsReal deltaEpi = 1.;
482  deltaEpi -= 0.95*sigmoid(v,-70,5.);
483  CepsReal tauiF = deltaEpi*(4.562+1/(0.3933*exp((-(v+100.0))/100.0)+0.08004*exp((v+50.0)/16.59)));
484  CepsReal tauiS = deltaEpi*(23.62+1/(0.001416*exp((-(v+96.52))/59.05)+1.780e-8*exp((v+114.1)/8.079)));
485  dtyLin [_iF] = -1./tauiF;
486  dtyNLin[_iF] = wInfi/tauiF;
487  dtyLin [_iS] = -1./tauiS;
488  dtyNLin[_iS] = wInfi/tauiS;
489 
490  CepsReal AiF = sigmoid(v,213.6,151.2);
491  CepsReal i = AiF*y[_iF]+(1.-AiF)*y[_iS];
492  CepsReal wInfap = sigmoid(v,24.34,-14.82);
493  dtyLin [_ap] = -1./taua;
494  dtyNLin[_ap] = wInfap/taua;
495 
496  CepsReal dtiDevelop = 1.354+1.0e-4/(exp((v-167.4)/15.89)+exp(-(v-12.23)/0.2154));
497  CepsReal dtiRecover = 1.0-0.5*sigmoid(v,-70,20);
498  CepsReal tauiFp = dtiDevelop*dtiRecover*tauiF;
499  CepsReal tauiSp = dtiDevelop*dtiRecover*tauiS;
500  dtyLin [_iFp] = -1./tauiFp;
501  dtyNLin[_iFp] = wInfi/tauiFp;
502  dtyLin [_iSp] = -1./tauiSp;
503  dtyNLin[_iSp] = wInfi/tauiSp;
504 
505  CepsReal ip = AiF*y[_iFp]+(1.-AiF)*y[_iSp];
506  CepsReal gto = 0.02*m_dconstants[_gtoFrac];
507  CepsReal EK = log(m_constants[_ko ]/y[_ki ])/m_dconstants[_FRT];
509  gto *= 4.0;
510  *Ito = gto*(v-EK)*((1-fraction)*i*y[_a]+fraction*ip*y[_ap]);
511 
512  return;
513 
514 }
515 
516 
517 void
519  CepsReal* ICaL,
520  CepsReal* ICaNa,
521  CepsReal* ICaK,
522  CepsReal v,
523  CepsReal* y,
524  CepsReal* dtyLin,
525  CepsReal* dtyNLin,
526  CepsReal fraction
527 ) const
528 {
529 
530  CepsReal wInfd = sigmoid(v,-3.940,-4.23);
531  CepsReal taud = 0.6+1.0/(exp(-0.05*(v+6.0))+exp(0.09*(v+14.0)));
532  dtyLin [_d] = -1./taud;
533  dtyNLin[_d] = wInfd/taud;
534 
535  CepsReal wInff = sigmoid(v,-19.58,3.696);
536  CepsReal tauff = 7.0+1.0/(0.0045*exp(-(v+20.0)/10.0)+0.0045*exp((v+20.0)/10.0));
537  CepsReal taufs = 1000.0+1.0/(0.000035*exp(-(v+5.0)/4.0)+0.000035*exp((v+5.0)/6.0));
538  dtyLin [_ff] = -1./tauff;
539  dtyNLin[_ff] = wInff/tauff;
540  dtyLin [_fs] = -1./taufs;
541  dtyNLin[_fs] = wInff/taufs;
542 
543  CepsReal wInffca = wInff;
544  CepsReal taufcaf = 7.0+1.0/(0.04*exp(-(v-4.0)/7.0)+0.04*exp((v-4.0)/7.0));
545  CepsReal taufcas = 100.0+1.0/(0.00012*exp(-v/3.0)+0.00012*exp(v/7.0));
546  dtyLin [_fcaf] = -1./taufcaf;
547  dtyNLin[_fcaf] = wInffca/taufcaf;
548  dtyLin [_fcas] = -1./taufcas;
549  dtyNLin[_fcas] = wInffca/taufcas;
550 
551  CepsReal taujca = 75.;
552  dtyLin [_jca] = -1./taujca;
553  dtyNLin[_jca] = wInffca/taujca;
554 
555  CepsReal tauffp = 2.5*tauff;
556  dtyLin [_ffp] = -1./tauffp;
557  dtyNLin[_ffp] = wInff/tauffp;
558 
559  CepsReal taufcafp = 2.5*taufcaf;
560  dtyLin [_fcafp] = -1./taufcafp;
561  dtyNLin[_fcafp] = wInffca/taufcafp;
562 
563  CepsReal Aff = 0.6;
564  CepsReal f = Aff*y[_ff]+(1.-Aff)*y[_fs];
565  CepsReal Afcaf = 0.3+0.6*sigmoid(v,10.,10.);
566  CepsReal fca = Afcaf*y[_fcaf ]+(1.-Afcaf)*y[_fcas];
567  CepsReal fp = Aff *y[_ffp ]+(1.-Aff )*y[_fs ];
568  CepsReal fcap = Afcaf*y[_fcafp]+(1.-Afcaf)*y[_fcas];
569  CepsReal Kmn = 0.002;
570  CepsReal k2n = 1000.0;
571  CepsReal km2n = y[_jca];
572  CepsReal anca = 1./(k2n/km2n+pow(1+Kmn/y[_cass],4.));
573  dtyLin [_nca] = -km2n;
574  dtyNLin[_nca] = anca*k2n;
575 
576  CepsReal vfrt = v*m_dconstants[_FRT];
577  CepsReal vffrt = vfrt*m_constants[_F];
578  CepsReal e1vfrt = exp(vfrt);
579  CepsReal e2vfrt = e1vfrt*e1vfrt;
580  CepsReal phiCaL = 4.0*vffrt*( y[_cass]*e2vfrt-0.341*m_constants[_cao])/(e2vfrt-1);
581  CepsReal phiCaNa = 1.0*vffrt*(0.75*y[_nass]*e1vfrt-0.750*m_constants[_nao])/(e1vfrt-1);
582  CepsReal phiCaK = 1.0*vffrt*(0.75*y[_kss ]*e1vfrt-0.750*m_constants[_ko ])/(e1vfrt-1);
583  CepsReal PCa = 1.e-4;
585  PCa *= 1.2;
586  else if (m_type==ORdmD16::Type::MidMyo)
587  PCa *= 2.5;
588  CepsReal PCap = 1.100e+0*PCa;
589  CepsReal PCaNa = 1.250e-3*PCa;
590  CepsReal PCaK = 3.574e-4*PCa;
591  CepsReal PCaNap = 1.250e-3*PCap;
592  CepsReal PCaKp = 3.574e-4*PCap;
593 
594  *ICaNa = (1.0-fraction)*PCaNa *phiCaNa*y[_d]*(f *(1.0-y[_nca])+y[_jca]*fca *y[_nca])
595  + fraction *PCaNap*phiCaNa*y[_d]*(fp*(1.0-y[_nca])+y[_jca]*fcap*y[_nca]);
596  *ICaK = (1.0-fraction)*PCaK *phiCaK *y[_d]*(f *(1.0-y[_nca])+y[_jca]*fca *y[_nca])
597  + fraction *PCaKp *phiCaK *y[_d]*(fp*(1.0-y[_nca])+y[_jca]*fcap*y[_nca]);
598  *ICaL = (1.0-fraction)*PCa *phiCaL *y[_d]*(f *(1.0-y[_nca])+y[_jca]*fca *y[_nca])
599  + fraction *PCap *phiCaL *y[_d]*(fp*(1.0-y[_nca])+y[_jca]*fcap*y[_nca]);
601 
602  return;
603 
604 }
605 
606 void
608  CepsReal* IKr,
609  CepsReal v,
610  CepsReal* y,
611  CepsReal* dtyLin,
612  CepsReal* dtyNLin
613 ) const
614 {
615 
616  CepsReal wInfxr = sigmoid(v,-8.337,-6.789);
617  CepsReal tauxrf = 12.98+1.0/(0.3652*exp((v-31.66)/3.869)+4.123e-5*exp((-(v-47.78))/20.38));
618  CepsReal tauxrs = 1.865+1.0/(0.06629*exp((v-34.70)/7.355)+1.128e-5*exp((-(v-29.74))/25.94));
619  dtyLin [_xrf] = -1./tauxrf;
620  dtyNLin[_xrf] = wInfxr/tauxrf;
621  dtyLin [_xrs] = -1./tauxrs;
622  dtyNLin[_xrs] = wInfxr/tauxrs;
623 
624  CepsReal Axrf = sigmoid(v,-54.81,38.21);
625  CepsReal xr = Axrf*y[_xrf] + (1-Axrf)*y[_xrs];
626  CepsReal rkr = sigmoid(v,-55,75)*sigmoid(v,10,30);
627  CepsReal EK = log(m_constants[_ko ]/y[_ki ])/m_dconstants[_FRT];
630  GKr *= 1.3;
631  else if (m_type==ORdmD16::Type::MidMyo)
632  GKr *= 0.8;
633  *IKr = GKr*sqrt(m_constants[_ko]/5.4)*xr*rkr*(v-EK);
634 
635  return;
636 
637 }
638 
639 void
641  CepsReal* IKs,
642  CepsReal v,
643  CepsReal* y,
644  CepsReal* dtyLin,
645  CepsReal* dtyNLin
646 ) const
647 {
648 
649  CepsReal wInfxs1 = sigmoid(v,-11.60,-8.932);
650  CepsReal tauxs1 = 817.3+1.0/(2.326e-4*exp((v+48.28)/17.80)+0.001292*exp((-(v+210.0))/230.0));
651  dtyLin [_xs1] = -1./tauxs1;
652  dtyNLin[_xs1] = wInfxs1/tauxs1;
653 
654  CepsReal wInfxs2 = wInfxs1;
655  CepsReal tauxs2 = 1.0/(0.01*exp((v-50.0)/20.0)+0.0193*exp((-(v+66.54))/31.0));
656  dtyLin [_xs2] = -1./tauxs2;
657  dtyNLin[_xs2] = wInfxs2/tauxs2;
658 
659  CepsReal KsCa = 1.0+0.6/(1.0+std::pow(3.8e-5/y[_cai],1.4));
661  /(y[_ki ]+m_constants[_PKNa]*y[_nai]))/m_dconstants[_FRT];
664  GKs *= 1.4;
665  *IKs = GKs*KsCa*y[_xs1]*y[_xs2]*(v-EKs);
666 
667  return;
668 
669 }
670 
671 void
673  CepsReal* IK1,
674  CepsReal v,
675  CepsReal* y,
676  CepsReal* dtyLin,
677  CepsReal* dtyNLin
678 ) const
679 {
680 
681  CepsReal wInfxk1 = sigmoid(v,-2.5538*m_constants[_ko]-144.59,-1.5692*m_constants[_ko]-3.8115);
682  CepsReal tauxk1 = 122.2/(exp((-(v+127.2))/20.36)+exp((v+236.8)/69.33));
683  dtyLin [_xk1] = -1./tauxk1;
684  dtyNLin[_xk1] = wInfxk1/tauxk1;
685 
686  CepsReal rk1 = sigmoid(v,-105.8+2.6*m_constants[_ko],9.493);
687  CepsReal EK = log(m_constants[_ko ]/y[_ki ])/m_dconstants[_FRT];
690  GK1 *= 1.2;
691  else if (m_type==ORdmD16::Type::MidMyo)
692  GK1 *= 1.3;
693  *IK1 = GK1*sqrt(m_constants[_ko])*rk1*y[_xk1]*(v-EK);
694 
695  return;
696 
697 }
698 
699 void
700 ORdmD16::computeINaCa(CepsReal* INaCa_i, CepsReal* INaCa_ss, CepsReal v, CepsReal* y) const
701 {
702  *INaCa_i = 0.8*computeINaCaInternal(v,y[_nai ],y[_cai ]);
703  *INaCa_ss = 0.2*computeINaCaInternal(v,y[_nass],y[_cass]);
704  return;
705 }
706 
707 CepsReal
709 {
710 
711  CepsReal kna1 = 15.0;
712  CepsReal kna2 = 5.0;
713  CepsReal kna3 = 88.12;
714  CepsReal kasymm = 12.5;
715  CepsReal wna = 6.e4;
716  CepsReal wca = 6.e4;
717  CepsReal wnaca = 5.e3;
718  CepsReal kcaon = 1.5e6;
719  CepsReal kcaoff = 5.e3;
720  CepsReal qca = 0.1670;
721  CepsReal qna = 0.5224;
722  CepsReal hca = exp(qca*v*m_dconstants[_FRT]);
723  CepsReal hna = exp(qna*v*m_dconstants[_FRT]);
724 
725  CepsReal h1 = 1+na/kna3*(1+hna);
726  CepsReal h2 = na*hna/(kna3*h1);
727  CepsReal h3 = 1.0/h1;
728  CepsReal h4 = 1.0+na/kna1*(1+na/kna2);
729  CepsReal h5 = na*na/(h4*kna1*kna2);
730  CepsReal h6 = 1.0/h4;
731  CepsReal h7 = 1.0+m_constants[_nao]/kna3*(1.0+1.0/hna);
732  CepsReal h8 = m_constants[_nao]/(kna3*hna*h7);
733  CepsReal h9 = 1.0/h7;
734  CepsReal h10 = kasymm+1.0+m_constants[_nao]/kna1*(1.0+m_constants[_nao]/kna2);
735  CepsReal h11 = m_constants[_nao]*m_constants[_nao]/(h10*kna1*kna2);
736  CepsReal h12 = 1.0/h10;
737  CepsReal k1 = h12*m_constants[_cao]*kcaon;
738  CepsReal k2 = kcaoff;
739  CepsReal k3p = h9*wca;
740  CepsReal k3pp = h8*wnaca;
741  CepsReal k3 = k3p+k3pp;
742  CepsReal k4p = h3*wca/hca;
743  CepsReal k4pp = h2*wnaca;
744  CepsReal k4 = k4p+k4pp;
745  CepsReal k5 = kcaoff;
746  CepsReal k6 = h6*ca*kcaon;
747  CepsReal k7 = h5*h2*wna;
748  CepsReal k8 = h8*h11*wna;
749  CepsReal x1 = k2*k4*(k7+k6)+k5*k7*(k2+k3);
750  CepsReal x2 = k1*k7*(k4+k5)+k4*k6*(k1+k8);
751  CepsReal x3 = k1*k3*(k7+k6)+k8*k6*(k2+k3);
752  CepsReal x4 = k2*k8*(k4+k5)+k3*k5*(k1+k8);
753  CepsReal E1 = x1/(x1+x2+x3+x4);
754  CepsReal E2 = x2/(x1+x2+x3+x4);
755  CepsReal E3 = x3/(x1+x2+x3+x4);
756  CepsReal E4 = x4/(x1+x2+x3+x4);
757  CepsReal KmCaAct = 150.0e-6;
758  CepsReal allo = 1.0/(1.0+pow(KmCaAct/ca,2.0));
759  CepsReal JncxNa = 3.0*(E4*k7-E1*k8)+E3*k4pp-E2*k3pp;
760  CepsReal JncxCa = E2*k2-E1*k1;
761  CepsReal zna = 1.0;
762  CepsReal zca = 2.0;
763  CepsReal Gncx = 0.0008;
765  Gncx *= 1.1;
766  else if (m_type==ORdmD16::Type::MidMyo)
767  Gncx *= 1.4;
768  return Gncx*allo*(zna*JncxNa+zca*JncxCa);
769 
770 }
771 
772 void
774 {
775 
776  CepsReal k1p = 949.5;
777  CepsReal k1m = 182.4;
778  CepsReal k2p = 687.2;
779  CepsReal k2m = 39.4;
780  CepsReal k3p = 1899.0;
781  CepsReal k3m = 79300.0;
782  CepsReal k4p = 639.0;
783  CepsReal k4m = 40.0;
784  CepsReal Knai0 = 9.073;
785  CepsReal Knao0 = 27.78;
786  CepsReal delta = -0.1550;
787  CepsReal evfrt = exp(v*m_dconstants[_FRT]/3.0);
788  CepsReal Knai = Knai0*pow(evfrt, delta);
789  CepsReal Knao = Knao0*pow(evfrt,1-delta);
790  CepsReal Kki = 0.5;
791  CepsReal Kko = 0.3582;
792  CepsReal MgADP = 0.05;
793  CepsReal MgATP = 9.8;
794  CepsReal Kmgatp = 1.698e-7;
795  CepsReal H = 1.0e-7;
796  CepsReal eP = 4.2;
797  CepsReal Khp = 1.698e-7;
798  CepsReal Knap = 224.0;
799  CepsReal Kxkur = 292.0;
800  CepsReal P = eP/(1.0+H/Khp+y[_nai]/Knap+y[_ki]/Kxkur);
801  CepsReal a1 = k1p*pow(y[_nai]/Knai,3.0)/(pow(1.0+y[_nai]/Knai,3.0)+pow(1.0+y[_ki]/Kki,2.0)-1.0);
802  CepsReal b1 = k1m*MgADP;
803  CepsReal a2 = k2p;
804  CepsReal b2 = k2m*pow(m_constants[_nao]/Knao,3.0)/(pow(1.0+m_constants[_nao]/Knao,3.0)+pow(1.0+y[_ko]/Kko,2.0)-1.0);
805  CepsReal a3 = k3p*pow(m_constants[_ko ]/Kko ,2.0)/(pow(1.0+m_constants[_nao]/Knao,3.0)+pow(1.0+y[_ko]/Kko,2.0)-1.0);
806  CepsReal b3 = k3m*P*H/(1.0+MgATP/Kmgatp);
807  CepsReal a4 = k4p*MgATP/Kmgatp/(1.0+MgATP/Kmgatp);
808  CepsReal b4 = k4m*pow(y[_ki]/Kki,2.0)/(pow(1.0+y[_nai]/Knai,3.0)+pow(1.0+y[_ki]/Kki,2.0)-1.0);
809  CepsReal x1 = a4*a1*a2+b2*b4*b3+a2*b4*b3+b3*a1*a2;
810  CepsReal x2 = b2*b1*b4+a1*a2*a3+a3*b1*b4+a2*a3*b4;
811  CepsReal x3 = a2*a3*a4+b3*b2*b1+b2*b1*a4+a3*a4*b1;
812  CepsReal x4 = b4*b3*b2+a3*a4*a1+b2*a4*a1+b3*b2*a1;
813  CepsReal E1 = x1/(x1+x2+x3+x4);
814  CepsReal E2 = x2/(x1+x2+x3+x4);
815  CepsReal E3 = x3/(x1+x2+x3+x4);
816  CepsReal E4 = x4/(x1+x2+x3+x4);
817  CepsReal zk = 1.0;
818  CepsReal JnakNa = 3.0*(E1*a3-E2*b3);
819  CepsReal JnakK = 2.0*(E4*b1-E3*a1);
820  CepsReal Pnak = 30;
821  CepsReal zna = 1.0;
823  Pnak *= 0.9;
824  else if (m_type==ORdmD16::Type::MidMyo)
825  Pnak *= 0.7;
826 
827  *INaK = Pnak*(zna*JnakNa+zk*JnakK);
828 
829  return;
830 }
831 
832 void
834 {
835  CepsReal xkb = sigmoid(v,14.48,-18.34);
836  CepsReal EK = log(m_constants[_ko ]/y[_ki ])/m_dconstants[_FRT];
837  CepsReal GKb = 0.003;
839  GKb *= 0.6;
840  *IKb = GKb*xkb*(v-EK);
841 
842  CepsReal vfrt = v*m_dconstants[_FRT];
843  CepsReal vffrt = vfrt*m_constants[_F];
844  CepsReal e1vfrt = exp(vfrt);
845  CepsReal e2vfrt = e1vfrt*e1vfrt;
846 
847  CepsReal PNab = 3.75e-10;
848  CepsReal PCab = 2.5e-8;
849  *INab = PNab*1.0*vffrt*(y[_nai]*e1vfrt- m_constants[_nao])/(e1vfrt-1);
850  *ICab = PCab*4.0*vffrt*(y[_cai]*e2vfrt-0.341*m_constants[_cao])/(e2vfrt-1);
851  return;
852 }
853 
854 void
856 {
857  CepsReal GpCa = 5.e-4;
858  *IPCa = GpCa*y[_cai]/(5.e-4+y[_cai]);
859 }
860 
861 void
863  CepsReal* Jrel,
864  CepsReal ICaL,
865  CepsReal* y,
866  CepsReal* dtyLin,
867  CepsReal* dtyNLin,
868  CepsReal fraction
869 ) const
870 {
871  CepsReal bt = 4.75;
872  CepsReal a_rel = 0.5*bt;
873  CepsReal wInfJrel = -a_rel*ICaL/(1.0+pow(1.5/y[_cajsr],8.0));
875  wInfJrel *= 1.7;
876  CepsReal tauJrel = std::max(0.001,bt/(1.0+0.0123/y[_cajsr]));
877  dtyLin [_Jrelnp] = -1/tauJrel;
878  dtyNLin[_Jrelnp] = wInfJrel/tauJrel;
879 
880  CepsReal btp = 1.25*bt;
881  CepsReal a_relp = 0.5*btp;
882  CepsReal wInfJrelp = -a_relp*ICaL/(1.0+pow(1.5/y[_cajsr],8.0));
884  wInfJrelp *= 1.7;
885  CepsReal tauJrelp = std::max(0.001,btp/(1.0+0.0123/y[_cajsr]));
886  dtyLin [_Jrelp] = -1/tauJrelp;
887  dtyNLin[_Jrelp] = wInfJrelp/tauJrelp;
888  *Jrel = (1-fraction)*y[_Jrelnp] + fraction*y[_Jrelp];
889 
890  return;
891 }
892 
893 void
895 {
896  CepsReal Jupnp = 0.004375*y[_cai]/(y[_cai]+0.00092);
897  CepsReal Jupp = 2.75*0.004375*y[_cai]/(y[_cai]+0.00092-0.00017);
899  {
900  Jupnp *= 1.3;
901  Jupp *= 1.3;
902  }
903  CepsReal Jleak = 0.0039375*y[_cansr]/15.;
904  *Jup = (1-fraction)*Jupnp + fraction*Jupp - Jleak;
905 
906  return;
907 }
908 
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 m_paperStim
Original stim amplitude.
CepsReal * m_dconstants
Constant parameters of the model, computed from others.
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.
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...
Reads and stores simulation configuration.
CepsReal getReal(const keyType &key) const
Reads a floating point value from configuration.
static constexpr const CepsInt _vnsr
Index alias.
Definition: ORdmD16.hpp:243
void computeBgCurrents(CepsReal *IKb, CepsReal *INab, CepsReal *ICab, CepsReal v, CepsReal *y) const
Background currents.
Definition: ORdmD16.cpp:833
static constexpr const CepsInt _hLp
Index alias.
Definition: ORdmD16.hpp:178
static constexpr const CepsInt _R
Index alias.
Definition: ORdmD16.hpp:212
void computeIKr(CepsReal *IKr, CepsReal v, CepsReal *y, CepsReal *dtyLin, CepsReal *dtyNLin) const
Rapid Delayed Rectifier K+ Current.
Definition: ORdmD16.cpp:607
static constexpr const CepsInt _ICK1
Index alias.
Definition: ORdmD16.hpp:234
static constexpr const CepsInt _hs
Index alias.
Definition: ORdmD16.hpp:172
static constexpr const CepsInt _hNaL
Index alias.
Definition: ORdmD16.hpp:225
static constexpr const CepsInt _xs2
Index alias.
Definition: ORdmD16.hpp:197
void setupWithParameters(InputParameters *p)
Sets the constants and the space dependant parameters from text inputs.
Definition: ORdmD16.cpp:353
static constexpr const CepsInt _T
Index alias.
Definition: ORdmD16.hpp:213
void computeICa(CepsReal *ICaL, CepsReal *ICaNa, CepsReal *ICaK, CepsReal v, CepsReal *y, CepsReal *dtyLin, CepsReal *dtyNLin, CepsReal fraction) const
L-type Ca2+ channel.
Definition: ORdmD16.cpp:518
static constexpr const CepsInt _acap
Index alias.
Definition: ORdmD16.hpp:241
static constexpr const CepsInt _hK1
Index alias.
Definition: ORdmD16.hpp:235
static constexpr const CepsInt _vcell
Index alias.
Definition: ORdmD16.hpp:239
static constexpr const CepsInt _hf
Index alias.
Definition: ORdmD16.hpp:171
static constexpr const CepsInt _gtoFrac
Index alias.
Definition: ORdmD16.hpp:249
static constexpr const CepsInt _ko
Index alias.
Definition: ORdmD16.hpp:211
static constexpr const CepsInt _ICCal
Index alias.
Definition: ORdmD16.hpp:228
static constexpr const CepsInt _gNaFrac
Index alias.
Definition: ORdmD16.hpp:247
static constexpr const CepsInt _j
Index alias.
Definition: ORdmD16.hpp:173
static constexpr const CepsInt _cass
Index alias.
Definition: ORdmD16.hpp:167
static constexpr const CepsInt _d
Index alias.
Definition: ORdmD16.hpp:185
static constexpr const CepsInt _nass
Index alias.
Definition: ORdmD16.hpp:163
static constexpr const CepsInt _IKs_factor
Index alias.
Definition: ORdmD16.hpp:205
void computeIto(CepsReal *Ito, CepsReal v, CepsReal *y, CepsReal *dtyLin, CepsReal *dtyNLin, CepsReal fraction) const
Transient outward K+ current.
Definition: ORdmD16.cpp:464
static constexpr const CepsInt _kss
Index alias.
Definition: ORdmD16.hpp:165
CepsReal computeINaCaInternal(CepsReal v, CepsReal na, CepsReal ca) const
Internal function to avoid duplication.
Definition: ORdmD16.cpp:708
static constexpr const CepsInt _ICNaL
Index alias.
Definition: ORdmD16.hpp:224
static constexpr const CepsInt _FRT
Index alias.
Definition: ORdmD16.hpp:246
void computeINaK(CepsReal *INaK, CepsReal v, CepsReal *y) const
Sodium/Potassium ATPase Current.
Definition: ORdmD16.cpp:773
static constexpr const CepsInt _a
Index alias.
Definition: ORdmD16.hpp:179
static constexpr const CepsInt _iF
Index alias.
Definition: ORdmD16.hpp:180
static constexpr const CepsInt _gCalFrac
Index alias.
Definition: ORdmD16.hpp:250
static constexpr const CepsInt _xrs
Index alias.
Definition: ORdmD16.hpp:195
static constexpr const CepsInt _hKs
Index alias.
Definition: ORdmD16.hpp:233
static constexpr const CepsInt _vnsr_fraction
Index alias.
Definition: ORdmD16.hpp:218
static constexpr const CepsInt _vjsr_fraction
Index alias.
Definition: ORdmD16.hpp:219
static constexpr const CepsInt _cajsr
Index alias.
Definition: ORdmD16.hpp:169
void computeJrel(CepsReal *Jrel, CepsReal ICaL, CepsReal *y, CepsReal *dtyLin, CepsReal *dtyNLin, CepsReal fraction) const
SR Calcium Release Flux, via Ryanodine Receptor.
Definition: ORdmD16.cpp:862
static constexpr const CepsInt _fcaf
Index alias.
Definition: ORdmD16.hpp:188
static constexpr const CepsInt _vjsr
Index alias.
Definition: ORdmD16.hpp:244
static constexpr const CepsInt _ff
Index alias.
Definition: ORdmD16.hpp:186
void getInitialCondition(CepsReal *v, CepsReal *y) const final
Sets initial values of state variables and transmembrane voltage for a single point....
Definition: ORdmD16.cpp:163
static constexpr const CepsInt _gNaLFrac
Index alias.
Definition: ORdmD16.hpp:248
static constexpr const CepsInt _hsp
Index alias.
Definition: ORdmD16.hpp:174
static constexpr const CepsInt _xs1
Index alias.
Definition: ORdmD16.hpp:196
static constexpr const CepsInt _vss
Index alias.
Definition: ORdmD16.hpp:245
static constexpr const CepsInt _gK1Frac
Index alias.
Definition: ORdmD16.hpp:253
static constexpr const CepsInt _fcas
Index alias.
Definition: ORdmD16.hpp:189
static constexpr const CepsInt _nca
Index alias.
Definition: ORdmD16.hpp:191
static constexpr const CepsInt _iFp
Index alias.
Definition: ORdmD16.hpp:183
static constexpr const CepsInt _ICKs
Index alias.
Definition: ORdmD16.hpp:232
static constexpr const CepsInt _iS
Index alias.
Definition: ORdmD16.hpp:181
static constexpr const CepsInt _nao
Index alias.
Definition: ORdmD16.hpp:209
static constexpr const CepsInt _rad
Index alias.
Definition: ORdmD16.hpp:216
static constexpr const CepsInt _IKr_factor
Index alias.
Definition: ORdmD16.hpp:204
Type m_type
Celltype selector (endo, epi, midmyo)
Definition: ORdmD16.hpp:159
static constexpr const CepsInt _CaMKt
Index alias.
Definition: ORdmD16.hpp:201
static constexpr const CepsInt _ICNa
Index alias.
Definition: ORdmD16.hpp:222
static constexpr const CepsInt _fcafp
Index alias.
Definition: ORdmD16.hpp:193
static constexpr const CepsInt _ffp
Index alias.
Definition: ORdmD16.hpp:192
static constexpr const CepsInt _ICKr
Index alias.
Definition: ORdmD16.hpp:230
static constexpr const CepsInt _vmyo
Index alias.
Definition: ORdmD16.hpp:242
static constexpr const CepsInt _mL
Index alias.
Definition: ORdmD16.hpp:176
static constexpr const CepsInt _Jrelnp
Index alias.
Definition: ORdmD16.hpp:199
static constexpr const CepsInt _ki
Index alias.
Definition: ORdmD16.hpp:164
static constexpr const CepsInt _nai
Index alias.
Definition: ORdmD16.hpp:162
static constexpr const CepsInt _jca
Index alias.
Definition: ORdmD16.hpp:190
void computeINa(CepsReal *INa, CepsReal *iNaL, CepsReal v, CepsReal *y, CepsReal *dtyLin, CepsReal *dtyNLin, CepsReal fraction) const
Fast Na+ current and Late Na+ current.
Definition: ORdmD16.cpp:395
static constexpr const CepsInt _gKrFrac
Index alias.
Definition: ORdmD16.hpp:251
static constexpr const CepsInt _hto
Index alias.
Definition: ORdmD16.hpp:227
static constexpr const CepsInt _hCal
Index alias.
Definition: ORdmD16.hpp:229
static constexpr const CepsInt _m
Index alias.
Definition: ORdmD16.hpp:170
static constexpr const CepsInt _Jrelp
Index alias.
Definition: ORdmD16.hpp:200
static constexpr const CepsInt _ap
Index alias.
Definition: ORdmD16.hpp:182
static constexpr const CepsInt _vmyo_fraction
Index alias.
Definition: ORdmD16.hpp:217
static constexpr const CepsInt _ICto
Index alias.
Definition: ORdmD16.hpp:226
static constexpr const CepsInt _INaL_factor
Index alias.
Definition: ORdmD16.hpp:208
static constexpr const CepsInt _xrf
Index alias.
Definition: ORdmD16.hpp:194
static constexpr const CepsInt _hNa
Index alias.
Definition: ORdmD16.hpp:223
void computeIPCa(CepsReal *IPCa, CepsReal *y) const
Sarsolemmal calcium pump current.
Definition: ORdmD16.cpp:855
static constexpr const CepsInt _vss_fraction
Index alias.
Definition: ORdmD16.hpp:220
ORdmD16(const Type &type, Unknown *u, const CepsSet< CepsAttribute > &attrs={}, InputParameters *params=nullptr)
Constructor (sets constants)
Definition: ORdmD16.cpp:40
static constexpr const CepsInt _gKsFrac
Index alias.
Definition: ORdmD16.hpp:252
static constexpr const CepsInt _cao
Index alias.
Definition: ORdmD16.hpp:210
static constexpr const CepsInt _cansr
Index alias.
Definition: ORdmD16.hpp:168
void computeJup(CepsReal *Jup, CepsReal *y, CepsReal fraction) const
Calcium Uptake via SERCA Pump.
Definition: ORdmD16.cpp:894
Type
Model variant selector.
Definition: ORdmD16.hpp:52
@ Epi
Model variant selector.
@ MidMyo
Model variant selector.
@ Endo
Model variant selector.
static constexpr const CepsInt _ageo
Index alias.
Definition: ORdmD16.hpp:240
static constexpr const CepsInt _IK1_factor
Index alias.
Definition: ORdmD16.hpp:206
static constexpr const CepsInt _jp
Index alias.
Definition: ORdmD16.hpp:175
static constexpr const CepsInt _xk1
Index alias.
Definition: ORdmD16.hpp:198
static constexpr const CepsInt _hKr
Index alias.
Definition: ORdmD16.hpp:231
static constexpr const CepsInt _L
Index alias.
Definition: ORdmD16.hpp:215
void computeIKs(CepsReal *IKs, CepsReal v, CepsReal *y, CepsReal *dtyLin, CepsReal *dtyNLin) const
Slow Delayed Rectifier K+ Current.
Definition: ORdmD16.cpp:640
static constexpr const CepsInt _ICaL_factor
Index alias.
Definition: ORdmD16.hpp:207
static constexpr const CepsInt _fs
Index alias.
Definition: ORdmD16.hpp:187
static constexpr const CepsInt _F
Index alias.
Definition: ORdmD16.hpp:214
static constexpr const CepsInt _drug
Index alias.
Definition: ORdmD16.hpp:221
void computeRates(CepsReal t, CepsReal *y, CepsReal *v, CepsReal *dtyL, CepsReal *dtyNL, CepsReal *dtv, DegreeOfFreedom *dof) const override
Get the linear and non linear part of the evolution function f. Also computes the ionic current.
Definition: ORdmD16.cpp:209
void computeINaCa(CepsReal *INaCa_i, CepsReal *INaCa_ss, CepsReal v, CepsReal *y) const
Na+/Ca2+ exchanger.
Definition: ORdmD16.cpp:700
static constexpr const CepsInt _PKNa
Index alias.
Definition: ORdmD16.hpp:236
void computeIK1(CepsReal *IK1, CepsReal v, CepsReal *y, CepsReal *dtyLin, CepsReal *dtyNLin) const
Inward Rectifier K+ Current.
Definition: ORdmD16.cpp:672
static constexpr const CepsInt _hL
Index alias.
Definition: ORdmD16.hpp:177
static constexpr const CepsInt _iSp
Index alias.
Definition: ORdmD16.hpp:184
static constexpr const CepsInt _cai
Index alias.
Definition: ORdmD16.hpp:166
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
const _Type & max(const CepsVector< _Type, _Alloc > &vec)
Returns the maximum of the vector, const version.
Definition: CepsVector.hpp:464
void checkNanOrInf(CepsReal v, CepsString message="")
Stops if value is NaN or infty.