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

Learning Constrained Parametric Differentiable Predictive Control Policies With Guarantees

관련 필름·전자재료 · (16) CPI(투명 폴리이미드)

기본 정보

저자
  1. Ján Drgoňa — Physics and Computational Sciences Division, Pacific Northwest National Laboratory, Richland, WA, USA
  2. Aaron Tuor — Physics and Computational Sciences Division, Pacific Northwest National Laboratory, Richland, WA, USA
  3. Draguna Vrabie — Physics and Computational Sciences Division, Pacific Northwest National Laboratory, Richland, WA, USA
DOI
10.1109/tsmc.2024.3368026
저널
IEEE Transactions on Systems Man and Cybernetics Systems
발행년도
2024
발행기관
Institute of Electrical and Electronics Engineers
피인용수
25
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1109/tsmc.2024.3368026
토픽
Fuel Cells and Related Materials
OpenAlex ID
W4393206865

평가 내용

관련도
관련
사업분야
필름·전자재료 · (16) CPI(투명 폴리이미드)
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '필름·전자재료 > CPI(투명 폴리이미드)' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

We present differentiable predictive control (DPC), a method for offline learning of constrained neural control policies for nonlinear dynamical systems with performance guarantees. We show that the sensitivities of the parametric optimal control problem can be used to obtain direct policy gradients. Specifically, we employ automatic differentiation (AD) to efficiently compute the sensitivities of the model predictive control (MPC) objective function and constraints penalties. To guarantee safety upon deployment, we derive probabilistic guarantees on closed-loop stability and constraint satisfaction based on indicator functions and Hoeffding’s inequality. We empirically demonstrate that the proposed method can learn neural control policies for various parametric optimal control tasks. In particular, we show that the proposed DPC method can stabilize systems with unstable dynamics, track time-varying references, and satisfy nonlinear state and input constraints. Our DPC method has practical time savings compared to alternative approaches for fast and memory-efficient controller design. Specifically, DPC does not depend on a supervisory controller as opposed to approximate MPC based on imitation learning. We demonstrate that, without losing performance, DPC is scalable with greatly reduced demands on memory and computation compared to implicit and explicit MPC while being more sample efficient than model-free reinforcement learning (RL) algorithms.

본문 77,673자

