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

rdActuator Class Reference

An abstract class for representing an actuator (e.g., a torque motor, muscle, ...). More...

#include <rdActuator.h>

Inheritance diagram for rdActuator:

rdObject rdForce rdGeneralizedForce rdContactForce rdMuscleZajac rdGeneralizedForceAtv suSpringGeneralizedForce rdSetPoint rdLinearSetPoint rdPolynomialSetPoint List of all members.

Public Member Functions

 rdActuator (int aNX, int aNY, int aNYP)
 Construct an actuator that has a specified number of controls, states, and pseudostates.

 rdActuator (int aNX, int aNY, int aNYP, IDOM_Element *aElement)
 Construct an actuator from an XML Element.

 rdActuator (const rdActuator &aActuator)
 Copy constructor.

virtual ~rdActuator ()
 Destructor.

virtual rdActuator * copy () const=0
virtual rdActuator * copy (IDOM_Element *aElement) const=0
rdActuator & operator= (const rdActuator &aActuator)
 Assignment operator.

void setModel (rdModel *aModel)
 Set the model which this actuator actuates.

rdModelgetModel () const
 Get a pointer to the model on which this analysis is being performed.

int getNX () const
 Get the number of controls.

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

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

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

int getNY () const
 Get the number of states.

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

virtual void setStates (const double aY[])
 Set the current values of the states.

virtual void getStates (double rY[]) const
 Get the current values of the states.

int getNYP () const
 Get the number of pseudostates.

const char * getPseudoStateName (int aIndex) const
 Get the name of a pseudostate.

virtual void setPseudoStates (const double aY[])
 Set the current values of the pseudostates.

virtual void getPseudoStates (double rY[]) const
 Get the current values of the pseudostates.

bool getAppliesForce () const
 Get whether the actuator applies a force or torque to the model.

void setForce (double aForce)
 Set the current force (or torque) of the actuator.

double getForce () const
 Get the current force (or torque) of the actuator.

double getSpeed () const
 Get the current speed (linear or angular) of the actuator.

double getPower () const
 Get the instantaneous power developed by an actuator.

void setMaxForce (double aMax)
 Set the maximum force (or torque) that can by applied by the actuator.

double getMaxForce () const
 Get the maximum force (or torque) that can by applied by the actuator.

void setMinForce (double aMin)
 Set the minimum force (or torque) that can by applied by the actuator.

double getMinForce () const
 Get the minimum force (or torque) that can by applied by the actuator.

virtual void promoteControlsToStates (const double aX[], double aDT)
 Promote a set of controls to state variables.

virtual void computeActuation ()=0
virtual void computeStateDerivatives (double rDYDT[])
 Compute the time derivatives of the states for this actuator.

virtual void updatePseudoStates ()
 Update actuator parameters so they are intervally consistent.

virtual void apply ()=0
virtual bool check () const
 Check that this actuator is valid.

virtual void updateObject (bool aDeep=true)
 Update this object based on its XML node.

virtual void updateNode (bool aDeep=true)
 Update the XML node representing this object.

virtual void generateNode (IDOM_Element *aParent)
 Generate an XML node representing this object.

void updateData ()
 Update the member data of this object based on its XML node.


Static Public Attributes

const double LARGE = 1.0e8
const int NAME_LENGTH = rdObject_NAME_LENGTH
 A length limit for the name of an object.

const char DEFAULT_NAME [] = "default"
const char PROP_MAXFORCE [] = "max_force"
const char PROP_MINFORCE [] = "min_force"

Protected Member Functions

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

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

void setPseudoStateName (int aIndex, const char *aName)
 Set the name of a pseudostate.


Protected Attributes

rdModel_model
 Model which the actuator actuates.

int _nx
 Number of controls that control this actuator.

char ** _xNames
 Names of the controls.

int _ny
 Number of states that characterize this actuator.

char ** _yNames
 Names of the states.

int _nyp
 Number of pseudostates in this actuator.

char ** _ypNames
 Names of the pseudostates.

bool _appliesForce
 Flag indicating whether the actuator applies a force or a torque.

double _force
 Force (or torque) magnitude that is applied to the model.

double _speed
 Speed of actuator (linear or angular).

double _maxForce
 Maximum force (or torque) that this actuator can apply.

double _minForce
 Minimum force (or torque) that this actuator can apply.


Private Member Functions

void setNull ()
 Set the data members of this actuator to their null values.

void constructControls ()
 Construct controls.

void constructStates ()
 Construct states.

void constructPseudoStates ()
 Construct pseudostates.


Detailed Description

An abstract class for representing an actuator (e.g., a torque motor, muscle, ...).

Author:
Frank C. Anderson
Version:
1.0


Constructor & Destructor Documentation

