CombinedOdeSystem Class Reference

#include <CombinedOdeSystem.hpp>

Inheritance diagram for CombinedOdeSystem:

Inheritance graph
[legend]
Collaboration diagram for CombinedOdeSystem:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 CombinedOdeSystem (std::vector< AbstractOdeSystem * > odeSystems)
void Configure (const std::map< unsigned, unsigned > &rVariableParameterMap, AbstractOdeSystem *pVariableOdeSystem, AbstractOdeSystem *pParameterOdeSystem)
void EvaluateYDerivatives (double time, const std::vector< double > &rY, std::vector< double > &rDY)

Private Attributes

std::vector< AbstractOdeSystem * > mOdeSystems
std::vector< std::vector
< double > > 
mWorkingStateVars
std::vector< std::vector
< double > > 
mWorkingDerivs
std::vector< unsigned > mOffsets
std::vector< struct
VariableParameterMap
mVariableParameterMaps

Classes

struct  VariableParameterMap


Detailed Description

An ODE system formed by combining several subsystems.

Instances of this class are formed by passing other ODE system instances to our constructor, and then calling Configure to set up any coupling between subsystems. This allows state variables from one system to be used as parameters in other systems.

This allows us to set up coupled systems such as $dy/dt = f(y, t)$ from subsystems $dy_1/dt = f_1(y_1, t; y_2)$ and $dy_2/dt = f_2(y_2, t; y_1)$ where $y = (y_1, y_2)$.

The vector of state variables for the combined system is formed as the concatenation of the state variable vectors of the subsystem. This class also makes use of the CombinedOdeSystemInformation class to provide initial conditions, etc.

Definition at line 59 of file CombinedOdeSystem.hpp.


Constructor & Destructor Documentation

CombinedOdeSystem::CombinedOdeSystem ( std::vector< AbstractOdeSystem * >  odeSystems  ) 


Member Function Documentation

void CombinedOdeSystem::Configure ( const std::map< unsigned, unsigned > &  rVariableParameterMap,
AbstractOdeSystem pVariableOdeSystem,
AbstractOdeSystem pParameterOdeSystem 
)

Configure a mapping between the state variables of one subsystem and the parameters of another.

Parameters:
rVariableParameterMap a map specifying which state variables (keys) are mapped to which parameters (values).
pVariableOdeSystem the ODE subsystem providing state variable values.
pParameterOdeSystem the ODE subsystem whose parameters should be set.

Definition at line 62 of file CombinedOdeSystem.cpp.

References mOdeSystems, mVariableParameterMaps, CombinedOdeSystem::VariableParameterMap::pParameterOdeSystem, CombinedOdeSystem::VariableParameterMap::pVariableOdeSystemIndex, and CombinedOdeSystem::VariableParameterMap::theMap.

void CombinedOdeSystem::EvaluateYDerivatives ( double  time,
const std::vector< double > &  rY,
std::vector< double > &  rDY 
) [virtual]

Evaluate the right-hand side of the combined system.

This calls EvaluateYDerivatives for each subsystem with the appropriate portion of rY and rDY, having set parameters from values in rY according to the configured maps.

Parameters:
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

Implements AbstractOdeSystem.

Definition at line 80 of file CombinedOdeSystem.cpp.

References mOdeSystems, mOffsets, mVariableParameterMaps, mWorkingDerivs, and mWorkingStateVars.


Member Data Documentation

The subsystems forming this combined system.

Definition at line 64 of file CombinedOdeSystem.hpp.

Referenced by CombinedOdeSystem(), Configure(), and EvaluateYDerivatives().

std::vector<std::vector<double> > CombinedOdeSystem::mWorkingStateVars [private]

Working memory for the Y vectors of the subsystems.

Definition at line 67 of file CombinedOdeSystem.hpp.

Referenced by CombinedOdeSystem(), and EvaluateYDerivatives().

std::vector<std::vector<double> > CombinedOdeSystem::mWorkingDerivs [private]

Working memory for the DY vectors of the subsystems.

Definition at line 69 of file CombinedOdeSystem.hpp.

Referenced by CombinedOdeSystem(), and EvaluateYDerivatives().

std::vector<unsigned> CombinedOdeSystem::mOffsets [private]

Keeps track of where the state variable vector for each subsystem is located within the combined state variable vector.

Definition at line 74 of file CombinedOdeSystem.hpp.

Referenced by CombinedOdeSystem(), and EvaluateYDerivatives().

Stores the information passed to Configure calls.

Definition at line 97 of file CombinedOdeSystem.hpp.

Referenced by Configure(), and EvaluateYDerivatives().


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

Generated on Tue Aug 4 16:11:07 2009 for Chaste by  doxygen 1.5.5