원시데이터 수집 시스템
선정목록으로

Approximate dynamic programming for constrained linear systems: A piecewise quadratic approximation approach

관련 산업용 섬유 · (8) HDPE 섬유(FORPE)

기본 정보

저자
  1. Kanghui He — Delft Center for Systems and Control, Delft University of Technology, Delft, The Netherlands
  2. Shengling Shi — Delft Center for Systems and Control, Delft University of Technology, Delft, The Netherlands
  3. Ton van den Boom — Delft Center for Systems and Control, Delft University of Technology, Delft, The Netherlands
  4. Bart De Schutter — Delft Center for Systems and Control, Delft University of Technology, Delft, The Netherlands
DOI
10.1016/j.automatica.2023.111456
저널
Automatica
발행년도
2023
발행기관
Elsevier BV
피인용수
6
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1016/j.automatica.2023.111456
토픽
Fuel Cells and Related Materials
OpenAlex ID
W4389512216

평가 내용

관련도
관련
사업분야
산업용 섬유 · (8) HDPE 섬유(FORPE)
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '산업용 섬유 > HDPE 섬유(FORPE)' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

<p>Approximate dynamic programming (ADP) faces challenges in dealing with constraints in control problems. Model predictive control (MPC) is, in comparison, well-known for its accommodation of constraints and stability guarantees, although its computation is sometimes prohibitive. This paper introduces an approach combining the two methodologies to overcome their individual limitations. The predictive control law for constrained linear quadratic regulation (CLQR) problems has been proven to be piecewise affine (PWA) while the value function is piecewise quadratic. We exploit these formal results from MPC to design an ADP method for CLQR problems with a known model. A novel convex and piecewise quadratic neural network with a local–global architecture is proposed to provide an accurate approximation of the value function, which is used as the cost-to-go function in the online dynamic programming problem. An efficient decomposition algorithm is developed to generate the control policy and speed up the online computation. Rigorous stability analysis of the closed-loop system is conducted for the proposed control scheme under the condition that a good approximation of the value function is achieved. Comparative simulations are carried out to demonstrate the potential of the proposed method in terms of online computation and optimality.</p>

본문 112,521자

