46#include "AbstractGeneralizedRushLarsenCardiacCell.hpp"
50#include "OdeSolution.hpp"
51#include "TimeStepper.hpp"
54 unsigned voltageIndex,
55 boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus)
57 numberOfStateVariables,
59 pIntracellularStimulus),
60 mHasAnalyticJacobian(false)
63 mEvalF.resize(numberOfStateVariables);
64 mYInit.resize(numberOfStateVariables);
77 const unsigned n_steps = (
unsigned) floor((tEnd - tStart)/tSamp + 0.5);
78 assert(fabs(tStart+n_steps*tSamp - tEnd) < 1e-12);
79 const unsigned n_small_steps = (
unsigned) floor(tSamp/
mDt+0.5);
80 assert(fabs(
mDt*n_small_steps - tSamp) < 1e-12);
92 for (
unsigned i=0; i<n_steps; i++)
94 double curr_time = tStart;
95 for (
unsigned j=0; j<n_small_steps; j++)
97 curr_time = tStart + i*tSamp + j*
mDt;
161 if (!useNumericalJacobian)
163 EXCEPTION(
"Using analytic Jacobian terms for generalised Rush-Larsen is not yet supported.");
#define EXCEPTION(message)
unsigned GetVoltageIndex()
virtual void SetVoltageDerivativeToZero(bool clamp=true)
bool mHasAnalyticJacobian
void ForceUseOfNumericalJacobian(bool useNumericalJacobian=true)
virtual void UpdateTransmembranePotential(double time)=0
OdeSolution Compute(double tStart, double tEnd, double tSamp=0.0)
virtual void ComputeOneStepExceptVoltage(double time)=0
std::vector< double > mEvalF
AbstractGeneralizedRushLarsenCardiacCell(unsigned numberOfStateVariables, unsigned voltageIndex, boost::shared_ptr< AbstractStimulusFunction > pIntracellularStimulus)
std::vector< double > mPartialF
bool HasAnalyticJacobian() const
std::vector< double > mYInit
void SolveAndUpdateState(double tStart, double tEnd)
virtual ~AbstractGeneralizedRushLarsenCardiacCell()
void ComputeExceptVoltage(double tStart, double tEnd)
bool mUseAnalyticJacobian
virtual void VerifyStateVariables()
std::vector< double > & rGetStateVariables()
boost::shared_ptr< AbstractOdeSystemInformation > mpSystemInfo
void SetNumberOfTimeSteps(unsigned numTimeSteps)
std::vector< std::vector< double > > & rGetSolutions()
std::vector< double > & rGetTimes()
void SetOdeSystemInformation(boost::shared_ptr< const AbstractOdeSystemInformation > pOdeSystemInfo)
void AdvanceOneTimeStep()