Constraint-Adaptive MPC for linear systems: A system-theoretic framework for speeding up MPC through online constraint removal

Reducing the computation time of model predictive control (MPC) is important, especially for systems constrained by many state constraints. In this paper, we propose a new online constraint removal framework for linear systems, for which we coin the term constraint-adaptive MPC (ca-MPC). In so-called exact ca-MPC, we adapt the imposed constraints by removing, at each time-step, a subset of the state constraints in order to reduce the computational complexity of the receding-horizon optimal control problem, while ensuring that the closed-loop behavior is {\em identical} to that of the original MPC law. We also propose an approximate ca-MPC scheme in which a further reduction of computation time can be accomplished by a tradeoff with closed-loop performance, while still preserving recursive feasibility, stability, and constraint satisfaction properties. The online constraint removal exploits fast backward and forward reachability computations combined with optimality properties.


I. INTRODUCTION
Model predictive control (MPC) is a successful control technology adopted in many application fields [13], [14], and is based on recursively solving a finite-horizon optimization problem online. Solving an optimization problem at each timestep can prohibit the real-time feasibility of the controller for computationally complex scenarios. This is particularly the case in applications requiring the control of systems with many state constraints, which is the setting studied in this paper.
Efforts to improve the computational aspects of MPC are commonplace in the literature with, amongst others, explicit MPC, model reduction, and tailored numerical solvers as prominent examples, see, e.g., [2]- [6], [9], [10], [19]. In particular, constraint removal techniques were developed to accelerate MPC for systems subject to many constraints. This research is supported by KWF Kankerbestrijding and NWO Domain AES, as part of their joint strategic research programme: Technology for Oncology II. The collaboration project is co-funded by the PPP Allowance made available by Health∼Holland, Top Sector Life Sciences & Health, to stimulate public-private partnerships.
© 2023. This manuscript version is made available under the CC-BY-NC-ND 4.0 license https://creativecommons.org/licenses/by-nc-nd/4.0/ Constraint removal techniques can be roughly separated into offline [1], [18], [20], and online methods [11], [12]. Although of interest, offline methods can be prohibitively complex to compute and do not always enable real-time MPC, as constraints can only be removed if they are redundant for all feasible states. The fact that offline methods do not depend on and thus can not exploit the current state information might make them less effective than online constraint removal techniques.
In contrast, online techniques can exploit knowledge of the current state and possibly even more. As a result, online techniques have the potential to remove considerably more constraints compared to offline methods. For example, in [11] so-called regions of activity for each constraint are (approximately) computed that are based on the initial state for the MPC problem. Loosely speaking, the region of activity represents the set of initial states for which the particular constraint in consideration is active at the minimizer of the MPC problem. The online complexity of this method is reported to scale linearly in the number of constraints. However, approximating the region of activity can become intractable in scenarios with many constraints, as for each constraint either an ellipsoidal or hypercube outer approximation must be computed that depends on all other constraints. Alternatively in [12], a Lyapunov-based approach is proposed, assuming the cost function of the MPC problem is a Lyapunov function. Here, for each inequality constraint, the cost function is minimized assuming the particular inequality is active in the sense of equality. This leads to the minimum cost function value for which the particular constraint can be active. Next, when the MPC control law is running, the value of the Lyapunov function for the current state is compared to the pre-computed values for all constraints. If this value for the current state is lower than the corresponding value for an inequality constraint, it can be removed permanently from the MPC problem.
In this work, we will present a new online constraint removal framework for linear systems, called constraintadaptive MPC (ca-MPC). We present both exact and ap-proximate ca-MPC strategies. Crucially, in exact ca-MPC, the closed-loop behavior of the resulting accelerated MPC feedback law is identical to that of the original MPC feedback law. In approximate ca-MPC a further reduction of computation time can be accomplished compared to exact ca-MPC due to a tradeoff with closed-loop performance (as the closedloop behavior is no longer identical in approximate ca-MPC). However, in approximate ca-MPC crucial properties such as recursive feasibility, stability, and constraint satisfaction can be preserved by design. Both strategies exploit systemtheoretic properties, such as reachability and optimality, in a computationally effective manner. The method presented in this paper extends our preliminary work in [16] and [17] in which only initial ideas were presented (without any technical proofs). The current work formalizes these initial ideas in a complete framework and specifies also the technical underlying results and their rigorous proofs. A new numerical case study, extending the earlier one, is provided as well, which shows a two-order reduction in computational time of the ca-MPC scheme compared to the original MPC scheme, while still having identical closed-loop behavior. We also show how the preliminary results of [16] can be seen as a special case, approximate ca-MPC framework presented in this paper (see Section V).

