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

suSpringGeneralizedForce Class Reference

An actuator that exerts a generalized force based on spring-like characteristics (stiffness and viscosity). More...

#include <suSpringGeneralizedForce.h>

Inheritance diagram for suSpringGeneralizedForce:

rdGeneralizedForce rdActuator rdObject List of all members.

Public Member Functions

 suSpringGeneralizedForce (int aQID=-1, int aNX=1, int aNY=0, int aNYP=0)
 Default constructor.

 suSpringGeneralizedForce (IDOM_Element *aElement, int aNX=1, int aNY=0, int aNYP=0)
 Construct the actuator from an XML Element.

 suSpringGeneralizedForce (const suSpringGeneralizedForce &aActuator)
 Copy constructor.

virtual ~suSpringGeneralizedForce ()
 Destructor.

virtual rdActuatorcopy () const
 Copy this actuator and return a pointer to the copy.

virtual rdActuatorcopy (IDOM_Element *aElement) const
 Copy this actuator and modify the copy so that it is consistent with a specified XML element node.

suSpringGeneralizedForce & operator= (const suSpringGeneralizedForce &aActuator)
 Assignment operator.

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

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

void setRestLength (double aRestLength)
 Set the rest length of the actuator.

double getRestLength () const
 Get the rest length of the actuator.

void setViscosity (double aViscosity)
 Set the viscosity of the actuator.

double getViscosity () const
 Get the viscosity of the actuator.

void setStiffness (double aStiffness)
 Set the stiffness of the actuator.

double getStiffness () const
 Get the stiffness of the actuator.

virtual void computeActuation ()
 Compute all quantities necessary for applying the actuator force to the model.

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.


Protected Attributes

double _restLength
 Rest length.

double _viscosity
 Viscosity.

double _stiffness
 Stiffness (control 0).


Private Member Functions

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


Static Private Attributes

const char PROP_REST_LENGTH [] = "rest_length"
const char PROP_VISCOSITY [] = "viscosity"

Detailed Description

An actuator that exerts a generalized force based on spring-like characteristics (stiffness and viscosity).

It has one control: stiffness.

Author:
Frank C. Anderson
Version:
1.0


Constructor & Destructor Documentation

suSpringGeneralizedForce::suSpringGeneralizedForce IDOM_Element *  aElement,
int  aNX = 1,
int  aNY = 0,
int  aNYP = 0
 

Construct the actuator from an XML Element.

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

suSpringGeneralizedForce::suSpringGeneralizedForce const suSpringGeneralizedForce &  aActuator  ) 
 

Copy constructor.

Parameters:
aActuator Actuator to be copied.


Member Function Documentation

rdActuator * suSpringGeneralizedForce::copy IDOM_Element *  aElement  )  const [virtual]
 

Copy this actuator and modify the copy so that it is consistent with a specified XML element node.

The copy is constructed by first using rdG::rdForce(IDOM_Element*,int,int) in order to establish the relationship of the rdForce object with the XML node. Then, the assignment operator is used to set all data members of the copy to the values of this rdForce object. Finally, the data members of the copy are updated using rdForce::updateObject().

Parameters:
aElement XML element.
Returns:
Pointer to a copy of this actuator.

Reimplemented from rdGeneralizedForce.

rdActuator * suSpringGeneralizedForce::copy  )  const [virtual]
 

Copy this actuator and return a pointer to the copy.

The copy constructor for this class is used.

Returns:
Pointer to a copy of this actuator.

Reimplemented from rdGeneralizedForce.

void suSpringGeneralizedForce::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 rdGeneralizedForce.

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

Get the controls.

This actuator has 1 control: its stiffness.

Parameters:
rX Control array- should have a length of at least 1.

Reimplemented from rdGeneralizedForce.

double suSpringGeneralizedForce::getRestLength  )  const
 

Get the rest length of the actuator.

Returns:
Rest length of the actuator.

double suSpringGeneralizedForce::getStiffness  )  const
 

Get the stiffness of the actuator.

Returns:
Stiffness of the actuator.

double suSpringGeneralizedForce::getViscosity  )  const
 

Get the viscosity of the actuator.

Returns:
Stiffness of the actuator.

suSpringGeneralizedForce & suSpringGeneralizedForce::operator= const suSpringGeneralizedForce &  aActuator  ) 
 

Assignment operator.

Returns:
Reference to the altered object.

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

Set the controls.

This actuator has 1 control: its stiffness.

Parameters:
aX Control array- should have a length of at least 1.

Reimplemented from rdGeneralizedForce.

void suSpringGeneralizedForce::setRestLength double  aRestLength  ) 
 

Set the rest length of the actuator.

Parameters:
aRestLength Rest length of the actuator.

void suSpringGeneralizedForce::setStiffness double  aStiffness  ) 
 

Set the stiffness of the actuator.

Normally the stiffness is a positive quantity. Negative stiffnessess will result in an unstable system- the force will push away from the rest length instead of pulling toward it.

Parameters:
aStiffness Stiffness of the actuator.

void suSpringGeneralizedForce::setViscosity double  aViscosity  ) 
 

Set the viscosity of the actuator.

Normally the viscosity should be a positive number. Negative viscosities will put energy into the system rather than apply a damping force.

Parameters:
aViscosity Viscosity of the actuator.

void suSpringGeneralizedForce::updateData  ) 
 

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

Member objects (children) are not updated.

Reimplemented from rdGeneralizedForce.

void suSpringGeneralizedForce::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 rdGeneralizedForce.

void suSpringGeneralizedForce::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 rdGeneralizedForce.


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