alphaFeedback

WorksEngineering

Certified Neural Approximation of Robust Nonlinear Model Predictive Control

AI contributions
Not recorded for this paper
View details

Abstract

Model predictive control is a high-performance control method, but it incurs comparatively high online computational costs across many control tasks and is challenging to realize in low-level hardware settings. To address this, we present a framework for generating neural network controllers that provably inherit the safety and stability guarantees of a robust model predictive policy. In contrast to approaches based on post-verification or additional online safety filters, our method provides constructive, a priori design conditions that ensure preservation of recursive feasibility and stability before deployment. We treat the approximation error as a bounded input disturbance, which is addressed in the MPC design. This allows the neural network controller to directly inherit robustness from the underlying model predictive controller, which enables the transfer of guarantees to the approximation. The design process is an offline, constructive synthesis pipeline and can be implemented once Lipschitz bounds are specified. We further demonstrate in simulation that the learned controller reproduces the closed-loop behavior of the original controller while reducing online computation.

Introduction

Model predictive control (MPC) has been well-established as a reliable feedback control approach that is based on solving an underlying optimal control problem repeatedly and online in a receding horizon fashion [11, 21, 28]. As such, it can handle a variety of systems, can include input, state, and output constraints, and ensure near-optimal closed-loop behavior with respect to a given control objective. These properties have led to its widespread adoption in industry and research. However, the need to solve the optimal control problem online can impose a computational burden, posing implementation challenges in resource-constrained environments, such as embedded hardware, due to the demanding nature of the optimization process.

To address this challenge, various approaches have been proposed. For example, in the linear–quadratic case with linear dynamics, quadratic costs, and polytopic state and input constraints, explicit MPC yields a feedback law that is piecewise affine in the state. This structural property enables explicit MPC to compute the feedback law offline in closed form, thereby avoiding the need to solve an optimization problem online [1, 35]. However, the number of regions of the piecewise affine law grows, in the worst case, exponentially with the total number of inequality constraints, which in turn increases with the horizon length and the number of constrained states and inputs. Consequently, both the offline computation and memory complexity become rapidly intractable as the problem size grows.

This motivates the development of approximation- and learning-based approaches that mimic the implicit MPC feedback law [7, 8, 12, 15, 17, 20, 22, 23, 24, 27, 29, 33]. Among the available function approximators, neural networks (NNs) are particularly attractive and employed in this work due to their universal approximation capabilities [13, 14] and their ability to maintain a fixed evaluation effort with growing state dimension, input dimension, and dataset sizes. These properties have motivated numerous neural imitation-learning approaches for approximating MPC feedback laws. Nevertheless, the choice of function approximator alone does not determine how closed-loop guarantees are obtained. Existing approaches can be distinguished more coherently by how the approximation error is incorporated into the control design and how compliance with a prescribed error bound is certified.

One prominent guarantee-transfer paradigm consists of two steps. First, the MPC is designed to be robust against a prescribed approximation error, which is interpreted as a bounded disturbance acting on the system state. Second, an explicit approximation of the resulting MPC feedback law is constructed such that its error satisfies the prescribed bound. An early NN-based formulation of this approach was presented in [12], where Hoeffding’s inequality is used to validate statistically whether the learned controller satisfies the admissible input-error bound. If validation fails, additional samples are generated, and the learning procedure is repeated. Building on this framework, [24] extends the approach to nonlinear setpoint tracking and introduces a less conservative validation criterion that jointly accounts for approximation error and model mismatch. In [2], statistical post-validation is replaced by a deterministic condition that combines Lipschitz properties of the MPC feedback law and the NN with the coverage of the training data.

This disturbance-based guarantee-transfer principle is independent of the chosen function approximator. In [29], a Gaussian process is used to learn the MPC feedback law, and compliance with the required error bound is established through tailored training-data selection. Recently, [33] employs automatic kernel interpolation to construct an explicit surrogate whose approximation error is uniformly bounded by design, under the assumption that the feedback law belongs to the associated reproducing kernel Hilbert space (RKHS) with a known norm bound. Similarly, [30] uses kernel interpolation on the closed-loop reachable set and Monte Carlo reachability analysis to certify safety and closed-loop performance. These approaches share the disturbance-based guarantee-transfer principle of the NN methods above, but differ in the choice of approximator, the associated regularity assumptions, and the mechanism used to certify the approximation error.

Other NN-based approaches obtain guarantees through direct error certification, structural restrictions, or online correction mechanisms. In [8], semidefinite programming is used to bound the worst-case difference between the NN and MPC feedback laws, while [27] uses an optimization-based projection to preserve constraint satisfaction and stability. Building on constrained NN approximations of explicit MPC laws [7, 23], deep piecewise-affine networks provide approximation guarantees by design [17]. For nonlinear MPC, [15] validates NN proposals online and uses an MPC-intrinsic fallback when needed, while [20, 22] learn MPC laws from trajectory data, with [22] improving data efficiency through gradient-informed Sobolev training.

Against this background, we develop a constructive framework for the certified neural approximation of robust nonlinear MPC. The framework adopts the disturbance-based viewpoint of [12, 24, 29, 33], but derives a deterministic certificate from dataset coverage and Lipschitz bounds, thereby preserving closed-loop guarantees without relying on statistical validation or requiring membership of the MPC feedback law in a prescribed RKHS with a corresponding norm bound. We generalize the framework of [2] to MPC feedback laws that need not be globally Lipschitz continuous, establishing guarantee transfer under local regularity conditions along the closed-loop trajectory. To this end, we first design a robust MPC for a prescribed disturbance bound and derive conditions ensuring that a neural network trained on MPC state-input data satisfies this bound, thereby preserving safety and stability without post-verification or auxiliary safety mechanisms. We further validate these guarantees in closed-loop operation. Our main contributions are:

  1. A priori conditions are derived that link the Lipschitz properties of the MPC feedback law and the coverage of the training data to certified bounds on the approximation error.

  2. A constructive offline procedure is developed to obtain a neural network approximator that satisfies these bounds, enabling systematic training of the network.

  3. It is shown that, under these conditions, the learned neural network controller inherits the recursive feasibility and stability properties of the robust MPC, ensuring safe and reliable closed-loop operation.

The remainder of this article is structured as follows. In Section 2, we formulate the problem and introduce the robust MPC scheme. Section 3 introduces the basics of the neural networks used, details our theoretical results on the neural network approximation of the underlying MPC, and further includes an overview of the constructive procedure enabling the generation of the neural networks in line with the previously established theory. We illustrate the effectiveness of our proposed approach in Section 4 in simulation using a 4-dimensional continuously stirred tank reactor example before concluding in Section 5.

Robust MPC as a Basis for Certified Controller Approximation

We first show that the neural network approximation error enters the system as a bounded input disturbance. Using Lipschitz continuity of the system dynamics, this input disturbance can be equivalently reformulated as a bounded additive state disturbance. This reformulation allows us to cast the closed-loop system in a standard robust control setting. Based on this representation, we introduce the robust nonlinear MPC scheme that forms the basis for transferring safety and stability guarantees to the neural network controller. The presentation focuses on a robust MPC formulation for additive state disturbances, which is sufficient for our subsequent analysis. We conclude the section by recalling the key closed-loop properties of the robust MPC, in particular, recursive feasibility and input-to-state stability.

System Description and Control Task

We consider nonlinear discrete-time systems given by

xk+1=f(xk,uk),(1)x_{k+1} = f(x_k,u_k), \tag*{(1)}

where xk∈Rnxx_k \in\mathbb{R}^{n_x} and uk∈Rnuu_k \in\mathbb{R}^{n_u} describe the system state and input, respectively, and k∈N0k \in\mathbb{N}_0 denotes the discrete time index. The transition map is given by f:Rnx×Rnu→Rnxf : \mathbb{R}^{n_x} \times\mathbb{R}^{n_u} \to\mathbb{R}^{n_x} and captures the dynamics of the system. The objective is to stabilize the system (1) at the origin (w.l.o.g.) while satisfying input and state constraints given by

∀k∈N: uk∈U⊂Rnu, xk∈X⊂Rnx.(2)\forall k \in\mathbb{N} : \ u_k \in\mathcal{U} \subset\mathbb{R}^{n_u}, \ x_k \in\mathcal{X} \subset\mathbb{R}^{n_x}. \tag*{(2)}

While model predictive control is well-suited for this task, it requires the online solution of a possibly large-scale optimization problem, typically through iterative methods. Thus, we aim to control the system (1) by a low-complexity neural network approximation κNN\kappa_{\mathrm{NN}} of the model predictive feedback law u=κ(x)u=\kappa(x) to reduce computational demands or enable formal verification of the explicit feedback law. However, the use of the neural network introduces an approximation error

e(x)=κ(x)−κNN(x),(3)e(x)=\kappa(x)-\kappa_{\mathrm{NN}}(x), \tag*{(3)}

which manifests as an additive disturbance on the control input. If this disturbance is appropriately accounted for in the MPC design, the safety and stability guarantees can be transferred to the neural network controller.

To do so, we rely on a pre-specified bound on the neural network’s approximation error, which we ensure through suitable data selection and training. That is, we assume that we know ϵ>0\epsilon>0 such that the approximation error in (3) satisfies ∀x∈X: ∥e∥≤ϵ\forall x\in\mathcal{X}:\ \lVert e\rVert\leq\epsilon.2 We then reformulate the resulting bounded input disturbance as a bounded additive disturbance acting on the state of the system (1) under the feedback law κ\kappa. This state disturbance is then addressed within a robust MPC formulation, allowing guarantees established for the closed-loop system under the robust MPC to carry over to any approximate controller that satisfies the prescribed error bound. The crucial step is to design a neural network that provably adheres to the predefined approximation error. To this end, we exploit Lipschitz continuity properties of both the MPC feedback law and the neural network, together with a data coverage criterion for the training data with respect to the domain X\mathcal{X}.

We make the following assumptions on the properties of the system and constraint sets.

Assumption 1 The transition map f:Rnx×Rnu→Rnxf:\mathbb{R}^{n_x}\times\mathbb{R}^{n_u}\to\mathbb{R}^{n_x} is twice continuously differentiable in xx and uu on Rnx×Rnu\mathbb{R}^{n_x}\times\mathbb{R}^{n_u}, denoted by f∈C2(Rnx×Rnu,Rnx)f\in C^2(\mathbb{R}^{n_x}\times\mathbb{R}^{n_u},\mathbb{R}^{n_x}). Moreover, it holds that f(0,0)=0f(0,0)=0.

Note that the differentiability property in Assumption 1 is needed to apply a known result from parametric optimization regarding the structural properties of the MPC feedback law, which constitutes the first of two key components enabling the transfer of guarantees from the robust MPC to the neural network controller. In practice, many commonly considered systems satisfy this assumption.

Assumption 2 The sets U\mathcal{U} and X\mathcal{X} are compact and given by U:={giu(u)≤0∣i=1,…,ncu}\mathcal{U}:=\{g_i^u(u)\leq0\mid i=1,\ldots,n_c^u\} and X:={gix(x)≤0∣i=1,…,ncx}\mathcal{X}:=\{g_i^x(x)\leq0\mid i=1,\ldots,n_c^x\}, where the twice continuously differentiable functions giu(u)∈C2(Rnu,R)g_i^u(u)\in C^2(\mathbb{R}^{n_u},\mathbb{R}) and gix(x)∈C2(Rnx,R)g_i^x(x)\in C^2(\mathbb{R}^{n_x},\mathbb{R}). Moreover, we have that (0,0)∈int⁡(X×U)(0,0)\in\operatorname{int}(\mathcal{X}\times\mathcal{U}).

As before, Assumption 2 is necessary to ensure the desired structural properties of the optimal control problem underlying the MPC feedback law. However, most practical MPC formulations employ polytopic or ellipsoidal sets for X\mathcal{X} and U\mathcal{U}, for which Assumption 2 holds.

From Input Approximation Error to State Disturbance

