COPASI API  4.40.278
CHybridMethodODE45 Class Reference

#include <CHybridMethodODE45.h>

Inheritance diagram for CHybridMethodODE45:
[legend]

Classes

struct  Data
 

Public Member Functions

 CHybridMethodODE45 (const CDataContainer *pParent, const CTaskEnum::Method &methodType=CTaskEnum::Method::hybridODE45, const CTaskEnum::Task &taskType=CTaskEnum::Task::timeCourse)
 
 CHybridMethodODE45 (const CHybridMethodODE45 &src, const CDataContainer *pParent)
 
virtual bool elevateChildren ()
 
virtual bool isValidProblem (const CCopasiProblem *pProblem)
 
virtual void start ()
 
virtual void stateChange (const CMath::StateChange &change)
 
virtual Status step (const double &deltaT, const bool &final=false)
 
 ~CHybridMethodODE45 ()
 
- Public Member Functions inherited from CTrajectoryMethod
 CTrajectoryMethod (const CDataContainer *pParent, const CTaskEnum::Method &methodType, const CTaskEnum::Task &taskType=CTaskEnum::Task::timeCourse)
 
 CTrajectoryMethod (const CTrajectoryMethod &src, const CDataContainer *pParent)
 
const CVectorCore< C_INT > & getRoots () const
 
const bool & integrateReducedModel () const
 
void setProblem (CTrajectoryProblem *problem)
 
 ~CTrajectoryMethod ()
 
- Public Member Functions inherited from CCopasiMethod
 CCopasiMethod (const CCopasiMethod &src, const CDataContainer *pParent)
 
virtual void clearCallBack ()
 
const CProcessReportLevelgetCallBack () const
 
CMathContainergetMathContainer () const
 
const CTaskEnum::MethodgetSubType () const
 
const CTaskEnum::TaskgetType () const
 
virtual void load (CReadConfig &configBuffer, CReadConfig::Mode mode=CReadConfig::SEARCH)
 
CCopasiMethodoperator= (const CCopasiMethod &rhs)
 
virtual void print (std::ostream *ostream) const
 
virtual void printResult (std::ostream *ostream) const
 
virtual bool setCallBack (CProcessReportLevel callBack)
 
void setMathContainer (CMathContainer *pContainer)
 
virtual ~CCopasiMethod ()
 
- Public Member Functions inherited from CCopasiParameterGroup
bool addGroup (const std::string &name)
 
void addParameter (CCopasiParameter *pParameter)
 
bool addParameter (const CCopasiParameter &parameter)
 
bool addParameter (const std::string &name, const CCopasiParameter::Type type, const CCopasiParameter::UserInterfaceFlag &flag=CCopasiParameter::UserInterfaceFlag::All)
 
template<class CType >
bool addParameter (const std::string &name, const CCopasiParameter::Type type, const CType &value, const CCopasiParameter::UserInterfaceFlag &flag=CCopasiParameter::UserInterfaceFlag::All)
 
virtual bool applyData (const CData &data, CUndoData::CChangeSet &changes)
 
CCopasiParameterGroupassertGroup (const std::string &name, const CCopasiParameter::UserInterfaceFlag &flag=CCopasiParameter::UserInterfaceFlag::All)
 
template<class CType >
CType * assertParameter (const std::string &name, const CCopasiParameter::Type type, const CType &defaultValue, const CCopasiParameter::UserInterfaceFlag &flag=CCopasiParameter::UserInterfaceFlag::All)
 
index_iterator beginIndex () const
 
const_name_iterator beginName () const
 
 CCopasiParameterGroup (const CCopasiParameterGroup &src, const CDataContainer *pParent=NULL)
 
 CCopasiParameterGroup (const std::string &name, const CDataContainer *pParent=NO_PARENT, const std::string &objectType="ParameterGroup")
 
void clear ()
 
virtual void createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const
 
index_iterator endIndex () const
 
const_name_iterator endName () const
 
CCopasiParameterGroupgetElementTemplates ()
 
const CCopasiParameterGroupgetElementTemplates () const
 
CCopasiParameterGroupgetGroup (const size_t &index)
 
const CCopasiParameterGroupgetGroup (const size_t &index) const
 
CCopasiParameterGroupgetGroup (const std::string &name)
 
const CCopasiParameterGroupgetGroup (const std::string &name) const
 
virtual size_t getIndex (const CDataObject *pObject) const
 
size_t getIndex (const std::string &name) const
 
std::string getKey (const size_t &index) const
 
std::string getKey (const std::string &name) const
 
virtual const std::string & getName (const size_t &index) const
 
