OpenSim::JointLoadOptimizationTarget Class Reference

This class provides an interface specification for static optimization Objective Function. More...

#include <JointLoadOptimizationTarget.h>

List of all members.

Public Member Functions

 JointLoadOptimizationTarget (const SimTK::State &s, Model *aModel, int aNX, int aNC, Set< JointReactionReference > &aRefSet, const bool useMusclePhysiology=true)
 Construct an optimization target.
void setModel (Model &aModel)
 ______________________________________________________________________________
void setStatesStore (const Storage *aStatesStore)
 ______________________________________________________________________________
void setStatesSplineSet (GCVSplineSet aStatesSplineSet)
 ______________________________________________________________________________
void setNumParams (const int aNP)
 ______________________________________________________________________________
void setNumConstraints (const int aNC)
 ______________________________________________________________________________
void setDX (double aVal)
 Set the derivative perturbation size for all controls.
void setDX (int aIndex, double aVal)
 Set the derivative perturbation size.
double getDX (int aIndex)
 Get the derivative perturbation size.
double * getDXArray ()
 Get a pointer to the vector of derivative perturbation sizes.
void getActuation (SimTK::State &s, const SimTK::Vector &parameters, SimTK::Vector &forces)
 Get an optimal force.
void setActivationExponent (double aActivationExponent)
double getActivationExponent () const
void setCurrentState (SimTK::State *state)
const SimTK::State * getCurrentState () const
void setJointReferences (Set< JointReactionReference > &aSet)
void getJointLoadsToPrint (SimTK::State &s, const SimTK::Vector &parameters, SimTK::Vector &jointLoads)
void setObjectiveScaleFactor (double aFactor)
void setJointTermScaleFactor (double aFactor)
void validatePerturbationSize (double &aSize)
 Ensure that a derivative perturbation is a valid size.
virtual void printPerformance (SimTK::State &s, double *x)
void computeActuatorAreas (const SimTK::State &s)
bool prepareToOptimize (SimTK::State &s, double *x)
int objectiveFunc (const SimTK::Vector &x, const bool new_coefficients, SimTK::Real &rP) const
int gradientFunc (const SimTK::Vector &x, const bool new_coefficients, SimTK::Vector &gradient) const
int constraintFunc (const SimTK::Vector &x, const bool new_coefficients, SimTK::Vector &constraints) const
 Compute acceleration constraints given parameters.
int constraintJacobian (const SimTK::Vector &x, const bool new_coefficients, SimTK::Matrix &jac) const
 Compute the gradient of constraint given parameters.

Static Public Member Functions

static int CentralDifferencesConstraint (const JointLoadOptimizationTarget *aTarget, double *dx, const SimTK::Vector &x, SimTK::Matrix &jacobian)
static int CentralDifferences (const JointLoadOptimizationTarget *aTarget, double *dx, const SimTK::Vector &x, SimTK::Vector &dpdx)

Static Public Attributes

static const double SMALLDX = 1.0e-14
 Smallest allowable perturbation size for computing derivatives.

Protected Attributes

double _activationExponent
bool _useMusclePhysiology
Array< double > _dx
 Perturbation size for computing numerical derivatives.
Array< int > _accelerationIndices
Set< JointReactionReference > & _jointReferenceSet
double _objectiveScaleFactor
double _jointTermScaleFactor
SimTK::Vector_< SimTK::Vec3 > _loadDescriptionIndices

Detailed Description

This class provides an interface specification for static optimization Objective Function.

This objective function includes terms for minimizing or maximizing joint joint force.

Author:
Jeff Reinbolt

Constructor & Destructor Documentation

JointLoadOptimizationTarget::JointLoadOptimizationTarget ( const SimTK::State &  s,
Model aModel,
int  aNP,
int  aNC,
Set< JointReactionReference > &  aRefSet,
const bool  useMusclePhysiology = true 
)

Construct an optimization target.

Parameters:
aNP The number of parameters.
aNC The number of constraints.
aT Current time in the integration.
aX Current control values.
aY Current states.
aDYDT Current state derivatives.

Member Function Documentation

static int OpenSim::JointLoadOptimizationTarget::CentralDifferences ( const JointLoadOptimizationTarget aTarget,
double *  dx,
const SimTK::Vector &  x,
SimTK::Vector &  dpdx 
) [static]
static int OpenSim::JointLoadOptimizationTarget::CentralDifferencesConstraint ( const JointLoadOptimizationTarget aTarget,
double *  dx,
const SimTK::Vector &  x,
SimTK::Matrix &  jacobian 
) [static]
void JointLoadOptimizationTarget::computeActuatorAreas ( const SimTK::State &  s  ) 
int JointLoadOptimizationTarget::constraintFunc ( const SimTK::Vector &  parameters,
const bool  new_parameters,
SimTK::Vector &  constraints 
) const

