lfilipozzi / LTV-MPC

1 stars 0 forks source link

The issues about the parameter in code #1

Open cyh1996-china opened 3 years ago

cyh1996-china commented 3 years ago
/**
 * @brief Set the cost function in the problem formulation.
 * @param[in] Q The cost matrix on the states.
 * @param[in] R The cost matrix on the inputs.
 * @param[in] T The cost matrix on the states and inputs.
 * @param[in] fx The cost vector on the states.
 * @param[in] fu The cost vector on the inputs.
 */

Dear author: I wanna know what the cost matrix on the states and inputs. "T" means.

In matlab "quadprog", I only use the cost matrix Q and R.

I also wanna know what the cost function is when the cost matrix T is used.

lfilipozzi commented 3 years ago

Hello,

In this code, the optimization problem is formulated as follow: \min\limits_{(uk){k\in [0,N-1]}} \sum\limits_{k=0}^{N_p-1} x_k^T Q xk + \sum\limits{k=0}^{N_t-1} u_k^T T x_k + x_k^T T^T u_k + u_k^T R u_k\ s.t. x0 = x{init}\ x_{k+1} = A x_k + B uk\ u{min} \leq uk \leq u{max}\ A_x x_k + A_u \delta u_k \leq b

So the T matrix is used to introduce a cost that results from the coupling between the state x and input u. This is not a standard MPC formulation.

Also, I want to warn you that I created this repo to practice C++ coding and become familiar with some libraries like Eigen and qpOASES. I would not recommend using this project to do research. You can see that the last commit on this repo is pretty old. There are errors in the code. If you are looking for a free library to implement MPC, I would recommend using ACADO ( https://github.com/acado/acado) or acados (https://github.com/acados/acados). These two libraries have been tested more thoroughly, are extremely fast, and flexible.

I hope this helps you,

Best, Louis

Le mar. 15 juin 2021 à 02:30, cyh1996-china @.***> a écrit :

/**

  • @brief Set the cost function in the problem formulation.
  • @param[in] Q The cost matrix on the states.
  • @param[in] R The cost matrix on the inputs.
  • @param[in] T The cost matrix on the states and inputs.
  • @param[in] fx The cost vector on the states.
  • @param[in] fu The cost vector on the inputs. */

Dear author: I wanna know what the cost matrix on the states and inputs. "T" means.

In matlab "quadprog", I only use the cost matrix Q and R.

I also wanna know what the cost function is when the cost matrix T is used.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lfilipozzi/LTV-MPC/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH3RGUOIAO2D2ACUIWUTW7DTS4MUBANCNFSM46W37R2Q .