This class provides an interface specification for optimizing redundant systems. More...
#include <OptimizationTarget.h>
Public Member Functions | |
OptimizationTarget (int aNX=0) | |
Construct an optimization target. | |
void | setNumParameters (const int aNX) |
______________________________________________________________________________ | |
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 | validatePerturbationSize (double &aSize) |
Ensure that a derivative perturbation is a valid size. | |
virtual bool | prepareToOptimize (const SimTK::State &s, double *x) |
virtual void | printPerformance (double *x) |
Static Public Member Functions | |
static int | CentralDifferencesConstraint (const OptimizationTarget *aTarget, double *dx, const SimTK::Vector &x, SimTK::Matrix &jacobian) |
static int | CentralDifferences (const OptimizationTarget *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 | |
Array< double > | _dx |
Perturbation size for computing numerical derivatives. |
This class provides an interface specification for optimizing redundant systems.
If a class represents a redundant system for which one would like to find a set of optimal controls, the class should inherit from this class and implement the virtual functions defined here.
OptimizationTarget::OptimizationTarget | ( | int | aNX = 0 |
) |
Construct an optimization target.
aNX | The number of controls. |
static int OpenSim::OptimizationTarget::CentralDifferences | ( | const OptimizationTarget * | aTarget, | |
double * | dx, | |||
const SimTK::Vector & | x, | |||
SimTK::Vector & | dpdx | |||
) | [static] |
static int OpenSim::OptimizationTarget::CentralDifferencesConstraint | ( | const OptimizationTarget * | aTarget, | |
double * | dx, | |||
const SimTK::Vector & | x, | |||
SimTK::Matrix & | jacobian | |||
) | [static] |
double OptimizationTarget::getDX | ( | int | aIndex | ) |
Get the derivative perturbation size.
double * OptimizationTarget::getDXArray | ( | ) |
Get a pointer to the vector of derivative perturbation sizes.
virtual bool OpenSim::OptimizationTarget::prepareToOptimize | ( | const SimTK::State & | s, | |
double * | x | |||
) | [inline, virtual] |
Reimplemented in OpenSim::ActuatorForceTarget, and OpenSim::ActuatorForceTargetFast.
void OptimizationTarget::printPerformance | ( | double * | x | ) | [virtual] |
Reimplemented in OpenSim::IKTarget.
void OptimizationTarget::setDX | ( | int | aIndex, | |
double | aVal | |||
) |
Set the derivative perturbation size.
void OptimizationTarget::setDX | ( | double | aVal | ) |
Set the derivative perturbation size for all controls.
void OptimizationTarget::setNumParameters | ( | const int | aNX | ) |
______________________________________________________________________________
Set the number of controls.
The number of controls can be set at any time. However, the perturbation sizes for the controls (i.e., _dx) is destroyed. Therefore, the perturbation sizes must be reset.
aNX | Number of controls. |
void OptimizationTarget::validatePerturbationSize | ( | double & | aSize | ) |
Ensure that a derivative perturbation is a valid size.
Array<double> OpenSim::OptimizationTarget::_dx [protected] |
Perturbation size for computing numerical derivatives.
const double OptimizationTarget::SMALLDX = 1.0e-14 [static] |
Smallest allowable perturbation size for computing derivatives.