1.1 What Is Nonlinear Model Predictive Control?

Nonlinear model predictive control (henceforth abbreviated as NMPC) is an optimization based method for the feedback control of nonlinear systems. Its primary applications arestabilization andtracking problems, which we briefly introduce in order to describe the basic idea of model predictive control.

Suppose we are given a controlled process whose statex(n) is measured at discrete time instantst n ,n=0,1,2,…. “Controlled” means that at each time instant we can select a control inputu(n) which influences the future behavior of the state of the system. In tracking control, the task is to determine the control inputsu(n) such thatx(n) follows a givenreference x ref(n) as good as possible. This means that if the current state is far away from the reference then we want to control the system towards the reference and if the current state is already close to the reference then we want to keep it there. In order to keep this introduction technically simple, we considerx(n)∈X=ℝd andu(n)∈U=ℝm, furthermore we consider a reference which is constant and equal tox =0, i.e.,x ref(n)=x =0 for alln≥0. With such a constant reference the tracking problem reduces to a stabilization problem; in its full generality the tracking problem will be considered in Sect. 3.3.

Since we want to be able to react to the current deviation ofx(n) from the reference valuex =0, we would like to haveu(n) infeedback form, i.e., in the formu(n)=μ(x(n)) for some mapμ mapping the statexX into the setU of control values.

The idea of model predictive control—linear or nonlinear—is now to utilize a model of the process in order to predict and optimize the future system behavior. In this book, we will use models of the form

$$x^+ = f(x,u) $$
(1.1)

wheref:X×UX is a known and in general nonlinear map which assigns to a statex and a control valueu the successor statex + at the next time instant. Starting from the current statex(n), for any given control sequenceu(0),…,u(N−1) withhorizon length N≥2, we can now iterate (1.1) in order to construct a prediction trajectoryx u defined by

$$ x_u(0) = x(n), \qquad x_u(k+1) =f\bigl(x_u(k),u(k)\bigr), \quad k=0,\ldots,N-1. $$
(1.2)

Proceeding this way, we obtain predictionsx u (k) for the state of the systemx(n+k) at timet n+k in the future. Hence, we obtain a prediction of the behavior of the system on the discrete intervalt n ,…,t n+N depending on the chosen control sequenceu(0),…,u(N−1).

Now we use optimal control in order to determineu(0),…,u(N−1) such thatx u is as close as possible tox =0. To this end, we measure the distance betweenx u (k) andx =0 fork=0,…,N−1 by a function(x u (k),u(k)). Here, we not only allow for penalizing the deviation of the state from the reference but also—if desired—the distance of the control valuesu(k) to a reference controlu , which here we also choose asu =0. A common and popular choice for this purpose is the quadratic function

$$\ell\bigl(x_u(k),u(k)\bigr) = \big\|x_u(k)\big\|^2 +\lambda\big\|u(k)\big\|^2,$$

where ‖⋅‖ denotes the usual Euclidean norm andλ≥0 is a weighting parameter for the control, which could also be chosen as 0 if no control penalization is desired. The optimal control problem now reads

$$\mbox{minimize} \quad J\bigl(x(n),u(\cdot)\bigr) := \sum_{k=0}^{N-1}\ell\bigl(x_u(k),u(k)\bigr)$$

with respect to all admissibleFootnote 1 control sequencesu(0),…,u(N−1) withx u generated by (1.2).

Let us assume that this optimal control problem has a solution which is given by the minimizing control sequenceu (0),…,u (N−1), i.e.,

$$\min_{u(0),\ldots,u(N-1)} J\bigl(x(n),u(\cdot)\bigr) = \sum_{k=0}^{N-1}\ell\bigl(x_{u^\star}(k),u^\star(k)\bigr).$$

In order to get the desired feedback valueμ(x(n)), we now setμ(x(n)):=u (0), i.e., we apply the first element of the optimal control sequence. This procedure is sketched in Fig. 1.1.

Fig. 1.1
figure 1

Illustration of the NMPC step at timet n

At the following time instantst n+1,t n+2,… we repeat the procedure with the new measurementsx(n+1),x(n+2),… in order to derive the feedback valuesμ(x(n+1)),μ(x(n+2)),…. In other words, we obtain the feedback lawμ by aniterative online optimization over the predictions generated by our model (1.1).Footnote 2 This is the first key feature of model predictive control.