virtual const CObjectInterfacegetObject (const CCommonName &cn) const
 
CCopasiParametergetParameter (const size_t &index)
 
const CCopasiParametergetParameter (const size_t &index) const
 
CCopasiParametergetParameter (std::string name)
 
const CCopasiParametergetParameter (std::string name) const
 
CCopasiParameter::Type getType (const size_t &index) const
 
CCopasiParameter::Type getType (const std::string &name) const
 
std::string getUniqueParameterName (const CCopasiParameter *pParameter) const
 
template<class CType >
CType & getValue (const size_t &index)
 
template<class CType >
const CType & getValue (const size_t &index) const
 
template<class CType >
CType & getValue (const std::string &name)
 
template<class CType >
const CType & getValue (const std::string &name) const
 
bool haveTemplate () const
 
virtual CUndoObjectInterfaceinsert (const CData &data)
 
CCopasiParameterGroupoperator= (const CCopasiParameterGroup &rhs)
 
virtual bool remove (CDataObject *pObject)
 
bool removeParameter (CCopasiParameter *pParameter)
 
bool removeParameter (const size_t &index)
 
bool removeParameter (const std::string &name)
 
virtual void setUserInterfaceFlag (const UserInterfaceFlag &flag)
 
template<class CType >
bool setValue (const size_t &index, const CType &value)
 
template<class CType >
bool setValue (const std::string &name, const CType &value)
 
size_t size (const UserInterfaceFlag &require=UserInterfaceFlag::None, const UserInterfaceFlag &exclude=UserInterfaceFlag::None) const
 
bool swap (const size_t &iFrom, const size_t &iTo)
 
bool swap (index_iterator &from, index_iterator &to)
 
virtual CData toData () const
 
virtual void updateIndex (const size_t &index, const CUndoObjectInterface *pUndoObject)
 
virtual ~CCopasiParameterGroup ()
 
- Public Member Functions inherited from CCopasiParameter
 CCopasiParameter (const CCopasiParameter &src, const CDataContainer *pParent)
 
 CCopasiParameter (const std::string &name, const Type &type, const void *pValue=NULL, const CDataContainer *pParent=NO_PARENT, const std::string &objectType="Parameter")
 
virtual CCommonName getCN () const override
 
template<class CType >
const CType & getDefault () const
 
virtual const std::string & getKey () const override
 
virtual std::string getObjectDisplayName () const override
 
const CCopasiParameter::TypegetType () const
 
const UserInterfaceFlaggetUserInterfaceFlag () const
 
template<class CType >
std::vector< std::pair< CType, CType > > & getValidValues ()
 
template<class CType >
const std::vector< std::pair< CType, CType > > & getValidValues () const
 
void * getValidValuesPointer () const
 
template<class CType >
CType & getValue ()
 
template<class CType >
const CType & getValue () const
 
virtual void * getValuePointer () const override
 
CDataObjectgetValueReference () const
 
bool hasValidValues () const
 
bool isBasic () const
 
bool isDefault () const
 
bool isEditable () const
 
bool isUnsupported () const
 
bool isValidValue (const bool &value) const
 
bool isValidValue (const C_FLOAT64 &value) const
 
bool isValidValue (const C_INT32 &value) const
 
bool isValidValue (const CCommonName &value) const
 
template<class CType >
bool isValidValue (const CType &) const
 
bool isValidValue (const std::string &value) const
 
bool isValidValue (const std::vector< CCopasiParameter * > &value) const
 
bool isValidValue (const unsigned C_INT32 &value) const
 
CCopasiParameteroperator= (const CCopasiParameter &rhs)
 
template<class CType >
bool setDefault (const CType &defaultValue)
 
bool setDefault (const std::vector< CCopasiParameter * > &defaultValue)
 
virtual bool setObjectParent (const CDataContainer *pParent) override
 
template<class CType , class Enum >
bool setValidValues (const CEnumAnnotation< CType, Enum > &validValues)
 
template<class CType >
bool setValidValues (const std::vector< std::pair< CType, CType > > &validValues)
 
template<class CType >
bool setValue (const CType &value)
 
bool setValue (const std::vector< CCopasiParameter * > &value)
 
virtual ~CCopasiParameter ()
 
- Public Member Functions inherited from CDataContainer
virtual bool add (CDataObject *pObject, const bool &adopt=true)
 
virtual bool appendDeletedDependentData (CUndoData &undoData) const
 
 CDataContainer (const CDataContainer &src, const CDataContainer *pParent)
 
 CDataContainer (const std::string &name, const CDataContainer *pParent=NO_PARENT, const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None)
 
