|
Biorbd Release_1.13.0
|
Base class for a Static Optimization algorithm. More...
#include <StaticOptimization.h>
Public Member Functions | |
| StaticOptimization (Model &model, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, const rigidbody::GeneralizedTorque &torqueTarget, double initialActivationGuess=0.01, unsigned int pNormFactor=2, bool useResidualTorque=true, int verbose=0, double objectiveScaling=1) | |
| Construct static optimization. | |
| StaticOptimization (Model &model, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, const rigidbody::GeneralizedTorque &torqueTarget, const utils::Vector &initialActivationGuess, unsigned int pNormFactor=2, bool useResidualTorque=true, int verbose=0, double objectiveScaling=1) | |
| Construct static optimization. | |
| StaticOptimization (Model &model, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, const rigidbody::GeneralizedTorque &torqueTarget, const std::vector< StateDynamics > &initialActivationGuess, unsigned int pNormFactor=2, bool useResidualTorque=true, int verbose=0, double objectiveScaling=1) | |
| Construct static optimization. | |
| StaticOptimization (Model &model, const std::vector< rigidbody::GeneralizedCoordinates > &allQ, const std::vector< rigidbody::GeneralizedVelocity > &allQdot, const std::vector< rigidbody::GeneralizedTorque > &allTorqueTarget, double initialActivationGuess=0.01, unsigned int pNormFactor=2, bool useResidualTorque=true, int verbose=0, double objectiveScaling=1) | |
| Construct static optimization for multiple frames. | |
| StaticOptimization (Model &model, const std::vector< rigidbody::GeneralizedCoordinates > &allQ, const std::vector< rigidbody::GeneralizedVelocity > &allQdot, const std::vector< rigidbody::GeneralizedTorque > &allTorqueTarget, const utils::Vector &initialActivationGuess, unsigned int pNormFactor=2, bool useResidualTorque=true, int verbose=0, double objectiveScaling=1) | |
| Construct static optimization for multiple frames. | |
| StaticOptimization (Model &model, const std::vector< rigidbody::GeneralizedCoordinates > &allQ, const std::vector< rigidbody::GeneralizedVelocity > &allQdot, const std::vector< rigidbody::GeneralizedTorque > &allTorqueTarget, const std::vector< StateDynamics > &initialActivationGuess, unsigned int pNormFactor=2, bool useResidualTorque=true, int verbose=0, double objectiveScaling=1) | |
| Construct static optimization for multiple frames. | |
| void | run (bool useLinearizedState=true, double tolerance=1e-7, int maxIter=1000, bool checkDerivatives=false) |
| Run the static optimization. | |
| std::vector< utils::Vector > | finalSolution () |
| Return the final solution. | |
| utils::Vector | finalSolution (unsigned int index) |
| Return the final solution at a specific index. | |
| std::vector< utils::Vector > | finalResidual () |
| Return the final residuals. | |
| utils::Vector | finalResidual (unsigned int index) |
| Return the final residuals at a specific index. | |
Protected Attributes | |
| Model & | m_model |
| A reference to the model. | |
| bool | m_useResidualTorque |
| To use residual torque. | |
| std::vector< rigidbody::GeneralizedCoordinates > | m_allQ |
| All the generalized coordinates. | |
| std::vector< rigidbody::GeneralizedVelocity > | m_allQdot |
| All the generalized velocities. | |
| std::vector< rigidbody::GeneralizedTorque > | m_allTorqueTarget |
| All the torque targets. | |
| std::shared_ptr< utils::Vector > | m_initialActivationGuess |
| Initial activation guess. | |
| unsigned int | m_pNormFactor |
| The p-norm factor. | |
| int | m_verbose |
| Verbose level. | |
| double | m_objectiveScaling |
| Scaling factor of the objective. | |
| std::vector< Ipopt::SmartPtr< Ipopt::TNLP > > | m_staticOptimProblem |
| The static optimization problem. | |
| bool | m_alreadyRun |
| If already ran the static optimization. | |
Base class for a Static Optimization algorithm.
Definition at line 30 of file StaticOptimization.h.
| internal_forces::muscles::StaticOptimization::StaticOptimization | ( | Model & | model, |
| const rigidbody::GeneralizedCoordinates & | Q, | ||
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| const rigidbody::GeneralizedTorque & | torqueTarget, | ||
| double | initialActivationGuess = 0.01, | ||
| unsigned int | pNormFactor = 2, | ||
| bool | useResidualTorque = true, | ||
| int | verbose = 0, | ||
| double | objectiveScaling = 1 ) |
Construct static optimization.
| model | The musculoskeletal Model |
| Q | The generalized coordinates |
| Qdot | The generalized velocities |
| torqueTarget | The generalized torque target to match during the optimization |
| initialActivationGuess | The initial activation guess |
| pNormFactor | The p-norm to perform |
| useResidualTorque | If use residual torque, if set to false, the optimization will fail if the model is not strong enough |
| verbose | Level of IPOPT verbose you want |
| objectiveScaling | The scaling factor applied to the objective function, on top of the scaling computed by IPOPT (must be positive) |
Definition at line 19 of file StaticOptimization.cpp.
| internal_forces::muscles::StaticOptimization::StaticOptimization | ( | Model & | model, |
| const rigidbody::GeneralizedCoordinates & | Q, | ||
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| const rigidbody::GeneralizedTorque & | torqueTarget, | ||
| const utils::Vector & | initialActivationGuess, | ||
| unsigned int | pNormFactor = 2, | ||
| bool | useResidualTorque = true, | ||
| int | verbose = 0, | ||
| double | objectiveScaling = 1 ) |
Construct static optimization.
| model | The musculoskeletal Model |
| Q | The generalized coordinates |
| Qdot | The generalized velocities |
| torqueTarget | The generalized torque target to match during the optimization |
| initialActivationGuess | The initial activation guess |
| pNormFactor | The p-norm to perform |
| useResidualTorque | If use residual torque, if set to false, the optimization will fail if the model is not strong enough |
| verbose | Level of IPOPT verbose you want |
| objectiveScaling | The scaling factor applied to the objective function, on top of the scaling computed by IPOPT (must be positive) |
Definition at line 48 of file StaticOptimization.cpp.
| internal_forces::muscles::StaticOptimization::StaticOptimization | ( | Model & | model, |
| const rigidbody::GeneralizedCoordinates & | Q, | ||
| const rigidbody::GeneralizedVelocity & | Qdot, | ||
| const rigidbody::GeneralizedTorque & | torqueTarget, | ||
| const std::vector< StateDynamics > & | initialActivationGuess, | ||
| unsigned int | pNormFactor = 2, | ||
| bool | useResidualTorque = true, | ||
| int | verbose = 0, | ||
| double | objectiveScaling = 1 ) |
Construct static optimization.
| model | The musculoskeletal Model |
| Q | The generalized coordinates |
| Qdot | The generalized velocities |
| torqueTarget | The generalized torque target to match during the optimization |
| initialActivationGuess | The initial activation guess |
| pNormFactor | The p-norm to perform |
| useResidualTorque | If use residual torque, if set to false, the optimization will fail if the model is not strong enough |
| verbose | Level of IPOPT verbose you want |
| objectiveScaling | The scaling factor applied to the objective function, on top of the scaling computed by IPOPT (must be positive) |
Definition at line 81 of file StaticOptimization.cpp.
| internal_forces::muscles::StaticOptimization::StaticOptimization | ( | Model & | model, |
| const std::vector< rigidbody::GeneralizedCoordinates > & | allQ, | ||
| const std::vector< rigidbody::GeneralizedVelocity > & | allQdot, | ||
| const std::vector< rigidbody::GeneralizedTorque > & | allTorqueTarget, | ||
| double | initialActivationGuess = 0.01, | ||
| unsigned int | pNormFactor = 2, | ||
| bool | useResidualTorque = true, | ||
| int | verbose = 0, | ||
| double | objectiveScaling = 1 ) |
Construct static optimization for multiple frames.
| model | The musculoskeletal Model |
| allQ | The generalized coordinates |
| allQdot | The generalized velocities |
| allTorqueTarget | The generalized torque target to match during the optimization |
| initialActivationGuess | The initial activation guess |
| pNormFactor | The p-norm to perform |
| useResidualTorque | If use residual torque, if set to false, the optimization will fail if the model is not strong enough |
| verbose | Level of IPOPT verbose you want |
| objectiveScaling | The scaling factor applied to the objective function, on top of the scaling computed by IPOPT (must be positive) |
Definition at line 116 of file StaticOptimization.cpp.
| internal_forces::muscles::StaticOptimization::StaticOptimization | ( | Model & | model, |
| const std::vector< rigidbody::GeneralizedCoordinates > & | allQ, | ||
| const std::vector< rigidbody::GeneralizedVelocity > & | allQdot, | ||
| const std::vector< rigidbody::GeneralizedTorque > & | allTorqueTarget, | ||
| const utils::Vector & | initialActivationGuess, | ||
| unsigned int | pNormFactor = 2, | ||
| bool | useResidualTorque = true, | ||
| int | verbose = 0, | ||
| double | objectiveScaling = 1 ) |
Construct static optimization for multiple frames.
| model | The musculoskeletal Model |
| allQ | The generalized coordinates |
| allQdot | The generalized velocities |
| allTorqueTarget | The generalized torque target to match during the optimization |
| initialActivationGuess | The initial activation guess |
| pNormFactor | The p-norm to perform |
| useResidualTorque | If use residual torque, if set to false, the optimization will fail if the model is not strong enough |
| verbose | Level of IPOPT verbose you want |
| objectiveScaling | The scaling factor applied to the objective function, on top of the scaling computed by IPOPT (must be positive) |
Definition at line 144 of file StaticOptimization.cpp.
| internal_forces::muscles::StaticOptimization::StaticOptimization | ( | Model & | model, |
| const std::vector< rigidbody::GeneralizedCoordinates > & | allQ, | ||
| const std::vector< rigidbody::GeneralizedVelocity > & | allQdot, | ||
| const std::vector< rigidbody::GeneralizedTorque > & | allTorqueTarget, | ||
| const std::vector< StateDynamics > & | initialActivationGuess, | ||
| unsigned int | pNormFactor = 2, | ||
| bool | useResidualTorque = true, | ||
| int | verbose = 0, | ||
| double | objectiveScaling = 1 ) |
Construct static optimization for multiple frames.
| model | The musculoskeletal Model |
| allQ | The generalized coordinates |
| allQdot | The generalized velocities |
| allTorqueTarget | The generalized torque target to match during the optimization |
| initialActivationGuess | The initial activation guess |
| pNormFactor | The p-norm to perform |
| useResidualTorque | If use residual torque, if set to false, the optimization will fail if the model is not strong enough |
| verbose | Level of IPOPT verbose you want |
| objectiveScaling | The scaling factor applied to the objective function, on top of the scaling computed by IPOPT (must be positive) |
Definition at line 175 of file StaticOptimization.cpp.
| std::vector< utils::Vector > internal_forces::muscles::StaticOptimization::finalResidual | ( | ) |
Return the final residuals.
Definition at line 313 of file StaticOptimization.cpp.
| utils::Vector internal_forces::muscles::StaticOptimization::finalResidual | ( | unsigned int | index | ) |
Return the final residuals at a specific index.
| index | The index of the frame |
Definition at line 331 of file StaticOptimization.cpp.
| std::vector< utils::Vector > internal_forces::muscles::StaticOptimization::finalSolution | ( | ) |
Return the final solution.
Definition at line 277 of file StaticOptimization.cpp.
| utils::Vector internal_forces::muscles::StaticOptimization::finalSolution | ( | unsigned int | index | ) |
Return the final solution at a specific index.
| index | The index of the frame |
Definition at line 296 of file StaticOptimization.cpp.
| void internal_forces::muscles::StaticOptimization::run | ( | bool | useLinearizedState = true, |
| double | tolerance = 1e-7, | ||
| int | maxIter = 1000, | ||
| bool | checkDerivatives = false ) |
Run the static optimization.
| useLinearizedState | If use the algorithm should be run with the linearized approach (faster but less precise) |
| tolerance | The convergence tolerance of IPOPT ("tol" option) |
| maxIter | The maximum number of iterations of IPOPT for each frame. If it is reached, a warning is issued and the last iterate is kept |
| checkDerivatives | If the first order derivatives should be checked by IPOPT against finite differences (for debug purposes, the results are printed if verbose is high enough) |
Each frame uses the solution of the previous frame as initial guess. Running more than once restarts from the initial guess given at construction and replaces the previous results.
Definition at line 209 of file StaticOptimization.cpp.
|
protected |
All the generalized coordinates.
Definition at line 239 of file StaticOptimization.h.
|
protected |
All the generalized velocities.
Definition at line 241 of file StaticOptimization.h.
|
protected |
All the torque targets.
Definition at line 243 of file StaticOptimization.h.
|
protected |
If already ran the static optimization.
Definition at line 251 of file StaticOptimization.h.
|
protected |
Initial activation guess.
Definition at line 245 of file StaticOptimization.h.
|
protected |
A reference to the model.
Definition at line 236 of file StaticOptimization.h.
|
protected |
Scaling factor of the objective.
Definition at line 248 of file StaticOptimization.h.
|
protected |
The p-norm factor.
Definition at line 246 of file StaticOptimization.h.
|
protected |
The static optimization problem.
Definition at line 250 of file StaticOptimization.h.
|
protected |
To use residual torque.
Definition at line 237 of file StaticOptimization.h.
|
protected |
Verbose level.
Definition at line 247 of file StaticOptimization.h.