From the prediction horizon point of view, proceeding this iterative way the trajectoriesx u (k),k=0,…,N provide a prediction on the discrete intervalt n ,…,t n+N at timet n , on the intervalt n+1,…,t n+N+1 at timet n+1, on the intervalt n+2,…,t n+N+2 at timet n+2, and so on. Hence, the prediction horizon is moving and thismoving horizon is the second key feature of model predictive control.

Regarding terminology, another term which is often used alternatively tomodel predictive control isreceding horizon control. While the former expression stresses the use of model based predictions, the latter emphasizes the moving horizon idea. Despite these slightly different literal meanings, we prefer and follow the common practice to use these names synonymously. The additional termnonlinear indicates that our model (1.1) need not be a linear map.

1.2 Where Did NMPC Come from?

Due to the vast amount of literature, the brief history of NMPC we provide in this section is inevitably incomplete and focused on those references in the literature from which we ourselves learned about the various NMPC techniques. Furthermore, we focus on the systems theoretic aspects of NMPC and on the academic development; some remarks on numerical methods specifically designed for NMPC can be found in Sect. 10.7. Information about the use of linear and nonlinear MPC in practical applications can be found in many articles, books and proceedings volumes, e.g., in [15,22,24].

Nonlinear model predictive control grew out of the theory of optimal control which had been developed in the middle of the 20th century with seminal contributions like the maximum principle of Pontryagin, Boltyanskii, Gamkrelidze and Mishchenko [20] and the dynamic programming method developed by Bellman [2]. The first paper we are aware of in which the central idea of model predictive control—for discrete time linear systems—is formulated was published by Propoĭ [21] in the early 1960s. Interestingly enough, in this paper neither Pontryagin’s maximum principle nor dynamic programming is used in order to solve the optimal control problem. Rather, the paper already proposed the method which is predominant nowadays in NMPC, in which the optimal control problem is transformed into a static optimization problem, in this case a linear one. For nonlinear systems, the idea of model predictive control can be found in the book by Lee and Markus [14] from 1967 on page 423:

One technique for obtaining a feedback controller synthesis from knowledge of open-loop controllers is to measure the current control process state and then compute very rapidly for the open-loop control function. The first portion of this function is then used during a short time interval, after which a new measurement of the process state is made and a new open-loop control function is computed for this new measurement. The procedure is then repeated.

Due to the fact that neither computer hardware nor software for the necessary “very rapid” computation were available at that time, for a while this observation had little practical impact.

In the late 1970s, due to the progress in algorithms for solving constrained linear and quadratic optimization problems, MPC for linear systems became popular in control engineering. Richalet, Rault, Testud and Papon [25] and Cutler and Ramaker [6] were among the first to propose this method in the area of process control, in which the processes to be controlled are often slow enough in order to allow for an online optimization, even with the computer technology available at that time. It is interesting to note that in [25] the method was described as a “new method of digital process control” and earlier references were not mentioned; it appears that the basic MPC principle was re-invented several times. Systematic stability investigations appeared a little bit later; an account of early results in that direction for linear MPC can, e.g., be found in the survey paper of García, Prett and Morari [10] or in the monograph by Bitmead, Gevers and Wertz [3]. Many of the techniques which later turned out to be useful for NMPC, like Lyapunov function based stability proofs or stabilizing terminal constraints were in fact first developed for linear MPC and later carried over to the nonlinear setting.

The earliest paper we were able to find which analyzes an NMPC algorithm similar to the ones used today is an article by Chen and Shaw [4] from 1982. In this paper, stability of an NMPC scheme with equilibrium terminal constraint in continuous time is proved using Lyapunov function techniques, however, the whole optimal control function on the optimization horizon is applied to the plant, as opposed to only the first part as in our NMPC paradigm. For NMPC algorithms meeting this paradigm, first comprehensive stability studies for schemes with equilibrium terminal constraint were given in 1988 by Keerthi and Gilbert [13] in discrete time and in 1990 by Mayne and Michalska [17] in continuous time. The fact that for nonlinear systems equilibrium terminal constraints may cause severe numerical difficulties subsequently motivated the investigation of alternative techniques. Regional terminal constraints in combination with appropriate terminal costs turned out to be a suitable tool for this purpose and in the second half of the 1990s there was a rapid development of such techniques with contributions by De Nicolao, Magni and Scattolini [7,8], Magni and Sepulchre [16] or Chen and Allgöwer [5], both in discrete and continuous time. This development eventually led to the formulation of a widely accepted “axiomatic” stability framework for NMPC schemes with stabilizing terminal constraints as formulated in discrete time in the survey article by Mayne, Rawlings, Rao and Scokaert [18] in 2000, which is also an excellent source for more detailed information on the history of various NMPC variants not mentioned here. This framework also forms the core of our stability analysis of such schemes in Chap. 5 of this book. A continuous time version of such a framework was given by Fontes [9] in 2001.

