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

rdModel Class Reference

An abstract class that specifies the interface for a dynamic model. More...

#include <rdModel.h>

Inheritance diagram for rdModel:

rdMimic rdSDFast rdActuatedModel_SDFast rdUTWalking8 suShank suSIMM cgmalWalking01 rdBlock suBlock suHopper suSlider suUTWalk8IAHard suUTWalk8IATaylor suUTWalkGenFrc List of all members.

Public Member Functions

 rdModel ()
 Default constructor.

virtual ~rdModel ()
 Destructor.

int getNX () const
 Get the number of controls for this model.

int getNQ () const
 Get the number of generalized coordinates.

int getNU () const
 Get the number of generalized speeds.

int getNY () const
 Get the total number of states.

int getNYP () const
 Get the total number of pseudo-states.

int getNB () const
 Get the number of bodies in this model, not counting the ground inertial reference frame.

int getNJ () const
 Get the number of joints in this model.

int getNA () const
 Get the number of actuators in this model.

int getNP () const
 Get the number of contact points that are present given the current state of the model.

void setName (const char *aName)
 Set the name the model.

const char * getName () const
 Get the name the model.

const char * getBodyName (int aIndex) const
 Get the name of body.

const char * getCoordinateName (int aIndex) const
 Get the name of a generalized coordinate.

const char * getSpeedName (int aIndex) const
 Get the name of a generalized speed.

const char * getActuatorName (int aIndex) const
 Get the name of an actuator.

const char * getControlName (int aIndex) const
 Get the name of a control.

const char * getStateName (int aIndex) const
 Get the name of a state.

const char * getPseudoStateName (int aIndex) const
 Get the name of a pseudo-state.

int getBodyIndex (const char *aName) const
 Get the index of a body given its name.

int getCoordinateIndex (const char *aName) const
 Get the index of a generalized coordinate given its name.

int getSpeedIndex (const char *aName) const
 Get the index of a generalized speed given its name.

int getActuatorIndex (const char *aName) const
 Get the index of an actuator given its name.

int getControlIndex (const char *aName) const
 Get the index of a control given its name.

int getStateIndex (const char *aName) const
 Get the index of a state given its name.

int getPseudoStateIndex (const char *aName) const
 Get the index of a pseudo-state given its name.

virtual void set (double aT, const double aX[], const double aY[])
 Set the current time, controls, and states.

virtual void setTime (double aT)
 Set the current time.

double getTime () const
 Get the current time.

virtual void setTimeNormConstant (double aNormConst)
 Set the constant by which time is normalized.

double getTimeNormConstant () const
 Get the constant by which time is normalized.

virtual void setControls (const double aX[])
 Set the current controls.

virtual void setControl (int aIndex, double aValue)
 Set the value of a control by index.

virtual void setControl (const char *aName, double aValue)
 Set the value of a control by name.

virtual void getControls (double rX[]) const
 Get the current controls.

virtual double getControl (int aIndex) const
 Get the current value of a control by index.

double getControl (const char *aName) const
 Get the value of a control by name.

virtual void setInitialStates (const double aYI[])
 Set the initial states for this model.

virtual void getInitialStates (double rYI[]) const
 Get the initial states currently set for this model.

virtual double getInitialState (int aIndex) const
 Get the current value of an initial state by index.

double getInitialState (const char *aName) const
 Get the value of an initial state by name.

virtual void setStates (const double aY[])=0
virtual void getStates (double rY[]) const=0
virtual double getState (int aIndex) const=0
double getState (const char *aName) const
 Get the value of a state by name.

virtual void setInitialPseudoStates (const double aYPI[])
 Set the initial pseudo-states for this model.

virtual void getInitialPseudoStates (double rYPI[]) const
 Get the initial pseudo-states currently set for this model.

virtual double getInitialPseudoState (int aIndex) const
 Get the current value of an initial pseudo-state by index.

double getInitialPseudoState (const char *aName) const
 Get the value of an initial pseudo-state by name.

virtual void setPseudoStates (const double aYP[])
 Set the current pseudo-states for this model.

virtual void getPseudoStates (double rYP[]) const
 Get the current pseudo-states for this model.

virtual double getPseudoState (int aIndex) const
 Get the current value of a pseudo-state by index.

double getPseudoState (const char *aName) const
 Get the value of a pseudo-state by name.

virtual void setConfiguration (const double aY[])
 Set the configuration (that is, the generalized coordinates and speeds) of the model.

virtual void setConfiguration (const double aQ[], const double aU[])
 Set the configuration (that is, the generalized coordinates and speeds) of the model.

void getCoordinates (double rQ[]) const
 Get the current values of the generalized coordinates of the model.

double getCoordinate (int aIndex) const
 Get the current value of a coordinate by index.

double getCoordinate (const char *aName) const
 Get the value of a coordinate by name.

void getSpeeds (double rU[]) const
 Get the current values of the generalized speeds of the model.

double getSpeed (int aIndex) const
 Get the current value of a speed by index.

double getSpeed (const char *aName) const
 Get the value of a speed by name.

void getAccelerations (double rDUDT[]) const
 Get the last-computed values of the accelerations of the generalized coordinates.

double getAcceleration (int aIndex) const
 Get the last-computed value of the acceleration a generalized coordinate.

double getAcceleration (const char *aSpeedName) const
 Get the last-computed value of the acceleration a generalized coordinate specified by name.

virtual void extractConfiguration (const double aY[], double rQ[], double rU[]) const
 Extract the generalized coordinates and speeds from a state vector.

virtual void getGravity (double rGrav[3]) const
 Get the acceleration due to gravity.

virtual void setGravity (double aGrav[3])
 Set the acceleration due to gravity.

virtual int getGroundID () const=0
virtual void getBodyToJointBodyLocal (int aBody, double rBTJ[3]) const=0
virtual void getInboardToJointBodyLocal (int aBody, double rBTJ[3]) const=0
virtual double getMass (int aBody) const=0
 Get the mass of body aBody.

virtual int getInertiaBodyLocal (int aBody, double rI[3][3]) const=0
 Get the scalar inertial matrix of a body.

