TuP11-4 An Algorithm for Multi-Parametric Quadratic Programming and Explicit MPC Solutions P. Tøndel1, T.A. Johansen1, A. Bemporad2

Abstract PWL solution to linear quadratic MPC problems is addressed in [11, 12], and efficient on-line computation schemes of ex- Explicit solutions to constrained linear MPC problems can plicit MPC controllers are proposed in [13]. This paper ex- be obtained by solving multi-parametric quadratic programs tends the theoretical results of [1], by analyzing several prop- (mp-QP) where the parameters are the components of the erties of the geometry of the polyhedral partition and its rela- state vector. We study the properties of the polyhedral parti- tion to the combination of active constraints at the optimum tion of the state-space induced by the multiparametric piece- of the quadratic program. Based on these results, we derive a wise linear solution and propose a new mp-QP solver. Com- new exploration strategy for subdividing the parameter space, pared to existing algorithms, our approach adopts a differ- which avoids (i) unnecessary partitioning, (ii) the solution to ent exploration strategy for subdividing the parameter space, LP problems for determining an interior point in each new avoiding unnecessary partitioning and QP problem solving, region of the parameter space, and (iii) the solution to the QP with a significant improvement of efficiency. problem for such an interior point. As a consequence, there is a significant improvement of efficiency with respect to the 1 Introduction algorithm of [1]. Our motivation for investigating multi-parametric quadratic programming (mp-QP) comes from linear Model Predictive 2 From Linear MPC to an mp-QP Problem Control (MPC). This refers to a class of control algorithms The main aspects of formulating a linear MPC problem as a that compute a manipulated variable trajectory from a lin- multi-parametric QP will, for convenience, be repeated here. ear process model to minimize a quadratic performance in- See [1] for further details. Consider the linear system dex subject to linear constraints on a prediction horizon. The first control input is then applied to the process. At the next x(t +1)=Ax(t)+Bu(t) (1) sample, measurements are used to update the optimization y(t)=Cx(t) problem, and the optimization is repeated. In this way, this becomes a closed-loop approach. There has been some limi- where x(t) ∈ Rn is the state variable, u(t) ∈ Rm is the input tation to which processes MPC could be used on, due to the variable, A ∈ Rn×n, B ∈ Rn×m and (A, B) is a control- computationally expensive on-line optimization which was lable pair. For the current x(t), MPC solves the optimization required. There has recently been derived explicit solutions problem to the constrained MPC problem, which could increase the area of use for this kind of controllers. Independent works T minU {J(U, x(t)) = x Pxt+N|t by [1], [2], [3] and [4] has reported how a piecewise linear P t+N|t + N−1 xT Qx + uT Ru } (PWL) solution can be computed off-line, while the on-line k=0 t+k|t t+k|t t+k t+k effort is limited to evaluate this PWL . In particu- s.t.ymin ≤ yt+k|t ≤ ymax,k=1, ..., N u ≤ u ≤ u ,k =0, ..., M − 1 lar, in [1] and [2] such a PWL function is obtained by treat- min t+k max (2) ing the MPC as a parametric program. ut+k = Kxt+k|t,M≤ k ≤ N − 1 Parametric programming is a term for solving an optimiza- xt|t = x(t) tion problem for a range of parameter values. One can dis- xt+k+1|t = Axt+k|t + But+k,k≥ 0 tinguish between parametric programs, in which only one yt+k|t = Cxt+k|t,k≥ 0 parameter is considered, and multi-parametric programs, in 0 which a vector of parameters is considered. The algorithm with respect to U , {ut, ..., ut+M−1},whereR = 0, reported in [1] is the only mp-QP algorithm known to the au- Q = Q0  0, P = P 0 0. When the final cost P and thors for solving general linear MPC problems, while single gain K are calculated from the algebraic Riccati equation, parameter parametric QP is treated in [5]. Multi-parametric under the assumption that the constraints are not active for LP (mp-LP) is treated in [6] and [7], mp-LP in connection k ≥ N, (2) exactly solve the constrained (infinite-horizon) with MPC based on is investigated in LQR problem for (1) with weights Q, R (see also [14], [15] [8], and multi-parametric mixed-integer linear programming and [16]). This and related problems can by some algebraic [9] is used in [10] for obtaining explicit solutions to hy- manipulation be reformulated as brid MPC. The problem of reducing the complexity of the 1 T 1 Vz(x(t)) = min z Hz (3) Department of Engineering Cybernetics, Norwegian Uni- z 2 versity of Science and Technology, 7491 Trondheim, Norway, [email protected], Tor.Arne.Johansen@itk. s.t. Gz ≤ W + Sx(t) (4) ntnu.no. 2   Dipartimento di Ingegneria dell’Informazione, University of Siena, z , U + H−1F T x(t) U = uT , ..., uT T 53100 Siena, Italy, [email protected]. ETH Zentrum, 8092 where , t t+M−1 ,and Zurich, Switzerland x(t) is the current state, which can be treated as a vector of