All stability results discussed so far add terminal constraints as additional state constraints to the finite horizon optimization in order to ensure stability. Among the first who provided a rigorous stability result of an NMPC scheme without such constraints were Parisini and Zoppoli [19] and Alamir and Bornard [1], both in 1995 and for discrete time systems. Parisini and Zoppoli [19], however, still needed a terminal cost with specific properties similar to the one used in [5]. Alamir and Bonnard [1] were able to prove stability without such a terminal cost by imposing a rank condition on the linearization on the system. Under less restrictive conditions, stability results were provided in 2005 by Grimm, Messina, Tuna and Teel [11] for discrete time systems and by Jadbabaie and Hauser [12] for continuous time systems. The results presented in Chap. 6 of this book are qualitatively similar to these references but use slightly different assumptions and a different proof technique which allows for quantitatively tighter results; for more details we refer to the discussions in Sects. 6.1 and6.9.

After the basic systems theoretic principles of NMPC had been clarified, more advanced topics like robustness of stability and feasibility under perturbations, performance estimates and efficiency of numerical algorithms were addressed. For a discussion of these more recent issues including a number of references we refer to the final sections of the respective chapters of this book.

1.3 How Is This Book Organized?

The book consists of two main parts, which cover systems theoretic aspects of NMPC in Chaps. 28 on the one hand and numerical and algorithmic aspects in Chaps. 910 on the other hand. These parts are, however, not strictly separated; in particular, many of the theoretical and structural properties of NMPC developed in the first part are used when looking at the performance of numerical algorithms.

The basic theme of the first part of the book is the systems theoretic analysis of stability, performance, feasibility and robustness of NMPC schemes. This part starts with the introduction of theclass of systems and the presentation ofbackground material from Lyapunov stability theory in Chap. 2 and proceeds with adetailed description of different NMPC algorithms as well as related background information on dynamic programming in Chap. 3.

A distinctive feature of this book is that both schemes with stabilizing terminal constraints as well as schemes without such constraints are considered and treated in a uniform way. This “uniform way” consists of interpreting both classes of schemes as relaxed versions ofinfinite horizon optimal control. To this end, Chap. 4 first develops the theory of infinite horizon optimal control and shows by means of dynamic programming and Lyapunov function arguments that infinite horizon optimal feedback laws are actually asymptotically stabilizing feedback laws. The main building block of our subsequent analysis is the development of arelaxed dynamic programming framework in Sect. 4.3. Roughly speaking, Theorems 4.11 and 4.14 in this section extract the main structural properties of the infinite horizon optimal control problem, which ensure

  • asymptotic or practical asymptotic stability of the closed loop,

  • admissibility, i.e., maintaining the imposed state constraints,

  • a guaranteed bound on the infinite horizon performance of the closed loop,

  • applicability to NMPC schemes with and without stabilizing terminal constraints.

The application of these theorems does not necessarily require that the feedback law to be analyzed is close to an infinite horizon optimal feedback law in some quantitative sense. Rather, it requires that the two feedback laws share certain properties which are sufficient in order to conclude asymptotic or practical asymptotic stability and admissibility for the closed loop. While our approach allows for investigating the infinite horizon performance of the closed loop for most schemes under consideration—which we regard as an important feature of the approach in this book—we would like to emphasize that near optimal infinite horizon performance is not needed for ensuring stability and admissibility.