virtual int getInertiaBodyLocal (int aBody, double *rI) const=0
virtual void getSystemInertia (double *rM, double rCOM[3], double rI[3][3]) const=0
virtual void getSystemInertia (double *rM, double *rCOM, double *rI) const=0
virtual void getPosition (int aBody, const double aPoint[3], double rPos[3]) const=0
virtual void getVelocity (int aBody, const double aPoint[3], double rVel[3]) const=0
virtual void getAcceleration (int aBody, const double aPoint[3], double rAcc[3]) const=0
virtual void getDirectionCosines (int aBody, double rDirCos[3][3]) const=0
virtual void getDirectionCosines (int aBody, double *rDirCos) const=0
virtual void getAngularVelocity (int aBody, double rAngVel[3]) const=0
virtual void getAngularVelocityBodyLocal (int aBody, double rAngVel[3]) const=0
virtual void getAngularAcceleration (int aBody, double rAngAcc[3]) const=0
virtual void getAngularAccelerationBodyLocal (int aBody, double rAngAcc[3]) const=0
virtual void applyForce (int aBody, const double aPoint[3], const double aForce[3])=0
virtual void applyForces (int aN, const int aBodies[], const double aPoints[][3], const double aForces[][3])=0
virtual void applyForces (int aN, const int aBodies[], const double *aPoints, const double *aForces)=0
virtual void applyForceBodyLocal (int aBody, const double aPoint[3], const double aForce[3])=0
virtual void applyForcesBodyLocal (int aN, const int aBodies[], const double aPoints[][3], const double aForces[][3])=0
virtual void applyForcesBodyLocal (int aN, const int aBodies[], const double *aPoints, const double *aForces)=0
virtual void applyTorque (int aBody, const double aTorque[3])=0
virtual void applyTorques (int aN, const int aBodies[], const double aTorques[][3])=0
virtual void applyTorques (int aN, const int aBodies[], const double *aTorques)=0
virtual void applyTorqueBodyLocal (int aBody, const double aTorque[3])=0
virtual void applyTorquesBodyLocal (int aN, const int aBodies[], const double aTorques[][3])=0
virtual void applyTorquesBodyLocal (int aN, const int aBodies[], const double *aTorques)=0
virtual void applyGeneralizedForce (int aU, double aF)=0
virtual void applyGeneralizedForces (const double aF[])=0
virtual void applyGeneralizedForces (int aN, const int aU[], const double aF[])=0
virtual double getNetAppliedGeneralizedForce (int aU) const=0
virtual void computeGeneralizedForces (double aDUDT[], double rF[]) const=0
virtual int computeAccelerations (double *dqdt, double *dudt)=0
virtual void formMassMatrix (double *rI)=0
virtual void formEulerTransform (int aBody, double *rE) const=0
virtual void formJacobianTranslation (int aBody, const double aPoint[3], double *rJ, int aRefBody=-1) const=0
virtual void formJacobianOrientation (int aBody, double *rJ0, int aRefBody=-1) const=0
virtual void formJacobianEuler (int aBody, double *rJE, int aRefBody=-1) const=0
virtual int deriv (double t, double *xt, double *y, double *dy)=0
virtual int deriv (double t, double *xt, double *y, double *dqdt, double *dudt)=0
virtual void promoteControlsToStates (const double aX[], double aDT)
 Promote a set of controls to state variables.

virtual int computePerformance (double t, double *x, double *y, double *p, void *cd=NULL)
 Compute the value of the performance criterion.

virtual int computeConstraint (double t, double *x, double *y, int ic, double *c, void *cd=NULL)
 Compute the value of the constraint indexed by ic.

virtual void transform (int aBody1, const double aVec1[3], int aBody2, double rVec2[3]) const=0
virtual void convertQuaternionsToAngles (double *aQ, double *rQAng) const=0
virtual void convertQuaternionsToAngles (rdStorage *rQStore) const=0
virtual void convertAnglesToQuaternions (double *aQAng, double *rQ) const=0
virtual void convertAnglesToQuaternions (rdStorage *rQStore) const=0
virtual void convertRadiansToDegrees (double *aQRad, double *rQDeg) const=0
virtual void convertRadiansToDegrees (rdStorage *rQStore) const=0
virtual void convertDegreesToRadians (double *aQDeg, double *rQRad) const=0
virtual void convertDegreesToRadians (rdStorage *rQStore) const=0
virtual void convertAnglesToDirectionCosines (double aE1, double aE2, double aE3, double rDirCos[3][3]) const=0
virtual void convertAnglesToDirectionCosines (double aE1, double aE2, double aE3, double *rDirCos) const=0
virtual void convertDirectionCosinesToAngles (double aDirCos[3][3], double *rE1, double *rE2, double *rE3) const=0
virtual void convertDirectionCosinesToAngles (double *aDirCos, double *rE1, double *rE2, double *rE3) const=0
virtual void convertDirectionCosinesToQuaternions (double aDirCos[3][3], double *rQ1, double *rQ2, double *rQ3, double *rQ4) const=0
virtual void convertDirectionCosinesToQuaternions (double *aDirCos, double *rQ1, double *rQ2, double *rQ3, double *rQ4) const=0
virtual void convertQuaternionsToDirectionCosines (double aQ1, double aQ2, double aQ3, double aQ4, double rDirCos[3][3]) const=0
virtual void convertQuaternionsToDirectionCosines (double aQ1, double aQ2, double aQ3, double aQ4, double *rDirCos) const=0
virtual void computeActuation ()
 Compute all quantities associated with actuating a model.

virtual void applyActuatorForce (int aID)
 Apply an actuator force.

virtual void applyActuatorForces ()
 Apply actuator forces.

virtual void setActuatorForce (int aID, double aForce)
 Set the magnitude of force experted by a particular actuator.

virtual double getActuatorForce (int aID) const
 Get the magnitude of force experted by a particular actuator.

virtual double getActuatorSpeed (int aID) const
 Get the speed at which a particular actuator force is applied.

virtual double getActuatorPower (int aID) const
 Get the power delivered or absorbed by a particular actuator.

virtual void computeContact ()
 Compute all quantities associated with simulating contact between bodies.

virtual void applyContactForce (int aID)
 Apply a contacted force.

virtual void applyContactForces ()
 Apply the computed contacted forces.

virtual int getContactBodyA (int aID) const
 Get the body number of BodyA for a particular contact force.

virtual int getContactBodyB (int aID) const
 Get the body number of BodyB for a particular contact force.

virtual void setContactPointA (int aID, const double aPoint[3])
 Set the contact point on BodyA expressed in the local frame of BodyA for a specified contact.

virtual void getContactPointA (int aID, double rPoint[3]) const
 Get the contact point on BodyA expressed in the local frame of BodyA for a particular contact force.

virtual void setContactPointB (int aID, const double aPoint[3])
 Set the contact point on BodyB expressed in the local frame of BodyB for a specified contact.

virtual void getContactPointB (int aID, double rPoint[3]) const
 Get the contact point on BodyB expressed in the local frame of BodyB for a particular contact force.

virtual void getContactForce (int aID, double rF[3]) const
 Get the contact force acting on BodyB expressed in the local frame of BodyA for a particular contact force.

virtual void getContactNormalForce (int aID, double rFP[3], double rFV[3], double rF[3]) const
 Get the normal contact force acting on BodyB expressed in the local frame of BodyA for a particular contact force.

virtual void getContactTangentForce (int aID, double rFP[3], double rFV[3], double rF[3]) const
 Get the tangential contact force acting on BodyB expressed in the local frame of BodyA for a particular contact force.