rdActuator::rdActuator int  aNX,
int  aNY,
int  aNYP
 

Construct an actuator that has a specified number of controls, states, and pseudostates.

Parameters:
aNX Number of controls.
aNY Number of states.
aNYP Number of pseudostates.

rdActuator::rdActuator int  aNX,
int  aNY,
int  aNYP,
IDOM_Element *  aElement
 

Construct an actuator from an XML Element.

Parameters:
aNX Number of controls.
aNY Number of states.
aNYP Number of pseudo-states.
aElement XML element.

rdActuator::rdActuator const rdActuator &  aActuator  ) 
 

Copy constructor.

Parameters:
aActuator Actuator to copy.


Member Function Documentation

void rdActuator::computeStateDerivatives double  rDYDT[]  )  [virtual]
 

Compute the time derivatives of the states for this actuator.

This method should be overridden by derived classes that have actuator states. In rdActuator this method is empty and put here so that derived classes that don't have any actuator states won't have to implement this method.

Parameters:
rDYDT Time derivatives of the states.

Reimplemented in rdGeneralizedForceAtv, and rdMuscleZajac.

void rdActuator::generateNode IDOM_Element *  aParent  )  [virtual]
 

Generate an XML node representing this object.

Parameters:
aParent Intended parent of the node to be generated. If aParent is NULL, the intent is for this object to serve as the root element of a new document.
See also:
rdObject::generateNode()

Reimplemented from rdObject.

Reimplemented in rdGeneralizedForceAtv, rdLinearSetPoint, rdMuscleZajac, rdPolynomialSetPoint, rdSetPoint, rdContactForce, rdForce, rdGeneralizedForce, and suSpringGeneralizedForce.

bool rdActuator::getAppliesForce  )  const
 

Get whether the actuator applies a force or torque to the model.

Returns:
True if the actuator applies a force, false if the actuator applies a torque.

const char * rdActuator::getControlName int  aIndex  )  const
 

Get the name of a control.

Parameters:
aIndex Index of the control whose name is desired.

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

Get the current values of the controls.

Parameters:
aX Array of control values.

Reimplemented in rdGeneralizedForceAtv, rdMuscleZajac, rdForce, rdGeneralizedForce, and suSpringGeneralizedForce.

double rdActuator::getForce  )  const
 

Get the current force (or torque) of the actuator.

The force (or torque) is represented as a scalar; its vector properties derive from the geometry characterizing how it is applied to the model. The particulars of the geometry is dependent on the type of the actuator.

Returns:
Force (or torque) of the actuator.

double rdActuator::getMaxForce  )  const
 

Get the maximum force (or torque) that can by applied by the actuator.

Returns:
Maximum force or torque.

double rdActuator::getMinForce  )  const
 

Get the minimum force (or torque) that can by applied by the actuator.

Returns:
Minimum force or torque.

rdModel * rdActuator::getModel  )  const
 

Get a pointer to the model on which this analysis is being performed.

Returns:
Pointer to the model.

int rdActuator::getNX  )  const
 

Get the number of controls.

Returns:
Number of controls.

int rdActuator::getNY  )  const
 

Get the number of states.

Returns:
Number of states.

int rdActuator::getNYP  )  const
 

Get the number of pseudostates.

Returns:
Number of pseudostates.

double rdActuator::getPower  )  const
 

Get the instantaneous power developed by an actuator.

The instantaneous power is the product of the actuator force and the actuator speed. If the power is positive, the actuator is delivering energy to the model. If the power is negative, the actuator is absorbing energy from the model.

Returns:
Instantaneous power of the actuator.

const char * rdActuator::getPseudoStateName int  aIndex  )  const
 

Get the name of a pseudostate.

Parameters:
aIndex Index of the pseudostate whose name is desired.

void rdActuator::getPseudoStates double  rY[]  )  const [virtual]
 

Get the current values of the pseudostates.

Parameters:
rYP Array of pseudostate values.

Reimplemented in rdSetPoint.

double rdActuator::getSpeed  )  const
 

Get the current speed (linear or angular) of the actuator.

The speed is the dot product of the direction of force applied by the actuator to Body1 and the velocity of shortening of the actuator:

speed = DotProduct(u1,v), where u1 = unit vector describing the direction of force applied to Body1 expressed in the Body0 frame. v = velocity of Point1 in the frame of Body0 expressed in the Body0 frame.

Returns:
Speed (or angular velocity) of the actuator.

const char * rdActuator::getStateName int  aIndex  )  const
 

Get the name of a state.

Parameters:
aIndex Index of the state whose name is desired.

void rdActuator::getStates double  rY[]  )  const [virtual]
 

Get the current values of the states.

