3.4 Regularisation Procedure for Convex QPs
4.1.1 Algorithmic Description
qpOASES implements the online active set strategy for solving convex QPs. As described in Chapter 3, this strategy has been designed for solving QPs arising in MPC very efficiently. qpOASES solves instances of parametric QPs of the following
form: min x∈Rn 1 2x′Hx + x′g(w0) (4.1a) s. t. bB(w0) ≤ x ≤ bB(w0) , (4.1b) bC(w0) ≤ Gx ≤ bC(w0) , (4.1c)
with a positive semi-definite Hessian matrix H ∈ Sn
0, a gradient vector g(w0) ∈ Rn
and a constraint matrix G ∈ Rm×n. In order to fully exploit the problem structure,
the constraint formulation was kept more general than the one in Definition 2.5. Thus, qpOASES distinguishes between box constraints or bounds on the variables given by the vectors bB(w0), bB(w0) ∈ Rn and general constraints involving the
constraint matrix G and the vectors bC(w0), bC(w0) ∈ Rm. It is worth to stress
that qpOASES can also solve non-parametric QPs as its implementation uses the dependency of the QP data on w0 only implicitly.
The distinction between bounds and constraints can lead to substantial computa- tional savings (see Section 4.2) and is very natural in the MPC context: bounds on the control inputs also translate into bounds within the QP formulation, bounds and constraints on the outputs or the differential states lead to general constraints within the QP formulation.
qpOASESdistinguishes two different ways to solve a QP of the form (4.1): First, it can be solved by performing a cold-start, i.e. without any prior solution information. This is the usual situation if just a single QP is to be solved or if the QP is the first one of a whole sequence of parameterised QPs (as typically arising in MPC). Second, provided that a QP with same dimensions has been already solved before, the current QP can be solved by performing a hot-start based on the optimal solution and the internal matrix factorisations of the previously solved QP.
In both cases, each QP iteration of the online active set strategy requires one to solve the KKT system (3.6). The way this is done does only affect computational speed and accuracy but does not affect the iterates produced along the homotopy path. qpOASES solves the KKT system by means of a null space approach (see Section 2.3.1), though other choices would have been possible. We briefly outline its main concept.
First, the active constraints matrix is decomposed by a modified QR decomposition as proposed in [101]:
OVERVIEW OF THE SOFTWARE PACKAGE 49
where Z ∈ Rn×(n−|A|) forms an orthonormal basis of the null space of the active
constraints and T ∈ R|A|×|A| is a reverse lower triangular matrix. Second, the
Hessian matrix is projected to this null space and the resulting projected Hessian
matrix is then factorised by means of a Cholesky decomposition:
Z′HZ = R′R , (4.3)
where R ∈ R(n−|A|)×(n−|A|) is an upper triangular matrix. Once these two matrix
factorisations have been set up, they allow for an efficient solution of the KKT system (3.6) in O(n2) floating-point operations. In order to see this, we transform
the coordinates of the KKT system by the orthonormal matrix
Q 0
0 I|A|
. (4.4)
This yields the following transformed KKT system: R ′R Z′HY 0 Y′HZ Y′HY T′ 0 T 0 ∆x opt Z ∆xoptY −∆yAopt = −∆g−∆gYZ ∆bA , (4.5)
where the subscripts Y and Z indicate a projection onto the range and null space of the active constraints, respectively. This system of equations can now be solved using forward and backward substitutions with the triangular matrices T and R:
∆xoptY = T−1∆bA, (4.6a) ∆xoptZ = −R−1(R′)−1 ∆g Z+ Z′HY ∆xoptY , (4.6b) ∆yA = (T′)−1 ∆gY + Y′HZ∆xoptZ + Y ′HY ∆xopt Y . (4.6c)
Note that calculating these solutions can be further simplified by exploiting common subexpressions and other structural information. qpOASES actually solves an adapted variant of KKT system (3.6) to reflect the distinction between bounds and constraints (see [77] for more details).
The null space approach is particularly numerically stable and does not rely on a positive definite Hessian matrix. This facilitated the extension to convex QPs as presented in Section 4.3 and is also numerically advantageous for QPs comprising positive definite Hessian matrices with very small positive eigenvalues. However, this comes at the expense that iterations are more expensive (than ones of the range space approach) whenever the null space has high dimension, i.e. whenever only a few constraints are active. On the other hand, computational savings due to the distinction between bounds and constraints are “most readily achieved in null space methods” [87].
While moving along the homotopy path, the set of active constraints is modified by adding or removing a constraint in each iteration. However, it would be too expensive to re-compute the TQ factorisation and Cholesky decomposition in each iteration as they require O(n3) floating-point operations. Instead, in
order to compute the next step direction efficiently, these matrix decompositions are maintained after each change in the set of active constraints by means of
Givens plane rotations [105, 110]. They reduce the effort to O(n2) floating-point
operations per iteration. qpOASES implements updating routines specially tailored to the context where bounds and constraints are distinguished as proposed in [101].