본문 펼치기
## Learning Constrained Parametric Differentiable Predictive Control Policies With Guarantees Ján Drgoˇna, _Member,_ _IEEE_, Aaron Tuor, and Draguna Vrabie, _Member,_ _IEEE_ _Abstract_ —We present differentiable predictive control (DPC), a method for offline learning of constrained neural control policies for nonlinear dynamical systems with performance guarantees. We show that the sensitivities of the parametric optimal control problem can be used to obtain direct policy gradients. Specifically, we employ automatic differentiation (AD) to efficiently compute the sensitivities of the model predictive control (MPC) objective function and constraints penalties. To guarantee safety upon deployment, we derive probabilistic guarantees on closed-loop stability and constraint satisfaction based on indicator functions and Hoeffding’s inequality. We empirically demonstrate that the proposed method can learn neural control policies for various parametric optimal control tasks. In particular, we show that the proposed DPC method can stabilize systems with unstable dynamics, track time-varying references, and satisfy nonlinear state and input constraints. Our DPC method has practical time savings compared to alternative approaches for fast and memoryefficient controller design. Specifically, DPC does not depend on a supervisory controller as opposed to approximate MPC based on imitation learning. We demonstrate that, without losing performance, DPC is scalable with greatly reduced demands on memory and computation compared to implicit and explicit MPC while being more sample efficient than model-free reinforcement learning (RL) algorithms. _Index_ _Terms_ —Differentiable programming, learning for control, parametric optimal control, policy optimization (PO). I. INTRODUCTION ATA-DRIVEN dynamics modeling and control policy learning show promise to “democratize” advanced con# D trol to systems with complex and partially characterized dynamics. However, pure data-driven methods typically suffer from poor-sampling efficiency, scale poorly with problem size, and exhibit slow convergence to optimal decisions [1]. Of special concern are the lack of guarantees that black-box data-driven controllers will satisfy operational constraints and maintain safe operation. Manuscript received 19 October 2023; accepted 11 February 2024. This work was supported by the Mathematics for Artificial Reasoning in Science (MARS) and Data Model Convergence (DMC) Initiatives through the Laboratory Directed Research and Development (LDRD) Investments at Pacific Northwest National Laboratory (PNNL). PNNL is a national laboratory operated for the U.S. Department of Energy (DOE) by Battelle Memorial Institute under Contract DE-AC05-76RL0-1830. This article was recommended by Associate Editor M. Qiu. _(Corresponding_ _author:_ _Ján_ _Drgoˇna.)_ The authors are with the Physics and Computational Sciences Division, Pacific Northwest National Laboratory, Richland, WA 99352 USA (e-mail: jan.drgona@pnnl.gov; aaron.tuor@pnnl.gov; draguna.vrabie@pnnl.gov). This article has supplementary material provided by the authors and color versions of one or more figures available at https://doi.org/10.1109/TSMC.2024.3368026. Digital Object Identifier 10.1109/TSMC.2024.3368026 Model predictive control (MPC) methods can offer optimal performance with systematic constraints handling. However, their solution is based on real-time optimization that might be computationally prohibitive for some applications. Explicit MPC (eMPC) [2] aims to overcome the limits of online optimization by precomputing the control law offline for a given set of admissible parameters. However, obtaining eMPC policies via multiparametric programming (mpP) [3] is computationally expensive, limiting its applicability to small-scale systems. Addressing limitations of eMPC, several authors have proposed using deep learning to approximate the control policies given example data sets computed by a supervisory MPC [4], [5]. _A._ _Contributions_ In this article, we expand our prior work on differentiable predictive control (DPC), a method for offline learning of explicit predictive control policies [6], [7], [8]. DPC is based on differentiable programming [9] where the mathematical operations associated with evaluating the MPC problem’s constraints and objective function are represented as a directed acyclic computational graph implemented in a language supporting automatic differentiation (AD). This allows us to obtain direct policy gradients of the MPC problem suitable for learning constrained control policies using stochastic gradient descent (SGD) algorithm. We report the following contributions. 1) An offline policy optimization (PO) algorithm based on gradients computed by differentiating the MPC problem. 2) Probabilistic closed-loop stability and constraint satisfaction guarantees based on Hoeffding’s inequality. 3) Five numerical studies that compare DPC with MPC, approximate MPC (aMPC), and model-free reinforcement learning (RL) algorithms demonstrating that: a) DPC can learn to stabilize unstable systems; b) DPC can handle parametric nonlinear constraints; c) DPC is more sample efficient than RL algorithms; d) DPC has faster execution time than implicit MPC; and e) DPC scales better compared to eMPC. 4) Open-source code implementation [10]. _B._ _Related_ _Work_ _1)_ _Learning-Based_ _Model_ _Predictive_ _Control:_ In general, learning-based MPC (LBMPC) methods [11], [12] are based on learning the system dynamics model from data and can be considered generalizations of classical adaptive MPC. ⃝c 2024 The Authors. This work is licensed under a Creative Commons Attribution 4.0 License. F i f ti htt // ti /li /b /4 0/ To make LBMPC tractable, the performance and safety tasks are decoupled by using reachability analysis [13], [14]. Variations include formulation of robust or stochastic MPC with state-dependent uncertainty for data-driven linear models [15], Gaussian processed (GP) [16], kernel regression model [17], Koopman operator model [18], recurrent neural networks [19], [20], fuzzy neural networks [21], [22] selforganizing radial basis function neural networks [23], or iterative model updates for linear systems with bounded uncertainties and robustness guarantees [24]. For a comprehensive review of LBMPC approaches we refer the reader to a recent review [25] and references therein. In general, LBMPC methods are based on the online solution of the corresponding optimization. In contrast, in the proposed DPC methodology, the neural policy is learned offline and hence represents an explicit solution to the underlying parametric optimal control problem (pOCP). _2)_ _Explicit_ _Model_ _Predictive_ _Control:_ For a certain class of small scale MPC problems [26], [27], the solution can be precomputed offline using mpP [3], [28] to obtain a socalled eMPC policy [29], [30]. The benefits of eMPC are typically faster online computations, exact bounds on worstcase execution time, and simple and verifiable policy code, which makes it a suitable approach for embedded applications. However, eMPC suffers from the curse of dimensionality, scaling geometrically with the number of constraints. This severely limits its practical applicability only to small scale systems with short prediction horizons [2], even after applying various complexity reduction methods [31], [32]. The DPC method proposed here presents a scalable alternative for obtaining eMPC policies for linear systems by employing principles of data-driven constrained differentiable programming. _3)_ _Approximate_ _Model_ _Predictive_ _Control:_ Targeting the scalability issues of eMPC, authors in the control community proposed aMPC [33], [34], [35], [36], [37] whose solution is based on supervised learning of control policies imitating the original MPC. An interesting theoretical connection was made by Karg and Lucia [38] showing that every piecewise affine (PWA) control policy can be exactly represented by a deep ReLU network [39]. This means that the optimality of the neural control policy will depend only on the quality of training data and formulation of the learning problem. However, the remaining disadvantage of aMPC is its inherent dependency on the solution of the original MPC problem. This article presents an alternative method for computing scalable explicit control policies for linear systems subject to nonlinear constraints. Our approach is based on differentiable programming and avoids the need for a supervisory MPC controller, as in the case of aMPC. aMPC methods alone do not provide performance guarantees, as in the case of implicit MPC. This limitation has previously been addressed either by involving optimality checks with backup controllers [40], projections of the control actions onto the feasible set [41], or by providing sampling-based probabilistic performance guarantees [42]. In this work, we adapt probabilistic performance guarantees as introduced in [42] in the context of unsupervised learning of the constrained control policies via the proposed DPC method. _4)_ _Safe_ _Learning-Based_ _Control:_ For imposing stability guarantees in deep learning-based control applications, one could employ data-driven methods based on learning Lyapunov function candidates for stable dynamics models and control policies as part of the neural architecture [8], [43], [44], constructing analytical Lyapunov functions [45], or attraction domain criteria [46]. Others [47] have employed semidefinite programming for safety verification and robustness analysis of feed-forward neural network control policies. Agrawal et al. [48] represented constrained optimization problems as implicit layers in deep neural networks, leading to the introduction of neural network policy architectures designed to handle predefined constraints [49], [50]. Peng et al. [51] proposed a novel proportional-integral Lagrangian method to handle hance constraints in RL setting. A conceptual idea of backpropagating through the learned system model parametrized via convex neural networks was investigated in [52]. Zhang et al. [53] and Ding et al. [54] studied the convergence of the PO with robustness guarantees in the context of constrained model-based RL. Others [55], [56] have recently proposed modifications of RL algorithms that can handle constrained-input systems. The proposed work falls in the category of domain-aware differentiable architectures that can handle both state and input constraints emerging in the MPC problem formulations. _5)_ _Differentiable_ _Model_ _Predictive_ _Control:_ In recent years, works [50], [57] have proposed differentiable MPC as safe imitation learning methods based on AD of the MPC or LQR optimization problems. In this context, the computed MPC sensitivities (i.e., backward gradients) are used in the gradient-based update rules to learn the unknown dynamics models and MPC objective functions of the controlled system from the sampled closed-loop data. Orthogonally, Zanon et al. [58] and Gros and Zanon [59] leveraged differentiable MPC as a policy approximation to provide safety guarantees in the context of RL algorithms. This is achieved by replacing deep neural network policy with an online MPC scheme whose parameters are tuned via RL updates based on the MPC sensitivities obtained via AD. Dong et al. [60] used neural-networks to reconstruct the unknown system dynamics and parameterize the critic network in the adaptive dynamic programming (ADP)-based nonlinear MPC scheme. Contrary to the methods mentioned above, the presented DPC method uses backward AD to compute the sensitivities of the MPC problem without the need for learning additional critic networks, or supervisory signals. II. DIFFERENTIABLE PREDICTIVE CONTROL We present a new perspective on solving pOCPs by leveraging the connection between parametric and differentiable programming. In particular, we introduce a DPC method based on representing the constrained optimal control problem as a differentiable program and using AD to obtain direct policy gradients for gradient-based optimization. The proposed model-based DPC methodology is illustrated in Fig. 1. As a first step, the system’s state-space model is obtained from Fig. 1. DPC method. system identification or physics-based modeling. Next, we construct a differentiable closed-loop system model by combining the state space model and neural control policy in a computational graph. Finally, the neural control policy is optimized via backpropagation of the gradients of the MPC objective function and constraints penalties, formulated as soft constraints, through the unrolled closed-loop system dynamics. _A._ _Differentiable_ _Predictive_ _Control_ _Problem_ _Formulation_ Compared to MPC, instead of directly optimizing for control actions u, the DPC problem is optimizing the learnable parameters, W, of a neural control policy _π_ W : R <sup>_nx_</sup> <sup>+</sup> <sup>_nξ_</sup> → R <sup>_nu_</sup>, i.e., an explicit mapping from system states x and parameters _ξ_ to control actions u . Beware of an unfortunate collision of terminology between the machine learning, optimization, and control communities here. Unlike policy parameters W, problem parameters _ξ_ is a set of loss function r, state constraint ph, input constraint pg, and system model parameters _θ_, that together with the initial conditions x 0 define the following pOCP: _B._ _Differentiable_ _Closed-Loop_ _System_ The core idea of DPC is parametrization of the closed-loop system composed of differentiable system dynamics model and neural control policy as shown in Fig. 1. One major difference between implicit MPC and DPC (1) is that the MPC solution returns an optimal sequence of the control actions U = u 0 _, . . .,_ u _N_ −1, while solving DPC yields optimized weights and biases W = { H 1 _, . . .,_ H _L,_ b 1 _, . . .,_ b _L_ } parametrizing the explicit neural control policy _π_ W : R <sup>_nx_</sup> <sup>+</sup> <sup>_nξ_</sup> → R <sup>_nu_</sup> given as _π_ W _(_ x _k,_ _ξ_ _k)_ = H _L_ z _L_ + b _L_ (2a) z _l_ = _σ_ _(_ H _l_ −1 z _l_ −1 + b _l_ −1 _)_ (2b) z 0 = [ x _k,_ _ξ_ _k_ ] (2c) where z _i_ are hidden states, H _i_, and b _i_ represent weights and biases of the _i_ th layer, respectively. The activation layer _σ_ : R <sup>_nz_</sup> → R <sup>_nz_</sup> is given as the element-wise application of a differentiable univariate function _σ_ : R → R. This article assumes a discrete-time nonlinear dynamical system model (1b). In a nominal case with z 0 = x _k_ we obtain a full state feedback formulation of the control problem (1), where the system model (1b) and control policy (1c) together define the closed-loop system dynamics as x _k_ +1 = f _θ_ _(_ x _k, π_ W _(_ x _k))._ (3) Here, the _N_ -step ahead rollout of the system (3) is conceptually equivalent to a single shooting formulation of the MPC problem [26]. Please note that in the extended case, we can consider the features of the policy to be augmented with vector _ξ_ _k_ = { r _k,_ ph _k,_ pg _k, θ_ } consisting of reference signals, state and input constraints parameters, as well as system model parameters. Thus allowing for generalization across model scenarios, tasks with full reference preview, and dynamic constraints handling capabilities as in the case of classical implicit MPC. _C._ _Differentiable_ _Loss_ _Function_ The proposed DPC method is an offline PO algorithm that requires an estimate of the expected values of the pOCP’s objective function (1a) and (1d) and (1e). For this purpose, we construct the Lagrangian of the pOCP (1) using well known penalty method. This allows us to compute the DPC loss _L_ DPC as weighted average of the Lagrangian by sampling _m_ -number scenarios of the initial conditions x <sup>_i_</sup> 0 <sup>∼</sup> <sup>_P_</sup> <sup>x</sup> 0 <sup>and</sup> <sup>problem</sup> min W E x 0∼ _P_ x0 _,_ _ξ_ _k_ ∼ _P_ _ξ_ - <sup>_N_</sup> - <sup>−1</sup> _k_ =0 _ℓ(_ x _k,_ u _k,_ r _k)_ + _pN(_ x _N)_ (1a) s.t. x _k_ +1 = f _θ_ _(_ x _k,_ u _k),_ _k_ ∈ N0 <sup>_N_</sup> <sup>−1</sup> (1b) u _k_ = _π_ W _(_ x _k,_ _ξ_ _k)_ (1c) _h(_ x _k,_ ph _k)_ ≤ 0 (1d) _g(_ u _k,_ pg _k)_ ≤ 0 (1e) x 0 ⊂ R <sup>_nx_</sup> _,_ _ξ_ _k_ = { r _k,_ ph _k,_ pg _k, θ_ } ⊂ R <sup>n</sup> <sup>_ξ_</sup> _._ (1f) Here, _N_ represents a prediction horizon, and _k_ is a discrete time step. The loss function terms are the parametric MPC objective _ℓ_ : R <sup>_nx_</sup> <sup>+</sup> <sup>_nu_</sup> <sup>+</sup> <sup>_nr_</sup> → R with terminal penalty term, _pN_ : R <sup>_nx_</sup> → R, to promote stability of the underlying MPC problem. The parametric state and input constraints are given via (1d), and (1e), respectively. The formulation (1) implemented as a differentiable program allows us to obtain a data-driven solution of the corresponding parametric programming problem by differentiating the loss function (1a) backwards through the parametrized closed-loop dynamics given by the system model (1b) and neural control policy (1c). This formulation allows one to use the SGD and its variants to minimize the loss function (1a) over the initial conditions and problem parameters sampled from distributions _P_ x 0, and _P_ _ξ_, respectively. In the following paragraphs, we elaborate on key components of the proposed DPC problem formulation (1). The first term of the differentiable Lagrangian loss function _L_ DPC represents the main performance metric and can be defined, for instance, as a reference tracking term _ℓ(_ x _k,_ u _k,_ r _k)_ = || x _k_ - r _k_ || <sup>2</sup> 2 <sup>+ ||</sup> <sup>u</sup> <sup>_k_</sup> <sup>||</sup> 2 <sup>2</sup> (5) scenarios of the initial conditions x <sup>_i_</sup> 0 <sup>∼</sup> <sup>_P_</sup> <sup>x</sup> 0 <sup>and</sup> <sup>problem</sup> parameters _ξ_ <sup>_i_</sup> _k_ <sup>= {</sup> <sup>r</sup> _k_ <sup>_i_</sup> <sup>_,_</sup> <sup>ph</sup> <sup>_i_</sup> _k_ <sup>_,_</sup> <sup>pg</sup> _k_ <sup>_i_</sup> <sup>_, θ_</sup> <sup>_i_</sup> <sup>} ∼</sup> <sup>_P_</sup> <sup>_ξ_</sup> <sup>,</sup> <sup>given</sup> <sup>as</sup> x <sup>_i_</sup> _k_ <sup>_i_</sup> _k_ <sup>= {</sup> <sup>r</sup> _k_ <sup>_i_</sup> <sup>_i_</sup> _k_ <sup>_,_</sup> <sup>pg</sup> _k_ <sup>_i_</sup> - _N_ −1 _k_ <sup>_i_</sup> <sup>_,_</sup> <sup>ph</sup> <sup>_i_</sup> _k_ _k_ <sup>_i_</sup> <sup>_, θ_</sup> <sup>_i_</sup> <sup>} ∼</sup> <sup>_P_</sup> <sup>_ξ_</sup> <sup>,</sup> <sup>given</sup> <sup>as</sup> - _Qlℓ_ <sup>_i_</sup> _k_ <sup>_,_</sup> <sup>u</sup> <sup>_i_</sup> _k_ <sup>_i_</sup> _k_ <sup>_,_</sup> <sup>r</sup> <sup>_i_</sup> _k_ <u>1</u> _L_ DPC = _mN_ - _m_ _i_ =1 _k_ _k_ =0 <sup>_i_</sup> _k_ <sup>_,_</sup> <sup>ph</sup> _k_ <sup>_i_</sup> + _Qhpx(h(_ x <sup>_i_</sup> _k_ _k_ <sup>_i_</sup> <sup>_))_</sup> <sup>_i_</sup> _k_ <sup>_,_</sup> <sup>pg</sup> <sup>_i_</sup> _k_ _k_ x <sup>_i_</sup> _N_ _._ (4) + _Qgpu_ _g_ u <sup>_i_</sup> _k_ ��� + _QNpN_ parametrized by r _k_ . The constraints terms correspond to penalty functions [61], [62] imposed on state and control action constraints parametrized by ph _k_, and pg _k_, respectively. Specifically, the parametric constraints penalties are _px(h(_ x _k,_ ph _k))_ = <sup><u>1</u></sup> ||ReLU _(h(_ x _k,_ ph _k))_ ||2 (6a) _nh_ _pu(g(_ u _k,_ pg _k))_ = <sup><u>1</u></sup> ||ReLU _(g(_ u _k,_ pg _k))_ ||2 (6b) _ng_ with ReLU : R → R standing for rectifier linear unit function, _nh_ and _ng_ define the total number of state and input constraints. The relative importance of the individual terms is tuned by weight factors _Ql_, _Qh_, _Qg_, and _QN_ . The terminal penalty term _pN(_ x _N)_ in the DPC problem formulation (1) is a commonly used ingredient to guarantee recursive feasibility and closed-loop stability of MPC and can be designed based on a wide range of methods from [63], [64], [65], [66], [67], and [68]. _Assumption_ _1:_ The system dynamics model (1b), parametric control objective function _ℓ(_ x _k,_ u _k,_ r _k)_, state and input constraints penalties _px(h(_ x _k,_ ph _k))_ and _pu(g(_ u _k,_ pg _k))_, and terminal penalty term _pN(_ x _N)_ are differentiable at almost every point in their domain. We assume zero gradients at points where the functions are not differentiable. _D._ _Differentiable_ _Predictive_ _Control_ _Policy_ _Gradients_ A main advantage of having a differentiable closed-loop dynamics model, control objective function, constraints, and terminal penalties is that it allows us to use AD (backpropagation through time [69]) to directly compute the policy gradient. In particular, by representing the problem (1) as a computational graph and leveraging the chain rule, we can directly compute the gradients of the loss function _L_ DPC w.r.t. the policy parameters W . For a simplicity of exposure lets consider the case with _m_ = 1 and _N_ = 1 with corresponding gradients defined as follows: <sup><u>x</u></sup> <sup>_,_</sup> <sup><u>u</u></sup> <sup>_,_</sup> <sup><u>r</u></sup> <sup>_)_</sup> + <sup>_∂px(h(_</sup> <sup><u>x</u></sup> <sup>_,_</sup> <sup><u>ph</u></sup> <sup>_))_</sup> _∂_ W _∂_ W ∇ W _L_ DPC = <sup>_∂ℓ(_</sup> <sup><u>x</u></sup> <sup>_,_</sup> <sup><u>u</u></sup> <sup>_,_</sup> <sup><u>r</u></sup> <sup>_)_</sup> + <sup>_∂pu(g(_</sup> <sup>u</sup> <sup>_,_</sup> <sup>pg</sup> <sup>_))_</sup> _∂_ W _∂_ W <sup>_g(_</sup> <sup>u</sup> <sup>_,_</sup> <sup>pg</sup> <sup>_))_</sup> + <sup>_∂pN(_</sup> <sup><u>x</u></sup> <sup>_<u>N)</u>_</sup> _∂_ W _∂_ W _∂∂_ Wu <sup>+</sup> <sup>_∂ℓ(_</sup> <sup><u>x</u></sup> _∂_ <sup>_,_</sup> u <sup><u>u</u></sup> <sup>_,_</sup> <sup><u>r</u></sup> <sup>_)_</sup> _∂_ u _∂_ <u>u</u> _∂_ W = <sup>_∂ℓ(_</sup> <sup><u>x</u></sup> <sup>_,_</sup> <sup><u>u</u></sup> <sup>_,_</sup> <sup><u>r</u></sup> <sup>_)_</sup> _∂_ <u>x</u> _∂_ u _∂_ x _∂_ <u>u</u> _∂_ W _∂∂_ Wu <sup>+</sup> <sup>_∂pu(g_</sup> _∂_ <sup>_(_</sup> <sup>u</sup> u <sup>_,_</sup> <sup>pg</sup> <sup>_))_</sup> _∂_ u + <sup>_∂px(h(_</sup> <sup><u>x</u></sup> <sup>_,_</sup> <sup><u>ph</u></sup> <sup>_))_</sup> _∂_ <u>x</u> _∂_ u _∂_ x _∂_ <u>x</u> _∂_ u _∂_ <u>u</u> _∂_ W <sup>_._</sup> (7) <u>Algorithm</u> <u>1</u> <u>DPC</u> <u>Offinel</u> <u>PO</u> 1: input training datasets of initial conditions and problem parameters sampled from distributions _P_ x 0 and _P_ _ξ_ 2: input system dynamics model x _k_ +1 = f _θ_ _(_ x _k,_ u _k)_ 3: input neural policy architecture _π_ W _(_ x _k,_ _ξ_ _k)_ 4: input DPC loss _L_ DPC (4) 5: input optimizer O 6: differentiate DPC loss _L_ DPC (4) to obtain the policy gradient ∇ W _L_ DPC (7) 7: learn policy weights W via optimizer O using gradient ∇ W _L_ DPC 8: return optimized policy _π_ W _(_ x _k,_ _ξ_ _k)_ window. Optionally, the problem parameters could include system dynamics model parameters _θ_ representing system model uncertainties. The simplest choice of _P_ x 0 and _P_ _ξ_ is to use the uniform distribution. Alternatively, the distribution of the training data can be obtained from measured trajectories of the controlled system or specified by a domain expert. Now combining the individual components, the DPC PO algorithm is summarized in Algorithm 1. The system dynamics model and control policy architecture are required to instantiate the computational graph of the DPC problem (1). The policy gradients ∇ W _L_ DPC are obtained by differentiating the DPC loss function _L_ DPC over the distribution of initial state conditions and problem parameters sampled from given distributions. The computed policy gradients now allow us to perform direct PO via a gradient-based optimizer O. The presented algorithm introduces a generic approach for a datadriven solution of model-based pOCP (1). III. PROBABILISTIC STABILITY AND CONSTRAINT SATISFACTION In this section, we present a probabilistic verification method for closed-loop stability and constraint satisfaction guarantees of the proposed DPC PO Algorithm 1. In particular, we modify the probabilistic verification method developed by [42] in the context of aMPC method. We first consider the following assumptions. _Assumption_ _2:_ There exists a local Lyapunov function _V(_ x _)_, an invariant terminal set _XN_, and feasible terminal control law K _(_ x _)_, such that ∀ x ∈ _XN_ the following holds: _Vf (_ f _θ_ _(_ x _,_ K _(_ x _)))_ ≤ _Vf (_ x _)._ (8) _Remark_ _1:_ In practice, the condition of Assumption 2 can be satisfied by designing a stabilizing LQR controller given the system dynamics xk + 1 = Axk + Bu _k_ linearized at the operating point x ∈ _XN_ . In standard MPC, the terminal control law K _(_ x _)_ is typically combined with terminal cost function _pN(_ x _N)_ to guarantee the closed-loop stability by showing the optimal cost function is a Lyapunov function [63], [64], [65], [66], [67], [68]. _A._ _Performance_ _Indicator_ _Functions_ Inspired by [42] and [72], our probabilistic validation method is based on the closed-loop system (3) rollouts + <sup>_∂pN(_</sup> <sup><u>x</u></sup> <sup>_<u>N)</u>_</sup> _∂_ x The advantage of having gradients (7) is that it allows us to use the SGD algorithms, such as AdamW [70], to solve the corresponding pOCP (1). In practice, we can compute the gradient of the DPC problem by using AD frameworks, such as Pytorch [71]. _E._ _Offline_ _DPC_ _Policy_ _Optimization_ _Algorithm_ First, we sample the initial conditions of the problem x 0 ∼ _P_ x 0 . Next, we sample the problem parameters _ξ_ <sup>_i_</sup> _k_ <sup>=</sup> <sup>{</sup> <sup>r</sup> _k_ <sup>_i_</sup> <sup>_,_</sup> <sup>ph</sup> <sup>_i_</sup> _k_ <sup>_,_</sup> <sup>pg</sup> _k_ <sup>_i_</sup> <sup>}</sup> <sup>∼</sup> <sup>_P_</sup> <sup>_ξ_</sup> <sup>over</sup> <sup>an</sup> <sup>_N_</sup> <sup>-step</sup> <sup>prediction</sup> <sup>horizon</sup> <sup>_i_</sup> _k_ <sup>=</sup> <sup>{</sup> <sup>r</sup> _k_ <sup>_i_</sup> <sup>_i_</sup> _k_ <sup>_,_</sup> <sup>pg</sup> _k_ <sup>_i_</sup> _k_ <sup>_i_</sup> <sup>_,_</sup> <sup>ph</sup> <sup>_i_</sup> _k_ _k_ <sup>_i_</sup> <sup>}</sup> <sup>∼</sup> <sup>_P_</sup> <sup>_ξ_</sup> <sup>over</sup> <sup>an</sup> <sup>_N_</sup> <sup>-step</sup> <sup>prediction</sup> <sup>horizon</sup> defined as <sup>_i_</sup> 0 <sup>∈</sup> <sup>X</sup> <sup>_,_</sup> <sup>s</sup> <sup>_._</sup> <sup>t</sup> <sup>_._</sup> <sup>_(_</sup> <sup>3</sup> <sup>_)_</sup> _._ (9) Algorithm 2 Closed-Loop Stability and Constraint <u>Satisfaction</u> <u>Validation</u> <u>of</u> <u>DPC</u> <u>PO</u> <u>Algorithm</u> 1: input stability and constraints indicator functions (10) 2: input confidence _δ_ and admissible risk bound _μ_ bound 3: input sampling parameters _m_, _m_ max, _p_ 4: sample _m_ IID initial conditions x <sup>_i_</sup> 0 <sup>∼</sup> <sup>_P_</sup> <sup>x</sup> 0 <sup>_,_</sup> <sup>_i_</sup> <sup>∈</sup> <sup>N</sup> 1 <sup>_m_</sup> 5: train DPC neural policy via Algorithm 1 on sampled initial conditions from step 4 6: rollout closed-loop system (3) over _N_ steps for each initial condition x <sup>_i_</sup> 0 <sup>to</sup> <sup>obtain</sup> <sup>state</sup> <sup>trajectories</sup> <sup>X</sup> <sup>_i_</sup> X <sup>_i_</sup> = x <sup>_i_</sup> <sup>_i_</sup> 0 <sup>_, . . .,_</sup> <sup>x</sup> <sup>_i_</sup> _N_ <sup>:</sup> <sup>x</sup> <sup>_i_</sup> 0 Here, _i_ is an index of the simulated trajectory, and X represents a set of sampled initial conditions. For performance assessment, we define stability _Is(_ X <sup>_i_</sup> _)_ and constraint satisfaction _Ic(_ X <sup>_i_</sup> _)_ indicator functions as _Is(_ X <sup>_i_</sup> _)_ = _Ic(_ X <sup>_i_</sup> _)_ = 1 _,_ x <sup>_i_</sup> _N_ <sup>∈</sup> <sup>_Xf,_</sup> <sup>for</sup> <sup>x</sup> <sup>_N_</sup> <sup>∈</sup> <sup>X</sup> <sup>_i_</sup> (10b) 0 _,_ otherwise _._ (10a) 0 _,_ otherwise <sup>_i_</sup> 0 <sup>to</sup> <sup>obtain</sup> <sup>state</sup> <sup>trajectories</sup> <sup>X</sup> <sup>_i_</sup> - 1 _,_ if x ∈ _X_ _,_ _π_ W _(_ x _)_ ∈ _U_ ∀ x ∈ X _i_ 7: evaluate indicator functions (10) for each X <sup>_i_</sup> The proposed indicator functions (10) indicate whether the learned control policy _π_ W _(_ x _k)_ generates state trajectories that satisfy given stability conditions (10a), without violating state and input constraints (10b), respectively. For this purpose, we define the risk as _μ_ := P[ _Is(_ X <sup>_i_</sup> _)_ = 1 & _Ic(_ X <sup>_i_</sup> _)_ = 1], where _μ_ = 1 implies the stability and constraints are satisfied for 100% of sampled trajectories (9), conversely, _μ_ = 0 implies that all sampled scenarios violate either constraints or stability. _Remark_ _2:_ The advantage of the proposed DPC problem formulation (1) in comparison with aMPC scheme [42] is that it allows us to define direct performance indicator functions (10) based on known constraints and closed-loop system dynamics (3). While in [42], the indicator functions are based on the approximation error of the control policy trained via imitation learning supervised by the original MPC. _B._ _Probabilistic_ _Guarantees_ We can now use the indicator functions (10) to empirically validate the set of _m_ trajectories X <sup>_i_</sup> _,_ _i_ ∈ N <sup>_m_</sup> 1 <sup>,</sup> <sup>with</sup> <sup>sampled</sup> independent and identically distributed (IID) initial conditions x <sup>_i_</sup> 0 <sup>∼</sup> <sup>_P_</sup> <sup>x</sup> 0 <sup>.</sup> <sup>For</sup> <sup>this</sup> <sup>purpose,</sup> <sup>we</sup> <sup>define</sup> <sup>the</sup> <sup>empirical</sup> <sup>risk</sup> <sup>as</sup> _μ_ ˜ = <sup><u>1</u></sup> _m_ - _m_ _i_ =1 _(Is(_ X <sup>_i_</sup> _)Ic(_ X <sup>_i_</sup> _))._ (11) Similar to [42], we use the Hoeffding’s inequality [73] to estimate the true risk _μ_ from the empirical risk _μ_ ˜ . Hoeffding’s inequality implies that the probability of the sampled trajectories X <sup>_i_</sup> satisfying the indicator functions (10) is larger than the empirical risk _μ_ ˜ minus the user-defined risk tolerance _ϵ_ with confidence 1 − _δ_, or more compactly P[ _Is(_ X <sup>_i_</sup> _)_ = 1 & _Ic(_ X <sup>_i_</sup> _)_ = 1] = _μ_ ≥˜ _μ_ - _ϵ_ . Thus as given in [42], for a chosen confidence _δ_ and _m_ samples, we obtain the following formula to calculate the worst-case empirical risk _μ_ wc: 8: evaluate empirical risk (11) and worst case risk (12) 9: if _μ_ wc ≤ _μ_ bound then 10: increase number of samples _m_ : = _m_ + _p_ 11: if _m_ ≥ _m_ max then 12: validation failed, terminate procedure 13: else repeat from step 4 14: else validation passed, terminate procedure _Theorem_ _1:_ Let Assumption 2 hold. Construct the DPC problem (1) with the given system dynamics model. Initialize and run Algorithm 2 with chosen hyperparameters _δ_, _μ_ bound, _m_, _m_ max, and _p_ . If Algorithm 2 terminates with the validation procedure passed, then with the confidence of 1− _δ_ the trained control policy satisfies closed-loop stability and constraint satisfaction for sampled initial conditions with admissible risk _μ_ bound. _Proof:_ If Algorithm 2 terminates with validation procedure passed, then (12) must hold, then through Hoeffding’s inequality it holds that P[ _Is(_ X <sup>_i_</sup> _)_ = 1 & _Ic(_ X <sup>_i_</sup> _)_ = 1] ≥ _μ_ bound with confidence of 1− _δ_ . Or in other words, reaching the terminal set _Xf_ while satisfying state and input constraints is guaranteed at minimum for _μ_ bound portion of samples with 1− _δ_ confidence. Thanks to Assumption 2 convergence to the terminal set _Xf_ now implies closed-loop stability (8). IV. NUMERICAL CASE STUDIES This section presents simulation results on five example systems demonstrating the capabilities of the DPC PO algorithm to 1) learn to stabilize unstable linear systems; 2) learn to control systems with multiple inputs and outputs; and 3) satisfy state and input constraints. Furthermore, we demonstrate superior sampling efficiency compared to model-free RL algorithms, faster online execution compared to implicit MPC, and smaller memory footprint and better scalability compared to eMPC. The presented experiments are implemented in Pytorch-based toolbox NeuroMANCER [10] and are available on Github. <sup>1</sup> All experiments in this section were performed on a laptop with 2.60-GHz Intel i7-8850H CPU and 16-GB RAM on a 64-bit operating system. All examples using DPC PO Algorithm 1 are optimized with AdamW [70] optimizer. 1https://github.com/pnnl/deps_arXiv2020 _μ_ wc = _μ_ ˜ - _ϵ_ = _μ_ ˜ <u>2</u> - <sup>ln</sup> 2 _m_ <sup>_<u>δ</u>_</sup> <sup>_._</sup> (12) Now using the condition (12) we can compute the worst-case bound for the true risk as _μ_ ≥ _μ_ wc. Hence, higher-empirical risk value _μ_ ˜, more samples _m_, and lower-confidence _δ_, imply higher-worst-case risk value _μ_ wc, which implies tighter bound on true risk _μ_ . This allows us to define the following closedloop performance validation Algorithm 2. Finally, we can formalize the stability guarantees for DPC PO Algorithm 1 via Theorem 1 inspired by [42]. _A._ _Example_ _1—Stabilizing_ _Unstable_ _Double_ _Integrator_ Here, we demonstrate the capabilities of DPC to learn a stabilizing neural feedback policy for an unstable system with known dynamics. We control the unstable double integrator �1 _._ 0 0 _._ 5 u _k._ (13) x _k_ +1 = �1 _._ 2 1 _._ 0 0 _._ 0 1 _._ 0 x _k_ + Subject to state and input constraints given as x _k_ ∈ _X_ := { x | −10 ≤ _x_ ≤ 10}, and u _k_ ∈ _U_ := { u | −1 ≤ _u_ ≤ 1}, respectively. For the DPC PO, we consider the following objective: <sup>2</sup> _Qx_ <sup>+ ||</sup> <sup>u</sup> _k_ <sup>_i_</sup> Fig. 2. Surfaces of PWA eMPC policy (left) and neural DPC policy (right) for double integrator system (13). Fig. 3. Closed-loop trajectories of system (13) controlled by stabilizing neural feedback policy trained using Algorithm 1 with DPC problem formulation (1), including terminal constraint x _N_ ∈ _Xf_ . Fig. 4. DPC loss function (4) on the left, and on the right, regions with contractive (blue) and divergent (red) dynamics plotted over state space of a double integrator system (13) controlled by stabilizing neural feedback policy trained using DPC Algorithm 1. balancing. The nonlinear ordinary differential equation (ODE) model <sup>2</sup> has the following form: || x <sup>_i_</sup> _k_ _N_ �−1 _k_ =0 <u>1</u> _L_ DPC = _mN_ - _m_ _i_ =1 <sup>_i_</sup> _k_ <sup>||2</sup> _Q_ _k_ <sup>_i_</sup> <sup>||2</sup> _Q_ _Qu_ _._ (14) As a benchmark we synthesize an eMPC policy solved with classical multiparametric programming solver using MPT3 toolbox [74] with prediction horizon of _N_ = 10, and weights _Qx_ = 1, _Qu_ = 1, for whose the surface is shown on the left in Fig. 2. _1)_ _Training:_ In the case of DPC, we learn a full state feedback neural policy u _k_ = _π_ W _(_ x _k)_ in the closed-loop system (3) via Algorithm 1 for whose the surface is shown on the right in Fig. 2. A side by side comparison in Fig. 2 shows almost identical control surfaces of compared policies. For the DPC policy training we used the MPC loss function (14) subject to state x _k_ ∈ _X_, input u _k_ ∈ _U_, as well as terminal set constraints x _N_ ∈ _Xf_ := { x | −0 _._ 1 ≤ _x_ ≤ 0 _._ 1}. All constraints are implemented using penalties (6) with weights _Qh_ = 10, _Qg_ = 100, _QN_ = 1, while for the control objective (14) we consider prediction horizon _N_ = 1, and weights _Qx_ = 5, _Qu_ = 0 _._ 5. We train the neural policy (2) _π_ W _(_ x _)_ : R <sup>2</sup> → R with 4 layers, 20 hidden states, with bias, and ReLU activation functions. We use a training set of 3333 normally sampled initial conditions x 0 fully covering the admissible set _X_ . _2)_ _Closed-Loop_ _Performance:_ Fig. 3 shows resulting converging trajectories of the closed-loop system dynamics controlled by a stabilizing neural policy learned using DPC formulation with terminal constraints. Finally, on the left hand side of Fig. 4 we visualize the DPC loss function (4) (left) for a trained policy over a state space to demonstrate that it is indeed a Lyapunov function. While on the right of Fig. 4 we evaluate the contraction constraint (15) showing state space regions with contractive _α_ _<_ 1 (blue) and diverging _α_ _>_ 1 (red) dynamics || x _k_ +1|| _p_ ≤ _α_ || x _k_ || _p,_ _α_ _<_ 1 _._ (15) _B._ _Example_ _2—Reference_ _Tracking_ _of_ _Two_ _Tank_ _System_ We consider a canonical nonlinear control problem, a system of two connected tanks controlled by a single pump and a two way valve. The system is a simplified model of a pumped-storage hydroelectricity which is a type of hydroelectric energy storage used by electric power systems for load _<u>dh</u>_ <u>1</u> _dt_ <sup>=</sup> <sup>_c_</sup> <sup>1</sup> <sup>_(_</sup> <sup>1</sup> <sup>_._</sup> <sup>0 −</sup> <sup>_v)_</sup> <sup>_p_</sup> <sup>−</sup> <sup>_c_</sup> <sup>2</sup> _<u>dh</u>_ <u>2</u> _dt_ <sup>=</sup> <sup>_c_</sup> <sup>1</sup> <sup>_vp_</sup> <sup>+</sup> <sup>_c_</sup> <sup>2</sup> ~~�~~ _h_ 1 − _c_ 2 ~~�~~ _h_ 1 (16a) ~~�~~ 2 _h_ 2 (16b) With system states _h_ 1, and _h_ 2 representing levels of liquid in tank 1 and 2, respectively. Control actions are pump modulation _p_, and valve opening _v_ . The ODE system is parametrized by inlet and outlet valve coefficients _c_ 1 and _c_ 2. We solve the continuous-time system model (16) by using a 2https://apmonitor.com/do/index.php/Main/LevelControl 4th order Runge–Kutta ODE solver obtaining a discretized system that can be represented in a compact form as x _k_ +1 = ODESolve _(_ f _(_ x _k,_ u _k))_ (17) with system states x = [ _h_ 1 _, h_ 2] and control actions u = [ _p, v_ ]. In general, there are two ways to differentiate through the system model solved with the ODE solver (17). The first is to use the backpropagation through time algorithm [69] by unrolling the operations of the ODE solver and using AD to compute its gradients. The second, is to use adjoint method as in the case of neural ODEs [75]. _1)_ _Training:_ The objective is to control the tank levels into desired time-varying reference values by modulating the pump and valve control actions, subject to state and input constraints. We use the DPC PO Algorithm 1 to learn the explicit neural control policy by solving the following parametric nonlinear optimal control problem: _k_ <sup>_i_</sup> <sup>||2</sup> 2 <sup>2</sup> 2 + _QN_ || x <sup>_i_</sup> <sup>_i_</sup> _N_ <sup>−</sup> <sup>r</sup> <sup>_i_</sup> _N_ <sup>_i_</sup> <sup>||2</sup> 2 <sup>2</sup> 2 <sup>(18a)</sup> Fig. 5. Closed-loop trajectories of the two tank system controlled by neural policy trained offline using DPC PO Algorithm 1. x _k_ ∈ R <sup>12</sup>, and four control inputs u _k_ ∈ R <sup>4</sup> . Our objective is to track the reference with the 3-rd state representing the controlled output y _k_ ∈ R, and stabilize rest of the states, while satisfying state and input constraints. _1)_ _Training:_ To optimize the policy, we use Algorithm 1 with 30 000 samples of feasible normally distributed initial conditions, where we use 10 000 samples for train, validation, and test set, respectively. We consider the DPC problem with sampled quadratic control objective min W - _m_ - <sup>_N_</sup> - <sup>−1</sup> _i_ =1 _k_ =1 _Qx_ || x <sup>_i_</sup> _k_ <sup>_i_</sup> _k_ <sup>−</sup> <sup>r</sup> _k_ <sup>_i_</sup> s.t. x <sup>_i_</sup> _k_ <sup>_i_</sup> _k_ +1 <sup>= ODESolve</sup> <sup>_(_</sup> <sup>f</sup> <sup>_(_</sup> <sup>x</sup> _k_ <sup>_i_</sup> _k_ <sup>_i_</sup> <sup>_,_</sup> <sup>u</sup> <sup>_i_</sup> _k_ <sup>_i_</sup> _k_ <sup>_))_</sup> (18b) u <sup>_i_</sup> <sup>_i_</sup> _k_ <sup>=</sup> <sup>_π_</sup> <sup>W</sup> <sup>_(_</sup> <sup>x</sup> _k_ <sup>_i_</sup> _k_ <sup>_i_</sup> <sup>_,_</sup> <sup>R</sup> <sup>_i)_</sup> (18c) 0 ≤ x <sup>_i_</sup> _k_ <sup>≤</sup> <sup>1</sup> (18d) 0 ≤ u <sup>_i_</sup> _k_ <sup>≤</sup> <sup>1</sup> (18e) x <sup>_i_</sup> 0 <sup>_i_</sup> 0 <sup>∼</sup> <sup>_Px_</sup> 0 (18f) R <sup>_i_</sup> = [ r <sup>_i_</sup> <sup>_i_</sup> 1 <sup>_, . . .,_</sup> <sup>r</sup> _N_ <sup>_i_</sup> <sup>] ∼</sup> <sup>_PR._</sup> (18g) The objective function is to minimize the reference tracking error || x <sup>_i_</sup> _k_ <sup>−</sup> <sup>r</sup> _k_ <sup>_i_</sup> <sup>||2</sup> 2 <sup>over</sup> <sup>the prediction</sup> <sup>horizon</sup> <sup>_N_</sup> <sup>= 50 weighted</sup> _N_ �−1 _k_ =0 _k_ <sup>_i_</sup> <sup>||2</sup> _Q_ - _m_ _i_ =1 || y <sup>_i_</sup> <sup>2</sup> _Qr_ <sup>+ ||</sup> <sup>x</sup> _k_ <sup>_i_</sup> _k_ <sup>_i_</sup> <sup>||2</sup> _Q_ _Qx_ <sup>_i_</sup> _k_ <sup>−</sup> <sup>r</sup> _k_ <sup>_i_</sup> _k_ <sup>_i_</sup> <sup>||2</sup> 2 error || x <sup>_i_</sup> _k_ <sup>−</sup> <sup>r</sup> _k_ <sup>_i_</sup> <sup>||2</sup> 2 <sup>over</sup> <sup>the prediction</sup> <sup>horizon</sup> <sup>_N_</sup> <sup>= 50 weighted</sup> by a scalar _Qx_ = 5, including terminal penalty weighted by _QN_ = 10. The parametric neural control policy is given by _π_ W _(_ x <sup>_i_</sup> _k_ <sup>_,_</sup> <sup>R</sup> <sup>_i)_</sup> <sup>.</sup> <sup>The</sup> <sup>neural</sup> <sup>control</sup> <sup>policy</sup> <sup>is</sup> <sup>optimized</sup> <sup>over</sup> <u>1</u> _L_ DPC = _mN_ <sup>_i_</sup> _k_ <sup>−</sup> <sup>r</sup> _k_ <sup>_i_</sup> (19) by _π_ W _(_ x <sup>_i_</sup> _k_ <sup>_,_</sup> <sup>R</sup> <sup>_i)_</sup> <sup>.</sup> <sup>The</sup> <sup>neural</sup> <sup>control</sup> <sup>policy</sup> <sup>is</sup> <sup>optimized</sup> <sup>over</sup> problem parameters sampled from the distributions _Px_ 0, and _PR_, for state initial conditions and references, respectively. Specifically, we sample 2000 scenarios with uniformly distributed initial conditions and a random sequence of desired references with prediction horizon _N_ = 50. The state (18d) and input (18e) constraints are transformed into penalties with weights _Qh_ = 10, _Qg_ = 10, respectively. We train the neural policy _π_ W _(_ x _k,_ R _)_ : R <sup>_nx_</sup> <sup>+</sup> <sup>_Nnr_</sup> → R <sup>_nu_</sup> with 2 layers, 32 hidden states, with bias, and GeLU activation functions, where _nx_ = 2, _nr_ = 2, _nu_ = 2, and _N_ = 50 being number of states, references, control actions, and prediction horizon steps, respectively. _2)_ _Closed-Loop_ _Performance:_ In Fig. 5 we show the closed-loop reference tracking control performance using the neural control policy trained offline using the DPC PO Algorithm 1. We demonstrate that the neural DPC policy can reliably control nonlinear dynamical system with time-varying reference, while satisfying state and input constraints. _C._ _Example_ _3—Tracking_ _Control_ _of_ _Quadcopter_ _Model_ In this example, we demonstrate scalability of DPC to larger systems using a linear quadcopter model <sup>3</sup> with twelve states 3https://osqp.org/docs/examples/mpc.html using prediction horizon _N_ = 10, and weights _Qr_ = 20, _Qx_ = 5. The system is subject to state and input constraints x _k_ ∈ _X_ := { x | −10 ≤ _x_ ≤ 10}, and u _k_ ∈ _U_ := { u | −1 _._ 0 ≤ _u_ ≤ 2 _._ 5}, with constraints penalty weights _Qh_ = 1 _,_ _Qg_ = 2, respectively. To promote the stability of the closed-loop system during training, we consider the contraction constraint (15) with scaling factor _α_ = 0 _._ 8 and penalty weight _Qc_ = 1. We train the full state feedback neural policy (2) _π_ W _(_ x _)_ : R <sup>12</sup> → R <sup>_N_</sup> <sup>×4</sup> with 2 layers, 100 hidden states, and ReLU activation functions. In the closed-loop simulations, we use RHC to use only the first predicted control action. _2)_ _Closed-Loop_ _Performance:_ Fig. 6 plots the closed-loop control performance of the quadcopter model controlled with the trained full state feedback neural policy. We demonstrate that the trained DPC policy can simultaneously track the desired reference, and stabilize the selected states while satisfying state and input constraints. From the computational perspective, in Table I we compare the online computational time associated with the evaluation of the trained DPC policy compared against the implicit MPC in the quadratic form implemented in CVXPY [76] and solved with the OSQP solver [77]. We report on average almost two orders of magnitude speedup in the maximum and mean evaluation time compared to the online optimization solver. Due to the large state dimensions, the presented Fig. 6. Closed-loop trajectories of the quadcopter system controlled by DPC policy trained via Algorithm 1 using control objective (19) and constraints penalties (6), including contraction constraint (15). TABLE I COMPARISON OF ONLINE COMPUTATIONAL TIME OF THE PROPOSED DPC POLICY AGAINST IMPLICIT MPC SOLVED WITH OSQP problem is not feasible with traditional parametric programming solvers. Thus by solving this problem, we demonstrate the scalability of the proposed DPC method beyond the limitations of eMPC while providing significant speedups compared to the online state-of-the-art convex optimization solver. _D._ _Example_ _4—Parametric_ _Obstacle_ _Avoidance_ _Problem_ In this example, we demonstrate handling parametric nonlinear constraints for obstacle avoidance problem by learning parametric neural policies using DPC PO Algorithm 1. We consider the double integrator system Fig. 7. Trajectories in different parametric scenarios of the obstacle avoidance problem (21) computed online using IPOPT and offline using DPC PO Algorithm 1. TABLE II COMPARISON OF ONLINE COMPUTATIONAL TIME OF THE PROPOSED DPC POLICY AND IMPLICIT MPC SOLVED WITH IPOPT _k_ <sup>_i_</sup> <sup>||2</sup> _Q_ <sup>2</sup> _Qdu_ <sup>+ ||</sup> <sup>x</sup> <sup>_i_</sup> _N_ <sup>_i_</sup> <sup>−</sup> <sup>r</sup> <sup>_i_</sup> _N_ <sup>_i_</sup> <sup>||2</sup> _Q_ _Qr_ + _N_ �−2 _k_ =0 || u <sup>_i_</sup> <sup>_i_</sup> _k_ +1 <sup>−</sup> <sup>u</sup> _k_ <sup>_i_</sup> (22) �1 _._ 0 0 _._ 0 0 _._ 0 1 _._ 0 u _k_ (20) where the first term penalizes the terminal state condition with parametric reference r _N_, the second term penalizes the energy used in control actions, while the third and fourth terms represent control action and state smoothing penalties. For scaling the control objective terms we use following weight factor values _Qr_ = 1 _._ 0, _Qdx_ = 1 _._ 0, _Qdu_ = 10 _._ 0, _Qu_ = 10 _._ 0, and we use _Qh_ = 100 _._ 0 for state constraint penalties that include the obstacle avoidance constraint (21) and box constraints on states and control actions. For datasets we sample 30 000 uniformly distributed initial state conditions x <sup>_i_</sup> 0 <sup>,</sup> <sup>constraints</sup> <sup>parameters</sup> <sup>_pi_</sup> <sup>,</sup> <sup>_bi_</sup> <sup>,</sup> <sup>_ci_</sup> <sup>,</sup> <sup>_di_</sup> <sup>,</sup> <sup>and</sup> <sup>terminal</sup> <sup>state</sup> references r <sup>_i_</sup> _N_ <sup>,</sup> <sup>and</sup> <sup>use</sup> <sup>one</sup> <sup>third</sup> <sup>of</sup> <sup>data</sup> <sup>for</sup> <sup>train,</sup> <sup>validation,</sup> and test set, respectively. _2)_ _Optimal_ _Control_ _Performance:_ The obstacle constraint (21) casts the overall pOCP (1) to be nonlinear. Hence for the comparison, we implement the implicit MPC with nonlinear constraints in the CasADi framework [78] using the nonlinear programming solver IPOPT [79]. In Fig. 7 we visualize, for different parametric scenarios, the trajectories computed online using IPOPT and those computed offline using our DPC PO Algorithm 1. We demonstrate that DPC can generate suboptimal trajectories that satisfy a distribution of parametric nonlinear constraints while being more computationally efficient in online time than the state-of-the-art IPOPT solver. In particular, Table II compares mean and maximum online computational time associated with the evaluation of the learned DPC policy with implicit nonlinear MPC solved using IPOPT. On average, the explicit neural DPC policy provides x _k_ +1 = �1 _._ 0 0 _._ 1 0 _._ 0 1 _._ 0 x _k_ + where x ∈ R <sup>2</sup> and u ∈ R <sup>2</sup> are states and inputs that are subject to the box constraints x _k_ ∈ _X_ := { x | −10 ≤ _x_ ≤ 10}, and u _k_ ∈ _U_ := { u | −1 ≤ _u_ ≤ 1}, respectively. Additionally, we consider parametric nonlinear constraints representing an obstacle in the state space _p_ <sup>2</sup> ≤ _b(_ x 1 _,k_ - _c)_ <sup>2</sup> + _(_ x 2 _,k_ - _d)_ <sup>2</sup> (21) where x _i,k_ denotes the _i_ th system dynamics state, and _p_, _b_, _c_, _d_ are scalar-valued parameters defining the volume, shape, and center of the eliptic obstacle defined by (21). _1)_ _Training:_ Again we use the DPC PO Algorithm 1 for training the parametric neural policy _π_ W _(_ x _,_ _ξ_ _)_ : R <sup>7</sup> → R <sup>_N_</sup> <sup>×2</sup> with 4-layer, each having 100 hidden neurons, and ReLU activation functions, where _ξ_ = [ _b, c, d,_ r _N_ ]. To solve this problem, we consider the following DPC objective with the prediction horizon _N_ = 20: || x <sup>_i_</sup> <sup>_i_</sup> _k_ +1 <sup>−</sup> <sup>x</sup> _k_ <sup>_i_</sup> _k_ <sup>_i_</sup> <sup>||2</sup> _Q_ <u>1</u> _L_ DPC = _mN_ _m_ - _N_ −1 - _i_ =1 <sup>2</sup> _Qdx_ <sup>+ ||</sup> <sup>u</sup> _k_ <sup>_i_</sup> _k_ <sup>_i_</sup> <sup>||2</sup> _Q_ _Qu_ _k_ =0 almost 40-times speedup and 30-times speedup in the worstcase compared to IPOPT online solver without sacrificing the control performance on the presented obstacle avoidance problem. _E._ _Scalability_ _and_ _Performance_ _Guarantees_ In this section, we analyze online (evaluation) and offline (training) computational complexity of the proposed DPC PO method. _1)_ _Online_ _Computational_ _Complexity:_ From the online computational and memory standpoint we compare the proposed method with implicit and explicit solutions. The implicit MPC problem is solved online via quadratic programming (QP) using MATLAB’s Quadprog solver. In theory, the online complexity of the QP problem depends on the number of constraints, which scale polynomially with the prediction horizon steps _N_, and decision variables. In particular, the theoretical complexity of the QP problem in a dense form is _O(N_ <sup>3</sup> _n_ <sup>3</sup> _u_ <sup>_)_</sup> <sup>,</sup> <sup>and</sup> <sup>in</sup> <sup>the</sup> <sup>sparse</sup> <sup>form</sup> <sup>is</sup> <sup>_O(N_</sup> <sup>3</sup> <sup>_(nx_</sup> <sup>+</sup> <sup>_nu)_</sup> <sup>3</sup> <sup>_)_</sup> <sup>[80].</sup> _O(N_ <sup>3</sup> _n_ <sup>3</sup> _u_ <sup>_)_</sup> <sup>,</sup> <sup>and</sup> <sup>in</sup> <sup>the</sup> <sup>sparse</sup> <sup>form</sup> <sup>is</sup> <sup>_O(N_</sup> <sup>3</sup> <sup>_(nx_</sup> <sup>+</sup> <sup>_nu)_</sup> <sup>3</sup> <sup>_)_</sup> <sup>[80].</sup> The online procedure of eMPC consists of evaluating the piecewise affine policy. The forward pass of the PWA map is typically performed using binary search that has logarithmic complexity _O(_ log _(nR))_, where _nR_ is the number of critical regions of the PWA map that is upper bounded exponentially by the number of constraints _q_ as _nR_ ≤ 2 <sup>_q_</sup> . In case of DPC, the online computational complexity depends solely on the number of hidden layers _nL_ and hidden size _nz_ of the neural control policy (2). In particular, the evaluation of a single layer neural network consists of matrix multiplication with worst-case asymptotic run-time _O(n_ <sup>3</sup> _z_ <sup>_)_</sup> <sup>followed</sup> <sup>the</sup> <sup>elemen-</sup> worst-case asymptotic run-time _O(n_ <sup>3</sup> _z_ <sup>_)_</sup> <sup>followed</sup> <sup>the</sup> <sup>elemen-</sup> twise activation function with run-time _O(nz)_ . The overall theoretical complexity of the neural policy evaluation then becomes _O(nL(n_ <sup>3</sup> _z_ <sup>+</sup> <sup>_nz))_</sup> <sup>,</sup> <sup>thus</sup> <sup>being</sup> <sup>decoupled</sup> <sup>from</sup> <sup>the</sup> <sup>sizes</sup> becomes _O(nL(n_ <sup>3</sup> _z_ <sup>+</sup> <sup>_nz))_</sup> <sup>,</sup> <sup>thus</sup> <sup>being</sup> <sup>decoupled</sup> <sup>from</sup> <sup>the</sup> <sup>sizes</sup> of the optimization problem _nx_, _nu_, _N_ . This allows us to design neural policies with a tunable upper bound on worstcase computational time for the problems of arbitrary size. We empirically compare the mean and maximum online evaluation of the iMPC, eMPC, and DPC policies to demonstrate this advantage. Furthermore, we compare the memory footprint of the trained neural policy of DPC against PWA policy of eMPC. The assessment of the memory requirements of the implicit MPC is not straightforward, as it depends on the memory footprint of the chosen optimization solver, dependencies, and storage of the problem parameters. In this case, we estimate the optimistic lower bound by assessing only the memory requirements of the Quadprog solver. <sup>4</sup> In Table III we report the scalability analysis in terms of mean and maximum online evaluation time, and memory footprint as a function of increasing prediction horizon _N_, evaluated on the problem from Example 5. The results show that the learned DPC policy is on average 5 to 10 times faster than iMPC policy, comparable to eMPC on smaller problems, and orders of magnitude faster than eMPC on larger problems. Compared with eMPC, the DPC has a significantly 4The memory footprint estimate of implicit MPC in Table III is based on the standalone Python implementation of the open-source Quadprog solver: https://pypi.org/project/quadprog/. TABLE III ONLINE SCALABILITY WITH INCREASING PREDICTION HORIZON _N_ . COMPARISON OF MEAN AND WORST-CASE ONLINE COMPUTATIONAL TIME PER SAMPLE, AND MEMORY FOOTPRINT OF THE PROPOSED DPC POLICY AGAINST IMPLICIT (IMPC) AND EXPLICIT (EMPC) SOLUTIONS, EVALUATED ON THE MODEL FROM EXAMPLE 5 smaller memory footprint across all scales. Both CPU time and memory footprint of the DPC policies scale linearly with the problem complexity, while eMPC solutions scale exponentially and are practically infeasible for larger-scale problems. These findings are supported by the fact that DNNs with ReLU layers are more memory efficient than lookup tables for parametrizing the PWA functions representing eMPC policies [38]. _Remark_ _3:_ To account for increasing problem complexity, we train a two layer DPC policy, with progressively increasing number of hidden layers _n_ hidden = 10 _N_ . Both, DPC and iMPC policies share the same objectives, however, due to the exponential complexity growth in the case of eMPC we had to implement the move blocking strategy [81] limiting the control horizon _Nc_ as follows: if _N_ = 4 then _Nc_ = 2, if _N_ = 6 then _Nc_ = 1, while the problem with _N_ = 8 is practically intractable for eMPC even with _Nc_ = 1. _Remark_ _4:_ The online complexity of DPC depends entirely on the choice of the policy parametrizations, i.e., number of layers, and hidden neurons. Therefore, it can represent a tunable tradeoff between the performance and guaranteed complexity, a design trait desirable for embedded applications with limited computational resources. _2)_ _Offline_ _Computational_ _Complexity:_ For both, DPC and aMPC we evaluate the offline computational complexity using a problem from Example 2. The resulting scalability analysis of the PO algorithms with the increasing number of training samples is given Table IV. In particular, we evaluate total offline computational time as a sum of dataset generation and training time. We demonstrate that the proposed DPC algorithm requires fewer computational resources than aMPC based on imitation learning. The first reason is that DPC dataset generation does not require the solution of the original MPC as in the case of aMPC. Interestingly, using the same number of epochs, same policy architecture, and the same learning algorithm hyperparameters, the DPC approach has shown to be faster in the training time than the aMPC supervised learning method. As observed in the presented TABLE IV OFFLINE SCALABILITY WITH THE NUMBER OF TRAINING SAMPLES. COMPARISON OF THE COMBINED DATASET GENERATION AND TRAINING TIME OF THE AMPC AND THE PROPOSED DPC PO ALGORITHMS, EVALUATED ON THE PROBLEM FROM EXAMPLE 2 WITH PREDICTION HORIZON _N_ = 10 TABLE V PROBABILISTIC PERFORMANCE GUARANTEES OF THE PROPOSED DPC AND AMPC EVALUATED USING EMPIRICAL RISKS _μ_ AS A FUNCTION OF TRAINING SAMPLES example, the policy training via the DPC method seems to be approximately three times faster than aMPC. In this article, the eMPC problems are solved offline via multiparametric QP (mpQP) using MPT3 toolbox [74]. In the multiparametric QP the worst case is given by the all possible combination of active constraints _(O)(_ 2 <sup>_q_</sup> _)_, where _q_ is the number of constraints [2], [82]. As a consequence applications of the eMPC approach are limited to very small problems as shown in Table III, where the mpQP problem for larger prediction horizons took several hours to compute. Thus, we omit the eMPC approach from the scalability comparison with DPC and aMPC on a larger problem used for the analysis in Table IV. _3)_ _Probabilistic Performance Guarantees:_ For trained policies trained via DPC and aMPC, we calculate the empirical risk _μ_ (12) using Algorithm 2 evaluated on a problem from Example 2. Given a risk tolerance _ϵ_ = 0 _._ 02 and confidence 0 _._ 9835 we generate 7000 closed-loop trajectories by simulating the system (3) with trained policies on samples of normally i.i.d. initial conditions. Then we calculate the lower bound on empirical risks _μ_ of stability and constraints violations as a function number of training samples and we report the results in Table V. The results for DPC and aMPC policies trained on the same amount of data are almost identical, where DPC seems to perform slightly better with more training samples, and aMPC does better with fewer training samples. V. CONCLUSION In this work, we present a novel direct PO method called DPC. We provide a new perspective on the use of differentiable programming for obtaining offline policy gradients that can lead to solutions of the parametric programming problems arising in eMPC. The presented DPC PO can learn stable neural control policies for linear and nonlinear systems subject to state and input constraints. The neural control policy can be learned end-to-end without the need for an expert policy to imitate, thus presenting a scalable algorithm for obtaining parametric solutions to constrained optimal control problems. Furthermore, we provide sampling-based stochastic performance guarantees of the trained DPC policies by employing Hoeffding’s inequality. We demonstrate the method in extensive case studies, evaluating the control performance, data efficiency, and scalability against implicit and eMPC, aMPC, and deep RL algorithms. We show that DPC is faster than implicit MPC, has a smaller memory footprint than eMPC, and requires fewer resources for training than aMPC. Based on the reported results and userfriendly open-source implementation [10], the proposed DPC has the potential to be deployed in the application domains beyond the computational reach of the traditional eMPC while providing performance guarantees and sound computational tradeoffs. REFERENCES [1] G. Dulac-Arnold et al., “Challenges of real-world reinforcement learning: Definitions, benchmarks and analysis,” _Mach._ _Learn._, vol. 110, no. 9, pp. 2419–2468, 2021. [Online]. Available: https://doi.org/10.1007/s10994-021-05961-4 [2] A. Alessio and A. Bemporad, _A_ _Survey_ _on_ _Explicit_ _Model_ _Predictive_ _Control,_ _in_ _Nonlinear_ _Model_ _Predictive_ _Control:_ _Towards_ _New_ _Challenging_ _Applications_ . Heidelberg, Germany: Springer, 2009. [3] M. Kvasnica, _Real-Time_ _Model_ _Predictive_ _Control_ _via_ _Multi-Parametric_ _Programming:_ _Theory_ _and_ _Tools_ . Saarbrucken, Germany: VDM Verlag, Jan. 2009. [4] E. Maddalena, C. D. S. Moraes, G. Waltrich, and C. Jones, “A neural network architecture to learn explicit MPC controllers from data,” _IFAC-_ _PapersOnLine_, vol. 53, no. 2, pp. 11362–11367, 2020. [5] B. Karg and S. Lucia, “Approximate moving horizon estimation and robust nonlinear model predictive control via deep learning,” _Comput._ _Chem._ _Eng._, vol. 148, May 2021, Art. no. 107266. [6] J. Drgoˇna, K. Kiš, A. Tuor, D. Vrabie, and M. Klauˇco, “Differentiable predictive control: Deep learning alternative to explicit model predictive control for unknown nonlinear systems,” _J._ _Process_ _Control_, vol. 116, pp. 80–92, Aug. 2022. [7] J. Drgoˇna, S. Mukherjee, A. Tuor, M. Halappanavar, and D. Vrabie, “Learning stochastic parametric diferentiable predictive control policies,” _IFAC-PapersOnLine_, vol. 55, no. 25, pp. 121–126, 2022. [8] S. Mukherjee, J. Drgoˇna, A. Tuor, M. Halappanavar, and D. Vrabie, “Neural Lyapunov differentiable predictive control,” in _Proc._ _IEEE_ _61st_ _Conf._ _Decis._ _Control_ _(CDC)_, 2022, pp. 2097–2104. [9] M. Innes et al., “A differentiable programming system to bridge machine learning and scientific computing,” 2019, _arXiv:1907.07587_ . [10] A. Tuor, J. Drgona, and E. Skomski. “NeuroMANCER: Neural modules with adaptive nonlinear constraints and efficient regularizations.” 2021. [Online]. Available: https://github.com/pnnl/neuromancer [11] A. Aswani, H. Gonzalez, S. S. Sastry, and C. Tomlin, “Provably safe and robust learning-based model predictive control,” _Automatica_, vol. 49, no. 5, pp. 1216–1226, 2013. [12] J. F. Fisac, A. K. Akametalu, M. N. Zeilinger, S. Kaynama, J. Gillula, and C. J. Tomlin, “A general safety framework for learning-based control in uncertain robotic systems,” _IEEE_ _Trans._ _Autom._ _Control_, vol. 64, no. 7, pp. 2737–2752, Jul. 2019. [13] E. Asarin, O. Bournez, T. Dang, and O. Maler, “Approximate reachabil ity analysis of piecewise-linear dynamical systems,” in _Hybrid_ _Systems:_ _Computation_ _and_ _Control_, N. Lynch and B. H. Krogh, Eds. Berlin, Heidelberg: Springer 2000, pp. 20–31. [14] S. V. Rakovic, E. C. Kerrigan, D. Q. Mayne, and J. Lygeros, “Reachability analysis of discrete-time systems with disturbances,” _IEEE_ _Trans._ _Autom._ _Control_, vol. 51, no. 4, pp. 546–561, Apr. 2006. [15] R. Soloperto, M. A. Müller, S. Trimpe, and F. Allgöwer, “Learning based robust model predictive control with state-dependent uncertainty,” _IFAC-PapersOnLine_, vol. 51, no. 20, pp. 442–447, 2018. [16] L. Hewing, J. Kabzan, and M. N. Zeilinger, “Cautious model predictive control using Gaussian process regression,” _IEEE_ _Trans._ _Control_ _Syst._ _Technol._, vol. 28, no. 6, pp. 2736–2743, Nov. 2020. [17] J. Yoo and K. H. Johansson, “Event-triggered model predictive control with a statistical learning,” _IEEE_ _Trans._ _Syst.,_ _Man,_ _Cybern.,_ _Syst._, vol. 51, no. 4, pp. 2571–2581, Apr. 2021. [18] X. Zhang, J. Liu, X. Xu, S. Yu, and H. Chen, “Robust learning-based predictive control for discrete-time nonlinear systems with unknown dynamics and state constraints,” _IEEE_ _Trans._ _Syst.,_ _Man,_ _Cybern.,_ _Syst._, vol. 52, no. 12, pp. 7314–7327, Dec. 2022. [19] I. Lenz, R. A. Knepper, and A. Saxena, “DeepMPC: Learning deep latent features for model predictive control,” in _Proc._ _Robot._ _Sci._ _Syst._, 2015, pp. 1–9. [20] Z. Yan and J. Wang, “Robust model predictive control of nonlinear systems with unmodeled dynamics and bounded uncertainties based on neural networks,” _IEEE Trans. Neural Netw. Learn. Syst._, vol. 25, no. 3, pp. 457–469, Mar. 2014. [21] H. Han, S. Fu, H. Sun, and J. Qiao, “Data-driven model-predictive control for nonlinear systems with stochastic sampling interval,” _IEEE_ _Trans._ _Syst.,_ _Man,_ _Cybern.,_ _Syst._, vol. 53, no. 5, pp. 3019–3030, May 2023. [22] H. Han, Z. Liu, H. Liu, and J. Qiao, “Knowledge-data-driven model predictive control for a class of nonlinear systems,” _IEEE_ _Trans._ _Syst.,_ _Man,_ _Cybern.,_ _Syst._, vol. 51, no. 7, pp. 4492–4504, Jul. 2021. [23] H.-G. Han, X.-L. Wu, and J.-F. Qiao, “Real-time model predictive control using a self-organizing neural network,” _IEEE_ _Trans._ _Neural_ _Netw._ _Learn._ _Syst._, vol. 24, no. 9, pp. 1425–1436, Sep. 2013. [24] M. Bujarbaruah, X. Zhang, U. Rosolia, and F. Borrelli, “Adaptive MPC for iterative tasks,” in _Proc._ _IEEE_ _Conf._ _Decis._ _Control_ _(CDC)_, 2018, pp. 6322–6327. [25] L. Hewing, K. P. Wabersich, M. Menner, and M. N. Zeilinger, “Learning based model predictive control: Toward safe learning in control,” _Annu._ _Rev._ _Control,_ _Robot.,_ _Auton._ _Syst._, vol. 3, no. 1, pp. 269–296, 2020. [26] M. Grötschel, S. O. Krumke, and J. Rambau, _Introduction_ _to_ _Model_ _Based_ _Optimization_ _of_ _Chemical_ _Processes_ _on_ _Moving_ _Horizons_ . Heidelberg, Germany: Springer, 2001, pp. 295–339. [27] J. M. Maciejowski, _Predictive_ _Control_ _With_ _Constraints_ . Hoboken, NJ, USA: Prentice Hall, 2002. [28] A. Bemporad, M. Morari, V. Dua, and E. N. Pistikopoulos, “The explicit solution of model predictive control via multiparametric quadratic programming,” in _Proc. Amer. Control Conf._, vol. 2. Danvers, MA, USA, 2000, pp. 872–876. [29] A. Bemporad, F. Borrelli, and M. Morari, “Explicit solution of LP-based model predictive control,” in _Proc._ _CDC_, Dec. 2000, pp. 632–637. [30] P. Tondel, T. Johansen, and A. Bemporad, “An algorithm for multi parametric quadratic programming and explicit MPC solutions,” in _Proc._ _40th_ _IEEE_ _Conf._ _Decis._ _Control_, vol. 2, 2001, pp. 1199–1204. [31] M. Kvasnica and M. Fikar, “Clipping-based complexity reduction in explicit MPC,” _IEEE_ _Trans._ _Autom._ _Control_, vol. 57, no. 7, pp. 1878–1883, Jul. 2012. [32] M. Gulan, N. A. Nguyen, and G. Takács, “Convex lifting based inverse parametric optimization for implicit model predictive control: A case study,” in _Proc._ _59th_ _IEEE_ _Conf._ _Decis._ _Control_ _(CDC)_, 2020, pp. 2501–2508. [33] A. Domahidi, M. N. Zeilinger, M. Morari, and C. N. Jones, “Learning a feasible and stabilizing explicit model predictive control law by robust optimization,” in _Proc._ _50th_ _IEEE_ _Conf._ _Decis._ _Control_ _Eur._ _Control_ _Conf._, 2011, pp. 513–519. [34] J. Drgoˇna, D. Picard, M. Kvasnica, and L. Helsen, “Approximate model predictive building control via machine learning,” _Appl. Energy_, vol. 218, pp. 199–216, May 2018. [35] A. Raha, A. Chakrabarty, V. Raghunathan, and G. T. Buzzard, “Embedding approximate nonlinear model predictive control at ultrahigh speed and extremely low power,” _IEEE_ _Trans._ _Control._ _Syst._ _Technol._, vol. 28, no. 3, pp. 1092–1099, May 2020. [36] 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, Jan. 2022, Art. no. 109947. [37] S. Lucia, D. Navarro, B. Karg, H. Sarnago, and S. Lucía, “Deep learning based model predictive control for resonant power converters,” _IEEE_ _Trans._ _Ind._ _Informat._, vol. 17, no. 1, pp. 409–420, Jan. 2021. [38] B. Karg and S. Lucia, “Efficient representation and approximation of model predictive control laws via deep learning,” _IEEE_ _Trans._ _Cybern._, vol. 50, no. 9, pp. 3866–3878, Sep. 2020. [39] G. Montúfar, R. Pascanu, K. Cho, and Y. Bengio, “On the number of linear regions of deep neural networks,” 2014, _arXiv:1402.1869_ . [40] X. Zhang, M. Bujarbaruah, and F. Borrelli, “Safe and near-optimal policy learning for model predictive control using primal-dual neural networks,” in _Proc._ _Amer._ _Control_ _Conf._ _(ACC)_, 2019, pp. 354–359. [41] S. Chen et al., “Approximating explicit model predictive control using constrained neural networks,” in _Proc. Annu. Amer. Control Conf. (ACC)_, Jun. 2018, pp. 1520–1527. [42] M. Hertneck, J. Köhler, S. Trimpe, and F. Allgöwer, “Learning an approximate model predictive controller with guarantees,” _IEEE Control_ _Syst._ _Lett._, vol. 2, no. 3, pp. 543–548, Jul. 2018. [43] J. Z. Kolter and G. Manek, “Learning stable deep dynamics models,” in _Advances in Neural Information Processing Systems_, vol. 32. Red Hook, NY, USA: Curran Assoc., Inc., 2019, pp. 11126–11134. [44] P. L. Donti, M. Roderick, M. Fazlyab, and J. Z. Kolter, “Enforcing robust control guarantees within neural network policies,” 2020, _arXiv:2011.08105_ . [45] Z. Zhao, Y. Ren, C. Mu, T. Zou, and K.-S. Hong, “Adaptive neural network-based fault-tolerant control for a flexible string with composite disturbance observer and input constraints,” _IEEE_ _Trans._ _Cybern._, vol. 52, no. 12, pp. 12843–12853, Dec. 2022. [46] M. Ha, D. Wang, and D. Liu, “Offline and online adaptive critic control designs with stability guarantee through value iteration,” _IEEE_ _Trans._ _Cybern._, vol. 52, no. 12, pp. 13262–13274, Dec. 2022. [47] M. Fazlyab, M. Morari, and G. J. Pappas, “Safety verification and robustness analysis of neural networks via quadratic constraints and semidefinite programming,” _IEEE Trans. Autom. Control_, vol. 67, no. 1, pp. 1–15, Jan. 2022. [48] A. Agrawal, B. Amos, S. Barratt, S. Boyd, S. Diamond, and J. Z. Kolter, “Differentiable convex optimization layers,” in _Advances_ _in_ _Neural_ _Information_ _Processing_ _Systems_, vol. 32, H. Wallach, H. Larochelle, A. Beygelzimer, F. d’ Alché-Buc, E. Fox, and R. Garnett, Eds. Red Hook, NY, USA: Curran Assoc., Inc., 2019. [49] M. Pereira, D. D. Fan, G. N. An, and E. A. Theodorou, “MPC inspired neural network policies for sequential decision making,” 2018, _arXiv:1802.05803_ . [50] B. Amos, I. Jimenez, J. Sacks, B. Boots, and J. Z. Kolter, “Differentiable MPC for end-to-end planning and control,” in _Proc._ _Adv._ _Neural_ _Inf._ _Process._ _Syst._, vol. 31, 2018, pp. 1–16. [51] B. Peng et al., “Model-based chance-constrained reinforcement learning via separated proportional-integral Lagrangian,” _IEEE_ _Trans._ _Neural_ _Netw._ _Learn._ _Syst._, vol. 35, no. 1, pp. 466–478, Jan. 2024. [52] Y. Chen, Y. Shi, and B. Zhang, “Optimal control via neural networks: A convex approach,” 2018, _arXiv:1805.11835_ . [53] K. Zhang, B. Hu, and T. Basar, “Policy optimization for _H_ 2 linear control with _H_ ∞ robustness guarantee: Implicit Regularization and global convergence,” in _Proc._ _2nd_ _Conf._ _Learn._ _Dyn._ _Control_, vol. 120, Jun. 2020, pp. 179–190. [54] D. Ding, K. Zhang, T. Basar, and M. Jovanovic, “Natural policy gradient primal-dual method for constrained Markov decision processes,” in _Advances_ _in_ _Neural_ _Information_ _Processing_ _Systems_, H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin, Eds. Red Hook, NY, USA: Curran Assoc., Inc., 2020, pp. 8378–8390. [55] X. Yuan, Y. Wang, J. Liu, and C. Sun, “Action mapping: A reinforcement learning method for constrained-input systems,” _IEEE_ _Trans._ _Neural_ _Netw._ _Learn._ _Syst._, vol. 34, no. 10, pp. 7145–7157, Oct. 2023. [56] B. Zhao, D. Liu, and C. Luo, “Reinforcement learning-based optimal stabilization for unknown nonlinear systems subject to inputs with uncertain constraints,” _IEEE_ _Trans._ _Neural_ _Netw._ _Learn._ _Syst._, vol. 31, no. 10, pp. 4330–4340, Oct. 2020. [57] S. East, M. Gallieri, J. Masci, J. Koutnik, and M. Cannon, “Infinite horizon differentiable model predictive control,” in _Proc._ _Int._ _Conf._ _Learn._ _Represent._, 2020, pp. 1–15. [58] M. Zanon, S. Gros, and A. Bemporad, “Practical reinforcement learning of Stabilizing economic MPC,” in _Proc. 18th Eur. Control Conf. (ECC)_, 2019, pp. 2258–2263. [59] S. Gros and M. Zanon, “Reinforcement learning based on MPC and the stochastic policy gradient method,” in _Proc. Amer. Control Conf. (ACC)_, 2021, pp. 1947–1952. [60] L. Dong, J. Yan, X. Yuan, H. He, and C. Sun, “Functional nonlinear model predictive control based on adaptive dynamic programming,” _IEEE_ _Trans._ _Cybern._, vol. 49, no. 12, pp. 4206–4218, Dec. 2019. [61] S. Boyd and L. Vandenberghe, _Convex_ _Optimization_ . Cambridge, U.K.: Cambridge Univ. Press, 2004. [62] A. Ben-Tal and A. Nemirovski, _Lectures_ _on_ _Modern_ _Convex_ _Optimization:_ _Analysis,_ _Algorithms,_ _and_ _Engineering_ _Applications_ (MPS/SIAM Series on Optimization). Philadelphia, PA, USA: SIAM, 2001. [63] H. Chen and F. Allgöwer, “A quasi-infinite horizon nonlinear model predictive control scheme with guaranteed stability,” _Automatica_, vol. 34, no. 10, pp. 1205–1217, 1998. [64] D. Mayne, J. Rawlings, C. Rao, and P. Scokaert, “Constrained model predictive control: Stability and optimality,” _Automatica_, vol. 36, no. 6, pp. 789–814, 2000. [65] D. Mayne, “An apologia for stabilising terminal conditions in model predictive control,” _Int. J. Control_, vol. 86, no. 11, pp. 2090–2095, 2013. [66] L. Fagiano and A. R. Teel, “Generalized terminal state constraint for model predictive control,” _Automatica_, vol. 49, no. 9, pp. 2622–2631, 2013. [67] M. A. Müller, D. Angeli, and F. Allgöwer, “On the performance of economic model predictive control with self-tuning terminal cost,” _J._ _Process_ _Control_, vol. 24, no. 8, pp. 1179–1186, 2014. [68] J. Köhler, M. A. Müller, and F. Allgöwer, “A nonlinear model predictive control framework using reference generic terminal ingredients,” _IEEE_ _Trans._ _Autom._ _Control_, vol. 65, no. 8, pp. 3576–3583, Aug. 2020. [69] G. Puskorius and L. Feldkamp, “Truncated backpropagation through time and Kalman filter training for neurocontrol,” in _Proc._ _IEEE_ _Int._ _Conf._ _Neural_ _Netw._ _(ICNN)_, vol. 4, 1994, pp. 2488–2493. [70] I. Loshchilov and F. Hutter, “Decoupled weight decay regularization,” 2017, _arXiv:1711.05101_ . [71] A. Paszke et al., “PyTorch: An imperative style, high-performance deep learning library,” in _Proc._ _Adv._ _Neural_ _Inf._ _Process._ _Syst._, 2019, pp. 8024–8035. [72] B. Karg, T. Alamo, and S. Lucia, “Probabilistic performance validation of deep learning-based robust NMPC controllers,” _Int. J. Robust Nonlin._ _Control_, vol. 31, no. 18, pp. 8855–8876, 2021. [73] W. Hoeffding, “Probability inequalities for sums of bounded random variables,” _J._ _Amer._ _Stat._ _Assoc._, vol. 58, no. 301, pp. 13–30, 1963. [74] M. Herceg, M. Kvasnica, C. Jones, and M. Morari, “Multi-parametric toolbox 3.0,” in _Proc._ _Eur._ _Control_ _Conf._, Zurich, Switzerland, 2013, pp. 502–510. [75] T. Q. Chen, Y. Rubanova, J. Bettencourt, and D. K. Duvenaud, “Neural ordinary differential equations,” in _Advances_ _in_ _Neural_ _Information_ _Processing_ _Systems_, vol. 31, S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, Eds. Red Hook, NY, USA: Curran Assoc., Inc., 2018, pp. 6571–6583. [76] S. Diamond and S. Boyd, “CVXPY: A Python-embedded modeling language for convex optimization,” _J. Mach. Learn. Res._, vol. 17, no. 83, pp. 1–5, 2016. [77] B. Stellato, G. Banjac, P. Goulart, A. Bemporad, and S. Boyd, “OSQP: An operator splitting solver for quadratic programs,” _Math._ _Program._ _Comput._, vol. 12, no. 4, pp. 637–672, 2020. [78] J. A. E. Andersson, J. Gillis, G. Horn, J. B. Rawlings, and M. Diehl, “CasADi: A software framework for nonlinear optimization and optimal control,” _Math._ _Program._ _Comput._, vol. 11, no. 1, pp. 1–36, Mar. 2019. [79] A. Wächter and L. T. Biegler, “On the implementation of an interior point filter line-search algorithm for large-scale nonlinear programming,” _Math._ _Program._, vol. 106, pp. 25–57, Mar. 2006. [80] G. Frison and J. B. Jørgensen, “A fast condensing method for solution of linear-quadratic control problems,” in _Proc._ _52nd_ _IEEE_ _Conf._ _Decis._ _Control_, 2013, pp. 7715–7720. [81] R. Cagienard, P. Grieder, E. Kerrigan, and M. Morari, “Move blocking strategies in receding horizon control,” _J. Process Control_, vol. 17, no. 6, pp. 563–570, Jul. 2007. [82] A. Bemporad, “Model predictive control design: New trends and tools,” in _Proc._ _45th_ _IEEE_ _Conf._ _Decis._ _Control_, 2006, pp. 6678–6683. Ján Drgoˇna (Member, IEEE) received the Ph.D. degree in control theory from the Slovak University of Technology, Bratislava, Slovakia, in 2017. He is a Data Scientist with the Physics and Computational Sciences Division, Pacific Northwest National Laboratory (PNNL), Richland, WA, USA. Before PNNL, he was a Postdoctoral Researcher with the Mechanical Engineering Department, KU Leuven, Leuven, Belgium. His current research focus falls in the intersection of model-based optimal control and differentiable programming methods. Aaron Tuor received the M.Sc. degree in computer science. He is a PNNL Researcher of Machine Learning Applications for a range of data modalities, including computer vision, natural language processing, multispectral remote imagery, and cyber data. He is a Principal Investigator for a project developing physics-constrained data-driven control and system identification techniques. His current research is focused on embedding domain knowledge into deep learning methods for dynamics modeling and control. Draguna Vrabie (Member, IEEE) received the Ph.D. degree in control theory from The University of Texas at Arlington, Arlington, TX, USA, in 2009. She is a Chief Data Scientist with Pacific Northwest National Laboratory (PNNL), Richland, WA, USA. Before joining PNNL, she was a Senior Research Scientist with United Technologies Research Center, East Hartford, CT, USA. She works at the intersection of control system theory and machine learning to design adaptive decision and control systems. Her focus is on deep learning methodologies and algorithms for design and operation of high-performance, and cyber–physical systems.

