#include <AbstractBackwardEulerCardiacCell.hpp>
Public Member Functions | |
AbstractBackwardEulerCardiacCell (unsigned numberOfStateVariables, unsigned voltageIndex, AbstractStimulusFunction *intracellularStimulus) | |
virtual void | ComputeResidual (const double rCurrentGuess[SIZE], double rResidual[SIZE])=0 |
virtual void | ComputeJacobian (const double rCurrentGuess[SIZE], double rJacobian[SIZE][SIZE])=0 |
virtual OdeSolution | Compute (double tStart, double tEnd) |
virtual void | ComputeExceptVoltage (double tStart, double tEnd) |
Protected Member Functions | |
virtual void | ComputeOneStepExceptVoltage (double tStart)=0 |
virtual void | UpdateTransmembranePotential (double time)=0 |
Private Member Functions | |
void | EvaluateYDerivatives (double time, const std::vector< double > &rY, std::vector< double > &rDY) |
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 54 of file AbstractBackwardEulerCardiacCell.hpp.
AbstractBackwardEulerCardiacCell< SIZE >::AbstractBackwardEulerCardiacCell | ( | unsigned | numberOfStateVariables, | |
unsigned | voltageIndex, | |||
AbstractStimulusFunction * | intracellularStimulus | |||
) | [inline] |
Standard constructor for a cell.
numberOfStateVariables | the size of the ODE system | |
voltageIndex | the index of the variable representing the transmembrane potential within the state variable vector | |
dt | the timestep to use in solving the ODEs | |
intracellularStimulus | the intracellular stimulus function | |
extracellularStimulus | the extracellular stimulus function |
Definition at line 146 of file AbstractBackwardEulerCardiacCell.hpp.
virtual void AbstractBackwardEulerCardiacCell< SIZE >::ComputeResidual | ( | const double | rCurrentGuess[SIZE], | |
double | rResidual[SIZE] | |||
) | [pure virtual] |
Compute the residual of the nonlinear system portion of the cell model.
rCurrentGuess | the current guess for U_n | |
rResidual | to be filled in with the residual vector |
Referenced by CardiacNewtonSolver< SIZE >::Solve().
virtual void AbstractBackwardEulerCardiacCell< SIZE >::ComputeJacobian | ( | const double | rCurrentGuess[SIZE], | |
double | rJacobian[SIZE][SIZE] | |||
) | [pure virtual] |
Compute the Jacobian matrix for the nonlinear system portion of the cell model.
rCurrentGuess | the current guess for U_n | |
rJacobian | to be filled in with the Jacobian matrix |
Referenced by CardiacNewtonSolver< SIZE >::Solve().
OdeSolution AbstractBackwardEulerCardiacCell< SIZE >::Compute | ( | double | tStart, | |
double | tEnd | |||
) | [inline, 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.
Reimplemented from AbstractCardiacCell.
Definition at line 161 of file AbstractBackwardEulerCardiacCell.hpp.
References AbstractBackwardEulerCardiacCell< SIZE >::ComputeOneStepExceptVoltage(), OdeSolution::rGetSolutions(), OdeSolution::rGetTimes(), OdeSolution::SetNumberOfTimeSteps(), AbstractBackwardEulerCardiacCell< SIZE >::UpdateTransmembranePotential(), and AbstractCardiacCell::VerifyStateVariables().
void AbstractBackwardEulerCardiacCell< SIZE >::ComputeExceptVoltage | ( | double | tStart, | |
double | tEnd | |||
) | [inline, 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.
Reimplemented from AbstractCardiacCell.
Definition at line 202 of file AbstractBackwardEulerCardiacCell.hpp.
References AbstractBackwardEulerCardiacCell< SIZE >::ComputeOneStepExceptVoltage(), and AbstractCardiacCell::VerifyStateVariables().
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.
Implements AbstractOdeSystem.
Definition at line 122 of file AbstractBackwardEulerCardiacCell.hpp.
virtual void AbstractBackwardEulerCardiacCell< SIZE >::ComputeOneStepExceptVoltage | ( | double | tStart | ) | [protected, pure virtual] |
Compute the values of all state variables except the voltage, for one timestep from tStart.
This method must be provided by subclasses.
Implemented in BackwardEulerFoxModel2002Modified, and BackwardEulerLuoRudyIModel1991.
Referenced by AbstractBackwardEulerCardiacCell< SIZE >::Compute(), and AbstractBackwardEulerCardiacCell< SIZE >::ComputeExceptVoltage().
virtual void AbstractBackwardEulerCardiacCell< SIZE >::UpdateTransmembranePotential | ( | double | time | ) | [protected, pure virtual] |
Perform a forward Euler step to update the transmembrane potential.
This method must be provided by subclasses.
Implemented in BackwardEulerFoxModel2002Modified, and BackwardEulerLuoRudyIModel1991.
Referenced by AbstractBackwardEulerCardiacCell< SIZE >::Compute().