OpenSim::StaticOptimizationTarget Class Reference

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

#include <StaticOptimizationTarget.h>

List of all members.

Public Member Functions

 StaticOptimizationTarget (const SimTK::State &s, Model *aModel, int aNX, int aNC, 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 (const SimTK::State *state)
const SimTK::State * getCurrentState () const
void validatePerturbationSize (double &aSize)
 Ensure that a derivative perturbation is a valid size.
virtual void printPerformance (const 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 StaticOptimizationTarget *aTarget, double *dx, const SimTK::Vector &x, SimTK::Matrix &jacobian)
static int CentralDifferences (const StaticOptimizationTarget *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

Detailed Description

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

Author:
Jeff Reinbolt

Constructor & Destructor Documentation

StaticOptimizationTarget::StaticOptimizationTarget ( const SimTK::State &  s,
Model aModel,
int  aNP,
int  aNC,
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::StaticOptimizationTarget::CentralDifferences ( const StaticOptimizationTarget aTarget,
double *  dx,
const SimTK::Vector &  x,
SimTK::Vector &  dpdx 
) [static]
static int OpenSim::StaticOptimizationTarget::CentralDifferencesConstraint ( const StaticOptimizationTarget aTarget,
double *  dx,
const SimTK::Vector &  x,
SimTK::Matrix &  jacobian 
) [static]
void StaticOptimizationTarget::computeActuatorAreas ( const SimTK::State &  s  ) 
int StaticOptimizationTarget::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 StaticOptimizationTarget::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::StaticOptimizationTarget::getActivationExponent (  )  const [inline]
void StaticOptimizationTarget::getActuation ( SimTK::State &  s,
const SimTK::Vector &  parameters,
SimTK::Vector &  forces 
)

Get an optimal force.

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

Get the derivative perturbation size.

double * StaticOptimizationTarget::getDXArray (  ) 

Get a pointer to the vector of derivative perturbation sizes.

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

Set the derivative perturbation size.

void StaticOptimizationTarget::setDX ( double  aVal  ) 

Set the derivative perturbation size for all controls.

void StaticOptimizationTarget::setModel ( Model aModel  ) 

______________________________________________________________________________

Set the model.

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

______________________________________________________________________________

Set the number of constraints.

Parameters:
aNC Number of constraints.
void StaticOptimizationTarget::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 StaticOptimizationTarget::setStatesSplineSet ( GCVSplineSet  aStatesSplineSet  ) 

______________________________________________________________________________

Set the states spline set.

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

______________________________________________________________________________

Set the states storage.

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

Ensure that a derivative perturbation is a valid size.


Member Data Documentation

Perturbation size for computing numerical derivatives.

const double StaticOptimizationTarget::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:47 2011 for OpenSim by  doxygen 1.6.1