Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

rdRKF Class Reference

A class which integrates the equations of motion forward one step in time. More...

#include <rdRKF.h>

Inheritance diagram for rdRKF:

rdIntegRKF List of all members.

Public Member Functions

 rdRKF (rdModel *aModel, double aTol=1.0e-4, double aTolFine=-1.0)
 Default constructor.

virtual ~rdRKF ()
 Destructor.

rdModelgetModel ()
 Get the model.

int getNY ()
 Get the number of states being integrated.

void setTolerance (double aTol, double aTolFine=-1.0)
 Set the tolerances of the integrator.

double getTolerance ()
 Get the tolerance of the integrator.

void setFineTolerance (double aFineTol)
 Set the fine tolerance of the integrator.

double getFineTolerance ()
 Get the fine tolerance of the integrator.

int step (double dt, double t, rdControlSet &x, double *y)
 Step forward in time by dt.

int step (double dt, double t, double *x, double *y)
 Step forward in time by dt.

int stepFixed (double dt, double t, rdControlSet &x, double *y)
 Step forward in time by dt.

int stepFixed (double dt, double t, double *x, double *y)
 Step forward in time by dt.


Protected Attributes

double _tol
 Integration tolerance.

double _tolFine
 Integration fine tolerance.

rdModel_model
 Dynamic model.

int _nx
 Number of controls.

double * _x
 Controls at time t.

int _ny
 Number of states.

double * _yv
 Work arrays for computing the new states.

double * _ye
 Work arrays for computing the new states.

double * _dy
 Work arrays for computing the new states.

double * _k1
double * _k2
double * _k3
double * _k4
double * _k5
double * _k6

Private Member Functions

int allocateMemory ()
 Allocate the memory needed to perform the integration.

int freeMemory ()
 Free the memory needed to perform the integration.


Detailed Description

A class which integrates the equations of motion forward one step in time.

The integration method is based on a Runge-Kutta-Feldberg 5-6 Variable-Step Integrator adapted from one given by Atkinson, L.V., et al, "Numerical Methods with Fortran 77.", pp. 310-322, Addison-Wesley Publishing Company, 1989.

The user must supply a pointer to an rdModel on construction.


Member Function Documentation

double rdRKF::getFineTolerance  ) 
 

Get the fine tolerance of the integrator.

The fine tollerance specifies the accuracy tolerance of an integration. If the accuracy is better than aTolFine, the integration step size is doubled.

double rdRKF::getTolerance  ) 
 

Get the tolerance of the integrator.

The tolerance specifies the allowd error of an integration. If the error exceeds the tolerance, the integration step size is halved.

void rdRKF::setFineTolerance double  aFineTol  ) 
 

Set the fine tolerance of the integrator.

The fine tollerance, aTolFine, specifies the accuracy tolerance of an integration. If the accuracy is better than aTolFine, the integration step size should be doubled.

void rdRKF::setTolerance double  aTol,
double  aTolFine = -1.0
 

Set the tolerances of the integrator.

The tolerance, aTol, specifies the allowd error of an integration. If the error exceeds the tolerance, the integration step size should be halved.

The fine tollerance, aTolFine, specifies the accuracy tolerance of an integration. If the accuracy is better than aTolFine, the integration step size should be doubled.

int rdRKF::step double  dt,
double  t,
double *  x,
double *  y
 

Step forward in time by dt.

Parameters:
dt Requested integration time step.
t Current time.
x Controls.
y States.
Returns:
rdRKF_NORMAL on a successful step, rdRKF_NAN if not-a-number is encountered in any of the states, rdRKF_POOR if the integration error is worse than the specified tolerance, or rdRKF_FINE if the integration error is better than the specified fine tolerance.

int rdRKF::step double  dt,
double  t,
rdControlSet x,
double *  y
 

Step forward in time by dt.

Parameters:
dt Requested integration time step.
t Current time.
controlSet Controls.
y States.
Returns:
rdRKF_NORMAL on a successful step, rdRKF_NAN if not-a-number is encountered in any of the states, rdRKF_POOR if the integration error is worse than the specified tolerance, or rdRKF_FINE if the integration error is better than the specified fine tolerance.

int rdRKF::stepFixed double  dt,
double  t,
double *  x,
double *  y
 

Step forward in time by dt.

This method does not estimate the integration error and does not return any kind of integration status other than rdRKF_NORMAL or rdRKF_NAN.

Parameters:
dt Requested integration step.
t Current time.
x Controls.
y States.
Returns:
rdRKF_NORMAL on a successful step, or rdRKF_NAN if not-a-number is encountered in any of the states.

int rdRKF::stepFixed double  dt,
double  t,
rdControlSet x,
double *  y
 

Step forward in time by dt.

This method does not estimate the integration error and does not return any kind of integration status other than rdRKF_NORMAL or rdRKF_NAN.

Parameters:
dt Requested integration step.
t Current time.
controlSet Controls.
y States.
Returns:
rdRKF_NORMAL on a successful step, or rdRKF_NAN if not-a-number is encountered in any of the states.


The documentation for this class was generated from the following files:
Generated on Wed Aug 20 02:17:12 2003 for Simulation Software by doxygen1.3