virtual void getContactStiffness (int aID, const double aDX[3], double rDF[3]) const
 Get the instantaneous stiffness (or change in force on BodyB due to a change in position of the BodyB contact point) of a specified contact force.

virtual void getContactViscosity (int aID, const double aDV[3], double rDF[3]) const
 Get the instantaneous viscosity (or change in force on BodyB due to a change in velocity of the BodyB contact point) of a specified contact force.

virtual void getContactFrictionCorrection (int aID, double aDFFric[3]) const
 Get the correction that was made to the contact force to enforce friction constraints.

virtual double getContactForce (int aID) const
 Get the magnitude of force experted by a particular contact force.

virtual double getContactSpeed (int aID) const
 Get the speed at which a particular contact force is applied.

virtual double getContactPower (int aID) const
 Get the power delivered or absorbed by a particular contact force.

int getNumAnalyses ()
 Get the number of analyses.

rdAnalysisgetAnalysis (int aIndex)
 Get an analysis.

int addAnalysis (rdAnalysis *aAnalysis)
 Add an analysis to the end of the analysis list.

rdAnalysisremoveAnalysis (int aIndex)
 Remove an analysis.

void turnOffAnalyses ()
 Turn off all analyses.

void turnOnAnalyses ()
 Turn on all analyses.

void listAnalyses ()
 List analyses.

int getNumDerivCallbacks () const
 Get the number of derivative callbacks.

int getDerivCallbackIndex (rdDerivCallback *aCallback) const
 Get a derivative callback index.

rdDerivCallbackgetDerivCallback (int aIndex) const
 Get a derivative callback.

int addDerivCallback (rdDerivCallback *aCallback)
 Add a derivative callback to the end of the derivative callback list.

rdDerivCallbackremoveDerivCallback (int aIndex)
 Remove a derivative callback.

rdDerivCallbackremoveDerivCallback (rdDerivCallback *aCallback)
 Remove a derivative callback.

void makeDerivCallbacksConsecutive ()
 Make sure all derivative callbacks are consequtive.

void turnOffDerivCallbacks ()
 Turn off all derivative callbacks.

void turnOnDerivCallbacks ()
 Turn on all derivative callbacks.

void listDerivCallbacks ()
 List derivative callbacks.

void callSetCallbacks (double aT, double *aX, double *aY)
 Call all registered 'set' callbacks.

void callComputeContactCallbacks (double aT, double *aX, double *aY)
 Call all registered 'computeContact' callbacks.

void callApplyContactCallbacks (double aT, double *aX, double *aY)
 Call all registered 'applyContact' callbacks.

void callComputeActuationCallbacks (double aT, double *aX, double *aY)
 Call all registered 'computeActuation' callbacks.

void callApplyActuationCallbacks (double aT, double *aX, double *aY)
 Call all registered 'applyActuation' callbacks.

void callComputeDerivativesCallbacks (double aT, double *aX, double *aY, double *aDY)
 Call all registered 'computeDerivatives' callbacks.

rdIntegCallbackSetgetIntegCallbackSet ()
 Get the set of integration callbacks.

virtual void integBeginCallback (int aStep, double aDT, double aT, double *aX, double *aY, void *aClientData=NULL)
 This method is called at the beginning of a forward integration.

virtual void integStepCallback (double *aXPrev, double *aYPrev, int aStep, double aDT, double aT, double *aX, double *aY, void *aClientData=NULL)
 This method is called after an integration step is completed successfully.

virtual void integEndCallback (int aStep, double aDT, double aT, double *aX, double *aY, void *aClientData=NULL)
 This method is called when the integration is completed.


Static Public Member Functions

int ComputeEffectiveMassMatrix (int aNJX, int aNU, const double *aJ, const double *aIinv, double *rIeff)
 Compute an effective mass matrix given a Jacobian matrix and the inverse of a system mass matrix.

int ComputeJacobianInverse (int aNJX, int aNU, const double *aJ, const double *aI, double *rJInv)
 Compute the generalized inverse of a Jacobian matrix.


Static Public Attributes

const int ANALYSIS_LIMIT = rdModel_ANALYSIS_LIMIT
 The maximum number of analyses that can be performed simultaneously.

const int CALLBACK_LIMIT = rdModel_CALLBACK_LIMIT
 The maximum number of callbacks that can be registred simultaneously.

const int MAXLEN = rdModel_MAXLEN
 A length that can be used as a maximum length for arrays or srings.

const int NAME_LENGTH = rdModel_NAME_LENGTH
 The limit for the length of a name.

const char * DEFAULT_NAME = "rdModel"
 The default name of a model.


Protected Member Functions

virtual void setBodyName (int aIndex, const char *aName)
 Set the name of a body.

virtual void setCoordinateName (int aIndex, const char *aName)
 Set the name of a generalized coordinate.

virtual void setSpeedName (int aIndex, const char *aName)
 Set the name of a generalized speed.

virtual void setActuatorName (int aIndex, const char *aName)
 Set the name of an actuator.

virtual void setControlName (int aIndex, const char *aName)
 Set the name of a control.

virtual void setStateName (int aIndex, const char *aName)
 Set the name of a state.

virtual void setPseudoStateName (int aIndex, const char *aName)
 Set the name of a pseudo-state.


Protected Attributes

int _nx
 Number of controls.

int _nq
 Number of generalized coordinates.

int _nu
 Number of generalized speeds.

int _ny
 Number of states.

int _nyp
 Number of pseudo-states.

int _nj
 Number of joints.

int _nb
 Number of bodies.

int _na
 Number of actuators.

int _np
 Number of contact points.

char _name [rdModel_MAXLEN]
 Name of the model.

char ** _bNames
 Names of bodies.

char ** _qNames
 Names of generalized coordinates.

char ** _uNames
 Names of generalized speeds.

char ** _yNames
 Names of states.

char ** _ypNames
 Names of pseudo-states.

char ** _xNames
 Names of controls.

char ** _aNames
 Names of actuators.

double _g [3]
 Gravitational acceleration.

double _t
 Time.

double _tNormConst
 Time normalization.

double * _x
 Array of current controls.

double * _yi
 Array of initial states.

double * _ypi
 Array of initial pseudo-states.

double * _q
 Generalized coordinates.

double * _u
 Generalized Speeds.

double * _dudt
 Accelerations of the independent generalized coordinates.

rdBody ** _b
 Array of bodies.

int _nAnalyses
 Number of analyses.

rdAnalysis_analyses [rdModel_ANALYSIS_LIMIT]
 Array of analyses.

int _nDerivCallbacks
 Number of derivative callbacks.

rdDerivCallback_derivCallbacks [rdModel_CALLBACK_LIMIT]
rdIntegCallbackSet_integCallbackSet
 Set of integration callbacks.


Private Member Functions