섹션 본문 92문단 · 43,182자

Learning Constrained Parametric Differentiable Predictive Control Policies With Guarantees

2Ján Drgoňa , Member, IEEE, Aaron Tuor, and Draguna Vrabie , Member, IEEE Abstract-We present differentiable predictive control (DPC), a method for offline learning of constrained neural control policies for nonlinear dynamical systems with performance guarantees.We show that the sensitivities of the parametric optimal control problem can be used to obtain direct policy gradients.Specifically, we employ automatic differentiation (AD) to efficiently compute the sensitivities of the model predictive control (MPC) objective function and constraints penalties.To guarantee safety upon deployment, we derive probabilistic guarantees on closed-loop stability and constraint satisfaction based on indicator functions and Hoeffding's inequality.We empirically demonstrate that the proposed method can learn neural control policies for various parametric optimal control tasks.In particular, we show that the proposed DPC method can stabilize systems with unstable dynamics, track time-varying references, and satisfy nonlinear state and input constraints.Our DPC method has practical time savings compared to alternative approaches for fast and memoryefficient controller design.Specifically, DPC does not depend on a supervisory controller as opposed to approximate MPC based on imitation learning.We demonstrate that, without losing performance, DPC is scalable with greatly reduced demands on memory and computation compared to implicit and explicit MPC while being more sample efficient than model-free reinforcement learning (RL) algorithms.

