Biorbd Release_1.13.0
Loading...
Searching...
No Matches
StaticOptimizationIpoptLinearized.h
1#ifndef BIORBD_MUSCLES_STATIC_OPTIMIZATION_IPOPT_LINEARIZED_H
2#define BIORBD_MUSCLES_STATIC_OPTIMIZATION_IPOPT_LINEARIZED_H
3
4#include "biorbdConfig.h"
5
6#include "InternalForces/Muscles/StaticOptimizationIpopt.h"
7
8namespace BIORBD_NAMESPACE {
9namespace utils {
10class Matrix;
11class Vector;
12} // namespace utils
13
14namespace internal_forces {
15namespace muscles {
30 public:
46 Model& model,
49 const rigidbody::GeneralizedTorque& torqueTarget,
50 const utils::Vector& activationInit,
51 bool useResidual = true,
52 unsigned int pNormFactor = 2,
53 int verbose = 0,
54 double eps = 1e-8);
55
60
70 virtual bool eval_g(
71 Ipopt::Index n,
72 const Ipopt::Number* x,
73 bool new_x,
74 Ipopt::Index m,
75 Ipopt::Number* g);
76
89 virtual bool eval_jac_g(
90 Ipopt::Index n,
91 const Ipopt::Number* x,
92 bool new_x,
93 Ipopt::Index m,
94 Ipopt::Index nele_jac,
95 Ipopt::Index* iRow,
96 Ipopt::Index* jCol,
97 Ipopt::Number* values);
98
99 protected:
100 std::shared_ptr<utils::Matrix> m_jacobian;
101 std::shared_ptr<utils::Vector>
103 void prepareJacobian();
104};
105
106} // namespace muscles
107} // namespace internal_forces
108} // namespace BIORBD_NAMESPACE
109
110#endif // BIORBD_MUSCLES_STATIC_OPTIMIZATION_IPOPT_LINEARIZED_H
The actual musculoskeletal model that holds everything in biorbd.
virtual bool eval_g(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Number *g)
Method to return the constraint residuals.
virtual bool eval_jac_g(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Index nele_jac, Ipopt::Index *iRow, Ipopt::Index *jCol, Ipopt::Number *values)
Return the jacobian of contraints.
StaticOptimizationIpoptLinearized(Model &model, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, const rigidbody::GeneralizedTorque &torqueTarget, const utils::Vector &activationInit, bool useResidual=true, unsigned int pNormFactor=2, int verbose=0, double eps=1e-8)
Construct an Ipopt static optimization problem.
std::shared_ptr< utils::Vector > m_torquePassive
The muscle torque when not activated.
StaticOptimizationIpopt(Model &model, const rigidbody::GeneralizedCoordinates &Q, const rigidbody::GeneralizedVelocity &Qdot, const rigidbody::GeneralizedTorque &torqueTarget, const utils::Vector &activationInit, bool useResidual=true, unsigned int pNormFactor=2, int verbose=0, double eps=1e-8)
Construct an Ipopt static optimization problem.
A wrapper for the Eigen::MatrixXd.
Definition Matrix.h:18
Wrapper of the Eigen VectorXd.
Definition Vector.h:21