void setNull ()
 Set the values of all data members to an appropriate "null" value.

void removeFromCallbacks ()
 Remove this model from registered callbacks.


Detailed Description

An abstract class that specifies the interface for a dynamic model.

Frank C. Anderson, except where noted

Version:
1.0


Constructor & Destructor Documentation

rdModel::~rdModel  )  [virtual]
 

Destructor.

Note that analyses registered with the model should not be deleted by the model but by the calling code that created the analyses.


Member Function Documentation

int rdModel::addAnalysis rdAnalysis aAnalysis  ) 
 

Add an analysis to the end of the analysis list.

Parameters:
aAnalysis Pointer to the analysis to add.
Returns:
-1 on failure, 0 on success.

int rdModel::addDerivCallback rdDerivCallback aCallback  ) 
 

Add a derivative callback to the end of the derivative callback list.

Parameters:
aCallback Pointer to the derivative callback to add.
Returns:
Index at which the callback is added; -1 on failure.

void rdModel::applyContactForce int  aID  )  [virtual]
 

Apply a contacted force.

For the correct contact forces to be applied correctly, computeContact() must be called prior to calling this method.

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

void rdModel::applyContactForces  )  [virtual]
 

Apply the computed contacted forces.

For the correct contact forces to be applied correctly, computeContact() must be called prior to calling this method.

Reimplemented in rdUTWalking8, rdActuatedModel_SDFast, suShank, and suSIMM.

int rdModel::computeConstraint double  t,
double *  x,
double *  y,
int  ic,
double *  c,
void *  cd = NULL
[virtual]
 

Compute the value of the constraint indexed by ic.

This virutal method simply sets the value of the constraint to 0.0. Derived classes should override this method. The parameter cd is provided so that the caller may send in client data if desired.

void rdModel::computeContact  )  [virtual]
 

Compute all quantities associated with simulating contact between bodies.

These quantities include at least the contact bodies, contact points, and contact forces.

See also:
getNP()

Reimplemented in rdUTWalking8, rdActuatedModel_SDFast, suShank, and suSIMM.

int rdModel::ComputeEffectiveMassMatrix int  aNJX,
int  aNU,
const double *  aJ,
const double *  aIinv,
double *  rIeff
[static]
 

Compute an effective mass matrix given a Jacobian matrix and the inverse of a system mass matrix.

Ieff = Inverse( aJ * Iinv * JT)

Parameters:
aNJX Number of rows in the Jacobian matrix.
aNU Number of degrees of freedom or generalized speeds.
aJ Pointer to a Jacobian (aJ[NJX][NU]).
aIinv Pointer to the inverse of a mass matrix (aIinv[NU][NU]).
aIeff Effective mass matrix (aIeff[NJX][NJX]).
Returns:
0 when successful, -1 if an error is encountered, -2 when a singularity is encountered when performing the matrix inversion.

int rdModel::ComputeJacobianInverse int  aNJX,
int  aNU,
const double *  aJ,
const double *  aI,
double *  rJInv
[static]
 

Compute the generalized inverse of a Jacobian matrix.

rJInv has the shape rJInv[NU][NJX];

rJInv = Inverse(aI) * aJT * Inverse( aJ * Inverse(aI) * JT)

Parameters:
aNJX Number of rows in the Jacobian matrix
aNU Number of generalized speeds or degrees of freedom.
aJ Pointer to the system Jacobian (NJX by NU).
aI Pointer to the system mass matrix (NU by NU).
aJInv A pointer to the generalized inverse (NU by NJX).
Returns:
0 when successful, -1 if an error is encountered, -2 when the Jacobian has a singularity.

int rdModel::computePerformance double  t,
double *  x,
double *  y,
double *  p,
void *  cd = NULL
[virtual]
 

Compute the value of the performance criterion.

This virutal method simply sets the performance to 1.0. Derived classes should override this method. The parameter cd is provided so that the caller may send in client data if desired.

void rdModel::extractConfiguration const double  aY[],
double  rQ[],
double  rU[]
const [virtual]
 

Extract the generalized coordinates and speeds from a state vector.

Note that this method does not alter the internal state of the model.

double rdModel::getAcceleration const char *  aSpeedName  )  const
 

Get the last-computed value of the acceleration a generalized coordinate specified by name.

For the returned value to be valid, the method computeAccelerations() must have been called.

Note that this method is slow and should not be used in code where it might be called repeatedly.

Parameters:
aName Name of the speed whose derivative is returned.
Returns:
Value of the acceleration. rdMath::NAN is returned on an error.
See also:
computeAccelerations()

getAccelerations(double rDUDT[])

getAcceleration(int aIndex);

double rdModel::getAcceleration int  aIndex  )  const
 

Get the last-computed value of the acceleration a generalized coordinate.

For the returned value to be valid, the method computeAccelerations() must have been called.

Parameters:
aIndex Index of the acceleration: 0 <= aIndex < getNU().
Returns:
Value of the acceleration. rdMath::NAN is returned on an error.
See also:
computeAccelerations()

getAccelerations(double rDUDT[])

getAcceleration(const char* aName);

void rdModel::getAccelerations double  rDUDT[]  )  const
 

Get the last-computed values of the accelerations of the generalized coordinates.

For the values to be valid, the method computeAccelerations() must have been called.

Parameters:
rDUDT Array to be filled with values of the accelerations of the generalized coordinates. The length of rDUDT should be at least as large as the value returned by getNU().
See also:
computeAccelerations()

getAcceleration(int aIndex)

getAcceleration(const char* aName);

double rdModel::getActuatorForce int  aID  )  const [virtual]
 

Get the magnitude of force experted by a particular actuator.

For the returned information to be valid, computeActuation() must be called prior to calling this method.

Parameters:
aID Index of the actuator- should be greater than or equal to zero and less than the value returned by getNA().
Returns:
Magnitude of actuator force.

Reimplemented in rdUTWalking8, rdActuatedModel_SDFast, and suUTWalkGenFrc.

int rdModel::getActuatorIndex const char *  aName  )  const
 

Get the index of an actuator given its name.

Note that the actuator names need to be unique for this method to work properly.

Parameters:
aName Name of an actuator.
Returns:
Index of the first actuator with the name aName; -1, if there is no such actuator or if there is an error.

const char * rdModel::getActuatorName int  aIndex  )  const
 

Get the name of an actuator.

Parameters:
aIndex Index of the actuator whose name is desired. aIndex should be greater than or equal to 0 and less than the number of actuators.
Returns:
Control name.
See also:
getNA()

Reimplemented in rdActuatedModel_SDFast.

double rdModel::getActuatorPower int  aID  )  const [virtual]
 

Get the power delivered or absorbed by a particular actuator.

A positive power means the actuator is doing work on the model; negative power means that the actuator is absorbing energy from the model.