1199 parameters. Note that H 0 since R 0. The number of inequalities is denoted by q and the number of free variables X n n ×n q×n is nz = m · N. Then z ∈ R z , H ∈ R z z , G ∈ R z , q×1 q×n n×q R0 R0 W ∈ R , S ∈ R , F ∈ R . The problem we con- R1 sider here is to find the solution of the optimization problem (3)–(4) in an explicit form z∗ = z∗ (x(t)). Bemporad et. al. [1] showed that the solution z∗(x(t)) (and U ∗(x(t))) is a con- tinuous PWL function1 defined over a polyhedral partition of a) b) the parameter space, and Vz(x(t)) is a convex (and therefore continuous) piecewise quadratic function. R2

R0 R0 R3 3 Background on mp-QP R1 R1 As shown in [1], the mp-QP problem (3)-(4) can be solved R5 R4 by applying the Karush-Kuhn-Tucker (KKT) conditions CRi

T q Hz + G λ =0,λ∈ R , (5) c) d)  i i i λi G z − W − S x =0,i=1, ..., q, (6) Figure 1: State-space exploration strategy. λ ≥ 0, (7) Gz − W − Sx ≤ 0. (8) We have now characterized the solution to (3)-(4) for a given For ease of notation we write x instead of x(t). Superscript optimal active set A∗ ⊆{1,...,q},andafixedx.How- ∗ i on some matrix denotes the ith row. Since H has full rank, ever, as long as A remains the optimal active set in a neigh- (5) gives borhood of x, the solution (11) remains optimal, when z is ∗ z = −H−1GT λ (9) viewed as a function of x. Such a neighborhood where A is optimal is determined by imposing that z must remain feasi- Definition 1 Let z∗(x) be the optimal solution to (3)-(4) for ble (8) x a given . We define active constraints the constraints with GH−1G˜T (GH˜ −1G˜T )−1(W˜ + Sx˜ ) ≤ W + Sx., Giz∗(x) − W i − Six =0, and inactive constraints the con- (12) straints with Giz∗(x) − W i − Six<0.Theoptimal active ∗ and that the Lagrange multipliers λ must remain non- set A (x) is the set of indices of active constraints at the  negative (7) optimum A∗(x)= i | Giz∗(x)=W i + Six .Wealsode- fine as weakly active constraint an active constraint with an −(GH˜ −1G˜T )−1(W˜ + Sx˜ ) ≥ 0.. (13) associated zero λi, and as strongly ac- tive constraint an active constraint with a positive Lagrange Equations (12) and (13) describe a polyhedron in the state λi multiplier . space. This region is denoted as the critical region CR0 corresponding to the given set A∗ of active constraints, is Let λ˘ be the Lagrange multipliers of the inactive constraints, a convex polyhedral set, and represents the largest set of pa- ∗ λ˘ =0,andλ˜ the Lagrange multipliers of the active con- rameters x such that the combination A of active constraints straints, λ˜ ≥ 0. Assume for the moment that we know which at the minimizer is optimal [1]. constraints are active at the optimum for a given x. We can The recursive algorithm of [1] can be briefly summarized as i x now form matrices G,˜ W˜ and S˜ which contains the rows G , follows: Choose a parameter 0. Solve a QP to find the op- i i A x W and S corresponding to the active constraints. timal active set 0 for 0, and then use (10)-(13) to charac- terize the solution and critical region corresponding to A0. Definition 2 For an active set, we say that the linear inde- Then divide the parameter space as in Figure 1 by reversing pendence constraint qualification (LICQ) holds if the set of one by one the hyperplanes defining the critical region. Iter- atively subdivide each new region Ri in a similar way. The active constraint are linearly independent, i.e., G˜ main drawback of this algorithm is that the regions Ri are has full row rank. not related to optimality, as they can split some of the critical CR CR ˜ regions like 1 in Figure 1d. A consequence is that 1 Assume that LICQ holds, such that the rows of G are lin- will be detected at least twice. early independent. For the active constraints, (6) and (9) give The following theorem characterizes the primal and dual −GH˜ −1G˜T λ˜ − W˜ − Sx˜ =0 , which leads to parametric solutions, and will be useful in the sequel. λ˜ = −(GH˜ −1G˜T )−1(W˜ + Sx˜ ). (10) Theorem 1 Consider Problem (3)-(4) with H 0.Let X ∈ Rn z∗(x) Eq. (10) can now be substituted into (9) to obtain be a polyhedron. Then the solution and the Lagrange multipliers λ∗(x) of a mp-QP are piecewise lin- −1 T −1 T −1 x z∗(x) z = H G˜ (GH˜ G˜ ) (W˜ + Sx˜ ). (11) ear, functions of the parameters , and is continuous. Moreover, if LICQ holds for all x ∈ X, λ∗(x) is also contin- 1Strictly speaking “piecewise affine” would be a more appropriate term. uous.