virtual std::string getChildObjectUnits (const CDataObject *pObject) const
 
void getDescendants (CDataObject::DataObjectSet &descendants, const bool &recursive=false) const
 
virtual objectMapgetObjects ()
 
virtual const objectMapgetObjects () const
 
virtual const std::string getUnits () const override
 
virtual const CDataObjectgetValueObject () const override
 
void objectRenamed (CDataObject *pObject, const std::string &oldName)
 
virtual ~CDataContainer ()
 
- Public Member Functions inherited from CDataObject
void addIssue (const CIssue &issue)
 
void addReference (const CDataContainer *pReference)
 
virtual void calculateValue () override
 
 CDataObject (const CDataObject &src, const CDataContainer *pParent=NULL)
 
virtual void destruct () override
 
virtual const CDataObjectgetDataObject () const override
 
CDataContainergetObjectAncestor (const std::string &type) const
 
CDataModelgetObjectDataModel () const
 
const CObjectInterfacegetObjectFromCN (const CCommonName &cn) const
 
const std::string & getObjectName () const
 
CDataContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const CObjectInterface::ObjectSetgetPrerequisites () const override
 
virtual const CValiditygetValidity () const override
 
bool hasFlag (const Flag &flag) const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CCore::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const override
 
bool prerequisitsContains (const DataObjectSet &objects) const
 
void removeIssue (const CIssue &issue)
 
void removeReference (const CDataContainer *pReference)
 
bool setObjectName (const std::string &name)
 
void validityChanged (const CValidity &changedValidity) override
 
void validityRemoved (const CValidity &changedValidity)
 
virtual ~CDataObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
 CObjectInterface (const CObjectInterface &src)
 
virtual ~CObjectInterface ()
 
- Public Member Functions inherited from CUndoObjectInterface
 CUndoObjectInterface ()
 
 CUndoObjectInterface (const CUndoObjectInterface &src)
 
bool generateUuid ()
 
const xg::Guid & getUuid () const
 
bool setUuid (const std::string &uuid)
 
bool setUuid (const xg::Guid &uuid)
 
virtual ~CUndoObjectInterface ()
 

Protected Types

enum  IntergrationType { DETERMINISTIC , HYBRID }
 
enum  PartitioningStrategyType { AllDeterministic = 0 , UserSpecified , AllStochastic }
 
enum  RootMasking { NONE = 0 , ALL , DISCRETE }
 

Protected Member Functions

C_INT32 checkModel (CModel *model)
 
bool checkRoots ()
 
 CHybridMethodODE45 ()
 
void determineIntegrationType ()
 
C_FLOAT64 doSingleStep (C_FLOAT64 endTime)
 
void evalF (const C_FLOAT64 *t, const C_FLOAT64 *y, C_FLOAT64 *ydot)
 
void evalR (const C_FLOAT64 *t, const C_FLOAT64 *y, const size_t *nr, C_FLOAT64 *r)
 
void fireReaction ()
 
CMathReactiongetReactionToFire ()
 
void integrateDeterministicPart (C_FLOAT64 ds)
 
void partitionSystem ()
 
- Protected Member Functions inherited from CTrajectoryMethod
void output (const bool &useMoieties)
 
virtual void signalMathContainerChanged ()
 
- Protected Member Functions inherited from CCopasiMethod
 CCopasiMethod (const CCopasiMethod &src)
 
 CCopasiMethod (const CDataContainer *pParent, const CTaskEnum::Method &methodType, const CTaskEnum::Task &taskType)
 
- Protected Member Functions inherited from CCopasiParameterGroup
 CCopasiParameterGroup ()
 
- Protected Member Functions inherited from CCopasiParameter
 CCopasiParameter (const CCopasiParameter &src)
 
- Protected Member Functions inherited from CDataContainer
template<class CType >
CDataMatrixReference< CType > * addMatrixReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None)
 
template<class CType >
CDataObjectReference< CType > * addObjectReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None)
 
template<class CType >
CDataVectorReference< CType > * addVectorReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None)
 
 CDataContainer (const CDataContainer &src)
 
void initObjects ()
 
- Protected Member Functions inherited from CDataObject
 CDataObject ()
 
 CDataObject (const std::string &name, const CDataContainer *pParent=static_cast< CDataContainer * >((void *) 0), const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None)
 

Static Protected Member Functions

static void EvalF (const size_t *n, const C_FLOAT64 *t, const C_FLOAT64 *y, C_FLOAT64 *ydot)
 