본문 펼치기
## Approximate Dynamic Programming for Constrained Linear Systems: A Piecewise Quadratic Approximation Approach ⋆ ### Kanghui He, Shengling Shi, Ton van den Boom, Bart De Schutter Delft Center for Systems and Control, Delft University of Technology, Delft, The Netherlands Abstract Approximate dynamic programming (ADP) faces challenges in dealing with constraints in control problems. Model predictive control (MPC) is, in comparison, well-known for its accommodation of constraints and stability guarantees, although its computation is sometimes prohibitive. This paper introduces an approach combining the two methodologies to overcome their individual limitations. The predictive control law for constrained linear quadratic regulation (CLQR) problems has been proven to be piecewise affine (PWA) while the value function is piecewise quadratic. We exploit these formal results from MPC to design an ADP method for CLQR problems with a known model. A novel convex and piecewise quadratic neural network with a local-global architecture is proposed to provide an accurate approximation of the value function, which is used as the cost-to-go function in the online dynamic programming problem. An efficient decomposition algorithm is developed to speed up the online computation. Rigorous stability analysis of the closed-loop system is conducted for the proposed control scheme under the condition that a good approximation of the value function is achieved. Comparative simulations are carried out to demonstrate the potential of the proposed method in terms of online computation and optimality. Key words: Approximate dynamic programming; Reinforcement learning; Model predictive control; Value function approximation; Neural network; Constrained linear quadratic regulation. 1 Introduction 1.1 Background Reinforcement learning (RL) [1] provides powerful tools for the synthesis of controllers due to its strong interactions with the environment. When RL is applied to physical systems with given models, model-based RL, also known as (approximate) dynamic programming ((A)DP) [2], has received much attention since it can make effective use of the state transition information provided by the model. Combined with control techniques, model-based RL has successfully been applied to a broad range of control engineering. Compared to its diverse industrial applications, the theoretical analysis on the stability and safety for RL faces great challenges [3]. Originated from the artificial intel ⋆ This paper was not presented at any IFAC meeting. Corresponding author Kanghui He. Email addresses: k.he@tudelft.nl (Kanghui He), s.shi-3@tudelft.nl (Shengling Shi), a.j.j.vandenBoom@tudelft.nl (Ton van den Boom), b.deschutter@tudelft.nl (Bart De Schutter). ligence (AI) community, RL used to be developed only for AI applications (e.g., board games), in which AI researchers focused almost entirely on performance with respect to a designated reward function while stability and safety are ignored. Stability and safety, on the other hand, are central to the control community since unstable modes or risky control policies may lead to destructive consequences in physical systems. In the control community, the earliest ADP methods can be traced back to the 1990s, when Werbos [4] introduced function approximators to construct actor-critic structures for the synthesis of feedback control laws. Thanks to Lyapunov stability theory, the stability issue of ADP has been comprehensively addressed, both for linear [5] and nonlinear systems [6]. Recently, [7] has investigated the use of Lyapunov stability results to enforce stability of RL policies during the policy exploration. Although ADP approaches consider stability, safety is another important issue that needs further study. From the control viewpoint, safety means that the behavior of closed-loop systems, including states, inputs, and outputs, satisfies some hard or soft constraints. In summary, techniques employed by RL or ADP approaches for dealing with constraints can be grouped into two P i t b itt d t A t ti 10 A il 2023 categories: policy-projection-based methods and policyoptimization-based methods. Policy-projection-based methods consider the RL formulation in the unconstrained case and involves a regulator to check and modify the policies that may violate the constraints. Such regulator can be a single projection operator [8,9] that can handle linear state and input constraints, a predictive safety filter [10] for nonlinear state and input constraints, or it can contain control barrier functions to guarantee safety [11, 12]. These indirect methods, however, sometimes fail to capture the optimal solution of the constrained problem and lack stability guarantees. In comparison, optimization-based methods intend to directly get the optimal value function for the constrained problems by solving the constrained Hamilton-Jacobi-Bellman (HJB) equation. With the optimal value function available, the optimal control policy can thereby be produced by solving a constrained policy optimization problem. [13] was the first investigation of this kind of method, although it was limited to searching for the best linear feedback control law and needs an initial stabilizing policy. Following this direction, [14] explores an estimation approach to find an initial stabilizing policy even when there are uncertain nonlinear dynamics. The authors of [15] focused on using deep neural networks (NNs) to estimate the value function and the optimal policy for a nonlinear control problem with state constraints. It should be mentioned that in constrained cases, neither the optimal policy nor the optimal value function is readily available, even for the most basic infinitehorizon linear quadratic regulation (LQR) problems. This to some extent restricts the development of the policy-optimization-based RL methods for constrained control problems. In comparison, model predictive control (MPC) [16], an optimization-based control scheme widely adopted in the control community, has a mature stability and robustness theory as well as an inherent constraint handling. MPC uses multi-step policy optimization without any adaption. From RL’s point of view, using multi-step policy optimization algorithms diminishes the need for exact knowledge of the costto-go function [17]. For infinite-horizon LQR problems, MPC can render the exact optimal control law due to the equivalence of finite and infinite optimal control as long as the horizon is sufficiently long [18]. With this fundamental property, infinite-horizon LQR problems can be solved by either implementing MPC online or explicit MPC [19], and the solution is proven to be piecewise affine (PWA) in the state space [19]. However, the computational complexity of online MPC and the storage requirements of explicit MPC grow dramatically with the increase of the horizon. This is one of the main drawbacks of MPC compared with RL or ADP [20]. Dedicated to overcoming this drawback, approximation methods of predictive control laws have received much attention in recent years. An emerging methodology is using specific function regression techniques such as polynomial approximators [21] and PWA neural networks [9, 22, 23]. The PWA neural networks, or more specifically, the neural networks with rectified linear units, can represent PWA functions [24], which provides the opportunity for using PWA neural networks to accurately fit the predictive control laws. In [22, 23], this approach is shown to alleviate storage demands. Nevertheless, no guarantees of closed-loop stability are conveniently available, even through the final approximation error is small enough. Using NN-based controllers to warm start the solver in online MPC [25] can inherently guarantee stability, and learning Lyapunov functions to verify the stability of NN-based controllers [26] is also an alternative way. However, as additional computation is required in the optimization or learning procedure, the superiority of lower computational complexity brought by approximation methods is not obvious. [27] presents an on-policy RL framework to learn a Lyapunov NN, which is used in MPC as a terminal cost to generate a safe and stabilizing policy. However, it does not address the online computational issue since the NN can make the MPC problem too complex to solve. Besides, [28] develops a support vector machine-informed methodology to produce explicit model predictive controllers with feasibility and stability guarantees. To have these guarantees, [28] requires sufficient sampling and the initial state to lie in a specific small region. 1.2 Novelties and contributions Observing that MPC has computational limitations and approximation in the policy space lacks performance guarantees, we aim to attain a computationally inexpensive control scheme for linear systems with stability and feasibility guarantees. To this end, we approximate the value function via ADP and shorten the prediction horizon to one. We focus on the infinite-horizon LQR problem with state and input constraints. Note that usually, the optimal control law can be steep in some regions while the value function is continuous and convex [20]. So in general, the value function may be easier to approximate accurately than the control law. Different from the research on approximating the MPC policy [9, 21–23], we propose a value function approximation scheme. The optimal value function that has been extensively characterized by explicit MPC, is approximated by a piecewise quadratic (PWQ) neural network. The synthesis of the control law is carried out in a DP problem, where stability, feasibility, and sub-optimality can be guaranteed if a good approximation is obtained. Meanwhile, note that one disadvantage of approximating the value function is that it needs online policy optimization, which would not be the case in policy approximation methods [9,21–23]. To address this issue, we develop algorithms so that online optimization can be done efficiently, as will be shown in Section 3. 2 The contributions of the paper are highlighted as follows: (1) We propose a novel NN structure to approximate the solution of the constrained LQR problem based on ADP. The proposed NN structure can capture the PWQ and convex properties of the value function. Different from policy-based approximation approaches [9, 22, 29], our approach has the important advantage that the resulting controller has safety and stability guarantees. (2) We propose an efficient algorithm to solve the policy optimization problem, which is a convex piecewise quadratic program. In particular, this program is simplified to a collection of quadratic programs (QPs). Note that the main difficulty that prevents ones from considering more complex approximation structures is the increase in online computational time. We solve this problem in Algorithm 1. Complexity analysis and simulation results show that the proposed method requires much less online computation time than implicit MPC. (3) Compared to [13], the first exploration of ADP in a constrained LQR setting, the proposed approach eliminates the restriction of searching for a linear feedback law and does not require an initially stabilizing policy nor an initial state belonging to an invariant set. (4) We do a rigorous stability analysis, give stability conditions, and provide a tractable way to verify them. In contrast, [13] does not address stability, while [30] only explores stability conditions on the bound of the approximation errors but does not provide ways to verify them. 2 Preliminaries Notations: The identity matrix with dimension n × n is written as In. The set N denotes the set of positive integers containing zero. The symbol ∇f (·) is used to represent the gradient of a function f (·). In addition, λmax(P ) and λ min(P ) represent the maximum and minimum eigenvalues of a symmetric positive definite matrix P respectively. The boundary of the set P is ∂P, and int(P) stands for the interior of P. We utilize Ai,· to represent the ith row of the matrix A. 2.1 Infinite-horizon optimal control and MPC We study the infinite-horizon constrained linear quadratic regulation (CLQR) problem where xk ∈ R <sup>n</sup>, uk ∈ R <sup>m</sup>, A ∈ R <sup>n×n</sup>, B ∈ R <sup>n×m</sup>, X and U are polyhedra that contain the origin in their interior, and U <sup>∞</sup> = [u0, u1, ..., u∞] is the infinite-dimensional decision variable. Matrices A and B are known. Extending the proposed method to model-free cases will be our future work. In addition, computing K <sup>∗</sup> and P <sup>∗</sup> is also possible when the model is unknown [13]. Like other papers [9,31], it is assumed that is called the maximal LQR invariant set for the au XK ∗, ∀k ∈ N ⊆ R <sup>n�</sup> tonomous constrained linear system xk+1 = (A − BK <sup>∗</sup> ) xk, xk ∈X, ∀k ∈ N. Assumption A1: (A, B) is stabilizable, Q - 0, and R - 0. Moreover, there exists an initial state, such that there exists a sequence of admissible input vectors u0, u1, . . . that can steer the state to the origin, i.e., X¯ ≜ {x ∈ R <sup>n</sup> |∃U <sup>∞</sup> s.t. xk ∈X, uk ∈U, and J∞ <sup>∗</sup> X¯ ≜ {x ∈ R <sup>n</sup> |∃U <sup>∞</sup> s.t. xk ∈X, uk ∈U, and J∞ <sup>∗</sup> <sup>(x)</sup> < ∞, ∀k ∈ N } is not empty. In some existing literature [16, 31], X <sup>¯</sup> is also called the maximal stabilizable set. With Assumption A1, let K ∈ R <sup>m×n</sup> be a stabilizing gain matrix for the unconstrained plant xk+1 = Axk + Buk. As in [18], we consider the admissible set of states under a given stabilizing control gain K as X¯K = {x ∈ R <sup>n</sup> | x ∈X, −Kx ∈U}. If the constraints in the CLQR problem (1) are removed, the problem admits a unique linear solution u <sup>LQR</sup> k = −K <sup>∗</sup> xk, k = 0, 1, . . . where K <sup>∗</sup> = tion u <sup>LQR</sup> k = −K <sup>∗</sup> xk, k = 0, 1, . . . where K <sup>∗</sup> = R + B <sup>T</sup> P <sup>∗</sup> B positive-definite solution of the algebraic Riccati equation [5]� �−1 BT P ∗A and P ∗ = P ∗T is the unique k R + B <sup>T</sup> P <sup>∗</sup> B positive-definite solution of the algebraic Riccati equation [5]� �−1 BT P ∗A and P ∗ = P ∗T is the unique P <sup>∗</sup> = A <sup>T</sup> P <sup>∗</sup> A−A <sup>T</sup> P <sup>∗</sup> B �R+B <sup>T</sup> PB <sup>in</sup> <sup>the</sup> �−1 BT P ∗A+Q (2) ∞ <sup>∗</sup> <sup>(x) = xT P ∗x</sup> <sup>in</sup> <sup>the</sup> <sup>absence of constraints.</sup> Then, J <sup>∗</sup> In the constrained case, problem (1) is not as easy to solve as the unconstrained one due to the infinite number of decision variables. However, if the state is close to the origin, the unconstrained LQR solution u <sup>LQR</sup> k = −K <sup>∗</sup> xk, k = 0, 1, . . . may not violate the constraints so that the solution to problem (1) is identical to the unconstrained LQR solution −K <sup>∗</sup> xk as if there is no constraint at all. This motivates researchers to consider the following positively invariant set: Definition 1 (Maximal LQR invariant set [16, 18]) O∞ <sup>LQR</sup> = {x ∈ R <sup>n</sup> | (A − BK <sup>∗</sup> ) <sup>k</sup> x ∈ <sup>¯</sup> ∞ <sup>LQR</sup> = {x ∈ R <sup>n</sup> | (A − BK <sup>∗</sup> ) <sup>k</sup> x ∈ <sup>¯</sup> called the maximal LQR invariant set for the au XK ∗, ∀k ∈ N ⊆ R <sup>n�</sup> tonomous constrained linear system xk+1 = (A − BK <sup>∗</sup> ) x k=0 k=0 ∞ k=0 x <sup>T</sup> k <sup>T</sup> k <sup>Qxk</sup> <sup>+ uT</sup> k <sup>T</sup> k <sup>Ruk</sup> J∞ <sup>∗</sup> U <sup>∞</sup> (1) With this definition, the existing literature [18, 32, 33] considers using a finite-horizon problem: ∞ <sup>∗</sup> <sup>(x) = min</sup> J∞ (x0, U <sup>∞</sup> ) ≜ s.t. xk+1 = Axk + Buk, k = 0, 1, . . ., x0 = x xk ∈X, uk ∈U, k = 0, 1, . . . JN <sup>∗</sup> N <sup>∗</sup> <sup>(x) =</sup> min {uk} <sup>N</sup> k=0 <sup>−1</sup> <sup>T</sup> k <sup>Ruk</sup> <sup>+ x</sup> N <sup>T</sup> N <sup>T</sup> <sup>P ∗xN</sup> x <sup>T</sup> k <sup>T</sup> k <sup>Qxk</sup> <sup>+ uT</sup> k N −1 k=0 3 s.t. xk+1 = Axk + Buk, k = 0, 1, . . ., N - 1, x0 = x xk ∈X, uk ∈U, k = 0, 1, . . ., N - 1 (3) pends on the current state x: N <sup>∗</sup> <sup>(x) =1</sup> 2 0 <sup>Y x0 + min</sup> 2 <sup>xT</sup> U 0 <sup>FU</sup> . 2 <sup>U T HU</sup> <sup>+ xT</sup> - 1 (4) to approximate the infinite-horizon LQR problem (1). In (3), U = [u0, u1, ..., uN −1] is the decision variable and U <sup>∗</sup> (x) is the solution. The rationale behind this design is that after a sufficient long horizon, the resulting xN will fall into O∞ <sup>LQR</sup> where the unconstrained LQR solu tion uN = −K <sup>∗</sup> xN will not violate the constraints. Since O∞ <sup>LQR</sup> is positively invariant, the subsequent trajectories xN +1, xN +2, . . . will always stay in O∞ <sup>LQR</sup>, and the con JN <sup>∗</sup> s.t. GU ≤ w + Sx0, x0 = x; xN +1, xN +2, . . . will always stay in O∞ <sup>LQR</sup>, and the con straints will be automatically satisfied with the control gain K <sup>∗</sup> . As the result, the terminal cost x <sup>T</sup> N <sup>P ∗xN</sup> <sup>is an</sup> where the matrices H, F, Y, G, w, S can be readily obtained through matrix multiplication operations. Problem (4) can be solved online or offline. The online implementation requires to solve a quadratic program (QP) with x in (4) fixed to the current state at each time step. Although efficient QP solvers based on interior point methods and active-set methods are applicable, the computational complexity is cubic in the horizon N and the dimension m of the input vector. In comparison, the offline method, also called explicit MPC, aims to directly solve the mpQP in (4) for all possible x in a feasible set, and find the relationship between the optimizer U <sup>∗</sup> (x) and x. The results from explicit MPC show that the optimizer U <sup>∗</sup> (x) and the optimal MPC control law are PWA. Therefore, the solution to the infinite-horizon problem (1) is also PWA. The following theorem, proposed in [19], summarizes the properties of the explicit solution to the CLQR problem. Theorem 2 ( [19]) With Assumption A1 and the equivalence in Theorem 1 satisfied, the state feedback solution to the CLQR problem (1) in a compact polyhedral set of the initial conditions X0 ⊆ X <sup>¯</sup> is time-invariant, continuous and PWA u <sup>∗</sup> = Fj x + gj if x ∈Rj, j = 1, . . ., Nr (5) where the polyhedral sets Rj = {x ∈ R <sup>n</sup> : Hjx ≤ hj}, j = 1, . . ., Nr constitute a finite partition of X0. To implement the PWA feedback law, the direct way is to store Hj, hj, Fj, gj that define all the polyhedra Rj and the corresponding affine feedback law, perform an online search to locate the polyhedron that contains x, and finally feed the system with the corresponding affine feedback law. 2.2 Problem formulation The explicit controller is easy to compute offline in the case of a short horizon and a low-dimensional input vector. However, with the increase of the horizon and the input’s dimension, the number of regions in (5) grows exponentially [19] and the representations of these regions become more complex, which may make the offline computation and online implementation intractable. It has been verified that artificial neural networks with at least one hidden layer have the capability of universal approximation [34] for any continuous function, provided that the hidden layer is given enough units. Herein, gain K <sup>∗</sup> . As the result, the terminal cost x <sup>T</sup> N <sup>P ∗xN</sup> <sup>is an</sup> exact representation for J∞ <sup>∗</sup> <sup>(xN</sup> <sup>).</sup> <sup>The</sup> <sup>following</sup> <sup>theo-</sup> rem, proposed in [18], formally demonstrates the validity of this design. Theorem 1 ( [18]) Let J¯ be an upper bound on J∞ <sup>∗</sup> <sup>(x).</sup> <sup>For</sup> <sup>any</sup> <sup>x</sup> <sup>∈</sup> X¯, if N - /q where J∞ <sup>∗</sup> <sup>(x).</sup> <sup>For</sup> <sup>any</sup> <sup>x</sup> <sup>∈</sup> X¯, if N - /q where 0 < q ≤ qm ≜ inf x/∈O∞LQR x <sup>T</sup> Qx �J¯and− p�0 < p ≤ - ∞ <sup>∗</sup> <sup>(x).</sup> <sup>For</sup> <sup>any</sup> <sup>x</sup> <sup>∈</sup> X¯, if N 0 < q ≤ qm ≜ inf x/∈O∞LQR x <sup>T</sup> Qx �J¯and− p�0 < p ≤ pm ˆ= inf x/∈O∞LQR x <sup>T</sup> Px, then�xN ∈O� ∞ <sup>LQR</sup> and prob - x <sup>T</sup> Qx xN pm ˆ= inf x/∈O∞LQR x <sup>T</sup> Px, then xN ∈O∞ <sup>LQR</sup> and prob lem (3) is equivalent to problem (1) in the sense of - J∞ <sup>∗</sup> <sup>(x) = J</sup> N <sup>∗</sup> <sup>(x),</sup> <sup>∀x ∈</sup> <sup>X¯</sup> <sup>.</sup> ∞ x <sup>T</sup> Px equivalent ∞ , then xN ∈O∞ <sup>LQR</sup> - to problem (1) in N <sup>∗</sup> <sup>(x),</sup> <sup>∀x ∈</sup> <sup>X¯</sup> <sup>.</sup> ∞ <sup>∗</sup> <sup>(x) = J</sup> N <sup>∗</sup> According to Theorem 1, the horizon N is essential to the equivalence of the finite-horizon and infinite-horizon problems. For a given x, one can repeatedly solve problem (3) with an increasing N until the terminal state falls into O∞ <sup>LQR</sup> [32]. This approach only works for a certain state value. Alternatively, [18] gives a conservative estimate of the horizon for all x belonging to a polyhedral set X0 based on the result in Theorem 1. Specifically, [18] computes pm, qm, and J∞ <sup>∗</sup> <sup>(·) at the vertices of X0. Next,</sup> J¯ is set to be maximum of all J∞ <sup>∗</sup> <sup>(·),</sup> <sup>and</sup> <sup>N</sup> <sup>is</sup> <sup>selected</sup> to be the smallest integer such that N ≥ ( J <sup>¯</sup> - pm)/qm. It is not necessary to compute O∞ <sup>LQR</sup> explicitly. A more mathematically convenient routine is to compute an ellipsoidal subset of O∞ <sup>LQR</sup> [18]. This approach, on the other hand, may lead to a conservative choice of N . With the equivalence in Theorem 1 established, we can regulate the state to minimize the infinite-horizon cost by solving problem (3). Throughout the paper, we assume that N in (3) is chosen such that the equivalence in Theorem 1 is satisfied. Problem (3) can be solved in a receding-horizon manner. Specifically, at each time step t, t ∈ N, x in (3) is set to the current state xt and only the first m elements of the corresponding solution U <sup>∗</sup> (xt) is applied to the system, i.e., u <sup>∗</sup> t <sup>(xt)</sup> <sup>=</sup> lution U <sup>∗</sup> (xt) is applied to the system, i.e., u <sup>∗</sup> t <sup>(xt)</sup> <sup>=</sup> [Im 0m - · · 0m]U <sup>∗</sup> (xt). Then, problem (3) is a typi N −1 terms cal MPC problem. - �� ]U <sup>∗</sup> (xt). Then, problem (3) is a typi cal MPC problem. By substituting the state update equation into JN <sup>∗</sup> <sup>(x)</sup> and the constraints, (3) can be reformulated as a multiparametric quadratic program (mpQP) that only de 4 one direct intuition is that we can use neural networks to represent the explicit MPC law, without any need to identify the regions in (5). With the knowledge of the PWA form of the MPC law, one can construct some specific neural architectures to achieve exact and computationally inexpensive approximation. Related work has been reported in [9, 22, 29], combined with supervised learning or policy gradient methods. The neuralnetwork-based controllers proposed in these papers require online feasibility certificate to determine whether the outputs of the neural networks are safe. Usually, a feasibility recovery technique based on projection is used to regulate the control inputs. These neural network based policy approximators, on the other hand, inherently lack stability guarantees. The authors of [25] propose an explicit-implicit MPC scheme, where neural networks provide a control input initialization and a primal active-set method is executed to solve a QP online to ensure feasibility and asymptotic stability. However, this explicit-implicit MPC scheme needs large-scale neural networks whose outputs are supposed to contain all primal and dual variables in (4), and the online computation burden still exists since the decision variable in the QP is still U . To address the computational burden of MPC and the lack of guarantees of policy-based approximation, we adopt value function approximation and shorten the MPC horizon to one. The main challenges are thereby (i) the design of the value function approximator, which is expected to output a function akin to the optimal value function, (ii) the relation between those guarantees and the quality of the approximation, and (iii) further reduction of online computation time concerning that the one-step problem contains a function approximator. Before establishing our approximation structure, we concentrate on the properties of the optimal value function J∞ <sup>∗</sup> <sup>(·).</sup> Then, Theorem 3 ( [16]) With Assumption A1 and the equivalence in Theorem 1 satisfied, then, in a compact polyhedral set of the initial conditions X0 ⊆ X¯, the optimal value function J∞ <sup>∗</sup> <sup>(·)</sup> <sup>obtained</sup> <sup>from</sup> <sup>J</sup> N <sup>∗</sup> <sup>(·)</sup> <sup>is</sup> continuous, convex, and PWQ over polyhedra: ∞ <sup>∗</sup> <sup>(x) = Ji(x) = xT Pix+q</sup> i <sup>T</sup> J <sup>∗</sup> i <sup>T</sup> <sup>x+vi,</sup> <sup>if</sup> <sup>x ∈Ri, i = 1, . . ., Nr</sup> Pi − Pj ≤ 0 if Ai ⊂Aj P <sup>∗</sup> - Pj ≤ 0 ∀j ∈{1, 2, . . ., Nr} (7) Problem (4) is said to be (primal) degenerate if GAj,· is not full row rank in some regions Rj. Note that some CLQR problems may result in degenerate mpQPs, which means the continuous differentiability of J∞ <sup>∗</sup> <sup>(·)</sup> may not always hold. For example, degeneracy could happen when more than Nm constraints in (4) are active at the optimizer U <sup>∗</sup> (x). Nevertheless, degeneracy does not necessarily cause the loss of continuous differentiability of the value function [35]. Also notice that currently, there are no analytical results on how to identify a class of control problems that can ensure nondegeneracy in advance. Adding a terminal constraint may make (4) become degenerate [35]. If degeneracy is recorded when solving (4), feasible methods to avoid degeneracy include removing redundant constraints from GU ≤ w + Sx0 [36] or slightly tuning the weight matrices Q and R. 3 ADP design for CLQR problem 3.1 Design of neural network for approximation in value space According to Theorems 3 and 4, the value function approximator, denoted by J <sup>ˆ</sup> (·, θ) where θ refers to some parameters, is expected to have the following features: - (F1) It can partition its input space into polyhedral regions. - (F2) It can produce a convex and PWQ function partitioned by polyhedra. - (F3) For x in a small region containing the origin, the approximator can provide the exact representation for the value function, i.e., J <sup>ˆ</sup> (x, θ) = x <sup>T</sup> P <sup>∗</sup> x. We intend to use a feed-forward NN to capture the relationship between the state x and the value J∞ <sup>∗</sup> <sup>(·) of the</sup> optimal value function. A feed-forward NN is composed of one or more hidden layers and an output layer, where each hidden layer contains an affine map fl (κl−1) = Wlκl−1 + bl, followed by a nonlinear map κl = gl(fl). Here, Ml is the width of the lth layer, referring to the number of units in the layer, M0 = n, κl−1 ∈ R <sup>Ml</sup> is the output of the previous layer with κ0 the input of the network, Wl ∈ R <sup>Ml×Ml−1</sup> and bl ∈ R <sup>Ml</sup> are the weights and biases, respectively, gl(·) : R <sup>Ml</sup> → R <sup>Ml</sup> is a nonlinear activation function that is usually applied element-wise on its input. In the output layer, the outputs of the last hidden layer are linearly combined with weight WL+1 ∈ R <sup>1×Ml</sup> and (6) Moreover, if the mpQP problem (4) is not degenerate, then the value function J∞ <sup>∗</sup> <sup>(·)</sup> <sup>is</sup> <sup>continuously</sup> <sup>differen-</sup> tiable. Theorem 4 ( [35]) Assume that the infinite-horizon problem (1) results in a non-degenerate mpQP. Let Ri, Rj be two neighboring polyhedra and Ai, Aj be the corresponding sets of active constraints at the optimum of (4), i.e., Ai = {l | Gl,·U <sup>∗</sup> (x) = wl,· + Sl,·x, x ∈Ri}. 5 bias bL+1 ∈ R, to produce the final output of the network. Based on these definitions, a NN with L hidden layers and Ml units in the lth layer can be represented by fNN(x, θ) = [fL+1 ◦ gL ◦ fL ◦· · · ◦ g1 ◦ f1](x) (8) where θ contains all the weights and biases of the affine functions in all the layers, and the symbol - means the layers are connected in series. The activation function plays an important role in the approximation of NNs. In this paper, we consider a popular activation function, named the rectifier linear unit (ReLU), which is defined as gReLU(x) = max {0, x}. Here, max(0, x) computes the element-wise maximum between the vector x and a zero vector of the same dimension. An amazing property of the ReLU is that it can produce a series of PWA functions with polyhedral partitions, combined with an affine transformation [24]. Actually, the output of a NN with ReLUs as activation functions is PWA. Based on these observations, [9,22,29] contemplate using ReLU NNs to represent the explicit MPC law. As the optimal value function is PWQ, we are interested in producing a class of PWQ basis functions that can efficiently represent the value function. Let us focus on the last hidden layer in (8). All activation units in this layer can still be written as a continuous PWA function over the input space of the network [37]. The elementwise product of any two vector-valued continuous PWA functions with the same number of components is a continuous PWQ function. This indicates that such a product can be a possible basis to capture the features of the MPC optimal value function. We therefore calculate the element-wise product ⊙ of all the units κL in the last hidden layer ϕ = p (κL) ≜ diag(κL)κL ∈ R <sup>ML</sup> to generate a series of PWQ functions ϕ = [ϕ1(x) ϕ2(x) - · · ϕM (x)] <sup>T</sup> . This calculation can be viewed as a layer in the network, denoted by the product layer p(κL). Finally, the output layer is a simple weighted sum of the outputs of the previous layer: with P <sup>∗</sup> the solution to the algebraic Riccati equation. The term x <sup>T</sup> P <sup>∗</sup> x is included to capture “global” aspects of J∞ <sup>∗</sup> <sup>(·),</sup> <sup>while</sup> <sup>the</sup> <sup>neural-network-based</sup> <sup>term</sup> <sup>is</sup> exploited to identify the polyhedral partition in (6) and capture the local residuals J∞ <sup>∗</sup> <sup>(x) −</sup> <sup>xT P ∗x.</sup> <sup>Since</sup> <sup>the</sup> known term x <sup>T</sup> P <sup>∗</sup> x that dominates the value function is extracted and fixed, using such a “local-global” architecture is possible to enhance the quality of approximation. X0, and get the state-value pairs {(x <sup>(i)</sup>, J∞ <sup>∗</sup> <sup>(x(i)))}N</sup> i=1 <sup>x</sup> <sup>.</sup> Let U <sup>(i)∗</sup> = {u <sup>(</sup> k <sup>i)∗</sup> } <sup>N</sup> k=0 <sup>−1</sup> <sup>and</sup> <sup>{x(</sup> k <sup>i)∗</sup> } <sup>N</sup> k=0 <sup>denote</sup> <sup>the</sup> <sup>solu-</sup> tion to the MPC problem for the initial state x <sup>(i)</sup> and the corresponding trajectories of the closed-loop controlled system. All existing research [22,29] on the approximation of MPC only uses the initial states {x <sup>(</sup> 0 <sup>i)∗</sup> } <sup>N</sup> i=1 <sup>x</sup> <sup>as the</sup> input training data, which means solving (3) Nx times can only generate Nx training pairs. <sup>(</sup> 0 <sup>i)∗</sup> } <sup>N</sup> i=1 <sup>x</sup> We hereafter denote M1 by M, and J <sup>ˆ</sup> (·, W, b, r) by Jˆ (·, θ) for the sake of brevity, with all the parameters condensed in θ. The reason why we use only one hidden layer is twofold. First, by using one hidden layer, it is possible to construct a convex J <sup>ˆ</sup> (·, θ), which is desirable since the real optimal value function is convex. This property will be discussed in the next section. More importantly, using one hidden layer provides the opportunity to solve the dynamic programming problem through simple QP methods. It should be noticed that in our case the dynamic programming problem is a nonlinear program since the objective function is PWQ. If we use one hidden layer, we can explicitly compute the coefficients of Jˆ (·, θ) by extracting the activated units in the hidden layer. The online dynamic programming can be conducted by solving a sequence of quadratic programs without the need to calculate any gradients or Hessians. 3.2 Network training and convexity analysis So far, we have finished the design of the architecture of the proposed neural network. This subsection discusses the optimization strategy over the parameters in θ in order to approximate the optimal value function. Firstly, training data needs to be generated offline by solving (3) for Nx different initial states i=1 <sup>, x(i)</sup> <sup>∈</sup> solving (3) for Nx different initial states i=1 <sup>, x(i)</sup> <sup>∈</sup> X0, and get the state-value pairs {(x <sup>(i)</sup> �, Jx <sup>(</sup> ∞ <sup>∗i)�(xN(xi)))}N</sup> i=1 <sup>x</sup> <sup>.</sup> <sup>N</sup> k=0 <sup>−1</sup> <sup>and</sup> <sup>{x(</sup> k <sup>i)∗</sup> ∞ <sup>∗</sup> <sup>(x(i)))}N</sup> i=1 <sup>x</sup> <sup>(</sup> k <sup>i)∗</sup> } <sup>N</sup> k=0 <sup>−1</sup> <sup>(</sup> k <sup>i)∗</sup> } <sup>N</sup> k i=1 <sup>)</sup>, J∞ <sup>∗</sup> <sup>(x(i)</sup> �x <sup>(i)�Nx</sup> fL+1(ϕ) = r <sup>T</sup> ϕ = ML i=1 riϕi with the weight vector r = (r1, r2, ..., rML ) <sup>T</sup> ∈ R <sup>ML</sup> . To make the proposed approximator satisfy F3, we develop a “local-global” architecture [38], which decomposes the outputs of the approximator into two parts Jˆ (x, W, b, r) = x <sup>T</sup> P <sup>∗</sup> x + [f2 ◦ p ◦ g1 ◦ f1](x) (9) In view of this, we present a more efficient strategy for data generation by leveraging the equivalence between the finite-horizon problem and the infinite-horizon problem. Suppose that we have obtained the optimal control sequence {u <sup>(</sup> k <sup>i)∗</sup> } <sup>N</sup> k=0 <sup>−1</sup> <sup>and</sup> <sup>the</sup> <sup>corresponding</sup> <sup>value</sup> JN <sup>∗</sup> for different x <sup>(i)</sup>, consider the sub-problems <sup>(</sup> k <sup>i)∗</sup>, U ) in (1). According to the <sup>(</sup> k <sup>i)∗</sup> } <sup>N</sup> k=0 <sup>−1</sup> JN <sup>∗</sup> for different x <sup>(i)</sup>, consider the sub-problems whereby�x <sup>(i)�</sup> we start at x <sup>(</sup> k <sup>i)∗</sup>, for k = 1, . . ., N - 1 and wish to minimize J∞(x <sup>(</sup> k <sup>i)∗</sup>, U ) in (1). According to the N whereby �x <sup>(i)�</sup> 6 principle of optimality [17], the truncated optimal control sequence {u <sup>(</sup> j <sup>i)∗</sup> } <sup>N</sup> j= <sup>−</sup> k <sup>1</sup> <sup>is</sup> <sup>also</sup> <sup>optimal</sup> <sup>for</sup> <sup>these</sup> <sup>sub-</sup> problems. As a result, the optimal value functions for these subsequent trajectories x <sup>(</sup> k <sup>i)∗</sup>, k = 1, . . ., N − 1 can directly be computed as ∞ <sup>∗</sup> <sup>(x(</sup> k <sup>i)∗</sup> N <sup>∗</sup> <sup>(x(</sup> k <sup>i)∗</sup> J∞ <sup>∗</sup> <sup>(</sup> k <sup>i)∗</sup> ) = JN <sup>∗</sup> <sup>(</sup> k <sup>i)∗</sup> ) (10) <sup>(</sup> j <sup>i)∗</sup> + uj <sup>(i)∗T</sup> j <sup>(i)∗T</sup> Ru <sup>(</sup> j <sup>i)∗</sup> j = JN <sup>∗</sup> <sup>(x(i)) −</sup> k−1 j=0 xj <sup>(i)∗T</sup> j <sup>(i)∗T</sup> Qx <sup>(</sup> j <sup>i)∗</sup> After the neural network is trained, the system can be run and the control signals are computed by solving a dynamic programming problem. It is desirable that it could be convex so that any locally optimal point is also globally optimal. It should be noticed that in most case a neural network cannot provide a convex function w.r.t. its inputs even through it uses convex activation functions. With a specific structure, our proposed neural network, on the other hand, allows to produce a convex function J <sup>ˆ</sup> (·, θ). Suppose that the output of the proposed approximator has the following PWQ form: with no need to solve (3) repeatedly. Jˆ(x, θ)= Jˆ <sup>j</sup> (x)= x <sup>T</sup> Pˆjx+ˆqj <sup>T</sup> j <sup>T</sup> <sup>x+ˆvj, if x ∈</sup> <sup>Rˆ</sup> <sup>j, j =1, . . .,</sup> <sup>Nˆr</sup> With this design, we can generate NxN state-value pairs by only solving (3) Nx times. Therefore, our sampling strategy is sampling from the MPC closed-loop trajectories. Besides, since we have assumed the complete knowledge of the model, data (state-value pairs) can be rapidly and accurately generated once the initial states x0 are sampled. In addition, for any x <sup>(i)</sup>, the control sequence {uk <sup>(i)∗</sup> } <sup>N</sup> k=0 <sup>−1</sup> <sup>will</sup> <sup>regulate</sup> <sup>the</sup> <sup>state</sup> <sup>to</sup> <sup>a</sup> <sup>point</sup> <sup>in</sup> <sup>O</sup> ∞ <sup>LQR</sup> (12) where R <sup>ˆ</sup> j are polyhedra defined by the hyperplanes {Wl,·x + bl = 0} <sup>M</sup> l=1 <sup>.</sup> <sup>Define</sup> <sup>R¯</sup> <sup>=</sup> <sup>diag(r)</sup> <sup>and</sup> <sup>we</sup> <sup>can</sup> {Wl,·x + bl = 0} <sup>M</sup> l=1 <sup>.</sup> <sup>Define</sup> <sup>R¯</sup> <sup>=</sup> <sup>diag(r)</sup> <sup>and</sup> <sup>we</sup> <sup>can</sup> rewrite (9) as k <sup>(i)∗</sup> } <sup>N</sup> k=0 <sup>−1</sup> <sup>N</sup> k=0 <sup>−1</sup> <sup>will</sup> <sup>regulate</sup> <sup>the</sup> <sup>state</sup> <sup>to</sup> <sup>a</sup> <sup>point</sup> <sup>in</sup> <sup>O</sup> ∞ <sup>LQR</sup> k k=0 <sup>will</sup> <sup>regulate</sup> <sup>the</sup> <sup>state</sup> <sup>to</sup> <sup>a</sup> <sup>point</sup> <sup>in</sup> <sup>O</sup> ∞ and the subsequent states will always stay in O∞ <sup>LQR</sup> and the subsequent states will always stay in O∞ <sup>LQR</sup> ac cording to Theorem 1. This means that the tail of the state sequence {x <sup>(</sup> k <sup>i)∗</sup> } <sup>N</sup> k=0 <sup>−1</sup> <sup>is prone to congregating near</sup> the origin if the initial state x <sup>(i)</sup> is chosen too close to the origin. Therefore, to make the training data cover the whole region of X0 as much as possible, the initial states x <sup>(i)</sup>, i = 1, . . ., Nx are recommended to be set near the boundary of X0. <sup>(</sup> k <sup>i)∗</sup> } <sup>N</sup> k=0 <sup>−1</sup> With the NxN state-value pairs available, the neural network is trained so that its parameters approximate the solution to the following problem: Nx i=1 N −1 k=0 Jˆ(x, θ) = x <sup>T</sup> P <sup>∗</sup> x + κ <sup>T</sup> Rκ¯ (13) where κ, the output of the hidden layer, is PWA w.r.t. x. Therefore, by applying the chain rule for the second derivative, it is found that the Hessian ∇ <sup>2</sup> x <sup>Jˆ</sup> <sup>is</sup> <sup>positive</sup> definite in the interior of any R <sup>ˆ</sup> j if the weight matrix R <sup>¯</sup> ≥ 0, i.e., ri ≥ 0, for i = 1, . . ., M . In the following, we will show that the gradient descent method with projection can guarantee the positive semi-definiteness of R <sup>¯</sup> . Proposition 1 Consider the PWQ NN (9). With a non-negative r and a negative b, the function J <sup>ˆ</sup> (·, θ) that the NN produces is continuously differentiable and convex w.r.t. its input. Proof In the interior of any R <sup>ˆ</sup> j, j = 1, . . ., N <sup>ˆ</sup> r, continuous differentiability of J <sup>ˆ</sup> (·, θ) is clear since J <sup>ˆ</sup> (·, θ) has a quadratic form, and convexity of J <sup>ˆ</sup> (·, θ) follows from the positive semi-definiteness of R <sup>¯</sup> in (13). Then, we have Pˆj - P <sup>∗</sup> ≥ 0 for all j = 1, . . ., Nˆr. At the boundary of any neighboring R <sup>ˆ</sup> i and R <sup>ˆ</sup> j, without loss of generality, suppose that R <sup>ˆ</sup> i, R <sup>ˆ</sup> j are partitioned by the hyperplane W1,·x + b1 = 0, i.e., W1,·x + b1 ≤ 0 ∀x ∈ R <sup>ˆ</sup> i and W1,·x + b1 ≥ 0 ∀x ∈ R <sup>ˆ</sup> j. It follows from (3.3) that Jˆ <sup>j</sup> (x) = Jˆ <sup>i</sup> (x) + r1(W1,·x + b1) <sup>2</sup> (14) Differentiating both sides of (14) yields ∇xJ <sup>ˆ</sup> j(x, θ) = ∇xJ <sup>ˆ</sup> i(x, θ) ∀x ∈{x ∈ R <sup>n</sup> |W1,·x + b1 = 0} which proves continuous differentiability of J <sup>ˆ</sup> (x, θ) at the boundary. min b<0,W,r≥0 1 NNx e(x <sup>(</sup> k <sup>i)∗</sup>, θ) (11) e(x <sup>(</sup> k <sup>i)∗</sup> where e(x <sup>(</sup> k <sup>i)∗</sup>, θ) = ( J <sup>ˆ</sup> (x <sup>(</sup> k <sup>i)∗</sup>, θ) - J∞ <sup>∗</sup> <sup>(x(</sup> k <sup>i)∗</sup> )) <sup>2</sup> is the square of the approximation error for each training pair, and x <sup>(</sup> 0 <sup>i)∗</sup> = x <sup>(i)</sup>, ∀i ∈{1, . . ., Nx}. The constraint b < 0 where e(x <sup>(</sup> k <sup>i)∗</sup> <sup>(</sup> k <sup>i)∗</sup>, θ) = ( J <sup>ˆ</sup> (x <sup>(</sup> k <sup>i)∗</sup> <sup>(</sup> k <sup>i)∗</sup>, θ) - J∞ <sup>∗</sup> ∞ <sup>∗</sup> <sup>(x(</sup> k <sup>i)∗</sup> and x <sup>(</sup> 0 <sup>i)∗</sup> = x <sup>(i)</sup>, ∀i ∈{1, . . ., Nx}. The constraint b < 0 is introduced to guarantee that no units in the hidden layer are activated when x is near the origin, i.e., to fulfill F3, while the constraint r ≥ 0 is responsible for maintaining convexity of J <sup>ˆ</sup> (·, θ). Problem (11) is a nonlinear least-squares problem, which can be successfully solved by the gradient descent method [39] with a learning rate α > 0. The constraints on the NN parameters can be handled by constraint elimination, i.e., by letting r = r¯1 <sup>2, ¯r</sup> 2 <sup>2, . . ., ¯r</sup> M <sup>2</sup> elimination, i.e., by letting r = r¯1 <sup>2, ¯r</sup> 2 <sup>2, . . ., ¯r</sup> M <sup>2</sup> can always guarantee r ≥ 0, penalizing the constraint - �T, which violation in the loss function, or reducing the number of hidden units if constraint violation is detected. �r¯1 <sup>2</sup> 1 <sup>2, ¯r</sup> 2 <sup>2, . . ., ¯r</sup> M <sup>2</sup> 7 Furthermore, since J <sup>ˆ</sup> (x, θ) is differentiable, convexity of Jˆ(x, θ) at the boundary can be checked through firstorder conditions [40]. Formally speaking, J <sup>ˆ</sup> (x, θ) is convex if and only if Jˆ(x2, θ) − Jˆ(x1, θ) ≥∇ <sup>T</sup> x <sup>Jˆ(x1, θ)(x2 −</sup> <sup>x1)</sup> (15) holds for all x1, x2 belonging to the domain of J <sup>ˆ</sup> (x, θ). As convexity of J <sup>ˆ</sup> (x, θ) in the interior of any R <sup>ˆ</sup> j, j = 1, . . ., N <sup>ˆ</sup> r has been verified, we only focus on the boundary. Without loss of generality, let x1 ∈ R <sup>ˆ</sup> i and x2 ∈ R <sup>ˆ</sup> j. From (14) one has Jˆ (x2, θ) − Jˆ (x1, θ) −∇x ˆJ (x1, θ) <sup>T</sup> (x2 − x1) = J <sup>ˆ</sup> i (x2)+r1 (W1,·x2 +b1) <sup>2</sup> −J <sup>ˆ</sup> i (x1)−∇ <sup>T</sup> x <sup>Jˆi</sup> <sup>(x1, θ) (x2</sup> <sup>−x1)</sup> <sup>T</sup> 2 <sup>Pix2 + q</sup> i <sup>T</sup> <sup>x2 + r1 (W1,·x2 + b1)2</sup> =x <sup>T</sup> 2 - x <sup>T</sup> 1 <sup>T</sup> 1 <sup>Pix1</sup> <sup>+ q</sup> i <sup>T</sup> <sup>x1</sup> <sup>−</sup> x <sup>T</sup> 1 �) + <sup>T</sup> 1 <sup>Pi</sup> <sup>+ q</sup> i <sup>T</sup> (x2 − x1) �x2 + b1) <sup>2</sup> = (x2 −x1) <sup>T</sup> Pi (x2 −x1) + r1 (W1,·x2 + b1) <sup>2</sup> ≥ 0 which demonstrates that J <sup>ˆ</sup> (·, θ) satisfies (15) at the boundary. This completes the proof of Proposition 1. ✷ Remark 1 In [13], a quadratic value function approximator is proposed to implement both model-based and model-free ADP algorithms. Compared with the modelbased method in [13], our method retains the PWQ property of the real value function and moves the training process offline. As a result, the proposed control framework can more accurately accommodate the optimal control law. Besides, [13] assumes that the initial state lies in an invariant set, while our method relaxes this restriction. In particular, the domain of attraction under the proposed control law can be equal to the maximal stabilizable set X <sup>¯</sup> . Overall, the benefit of considering piecewise quadratic approximation is its good approximation performance, while the advantage of considering a quadratic form is that one can use Riccati Equation to update the value function without any state transition data. 3.3 Suboptimal control law based on dynamic programming With a well-fitted J <sup>ˆ</sup> (·, θ) available, at each time step t ∈ N, we can obtain a suboptimal control policy by solving the following one-step dynamic programming problem to indicate that problem (16) is solved online at each time step t. In problem (16), C is chosen as X <sup>¯</sup> or R <sup>n</sup>, depending on whether X <sup>¯</sup> is computable. In particular, if the iterative algorithm (Algorithm 10.3) in [16] does not terminate in finite time, we drop the constraint on Axt + But. This could happen, e.g., when there is no state constraint in (1). Besides, in both cases problem (16) is recursively feasible since X <sup>¯</sup> is a control invariant set (CIS) [16]. Moreover, it should be noted that some approximation methods of predictive control laws specify C as the maximal CIS C∞ [9] or an arbitrary polytopic CIS [22], which may make the approximated controllers not stabilizing since usually X <sup>¯</sup> ⊆C∞. The set C∞\X <sup>¯</sup> contains some initial states that cannot be steered to the origin. The dynamic programming solution in (16), on the other hand, can prevent xt from falling into C∞\X <sup>¯</sup> as we can prove that J <sup>ˆ</sup> (·, θ) is possible to be a Lyapunov function for the closed-loop system. The following lemma characterizes the properties of the optimizer uˆ <sup>∗</sup> t <sup>(xt) of</sup> <sup>(16).</sup> Lemma 1 With Assumption A1 and the conditions in Proposition satisfied, the optimizer uˆ <sup>∗</sup> t <sup>(xt)</sup> <sup>of</sup> <sup>(16)</sup> <sup>is</sup> <sup>a</sup> continuous PWA function on C. Proof The proof is similar to standard arguments for proving the PWA property of explicit MPC law [16, Theorem 17.1]. In (16), J <sup>ˆ</sup> (·, θ) has the PWQ form shown in . For a certain R <sup>ˆ</sup> j, considering the following parametric quadratic program: where {T <sup>j,k</sup> } <sup>N</sup> k=1 <sup>j</sup> <sup>is</sup> <sup>a</sup> <sup>polyhedral</sup> <sup>partition</sup> <sup>of</sup> <sup>the</sup> <sup>poly-</sup> hedral set D <sup>j</sup> of feasible states for the above parametric quadratic program. The union of all D <sup>j</sup> is thereby the feasible set D for problem in (16). Also, Vj (·) is a PWQ function with the partition T <sup>j,k</sup>, k = 1, . . ., N <sup>ˆ</sup> r,j. Then, we extend the domain D <sup>j</sup> of each Vj(·) to D by assigning an infinite value for those xt ∈D\D <sup>j</sup> . As a result, the optimizer of problem (16) is determined by comparing the value of Vj (xt) and selecting the PWA feedback law u <sup>j</sup> t <sup>(xt)</sup> <sup>corresponding</sup> <sup>to</sup> <sup>the</sup> <sup>smallest</sup> Vj(xt): ut <sup>x</sup> t <sup>T</sup> <sup>T</sup> t <sup>Rut +</sup> <sup>Jˆj(Axt + But)</sup> Vj(xt) = minut t <sup>T</sup> <sup>Qxt + uT</sup> t s.t. ut ∈U, Axt + But ∈ R <sup>ˆ</sup> j which admits a unique PWA optimizer [16, Theorem 6.7] u <sup>j</sup> t <sup>(xt) =</sup> <sup>F˜ j,kx(0)+˜gj,k,</sup> ∀x(t) ∈T <sup>j,k</sup>, k = 1, . . ., N <sup>ˆ</sup> r,j <sup>T</sup> t <sup>Rut +</sup> <sup>Jˆ (Axt + But, θ)</sup> min ut Qˆ(xt, ut) ≜ x <sup>T</sup> t <sup>T</sup> t <sup>Qxt + uT</sup> t s.t. ut ∈U, Axt + But ∈C (16) where Q <sup>ˆ</sup> (xt, ut) can be viewed as the approximated optimal Q-function [17] for problem (1). Denote the solution to (16) by uˆ <sup>∗</sup> t <sup>.</sup> <sup>Here,</sup> <sup>we</sup> <sup>use</sup> <sup>another</sup> <sup>subscript</sup> <sup>(·)t</sup> <sup>∗</sup> t <sup>(xt)=</sup> <sup>uj</sup> t Nˆr l=1 u <sup>∗</sup> t <sup>j</sup> t <sup>(xt), if</sup> <sup>Vj</sup> <sup>(xt) is the smallest among {Vl(xt)}</sup> After this procedure, u <sup>∗</sup> t <sup>(·)</sup> <sup>consists</sup> <sup>of</sup> <sup>affine</sup> <sup>functions.</sup> Each of affine function is defined on a region, which can 8 have affine and quadratic boundaries. Quadratic boundaries may arise from the comparison of all Vj(xt), j = 1, 2, ..., N <sup>ˆ</sup> r. However, it can be easily shown that problem (16) is strictly convex, because J <sup>ˆ</sup> (·, θ) is convex and R - 0. Therefore, the optimizer u <sup>∗</sup> t <sup>(·)</sup> <sup>is</sup> <sup>unique</sup> <sup>ac-</sup> cording to [41, Proposition 1. 1. 2]. This implies that u <sup>j</sup> t <sup>(xt)</sup> <sup>=</sup> <sup>ui</sup> t <sup>(xt)</sup> <sup>for</sup> <sup>those</sup> <sup>xt</sup> <sup>belonging</sup> <sup>to</sup> <sup>the</sup> <sup>quadratic</sup> boundary Vj (xt) = Vi(xt). This can happen only if the quadratic boundary degenerates to a single feasible point or to affine boundaries. Therefore, u <sup>∗</sup> t <sup>(·) is a PWA func-</sup> tion. Finally, note that the feasible set for ut at any xt ∈C is a continuous point-to-set map on C. The continuity of u <sup>∗</sup> t <sup>(·) follows from the uniqueness of u∗</sup> t <sup>(·), the continuity</sup> of Q <sup>ˆ</sup> (·, ·), and [42, Corollary 8.1]. ✷ Algorithm 1 PCP algorithm for solving the piecewise quadratic program (16) [43] Input: State xt at time step t, input ut−1 at the last time step t − 1 (if t > 0), the optimal Q-function Q <sup>ˆ</sup> (·, ·), C Output: Control input ut that will be applied to the system Initialize a starting point u <sup>(1)</sup> ← ut−1 Initialize a set U1 ←{u|u ∈U, Axt + Bu ∈C for s = 1, 2, . . . do Update the set of activated units A¯(u <sup>(s)</sup> ) at u <sup>(s)</sup> by (17), and compute the coefficients P¯(A¯(u <sup>(s)</sup> )) and q¯ <sup>T</sup> (A <sup>¯</sup> (u <sup>(s)</sup> )) associated with A <sup>¯</sup> (u <sup>(s)</sup> ) through (19) Find u <sup>(s+1)</sup> ← arg min u <sup>T</sup> P <sup>¯</sup> (A <sup>¯</sup> (u <sup>(s)</sup> ))u + ¯q <sup>T</sup> (A <sup>¯</sup> (u <sup>(s)</sup> ))u u∈Us Find d <sup>(s+1)</sup> ← arg min u u <sup>T</sup> P <sup>¯</sup> (A <sup>¯</sup> (u <sup>(s)</sup> ))u+¯q <sup>T</sup> (A <sup>¯</sup> (u <sup>(s)</sup> ))u The objective function in (16) is nonlinear and contains a neural network. Standard solvers such as the ellipsoid algorithm or the interior-point algorithm require the computation of the Hessian ∇ <sup>2</sup> u <sup>Qˆ(x, u) or the gradi-</sup> ent ∇uQ <sup>ˆ</sup> (x, u) in each iteration. Such computation can only be carried out by visiting all units in the hidden layers and extracting the activated ones. The advantage of low computational complexity brought by dynamic programming will then inevitably diminish. In view of this, we intend to avoid frequently calculating ∇ <sup>2</sup> u <sup>Qˆ(x, u)</sup> <sup>and</sup> <sup>∇u ˆQ(x, u)</sup> <sup>by</sup> <sup>decomposing</sup> <sup>the</sup> <sup>Q-</sup> function Q <sup>ˆ</sup> (xt, ut) into some quadratic functions. In particular, we develop two optimization algorithms in which problem (16) is reduced to a QP problem in each iteration. For a given xt, t ∈ N, consider the set of activated ReLU units in J <sup>ˆ</sup> (Ax + Bu, θ): A¯(u) = {i ∈{1, . . ., M } | Wi,·(Axt + Bu) + bi - 0} (17) where M is the width of the hidden layer. With (17), Qˆ(xt, u) can thus be computed as Qˆ(xt, u) = u <sup>T</sup> P¯(A¯(u))u + ¯q <sup>T</sup> (A <sup>¯</sup> (u))u + ¯v(A <sup>¯</sup> (u)) (18) where P¯(A¯(u)) = R + B <sup>T</sup> (P <sup>∗</sup> + i∈�A <sup>¯</sup> (u) �A <sup>¯</sup> ( riWi, <sup>T</sup> - <sup>Wi,·)B</sup> riWi, <sup>T</sup> q¯ <sup>T</sup> (A <sup>¯</sup> (u)) = 2x <sup>T</sup> t <sup>AT P ∗B + 2(</sup> i∈�A <sup>¯</sup> (u) ri (Wi,·Axt + bi) Wi,·)B s.t. Wi,·(Axt + Bu) + bi ≥ 0 ∀i ∈ A <sup>¯</sup> (u <sup>(s)</sup> ) Wj,·(Axt + Bu) + bj ≤ 0 ∀j ∈/ A <sup>¯</sup> (u <sup>(s)</sup> ) u ∈U, Axt + Bu ∈C if |d <sup>(s+1)</sup> - u <sup>(s+1)</sup> | ≤ ε then Let sm ← s + 1, return ut ← d <sup>(sm)</sup>, and break else Let Us+1 ← Us ∩{u|(u <sup>(s+1)T</sup> P <sup>¯</sup> (A <sup>¯</sup> (u <sup>(s)</sup> )) + q¯ <sup>T</sup> (A <sup>¯</sup> (u <sup>(s)</sup> )))(u − d <sup>(s+1)</sup> ) ≤ 0} end if end for Algorithm 1 is a modified version of the PCP algorithm in [43]. In each iteration, Algorithm 1 solves two auxiliary QPs and terminates if the minimizers d <sup>(s+1)</sup> and u <sup>(s+1)</sup> are identical. The parameter ε > 0 is a tolerance. If |d <sup>(s+1)</sup> - u <sup>(s+1)</sup> | ≤ ε is recorded, we assume that the two problems in Algorithm 1 admit the same optimal point. It is preferable that d <sup>(sm)</sup> or u <sup>(sm)</sup> could be the exact solution to problem (16) and that Algorithm 1 could stop in finite time. [43] provides these guarantees, which are summarized in the following theorem. Theorem 5 ( [43]) Consider the dynamic programming problem (16). For any xt that makes problem (16) feasible, the PCP algorithm (Algorithm 1) terminates in a finite number of iterations, i.e., there exists a finite sm such that |d <sup>(sm)</sup> - u <sup>(sm)</sup> | ≤ ε holds. Moreover, if |d <sup>(sm)</sup> - u <sup>(sm)</sup> | ≤ ε holds, then d <sup>(sm)</sup> is the solution to problem (16). As shown in [43], using Algorithm 1 to solve piecewise quadratic programs can be effective since it only needs to compute ∇ <sup>2</sup> u <sup>Qˆ(x, u) or ∇uQˆ(x, u) when s is updated.</sup> On the other hand, Algorithm 1 is not the ideal choice for solving our DP problem, because problem (9) contains numerous constraints if the neural network has a large number of hidden units. This motivates us to consider the following design. In each iteration s, s ∈ N <sup>+</sup>, let u <sup>(s)</sup> be an initial input (for s = 1) or the input calculated from the last iteration (for s - 1). We compute the set of activated units A <sup>¯</sup> (u <sup>(s)</sup> ) at u <sup>(s)</sup>, and thereby get v¯(A <sup>¯</sup> (u)) = x <sup>T</sup> t <sup>(Q + AT P ∗A)xt</sup> <sup>+</sup> <sup>T</sup> t <sup>(Q + AT P ∗A)xt</sup> <sup>+</sup> �A <sup>¯</sup> (u i∈�A <sup>¯</sup> (u) ri (Wi,·Axt + bi) <sup>2</sup> (19) Since P <sup>¯</sup> (A <sup>¯</sup> (u)) > 0, the right-hand side of (18) is a convex quadratic function if A <sup>¯</sup> (u) is fixed. An algorithm that can cope with general piecewise convex programs (PCP) is proposed in [43]. We adapt it to solving problem (16) and summarize it in Algorithm 1. 9 P¯(A¯(u <sup>(s)</sup> )) and q¯ <sup>T</sup> (A <sup>¯</sup> (u <sup>(s)</sup> )) from (19). Then, we solve the following QP: u <sup>(s+1)</sup> = arg min u <sup>T</sup> P <sup>¯</sup> (A <sup>¯</sup> (u <sup>(s)</sup> ))u + ¯q <sup>T</sup> (A <sup>¯</sup> (u <sup>(s)</sup> ))u u s.t. u ∈U, Axt + Bu ∈C (20) A¯(u <sup>(k)</sup> ), k = 1, . . ., s − 1. For all that, we can still rely on Algorithm 2 because we have found that cycles rarely occur in our numerical experiments for several examples. Besides, we can also switch to algorithm 1 by taking Usc ←{u|u ∈U, Axt + Bu ∈C if a cycle is detected at s = sc. which returns u <sup>(s+1)</sup> for the next iteration. In the next iteration, after computing A <sup>¯</sup> (u <sup>(s+1)</sup> ), we can terminate and output u <sup>(s+1)</sup> if A <sup>¯</sup> (u <sup>(s+1)</sup> )=A <sup>¯</sup> (u <sup>(s)</sup> ). If a cycle occurs, i.e., A <sup>¯</sup> (u <sup>(s+1)</sup> )=A <sup>¯</sup> (u <sup>(k)</sup> ), ∃k ∈{1, . . ., s − 1}, we arbitrarily choose another A <sup>¯</sup> (u <sup>(s+1)</sup> ) that has not been involved in previous iterations. The proposed method for getting the solution to (16) is summarized in Algorithm 2. Algorithm 2 Decomposition algorithm for solving the piecewise quadratic program (16) Input: State xt at time step t, input ut−1 at the last time step t - 1 (if t - 0), the optimal Q-function Qˆ (·, ·), C Output: Control input ut that will be applied to the system Proof We will first show that if Algorithm 2 stops, it outputs a solution to problem (16). According to Algorithm 2, u <sup>(sm)</sup> minimizes Q <sup>¯</sup> u(sm) (xt, u) ≜ u <sup>T</sup> P <sup>¯</sup> (A <sup>¯</sup> (u <sup>(sm)</sup> ))u + ¯q <sup>T</sup> (A <sup>¯</sup> (u <sup>(sm)</sup> ))u + ¯v(A <sup>¯</sup> (u <sup>(sm)</sup> )) subject to u ∈U, Axt + Bu ∈C∞ if A <sup>¯</sup> (u <sup>(sm)</sup> ) = A <sup>¯</sup> (u <sup>(sm−1)</sup> ). In this case, the inequality ∇ <sup>T</sup> u <sup>Q¯</sup> u <sup>(sm)</sup> <sup>(xt, u(sm))(u −</sup> <sup>u(sm)) ≥</sup> <sup>0</sup> (21) Theorem 6 Consider the DP problem (16). For any xt that makes problem (16) feasible, the decomposition algorithm (Algorithm 2) terminates in a finite number of iterations, i.e, there exists a finite sm such that A¯ = A¯ holds. Moreover, if A¯ = A <sup>¯</sup>, then u <sup>(sm)</sup> is the solution to �u <sup>(sm)�</sup> �u <sup>(sm−1)�</sup> = A <sup>¯</sup> �u <sup>(sm)�</sup> <sup>�</sup> problem �u <sup>(sm)�</sup> = A¯ A¯ = A <sup>¯</sup>, then u <sup>(sm)</sup> is the solution to �u <sup>(sm)�</sup> �u <sup>(sm−1)�</sup> problem (16). �u <sup>(sm)�</sup> �u <sup>(sm−1)�</sup> = A <sup>¯</sup> �u <sup>(sm−1)�</sup> , then u �u <sup>(sm−1)�</sup> <sup>�</sup> Initialize a starting point u <sup>(1)</sup> ← ut−1 for s = 1, 2, . . . do Update the set of activated units A <sup>¯</sup> (u <sup>(s)</sup> ) by (17) if A <sup>¯</sup> (u <sup>(s)</sup> ) = A <sup>¯</sup> (u <sup>(s−1)</sup> ) and s > 1 then Let sm ← s, return ut ← u <sup>(sm)</sup>, break else Qˆ (xt, ·) can be applied at u <sup>(s</sup> m <sup>)</sup> : for the �xt, u <sup>(sm)�</sup> u <sup>(s</sup> m <sup>)</sup> : holds for all u ∈U1 ≜ {u|u ∈U, Axt + Bu ∈C. Using the fact that ∇ <sup>T</sup> u <sup>Q¯</sup> u <sup>(sm)</sup> = ∇ <sup>T</sup> u <sup>Qˆ</sup>, the gradient inequality for the convex PWQ function �xt, u <sup>(sm)�</sup> �xt, u <sup>(sm)�</sup> <sup>T</sup> u <sup>Q¯</sup> u <sup>(sm)</sup> <sup>T</sup> u <sup>Qˆ</sup> , function �xt, u <sup>(sm)�</sup> = ∇ <sup>T</sup> u if A <sup>¯</sup> (u <sup>(s)</sup> ) = A <sup>¯</sup> (u <sup>(k)</sup> ), ∃k ∈{1, . . ., s − 2} and s > 2 then Reset A <sup>¯</sup> (u <sup>(s)</sup> ) to be a new set of activated units that never occurred previously. Qˆ(xt, u) ≥ Qˆ(xt, u <sup>(sm)</sup> )+∇ <sup>T</sup> u <sup>Qˆ</sup> u <sup>(sm)</sup> <sup>(xt, u(sm))(u−u(sm))</sup> end if Compute the coefficients P¯(A¯(u <sup>(s)</sup> )) and q¯ <sup>T</sup> (A <sup>¯</sup> (u <sup>(s)</sup> )) associated with A <sup>¯</sup> (u <sup>(s)</sup> ) through (19) Update the policy through (20) and get u <sup>(s+1)</sup> end if end for In Algorithm 2, the starting point u <sup>(1)</sup> = ut−1 is initialized with the last control input, which can be viewed as a warm start for the algorithm. To understand the rationale of this design, suppose that xt is close to the origin after enough time steps. Then, ut will vary slightly around the origin. Choosing u <sup>(1)</sup> = ut−1 is beneficial to reducing the number of iterations. Compared to Algorithm 1, Algorithm 2 only needs to solve one QP, in which the constraints are the same as those in (16). Additionally, Algorithm 2 circumvents the calculation of Us+1. Meanwhile, Algorithm 2 can also achieve finite termination as well as the optimality for problem (16). However, the number of iterations in Algorithm 2 may be more than that in Algorithm 1, and we need to store all the previous set of activated units Furthermore, if a cycle occurs, i.e., A <sup>¯</sup> (u <sup>(s)</sup> ) = A <sup>¯</sup> (u <sup>(k)</sup> ), ∃k ∈ {1, 2, . . ., s − 2} happens for some s, according to Algorthm 2, we select another set of activated units that has never been considered in problem (20). As the number of combinations of activated units is finite, which means the number of different A <sup>¯</sup> (·) is limited, the algorithm must stop in a finite number of iterations. ✷ In general, the amount of data needed in our method is in general less than that in policy-based methods [22] because the value function is a scalar, but the policy may be multi-dimensional. Besides, for the extension to constrained nonlinear systems, there are some situations when the value function can be guaranteed to be continuous [44, Theorem 3], while ensuring the continuity of the optimal policy is almost impossible. Basically, learning a continuous function requires simpler approximation structures than learning a discontinuous function. which, combined with inequality (21), shows that Qˆ (xt, u) ≥ Qˆ <sup>)</sup> is proven. �xt, u <sup>(sm)�</sup> Qˆ (xt, u) ≥ Qˆ for all u ∈U1. Thus, the opti mality of u <sup>(sm)</sup> is proven. �xt, u <sup>(sm)�</sup> 10 3.4 Analysis of the proposed method 3.5 Stability analysis The recursive feasibility of the DP problem (16) is inherently guaranteed. In this section, we investigate the stability of the proposed control law. If problem (4) is non-degenerate, all Ri, i = 1, . . ., Nr are full-dimensional [16]. In contrast, in the degenerate case, some Ri are lower-dimensional, and in general, they correspond to common boundaries between full-dimensional regions. Since both J∞ <sup>∗</sup> <sup>(·)</sup> <sup>and</sup> <sup>Jˆ (·, θ)</sup> are PWQ on polyhedra, the intersection of any Ri and Rˆ j, i = 1, . . ., Nr, j = 1, . . ., Nˆr is still polyhedral. Let Ri,j denote this intersection if such intersection represents a full-dimensional region, i.e., Ri,j ≜ Ri ∩ R <sup>ˆ</sup> j, i ∈ {1, ..., Nr}, j ∈{1, ..., N <sup>ˆ</sup> r} and dim(Ri ∩ R <sup>ˆ</sup> j ) = n. It is clear that all Ri,j are a partition of X0. To achieve this, we need the following assumption. Assumption A2: For the partition Ri,j of X0, suppose that there exists at least one training point in each int(Ri,j ). Meanwhile, define a measure of the gradient error as J (x,θ)−∇J∞ <sup>∗</sup> <sup>(x)∥</sup> 2 egrad (x) ≜ <sup>∥∇</sup> <sup>ˆ</sup> J∞ <sup>∗</sup> <sup>(x)</sup>, and let ¯e and ¯egrad stand for the maximum values of |e(·)| and egrad(·) over all training data, which are computable. It is straightforward to see that |e(x <sup>(</sup> k <sup>i∗)</sup> <sup>(</sup> k <sup>i∗)</sup> )|≤ e,¯ egrad(x <sup>(</sup> k <sup>i∗)</sup> <sup>(</sup> k <sup>i∗)</sup> ) ≤ e¯grad, i =1, . . ., Nx, k =0, . . ., N −1 (24) where x <sup>(</sup> k <sup>i∗)</sup> is any sampled state specified in (10). <sup>(</sup> k <sup>i∗)</sup> is any sampled state specified in (10). Upper bound of the approximation error. To certificate the stability, we need to know the upper bound of the approximation error for all x belonging to X0. Computing the maximum of |J <sup>ˆ</sup> (·, θ) − J∞ <sup>∗</sup> <sup>(·)|/J</sup> ∞ <sup>∗</sup> <sup>(·) over</sup> each Ri,j is cumbersome since (i) it needs the analytical form of J∞ <sup>∗</sup> <sup>(·) and (ii) it needs to solve at most NrNˆr</sup> ∞ <sup>∗</sup> <sup>(·)|/J</sup> ∞ <sup>∗</sup> cal form of J∞ <sup>∗</sup> <sup>(·) and (ii) it needs to solve at most NrNˆr</sup> non-convex optimization problems, which is computationally demanding. For this reason, we develop a procedure to get an upper bound of |J <sup>ˆ</sup> (·, θ) − J∞ <sup>∗</sup> <sup>(·)|/J</sup> ∞ <sup>∗</sup> <sup>(·)</sup> <sup>by</sup> <sup>leveraging</sup> <sup>the</sup> Lipschitz continuity of ∇J <sup>ˆ</sup> (·, θ) and ∇J∞ <sup>∗</sup> <sup>(·).</sup> <sup>Since</sup> <sup>we</sup> can compute the approximation error of the proposed neural network at the training points, it is possible to obtain an upper bound of the approximation error for all x in X0. In the interior of each Ri,j, both J∞ <sup>∗</sup> <sup>(·)</sup> Remark 2 Assumption A2 is used to compute a global bound ζ to guarantee (23). Assumption A2 is not required to satisfy when training the NN. To guarantee stability, if Assumption A2 is not satisfied after the NN is trained, we can add one testing point in each region int(Ri,j ) where there is no training point. Then, we evaluate the approximation errors |e(·)| and egrad(·) at these testing points, and adjust e¯ and e¯grad if necessary so that |e (·)| ≤ e, e¯ grad (·) ≤ e¯grad also hold at these testing points. Nevertheless, we should point out that one of the limitations is that we sometimes need carefully selected testing data to satisfy Assumption A2, and the data should be enough dense if the NN or the optimal value function has many polyhedral regions. To compute ζ, one needs to compute (i) the partition for the value functions, (ii) the Lipschitz constants of the value functions, and (iii) J∞ <sup>∗</sup> <sup>at the sampled</sup> <sup>points. Relaxing Assumption A2</sup> and exploring a more convenient way to compute the error bound ζ will be our future work. ∞ <sup>∗</sup> <sup>(·)|/J</sup> ∞ <sup>∗</sup> all x in X0. In the interior of each Ri,j, both J∞ <sup>∗</sup> <sup>(·)</sup> and J <sup>ˆ</sup> (·, θ) are quadratic and hence twice continuously differentiable. According to [16, Lemma 3.2], the gradients ∇xJ∞ <sup>∗</sup> <sup>(·)</sup> <sup>and</sup> <sup>∇xJˆ (·, θ)</sup> <sup>are</sup> <sup>locally</sup> <sup>Lipschitz</sup> <sup>on</sup> dients ∇xJ∞ <sup>∗</sup> <sup>(·)</sup> <sup>and</sup> <sup>∇xJˆ (·, θ)</sup> <sup>are</sup> <sup>locally</sup> <sup>Lipschitz</sup> <sup>on</sup> int(Ri,j ), i.e., there exist non-negative constants Li and Lˆj such that for all pairs (x, y) ∈ int(Ri,j ) × int(Ri,j ), we have Let R1 refer to the polyhedron where no constraints in (4) are active, i.e., R1 = O∞ <sup>LQR</sup>, and accordingly let Rˆ 1 represents the polyhedron where no ReLU units in Jˆ (·, θ) are activated. In the region R1,1 = R1 ∩ Rˆ 1, we have |e(x)| ≡ 0 due to (9). For every Ri,j except R1,1, consider the following three cases: Case 1: e (x) ≥ 0, ∀x ∈ int(Ri,j ). In this case, for any x ∈ int(Ri,j ), let y ∈ int(Ri,j ) denote the training or testing point closest to x. Substituting x and y into (22) results in <sup>i</sup> 2 2 <sup>∥y −</sup> <sup>x∥2</sup> J∞ <sup>∗</sup> ∞ <sup>∗</sup> <sup>(y) ≤</sup> <sup>J</sup> ∞ <sup>∗</sup> ∞ <sup>∗</sup> <sup>(x) + ∇T J</sup> ∞ <sup>∗</sup> ∞ <sup>∗</sup> <sup>(x) (y −</sup> <sup>x) +</sup> <sup>Li</sup> 2 Jˆ (y, θ) ≤ Jˆ (x, θ) + ∇ <sup>T</sup> Jˆ (x, θ) (y − x) + Lˆj |e (x)| = Jˆ (y, θ) ≤ Jˆ (x, θ) + ∇ <sup>T</sup> Jˆ (x, θ) (y − x) + 2 2 <sup>∥y −</sup> <sup>x∥2</sup> (22) The Lipschitz constants Li and L <sup>ˆ</sup> j can be chosen as the largest eigenvalue of Pi and P <sup>ˆ</sup> j [16, Lemma 3.2], respectively. In the following, we will show that there exists a positive constant ζ such that Jˆ (x, θ) J∞ <sup>∗</sup> (x) <sup>−</sup> <sup>1</sup> Jˆ (y, θ) + ∇ <sup>T</sup> Jˆ (y, θ) (x − y) + Lˆj ∥x − y∥ <sup>2</sup> 2 <sup>/2</sup> - 1 J∞ <sup>∗</sup> (y) + ∇ <sup>T</sup> J∞ <sup>∗</sup> (y) (x − y) Jˆ (y, θ) + ∇ <sup>T</sup> Jˆ (y, θ) (x − y) + Lˆj ∥x − y∥ <sup>2</sup> 2 ≤ Jˆ(y, θ)−J∞ <sup>∗</sup> <sup>)+(∇Jˆ (y, θ)−∇J</sup> ∞ <sup>∗</sup> <sup>(y))</sup> T (x−y)+ ˆLj∥x−y∥22 <sup>/2</sup> J∞ <sup>∗</sup> (y)−∥∇ <sup>T</sup> J∞ <sup>∗</sup> (y)∥2 ∥x − y∥2 ∞ <sup>∗</sup> <sup>(y))</sup> T (x−y)+ ˆLj∥x−y∥22 ≤ ∞ <sup>∗</sup> <sup>(y)+(∇Jˆ (y, θ)−∇J</sup> ∞ <sup>∗</sup> Jˆ (x, θ) J∞ <sup>∗</sup> (x) <sup>−</sup> <sup>1</sup> ∀x ∈ X0 (23) ����� ≤ ζ, ≤ <sup>|e (y)| + egrad (y) ∥x −</sup> <sup>y∥2 +</sup> <sup>Lˆj ∥x −</sup> <sup>y∥</sup> 2 <sup>2</sup> <sup>/ (2J</sup> ∞ <sup>∗</sup> <sup>(y))</sup> 1 − β(y) ∥x − y∥2 (25) |e(x)| ≜ ����� 11 where β(y) = ∞ <sup>(y)</sup> 2 <sup>/J</sup> ∞ <sup>∗</sup> <sup>(y). The first inequality</sup> of (25) is true due to the second inequality of (22) and the convexity ��of∇TJ J∞ <sup>∗</sup> ∗ <sup>(·).</sup> <sup>Let</sup> �� <sup>di,j</sup> <sup>denote</sup> <sup>the</sup> <sup>maximum</sup> where β(y) = ∞ <sup>(y)</sup> due to the ��of∇TJ J∞ <sup>∗</sup> ∗ <sup>(·).</sup> the convexity of J∞ <sup>∗</sup> <sup>(·).</sup> <sup>Let</sup> <sup>di,j</sup> <sup>denote</sup> <sup>the</sup> <sup>maximum</sup> Euclidean distance between x and its nearest training or testing point subject to x ∈ int(Ri,j ). Using the fact that (24) holds at y, we obtain from (25) that since the analytical form of J <sup>ˆ</sup> (·, θ) is known. The values of ∇J∞ <sup>∗</sup> <sup>(y)</sup> <sup>and</sup> <sup>Li</sup> <sup>can</sup> <sup>be</sup> <sup>collected</sup> <sup>in</sup> <sup>the</sup> <sup>training</sup> process. Specifically, note that all y are contained in the interior of full-dimensional Ri, in which the rows of GAi are linearly independent. In this case, the Lagrange multipliers λ <sup>∗</sup> (·) of problem (4) are affine functions of x [19] on and thus continuously differentiable. Then, similar to the analysis in [16, Theorem 6.9], the gradient ∇J∞ <sup>∗</sup> <sup>(y)</sup> can be computed by 1 |e (x)| ≤ 1 − β(y)di,j e¯ + ¯egraddi,j + Lˆjdi,j 2J∞ <sup>∗</sup> (y) 2 ∇J∞ <sup>∗</sup> <sup>(y) = −ST λ∗(y) + Y y + FU ∗(y)</sup> (26) holds for any x ∈ int(Ri,j ). Herein, it should be mentioned that β(y) is bounded on all Ri,j except R1,1, since J∞ <sup>∗</sup> <sup>(·)</sup> <sup>can</sup> <sup>only</sup> <sup>equal</sup> <sup>zero</sup> <sup>at</sup> <sup>origin,</sup> <sup>which</sup> <sup>is</sup> <sup>contained</sup> in R1,1. Therefore, one can always make di,j sufficiently small so that 1 − β(y)di,j - 0. Case 2: e (x) ≤ 0, ∀x ∈ int(Ri,j ). Similarly to Case 1, we can readily get To obtain Li, let us restrict our attention to the set of active constraints at y. The set Ai defined in Theorem 4 can be determined by checking whether the elements of λ <sup>∗</sup> (y) is zero or not. Then, as illustrated in the proof of [35, Lemma 1 (Theorem 4 in this paper)], substituting Ai into Pi = P <sup>∗</sup> + <sup>1</sup> 2 <sup>1</sup> 2 <sup>S</sup> A <sup>T</sup> i,· <sup>Γ−1SA</sup> i <sup>,·</sup> J∞ <sup>∗</sup> (y) + ∇ <sup>T</sup> J∞ <sup>∗</sup> (y) (x − y) + Jˆ (y, θ) + ∇ <sup>T</sup> Jˆ (y, θ) (x − y) |e (x)| =1− Jˆ (x, θ) J∞ <sup>∗</sup> (x) <sup>≤</sup> <sup>1−</sup> Lid <sup>2</sup> i,j where Γ = GAi,·H <sup>−1</sup> G <sup>T</sup> Ai,· <sup>≻</sup> <sup>0,</sup> <sup>we</sup> <sup>can</sup> <sup>obtain</sup> <sup>Pi</sup> <sup>and</sup> hence select Li as the largest eigenvalue of Pi. With the property of boundedness for e(x) established, we can assess the stability for the closed-loop system with the approximate controller uˆ <sup>∗</sup> . Corresponding to the selection of C in problem (16), we consider two cases: (1) C = X <sup>¯</sup> and (2) C = R <sup>n</sup> . i,j 2 ∞ <sup>∗</sup> <sup>(y)−Jˆ (y, θ)+(∇J</sup> ∞ <sup>∗</sup> T (x−y)+Lid2i,j ≤ <sup>J</sup> ∞ <sup>∗</sup> <sup>y, θ)+(∇J</sup> ∞ <sup>∗</sup> <sup>(y)−∇Jˆ (y, θ))</sup> T (x−y)+Lid2i,j <sup>/2</sup> J∞ <sup>∗</sup> (y) −∥∇ <sup>T</sup> J∞ <sup>∗</sup> (y)∥2 ∥x − y∥2 ∞ <sup>∗</sup> <sup>(y)−∇Jˆ (y, θ))</sup> (27) 2 Theorem 7 Let uˆ <sup>∗</sup> t <sup>be the solution to problem</sup> <sup>(16) with</sup> C = X <sup>¯</sup> . Then, ˆu <sup>∗</sup> t <sup>is recursively feasible for the initial con-</sup> dition x0 ∈ X <sup>¯</sup> . Furthermore, suppose that Assumptions A1-A2 hold with X0 = X <sup>¯</sup> . If ζ (23) satisfies 1 ≤ 1 − β(y)di,j e¯ + ¯egraddi,j + <sup>Lidi,j</sup> - 2J∞ <sup>∗</sup> ( 2J∞ <sup>∗</sup> (y) where the first inequality of (27) comes from the first inequality of (22) and the convexity of J <sup>ˆ</sup> (·, θ). The last line of (27) is almost the same as the right-hand side of (26), and the only difference is that L <sup>ˆ</sup> j is replaced by Li. Case 3: ∃x1, x2 ∈ int(Ri,j ) such that e(x1) - 0 and e(x2) < 0. In this case, for all x ∈ int(Ri,j ) subject to Jˆ (x, θ) ≥ J∞ <sup>∗</sup> <sup>(x), we can get the</sup> <sup>same upper bound</sup> <sup>for</sup> |e(x)| as in (26), and for all x ∈ int(Ri,j) subject to Jˆ (x, θ) < J∞ <sup>∗</sup> <sup>(x),</sup> <sup>inequalities (27) holds.</sup> Consequently, combining the above 3 cases, it is sufficient to conclude that for any x ∈ int(Ri,j ), |e (x)| is upper bounded by Let us first consider the solution to the MPC problem (3). For every xt, t = 0, 1, . . ., MPC finds the solution Ut <sup>∗</sup> <sup>to problem (3) and only collects the first m elements,</sup> i.e., u <sup>∗</sup> t <sup>=</sup> <sup>[Im</sup> 0m - · · 0m]U <sup>∗</sup> (xt) will be applied 1 − ζ <sup>2</sup> - 2 sup ζ x∈X0\{0} Jˆ (x, θ) x <sup>T</sup> Qx <sup>,</sup> (29) then the origin of the closed-loop system xt+1 = Axt + Buˆ <sup>∗</sup> t <sup>, t = 0, 1, . . .</sup> <sup>is asymptotically stable with domain of</sup> attraction X <sup>¯</sup> . Proof In Theorem 7, C = X <sup>¯</sup> . Since X <sup>¯</sup> is control invariant, recursive feasibility regarding both state and input constraints is guaranteed for all initial states in X <sup>¯</sup> . ]U <sup>∗</sup> (xt) will be applied 1 ζi,j = 1 − β(y)di,j e¯ + ¯egraddi,j + (L <sup>ˆ</sup> j + Li)di,j <sup>2</sup> 2J∞ <sup>∗</sup> (y) (28) Finally, since e(x) is continuous on the closure of Ri,j, the bound ζi,j applies to all x in Ri,j . In addition, thanks to Assumption A2, the value of ζ in (23) can be determined by computing the right-hand side of (28) at all training/testing points and choosing the largest one. Computation of ∇J <sup>ˆ</sup> (y, θ), ∇J∞ <sup>∗</sup> <sup>(y),</sup> <sup>Li,</sup> <sup>and</sup> <sup>Lˆj.</sup> The computation of ∇J <sup>ˆ</sup> (y, θ) and L <sup>ˆ</sup> j is straightforward problem (1). As a result, Axt +Bu <sup>∗</sup> t <sup>∈</sup> <sup>X¯</sup> <sup>for any xt</sup> <sup>∈</sup> <sup>X¯</sup> <sup>.</sup> (Otherwise, J∞ <sup>∗</sup> <sup>(Axt+Bu∗</sup> t <sup>) = ∞</sup> <sup>and then J</sup> ∞ <sup>∗</sup> <sup>(xt) = ∞,</sup> which contradicts the claim that xt ∈ X <sup>¯</sup> ). Then, we will show that J <sup>ˆ</sup> (·, θ) is a Lyapunov function for the system. Suppose that xt ∈ X <sup>¯</sup> \{0}. Applying the <sup>∗</sup> t <sup>=</sup> <sup>[Im</sup> 0m - · · 0m N −1 terms system. From the - �� problem (3), {u <sup>∗</sup> t <sup>}∞</sup> t=0 to the system. From the equivalence between problem - �� (1) and problem (3), {u <sup>∗</sup> t <sup>}∞</sup> t=0 <sup>is</sup> <sup>also</sup> <sup>a</sup> <sup>solution</sup> <sup>to</sup> <sup>the</sup> problem (1). As a result, Axt +Bu <sup>∗</sup> t <sup>∈</sup> <sup>X¯</sup> <sup>for any xt</sup> <sup>∈</sup> <sup>X¯</sup> <sup>.</sup> <sup>∗</sup> t <sup>}∞</sup> t ∞ <sup>∗</sup> <sup>(Axt+Bu∗</sup> t <sup>∗</sup> t <sup>) = ∞</sup> <sup>and then J</sup> ∞ <sup>∗</sup> 12 optimal Bellman Equation [17] for problem (1) leads to Axt + Buˆ <sup>∗</sup> t <sup>, t = 0, 1, . . .</sup> <sup>is</sup> <sup>asymptotically</sup> <sup>stable with do-</sup> main of attraction Ω. J∞ <sup>∗</sup> ∞ <sup>∗</sup> <sup>(Axt + Bu∗</sup> t <sup>∗</sup> t <sup>) = J</sup> ∞ <sup>∗</sup> <sup>J</sup> ∞ <sup>∗</sup> <sup>(xt) −</sup> <sup>xT</sup> t <sup>Qxt −</sup> <sup>u∗</sup> t <sup>T</sup> <sup>Ru</sup> t <sup>∗</sup> < J∞ <sup>∗</sup> <sup>(xt) −</sup> <sup>xT</sup> t <sup>Qxt</sup> ∞ <sup>∗</sup> <sup>(xt) −</sup> <sup>xT</sup> t ∞ <sup>∗</sup> <sup>(xt) −</sup> <sup>xT</sup> t <sup>T</sup> t <sup>Qxt −</sup> <sup>u∗</sup> t <sup>T</sup> <sup>∗</sup> t <sup>T</sup> <sup>Ru</sup> t <sup>∗</sup> <sup>T</sup> t <sup>Qxt</sup> (30) For the proof of Corollary 1, from the definition of Ω and the continuity of J <sup>ˆ</sup> (·, θ), we know that Ω ⊆ X0. Following the proof of Theorem 7, we can show that for all xt ∈ Ω, J <sup>ˆ</sup> (Axt + Buˆ <sup>∗</sup> t <sup>, θ) −</sup> <sup>Jˆ (xt, θ)</sup> <sup><</sup> <sup>0</sup> <sup>holds.</sup> <sup>As</sup> <sup>a</sup> Combining (30) with (23), we have x <sup>T</sup> t <sup>T</sup> t <sup>Qxt + ˆu∗</sup> t <sup>T</sup> <sup>T</sup> t <sup>Qxt + u∗</sup> t <sup>T</sup> <sup>∗</sup> t <sup>T</sup> <sup>Ruˆ∗</sup> t <sup>∗</sup> t <sup>T</sup> <sup>Ru∗</sup> t <sup>∗</sup> t <sup>+</sup> <sup>Jˆ (Axt + Buˆ∗</sup> t <sup>∗</sup> t <sup>+</sup> <sup>Jˆ (Axt + Bu∗</sup> t <sup>∗</sup> t <sup>, θ)</sup> <sup>∗</sup> t <sup>, θ)</sup> all xt ∈ Ω, J <sup>ˆ</sup> (Axt + Buˆ <sup>∗</sup> t <sup>, θ) −</sup> <sup>Jˆ (xt, θ)</sup> <sup><</sup> <sup>0</sup> <sup>holds.</sup> <sup>As</sup> <sup>a</sup> result, the set Ωis positively invariant w.r.t. the closedloop system xt+1 = Axt + Buˆ <sup>∗</sup> t <sup>. The recursive feasibility</sup> ≤x <sup>T</sup> t ≤x <sup>T</sup> t <J∞ <sup>∗</sup> ∞ <sup>∗</sup> <sup>(xt) −</sup> <sup>ζxT</sup> t ∞ <sup>∗</sup> <sup>(Axt</sup> <sup>+Bu</sup> t <sup>∗</sup> t <sup>∗)+ζJ</sup> ∞ <sup>∗</sup> t <sup>∗T</sup> <sup>Ru</sup> t <sup>∗</sup> ∞ <sup>∗</sup> <sup>(Axt</sup> <sup>+Bu</sup> t <sup>∗</sup> <sup>T</sup> t <sup>Qxt</sup> <sup>+u</sup> t <sup>∗T</sup> t <sup>∗+J</sup> ∞ <sup>∗</sup> t <sup>∗)</sup> loop system xt+1 = Axt + Buˆ <sup>∗</sup> t <sup>. The recursive feasibility</sup> thus follows from Ω ⊆ X0 ⊆X . Similar to the proof of Theorem 7, it can be shown that J <sup>ˆ</sup> (·, θ) is a Lyapunov function for the closed-loop system and stability of the origin follows. ✷ ∞ <sup>∗</sup> <sup>(xt) + ζJ</sup> ∞ <sup>∗</sup> <J∞ <sup>∗</sup> <sup>(xt) + ζJ</sup> ∞ <sup>∗</sup> <sup>(xt) −</sup> <sup>ζxT</sup> t <sup>Qxt</sup> <J <sup>ˆ</sup> (xt, θ) + 2ζJ∞ <sup>∗</sup> <sup>(xt) −</sup> <sup>ζxT</sup> t <sup>Qx</sup> ∞ <sup>∗</sup> <sup>(xt) −</sup> <sup>ζxT</sup> t <sup>T</sup> t <sup>Qxt</sup> (31) In (31), the first inequality is true since ˆu <sup>∗</sup> t <sup>is a minimizer</sup> of (16). The second and last inequalities hold due to (23), and the third line is true thanks to the optimal Bellman equation in (30). Then, combining (23) and (29) yields According to Theorem 7 and Corollary 1, asymptotic stability is achieved if the condition in (29) or (34) holds. (29) or (34) can be satisfied by making ζ small enough since the right-hand side of (29) or (34) is upper bounded. To prove this, we find that x <sup>T</sup> Qx tends to zero if and only if x approaches the origin. Let B ⊆O∞ <sup>LQR</sup> be a sufficiently small neighborhood of the origin. It follows that J <sup>ˆ</sup> (x, θ) = x <sup>T</sup> P <sup>∗</sup> x if x ∈B. As a result, 1 + ζ - 2 sup ζ x∈X <sup>¯</sup> \{0} Jˆ (x, θ) (1 − ζ)x <sup>T</sup> Qx <sup>> 2</sup> x∈supX <sup>¯</sup> \{0} J∞ <sup>∗</sup> <sup>(x)</sup> x <sup>T</sup> Qx λ <sup>max</sup> min <sup>(</sup> ( <sup>P</sup> Q <sup>∗</sup> ) <sup>)</sup> <sup>.</sup> <sup>Besides,</sup> <sup>in</sup> <sup>view</sup> <sup>of</sup> <sup>(28),</sup> <sup>ζ</sup> <sup>is</sup> (32) Together with (32), (31) implies Jˆ (Axt + Buˆ <sup>∗</sup> t <sup>, θ) −</sup> <sup>Jˆ (xt, θ)</sup> sup x∈B\{0} Jˆ(x,θ) Jxˆ( <sup>T</sup> x,θQx) <sup>≤</sup> <sup>λ</sup> λ <sup>max</sup> min <sup>(</sup> ( <sup>P</sup> Q <sup>∗</sup> ) <sup>)</sup> <−(1+ζ)x <sup>T</sup> t <sup>T</sup> t <sup>Qxt</sup> <sup>−uˆ∗</sup> t <sup>T</sup> <sup>∗</sup> t <sup>T</sup> <sup>Ruˆ∗</sup> t <sup>∗</sup> t <sup>+2ζJ</sup> ∞ <sup>∗</sup> ∞ <sup>∗</sup> <sup>(xt)</sup> <sup><</sup> <sup>0 ∀xt</sup> <sup>∈</sup> X <sup>¯</sup> \{0} (33) determined mainly by e¯, e¯grad, and di,j. The condition (29) or (34) can thereby be guaranteed in two ways. One is to add more hidden units into the neural network so that e¯ and e¯grad could be smaller according to the universal approximation theorem [46]. Another possibility is to involve more state-value/gradient data to test (24) so that di,j is reduced. If the data generation strategy in Section 3.2 is used, sometimes it is not straightforward to satisfy Assumption A2 since the positions of the subsequent states x <sup>(</sup> k <sup>i)∗</sup>, i = 1, . . . Nx, k = 1, . . ., N - 1 cannot be deter mined explicitly. An alternative approach is to only use initial states {x <sup>(i)</sup> } <sup>N</sup> i=1 <sup>x</sup> <sup>with</sup> <sup>a</sup> <sup>much</sup> <sup>larger Nx</sup> <sup>if</sup> <sup>we</sup> <sup>find</sup> that a number of regions of the partition Ri,j are not visited by the training points. Let x0 ∈ X <sup>¯</sup> \{0} and x1, x2, . . . be the trajectory of the closed-loop system xt+1 = Axt+Buˆ <sup>∗</sup> t <sup>, t = 0, 1, . . . . It fol-</sup> lows from (33) that the sequence J <sup>ˆ</sup> (x0, θ), J <sup>ˆ</sup> (x1, θ), . . . is strictly decreasing. Besides, it is easy to check that Jˆ (0, θ) = 0, Jˆ (x, θ) - 0, ∀x ∈ X¯ \{0}, and Jˆ (·, θ) is continuous at the origin, finite in X <sup>¯</sup> . Then, J <sup>ˆ</sup> (·, θ) is therefore a Lyapunov Function according to [16, Theorem 7.2]. So, the asymptotic stability of the origin for any x ∈ X <sup>¯</sup> follows. ✷ As a Lyapunov function is insufficient to guarantee stability for a constrained system, i.e., the system must stay in an invariant set [45]. In the case of X0 ⊂ X <sup>¯</sup>, where the set X0 may not be invariant for the closed-loop system xt+1 = Axt + Buˆ <sup>∗</sup> t <sup>, t</sup> <sup>=</sup> <sup>0, 1, . . .,</sup> <sup>the</sup> <sup>corresponding</sup> <sup>sta-</sup> bility conditions are described in the following corollary: Approximation methods of MPC with stability guarantees have been investigated in, e.g., [25, 45, 47]. The stability results in these three papers are based on a common fundamental theorem, stating that if J∞ (x0, {uˆ <sup>∗</sup> t <sup>}∞</sup> t=0 <sup>) −</sup> <sup>J</sup> ∞ <sup>∗</sup> <sup>(x0) is less than</sup> <sup>xT</sup> 0 <sup>Qx0,</sup> <sup>J</sup> ∞ <sup>∗</sup> <sup>(·) is</sup> <sup>∗</sup> t <sup>}∞</sup> t <sup>∞</sup> t=0 <sup>) −</sup> <sup>J</sup> ∞ <sup>∗</sup> ∞ <sup>∗</sup> <sup>(x0) is less than</sup> <sup>xT</sup> 0 Corollary 1 Let uˆ <sup>∗</sup> t Corollary 1 Let uˆ <sup>∗</sup> t <sup>be the solution to problem</sup> <sup>(16) with</sup> C = R <sup>n</sup> . For a given X0 ⊂ X <sup>¯</sup>, suppose that Assumptions A1-A2 hold. Define a compact set as Ω ≜ {x ∈ R <sup>n</sup> | J <sup>ˆ</sup> (x, θ) ≤ χ} where χ ≜ inf Jˆ (x, θ). If ζ in (23) x∈∂X0 J∞ (x0, {uˆ <sup>∗</sup> t <sup>}∞</sup> t=0 <sup>) −</sup> <sup>J</sup> ∞ <sup>∗</sup> <sup>(x0) is less than</sup> <sup>xT</sup> 0 <sup>Qx0,</sup> <sup>J</sup> ∞ <sup>∗</sup> <sup>(·) is</sup> still a Lyapunov function for the system controlled by {uˆ <sup>∗</sup> t <sup>}∞</sup> t=0 <sup>. Our method, on the contrary, firstly obtains an</sup> estimation J <sup>ˆ</sup> (·, θ) of J∞ <sup>∗</sup> <sup>(·).</sup> <sup>If</sup> <sup>Jˆ (·, θ)</sup> <sup>can</sup> <sup>approximate</sup> <sup>∗</sup> t <sup>}∞</sup> t Jˆ (x, θ). If ζ in (23) estimation J <sup>ˆ</sup> (·, θ) of J∞ <sup>∗</sup> <sup>(·).</sup> <sup>If</sup> <sup>Jˆ (·, θ)</sup> <sup>can</sup> <sup>approximate</sup> J∞ <sup>∗</sup> <sup>(·)</sup> <sup>well</sup> <sup>(characterized</sup> <sup>by</sup> <sup>conditions</sup> <sup>(29)</sup> <sup>and</sup> <sup>(34)),</sup> the approximated control law generated by the DP (16) will be inherently stabilizing. In addition, note that the Lyapunov functions in Theorem 7 and Corollary 1 are satisfies 1 − ζ <sup>2</sup> - 2 sup ζ x∈Ω\{0} Jˆ (x, θ) x <sup>T</sup> Qx <sup>,</sup> (34) Jˆ (·, θ), instead of J∞ <sup>∗</sup> ∞ <sup>∗</sup> <sup>(·).</sup> then uˆ <sup>∗</sup> t <sup>is</sup> <sup>recursively</sup> <sup>feasible</sup> <sup>for</sup> <sup>the</sup> <sup>initial</sup> <sup>condition</sup> x0 ∈ Ω, and the origin of the closed-loop system xt+1 = Remark 3 It is worth mentioning that our approach can be extended to the degenerate cases. Even if J∞ <sup>∗</sup> <sup>(·) is not</sup> 13 continuously differentiable, we can still use the proposed PWQ neural network to approximate it. In addition, all the results of the proposed method apply to the degenerate cases. Remark 4 We investigate model-based learning and assume complete knowledge of the model. Besides, the robustness of our model-based method to uncertainty can be analyzed in the robust MPC framework. 3.6 Complexity analysis We analyze the offline storage requirement as well as the online computational complexity of the proposed control scheme, and compare them with other methods, such as implicit MPC, explicit MPC, and the policy approximation methods of MPC [22,25]. Storage space is dominated by the number of regions and control laws (for explicit MPC), or the structure of the neural network (for approximate MPC). The storage of some system’s parameters, such as A, B, X, U, Q, and R, are neglected for consistency. Implicit MPC does not need to store any data except for some system’s parameters. In comparison, to implement explicit MPC, the straightforward way is to store all polyhedral regions Rj, j = 1, . . ., Nr and all control laws Fj x + gj, identify online the region that contains the current state, and then choose the corresponding control law. From the explicit control law given in (2), explicit MPC requires the storage of Nr regions and affine feedback laws. Suppose that each region Rj is defined by nc <sup>(j)</sup> constraints. Then, explicit solve a QP with nD decision variables and nI linear inequalities. So in an interior-point method, solving (4) requires O flops per iteration. In comparison, the �N <sup>3</sup> m <sup>3�</sup> flops per iteration. In comparison, the number of flops for explicit MPC is 2n Nr j=1 n <sup>(</sup> c <sup>j)</sup> [16]. In our proposed control scheme, solving the DP problem (16) causes computational complexity. In Algorithms 1 and 2, the number of flops to determine A <sup>¯</sup> and to compute the coefficients P <sup>¯</sup> A A �u <sup>(s)�</sup> is bounded by fact = M (2n <sup>2</sup> + n + m <sup>2</sup> + 5m + 2mn + 2) + 2mn + m(m + 3)/2 in total. Then, in each iteration� ¯ �u <sup>(s)��</sup>, ¯q <sup>T</sup> <sup>�</sup> <sup>¯</sup> �u <sup>(s)��</sup> Algorithm 1 has to solve 2 different QPs, which need fQP (m, nc + lc + s − 1) and fQP (m, ns) flops. Here, ns stands for the number of inequalities that define Us. Algorithm 2 needs only fQP (m, nc + lc) flops to find u <sup>(s)</sup> in each iteration. Besides, some other calculation includes the update of Us (2m <sup>2</sup> + 2m − 1 flops per iteration) and the comparison of A <sup>¯</sup> (u <sup>(s)</sup> ) and A <sup>¯</sup> (u <sup>(s−1)</sup> ) (M flops per iteration). Therefore, the total number of flops to implement Algorithm 1 is + m <sup>2</sup> �u <sup>(s)��</sup> A �u <sup>(</sup> + 5m + 2 , ¯q <sup>T</sup> <sup>�</sup> <sup>¯</sup> A �u <sup>(s)�</sup> <sup>�</sup> <sup>¯</sup> �u A n - ¯ <sup>)�</sup> mn + �u <sup>(s)��</sup> falgo1 =sm(fact+fQP (m, M +nc + lc) + 2m <sup>2</sup> + 2m − 1) + sm s=1 fQP (m, ns) (35) and the number of flops to calculate the control input by using Algorithm 2 is falgo2 = sm(fact + fQP (m, nc + lc) + M ) (36) which can be much less than those in Algorithm 1. 4 Numerical examples Three case studies are presented to assess the feasibility and effectiveness of the proposed control scheme. In addition, some other methods including implicit MPC and the policy approximation method of MPC [22], are also compared with the proposed method in the case studies. The simulations are conducted in MATLAB 2021a. 4.1 Example 1: a system with input constraints MPC needs to store (n + 1) Nr j=1 j=1 n <sup>(</sup> c <sup>j)</sup> + Nr (mn + m) real numbers. As for the proposed method, it needs to construct a PWQ neural network before running the system. The neural network contains 3 parameters: W, b, and r, so the storage of the proposed neural network requires nM + 2M real numbers in total. In addition, as for the policy approximation methods reported in [22,25], the total storage demand of the neural networks is (n + n0 + 1) M + (L − 1) (M + 1) M, with n0 = m for [22] and n0 = N (m + 2n + nc + mc) for [25], respectively. Here, L denotes the number of hidden layers, and nc and mc denote the number of constraints specified by X and U. 1 0.05 - 0.5 1 0.5 1 , B = and input constraints Online computation time will be evaluated in terms of floating point operations (flops) for the computations that should be performed online. Implicit MPC needs to solve the QP (3) or (4) at each time step. Solving (4) for a given x requires fQP (Nm, N (mc + nc)) flops in the worst case ((4) has no redundant constraints). Here, fQP (nD, nI) represents the number of flops needed to Consider a 2-dimensional linear system with A = 1 0.1 1 0.05 , B = and input constraints - −0.1 1 - - 0.5 1 U = {u ∈ R <sup>2</sup> | ||u||∞ ≤ 0.5}. We are interested in stabilizing the system at the origin and meanwhile min k=0 <sup>x</sup> k <sup>T</sup> <sup>Qxk</sup> <sup>+</sup> <sup>uT</sup> k <sup>Ruk</sup> <sup>with</sup> <sup>Q</sup> <sup>=</sup> <sup>I2</sup> and R = 0.1I2. We choose the region of interest X0 = x ∈ R <sup>2</sup> | ∥x∥∞ ≤ 3 . By applying the algorithm imizing the cost <sup>�∞</sup> - X0 = x ∈ R <sup>2</sup> | ∥x∥∞ ≤ 3 . By applying the algorithm in [18], it can be verified that the vertices of X0 can be - −0.1 1 x ∈ R <sup>2</sup> | ∥x∥∞ ≤ 3 it can be verified k=0 <sup>x</sup> k <sup>T</sup> k <sup>T</sup> <sup>Qxk</sup> <sup>+</sup> <sup>uT</sup> k k=0 <sup>x</sup> k <sup>T</sup> <sup>Qxk</sup> <sup>+</sup> <sup>uT</sup> k <sup>Ruk</sup> <sup>with</sup> <sup>Q</sup> <sup>=</sup> <sup>I2</sup> and R = 0.1I2. We choose the region of interest X0 = x ∈ R <sup>2</sup> | ∥x∥∞ ≤ 3 . By applying the algorithm imizing the cost <sup>�∞</sup> 14 steered to an ellipsoidal subset of O∞ <sup>LQR</sup> with the horizon N = 10. By solving the explicit MPC problem (4) with N = 10, the partition of the state space for the optimal control law on the region X0 can be obtained, and is depicted in Fig. 1(a). If some regions share the same form of the control law and their union is convex, the union of these regions is computed and dyed the same color. 3 2 1 0 -1 -2 -3 -3 -2 -1 0 1 2 3 the absolute mean square errors, i.e., the values of the objective function in (11) during the training process and show them in Fig. 1(c). From Fig. 1(c), it is observed that the training objectives for the 3 neural networks decrease consistently over epochs, while the proposed approach has the smallest mean square error during the training process. Additionally, increasing the width does not necessarily improve the approximation ability of the proposed NN. The polyhedral partition of the proposed neural network is also depicted in Fig. 1(b). From Fig. 1(b) it is noticed that the partition of the neural network concentrates in the areas where the explicit MPC law changes rapidly. We also compare the output of the PWQ neural network with the real optimal value function in Figs. 1(d)-1(f), from which one can observe that the proposed method is able to closely approximate the optimal value function with a very simple network architecture. To verify the stability of the closed-loop system, we note that the maximal stabilizable set X <sup>¯</sup> is open and thereby not computable. So, we concentrate on checking (34). From Figs. 1(e)-1(f) we can get the bounds e¯ = 0.122 and e¯grad = 0.395. Then, based on (28), we compute the value of the right-hand side of (28) at all training points and choose the largest one: ζ = 0.188. Next, the right-hand side of (34) can be computed by solving the following constrained nonlinear problem: (a) Regions of optimal explicit MPC. 10 <sup>2</sup> 10 <sup>0</sup> 10 <sup>-2</sup> ~~Local-global PWQ NN (width 15)~~ Deep ReLU NN (width 6) Shallow ReLU NN (width 15) Global PWQ NN (width 15) Local-global PWQ NN (width 10 ~~<u>)</u>~~ Local-global PWQ NN (width 20 ~~<u>)</u>~~ Local-global PWQ NN (width 25 ~~<u>)</u>~~ 0 1000 2000 3000 4000 Epochs (c) Comparison of the different types of neural networks. (e) Relative approximation error at training points. (b) Regions of the PWQ neural network. (d) The comparison of the approximated and real value functions. (f) Relative error of the gradient at training points. max <sup>2 ˆJ (x, θ)</sup> x <sup>T</sup> Qx s.t. ǫ ≤ J <sup>ˆ</sup> (x, θ) ≤ χ (37) Fig. 1. Performance of the proposed PWQ neural network. To illustrate that the proposed PWQ neural network has a good approximation performance, we compare it with standard ReLU neural networks (with 1 or 2 hidden layers). The widths of the neural networks are taken as 15 (for the proposed and shallow ReLU neural networks) and 6 (for the deep ReLU neural networks), so that all of them have a comparable number of parameters. To prevent the network from falling into local minimums that are not globally optimal, multi-start local optimization [48] is employed. Particularly, the network is initialized with multiple values of θ that are randomly selected in the feasible set. We then evaluate the values of the objective function in (11) and select the initial network parameter that yields the lowest function value. Besides, a strictly global architecture without the quadratic term x <sup>T</sup> P <sup>∗</sup> x is also compared. Choosing α = 0.1, we compare where ǫ is a small positive constant to avoid singularity. (37) returns a maximum 4.904. As a result, it can be readily verified that (34) holds. In the closed-loop simulation, the proposed method, implicit MPC, and the policy-approximation method of [22] are compared. To implement the policyapproximation method, we construct a deep ReLU neural network with 2 hidden layers, to learn the explicit MPC law. Normally, the width of the deep ReLU neural network should be set as 6 so that it has a comparable number of parameters. However, it shows a bad approximation performance. Therefore, we increase the width of the deep ReLU neural network to 8. The number of samples for training the policy network is the same as that for training the value network. When the system is running online, the output of the deep ReLU neural network may violate the input constraint, and thus is projected onto U. All QPs during the simulation are solved via the MATLAB function “quadprog”, and we select an interior-point algorithm when using “quadprog”. We choose the initial point x0 = [0 2] <sup>T</sup> and run the simulation program for 100 steps. The closed-loop behaviors in the first 30 time steps are plotted in Fig. 2. 15 0.2 0 -0.2 -0.4 20 <u>10</u> <u>20</u> <u>30</u> <u>0</u> <u>5</u> <u>10</u> <u>15</u> <u>20</u> <u>25</u> <u>30</u> Online MPC Proposed method Policy-approximation metho ~~d~~ 0 5 10 15 20 25 30 Time step (b) Control inputs Online MPC Proposed method 1 Policy-approximation method 0 0 5 10 15 20 25 30 Time step 0.2 0 -0.2 -0.4 0 -0.2 -0.4 -0.6 (a) States of the closed loop systems 2 1 0 -1 -2 -2 -1 0 1 2 (c) Verification of the stability. Fig. 2. Closed-loop simulation. From Fig. 2, it can be seen that the proposed method can properly approximate the MPC controller, and that the corresponding trajectory is stabilized at the origin. In comparison, the policy-approximation method experiences some fluctuations when the state is close to the origin. This is probably because the value of the optimal control input is pretty small if x is around the origin, so a slight approximation error of the policy may lead to drastic changes in the dynamic response. Besides, we can verify the stability by illustrating the invariance of the sub-level set Ω ≜ {x ∈ R <sup>n</sup> | J <sup>ˆ</sup> (x, θ) ≤ χ}. We select some initial states that are at the boundary of Ω, and plot the behavior of the closed-loop system with the proposed controller in Fig. 2(c). It is seen that the trajectories starting from the boundary of Ωwill always stay in Ω, which is computed by Corollary 1. 4.2 Example 2: an 8-D system To illustrate the computational performance of the proposed method on larger-size examples we consider the problem of regulating a system of oscillating masses [49]. The 8-D system consists of a string of 4 masses that are interconnected by springs with the front and the last mass connected to a wall. The system contains 8 state variables and 2 input variables. The masses have a value of 1 kg. The spring constant is 1 N/m. The constraints are ∥u∥∞ ≤ 5 N, ∥x∥∞ ≤ 10 m. The weight matrices Q and R are set as identity matrices. The MPC horizon is Table 1 Comparison of different methods regarding the average CPU time and the total cost in the 8-D system. Methods CPU time Total cost Proposed + PCP Algorithm 1.2300 2004.2 Proposed + Algorithm 1 0.2225 2004.2 Proposed + nonlinear solver 0.7309 2004.2 Online MPC 1.7279 1857.3 Policy-approximation method 0.1845 2607.5 chosen as 20. We select initial states in X from a uniform distribution and stop until 100 samples that are feasible for MPC are collected. Table 1 shows the average CPU time of the different methods, as well as their total cost after running the system for 100 time steps. Besides, we also compare the CPU time of the PCP Algorithm, Algorithm 1, and the nonlinear programming algorithm (using the MATLAB function “fmincon” with the interiorpoint algorithm). For fariness, all QPs are solved via the MATLAB function “quadprog”, using an interior-point algorithm. The policy-approximation method needs the least simulation time since it just needs to compute a single projection (solve a QP) at each time step. The proposed method with Algorithm 1 requires shorter computation time than online MPC. Besides, compared with the nonlinear solver and the PCP Algorithm, Algorithm 1 significantly reduces the computational complexity. In other aspects, the control law generated by the proposed method is nearly optimal since its total cost is very close to that of MPC, while the total cost of the policy-approximation method is the largest (about 140% of that of MPC), due to the fluctuations near the origin. For the comparison of the storage demand, in the 2-D example explicit MPC computes a PWA control law with 161 regions. It needs to store 2850 real numbers. In comparison, the proposed NN with width 15 requires the storage of 60 real numbers, which is far less than that for explicit MPC. In the above 8-D example, the explicit solution for the MPC problem is highly complex and cannot be computed within 48 hours. The computation of explicit MPC stopped prematurely due to the available memory being exceeded, with already more than 2 · 10 <sup>6</sup> regions stored, while the proposed NN with width 50 needs the storage of 500 real numbers. 4.3 Example 3: a system with state and input constraints In the third case study, we concentrate on the case of X0 = X <sup>¯</sup> . Hence, we consider a linear system with state and input constraints: xt+1 = 1 1 - 0 1 xt+ 0.4 - 0.6 ut, ∥xt∥∞ ≤ 3, |ut| ≤ 2 (38) 16 Table 2 Comparison of different ADP methods and MPC regarding the whole simulation time and the total cost. Methods Simulation time (s) Total cost Fig. 3. The trajectories of the closed-loop systems controlled by the proposed control law and MPC. The initial states are [±3 ± 0.8] <sup>T</sup> (top left), [±1.8 ± 2] <sup>T</sup> (top right), [±0.2 ∓ 3] <sup>T</sup> (bottom left), [±3 ∓ 3] <sup>T</sup> (bottom right). where the weight matrices Q and R are taken as I2 and 0.1, respectively. We intend to compare the proposed method with an existing ADP method for constrained linear systems developed in [13]. With the help of the Multi-Parametric Toolbox, X <sup>¯</sup> can be efficiently computed, as depicted in Fig. 3. As in the previous example, it is verified that N = 6 leads to the equivalence of (1) and (4). In contrast to using the initial states as well as their subsequent trajectories as training data in the previous example, a 121 × 121 state data grid is constructed to cover the region x ∈ R <sup>2</sup> | ∥x∥∞ ⩽ 3 and only the points contained in X <sup>¯</sup> are selected as training points. Therefore, the distance - between adjacent points is 0.05. These training points are exploited to train the PWQ neural network with width 15. After 15000 training iterations, the value of the objective function in (11) is less than 10 <sup>−1</sup>, and we obtain e¯ = 0.0552, e¯grad = 0.355, and hence ζ = 0.0745. Meanwhile, we can compute the right-hand side of (29), which equals 9.853. Consequently, condition (29) is satisfied. The offline analysis hence provides a stability guarantee. The proposed control law ˆu <sup>∗</sup> t The proposed control law ˆu <sup>∗</sup> t <sup>is expected to be stabilizing</sup> for all x0 in X <sup>¯</sup> . To test this, Fig. 3 plots the trajectories of the closed-loop system starting from the vertices of X¯ . Owing to the convexity of J∞ <sup>∗</sup> X¯ . Owing to the convexity of J∞ <sup>∗</sup> <sup>(·),</sup> <sup>such</sup> <sup>vertices</sup> <sup>have</sup> the largest J∞ <sup>∗</sup> <sup>(·)</sup> <sup>in</sup> <sup>their</sup> <sup>neighborhoods,</sup> <sup>and</sup> <sup>therefore</sup> the system starting from these vertices is prone to be divergent. However, Fig. 3 shows that the trajectories starting from any vertices converge rapidly to the origin, and the proposed control law significantly approximates the MPC law, which is optimal for the infinite-horizon Proposed method with Algorithm 2 0.142 9.956 ADP method in [13] 0.270 10.367 Online MPC 0.161 9.956 problem. Table 2 compares the proposed method (using Algorithm 2) with the ADP method in [13] and online MPC in terms of total simulation time and total cost in the first 100 time steps. As the ADP method in [13] is infeasible for all vertices of X <sup>¯</sup>, we choose an initial point x0 = [2 - 2] <sup>T</sup> that is much closer to the origin and run the system in 100 time steps. The proposed method combined with Algorithm 2 takes the least computation time, while the ADP method in [13] needs the most, which is mainly because [13] must solve an extra semidefinite program online to estimate the value function. In terms of optimality, the proposed method produces the same solution as MPC since their total costs are equal to each other. 5 Conclusions and future work We have developed an ADP control framework for infinite-horizon optimal control of linear systems subject to state and input constraints. Compared to some common neural networks such as ReLU neural networks, the proposed neural network maintains the PWQ property and convexity of the real value function and has a much better approximation performance. These properties and superiority contribute to the reduction of the online computation as well as the construction of explicit stability criteria. Therefore, advantages of our method include low computational requirements, stability assurance, and excellent approximation of the optimal control law. The main limitations of the proposed scheme are that the model considered is linear, and that modeling uncertainty is not addressed is the proposed framework. Besides, the supervised learning method needs much offline computation for the preparation of the training data. Future work includes using temporal difference learning to train the NN, extending the proposed method to the cases where the model is unknown, and considering constrained PWA systems. Acknowledgements: This paper is part of a project that has received funding from the European Research Council (ERC) under the European Union’s Horizon 17 2020 research and innovation programme (Grant agreement No. 101018826 - CLariNet). References [1] R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction. MIT Press, 2018. [2] F. L. Lewis and D. Vrabie, “Reinforcement learning and adaptive dynamic programming for feedback control,” IEEE Circuits and Systems Magazine, vol. 9, no. 3, pp. 32–50, 2009. [3] L. Bu¸soniu, T. de Bruin, D. Toli´c, J. Kober, and I. Palunko, “Reinforcement learning for control: Performance, stability, and deep approximators,” Annual Reviews in Control, vol. 46, pp. 8–28, 2018. [4] P. Werbos, “Approximate dynamic programming for realtime control and neural modelling,” Handbook of Intelligent Control: Neural, Fuzzy and Adaptive Approaches, pp. 493– 525, 1992. [5] D. Kleinman, “On an iterative technique for riccati equation computations,” IEEE Transactions on Automatic Control, vol. 13, no. 1, pp. 114–115, 1968. [6] A. Al-Tamimi, F. L. Lewis, and M. Abu-Khalaf, “Discretetime nonlinear HJB solution using approximate dynamic programming: Convergence proof,” IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), vol. 38, no. 4, pp. 943–949, 2008. [7] F. Berkenkamp, M. Turchetta, A. Schoellig, and A. Krause, “Safe model-based reinforcement learning with stability guarantees,” Advances in Neural Information Processing Systems, vol. 30, 2017. [8] S. Gros, M. Zanon, and A. Bemporad, “Safe reinforcement learning via projection on a safe set: How to achieve optimality?” IFAC-PapersOnLine, vol. 53, no. 2, pp. 8076– 8081, 2020. [9] S. Chen, K. Saulnier, N. Atanasov, D. D. Lee, V. Kumar, G. J. Pappas, and M. Morari, “Approximating explicit model predictive control using constrained neural networks,” in 2018 Annual American Control Conference (ACC), 2018, pp. 1520–1527. [10] K. P. Wabersich and M. N. Zeilinger, “A predictive safety filter for learning-based control of constrained nonlinear dynamical systems,” Automatica, vol. 129, p. 109597, 2021. [11] A. D. Ames, S. Coogan, M. Egerstedt, G. Notomista, K. Sreenath, and P. Tabuada, “Control barrier functions: Theory and applications,” in 2019 18th European Control Conference (ECC), 2019, pp. 3420–3431. [12] R. Cheng, G. Orosz, R. M. Murray, and J. W. Burdick, “End-to-end safe reinforcement learning through barrier functions for safety-critical continuous control tasks,” in AAAI Conference on Artificial Intelligence, vol. 33, no. 01, 2019, pp. 3387–3395. [13] A. Chakrabarty, R. Quirynen, C. Danielson, and W. Gao, “Approximate dynamic programming for linear systems with state and input constraints,” in 2019 18th European Control Conference (ECC), 2019, pp. 524–529. [14] A. Chakrabarty, D. K. Jha, G. T. Buzzard, Y. Wang, and K. G. Vamvoudakis, “Safe approximate dynamic programming via kernelized lipschitz estimation,” IEEE Transactions on Neural Networks and Learning Systems, vol. 32, no. 1, pp. 405–419, 2020. [15] J. Duan, Z. Liu, S. E. Li, Q. Sun, Z. Jia, and B. Cheng, “Adaptive dynamic programming for nonaffine nonlinear optimal control problem with state constraints,” Neurocomputing, 2021. [16] F. Borrelli, A. Bemporad, and M. Morari, Predictive Control for Linear and Hybrid Systems. Cambridge University Press, 2017. [17] D. Bertsekas, Reinforcement Learning and Optimal Control. Athena Scientific, 2019. [18] D. Chmielewski and V. Manousiouthakis, “On constrained infinite-time linear quadratic optimal control,” Systems & Control Letters, vol. 29, no. 3, pp. 121–129, 1996. [19] A. Bemporad, M. Morari, V. Dua, and E. N. Pistikopoulos, “The explicit linear quadratic regulator for constrained systems,” Automatica, vol. 38, no. 1, pp. 3–20, 2002. [20] D. G¨orges, “Relations between model predictive control and reinforcement learning,” IFAC-PapersOnLine, vol. 50, no. 1, pp. 4920–4928, 2017. [21] M. Kvasnica, J. L¨ofberg, and M. Fikar, “Stabilizing polynomial approximation of explicit MPC,” Automatica, vol. 47, no. 10, pp. 2292–2297, 2011. [22] B. Karg and S. Lucia, “Efficient representation and approximation of model predictive control laws via deep learning,” IEEE Transactions on Cybernetics, vol. 50, no. 9, pp. 3866–3878, 2020. [23] E. T. Maddalena, C. G. de Silva Moraes, G. Waltrich, and C. N. Jones, “A neural network architecture to learn explicit mpc controllers from data,” arXiv preprint arXiv:1911.10789, 2019. [24] G. F. Montufar, R. Pascanu, K. Cho, and Y. Bengio, “On the number of linear regions of deep neural networks,” Advances in Neural Information Processing Dystems, vol. 27, 2014. [25] S. W. Chen, T. Wang, N. Atanasov, V. Kumar, and M. Morari, “Large scale model predictive control with neural networks and primal active sets,” Automatica, vol. 135, p. 109947, 2022. [26] S. Chen, M. Fazlyab, M. Morari, G. J. Pappas, and V. M. Preciado, “Learning Lyapunov functions for piecewise affine systems with neural network controllers,” arXiv preprint arXiv:2008.06546, 2020. [27] M. Mittal, M. Gallieri, A. Quaglino, S. S. M. Salehian, and J. Koutn´ık, “Neural Lyapunov model predictive control: Learning safe global controllers from sub-optimal examples,” arXiv preprint arXiv:2002.10451, 2020. [28] A. Chakrabarty, V. Dinh, M. J. Corless, A. E. Rundell, S. H. ˙Zak, and G. T. Buzzard, “Support vector machine informed explicit nonlinear model predictive control using lowdiscrepancy sequences,” IEEE Transactions on Automatic Control, vol. 62, no. 1, pp. 135–148, 2016. [29] E. T. Maddalena, C. G. de Silva Moraes, G. Waltrich, and C. N. Jones, “A neural network architecture to learn explicit MPC controllers from data,” IFAC-PapersOnLine, vol. 53, no. 2, pp. 11 362–11 367, 2020. [30] P. Bakar´aˇc, J. Holaza, M. Kal´uz, M. Klauˇco, J. L¨ofberg, and M. Kvasnica, “Explicit MPC based on approximate dynamic programming,” in 2018 European control conference (ECC), 2018, pp. 1172–1177. [31] E. C. Kerrigan and J. M. Maciejowski, “Invariant sets for constrained nonlinear discrete-time systems with application to feasibility in model predictive control,” in Proceedings of the 39th IEEE Conference on Decision and Control (Cat. No. 00CH37187), vol. 5, 2000, pp. 4951–4956. 18 [32] P. O. Scokaert and J. B. Rawlings, “Constrained linear quadratic regulation,” IEEE Transactions on Automatic Control, vol. 43, no. 8, pp. 1163–1169, 1998. [33] B. Pang and Z.-P. Jiang, “A data-driven approach for constrained infinite-horizon linear quadratic regulation,” in 2020 59th IEEE Conference on Decision and Control (CDC), 2020, pp. 6010–6015. [34] A. R. Barron, “Universal approximation bounds for superpositions of a sigmoidal function,” IEEE Transactions on Information Theory, vol. 39, no. 3, pp. 930–945, 1993. [35] M. Baoti´c, F. Borrelli, A. Bemporad, and M. Morari, “Efficient on-line computation of constrained optimal control,” SIAM Journal on Control and Optimization, vol. 47, no. 5, pp. 2470–2489, 2008. [36] P. Tøndel, T. A. Johansen, and A. Bemporad, “An algorithm for multi-parametric quadratic programming and explicit MPC solutions,” Automatica, vol. 39, no. 3, pp. 489–497, 2003. [37] S. Fahandezh-Saadi and M. Tomizuka, “In proximity of ReLU DNN, PWA function, and explicit MPC,” arXiv preprint arXiv:2006.05001, 2020. [38] D. P. Bertsekas and J. N. Tsitsiklis, Neuro-Dynamic Programming. Athena Scientific, 1996. [39] I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning. MIT Press, 2016. [40] S. Boyd, S. P. Boyd, and L. Vandenberghe, Convex Optimization. Cambridge University Press, 2004. [41] D. P. Bertsekas, “Nonlinear programming,” Journal of the Operational Research Society, vol. 48, no. 3, pp. 334–334, 1997. [42] W. W. Hogan, “Point-to-set maps in mathematical programming,” SIAM review, vol. 15, no. 3, pp. 591–603, 1973. [43] F. V. Louveaux, “Piecewise convex programs,” Mathematical Programming, vol. 15, no. 1, pp. 53–62, 1978. [44] R. Postoyan, L. Bu¸soniu, D. Neˇsi´c, and J. Daafouz, “Stability analysis of discrete-time infinite-horizon optimal control with discounted cost,” IEEE Transactions on Automatic Control, vol. 62, no. 6, pp. 2736–2749, 2016. [45] C. N. Jones and M. Morari, “Approximate explicit MPC using bilevel optimization,” in 2009 European Control Conference (ECC), 2009, pp. 2396–2401. [46] K. Hornik, M. Stinchcombe, and H. White, “Multilayer feedforward networks are universal approximators,” Neural Networks, vol. 2, no. 5, pp. 359–366, 1989. [47] M. N. Zeilinger, C. N. Jones, and M. Morari, “Real-time suboptimal model predictive control using a combination of explicit MPC and online optimization,” IEEE Transactions on Automatic Control, vol. 56, no. 7, pp. 1524–1534, 2011. [48] A. Rinnooy Kan and G. Timmer, “Stochastic global optimization methods part II: Multi level methods,” Mathematical Programming, vol. 39, no. 1, pp. 57–78, 1987. [49] Y. Wang and S. Boyd, “Fast model predictive control using online optimization,” IEEE Transactions on Control Systems Technology, vol. 18, no. 2, pp. 267–278, 2009. 19