The results from Sect. 4.3 are then used in the subsequent Chaps. 5 and6 in order to analyze stability, admissibility and infinite horizon performance properties for NMPC schemes with and without stabilizing terminal constraints, respectively. Here, the results forNMPC schemes with stabilizing terminal constraints in Chap. 5 can by now be considered as classical and thus mainly summarize what can be found in the literature, although some results—like, e.g., Theorems 5.21 and 5.22—generalize known results. In contrast to this, the results forNMPC schemes without stabilizing terminal constraints in Chap. 6 were mainly developed by ourselves and coauthors and have not been presented before in this way.

While most of the results in this book are formulated and proved in a mathematically rigorous way, Chap. 7 deviates from this practice and presents a couple ofvariants and extensions of the basic NMPC schemes considered before in a more survey like manner. Here, proofs are occasionally only sketched with appropriate references to the literature.

In Chap. 8 we return to the more rigorous style and discussfeasibility and robustness issues. In particular, in Sects. 8.18.3 we present feasibility results for NMPC schemes without stabilizing terminal constraints and without imposing viability assumptions on the state constraints which are, to the best of our knowledge, either entirely new or were so far only known for linear MPC. These results finish our study of the properties of the nominal NMPC closed-loop system, which is why it is followed by a comparative discussion of the advantages and disadvantages of the various NMPC schemes presented in this book in Sect. 8.4. The remaining sections in Chap. 8 address the robustness of the stability of the NMPC closed loop with respect to additive perturbations and measurement errors. Here we decided to present a selection of results we consider representative, partially from the literature and partially based on our own research. These considerations finish the systems theoretic part of the book.

The numerical part of the book covers two central questions in NMPC: how can we numerically compute the predicted trajectories needed in NMPC for finite-dimensional sampled data systems and how is the optimization in each NMPC step performed numerically? The first issue is treated in Chap. 9, in which we start by giving an overview onnumerical one step methods, a classical numerical technique for solving ordinary differential equations. After having looked at the convergence analysis and adaptive step size control techniques, we discuss some implementational issues for the use of this methods within NMPC schemes. Finally, we investigate how the numerical approximation errors affect the closed-loop behavior, using the robustness results from Chap. 8.

The last Chap. 10 is devoted to numerical algorithms for solving nonlinear finite horizon optimal control problems. We concentrate on so-calleddirect methods which form the currently by far preferred class of algorithms in NMPC applications. In these methods, the optimal control problem is transformed into a static optimization problem which can then be solved by nonlinear programming algorithms. We describe different ways of how to do this transformation and then give a detailed introduction into some popular nonlinear programming algorithms for constrained optimization. The focus of this introduction is on explaining how these algorithms work rather than on a rigorous convergence theory and its purpose is twofold: on the one hand, even though we do not expect our readers to implement such algorithms, we still think that some background knowledge is helpful in order to understand the opportunities and limitations of these numerical methods. On the other hand, we want to highlight the key features of these algorithms in order to be able to explain how they can be efficiently used within an NMPC scheme. This is the topic of the final Sects. 10.410.6, in which several issues regarding efficient implementation, warm start and feasibility are investigated. Like Chap. 7 and in contrast to the other chapters in the book, Chap. 10 has in large parts a more survey like character, since a comprehensive and rigorous treatment of these topics would easily fill an entire book. Still, we hope that this chapter contains valuable information for those readers who are interested not only in systems theoretic foundations but also in the practical numerical implementation of NMPC schemes.

Last but not least, for all examples presented in this book we offer either MATLAB or C++ code in order to reproduce our numerical results. This code is available from the web page

www.nmpc-book.com

Both our MATLAB NMPC routine—which is suitable for smaller problems—as well as our C++ NMPC package—which can also handle larger problems with reasonable computing time—can also be modified in order to perform simulations for problems not treated in this book. In order to facilitate both the usage and the modification, the Appendix contains brief descriptions of our routines.

Beyond numerical experiments, almost every chapter contains a small selection of problems related to the more theoretical results. Solutions for these problems are available from the authors upon request by email. Attentive readers will note that several of these problems—as well as some of our examples—are actually linear problems. Even though all theoretical and numerical results apply to general nonlinear systems, we have decided to include such problems and examples, because nonlinear problems hardly ever admit analytical solutions, which are needed in order to solve problems or to work out examples without the help of numerical algorithms.

