43 "Passed pointer to cardiac problem is null"
46 m_name =
"Beeler-Reuter 1977";
51 "CaI [concentration units]",
66 dico->
add(
"br77gNa" ,
"CONSTANT 4.e-2");
67 dico->
add(
"br77gNaCa",
"CONSTANT 3.e-5");
79 m_gNa = ceps::getNew<ScalarField<DegreeOfFreedom>>(dico->
getScalar(
"br77gNa" ),&dofs,
true);
80 m_gNaCa = ceps::getNew<ScalarField<DegreeOfFreedom>>(dico->
getScalar(
"br77gNaCa"),&dofs,
true);
87 m_gNa ->computeSupport(&selec);
88 m_gNaCa->computeSupport(&selec);
125 alpha = -(v+47.)/std::expm1(-0.1*(v+47.));
126 beta = 40*std::exp(-0.056*(v+72.));
127 dtyLin [
_m] = -alpha-beta;
130 alpha = 0.126*std::exp(-0.25*(v+77.));
131 beta = 1.7*
sigmoid(v,-22.5,-1./0.082);
132 dtyLin [
_h] = -alpha-beta;
138 alpha = 0.055*std::exp(-0.25*(v+78))*
sigmoid(v,-78,-1./0.2);
139 beta = 0.3 *
sigmoid(v,-32,-1./0.1);
140 dtyLin [
_j] = -alpha-beta;
143 alpha = 0.095*std::exp(-(v-5. )/100.)*
sigmoid(v,+ 5,-1./0.072);
144 beta = 0.07 *std::exp(-(v+44.)/ 59.)*
sigmoid(v,-44,+1./0.05 );
145 dtyLin [
_d] = -alpha-beta;
148 alpha = 0.012 *std::exp(-(v+28.)/125.)*
sigmoid(v,-28,+1./0.15);
149 beta = 0.0065*std::exp(-(v+30.)/50. )*
sigmoid(v,-30,-1./0.2 );
150 dtyLin [
_f] = -alpha-beta;
153 alpha = 0.0005*std::exp( (v+50.)/12.10)*
sigmoid(v,-50, 1./0.057);
154 beta = 0.0013*std::exp(-(v+20.)/16.67)*
sigmoid(v,-20,-1./0.04 );
155 dtyLin [
_x1] = -alpha-beta;
156 dtyNLin[
_x1] = alpha;
161 dtyNLin[
_CaI] = 7.e-6 -0.01*iS;
162 dtyLin [
_CaI] = -0.07;
169 CepsReal iX1 = y[
_x1] *0.008*std::expm1(0.04*(v+77)) / std::exp(0.04*(v+35.));
170 CepsReal tmp = std::exp(0.04*(v+53.));
171 CepsReal iK1 = 0.0035*(4.*std::expm1(0.04*(v+85.))/(tmp*tmp+tmp)
235 BR77(u,pb,attrs,params)
238 m_name =
"Beeler-Reuter 1977 Modified";
279 iNa = iNaB*(1+std::tanh(kB*(v-b)));
284 iNa = iNaA*(1-std::tanh(kA*(v-a)));
#define CEPS_ABORT_IF(condition, message)
Stops the execution with a message if condition is true. If testing is enabled, only throws a runtime...
std::basic_string< CepsChar > CepsString
C++ format string.
std::set< _Type, _Compare, _Alloc > CepsSet
C++ set.
std::vector< _Type, _Alloc > CepsVector
C++ vector.
float CepsReal
Need single precision floating point.
Abstract Class for all numerical method (FE, FD, FV etc)
const CepsMap< CepsUnknownIndex, CepsVector< DegreeOfFreedom * > > & getDegreesOfFreedomForUnknown()
Dofs sorted by unknown.
Represents a ionic model for a group of cells, i.e. multiple systems of ODEs.
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.
Unknown * m_unknown
Pointer on unknown on which the model applies.
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.
Base class for creating PDEs to solve.
FunctionDictionary * getFunctionDictionary() const
Get functions manager.
AbstractDiscretization * getSpatialDiscretization() const
Link to the spatial discretization (FE, FV, etc)
Geometry * getGeometry() const
Link to geometry on which the pb is defined.
static constexpr const CepsInt _vB
Maximum voltage above which current is bounded.
virtual CepsReal getINa(CepsReal *y, CepsReal gNaCa, CepsReal gNa, CepsReal v) const override
Returns the bounded current I_Na BR current.
BR77Modified(Unknown *u, AbstractPdeProblem *pb, const CepsSet< CepsAttribute > &attrs={}, InputParameters *params=nullptr)
Constructor (sets constants)
void setupWithParameters(InputParameters *p, FunctionDictionary *dico, AbstractPdeProblem *pb)
Sets the constants and the space dependant parameters from text inputs.
static constexpr const CepsInt _vA
Minimum voltage below which current is bounded.
Beeler Reuter (1977) ionic model.
static constexpr const CepsInt _ENa
Index alias.
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.
static constexpr const CepsInt _CaI
Index alias.
ScalarField< DegreeOfFreedom > * m_gNa
This parameter may vary with space.
static constexpr const CepsInt _f
Index alias.
void setupWithParameters(InputParameters *p, FunctionDictionary *dico, AbstractPdeProblem *pb)
Sets the constants and the space dependant parameters from text inputs.
CepsReal convertCmFromCepsUnit(const CepsReal &cm) const final
Convert capacitance from ceps units (uF/cm2) to ionic model units. Does nothing by default.
CepsReal convertCurrentFromCepsUnit(const CepsReal &v) const final
Convert from muA per cm2 to muA per mm2.
BR77(Unknown *u, AbstractPdeProblem *pb, const CepsSet< CepsAttribute > &attrs={}, InputParameters *params=nullptr)
Constructor (sets constants)
void getInitialCondition(CepsReal *v, CepsReal *y) const final
Sets initial values of state variables and transmembrane voltage for a single point....
virtual CepsReal getINa(CepsReal *y, CepsReal gNaCa, CepsReal gNa, CepsReal v) const
Returns the iNa current.
static constexpr const CepsInt _m
Index alias.
CepsReal convertCmToCepsUnit(const CepsReal &cm) const final
Convert capacitance from ionic model units to ceps units (uF/cm2). Does nothing by default.
static constexpr const CepsInt _h
Index alias.
ScalarField< DegreeOfFreedom > * m_gNaCa
This parameter may vary with space.
static constexpr const CepsInt _j
Index alias.
static constexpr const CepsInt _d
Index alias.
static constexpr const CepsInt _x1
Index alias.
static constexpr const CepsInt _gS
Index alias.
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...
void add(const CepsString &label, const CepsString ¶ms, Geometry *geom=nullptr)
Add an object from parameters.
void deleteScalar(const CepsString &label)
Delete a single scalar entry. Be careful if the functor was created outside dictionary.
const ScalarEntry getScalar(const CepsString &label) const
Get a single scalar entry, const version.
A class used to defined an unknown of a PDE problem The unknown can be defined on a specific region,...
CepsSet< CepsAttribute > m_attributes
The attributes held by the entity.
void setAttributes(const CepsVector< CepsAttribute > &attributes)
Sets the attributes of the entity.
const CepsGlobalIndex & getGlobalIndex() const
Get the index
CepsBool isValidPtr(_Type *ptr)
Tells if pointer is not null.
CepsBool greaterThan(CepsReal a, CepsReal b, CepsReal epsilon=FLOATING_POINT_EPSILON)
Greater than comparison with epsilon tolerance.
CepsBool isNullPtr(_Type *ptr)
Tells if passed pointer is null.
void checkNanOrInf(CepsReal v, CepsString message="")
Stops if value is NaN or infty.
CepsBool lesserThan(CepsReal a, CepsReal b, CepsReal epsilon=FLOATING_POINT_EPSILON)
Lesser than comparison with epsilon tolerance.
CepsBool equals(CepsReal a, CepsReal b, CepsReal error=1.0)
CepsReal equality up to machine precision.