섹션 본문 156문단 · 58,874자

(제목 없음)

1Approximate dynamic programming (ADP) faces challenges in dealing with constraints in control problems. Model predictive control (MPC) is, in comparison, well-known for its accommodation of constraints and stability guarantees, although its computation is sometimes prohibitive. This paper introduces an approach combining the two methodologies to overcome their individual limitations. The predictive control law for constrained linear quadratic regulation (CLQR) problems has been proven to be piecewise affine (PWA) while the value function is piecewise quadratic. We exploit these formal results from MPC to design an ADP method for CLQR problems. A novel convex and piecewise quadratic neural network with a localglobal architecture is proposed to provide an accurate approximation of the value function, which is used as the cost-to-go function in the online dynamic programming problem. An efficient decomposition algorithm is developed to speed up the online computation. Rigorous stability analysis of the closed-loop system is conducted for the proposed control scheme under the condition that a good approximation of the value function is achieved. Comparative simulations are carried out to demonstrate the potential of the proposed method in terms of online computation and optimality.

Background

2Reinforcement learning (RL) [1] provides powerful tools for the synthesis of controllers due to its strong interactions with the environment. When RL is applied to physical systems, model-based RL, also known as (approximate) dynamic programming ((A)DP) [2], has received much attention since it can make effective use of the state transition information provided by the model. Combined with control techniques, model-based RL has successfully been applied to a broad range of control engineering.