Let us finally say a few words on the class of systems and NMPC problems considered in this book. Most results are formulated for discrete time systems on arbitrary metric spaces, which in particular covers finite- and infinite-dimensional sampled data systems. The discrete time setting has been chosen because of its notational and conceptual simplicity compared to a continuous time formulation. Still, since sampled data continuous time systems form a particularly important class of systems, we have made considerable effort in order to highlight the peculiarities of this system class whenever appropriate. This concerns, among other topics, the relation between sampled data systems and discrete time systems in Sect. 2.2, the derivation of continuous time stability properties from their discrete time counterparts in Sect. 2.4 and Remark 4.13, the transformation of continuous time NMPC schemes into the discrete time formulation in Sect. 3.5 and the numerical solution of ordinary differential equations in Chap. 9. Readers or lecturers who are interested in NMPC in a pure discrete time framework may well skip these parts of the book.

The most general NMPC problem considered in this bookFootnote 3 is the asymptotic tracking problem in which the goal is to asymptotically stabilize a time varying referencex ref(n). This leads to a time varying NMPC formulation; in particular, the optimal control problem to be solved in each step of the NMPC algorithm explicitly depends on the current time. All of the fundamental results in Chaps. 24 explicitly take this time dependence into account. However, in order to be able to concentrate on concepts rather than on technical details, in the subsequent chapters we often decided to simplify the setting. To this end, many results in Chaps. 58 are first formulated for time invariant problemsx refx —i.e., for stabilizing anx —and the necessary modifications for the time varying case are discussed afterwards.

1.4 What Is Not Covered in This Book?

The area of NMPC has grown so rapidly over the last two decades that it is virtually impossible to cover all developments in detail. In order not to overload this book, we have decided to omit several topics, despite the fact that they are certainly important and useful in a variety of applications. We end this introduction by giving a brief overview over some of these topics.

For this book, we decided to concentrate on NMPC schemes with online optimization only, thus leaving out all approaches in which part of the optimization is carried out offline. Some of these methods, which can be based on both infinite horizon and finite horizon optimal control and are often termedexplicit MPC, are briefly discussed in Sects. 3.5 and4.4. Furthermore, we will not discuss special classes of nonlinear systems like, e.g., piecewise linear systems often considered in the explicit MPC literature.

Regarding robustness of NMPC controllers under perturbations, we have restricted our attention to schemes in which the optimization is carried out for a nominal model, i.e., in which the perturbation is not explicitly taken into account in the optimization objective, cf. Sects. 8.58.9. Some variants of model predictive control in which the perturbation is explicitly taken into account, like min–max MPC schemes building on game theoretic ideas or tube based MPC schemes relying on set oriented methods are briefly discussed in Sect. 8.10.

An emerging and currently strongly growing field are distributed NMPC schemes in which the optimization in each NMPC step is carried out locally in a number of subsystems instead of using a centralized optimization. Again, this is a topic which is not covered in this book and we refer to, e.g., Rawlings and Mayne [23, Chap. 6] and the references therein for more information.

At the very heart of each NMPC algorithm is a mathematical model of the systems dynamics, which leads to the discrete time dynamicsf in (1.1). While we will explain in detail in Sect. 2.2 and Chap. 9 how to obtain such a discrete time model from a differential equation, we will not address the question of how to obtain a suitable differential equation or how to identify the parameters in this model. Both modeling and parameter identification are serious problems in their own right which cannot be covered in this book. It should, however, be noted that optimization methods similar to those used in NMPC can also be used for parameter identification; see, e.g., Schittkowski [26].

A somewhat related problem stems from the fact that NMPC inevitably leads to a feedback law in which the full statex(n) needs to be measured in order to evaluate the feedback law, i.e., a state feedback law. In most applications, this information is not available; instead, only output informationy(n)=h(x(n)) for some output maph is at hand. This implies that the statex(n) must be reconstructed from the outputy(n) by means of a suitable observer. While there is a variety of different techniques for this purpose, it is interesting to note that an idea which is very similar to NMPC can be used for this purpose: in the so-calledmoving horizon state estimation approach the state is estimated by iteratively solving optimization problems over a moving time horizon, analogous to the repeated minimization ofJ(x(n),u(⋅)) described above. However, instead of minimizing the future deviations of the predictions from the reference value, here the past deviations of the trajectory from the measured output values are minimized. More information on this topic can be found, e.g., in Rawlings and Mayne [23, Chap. 4] and the references therein.