Most robust MPC formulations account for state disturbances. Therefore, we reformulate the approximation error as an equivalent state disturbance, enabling the application of a broad class of robust MPC formulations that provide a priori guarantees of closed-loop robustness to the neural network controller’s approximation error.

Assumptions 1 and 2 imply Lipschitz continuity of the transition map ff with respect to both xx and uu on the compact domain X×U\mathcal{X}\times\mathcal{U}. That is, there exist finite constants Lf,x>0L_{f,x}>0 and Lf,u>0L_{f,u}>0 such that

∥f(x,u)−f(x,u′)∥≤Lf,u∥u−u′∥,(4)\lVert f(x,u)-f(x,u')\rVert\leq L_{f,u}\lVert u-u'\rVert, \tag*{(4)}
∥f(x,u)−f(x′,u)∥≤Lf,x∥x−x′∥.(5)\lVert f(x,u)-f(x',u)\rVert\leq L_{f,x}\lVert x-x'\rVert. \tag*{(5)}

hold for all x,x′∈Xx,x'\in\mathcal{X} and u,u′∈Uu,u'\in\mathcal{U}. Hence, (4a) implies that the bounded input approximation error induces a bounded additive disturbance ww on the system states,

xk+1=f(xk,uk+ek)≡f(xk,uk)+wk,∥wk∥=∥f(xk,uk+ek)−f(xk,uk)∥≤Lf,uϵ,(6)x_{k+1}=f(x_k,u_k+e_k)\equiv f(x_k,u_k)+w_k,\quad\lVert w_k\rVert=\lVert f(x_k,u_k+e_k)-f(x_k,u_k)\rVert\leq L_{f,u}\epsilon, \tag*{(6)}

exploiting knowledge of a bound ϵ>0\epsilon>0 on the approximation error. We emphasize that this approximation error bound is a design parameter. We will later show that it is indeed possible to construct a neural network approximator that satisfies any prescribed bound.

Having rewritten the approximation error as a bounded additive disturbance in (5), the closed-loop dynamics under the neural network controller fit the standard setting of robust MPC.

Robust MPC Design and Closed-Loop Guarantees

The general idea of robust MPC schemes is to analyze a nominal system model subject to appropriately tightened constraints, such that satisfaction of the tightened constraints by the undisturbed system implies satisfaction of the original constraints by the disturbed system. This enables the establishment of robust recursive feasibility guarantees in closed-loop operation. Furthermore, the optimal value function of a robust MPC scheme is typically used as a Lyapunov function candidate to derive robust stability guarantees for the closed-loop system.

Without loss of generality, we adopt the robust MPC scheme proposed in [19]3, whose underlying optimal control problem is given by

min⁡uk∑n=0N−1l(xˉn∣k,un∣k)+VT(xˉN∣k)s.t.∀n∈{0,…,N−1}:xˉn+1∣k=f(xˉn∣k,un∣k),xˉ0∣k=xk,un∣k∈U⊖{u∈Rnu∣∥u∥≤ϵ},xˉn∣k∈X⊖Wn,xˉN∣k∈XT={x∈Rnx∣VT(x)≤αv}.(7)\begin{aligned} \min_{u_k}\quad&\sum_{n=0}^{N-1} l(\bar{x}_{n|k},u_{n|k})+V_{\mathrm{T}}(\bar{x}_{N|k}) \\ \text{s.t.}\quad&\forall n\in\{0,\ldots,N-1\}: \\ &\bar{x}_{n+1|k}=f(\bar{x}_{n|k},u_{n|k}),\quad\bar{x}_{0|k}=x_k, \\ &u_{n|k}\in\mathcal{U}\ominus\{u\in\mathbb{R}^{n_u}\mid\lVert u\rVert\le\epsilon\}, \\ &\bar{x}_{n|k}\in\mathcal{X}\ominus\mathcal{W}_n, \\ &\bar{x}_{N|k}\in\mathcal{X}_{\mathrm{T}}=\{x\in\mathbb{R}^{n_x}\mid V_{\mathrm{T}}(x)\le\alpha_v\}. \tag*{(7)} \end{aligned}

Here, xˉn∣k\bar{x}_{n|k} denotes the nominal state prediction nn steps ahead of the current time kk, un∣ku_{n|k} denotes the planned future control inputs nn steps ahead of the current time kk, and N∈NN\in\mathbb{N}, denotes the prediction horizon. The nominal state predictions are computed using the nominal system model (6b) initialized with the most recent state information xkx_k. The control objective is encoded in the cost function in (6a), which is composed of the stage cost l:Rnx×Rnu→[0,∞)l:\mathbb{R}^{n_x}\times\mathbb{R}^{n_u}\to[0,\infty) and the terminal cost VT:Rnx→[0,∞)V_{\mathrm{T}}:\mathbb{R}^{n_x}\to[0,\infty). We assume the following for the stage and the terminal cost functions.

Assumption 3 The stage and the terminal cost functions are twice continuously differentiable, i.e., l∈C2(Rnx×Rnu,[0,∞))l\in C^2(\mathbb{R}^{n_x}\times\mathbb{R}^{n_u},[0,\infty)) and VT∈C2(Rnx,[0,∞))V_{\mathrm{T}}\in C^2(\mathbb{R}^{n_x},[0,\infty)). Moreover, ll and VTV_{\mathrm{T}} are positive definite w.r.t. to the origin.

Note that Assumption 3 is satisfied by many commonly used stage and terminal cost functions, including quadratic costs typically employed in regulation (and, by extension, tracking) problems. Moreover, Assumption 3 implies that the stage and terminal cost functions are Lipschitz continuous on the compact domain X×U\mathcal{X}\times\mathcal{U} and X\mathcal{X}, respectively, with Lipschitz constants Ll,Lv>0L_l,L_v>0.

We impose the input constraint in (6c), where ⊖\ominus denotes the Pontryagin difference. This tightening of the original input constraints in (2) accounts for the approximation error introduced by the neural network controller.

Similarly, the state constraints in (2) appear in a tightened form in (6d), where they are imposed on the nominal system state. This tightening captures the effect of the (propagated) approximation error of the neural network controller on the system’s behavior. It is performed based on the sets

Wn={e∈Rnx | ∥e∥≤Lf,xn−1Lf,x−1Lf,uϵ}.(8)\mathcal{W}_n=\left\{e\in\mathbb{R}^{n_x}\ \middle|\ \lVert e\rVert\le\frac{L_{f,x}^{n}-1}{L_{f,x}-1}L_{f,u}\epsilon\right\}. \tag*{(8)}

Here the sets Wn\mathcal{W}_n overapproximate the possible — but a priori unknown — realizations of the mismatch between the nominal system and the disturbed system after nn steps. Hence, the constraint tightening in (6d) ensures that the state constraints will be satisfied by the system (1) under the approximate neural network controller.

The terminal region constraint in (6e), with a suitably chosen parameter αv>0\alpha_v>0, is used to guarantee recursive feasibility and stability of the closed-loop system under the MPC.

The optimal control problem (6) is repeatedly solved at any time kk with updated initial condition xkx_k, and the first element u0∣k∗u^*_{0|k} of the optimal input sequence uk∗=(u0∣k∗,…,uN−1∣k∗)\mathbf{u}^*_k=(u^*_{0|k},\ldots,u^*_{N-1|k}) is applied to the system (1). This implicitly defines the MPC feedback law

uk=κ(xk),κ(xk):=u0∣k∗.(9)u_k=\kappa(x_k),\quad\kappa(x_k):=u^*_{0|k}. \tag*{(9)}

We assume that the following conditions hold [19].

Assumption 4 Let α>0\alpha>0 and define the set Φ:={x∈X∣VT(x)≤α}\Phi:=\{x\in\mathcal{X}\mid V_{\mathrm{T}}(x)\le\alpha\}. Assume there exists a terminal feedback control law u=κT(x)u=\kappa_{\mathrm{T}}(x), κT:Φ→U\kappa_{\mathrm{T}}:\Phi\to\mathcal{U} and a constant αv\alpha_v with 0<αv≤α0<\alpha_v\le\alpha such that:

(i) The terminal controller satisfies the tightened input constraints when evaluated for x∈Φx\in\Phi, i.e., Φ⊂{x∈X∣κT(x)∈U⊖{u∈Rnu∣∥u∥≤ϵ}}\Phi\subset\{x\in\mathcal{X}\mid\kappa_{\mathrm{T}}(x)\in\mathcal{U}\ominus\{u\in\mathbb{R}^{n_u}\mid\lVert u\rVert\le\epsilon\}\}.

(ii) The set Φ\Phi and the terminal controller are such that f(x,κT(x))∈XTf(x,\kappa_{\mathrm{T}}(x))\in\mathcal{X}_{\mathrm{T}} holds for all x∈Φx\in\Phi, where XT={x∈Rnx∣VT(x)≤αv}\mathcal{X}_{\mathrm{T}}=\{x\in\mathbb{R}^{n_x}\mid V_{\mathrm{T}}(x)\le\alpha_v\} is the terminal region used in the optimal control problem in (6e). Consequently, Φ\Phi is robustly forward invariant for the system (5) under u=κT(x)u=\kappa_{\mathrm{T}}(x).

(iii) The terminal cost VTV_{\mathrm{T}} is a Lyapunov function for the nominal system under the terminal controller on Φ\Phi, i.e., there exist class-K∞\mathcal{K}_{\infty} functions α‾,α‾\underline{\alpha},\overline{\alpha} satisfying

α‾(∥x∥)≤VT(x)≤α‾(∥x∥),\underline{\alpha}(\lVert x\rVert)\le V_{\mathrm{T}}(x)\le\overline{\alpha}(\lVert x\rVert),
VT(f(x,κT(x)))−VT(x)≤−l(x,κT(x)),V_{\mathrm{T}}(f(x,\kappa_{\mathrm{T}}(x)))-V_{\mathrm{T}}(x)\le-l(x,\kappa_{\mathrm{T}}(x)),

for all x∈Φx\in\Phi.

(iv) The neural network approximation error ϵ\epsilon satisfies

Lf,uϵ≤α−αvLvLf,xN−1.L_{f,u}\epsilon\le\frac{\alpha-\alpha_v}{L_vL_{f,x}^{N-1}}.

Under these assumptions, the MPC defined by the optimal control problem (6) is recursive feasible and robustly stabilizes the system (1), as stated in the following theorem.

Theorem 5 (Recursive feasibility and stability [19]). Suppose Assumptions 1, 2, 3, and 4 hold. Then, if the optimal control problem (6) is initially feasible, it remains recursively feasible. Moreover, the origin is input-to-state stable for the disturbed system (5) under the MPC feedback law (8).

Corollary 6 The set of feasible initial conditions, defined as XN={x∈X∣Problem (6) admits a solution}\mathcal{X}_{N} = \{x \in\mathcal{X} \mid\text{Problem (6) admits a solution}\}, is robustly forward invariant for the disturbed system (5) under the MPC feedback law (8). That is, x∈XN⇒(f(x,κ(x))+w)∈XNx \in\mathcal{X}_{N} \Rightarrow(f(x,\kappa(x)) + w) \in\mathcal{X}_{N} holds for all disturbances ww satisfying ∥w∥≤Lf,uϵ\lVert w \rVert\le L_{f,u}\epsilon.

These results establish the foundation for extending the safety and stability guarantees of the MPC scheme to the neural network controller, as discussed in the next section.4

Certified Neural Approximation of the MPC Feedback Law

We begin by reviewing the fundamentals of feed-forward neural networks, which we employ as function approximators to learn the MPC feedback law. Thereafter, we present our main contribution. First, we derive conditions under which the neural network is guaranteed to satisfy a prescribed approximation error bound. Second, we discuss how safety and stability guarantees of the original MPC transfer to the neural network controller. The section concludes with an algorithm for constructing the neural network controller.

Feed-Forward Neural Networks

We employ neural networks to approximate the feedback law κNN\kappa_{\mathrm{NN}}, motivated by their ability to represent nonlinear functions accurately [13, 14], while retaining a fixed online evaluation structure that is independent of the size of the training dataset. This is particularly attractive for our approach, where large offline datasets are required, as discussed in § 3.1.1. Specifically, we restrict ourselves to feed-forward neural networks trained offline via supervised learning techniques and ensure differentiability of the neural networks by choosing differentiable activation functions. Particularly, the jthj^{\text{th}} layer of a NN can be written as

hj=σj∘ζj(hj−1):=σj(Ajhj−1+bj).h_j = \sigma_j \circ\zeta_j(h_{j-1}) := \sigma_j(A_j h_{j-1} + b_j).

Here, ζj\zeta_j denotes the affine transformation of the jthj^{\text{th}} layer’s inputs, defined through the weight matrix Aj∈Rnhj×nhj−1A_j \in\mathbb{R}^{n_{h_j} \times n_{h_{j-1}}} and the bias vector bj∈Rnhjb_j \in\mathbb{R}^{n_{h_j}}. The nonlinear function σj:Rnhj→Rnhj\sigma_j : \mathbb{R}^{n_{h_j}} \to\mathbb{R}^{n_{h_j}} encodes the element-wise application of an activation function to ζj(hj−1)\zeta_j(h_{j-1}) to produce the output hjh_j. A feed-forward NN is now the composition of all layers and their activations, denoted as

κNN(x):=ζm∘σm−1∘ζm−1∘…∘σ1∘ζ1(x),(10)\kappa_{\mathrm{NN}}(x) := \zeta_m \circ\sigma_{m-1} \circ\zeta_{m-1} \circ\ldots\circ\sigma_1 \circ\zeta_1(x), \tag*{(10)}

where mm is the total number of layers in the network. Since the activation functions σj\sigma_j are differentiable, and ζj\zeta_j is affine

and therefore differentiable, their composition (9) is also differentiable. This implies that the NN (9) is Lipschitz continuous on the compact domain X\mathcal{X}.

By exploiting Lipschitz continuity of the neural network, we derive conditions under which the NN satisfies a prescribed error bound in the next section. However, it is important to note that the results presented are not limited to feed-forward neural networks. Rather, any neural network that is Lipschitz continuous on X\mathcal{X} can be used. We formalize this requirement in the more general assumption below.

Assumption 7 The neural network approximator κNN\kappa_{\mathrm{NN}} is Lipschitz continuous on X\mathcal{X}, i.e., there exists a constant 0<LNN<∞0 < L_{\mathrm{NN}} < \infty such that ∥κNN(x1)−κNN(x2)∥≤LNN∥x1−x2∥\lVert\kappa_{\mathrm{NN}}(x_1) - \kappa_{\mathrm{NN}}(x_2) \rVert\le L_{\mathrm{NN}}\lVert x_1 - x_2 \rVert holds for all x1,x2∈Xx_1, x_2 \in\mathcal{X}.

Approximation Error Bounds

The results presented here develop the Lipschitz-based approximation approach introduced in [2 Theorem 1] into a certified approximation setting for robust nonlinear MPC. As in that work, our approach relies primarily on two key aspects: (i) the careful design of the training data and the accuracy of the NN approximator on the training data, and (ii) regularity properties of the MPC feedback law (8). We begin by discussing the requirements for the training data and the neural network’s accuracy on it.

The neural network is trained on a dataset D={(xi,κ(xi))∣i∈{1,…,nD}}\mathcal{D} = \{(x_i,\kappa(x_i)) \mid i \in\{1,\ldots,n_{\mathcal{D}}\}\} consisting of nDn_{\mathcal{D}} observations of the MPC feedback law (8) on the domain X\mathcal{X}. Specifically, we will explore coverage properties of the set of training inputs, {xi∣i=1,…,nD}\{x_i \mid i = 1,\ldots,n_{\mathcal{D}}\}, on X\mathcal{X}, as defined below.

Definition 8 Let (A,ρ)(\mathcal{A},\rho) be a metric space and let ∞>δ>0\infty> \delta> 0. A subset P⊆A\mathcal{P} \subseteq\mathcal{A} provides a δ\delta-coverage of A\mathcal{A} if, for every a∈Aa \in\mathcal{A}, there exists p∈Pp \in\mathcal{P} such that ρ(a,p)≤δ\rho(a,p) \le\delta.

We further assume that an arbitrary prescribed training accuracy on a dataset D\mathcal{D} can be attained through a suitable choice of network architecture and training procedure, as formalized in Assumption 10. This assumption is motivated by Lemma 9, which establishes the existence of a neural network achieving any prescribed accuracy on a finite dataset.

Lemma 9 (Existence of an ϵD\epsilon_{\mathcal{D}}-interpolating NN; proof in supplementary Section S3.) Let D={(xi,yi)∈Rd×Rp∣i∈{1,…,nD}}\mathcal{D} = \{(x_i,y_i) \in\mathbb{R}^{d} \times\mathbb{R}^{p} \mid i \in\{1,\ldots,n_{\mathcal{D}}\}\} be a dataset with pairwise distinct inputs xix_i and ϵD>0\epsilon_{\mathcal{D}} > 0 a given constant. Then there exists a feed-forward neural network f~:Rd→Rp\tilde{f} : \mathbb{R}^{d} \to\mathbb{R}^{p} with any continuous non-polynomial activation function such that ∥f~(xi)−yi∥≤ϵD\lVert\tilde{f}(x_i) - y_i \rVert\le\epsilon_{\mathcal{D}} for all i=1,…,nDi = 1,\ldots,n_{\mathcal{D}}.

Assumption 10 Given ϵD>0\epsilon_{\mathcal{D}} > 0 and a training dataset D\mathcal{D}, there exists a choice of training procedure and network architecture such that the trained network κNN\kappa_{\mathrm{NN}} satisfies ∥κ(xi)−κNN(xi)∥≤ϵD\lVert\kappa(x_i) - \kappa_{\mathrm{NN}}(x_i) \rVert\le\epsilon_{\mathcal{D}} for all (xi,κ(xi))∈D(x_i,\kappa(x_i)) \in\mathcal{D}.

Lemma 9 establishes the existence of a feedforward neural network with any prescribed in-sample accuracy, whereas Assumption 10 additionally requires that such accuracy be attainable through a suitable training procedure and architecture. Both statements concern only the samples in D\mathcal{D}; they imply neither convergence of a particular training procedure nor generalization beyond the training data. The training-set bound is extended to a uniform approximation bound below by combining it with the regularity properties of the MPC and NN policies and the coverage of the training inputs. We therefore begin by considering the regularity of the MPC feedback law (8). To this end, we note that the optimal control problem (6) is a parametric optimization problem, where the parameter is the initial state xkx_k in (6b). Specifically, we can express the nominal state xˉn∣k\bar{x}_{n\mid k}, n∈{0,…,N}n \in\{0,\ldots,N\}, in (6b) as a function of the initial state and the input (sub-)sequence, as xˉn∣k=ψ(n;xk,uk)\bar{x}_{n\mid k}=\psi(n;x_k,u_k). Since ψ\psi is defined via the nn-fold application of the dynamics ff, and ff is twice continuously differentiable in xx and uu, ψ\psi is twice continuously differentiable in xkx_k and uku_k. Substituting ψ(n;xk,uk)\psi(n;x_k,u_k) for the states xˉn∣k\bar{x}_{n\mid k} in the cost function (6a) and the constraints (6d) and (6e) enables us to write the optimal control problem (6) generically as

min⁡ukJ(uk,xk)s.t.Gi(uk,xk)≤0,i=1,…,N(ncu+ncx)+1.(11)\begin{aligned} \min_{u_k}\quad&J(u_k,x_k)\\ \text{s.t.}\quad&G_i(u_k,x_k)\leq0,\quad i=1,\ldots,N(n_c^u+n_c^x)+1. \tag*{(11)} \end{aligned}

Again, since self-compositions and sums of twice continuously differentiable functions remain twice continuously differentiable, Assumptions 1, 2, and 3 imply that the functions JJ and GiG_i, i=1,…,N(ncu+ncx)+1i=1,\ldots,N(n_c^u+n_c^x)+1 in (10), are twice continuously differentiable on the interior of UN×X\mathcal{U}^N\times\mathcal{X}. We will explore the following result from the field of parametric optimization.

Proposition 11 (Differentiability of optimal solutions [6].) Given xkx_k, suppose that uk∗u_k^* is an admissible point for the parametric optimization problem (10) which satisfies the Karush-Kuhn-Tucker conditions with Lagrange multiplier vector μk∗\mu_k^*. The corresponding active set is given as the index set Ia={i∈{1,…,N(ncu+ncx)+1}∣Gi(uk∗,xk)=0}\mathcal{I}_a=\{i\in\{1,\ldots,N(n_c^u+n_c^x)+1\}\mid G_i(u_k^*,x_k)=0\}. Furthermore, suppose that

(i) the linear independence constraint qualification (LICQ) is satisfied at (uk∗,xk)(u_k^*,x_k), i.e., the gradients ∇ukGi(uk∗,xk)\nabla_{u_k}G_i(u_k^*,x_k), i∈Iai\in\mathcal{I}_a, are linearly independent,

(ii) strict complementary slackness (SCS) holds, i.e., μk,i∗>0\mu_{k,i}^*>0 for all i∈Iai\in\mathcal{I}_a, and

(iii) the second-order sufficient condition (SOSC) is satisfied at (uk∗,xk)(u_k^*,x_k), i.e., the Hessian of the Lagrangian at (uk∗,xk)(u_k^*,x_k) is positive definite when restricted to the tangent space corresponding to the active constraints.

Then, there exist a neighborhood N(xk)⊂X\mathcal{N}(x_k)\subset\mathcal{X} of xkx_k and continuously differentiable functions u:N(xk)→UNu:\mathcal{N}(x_k)\to\mathcal{U}^N and μ:N(xk)→R(N−1)(ncu+ncx)+1\mu:\mathcal{N}(x_k)\to\mathbb{R}^{(N-1)(n_c^u+n_c^x)+1} such that

(a) u(xk)=uk∗u(x_k)=u_k^*, μ(xk)=μk∗\mu(x_k)=\mu_k^*,

(b) the active set is constant in N(xk)\mathcal{N}(x_k),

(c) LICQ is satisfied for all z∈N(xk)z\in\mathcal{N}(x_k), and

(d) for all z∈N(xk)z\in\mathcal{N}(x_k), the pair (u(z),μ(z))(u(z),\mu(z)) is a strong local minimum of the problem (10) with initial state zz, i.e., LICQ, SCS, and SOSC are satisfied.

Corollary 12 Under the same conditions as in Proposition 11, the MPC feedback law (8) is locally Lipschitz continuous on the neighborhood N(xk)\mathcal{N}(x_k) of xkx_k, i.e., there exists a constant 0<LMPC(xk)<∞0<L_{\mathrm{MPC}}(x_k)<\infty such that ∥κ(x1)−κ(x2)∥≤LMPC(xk)∥x1−x2∥\|\kappa(x_1)-\kappa(x_2)\|\leq L_{\mathrm{MPC}}(x_k)\|x_1-x_2\| holds for all x1,x2∈N(xk)x_1,x_2\in\mathcal{N}(x_k).

We now derive an approximation bound linking dataset coverage and Lipschitz constants.

Theorem 13 (Approximation Error Bound.) Suppose Assumptions 1, 2, 3, 4, 7, and 10 hold. Furthermore, suppose that the current state xkx_k of the system (1) is such that the conditions in Proposition 11 are satisfied. Then, for a given training dataset D\mathcal{D}, given ϵD>0\epsilon_{\mathcal{D}}>0, and for a prescribed ϵ>ϵD\epsilon>\epsilon_{\mathcal{D}}, the approximation error is bounded by

∥κ(xk)−κNN(xk)∥≤ϵ(12)\|\kappa(x_k)-\kappa_{\mathrm{NN}}(x_k)\|\leq\epsilon \tag*{(12)}

if there exists a training data point (x∗,κ(x∗))∈D(x^*,\kappa(x^*))\in\mathcal{D} that satisfies ∥xk−x∗∥≤(LMPC(xk)+LNN)−1(ϵ−ϵD)\|x_k-x^*\|\leq\left(L_{\mathrm{MPC}}(x_k)+L_{\mathrm{NN}}\right)^{-1}(\epsilon-\epsilon_{\mathcal{D}}) and x∗∈N(xk)x^*\in\mathcal{N}(x_k).

PROOF. We begin by writing the left-hand side of (11) as

∥κ(xk)−κNN(xk)∥=∥κ(xk)−κ(x∗)+κNN(x∗)−κNN(xk)+κ(x∗)−κNN(x∗)∥.\begin{aligned} \|\kappa(x_k)-\kappa_{\mathrm{NN}}(x_k)\| ={}&\|\kappa(x_k)-\kappa(x^*)+\kappa_{\mathrm{NN}}(x^*)\\ &-\kappa_{\mathrm{NN}}(x_k)+\kappa(x^*)-\kappa_{\mathrm{NN}}(x^*)\|. \end{aligned}

Applying the triangle inequality, we obtain the upper bound

∥κ(xk)−κNN(xk)∥≤∥κ(xk)−κ(x∗)∥+∥κNN(x∗)−κNN(xk)∥+∥κ(x∗)−κNN(x∗)∥.\begin{aligned} \|\kappa(x_k)-\kappa_{\mathrm{NN}}(x_k)\| \leq{}&\|\kappa(x_k)-\kappa(x^*)\|\\ &+\|\kappa_{\mathrm{NN}}(x^*)-\kappa_{\mathrm{NN}}(x_k)\|\\ &+\|\kappa(x^*)-\kappa_{\mathrm{NN}}(x^*)\|. \end{aligned}

By Assumption 7, and as x∗∈N(xk)x^*\in\mathcal{N}(x_k), we obtain further that

∥κNN(x∗)−κNN(xk)∥≤LNN∥x∗−xk∥,∥κ(xk)−κ(x∗)∥≤LMPC(xk)∥xk−x∗∥.\begin{aligned} \|\kappa_{\mathrm{NN}}(x^*)-\kappa_{\mathrm{NN}}(x_k)\|&\leq L_{\mathrm{NN}}\|x^*-x_k\|,\\ \|\kappa(x_k)-\kappa(x^*)\|&\leq L_{\mathrm{MPC}}(x_k)\|x_k-x^*\|. \end{aligned}

Now, it follows straightforwardly that

∥κ(xk)−κNN(xk)∥≤(LMPC(xk)+LNN)∥xk−x∗∥+ϵD,\|\kappa(x_k)-\kappa_{\mathrm{NN}}(x_k)\| \leq\left(L_{\mathrm{MPC}}(x_k)+L_{\mathrm{NN}}\right)\|x_k-x^*\|+\epsilon_{\mathcal{D}},

which, together with the requirement that ∥xk−x∗∥≤(LMPC(xk)+LNN)−1(ϵ−ϵD)\|x_k-x^*\|\leq\left(L_{\mathrm{MPC}}(x_k)+L_{\mathrm{NN}}\right)^{-1}(\epsilon-\epsilon_{\mathcal{D}}), implies the result in (11).

We now turn to a detailed discussion of the conditions in Proposition 11.

Remark 14 Assuming that LICQ, SOSC, and SCS hold can be restrictive. However, these assumptions are often employed in explicit MPC and parametric optimization to ensure that the optimal solution is well-behaved, see, e.g., [5] or [34]. LICQ is typically ensured by design of the constraints (6c), (6d), and (6e), or via regularization or constraint relaxation techniques, see, e.g., [28, 31]. SCS is usually only lost when arbitrarily small perturbations of the state xkx_k lead to active set changes. However, the sets on which this is the case are typically lower-dimensional subsets of X\mathcal{X}, and hence, Lebesgue null sets. As a result, it is unlikely in practice that a state sample lies in these sets. Satisfaction of the SOSC is more challenging; however, our approach allows for violations of the SOSC on Lebesgue-null sets, analogous to the SCS condition. For a more comprehensive overview of the regularity properties of parametric optimization problems, see, e.g., [9].

To better understand the implications of Theorem 13, we proceed by discussing some of its practical aspects.

Remark 15 If an upper bound LMPCmax⁡L_{\mathrm{MPC}}^{\max} on the local Lipschitz constants LMPC(xk)L_{\mathrm{MPC}}(x_k) can be estimated over all regions of the state space where the MPC feedback law is locally Lipschitz continuous, Theorem 13 generalizes accordingly. Specifically, a state-independent distance bound δ:=(LMPCmax⁡+LNN)−1(ϵ−ϵD)\delta:= (L_{\mathrm{MPC}}^{\max} + L_{\mathrm{NN}})^{-1}(\epsilon- \epsilon_D) can then be used to establish the result, at the cost of potentially increased conservatism. Hence, Theorem 13 provides a condition on the minimum coverage of X\mathcal{X} that must be achieved by the training inputs. To enforce the distance condition in Theorem 13, one can choose a parameter 0<η≤δ0 < \eta\le\delta and construct the training dataset to provide an η\eta-coverage of X\mathcal{X}. However, η\eta-coverage alone does not ensure that the corresponding training point lies in the same neighborhood of local Lipschitz continuity as xkx_k. These regions are determined by the underlying MPC problem and may have arbitrary geometry; in particular, they need not be norm balls or have a uniform radius. For each state xkx_k, the relevant neighborhood is the one associated with the corresponding region of the MPC problem. The result therefore remains conditional on the existence, for each considered state xkx_k, of a training point that satisfies both the distance and neighborhood conditions of Theorem 13. The parameter η\eta thus acts as a tuning parameter, which must be selected heuristically or via appropriate tuning strategies tailored to the specific application.

Recursive feasibility and Stability Guarantees

Building on the results of Theorem 13, we can now guarantee safety, i.e., constraint satisfaction, and stability of the system (1) under the neural network controller. Specifically, Theorem 13 provides conditions under which a neural network satisfies a prescribed bound on the approximation error, which can be used to design the underlying MPC to be robust against such errors, as described in § 2. This robustness enables safe substitution of the MPC with the neural network controller. In particular, if the conditions of Theorem 13 are satisfied (point-wise) along the closed-loop state trajectory of system (1) under the neural network controller, the safety and stability guarantees established in Theorem 5 are preserved. Moreover, under these conditions, the neural network controller maintains the invariance of the feasible set of initial conditions for the closed-loop system, as established in Corollary 6.

The following theorem provides a formal statement of the result under practical and realistically attainable conditions, explicitly accounting for stochastic disturbances that arise in closed-loop operation, which results in a probabilistic view on the results in Proposition 11 and Theorem 13.

Theorem 16 Suppose the following conditions hold:

(i) Assumptions 1, 2, 3, 4, 7, and 10 hold.

(ii) The system (1) is subject to additive, bounded, independent, and identically distributed noise νk∈Wν⊂Rnx\nu_k \in\mathcal{W}_\nu\subset\mathbb{R}^{n_x}, where (a) Wν\mathcal{W}_\nu is compact and satisfies 0∈int⁡(Wν)0 \in\operatorname{int}(\mathcal{W}_\nu), and (b) νk\nu_k follows a continuous probability measure μν\mu_\nu that is absolutely continuous with respect to the Lebesgue measure λ\lambda, i.e., μν≪λ\mu_\nu\ll\lambda.

(iii) The MPC problem (6) is designed to be robust with respect to the additive, bounded, total disturbance wˉk:=wk+νk\bar{w}_k := w_k + \nu_k, where wkw_k is defined as in (5).

(iv) The set Z:={x∈XN∣LICQ, SCS, or SOSC is violated at (u∗,x)}\mathcal{Z} := \{x \in\mathcal{X}_N \mid\text{LICQ, SCS, or SOSC is violated at } (u^*,x)\}, where u∗u^* is the optimal solution of (6) with initial condition xx, satisfies λ(Z)=0\lambda(\mathcal{Z}) = 0, i.e., the set of states where regularity fails is a null set with respect to the Lebesgue measure.

(v) The initial state satisfies x0∈XN∖Zx_0 \in\mathcal{X}_N \setminus\mathcal{Z}, i.e., the MPC problem is initially feasible, and the feedback law is regular at x0x_0.

(vi) For each x∈XN∖Zx \in\mathcal{X}_N \setminus\mathcal{Z}, there exists a training data point (x∗,κ(x∗))∈D(x^*, \kappa(x^*)) \in\mathcal{D} that satisfies ∥x−x∗∥≤(LMPCmax⁡+LNN)−1(ϵ−ϵD)\lVert x - x^* \rVert\le(L_{\mathrm{MPC}}^{\max} + L_{\mathrm{NN}})^{-1}(\epsilon- \epsilon_D) and x∗∈N(x)x^* \in\mathcal{N}(x).

Then, the neural network controller

(1) remains feasible along the closed-loop trajectory almost surely, and

(2) renders the closed-loop system almost surely input-to-state stable with respect to the origin and the disturbance wˉk\bar{w}_k.

PROOF. The proof proceeds in three main steps. First, we revisit the robust MPC design under the presence of an additional disturbance, as specified in condition (iia), and demonstrate the feasibility of the robust MPC formulation required by condition (iii). Second, we show that the feedback law of this robust MPC is almost surely sufficiently regular at the sampled closed-loop states xkx_k where it is evaluated, leveraging conditions (iia) and (iv). This guarantees the local Lipschitz continuity of the feedback law in neighborhoods around the observed closed-loop states. Third, leveraging conditions (i) and (v), we establish that the approximation error at any observed closed-loop state satisfies the bound stated in Theorem 13. Together, these results imply that the guarantees provided by the robust MPC design in Theorem 5 transfer to the neural network controller.

Step 1: We begin by considering the system (1) subject to the additive disturbance νk\nu_k, given by xk+1=f(xk,uk)+νkx_{k+1}=f(x_k,u_k)+\nu_k.

Analogously to the formulation in (5), we define a single additive disturbance term wˉk\bar{w}_k that captures both the effect of the approximation error induced by the neural network controller and the state disturbance νk\nu_k. Specifically,

xk+1=f(xk,uk+ek)+νk≡f(xk,uk)+wˉk,withx_{k+1}=f(x_k,u_k+e_k)+\nu_k \equiv f(x_k,u_k)+\bar{w}_k,\quad\text{with}
wˉk=f(xk,uk+ek)−f(xk,uk)+νk.\bar{w}_k=f(x_k,u_k+e_k)-f(x_k,u_k)+\nu_k.

This yields the bound ∥wˉk∥≤∥f(xk,uk+ek)−f(xk,uk)∥+∥νk∥≤Lf,uϵ+ϵν\lVert\bar{w}_k\rVert\leq\lVert f(x_k,u_k+e_k)-f(x_k,u_k)\rVert+\lVert\nu_k\rVert\leq L_{f,u}\epsilon+\epsilon_\nu, where ϵν>0\epsilon_\nu>0 is a constant such that Wν⊆{ν∣∥ν∥≤ϵν}\mathcal{W}_\nu\subseteq\{\nu\mid\lVert\nu\rVert\leq\epsilon_\nu\}. Such a constant ϵν>0\epsilon_\nu>0 exists due to the compactness of Wν\mathcal{W}_\nu. Including ϵν\epsilon_\nu in (7) yields

Wn={e∈Rnx∣∥e∥≤Lf,x−1Lf,x−1(Lf,uϵ+ϵν)}.\mathcal{W}_n=\left\{e\in\mathbb{R}^{n_x}\mid\lVert e\rVert\leq\frac{L_{f,x}-1}{L_{f,x}-1}(L_{f,u}\epsilon+\epsilon_\nu)\right\}.

This establishes the feasibility of the robust MPC design required in condition (iii), which is henceforth assumed.

Step 2: Given condition (iia), for a fixed state xk∈XN∖Zx_k\in\mathcal{X}_N\setminus\mathcal{Z}, the successor state xk+1x_{k+1} is a random variable determined by the disturbance νk\nu_k and follows the probability measure μx\mu_x. Specifically, μx\mu_x is the pushforward of μν\mu_\nu under the translation map T(z)=z+f(xk,uk+ek)T(z)=z+f(x_k,u_k+e_k). Since the Lebesgue measure λ\lambda is translation invariant and μν≪λ\mu_\nu\ll\lambda by assumption, it follows that μx≪λ\mu_x\ll\lambda, i.e., μx\mu_x is absolutely continuous with respect to the Lebesgue measure. Together with condition (iv), this yields μx(Z)=0\mu_x(\mathcal{Z})=0, or equivalently, Pr⁡[xk+1∈XN∖Z]=1\Pr[x_{k+1}\in\mathcal{X}_N\setminus\mathcal{Z}]=1 almost surely. By induction, and using condition (v), it follows that xk∈XN∖Zx_k\in\mathcal{X}_N\setminus\mathcal{Z} for all kk, almost surely. Consequently, the regularity conditions of Proposition 11 are almost surely satisfied at all visited closed-loop states, implying local Lipschitz continuity of the MPC feedback law in neighborhoods of these states.

Step 3: The established (local) Lipschitz continuity of the MPC feedback law in neighborhoods of all visited closed-loop states, together with conditions (i) and (vi), directly implies that the error at these states almost surely satisfies the bound stated in Theorem 13. Since, by condition (iii), the underlying MPC is robust with respect to both the approximation error induced by the neural network controller and the additive disturbance νk\nu_k, the closed-loop guarantees established in Theorem 5 almost surely carry over to the neural network controller.

We conclude the theoretical analysis by briefly discussing the conditions of Theorem 16. Condition (i) requires Assumptions 1, 2, 3, 4, 7, and 10, whose implications and restrictiveness were discussed upon introduction.

Condition (ii) assumes bounded additive disturbances with a continuous distribution of compact support, encompassing, e.g., model-plant mismatch, external disturbances, and measurement noise. Condition (iia) is standard in robust and stochastic MPC, while (iib) covers, among others, uniform and truncated Gaussian distributions; the distribution itself need not be known explicitly or analytically tractable.

Condition (iii) requires robustness of the MPC against the combined disturbance, achievable through standard constraint tightening as described in § 2.3.

Condition (iv) requires the irregularity set Z\mathcal{Z} to have Lebesgue measure zero, supported by Remark 14 and empirical evidence reported in [34].

Finally, condition (v) requires initial MPC feasibility and excludes states where the feedback law lacks regularity.

Procedure for Certified NN Approximation

We now present a procedure to generate a NN controller that provides the guarantees discussed in § 3.2 and discuss the limitations of implementing this method in a practical setting.

A possible implementation is summarized in Algorithm 1. The resulting NN is fixed at run time and does not require any online adaptation or re-training. In particular, once provisional bounds on the approximation error and the Lipschitz constants of the MPC law and the NN have been selected, sampling and training may be carried out in a single offline procedure, provided that the resulting network satisfies the prescribed bounds. Thus, enlarging the training dataset does not affect online execution times, as the evaluation time at deployment depends only on the NN architecture.

We first specify a bound ϵD\epsilon_{\mathcal{D}} on the expected error at the training points of the NN with respect to the underlying MPC law κ(x)\kappa(x). This bound may be chosen based on domain knowledge of the problem, an engineering guess, or a single preliminary NN training on an arbitrary initial dataset D0\mathcal{D}_0 from a similar domain. Given such a bound, we select the design parameter ϵ\epsilon in Theorem 13 so that ϵ≥ϵD\epsilon\geq\epsilon_{\mathcal{D}}, which can be chosen larger to include additional robustness margins.

Once ϵ\epsilon has been fixed, we design the robust MPC as in § 2.3. At this stage, state disturbances ϵν\epsilon_\nu can also be incorporated. This yields a robust MPC feedback law κ(x)\kappa(x).

Given the MPC design, we next provide bounds on the local Lipschitz constants of both the NN and the MPC on X\mathcal{X}. An upper bound LMPCL_{\mathrm{MPC}} for the feedback law (8) may be obtained via power iteration, finite-difference schemes, or specialized methods [26, 32]. Similarly, we fix LNNL_{\mathrm{NN}} for the NN architecture and estimate the robustly forward-invariant set XN\mathcal{X}_{N}, on which the MPC law is defined and from which the training data are drawn.

With the bounds ϵD\epsilon_D, LNNL_{\mathrm{NN}}, and LMPCL_{\mathrm{MPC}} specified and Theorem 13, we compute the coverage radius δ\delta. We then select a radius η≤δ\eta\leq\delta for the over-coverage. Having fixed η\eta, we employ sub-sampling or space-filling methods [18] to compute an η\eta-coverage of XN\mathcal{X}_{N}, which is also a δ\delta-coverage of XN\mathcal{X}_{N}. Evaluating the MPC feedback law (9) on these points in open-loop yields the final training dataset D\mathcal{D}.

We then initialize the neural network with the chosen architecture and train it once on the fixed dataset D\mathcal{D}. The trained network must satisfy ϵ^D:=max⁡(xi,κ(xi))∈D∥κ(xi)−κNN(xi)∥≤ϵD\hat{\epsilon}_{D} := \max_{(x_i,\kappa(x_i))\in\mathcal{D}} \lVert\kappa(x_i)-\kappa_{\mathrm{NN}}(x_i)\rVert\leq\epsilon_D and L^NN≤LNN\hat{L}_{\mathrm{NN}} \leq L_{\mathrm{NN}}. Because these quantities are known only after training, hyperparameter tuning or retraining may be required. Any network satisfying both inequalities is admissible, and no further refinement is needed.

Algorithm 1 Generation of NN Controller

Require: Constraint set X\mathcal{X}.

  1. Specify or estimate a nominal approximation error bound ϵD\epsilon_D

  2. Choose a design approximation error bound ϵ≥ϵD\epsilon\geq\epsilon_D.

  3. Design a robust MPC using ϵ\epsilon and, optionally, a disturbance bound ϵν\epsilon_\nu, obtaining the feedback law κ(x)\kappa(x).

  4. Specify Lipschitz bounds LMPCL_{\mathrm{MPC}} and LNNL_{\mathrm{NN}} on X\mathcal{X}.

  5. Estimate the robustly forward invariant set XN\mathcal{X}_{N} of the robust MPC.

  6. Compute the required coverage radius δ=ϵ−ϵDLMPC+LNN\delta= \frac{\epsilon-\epsilon_D}{L_{\mathrm{MPC}}+L_{\mathrm{NN}}} according to Theorem 13.

  7. Select a radius η≤δ\eta\leq\delta for over-coverage.

  8. Compute an η\eta-coverage of XN\mathcal{X}_{N} and form the training dataset D\mathcal{D} by evaluating κ(x)\kappa(x) on the coverage points.

  9. Train the neural network κNN\kappa_{\mathrm{NN}} on D\mathcal{D}, such that it satisfies ϵ^D≤ϵD≤ϵ\hat{\epsilon}_{D} \leq\epsilon_D \leq\epsilon and L^NN≤LNN\hat{L}_{\mathrm{NN}} \leq L_{\mathrm{NN}}.

  10. Output the final NN controller κNN(x)\kappa_{\mathrm{NN}}(x), which approximates κ(x)\kappa(x) on XN\mathcal{X}_{N} with error bound ϵ\epsilon.

Remark 17 In practice, coverage-based certification suffers from the curse of dimensionality: for a bounded nxn_x-dimensional domain with characteristic width RR, the required number of samples scales as nD=O((R/δ)nx)n_D = O((R/\delta)^{n_x}). Thus, maintaining a fixed coverage radius causes an increasing offline sampling and training effort with nxn_x, whereas online evaluation remains determined by the NN architecture. Scalability also depends on δ\delta, and hence on the acceptable approximation-error margin and the Lipschitz bounds.

Example

We evaluate the approach on an isothermal continuously stirred tank reactor in which the reaction 2A+B→C2A+B\to C, C→2DC\to2D, and the selective removal of DD are realized. The continuous-time dynamics are

c˙A=d(cA,f−cA)−2k1cA2cB,c˙B=d(cB,f−cB)−k1cA2cB,c˙C=−dcC+k1cA2cB−k2cC,c˙D=−dcD+2k2cC−ksepcD.\begin{aligned} \dot{c}_A &= d\left(c_{A,f}-c_A\right)-2k_1c_A^2c_B,\\ \dot{c}_B &= d\left(c_{B,f}-c_B\right)-k_1c_A^2c_B,\\ \dot{c}_C &= -dc_C+k_1c_A^2c_B-k_2c_C,\\ \dot{c}_D &= -dc_D+2k_2c_C-k_{\mathrm{sep}}c_D. \end{aligned}

Here, x=[cA,cB,cC,cD]x=[c_A,c_B,c_C,c_D] denotes the species concentrations in mol L−1\mathrm{mol\,L^{-1}}, and u=cA,fu=c_{A,f} is the controlled feed concentration of species A in mol L−1\mathrm{mol\,L^{-1}}. The dilution rate is d=0.1 min−1d=0.1\,\mathrm{min}^{-1}, and the fixed feed concentration is cB,f=0.75 mol L−1c_{B,f}=0.75\,\mathrm{mol\,L^{-1}}. The reaction parameters are k1=3.2 L2 min−2k_1=3.2\,\mathrm{L^2\,min^{-2}}, k2=0.1 min−1k_2=0.1\,\mathrm{min}^{-1} and ksep=0.1 min−1k_{\mathrm{sep}}=0.1\,\mathrm{min}^{-1}. The model is discretized using fourth-order Runge–Kutta with Ts=0.5 minT_s=0.5\,\mathrm{min}.

Over X×U\mathcal{X}\times\mathcal{U}, the numerically estimated Lipschitz constants of the undisturbed discrete dynamics w.r.t. the 2-norm are Lf,x=1.11L_{f,x}=1.11 and Lf,u=0.05L_{f,u}=0.05. We add v~k=[v~1,k,v~2,k,v~3,k,v~4,k]T\tilde{v}_k=[\tilde{v}_{1,k},\tilde{v}_{2,k},\tilde{v}_{3,k},\tilde{v}_{4,k}]^\mathsf{T}, as an additive disturbance satisfying ∥v~k∥2≤ϵv\lVert\tilde{v}_k\rVert_2\leq\epsilon_v with ϵv=0.001\epsilon_v=0.001 to the discretized system.

Controller Design

The robust MPC uses the constraint sets X:={x∣0.05 mol L−1≤cγ≤0.45 mol L−1, γ∈{A,B,C,D}}\mathcal{X}:=\{x\mid0.05\,\mathrm{mol\,L^{-1}}\leq c_\gamma\leq0.45\,\mathrm{mol\,L^{-1}},\ \gamma\in\{A,B,C,D\}\} and U:={u∣1.00 mol L−1≤u≤1.50 mol L−1}\mathcal{U}:=\{u\mid1.00\,\mathrm{mol\,L^{-1}}\leq u\leq1.50\,\mathrm{mol\,L^{-1}}\}, together with the quadratic stage and terminal costs l(x,u)=(x−xref)TQ(x−xref)+(u−uref)TR(u−uref)l(x,u)=(x-x_{\mathrm{ref}})^\mathsf{T}Q(x-x_{\mathrm{ref}})+(u-u_{\mathrm{ref}})^\mathsf{T}R(u-u_{\mathrm{ref}}) and VT(x)=(x−xref)TP(x−xref)V_T(x)=(x-x_{\mathrm{ref}})^\mathsf{T}P(x-x_{\mathrm{ref}}), respectively, where Q=diag⁡(2,1,1,1)Q=\operatorname{diag}(2,1,1,1), R=1R=1, and

P=[8.77−5.293.271.06−5.2914.192.230.693.272.2311.843.691.060.693.698.26].P= \begin{bmatrix} 8.77 & -5.29 & 3.27 & 1.06\\ -5.29 & 14.19 & 2.23 & 0.69\\ 3.27 & 2.23 & 11.84 & 3.69\\ 1.06 & 0.69 & 3.69 & 8.26 \end{bmatrix}.

The matrix PP is obtained from fixed-point iterations of the discrete-time algebraic Riccati equation for the model linearized at the reference. The terminal level is set to αV=0.10\alpha_V=0.10. We use the constant reference xref=[0.25,0.25,0.25,0.25]T mol L−1x_{\mathrm{ref}}=[0.25,0.25,0.25,0.25]^\mathsf{T}\,\mathrm{mol\,L^{-1}} and uref=1.25 mol L−1u_{\mathrm{ref}}=1.25\,\mathrm{mol\,L^{-1}}. We choose a prediction horizon of N=10N=10 steps, corresponding to a prediction horizon of 5.00 min5.00\,\mathrm{min}. We conservatively set the designable approximation-error bound to ϵ=0.05\epsilon=0.05, corresponding to 10% of the input range.

Neural Network Architecture

We approximate the underlying robust MPC law by a fully connected feed-forward neural network (cf. § 3.1) with 3 hidden layers, each containing 32 neurons, and Gaussian error linear unit activation functions. The network takes the 4-dimensional concentration state as input and outputs the scalar feed concentration cA,fc_{A,f}.

Data Generation and Training

We seed 194 481=214194\,481 = 214 points equally spaced within the state constraint set. Using these points, we estimate a grid approximation X^N⊆XN\hat{\mathcal{X}}_N \subseteq\mathcal{X}_N of the robustly forward-invariant set of the underlying MPC, which leaves 60 626 strictly feasible and converged grid points.

Before dataset generation, we estimate the Lipschitz constant of the MPC policy at 10 000 points in X^N\hat{\mathcal{X}}_N using central finite differences with a step size of 1×10−41 \times10^{-4}. This yields LMPC=3.1531L_{\mathrm{MPC}} = 3.1531. For the NN architecture described in In Section 4.2, we prescribe the analytical design bound LNN=3.5L_{\mathrm{NN}} = 3.5, which is subsequently enforced via weight projection during training [10]. The projection approach is further explained in supplementary Section S2 and in [10]. We choose the dataset error ϵD=0.01\epsilon_D = 0.01 and the overall approximation-error bound ϵ=0.05\epsilon= 0.05. Therefore, we can calculate δ=0.0060122\delta= 0.0060122, and we choose η=δ\eta= \delta. For the bounds and all subsequent analysis, the 2-norm was used.

We construct a candidate grid over the bounding box of X^N\hat{\mathcal{X}}_N and retain points that pass a membership check with the invariant set. The final η\eta-cover contains 6 417 883 centers. The MPC policy is evaluated at every center to obtain the final training dataset D\mathcal{D}. We then train a newly initialized NN on D\mathcal{D} for 50 epochs using a learning rate of 5×10−35 \times10^{-3} and a batch size of 128. The resulting NN achieves an R2R^2-score of 0.9999 on a validation set containing 10 000 points that are distinct from all training points. The maximum approximation error over the complete training dataset is ϵ^D=1.3759×10−3<0.01\hat{\epsilon}_D = 1.3759 \times10^{-3} < 0.01. For the trained NNs Lipschitz bound obtained from the layer operator norms and activation Lipschitz constants is L^NN=3.4999\hat{L}_{\mathrm{NN}} = 3.4999. Thus, both quantities remain below the used design values.

All training, sampling, and simulations were performed in Python on a Lenovo ThinkPad T14 Gen 2a running Windows 11, equipped with an AMD Ryzen 7 PRO 5850U CPU and 32 GB RAM. MPC was implemented using IPOPT via CasADi [3], and the neural network using PyTorch [4, 25].

An additional 2-dimensional result is shown in supplementary Section S1

Results

We evaluate the trained NN on the simulated isothermal reactor in closed-loop using the robust MPC used for data generation as a comparison. The closed-loops for both controllers were simulated starting from 100 independently selected initial states for 160 steps with a sampling time of 0.5 min. To assess the controller near the boundary of the estimated invariant set, points near the eight coordinate-wise extrema of

the retained grid are included explicitly. The remaining initial states are sampled uniformly without replacement from X^N\hat{\mathcal{X}}_N. None of the selected initial states were previously used for training or validation. For each initial state, the robust MPC and NN controller experience the same additional disturbance realization.

Figure 1 shows the resulting trajectories in the (cA,cB)(c_A,c_B)- and (cC,cD)(c_C,c_D)-projections of X^N\hat{\mathcal{X}}_N. The enlarged regions show trajectories initialized close to different boundaries of the estimated admissible set. The trajectories generated by the robust MPC and its NN approximation remain close over the complete simulation horizon and approach the reference. No state-constraint or input-constraint violations are observed for either controller. In particular, all 16 000 evaluated states remain inside X^N\hat{\mathcal{X}}_N. Set membership is evaluated in the full 4-dimensional state space and not solely from the 2-dimensional projections shown in Figure 1.

Projections of the estimated invariant set and closed-loop trajectories

Figure 1. Projections of the estimated invariant set X^N\hat{\mathcal{X}}_N and 100 closed-loop trajectories under the robust MPC and its NN approximation. Top: (cA,cB)(c_A,c_B)-plane; bottom: (cC,cD)(c_C,c_D)-plane. The insets show trajectories initialized near selected boundaries.

Table 1 reports the computation times obtained from 16 000 sequential single-state controller evaluations. Both controllers are evaluated on the same hardware using a single CPU thread, and no batching is employed for the NN controller. The mean computation time decreases from 20.73 ms for the robust MPC to 0.59 ms for the NN controller, corresponding to a mean speed-up of approximately 35 times.

Mean (ms)Max. (ms)Min. (ms)
Robust MPC20.7385.7916.40
NN controller0.591.850.48

Table 1. Controller computation times over 16,000 evaluations.

The pointwise approximation errors along the same independently generated trajectories are summarized in Table 2. The maximum observed error is 8.62×10−48.62 \times10^{-4}, which is below the prescribed approximation bound. No violation of the approximation bound occurs among the 16000 evaluations. The minimum error is 5.73×10−95.73 \times10^{-9} and is therefore close to the numerical precision relevant to this evaluation.

MeanMax.Min.
Approximation error4.76×10−54.76 \times10^{-5}8.62×10−48.62 \times10^{-4}5.73×10−95.73 \times10^{-9}

Table 2. Pointwise NN policy error over 16,000 evaluations.

These independent closed-loop results are consistent with the theoretical guarantees established through the underlying robust MPC, the coverage, and the certified approximation bound. In particular, the absence of approximation error bound, state, and input constraint violations supports the conditions of Theorem 13 along all evaluated trajectories and demonstrates the applicability of Algorithm 1.

Conclusion

We developed a constructive framework for certified neural approximation of robust nonlinear model predictive controllers. By interpreting the approximation error as a bounded input disturbance and embedding Lipschitz-based error bounds into a robust MPC design, we established conditions under which recursive feasibility and input-to-state stability of the original controller are preserved under neural replacement. In contrast to post-verification approaches, the proposed method provides an offline design procedure that links dataset coverage and Lipschitz constants to explicit uniform approximation guarantees.

The framework combines results from parametric optimization, robust MPC theory, and Lipschitz continuity of neural networks to derive verifiable error bounds. The simulation study on a nonlinear isothermal CSRT model confirms that the neural controller reproduces the closed-loop behavior of the robust MPC within the certified invariant region while significantly reducing online computation time.

Future work will investigate domain partitioning to reduce conservatism induced by global Lipschitz bounds and data requirements associated with uniform coverage, as well as adaptive or trajectory-based sampling and mixture-of-experts architectures to improve scalability to higher-dimensional systems. We will also consider relaxing the regularity assumptions on the MPC feedback law to broaden applicability of the proposed framework.

Declaration of Generative AI and AI-assisted technologies in the writing process

During the preparation of this work, the authors used Chat-GPT 5.5 and 5.6-Sol from OpenAI in order to improve language flow and wording. After using this tool/service, the authors reviewed and edited the content as needed and take full responsibility for the content of the publication.

2-Dimensional Example

In addition to the continuous stirred tank reactor example presented in the main part of the paper, we further evaluate the approach on a nonlinear drone model describing vertical motion. The state x=[x1,x2]=[z,vz]x = [x_1, x_2] = [z, v_z] consists of altitude and vertical velocity, and the dynamics are given by

x1,k+1=x1,k+Tsx2,k+ν~1,k,x2,k+1=x2,k+Ts(−g−kzx2,k3+1muk)+ν~2,k.\begin{aligned} x_{1,k+1} &= x_{1,k} + T_s x_{2,k} + \tilde{\nu}_{1,k},\\ x_{2,k+1} &= x_{2,k} + T_s\left(-g-k_zx_{2,k}^{3}+\frac{1}{m}u_k\right)+\tilde{\nu}_{2,k}. \end{aligned}

Here, uu is the input thrust force, kz=0.0001 s m−2k_z = 0.0001\ \mathrm{s}\,\mathrm{m}^{-2} is the cubic drag coefficient in zz-direction, m=1 kgm = 1\ \mathrm{kg} is the mass of the drone, g=9.81 m s−2g = 9.81\ \mathrm{m}\,\mathrm{s}^{-2} is the acceleration due to gravity, and Ts=0.05T_s = 0.05 is the discretization time. Additionally, ν~k=[ν~1,k,ν~2,k]T\tilde{\nu}_k = [\tilde{\nu}_{1,k}, \tilde{\nu}_{2,k}]^{\mathsf{T}} denotes an additive disturbance satisfying ∥ν~k∥2≤ϵν\lVert\tilde{\nu}_k\rVert_2 \le\epsilon_\nu with ϵν=0.001\epsilon_\nu= 0.001. The undisturbed system therefore has Lipschitz constants Lf,x=1.05L_{f,x} = 1.05 and Lf,u=0.05L_{f,u} = 0.05 w.r.t. the 2-norm, which can be calculated directly due to its control-affine structure.

Controller Design

For the robust MPC, we define the state constraint set X\mathcal{X} by −20 m≤x1≤40 m-20\ \mathrm{m} \le x_1 \le40\ \mathrm{m} and −25 m s−1≤x2≤25 m s−1-25\ \mathrm{m}\,\mathrm{s}^{-1} \le x_2 \le25\ \mathrm{m}\,\mathrm{s}^{-1}, with positive velocity pointing upward, and the input constraint set U\mathcal{U} by −30 N≤u≤30 N-30\ \mathrm{N} \le u \le30\ \mathrm{N}.

We use a quadratic stage cost l(x,u)=(x−xref)TQ(x−xref)+(u−uref)TR(u−uref)l(x,u) = (x-x_{\mathrm{ref}})^{\mathsf{T}}Q(x-x_{\mathrm{ref}})+(u-u_{\mathrm{ref}})^{\mathsf{T}}R(u-u_{\mathrm{ref}}), where Q=diag⁡(5,1)Q = \operatorname{diag}(5,1) and R=0.1R = 0.1. For the terminal cost, we choose VT(x)=(x−xref)TP(x−xref)V_T(x) = (x-x_{\mathrm{ref}})^{\mathsf{T}}P(x-x_{\mathrm{ref}}) with

P=[74.640415.989915.989911.1355]P = \begin{bmatrix} 74.6404 & 15.9899 \\ 15.9899 & 11.1355 \end{bmatrix}

obtained via fixed-point iterations of the discrete-time algebraic Riccati equation. The terminal set is defined as the αV\alpha_V-level set of VTV_T with αV=100\alpha_V = 100. We set a constant reference of xref=[25.0 m,0 m s−1]Tx_{\mathrm{ref}} = [25.0\ \mathrm{m}, 0\ \mathrm{m}\,\mathrm{s}^{-1}]^{\mathsf{T}} and uref=g⋅m=9.81 Nu_{\mathrm{ref}} = g \cdot m = 9.81\ \mathrm{N}.

The designable approximation error bound is set to ϵ=3\epsilon= 3, which is small relative to the admissible range of uu.

Horizon length and conservatism

For the robust MPC formulation in (6), the disturbance sets WnW_n may grow with the prediction step. Their radius rnr_n is

rn=Lf,xn−1Lf,x−1Lf,u(ϵ+ϵν).r_n = \frac{L_{f,x}^{n}-1}{L_{f,x}-1}L_{f,u}(\epsilon+\epsilon_\nu).

Hence, WnW_n remains bounded for Lf,x<1L_{f,x}<1, grows linearly for Lf,x=1L_{f,x}=1, and may grow geometrically for Lf,x>1L_{f,x}>1.

For the drone model, Lf,x=1.05>1L_{f,x}=1.05>1, and the disturbance sets therefore grow along the prediction horizon. With Lf,u=0.05L_{f,u}=0.05, ϵ=3\epsilon=3, and a chosen N=30N=30, the radius of WN−1=W29W_{N-1}=W_{29} is approximately

r29=1.0529−11.05−1(0.05⋅3+0.001)≈9.41.r_{29}=\frac{1.05^{29}-1}{1.05-1}(0.05\cdot3+0.001)\approx9.41.

For comparison, the state domain has widths 60 and 50 in the altitude and velocity directions, respectively. Under the 2-norm used in the example, the tightening by W29W_{29} reduces these widths by 2r29≈18.72r_{29}\approx18.7, corresponding to reductions of approximately 31% and 37%, respectively. This illustrates that the horizon-dependent tightening is already substantial for N=30N=30. We therefore selected this horizon as a practical trade-off between improved look-ahead and increased conservatism.

A tube-based MPC formulation with an ancillary feedback controller could modify this propagation by stabilizing the error dynamics. Under suitable conditions ensuring contraction of the resulting closed-loop error dynamics, the corresponding uncertainty sets could remain bounded or grow substantially more slowly. However, the use of an ancillary feedback controller alone does not guarantee such behavior; establishing boundedness or contraction would require additional assumptions and analysis beyond the scope of the present framework.

Neural Network Architecture

We approximate the underlying robust MPC law by a fully connected feed-forward neural network (cf. § 3.1) with 3 hidden layers, each containing 16 neurons and using a hyperbolic tangent activation function. The network takes the state xx as input and outputs the control input uu. This architecture is used for the initial and final training phases described in § 6.4.

Data Generation and Training

We seed 20 814 initial points equally spaced within the state bounds. Using these points, we estimate a robustly forward-invariant set X^N⊆XN\hat{\mathcal{X}}_N \subseteq\mathcal{X}_N of the underlying MPC using a backwards-pruning approach.

With the same seed points, we perform an initial training of the NN architecture (cf. § 6.3) for 200 epochs with a learning rate of 5×10−35 \times10^{-3}, which yields an approximation error of ϵD=1.9876\epsilon_D = 1.9876, rounded to ϵD=2\epsilon_D = 2 in the 2-norm.

Before dataset generation begins, we estimate the Lipschitz constants of both the MPC and the neural network on X^N\hat{\mathcal{X}}_N using a power-iteration method based on repeated Jacobian–vector and vector–Jacobian products. For the MPC, we obtain LMPC=19.887L_{\mathrm{MPC}} = 19.887, which we round to LMPC=20L_{\mathrm{MPC}} = 20, and for the initially trained neural network, we obtain 21.436, from which we chose LNN=25L_{\mathrm{NN}} = 25 for caution. This results in δ=0.0222\delta= 0.0222, based on which we set η=δ\eta= \delta. We then compute an η\eta-coverage of XN\mathcal{X}_N by calculating a bounding box of X^N\hat{\mathcal{X}}_N on which a space-filling sampling algorithm is employed.

This results in 1 231 052 coverage points xix_i, which are used to construct the final training dataset D\mathcal{D}. These points provide an η\eta-coverage of X^N\hat{\mathcal{X}}_N, i.e.,

sup⁡x∈X^Nmin⁡xi∈D∥x−xi∥2≤η.\sup_{x \in\hat{\mathcal{X}}_N} \min_{x_i \in\mathcal{D}} \lVert x - x_i \rVert_2 \leq\eta.

Equivalently, the balls of radius η\eta centered at the coverage points cover X^N\hat{\mathcal{X}}_N. Consequently, two neighboring coverage points whose corresponding balls overlap are separated by at most 2η2\eta. This bound applies to neighboring points; it does not impose a distance bound on arbitrary pairs of coverage points. A cutout of the cover is shown in Figure S1

Small cutout of $\hat{\mathcal{X}}_N$ in state space with coverage

Figure S1. Small cutout of X^N\hat{\mathcal{X}}_N in state space with coverage. Original coverage radius δ\delta as a black line and red circle. Over-coverage radius η\eta as a red line and blue circles. Data points xix_i are represented as orange points.

We then train a newly initialized NN on the dataset D\mathcal{D}. The training concludes after 100 epochs with a learning rate of 5×10−35 \times10^{-3} and a batch size of 1080, achieving an R2R^2-score of 0.9999 calculated on a validation set of 10 000 data points, which are distinct from any training data points. Moreover, the trained NN achieves ϵ^D=1.9222\hat{\epsilon}_D = 1.9222 and a Lipschitz estimate LNNan,final=23.22L_{\mathrm{NN}}^{\mathrm{an,final}} = 23.22, both of which satisfy the initial bounds.

All training, sampling, and simulations were performed in Python on a Lenovo ThinkPad T14 Gen 2a running Windows 11, equipped with an AMD Ryzen 7 PRO 5850U CPU and 32 GB RAM. MPC was implemented using IPOPT via CasADi, and the neural network using PyTorch.

Results

We simulate the system in closed-loop, controlled by the robust MPC and its NN approximation for 100 random initial states. Specifically, the initial states are drawn from a uniform distribution over X^N\hat{\mathcal{X}}_N. The closed-loop system is simulated for 15 s. We observe that the state trajectories under the robust MPC and the NN controller remain close over the whole simulation time and all converge to a neighborhood of the reference point (Figure S2). Furthermore, we can observe that no constraint violations occur, and that all trajectories stay inside X^N\hat{\mathcal{X}}_N. Table S1 shows the mean, maximum, and minimum computation times for both the MPC and NN controller along the 100 trajectories, indicating a significant speed-up using the NN controller. For the same trajectories, Table S2 presents the occurring approximation error in l2l_2-norm, all of which are below our allowed bound of ϵ=3\epsilon= 3. The minimal value is given as 0 since the first observed digit is at the seventh decimal point and therefore not clearly distinguishable from numerical noise.

Mean (ms)Max (ms)Min (ms)
MPC41.79213.9824.65
NN approx.0.521.980.44

Table S1. Computation time for the robust MPC and NN controller.

MeanMaxMin
Approx. errors0.19431.34977.5449×10−67.5449 \times10^{-6}

Table S2. Approximation error over 100 trajectories for the robust MPC and NN controller.

100 closed-loop state trajectories of the robust MPC and the NN controllers in state space

Figure S2. 100 closed-loop state trajectories of the robust MPC and the NN controllers in state space with initial states in X^N\hat{\mathcal{X}}_N, shown in white. The four insets provide enlarged views of selected trajectories for clarity.

The results show how safety and stability guarantees established via the underlying MPC transfer to the neural network controller. Furthermore, the results suggest that Theorem 16 is satisfied along all 100 closed-loop trajectories, indicating that the feedback law of the designed MPC is well-behaved

and that the proposed Algorithm 1 is suited to compute the NN approximator.

Weight-projected neural network training

The Lipschitz constant of the feed-forward neural network introduced in Section 3.1 of the main article can be bounded using the Lipschitz constants of its individual layers. Let LσjL_{\sigma_j} denote a Lipschitz constant of the activation function σj\sigma_j, and let AjA_j denote the weight matrix of the jj-th affine layer. Using the submultiplicativity of induced matrix norms and the composition of the network layers, we obtain the analytical upper bound

L^NN(θ)=∥Am∥2∏j=1m−1(Lσj∥Aj∥2),(13)\widehat{L}_{\mathrm{NN}}(\theta) = \lVert A_m \rVert_2 \prod_{j=1}^{m-1} \left(L_{\sigma_j} \lVert A_j \rVert_2\right), \tag*{(13)}

where θ\theta denotes the collection of all network parameters and mm is the number of weight matrices. Fixed linear input or output transformations contribute additional induced-norm factors to (S1). Equivalently, they can be incorporated into the first or last affine map when evaluating the bound. Since the bias vectors bjb_j are constant additional factors and therefore do not affect differences between network outputs, they do not contribute to L^NN\widehat{L}_{\mathrm{NN}} [10].

To enforce a prescribed bound LNN>0L_{\mathrm{NN}} > 0, the network is trained using projected gradient-based optimization. Starting from the parameters θ(k)\theta^{(k)}, an unconstrained optimizer step with respect to the supervised loss L\mathcal{L} first produces tentative parameters θ~(k+1)\widetilde{\theta}^{(k+1)}. These parameters are subsequently mapped back to the feasible parameter set

ΘL:={θ∣L^NN(θ)≤LNN}.\Theta_L := \left\{ \theta\mid\widehat{L}_{\mathrm{NN}}(\theta) \le L_{\mathrm{NN}} \right\}.

We employ a uniform radial rescaling of all mm weight matrices. The scaling factor is defined as

γ(k+1)={(LNNL^NN(θ~(k+1)))1/m,L^NN(θ~(k+1))>LNN,1,otherwise.\gamma^{(k+1)} = \begin{cases} \left(\dfrac{L_{\mathrm{NN}}}{\widehat{L}_{\mathrm{NN}}(\widetilde{\theta}^{(k+1)})}\right)^{1/m}, & \widehat{L}_{\mathrm{NN}}(\widetilde{\theta}^{(k+1)}) > L_{\mathrm{NN}}, \\ 1, & \text{otherwise}. \end{cases}

The updated parameters are then given by

Aj(k+1)=γ(k+1)A~j(k+1),j=1,…,m,A_j^{(k+1)} = \gamma^{(k+1)} \widetilde{A}_j^{(k+1)}, \qquad j = 1,\ldots,m,
bj(k+1)=b~j(k+1),j=1,…,m.b_j^{(k+1)} = \widetilde{b}_j^{(k+1)}, \qquad j = 1,\ldots,m.

Because induced matrix norms are positively homogeneous, the resulting bound satisfies

L^NN(θ(k+1))=(γ(k+1))mL^NN(θ~(k+1))≤LNN.\widehat{L}_{\mathrm{NN}}\left(\theta^{(k+1)}\right) = \left(\gamma^{(k+1)}\right)^m \widehat{L}_{\mathrm{NN}}\left(\widetilde{\theta}^{(k+1)}\right) \le L_{\mathrm{NN}}.

Thus, every completed optimization step yields parameters that satisfy the prescribed analytical Lipschitz bound [10].

A soft penalty on violations of LNNL_{\mathrm{NN}} may additionally be included in the training objective to reduce the magnitude and frequency of the rescaling steps. Related projection-based approaches are discussed in greater detail in [10].

Existence of a neural network with prescribed finite-dataset accuracy

This section provides the complete proof of Lemma 9 in the main article. Specifically, we show that, for any finite dataset with pairwise distinct inputs and any prescribed tolerance ϵD>0\epsilon_{\mathcal{D}} > 0, there exists a feed-forward neural network whose approximation error at every data point is at most ϵD\epsilon_{\mathcal{D}}. The result concerns existence and finite-dataset accuracy only. This statement does not imply that a particular training algorithm finds such a network or that the resulting network satisfies an approximation bound outside the training dataset.

Lemma S1 (Existence of an ϵD\epsilon_{\mathcal{D}}-interpolating NN.) Let D={(xi,yi)∈Rd×Rp∣i∈{1,…,nD}}\mathcal{D} = \{(x_i,y_i) \in\mathbb{R}^d \times\mathbb{R}^p \mid i \in\{1,\ldots,n_{\mathcal{D}}\}\} be a dataset with pairwise distinct inputs xix_i and ϵD>0\epsilon_{\mathcal{D}} > 0 a given constant. Then there exists a feedforward neural network f~:Rd→Rp\widetilde{f} : \mathbb{R}^d \to\mathbb{R}^p with any continuous non-polynomial activation function such that ∥f~(xi)−yi∥≤ϵD\lVert\widetilde{f}(x_i) - y_i \rVert\le\epsilon_{\mathcal{D}} for all i=1,…,nDi = 1,\ldots,n_{\mathcal{D}}.

PROOF. The proof consists of two steps. First, we show that there exists a continuous function that interpolates the training data. Second, we apply the universal approximation theorem to conclude the existence of a neural network that approximates this interpolant with ϵD\epsilon_{\mathcal{D}} accuracy. As a result, this neural network satisfies ∥f~(xi)−yi∥≤ϵD\lVert\widetilde{f}(x_i) - y_i \rVert\le\epsilon_{\mathcal{D}} point-wise on the training data, which proves the claim.

Step 1: Consider the set S={xi∣i∈{1,…,nD}}⊂RdS = \{x_i \mid i \in\{1,\ldots,n_{\mathcal{D}}\}\} \subset\mathbb{R}^d consisting of the training inputs. Since SS is finite, it is closed. Now, define the function g:S→Rpg : S \to\mathbb{R}^p by g(xi)=yig(x_i) = y_i for all i=1,…,nDi = 1,\ldots,n_{\mathcal{D}}. We now aim to construct a continuous extension of the function gg from the set SS to the entire space Rd\mathbb{R}^d, yielding the desired interpolant. To this end, we consider the component functions gj:S→Rg_j : S \to\mathbb{R}, such that g(x)=(g1(x),…,gp(x))g(x) = (g_1(x),\ldots,g_p(x)), and each component satisfies gj(xi)=yi(j)g_j(x_i) = y_i^{(j)}, where yi=(yi(1),…,yi(p)).y_i = (y_i^{(1)},\ldots,y_i^{(p)}). As Rd\mathbb{R}^d, equipped with any pp-norm, is a normal topological space and SS is closed, the Tietze extension theorem [16 Theorem 12.4] guarantees that each real-valued component function gjg_j can be continuously extended from SS to Rd\mathbb{R}^d. We denote the continuous extension of gjg_j by qjq_j, and define the continuous interpolant q:Rd→Rpq:\mathbb{R}^d \to\mathbb{R}^p of the training data by q(x)=(q1(x),…,qp(x))q(x)=(q_1(x),\ldots,q_p(x)).

Step 2: We consider a compact set K⊂Rd\mathcal{K} \subset\mathbb{R}^d of interest such that S⊂KS \subset\mathcal{K}. By the universal approximation theorem [13], for any δ′>0\delta' > 0, there exists a neural network f~:Rd→Rp\tilde{f}:\mathbb{R}^d \to\mathbb{R}^p such that sup⁡x∈K∥f~(x)−q(x)∥∞<δ′\sup_{x \in\mathcal{K}}\|\tilde{f}(x)-q(x)\|_\infty< \delta'. The result can be extended to arbitrary pp-norms with 1≤p<∞1 \le p < \infty by using norm equivalences in finite-dimensional real spaces. Specifically, for any 1≤p<∞1 \le p < \infty, there exists a constant cp≥1c_p \ge1 such that ∥v∥p≤cp∥v∥∞\|v\|_p \le c_p\|v\|_\infty for all v∈Rpv \in\mathbb{R}^p, and trivially, cp=1c_p=1 if p=∞p=\infty. Thus, and taking δ′=ϵD/cp\delta'=\epsilon_D/c_p, we obtain sup⁡x∈K∥f~(x)−q(x)∥<ϵD\sup_{x \in\mathcal{K}}\|\tilde{f}(x)-q(x)\| < \epsilon_D, and in particular, ∥f~(xi)−yi∥≤ϵD\|\tilde{f}(x_i)-y_i\| \le\epsilon_D for all ii, which concludes the proof.

References

  1. [1]A. Alessio and A. Bemporad. A survey on explicit model predictive control, pages 345–369. Springer Berlin Heidelberg, 2009.DOI
  2. [2]H. Alsmeier, L. Theiner, A. Savchenko, A. Mesbah, and R. Findeisen. Imitation learning of MPC with neural networks: error guarantees and sparsification. In Conf. Decis. Control, pages 4777–4782, 2024.arxiv.org/abs/2501.03671
  3. [3]J. A E Andersson, J. Gillis, G. Horn, J. B Rawlings, and M. Diehl. CasADi – A software framework for nonlinear optimization and optimal control. Math. Program. Comput., 11:1–36, 2019.
  4. [4]J. Ansel, E. Yang, H. He, et al. PyTorch 2: Faster Machine Learning Through Dynamic Python Bytecode Transformation and Graph Compilation. In 29th ACM Int. Conf. Archit. Support Program. Lang. Oper. Syst., 2024.DOI
  5. [5]A. Bemporad, M. Morari, V. Dua, and E. N. Pistikopoulos. The explicit linear quadratic regulator for constrained systems. Automatica, 38:3–20, 2002.DOI
  6. [6]C. Büskens and H. Maurer. Sensitivity analysis and real-time optimization of parametric nonlinear programming problems, pages 3–16. Springer Berlin Heidelberg, 2001.DOI
  7. [7]S. Chen, K. Saulnier, N. Atanasov, D. Lee, V. Kumar, G. J. Pappas, and M. Morari. Approximating explicit model predictive control using constrained neural networks. In Am. Control Conf., pages 1520–1527, 2018.DOI
  8. [8]R. Drummond, S. Duncan, M. Turner, P. Pauli, and F. Allgöwer. Bounding the difference between model predictive control and neural networks. In Learn. Dyn. Cont. Conf., pages 817–829, 2022.arxiv.org/abs/2204.06486
  9. [9]A. V. Fiacco and Y. Ishizuka. Sensitivity and stability analysis for nonlinear programming. Ann. Oper. Res., 27:215–235, 1990.DOI
  10. [10]H. Gouk, E. Frank, B. Pfahringer, and M. J. Cree. Regularisation of neural networks by enforcing Lipschitz continuity. Mach. Learn., 110:393–416, 2021.
  11. [11]L. Grüne and J. Pannek. Nonlinear model predictive control: theory and algorithms. Springer, 2017.
  12. [12]M. H. Herteck, J. Köhler, S. Trimpe, and F. Allgöwer. Learning an approximate model predictive controller with guarantees. Control Sys. Lett., 2:543–548, 2018.
  13. [13]K. Hornik. Approximation capabilities of multilayer feedforward networks. Neural Netw., 4:251–257, 1991.DOI
  14. [14]K. Hornik. Some new results on neural network approximation. Neural Netw., 6:1069–1072, 1993.DOI
  15. [15]H. Hose, J. Köhler, M. N. Zeilinger, and S. Trimpe. Approximate nonlinear model predictive control with safety-augmented neural networks. IEEE Trans. Control Syst. Technol., 33:2490–2497, 2025.DOI
  16. [16]G. J. O. Jameson. Topology and normed spaces. Chapman and Hall, 1974.
  17. [17]B. Karg and S. Lucia. Efficient representation and approximation of model predictive control laws via deep learning. Trans. Cybern., 50:3866–3878, 2020.DOI
  18. [18]M. Kiss, R. Tóth, and M. Schoukens. Space-filling input design for nonlinear state-space identification. IFAC-PapersOnLine, 58:562–567, 2024.arxiv.org/abs/2405.18207
  19. [19]D. Limón Marruedo, T. Alamo, and E. F. Camacho. Input-to-state stable MPC for constrained discrete-time nonlinear systems with bounded additive uncertainties. In Conf. Decis. Control, pages 4619–4624, 2002.
  20. [20]S. Lucia and B. Karg. A deep learning-based approach to robust nonlinear model predictive control. IFAC-PapersOnLine, 51:511–516, 2018.DOI
  21. [21]S. Lucia, M. Kögl, P. Zometa, D. E. Quevedo, and R. Findeisen. Predictive control, embedded cyberphysical systems and systems of systems–a perspective. Annu. Rev. Control, 41:193–207, 2016.DOI
  22. [22]L. Lüken, D. Brandner, and S. Lucia. Sobolev training for data-efficient approximate nonlinear MPC. IFAC-PapersOnLine, 56:5765–5772, 2023.DOI
  23. [23]E. T. Maddalena, C. G. da S. Moraes, G. Waltrich, and C. N. Jones. A neural network architecture to learn explicit MPC controllers from data. IFAC-PapersOnLine, 53:11362–11367, 2020.arxiv.org/abs/1911.10789
  24. [24]J. Nubert, J. Köhler, V. Berenz, F. Allgöwer, and S. Trimpe. Safe and fast tracking on a robot manipulator: robust MPC and neural network control. Robot. Autom. Lett., 5:3050–3057, 2020.DOI
  25. [25]A. Paszke, S. Gross, F. Massa, et al. Pytorch: An imperative style, high-performance deep learning library. In Adv. Neural Inf. Process. Syst., 2019.arxiv.org/abs/1912.01703
  26. [26]P. Pauli, A. Koch, J. Berberich, P. Köhler, and F. Allgöwer. Training robust neural networks using Lipschitz bounds. Control Syst. Lett., 6:121–126, 2021.
  27. [27]J. A. Paulson and A. Mesbah. Approximate closed-loop robust model predictive control with guaranteed stability and constraint satisfaction. Control Syst. Lett., 4:719–724, 2020.DOI
  28. [28]J. B. Rawlings, D. Q. Mayne, and M. Diehl. Model predictive control: theory, computation, and design. Nob Hill Publishing, 2017.
  29. [29]A. Rose, M. Pfefferkorn, H. H. Nguyen, and R. Findeisen. Learning a Gaussian process approximation of a model predictive controller with guarantees. In Conf. Decis. Control, pages 4094–4099, 2023.
  30. [30]A. Rose, P. Schaub, and R. Findeisen. Safe and high-performance learning of model predictive control using kernel-based interpolation. In Am. Control Conf., pages 91–96, 2025.arxiv.org/abs/2410.06771
  31. [31]P. O. M. Sckoakert and J. B. Rawlings. Feasibility issues in linear model predictive control. AIChE Journal, 45:1649–1659, 1999.
  32. [32]D. Teichrib and M. Schulze Darup. Efficient computation of Lipschitz constants for MPC with symmetries. In Conf. Decis. Control, pages 6685–6691, 2023.
  33. [33]A. Tokmak, C. Fiedler, M. N. Zeilinger, S. Trimpe, and J. Köhler. Automatic nonlinear MPC approximation with closed-loop guarantees. Trans. Autom. Control, 2025.arxiv.org/abs/2312.10199
  34. [34]M. Zanon and S. Gros. Safe reinforcement learning using robust MPC. Trans. Autom. Control, 66:3638–3652, 2021.DOI
  35. [35]M. N. Zeilinger, C. N. Jones, and M. Morari. Real-time suboptimal model predictive control using a combination of explicit MPC and online optimization. Trans. Autom. Control, 56:1524–1534, 2011.

Paper details

vlnc:W_6xn293t5
v1 · latestHistory (1)

published · Fresh — added to the Hub within the last 30 days

added ·

Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

CC BY 4.0

Original source

  • Engineering

Not recorded for this paper · View statement →

Looking for related papers…
Contents