static void EvalR (const size_t *n, const C_FLOAT64 *t, const C_FLOAT64 *y, const size_t *nr, C_FLOAT64 *r)
 

Protected Attributes

RootMasking mRootMasking
 
- Protected Attributes inherited from CTrajectoryMethod
CVectorCore< C_FLOAT64mContainerState
 
C_FLOAT64mpContainerStateTime
 
CTrajectoryProblemmpProblem
 
const bool * mpReducedModel
 
CTrajectoryTaskmpTask
 
CVectorCore< C_INTmRootsFound
 
- Protected Attributes inherited from CCopasiMethod
CMathContainermpContainer
 
CProcessReportLevel mProcessReport
 
- Protected Attributes inherited from CCopasiParameter
std::string mKey
 
void * mpDefault
 
void * mpValidValues
 
void * mpValue
 
CDataObjectmpValueReference
 
UserInterfaceFlag mUserInterfaceFlag
 
- Protected Attributes inherited from CDataContainer
objectMap mObjects
 
- Protected Attributes inherited from CDataObject
ObjectSet mPrerequisits
 
std::set< CDataContainer * > mReferences
 
- Protected Attributes inherited from CObjectInterface
CValidity mValidity
 

Static Protected Attributes

static std::string PartitioningStrategy []
 
- Static Protected Attributes inherited from CTrajectoryMethod
static const bool ReducedModel
 

Private Member Functions

void createRootMask ()
 
void destroyRootMask ()
 
void initializeParameter ()
 
void maskRoots (CVectorCore< C_FLOAT64 > &rootValues)
 

Private Attributes

C_FLOAT64 mA0
 
CVector< C_FLOAT64 * > mAmuPointers
 
CVectorCore< C_FLOAT64mAmuVariables
 
CVectorCore< C_FLOAT64mContainerFluxes
 
size_t mCountContainerVariables
 
size_t mCountReactionSpecies
 
Data mData
 
CVectorCore< bool > mDiscreteRoots
 
bool mEventProcessing
 
bool mFireReaction
 
size_t mFirstReactionSpeciesIndex
 
CVector< C_FLOAT64 * > mFluxPointers
 
bool mHasDetermReaction
 
bool mHasStoiReaction
 
IntergrationType mIntegrationType
 
CVector< C_FLOAT64mLastSuccessState
 
size_t mMaxBalance
 
bool mMaxStepsReached
 
CVector< C_INTmMethodRootsFound
 
CRungeKutta mODE45
 
bool mODEInitalized
 
size_t mOutputCounter
 
std::ofstream mOutputFile
 
std::string mOutputFileName
 
C_FLOAT64mpAbsoluteTolerance
 
CCopasiParameterGroupmpFastReactions
 
C_INTmpHybridRoot
 
unsigned C_INT32mpMaxInternalSteps
 
std::string * mpPartitioningStrategy
 
CRandommpRandomGenerator
 
unsigned C_INT32mpRandomSeed
 
C_FLOAT64mpRelativeTolerance
 
CCore::CUpdateSequence mPropensitiesUpdateSequence
 
bool * mpUseRandomSeed
 
const C_FLOAT64mpYdot
 
CRungeKutta::RKMethodStatus mRKMethodStatus
 
size_t mRootCounter
 
CVector< bool > mRootMask
 
CVector< C_FLOAT64mRootsNonZero
 
CVector< C_FLOAT64mRootValuesLeft
 
CVectorCore< C_FLOAT64mRootValuesRight
 
CVector< C_FLOAT64mSavedFluxes
 
CVector< CMathReaction * > mSlowReactions
 
CCore::CUpdateSequence mSpeciesRateUpdateSequence
 
C_FLOAT64 mTargetTime
 
CVector< C_FLOAT64mY
 

Additional Inherited Members

- Public Types inherited from CTrajectoryMethod
enum  Status { FAILURE = -1 , NORMAL = 0 , ROOT = 1 }
 
- Public Types inherited from CCopasiParameterGroup
typedef CDataObjectMap::const_type_iterator< CCopasiParameterconst_name_iterator
 
typedef std::vector< CCopasiParameter * > elements
 
typedef elements::iterator index_iterator
 
typedef CDataObjectMap::type_iterator< CCopasiParametername_iterator
 
- Public Types inherited from CCopasiParameter
enum class  eUserInterfaceFlag { editable , basic , unsupported , __SIZE }
 
enum class  Type {
  DOUBLE = 0 , UDOUBLE , INT , UINT ,
  BOOL , GROUP , STRING , CN ,
  KEY , FILE , EXPRESSION , INVALID ,
  __SIZE
}
 
