Reducing the Prediction Horizon in NMPC: An Algorithm Based Approach

In order to guarantee stability, known results for MPC without additional terminal costs or endpoint constraints often require rather large prediction horizons. Still, stable behavior of closed loop solutions can often be observed even for shorter horizons. Here, we make use of the recent observation that stability can be guaranteed for smaller prediction horizons via Lyapunov arguments if more than only the first control is implemented. Since such a procedure may be harmful in terms of robustness, we derive conditions which allow to increase the rate at which state measurements are used for feedback while maintaining stability and desired performance specifications. Our main contribution consists in developing two algorithms based on the deduced conditions and a corresponding stability theorem which ensures asymptotic stability for the MPC closed loop for significantly shorter prediction horizons.


INTRODUCTION
Model predictive control (MPC), sometimes also termed receding horizon control (RHC), deals with the problem of approximately solving an infinite horizon optimal control problem which is, in general, computationally intractable. To this end, a solution of the optimal control problem on a truncated, and thus finite, horizon is computed. Then, the first part of the resulting control is implemented at the plant and the finite horizon is shifted forward in time which renders this method to be iteratively applicable, see, e.g., .
During the last decade, theory of MPC has grown rather mature for both linear and nonlinear systems as shown in Allgöwer and Zheng (2000) and Rawlings and Mayne (2009). Additionally, it is used in a variety of industrial applications, cf. Badgwell and Qin (2003) due to its capability to directly incorporate input and state constraints. However, since the original problem is replaced by an iteratively solved sequence of control problems -which are posed on a finite horizon -stability of the resulting closed loop may be lost. In order to ensure stabilty, several modifications of the finite horizon control problems such as stabilizing terminal constraints or a local Lyapunov function as an additional terminal weight have been proposed, cf. Keerthi and Gilbert (1988) and Chen and Allgöwer (1999).
Here, we consider MPC without additional terminal contstraints or costs, which is especially attractive from a computational point of view. Stability for these schemes can be shown via a relaxed Lyapunov inequality, see Grüne (2009) for a set valued framework and Grüne and Pannek (2009) for a trajectory based approach. Still, stable behavior of the MPC controlled closed loop can be observed in many examples even if these theoretical results require a longer prediction horizon in order to guarantee stability. The aim of this paper consists of closing this gap between theory and experimental experience. In particular, we develop an algorithm which enables us to ensure stability for a significantly shorter prediction horizon and, as a consequence, reduces the computational effort in each MPC iteration significantly. The key observation in order to extend the line of arguments in the stability proofs proposed in Grüne (2009) is that the relaxed Lyapunov inequality holds true for the MPC closed loop for smaller horizons if not only the first element but several controls of the open loop are implemented, cf. Grüne et al. (2010). However, this may be harmful in terms of robustness, cf. Magni and Scattolini (2007). Utilizing the internal structure of consecutive MPC problems in the critical cases along the closed loop trajectory, we present conditions which allow us to close the loop more often and maintain stability. Indeed, our results are also applicable in order to deduce performance estimates of the MPC closed loop.
The paper is organized as follows: In Section 2, the MPC problem under consideration is stated. In the ensuing section, we extend suboptimality results from Grüne and Pannek (2009) and Grüne et al. (2010) in order to give a basic MPC algorithm which checks these performance bounds. In Section 4, we develop the proposed algorithm further in order to increase the rate at which state measurements are used for feedback and state our main stability theorem. In the final Section 5 we draw some conclusions. Instead of a separated example, we use a numerical experiment throughout the paper which shows the differences and improvements of the presented result in comparison to known results.