1200 Proof: Follows easily from uniqueness (due to H 0 and Proof: Let us first prove Type I. In order for some constraint ∗ ∗ LICQ) of z (x) and λ (x), cf. [1], [17]. ij ∈{i1, ..., ik} not to be in the optimal active set in CRi,by continuity of λ∗ (x) (due to Theorem 1 and LICQ), it follows i that (λ∗)ij (x)=λ j (x)=0for all x ∈F. Since there 4 Characterization of the Partition 0 are no constraints which are weakly active for all x ∈ CR0, ∗ Below, we denote by zk (x) the linear expression of the PWL this would mean that constraint ij becomes non-active at F. ∗ function z (x) over the critical region CRk. But this contradicts the assumption of n-minimality since i j ik+1 ∗ ik+1 ik+1 λ0 (x) ≥ 0 and G z0 (x) ≤ W + S x would be Definition 3 Let a polyhedron X ⊂ Rn be represented by coincident. On the other hand {i1, ..., ik} can not be the op- th CR CR the linear inequalities A0x ≤ b.Letthei hyperplane, timal active set on i because 0 is the largest set of i i x {i , ..., i } A0x = b be denoted by H.IfX ∩His (n − 1)-dimensional ’s such that 1 k is the optimal active set. Then, the then X ∩His called a facet of the polyhedron. optimal active set in CRi is a superset of {i1, ..., ik}.Now assume that another constraint ik+2 is active in CRi.That ik+2 ∗ ik+2 ik+2 means G zi (x)=W + S x in CRi, and by con- Definition 4 Two polyhedra are called neighboring polyhe- tinuity of z∗ (x), the equality also holds for x ∈F.However, dra if they have a common facet. ik+2 ∗ ik+2 ik+2 G z0 (x)=W + S x would then coincide with ik+1 ∗ ik+1 ik+1 G z0 (x)=W + S x, which contradicts the as- Definition 5 Let a polyhedron X be represented by A0x ≤ sumption of n-minimality. Therefore, only {i1, ..., ik,ik+1} i i j j CR b. We say that A0x ≤ b is redundant if A0x ≤ b ∀j 6= i ⇒ can be the optimal active set in i. The proof for Type II is i i A0x ≤ b (i.e., it can be removed from the description of the similar. polyhedron). The inequality i is redundant with degree h if it is redundant and there exists a h-dimensional subset Y of Corollary 1 Consider the same assumptions as in Theorem i i n X such that A0x = b for all x ∈ Y . 2, except that the assumption of -minimality is relaxed into (n − 1)-minimality, i.e., two or more hyperplanes can coin- cide. Let I⊂{i1, ..., ik} be the set of indices corresponding Definition 6 A representation of a polyhedron (12)-(13) is to coincident hyperplanes in the (n − 1)-minimal representa- l-minimal if all redundant constraints have degree h ≥ l. tion of (12)-(13) of CR0. - Every constraint ij where ij ∈{i1,i2, ..., ik}\Iis active Clearly, a representation of a polyhedron X ⊂ Rn is n- in CRi. minimal if it contains all inequalities defining facets, and i i ∈{/ i ,i , ..., i }∪I does not contain two or more coincident hyperplanes. - Every constraint j where j 1 2 k is inactive in CRi. Let us consider a hyperplane defining the common facet be- tween two polyhedra CR0, CRi in the optimal partition of This means that every combination of the indices in I cannot the state space. There are two different kinds of hyperplanes. be excluded directly. We remark that coincident hyperplanes The first (Type I) are those described by (12), which repre- are rare, as from (12)-(13) one can see that special structures sents a non-active constraint of (4) that becomes active at the of H, F , G, W ,andS are required for two or more hyper- optimum as x moves from CR0 to CRi. As proved in the fol- planes to be coincident. Anyway, when for instance two hy- lowing theorem, this means that if a polyhedron is bounded perplanes are coincident, by Corollary 1 there are three pos- by a hyperplane which originates from (12), the correspond- sible active sets which have to be checked to find the optimal ing constraint will be activated on the other side of the facet active set in CRi. defined by this hyperplane. In addition, the corresponding Lagrange multiplier may become positive. The other kind Example 1. Consider the double integrator [3] (Type II) of hyperplanes which bounds the polyhedra are     1 T T 2 those described by (13). In this case, the corresponding con- A = s ,B= s straint will be non-active on the other side of the facet defined 01 Ts by this hyperplane. where the sampling interval Ts =0.05, and consider the MPC problem over the prediction horizon N =2with cost Theorem 2 Consider an optimal active set {i1,i2, ..., ik} 10 Q = R =1 and its corresponding n-minimal representation of the crit- matrices 00, . The constraints in the CR ical region 0 obtained by (12)-(13) after removing redun- system are −0.5 ≤ x2 ≤ 0.5, −1 ≤ u ≤ 1.Themp-QP CR dant inequalities. Let i be a full-dimensional neighboring associated with this problem has the form (3)-(4) with critical region to CR0 and assume LICQ holds on their com-     F = CR ∩H H 1.079 0.076 1.109 1.036 mon facet 0 where is the separating hyper- H = ,F= , plane between CR0 and CRi. Moreover, assume that there 0.076 1.073 1.573 1.517   are no constraints which are weakly active at the optimizer 10−100.05 0.05 −0.05 −0.05 z∗(x) x ∈ CR GT = , for all 0. Then, 01 0 −100.05 0 −0.05 ik+1 ∗ ik+1 ik+1 Type I. If H is given by G z0 (x)=W +S x,then CR {i , ..., i ,i } W T =[ 11110.50.50.50.5 ] ,ST = the optimal active set in i is 1 k k+1 .   ik 1.00.9 −1.0 −0.90.10.1 −0.1 −0.1 Type II. If H is given by λ0 (x)=0, then the optimal active set in CRi is {i1, ..., ik−1}. 1.41.3 −1.4 −1.3 −0.9 −0.90.90.9