typedef CFlags< eUserInterfaceFlagUserInterfaceFlag
 
- Public Types inherited from CDataContainer
typedef CDataObjectMap objectMap
 
- Public Types inherited from CDataObject
typedef std::set< const CDataObject * > DataObjectSet
 
enum  Flag {
  Container , Vector , Matrix , NameVector ,
  Reference , ValueBool , ValueInt , ValueInt64 ,
  ValueDbl , NonUniqueName , StaticString , ValueString ,
  Separator , DisplayName , ModelEntity , Array ,
  DataModel , Root , Gui , __SIZE
}
 
- Public Types inherited from CObjectInterface
typedef std::vector< const CDataContainer * > ContainerList
 
typedef std::set< const CObjectInterface * > ObjectSet
 
- Static Public Member Functions inherited from CCopasiParameter
static void allocateValidValues (const Type &type, void *&pValidValues)
 
static void allocateValue (const Type &type, void *&pValue)
 
static void assignValue (const Type &type, void *&pValue, const void *pNewValue)
 
static void deleteValidValues (const Type &type, void *&pValidValues)
 
static void deleteValue (const Type &type, void *&pValue)
 
static CCopasiParameterfromData (const CData &data, CUndoObjectInterface *pParent)
 
- Static Public Member Functions inherited from CDataContainer
static CDataContainerfromData (const CData &data, CUndoObjectInterface *pParent)
 
- Static Public Member Functions inherited from CDataObject
static CDataObjectfromData (const CData &data, CUndoObjectInterface *pParent)
 
static void sanitizeObjectName (std::string &name)
 
- Static Public Member Functions inherited from CObjectInterface
static const CDataObjectDataObject (const CObjectInterface *pInterface)
 
static CObjectInterfaceGetObjectFromCN (const ContainerList &listOfContainer, const CCommonName &objName)
 
- Static Public Member Functions inherited from CUndoObjectInterface
template<class CType >
static CType * fromData (const CData &, CUndoObjectInterface *)
 
- Static Public Attributes inherited from CCopasiParameter
static const CEnumAnnotation< std::string, TypeTypeName
 
static const CEnumAnnotation< std::string, TypeXMLType
 
- Static Public Attributes inherited from CDataContainer
static const CObjectInterface::ContainerList EmptyList
 

Detailed Description

A class to record whether a metab is slow or fast

Parameters
fastReactionsis applied to store which reactions this metab participates
flag,ifset is empty -> false, else, -> true

Member Enumeration Documentation

◆ IntergrationType

Enumerator
DETERMINISTIC 
HYBRID 

◆ PartitioningStrategyType

Enumerator
AllDeterministic 
UserSpecified 
AllStochastic 

◆ RootMasking

Enumerator
NONE 
ALL 
DISCRETE 

Constructor & Destructor Documentation

◆ CHybridMethodODE45() [1/3]

CHybridMethodODE45::CHybridMethodODE45 ( )
protected

Default Constructor

◆ CHybridMethodODE45() [2/3]

CHybridMethodODE45::CHybridMethodODE45 ( const CDataContainer pParent,
const CTaskEnum::Method methodType = CTaskEnum::Method::hybridODE45,
const CTaskEnum::Task taskType = CTaskEnum::Task::timeCourse 
)

Specific constructor

Parameters
constCDataContainer * pParent
constCTaskEnum::Method & methodType (default: hybridODE45)
constCTaskEnum::Task & taskType (default: timeCourse)

Default constructor.

References CHybridMethodODE45::Data::dim, initializeParameter(), mData, and CHybridMethodODE45::Data::pMethod.

◆ CHybridMethodODE45() [3/3]

CHybridMethodODE45::CHybridMethodODE45 ( const CHybridMethodODE45 src,
const CDataContainer pParent 
)

Copy constructor

Parameters
constCHybridMethodODE45 & src
constCDataContainer * pParent (default: NULL)

Copy Constructor

References CHybridMethodODE45::Data::dim, initializeParameter(), mData, and CHybridMethodODE45::Data::pMethod.

◆ ~CHybridMethodODE45()

CHybridMethodODE45::~CHybridMethodODE45 ( )

Member Function Documentation

◆ checkModel()

C_INT32 CHybridMethodODE45::checkModel ( CModel model)
protected

Test the model if it is proper to perform stochastic simulations on. Several properties are tested (e.g. integer stoichometry, all reactions take place in one compartment only, irreversibility...).

Returns
0, if everything is ok; <0, if an error occured.

References C_FLOAT64, C_INT32, CModel::getReactions(), CModel::getStoi(), INT_EPSILON, CMatrix< CType >::numRows(), and CDataVector< CType >::size().