3Index Terms-Differentiable programming, learning for control, parametric optimal control, policy optimization (PO).

I. INTRODUCTION

4D ATA-DRIVEN dynamics modeling and control policy learning show promise to "democratize" advanced control to systems with complex and partially characterized dynamics.However, pure data-driven methods typically suffer from poor-sampling efficiency, scale poorly with problem size, and exhibit slow convergence to optimal decisions [1].Of special concern are the lack of guarantees that black-box data-driven controllers will satisfy operational constraints and maintain safe operation.

5Model predictive control (MPC) methods can offer optimal performance with systematic constraints handling.However, their solution is based on real-time optimization that might be computationally prohibitive for some applications.Explicit MPC (eMPC) [2] aims to overcome the limits of online optimization by precomputing the control law offline for a given set of admissible parameters.However, obtaining eMPC policies via multiparametric programming (mpP) [3] is computationally expensive, limiting its applicability to small-scale systems.Addressing limitations of eMPC, several authors have proposed using deep learning to approximate the control policies given example data sets computed by a supervisory MPC [4], [5].

A. Contributions

6In this article, we expand our prior work on differentiable predictive control (DPC), a method for offline learning of explicit predictive control policies [6], [7], [8].DPC is based on differentiable programming [9] where the mathematical operations associated with evaluating the MPC problem's constraints and objective function are represented as a directed acyclic computational graph implemented in a language supporting automatic differentiation (AD).This allows us to obtain direct policy gradients of the MPC problem suitable for learning constrained control policies using stochastic gradient descent (SGD) algorithm.We report the following contributions.

