OpenSim::SpringGeneralizedForce Class Reference

#include <SpringGeneralizedForce.h>

Inheritance diagram for OpenSim::SpringGeneralizedForce:
OpenSim::CustomForce OpenSim::Force OpenSim::ModelComponent OpenSim::Object

List of all members.

Public Member Functions

 SpringGeneralizedForce (std::string aCoordinateName="")
 SpringGeneralizedForce (const SpringGeneralizedForce &aForce)
 Copy constructor.
 ~SpringGeneralizedForce ()
 Destructor.
virtual Objectcopy () const
 Copy this force and return a pointer to the copy.
SpringGeneralizedForceoperator= (const SpringGeneralizedForce &aForce)
 Assignment operator.
void setup (Model &aModel)
 setup sets the actual Coordinate reference _coord
void setCoordinate (Coordinate *aCoordinate)
CoordinategetCoordinate () const
void setStiffness (double aStiffness)
 Set the stiffness of the spring.
double getStiffness () const
 Get the stiffness of the force.
void setRestLength (double aRestLength)
 Set the rest length of the spring.
double getRestLength () const
 Get the rest length of the spring.
void setViscosity (double aViscosity)
 Set the viscosity of the spring.
double getViscosity () const
 Get the viscosity of the spring.

Protected Member Functions

virtual void computeForce (const SimTK::State &s) const
 Compute all quantities necessary for applying the spring force to the model.
 OPENSIM_DECLARE_DERIVED (SpringGeneralizedForce, CustomForce)

Protected Attributes

PropertyStr _propCoordinateName
 Name of coordinate to which the spring gen force is applied.
PropertyDbl _propStiffness
 Stiffness.
PropertyDbl _propRestLength
 Rest length.
PropertyDbl _propViscosity
 Viscosity.
std::string & _coordName
double & _stiffness
double & _restLength
double & _viscosity
Coordinate_coord
 Corresponding generalized coordinate to which the coordinate actuator is applied.

Constructor & Destructor Documentation

OpenSim::SpringGeneralizedForce::SpringGeneralizedForce ( std::string  aCoordinateName = ""  ) 
SpringGeneralizedForce::SpringGeneralizedForce ( const SpringGeneralizedForce aForce  ) 

Copy constructor.

Parameters:
aforce force to be copied.
SpringGeneralizedForce::~SpringGeneralizedForce (  ) 

Destructor.


Member Function Documentation

void SpringGeneralizedForce::computeForce ( const SimTK::State &  s  )  const [protected, virtual]

Compute all quantities necessary for applying the spring force to the model.

Implements OpenSim::CustomForce.

Object * SpringGeneralizedForce::copy (  )  const [virtual]

Copy this force and return a pointer to the copy.

The copy constructor for this class is used.

Returns:
Pointer to a copy of this force.

Reimplemented from OpenSim::Object.

Coordinate* OpenSim::SpringGeneralizedForce::getCoordinate (  )  const
double SpringGeneralizedForce::getRestLength (  )  const

Get the rest length of the spring.

Returns:
Rest length of the spring.
double SpringGeneralizedForce::getStiffness (  )  const

Get the stiffness of the force.

Returns:
Stiffness of the force.
double SpringGeneralizedForce::getViscosity (  )  const

Get the viscosity of the spring.

Returns:
Stiffness of the spring.
OpenSim::SpringGeneralizedForce::OPENSIM_DECLARE_DERIVED ( SpringGeneralizedForce  ,
CustomForce   
) [protected]
SpringGeneralizedForce & SpringGeneralizedForce::operator= ( const SpringGeneralizedForce aForce  ) 

Assignment operator.

Returns:
Reference to the altered object.

Reimplemented from OpenSim::Object.

void OpenSim::SpringGeneralizedForce::setCoordinate ( Coordinate aCoordinate  ) 
void SpringGeneralizedForce::setRestLength ( double  aRestLength  ) 

Set the rest length of the spring.

Parameters:
aRestLength Rest length of the spring.
void SpringGeneralizedForce::setStiffness ( double  aStiffness  ) 

Set the stiffness of the spring.

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 spring force.
void SpringGeneralizedForce::setup ( Model aModel  )  [virtual]

setup sets the actual Coordinate reference _coord

Reimplemented from OpenSim::Force.

void SpringGeneralizedForce::setViscosity ( double  aViscosity  ) 

Set the viscosity of the spring.

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 spring.

Member Data Documentation

Corresponding generalized coordinate to which the coordinate actuator is applied.

Name of coordinate to which the spring gen force is applied.

Rest length.

Stiffness.

Viscosity.


The documentation for this class was generated from the following files:

Generated on Wed Dec 16 15:03:38 2009 for OpenSim by  doxygen 1.6.1