#include <rdIntegRKF.h>
Inheritance diagram for rdIntegRKF:

Public Member Functions | |
| rdIntegRKF (rdModel *aModel=NULL, double aTol=1.0e-4, double aTolFine=-1.0) | |
| Constructs an rdIntegRKF based on the specified model and integration tolerance. | |
| virtual | ~rdIntegRKF () |
| Destructor. | |
| void | setMinDT (double aMin) |
| Set the minimum integration step size. | |
| double | getMinDT () |
| Get the maximum number of integration steps. | |
| void | setMaxDT (double aMax) |
| Set the maximum integration step size. | |
| double | getMaxDT () |
| Get the maximum number of integration steps. | |
| void | setMaximumNumberOfSteps (int aMaxSteps) |
| Set the maximum number of integration steps. | |
| int | getMaximumNumberOfSteps () |
| Get the maximum number of integration steps. | |
| int | getStatus () |
| Get the status of the integrator. | |
| void | setUseSpecifiedDT (bool aTrueFalse) |
| Set whether or not to take a specified sequence of deltas during an integration. | |
| bool | getUseSpecifiedDT () const |
| Get whether or not to take a specified sequence of deltas during an integration. | |
| void | setUseConstantDT (bool aTrueFalse) |
| Set whether or not to take a constant integration time step. | |
| bool | getUseConstantDT () const |
| Get whether or not to use a constant integration time step. | |
| void | setDT (double aDT) |
| Set the fixed time step to be taken when the integrator is set to take a constant time step and when appropriate time steps are not available in the time vector. | |
| double | getDT () const |
| Get the fixed time step to be taken when the integrator is set to take a fixed time step and when appropriate time steps are not available in the time vector. | |
| const rdArray< double > & | getDTArray () |
| Get the time deltas used in the last integration. | |
| void | setDTArray (int aN, const double aDT[], double aTI=0.0) |
| Set the deltas held in the dt array. | |
| double | getDTArrayDT (int aStep) |
| Get the delta used for a specified integration step. | |
| void | printDTArray (const char *aFileName=NULL) |
| Print the dt array. | |
| const rdArray< double > & | getTimeArray () |
| Get the sequence of time steps taken in the last integration. | |
| double | getTimeArrayTime (int aStep) |
| Get the time of a specified integration step. | |
| int | getTimeArrayStep (double aTime) |
| Get the integration step (index) that occured prior to or at a specified time. | |
| void | printTimeArray (const char *aFileName=NULL) |
| Print the time array. | |
| void | resetTimeAndDTArrays (double aTime) |
| Reset the time and dt arrays so that all times after the specified time and the corresponding deltas are erased. | |
| void | setControlStorage (rdStorage *aStorage) |
| Set the storage buffer for the integration controls. | |
| rdStorage * | getControlStorage () |
| Get the storage buffer for the integration controls. | |
| void | setStateStorage (rdStorage *aStorage) |
| Set the storage buffer for the integration states. | |
| rdStorage * | getStateStorage () |
| Get the storage buffer for the integration states. | |
| void | setPseudoStateStorage (rdStorage *aStorage) |
| Set the storage for the pseudostates. | |
| rdStorage * | getPseudoStateStorage () |
| Get the storage for the pseudostates. | |
| void | setController (rdController *aController) |
| Set a controller for this integration. | |
| rdController * | getController () |
| Get the dynamic filter. | |
| bool | integrate (double ti, double tf, rdControlSet &x, double *y, double dtFirst=1.0e-3) |
| Integrate the equations of motion from an initial time to a final time. | |
| void | halt () |
| Halt an integration. | |
| void | clearHalt () |
| Clear the halt flag. | |
| bool | checkHalt () |
| Check for a halt request. | |
Private Member Functions | |
| void | setNull () |
| Constructs an rdIntegRKF based on the specified model and integration tolerance. | |
Private Attributes | |
| rdController * | _controller |
| Controller for the simulation. | |
| int | _status |
| Status of the integration. | |
| int | _steps |
| Number of integration steps successfully taken. | |
| int | _trys |
| Number of integration step trys. | |
| int | _maxSteps |
| Maximum number of steps in an integration. | |
| bool | _halt |
| Flag for signaling a desired halt. | |
| double | _dtMin |
| Minimum step size. | |
| double | _dtMax |
| Maximum step size. | |
| double * | _x |
| Array of control values at the current time. | |
| double * | _xPrev |
| Array of control values at the previous integration time step. | |
| double * | _yPrev |
| Array of state values at the previous integration time step. | |
| double * | _yp |
| Array of pseudo states. | |
| bool | _specifiedDT |
| Flag to indicate whether or not specified integration time steps should be used. | |
| bool | _constantDT |
| Flag to indicate whether or not constant (fixed) integration time steps should be used. | |
| double | _dt |
| Constant integration time step. | |
| rdArray< double > | _tArray |
| Vector of integration time steps. | |
| rdArray< double > | _dtArray |
| Vector of integration time step deltas. | |
| rdStorage * | _controlStorage |
| Storage for the controls. | |
| rdStorage * | _stateStorage |
| Storage for the states. | |
| rdStorage * | _pseudoStorage |
| Storage for the pseudostates. | |
This class performs the relatively high-level tasks during an integration and implements the logic for when to reduce the integration step size or increase it. This class sits on top of class rdRKF which implements the low-level numerics for computing the derivatives and taking the states one step forward in time. RKF means Runge-Kutta-Feldberg. See rdRKF for details.
The user must supply a valid pointer to an rdModel on construction.
|
|
Check for a halt request. The value of the halt flag is simply returned. |
|
|
Clear the halt flag. The value of the interrupt flag is set to false. |
|
|
Get the dynamic filter.
|
|
|
Get the fixed time step to be taken when the integrator is set to take a fixed time step and when appropriate time steps are not available in the time vector.
|
|
|
Get the time deltas used in the last integration.
|
|
|
Get the delta used for a specified integration step. For step aStep, the delta returned is the delta used to go from step aStep to step aStep+1.
|
|
|
Get the integration step (index) that occured prior to or at a specified time.
|
|
|
Get the time of a specified integration step.
|
|
|
Get whether or not to use a constant integration time step. The constant integration time step can be set using setDT().
|
|
|
Get whether or not to take a specified sequence of deltas during an integration. The time deltas are obtained from what's stored in the dt vector (
|
|
|
Halt an integration. If an integration is pending or executing, the value of the interrupt flag is set to true. |
|
||||||||||||||||||||||||
|
Integrate the equations of motion from an initial time to a final time. The initial values of the states must already be set for the model.
|
|
|
Print the time array.
|
|
|
Reset the time and dt arrays so that all times after the specified time and the corresponding deltas are erased.
|
|
|
Set a controller for this integration. If one is set, the controller will be called each integration step to determine a set of controls for controlling the current model.
|
|
|
Set the fixed time step to be taken when the integrator is set to take a constant time step and when appropriate time steps are not available in the time vector.
|
|
||||||||||||||||
|
Set the deltas held in the dt array. These deltas will be used if the integrator is set to take a specified set of deltas. In order to integrate using a specified set of deltas, the sum of deltas must cover the requested integration time interval, otherwise an exception will be thrown at the beginning of an integration. Note that the time vector is reconstructed in order to check that the sum of the deltas covers a requested integration interval.
|
|
|
Set whether or not to take a constant integration time step. The size of the constant integration time step can be set using setDT().
|
|
|
Set whether or not to take a specified sequence of deltas during an integration. The time deltas are obtained from what's stored in the vector dt vector (
|
|
|
Flag to indicate whether or not constant (fixed) integration time steps should be used. The constant integration time step is set using setDT(). |
|
|
Flag to indicate whether or not specified integration time steps should be used. The specified integration time steps are held in _tVec. If _tVec does not contain time steps appropriate for the integration, an exception is thrown. |
1.3