3Compared to its diverse industrial applications, the theoretical analysis on the stability and safety for RL faces great challenges [3]. Originated from the artificial intelligence (AI) community, RL used to be developed only for AI applications (e.g., board games), in which AI researchers focused almost entirely on performance with respect to a designated reward function while stability and safety are ignored. Stability and safety, on the other hand, are central to the control community since unstable modes or risky control policies may lead to destructive consequences in physical systems. In the control community, the earliest ADP methods can be traced back to the 1990s, when Werbos [4] introduced function approximators to construct actor-critic structures for the synthesis of feedback control laws. Thanks to Lyapunov stability theory, the stability issue of ADP has been comprehensively addressed, both for linear [5] and nonlinear systems [6].

4Although ADP approaches consider stability, safety is another important issue that needs further study. From the control viewpoint, safety means that the behavior of closed-loop systems, including states, inputs, and outputs, satisfies some hard or soft constraints. In summary, techniques employed by RL or ADP approaches for dealing with constraints can be grouped into two categories: policy-projection-based methods and policyoptimization-based methods. Policy-projection-based methods considers the RL formulation in the uncon-strained case and involves a regulator to check and modify the policies that may violate the constraints. Such regulator can be a single projection operator [7,8] that can handle linear state and input constraints, a predictive safety filter [9] for nonlinear state and input constraints, or it can contain control barrier functions to guarantee safety [10,11]. These indirect methods, however, sometimes fail to capture the optimal solution of the constrained problem and lack stability guarantees. In comparison, optimization-based methods intend to directly get the optimal value function for the constrained problems by solving the constrained Hamilton-Jacobi-Bellman (HJB) equation. With the optimal value function available, the optimal control policy can thereby be produced by solving a constrained policy optimization problem. [12] was the first investigation of this kind of method, although it was limited to searching for the best linear feedback control law. The authors in [13] focused on using deep neural networks (NNs) to estimate the value function and the optimal policy for a nonlinear control problem with state constraints.

