#include <AbstractOdeSystem.hpp>
Public Member Functions | |
AbstractOdeSystem (unsigned numberOfStateVariables=0) | |
virtual | ~AbstractOdeSystem () |
virtual void | EvaluateYDerivatives (double time, const std::vector< double > &rY, std::vector< double > &rDY)=0 |
unsigned | GetNumberOfStateVariables () const |
void | SetInitialConditions (const std::vector< double > &rInitialConditions) |
void | SetInitialConditionsComponent (unsigned index, double initialCondition) |
std::vector< double > | GetInitialConditions () const |
void | SetStateVariables (const std::vector< double > &rStateVariables) |
std::vector< double > & | rGetStateVariables () |
std::vector< std::string > & | rGetVariableNames () |
std::vector< std::string > & | rGetVariableUnits () |
virtual bool | CalculateStoppingEvent (double time, const std::vector< double > &rY) |
virtual double | CalculateRootFunction (double time, const std::vector< double > &rY) |
bool | GetUseAnalytic () |
unsigned | GetStateVariableNumberByName (const std::string name) |
double | GetStateVariableValueByNumber (unsigned varNumber) const |
std::string | GetStateVariableUnitsByNumber (unsigned varNumber) const |
Protected Member Functions | |
std::string | DumpState (const std::string &message, std::vector< double > Y=std::vector< double >()) |
Protected Attributes | |
unsigned | mNumberOfStateVariables |
std::vector< double > | mStateVariables |
boost::shared_ptr < AbstractOdeSystemInformation > | mpSystemInfo |
bool | mUseAnalytic |
Whether to use an analytic Jacobian. | |
Friends | |
class | TestAbstractOdeSystem |
Definition at line 46 of file AbstractOdeSystem.hpp.
AbstractOdeSystem::AbstractOdeSystem | ( | unsigned | numberOfStateVariables = 0 |
) |
Constructor for an ODE system.
numberOfStateVariables | how many ODEs make up the system |
Definition at line 32 of file AbstractOdeSystem.cpp.
References mUseAnalytic.
AbstractOdeSystem::~AbstractOdeSystem | ( | ) | [virtual] |
Virtual destructor since we have virtual methods.
Definition at line 38 of file AbstractOdeSystem.cpp.
virtual void AbstractOdeSystem::EvaluateYDerivatives | ( | double | time, | |
const std::vector< double > & | rY, | |||
std::vector< double > & | rDY | |||
) | [pure virtual] |
Method to evaluate the derivatives of the system.
time | the current time | |
rY | the current values of the state variables | |
rDY | storage for the derivatives of the system; will be filled in on return |
Implemented in AbstractBackwardEulerCardiacCell< SIZE >, DiFrancescoNoble1985OdeSystem, FakeBathCell, FitzHughNagumo1961OdeSystem, FoxModel2002Modified, HodgkinHuxleySquidAxon1952OriginalOdeSystem, LuoRudyIModel1991OdeSystem, NhsCellularMechanicsOdeSystem, TenTusscher2006OdeSystem, IngeWntSwatCellCycleOdeSystem, TysonNovak2001OdeSystem, WntCellCycleOdeSystem, AbstractBackwardEulerCardiacCell< 12 >, AbstractBackwardEulerCardiacCell< 1 >, and AbstractBackwardEulerCardiacCell< 3 >.
Referenced by RungeKuttaFehlbergIvpOdeSolver::CalculateNextYValue(), RungeKutta4IvpOdeSolver::CalculateNextYValue(), RungeKutta2IvpOdeSolver::CalculateNextYValue(), and EulerIvpOdeSolver::CalculateNextYValue().
bool AbstractOdeSystem::CalculateStoppingEvent | ( | double | time, | |
const std::vector< double > & | rY | |||
) | [virtual] |
CalculateStoppingEvent() - can be overloaded if the ODE is to be solved only until a particular event (for example, only until the y value becomes negative.
After each timestep the solver will call this method on the ODE to see if it should stop there. By default, false is returned here.
Reimplemented in IngeWntSwatCellCycleOdeSystem, TysonNovak2001OdeSystem, and WntCellCycleOdeSystem.
Definition at line 42 of file AbstractOdeSystem.cpp.
Referenced by CalculateRootFunction(), RungeKuttaFehlbergIvpOdeSolver::InternalSolve(), AbstractOneStepIvpOdeSolver::InternalSolve(), RungeKuttaFehlbergIvpOdeSolver::Solve(), and AbstractOneStepIvpOdeSolver::Solve().
virtual double AbstractOdeSystem::CalculateRootFunction | ( | double | time, | |
const std::vector< double > & | rY | |||
) | [inline, virtual] |
An alternative approach to stopping events; currently only useful with CVODE. CVODE can search for roots (zeros) of this function while solving the ODE system, and home in on them to find sign transitions to high precision.
The default implementation here fakes a root function using CalculateStoppingEvent.
Reimplemented in IngeWntSwatCellCycleOdeSystem, TysonNovak2001OdeSystem, and WntCellCycleOdeSystem.
Definition at line 164 of file AbstractOdeSystem.hpp.
References CalculateStoppingEvent().
unsigned AbstractOdeSystem::GetStateVariableNumberByName | ( | const std::string | name | ) | [inline] |
This method is used to establish a state varible's position within the vector of state variables of an ODE system. This number can then be used with the methods GetStateVariableValueByNumber and GetStateVariableUnitsByNumber.
name | The name of a state variable. |
Definition at line 186 of file AbstractOdeSystem.hpp.
References mpSystemInfo.
double AbstractOdeSystem::GetStateVariableValueByNumber | ( | unsigned | varNumber | ) | const [inline] |
varNumber | A state variable's position within the vector of state variables associated with the ODE system. |
Definition at line 197 of file AbstractOdeSystem.hpp.
std::string AbstractOdeSystem::GetStateVariableUnitsByNumber | ( | unsigned | varNumber | ) | const [inline] |
varNumber | A state variable's position within the vector of state variables associated with the ODE system. |
Definition at line 208 of file AbstractOdeSystem.hpp.
References mpSystemInfo.
std::string AbstractOdeSystem::DumpState | ( | const std::string & | message, | |
std::vector< double > | Y = std::vector<double>() | |||
) | [protected] |
Used to include extra debugging information in exception messages. For example, EXCEPTION(DumpState("Gating variable out of range"));
Definition at line 47 of file AbstractOdeSystem.cpp.
Referenced by FoxModel2002Modified::EvaluateYDerivatives(), TenTusscher2006OdeSystem::VerifyStateVariables(), LuoRudyIModel1991OdeSystem::VerifyStateVariables(), and DiFrancescoNoble1985OdeSystem::VerifyStateVariables().
boost::shared_ptr<AbstractOdeSystemInformation> AbstractOdeSystem::mpSystemInfo [protected] |
Information about the concrete ODE system class.
Subclasses need to set this in their constructor to point to an instance of a suitable class. See for example the OdeSystemInformation class.
Definition at line 60 of file AbstractOdeSystem.hpp.
Referenced by BackwardEulerFoxModel2002Modified::BackwardEulerFoxModel2002Modified(), FakeBathCell::FakeBathCell(), FitzHughNagumo1961OdeSystem::FitzHughNagumo1961OdeSystem(), GetStateVariableNumberByName(), GetStateVariableUnitsByNumber(), HodgkinHuxleySquidAxon1952OriginalOdeSystem::HodgkinHuxleySquidAxon1952OriginalOdeSystem(), IngeWntSwatCellCycleOdeSystem::IngeWntSwatCellCycleOdeSystem(), BackwardEulerLuoRudyIModel1991::Init(), LuoRudyIModel1991OdeSystem::LuoRudyIModel1991OdeSystem(), NhsCellularMechanicsOdeSystem::NhsCellularMechanicsOdeSystem(), TenTusscher2006OdeSystem::TenTusscher2006OdeSystem(), TysonNovak2001OdeSystem::TysonNovak2001OdeSystem(), and WntCellCycleOdeSystem::WntCellCycleOdeSystem().