Compute acceleration constraints given parameters.

Parameters:
parameters Vector of optimization parameters.
constraints Vector of optimization constraints.
Returns:
Status (normal termination = 0, error < 0).
int JointLoadOptimizationTarget::constraintJacobian ( const SimTK::Vector &  parameters,
const bool  new_parameters,
SimTK::Matrix &  jac 
) const

Compute the gradient of constraint given parameters.

Parameters:
parameters Vector of parameters.
jac Derivative of constraint with respect to the parameters.
Returns:
Status (normal termination = 0, error < 0).
double OpenSim::JointLoadOptimizationTarget::getActivationExponent (  )  const [inline]
void JointLoadOptimizationTarget::getActuation ( SimTK::State &  s,
const SimTK::Vector &  parameters,
SimTK::Vector &  forces 
)

Get an optimal force.

const SimTK::State* OpenSim::JointLoadOptimizationTarget::getCurrentState (  )  const [inline]
double JointLoadOptimizationTarget::getDX ( int  aIndex  ) 

Get the derivative perturbation size.

double * JointLoadOptimizationTarget::getDXArray (  ) 

Get a pointer to the vector of derivative perturbation sizes.

void JointLoadOptimizationTarget::getJointLoadsToPrint ( SimTK::State &  s,
const SimTK::Vector &  parameters,
SimTK::Vector &  jointLoads 
)
int OpenSim::JointLoadOptimizationTarget::gradientFunc ( const SimTK::Vector &  x,
const bool  new_coefficients,
SimTK::Vector &  gradient 
) const
int OpenSim::JointLoadOptimizationTarget::objectiveFunc ( const SimTK::Vector &  x,
const bool  new_coefficients,
SimTK::Real &  rP 
) const
bool JointLoadOptimizationTarget::prepareToOptimize ( SimTK::State &  s,
double *  x 
)
void JointLoadOptimizationTarget::printPerformance ( SimTK::State &  s,
double *  x 
) [virtual]
void OpenSim::JointLoadOptimizationTarget::setActivationExponent ( double  aActivationExponent  )  [inline]
void OpenSim::JointLoadOptimizationTarget::setCurrentState ( SimTK::State *  state  )  [inline]
void JointLoadOptimizationTarget::setDX ( int  aIndex,
double  aVal 
)

Set the derivative perturbation size.

void JointLoadOptimizationTarget::setDX ( double  aVal  ) 

Set the derivative perturbation size for all controls.

void OpenSim::JointLoadOptimizationTarget::setJointReferences ( Set< JointReactionReference > &  aSet  )  [inline]
void OpenSim::JointLoadOptimizationTarget::setJointTermScaleFactor ( double  aFactor  )  [inline]
void JointLoadOptimizationTarget::setModel ( Model aModel  ) 

______________________________________________________________________________

Set the model.

Parameters:
aModel Model.
void JointLoadOptimizationTarget::setNumConstraints ( const int  aNC  ) 

______________________________________________________________________________

Set the number of constraints.

Parameters:
aNC Number of constraints.
void JointLoadOptimizationTarget::setNumParams ( const int  aNP  ) 

______________________________________________________________________________

Set the number of paramters.

The number of parameters can be set at any time. However, the perturbation sizes for the parameters (i.e., _dx) is destroyed. Therefore, the perturbation sizes must be reset.

Parameters:
aNP Number of parameters.
See also:
setDX()
void OpenSim::JointLoadOptimizationTarget::setObjectiveScaleFactor ( double  aFactor  )  [inline]
void JointLoadOptimizationTarget::setStatesSplineSet ( GCVSplineSet  aStatesSplineSet  ) 

______________________________________________________________________________

Set the states spline set.

Parameters:
aStatesSplineSet States spline set.
void JointLoadOptimizationTarget::setStatesStore ( const Storage aStatesStore  ) 

______________________________________________________________________________

Set the states storage.

Parameters:
aStatesStore States storage.
void JointLoadOptimizationTarget::validatePerturbationSize ( double &  aSize  ) 

Ensure that a derivative perturbation is a valid size.


Member Data Documentation

Perturbation size for computing numerical derivatives.

SimTK::Vector_<SimTK::Vec3> OpenSim::JointLoadOptimizationTarget::_loadDescriptionIndices [protected]
const double JointLoadOptimizationTarget::SMALLDX = 1.0e-14 [static]

Smallest allowable perturbation size for computing derivatives.


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