71) An offline policy optimization (PO) algorithm based on gradients computed by differentiating the MPC problem.2) Probabilistic closed-loop stability and constraint satisfaction guarantees based on Hoeffding's inequality.3) Five numerical studies that compare DPC with MPC, approximate MPC (aMPC), and model-free reinforcement learning (RL) algorithms demonstrating that: a) DPC can learn to stabilize unstable systems; b) DPC can handle parametric nonlinear constraints; c) DPC is more sample efficient than RL algorithms; d) DPC has faster execution time than implicit MPC; and e) DPC scales better compared to eMPC.4) Open-source code implementation [10].

B. Related Work 1) Learning-Based Model Predictive Control:

8In general, learning-based MPC (LBMPC) methods [11], [12] are based on learning the system dynamics model from data and can be considered generalizations of classical adaptive MPC.

9To make LBMPC tractable, the performance and safety tasks are decoupled by using reachability analysis [13], [14].Variations include formulation of robust or stochastic MPC with state-dependent uncertainty for data-driven linear models [15], Gaussian processed (GP) [16], kernel regression model [17], Koopman operator model [18], recurrent neural networks [19], [20], fuzzy neural networks [21], [22] selforganizing radial basis function neural networks [23], or iterative model updates for linear systems with bounded uncertainties and robustness guarantees [24].For a comprehensive review of LBMPC approaches we refer the reader to a recent review [25] and references therein.In general, LBMPC methods are based on the online solution of the corresponding optimization.In contrast, in the proposed DPC methodology, the neural policy is learned offline and hence represents an explicit solution to the underlying parametric optimal control problem (pOCP).