◆ checkRoots()

◆ createRootMask()

◆ destroyRootMask()

void CHybridMethodODE45::destroyRootMask ( )
private

◆ determineIntegrationType()

void CHybridMethodODE45::determineIntegrationType ( )
protected

Setup mMethod, switching between Deterministic Method and Hybrid Method

References DETERMINISTIC, HYBRID, mHasStoiReaction, and mIntegrationType.

Referenced by start().

◆ doSingleStep()

C_FLOAT64 CHybridMethodODE45::doSingleStep ( C_FLOAT64  endTime)
protected

Simulates the system over the next interval of time. The current time and the end time of the current step() are given as arguments.

Parameters
endTimeA C_FLOAT64 specifying the end time of the step()
Returns
A C_FLOAT giving the new time

Simulates the system over the next interval of time. The new time after this step is returned.

Parameters
endTimeA C_FLOAT64 specifying the endTime of the current step()
Returns
A C_FLOAT giving the new time

References C_FLOAT64, CRungeKutta::ERROR, fireReaction(), integrateDeterministicPart(), mEventProcessing, mFireReaction, CTrajectoryMethod::mpContainerStateTime, and mRKMethodStatus.

Referenced by step().

◆ elevateChildren()

bool CHybridMethodODE45::elevateChildren ( )
virtual

This methods must be called to elevate subgroups to derived objects. The default implementation does nothing.

Returns
bool success

Reimplemented from CCopasiParameterGroup.

References initializeParameter().

◆ evalF()

◆ EvalF()

void CHybridMethodODE45::EvalF ( const size_t *  n,
const C_FLOAT64 t,
const C_FLOAT64 y,
C_FLOAT64 ydot 
)
staticprotected

Dummy Function for calculating derivative of ODE systems

Dummy f function for calculating derivative of y

References evalF(), and CHybridMethodODE45::Data::pMethod.

Referenced by integrateDeterministicPart().

◆ evalR()

void CHybridMethodODE45::evalR ( const C_FLOAT64 t,
const C_FLOAT64 y,
const size_t *  nr,
C_FLOAT64 r 
)
protected

◆ EvalR()

void CHybridMethodODE45::EvalR ( const size_t *  n,
const C_FLOAT64 t,
const C_FLOAT64 y,
const size_t *  nr,
C_FLOAT64 r 
)
staticprotected

Dummy Function for calculating roots value

Dummy f function for calculating roots value

References evalR(), and CHybridMethodODE45::Data::pMethod.

Referenced by integrateDeterministicPart().

◆ fireReaction()

◆ getReactionToFire()

CMathReaction * CHybridMethodODE45::getReactionToFire ( )
protected

Function return a reaction index which is a slow reaction firing at the event time.

Returns
CMathReaction * pReaction

Calculate which slow reaction fires

References CVectorCore< CType >::array(), C_FLOAT64, CRandom::getRandomOO(), mA0, mAmuVariables, mpRandomGenerator, mSlowReactions, and CVectorCore< CType >::size().

Referenced by fireReaction().

◆ initializeParameter()

◆ integrateDeterministicPart()

◆ isValidProblem()

bool CHybridMethodODE45::isValidProblem ( const CCopasiProblem pProblem)
virtual

Check if the method is suitable for this problem

Returns
bool suitability of the method

Reimplemented from CTrajectoryMethod.

References CCopasiMessage::ERROR, CTrajectoryProblem::getDuration(), CTrajectoryMethod::isValidProblem(), and MCTrajectoryMethod.

◆ maskRoots()

void CHybridMethodODE45::maskRoots ( CVectorCore< C_FLOAT64 > &  rootValues)
private

◆ partitionSystem()

◆ start()

◆ stateChange()

void CHybridMethodODE45::stateChange ( const CMath::StateChange change)
virtual

Inform the trajectory method that the state has changed outside its control

Parameters
constCMath::StateChange & change

Reimplemented from CTrajectoryMethod.

References CMath::ContinuousSimulation, destroyRootMask(), CMath::EventSimulation, CRungeKutta::INITIALIZE, mRKMethodStatus, CRungeKutta::RESTART, and CMath::State.

◆ step()

CTrajectoryMethod::Status CHybridMethodODE45::step ( const double &  deltaT,
const bool &  final = false 
)
virtual

This instructs the method to calculate a time step of deltaT starting with the current state, i.e., the result of the previous step. The new state (after deltaT) is expected in the current state. The return value is the actual timestep taken.

Parameters
constdouble & deltaT
constbool & final (default: false)
Returns
Status status