Parameters:
rYP Array of state values.

Reimplemented in rdGeneralizedForceAtv, and rdMuscleZajac.

rdActuator & rdActuator::operator= const rdActuator &  aActuator  ) 
 

Assignment operator.

Returns:
Reference to this object.

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

Promote a set of controls to state variables.

This method is normally useful when solving for controls that will optimize some aspect of a model performance. For example, in models in which the controls are neural excitations, but muscle forces are determined by activation level, this method might set the muscle activations equal to the excitations. Each actuator is responsible for knowing how to promote its own controls to states.

Reimplemented in rdGeneralizedForceAtv, and rdMuscleZajac.

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

Set the name of a control.

This method is protected and is to be used outside this class and its derived classes.

Parameters:
aIndex Index of the control whose name is to be set.
aName Name.

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

Set the current values of the controls.

Parameters:
aX Array of control values.

Reimplemented in rdGeneralizedForceAtv, rdMuscleZajac, rdForce, rdGeneralizedForce, and suSpringGeneralizedForce.

void rdActuator::setForce double  aForce  ) 
 

Set the current force (or torque) of the actuator.

The force (or torque) is represented as a scalar; its vector properties derive from the geometry characterizing how it is applied to the model. The particulars of the geometry is dependent on the type of the actuator.

Note that this method clamps the force between the maximum and minimum force allowed for the actuator.

Returns:
Force (or torque) of the actuator.
See also:
rdActuator::setMaxForce

rdActuator::setMinForce

void rdActuator::setMaxForce double  aMax  ) 
 

Set the maximum force (or torque) that can by applied by the actuator.

Parameters:
aMax Maximum force or torque.

void rdActuator::setMinForce double  aMin  ) 
 

Set the minimum force (or torque) that can by applied by the actuator.

Parameters:
aMin Minimum force or torque.

void rdActuator::setModel rdModel aModel  ) 
 

Set the model which this actuator actuates.

Parameters:
aModel Pointer to a model.

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

Set the name of a pseudostate.

This method is protected and is not intended to be used outside this class and its derived classes.

Parameters:
aIndex Index of the pseudostate whose name is to be set.
aName Name.

void rdActuator::setPseudoStates const double  aY[]  )  [virtual]
 

Set the current values of the pseudostates.

Parameters:
aYP Array of pseudostate values.

Reimplemented in rdSetPoint.

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

Set the name of a state.

This method is protected and is not intended to be used outside this class and its derived classes.

Parameters:
aIndex Index of the state whose name is to be set.
aName Name.

void rdActuator::setStates const double  aY[]  )  [virtual]
 

Set the current values of the states.

Parameters:
aY Array of state values.

Reimplemented in rdGeneralizedForceAtv, and rdMuscleZajac.

void rdActuator::updateData  ) 
 

Update the member data of this object based on its XML node.

Member objects (children) are not updated.

Reimplemented in rdGeneralizedForceAtv, rdLinearSetPoint, rdMuscleZajac, rdPolynomialSetPoint, rdSetPoint, rdContactForce, rdForce, rdGeneralizedForce, and suSpringGeneralizedForce.

void rdActuator::updateNode bool  aDeep = true  )  [virtual]
 

Update the XML node representing this object.

Parameters:
aDeep If true, update the XML node of this object AND the XML nodes of all class members that are rdObjects (child nodes); if false, update only the XML node of this object without updating the XML nodes of its children.

Reimplemented from rdObject.

Reimplemented in rdGeneralizedForceAtv, rdLinearSetPoint, rdMuscleZajac, rdPolynomialSetPoint, rdSetPoint, rdContactForce, rdForce, rdGeneralizedForce, and suSpringGeneralizedForce.

void rdActuator::updateObject bool  aDeep = true  )  [virtual]
 

Update this object based on its XML node.

Parameters:
aDeep If true, update this object and all its child objects (that is, member variables that are rdObject's); if false, update only the member variables that are not rdObject's.

Reimplemented from rdObject.

Reimplemented in rdGeneralizedForceAtv, rdLinearSetPoint, rdMuscleZajac, rdPolynomialSetPoint, rdSetPoint, rdContactForce, rdForce, rdGeneralizedForce, and suSpringGeneralizedForce.

void rdActuator::updatePseudoStates  )  [virtual]
 

Update actuator parameters so they are intervally consistent.

This method is distinguished from computeActuation() in that it is normally called only after an integration time step has been taken. Updating spring setpoints is an example.

Reimplemented in rdSetPoint, and rdContactForce.


Member Data Documentation

int rdActuator::_nyp [protected]
 

Number of pseudostates in this actuator.

Pseudostates are variables that are not integrated but that depend on the history of the integration. They cannot be determined from the states.


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