For the returned information to be valid, computeActuation() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
Returns:
Power delivered (positive) or absorbed (negative).

Reimplemented in rdUTWalking8, rdActuatedModel_SDFast, and suUTWalkGenFrc.

double rdModel::getActuatorSpeed int  aID  )  const [virtual]
 

Get the speed at which a particular actuator force is applied.

For the returned information to be valid, computeActuation() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
Returns:
Speed at which actuator force is applied.

Reimplemented in rdUTWalking8, rdActuatedModel_SDFast, and suUTWalkGenFrc.

rdAnalysis * rdModel::getAnalysis int  aIndex  ) 
 

Get an analysis.

Parameters:
aIndex Index to the analysis returned.
Returns:
Pointer to an analysis.

int rdModel::getBodyIndex const char *  aName  )  const
 

Get the index of a body given its name.

The returned indices start at 0: for the first, 0 is returned; for the second, 1; etc.

Note that the body names need to be unique for this method to work properly.

Parameters:
aName Name of a body.
Returns:
Index of the first body with the name aName; -1, if there is no such body or if there is an error. Indices start at 0.

const char * rdModel::getBodyName int  aIndex  )  const
 

Get the name of body.

Parameters:
aIndex Index of the body whose name is desired. aIndex should be greater than or equal to 0 and less than the number of bodies.
Returns:
Control name.
See also:
getNB()

int rdModel::getContactBodyA int  aID  )  const [virtual]
 

Get the body number of BodyA for a particular contact force.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
Returns:
Body ID of BodyA.

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

int rdModel::getContactBodyB int  aID  )  const [virtual]
 

Get the body number of BodyB for a particular contact force.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
Returns:
Body ID of BodyB.

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

double rdModel::getContactForce int  aID  )  const [virtual]
 

Get the magnitude of force experted by a particular contact force.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
Returns:
Magnitude of contact force.

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

void rdModel::getContactForce int  aID,
double  rF[3]
const [virtual]
 

Get the contact force acting on BodyB expressed in the local frame of BodyA for a particular contact force.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
rF Total contact force acting on BodyB expressed in the local frame of BodyA.

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

void rdModel::getContactFrictionCorrection int  aID,
double  aDFFric[3]
const [virtual]
 

Get the correction that was made to the contact force to enforce friction constraints.

This correction is returned as the change in contact force applied to BodyB expressed in the local frame of BodyA.

Note that this correction is NOT intended to express changes in contact force due to damping terms, but rather changes due to the enforcement of constraints on the tangential component of the contact force, such as enforcing a coefficient of friction (e.g., fx <= mu*fy).

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
rDFFric Change in contact force due to enforcing friction constraints. This correction is returned as the change in contact force applied to BodyA expressed in the local frame of BodyA.

Reimplemented in rdActuatedModel_SDFast.

void rdModel::getContactNormalForce int  aID,
double  rFP[3],
double  rFV[3],
double  rF[3]
const [virtual]
 

Get the normal contact force acting on BodyB expressed in the local frame of BodyA for a particular contact force.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
rFP Elastic normal contact force NOT corrected to enforce friction constraints.
rFV Viscous normal contact force NOT corrected to enforce friction constraints.
rF Total normal contact force acting on BodyB expressed in the local frame of BodyA. This is the actual normal force applied to BodyB.

Reimplemented in rdActuatedModel_SDFast.

void rdModel::getContactPointA int  aID,
double  rPoint[3]
const [virtual]
 

Get the contact point on BodyA expressed in the local frame of BodyA for a particular contact force.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
rPoint Contact point on BodyA expressed in the local frame of BodyA.

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

void rdModel::getContactPointB int  aID,
double  rPoint[3]
const [virtual]
 

Get the contact point on BodyB expressed in the local frame of BodyB for a particular contact force.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
rPoint Contact point on BodyB expressed in the local frame of BodyB.

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

double rdModel::getContactPower int  aID  )  const [virtual]
 

Get the power delivered or absorbed by a particular contact force.

A positive power means the contact force is doing work on the model; negative power means that the contact force is absorbing energy from the model.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
Returns:
Power delivered (positive) or absorbed (negative).

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

double rdModel::getContactSpeed int  aID  )  const [virtual]
 

Get the speed at which a particular contact force is applied.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
Returns:
Speed at which contact force is applied.

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

void rdModel::getContactStiffness int  aID,
const double  aDX[3],
double  rDF[3]
const [virtual]
 

Get the instantaneous stiffness (or change in force on BodyB due to a change in position of the BodyB contact point) of a specified contact force.

aDF = (stiffness) * aDX; stiffness == df/dx (partial of f wrt x)

The displacement (aDX) is assumed to be expressed in the local frame of BodyA and specifies a change in position of the BodyB contact point. If the aDX is a unit vector, the returned value is the stiffness of the contact force in the direction aDX. However, if aDX is not a unit vector, the returned value is the change in force applied to BodyB that would occur for a displacment of aDX.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
aDX Displacement of the BodyB contact point expressed in the local frame of BodyA.
rDF Change in force applied to BodyB for the given displacement (or stiffness if |aDX| = 1.0) expressed in the local frame of BodyA.

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

void rdModel::getContactTangentForce int  aID,
double  rFP[3],
double  rFV[3],
double  rF[3]
const [virtual]
 

Get the tangential contact force acting on BodyB expressed in the local frame of BodyA for a particular contact force.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
rFP Elastic tangential contact force NOT corrected to enforce friction constraints.
rFV Viscous tangential contact force NOT corrected to enforce friction constraints.
rF Total tangential contact force acting on BodyB expressed in the local frame of BodyA. This is the actual tangential force applied to BodyB.

Reimplemented in rdActuatedModel_SDFast.

void rdModel::getContactViscosity int  aID,
const double  aDV[3],
double  rDF[3]
const [virtual]
 

Get the instantaneous viscosity (or change in force on BodyB due to a change in velocity of the BodyB contact point) of a specified contact force.

aDF = (viscosity) * aDV; viscosity == df/dv (partial of f wrt v)

The velocity change (aDV) is assumed to be expressed in the local frame of BodyA and specifies a change in velocity of the BodyB contact point. If the aDV is a unit vector, the returned value is the visocity of the contact force in the direction aDV. However, if aDV is not a unit vector, the returned value is the change in force applied to BodyB that would occur for a change in velocity of aDV.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
aDV Change in velocity of the BodyB contact point expressed in the local frame of BodyA.
rDF Change in force applied to BodyB for the given velocity change (or viscosity if |aDX| = 1.0) expressed in the local frame of BodyA.

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

double rdModel::getControl const char *  aName  )  const
 

Get the value of a control by name.

Note that this method is slow and should not be used in code where it might be called repeatedly.

Parameters:
aName Name of the control.
Returns:
Value of the control. rdMath::NAN is returned on an error.
See also:
getControls(double rX[])

