OpenSim::JointLoadOptimization Class Reference

This class implements static optimization to compute Muscle Forces and activations. More...

#include <JointLoadOptimization.h>

Inheritance diagram for OpenSim::JointLoadOptimization:
OpenSim::Analysis OpenSim::Object

List of all members.

Public Member Functions

 JointLoadOptimization (Model *aModel=0)
 JointLoadOptimization (const JointLoadOptimization &aObject)
 Copy constructor.
virtual Objectcopy () const
 Clone.
virtual ~JointLoadOptimization ()
 Destructor.
JointLoadOptimizationoperator= (const JointLoadOptimization &aJointLoadOptimization)
 Assign this object to the values of another.
void setStorageCapacityIncrements (int aIncrement)
 Set the capacity increments of all storage instances.
StoragegetActivationStorage ()
 Get the activation storage.
StoragegetForceStorage ()
 Get the force storage.
StoragegetJointForceStorage ()
 Get the joint force storage.
bool getUseModelForceSet ()
void setUseModelForceSet (bool aUseModelActuatorSet)
virtual void setModel (Model &aModel)
 Set the model for which the static optimization is to be computed.
void setActivationExponent (const double aExponent)
double getActivationExponent () const
void setUseMusclePhysiology (const bool useIt)
bool getUseMusclePhysiology () const
void setConvergenceCriterion (const double aConvergence)
double getConvergenceCriterion ()
void setPrintLevel (const int aLevel)
int getPrintLevel ()
void setMaxIterations (const int aIterations)
int getMaxIterations ()
void setOptimizerDX (const double aDX)
double getOptimizerDX ()
void constructJointForceColumnLabels ()
 Construct column labels for the file containing joint forces.
Array< int > findJointsToOptimize ()
 Find the joint set indicies for all joints we plan to optimize.
int findBodyIndexForJoint (std::string &jointName)
 Find the SimTK body index associated with each joint load.
virtual int begin (SimTK::State &s)
 This method is called at the beginning of an analysis so that any necessary initializations may be performed.
virtual int step (const SimTK::State &s, int setNumber)
 This method is called to perform the analysis.
virtual int end (SimTK::State &s)
 This method is called at the end of an analysis so that any necessary finalizations may be performed.
virtual int printResults (const std::string &aBaseName, const std::string &aDir="", double aDT=-1.0, const std::string &aExtension=".sto")
 Print the results of the analysis.

Protected Member Functions

virtual int record (const SimTK::State &s)
 Record the results.

Protected Attributes

PropertyBool _useModelForceSetProp
 Use force set from model.
bool & _useModelForceSet
PropertyDbl _activationExponentProp
double & _activationExponent
PropertyBool _useMusclePhysiologyProp
bool & _useMusclePhysiology
PropertyDbl _convergenceCriterionProp
double & _convergenceCriterion
PropertyInt _printLevelProp
int & _printLevel
PropertyInt _maxIterationsProp
int & _maxIterations
PropertyDbl _optimizerDXProp
double & _optimizerDX
PropertyObj _jointTaskSetProp
Set< JointReactionReference > & _jointTaskSet
PropertyStr _optimizerAlgorithmProp
std::string & _optimizerAlgorithm
PropertyDbl _objectiveScaleFactorProp
double & _objectiveScaleFactor
PropertyDbl _jointTermScaleProp
double & _jointTermScale
Storage_activationStorage
Storage_forceStorage
Storage_jointForceStorage
GCVSplineSet _statesSplineSet
Array< int > _accelerationIndices
Array< int > _optimizedJointsIndices
SimTK::Vector _parameters
bool _ownsForceSet
ForceSet_forceSet
Model_modelWorkingCopy

Detailed Description

This class implements static optimization to compute Muscle Forces and activations.

It includes extra terms in the cost function for minimizing or maximizing joint forces and moments.

Author:
Matt DeMers

Constructor & Destructor Documentation

JointLoadOptimization::JointLoadOptimization ( Model aModel = 0  ) 
JointLoadOptimization::JointLoadOptimization ( const JointLoadOptimization aObject  ) 

Copy constructor.

JointLoadOptimization::~JointLoadOptimization (  )  [virtual]

Destructor.


Member Function Documentation

int JointLoadOptimization::begin ( SimTK::State &  s  )  [virtual]

This method is called at the beginning of an analysis so that any necessary initializations may be performed.

This method is meant to be called at the begining of an integration

Parameters:
s Current state .
Returns:
-1 on error, 0 otherwise.

Reimplemented from OpenSim::Analysis.