5It should be mentioned that in constrained cases, neither the optimal policy nor the optimal value function is readily available, even for the most basic infinitehorizon linear quadratic regulation (LQR) problems. This to some extent restricts the development of the policy-optimization-based RL methods in constrained control problems. In comparison, model predictive control (MPC) [14], an optimization-based control scheme widely adopted in the control community, has a mature stability and robustness theory as well as an inherent constraint handling. MPC is distinguished in its enlargement of the horizon in the online policy optimization problem. From RL's point of view, using multi-step policy optimization algorithms diminishes the need for exact knowledge of the cost-to-go function [15]. For infinite-horizon LQR problems, MPC can render the exact optimal control law due to the equivalence of finite and infinite optimal control as long as the horizon is sufficiently long [16]. With this fundamental property, infinite-horizon LQR problems can be solved by either implementing MPC online or explicit MPC [17], and the solution is proven to be piecewise affine (PWA) in the state space [17]. However, the computational complexity of online MPC and the storage requirements of explicit MPC grow dramatically with the increase of the horizon. This is one of the main drawbacks of MPC compared with RL or ADP [18].

6Dedicated to overcoming this drawback, approximation methods of predictive control laws have received much attention in recent years. An emerging methodology is using specific function regression techniques such as polynomial approximators [19] and PWA neural networks [8,20,21]. The PWA neural networks, or more specifically, the neural networks with rectified linear units, can represent PWA functions [22], which provides the opportunity for using PWA neural networks to ac-curately fit the predictive control laws. In [20,21], this approach is shown to alleviate storage demands. Nevertheless, no guarantees of closed-loop stability are conveniently available, even through the final approximation error is small enough. Using NN-based controllers to warm start the solver in online MPC [23] can inherently guarantee stability, and learning Lyapunov functions to verify the stability of NN-based controllers [24] is also an alternative way. However, as additional computation is required in the optimization or learning procedure, the superiority of lower computational complexity brought by approximation methods is not obvious.