getControl(int aIndex);

double rdModel::getControl int  aIndex  )  const [virtual]
 

Get the current value of a control by index.

Parameters:
aIndex Index of the control: 0 <= aIndex < getNX().
Returns:
Value of the control. rdMath::NAN is returned on an error.
See also:
getControls(double rX[])

getControl(const char* aName);

int rdModel::getControlIndex const char *  aName  )  const
 

Get the index of a control given its name.

The returned indices start at 0: for the first, 0 is returned; for the second, 1; etc.

Note that the control names need to be unique for this method to work properly.

Parameters:
aName Name of a control.
Returns:
Index of the first control with the name aName; -1, if there is no such control or if there is an error. Indicies start at 0.

const char * rdModel::getControlName int  aIndex  )  const
 

Get the name of a control.

Parameters:
aIndex Index of the control whose name is desired. aIndex should be greater than or equal to 0 and less than the number of controls.
Returns:
Control name.
See also:
getNX()

void rdModel::getControls double  rX[]  )  const [virtual]
 

Get the current controls.

Parameters:
rX Array to be filled with the controls values. The array must be long enough to hold all of the controls.

double rdModel::getCoordinate const char *  aName  )  const
 

Get the value of a coordinate by name.

Note that this method is slow and should not be used in code where it might be called repeatedly.

Parameters:
aName Name of the coordinate.
Returns:
Value of the coordinate. rdMath::NAN is returned on an error.
See also:
getCoordinates(double rQ[])

getCoordinate(int aIndex);

double rdModel::getCoordinate int  aIndex  )  const
 

Get the current value of a coordinate by index.

Parameters:
aIndex Index of the coordinate: 0 <= aIndex < getNQ().
Returns:
Value of the cooridnate. rdMath::NAN is returned on an error.
See also:
getCoordinates(double rQ[])

getCoordinate(const char* aName);

int rdModel::getCoordinateIndex const char *  aName  )  const
 

Get the index of a generalized coordinate given its name.

The returned indices start at 0: for the first, 0 is returned; for the second, 1; etc.

Note that the coordinate names need to be unique for this method to work properly.

Parameters:
aName Name of a coordinate.
Returns:
Index of the first coordinate with the name aName; -1, if there is no such coordinate or if there is an error. The indicies start at 0.

const char * rdModel::getCoordinateName int  aIndex  )  const
 

Get the name of a generalized coordinate.

Parameters:
aIndex Index of the coordinate whose name is desired. aIndex should be greater than or equal to 0 and less than the number of generalized coordinates.
Returns:
Control name.
See also:
getNQ()

void rdModel::getCoordinates double  rQ[]  )  const
 

Get the current values of the generalized coordinates of the model.

Parameters:
rQ Array to be filled with values of the generalized coordinates. The length of rQ should be at least as large as the value returned by getNQ().

rdDerivCallback * rdModel::getDerivCallback int  aIndex  )  const
 

Get a derivative callback.

Parameters:
aIndex Index to the desired derivative callback.
Returns:
Pointer to the derivative callback.

int rdModel::getDerivCallbackIndex rdDerivCallback aCallback  )  const
 

Get a derivative callback index.

Parameters:
aCallback Pointer to the desired callback.
Returns:
Index of the derivative callback; if there is no such callback or aCallback is NULL, -1 is returned.

int rdModel::getInertiaBodyLocal int  aBody,
double  rI[3][3]
const [pure virtual]
 

Get the scalar inertial matrix of a body.

Parameters:
aBody Body ID.
rI Inertia matrix expressed in terms of body-local coordinates.
Returns:
-1 on an error, 0 otherwise.

Implemented in rdMimic, and rdSDFast.

double rdModel::getInitialPseudoState const char *  aName  )  const
 

Get the value of an initial pseudo-state by name.

Note that this method is slow and should not be used in code where it might be called repeatedly.

Parameters:
aName Name of the initial pseudo-state.
Returns:
Value of the initial pseudo-state. rdMath::NAN is returned on an error.
See also:
getInitialPseudoStates(double rYPI[])

getInitialPseudoState(int aIndex);

double rdModel::getInitialPseudoState int  aIndex  )  const [virtual]
 

Get the current value of an initial pseudo-state by index.

Parameters:
aIndex Index of the initial pseudo-state: 0 <= aIndex < getNYP().
Returns:
Value of the initial pseudo-state. rdMath::NAN is returned on an error.
See also:
getInitialPseudoStates(double rYP[])

getInitialPseudoState(const char* aName);

void rdModel::getInitialPseudoStates double  rYPI[]  )  const [virtual]
 

Get the initial pseudo-states currently set for this model.

Parameters:
rYPI Array to be filled with the initial pseudo-states. The size of rYP must be at least the number of pseudo-states, which can be found by calling getNYP().

double rdModel::getInitialState const char *  aName  )  const
 

Get the value of an initial state by name.

Note that this method is slow and should not be used in code where it might be called repeatedly.

Parameters:
aName Name of the initial state.
Returns:
Value of the initial state. rdMath::NAN is returned on an error.
See also:
getInitialStates(double rYI[])

getInitialState(int aIndex);

double rdModel::getInitialState int  aIndex  )  const [virtual]
 

Get the current value of an initial state by index.

Parameters:
aIndex Index of the initial state: 0 <= aIndex < getNY().
Returns:
Value of the initial state. rdMath::NAN is returned on an error.
See also:
getInitialStates(double rYI[])

getInitialState(const char* aName);

void rdModel::getInitialStates double  rYI[]  )  const [virtual]
 

Get the initial states currently set for this model.

Parameters:
rYI Array to be filled with the initial states. The size of rY must be at least the number of states, which can be found by calling getNY().

double rdModel::getMass int  aBody  )  const [pure virtual]
 

Get the mass of body aBody.

aBody must be in the range 0 <= aBody < NumBodies. If it is not, a mass of -1.0 is returned.

Implemented in rdMimic, and rdSDFast.

int rdModel::getNA  )  const
 

Get the number of actuators in this model.

Returns:
Number of actuators.

const char * rdModel::getName  )  const
 

Get the name the model.

Returns:
Constant pointer to the name of the model.

int rdModel::getNP  )  const
 

Get the number of contact points that are present given the current state of the model.

This method returns a valid result only after the contact points have been computed.

Returns:
Number of contact points.
See also:
getContactPointsBodyLocal()

int rdModel::getNumAnalyses  ) 
 

Get the number of analyses.

Returns:
Number of analyses.

int rdModel::getNumDerivCallbacks  )  const
 

Get the number of derivative callbacks.

Returns:
Number of derivative callbacks.

double rdModel::getPseudoState const char *  aName  )  const
 

Get the value of a pseudo-state by name.

Note that this method is slow and should not be used in code where it might be called repeatedly.

