API  4.0
For C++ developers
OpenSim::ActuatorForceTarget Class Reference

A Computed Muscle Control (CMC) optimization target for controlling dynamic systems whose actuators may be themselves governed by differential equations, meaning there may be non-linear behavior and delays in force production. More...

+ Inheritance diagram for OpenSim::ActuatorForceTarget:

Public Member Functions

virtual ~ActuatorForceTarget ()
 
 ActuatorForceTarget (int aNX, CMC *aController)
 
void setStressTermWeight (double aWeight)
 
bool prepareToOptimize (SimTK::State &s, double *x) override
 
int objectiveFunc (const SimTK::Vector &aF, bool new_coefficients, SimTK::Real &rP) const override
 
int gradientFunc (const SimTK::Vector &x, bool new_coefficients, SimTK::Vector &gradient) const override
 
- Public Member Functions inherited from OpenSim::OptimizationTarget
 OptimizationTarget (int aNX=0)
 
void setNumParameters (const int aNX)
 
void setDX (double aVal)
 
void setDX (int aIndex, double aVal)
 
double getDX (int aIndex)
 
double * getDXArray ()
 
void validatePerturbationSize (double &aSize)
 
virtual void printPerformance (double *x)
 
- Public Member Functions inherited from SimTK::OptimizerSystem
 OptimizerSystem ()
 
 OptimizerSystem (int nParameters)
 
virtual ~OptimizerSystem ()
 
virtual int constraintFunc (const Vector &parameters, bool new_parameters, Vector &constraints) const
 
virtual int constraintJacobian (const Vector &parameters, bool new_parameters, Matrix &jac) const
 
virtual int hessian (const Vector &parameters, bool new_parameters, Vector &gradient) const
 
void setNumParameters (const int nParameters)
 
void setNumEqualityConstraints (const int n)
 
void setNumInequalityConstraints (const int n)
 
void setNumLinearEqualityConstraints (const int n)
 
void setNumLinearInequalityConstraints (const int n)
 
void setParameterLimits (const Vector &lower, const Vector &upper)
 
int getNumParameters () const
 
int getNumConstraints () const
 
int getNumEqualityConstraints () const
 
int getNumInequalityConstraints () const
 
int getNumLinearEqualityConstraints () const
 
int getNumNonlinearEqualityConstraints () const
 
int getNumLinearInequalityConstraints () const
 
int getNumNonlinearInequalityConstraints () const
 
bool getHasLimits () const
 
void getParameterLimits (Real **lower, Real **upper) const
 

Additional Inherited Members

- Static Public Member Functions inherited from OpenSim::OptimizationTarget
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 int ForwardDifferences (const OptimizationTarget *aTarget, double *dx, const SimTK::Vector &x, SimTK::Vector &dpdx)
 
- Static Public Attributes inherited from OpenSim::OptimizationTarget
static const double SMALLDX
 Smallest allowable perturbation size for computing derivatives. More...
 
- Protected Attributes inherited from OpenSim::OptimizationTarget
Array< double > _dx
 Perturbation size for computing numerical derivatives. More...
 

Detailed Description

A Computed Muscle Control (CMC) optimization target for controlling dynamic systems whose actuators may be themselves governed by differential equations, meaning there may be non-linear behavior and delays in force production.

The performance criterion is a sum of two terms. The first term is the sum of actuator stresses squared. The second term is a weighted sum of terms designed to achieve a set of desired accelerations that will drive the dynamic model toward a set of target kinematic trajectories. The desired accelerations are according to the Proportional Derivative (PD) control law.

Because the performance criterion is simply a long sum of things, achieving the desired accelerations can be compromised in order to reduce the forces (or moments) applied by the actuators. This feature is what is exploited by the Residual Reduction Algorithm.

Although this target is fairly robust (meaning the optimizer should not fail to find a solution), it is a bit slower and less accurate than the "fast" target

See also
ActuatorForceTargetFast.
Version
1.0
Author
Frank C. Anderson

Constructor & Destructor Documentation

◆ ~ActuatorForceTarget()

virtual OpenSim::ActuatorForceTarget::~ActuatorForceTarget ( )
virtual

◆ ActuatorForceTarget()

OpenSim::ActuatorForceTarget::ActuatorForceTarget ( int  aNX,
CMC aController 
)

Member Function Documentation

◆ gradientFunc()

int OpenSim::ActuatorForceTarget::gradientFunc ( const SimTK::Vector x,
bool  new_coefficients,
SimTK::Vector gradient 
) const
overridevirtual

Reimplemented from SimTK::OptimizerSystem.

◆ objectiveFunc()

int OpenSim::ActuatorForceTarget::objectiveFunc ( const SimTK::Vector aF,
bool  new_coefficients,
SimTK::Real rP 
) const
overridevirtual

Reimplemented from SimTK::OptimizerSystem.

◆ prepareToOptimize()

bool OpenSim::ActuatorForceTarget::prepareToOptimize ( SimTK::State s,
double *  x 
)
overridevirtual

Reimplemented from OpenSim::OptimizationTarget.

◆ setStressTermWeight()

void OpenSim::ActuatorForceTarget::setStressTermWeight ( double  aWeight)

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