RobWorkProject  24.12.4-
Public Member Functions | List of all members
ModRussel_NLP Class Reference

Implementation of the Modified Russel beam problem, using the IPOPT TNLP structure. More...

#include <ModRussel_NLP.hpp>

Inherits TNLP.

Public Member Functions

 ModRussel_NLP (std::shared_ptr< BeamGeometry > geomPtr, std::shared_ptr< BeamObstaclePlane > obstaclePtr, rw::math::Transform3D<> planeTbeam, const std::vector< int > &integralIndices)
 

Overloaded from TNLP

virtual bool get_nlp_info (Ipopt::Index &n, Ipopt::Index &m, Ipopt::Index &nnz_jac_g, Ipopt::Index &nnz_h_lag, IndexStyleEnum &index_style)
 
virtual bool get_bounds_info (Ipopt::Index n, Ipopt::Number *x_l, Ipopt::Number *x_u, Ipopt::Index m, Ipopt::Number *g_l, Ipopt::Number *g_u)
 
virtual bool get_starting_point (Ipopt::Index n, bool init_x, Ipopt::Number *x, bool init_z, Ipopt::Number *z_L, Ipopt::Number *z_U, Ipopt::Index m, bool init_lambda, Ipopt::Number *lambda)
 
virtual bool eval_f (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number &obj_value)
 
virtual bool eval_grad_f (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number *grad_f)
 
virtual bool eval_g (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Number *g)
 
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)
 
virtual bool eval_h (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number obj_factor, Ipopt::Index m, const Ipopt::Number *lambda, bool new_lambda, Ipopt::Index nele_hess, Ipopt::Index *iRow, Ipopt::Index *jCol, Ipopt::Number *values)
 
virtual void finalize_solution (Ipopt::SolverReturn status, Ipopt::Index n, const Ipopt::Number *x, const Ipopt::Number *z_L, const Ipopt::Number *z_U, Ipopt::Index m, const Ipopt::Number *g, const Ipopt::Number *lambda, Ipopt::Number obj_value, const Ipopt::IpoptData *ip_data, Ipopt::IpoptCalculatedQuantities *ip_cq)
 
std::shared_ptr< BeamGeometrygetGeometry (void) const
 returns the geometry used More...
 
std::shared_ptr< BeamObstaclePlanegetObstacle (void) const
 returns the obstacle used More...
 
rw::math::Transform3D get_planeTbeam (void) const
 get the plane to beam transform More...
 
const Eigen::VectorXd & getSolution (void) const
 returns the solution vector More...
 
double getEnergyElastic (void) const
 returns the total elastic energy for the last solution More...
 
void setStartingGuess (const Eigen::VectorXd &xinituser)
 sets the starting guess for the optimization More...
 

Detailed Description

Implementation of the Modified Russel beam problem, using the IPOPT TNLP structure.

Member Function Documentation

◆ eval_f()

virtual bool eval_f ( Ipopt::Index  n,
const Ipopt::Number *  x,
bool  new_x,
Ipopt::Number &  obj_value 
)
virtual

Method to return the objective value

◆ eval_g()

virtual bool eval_g ( Ipopt::Index  n,
const Ipopt::Number *  x,
bool  new_x,
Ipopt::Index  m,
Ipopt::Number *  g 
)
virtual

Method to return the constraint residuals

◆ eval_grad_f()

virtual bool eval_grad_f ( Ipopt::Index  n,
const Ipopt::Number *  x,
bool  new_x,
Ipopt::Number *  grad_f 
)
virtual

Method to return the gradient of the objective

◆ eval_h()

virtual bool eval_h ( Ipopt::Index  n,
const Ipopt::Number *  x,
bool  new_x,
Ipopt::Number  obj_factor,
Ipopt::Index  m,
const Ipopt::Number *  lambda,
bool  new_lambda,
Ipopt::Index  nele_hess,
Ipopt::Index *  iRow,
Ipopt::Index *  jCol,
Ipopt::Number *  values 
)
virtual

Method to return: 1) The structure of the hessian of the lagrangian (if "values" is NULL) 2) The values of the hessian of the lagrangian (if "values" is not NULL)

◆ eval_jac_g()

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 
)
virtual

Method to return: 1) The structure of the jacobian (if "values" is NULL) 2) The values of the jacobian (if "values" is not NULL)

◆ finalize_solution()

virtual void finalize_solution ( Ipopt::SolverReturn  status,
Ipopt::Index  n,
const Ipopt::Number *  x,
const Ipopt::Number *  z_L,
const Ipopt::Number *  z_U,
Ipopt::Index  m,
const Ipopt::Number *  g,
const Ipopt::Number *  lambda,
Ipopt::Number  obj_value,
const Ipopt::IpoptData *  ip_data,
Ipopt::IpoptCalculatedQuantities *  ip_cq 
)
virtual

This method is called when the algorithm is complete so the TNLP can store/write the solution

◆ get_bounds_info()

virtual bool get_bounds_info ( Ipopt::Index  n,
Ipopt::Number *  x_l,
Ipopt::Number *  x_u,
Ipopt::Index  m,
Ipopt::Number *  g_l,
Ipopt::Number *  g_u 
)
virtual

Method to return the bounds for my problem

◆ get_nlp_info()

virtual bool get_nlp_info ( Ipopt::Index &  n,
Ipopt::Index &  m,
Ipopt::Index &  nnz_jac_g,
Ipopt::Index &  nnz_h_lag,
IndexStyleEnum &  index_style 
)
virtual

Method to return some info about the nlp

◆ get_planeTbeam()

rw::math::Transform3D get_planeTbeam ( void  ) const

get the plane to beam transform

Returns
the plane to beam transform

◆ get_starting_point()

virtual bool get_starting_point ( Ipopt::Index  n,
bool  init_x,
Ipopt::Number *  x,
bool  init_z,
Ipopt::Number *  z_L,
Ipopt::Number *  z_U,
Ipopt::Index  m,
bool  init_lambda,
Ipopt::Number *  lambda 
)
virtual

Method to return the starting point for the algorithm

◆ getEnergyElastic()

double getEnergyElastic ( void  ) const

returns the total elastic energy for the last solution

returns the total elastic energy for the last solution. The energy returned is in units of [kg mm^ 2 / s^2]

Returns
total elastic energy

◆ getGeometry()

std::shared_ptr<BeamGeometry> getGeometry ( void  ) const

returns the geometry used

Returns
the geometry used

◆ getObstacle()

std::shared_ptr<BeamObstaclePlane> getObstacle ( void  ) const

returns the obstacle used

Returns
the obstacle used

◆ getSolution()

const Eigen::VectorXd& getSolution ( void  ) const

returns the solution vector

Returns
solution vector

◆ setStartingGuess()

void setStartingGuess ( const Eigen::VectorXd &  xinituser)

sets the starting guess for the optimization

Parameters
xinituservector of deformation angles to be used as starting guess

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