PROBLEM FORMULATION
We consider nonlinear discrete time control systems where N 0 denotes the natural numbers including zero. The state space X and the control value space U are arbitrary metric spaces. As a consequence, the following results are applicable to discrete time dynamics induced by a sampled -finite or infinite dimensional -system, see, e.g., Altmüller et al. (2010) or Ito and Kunisch (2002). Constraints may be incorporated by choosing the sets X and U appropriately. Furthermore, we denote the space of control sequences u : N 0 → U by U N0 . Our goal consists of finding a static state feedback u = µ(x) ∈ U which stabilizes a given control system of type (1) at its unique equilibrium x * . In order to evaluate the quality of the obtained control sequence, we define the infinite horizon cost functional with continuous stage cost : X × U → R + 0 with (x * , 0) = 0 and (x, u) > 0 for x = x * . Here, R + 0 denotes the nonnegative real numbers. The optimal value function is given by V ∞ (x 0 ) = inf u∈U N 0 J ∞ (x 0 , u) and, for the sake of convenience, it is assumed that the infimum with respect to u ∈ U N0 is attained. Based on the optimal value function V ∞ (·), an optimal feedback law on the infinite horizon can be defined as µ ∞ (x(n)) := argmin u∈U {V ∞ (x(n + 1)) + (x(n), u)} (3) using Bellman's principle of optimality. However, since the computation of the desired control law (3) requires, in general, the solution of a Hamilton-Jacobi-Bellman equation, which is very hard to solve, we use a model predictive control (MPC) approach instead. The fundamental idea of MPC consists of three steps which are repeated at every discrete time instant: • Firstly, an optimal control (u 0 , u 1 , . . . , u N −1 ) ∈ U N for the problem on a finite horizon [0, N ), i.e., is computed given the most recent known state x 0 of the system (1). Here, x u (·; x 0 ) corresponds to the open loop trajectory of the prediction with control u and initial state x 0 . • Secondly, the first element µ N (x 0 ) = u 0 of the obtained sequence of open loop control values is implemented at the plant. • Thirdly, the entire optimal control problem considered in the first step is shifted forward in time by one discrete time instant which allows for an iterative application of this procedure.
The corresponding closed loop costs are given by to abbreviate the minimizing open loop control sequence and V N (x 0 ) = min u∈U N J N (x 0 , u) for the corresponding optimal value function. Furthermore, we say that a continuous function ρ : R ≥0 → R ≥0 is of class K ∞ if it satisfies ρ(0) = 0, is strictly increasing and unbounded, and a continuous function β : R ≥0 × R ≥0 → R ≥0 is of class KL if it is strictly decreasing in its second argument with lim t→∞ β(r, t) = 0 for each r > 0 and satisfies β(·, t) ∈ K ∞ for each t ≥ 0.
Note that, different to the infinite horizon problem (2), the first step of the MPC problem consists of minimizing the truncated cost functional (4) over a finite horizon. While commonly endpoint constraints or a Lyapunov function type endpoint weight are used to ensure stability of the closed loop, see, e.g., Keerthi and Gilbert (1988), Chen and Allgöwer (1999), Jadbabaie and Hauser (2005) and Graichen and Kugi (2010), we consider the plain MPC version without these modifications. According to Grüne and Pannek (2009), stable behavior of the closed loop trajectory can be guaranteed using relaxed dynamic programming. Proposition 2.1. (i) Consider the feedback law µ N : X → U and the closed loop trajectory x µ N (·) with initial value holds for some α ∈ (0, 1] and all n ∈ N 0 , then then there exists β ∈ KL which only depends on α 1 , α 2 , α 3 and α such that the inequality x µ N (n) ≤ β( x 0 , n) holds for all n ∈ N 0 , i.e., x µ N (·) behaves like a trajectory of an asymptotically stable system.
The key assumption in Proposition 2.1 is the relaxed Lyapunov-inequality (6) in which α can be interpreted as a lower bound for the rate of convergence. From the literature, it is well-known that this condition is satisfied for sufficiently long horizons N , cf. Jadbabaie and Hauser (2005), Grimm et al. (2005) or Alamir and Bornard (1995), and that a suitable N may be computed via methods described in Pannek (2009). To investigate whether this condition is restrictive, we consider the following example. Example 2.2. Consider the synchronous generator model = 28.22, and E = 0.2405 from Galaz et al. (2003) and the initial value x 0 = (1.02, 0.1, 1.014).
For Example 2.2 our aim is to steer the system to its equilibrium x * ≈ (1.12, 0.0, 0.914). To this end, we use MPC to generate results for sampling time T = 0.1 and running cost with piecewise constant controlũ(t) = u for t ∈ [0, T ) and λ = 10 −6 where ϕ(·; x,ũ) denotes the solution operator of the differential equation with initial value x and controlũ. For this setting, we obtain stability of the closed loop via inequality (6) for N ≥ 30, cf. Figure 1. However, Figure  1 shows stable behavior of the closed loop for the smaller prediction horizon N = 19 without significant deviations -despite the fact that the relaxed Lyapunov-inequality from Proposition 2.1 is violated at three instances. Our  (7) cannot be guaranteed via Proposition 2.1, stable and satisfactory behavior of the closed loop may still be observed. Hence, since the computational effort grows rapidly with respect to the prediction horizon, our goal consists of developing an algorithm which allows for significantly reducing the prediction horizon. To this end, we adapt the thereotical condition given in (6). Moreover, the proposed algorithms check -at runtimewhether these conditions are satisfied or not.
Note that, since we do not impose additional stabilizing terminal constraints, feasibility of the NMPC scheme is an issue that cannot be neglected. In particular, without these stabilizing constraints the closed loop trajectory might run into a dead end. To exclude such a scenario, we assume the following viability condition to hold. Assumption 2.3. For each x ∈ X there exists a control u ∈ U such that f (x, u) ∈ X holds.