void JointLoadOptimization::constructJointForceColumnLabels (  ) 

Construct column labels for the file containing joint forces.

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

Clone.

Reimplemented from OpenSim::Analysis.

int JointLoadOptimization::end ( SimTK::State &  s  )  [virtual]

This method is called at the end of an analysis so that any necessary finalizations may be performed.

Parameters:
s Current state
Returns:
-1 on error, 0 otherwise.

Reimplemented from OpenSim::Analysis.

int JointLoadOptimization::findBodyIndexForJoint ( std::string &  jointName  ) 

Find the SimTK body index associated with each joint load.

In simtk land, joints and joint loads are associated with the child body that the joint connects to the existing tree structure. We'll use this when collecting joint loads from computeReactions or calcMobilizerReactionForces. These functions conform to SimTK bodyset indexing, not OpenSim's JointSet indexing.

Array< int > JointLoadOptimization::findJointsToOptimize (  ) 

Find the joint set indicies for all joints we plan to optimize.

double OpenSim::JointLoadOptimization::getActivationExponent (  )  const [inline]
Storage * JointLoadOptimization::getActivationStorage (  ) 

Get the activation storage.

Returns:
Activation storage.
double OpenSim::JointLoadOptimization::getConvergenceCriterion (  )  [inline]
Storage * JointLoadOptimization::getForceStorage (  ) 

Get the force storage.

Returns:
Force storage.
Storage * JointLoadOptimization::getJointForceStorage (  ) 

Get the joint force storage.

Returns:
joint Force storage.
int OpenSim::JointLoadOptimization::getMaxIterations (  )  [inline]
double OpenSim::JointLoadOptimization::getOptimizerDX (  )  [inline]
int OpenSim::JointLoadOptimization::getPrintLevel (  )  [inline]
bool OpenSim::JointLoadOptimization::getUseModelForceSet (  )  [inline]
bool OpenSim::JointLoadOptimization::getUseMusclePhysiology (  )  const [inline]
JointLoadOptimization & JointLoadOptimization::operator= ( const JointLoadOptimization aJointLoadOptimization  ) 

Assign this object to the values of another.

Returns:
Reference to this object.

Reimplemented from OpenSim::Analysis.

virtual int OpenSim::JointLoadOptimization::printResults ( const std::string &  aBaseName,
const std::string &  aDir = "",
double  aDT = -1.0,
const std::string &  aExtension = ".sto" 
) [virtual]

Print the results of the analysis.

Parameters:
aFileName File to which to print the data.
aDT Time interval between results (linear interpolation is used). If not included as an argument or negative, all time steps are printed without interpolation.
Returns:
-1 on error, 0 otherwise.

Reimplemented from OpenSim::Analysis.

int JointLoadOptimization::record ( const SimTK::State &  s  )  [protected, virtual]

Record the results.

void OpenSim::JointLoadOptimization::setActivationExponent ( const double  aExponent  )  [inline]
void OpenSim::JointLoadOptimization::setConvergenceCriterion ( const double  aConvergence  )  [inline]
void OpenSim::JointLoadOptimization::setMaxIterations ( const int  aIterations  )  [inline]
void JointLoadOptimization::setModel ( Model aModel  )  [virtual]

Set the model for which the static optimization is to be computed.

Parameters:
aModel Model pointer

Reimplemented from OpenSim::Analysis.

void OpenSim::JointLoadOptimization::setOptimizerDX ( const double  aDX  )  [inline]
void OpenSim::JointLoadOptimization::setPrintLevel ( const int  aLevel  )  [inline]
void JointLoadOptimization::setStorageCapacityIncrements ( int  aIncrement  ) 

Set the capacity increments of all storage instances.

Parameters:
aIncrement Increment by which storage capacities will be increased when storage capacities run out.
void OpenSim::JointLoadOptimization::setUseModelForceSet ( bool  aUseModelActuatorSet  )  [inline]
void OpenSim::JointLoadOptimization::setUseMusclePhysiology ( const bool  useIt  )  [inline]
int JointLoadOptimization::step ( const SimTK::State &  s,
int  stepNumber 
) [virtual]

This method is called to perform the analysis.

It can be called during the execution of a forward integrations or after the integration by feeding it the necessary data.

This method should be overriden in derived classes. It is included here so that the derived class will not have to implement it if it is not necessary.

Parameters:
s Current state .
Returns:
-1 on error, 0 otherwise.

Reimplemented from OpenSim::Analysis.


Member Data Documentation

Use force set from model.


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

Generated on Sun Sep 25 00:19:46 2011 for OpenSim by  doxygen 1.6.1