This instructs the method to calculate a time step of deltaT starting with the current state, i.e., the result of the previous step. The new state (after deltaT) is expected in the current state. The return value is the actual timestep taken.

Parameters
const double &deltaT
Returns
Status status

Reimplemented from CTrajectoryMethod.

References C_FLOAT64, doSingleStep(), CRungeKutta::ERROR, CTrajectoryMethod::FAILURE, CTrajectoryProblem::getAutomaticStepSize(), CTrajectoryMethod::mContainerState, mEventProcessing, min, mLastSuccessState, mMaxStepsReached, CTrajectoryMethod::mpContainerStateTime, mpMaxInternalSteps, CTrajectoryMethod::mpProblem, mRKMethodStatus, mRootCounter, mTargetTime, CTrajectoryMethod::NORMAL, CTrajectoryMethod::ROOT, and CCopasiMessage::WARNING.

Member Data Documentation

◆ mA0

C_FLOAT64 CHybridMethodODE45::mA0
private

◆ mAmuPointers

CVector< C_FLOAT64 * > CHybridMethodODE45::mAmuPointers
private

Referenced by evalF(), evalR(), and partitionSystem().

◆ mAmuVariables

CVectorCore< C_FLOAT64 > CHybridMethodODE45::mAmuVariables
private

The variables handling the integrated propensities of the stochastic reactions.

Referenced by fireReaction(), getReactionToFire(), and start().

◆ mContainerFluxes

CVectorCore< C_FLOAT64 > CHybridMethodODE45::mContainerFluxes
private

Referenced by evalF(), and partitionSystem().

◆ mCountContainerVariables

size_t CHybridMethodODE45::mCountContainerVariables
private

◆ mCountReactionSpecies

size_t CHybridMethodODE45::mCountReactionSpecies
private

Referenced by evalF(), and start().

◆ mData

Data CHybridMethodODE45::mData
private

mData.dim is the dimension of the ODE system. mData.pMethod contains CLsodaMethod * this to be used in the static method EvalF

Referenced by CHybridMethodODE45(), evalF(), evalR(), integrateDeterministicPart(), and start().

◆ mDiscreteRoots

CVectorCore< bool > CHybridMethodODE45::mDiscreteRoots
private

A which indicates whether roots change only discretely.

Referenced by integrateDeterministicPart(), and start().

◆ mEventProcessing

bool CHybridMethodODE45::mEventProcessing
private

Status of Root and Slow Event

Referenced by doSingleStep(), fireReaction(), integrateDeterministicPart(), and step().

◆ mFireReaction

bool CHybridMethodODE45::mFireReaction
private

◆ mFirstReactionSpeciesIndex

size_t CHybridMethodODE45::mFirstReactionSpeciesIndex
private

Referenced by evalF(), and start().

◆ mFluxPointers

CVector< C_FLOAT64 * > CHybridMethodODE45::mFluxPointers
private

Referenced by evalF(), and partitionSystem().

◆ mHasDetermReaction

bool CHybridMethodODE45::mHasDetermReaction
private

Referenced by partitionSystem().

◆ mHasStoiReaction

bool CHybridMethodODE45::mHasStoiReaction
private

Bool value

Referenced by determineIntegrationType(), and partitionSystem().

◆ mIntegrationType

IntergrationType CHybridMethodODE45::mIntegrationType
private

An Integer showes the method now CHybridMethod used 0 == Stochastic 1 == Deterministic 2 == Hybrid

Referenced by determineIntegrationType(), evalF(), evalR(), and start().

◆ mLastSuccessState

CVector< C_FLOAT64 > CHybridMethodODE45::mLastSuccessState
private

A pointer to the current state in complete model view.

Referenced by integrateDeterministicPart(), start(), and step().

◆ mMaxBalance

size_t CHybridMethodODE45::mMaxBalance
private

maximal increase of a particle number in one step.

◆ mMaxStepsReached

bool CHybridMethodODE45::mMaxStepsReached
private

Referenced by start(), and step().

◆ mMethodRootsFound

CVector< C_INT > CHybridMethodODE45::mMethodRootsFound
private

◆ mODE45

CRungeKutta CHybridMethodODE45::mODE45
private

mODE45

Referenced by integrateDeterministicPart().

◆ mODEInitalized

bool CHybridMethodODE45::mODEInitalized
private

Record whether ODE solver has been initialized

◆ mOutputCounter

size_t CHybridMethodODE45::mOutputCounter
private

Output counter.

◆ mOutputFile

std::ofstream CHybridMethodODE45::mOutputFile
private