THEORETICAL BACKGROUND
In Section 2 we observed a mismatch between the relaxed Lyapunov inequality (6) and the results from Example 2.2 which indicates that the closed loop exhibits a stable and -in terms of performance -satisfactory behavior for significantly smaller prediction horizons N . In Grüne et al. (2010) it has been shown that the suboptimality estimate α is increasing (up to a certain point) if more than one element of the computed sequence of control values is applied. Hence, we vary the number of open loop control values to be implemented during runtime at each MPC iteration, i.e., the system may stay in open loop for more than one sampling period, in order to deal with this issue. Doing so, however, may lead to severe problems, e.g., in terms of robustness, cf. Magni and Scattolini (2007). Hence, the central aim of this work is the development of an algorithm which checks -at runtimewhether it is necessary to remain in open loop in order to guarantee the desired stability behavior of the closed loop by suboptimality arguments, or if the loop can be closed without loosing these characteristics.
To this end, we introduce the list S = (s(0), s(1), . . .) ⊆ N 0 , which we assume to be in ascending order, in order to indicate time instances at which the control sequence is updated. Moreover, we denote the closed loop solution at time instant s(n) by x n = x µ N (s(n)) and define m n := s(n + 1) − s(n), i.e., the time between two MPC updates. Hence, x µ N (s(n) + m n ) = x µ N (s(n + 1)) = x n+1 holds. This enables us -in view of Bellman's principle of optimality -to define the closed loop control In Grüne et al. (2010), a suboptimality degree α N,mn relative to the horizon length N and the number of controls to be implemented m n has been introduced in order to measure the tradeoff between the infinite horizon cost induced by the MPC feedback law µ S N (·; ·), i.e.
Examples 3.1 shows that choosing a larger value for m may significantly reduce the required prediction horizon length and, consequently, the numerical effort which grows rapidly with respect to the horizon N .
Since the shape of the curve in Figure 2 is not a coincidence, i.e., α N, N/2 ≥ α N,m holds for m ∈ {1, . . . , N − 1}, cf. Grüne et al. (2010), we may easily determine the small- note that these results exhibit a set-valued nature. Hence, the validity of the controllability condition (10) and the use of a prediction horizon length corresponding to the mentioned formula lead to an estimate which may be conservative -at least in parts of the state space. This motivates the development of algorithms which use the above calculated horizon length but close the control loop more often. Here, we make use of an extension of the mstep suboptimality estimate derived in Grüne and Pannek (2009) which is similar to Grüne et al. (2010) but can be applied in a trajectory based setting. Proposition 3.2. Consider α ∈ (0, 1] to be fixed. If there exists a function V N : holds for all n ∈ N 0 . Proof: Reordering (11), we obtain ) and hence taking n to infinity implies the assertion. 2 Remark 3.3. Note that the assumptions of Proposition 3.2 indeed imply the estimate for all n ∈ N 0 which can be proven analogously.
Note that S is built up during runtime of the algorithm and not known in advance. Hence, S is always ordered. A corresponding implementation which aims at guaranteeing a fixed lower bound of the degree of suboptimality α takes the following form: Given state x := x 0 , list S = (0), N ∈ N ≥2 , and α ∈ (0, 1) (1) Set j = 0, compute u N (·; x) and V N (x). Do (a) Set j = j + 1, compute V N (x u N (j; x)) (b) Compute maximal α to satisfy (11) (c) If α ≥ α: Set m n = j and goto 2 (d) If j = N − 1: Print warning "Solution may diverge", set m n = 1 and goto 2 while α < α (2) For j = 1, . . . , m n do Remark 3.4. Here, we adopted the programming notation back which allows for fast access to the last element of a list. Remark 3.5. If (11) is not satisfied for j ≤ N − 1, a warning will be printed out because the performance bound α cannot be guaranteed. In order to cope with this issue, there exist remedies, e.g., one may increase the prediction horizon and repeat step 1. For sufficiently large N , this ensures the local validity of (11). Unfortunately, the proof of Proposition 3.2 cannot be applied in this context due to the prolongation of the horizon. Yet, it can be replaced by estimates from Pannek (2009) or Giselsson (2010) for varying prediction horizons to obtain a result similar to (12). Alternatively, one may continue with the algorithm. If there does not occur another warning, the algorithm guarantees the desired performance for x n instead of x 0 , i.e., from that point on, cf. Remark 3.3.
In order to obtain a robust procedure, however, it is preferable that the control loop is closed as often as possible, i.e., m n = 1 for all n ∈ N 0 . In the following section, we give results and corresponding algorithms which -given certain conditions -allow us to reduce m n .