102) Explicit Model Predictive Control: For a certain class of small scale MPC problems [26], [27], the solution can be precomputed offline using mpP [3], [28] to obtain a socalled eMPC policy [29], [30].The benefits of eMPC are typically faster online computations, exact bounds on worstcase execution time, and simple and verifiable policy code, which makes it a suitable approach for embedded applications.However, eMPC suffers from the curse of dimensionality, scaling geometrically with the number of constraints.This severely limits its practical applicability only to small scale systems with short prediction horizons [2], even after applying various complexity reduction methods [31], [32].The DPC method proposed here presents a scalable alternative for obtaining eMPC policies for linear systems by employing principles of data-driven constrained differentiable programming.

113) Approximate Model Predictive Control: Targeting the scalability issues of eMPC, authors in the control community proposed aMPC [33], [34], [35], [36], [37] whose solution is based on supervised learning of control policies imitating the original MPC.An interesting theoretical connection was made by Karg and Lucia [38] showing that every piecewise affine (PWA) control policy can be exactly represented by a deep ReLU network [39].This means that the optimality of the neural control policy will depend only on the quality of training data and formulation of the learning problem.However, the remaining disadvantage of aMPC is its inherent dependency on the solution of the original MPC problem.This article presents an alternative method for computing scalable explicit control policies for linear systems subject to nonlinear constraints.Our approach is based on differentiable programming and avoids the need for a supervisory MPC controller, as in the case of aMPC.aMPC methods alone do not provide performance guarantees, as in the case of implicit MPC.This limitation has previously been addressed either by involving optimality checks with backup controllers [40], projections of the control actions onto the feasible set [41], or by providing sampling-based probabilistic performance guarantees [42].In this work, we adapt probabilistic performance guarantees as introduced in [42] in the context of unsupervised learning of the constrained control policies via the proposed DPC method.

124) Safe Learning-Based Control: For imposing stability guarantees in deep learning-based control applications, one could employ data-driven methods based on learning Lyapunov function candidates for stable dynamics models and control policies as part of the neural architecture [8], [43], [44], constructing analytical Lyapunov functions [45], or attraction domain criteria [46].Others [47] have employed semidefinite programming for safety verification and robustness analysis of feed-forward neural network control policies.Agrawal et al. [48] represented constrained optimization problems as implicit layers in deep neural networks, leading to the introduction of neural network policy architectures designed to handle predefined constraints [49], [50].Peng et al. [51] proposed a novel proportional-integral Lagrangian method to handle hance constraints in RL setting.A conceptual idea of backpropagating through the learned system model parametrized via convex neural networks was investigated in [52].Zhang et al. [53] and Ding et al. [54] studied the convergence of the PO with robustness guarantees in the context of constrained model-based RL.Others [55], [56] have recently proposed modifications of RL algorithms that can handle constrained-input systems.The proposed work falls in the category of domain-aware differentiable architectures that can handle both state and input constraints emerging in the MPC problem formulations.

5) Differentiable Model Predictive Control:

13In recent years, works [50], [57] have proposed differentiable MPC as safe imitation learning methods based on AD of the MPC or LQR optimization problems.In this context, the computed MPC sensitivities (i.e., backward gradients) are used in the gradient-based update rules to learn the unknown dynamics models and MPC objective functions of the controlled system from the sampled closed-loop data.Orthogonally, Zanon et al. [58] and Gros and Zanon [59] leveraged differentiable MPC as a policy approximation to provide safety guarantees in the context of RL algorithms.This is achieved by replacing deep neural network policy with an online MPC scheme whose parameters are tuned via RL updates based on the MPC sensitivities obtained via AD.Dong et al. [60] used neural-networks to reconstruct the unknown system dynamics and parameterize the critic network in the adaptive dynamic programming (ADP)-based nonlinear MPC scheme.Contrary to the methods mentioned above, the presented DPC method uses backward AD to compute the sensitivities of the MPC problem without the need for learning additional critic networks, or supervisory signals.

II. DIFFERENTIABLE PREDICTIVE CONTROL

14We present a new perspective on solving pOCPs by leveraging the connection between parametric and differentiable programming.In particular, we introduce a DPC method based on representing the constrained optimal control problem as a differentiable program and using AD to obtain direct policy gradients for gradient-based optimization.The proposed model-based DPC methodology is illustrated in Fig. 1.As a first step, the system's state-space model is obtained from system identification or physics-based modeling.Next, we construct a differentiable closed-loop system model by combining the state space model and neural control policy in a computational graph.Finally, the neural control policy is optimized via backpropagation of the gradients of the MPC objective function and constraints penalties, formulated as soft constraints, through the unrolled closed-loop system dynamics.

A. Differentiable Predictive Control Problem Formulation

15Compared to MPC, instead of directly optimizing for control actions u, the DPC problem is optimizing the learnable parameters, W, of a neural control policy π W : R n x +n ξ → R n u , i.e., an explicit mapping from system states x and parameters ξ to control actions u.Beware of an unfortunate collision of terminology between the machine learning, optimization, and control communities here.Unlike policy parameters W, problem parameters ξ is a set of loss function r, state constraint p h , input constraint p g , and system model parameters θ , that together with the initial conditions x 0 define the following pOCP:

16Here, N represents a prediction horizon, and k is a discrete time step.The loss function terms are the parametric MPC objective : R n x +n u +n r → R with terminal penalty term, p N : R n x → R, to promote stability of the underlying MPC problem.The parametric state and input constraints are given via (1d), and (1e), respectively.The formulation (1) implemented as a differentiable program allows us to obtain a data-driven solution of the corresponding parametric programming problem by differentiating the loss function (1a) backwards through the parametrized closed-loop dynamics given by the system model (1b) and neural control policy (1c).This formulation allows one to use the SGD and its variants to minimize the loss function (1a) over the initial conditions and problem parameters sampled from distributions P x 0 , and P ξ , respectively.In the following paragraphs, we elaborate on key components of the proposed DPC problem formulation (1).

B. Differentiable Closed-Loop System

17The core idea of DPC is parametrization of the closed-loop system composed of differentiable system dynamics model and neural control policy as shown in Fig. 1.One major difference between implicit MPC and DPC ( 1) is that the MPC solution returns an optimal sequence of the control actions U = u 0 , . . ., u N−1 , while solving DPC yields optimized weights and biases W = {H 1 , . . ., H L , b 1 , . . ., b L } parametrizing the explicit neural control policy π W : R n x +n ξ → R n u given as

18where z i are hidden states, H i , and b i represent weights and biases of the ith layer, respectively.The activation layer σ : R n z → R n z is given as the element-wise application of a differentiable univariate function σ : R → R.This article assumes a discrete-time nonlinear dynamical system model (1b).In a nominal case with z 0 = x k we obtain a full state feedback formulation of the control problem (1), where the system model (1b) and control policy (1c) together define the closed-loop system dynamics as

19(

20Here, the N-step ahead rollout of the system (3) is conceptually equivalent to a single shooting formulation of the MPC problem [26].Please note that in the extended case, we can consider the features of the policy to be augmented with vector ξ k = {r k , p hk , p g k , θ} consisting of reference signals, state and input constraints parameters, as well as system model parameters.Thus allowing for generalization across model scenarios, tasks with full reference preview, and dynamic constraints handling capabilities as in the case of classical implicit MPC.

C. Differentiable Loss Function

21The proposed DPC method is an offline PO algorithm that requires an estimate of the expected values of the pOCP's objective function (1a) and (1d) and (1e).For this purpose, we construct the Lagrangian of the pOCP (1) using well known penalty method.This allows us to compute the DPC loss L DPC as weighted average of the Lagrangian by sampling m-number scenarios of the initial conditions x i 0 ∼ P x 0 and problem parameters

22The first term of the differentiable Lagrangian loss function L DPC represents the main performance metric and can be defined, for instance, as a reference tracking term

23Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

24parametrized by r k .The constraints terms correspond to penalty functions [61], [62] imposed on state and control action constraints parametrized by p hk , and p g k , respectively.Specifically, the parametric constraints penalties are

25with ReLU : R → R standing for rectifier linear unit function, n h and n g define the total number of state and input constraints.

26The relative importance of the individual terms is tuned by

27The terminal penalty term p N (x N ) in the DPC problem formulation ( 1) is a commonly used ingredient to guarantee recursive feasibility and closed-loop stability of MPC and can be designed based on a wide range of methods from [63], [64], [65], [66], [67], and [68].

28Assumption 1: The system dynamics model (1b), parametric control objective function (x k , u k , r k ), state and input constraints penalties p x (h(x k , p hk )) and p u (g(u k , p g k )), and terminal penalty term p N (x N ) are differentiable at almost every point in their domain.We assume zero gradients at points where the functions are not differentiable.

D. Differentiable Predictive Control Policy Gradients

29A main advantage of having a differentiable closed-loop dynamics model, control objective function, constraints, and terminal penalties is that it allows us to use AD (backpropagation through time [69]) to directly compute the policy gradient.In particular, by representing the problem (1) as a computational graph and leveraging the chain rule, we can directly compute the gradients of the loss function L DPC w.r.t. the policy parameters W. For a simplicity of exposure lets consider the case with m = 1 and N = 1 with corresponding gradients defined as follows:

30The advantage of having gradients (7) is that it allows us to use the SGD algorithms, such as AdamW [70], to solve the corresponding pOCP (1).In practice, we can compute the gradient of the DPC problem by using AD frameworks, such as Pytorch [71].

E. Offline DPC Policy Optimization Algorithm

31First, we sample the initial conditions of the problem x 0 ∼ P x 0 .

32Next, we sample the problem parameters window.Optionally, the problem parameters could include system dynamics model parameters θ representing system model uncertainties.The simplest choice of P x 0 and P ξ is to use the uniform distribution.Alternatively, the distribution of the training data can be obtained from measured trajectories of the controlled system or specified by a domain expert.Now combining the individual components, the DPC PO algorithm is summarized in Algorithm 1.The system dynamics model and control policy architecture are required to instantiate the computational graph of the DPC problem (1).The policy gradients ∇ W L DPC are obtained by differentiating the DPC loss function L DPC over the distribution of initial state conditions and problem parameters sampled from given distributions.The computed policy gradients now allow us to perform direct PO via a gradient-based optimizer O.The presented algorithm introduces a generic approach for a datadriven solution of model-based pOCP (1).

III. PROBABILISTIC STABILITY AND CONSTRAINT SATISFACTION

33In this section, we present a probabilistic verification method for closed-loop stability and constraint satisfaction guarantees of the proposed DPC PO Algorithm 1.In particular, we modify the probabilistic verification method developed by [42] in the context of aMPC method.We first consider the following assumptions.

34Assumption 2: There exists a local Lyapunov function V(x), an invariant terminal set X N , and feasible terminal control law K(x), such that ∀x ∈ X N the following holds:

35Remark 1: In practice, the condition of Assumption 2 can be satisfied by designing a stabilizing LQR controller given the system dynamics x k+1 = Ax k + Bu k linearized at the operating point x ∈ X N .In standard MPC, the terminal control law K(x) is typically combined with terminal cost function p N (x N ) to guarantee the closed-loop stability by showing the optimal cost function is a Lyapunov function [63], [64], [65], [66], [67], [68].

A. Performance Indicator Functions

36Inspired by [42] and [72], our probabilistic validation method is based on the closed-loop system (3) rollouts defined as

37Here, i is an index of the simulated trajectory, and X represents a set of sampled initial conditions.For performance assessment, we define stability I s (X i ) and constraint satisfaction I c (X i ) indicator functions as

38The proposed indicator functions (10) indicate whether the learned control policy π W (x k ) generates state trajectories that satisfy given stability conditions (10a), without violating state and input constraints (10b), respectively.For this purpose, we define the risk as μ

39, where μ = 1 implies the stability and constraints are satisfied for 100% of sampled trajectories (9), conversely, μ = 0 implies that all sampled scenarios violate either constraints or stability.

40Remark 2: The advantage of the proposed DPC problem formulation (1) in comparison with aMPC scheme [42] is that it allows us to define direct performance indicator functions (10) based on known constraints and closed-loop system dynamics (3).While in [42], the indicator functions are based on the approximation error of the control policy trained via imitation learning supervised by the original MPC.

B. Probabilistic Guarantees

41We can now use the indicator functions (10) to empirically validate the set of m trajectories X i , i ∈ N m 1 , with sampled independent and identically distributed (IID) initial conditions x i 0 ∼ P x 0 .For this purpose, we define the empirical risk as

42Similar to [42], we use the Hoeffding's inequality [73] to estimate the true risk μ from the empirical risk μ.Hoeffding's inequality implies that the probability of the sampled trajectories X i satisfying the indicator functions (10) is larger than the empirical risk μ minus the user-defined risk tolerance with confidence 1 − δ, or more compactly

43Thus as given in [42], for a chosen confidence δ and m samples, we obtain the following formula to calculate the worst-case empirical risk μ wc :

44Now using the condition (12) we can compute the worst-case bound for the true risk as μ ≥ μ wc .Hence, higher-empirical risk value μ, more samples m, and lower-confidence δ, imply higher-worst-case risk value μ wc , which implies tighter bound on true risk μ.This allows us to define the following closedloop performance validation Algorithm 2. Finally, we can formalize the stability guarantees for DPC PO Algorithm 1 via Theorem 1 inspired by [42].else repeat from step 4 14: else validation passed, terminate procedure Theorem 1: Let Assumption 2 hold.Construct the DPC problem (1) with the given system dynamics model.Initialize and run Algorithm 2 with chosen hyperparameters δ, μ bound , m, m max , and p.If Algorithm 2 terminates with the validation procedure passed, then with the confidence of 1−δ the trained control policy satisfies closed-loop stability and constraint satisfaction for sampled initial conditions with admissible risk μ bound .

45Proof: If Algorithm 2 terminates with validation procedure passed, then (12) must hold, then through Hoeffding's inequality it holds that P[I s (X i ) = 1 & I c (X i ) = 1] ≥ μ bound with confidence of 1−δ.Or in other words, reaching the terminal set X f while satisfying state and input constraints is guaranteed at minimum for μ bound portion of samples with 1−δ confidence.Thanks to Assumption 2 convergence to the terminal set X f now implies closed-loop stability (8).

IV. NUMERICAL CASE STUDIES

46This section presents simulation results on five example systems demonstrating the capabilities of the DPC PO algorithm to 1) learn to stabilize unstable linear systems; 2) learn to control systems with multiple inputs and outputs; and 3) satisfy state and input constraints.Furthermore, we demonstrate superior sampling efficiency compared to model-free RL algorithms, faster online execution compared to implicit MPC, and smaller memory footprint and better scalability compared to eMPC.The presented experiments are implemented in Pytorch-based toolbox NeuroMANCER [10] and are available on Github. 1 All experiments in this section were performed on a laptop with 2.60-GHz Intel i7-8850H CPU and 16-GB RAM on a 64-bit operating system.All examples using DPC PO Algorithm 1 are optimized with AdamW [70] optimizer.

