Chaste Release::3.1
AbstractBackwardEulerCardiacCell< SIZE > Class Template Reference

#include <AbstractBackwardEulerCardiacCell.hpp>

Inheritance diagram for AbstractBackwardEulerCardiacCell< SIZE >:
Collaboration diagram for AbstractBackwardEulerCardiacCell< SIZE >:

List of all members.

Public Member Functions

 AbstractBackwardEulerCardiacCell (unsigned numberOfStateVariables, unsigned voltageIndex, boost::shared_ptr< AbstractStimulusFunction > pIntracellularStimulus)
virtual ~AbstractBackwardEulerCardiacCell ()
virtual void ComputeResidual (double time, const double rCurrentGuess[SIZE], double rResidual[SIZE])=0
virtual void ComputeJacobian (double time, const double rCurrentGuess[SIZE], double rJacobian[SIZE][SIZE])=0
OdeSolution Compute (double tStart, double tEnd, double tSamp=0.0)
void ComputeExceptVoltage (double tStart, double tEnd)
void SolveAndUpdateState (double tStart, double tEnd)

Protected Member Functions

virtual void ComputeOneStepExceptVoltage (double tStart)=0
virtual void UpdateTransmembranePotential (double time)=0

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)
void EvaluateYDerivatives (double time, const std::vector< double > &rY, std::vector< double > &rDY)

Friends

class boost::serialization::access

Detailed Description

template<unsigned SIZE>
class AbstractBackwardEulerCardiacCell< SIZE >