Parameters:
aName Name of the pseudo-state.
Returns:
Value of the pseudo-state. rdMath::NAN is returned on an error.
See also:
getPseudoStates(double rYP[])

getPseudoState(int aIndex);

double rdModel::getPseudoState int  aIndex  )  const [virtual]
 

Get the current value of a pseudo-state by index.

Parameters:
aIndex Index of the pseudo-state: 0 <= aIndex < getNYP().
Returns:
Value of the pseudo-state. rdMath::NAN is returned on an error.
See also:
getPseudoStates(double rYP[])

getPseudoState(const char* aName);

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

int rdModel::getPseudoStateIndex const char *  aName  )  const
 

Get the index of a pseudo-state given its name.

The returned indices start at 0: for the first, 0 is returned; for the second, 1; etc.

Note that the pseudo-state names need to be unique for this method to work properly.

Parameters:
aName Name of a pseudo-state.
Returns:
Index of the first pseudo-state with the name aName; -1, if there is no such pseudo-state or if there is an error. Indices start at 0.

const char * rdModel::getPseudoStateName int  aIndex  )  const
 

Get the name of a pseudo-state.

Parameters:
aIndex Index of the pseudo-state whose name is desired. aIndex should be greater than or equal to 0 and less than the number of states.
Returns:
Pseudo-state name.
See also:
getNYP()

void rdModel::getPseudoStates double  rYP[]  )  const [virtual]
 

Get the current pseudo-states for this model.

The pseudo-states are those quantities that are not integrated during a simulation but which are dependent on the time history of the states. Pseudo-states cannot be computed from the states.

Parameters:
rYP Array to be filled with copies of the pseudo-states. The length of rYP must be at least as large as the value returned by getNYP().

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

double rdModel::getSpeed const char *  aName  )  const
 

Get the value of a speed by name.

Note that this method is slow and should not be used in code where it might be called repeatedly.

Parameters:
aName Name of the speed.
Returns:
Value of the speed. rdMath::NAN is returned on an error.
See also:
getSpeeds(double rU[])

getSpeed(int aIndex);

double rdModel::getSpeed int  aIndex  )  const
 

Get the current value of a speed by index.

Parameters:
aIndex Index of the speed: 0 <= aIndex < getNU().
Returns:
Value of the speed. rdMath::NAN is returned on an error.
See also:
getSpeeds(double rU[])

getSpeed(const char* aName);

int rdModel::getSpeedIndex const char *  aName  )  const
 

Get the index of a generalized speed given its name.

The returned indices start at 0: for the first, 0 is returned; for the second, 1; etc.

Note that the speed names need to be unique for this method to work properly.

Parameters:
aName Name of a speed.
Returns:
Index of the first speed with the name aName; -1, if there is no such speed or if there is an error. Indicies start at 0.

const char * rdModel::getSpeedName int  aIndex  )  const
 

Get the name of a generalized speed.

Parameters:
aIndex Index of the speed whose name is desired. aIndex should be greater than or equal to 0 and less than the number of generalized speeds.
Returns:
Control name.
See also:
getNU()

void rdModel::getSpeeds double  rU[]  )  const
 

Get the current values of the generalized speeds of the model.

Parameters:
rU Array to be filled with values of the generalized speeds. The length of rU should be at least as large as the value returned by getNU().

double rdModel::getState const char *  aName  )  const
 

Get the value of a state by name.

Note that this method is slow and should not be used in code where it might be called repeatedly.

Parameters:
aName Name of the state.
Returns:
Value of the state. rdMath::NAN is returned on an error.
See also:
getStates(double rY[])

getState(int aIndex);

int rdModel::getStateIndex const char *  aName  )  const
 

Get the index of a state given its name.

The returned indices start at 0: for the first, 0 is returned; for the second, 1; etc.

Note that the state names need to be unique for this method to work properly.

Parameters:
aName Name of a state.
Returns:
Index of the first state with the name aName; -1, if there is no such state or if there is an error. Indices start at 0.

const char * rdModel::getStateName int  aIndex  )  const
 

Get the name of a state.

Parameters:
aIndex Index of the state whose name is desired. aIndex should be greater than or equal to 0 and less than the number of states.
Returns:
State name.
See also:
getNY()

double rdModel::getTime  )  const
 

Get the current time.

Returns:
Current time.

double rdModel::getTimeNormConstant  )  const
 

Get the constant by which time is normalized.

By default, the time normalization constant is 1.0.

Returns:
Current time.

void rdModel::integBeginCallback int  aStep,
double  aDT,
double  aT,
double *  aX,
double *  aY,
void *  aClientData = NULL
[virtual]
 

This method is called at the beginning of a forward integration.

Override this method in a derived class as needed.

Parameters:
aStep Step number of the integration.
aDT Size of the time step that will be attempted.
aT Current time in the integration.
aX Current control values.
aY Current states.
aClientData General use pointer for sending in client data.

Reimplemented in rdUTWalking8, rdActuatedModel_SDFast, suShank, suSIMM, suUTWalk8IAHard, suUTWalk8IATaylor, and suUTWalkGenFrc.

void rdModel::integEndCallback int  aStep,
double  aDT,
double  aT,
double *  aX,
double *  aY,
void *  aClientData = NULL
[virtual]
 

This method is called when the integration is completed.

Override this method in a derived class as needed.

Parameters:
aStep Step number of the integration.
aDT Size of the time step that was just completed.
aT Current time in the integration.
aX Current control values.
aY Current states.
aClientData General use pointer for sending in client data.

Reimplemented in suShank, and suSIMM.

void rdModel::integStepCallback double *  aXPrev,
double *  aYPrev,
int  aStep,
double  aDT,
double  aT,
double *  aX,
double *  aY,
void *  aClientData = NULL
[virtual]
 

This method is called after an integration step is completed successfully.

Override this method in a derived class as needed.

Parameters:
aXPrev Control values at the previous time step.
aYPrev State values at the previous time step.
aStep Step number of the integration.
aDT Size of the time step that was just completed.
aT Current time in the integration.
aX Current control values.
aY Current states.
aClientData General use pointer for sending in client data.

Reimplemented in rdUTWalking8, rdActuatedModel_SDFast, suShank, suSIMM, suUTWalk8IAHard, suUTWalk8IATaylor, and suUTWalkGenFrc.

void rdModel::promoteControlsToStates const double  aX[],
double  aDT
[virtual]
 

Promote a set of controls to state variables.

This utility routine is normally useful when solving static optimization problems with a dynamic model. In the base class, this method does nothing.

Parameters:
aX Controls.

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

rdAnalysis * rdModel::removeAnalysis int  aIndex  ) 
 

Remove an analysis.

Parameters:
aIndex Index of analysis to remove.
Returns:
Pointer to the analysis removed.

rdDerivCallback * rdModel::removeDerivCallback rdDerivCallback aCallback  ) 
 

