| 
    autogenu-jupyter
    
   An automatic code generator and the continuation/GMRES (C/GMRES) based numerical solvers for nonlinear MPC 
   | 
 
Definition of the optimal control problem (OCP) of pendubot. More...
#include <ocp.hpp>
Public Member Functions | |
| void | disp (std::ostream &os) const | 
| void | synchronize () | 
| Synchrozies the internal parameters of this OCP with the external references. This method is called at the beginning of each MPC update.  More... | |
| void | eval_f (const double t, const double *x, const double *u, double *dx) const | 
| Computes the state equation dx = f(t, x, u).  More... | |
| void | eval_phix (const double t, const double *x, double *phix) const | 
| Computes the partial derivative of terminal cost with respect to state, i.e., phix = dphi/dx(t, x).  More... | |
| void | eval_hx (const double t, const double *x, const double *u, const double *lmd, double *hx) const | 
| Computes the partial derivative of the Hamiltonian with respect to state, i.e., hx = dH/dx(t, x, u, lmd).  More... | |
| void | eval_hu (const double t, const double *x, const double *u, const double *lmd, double *hu) const | 
| Computes the partial derivative of the Hamiltonian with respect to control input and the equality constraints, i.e., hu = dH/du(t, x, u, lmd).  More... | |
| template<typename VectorType1 , typename VectorType2 , typename VectorType3 > | |
| void | eval_f (const double t, const MatrixBase< VectorType1 > &x, const MatrixBase< VectorType2 > &u, const MatrixBase< VectorType3 > &dx) const | 
| Computes the state equation dx = f(t, x, u).  More... | |
| template<typename VectorType1 , typename VectorType2 > | |
| void | eval_phix (const double t, const MatrixBase< VectorType1 > &x, const MatrixBase< VectorType2 > &phix) const | 
| Computes the partial derivative of terminal cost with respect to state, i.e., phix = dphi/dx(t, x).  More... | |
| template<typename VectorType1 , typename VectorType2 , typename VectorType3 , typename VectorType4 > | |
| void | eval_hx (const double t, const MatrixBase< VectorType1 > &x, const MatrixBase< VectorType2 > &uc, const MatrixBase< VectorType3 > &lmd, const MatrixBase< VectorType4 > &hx) const | 
| Computes the partial derivative of the Hamiltonian with respect to the state, i.e., hx = dH/dx(t, x, u, lmd).  More... | |
| template<typename VectorType1 , typename VectorType2 , typename VectorType3 , typename VectorType4 > | |
| void | eval_hu (const double t, const MatrixBase< VectorType1 > &x, const MatrixBase< VectorType2 > &uc, const MatrixBase< VectorType3 > &lmd, const MatrixBase< VectorType4 > &hu) const | 
| Computes the partial derivative of the Hamiltonian with respect to control input and the equality constraints, i.e., hu = dH/du(t, x, u, lmd).  More... | |
Public Attributes | |
| double | m1 = 0.2 | 
| double | m2 = 0.7 | 
| double | l1 = 0.3 | 
| double | l2 = 0.3 | 
| double | d1 = 0.15 | 
| double | d2 = 0.257 | 
| double | J1 = 0.006 | 
| double | J2 = 0.051 | 
| double | g = 9.80665 | 
| std::array< double, 4 > | q = {1, 1, 0.1, 0.1} | 
| std::array< double, 4 > | q_terminal = {1, 1, 0.1, 0.1} | 
| std::array< double, 4 > | x_ref = {M_PI, 0, 0, 0} | 
| std::array< double, 1 > | r = {0.1} | 
| std::array< double, nub > | umin = {-5.0} | 
| std::array< double, nub > | umax = {5.0} | 
| std::array< double, nub > | dummy_weight = {0.1} | 
Static Public Attributes | |
| static constexpr int | nx = 4 | 
| Dimension of the state.  More... | |
| static constexpr int | nu = 1 | 
| Dimension of the control input.  More... | |
| static constexpr int | nc = 0 | 
| Dimension of the equality constraints.  More... | |
| static constexpr int | nh = 0 | 
| Dimension of the Fischer-Burmeister function (already counded in nc).  More... | |
| static constexpr int | nuc = nu + nc | 
| Dimension of the concatenation of the control input and equality constraints.  More... | |
| static constexpr int | nub = 1 | 
| Dimension of the bound constraints on the control input.  More... | |
| static constexpr std::array< int, nub > | ubound_indices = {0} | 
Friends | |
| std::ostream & | operator<< (std::ostream &os, const OCP_pendubot &ocp) | 
Definition of the optimal control problem (OCP) of pendubot.
      
  | 
  inline | 
      
  | 
  inline | 
Computes the state equation dx = f(t, x, u).
| [in] | t | Time. | 
| [in] | x | State. | 
| [in] | u | Control input. | 
| [out] | dx | Evaluated value of the state equation. | 
      
  | 
  inline | 
