Efficient evaluation of mp-MIQP solutions using lifting
11 Efficient evaluation of mp-MIQP solutionsusing lifting
Alexander Fuchs , Daniel Axehill , Manfred Morari
Abstract
This paper presents an efficient approach for the evaluation of multi-parametric mixed integerquadratic programming (mp-MIQP) solutions, occurring for instance in control problems involvingdiscrete time hybrid systems with quadratic cost. Traditionally, the online evaluation requires a se-quential comparison of piecewise quadratic value functions. As the main contribution, we introducea lifted parameter space in which the piecewise quadratic value functions become piecewise affineand can be merged to a single value function defined over a single polyhedral partition without anyoverlaps. This enables efficient point location approaches using a single binary search tree. Numericalexperiments include a power electronics application and demonstrate an online speedup up to an orderof magnitude. We also show how the achievable online evaluation time can be traded off against theoffline computational time.
Index Terms
Explicit MPC; Control of discrete time hybrid systems; Control of constrained systems
I. I
NTRODUCTION
A. Background and motivation
The main motivation for this work is control of discrete-time hybrid systems [1], [2], [3] usingModel Predictive Control (MPC) with quadratic cost [4], [5]. The paper considers the parametric
A. Fuchs is with the Research Centre for Energy Networks, Swiss Federal Institute of Technology (ETH), 8092 Zurich,Switzerland. E-mail: [email protected] .D. Axehill is with the Division of Automatic Control, Linköping University, 58183 Linköping, Sweden. E-mail:[email protected] .M. Morari is with the Automatic Control Laboratory, Swiss Federal Institute of Technology (ETH), 8092 Zurich, Switzerland.E-mail: [email protected] .
August 13, 2018 DRAFT a r X i v : . [ m a t h . O C ] J u l solution to the MPC problem, where the optimal control is computed offline for a set of initialstates to reduce the online computational effort [6], [7], [8]. For hybrid systems with quadraticcost, the offline computation then requires to solve a multi-parametric Mixed Integer QuadraticProgramming (mp-MIQP) problem [9]. Solutions to mp-MIQPs have been proposed based onthe solution of Mixed Integer Nonlinear Programming problems [10], on the enumeration of allswitching sequences [9], on dynamic programming [11], and on parametric branch and bound[12].For efficient evaluation, a parametric solution needs to be stored in a suitable data structure.The evaluation approaches in [13], [14], [15] are focused on solutions with non-overlappingpolyhedral partitions, which can be computed for mp-LP, mp-QP or mp-MILP problems [16].This covers the MPC problem classes of linear system with linear or quadratic cost and hybridsystems with linear cost. Efficient data structures for mp-MIQP problems, occurring for hybridsystems with quadratic cost, is the main topic of this paper and a more or less unexploredfield. The reason is that the solution is a pointwise minimizer of intersecting piecewise quadraticfunctions on overlapping polyhedral partitions. Therefore, the boundary between optimal regionsis not only defined by hyperplanes but also, in general, by quadratic surfaces. The approach in[17], [18] can be used with arbitrary functions defined on overlapping polyhedral partitions, butrequires an online sequential search to compare all of the potentially many overlapping valuefunctions defined for the given parameter vector. B. Contributions
The evaluation of mp-MIQP solutions defined over multiple overlapping polyhedral partitions is traditionally performed in two steps [9]. First, for each partition, the region containing theparameter vector is determined using a binary search tree [13]. Then, the optimal partition isdetermined using a sequential comparison of the value functions associated with the selectedregions.The main contribution in this paper is to show how mp-MIQP solutions can be lifted andthen merged to an equivalent piecewise affine function defined over a single polyhedral par-tition without overlaps . This has a direct impact on the online evaluation time, which can besignificantly reduced using a single search tree eliminating the need for the additional sequentialsearch.
August 13, 2018 DRAFT
The reason for the significant reduction of the evaluation time is that the complexity of asearch tree evaluation depends logarithmically on the number of regions in the partition. Asa result, the evaluation of a single larger search tree for the merged partition requires feweroperations than the evaluation of multiple search trees and the sequential function comparisonfor the original partitions.The merging of the lifted partitions can be performed with a standard method for mp-MILPsolutions [16]. Using the proposed lifting procedure, the method becomes available for anymp-MIQP solution represented by piecewise quadratic functions over overlapping polyhedralpartitions. This means that the merging can immediately be combined with any of the above listedsolution methods for mp-MIQP problems, and also to suboptimal solutions as those computedby the algorithm in [12].A second contribution of this paper is a new partial merging algorithm. It enables a trade-offbetween the online and offline complexity of the evaluation of both mp-MILP and mp-MIQPsolutions.
C. Paper organization
The remainder of the paper is organized as follows. Section II defines the evaluation problemof mp-MIQP solutions. Section III introduces a lifting procedure and a reformulation of themp-MIQP solution which enables efficient online evaluation and is the main result of the paper.Section IV presents the offline and online algorithm for the evaluation of mp-MIQP solutionsand their complexity. Section V introduces an algorithm that enables a trade-off between theoffline and online complexity for the evaluation of mp-MILP and mp-MIQP solutions. Section VIapplies the algorithms to three mp-MIQP examples, showing a reduction of the online evaluationtime up to an order of magnitude compared to the traditional evaluation approach. Section VIIconcludes the paper. II. E
VALUATION PROBLEM FORMULATION
This section introduces the definitions used to characterize mp-MIQP solutions and states thecorresponding evaluation problem.
August 13, 2018 DRAFT
A. Definitions
Definition 1. A polyhedron P in R n , is an intersection of a finite number of half-spaces, givenin inequality form with H ∈ R m × n and K ∈ R m as P = { x ∈ R n : Hx ≤ K } . (1) Definition 2.
Two polyhedra P and P in R n are called overlapping when they have commoninterior points, i.e. ∃ x ∈ R n : H x < K , H x < K . (2) Definition 3. A polyhedral set P in R n is a finite collection P = { P , P , ..., P N } of | P | = N polyhedra in R n . The i ’th polyhedron is referred to as P [ i ] = P i . Definition 4. A polyhedral partition P in R n is a polyhedral set in R n whose polyhedra are notoverlapping. Definition 5.
The index set I P ( x ) of a polyhedral set P with N elements in R n , and a vector x ∈ R n is given by I P ( x ) = { i ∈ { , , ..., N } : x ∈ P [ i ] } . (3) Definition 6. A set of quadratic functions J in R n is a finite collection J = { J ( · ) , J ( · ) , ..., J N ( · ) } , J i : R n → R , J i ( x ) = x T A i x + B Ti x + C i , (4) with A i = A Ti ∈ R n × n , B i ∈ R n and C i ∈ R . The i ’th quadratic function of J is referred to as J [ i ]( · ) = J i ( · ) . If all A i are zero matrices, J is referred to as set of affine functions . Definition 7. A piecewise quadratic function J P , J ( · ) in R n over a polyhedral set P in R n witha set of quadratic functions J in R n is a map J P , J : R n → R , J P , J ( x ) = min i ∈I P ( x ) J [ i ]( x ) . (5) If J is a set of affine functions, J P , J ( · ) is referred to as piecewise affine function .B. Evaluation problem for mp-MIQP solutions The definitions in Section II-A are used to characterize mp-MIQP solutions:
August 13, 2018 DRAFT
Lemma 1.
The value function of an mp-MIQP problem can be represented as a piecewisequadratic function. The value function of an mp-MILP problem can be represented as a piecewiseaffine function.Proof.
See, for instance, [9]. The polyhedral set P then consists of multiple overlapping poly-hedral partitions, each corresponding to a fixed value of the problem’s integer variables.The evaluation problem of mp-MIQP solutions requires the solution to the minimizationproblem in (5), which is a point location problem in combination with pairwise comparisons ofquadratic functions: Definition 8. (PL-MIQP) : Given a piecewise quadratic function J P , J ( · ) and a vector x in R n ,determine an index i ∗ ∈ I P ( x ) such that ∀ i ∈ I P ( x ) : J [ i ∗ ]( x ) ≤ J [ i ]( x ) . (6) If J P , J ( · ) is a piecewise affine function, the problem is referred to as (PL-MILP) . In words, among the polyhedra containing the vector, identify the one with the smallestassociated function value.
Remark 1.
The solution of (PL-MIQP) allows to extract the mp-MIQP optimizer associatedwith the optimal region index i ∗ of the given parameter vector x . It also yields the evaluatedvalue function, J P , J ( x ) = J [ i ∗ ]( x ) . (7)III. L IFTING MP -MIQP
SOLUTIONS
This section presents a lifting procedure for piecewise quadratic functions, which is the maincontribution of the paper. It shows that mp-MIQP value functions have an equivalent piecewiseaffine representation, thereby enabling efficient evaluation schemes.
A. Motivation of the lifting procedure
The Multi Parametric Toolbox (MPT) [16] provides algorithms to construct data structures forthe efficient solution of problem (PL-MILP). For that case, the description of the piecewise affinefunction J P , J ( · ) is merged to a function defined over a single polyhedral partition, enabling the August 13, 2018 DRAFT construction of a binary search tree [13] for fast online evaluation. These algorithms can howevernot be directly applied to solve (PL-MIQP), the case with quadratic terms, since J P , J ( · ) is then anon-convex piecewise quadratic function defined on regions that, in general, are partially definedby quadratic boundary constraints.It will now be shown how an mp-MIQP solution can be lifted to a piecewise affine formulationin a higher dimensional parameter space. The lifted formulation after this transformation is shownto be equivalent to the original formulation. Furthermore, the lifted formulation has the structureof an mp-MILP solution, making the standard state-of-the-art methods designed for (PL-MILP)problems available to (PL-MIQP) problems. B. Definition of the lifting procedure
Definition 9.
The lifting transformation L ( · ) of R n , is defined as L : R n → R l , l = n + 3 n , (8) L ( x ) = [ x , x , ..., x n , x , x x , ..., x x n ,x , x x , ..., x x n , ..., x n ] T . (9) Definition 10.
Given a polyhedral set P in R n , the lifted polyhedral set P l = L P ( P ) in R l , l = ( n + 3 n ) / , is defined as ∀ i ∈ { , ..., | P |} : P l [ i ] = (cid:8) y ∈ R l : [ H i , ] y ≤ K i (cid:9) (10) where ( H i , K i ) are the matrices defining P [ i ] = { x ∈ R n : H i x ≤ K i } (11) and denotes the zero matrix of appropriate dimensions. Remark 2.
Through the lifting, the polyhedra P [ i ] are extended along the dimensions of thelifted space corresponding to the bilinear terms in (9). The lifting of the polyhedra does not addconstraints or change the structure of their projection on the original n dimensions. Definition 11.
Given a set of quadratic functions J in R n , the lifted set of affine functions J l = L J ( J ) in R l , l = ( n + 3 n ) / , is defined as August 13, 2018 DRAFT ∀ i ∈ { , ..., | J |} : J l [ i ] : R l → R , J l [ i ]( y ) = D Ti y + E i , (12) where D i = [ B i, , B i, , ..., B i,n , A i, , A i, , ..., A i, n ,A i, , A i, , ..., A i, n , ..., A i,nn ] T , (13) E i = C i , (14) are the rearranged parameters of the quadratic functions J [ i ]( x ) = x T A i x + B Ti x + C i .C. Properties of lifted mp-MIQP solutions The following results show the equivalence of piecewise quadratic functions and the corre-sponding lifted piecewise affine functions.
Lemma 2.
Given a polyhedral set P in R n , the lifting transformation L ( · ) , and the liftedpolyhedral set P l = L P ( P ) , it holds that ∀ x ∈ R n : I P ( x ) = I P l ( L ( x )) . (15) Proof. ∀ x ∈ R n , ∀ i ∈{ , ..., | P |} : i ∈ I P ( x ) ↔ x ∈ P [ i ] ↔ H i x ≤ K i ↔ [ H i , ][ x T , x , x x , ..., x n ] T ≤ K i ↔ L ( x ) ∈ P l [ i ] ↔ i ∈ I P l ( L ( x )) Lemma 3.
Given a set of quadratic functions J in R n , the lifting transformation L ( · ) , and thelifted set of affine functions J l = L J ( J ) , it holds that ∀ x ∈ R n , ∀ i ∈ { , ..., | J |} : J [ i ]( x ) = J l [ i ]( L ( x )) . (16) August 13, 2018 DRAFT
Proof. ∀ x ∈ R n , ∀ i ∈ { , ..., | P |} : J [ i ]( x ) = x T A i x + B Ti x + C i = B i, x + ... + B i,n x n + A i, x + 2 A i, x x + ... + 2 A i, n x x n + A i, x + 2 A i, x x + ... + 2 A i, n x x n + ... + A i,nn x n + C i = D Ti L ( x ) + E i = J l [ i ]( L ( x )) Theorem 1.
Given a piecewise quadratic function J P , J ( · ) in R n , a lifting transformation L ( · ) and the lifted sets P l = L P ( P ) and J l = L J ( J ) , the piecewise affine function J P l , J l ( · ) satisfies ∀ x ∈ R n : J P , J ( x ) = J P l , J l ( L ( x )) . (17) Proof. ∀ x ∈ R n : J P , J ( x ) = min i ∈I P ( x ) J [ i ]( x ) (Lemma 2) = min i ∈I P l ( L ( x )) J [ i ]( x ) (Lemma 3) = min i ∈I P l ( L ( x )) J l [ i ]( L ( x ))= J P l , J l ( L ( x )) . Remark 3.
The construction of the lifted piecewise affine function J P l , J l ( · ) is computationallyinexpensive. Both the polyhedral set P l and the set of affine functions J l require only arearrangement of the data representing the original piecewise quadratic function J P , J ( · ) . August 13, 2018 DRAFT
Remark 4.
Since Theorem 1 states that value functions of mp-MIQP problems can be representedas equivalent piecewise affine functions J P l , J l ( · ) , algorithms for efficient evaluation of mp-MILPsolutions, such as [16], [13], can now be directly applied. IV. E
VALUATION OF MP -MIQP
SOLUTIONS
The proposed offline procedure to prepare the evaluation of mp-MIQP solutions, stated asproblem (PL-MIQP) in Definition 8, is summarized as Algorithm 1. All lines of Algorithm 1 useexisting algorithms available in the Multi-Parametric Toolbox [16] in MATLAB, except for thelifting operation in line two. The algorithms and their complexity are discussed in the followingfour subsections. Subsection IV-E then discusses the online evaluation and its complexity.
Algorithm 1 P REPARE E VALUATION ( P , J ) Require: set of polyhedral partitions P , set of quadratic functions J Ensure: binary search tree T ( P r , J r ) ← R EDUCE ( P , J ) ( P l , J l ) ← ( L P ( P r ) , L J ( J r )) ( P , J m ) ← M ERGE ( P l , J l ) T ← T REE ( P ) A. Overlap reduction
A piecewise quadratic function J P , J ( · ) in R n may contain regions P [ i ] whose associatedquadratic function value J [ i ]( x ) is never minimizing the expression in (5) for any vector x ∈ P [ i ] .These regions can be identified and removed using the algorithm in [19], denoted by R EDUCE in the first line of Algorithm 1. For N initial polyhedra in P , R EDUCE solves up to N indefinitequadratic programs with n variables to identify the reduced polyhedral set P r and the associatedquadratic functions J r . The complexity can be reduced using several heuristics. Since line threeof Algorithm 1 also removes redundant regions, the application of R EDUCE could be omittedbut serves as a preprocessing step to improve performance.
August 13, 2018 DRAFT0
B. Lifting
The second line of Algorithm 1 applies the lifting operation to the | P r | polyhedra and quadraticfunctions of ( P r , J r ) , as defined in Definitions 10 and 11. As pointed out in Remark 3, this is aformal rearrangement of the internal data representation and requires no additional computations. C. Merging
The third line of Algorithm 1 removes the region overlaps of the piecewise affine function J P l , J l ( · ) in R l , defined by the lifted polyhedral set and the set of affine functions ( P l , J l ) . Thealgorithm M ERGE is shown as pseudocode in Algorithm 2, based on the implementation in[16]. It provides a single polyhedral partition P and a set of affine functions J m , defining theequivalent piecewise affine function J P , J m ( · ) in R l . Since the regions of P do not overlap, afunction value comparison is no longer necessary and the original (PL-MIQP) reduces to a purepoint location problem in the partition P .Essentially, Algorithm 2 loops through all polyhedra P [ i ] and collects a polyhedral set Q ,covering the subset of P [ i ] where the function J [ i ]( · ) is not the minimizer of all overlappingfunctions in J . Consequently the set difference D = P [ i ] \ Q is the portion of P [ i ] where thefunction J [ i ]( · ) is the minimizer of all overlapping functions in J .The construction of Q inside the two for-loops requires less than | P | feasibility checks ofpolyhedra. The central and most expensive part of Algorithm 2 is the set difference operationR EGION D IFF , called | P | times in line ten. A pessimistic upper bound on the number of LPssolved by R EGION D IFF is given in [20]. The bound is exponential in the dimension of Q , withthe total number of constraints of all polyhedra as base.The lifting of mp-MIQP solutions to R l , as in Definition 9, practically squares the problemdimension compared to mp-MILP solutions in the original parameter space R n . The exponentialbound on the number of LPs solved by R EGION D IFF suggests that merging lifted mp-MIQPsolutions is much more expensive than merging mp-MILP solutions with a similar polyhedralstructure. However, numerical experiments indicate that the total complexity of Algorithm 2 withaffine or lifted quadratic functions is similar. The reason is that in the case with lifted quadraticfunctions, only very few constraints of Q , originating from the | Q | function differences in linefive of Algorithm 2, actually spread along the bilinear dimensions. In other words, because ofthe special structure of the lifting procedure, only a small amount of additional complexity is August 13, 2018 DRAFT1
Algorithm 2 M ERGE ( P , J ), [16] Require: polyhedral set P , set of affine functions J Ensure: polyhedral partition P ,set of affine functions J m P ← ∅ , J m ← ∅ for i ∈ { , ..., | P |} do Q ← ∅ for j ∈ { , ..., | P |} , j (cid:54) = i do Q ← { x ∈ ( P [ i ] ∩ P [ j ]) : J [ i ]( x ) ≥ J [ j ]( x ) } if Q (cid:54) = ∅ then Q ← [ Q , Q] end if end for D ← R EGION D IFF ( P [ i ] , Q ) if D (cid:54) = ∅ then P ← [ P , D ] for k ∈ { , ..., |D|} do J m ← [ J m , J [ i ]( · )] end for end if end for introduced to M ERGE when applied to a lifted problem (PL-MIQP) compared to a problem(PL-MILP) with the same underlying polyhedral set.
D. Search tree construction
After the merging, the solution of a problem (PL-MIQP) reduces to a point location in a singlepolyhedral partition P . An efficient solution is the construction of a binary search tree, denotedby T REE in line four of Algorithm 1.An algorithm to construct a binary tree using the polyhedra’s hyperplanes as decision criteriais given in [13]. The method uses heuristics to obtain a balanced tree. A central part of the
August 13, 2018 DRAFT2 algorithm is the preprocessing step that determines the relative position of every polyhedron andeach of the n h hyperplanes of the partition, solving up to n h |P| LPs. Constructing a tree thatis guaranteed to have minimum depth might require the solution of an MILP with up to |P| binary variables for each node of the tree [21]. The method can also be generalized to trees withmore than two children [22], which are particularly suitable for an implementation with multipleprocessors.Neither n h nor |P| are directly increased through the additional dimensions from the lifting.In other words, only little additional complexity is introduced to T REE when solving a liftedproblem (PL-MIQP) instead of a problem (PL-MILP) with a similar underlying polyhedral set.
E. Online evaluation
After the preparation with Algorithm 1, the solution of a problem (PL-MIQP) with a polyhedralset P , a set of quadratic functions J and a vector x in R n reduces to the evaluation of the binarytree T . The evaluation is a sequence of vector multiplications [13] that needs to be applied tothe lifted vector y = L ( x ) , defined in (8). It is denoted by i ∗ ← E VALUATE T REE ( T , y ) (18)and returns the index of the optimal region P [ i ∗ ] . For mp-MIQP solutions, each region has anassociated control law that can now be extracted. A balanced binary tree can execute pointlocation queries in log ( |P| ) tree node decisions, where P is denoting the polyhedral partitionafter the merging [13].It is of interest how the online evaluation complexity of mp-MIQP solutions compares withand without the preparation through the lifting and merging procedure in Algorithm 1. WhileSection VI shows a numerical assessment with concrete examples, a basic comparison is obtainedas follows. Consider a piecewise quadratic function J P , J ( · ) in R n defined over n part partitions,with the same number of m polyhedra in each partition. Without Algorithm 1, each of the n part partitions is evaluated with a separate search tree [9]. The total number of online operations forthe tree evaluations then is N ops , no merging = n part · K · log ( m ) , (19)where K , the number of arithmetic operations per tree node decision, grows linearly with theproblem dimension n . Additionally, n part operations are required to find the optimal partition. August 13, 2018 DRAFT3
In comparison, using Algorithm 1, the fully merged partition P is evaluated with a single tree,requiring N ops , merging = K · log ( |P| ) (20)operations. The factor K is slightly larger than K , depending on the ratio of tree decisionsinvolving the lifted dimensions, n + 1 to l . It follows that a reduction of the online complexitythrough the lifting and merging is given whenever N ops , merging < N ops , no merging , (21) ↔ |P| < m K · n part K ≈ m n part . (22)For mp-MIQP solutions to practical problem instances, one often obtains |P| (cid:28) m n part , leading toa significant improvement of the evaluation time when using the lifting and merging procedure.This is also confirmed by the examples in Section VI.V. P ARTIAL MERGING OF MP -MIQP
SOLUTIONS
This section presents a modification of lines three and four in Algorithm 1 that allows tochoose a trade-off between offline and online complexity. It can be used for both mp-MIQP andmp-MILP solutions.
A. Pairwise partition merging
If the offline preparation using Algorithm 1 can not be completed within the available offlinecomputational time, it is still possible to improve the online evaluation time by partially mergingthe solution’s partitions. To define the partial merging algorithm, the partition structure ofmp-MIQP solutions is characterized using the following additional definitions. In words, eachpolyhedron of the polyhedral set P is assigned to one of the partitions of the mp-MIQP solution. Definition 12. A partition index I for n part partitions, associated with a polyhedral set of N elements, is given by I = { s , s , ..., s N } , s i ∈ { , , ..., n part } . (23) Definition 13.
The index set of the k ’th polyhedral partition for a partition index I with N elements is given by I I ( k ) = { i ∈ { , , ..., N } : I [ i ] = k } . (24) August 13, 2018 DRAFT4
Definition 14.
The elements of a polyhedral set P and a set of functions J corresponding to anindex I = { i , i , ... } are denoted by P [ I ] = { P [ i ] , P [ i ] , ... } and J [ I ] = { J [ i ]( · ) , J [ i ]( · ) , ... } . The partial merging algorithm M
ERGE P AIRWISE is given in Algorithm 3 and replaces linethree in Algorithm 1. It runs n m iterations, each of which merges pairs of polyhedral partitions,using M ERGE , as defined in Algorithm 2. The associated affine function set J can originatedirectly from an mp-MILP solution or from a lifted mp-MIQP solution. Line nine then assignsthe number of the merged partition, k , to all elements of the corresponding new partition index.The complexity of each function call of M ERGE depends on the number of polyhedral constraintsof its argument and grows with the number of iterations n m , which can therefore be used toselect the offline complexity of Algorithm 3.The selection of the pairing through the partition index in line six of Algorithm 3 is arbitrary.It can be adjusted to consider generalized polyhedral subsets, as long as they cover the fullpolyhedral set P . A greedy heuristic to obtain a small polyhedral set P m is to execute M ERGE -P AIRWISE repeatedly with different permutations of the partition index I , keeping the one thatyields the smallest | P m | .After the partial merging of the partitions, the tree construction in line four of Algorithm 1 mustbe performed for each one of the remaining partitions. The corresponding algorithm M ULTI T REE is defined in Algorithm 4.
B. Online evaluation
For partially merged mp-MIQP solutions, the optimal region is analogously to the traditionallook-up methods determined using a standard two step procedure [9], which is denoted byE
VALUATE M ULTI T REES and shown as pseudocode in Algorithm 5. After first evaluating thebinary trees in line five of Algorithm 5, the corresponding value function values are comparedto determine the index of the optimal region. If the evaluation of the n t = | T | trees requires N ops ,i scalar operations for the i ’th tree, a total of N ops = ( l + 1) n t + n t (cid:88) i =1 N ops ,i (25)operations are required for the online evaluation of the mp-MIQP solution. This includes ad-ditions, multiplications and comparisons. The first term in (25) accounts for the value function August 13, 2018 DRAFT5
Algorithm 3 M ERGE P AIRWISE ( P , J , I , n m ) Require: polyhedral set P , set of affine functions J , partition index I , number of mergingiterations n m Ensure: polyhedral set P m , set of affine functions J m , reduced partition index I m ( P m , J m , I m ) ← ( P , J , I ) while n m > do k ← while k < max( I m ) / do k ← k + 1 , I k ← ∅ I ← [ I I (2 k − , I I (2 k )] ( P k , J k ) ← M ERGE ( P m [ I ] , J m [ I ]) for i ∈ { , ..., |P k |} do I k [ i ] ← k end for end while P m ← [ P , ..., P k ] J m ← [ J , ..., J k ] I m ← [ I , ..., I k ] n m ← n m − end whileAlgorithm 4 M ULTI T REE ( P , I ) Require: polyhedral set P , partition index I , Ensure: set of search trees T , for i ∈ { , ..., max( I ) } do T i ← T REE ( P [ I I ( i )]) end for T = [ T , T , ..., T max( I ) ] August 13, 2018 DRAFT6 comparisons in line six of Algorithm 5 in the l -dimensional lifted space. The number N ops ,i is the maximum number of operations for a single execution of E VALUATE T REE . It dependslogarithmically on the size of the polyhedral partition and corresponds to the term K · log ( m ) of the basic complexity estimate in (19). Algorithm 5 E VALUATE M ULTI T REES ( T , J , I , x ) Require: set of search trees T , set of functions J , partition index I , vector x Ensure: optimal index ( i ∗ , j ∗ ) y ← L ( x ) J ∗ ← ∞ for i ∈ { , ..., max( I ) } do J i ← J [ I I [ i ]] j ← E VALUATE T REE ( T [ i ] , y ) if J i [ j ]( x ) < J ∗ then J ∗ ← J i [ j ]( x ) ( i ∗ , j ∗ ) ← ( i, j ) end if end for VI. N
UMERICAL EXPERIMENTS
In this section, the proposed approach to evaluate mp-MIQP solutions is applied to threeexample cases. First, a simple artificial problem illustrates Algorithm 1. Second, control of asimple PWA system shows the potential reduction of online complexity. Finally, the algorithm isapplied to a recent approach for controlling DC-DC converters, showing the trade-off betweenonline and offline complexity in an industrially relevant application.
A. Illustrative 1D example
This section illustrates the steps of Algorithm 1 using an artificial 1D-example of two over-lapping polyhedra P = {| x | ≤ , | x | ≤ } with corresponding intersecting quadratic functions J = { x + 1 , x } , shown in Fig. 1. After the lifting operation in line two of Algorithm 1, thepolyhedra P l and the functions J l are defined over the space { x, x } , but still intersect (Fig. 2). August 13, 2018 DRAFT7 x J -3 -2 -1 0 1 2 3024681012141618 Fig. 1. Illustrative example: Two overlapping polyhedra P (bold lines) with corresponding intersecting quadratic functions J (thin curves). The M
ERGE operation in line three of Algorithm 1 then provides a single partition with nooverlaps and the corresponding piecewise affine function J m (Fig. 3). It is now possible to builda binary search tree for the merged partition. B. 2D PWA Example
The PWA system given by equation (44) in [3] has two dynamic states, one input, two differentdynamics and box constraints on states and input. The system is controlled using a finite horizonformulation with the penalty matrices Q = R = 1 . (26)Fig. 4 shows the total number of online operations N ops , defined in (25), as a function of theprediction horizon N . Lifting and merging the solution reduces N ops by more than an order ofmagnitude. The factor increases with the prediction horizon. In particular, the evaluation of themerged mp-MIQP solution with a prediction horizon N = 6 is still faster than the traditionalapproach with N = 1 . As shown in Table I, the merging operation increases the total number of August 13, 2018 DRAFT8 y = xy = x J l -2 0 2-505-10010 Fig. 2. Illustrative example: The lifted functions J l are affine. y = xy = x J m -2 0 2-505-10010 Fig. 3. Illustrative example: Functions J m after merging. August 13, 2018 DRAFT9 N N op s no merging (traditional)completely merged Fig. 4. 2D PWA system: Number of online operations N ops with different predictions horizons N , using traditional approach(dashed) and Algorithm 1 (solid) . polyhedra n p , thereby also increasing the size of the resulting search tree. The number floatingpoint numbers stored in the search trees, n store , determines the memory footprint of the controllaw. For N = 6 , the merging operation causes n store to increase by a factor of six, compared tothe traditional approach without merging. N n t n p
12 47 100 168 221 322 n store
24 174 360 666 813 1248complete merging ( n t = 1 ) n p
12 87 208 587 650 1560 n store
33 366 780 2718 2487 7395TABLE I2D PWA
SYSTEM : NUMBER OF PARTITIONS n t , NUMBER OF POLYHEDRA n p , AND NUMBER OF FLOATING POINT VALUESSTORED IN THE TREE ( S ) n store , FOR DIFFERENT PREDICTION HORIZONS N . August 13, 2018 DRAFT0
C. 5D DC-DC converter example
A recent approach to the control of DC-DC converters [23] uses a mixed logical dynamicalsystem formulation to compute an explicit receding horizon control policy. The equivalent for-mulation as PWA system has five states, one input, three different dynamics and box constraintson states and inputs. In [23], the system has been controlled using a 1-norm stage cost || Qx || .The control approach is applied to the same system formulation, only changing the cost functionsto the 2-norm stage cost x T Qx + u T Ru with Q = diag ([4 0 . , R = 0 . . (27)In the lifted space, which has the dimension l = 20 , it is now possible to merge the overlappingpartitions for an efficient implementation of the resulting control policy.Fig. 5 shows the total number of online operations N ops defined in (25), as a function of thenumber of merging iterations n m . For the shown cases, merging the solution in the lifted spacereduces N ops up to a factor of seven compared to the traditional approach without merging. Thefactor increases with the prediction horizon N and the number of merging iterations n m . Inparticular, the evaluation of the completely merged mp-MIQP solution with N = 4 is faster thanthe traditional approach to evaluate a solution with N = 1 .The offline effort for a prediction horizon N = 4 and different number of merging iterations n m is summarized in Table II. For the preparation of the evaluation using a single search tree,a binary tree was constructed for a partition of 13821 20-dimensional polyhedra. The time ofthe merging operation itself remained relatively small (about 15 minutes), compared to the timeof the tree construction (about 36 hours), both using a simple MATLAB implementation on asingle core machine. This also confirms that the lifting does not render the merging problemintractable due to the increased number of dimensions.VII. C ONCLUSION
The evaluation of mp-MIQP solutions requires a comparison of potentially many overlappingpiecewise quadratic value functions defined on polyhedral sets. In this paper it is shown howthe quadratic functions and the associated polyhedra can be lifted to a higher dimensionalparameter space. It is shown that mp-MIQP solutions in this space have a representation aspolyhedral piecewise affine function without overlaps. For the online evaluation, this enables
August 13, 2018 DRAFT1 n m N op s N = 2 N = 3 N = 4 N = 5 N = 6 no merging (traditional)completely merged Fig. 5. DC-DC converter problem: Number of online operations N ops with n m merging recursions of Algorithm 3 for differentprediction horizons N . n m n t
31 16 8 4 2 1 n p
105 104 111 267 1170 13821 n store
546 702 954 2766 12690 138402 t merge t tree CONVERTER PROBLEM WITH PREDICTION HORIZON N = 4 : NUMBER OF PARTITIONS n t , NUMBER OF POLYHEDRA n p , NUMBER OF FLOATING POINT VALUES STORED IN THE TREE ( S ) n store , OFFLINE TIME TO MERGE PARTITIONS t merge [seconds], OFFLINE TIME TO BUILD SEARCH TREES t tree [seconds], FOR DIFFERENT MERGING RECURSIONS n m . the use of efficient data structures known from mp-MILP problems, including binary searchtrees. Furthermore, an algorithm is presented that enables a trade-off between online and offlinecomputational complexity both for mp-MILP and mp-MIQP problems. The numerical examplesinclude a power electronics control problem of practical relevance. An online speedup up to anorder of magnitude is achieved. August 13, 2018 DRAFT2 R EFERENCES [1] W. Heemels, B. de Schutter, and A. Bemporad, “Equivalence of Hybrid Dynamical Models,”
Automatica , vol. 37, no. 7,pp. 1085 – 1091, 2001.[2] J. Lunze and F. Lamnabhi-Lagarrigue, Eds.,
Handbook of Hybrid Systems Control . Cambridge University Press, 2009.[3] A. Bemporad and M. Morari, “Control of Systems Integrating Logics, Dynamics, and Constraints,”
Automatica , vol. 35,no. 5, pp. 407 – 427, 1999.[4] J. Maciejowski,
Predictive Control with Constraints . Prentice Hall, June 2001.[5] J. Rawlings and D. Mayne,
Model Predictive Control: Theory and Design . Nob Hill Publishing, 2009.[6] B. Bank, J. Guddat, D. Klatte, B. Kummer, and K. Tammer,
Non-Linear Parametric Optimization . Berlin: Akademie-Verlag, 1982.[7] E. Pistikopoulos, V. Dua, N. Bozinis, A. Bemporad, and M. Morari, “On-line Optimization via Off-line ParametricOptimization Tools,” in
International Symposium on Process Systems Engineering , Keystone, USA, Jul. 2000, pp. 183–188.[8] A. Bemporad, F. Borrelli, and M. Morari, “Model Predictive Control Based on Linear Programming – The ExplicitSolution,”
IEEE Transactions on Automatic Control , vol. 47, no. 12, pp. 1974 – 1985, December 2002.[9] F. Borrelli, A. Bemporad, and M. Morari,
Predictive control for linear and hybrid systems
Computers & Chemical Engineering , vol. 26, pp. 715–733, 2002.[11] M. Baoti´c, “Optimal Control of Piecewise Affine Systems – A Multi-parametric Approach,” Ph.D. dissertation, AutomaticControl Laboratory, ETH Zurich, Mar. 2005.[12] D. Axehill, T. Besselmann, D. Raimondo, and M. Morari, “A parametric branch and bound approach to suboptimal explicithybrid MPC,”
Automatica , vol. 50, no. 1, pp. 240–246, Jan. 2014.[13] P. Tondel, T. Johansen, and A. Bemporad, “Evaluation of piecewise affine control via binary search tree,”
Automatica ,vol. 39, no. 5, pp. 945–950, 2003.[14] C. Jones, P. Grieder, and S. Rakovic, “A Logarithmic-Time Solution to the Point Location Problem for Parametric LinearProgramming,”
Automatica , vol. 42, no. 12, pp. 2215–2218, Dec. 2006.[15] Y. Wang, C. Jones, and J. M. Maciejowski, “Efficient point location via subdivision walking with application to explicitMPC,” in
European Control Conference , Kos, Greece, Jul. 2007.[16] M. Kvasnica, P. Grieder, M. Baoti´c, and M. Morari, “Multi-Parametric Toolbox (MPT),” in
Proceedings of the InternationalWorkshop on Hybrid Systems: Computation and Control , Philadelphia, USA, Mar. 2004, pp. 448–462.[17] F. Christophersen, M. Kvasnica, C. Jones, and M. Morari, “Efficient Evaluation of Piecewise Control Laws defined overa Large Number of Polyhedra,” in
Proc. of the European Control Conference , Kos, Greece, Jul. 2007.[18] A. Fuchs, D. Axehill, and M. Morari, “On the choice of the Linear Decision Functions for Point Location in PolytopicData Sets - Application to Explicit MPC,” in
IEEE Conference on Decision and Control , Atlanta, USA, Dec. 2010, pp.5283–5288.[19] T. Besselmann, “Constrained Optimal Control – Piecewise Affine and Linear Parameter-Varying Systems,” Ph.D.dissertation, Automatic Control Laboratory, ETH Zurich, 2010.[20] M. Baoti´c, “Polytopic Computations in Constrained Optimal Control ,”
Automatika , vol. 50, no. 3, pp. 119 – 134, 2009.[21] A. Fuchs, C. Jones, and M. Morari, “Optimized Decision Trees for Point Location in Polytopic Data Sets - Applicationto Explicit MPC,” in
American Control Conference , Baltimore, USA, Jun. 2010.
August 13, 2018 DRAFT3 [22] M. Mönnigmann and M. Kastsian, “Fast explicit MPC with multiway trees,”
IFAC World Congress , Sep. 2011.[23] T. Geyer, G. Papafotiou, and M. Morari, “Hybrid Model Predictive Control of the Step-Down DC-DC Converter,”
IEEETransactions on Control Systems Technology , vol. 16, no. 6, pp. 1112–1124, Nov. 2008., vol. 16, no. 6, pp. 1112–1124, Nov. 2008.