Expressions for QP matrices

3 次查看(过去 30 天)
Elias Prytz
Elias Prytz 2023-10-26
回答: Ashok 2024-8-22
Does anynoe have expressions for H, f, A, b that is sent to the QP solver in mpcCustomSolver.m ? I am trying to find them for the aircraft example in https://se.mathworks.com/help/mpc/ug/aircraft-with-unstable-poles.html.
I can't quite make it out from the information in https://se.mathworks.com/help/mpc/ug/optimization-problem.html. For example it looks like (I am using the same notation as the mathworks I just mentioned)
but then what is ?
I haven't tried yet, but it looks like finding A and b might be easier.
  1 个评论
Elias Prytz
Elias Prytz 2023-10-26
编辑:Elias Prytz 2023-10-26
I found this:
Still not tried the constraints. Please tell me if it looks correct

请先登录,再进行评论。

回答(1 个)

Ashok
Ashok 2024-8-22
Hello Elias,
I understand that you are trying to use the “quadprog” function in the “Optimization Toolbox” to implement an MPC controller for a linearized aircraft model and facing difficulty in understanding the input matrices to the “quadprog” function, i.e., .
To implement a linear MPC controller using the “quadprog” function, firstly, a linear discrete time model of the plant is required. You can convert the continuous time aircraft model to a discrete time model using the “c2d” function. You can refer the link below for further details.
Though the derivation of the MPC matrices could take considerable effort, here is the general procedure to pose the MPC control problem as a QP (Quadratic Programming) problem. The cost function in MPC consists of 4 terms as shown below.
Here is the manipulated variable. The functions correspond to the costs associated with the output tracking, manipulated variable tracking, manipulated variable move suppression and constraint violation respectively. These variables are further explained in the below link.
The matrices are obtained by expanding the summations under each of cost functions and expressing the total cost in a matrix form suitable for QP (quadratic programming), which is
Here, z is a concatenated vector of the manipulated variable (column vectors) at each instant, i.e., where p is the prediction horizon.
You can leverage the capability of the “quadprog” function to accept inequality constraints, equality constraints as well as input bounds to formulate your problem effectively. You can find more about “quadprog” in the link below:
Further, the constraints, be it the ones associated with the outputs or the inputs, should also be converted into discrete time form. For the aircraft model mentioned in the link below, these are few additional suggestions from my end:
  • The only constraints mentioned are the controller constraints. These could be directly mentioned as the lower bound (lb) and upper bound (ub) in “quadprog”.
  • The aircraft control problem does not contain any soft constraint; hence you can drop the slack variables (ϵ) and the associated constraint violation cost, .
Hope this helps you in formulating your MPC/QP problem.

类别

Help CenterFile Exchange 中查找有关 Model Predictive Control Toolbox 的更多信息

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by