1#ifndef OPENSIM_MOCOACTIVATIONGOAL_H
2#define OPENSIM_MOCOACTIVATIONGOAL_H
7#include <OpenSim/Moco/osimMoco.h>
42 constructProperties();
49 :
MocoGoal(std::move(name), weight) {
50 constructProperties();
64 void setEndPointGoal(
double end_point_goal) { set_end_point_goal(end_point_goal); }
86 const IntegrandInput& input,
double& integrand)
const override;
92 const GoalInput& input, SimTK::Vector& cost)
const override;
99 "Divide by the model's displacement over the phase (default: "
103 "The exponent applied to the output value in the integrand. "
104 "The output can take on negative values in the integrand when the "
105 "exponent is set to 1 (the default value). When the exponent is "
106 "set to a value greater than 1, the absolute value function is "
107 "applied to the output (before the exponent is applied), meaning "
108 "that odd numbered exponents (greater than 1) do not take on "
112 "Target value for end-point goal (default: 0)");
121 mutable std::function<double(
const double&)> m_power_function;
123 mutable std::vector<int> m_act_indices;
#define OSIMMOCOACTIVATIONGOAL_API
Definition osimMocoActivationGoalDLL.h:12
This goal minimizes the sum of muscle activations to a specified power, optionally allowing custom we...
Definition MocoActivationGoal.h:30
void initializeOnModelImpl(const Model &) const override
Initialize the goal with the model.
bool getDivideByDisplacement() const
Get whether the sum is divided by displacement.
Definition MocoActivationGoal.h:60
OpenSim_DECLARE_PROPERTY(divide_by_displacement, bool, "Divide by the model's displacement over the phase (default: " "false)")
void setDivideByDisplacement(bool tf)
Set whether to divide the sum of activations by displacement.
Definition MocoActivationGoal.h:56
void calcIntegrandImpl(const IntegrandInput &input, double &integrand) const override
Calculate the integrand value for the cost function.
void calcGoalImpl(const GoalInput &input, SimTK::Vector &cost) const override
Calculate the goal value.
OpenSim_DECLARE_CONCRETE_OBJECT(MocoActivationGoal, MocoGoal)
MocoActivationGoal()
Default constructor.
Definition MocoActivationGoal.h:37
OpenSim_DECLARE_PROPERTY(exponent, int, "The exponent applied to the output value in the integrand. " "The output can take on negative values in the integrand when the " "exponent is set to 1 (the default value). When the exponent is " "set to a value greater than 1, the absolute value function is " "applied to the output (before the exponent is applied), meaning " "that odd numbered exponents (greater than 1) do not take on " "negative values.")
bool getSupportsEndpointConstraintImpl() const override
Whether this goal supports endpoint constraint mode.
Definition MocoActivationGoal.h:77
MocoActivationGoal(std::string name)
Constructor with name.
Definition MocoActivationGoal.h:41
void setEndPointGoal(double end_point_goal)
Set the target value when using this goal as an endpoint constraint.
Definition MocoActivationGoal.h:64
OpenSim_DECLARE_PROPERTY(end_point_goal, double, "Target value for end-point goal (default: 0)")
double getEndPointGoal() const
Get the endpoint constraint target value.
Definition MocoActivationGoal.h:68
void constructProperties()
Initialize the goal's properties.
MocoActivationGoal(std::string name, double weight)
Constructor with name and weight.
Definition MocoActivationGoal.h:48
Mode getDefaultModeImpl() const override
Get the default mode for this goal.
Definition MocoActivationGoal.h:74
Definition MocoActivationGoal.h:14