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.");
void SolveAndUpdateState(double tStart, double tEnd)
bool HasAnalyticJacobian() const
std::vector< std::vector< double > > & rGetSolutions()
std::vector< double > mPartialF
#define EXCEPTION(message)
std::vector< double > & rGetStateVariables()
std::vector< double > mEvalF
virtual ~AbstractGeneralizedRushLarsenCardiacCell()
void AdvanceOneTimeStep()
void SetOdeSystemInformation(boost::shared_ptr< const AbstractOdeSystemInformation > pOdeSystemInfo)
void ForceUseOfNumericalJacobian(bool useNumericalJacobian=true)
std::vector< double > mYInit
bool mUseAnalyticJacobian
virtual void VerifyStateVariables()
std::vector< double > & rGetTimes()
virtual void SetVoltageDerivativeToZero(bool clamp=true)
unsigned GetVoltageIndex()
boost::shared_ptr< AbstractOdeSystemInformation > mpSystemInfo
AbstractGeneralizedRushLarsenCardiacCell(unsigned numberOfStateVariables, unsigned voltageIndex, boost::shared_ptr< AbstractStimulusFunction > pIntracellularStimulus)
bool mHasAnalyticJacobian
void ComputeExceptVoltage(double tStart, double tEnd)
virtual void UpdateTransmembranePotential(double time)=0
OdeSolution Compute(double tStart, double tEnd, double tSamp=0.0)
virtual void ComputeOneStepExceptVoltage(double time)=0
void SetNumberOfTimeSteps(unsigned numTimeSteps)