Remove a derivative callback.

The model is not the owner of the callback, so the caller is responsible for deleting the callback.

Parameters:
aCallback Pointer to the derivative callback to remove.
Returns:
Pointer to the derivative callback removed; NULL if there was no mathcing callback.

rdDerivCallback * rdModel::removeDerivCallback int  aIndex  ) 
 

Remove a derivative callback.

The model is not the owner of the callback, so the caller is responsible for deleting the callback.

Parameters:
aIndex Index of the derivative callback to remove.
Returns:
Pointer to the derivative callback removed; NULL if there was no callback at aIndex.

void rdModel::set double  aT,
const double  aX[],
const double  aY[]
[virtual]
 

Set the current time, controls, and states.

This method is simply a convenience method for calling setTime(), setControls(), and setStates(). This method, or all of the methods it calls, should be called at the beginning of a dynamic analysis.

Parameters:
aT Time.
aX Array of controls (length should be getNX()).
aY Array of states (length should be getNY()).

void rdModel::setActuatorForce int  aID,
double  aForce
[virtual]
 

Set the magnitude of force experted by a particular actuator.

Parameters:
aID Index of the actuator- should be greater than or equal to zero and less than the value returned by getNA().
aForce Magnitude of the actuator force.

Reimplemented in rdUTWalking8, and suUTWalkGenFrc.

void rdModel::setActuatorName int  aIndex,
const char *  aName
[protected, virtual]
 

Set the name of an actuator.

Parameters:
aIndex Index of the actuator whose name should be set. aIndex should be greater than or equal to 0 and less than the number of actuators.
aName Name of actuator.
See also:
getNA()

void rdModel::setBodyName int  aIndex,
const char *  aName
[protected, virtual]
 

Set the name of a body.

Parameters:
aIndex Index of the body whose name should be set. aIndex should be greater than or equal to 0 and less than the number of bodies.
aName Name of body.
See also:
getNB()

void rdModel::setConfiguration const double  aQ[],
const double  aU[]
[virtual]
 

Set the configuration (that is, the generalized coordinates and speeds) of the model.

Parameters:
aQ Generalized coordinates.
aU Generalized speeds.

Reimplemented in rdMimic, and rdSDFast.

void rdModel::setConfiguration const double  aY[]  )  [virtual]
 

Set the configuration (that is, the generalized coordinates and speeds) of the model.

Parameters:
aY Array of states. The length of aY should be at least as large as the value returned by getNY().

Reimplemented in rdMimic, and rdSDFast.

void rdModel::setContactPointA int  aID,
const double  aPoint[3]
[virtual]
 

Set the contact point on BodyA expressed in the local frame of BodyA for a specified contact.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
aPoint Contact point on BodyA expressed in the local frame of BodyA.

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

void rdModel::setContactPointB int  aID,
const double  aPoint[3]
[virtual]
 

Set the contact point on BodyB expressed in the local frame of BodyB for a specified contact.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
aPoint Contact point on BodyB expressed in the local frame of BodyB.

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

void rdModel::setControl const char *  aName,
double  aValue
[virtual]
 

Set the value of a control by name.

Note that this method is slow and should not be used in code where it might be called repeatedly.

Parameters:
aIndex Index of the control to be set: 0 <= aIndex < getNX().
aValue Value of the control.

void rdModel::setControl int  aIndex,
double  aValue
[virtual]
 

Set the value of a control by index.

Parameters:
aIndex Index of the control to be set: 0 <= aIndex < getNX().
aValue Value of the control.

void rdModel::setControlName int  aIndex,
const char *  aName
[protected, virtual]
 

Set the name of a control.

Parameters:
aIndex Index of the control whose name should be set. aIndex should be greater than or equal to 0 and less than the number of controls.
aName Name of control.
See also:
getNX()

void rdModel::setControls const double  aX[]  )  [virtual]
 

Set the current controls.

Parameters:
aX Array of controls.

Reimplemented in rdActuatedModel_SDFast.

void rdModel::setCoordinateName int  aIndex,
const char *  aName
[protected, virtual]
 

Set the name of a generalized coordinate.

Parameters:
aIndex Index of the coordinate whose name should be set. aIndex should be greater than or equal to 0 and less than the number of coordinates.
aName Name of generalized coordinate.
See also:
getNQ()

void rdModel::setInitialPseudoStates const double  aYPI[]  )  [virtual]
 

Set the initial pseudo-states for this model.

Parameters:
aYPI Array of pseudo-states. The size of rYP must be at least the number of pseudo-states, which can be found by calling getNYP().

void rdModel::setInitialStates const double  aYI[]  )  [virtual]
 

Set the initial states for this model.

Parameters:
aYI Array of states. The size of rY must be at least the number of states, which can be found by calling getNY().

void rdModel::setName const char *  aName  ) 
 

Set the name the model.

Parameters:
aName Name of the model.

void rdModel::setPseudoStateName int  aIndex,
const char *  aName
[protected, virtual]
 

Set the name of a pseudo-state.

Parameters:
aIndex Index of the pseudo-state whose name should be set. aIndex should be greater than or equal to 0 and less than the number of pseudo-states.
aName Name of pseudo-state.
See also:
getNYP()

void rdModel::setPseudoStates const double  aYP[]  )  [virtual]
 

Set the current pseudo-states for this model.

The pseudo-states are those quantities that are not integrated during a simulation but which are dependent on the time history of the states. Pseudo-states cannot be computed from the states.

Parameters:
aYP Array of pseudo-states. The size of aYP should be the value returned by getNYP().

Reimplemented in rdUTWalking8, and rdActuatedModel_SDFast.

void rdModel::setSpeedName int  aIndex,
const char *  aName
[protected, virtual]
 

Set the name of a generalized speed.

Parameters:
aIndex Index of the speed whose name should be set. aIndex should be greater than or equal to 0 and less than the number of speeds.
aName Name of generalized speed.
See also:
getNU()

void rdModel::setStateName int  aIndex,
const char *  aName
[protected, virtual]
 

Set the name of a state.

Parameters:
aIndex Index of the state whose name should be set. aIndex should be greater than or equal to 0 and less than the number of states.
aName Name of state.
See also:
getNY()

void rdModel::setTime double  aT  )  [virtual]
 

Set the current time.

Parameters:
Current time.

void rdModel::setTimeNormConstant double  aNormConst  )  [virtual]
 

Set the constant by which time is normalized.

The normalization constant must be greater than or equal to the constant rdMath::ZERO.

Parameters:
Time normalization constant.


Member Data Documentation

int rdModel::_ny [protected]
 

Number of states.

A state is an integrated quantity.

int rdModel::_nyp [protected]
 

Number of pseudo-states.

A pseudo-state is a quantity that is not integrated but nevertheless depends on the time history of states. A pseudo-state cannot be computed from the current values 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