Novelties and contributions

7Based on these observations, we aim to benefit from both MPC and RL (ADP) to attain a computationally inexpensive control scheme for linear systems with stability and feasibility guarantees. We focus on the infinitehorizon LQR problem with state and input constraints. Note that usually, the optimal control law can be steep in some regions while the value function is continuous and convex [18]. So in general, the value function may be easier to approximate accurately than the control law. Different from the research of approximating the MPC policy [8,[19][20][21], we propose a value function approximation scheme. The optimal value function that has been extensively characterized by explicit MPC, is approximated by a piecewise quadratic (PWQ) neural network. The synthesis of the control law is carried out in a DP problem, where stability, feasibility, and sub-optimality can be guaranteed if a good approximation is obtained. Meanwhile, note that one disadvantage of approximating the value function is that it needs online policy optimization, which would not be the case in policy approximation methods [8,[19][20][21]. To address this issue, we develop algorithms so that online optimization can be done efficiently, as will be shown in Section 3.

8The contributions of the paper are highlighted as follows:

9(1) We present a new approach to approximate MPC for linear systems based on value function approximation and DP. Different from the policy-based approximation approaches, the proposed approach achieves suboptimal control performance with stability and feasibility guarantees.

10(2) To obtain the MPC value function, we design a PWQ neural network that can fully capture the PWQ and convex properties of the value function. As a result, better approximation quality can be realized with a simple network structure.

11(3) We develop a policy optimization algorithm to solve the ADP problem efficiently. In particular, the nonlinear dynamic program is simplified to a quadratic program (QP) in which decision variables and constraints are much fewer than those in traditional MPC problems.

12(4) Compared to [12], the first exploration of ADP in constrained LQR setting, the proposed approach eliminates the restriction of searching for a linear feedback law and does not require an initially stabilizing policy or an initial state belonging to an invariant set.

Preliminaries

13Notations: The identity matrix with dimension n × n is written as I n . The set N denotes the set of positive integers containing zero. The symbol ∇f (·) is used to represent the gradient of a function f (·). In addition, λ max (P ) and λ min (P ) represent the maximum and minimum eigenvalues of a symmetric positive definite matrix P respectively. The boundary of the set P is ∂P, and int(P) stands for the interior of P. We utilize A i,· to represent the ith row of the matrix A.

Problem formulation

14We study the infinite-horizon constrained linear quadratic regulation (CLQR) problem

15(1) where x k ∈ R n , u k ∈ R m , A ∈ R n×n , B ∈ R n×m , X and U are polyhedra that contain the origin in their interior, and U ∞ = {u k } ∞ k=0 is the infinite-dimensional decision variable. Like other papers [8,25], it is assumed that Assumption A1: (A, B) is stabilizable and Q 1/2 , A is observable. Moreover, for any possible initial state x, there exists a sequence of admissible input vectors u 0 , u 1 , . . . that can stabilize the state to the origin, i.e.,

16In some existing literature [14,25],X is also called the maximal stabilizable set.

17With Assumption A1, let K ∈ R m×n be a stabilizing gain matrix for the unconstrained plant x k+1 = Ax k + Bu k . As in [16], we consider the admissible set of state under a given stabilizing control gain K asX K = {x ∈ R n | x ∈ X , −Kx ∈ U}.

18If the constraints in the CLQR problem (1) are removed, the problem admits a unique linear solution u LQR k = −K * x k , k = 0, 1, . . . where K * = R + B T P * B −1 B T P * A and P * = P * T is the unique positive-definite solution of the algebraic Riccati equation [5]

19In the constrained case, problem (1) is not as easy to solve as the unconstrained one due to infinite number of decision variables. However, if the state is close to the origin, the unconstrained LQR solution u LQR k = −K * x k , k = 0, 1, . . . may not violate the constraints so that the solution to problem (1) is identical to the unconstrained LQR solution −K * x k as if there is no constraint at all. This motivates researchers to consider the following positively invariant set:

20With this definition, the existing literature [16,26,27] considers using a finite-horizon problem:

21to approximate the infinite-horizon LQR problem (1). The rationale behind this design is that after a sufficient long horizon, the resulting x N will fall into O LQR ∞ where the unconstrained LQR solution u N = −K * x N will not violate the constraints. Since O LQR ∞ is positively invariant, the subsequent trajectories x N +1 , x N +2 , . . . will always stay in O LQR ∞ , and the constraints will be automatically satisfied with the control gain K * . As the result, the terminal cost x T N P * x N is an exact representation for J * ∞ (x N ). The following theorem, proposed in [16], formally demonstrates the validity of this design.

Theorem 2 [16] LetJ be an upper bound on

22According to Theorem 2, the horizon N is essential to the equivalence of the finite-horizon and infinite-horizon problems. For a given x, one can repeatedly solve problem (3) with an increasing N until the terminal state falls into O LQR ∞ [26]. This approach only works for a certain state value. Alternatively, [16] gives a conservative estimate of the horizon for all x belonging to a polyhedral set X 0 based on the result in Theorem 2. Specifically, [16] computes p m , q m , and J * ∞ (·) at the vertices of X 0 . Next, J is set to be maximum of all J * ∞ (·), and N is selected to be the smallest integer such that N ≥ (J − p m )/q m .

23It is not necessary to compute O LQR ∞ explicitly. A more mathematically convenient routine is to compute an ellipsoidal subset of O LQR ∞ [16]. This approach, on the other hand, may lead to a conservative choice of N .

24With the equivalence in Theorem 2 established, we can regulate the state to minimize the infinite-horizon cost by solving problem (3). Problem (3) can be solved in a receding-horizon manner. Specifically, at each time step t, t ∈ N, x in (3) is set to the current state x t and only the first m elements of the corresponding so-

Explicit MPC

25By substituting the state update equation into J * N (x) and the constraints, (3) can be reformulated as a multiparametric quadratic program (mpQP) that only depends on the current state x:

26where the matrices H, F, Y, G, w, S can be readily obtained through matrix multiplication operations, and

27k=0 is the finite-dimensional decision variable. Problem (4) can be solved online or offline. The online implementation requires to solve a quadratic program (QP) with x in (4) fixed to the current state at each time step. Although efficient QP solvers based on interior point methods and active-set methods are applicable, the computational complexity is cubic in the horizon N and the dimension m of the input vector. In comparison, the offline method, also called explicit MPC, aims to directly solve the mpQP in (4) for all possible x in a feasible set, and find the relationship between the optimizer U * (x) and x.

28The results from explicit MPC show that the optimizer U * (x) and the optimal MPC control law are PWA. Therefore, the solution to the infinite-horizon problem (1) is also PWA. The following theorem, proposed in [17], summarizes the properties of the explicit solution to the CLQR problem.

29Theorem 3 [17] With Assumption A1 and the equivalence in Theorem 2 satisfied, the state feedback solution to the CLQR problem (1) in a compact polyhedral set of the initial conditions X 0 ⊆X is time-invariant, continuous and PWA

30where the polyhedral sets R j = {x ∈ R n : H j x ≤ h j } , j = 1, . . . , N r constitute a finite partition of X 0 .

31To implement the PWA feedback law, the direct way is to store H j , h j , F j , g j that define all the polyhedra R j and the corresponding affine feedback law, perform an online search to locate the polyhedron that contains x, and finally feed the system with the corresponding affine feedback law.

32The explicit controller is easy to implement offline in the case of a short horizon and a low-dimensional input vector. However, with the increase of the horizon and the input's dimension, the number of regions in (5) grows exponentially [17], which may make the offline computation almost intractable.

33It has been verified that artificial neural networks with at least one hidden layer have the capability of universal approximation [28] for any continuous function, provided that the hidden layer is given enough units. Herein, one direct intuition is that we can use neural networks to represent the explicit MPC law, without any need to identify the regions in (5). With the knowledge of the PWA form of the MPC law, one can construct some specific neural architectures to achieve exact and computationally inexpensive approximation. Related work has been reported in [8,20,29], combined with supervised learning or policy gradient methods. The neuralnetwork-based controllers proposed in these papers require online feasibility certificate to determine whether the outputs of the neural networks are safe. Usually, a feasibility recovery technique based on projection is used to regulate the control inputs. These neural network based policy approximators, on the other hand, inherently lack stability guarantees. The authors in [23] propose an explicit-implicit MPC scheme, where neural networks provide a control input initialization and a primal active-set method is executed to solve a QP online to ensure feasibility and asymptotic stability. However, this explicit-implicit MPC scheme needs large-scale neural networks whose outputs are supposed to contain all primal and dual variables in (4), and the online computation burden still exists since the decision variables in the QP is still U .

34The optimal value function, on the other hand, is a scalar, positive, and PWQ function [17]. If we could get an approximationĴ(·) of the optimal value function, the control input can thereby be generated through a dynamic programming approach, which can rigorously guarantee the recursive feasibility and stability [2]. The approach of combining value function approximation and dynamic programming is called approximate dynamic programming (ADP), which has been widely studied for optimal control of unconstrained linear and nonlinear systems [2]. However, in constrained cases, even the most primary LQR problem becomes challenging from the ADP point of view. A relevant paper [12], published in 2019, simplifies the problem by searching for a quadratic approximation for the value function, and thus obtains linear feedback.

35Before establishing our approximation structure, we concentrate on the properties of the optimal value function J * ∞ (·).

36Theorem 4 [14] With Assumption A1 and the equivalence in Theorem 2 satisfied, then, in a compact polyhedral set of the initial conditions X 0 ⊆X, the optimal value function J * ∞ (·) obtained from J * N (·) is continuous, convex, and PWQ over polyhedra:

37Theorem 5 [30] Assume that the infinite-horizon problem (1) results in a non-degenerate mpQP. Let R i , R j be two neighboring polyhedra and A i , A j be the corresponding sets of active constraints at the optimum of (4), i.e.,

38Problem (4) is said to be (primal) degenerate if G Aj ,· is not full row rank in some regions R j . Note that some CLQR problems may result in degenerate mpQPs, which means the continuous differentiability of J * ∞ (·) may not always hold. For example, degeneracy could happen when more than N m constraints in (4) are active at the optimizer U * (x). Nevertheless, degeneracy does not necessarily cause the loss of continuous differentiability of the value function [30]. Also notice that currently, there are no analytical results on how to identify a class of control problems that can ensure nondegeneracy in advance. Adding a terminal constraint may make (4) become degenerate [30]. If degeneracy is recorded when solving (4), feasible methods to avoid degeneracy include removing redundant constraints from GU ≤ w + Sx 0 [31] or slightly tuning the weight matrices Q and R.

Design of neural network for approximation in value space

39According to Theorems 4 and 5, the value function approximator, denoted byĴ(·, θ) where θ refers to some parameters, is expected to have the following features:

40• (F1) It can partition its input space into polyhedral regions. • (F2) It can produce a convex and PWQ function partitioned by polyhedra. • (F3) For x in a small region containing the origin, the approximator can provide the exact representation for the value function, i,e,Ĵ(x, θ) = x T P * x.

41We intend to use a feed-forward neural network to capture the relationship between the state x and the value J * ∞ (·) of the optimal value function. A feed-forward neural network is composed of one or more hidden layers and an output layer, where each hidden layer contains an affine map

42followed by a nonlinear map

43In (8) and (9), M is the width of each layer, referring to the number of units in each layer, κ l−1 ∈ R M is the output of the previous layer with κ 0 the input of the network, W l ∈ R M×M and b l ∈ R M are the weights and biases, respectively, g l (·) : R M → R M is a nonlinear activation function that is usually applied element-wise on its input.

44In the output layer, the outputs of the last hidden layer are linearly combined with weight W L+1 ∈ R 1×M , to produce the final output of the network

45Based on these definitions, a neural network with L hidden layers and M units in each layer can be represented by

46where θ contains all the weights and biases of the affine functions in all the layers, and the symbol • means the layers are connected in series.

47The activation function plays an important role in the approximation of neural network. In this paper, we consider a popular activation function, named the rectifier linear unit (ReLU), which is defined as f ReLU (x) = max {0, x}. Here, max(0, x) computes the element-wise maximum between the vector x and a zero vector of the same dimension. An amazing property of the ReLU is that it can produce a series of PWA functions with polyhedral partitions, combined with an affine transformation (8) [22]. Actually, the output of a neural network with ReLUs as activation functions is PWA. Based on these observations, [8,20,29] contemplates using ReLU neural networks to represent the explicit MPC law.

48Now, we know that the optimal value function is PWQ. We are interested in producing a class of PWQ basis functions that can efficiently represent the value function. Let us focus on the last hidden layer in (11). All activation units in this layer can still be written as a continuous PWA function over the input space of the network [32]. The product of any two continuous PWA functions is a continuous PWQ function. This indicates that such a product can be a possible basis to capture the features of the MPC optimal value function. Now, we are in a position to state our design. We calculate the element-wise product ⊙ of all the units κ L in the last hidden layer

49to generate a series of PWQ functions

50This calculation can be viewed as a layer in the network, denoted by the product layer p(κ L ).

51Finally, the output layer is a simple weighted sum of the outputs of the previous layer:

52where r = (r 1 , r 2 , ..., r M ) T ∈ R M is the weight vector of the output layer.

53To make the proposed approximator satisfy F3, we develop a "local-global" architecture [33], which decomposes the outputs of the approximator into two partŝ

54with P * being the solution to the ARE (2). The term x T P * x is included to capture "global" aspects of J * ∞ (·), while the neural-network-based term is exploited to identify the polyhedral partition in (6) and capture the local residuals J * ∞ (x) − x T P * x. Since the known term x T P * x that dominates the value function is extracted and fixed, using such a "local-global" architecture is possible to enhance the quality of approximation.

55We hereafter denoteĴ (·, W, b, r) byĴ (·, θ) for the sake of brevity, with all the parameters condensed in θ.

56The reason why we use only one hidden layer is twofold. First, by using one hidden layer, it is possible to construct a convexĴ (·, θ), which is desirable since the real optimal value function is convex. This property will be discussed in the next section. More importantly, using one hidden layer provides the opportunity to solve the dynamic programming problem through simple QP methods. It should be noticed that in our case the dynamic programming problem is a nonlinear program since the objective function is PWQ. If we use one hidden layer, we can explicitly compute the coefficients of J (·, θ) by extracting the activated units in the hidden layer. The online dynamic programming can be conducted by solving a sequence of quadratic programs without the need to calculate any gradients or Hessians.

Network training and convexity analysis

57So far, we have finished the design of the architecture of the proposed neural network. This subsection discusses the optimization strategy over the parameters in θ in order to approximate the optimal value function.

58Firstly, training data needs to be generated offline by

59denote the solution to the MPC problem for the initial state x (i) and the corresponding trajectories of the closed-loop controlled system. All existing research [20,29] on the approximation of MPC only uses the initial states {x

60as the input training data, which means solving (3) N x times can only generate N x training pairs.

61In view of this, we present a more efficient strategy for data generation by leveraging the equivalence between the finite-horizon problem and the infinite-horizon problem. Suppose that we have obtained the optimal control sequence {u

62k=0 and the corresponding value J * N x (i) for different x (i) , consider the sub-problems whereby we start at x (1). According to the principle of optimality [15], the truncated optimal control sequence {u

63j=k is also optimal for these subproblems. As a result, the optimal value functions for these subsequent trajectories x

64with no need to solve (3) repeatedly.

65k=0 is prone to congregating near the origin if the initial state x (i) is chosen too close to the origin. Therefore, to make the training data cover the whole region of X 0 as much as possible, the initial states x (i) , i = 1, . . . , N x are recommended to be set near the boundary of X 0 .

66With the N x N state-value pairs available, the neural network is trained so that its parameters approximate the solution to the following problem: 2 is the square of the approximation error for each training pair, and x

67is introduced to guarantee that no units in the hidden layer are activated when x is near the origin, i.e., to fulfill F3, while the constraint r ≥ 0 is responsible for maintaining convexity ofĴ(·, θ).

68Problem (16) is a nonlinear least-squares problem, which can be successfully solved by the gradient descent method [34] with a learning rate α > 0. In each iteration s, s = 1, 2, . . . , θ is projected onto the feasible set of (16) after updated by the gradient downhill.

69After the neural network is trained, the system can be run and the control signals are computed by solving a dynamic programming problem. It is desirable that it could be convex so that any locally optimal point is also globally optimal. It should be noticed that in most case a neural network cannot provide a convex function w.r.t. its inputs even through it uses convex activation functions. With a specific structure, our proposed neural network, on the other hand, allows to produce a convex functionĴ(·, θ).

70Suppose that the output of the proposed approximator has the following PWQ form:

71whereR j are polyhedra defined by the hyperplanes {W l,· x + b l = 0} M l=1 . DefineR = diag(r) and we can rewrite (14) asĴ

72where κ, the output of the hidden layer, is PWA w.r.t.

73x. Therefore, by applying the chain rule for the second derivative, it is found that the Hessian ∇ 2 xĴ is positive definite in the interior of anyR j if the weight matrixR ≥ 0, i.e., r i ≥ 0, for i = 1, . . . , M . In the following, we will show that the gradient descent method with projection can guarantee the positive semi-definiteness ofR.

74Theorem 6 Consider the PWQ neural network (14) comprised of (8)- (9) and (12)- (13). With a non-negative r and a negative b, the functionĴ(·, θ) that the neural network produces is continuously differentiable and convex w.r.t. its input.

75Proof In the interior of anyR j , j = 1, . . . ,N r , continuous differentiability ofĴ(·, θ) is clear sinceĴ(·, θ) has a quadratic form, and convexity ofĴ(·, θ) follows from the positive semi-definiteness ofR in (18). Then, we havê P j − P * ≥ 0 for all j = 1, . . . ,N r .

76At the boundary of any neighboringR i andR j , without loss of generality, suppose thatR i ,R j are partitioned by the hyperplane

77Differentiating both sides of (19) yields

7820) which proves continuous differentiability ofĴ(x, θ) at the boundary.

79Furthermore, sinceĴ(x, θ) is differentiable, convexity of J(x, θ) at the boundary can be checked through firstorder conditions [35]. Formally speaking,Ĵ(x, θ) is convex if and only if

80holds for all x 1 , x 2 belonging to the domain ofĴ(x, θ).

81As convexity ofĴ(x, θ) in the interior of anyR j , j = 1, . . . ,N r has been verified, we only focus on the boundary. Without loss of generality, let x 1 ∈R i and x 2 ∈R j . From (19) one haŝ

82which demonstrates thatĴ(·, θ) satisfies (21) at the boundary. This completes the proof of Theorem 6. ✷

Remark 7

83In [12], a quadratic value function approximator is proposed, and it is updated online. In contrast, our method retains the PWQ property of the real value function and move the training process offline. As a result, the proposed control framework can more accurately accommodate the optimal control law. Besides, [12] assumes that the initial state lies in an invariant set, while our method relaxes this restriction. In particular, the domain of attraction under the proposed control law can be equal to the maximal stabilizable setX.

Suboptimal control law based on dynamic programming

84With a well-fittedĴ(·, θ) available, at each time step t, t ∈ N, we can obtain a suboptimal control policy by solving the following one-step dynamic programming problem

85whereQ(x t , u t ) can be viewed as the approximated optimal Q-function [15] for problem (1). Denote the solution to (23) byû * t . Here, we use another subscript (·) t to indicate that problem (23) is solved online at each time step t. In problem (23), C is chosen asX or R n , depending on whetherX is computable. In particular, if the iterative algorithm (Algorithm 10.3) in [14] does not terminate in finite time, we drop the constraint on Ax t + Bu t . This could happen, e.g., when there is no state constraint in (1). Besides, in both cases problem (23) is recursively feasible sinceX is a control invariant set (CIS) [14]. Moreover, it should be noted that some approximation methods of predictive control laws specify C as the maximal CIS C ∞ [8] or an arbitrary polytopic CIS [20], which may make the approximated controllers not stabilizing since usuallyX ⊆ C ∞ . The set C ∞ \X contains some initial states that cannot be steered to the origin. The dynamic programming solution in (23), on the other hand, can prevent x t from falling into C ∞ \X as we can prove thatĴ(·, θ) is possible to be a Lyapunov function for the closed-loop system.

86Let m c and l c denote the minimum number of linear inequalities that define U and C, respectively. Note that problem (23) contains m decision variables and m c + l c constraints, both of which are much less than those in problem (4). This is one of the main benefits of ADP or RL. Nevertheless, the objective function in (23) is nonlinear and contains a neural network. Standard solvers such as the ellipsoid algorithm or the interior-point algorithm require the computation of the Hessian ∇ 2 uQ (x, u) or the gradient ∇ uQ (x, u) in each iteration. Such computation can only be carried out by visiting all units in the hidden layers and extracting the activated ones. The advantage of low computational complexity brought by dynamic programming will then inevitably diminish.

87In view of this, we intend to avoid frequently calculating ∇ 2 uQ (x, u) and ∇ uQ (x, u) by decomposing the Q-functionQ(x t , u t ) into some quadratic functions. In particular, we develop two optimization algorithms in which problem (23) is reduced to a QP problem in each iteration. For a given x t , t ∈ N, consider the set of activated ReLU units inĴ (Ax + Bu, θ):

88(24) where M is the width of the hidden layer. With (24), Q(x t , u) can thus be computed aŝ

89SinceP (Ā(u)) > 0, the right-hand side of (25) is a convex quadratic function ifĀ(u) is fixed. An algorithm that can cope with general piecewise convex programs (PCP) is proposed in [36]. We adapt it to solving problem (23) and summarize it in Algorithm 1.

90Algorithm 1 is a modified version of the PCP algorithm in [36]. In each iteration, Algorithm 1 solves two auxiliary QPs and terminates if the minimizers d (s+1) and u (s+1) are identical. The parameter ε > 0 is a tolerance. If |d (s+1) − u (s+1) | ≤ ε is recorded, we assume that the two problems in Algorithm 1 admit the same optimal point. It is preferable that d (sm) or u (sm) could be the exact solution to problem (23) and that Algorithm 1 could stop in finite time. [36] provides these guarantees, which are summarized in the following theorem.

91Theorem 8 [36]Consider the dynamic programming problem (23). For any x t that makes problem (23) feasible, the PCP algorithm (Algorithm 1) terminates in a finite number of iterations, i.e., there exists a finite s m such that |d (sm) − u (sm) | ≤ ε holds. Moreover, if |d (sm) − u (sm) | ≤ ε holds, then d (sm) is the solution to problem (23).

92As shown in [36], using Algorithm 1 to solve piecewise quadratic programs can be effective since it only needs Algorithm 1 PCP algorithm for solving the piecewise quadratic program (23) [36] Input: State xt at time step t, input ut−1 at the last time step t − 1 (if t > 0), the optimal Q-functionQ (·, ·), C Output: Control input ut that will be applied to the system Initialize a starting point u (1) ← ut−1 Initialize a set U1 ← {u|u ∈ U, Axt + Bu ∈ C for s = 1, 2, . . . do Update the set of activated unitsĀ(u (s) ) at u (s) by (24), and compute the coefficientsP (Ā(u (s) )) and q T (Ā(u (s) )) associated withĀ(u (s) ) through (26) Find u (s+1) ← arg min u∈Us u TP (Ā(u (s) ))u +q T (Ā(u (s) ))u

93end if end for to compute ∇ 2 uQ (x, u) or ∇ uQ (x, u) when s is updated. On the other hand, Algorithm 1 is not the ideal choice for solving our DP problem, because problem (9) contains numerous constraints if the neural network has a large number of hidden units. This motivates us to consider the following design. In each iteration s, s ∈ N + , let u (s) be an initial input (for s = 1) or the input calculated from the last iteration (for s > 1). We compute the set of activated unitsĀ(u (s) ) at u (s) , and thereby get P (Ā(u (s) )) andq T (Ā(u (s) )) from (26). Then, we solve the following QP:

94which returns u (s+1) for the next iteration. In the next iteration, after computingĀ(u (s+1) ), we can terminate and output u (s+1) ifĀ(u (s+1) )=Ā(u (s) ). If a cycle occurs, i.e.,Ā(u (s+1) )=Ā(u (k) ), ∃k ∈ {1, . . . , s − 1}, we arbitrarily choose anotherĀ(u (s+1) ) that has not been involved in previous iterations. The proposed method for getting the solution to (23) is summarized in Algorithm 2.

95In Algorithm 2, the starting point u (1) = u t−1 is initialized with the last control input, which can be viewed as a warm start for the algorithm. To understand the rationale of this design, suppose that x t is close to the ori-Algorithm 2 Decomposition algorithm for solving the piecewise quadratic program (23) Input: State x t at time step t, input u t−1 at the last time step t − 1 (if t > 0), the optimal Q-function Q (·, ·), C Output: Control input u t that will be applied to the system Initialize a starting point u (1) ← u t−1 for s = 1, 2, . . . do Update the set of activated unitsĀ(u (s) ) by (24) ifĀ(u (s) ) =Ā(u (s−1) ) and s > 1 then Let s m ← s, return u t ← u (sm) , break else ifĀ(u (s) ) =Ā(u (k) ), ∃k ∈ {1, . . . , s − 2} then ResetĀ(u (s) ) to be a new set of activated units that never occurs previously.

96end if Compute the coefficientsP (Ā(u (s) )) and q T (Ā(u (s) )) associated withĀ(u (s) ) through (26) Update the policy through (27) and get u (s+1) end if end for gin after enough time steps. Then, u t will vary slightly around the origin. Choosing u (1) = u t−1 is beneficial to reducing the number of iterations.

97Compared to Algorithm 1, Algorithm 2 only needs to solve one QP, in which the constraints are the same as those in (23). Additionally, Algorithm 2 circumvents the calculation of U s+1 . Meanwhile, Algorithm 2 can also achieve finite termination as well as the optimality for problem (23). However, the number of iterations in Algorithm 2 may be more than that in Algorithm 1, and we need to store all the previous set of activated units A(u (k) ), k = 1, . . . , s − 1. For all that, we can still rely on Algorithm 2 because we have found that cycles rarely occur in our numerical experiments for several examples. Besides, we can also switch to algorithm 1 by taking U sc ← {u|u ∈ U, Ax t + Bu ∈ C if a cycle is detected at s = s c .

98Theorem 9 Consider the DP problem (23). For any x t that makes problem (23) feasible, the decomposition algorithm (Algorithm 2) terminates in a finite number of iterations, i.e, there exists a finite s m such thatĀ u (sm) =Ā u (sm−1) holds. Moreover, if A u (sm) =Ā u (sm−1) , then u (sm) is the solution to problem (23).

99Proof We will first show that if Algorithm 2 stops, it outputs a solution to problem (23).

100According to Algorithm 2, u (sm) minimizesQ u (sm ) (x t , u) u TP (Ā(u (sm) ))u +q T (Ā(u (sm) ))u +v(Ā(u (sm) )) subject to u ∈ U, Ax t + Bu ∈ C ∞ ifĀ(u (sm) ) =Ā(u (sm−1) ). In this case, the inequality

101holds for all u ∈ U 1 {u|u ∈ U, Ax t + Bu ∈ C. Using the fact that ∇ T uQu (sm ) x t , u (sm) = ∇ T uQ x t , u (sm) , the gradient inequality for the convex PWQ function Q (x t , ·) can be applied at u (sm) :

102which, combined with inequality (28), shows that Q (x t , u) ≥Q x t , u (sm) for all u ∈ U 1 . Thus, the optimality of u (sm) is proven.

103Furthermore, if a cycle occurs, i.e.,Ā(u (s) ) =Ā(u (k) ), ∃k ∈ {1, 2, . . . , s − 2} happens for some s, according to Algorthm 2, we select another set of activated units that has never been considered in problem (27). As the combinations of activated units are finite, which means the number of differentĀ(·) is limited, the algorithm must stop in finite iterations. ✷

Stability analysis

104The recursive feasibility of the DP problem (23) is inherently guaranteed. In this section, we investigate the stability of the proposed control law.

105If problem (4) is non-degenerate, all R i , i = 1, . . . , N r are full-dimensional [14]. In contrast, in the degenerate case, some R i are lower-dimensional, and in general, they correspond to common boundaries between full-dimensional regions. Since both J * ∞ (·) andĴ (·, θ) are PWQ on polyhedra, the intersection of any R i and R j , i = 1, . . . , N r , j = 1, . . . ,N r is still polyhedral. Let R i,j denote this intersection if such intersection represents a full-dimensional region, i.e., R i,j R i ∩R j , i ∈ {1, ..., N r } , j ∈ {1, ...,N r } and dim(R i ∩R j ) = n. It is clear that all R i,j are a partition of X 0 .

106Upper bound of the approximation error. To certificate the stability, we need to know the upper bound of the approximation error for all x belonging to X 0 . Computing the maximum of |Ĵ(·, θ) − J * ∞ (·)|/J * ∞ (·) over each R i,j is cumbersome since (i) it needs the analytical form of J * ∞ (·) and (ii) it needs to solve at most N rNr non-convex optimization problems, which is computationally demanding.

107For this reason, we develop a procedure to get an upper bound of |Ĵ(·, θ) − J * ∞ (·)|/J * ∞ (·) by leveraging the Lipschitz continuity of ∇Ĵ(·, θ) and ∇J * ∞ (·). Since we can compute the approximation error of the proposed neural network at the training points, it is possible to obtain an upper bound of the approximation error for all x in X 0 . In the interior of each R i,j , both J * ∞ (·) andĴ (·, θ) are quadratic and hence twice continuously differentiable. According to [14,Lemma 3.2], the gradients ∇ x J * ∞ (·) and ∇ xĴ (·, θ) are locally Lipschitz on int(R i,j ), i.e., there exist non-negative constants L i and L j such that for all pairs (x,

108(30) The Lipschitz constants L i andL j can be chosen as the largest eigenvalue of P i andP j [14, Lemma 3.2], respectively. In the following, we will show that there exists a positive constant ζ such that

109To achieve this, we need the following assumption.

110Assumption A2: For the partition R i,j of X 0 , suppose that there exists at least one training point in each int(R i,j ).

111Meanwhile, define a measure of the gradient error as

112, and letf andḡ stand for the maximum values of |f (·)| and g(·) over all training data, which are computable. It is straightforward to see that

113is any training point specified in (15).

Remark 10

114If Assumption A2 is not satisfied after the neural network is trained, we can add some testing points in int(R i,j ), evaluate |f (·)| and g(·) at these testing points, and adjustf andḡ if necessary so that |f (·)| ≤f , g (·) ≤ḡ also hold at these testing points.

115Let R 1 refer to the polyhedron where no constraints in (4) are active, i.e., R 1 = O LQR ∞ , and accordingly let R 1 represents the polyhedron where no ReLU units in J (·, θ) are activated. In the region R 1,1 = R 1 ∩R 1 , we have |f (x)| ≡ 0 due to (14). For every R i,j except R 1,1 , consider the following three cases:

116Case 1: f (x) ≥ 0, ∀x ∈ int(R i,j ). In this case, for any x ∈ int(R i,j ), let y ∈ int(R i,j ) denote the training or testing point closest to x. Substituting x and y into (30) results in

117where β(y) = ∇ T J * ∞ (y) 2 /J * ∞ (y). The first inequality of (33) is true due to the second inequality of (30) and the convexity of J * ∞ (·). Let d i,j denote the maximum Euclidean distance between x and its nearest training or testing point subject to x ∈ int(R i,j ). Using the fact that (32) holds at y, we obtain from (33) that

118holds for any x ∈ int(R i,j ). Herein, it should be mentioned that β(y) is bounded on all R i,j except R 1,1 , since J * ∞ (·) can only equal zero at origin, which is contained in R 1,1 . Therefore, one can always make d i,j sufficiently small so that 1 − β(y)d i,j > 0.

119Case 2: f (x) ≤ 0, ∀x ∈ int(R i,j ). Similarly to Case 1, we can readily get

120where the first inequality of (35) comes from the first inequality of (30) and the convexity ofĴ (·, θ). The last line of (35) is almost the same as the right-hand side of (34), and the only difference is thatL j is replaced by L i .

121, we can get the same upper bound for |f (x)| as in (34), and for all x ∈ int(R i,j ) subject tô J (x, θ) < J * ∞ (x), inequalities (35) holds.

122Consequently, combining the above 3 cases, it is sufficient to conclude that for any x ∈ int(R i,j ), |f (x)| is upper bounded by

123Finally, since f (x) is continuous on the closure of R i,j , the bound ζ i,j applies to all x in R i,j . In addition, thanks to Assumption A2, the value of ζ in (31) can be determined by computing the right-hand side of (36) at all training/testing points and choosing the largest one.

124Computation of ∇Ĵ (y, θ), ∇J * ∞ (y), L i , andL j . The computation of ∇Ĵ (y, θ) andL j is straightforward since the analytical form ofĴ (·, θ) is known. The values of ∇J * ∞ (y) and L i can be collected in the training process. Specifically, note that all y are contained in the interior of full-dimensional R i , in which the rows of G A i are linearly independent. In this case, the Lagrange multipliers λ * (·) of problem (4) are affine functions of x [17] on and thus continuously differentiable. Then, similar to the analysis in [14, Theorem 6.9], the gradient ∇J * ∞ (y) can be computed by

125To obtain L i , let us restrict our attention to the set of active constraints at y. The set A i defined in Theorem 5 can be determined by checking whether the elements of λ * (y) is zero or not. Then, as illustrated in the proof of [30, Lemma 1 (Theorem 5 in this paper)], substituting A i into

126where Γ = G Ai,· H −1 G T Ai,· ≻ 0, we can obtain P i and hence select L i as the largest eigenvalue of P i .

127With the property of boundedness for f (x) established, we can assess the stability for the closed-loop system with the approximate controllerû * . Corresponding to the selection of C in problem (23), we consider two cases:

128(1) C =X and (2) C = R n .

129Theorem 11 Letû * t be the solution to problem (23) with C =X. Suppose that Assumptions A1-A2 hold with X 0 = X. If ζ satisfies

130then the origin of the closed-loop system x t+1 = Ax t + Bû * t , t = 0, 1, . . . is asymptotically stable with domain of attractionX.

131Proof Let us first consider the solution to the MPC problem (3). For every x t , t = 0, 1, . . . , MPC finds the solution U * t to problem (3) and only collects the first m elements, i.e., u * t = [I m 0 m · · · 0 m N −1 terms ]U * t will be applied to the system. From the equivalence between problem (1) and problem (3), {u * t } ∞ t=0 is also a solution to the problem (1). As a result, Ax t + Bu * t ∈X for any x T Qx ≤ λmax(P * ) λmin(Q) . Besides, in view of (36), ζ is determined mainly byf ,ḡ, and d i,j . The condition (39) or (44) can thereby be guaranteed in two ways. One is to add more hidden units into the neural network so thatf andḡ could be smaller according to the universal approximation theorem [38]. Another possibility is to involve more state-value/gradient data to test (32) so that d i,j is reduced.

132If the data generation strategy in Section 3.2 is used, sometimes it is not straightforward to satisfy Assumption A2 since the positions of the subsequent states x (i) * k , i = 1, . . . N x , k = 1, . . . , N − 1 cannot be determined explicitly. An alternative approach is to only use initial states {x (i) } Nx i=1 with a much larger N x if we find that a number of regions of the partition R i,j are not visited by the training points.

133Approximation methods of MPC with stability guarantees have been investigated in, e.g., [23,37,39]. The stability results in these three papers are based on a common fundamental theorem, stating that if

134is still a Lyapunov function for the system controlled by {û * t } ∞ t=0 . Our method, on the contrary, firstly obtains an estimationĴ (·, θ) of J * ∞ (·). IfĴ (·, θ) can approximate J * ∞ (·) well (characterized by conditions (39) and (44)), the approximated control law generated by the DP (23) will be inherently stabilizing. In addition, note that the Lyapunov functions in Theorems 11 and 12 areĴ (·, θ), instead of J * ∞ (·).

135Remark 13 It is worth mentioning that our approach can be extended to the degenerate cases. Even if J * ∞ (·) is not continuously differentiable, we can still use the proposed PWQ neural network to approximate it. In addition, all the results of the proposed method apply to the degenerate cases.

Complexity analysis

136We analyze the offline storage requirement as well as the online computational complexity of the proposed control scheme, and compare them with other methods, such as implicit MPC, explicit MPC, and the policy approximation methods of MPC [20,23].

137Storage space is dominated by the number of regions and control laws (for explicit MPC), or the structure of the neural network (for approximate MPC). The storage of some system's parameters, such as A, B, X , U, Q, and R, are neglected for consistency. Implicit MPC does not need to store any data except for some system's parameters. In comparison, to implement explicit MPC, the straightforward way is to store all polyhedral regions R j , j = 1, . . . , N r and all control laws F j x + g j , identify online the region that contains the current state, and then choose the corresponding control law. From the explicit control law given in (3), explicit MPC requires the storage of N r regions and affine feedback laws. Suppose that each region R j is defined by n (j) c constraints. Then, explicit MPC needs to store (n + 1) Nr j=1 n (j) c + N r (mn + m) real numbers. As for the proposed method, it needs to construct a PWQ neural network before running the system. The neural network contains 3 parameters: W, b, and r, so the storage of the proposed neural network requires nM + 2M real numbers in total. In addition, as for the policy approximation methods reported in [20,23], the total storage demand of the neural networks is (n + n 0 + 1) M + (L − 1) (M + 1) M , with n 0 = m for [20] and n 0 = N (m + 2n + n c + m c ) for [23], respectively. Here, L denotes the number of hidden layers, and n c and m c denote the number of constraints specified by X and U.

138Online computation time will be evaluated in terms of floating point operations (flops) for the computations that should be performed online. Implicit MPC needs to solve the QP (3) or (4) at each time step. Solving (4) for a given x requires f QP (N m, N (m c + n c )) flops in the worst case ((4) has no redundant constraints). Here, f QP (n D , n I ) represents the number of flops needed to solve a QP with n D decision variables and n I linear inequalities. So in an interior-point method, solving (4) requires O N 3 m 3 flops per iteration. In comparison, the number of flops for explicit MPC is 2n Nr j=1 n (j) c [14], far less than that for implicit MPC.

139In our proposed control scheme, solving the DP problem (23) causes computational complexity. In Algorithms 1 and 2, the number of flops to determineĀ u (s) and to compute the coefficientsP Ā u (s) ,q T Ā u (s) is bounded by f act = M (2n 2 + n + m 2 + 5m + 2mn + 2) + 2mn + m(m + 3)/2 in total. Then, in each iteration Algorithm 1 has to solve 2 different QPs, which need f QP (m, n c + l c + s − 1) and f QP (m, n s ) flops. Here, n s stands for the number of inequalities that define U s . Algorithm 2 needs only f QP (m, n c + l c ) flops to find u (s) in each iteration. Besides, some other calculation includes the update of U s (2m 2 + 2m − 1 flops per iteration) and the comparison ofĀ(u (s) ) andĀ(u (s−1) ) (M flops per iteration). Therefore, the total number of flops to implement Algorithm 1 is

140and the number of flops to calculate the control input by using Algorithm 2 is

141which can be much less than those in Algorithm 1.

Numerical examples

142Two case studies are presented to assess the feasibility and effectiveness of the proposed control scheme. In addition, some other methods including implicit MPC and the policy approximation method of MPC [20], are also compared with the proposed method in the case studies. The simulations are conducted in MATLAB 2021a.

143We are interested in stabilizing the system at the origin and meanwhile minimizing the cost ∞ k=0 x T k Qx k + u T k Ru k with Q = I 2 and R = 0.1I 2 . We choose the region of interest X 0 = x ∈ R 2 | x ∞ ≤ 3 . By applying the algorithm in [16], it can be verified that the vertices of X 0 can be steered to an ellipsoidal subset of O LQR ∞ with the horizon N = 10. By solving the explicit MPC problem (4) with N = 10, the partition of the state space for the optimal control law on the region X 0 can be obtained, and is depicted in Fig. 2(a). If some regions share the same form of the control law and their union is convex, the union of these regions is computed and dyed the same color.

144(a) Regions of optimal explicit MPC. (e) Relative approximation error at training points.

145(f) Relative error of the gradient at training points. To illustrate that the proposed PWQ neural network has a good approximation performance, we compare it with standard ReLU neural networks (with 1 or 2 hidden layers). The widths of the neural networks are taken as 15 (for the proposed and shallow ReLU neural networks) and 6 (for the deep ReLU neural networks), so that all of them have a comparable number of parameters. To prevent the network from falling into local minimums that are not globally optimal, multi-start local optimization [40] is employed. Particularly, the network is initialized with multiple values of θ that are randomly selected in the feasible set. We then evaluate the values of the objective function in (16) and select the initial network parameter that yields the lowest function value. Choosing α = 0.1, we compare the absolute mean square errors, i.e., the values of the objective function in (16) during the training process and show them in Fig. 2(c). From Fig. 2(c), it is observed that the training objectives for the 3 neural networks decrease consistently over epochs, while the proposed approach has the smallest mean square error during the training process.

146The polyhedral partition of the proposed neural network is also depicted in Fig. 2(b). From Fig. 2(b) it is noticed that the partition of the neural network concentrates in the areas where the explicit MPC law changes rapidly. We also compare the output of the PWQ neural network with the real optimal value function in Figs. 2(d)-2(f), from which one can observe that the proposed method is able to closely approximate the optimal value function with a very simple network architecture.

147To verify the stability of the closed (36), we compute the value of the right-hand side of (36) at all training points and choose the largest one: ζ = 0.188. Next, the righthand side of (44) can be computed by solving the following constrained nonlinear problem:

148where ǫ is a small positive constant to avoid singularity. (47) returns a maximum 4.904. As a result, it can be readily verified that (44) holds.

149In the closed-loop simulation, the proposed method, implicit MPC, and the policy-approximation method of [20] are compared. To implement the policyapproximation method, we construct a deep ReLU neural network with 2 hidden layers, to learn the explicit MPC law. Normally, the width of the deep ReLU neural network should be set as 6 so that it has a comparable number of parameters. However, we find that it comes off a bad approximation performance. Therefore, we increase the width of the deep ReLU neural network to 8. When the system is running online, the output of the deep ReLU neural network may violate the input constraint, and thus is projected onto U. All QPs during the simulation are solved via MATLAB function "quadprog", and we select an interior-point algorithm when using "quadprog". We choose the initial point x 0 = [0 2] T and run the simulation program in 100 steps. The closed-loop behaviors in the first 30 time steps are plotted in Fig. 3. From Fig. 3, it can be seen that the proposed method can properly approximate the MPC controller, and that the corresponding trajectory is stabilized at the origin. In comparison, the policyapproximation method experiences some fluctuations when the state is close to the origin. This is probably because the value of the optimal control input is pretty small if x is around the origin, so a slight approximation error of the policy may lead to drastic changes in the dynamic response. Table 1 shows the whole simulation time of the three methods, as well as their total cost 100 t=0

150x T t Qx t + u T t Ru t . Besides, we also compare the simulation time of Algorithm 1, Algorithm 2, and the nonlinear programming method (using the MATLAB function "fmincon" with the interior-point algorithm) when implementing the proposed method. The policy-approximation method needs the least simulation time since it just needs to compute a single projection (solve a QP) at each time step. The proposed method with Algorithm 2 requires shorter computation time than online MPC. Besides, compared with the nonlinear solver and Algorithm 1, Algorithm 2 significantly reduces the computation complexity. In other aspects, the control law generated by the proposed method is nearly optimal since its total cost is very close to that of MPC, while the total cost of the policy-approximation method is relatively large (about 126% of that of MPC), due to the fluctuations near the origin.

151In the second case study, we concentrate on the case of X 0 =X. Hence, we consider a linear system with state and input constraints:

152where the weight matrices Q and R are taken as I 2 and 0.1, respectively. We intend to compare the proposed method with an existing ADP method for constrained linear systems developed in [12]. With the help of the Multi-Parametric Toolbox,X can be efficiently computed, as depicted in Fig. 4.

153As in the previous example, it is verified that N = 6 leads to the equivalence of (1) and (4). In contrast to using the initial states as well as their subsequent trajectories as training data in the previous example, a 121 × 121 state data grid is constructed to cover the region x ∈ R 2 | x ∞ 3 and only the points contained inX are selected as training points. Therefore, the distance between adjacent points is 0.05. These training points are exploited to train the PWQ neural network with width 15. After 15000 training iterations, the value of the objective function in (16) is less than 10 −1 , and we obtainf = 0.0552,ḡ = 0.355, and hence ζ = 0.0745. Meanwhile, we can compute the right-hand side of (39), which equals 9.853. Consequently, condition (39) is satisfied. The offline analysis hence provides a stability guarantee.

154The proposed control lawû * t is expected to be stabilizing for all x 0 inX. To test this, Fig. 4 plots the trajectories of the closed-loop system starting from the vertices of X. Owing to the convexity of J * ∞ (·), such vertices have the largest J * ∞ (·) in their neighborhoods, and therefore the system starting from these vertices is prone to be divergent. However, Fig. 4 shows that the trajectories starting from any vertices converge rapidly to the origin, and the proposed control law significantly approximates the MPC law, which is optimal for the infinite-horizon problem. Table 2 compares the proposed method (using Algorithm 2) with the ADP method in [12] and online MPC in terms of total simulation time and total cost in the first 100 time steps. As the ADP method in [12] is infeasible for all vertices ofX, we choose an initial point x 0 = [2 − 2] T that is much closer to the origin and run the system in 100 time steps. The proposed method combined with Algorithm 2 takes the least computation time, while the ADP method in [12] needs the most, which is mainly because [12] must solve an extra semidefinite program online to estimate the value function. In terms of optimality, the proposed method produces the same solution as MPC since their total costs are equal to each other.

Conclusions and future work

155In this paper, we have developed an ADP control framework for infinite-horizon optimal control of linear systems subject to state and input constraints. Compared to some common neural networks such as ReLU neural networks, the proposed neural network maintains the PWQ property and convexity of the real value function and has a much better approximation performance. These properties and superiority contribute to the reduction of the online computation as well as the construction of explicit stability criteria. Therefore, advantages of our method include low computational requirements, stability assurance, and excellent approximation of the optimal control law.

156The main limitations of the proposed scheme are that the model considered is linear, and that modeling uncertainty is not addressed is the proposed framework. Besides, the supervised learning method needs much offline computation for the preparation of the training data. Future work include using temporal difference learning to train the neural network, and extending the proposed method to constrained PWA systems, which can model a wide range of hybrid processes and nonlinear systems.

참고문헌 24건

  1. Handbook of Intelligent Control: Neural, Fuzzy, and Adaptive Approaches 1992
  2. The explicit linear quadratic regulator for constrained systems Automatica · Elsevier BV · 2002 10.1016/s0005-1098(01)00174-1
  3. On an iterative technique for Riccati equation computations IEEE Transactions on Automatic Control · Institute of Electrical and Electronics Engineers · 1968 10.1109/tac.1968.1098829
  4. Stochastic global optimization methods part II: Multi level methods Mathematical Programming · Springer Science+Business Media · 1987 10.1007/bf02592071
  5. Piecewise convex programs Mathematical Programming · Springer Science+Business Media · 1978 10.1007/bf01608999
  6. Discrete-Time Nonlinear HJB Solution Using Approximate Dynamic Programming: Convergence Proof IEEE Transactions on Systems Man and Cybernetics Part B (Cybernetics) · Institute of Electrical and Electronics Engineers · 2008 10.1109/tsmcb.2008.926614
  7. An algorithm for multi-parametric quadratic programming and explicit MPC solutions Automatica · Elsevier BV · 2003 10.1016/s0005-1098(02)00250-9
  8. Fast Model Predictive Control Using Online Optimization IEEE Transactions on Control Systems Technology · Institute of Electrical and Electronics Engineers · 2009 10.1109/tcst.2009.2017934
  9. Efficient On-Line Computation of Constrained Optimal Control SIAM Journal on Control and Optimization · Society for Industrial and Applied Mathematics · 2008 10.1137/060659314
  10. Multilayer feedforward networks are universal approximators Neural Networks · Elsevier BV · 1989 10.1016/0893-6080(89)90020-8
  11. Invariant sets for constrained nonlinear discrete-time systems with application to feasibility in model predictive control Proceedings of the 40th IEEE Conference on Decision and Control (Cat. No.01CH37228) · 2002 10.1109/cdc.2001.914717
  12. On constrained infinite-time linear quadratic optimal control Systems & Control Letters · Elsevier BV · 1996 10.1016/s0167-6911(96)00057-6
  13. Predictive Control for Linear and Hybrid Systems 2017 10.1017/9781139061759
  14. Efficient Representation and Approximation of Model Predictive Control Laws via Deep Learning IEEE Transactions on Cybernetics · Institute of Electrical and Electronics Engineers · 2020 10.1109/tcyb.2020.2999556
  15. Approximating Explicit Model Predictive Control Using Constrained Neural Networks 2018 10.23919/acc.2018.8431275
  16. Approximate Dynamic Programming For Linear Systems with State and Input Constraints 2019 10.23919/ecc.2019.8795815
  17. Safe Approximate Dynamic Programming via Kernelized Lipschitz Estimation IEEE Transactions on Neural Networks and Learning Systems · Institute of Electrical and Electronics Engineers · 2020 10.1109/tnnls.2020.2978805
  18. Learning Lyapunov Functions for Piecewise Affine Systems with Neural Network Controllers arXiv (Cornell University) · Cornell University · 2020 10.48550/arxiv.2008.06546
  19. A predictive safety filter for learning-based control of constrained nonlinear dynamical systems Automatica · Elsevier BV · 2021 10.1016/j.automatica.2021.109597
  20. A Neural Network Architecture to Learn Explicit MPC Controllers from Data IFAC-PapersOnLine · Elsevier BV · 2020 10.1016/j.ifacol.2020.12.546
  21. Large scale model predictive control with neural networks and primal active sets Automatica · Elsevier BV · 2021 10.1016/j.automatica.2021.109947
  22. In Proximity of ReLU DNN, PWA Function, and Explicit MPC arXiv (Cornell University) · Cornell University · 2020 10.48550/arxiv.2006.05001
  23. Safe Model-based Reinforcement Learning with Stability Guarantees arXiv (Cornell University) · Cornell University · 2017 10.48550/arxiv.1705.08551
  24. Approximate dynamic programming for constrained linear systems: A piecewise quadratic approximation approach Automatica · Elsevier BV · 2023 10.1016/j.automatica.2023.111456