Expressions for QP matrices

4 vues (au cours des 30 derniers jours)
Elias Prytz
Elias Prytz le 26 Oct 2023
Réponse apportée : Ashok le 22 Août 2024
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 commentaire
Elias Prytz
Elias Prytz le 26 Oct 2023
Modifié(e) : Elias Prytz le 26 Oct 2023
I found this:
Still not tried the constraints. Please tell me if it looks correct

Connectez-vous pour commenter.

Réponses (1)

Ashok
Ashok le 22 Août 2024
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.

Catégories

En savoir plus sur Model Predictive Control Toolbox dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by