Computes the state equation dx = f(t, x, u).
| [in] | t | Time. | 
| [in] | x | State. Size must be nx. | 
| [in] | u | Control input. Size must be nu. | 
| [out] | dx | Evaluated value of the state equation. Size must be nx. | 
      
  | 
  inline | 
Computes the partial derivative of the Hamiltonian with respect to control input and the equality constraints, i.e., hu = dH/du(t, x, u, lmd).
| [in] | t | Time. | 
| [in] | x | State. | 
| [in] | u | Concatenatin of the control input and Lagrange multiplier with respect to the equality constraints. | 
| [in] | lmd | Costate. | 
| [out] | hu | Evaluated value of the partial derivative of the Hamiltonian. | 
      
  | 
  inline | 
Computes the partial derivative of the Hamiltonian with respect to control input and the equality constraints, i.e., hu = dH/du(t, x, u, lmd).
| [in] | t | Time. | 
| [in] | x | State. Size must be nx. | 
| [in] | uc | Concatenatin of the control input and Lagrange multiplier with respect to the equality constraints. Size must be nuc. | 
| [in] | lmd | Costate. Size must be nx. | 
| [out] | hu | Evaluated value of the partial derivative of the Hamiltonian. Size must be nuc. | 
      
  | 
  inline | 
Computes the partial derivative of the Hamiltonian with respect to state, i.e., hx = dH/dx(t, x, u, lmd).
| [in] | t | Time. | 
| [in] | x | State. | 
| [in] | u | Concatenatin of the control input and Lagrange multiplier with respect to the equality constraints. | 
| [in] | lmd | Costate. | 
| [out] | hx | Evaluated value of the partial derivative of the Hamiltonian. | 
      
  | 
  inline | 
Computes the partial derivative of the Hamiltonian with respect to the state, i.e., hx = dH/dx(t, x, u, lmd).
| [in] | t | Time. | 
| [in] | x | State. Size must be nx. | 
| [in] | uc | Concatenatin of the control input and Lagrange multiplier with respect to the equality constraints. Size must be nuc. | 
| [in] | lmd | Costate. Size must be nx. | 
| [out] | hx | Evaluated value of the partial derivative of the Hamiltonian. Size must be nx. | 
      
  | 
  inline | 
Computes the partial derivative of terminal cost with respect to state, i.e., phix = dphi/dx(t, x).
| [in] | t | Time. | 
| [in] | x | State. | 
| [out] | phix | Evaluated value of the partial derivative of terminal cost. | 
      
  | 
  inline | 
Computes the partial derivative of terminal cost with respect to state, i.e., phix = dphi/dx(t, x).
| [in] | t | Time. | 
| [in] | x | State. Size must be nx. | 
| [out] | phix | Evaluated value of the partial derivative of terminal cost. Size must be nx. | 
      
  | 
  inline | 
Synchrozies the internal parameters of this OCP with the external references. This method is called at the beginning of each MPC update.
      
  | 
  friend | 
| double cgmres::OCP_pendubot::d1 = 0.15 | 
| double cgmres::OCP_pendubot::d2 = 0.257 | 
| std::array<double, nub> cgmres::OCP_pendubot::dummy_weight = {0.1} | 
| double cgmres::OCP_pendubot::g = 9.80665 | 
| double cgmres::OCP_pendubot::J1 = 0.006 | 
| double cgmres::OCP_pendubot::J2 = 0.051 | 
| double cgmres::OCP_pendubot::l1 = 0.3 | 
| double cgmres::OCP_pendubot::l2 = 0.3 | 
| double cgmres::OCP_pendubot::m1 = 0.2 | 
| double cgmres::OCP_pendubot::m2 = 0.7 | 
      
  | 
  staticconstexpr | 
Dimension of the equality constraints.
      
  | 
  staticconstexpr | 
Dimension of the Fischer-Burmeister function (already counded in nc).
      
  | 
  staticconstexpr | 
Dimension of the control input.
      
  | 
  staticconstexpr | 
Dimension of the bound constraints on the control input.
Dimension of the concatenation of the control input and equality constraints.
      
  | 
  staticconstexpr | 
Dimension of the state.
| std::array<double, 4> cgmres::OCP_pendubot::q = {1, 1, 0.1, 0.1} | 
| std::array<double, 4> cgmres::OCP_pendubot::q_terminal = {1, 1, 0.1, 0.1} | 
| std::array<double, 1> cgmres::OCP_pendubot::r = {0.1} | 
      
  | 
  staticconstexpr | 
| std::array<double, nub> cgmres::OCP_pendubot::umax = {5.0} | 
| std::array<double, nub> cgmres::OCP_pendubot::umin = {-5.0} | 
| std::array<double, 4> cgmres::OCP_pendubot::x_ref = {M_PI, 0, 0, 0} |