This is the base class for cardiac cells solved using a (decoupled) backward Euler approach (see http://dx.doi.org/10.1109/TBME.2006.879425).

The basic approach to solving such models is:

  • Update the transmembrane potential, either from solving an external PDE, or using a forward Euler step.
  • Update any gating variables (or similar) using a backward euler step. Suitable ODEs can be written in the form $du/dt = g(V) + h(V)*u$. The update expression is then $u_n = ( u_{n-1} + g(V_n)*dt ) / ( 1 - h(V_n)*dt )$.
  • Update the remaining state variables using Newton's method to solve the nonlinear system $U_n - U_{n-1} = dt*F(U_n, V_n)$. The template parameter to the class specifies the size of this nonlinear system.

Definition at line 67 of file AbstractBackwardEulerCardiacCell.hpp.


Constructor & Destructor Documentation

template<unsigned SIZE>
AbstractBackwardEulerCardiacCell< SIZE >::AbstractBackwardEulerCardiacCell ( unsigned  numberOfStateVariables,
unsigned  voltageIndex,
boost::shared_ptr< AbstractStimulusFunction pIntracellularStimulus 
)

Standard constructor for a cell.

Parameters:
numberOfStateVariablesthe size of the ODE system
voltageIndexthe index of the variable representing the transmembrane potential within the state variable vector
pIntracellularStimulusthe intracellular stimulus function

Some notes for future reference:

  • We may want to remove the timestep from this class, and instead pass it to the Compute* methods, especially if variable timestepping is to be used.
  • It's a pity that inheriting from AbstractCardiacCell forces us to store a null pointer (for the unused ODE solver) in every instance. We may want to revisit this design decision at a later date.

Definition at line 205 of file AbstractBackwardEulerCardiacCell.hpp.

template<unsigned SIZE>
AbstractBackwardEulerCardiacCell< SIZE >::~AbstractBackwardEulerCardiacCell ( ) [virtual]

Virtual destructor

Definition at line 216 of file AbstractBackwardEulerCardiacCell.hpp.


Member Function Documentation

template<unsigned SIZE>
OdeSolution AbstractBackwardEulerCardiacCell< SIZE >::Compute ( double  tStart,
double  tEnd,
double  tSamp = 0.0 
) [virtual]

Simulates this cell's behaviour between the time interval [tStart, tEnd], with timestep mDt. Uses a forward Euler step to update the transmembrane potential at each timestep.

The length of the time interval must be a multiple of the timestep.

Parameters:
tStartbeginning of the time interval to simulate
tEndend of the time interval to simulate
tSampsampling interval for returned results (defaults to mDt)
Returns:
the values of each state variable, at intervals of tSamp.

Reimplemented from AbstractCardiacCell.

Definition at line 220 of file AbstractBackwardEulerCardiacCell.hpp.

References OdeSolution::rGetSolutions(), OdeSolution::rGetTimes(), OdeSolution::SetNumberOfTimeSteps(), and OdeSolution::SetOdeSystemInformation().

template<unsigned SIZE>
void AbstractBackwardEulerCardiacCell< SIZE >::ComputeExceptVoltage ( double  tStart,
double  tEnd 
) [virtual]

Simulates this cell's behaviour between the time interval [tStart, tEnd], with timestep mDt. The transmembrane potential is kept fixed throughout.

The length of the time interval must be a multiple of the timestep.

Parameters:
tStartbeginning of the time interval to simulate
tEndend of the time interval to simulate

Reimplemented from AbstractCardiacCell.

Definition at line 272 of file AbstractBackwardEulerCardiacCell.hpp.

template<unsigned SIZE>
virtual void AbstractBackwardEulerCardiacCell< SIZE >::ComputeJacobian ( double  time,
const double  rCurrentGuess[SIZE],
double  rJacobian[SIZE][SIZE] 
) [pure virtual]

Compute the Jacobian matrix for the nonlinear system portion of the cell model.

Parameters:
timethe current time
rCurrentGuessthe current guess for $U_n$
rJacobianto be filled in with the Jacobian matrix
template<unsigned SIZE>
virtual void AbstractBackwardEulerCardiacCell< SIZE >::ComputeOneStepExceptVoltage ( double  tStart) [protected, pure virtual]

Compute the values of all state variables, except the voltage, using backward Euler, for one timestep from tStart.

Note:
This method must be provided by subclasses.
Parameters:
tStartstart of this timestep
template<unsigned SIZE>
virtual void AbstractBackwardEulerCardiacCell< SIZE >::ComputeResidual ( double  time,
const double  rCurrentGuess[SIZE],
double  rResidual[SIZE] 
) [pure virtual]

Compute the residual of the nonlinear system portion of the cell model.

Parameters:
timethe current time
rCurrentGuessthe current guess for $U_n$
rResidualto be filled in with the residual vector
template<unsigned SIZE>
void AbstractBackwardEulerCardiacCell< SIZE >::EvaluateYDerivatives ( double  time,
const std::vector< double > &  rY,
std::vector< double > &  rDY 
) [inline, private, virtual]

This function should never be called - the cell class incorporates its own solver.

Parameters:
time
rY
rDY

Implements AbstractOdeSystem.

Definition at line 170 of file AbstractBackwardEulerCardiacCell.hpp.

References NEVER_REACHED.

template<unsigned SIZE>
template<class Archive >
void AbstractBackwardEulerCardiacCell< SIZE >::serialize ( Archive &  archive,
const unsigned int  version 
) [inline, private]

Archive the member variables.

Parameters:
archive
version

Reimplemented from AbstractCardiacCell.

Definition at line 79 of file AbstractBackwardEulerCardiacCell.hpp.

template<unsigned SIZE>
void AbstractBackwardEulerCardiacCell< SIZE >::SolveAndUpdateState ( double  tStart,
double  tEnd 
) [virtual]

Simulate this cell's behaviour between the time interval [tStart, tEnd], with timestemp mDt, updating the internal state variable values.

Parameters:
tStartbeginning of the time interval to simulate
tEndend of the time interval to simulate

Reimplemented from AbstractCardiacCell.

Definition at line 298 of file AbstractBackwardEulerCardiacCell.hpp.

References TimeStepper::AdvanceOneTimeStep(), TimeStepper::GetTime(), and TimeStepper::IsTimeAtEnd().

template<unsigned SIZE>
virtual void AbstractBackwardEulerCardiacCell< SIZE >::UpdateTransmembranePotential ( double  time) [protected, pure virtual]

Perform a forward Euler step to update the transmembrane potential.

Note:
This method must be provided by subclasses.
Parameters:
timestart of this timestep

Friends And Related Function Documentation

template<unsigned SIZE>
friend class boost::serialization::access [friend]

Needed for serialization.

Reimplemented from AbstractCardiacCell.

Definition at line 71 of file AbstractBackwardEulerCardiacCell.hpp.


The documentation for this class was generated from the following file: