QP_MPC2QP – Conversion of MPC problem to quadratic programming
Block SymbolLicensing group: ADVANCED
Function Description
Quadratic Programming (QP) is a standard technique which suites very well to solve
model based predictive control (MPC) problems [10]. Quadratic Programming is
an optimization technique that minimizes the sum of quadratic form and linear
form.
The QP_MPC2QP block converts a linear MPC problem with quadratic optimization criterion to a quadratic programming problem. The block is compatible with the block QP_UPDATE and the QP solver QP_OASES.
MPC problem formulation
The MPC problem consists of a discrete linear time invariant state space model
xk+1=Axk+Buuk+Bvvk,yk=Cxk,(15.7)
where x∈ℝn is the state vector, u∈ℝmu is the input vector, v∈ℝmv is the disturbance vector and y∈ℝp is the output vector. Matrices A∈ℝn×n, Bu∈ℝn×mu, Bv∈ℝn×mv and C∈ℝp×n are referenced by inputs uA, uBu, uBv and uC. The model based predictive control problem is formulated as an optimization problem – minimization of the quadratic optimality criterion (cost function) in the form
J=np∑k=1{ˆxTkQˆxk+ˆxTkW+ûTk−1Rûk−1}, | (15.8) |
where symmetric and positive (semi-)definite matrices Q∈ℝn×n and R∈ℝmu×mu and the vector W∈ℝn are referenced by inputs uQ, uR and uW, and np is the prediction horizon (input np).
Additional constraints on the state x and the output y may be required for the minimization process:
xmin≤xk≤xmax(15.9)ymin≤yk≤ymax(15.10)For detailed derivation, see the PDF version of this manual.
Inputs
np | Prediction horizon ↓1 ↑1000000 | Long (I32) |
nc | Control horizon ↓1 ↑1000000 | Long (I32) |
uA | Input reference to system matrix A | Reference |
uBu | Input reference to input matrix Bu of control vector u | Reference |
uBv | Input reference to input matrix Bv of disturbance vector v | Reference |
uC | Input reference to output matrix C | Reference |
uQ | Input reference to symmetric matrix Q in cost function | Reference |
uW | Input reference to vector W in cost function | Reference |
uR | Input reference to symmetric matrix R in cost function | Reference |
ul | Input reference to integer index vector l | Reference |
uH | Input reference to Hessian matrix H | Reference |
uGx | Input reference to part of gradient vector G corresponding to state vector x | Reference |
uGv | Input reference to part of gradient vector G corresponding to disturbance vector v | Reference |
uGw | Intput reference to part of gradient vector G corresponding to vector W | Reference |
uSuL | Input reference to work matrix Su*L | Reference |
uSv | Input reference to work matrix Sv | Reference |
uT | Input reference to work matrix T | Reference |
uScuL | Input reference to work matrix Scu*L | Reference |
uScv | Input reference to work matrix Scv | Reference |
uTc | Input reference to work matrix Tc | Reference |
uWORK | Input reference to matrix WORK | Reference |
HLD | Hold | Bool |
Outputs
yA | Output reference to system matrix A | Reference |
yBu | Output reference to input matrix Bu of control vector u | Reference |
yBv | Output reference to input matrix Bv of disturbance vector v | Reference |
yC | Output reference to output matrix C | Reference |
yQ | Output reference to symmetric matrix Q in cost function | Reference |
yW | Output reference to vector W in cost function | Reference |
yR | Output reference to symmetric matrix R in cost function | Reference |
yl | Output reference to integer index vector l | Reference |
yH | Output reference to Hessian matrix H | Reference |
yGx | Output reference to part of gradient vector G corresponding to state vector x | Reference |
yGv | Output reference to part of gradient vector G corresponding to disturbance vector v | Reference |
yGw | Output reference to part of gradient vector G corresponding to vector W | Reference |
ySuL | Output reference to work matrix Su*L | Reference |
ySv | Output reference to work matrix Sv | Reference |
yT | Output reference to work matrix T | Reference |
yScuL | Output reference to work matrix Scu*L | Reference |
yScv | Output reference to work matrix Scv | Reference |
yTc | Output reference to work matrix Tc | Reference |
yWORK | Output reference to matrix WORK | Reference |
E | Error indicator | Bool |
[Previous] [Back to top] [Up] [Next]
2024 © REX Controls s.r.o., www.rexygen.com