File output stream to write data.

◆ mOutputFileName

std::string CHybridMethodODE45::mOutputFileName
private

Output filename.

◆ mpAbsoluteTolerance

C_FLOAT64* CHybridMethodODE45::mpAbsoluteTolerance
private

◆ mpFastReactions

CCopasiParameterGroup* CHybridMethodODE45::mpFastReactions
private

◆ mpHybridRoot

C_INT* CHybridMethodODE45::mpHybridRoot
private

◆ mpMaxInternalSteps

unsigned C_INT32* CHybridMethodODE45::mpMaxInternalSteps
private

◆ mpPartitioningStrategy

std::string* CHybridMethodODE45::mpPartitioningStrategy
private

◆ mpRandomGenerator

CRandom* CHybridMethodODE45::mpRandomGenerator
private

The random number generator.

Referenced by fireReaction(), getReactionToFire(), and start().

◆ mpRandomSeed

unsigned C_INT32* CHybridMethodODE45::mpRandomSeed
private

Referenced by initializeParameter(), and start().

◆ mpRelativeTolerance

C_FLOAT64* CHybridMethodODE45::mpRelativeTolerance
private

◆ mPropensitiesUpdateSequence

CCore::CUpdateSequence CHybridMethodODE45::mPropensitiesUpdateSequence
private

Referenced by evalF(), and partitionSystem().

◆ mpUseRandomSeed

bool* CHybridMethodODE45::mpUseRandomSeed
private

Referenced by initializeParameter(), and start().

◆ mpYdot

const C_FLOAT64* CHybridMethodODE45::mpYdot
private

Referenced by evalF(), and start().

◆ mRKMethodStatus

CRungeKutta::RKMethodStatus CHybridMethodODE45::mRKMethodStatus
private

◆ mRootCounter

size_t CHybridMethodODE45::mRootCounter
private

Max number of doSingleStep() per step()

Referenced by integrateDeterministicPart(), start(), and step().

◆ mRootMask

CVector< bool > CHybridMethodODE45::mRootMask
private

A mask which hides all roots being constant and zero.

Referenced by createRootMask(), destroyRootMask(), integrateDeterministicPart(), and maskRoots().

◆ mRootMasking

RootMasking CHybridMethodODE45::mRootMasking
protected

Root counter to determine whether the internal step limit is exceeded. A Boolean flag indicating whether we should try masking roots

Referenced by createRootMask(), destroyRootMask(), evalR(), integrateDeterministicPart(), and start().

◆ mRootsNonZero

CVector< C_FLOAT64 > CHybridMethodODE45::mRootsNonZero
private

2 Vector for storing root value

Referenced by checkRoots(), and start().

◆ mRootValuesLeft

CVector< C_FLOAT64 > CHybridMethodODE45::mRootValuesLeft
private

Value of Roots before a reaction event

Referenced by checkRoots(), fireReaction(), and start().

◆ mRootValuesRight

CVectorCore< C_FLOAT64 > CHybridMethodODE45::mRootValuesRight
private

Value of Roots after a reaction event

Referenced by checkRoots(), fireReaction(), and start().

◆ mSavedFluxes

CVector< C_FLOAT64 > CHybridMethodODE45::mSavedFluxes
private

Referenced by evalF().

◆ mSlowReactions

CVector< CMathReaction * > CHybridMethodODE45::mSlowReactions
private

Vector containing pointers to the slow of the model.

Referenced by getReactionToFire(), partitionSystem(), and start().

◆ mSpeciesRateUpdateSequence

CCore::CUpdateSequence CHybridMethodODE45::mSpeciesRateUpdateSequence
private

Referenced by evalF(), and partitionSystem().

◆ mTargetTime

C_FLOAT64 CHybridMethodODE45::mTargetTime
private

Time Record

Referenced by start(), and step().

◆ mY

CVector< C_FLOAT64 > CHybridMethodODE45::mY
private

Vector of integration variables

Referenced by integrateDeterministicPart(), and start().

◆ PartitioningStrategy

std::string CHybridMethodODE45::PartitioningStrategy
staticprotected
Initial value:
=
{
"All Reactions Deterministic",
"User specified Partition",
"All Reactions Stochastic",
""
}

CHybridMethodODE45

This class implements an hybrid algorithm for the simulation of a biochemical system over time.

File name: CHybridMethodODE45.cpp Author: Shuo Wang Email: shuow.nosp@m.ang..nosp@m.learn.nosp@m.er@g.nosp@m.mail..nosp@m.com

Last change: 11, Aug 2014

Referenced by initializeParameter(), and partitionSystem().


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