A. Example 1-Stabilizing Unstable Double Integrator

47Here, we demonstrate the capabilities of DPC to learn a stabilizing neural feedback policy for an unstable system with known dynamics.We control the unstable double integrator

48As a benchmark we synthesize an eMPC policy solved with classical multiparametric programming solver using MPT3 toolbox [74] with prediction horizon of N = 10, and weights

49for whose the surface is shown on the left in Fig. 2.

501) Training: In the case of DPC, we learn a full state feedback neural policy u k = π W (x k ) in the closed-loop system (3) via Algorithm 1 for whose the surface is shown on the right in Fig. 2. A side by side comparison in Fig. 2 shows almost identical control surfaces of compared policies.For the DPC policy training we used the MPC loss function (14) subject to state x k ∈ X , input u k ∈ U , as well as terminal set constraints x N ∈ X f := {x | −0.1 ≤ x ≤ 0.1}.All constraints are implemented using penalties (6) with weights Q h = 10, Q g = 100, Q N = 1, while for the control objective ( 14) we consider prediction horizon N = 1, and weights Q x = 5, Q u = 0.5.We train the neural policy (2) π W (x) : R2 → R with 4 layers, 20 hidden states, with bias, and ReLU activation functions.We use a training set of 3333 normally sampled initial conditions x 0 fully covering the admissible set X .

512) Closed-Loop Performance: Fig. 3 shows resulting converging trajectories of the closed-loop system dynamics controlled by a stabilizing neural policy learned using DPC formulation with terminal constraints.Finally, on the left hand side of Fig. 4 we visualize the DPC loss function (4) (left) for a trained policy over a state space to demonstrate that it is indeed a Lyapunov function.While on the right of Fig. 4 we evaluate the contraction constraint (15) showing state space regions with contractive α < 1 (blue) and diverging α > 1 (red) dynamics

B. Example 2-Reference Tracking of Two Tank System

52We consider a canonical nonlinear control problem, a system of two connected tanks controlled by a single pump and a two way valve.The system is a simplified model of a pumped-storage hydroelectricity which is a type of hydroelectric energy storage used by electric power systems for load balancing.The nonlinear ordinary differential equation (ODE) model 2 has the following form:

53With system states h 1 , and h 2 representing levels of liquid in tank 1 and 2, respectively.Control actions are pump modulation p, and valve opening v.The ODE system is parametrized by inlet and outlet valve coefficients c 1 and c 2 .We solve the continuous-time system model ( 16) by using a 4th order Runge-Kutta ODE solver obtaining a discretized system that can be represented in a compact form as

54with system states x = [h 1 , h 2 ] and control actions u = [p, v].

55In general, there are two ways to differentiate through the system model solved with the ODE solver (17).The first is to use the backpropagation through time algorithm [69] by unrolling the operations of the ODE solver and using AD to compute its gradients.The second, is to use adjoint method as in the case of neural ODEs [75].

1) Training:

56The objective is to control the tank levels into desired time-varying reference values by modulating the pump and valve control actions, subject to state and input constraints.We use the DPC PO Algorithm 1 to learn the explicit neural control policy by solving the following parametric nonlinear optimal control problem:

57The objective function is to minimize the reference tracking error ||x i k − r i k || 2 2 over the prediction horizon N = 50 weighted by a scalar Q x = 5, including terminal penalty weighted by Q N = 10.The parametric neural control policy is given by π W (x i k , R i ).The neural control policy is optimized over problem parameters sampled from the distributions P x 0 , and P R , for state initial conditions and references, respectively.Specifically, we sample 2000 scenarios with uniformly distributed initial conditions and a random sequence of desired references with prediction horizon N = 50.The state (18d) and input (18e) constraints are transformed into penalties with weights Q h = 10, Q g = 10, respectively.

58We train the neural policy π W (x k , R) : R n x +Nn r → R n u with 2 layers, 32 hidden states, with bias, and GeLU activation functions, where n x = 2, n r = 2, n u = 2, and N = 50 being number of states, references, control actions, and prediction horizon steps, respectively.

592) Closed-Loop Performance: In Fig. 5 we show the closed-loop reference tracking control performance using the neural control policy trained offline using the DPC PO Algorithm 1.We demonstrate that the neural DPC policy can reliably control nonlinear dynamical system with time-varying reference, while satisfying state and input constraints.

C. Example 3-Tracking Control of Quadcopter Model

60In this example, we demonstrate scalability of DPC to larger systems using a linear quadcopter model 3 with twelve states 3 https://osqp.org/docs/examples/mpc.html Fig. 5. Closed-loop trajectories of the two tank system controlled by neural policy trained offline using DPC PO Algorithm 1.

61x k ∈ R 12 , and four control inputs u k ∈ R 4 .Our objective is to track the reference with the 3-rd state representing the controlled output y k ∈ R, and stabilize rest of the states, while satisfying state and input constraints.

621) Training: To optimize the policy, we use Algorithm 1 with 30 000 samples of feasible normally distributed initial conditions, where we use 10 000 samples for train, validation, and test set, respectively.We consider the DPC problem with sampled quadratic control objective

63using prediction horizon N = 10, and weights Q r = 20, Q x = 5.The system is subject to state and input constraints

5}, with constraints penalty weights

64respectively.To promote the stability of the closed-loop system during training, we consider the contraction constraint (15) with scaling factor α = 0.8 and penalty weight Q c = 1.We train the full state feedback neural policy (2) π W (x) : R 12 → R N×4 with 2 layers, 100 hidden states, and ReLU activation functions.In the closed-loop simulations, we use RHC to use only the first predicted control action.

652) Closed-Loop Performance: Fig. 6 plots the closed-loop control performance of the quadcopter model controlled with the trained full state feedback neural policy.We demonstrate that the trained DPC policy can simultaneously track the desired reference, and stabilize the selected states while satisfying state and input constraints.From the computational perspective, in Table I we compare the online computational time associated with the evaluation of the trained DPC policy compared against the implicit MPC in the quadratic form implemented in CVXPY [76] and solved with the OSQP solver [77].We report on average almost two orders of magnitude speedup in the maximum and mean evaluation time compared to the online optimization solver.Due to the large state dimensions, the presented Fig. 6.Closed-loop trajectories of the quadcopter system controlled by DPC policy trained via Algorithm 1 using control objective (19) and constraints penalties (6), including contraction constraint (15).

TABLE I COMPARISON OF ONLINE COMPUTATIONAL TIME OF THE PROPOSED DPC POLICY AGAINST IMPLICIT MPC SOLVED WITH OSQP

66problem is not feasible with traditional parametric programming solvers.Thus by solving this problem, we demonstrate the scalability of the proposed DPC method beyond the limitations of eMPC while providing significant speedups compared to the online state-of-the-art convex optimization solver.

D. Example 4-Parametric Obstacle Avoidance Problem

67In this example, we demonstrate handling parametric nonlinear constraints for obstacle avoidance problem by learning parametric neural policies using DPC PO Algorithm 1.We consider the double integrator system

68where x i,k denotes the ith system dynamics state, and p, b, c, d are scalar-valued parameters defining the volume, shape, and center of the eliptic obstacle defined by (21).

69where the first term penalizes the terminal state condition with parametric reference r N , the second term penalizes the energy used in control actions, while the third and fourth terms represent control action and state smoothing penalties.For scaling the control objective terms we use following weight factor values Q r = 1.0,Q dx = 1.0,Q du = 10.0,Q u = 10.0, and we use Q h = 100.0for state constraint penalties that include the obstacle avoidance constraint (21) and box constraints on states and control actions.For datasets we sample 30 000 uniformly distributed initial state conditions x i 0 , constraints parameters p i , b i , c i , d i , and terminal state references r i N , and use one third of data for train, validation, and test set, respectively.

702) Optimal Control Performance: The obstacle constraint (21) casts the overall pOCP (1) to be nonlinear.Hence for the comparison, we implement the implicit MPC with nonlinear constraints in the CasADi framework [78] using the nonlinear programming solver IPOPT [79].In Fig. 7 we visualize, for different parametric scenarios, the trajectories computed online using IPOPT and those computed offline using our DPC PO Algorithm 1.We demonstrate that DPC can generate suboptimal trajectories that satisfy a distribution of parametric nonlinear constraints while being more computationally efficient in online time than the state-of-the-art IPOPT solver.In particular, Table II compares mean and maximum online computational time associated with the evaluation of the learned DPC policy with implicit nonlinear MPC solved using IPOPT.On average, the explicit neural DPC policy provides Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

71almost 40-times speedup and 30-times speedup in the worstcase compared to IPOPT online solver without sacrificing the control performance on the presented obstacle avoidance problem.

E. Scalability and Performance Guarantees

72In this section, we analyze online (evaluation) and offline (training) computational complexity of the proposed DPC PO method.

731) Online Computational Complexity: From the online computational and memory standpoint we compare the proposed method with implicit and explicit solutions.The implicit MPC problem is solved online via quadratic programming (QP) using MATLAB's Quadprog solver.In theory, the online complexity of the QP problem depends on the number of constraints, which scale polynomially with the prediction horizon steps N, and decision variables.In particular, the theoretical complexity of the QP problem in a dense form is O(N 3 n 3 u ), and in the sparse form is O(N 3 (n x + n u ) 3 ) [80].The online procedure of eMPC consists of evaluating the piecewise affine policy.The forward pass of the PWA map is typically performed using binary search that has logarithmic complexity O(log(n R )), where n R is the number of critical regions of the PWA map that is upper bounded exponentially by the number of constraints q as n R ≤ 2 q .In case of DPC, the online computational complexity depends solely on the number of hidden layers n L and hidden size n z of the neural control policy (2).In particular, the evaluation of a single layer neural network consists of matrix multiplication with worst-case asymptotic run-time O(n 3 z ) followed the elementwise activation function with run-time O(n z ).The overall theoretical complexity of the neural policy evaluation then becomes O(n L (n 3 z + n z )), thus being decoupled from the sizes of the optimization problem n x , n u , N. This allows us to design neural policies with a tunable upper bound on worstcase computational time for the problems of arbitrary size.We empirically compare the mean and maximum online evaluation of the iMPC, eMPC, and DPC policies to demonstrate this advantage.Furthermore, we compare the memory footprint of the trained neural policy of DPC against PWA policy of eMPC.The assessment of the memory requirements of the implicit MPC is not straightforward, as it depends on the memory footprint of the chosen optimization solver, dependencies, and storage of the problem parameters.In this case, we estimate the optimistic lower bound by assessing only the memory requirements of the Quadprog solver. 4n Table III we report the scalability analysis in terms of mean and maximum online evaluation time, and memory footprint as a function of increasing prediction horizon N, evaluated on the problem from Example 5.The results show that the learned DPC policy is on average 5 to 10 times faster than iMPC policy, comparable to eMPC on smaller problems, and orders of magnitude faster than eMPC on larger problems.Compared with eMPC, the DPC has a significantly [38].Remark 3: To account for increasing problem complexity, we train a two layer DPC policy, with progressively increasing number of hidden layers n hidden = 10 N. Both, DPC and iMPC policies share the same objectives, however, due to the exponential complexity growth in the case of eMPC we had to implement the move blocking strategy [81] limiting the control horizon N c as follows: if N = 4 then N c = 2, if N = 6 then N c = 1, while the problem with N = 8 is practically intractable for eMPC even with N c = 1.

74Remark 4: The online complexity of DPC depends entirely on the choice of the policy parametrizations, i.e., number of layers, and hidden neurons.Therefore, it can represent a tunable tradeoff between the performance and guaranteed complexity, a design trait desirable for embedded applications with limited computational resources.

752) Offline Computational Complexity: For both, DPC and aMPC we evaluate the offline computational complexity using a problem from Example 2. The resulting scalability analysis of the PO algorithms with the increasing number of training samples is given Table IV.In particular, we evaluate total offline computational time as a sum of dataset generation and training time.We demonstrate that the proposed DPC algorithm requires fewer computational resources than aMPC based on imitation learning.The first reason is that DPC dataset generation does not require the solution of the original MPC as in the case of aMPC.Interestingly, using the same number of epochs, same policy architecture, and the same learning algorithm hyperparameters, the DPC approach has shown to be faster in the training time than the aMPC supervised learning method.As observed in the presented example, the policy training via the DPC method seems to be approximately three times faster than aMPC.In this article, the eMPC problems are solved offline via multiparametric QP (mpQP) using MPT3 toolbox [74].In the multiparametric QP the worst case is given by the all possible combination of active constraints (O)(2 q ), where q is the number of constraints [2], [82].As a consequence applications of the eMPC approach are limited to very small problems as shown in Table III, where the mpQP problem for larger prediction horizons took several hours to compute.Thus, we omit the eMPC approach from the scalability comparison with DPC and aMPC on a larger problem used for the analysis in Table IV.

763) Probabilistic Performance Guarantees: For trained policies trained via DPC and aMPC, we calculate the empirical risk μ (12) using Algorithm 2 evaluated on a problem from Example 2. Given a risk tolerance = 0.02 and confidence 0.9835 we generate 7000 closed-loop trajectories by simulating the system (3) with trained policies on samples of normally i.i.d.initial conditions.Then we calculate the lower bound on empirical risks μ of stability and constraints violations as a function number of training samples and we report the results in Table V.The results for DPC and aMPC policies trained on the same amount of data are almost identical, where DPC seems to perform slightly better with more training samples, and aMPC does better with fewer training samples.

V. CONCLUSION

77In this work, we present a novel direct PO method called DPC.We provide a new perspective on the use of differentiable programming for obtaining offline policy gradients that can lead to solutions of the parametric programming problems arising in eMPC.The presented DPC PO can learn stable neural control policies for linear and nonlinear systems subject to state and input constraints.