ALGORITHMS AND STABILITY RESULTS
In many applications a stable behavior of the closed loop is observed for m n = 1 even if it cannot be guaranteed using the suboptimality estimate (6), cf. Example 2.2. Here, we present a methodology to close the control loop more often while maintaining stability. In particular, if m n > 1 is required in order to ensure α ≥ α in (11) and, as a consequence, in step (1) of the proposed algorithm, we present conditions which allow us to update the control for some j ∈ {1, . . . , m n − 1} tô insert the new updating time instant s(n) + j into the list S, and still be able to guarantee the desired stability behavior of the closed loop. Summarizing, our aim consists of guaranteeing that the degree of suboptimality α is maintained, i.e., (11) is still satisfied, for the MPC law updated at a time instant j ≤ m n − 1 according to (14). Proposition 4.1. Let x n ∈ X be given and inequality (11) hold for u N (·; x n ), α > 0, and m n ∈ {2, . . . , N − 1}. If the inequality holds for some j ∈ {1, . . . , m n − 1}, then the control sequence u N (·; x n ) can be replaced by (14) and suboptimality degree α is locally maintained.
Proof: In order to show the assertion, we need to show (11) for the modified control sequence (14). Reformulating (15) by shifting the running costs associated with the unchanged control to the left hand side of (15) we obtain which is equivalent to i.e., the relaxed Lyapunov inequality (11) for the updated controlû N (·; x n ). 2 Example 4.2. Consider the illustrative Example 2.2 with horizon N = 19 and α = 0.1. For this setting, we obtain α ≥ α with m n = 1 for all updating instances s n ∈ S except for those three points indicated by ( ) in Figure 1 where we have m n = 2 once and m n = 3 twice. Yet, for each of these points, inequality (15) holds with j = 1.
• m n = 2: We apply Theorem 4.1 in order to update the control u N (·; x n ) :=û N (·; x) according to (14). Thus, since the MPC law was updated at each sampling instant, we have obtained stability of the classical MPC closed loop. • m n = 3: We utilize Theorem 4.1 in an iterative manner: since (15) holds for j = 1, we proceed as in the case m n = 2, update the control u N (·; x n ) := u N (·; x n ), and compute x µ N (2; x n ). Then, we compute u N (·; x µ N (2; x n )) and check whether or not (15) holds for (14) with j = 2. Note that here, u N (·; x n ) in (14) is already an updated control sequence. Since (15) holds true, we obtain stability of the closed loop for the updated MPC control sequence. Moreover, we applied µ N (x(s(n)), µ N (x(s(n)+1)) and µ N (x(s(n)+ 2)) instead of µ S N (i; x(s(n))), i = 0, 1, 2, i.e., we have again used classical MPC.
Note that this iterative procedure can be extended in a similar manner for all m n ≤ N − 1.
Integrating the results from Theorem 4.1 into the algorithm displayed after Proposition 3.2 can be done by changing Step (2).
(2) For j = 1, . . . , m n do (a) Implement µ S N (j − 1; x) := u N (j − 1; x) (b) Compute u N (·; x u N (j; x)) and V N (xû N (m n ; x)) (c) If j < m n and condition (15) holds: Constructû N (·; x) according to (14) Update u N (·; x) :=û N (·; x) (15) is known in advance from V N (x n ) due to the principle of optimality. Hence, only u N (·; x u N (j; x n )) and V N (xû n (m n ; x n )) need to be computed. Unfortunately, this result has to be checked for all j ∈ {1, . . . , m n −2} using the comparison basis V N (x n ). As a consequence, we always have to keep the updating instant s(n) in mind, cf. Example 4.2. The following result allows us to weaken this restriction: Proposition 4.3. Let x n ∈ X be given and inequality (11) hold for u N (·; x n ), α > 0, and m n ∈ {2, . . . , N − 1}. If the inequality V N (x u N (m n − j; x u N (j; x n ))) − V N (x u N (m n ; x n )) ≤ α mn−1 k=j (x u N (k; x n ), u N (k; x n )) (17) − (x u N (k − j; x u N (j; x n )), u N (k − j; x u N (j; x n ))) holds for some j ∈ {1, . . . , m n − 1}, then the control sequence u N (·; x n ) can be replaced by (14) and suboptimality degree α is locally maintained.
Updating the control sequence according to (14), we obtain (16) which completes the proof. 2 Remark 4.4. We also like to point out that conditions (15) and (17) allow for a less fast decrease of energy along the closed loop, i.e., the case V N (xû N (m n ; x n )) ≥ V N (x u N (m n ; x n )) is not excluded in general.
As outlined in Example 4.2, Theorem 4.1 (and analogously Theorem 4.3) may be applied iteratively. Yet, in contrast to (15), V N (x n ) is not required in (17). Hence, if an appropriate update can be found for time instant j ∈ {1, . . . , m n − 1}, the loop can be closed and, as a consequence, Theorem 4.3 can be applied to the new initial value xû(j; x n ) with respect to the reduced number Since the proposed algorithms guarantee stability for the significantly smaller horizon N = 19, the computing time for Example 2.2 is reduced by almost 50% -despite the additional computational effort for Step (2).

CONCLUSION
Based on a detailed analysis of a relaxed Lyapunov inequality, we have deduced conditions in order to close the gap between theoretical stability results and stable behavior of the MPC closed loop. Using this additional insight, we developed two MPC algorithms which check these conditions at runtime. Although the additional computational effort is not negligible, the proposed algorithms may allow us to shorten the prediction horizon used in the optimization. This reduces, in general, the complexity of the problem significantly which may imply a reduction of the overall computational costs.