1201 We start the partitioning by finding the region where no con- Such cases are referred to as degenerate. We will first con- sider how to handle cases where LICQ is violated, and then

0.5 0.5 consider weakly active constraints. ∗

2 CR 2 A ⊆ x 0 0 x 0 CR Theorem 3 Consider a generic combination H 1 1 {1,...,q} of active constraints and assume that the corre- −0.5 −0.5 [G˜ − S˜ − W˜ ] −2 −1 0 1 2 −2 −1.5 −1 −0.5 0 sponding rows are linearly independent. If (a) A = {} (b) A = {1} 0 1 LICQ is violated, then the corresponding critical region is 0.5 0.5 not full-dimensional. 2 2

x 0 x 0 CR 3 Proof: Let the active constraints be Gz˜ = Sx˜ + W˜ . ˜ −0.5 −0.5 Since LICQ is violated, G has not full rank and a reduced −2 −1.5 −1 −0.5 0 −2 −1.5 −1 −0.5 0 (c) A = A ⇒ A is rejected (d) A = {1,2} 2 0 2 3 set of equations can be defined without changing the solution 0.45 z∗(x) G0z = S0x + W 0 −0.1 : . Assume without loss of generality −0.2 that

2 CR 2 4 x 0.4 x −0.3       0 0 0 −0.4 ˜ G ˜ S ˜ W −0.5 G = k , S = k , W = k , (14) 0.35 G S W −2 −1.9 −1.8 −1.7 −1.6 −1.5 −1 −0.8 −0.6 −0.4 −0.2 0 (e) A = {1,6} (f) A = {1,7} ⇒ infeasibility 4 5 Gk Sk W k Figure 2: Critical regions for double integrator. where ,and are row-vectors and is a scalar. Let CR0 and CRg be the critical regions where the active sets corresponding to G0 and G˜, respectively, are optimal. z∗ (x)=z∗ (x)=Lx + v straints are active. As the mp-QP is created from a feasi- The solution is CR0 CRg within ble MPC problem, the empty active set will be optimal in CR0 CRg L = H−1G0T (G0H−1G0T )−1S0 ˜ ˜ ˜ both and ,where , some full-dimensional region (A0 = ∅,andG, W and S are −1 0T 0 −1 0T −1 0 g ∗ ∗ v = H G (G H G ) W . It is clear that CR ⊂ empty matrices, z (x)=0and the first component of U (x) h i z∗ (x) x ∈ Rn| G˜ − S˜ CRg = W˜ = M˜ is the unconstrained LQR gain). This critical region is then x and described by 0 ≤ W + Sx, which contains eight inequali-       ties. Two of these inequalities are redundant with degree 0 G0 −S0 Lx + v W 0 M˜ = x ∈ Rn| = (#2 and #4), the remaining six hyperplanes are facet inequal- Gk −Sk x W k ities of the polyhedron (see Figure 2a). By crossing the facet   H x ∈ Rn | G0Lx − S0x + G0v = W 0 given by 1, defined by inequality 1 and of Type I, as pre- = dicted by Theorem 2 the optimal active set across this facet is , (GkL − Sk)x + Gkv = W k (15) A1 = {1}, which leads to the critical region CR1 (see Figure  = x ∈ Rn | (GkL − Sk)x + Gkv = W k . 2b). After removing redundant inequalities we are left with a n-minimal representation of CR1 containing four facets. k k k k 1 G L 6= S G v 6= W M˜ The first of these is of Type II, λ (x)=0. The other three If or it follows that is n g are of Type I. These are inequalities #2, #6 and #7. Consider not a full-dimensional subspace of R , and since CR ⊂ 1 first the other side of the facet which comes from λ (x)=0, M˜ , neither is CRg. Suppose this does not hold, i.e., see Figure 2c. The region should not have constraint 1 ac- GkL = Sk and Gkv = W k.SinceG˜ has not tive, so the optimal active set is A2 = ∅. This is the same full rank, Gk = αG0,whereα is a row-vector, and combination of active constraints as A0, as expected, so A2 Sk = αG0H−1G0T (G0H−1G0T )−1S0 = αS0, W k = is not pursued. Next, consider crossing the respective facets 0 −1 0T 0 −1 0T −1 0 0 αG H G (G H G ) W = αW . Then, there is lin- of inequalities 2, 6 and 7, see Figures 2d–2f. This results in ear dependence between rows of G˜ −S˜ −W˜ , a con- three different active sets: A3 = {1, 2}, A4 = {1, 6} and tradiction. A5 = {1, 7}. A3 and A4 leads to new polyhedra as shown in the figures. The combination A5 leads to an interesting In an MPC problem one might avoid full-dimensional critical ˜ case of “degeneracy”. The associated matrix G has linearly regions with violation of LICQ by simply slightly perturbing dependent rows, which violates the LICQ assumption. In this the weight matrices and the constraints, without producing case, A5 leads to an infeasible part of the state space. A gen- significant changes of the closed-loop behavior. On the other eral treatment of degeneracy is given in the next section. hand, in some situations this may not be possible, for in- stance equality constraints such as terminal state constraints Theorem 2 and Corollary 1 show how to find the optimal ac- xt+N|t =0, would lead to violation of LICQ (cf. [5, Exam- tive set across a facet only by using the knowledge of which ple 6.3]). In such cases, full-dimensional critical regions can kind of hyperplane the facet corresponds to, except in degen- be handled by solving a QP, as in [18]. One should also a z erate cases, which is the topic of the next section. priori remove redundant constraints from [G − S][x ] ≤ W , which might remove linear dependence in [G˜ −S˜ −W˜ ],and 5 Degeneracy in mp-QP also would reduce the complexity of the mp-QP. We have so far assumed that LICQ holds on the common facet between two polyhedra, and that there are no constraints Next Theorem 4 provides a method to find the optimal active which are weakly active for all x within a critical region. set in a neighboring region also when LICQ is violated on the

1202 common facet. Before proceeding further, we need a techni- Theorem 5 Make the same assumptions as in Theorem 2, cal Lemma, which is proven in [18]. Since now on, when except that now constraint i1 is weakly active for all x ∈ ˜ ˜ ˜ we discuss matrices as G, S,orW or the active constraints CR0. λ˜ ik+1 ∗ ik+1 ik+1 , according to different active sets, we will use the notation Type I. If H is given by G z0 (x)=W + S x, ˜{i1,...,ik} G to mean the rows of the G matrix corresponding then the optimal active set in CRi is {i1, ..., ik,ik+1} or to the active set {i1, ..., ik},etc. {i2, ..., ik,ik+1}. ik Type II. If H is given by λ0 (x)=0, then the optimal active Lemma 1 Let the optimal active set in a critical region CR0 set in CRi is {i1, ..., ik−1} or {i2, ..., ik−1}. be {i1, ..., ik}, and consider an n-minimal representation of CR0. Assume that there are no constraints which are weakly x ∈ CR G˜{i1,...,ik} active for all 0 and that does not have lin- Example 1 (cont’d). We want to show how to handle the CR early dependent rows. Let i be a full-dimensional neigh- case when LICQ is violated at a facet. First, notice in Figure CR F boring critical region to 0, and let be their common 2 that the polyhedra made from A3 and A4 are neighboring F = CR ∩H H facet with 0 and is the Type I hyperplane polyhedra, but still there are two elements in A3 which are Gik+1 z∗ (x)=W ik+1 + Sik+1 x G˜{i1 ,...,ik,ik+1} 0 . Suppose different from A4. This is caused by a violation of LICQ has linearly dependent rows, such that LICQ is violated at on the hyperplane separating these regions. Assume we have F CR . Then, if there is a feasible solution in i, the optimal found CR3, and try to detect CR4. We cross a hyperplane active set in CRi consists of constraint ik+1 and some subset of Type 1, which defines their common facet F. This hy- of {i1, ..., ik}. perplane says that constraint 6 is becoming active at the op- timal solution for x ∈F. Since constraint 1 and 2 was ac- Theorem 4 Make the same assumptions as in Lemma 1. tive in CR3, constraints {1, 2, 6} are active at the optimal Consider the following LP: solution for x ∈F. This obviously leads to linear depen- ˜ i dence among the elements in G, and Theorem 4 is applied max λ k+1 (16) to find the optimal active set across F. A point x0 ∈Fis  T ˜{i1,...,ik,ik+1} {i1,...,ik,ik+1} needed to initialize the LP (16)-(18), and in this case we use s.t. Hz + G λ =0 (17) T x0 =[ −1.80.4 ] . We then solve the LP λ{i1,...,ik,ik+1} ≥ 0 (18) max λ6 (19)   If this LP has a bounded solution, the optimal active set in T i s.t.Hz + G˜{1,2,6} λ{1,2,6} =0,λ{1,2,6} > 0 CRi consists of the elements of {i1, ..., ik,ik+1} with λ j > (20) 0 CR in the solution. If the LP is unbounded, i is an infeasible   area of the parameter space.  T  T −1 From (11), Hz = G˜{1,2} G˜{1,2}H−1 G˜{1,2} · Proof: The solution z∗(x) to (5)-(8) on F is known from   ∗ ˜ {1,2} ˜{1,2} {1,2,6} the solution in CR0. The optimal Lagrange multipliers λ (x) W + S x0 , and the solution of (19) is λ = F on is then characterized by (17)-(18). The solution to (5)- 0.11 0 4.25 T 2 CR F λ∗(x) [ ] . Hence, λ should be removed from the (8) in i must also be valid on , in particular, i must CR {1, 6} satisfy (17)-(18) on F. From Lemma 1, the optimal active active set, and the optimal active set in 4 is ,asex- pected. Next, consider crossing the facet drawn as a thick set in CRi, consists of constraint ik+1 and a proper subset of segment in Figure 2f. The optimal active set in CR1 is {1}, {i1, ..., ik}. Therefore, there must be a solution on F which  ∗  ∗ and the inequality corresponding to the facet says that con- ik+1 ij 1 7 satisfies λi (x) > 0 and λi (x)=0for at least straint 7 is being activated. G and G are linearly depen- ik+1 dent, so LICQ is violated. We therefore solve the LP (16)- one ij ∈{i1, ..., ik}. With a fixed λ =0, (17) defines x =[ −0.28 −0.55 ]T max λ7 s.t. Hz + nz equations in k unknowns (nz ≥ k). But there exists a (18), with 0 : ,  T solution from CR0, such that a reduced set of equations can ˜{1,7} {1,7} {1,7} i G λ =0, λ > 0. The solution to this LP be defined with k equations in k unknowns. When λ k+1 ≥ 0, (17) consists of k equations in k +1unknowns, and λij = is unbounded and according to Theorem 4, we have reached i i i f j (λ k+1 ) for any ij ∈{i1, ..., ik},wheref j is an affine an infeasible part of the state space, which is easily verified. function. When λik+1 =0, the solution of (17)-(18) has i λ j > 0 for all ij ∈{i1, ..., ik} (due to n-minimality and x CR no weakly active constraints for all in 0). To find a 6 Off-Line Mp-QP Algorithm solution which satisfies Lemma 1, λik+1 must be increased i from zero until λ j =0for some ij ∈{i1, ..., ik}. This is the Based on the results of Sections 3, 4 and 5, we finally present only solution of (17)-(18) which satisfies Lemma 1 because an efficient algorithm for the computation of the solution to if λik+1 is increased further, λij = f ij (λik+1 ) < 0 (since f ij the mp-QP (3)-(4). Generally, there exist active sets which is an affine function). are not optimal anywhere in the parameter space (typically, most active sets are not optimal anywhere). We need an ac- tive set which is optimal in a full-dimensional region to start Constraints that are weakly active for all x in a critical region, the algorithm below. Generally we can do this by choos- can be handled according to the following result, which can ing a feasible x, and find the optimal active set for this x by be proven similarly to Theorem 2. solving a QP. A special case is when we solve a linear MPC

1203 Table 1: Computation times, double integrator example. lutions to MPC control problems. Being based on the ex- Hor. Alg. from [1] Alg. 1 #regions ploitation of direct relations between neighboring polyhedral 2 0.77 s 0.13 s 9 regions and combinations of active constraints, we believe 3 2.63 s 0.22 s 19 that our contribution significantly advances the field of ex- 4 5.60 s 0.38 s 33 plicit MPC control, both theoretically and practically, as ex- 5 9.01 s 0.65 s 51 amples have indicated large improvements over existing mp- QP algorithms. 6 16.48 s 1.06 s 73 References [1] A. Bemporad, M. Morari, V. Dua, and E. N. Pistikopoulos, problem. Then there will be a region where the unconstrained “The explicit linear quadratic regulator for constrained systems,” controller will be optimal, and we can choose the active set Automatica, to appear. A = ∅ 0 (see [8], Prop. 2). [2] A. Bemporad, M. Morari, V. Dua, and E. Pistikopoulos, “The Let Lcand be a list of active sets which are found, but not yet explicit linear quadratic regulator for constrained systems,” in Proc. explored (i.e., are candidates for optimality) and Lopt be the American Contr. Conf., (Chicago, IL), pp. 872–876, June 2000. set of active sets which have been explored (i.e., are found to [3] T. A. Johansen, I. Petersen, and O. Slupphaug, “Explicit sub- be optimal). opitmal linear quadratic regulation with input and state constraints,” in Proc. 39th IEEE Conf. on Decision and Control, (Sydney), 2000. Algorithm 1 [4] M. M. Seron, J. A. D. Don´a, and G. C. Goodwin, “Global analytical model predictive control with input constraints,” in Proc. Choose the initial active set A0 as in [8], Prop. 2; Let 39th IEEE Conf. on Decision and Control, (Sydney), 2000. Lcand ←{A 0}, Lopt ←∅; [5] A. Berkelaar, K. Roos, and T. Terlaky, “Advances in sensitiv- while Lcand 6= ∅ do ity analysis and parametric programming,” pp. [6–1]–[6–45], 1997. Pick an element A from Lcand. Lcand ← Lcand \{A}; [6] T. Gal, Postoptimal Analyses, Parametric Programming, and Build the matrices G˜, M˜ and S˜ from A and determine ˜ Related Topics. Berlin: de Gruyter, second ed., 1995. the local Lagrange multipliers, λ(x) and the solution [7] F. Borrelli, A. Bemporad, and M. Morari, “A geometric algo- z(x) from (10) and (9); rithm for multi-parametric linear programming,” Tech. Rep. AUT00- Find the CR where A is optimal from (12) and (13), and 04, Automatic Control Laboratory, ETH, 2000. find the (n-1)-minimal representation of CR; [8] A. Bemporad, F. Borrelli, and M. Morari, “Model predictive if CR is full-dimensional then control based on linear programming - the explicit solution,” Tech. Lopt ← Lopt ∪{A}; Report, ETH Zurich, AUT01-06, 2001. for each facet F in the (n-1)-dimensional representa- [9] V. Dua and E. Pistikopoulos, “An algorithm for the solution tion of CR do of multiparametric mixed integer linear programming problems,” Find the optimal active set on F by examining the Annals of Operations Research, to appear. type of hyperplane F is given by; [10] A. Bemporad, F. Borrelli, and M. Morari, “Piecewise linear Find any possible optimal active sets in CRi ac- optimal controllers for hybrid systems,” in Proc. American Contr. cording to Theorem 2, Corollary 1, Theorem 4 and Conf., (Chicago, IL), pp. 1190–1194, June 2000. Theorem 5. If none of these are applicable, one [11] T. A. Johansen, I. Petersen, and O. Slupphaug, “Explicit sub- optimal linear quadratic regulation with state and input constraints,” can find the active set in CRi by solving a QP as in [18]; SINTEF report STF72-A00303, 1999. [12] A. Bemporad and C. Filippi, “Suboptimal explicit MPC For any new active set Anew found, let Lcand ← L ∪{A } via approximate multiparametric quadratic programming,” in Proc. cand new 40th IEEE Conf. on Decision and Control, (Orlando, Florida), 2001. end for [13] F. Borrelli, M. Baotic, A. Bemporad, and M. Morari, “Ef- end if ficient on-line computation of explicit model predictive control,” in end while Proc. 40th IEEE Conf. on Decision and Control, (Orlando, Florida), 2001. Example 2. For comparing the efficiency of Algorithm 1 and [14] M. Sznaier and M. J. Damborg, “Suboptimal control of linear systems with state and control inequality constraints.,” Proc. 26th the algorithm of [1] we have repeated the double integrator Conf. Decision and Control., pp. 761–762, 1987. example from [1]. Some corrections for different CPU fre- 2 [15] D. Chmielewski and V. Manousiouthakis, “On constrained quency are made. Symmetries in the MPC problem are here infinite-time linear quadratic optimal control.,” Systems and Control exploited, almost halving the computation times.In this ex- Letters, vol. 29, pp. 121–129, 1996. ample more than 60% of the time is spent by both algorithms [16] P. Scokaert and J. B. Rawlings, “Constrained linear quadratic on removing redundant constraints from the polyhedra. This regulation.,” IEEE Trans. Automatic Control’, vol. 43, pp. 1163– is done by solving one LP for each hyperplane in each poly- 1169, 1998. hedron. [17] A. V. Fiacco, Introduction to sensitivity and stability analy- sis in . Orlando, FL: Academic Press Inc., 7 Conclusions 1983. [18] P. Tøndel, T. A. Johansen, and A. Bemporad, “An In this paper we have proposed a new approach for solving algorithm for multi-parametric quadratic programming and mp-QP problems giving off-line piecewise linear explicit so- explicit MPC solutions,” Tech. report 2001-7-W. Available at

2 http://www.itk.ntnu.no/ansatte/Johansen Tor.Arne/mpQPAlg.pdf, Both methods were implemented in MATLAB using the NAG Founda- 2001. tion Toolbox to solve LP/QP subproblems.

1204