II. SYSTEM AND MPC SETUP
In this paper, we consider plants that can be described by a discrete-time linear time-invariant (LTI) system although several ideas also apply to nonlinear and time-varying plants, see, e.g., [16]. In (1), x k ∈ R n and u k ∈ R m denote the plant states and the inputs, respectively, at discrete time k ∈ N. Furthermore, A ∈ R n×n and B ∈ R n×m . The system (1) is subject to polyhedral state and input constraints given for k ∈ N by Here, X and U are assumed to be non-empty polyhedral sets with c j ∈ R 1×n , g j ∈ R 1×m , b j ∈ R, and h j ∈ R. In this paper, we study systems that are constrained by many state constraints, i.e., n x 1.

A. MPC setup
Based on the system dynamics (1) and constraints (2), a common MPC setup, given state x k at time k ∈ N, is minimize subject to X k = Φx k + ΓU k , where Here, , T , x i|k , u i|k , and X i denote the stage cost, the terminal cost, the predicted state, the predicted input, and the state constraint set at predicted time i ∈ N [1,N ] := {1, 2, · · · , N } made at time k ∈ N, respectively. The state constraints depend on i for generality and to facilitate compact notation using the Cartesian product. Typically, X i is chosen as X i = X ⊂ R n for i ∈ N [1,N −1] and X N = X T ⊆ X, where X T denotes a suitable controlled invariant terminal set [14]. The i|k subscript is used to denote the i-th prediction at time k.
For the optimization problem (3), we denote the set of feasible input sequences parameterized by x k as and the set of feasible states by Under suitable assumptions on , T , U, and X , e.g., and T being continuous and X being closed and U being compact [14], a minimizer of (3) exists for all x k ∈ X f and we denote by U k := [u 0|k · · · u N −1|k ] a particular one at time k ∈ N for state x k , i.e., whereJ(x k , U k ) := J(Φx k + ΓU k , U k ). The set of all optimal predicted state sequences corresponding to U (x k ) is denoted by where a particular one is given by X k = Φx k + ΓU k ∈ X (x k ). Using a receding horizon implementation, the MPC problem (3) is turned into a feedback law K MPC : X f → U by applying the first computed input in U k on the real plant (1), i.e., u k := K MPC (x k ) := u 0|k , k ∈ N.

B. Reduced MPC problem
To address the problem of removing redundant state constraints from (3), we introduce the reduced MPC problem, where the original constraints set X is replaced by a (statedependent) reduced constraint set denoted by subject to (3b), (3d), (7b) The reduced constraint set X red (A(x k )) is described by an Clearly, X red is defined by a subset of the constraints in X . Moreover, observe that the index set A(x k ) depends on x k . Hence, our ca-MPC scheme requires the specification of the set-valued mapping A i : [1,N ] . A formal problem formulation will be given in Section III. We use the notation ⇒ to indicate the set-valuedness of the maps The reduced MPC problem (7) with the reduced constraint sets (8) gives rise to the set of minimizers Again, similar to the original MPC problem, we introduce the set of "optimal" state trajectories

C. Preliminaries and notation
Given a set V ⊂ R n , we denote the affine transformation of V with matrix M ∈ R m×n and vector b ∈ R m by M V+b : To project from sets defined for state (or input) trajectories to individual state vectors (or input vectors), we introduce the projection P i of a set V ⊆ R N n as where i ∈ N [1,N ] , assuming N is clear from the context. We define the normal cone of a set