78The neural control policy can be learned end-to-end without the need for an expert policy to imitate, thus presenting a scalable algorithm for obtaining parametric solutions to constrained optimal control problems.

79Furthermore, we provide sampling-based stochastic performance guarantees of the trained DPC policies by employing Hoeffding's inequality.

80We demonstrate the method in extensive case studies, evaluating the control performance, data efficiency, and scalability against implicit and eMPC, aMPC, and deep RL algorithms.We show that DPC is faster than implicit MPC, has a smaller memory footprint than eMPC, and requires fewer resources for training than aMPC.Based on the reported results and userfriendly open-source implementation [10], the proposed DPC has the potential to be deployed in the application domains beyond the computational reach of the traditional eMPC while providing performance guarantees and sound computational tradeoffs.

Fig. 1 .

81Fig. 1.DPC method.

82and input constraints given as x k ∈ X := {x | −10 ≤ x ≤ 10}, and u k ∈ U := {u | −1 ≤ u ≤ 1}, respectively.For the DPC PO, we consider the following objective:

Fig. 2 .

83Fig. 2. Surfaces of PWA eMPC policy (left) and neural DPC policy (right) for double integrator system (13).

Fig. 3 .

84Fig.3.Closed-loop trajectories of system (13) controlled by stabilizing neural feedback policy trained using Algorithm 1 with DPC problem formulation (1), including terminal constraint x N ∈ X f .

85x ∈ R 2 and u ∈ R 2 are states and inputs that are subject to the box constraints x k ∈ X := {x | −10 ≤ x ≤ 10}, and u k ∈ U := {u | −1 ≤ u ≤ 1}, respectively.Additionally, we consider parametric nonlinear constraints representing an obstacle in the state space

1 )

86Training: Again we use the DPC PO Algorithm 1 for training the parametric neural policy π W (x, ξ ) : R 7 → R N×2 with 4-layer, each having 100 hidden neurons, and ReLU activation functions, where ξ = [b, c, d, r N ].To solve this problem, we consider the following DPC objective with the prediction horizon N = 20:

Fig. 7 .

87Fig. 7. Trajectories in different parametric scenarios of the obstacle avoidance problem (21) computed online using IPOPT and offline using DPC PO Algorithm 1.

88DPC Offline PO 1: input training datasets of initial conditions and problem parameters sampled from distributions P x 0 and P ξ 2: input system dynamics model x k+1 = f θ (x k , u k ) 3: input neural policy architecture π W (x k , ξ k ) 4: input DPC loss L DPC (4) 5: input optimizer O 6: differentiate DPC loss L DPC (4) to obtain the policy gradient ∇ W L DPC (7) 7: learn policy weights W via optimizer O using gradient ∇ W L DPC 8: return optimized policy π W (x k , ξ k )

89an N-step prediction horizon Algorithm 1

Algorithm 2

90Closed-Loop Stability and Constraint Satisfaction Validation of DPC PO Algorithm 1: input stability and constraints indicator functions (10) 2: input confidence δ and admissible risk bound μ bound 3: input sampling parameters m, m max , p 4: sample m IID initial conditions x i 0 ∼ P x 0 , i ∈ N m

TABLE II COMPARISON

91OF ONLINE COMPUTATIONAL TIME OF THE PROPOSED DPC POLICY AND IMPLICIT MPC SOLVED WITH IPOPT

TABLE III ONLINE

92SCALABILITY WITH INCREASING PREDICTION HORIZON N. COMPARISON OF MEAN AND WORST-CASE ONLINE COMPUTATIONAL TIME PER SAMPLE, AND MEMORY FOOTPRINT OF THE PROPOSED DPC POLICY AGAINST IMPLICIT (IMPC) AND EXPLICIT (EMPC) SOLUTIONS, EVALUATED ON THE MODEL FROM EXAMPLE 5 smaller memory footprint across all scales.Both CPU time and memory footprint of the DPC policies scale linearly with the problem complexity, while eMPC solutions scale exponentially and are practically infeasible for larger-scale problems.These findings are supported by the fact that DNNs with ReLU layers are more memory efficient than lookup tables for parametrizing the PWA functions representing eMPC policies

TABLE IV OFFLINE

93SCALABILITY WITH THE NUMBER OF TRAINING SAMPLES.COMPARISON OF THE COMBINED DATASET GENERATION AND TRAINING TIME OF THE AMPC AND THE PROPOSED DPC PO ALGORITHMS, EVALUATED ON THE PROBLEM FROM EXAMPLE 2 WITH PREDICTION HORIZON N = 10 TABLE V PROBABILISTIC PERFORMANCE GUARANTEES THE PROPOSED DPC AND AMPC EVALUATED USING EMPIRICAL RISKS μ AS A FUNCTION OF TRAINING SAMPLES

참고문헌 72건

  1. Introduction to Model Based Optimization of Chemical Processes on Moving Horizons Springer eBooks · Springer Nature · 2001 10.1007/978-3-662-04331-8_18
  2. Approximate Reachability Analysis of Piecewise-Linear Dynamical Systems Lecture notes in computer science · Springer Science+Business Media · 2000 10.1007/3-540-46430-1_6
  3. Truncated backpropagation through time and Kalman filter training for neurocontrol 2002 10.1109/icnn.1994.374611
  4. Multi-Parametric Toolbox 3.0 2022 European Control Conference (ECC) · 2013 10.23919/ecc.2013.6669862
  5. Lectures on modern convex optimization analysis, algorithms, and engineering applications. - Includes index 2001 10.1137/1.9780898718829
  6. Constrained model predictive control: Stability and optimality Automatica · Elsevier BV · 2000 10.1016/s0005-1098(99)00214-9
  7. Clipping-Based Complexity Reduction in Explicit MPC IEEE Transactions on Automatic Control · Institute of Electrical and Electronics Engineers · 2011 10.1109/tac.2011.2179428
  8. An apologia for stabilising terminal conditions in model predictive control International Journal of Control · Taylor & Francis · 2013 10.1080/00207179.2013.813647
  9. Real-Time Model Predictive Control Using a Self-Organizing Neural Network IEEE Transactions on Neural Networks and Learning Systems · Institute of Electrical and Electronics Engineers · 2013 10.1109/tnnls.2013.2261574
  10. Provably safe and robust learning-based model predictive control Automatica · Elsevier BV · 2013 10.1016/j.automatica.2013.02.003
  11. Learning a feasible and stabilizing explicit model predictive control law by robust optimization 2011 10.1109/cdc.2011.6161258
  12. A fast condensing method for solution of linear-quadratic control problems 2013 10.1109/cdc.2013.6761114
  13. A Quasi-Infinite Horizon Nonlinear Model Predictive Control Scheme with Guaranteed Stability∗∗This paper was not presented at any IFAC meeting. This paper was accepted for publication in revised form by Associate Editor W. Bequette under the direction of Editor Prof. S. Skogestad. Automatica · Elsevier BV · 1998 10.1016/s0005-1098(98)00073-9
  14. On the performance of economic model predictive control with self-tuning terminal cost Journal of Process Control · Elsevier BV · 2014 10.1016/j.jprocont.2014.05.009
  15. Robust Model Predictive Control of Nonlinear Systems With Unmodeled Dynamics and Bounded Uncertainties Based on Neural Networks IEEE Transactions on Neural Networks and Learning Systems · Institute of Electrical and Electronics Engineers · 2013 10.1109/tnnls.2013.2275948
  16. Model Predictive Control with generalized terminal state constraint IFAC Proceedings Volumes · Elsevier BV · 2012 10.3182/20120823-5-nl-3013.00063
  17. On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming Mathematical Programming · Springer Science+Business Media · 2005 10.1007/s10107-004-0559-y
  18. Move blocking strategies in receding horizon control Journal of Process Control · Elsevier BV · 2007 10.1016/j.jprocont.2007.01.001
  19. The explicit solution of model predictive control via multiparametric quadratic programming 2000 10.1109/acc.2000.876624
  20. Model Predictive Control Design: New Trends and Tools 2006 10.1109/cdc.2006.377490
  21. On the Number of Linear Regions of Deep Neural Networks arXiv (Cornell University) · Cornell University · 2014 10.48550/arxiv.1402.1869
  22. Reachability Analysis of Discrete-Time Systems With Disturbances IEEE Transactions on Automatic Control · Institute of Electrical and Electronics Engineers · 2006 10.1109/tac.2006.872835
  23. An algorithm for multi-parametric quadratic programming and explicit MPC solutions Proceedings of the 40th IEEE Conference on Decision and Control (Cat. No.01CH37228) · 2003 10.1109/cdc.2001.981048
  24. Predictive control with constraints Automatica · Elsevier BV · 2003 10.1016/s0005-1098(03)00056-6
  25. DeepMPC: Learning Deep Latent Features for Model Predictive Control 2015 10.15607/rss.2015.xi.012
  26. Cautious Model Predictive Control Using Gaussian Process Regression IEEE Transactions on Control Systems Technology · Institute of Electrical and Electronics Engineers · 2019 10.1109/tcst.2019.2949757
  27. OSQP: an operator splitting solver for quadratic programs Mathematical Programming Computation · Springer Science+Business Media · 2020 10.1007/s12532-020-00179-2
  28. MPC-Inspired Neural Network Policies for Sequential Decision Making arXiv (Cornell University) · Cornell University · 2018 10.48550/arxiv.1802.05803
  29. Approximate model predictive building control via machine learning Applied Energy · Elsevier BV · 2018 10.1016/j.apenergy.2018.02.156
  30. 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
  31. CasADi: a software framework for nonlinear optimization and optimal control Mathematical Programming Computation · Springer Science+Business Media · 2018 10.1007/s12532-018-0139-4
  32. Functional Nonlinear Model Predictive Control Based on Adaptive Dynamic Programming IEEE Transactions on Cybernetics · Institute of Electrical and Electronics Engineers · 2018 10.1109/tcyb.2018.2859801
  33. Approximating Explicit Model Predictive Control Using Constrained Neural Networks 2018 10.23919/acc.2018.8431275
  34. Deep Learning-Based Model Predictive Control for Resonant Power Converters IEEE Transactions on Industrial Informatics · Institute of Electrical and Electronics Engineers · 2020 10.1109/tii.2020.2969729
  35. Learning-Based Robust Model Predictive Control with State-Dependent Uncertainty IFAC-PapersOnLine · Elsevier BV · 2018 10.1016/j.ifacol.2018.11.052
  36. Decoupled Weight Decay Regularization arXiv (Cornell University) · Cornell University · 2017 10.48550/arxiv.1711.05101
  37. Embedding Approximate Nonlinear Model Predictive Control at Ultrahigh Speed and Extremely Low Power IEEE Transactions on Control Systems Technology · Institute of Electrical and Electronics Engineers · 2019 10.1109/tcst.2019.2898835
  38. Event-Triggered Model Predictive Control With a Statistical Learning IEEE Transactions on Systems Man and Cybernetics Systems · Institute of Electrical and Electronics Engineers · 2019 10.1109/tsmc.2019.2916626
  39. On the Number of Linear Regions of Deep Neural Networks arXiv (Cornell University) · Cornell University · 2014
  40. Optimal Control Via Neural Networks: A Convex Approach arXiv (Cornell University) · Cornell University · 2018 10.48550/arxiv.1805.11835
  41. A General Safety Framework for Learning-Based Control in Uncertain Robotic Systems IEEE Transactions on Automatic Control · Institute of Electrical and Electronics Engineers · 2018 10.1109/tac.2018.2876389
  42. Adaptive MPC for Iterative Tasks 2018 10.1109/cdc.2018.8618694
  43. Practical Reinforcement Learning of Stabilizing Economic MPC 2019 10.23919/ecc.2019.8795816
  44. Knowledge-Data-Driven Model Predictive Control for a Class of Nonlinear Systems IEEE Transactions on Systems Man and Cybernetics Systems · Institute of Electrical and Electronics Engineers · 2019 10.1109/tsmc.2019.2937002
  45. Safe and Near-Optimal Policy Learning for Model Predictive Control using Primal-Dual Neural Networks 2022 American Control Conference (ACC) · 2019 10.23919/acc.2019.8814335
  46. A nonlinear model predictive control framework using reference generic terminal ingredients -- extended version arXiv (Cornell University) · Cornell University · 2019 10.1109/tac.2019.2949350
  47. Probabilistic performance validation of deep learning‐based robust NMPC controllers International Journal of Robust and Nonlinear Control · Wiley · 2021 10.1002/rnc.5696
  48. Advances in Neural Information Processing Systems 19 The MIT Press eBooks · The MIT Press · 2007 10.7551/mitpress/7503.001.0001
  49. Learning-Based Model Predictive Control: Toward Safe Learning in Control Annual Review of Control Robotics and Autonomous Systems · Annual Reviews · 2019 10.1146/annurev-control-090419-075625
  50. Reinforcement Learning-Based Optimal Stabilization for Unknown Nonlinear Systems Subject to Inputs With Uncertain Constraints IEEE Transactions on Neural Networks and Learning Systems · Institute of Electrical and Electronics Engineers · 2019 10.1109/tnnls.2019.2954983
  51. Cautious Model Predictive Control Using Gaussian Process Regression IEEE Transactions on Control Systems Technology · Institute of Electrical and Electronics Engineers · 2019 10.1109/tcst.2019.2949757
  52. Safety Verification and Robustness Analysis of Neural Networks via Quadratic Constraints and Semidefinite Programming IEEE Transactions on Automatic Control · Institute of Electrical and Electronics Engineers · 2020 10.1109/tac.2020.3046193
  53. Convex Lifting Based Inverse Parametric Optimization for Implicit Model Predictive Control: A Case Study 2021 60th IEEE Conference on Decision and Control (CDC) · 2020 10.1109/cdc42340.2020.9304148
  54. Challenges of real-world reinforcement learning: definitions, benchmarks and analysis Machine Learning · Springer Science+Business Media · 2021 10.1007/s10994-021-05961-4
  55. Approximate moving horizon estimation and robust nonlinear model predictive control via deep learning Computers & Chemical Engineering · Elsevier BV · 2021 10.1016/j.compchemeng.2021.107266
  56. A Neural Network Architecture to Learn Explicit MPC Controllers from Data IFAC-PapersOnLine · Elsevier BV · 2020 10.1016/j.ifacol.2020.12.546
  57. Robust Learning-Based Predictive Control for Discrete-Time Nonlinear Systems With Unknown Dynamics and State Constraints IEEE Transactions on Systems Man and Cybernetics Systems · Institute of Electrical and Electronics Engineers · 2022 10.1109/tsmc.2022.3146284
  58. Adaptive Neural-Network-Based Fault-Tolerant Control for a Flexible String With Composite Disturbance Observer and Input Constraints IEEE Transactions on Cybernetics · Institute of Electrical and Electronics Engineers · 2021 10.1109/tcyb.2021.3090417
  59. Reinforcement Learning based on MPC and the Stochastic Policy Gradient Method 2022 American Control Conference (ACC) · 2021 10.23919/acc50511.2021.9482765
  60. Model-Based Chance-Constrained Reinforcement Learning via Separated Proportional-Integral Lagrangian IEEE Transactions on Neural Networks and Learning Systems · Institute of Electrical and Electronics Engineers · 2022 10.1109/tnnls.2022.3175595
  61. Offline and Online Adaptive Critic Control Designs With Stability Guarantee Through Value Iteration IEEE Transactions on Cybernetics · Institute of Electrical and Electronics Engineers · 2021 10.1109/tcyb.2021.3107801
  62. Large scale model predictive control with neural networks and primal active sets Automatica · Elsevier BV · 2021 10.1016/j.automatica.2021.109947
  63. Action Mapping: A Reinforcement Learning Method for Constrained-Input Systems IEEE Transactions on Neural Networks and Learning Systems · Institute of Electrical and Electronics Engineers · 2022 10.1109/tnnls.2021.3138924
  64. Probability Inequalities for Sums of Bounded Random Variables Journal of the American Statistical Association · 1963 10.1080/01621459.1963.10500830
  65. Convex Optimization 2004 10.1017/cbo9780511804441
  66. Differentiable predictive control: Deep learning alternative to explicit model predictive control for unknown nonlinear systems Journal of Process Control · Elsevier BV · 2022 10.1016/j.jprocont.2022.06.001
  67. Enforcing robust control guarantees within neural network policies arXiv (Cornell University) · Cornell University · 2020 10.48550/arxiv.2011.08105
  68. CVXPY: A Python-Embedded Modeling Language for Convex Optimization arXiv (Cornell University) · Cornell University · 2016 10.48550/arxiv.1603.00943
  69. Learning Stochastic Parametric Diferentiable Predictive Control Policies IFAC-PapersOnLine · Elsevier BV · 2022 10.1016/j.ifacol.2022.09.334
  70. Data-Driven Model-Predictive Control for Nonlinear Systems With Stochastic Sampling Interval IEEE Transactions on Systems Man and Cybernetics Systems · Institute of Electrical and Electronics Engineers · 2022 10.1109/tsmc.2022.3220550
  71. Neural Lyapunov Differentiable Predictive Control 2022 IEEE 61st Conference on Decision and Control (CDC) · 2022 10.1109/cdc51059.2022.9992386
  72. A Differentiable Programming System to Bridge Machine Learning and Scientific Computing arXiv (Cornell University) · Cornell University · 2019 10.48550/arxiv.1907.07587