SolverIpopt (std::shared_ptr< ShootingProblem > problem) Initialize the Ipopt solver. virtual void resizeData () override Resizing the solver data. void set_th_stop (const Scalar th_stop)virtual void setCandidate (const std::vector< VectorXs > &xs_warm=DefaultVector < Scalar >::value, const std::vector< VectorXs > &us_warm=DefaultVector < Scalar >::value, const bool is_feasible=false) Set the solver candidate trajectories . void setNumericIpoptOption (const std::string &tag, Ipopt::Number value) Set a string ipopt option. void setStringIpoptOption (const std::string &tag, const std::string &value) Set a string ipopt option. bool solve (const std::vector< VectorXs > &init_xs=DefaultVector < Scalar >::value, const std::vector< VectorXs > &init_us=DefaultVector < Scalar >::value, const std::size_t maxiter=100, const bool is_feasible=false, const Scalar reg_init=Scalar(1e-9)) override SolverAbstractTpl (std::shared_ptr< ShootingProblem > problem) Initialize the solver. virtual void calcDir () Refresh the linearization of the optimal control problem around the current candidate. virtual bool checkAcceptance () Check if we should accept or not the step. virtual void computeCandidate (const Scalar steplength=Scalar(1.)) Compute new candidate solution using step length. Scalar computeControlFeasibility (const std::vector< VectorXs > &us) Compute the control box-constraint feasibility from a given control trajectory. Scalar computeDynamicFeasibility () Compute the dynamic feasibility for the current guess . Scalar computeEqualityFeasibility () Compute the feasibility of the equality constraints for the current guess. virtual void computeExpectedMeritFunctionImprovement () Compute the expected merit function improvement for the current step. Scalar computeFeasibility (const std::vector< VectorXs > &fs) Compute the feasibility from a given residual vector. Scalar computeInequalityFeasibility () Compute the feasibility of the inequality constraints for the current guess. virtual void computeMeritFunctionImprovement () Compute the merit function improvement for the current step. Scalar computeStateFeasibility (const std::vector< VectorXs > &xs) Compute the state box-constraint feasibility from a given state trajectory. virtual void decreaseRegularization () Decrease the state and control regularization values by a regfactor_ factor. virtual bool decreaseRegularizationCriteria () Criteria used to decrease regularization. DEPRECATED ("Use get_preg for primal-variable regularization", Scalar get_xreg() const { return preg_ ;}) DEPRECATED("Use get_preg for primal-variable regularization"const std::vector< Scalar > & get_alphas () const Return the set of step lengths using by the line-search procedure. Scalar get_cost () const Return the cost for the current guess. Scalar get_dfeas () const Return the reduction in the feasibility. Scalar get_dPhi () const Return the reduction in the merit function . Scalar get_dPhiexp () const Return the expected reduction in the merit function . Scalar get_dreg () const Return the dual-variable regularization. const std::vector< VectorXs > & get_dus () const Return the feedforward gains . const Vector3s & get_DV () const Return the constant, linear, and quadratic terms of the expected improvement. Scalar get_dV () const Return the reduction in the cost function . Scalar get_dVexp () const Return the expected reduction in the cost function . const std::vector< VectorXs > & get_dxs () const Return the linear update in . Scalar get_feas () const Return the total feasibility for the current guess. Scalar get_ffeas () const Return the dynamic feasibility for the current guess. Scalar get_ffeas_try () const Return the dynamic feasibility for the current step length. const std::vector< VectorXs > & get_fs () const Return the dynamic infeasibility . const std::vector< VectorXs > & get_fs_try () const Return the trail dynamic infeasibility . Scalar get_gfeas () const Return the inequality feasibility for the current guess. Scalar get_gfeas_try () const Return the inequality feasibility for the current step length. Scalar get_hfeas () const Return the equality feasibility for the current guess. Scalar get_hfeas_try () const Return the equality feasibility for the current step length. bool get_is_feasible () const Return the feasibility status of the trajectory. std::size_t get_iter () const Return the number of iterations performed by the solver. Scalar get_merit () const Return the merit for the current guess. Scalar get_preg () const Return the primal-variable regularization. const std::shared_ptr< ShootingProblem > & get_problem () const Return the shooting problem. Scalar get_reg_max () const Return the maximum regularization value. Scalar get_reg_min () const Return the minimum regularization value. Scalar get_steplength () const Return the step length . Scalar get_stop () const Return the stopping-criteria value computed by stoppingCriteria() . Scalar get_th_acceptstep () const Return the threshold used for accepting a step. Scalar get_th_stop () const Return the tolerance for stopping the algorithm. Scalar get_ureg () constconst std::vector< VectorXs > & get_us () const Return the control trajectory . const std::vector< VectorXs > & get_us_try () const Return the trial control trajectory . const std::vector< VectorXs > & get_xs () const Return the state trajectory . const std::vector< VectorXs > & get_xs_try () const Return the trial state trajectory . const std::vector< std::shared_ptr< CallbackAbstract > > & getCallbacks () const Return the list of callback functions using for diagnostic. virtual void increaseRegularization () Increase the state and control regularization values by a regfactor_ factor. virtual bool increaseRegularizationCriteria () Criteria used to increase regularization. void set_alphas (const std::vector< Scalar > &alphas) Modify the set of step lengths using by the line-search procedure. void set_dreg (const Scalar dreg) Modify the dual-variable regularization value. void set_preg (const Scalar preg) Modify the primal-variable regularization value. void set_reg_max (const Scalar regmax) Modify the maximum regularization value. void set_reg_min (const Scalar regmin) Modify the minimum regularization value. void set_th_acceptstep (const Scalar th_acceptstep) Modify the threshold used for accepting step. void set_th_stop (const Scalar th_stop) Modify the tolerance for stopping the algorithm. void set_ureg (const Scalar ureg)void set_us (const std::vector< VectorXs > &us) Modify the control trajectory . void set_xs (const std::vector< VectorXs > &xs) Modify the state trajectory . void setCallbacks (const std::vector< std::shared_ptr< CallbackAbstract > > &callbacks) Set a list of callback functions using for the solver diagnostic. virtual void setCandidate (const std::vector< VectorXs > &xs_warm=DefaultVector < Scalar >::value, const std::vector< VectorXs > &us_warm=DefaultVector < Scalar >::value, const bool is_feasible=false) Set the solver candidate trajectories . virtual bool solve (const std::vector< VectorXs > &init_xs=DefaultVector < Scalar >::value, const std::vector< VectorXs > &init_us=DefaultVector < Scalar >::value, const std::size_t maxiter=100, const bool is_feasible=false, const Scalar reg_init=std::numeric_limits< Scalar >::quiet_NaN()) Compute the optimal trajectory as lists of and terms. virtual void updateCandidate () Update the candidate solution: cost, feasibilities, and merit value. virtual void updateMeritFunction () Update the merit function value for the current guess.
void allocateData () Allocate all the basic data needed in solvers. virtual void resizeRunningData () Resize data associated with the running models of the shooting problem. virtual void resizeTerminalData () Resize data associated with the terminal model of the shooting problem. bool acceptstep_ std::vector< Scalar > alphas_ Set of step lengths using by the line-search procedure. std::vector< std::shared_ptr< CallbackAbstract > > callbacks_ Callback functions. Scalar cost_ Cost for the current guess. Scalar cost_try_ Total cost computed by line-search procedure. Scalar dfeas_ Reduction in the feasibility. Scalar dImpr_ Scalar dPhi_ Reduction in the merit function computed by tryStep() . Scalar dPhiexp_ Scalar dreg_ Current dual-variable regularization value. std::vector< VectorXs > dus_ Linear control direction (size T). Vector3s DV_ LQ approximation of the expected improvement. Scalar dV_ Reduction in the cost function computed by tryStep() . Scalar dVexp_ Scalar dVexp_full_ std::vector< VectorXs > dxs_ Linear state direction (size T + 1). Scalar feas_ Total feasibility for the current guess. Scalar ffeas_ Feasibility of the dynamic constraints for the current guess. Scalar ffeas_try_ std::vector< VectorXs > fs_ Dynamics gaps in each node. std::vector< VectorXs > fs_try_ std::vector< VectorXs > g_adj_ Adjusted inequality bound. Scalar gfeas_ Scalar gfeas_try_ Scalar hfeas_ Scalar hfeas_try_ bool is_feasible_ Label that indicates is the iteration is feasible. std::size_t iter_ Number of iteration performed by the solver. Scalar merit_ Merit for the current guess. std::size_t ng_T_ Dimension of termianl inequality constraints. std::size_t nh_T_ Dimension of terminal equality constraints. Scalar preg_ Current primal-variable regularization value. std::shared_ptr< ShootingProblem > problem_ optimal control problem bool recalcdir_ Scalar reg_max_ Maximum allowed regularization value. Scalar reg_min_ < Current control regularization values Scalar steplength_ Current applied step length. Scalar stop_ Value computed by stoppingCriteria() . Scalar th_acceptstep_ Threshold used for accepting step. Scalar th_stop_ Tolerance for stopping the algorithm. Scalar tmp_feas_ Temporal variables used for computed the feasibility. std::vector< VectorXs > u_adj_ Adjusted control bound. Scalar ureg_ std::vector< VectorXs > us_ Control trajectory. std::vector< VectorXs > us_try_ Control trajectory computed by line-search procedure. bool was_feasible_ std::vector< VectorXs > x_adj_ Adjusted state bound. std::vector< VectorXs > xs_ State trajectory. std::vector< VectorXs > xs_try_ State trajectory computed by line-search procedure.
Ipopt solver.
This solver solves the optimal control problem by transcribing with the multiple shooting approach.
See also solve() Definition at line 30 of file ipopt.hpp .