This class provides an interface specification for static optimization Objective Function. More...
#include <JointLoadOptimizationTarget.h>
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 ¶meters, 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 ¶meters, 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 |
This class provides an interface specification for static optimization Objective Function.
This objective function includes terms for minimizing or maximizing joint joint force.
JointLoadOptimizationTarget::JointLoadOptimizationTarget | ( | const SimTK::State & | s, | |
Model * | aModel, | |||
int | aNP, | |||
int | aNC, | |||
Set< JointReactionReference > & | aRefSet, | |||
const bool | useMusclePhysiology = true | |||
) |
Construct an optimization target.
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. |
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 | Vector of optimization parameters. | |
constraints | Vector of optimization constraints. |
int JointLoadOptimizationTarget::constraintJacobian | ( | const SimTK::Vector & | parameters, | |
const bool | new_parameters, | |||
SimTK::Matrix & | jac | |||
) | const |
Compute the gradient of constraint given parameters.
parameters | Vector of parameters. | |
jac | Derivative of constraint with respect to the parameters. |
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 | ) |
void JointLoadOptimizationTarget::setNumConstraints | ( | const int | aNC | ) |
______________________________________________________________________________
Set the number of constraints.
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.
aNP | Number of parameters. |
void OpenSim::JointLoadOptimizationTarget::setObjectiveScaleFactor | ( | double | aFactor | ) | [inline] |
void JointLoadOptimizationTarget::setStatesSplineSet | ( | GCVSplineSet | aStatesSplineSet | ) |
______________________________________________________________________________
Set the states spline set.
aStatesSplineSet | States spline set. |
void JointLoadOptimizationTarget::setStatesStore | ( | const Storage * | aStatesStore | ) |
______________________________________________________________________________
Set the states storage.
aStatesStore | States storage. |
void JointLoadOptimizationTarget::validatePerturbationSize | ( | double & | aSize | ) |
Ensure that a derivative perturbation is a valid size.
Array<int> OpenSim::JointLoadOptimizationTarget::_accelerationIndices [protected] |
double OpenSim::JointLoadOptimizationTarget::_activationExponent [protected] |
Array<double> OpenSim::JointLoadOptimizationTarget::_dx [protected] |
Perturbation size for computing numerical derivatives.
double OpenSim::JointLoadOptimizationTarget::_jointTermScaleFactor [protected] |
SimTK::Vector_<SimTK::Vec3> OpenSim::JointLoadOptimizationTarget::_loadDescriptionIndices [protected] |
double OpenSim::JointLoadOptimizationTarget::_objectiveScaleFactor [protected] |
bool OpenSim::JointLoadOptimizationTarget::_useMusclePhysiology [protected] |
const double JointLoadOptimizationTarget::SMALLDX = 1.0e-14 [static] |
Smallest allowable perturbation size for computing derivatives.