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

rdDerivCallback Class Reference

An abstract class for specifying a derivative callback. More...

#include <rdDerivCallback.h>

Inheritance diagram for rdDerivCallback:

rdCallback rdObject suActuatorPerturbation suForceApplier suGeneralizedForcePerturbation suActuatorPerturbationIndependent List of all members.

Public Member Functions

 rdDerivCallback (rdModel *aModel)
 Default constructor.

virtual ~rdDerivCallback ()
 Destructor.

virtual void set (double aT, double *aX, double *aY)
 This method is intended to be called from rdModel::deriv() after the states of a model have been set (e.g., after rdModel::set() or rdModel::setStates()).

virtual void computeContact (double aT, double *aX, double *aY)
 This method is intended to be called from rdModel::deriv() after contact quantities have been computed (e.g., after rdModel::computeContact()).

virtual void applyContact (double aT, double *aX, double *aY)
 This method is intended to be called from rdModel::deriv() after contact forces have been applied (e.g., after rdModel::applyContactForces()).

virtual void computeActuation (double aT, double *aX, double *aY)
 This method is intended to be called from rdModel::deriv() after actuation quantities have been computed (e.g., after rdModel::computeActuation()).

virtual void applyActuation (double aT, double *aX, double *aY)
 This method is intended to be called from rdModel::deriv() after actuator forces have been applied (e.g., after rdModel::applyActuatorForces()).

virtual void computeDerivatives (double aT, double *aX, double *aY, double *aDY)
 This method is intended to be called from rdModel::deriv() after derivatives of the model states have been computed (e.g., after rdModel::computeAccelerations(), ...).


Private Member Functions

void setNull ()
 Set NULL values for member variables.


Detailed Description

An abstract class for specifying a derivative callback.

Derivative callbacks are registered with a model and provide a set of methods that the model calls during computation of the model state derivatives. The methods are set(), computeContact(), applyContact(), computeActuation(), applyActuation(), and computeDerivatives(). These methods provide low-level access for making adjustments to model states and applied forces, applying additional forces, and/or altering state derivatives. Each of these methods is intended to be called FOLLOWING the corresponding action in rdModel::deriv(), although rdModel::deriv() can be written to call these methods in any order or not at all.

Derivative callbacks are meant to make alterations to the "normal" model of simulation either for analysis or to achieve some unusual effect. Alternately, this class can be used to implement the entirety of the rdModel::deriv() method, giving the user nearly complete control of how derivatives are computed without making changes to the model. To accomplish this, the user may need to make a new derived model class that overrides rdModel::deriv() with a new method that makes the appropriate rdDerivCallback method calls.

On a final note, it is possible to register many derivative callbacks with a model and no attempt is made to ensure that the the actions of registered callbacks are compatible. Ensuring compatibility is left to the user.

Author:
Frank C. Anderson
Version:
1.0
See also:
rdModel::deriv()


Constructor & Destructor Documentation

rdDerivCallback::rdDerivCallback rdModel aModel  ) 
 

Default constructor.

Parameters:
aModel Model to which the callback mthods apply.


Member Function Documentation

void rdDerivCallback::applyActuation double  aT,
double *  aX,
double *  aY
[virtual]
 

This method is intended to be called from rdModel::deriv() after actuator forces have been applied (e.g., after rdModel::applyActuatorForces()).

Override this method in derived classes.

Reimplemented in suActuatorPerturbation, suActuatorPerturbationIndependent, suForceApplier, and suGeneralizedForcePerturbation.

void rdDerivCallback::applyContact double  aT,
double *  aX,
double *  aY
[virtual]
 

This method is intended to be called from rdModel::deriv() after contact forces have been applied (e.g., after rdModel::applyContactForces()).

Override this method in derived classes.

void rdDerivCallback::computeActuation double  aT,
double *  aX,
double *  aY
[virtual]
 

This method is intended to be called from rdModel::deriv() after actuation quantities have been computed (e.g., after rdModel::computeActuation()).

Override this method in derived classes.

Reimplemented in suActuatorPerturbation, suActuatorPerturbationIndependent, and suGeneralizedForcePerturbation.

void rdDerivCallback::computeContact double  aT,
double *  aX,
double *  aY
[virtual]
 

This method is intended to be called from rdModel::deriv() after contact quantities have been computed (e.g., after rdModel::computeContact()).

Override this method in derived classes.

void rdDerivCallback::computeDerivatives double  aT,
double *  aX,
double *  aY,
double *  aDY
[virtual]
 

This method is intended to be called from rdModel::deriv() after derivatives of the model states have been computed (e.g., after rdModel::computeAccelerations(), ...).

Override this method in derived classes.

void rdDerivCallback::set double  aT,
double *  aX,
double *  aY
[virtual]
 

This method is intended to be called from rdModel::deriv() after the states of a model have been set (e.g., after rdModel::set() or rdModel::setStates()).

Override this method in derived classes.


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