III. EXACT CONSTRAINT-ADAPTIVE MPC
We introduce now exact ca-MPC, in which the term "exact" refers to the property that the closed-loop system will not be changed when replacing (3) by the reduced MPC problem (7).
f and the set of minimizers of the reduced MPC problem (7) is the same as for the original MPC problem As the minimizers are identical, exact ca-MPC trivially inherits all performance, stability, and constraint satisfaction properties from the original MPC problem.
The main problem considered in this paper can now be formulated as follows: Construct computationally tractable setvalued mappings A i : n xi (if possible) for i ∈ N [1,N ] for all x k ∈ X f , such that, the resulting ca-MPC scheme is exact in the sense of Definition 1.
By creating simpler MPC problems, ca-MPC can accelerate both interior-point and active-set solvers. For interior-point methods, ca-MPC straightforwardly reduces the complexity of each Newton step, thereby accelerating the optimization problem. Additionally, ca-MPC is also a natural extension to active-set solvers, as the working and inactive constraint sets are already dynamically updated. By removing constraints a priori, determining which constraint has to be added to the working set is easier, as there are fewer constraints to evaluate.
The key concept of exact ca-MPC is inspired by the following basic observation. A ca-MPC scheme based on (7) for given mappings A, is exact if and only if for all x k ∈ X f . Indeed, when the optimal set of state trajectories satisfy all state constraints, we obtain the same set of minimizers. However, note that (13) is not suitable as a direct tool to design appropriate set-valued mappings A, as (13) cannot be used in a constructive manner. To overcome this, we build upon the following theorem using outer approximations of X red (x k , A(x k )) by a set M(x k ) (not depending on A).
Theorem 1. Consider the original and reduced MPC optimization problem (3) and (7), respectively, with then X f = X red f and the ca-MPC scheme (7) is exact. Proof. Let x k ∈ X f be given. First, observe which is immediate as (7) uses a subset of the constraints of (3). Hence, X f ⊆ X red f and for all x k ∈ X f min Next, to show (12), take Combining (15), (16), and (17) leads now to (12).
The main takeaway from Theorem 1 is that we concentrate the A-dependence in X red (A(x k )). The way we apply Theorem 1 is to first construct an A-independent set M(x k ) satisfying (C1), for all possible choices of A. Once, this M(x k ) is available, we can select, in the second step, the indices in A(x k ) such that (C2) is satisfied. Intuitively, when M satisfies (C1), then, its elements indicate which state constraints can be violated. Therefore, by adding these state constraint indices to A, we ensure that these "at-risk" constraints are not violated. As a result, the optimal state trajectory X red (x k , A(x k )) will satisfy all state constraints, and, hence, we obtain an exact ca-MPC scheme.
An important observation is that a smaller M has the potential to remove more constraints, see (C2). However, M still has to satisfy (C1). To this end, a useful extension to Theorem 1, is to utilize additional information besides the initial state, see, e.g., Sections IV-B and IV-C. For example, we can exclude certain state constraints from the removal process in order to find a smaller M. To this end, we introduce a set of fixed constraints given by F( . We will omit the dependence of M on F, as it will be clear from context.
Besides introducing fixed constraints to exclude constraints from the removal process, it is useful to construct A in a subtractive manner. By doing so, we can be conservative in removing constraints without losing exactness, but this will provide many computational benefits. To make this concrete, we parameterize A as where x k ∈ X f , denotes the set of removed constraints from the MPC problem. We also define the compact notation I( . Lemma 1. Consider the original and reduced MPC problems (3) and (7), respectively, and let F i : X f ⇒ N [1,nx i ] and M : X f ⇒ R N n satisfying (C1) be given. Let the set-valued mapping I i : [1,N ] , capture the removed state constraints, i.e., Then, the resulting ca-MPC scheme is exact.
Proof. To show (C2), we start with the inclusion X ∩ The result of Lemma 1 is instrumental as it provides a computationally efficient method to remove constraints from the reduced MPC problem. For example, (C3) can be evaluated for each constraint independently. As a result, we can also consider projections of M, i.e., for all i ∈ N [1,N ] , is equivalent to (C3). This observation will lead to an efficient ca-MPC implementation, as we will see in the next section.

IV. PROPOSED EXACT CA-MPC IMPLEMENTATION
In this section, we will make the exact ca-MPC scheme concrete by introducing three sets M (1) , M (2) , and M (3) to construct M as M (1) ∩ M (2) ∩ M (3) . Hereafter, we will provide a concrete outline on how M is used to compute the mapping A.

A. Forward reachable set
As all state trajectories start at x k and satisfy the system dynamics and input constraints, we can use the inputconstrained forward reachable set to construct M (1) (x k ). To this end, we introduce the input-constrained forward reachable To compute the state-dependent forward reachable set in a real-time setting we define M (1) (x k ) as where E(L i,1 , q i,1 ) ⊃ − → H i (0, U), which can be computed using [7], [8]. The construction (21) solves two problems. First, note that the forward reachable set can be decomposed as for linear systems. Hence, we can compute the forward reachable set once offline for a zero initial state, and shift the result by the free state response A i x k . Second, we use ellipsoids that have a fixed complexity to outer approximate the true forward reachable set, which can be arbitrarily complex.

B. Backward reachable set
Given the forward reachable set, a natural extension is to exploit backward reachability too. Indeed, when we choose , all optimal state trajectories that can result from (7) must end in the terminal set. To this end, we introduce the input-and terminal-state-constrained backward reachable set for (1) and (2b), i.e., Note that the backwards reachable set is not state-dependent but can be prohibitively complex, similar to the forward reachable set. Hereto, we define M (2) as where E(L i,2 , q i,2 ) ⊆ ← − H i (X N , U) to manage online complexity.

C. First-order optimality set
The third set, M (3) , exploits the optimization based nature of MPC. For example, a feasible solution to (3) upper bounds the cost function, thereby bounding the minimizer [17]. One method to obtain a feasible solution, is by extending the minimizer U k−1 obtained at time k − 1 (as is common when using terminal set and cost methods, see [14]). In this section, we introduce a more advanced notion of this concept by exploiting the property that optimal state trajectories satisfy first-order optimality conditions, which, in combination with a feasible solution to (3), yields a smaller set.
We start by formalizing the first-order optimality conditions that optimal input trajectories satisfy, under differentiability of J with respect to U , where at U , as is commonly seen in stationary conditions for optimization problems [15,Sec. 12.7]. Observe that (24) is not a constructive condition to design M (3) , as it uses A and U in its definition. To get around this issue, we introduce the set of input trajectories for which a convex constraint set exists, such that, first-order optimality conditions can be satisfied given a feasible input trajectoryŨ k ∈ U f (x k ), see Figure 1. Note that the set of all convex sets that include the feasible input trajectory is guaranteed to include s.t. U ,Ũ k ∈ S, and − ∇ UJ (x k , U k ) ∈ N S (U )}.
Given (25), we obtain M (3) (x k ) = Φx k + ΓJ (x k ,Ũ k ). While (25) seems complex at first sight, it has an elegant solution for quadratic cost functions. To show this, we specify a quadratic cost function J as in (3e) with (x, u) = x Qx + u Ru, T (x) = x P x, where Q and P denote positive semi-definite matrices and R is positive definite. When substituting the quadratic cost and system dynamics into (3e), it is easy to see that an equivalent formulation for the cost isJ with G ∈ R N m×N m and linear maps q : X f → R N m , r : X f → R that depend on the system dynamics, the current state, and Q, P , R. Observe that q(x k ) denotes the unconstrained minimizer of the MPC problem, which is the unique solution to ∇ UJ (x k , q(x k )) = 0. Using (26), J (x k ,Ũ k ) is given by the ellipsoid The proof of this result is provided in Appendix A, and a schematic illustration is in Figure 1. where ∇ UJ (x k , q(x k )) = 0. Note that J is significantly smaller than the level set ofJ atŨ . Left: U ∈ J , as there exists a set S such that N S includes −∇ UJ . In fact, U is the minimizer. Right: U / ∈ J , as there does not exist a set S such that −∇ UJ ∈ N S . As expected, we observe that the minimizer for S satisfies U ∈ J .

D. Integration into an exact ca-MPC scheme
Now we will present how the sets M (i) , i = {1, 2, 3}, are used to construct an exact ca-MPC scheme. Recall that M (2) requires As M is defined as the intersection of ellipsoids, we utilize (C3) to construct I(x k ) as where E(L i,l , q i,l ) = P i (M (l) (x k )). Observe that for each l ∈ {1, 2, 3}, it holds that Hence, (28) implies (C3). The derivation of (28b) is given in Appendix A. Crucially, L i,l is not state-dependent (up to a constant), therefore, c i,j L −1 i,l 2 can be pre-computed (up to a constant) for all i, j, l. As a result, the ellipsoidal description of M allows for the computationally efficient of I(x k ) using (28). In fact, (28b) only requires one inner product, a scalar absolute value, and a comparison.
For the remainder of this section, we present an overview of the integrated ca-MPC scheme in Algorithm 1. In Algorithm 1, we use ← to denote "compute using". First, in lines 1-5, in an offline setting, we pre-compute the forward and backward reachable sets and corresponding ellipsoidal outer approximations. Second, in an online setting, we start by computing the first-order optimality set in line 8 based on the measured state x k and generated feasible input sequenceŨ k . Next, in lines 9-13, we perform the constraint removal using the forward and backward reachable sets and first-order optimality set. Finally, we compute the minimizer of the resulting reduced MPC problem (line 14) and apply u k = u red 0|k to the plant (line 15).

Algorithm 1 Implementation of exact ca-MPC
for i = 1, 2, · · · , N − 1 do 10: The exact ca-MPC method introduced in Sections III and IV is highly effective in the sense that the online complexity of computing A(x k ) is low, while significant reductions in the number of constraints can be achieved. A relaxation, approximate ca-MPC, aims to remove more constraints from the MPC problem. Approximate ca-MPC will maintain the constraint satisfaction (and stability), but will no longer be exact.
Based on (C2), we observe that shrinking M can result in the removal of more state constraints. One way to realize this, is by designing a smaller M that satisfies (C1). Hereto, we impose additional input-constraints that allow us to design a tighter M. To this end, we augment the original MPC problem (3) with the input constraint U k ∈Ũ k + δU N , whereŨ k ∈ U f (x k ) is a feasible input sequence, and δU ⊂ R m with 0 ∈ δU is a set limiting the input sequence U k to be "close" tõ U k . By constraining the minimizer to be close to a feasible input trajectory, we obtain "smaller" forward and backward reachable sets that can lead to the removal of more constraints from the MPC problem. We will consider a particular choice ofŨ k , namely,Ũ k = [u 1|k−1 · · · u N −1|k−1ũ (x N |k−1 )] , whereũ : X N → U denotes an auxiliary feedback law that renders X N positively invariant, i.e., Ax + Bũ(x) ∈ X N for all x ∈ X N . The MPC problem corresponding to this new setup is given by subject to (3b), (3d) (30b) Note that depending onũ : X N → U, the closed-loop stability of (30) can be unchanged with respect to (3), as the standard stability proof based on a terminal set and cost [14], is still applicable. Interestingly, the approximate ca-MPC scheme is exact with respect to (30), but not (3), hence, its properties can be analyzed using (30). Last, note that the size of δU is a tuning knob (and can even depend on time k and prediction step i) that can trade-off potential performance loss to increased constraint removal, and thus computational benefits.

VI. NUMERICAL EXAMPLE
We will use a double integrator system as the two-dimensional state allows for convenient visualization. The input constraints are U = {u ∈ R | |u| ≤ 1}.
To obtain an example with a large number of linear state constraints as in (3), we approximate two quadratic constraints with linear inequalities, i.e., The points v 1,j , v 2,j , j ∈ N [1,nv] , are chosen on the boundary of the respective ellipses, which will result in a tangent inequality constraint at v 1,j and v 2,j , respectively. Note that all constraints are non-redundant, i.e., the removal of each constraint changes the set. Moreover, the number of state constraints will be n xi = 2n v , i ∈ N  We define the MPC cost function as (x, u) = x Qx + u Ru, T (x) = x P x using Q = [ 1 0 0 1 ] , P = [ 1 0 0 1 ] , R = 1. For both the first-order optimality set and the approximate ca-MPC scheme, we use the feasible input sequence,Ũ k = [u 1|k−1 · · · u N −1|k−1 (K T x N |k−1 ) ] . The last component needed for the approximate ca-MPC scheme is the additional input constraint, which we take as δU := {u ∈ R | |u| ≤ 0.3}.
The two-dimensional state of (31) allows for the visualization of M (l) (x k ) for l ∈ {1, 2, 3}, see  Note that forward and backward reachable set are approximated using the outer Löwner-John ellipsoid of (20) and (22), respectively. These offline ca-MPC computations required approximately 30 seconds for this example.
) for the current state x k ( ).
Simulation results: we initialize (31) at x 0 = −[4 0.4] and let the MPC, exact ca-MPC, and the approximate ca-MPC scheme regulate the state to the origin. The quadratic programs are solved using a primal-dual interior-point method from the MATLAB MPC toolbox. The resulting state trajectories are shown in Figure 6. First of all, none of the schemes violated the state constraints, as expected. Second, as also expected, the exact ca-MPC scheme has an indistinguishable closed-loop trajectory compared to the original MPC solution, while, the approximate ca-MPC scheme did result in a different closedloop trajectory. In Figure 7, the computation time and the number of reduced constraints over time for both ca-MPC schemes are shown. Clearly, both the exact and approximate ca-MPC schemes are significantly faster to compute compared to the original MPC problem. Last, in Figure 8, we show the maximum computation time for the MPC and exact ca-MPC feedback law (and the breakdown of the ca-MPC scheme), for a range of state constraints by adjusting in (32) n v (1200 ≤ N i=1 n xi ≤ 45600). From this figure, we observe a consistent two-order of magnitude computational time improvement using our exact ca-MPC scheme for this example.
Remark 1. While the double-integrator is convenient for illustrating all aspects of the ca-MPC scheme due to its 2dimensional visualization possibilities, the interested reader is referred for a higher-dimensional example to [17]. In [17] a similar ca-MPC scheme is applied to a discretized thermal PDE with a temperature upper bound on the (discrete) spatial domain. This leads to a discrete-time linear plant model with 2000 states. Here, a similar two-order of magnitude improvement in computational time was observed for an MPC setup with 20,000 constraints. Due to space limitations, we refer to [17] for further details on this thermal PDE example. VII. CONCLUSIONS In this paper, we presented an efficient online constraint removal framework for accelerating MPC for linear sys- ) and the resulting QP ( ).
tems using system-theoretic insights. A crucial aspect of our proposed method is that the closed-loop behavior and thus properties of the reduced MPC feedback law, such as stability, performance, and constraint satisfaction, remain unchanged when compared to the original MPC feedback law. We achieve this by exploiting computationally efficient bounds on the optimal state trajectory that indicate which constraints can be removed from the MPC problem. In particular, we showed that the forward and backward reachable sets and a firstorder optimality set are computationally efficient and powerful tools to remove state constraints from the MPC problem. Additionally, we presented an extension, called approximate ca-MPC, that is able to trade-off closed-loop performance with the computational complexity of the resulting reduced MPC problem, while still maintaining constraint satisfaction and stability. The results from a numerical example show that the resulting constraint removal scheme can achieve computational speed ups of two-orders of magnitude, without loss of closedloop performance. An alternative example with a similar ca-MPC using a thermal system described by a PDE is presented in [17], where a comparable two-orders of magnitude improvement was observed as well. Moreover, many of the conceptual ideas that we exploited to get to our constraintadaptive MPC framework can be extended to nonlinear and time-varying systems as well, see also [16] for first steps.