This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Discrete-time Contraction-based Control of Nonlinear Systems with Parametric Uncertainties using Neural Networks

Lai Wei, Ryan McCloy, and Jie Bao Lai Wei, Ryan McCloy and Jie Bao are with the School of Chemical Engineering, The University of New South Wales (UNSW Sydney), Sydney, NSW 2052, Australia. E-mail: [email protected], [email protected] and [email protected] (corresponding author).This project is partially supported by Australian Research Council (ARC) Discovery Projects DP180101717 and ARC Research Hub IH180100020.
Abstract

In response to the continuously changing feedstock supply and market demand for products with different specifications, the processes need to be operated at time-varying operating conditions and targets (e.g., setpoints) to improve the process economy, in contrast to traditional process operations around predetermined equilibriums. In this paper, a contraction theory-based control approach using neural networks is developed for nonlinear chemical processes to achieve time-varying reference tracking. This approach leverages the universal approximation characteristics of neural networks with discrete-time contraction analysis and control. It involves training a neural network to learn a contraction metric and differential feedback gain, that is embedded in a contraction-based controller. A second, separate neural network is also incorporated into the control-loop to perform online learning of uncertain system model parameters. The resulting control scheme is capable of achieving efficient offset-free tracking of time-varying references, with a full range of model uncertainty, without the need for controller structure redesign as the reference changes. This is a robust approach that can deal with bounded parametric uncertainties in the process model, which are commonly encountered in industrial (chemical) processes. This approach also ensures the process stability during online simultaneous learning and control. Simulation examples are provided to illustrate the above approach.

Index Terms:
Nonlinear control; neural networks; contraction theory; uncertain nonlinear systems; discrete-time control contraction metric

I Introduction

The process industry has seen increasing variability in market demand, with time varying specifications and quantity of products. As an example, there is a trend for produce-to-order operations in polymer [1] and fine chemicals sectors. Variations are also evident in the specifications, costs and supply volume of “raw” materials and energy. Consequently, businesses in the process industry are required to have the flexibility to dynamically adjust the volume and specifications of products, and deal with diverse sources of raw materials to remain competitive [2]. Traditionally, a chemical plant is designed and operated at a certain steady-state operating condition where the plant economy is optimized. The process industry is shifting from the traditional mass production to more agile, cost-effective and dynamic process operation closer to the market, which is the main driver for next-generation “smart plants”. As such, the control systems for modern chemical processes need to have the flexibility to drive a process to any required time-varying operational target (setpoint) to meet the dynamic market demand, with a stability guarantee, especially during the start-up or shut-down of processes.

As most chemical processes are inherently nonlinear, flexible process operation warrants nonlinear control as the target operating conditions may need to vary significantly to minimize the economic cost. Control of nonlinear systems to track a time-varying reference profile and ensure stability (convergence) can be challenging [3]. For general nonlinear systems (e.g., many of them appearing in chemical process systems), common nonlinear control approaches involve stabilization of nonlinear systems with respect to a given fixed equilibrium point, e.g., designing a control Lyapunov function for a given equilibrium point, and based on which, constructing a stabilizing control law. Therefore, every time the reference is changed, a new control Lyapunov function needs to be constructed and the control algorithm needs to be redesigned. This inherent lack of flexibility makes control Lyapunov function-based approaches infeasible for tracking arbitrary time-varying references (such as time-varying product specifications required by the market). To address the above challenge, contraction theory [4, 3] was adopted to study the stability around (or contraction to) arbitrary references and design tracking controllers based on differential dynamics for time-varying (feasible) references of nonlinear systems with stability guarantees and without structural redesign (e.g., [5, 6]).

Neural networks have been used for nonlinear process modeling (e.g.,[7]) due to their ability to universally approximate arbitrary functions, adaptive control [8, 9], finding utilization in model-based control designs, such as model predictive control (MPC) (see, e.g., [10]). Neural networks have also been effectively used in learning control and adaptive control applications [11]. A wide variety of neural network structures are available (e.g., Siamese networks [12]), of which can greatly impact the performance of the trained neural network. However, stability design for neural network-based control is still an open problem. In particular, there are very few results on setpoint-independent nonlinear control, especially when considering (embedding) the neural network within the closed-loop control system. This poses a significant obstacle for the neural network-based control approaches for chemical processes, which are mission critical. It is often impractical to operate a process in a large range of random operating conditions (with sufficient excitations) to produce process data to train neural networks to learn system dynamics (or even directly learn control laws). While such an exploration exercise is often performed for mechanical systems, it is generally infeasible for chemical processes, as many operating conditions may lead to poor product quality and/or inefficient material and energy usage with significant financial penalties. If process stability is not ensured, random process operating conditions can even cause severe safety risks (fires or explosions). Furthermore, chemical processes are typically designed based on known mechanisms and thus chemical process models are often available, although often with model uncertainties such as uncertain parameters within a known range (see, e.g., [13]). As such, one promising approach in chemical process control [14] is to train neural network-based controllers using process data (input/output trajectories) generated from process models and further refine such neural networks using real-world process operating data. An important issue is “safe exploration” (during online simultaneous learning and control using neural networks), i.e., how can the controller explore system trajectories to obtain new operating data, such that the stimulus is sufficient for online learning and refinement of such networks, yet simultaneously ensure process stability by exploiting known trajectories, during online simultaneous learning and control using neural networks. Inspired by [14, 15], we aim to develop such a “safe” neural network-based online learning approach to determine uncertain system parameters by “exploiting” a neural network embedded controller that is designed offline via the contraction theory framework.

To address the problem of controlling discrete-time nonlinear systems with parametric uncertainties, this article presents a systematic approach to obtaining a novel contraction-based controller with online parameter learning that embeds neural networks. Using properties of contracting discrete-time systems, we develop a novel approach that uses neural networks to synthesize DCCMs. This approach utilizes the nonlinear process model to train the DCCM neural network representations of the DCCM and differential feedback control gain (from which the control law can be computed). To train the DCCM neural network, a Siamese (or twin) neural network [12] is employed to ensure both steps in the state trajectory share the same state-dependent DCCM. A neural network-based learning module is also incorporated into the control-loop, such that any uncertain parameters can be identified online. Finally, conditions to ensure offset-free tracking (after system parameters are correctly identified), or bounded tracking (when parameters are modeled with known uncertainty bounds), to feasible references are derived. The resulting contraction-based controller embeds a neural network.

This article is structured as follows. Section II formulates the problem of tracking-time varying references for uncertain nonlinear systems with neural networks in the closed loop, and the proposed approach which leverages the contraction theory framework. Section III presents the main approach to designing a discrete-time contraction-based controller for discrete-time systems with parametric uncertainties using DCCM neural networks and learning of uncertain parameters via estimation neural networks. Section IV develops the conditions for the existence of contracting regions under the proposed neural network-based method of Section III. Section V presents illustrative examples, followed by Section VI which concludes the article.

Notation.

Function fkf_{k} is defined as fk=f(xk)f_{k}=f(x_{k}) for any function ff, \mathbb{Z} represents the set of all integers, +\mathbb{Z}^{+} represents the set of positive integers, \mathbb{R} represents set of real numbers.

II Problem Formulation and Approach

II-A Contraction Theory Overview

Contraction theory [4, 3] facilitates stability analysis and control of discrete-time nonlinear systems with respect to arbitrary, time-varying (feasible) references, without redesigning the control algorithm, through the study of corresponding displacement dynamics or differential dynamics. The analysis and controller synthesis to ensure stability/contraction of the nonlinear system is simultaneously completed via discrete-time control contraction metrics (DCCMs). To introduce the contraction-based methodology, we firstly consider the discrete-time nonlinear control affine system without uncertainty (extended in later sections)

xk+1=f(xk)+g(xk)uk,x_{k+1}=f(x_{k})+g(x_{k})u_{k}, (1)

where state and control are xk𝒳nx_{k}\in\mathcal{X}\subseteq\mathbb{R}^{n} and uk𝒰mu_{k}\in\mathcal{U}\subseteq\mathbb{R}^{m}. The corresponding differential system of (1) is as follows

Refer to caption
Figure 1: System trajectories along the state manifold 𝒳\mathcal{X}.
δxk+1=Akδxk+Bkδuk,\delta_{x_{k+1}}=A_{k}\delta_{x_{k}}+B_{k}\delta_{u_{k}}, (2)

where Jacobian matrices of ff and gg in (1) are defined as Ak=A(xk):=(f(xk)+g(xk)uk)xkA_{k}=A(x_{k}):=\frac{\partial(f(x_{k})+g(x_{k})u_{k})}{\partial x_{k}} and Bk=B(xk):=(f(xk)+g(xk)uk)ukB_{k}=B(x_{k}):=\frac{\partial(f(x_{k})+g(x_{k})u_{k})}{\partial u_{k}} respectively, δuk:=uks\delta_{u_{k}}:=\frac{\partial u_{k}}{\partial s} and δxk:=xks\delta_{x_{k}}:=\frac{\partial x_{k}}{\partial s} are vectors in the tangent space Tx𝒰T_{x}\mathcal{U} at uku_{k} and Tx𝒳T_{x}\mathcal{X} at xkx_{k} respectively, where ss parameterises a path, c(s):[0,1]𝒳c(s):[0,1]\rightarrow\mathcal{X} between two points such that c(0)=x,c(1)=x𝒳c(0)=x,c(1)=x^{*}\in\mathcal{X} (see Fig. 1). Considering a state-feedback control law for the differential dynamics (2),

δuk=K(xk)δxk,\delta_{u_{k}}=K(x_{k})\delta_{x_{k}}, (3)

where KK is a state dependent function, we then have from [4, 3] the following definition for a contracting system.

Definition 1.

A discrete-time nonlinear system (1), with differential dynamics (2) and differential state-feedback controller (3), is contracting, with respect to a uniformly bounded metric, α1IM(xk)α2I\alpha_{1}I\leq M(x_{k})\leq\alpha_{2}I (for constants α2α1>0\alpha_{2}\geq\alpha_{1}>0), provided, x𝒳\forall x\in\mathcal{X} and δxTx𝒳\forall\delta_{x}\in T_{x}\mathcal{X},

(Ak+BkKk)Mk+1(Ak+BkKk)(1β)Mk<0,(A_{k}+B_{k}K_{k})^{\top}M_{k+1}(A_{k}+B_{k}K_{k})-(1-\beta)M_{k}<0, (4)

for some constant contraction rate 0<β10<\beta\leq 1, where Mk=M(xk)M_{k}=M(x_{k}) and Mk+1=M(xk+1)M_{k+1}=M(x_{k+1}).

A region of state space is called a contraction region if condition (4) holds for all points in that region. In Definition 1, MM is a metric used in describing the geometry of Riemannian space, which we briefly present here. We define the Riemannian distance, d(x,x)d(x,x^{*}), as a measure for the tracking performance (convergence/stability of the state, xx, to the reference, xx^{*}), and is defined as (see, e.g., [16])

d(x,x)=d(c):=01δc(s)M(c(s))δc(s)𝑑s,\displaystyle d(x,x^{*})=d(c):=\int_{0}^{1}\sqrt{\delta^{\top}_{c(s)}M(c(s))\delta_{c(s)}}ds, (5)

where δc(s):=c(s)s\delta_{c(s)}:=\frac{\partial c(s)}{\partial s}. The shortest path in Riemannian space, or geodesic, between xx and xx^{*} is defined as

γ(s):=argminc(s)d(x,x).\gamma(s):=\operatorname*{arg\,min}_{c(s)}{d(x,x^{*})}. (6)

Leveraging Riemannian tools, one feasible feedback tracking controller for (1), can be obtained by integrating the differential feedback law (3) along the geodesic, γ(s)\gamma(s) (6), as

uk=uk+01K(γ(s))γ(s)s𝑑s.u_{k}=u^{*}_{k}+\int_{0}^{1}K(\gamma(s))\frac{\partial\gamma(s)}{\partial s}\,ds. (7)

Note, that this particular formulation is reference-independent, since the target trajectory variations do not require structural redesign of the feedback controller and is naturally befitting to the flexible manufacturing paradigm. Moreover, the discrete-time control input, uku_{k} (7), is a function with arguments (xkx_{k}, xkx^{*}_{k}, uku^{*}_{k}) and hence the control action is computed from the current state and target trajectory.

Then, under Definition 1 for a contracting system, e.g., (1) driven by (7), we have

d(γk+1)(1β)12d(γk),d(\gamma_{k+1})\leq(1-\beta)^{\frac{1}{2}}d(\gamma_{k}), (8)

which states that the Riemannian distance between the state trajectory, xx, and a desired trajectory, xx^{*} is shrinking (i.e., convergence of the state to the reference), with respect to the DCCM, MM, with at least constant rate.

II-B System Description

To address parametric uncertainties, for the remainder of this article, we consider the following discrete-time control affine nonlinear system with parametric uncertainty

xk+1=f(r,xk)+g(r,xk)uk,x_{k+1}=f(r,x_{k})+g(r,x_{k})u_{k}, (9)

where vector rr represents the bounded uncertain parameters,

r={r|ri,minrri,max|i=1,,},r\in\mathcal{R}=\{r\in\mathbb{R}^{\ell}~{}|~{}r_{i,min}\leq r\leq r_{i,max}~{}|~{}i=1,\dots,\ell\}, (10)

and functions ff and gg are smooth along the xx direction and Lipschitz continuous along rr. The corresponding differential dynamics (and hence the contraction condition) can be determined for any specific value of the parameter rr, i.e.,

δxk+1=A(r,xk)δxk+B(r,xk)δuk,\delta_{x_{k+1}}=A(r,x_{k})\delta_{x_{k}}+B(r,x_{k})\delta_{u_{k}}, (11)

where A(r,xk):=(f(r,xk)+g(r,xk)uk)xkA(r,x_{k}):=\frac{\partial(f(r,x_{k})+g(r,x_{k})u_{k})}{\partial x_{k}} and B(r,xk):=(f(r,xk)+g(r,xk)uk)ukB(r,x_{k}):=\frac{\partial(f(r,x_{k})+g(r,x_{k})u_{k})}{\partial u_{k}}. Hence, from Section II-A, a function pair (M,KM,K), satisfying the contraction condition (4) for any rr\in\mathcal{R}, i.e., satisfying

(Ak(r)+Bk(r)Kk)Mk+1(Ak(r)+Bk(r)Kk)\displaystyle\left(A_{k}(r)+B_{k}(r)K_{k}\right)^{\top}M_{k+1}\left(A_{k}(r)+B_{k}(r)K_{k}\right) (12)
(1β)Mk<0,r.\displaystyle-(1-\beta)M_{k}<0,\qquad\forall r\in\mathcal{R}.

ensures contraction of the uncertain system (9) for the full range of uncertainty.

II-C Objective and Approach

The main objective is to ensure offset-free tracking of (a priori unknown) time-varying references for an uncertain nonlinear system (9). Time-varying references are generated using an estimate of the uncertain parameter r^k\hat{r}_{k}, such that the reference sequence (x,u)(x^{*},u^{*}) satisfies the following

xk+1=f(r,xk)+g(r,xk)uk,x_{k+1}^{*}=f(r^{*},x_{k}^{*})+g(r^{*},x_{k}^{*})u_{k}^{*}, (13)

where rk=r^kr^{*}_{k}=\hat{r}_{k}. Suppose that we have the desired state trajectory (xk,xk+1)(x^{*}_{k},x^{*}_{k+1}). The corresponding target control input, uku_{k}, can be obtained, given a system model and an estimated parameter value, r^k\hat{r}_{k}, by solution to (13). These solutions, (xk,xk+1,uk)(x^{*}_{k},x^{*}_{k+1},u^{*}_{k}), are only feasible solutions for the actual system dynamics (9) when the estimated parameter, r^\hat{r}, is equal to the physical system value, rr. Consequently, generating control references subject to parameter modelling error will result in incorrect control targets and hence state tracking offsets (see, e.g., [17]). Thus, our ensuing objective is to force the parameter estimate, r^\hat{r}, to approach the real value, rr, online, whilst ensuring stability (to reference targets) for the full range of parameter variation.

To ensure stability/convergence to any (feasible) reference trajectories for the full range of parameter variation, a contraction theory-based structure is imposed during training of a neural network embedded controller offline. Instead of using the process model to generate process data for general neural network training, we propose to use the model to directly learn the crucial information for the contraction-based control design (satisfying (12)): the contraction metric (DCCM), which implies how the process nonlinearity affects the contraction behavior; and a differential feedback gain, from which the control action is computed. This trained DCCM neural network is then embedded in a contraction-based structure for (state-feedback) real-time control providing stability guarantees across the full range of parametric uncertainty (“exploitation”). This then facilitates online learning of uncertain system parameters within the control-loop (“safe exploration” see, e.g., [14, 15] for further discussion).

By integrating the power of well-studied, model-based modern control methods with the inherent ability of neural networks to handle system uncertainties, the proposed approach provides: (1) a systematic and efficient approach to embedding neural networks in the closed-loop control scheme; (2) certificates for stabilizability to arbitrary (feasible) time-varying references without structural redesign of the controller, by imposing a contraction-based controller structure and conditions; and (3) online model correction through iterative learning of uncertain system parameters.

III Neural Network Approach to Contraction Analysis and Control of Uncertain Nonlinear Systems

The following sections detail the proposed neural network embedded contraction-based control with online parameter learning approach as follows. Firstly, the family of models (9) is used to generate the state data and local values of the Jacobian matrices for training (with both arbitrary and specific distributions permitted). Secondly, the data set is fed into a neural network to learn the function pair (M,K)(M,K) satisfying (12), using a tailored loss function. Then, the controller is constructed using the function pair (MNN,KNN)(M_{NN},K_{NN}) (both of which are represented by the DCCM neural network) by implementing (7). Finally, a neural network-based parameter learning module is incorporated into the control-loop, to provide online estimation of uncertain parameters, as required for correct reference generation and offset-free tracking.

III-A Model-based Data Generation

The first step in the proposed methodology is to generate data, 𝒟\mathcal{D}, from a family of system models (9). As discussed in the Introduction, to operate a chemical process using random operating conditions to generate process data to learn an accurate model is infeasible due to stability/safety concerns. The idea proposed in the following is to use a model with uncertain parameters (which characterizes the inherent uncertain nonlinear nature of modern processes) to generate data, which can be done safely offline for an explicit range of uncertainty in the system model. The contraction-based analysis is performed for the full range of system uncertainty to ensure the contraction-based controller to be robust. In this way, provided the actual system model behaves inside the family of models considered, efficient and stabilizing control combined with online parameter learning can be achieved.

In order to impose the contraction conditions (12) during training, which utilizes the generated data set, consideration as to which parameters must be included in 𝒟\mathcal{D} is required. The Jacobian matrices, Ak(r,xk)A_{k}(r,x_{k}) and Bk(r,xk)B_{k}(r,x_{k}), can be explicitly calculated from the system model (9) for specific rr values (see (11)). If the distribution for the uncertain parameter is known, then rr can be generated as a random variable with such a distribution to produce a more realistic data set for the uncertain model. Calculation of Mk+1M_{k+1} requires the possible next-step states (i.e., given a specific state, xk𝒳x_{k}\in\mathcal{X}, generate all possible next-step states, xk+1𝒳x_{k+1}\in\mathcal{X}, for all possible inputs, uk𝒰u_{k}\in\mathcal{U}, using (9)). Consequently, the Jacobian matrices Ak(r,xk),Bk(r,xk)A_{k}(r,x_{k}),B_{k}(r,x_{k}) and the two-step trajectories, xk,xk+1x_{k},x_{k+1}, under specific rr, are needed in the data set, 𝒟\mathcal{D}. Algorithm 1 summarizes the data set generation procedure.

Initialize r,s,xkr,s,x_{k} and uku_{k} with lower bound values
for rr\in\mathcal{R} do
       for xk𝒳x_{k}\in\mathcal{X} do
             for uk𝒰u_{k}\in\mathcal{U} do
                   Calculate xk+1=f(r,xk)+g(r,xk)ukx_{k+1}=f(r,x_{k})+g(r,x_{k})u_{k}.
                   Compute Ak,BkA_{k},B_{k}.
                   Store {r,xk,xk+1,Ak,Bk}i\{r,x_{k},x_{k+1},A_{k},B_{k}\}_{i} in data set 𝒟\mathcal{D}.
             end for
            
       end for
      
end for
Algorithm 1 Data Set Generation.
Remark 1.

The data set generation process can be accelerated by paralleling Algorithm 1, i.e. to calculate {xk+1,Ak,Bk}\{x_{k+1},A_{k},B_{k}\} with each {r,xk,uk}×𝒳×𝒰\{r,x_{k},u_{k}\}\in\mathcal{R}\times\mathcal{X}\times\mathcal{U} in parallel.

Remark 2.

An ideal data set would include all possible two-step-trajectories, xk,xk+1x_{k},x_{k+1}, and Jacobians, AkA_{k}, BkB_{k}, under all possible combinations of rr\in\mathcal{R}, xk𝒳x_{k}\in\mathcal{X}, uk𝒰u_{k}\in\mathcal{U}. Naturally, numerical implementation of Algorithm 1 requires discretization of these continuous sets (see, e.g., (10)) using a sufficiently small step size (forming, e.g., a mesh of states). The mesh can be nonlinear, depending on the nonlinearity of the system dynamics and additionally chosen to be finer near reference trajectories, i.e., to provide better accuracy when close to the desired state and corresponding control input. The condition on the mesh size to ensure contraction will be discussed in Section IV

Remark 3.

Straightforward extensions can be made to Algorithm 1 such that the data set, 𝒟\mathcal{D}, is generated whilst additionally considering measurement noise. For example, the next step state values, xk+1x_{k+1}, could be generated using the small state perturbation xk+ηx_{k}+\eta, where η\eta denotes a bounded measurement noise variable. Consequently, the learned DCCM will inherently be capable of handling measurement noise, although this would require additional extension of the system model and hence contraction analysis that follows (e.g., via adaptation of the results in [18]). Additionally, through straightforward modifications, guaranteed bounded disturbance responses could be shaped from the disturbance input to the state or output (e.g., via the differential dissipativity approach of [19]). Both the measurement noise accommodation and disturbance rejection extensions are omitted from this article to avoid over-complicating the presentation.

III-B DCCM Synthesis from Data

In this work, a DCCM neural network is employed to represent the function pair (MM,KK) satisfying (12). The structure of this DCCM neural network is shown in Fig. 2, whereby the inputs are the states of the system and the outputs are the numerical values of the matrices MNNM_{NN} and KNNK_{NN} for the corresponding states. Since the DCCM, MNNM_{NN}, is a symmetric matrix, only the lower triangular components of MNNM_{NN} are of interest (i.e., only the lower triangular matrix is required to fully construct MNNM_{NN}). Consequently, the first group of outputs are the components in the lower triangular matrix of MNNM_{NN} and the second group of outputs are the components of the controller gain KNNK_{NN} (see Fig. 2). Moreover, by exploiting the symmetric property of MNNM_{NN} the computational complexity is significantly reduced (only requiring n(n+1)/2n(n+1)/2 decision variables or network outputs).

Refer to caption
Figure 2: Illustration of the DCCM neural network structure.

III-B1 Loss Function Design

In order to train the DCCM neural network, a suitable loss function, LL, is required. Inspired by the triplet loss in [20], a novel (non-quadratic) objective loss function is developed herein to represent the positive definite properties of the neural represented metric function, MNNM_{NN}, and contraction condition (12). By reforming (12), we can rewrite the negative semi-definite uncertain contraction condition as a positive semi-definite condition (required for the subsequent loss function and training approach). Hence, we define Ω\Omega as (cf. (12))

Ω:=Acl,k(r)MNNk+1Acl,k(r)+(1β)MNNk,\Omega:=-A_{cl,k}(r)^{\top}M_{{NN}_{k+1}}A_{cl,k}(r)+(1-\beta)M_{NN_{k}}, (14)

where Acl,k(r):=Ak(r)+Bk(r)KNNkA_{cl,k}(r):=A_{k}(r)+B_{k}(r)K_{NN_{k}}. Then if Ω0\Omega\geq 0, the contraction condition (12) holds. Since these two conditions are inequalities of matrices, it is befitting to formulate the following loss function, LL, based on quadratic penalty functions (see, e.g.,[21])

LMi\displaystyle L_{M_{i}} ={(|MNN(1,i)|ϵi)if(|MNN(1,i)|ϵi)00else\displaystyle=\begin{cases}-(|M_{NN_{(1,i)}}|-\epsilon_{i})&if~{}(|M_{NN_{(1,i)}}|-\epsilon_{i})\leq 0\\ 0\ &else\end{cases} (15)
LΩj\displaystyle L_{\Omega j} ={(|Ω(1,j)|ϵj)if(|Ω(1,j)|ϵj)00else\displaystyle=\begin{cases}-(|\Omega_{(1,j)}|-\epsilon_{j})\quad\ &if~{}(|\Omega_{(1,j)}|-\epsilon_{j})\leq 0\\ 0\ &else\end{cases}
L\displaystyle L =iLMi+jLΩj,\displaystyle=\sum_{i}L_{Mi}+\sum_{j}L_{\Omega j},

where |MNN(1,i)||M_{NN_{(1,i)}}| is the leading principle minor of MNNM_{NN} including the first ii rows and columns (i.e square submatrix) of matrix MNNM_{NN} and similarly for Ω(1,i)\Omega_{(1,i)}. Under Sylvester’s criterion, by ensuring that each leading principle minor is positive, we can ensure the positive-definiteness of MNNM_{NN} and Ω\Omega. A small positive value, ϵi\epsilon_{i} or ϵj\epsilon_{j}, is introduced to reduce the effects of numerical errors, which may effectively return a semi-definite (or possible non-convergence) result. Each LMiL_{M_{i}} or LMjL_{M_{j}} returns a higher cost if the leading principle minor is smaller than ϵi\epsilon_{i} or ϵj\epsilon_{j}, otherwise, it returns zero. This encourages convergence of the leading principle minor to some value larger than ϵi\epsilon_{i} or ϵj\epsilon_{j}. The loss function, LL, (the sum of all LMiL_{Mi} and LΩjL_{\Omega j}), encourages all leading principle minors to be positive and hence the positive definiteness of both matrices, MNNM_{NN} and Ω\Omega, which consequently implies MNNM_{NN} is a DCCM for the contraction of (9). Compared to existing CCM synthesis approaches using SoS programming, the proposed method permits contraction metric and feedback gain synthesis for non-polynomial system descriptions in addition to systems modeled with parametric uncertainty.

III-B2 DCCM Neural Network Training

Refer to caption
Figure 3: DCCM neural network training process block diagram.

Using the training data set, 𝒟\mathcal{D}, generated from Algorithm 1 and loss function (15), we detail here the process for training the DCCM neural network function pair (MNN,KNN)(M_{NN},K_{NN}). The DCCM neural network cannot be simply trained using the generalized structure in Fig. 2, as the loss function (15) requires both the DCCM neural network output under input, xkx_{k}, and also the output under input, xk+1x_{k+1}, since (14) requires both MNNkM_{NN_{k}} and MNNk+1M_{NN_{k+1}} at the next step (i.e., MNN(xk+1)M_{NN}(x_{k+1}) evaluated using MNN(xk)M_{NN}(x_{k}) and stepping forward using (9)). To overcome this difficulty, we adopted a Siamese network (see Fig. 3) structure, whereby two neural networks, sharing the same weights, can be tuned at the same time, by considering both outputs of the weight sharing neural networks simultaneously. In addition, the Siamese network structure permits the use of outputs at time step kk and k+1k+1 in the loss function. Furthermore, the learning can be done in parallel using a GPU to speed up the training, i.e. the complete set, 𝒟\mathcal{D} is treated as a batch, and a total loss, LtL_{t}, is defined by summing every loss function, LiL_{i}, where LiL_{i} is the output from each element {r,xk,xk+1,Ak,Bk}i\{r,x_{k},x_{k+1},A_{k},B_{k}\}_{i} in 𝒟\mathcal{D}. Algorithm 2 describes the training procedure for the Siamese neural network, with further details and discussion provided subsequently.

Stack elements, {r,xk,xk+1,Ak,Bk}i𝒟\{r,x_{k},x_{k+1},A_{k},B_{k}\}_{i}\in\mathcal{D} as a batch
for itermaxiterationnumberiter\leq\ max\ iteration\ number do
       for each element {r,xk,xk+1,Ak,Bk}i𝒟\{r,x_{k},x_{k+1},A_{k},B_{k}\}_{i}\in\mathcal{D} do
             Feed xkx_{k} into the Siamese neural network.
             Feed xk+1x_{k+1} into the Siamese neural network.
             Construct MNNk,MNNk+1M_{NN_{k}},M_{NN_{k+1}} and KNNkK_{NN_{k}}.
             Calculate the ii-th element loss, LiL_{i}, as in (15).
            
       end for
      Calculate total loss Lt=iLiL_{t}=\sum_{i}{L_{i}}.
       Proceed backward propagation.
       if Lt<ϵminL_{t}<\epsilon_{min} then Break.
end for
Save MNNM_{NN} and KNNK_{NN}.
Algorithm 2 Training Procedure

The first step in Algorithm 2, is to feed the two-step trajectories, xk,xk+1x_{k},x_{k+1}, into the Siamese networks, which have two sets of outputs, MNNk,KNNkM_{NN_{k}},K_{NN_{k}} and MNNk+1M_{NN_{k+1}}. Then, MNNk,KNNkM_{NN_{k}},K_{NN_{k}} and MNNk+1M_{NN_{k+1}} are used to calculate the loss function, LiL_{i} (15) for {r,xk,xk+1,Ak,Bk}i\{r,x_{k},x_{k+1},A_{k},B_{k}\}_{i}. The DCCM neural network is trained using backward propagation, whereby the loss is summed cumulatively at each iteration. As described in Algorithm 2, each iteration involves calculating the total loss, LtL_{t}, for the all elements in the data set; however, if the number of elements is sufficiently large, this process can be batch executed. The learning process is finally terminated when the total loss, LtL_{t}, is small enough, or the max number of predefined iterations is reached. The error threshold, ϵmin\epsilon_{min}, is the smallest among all ϵi\epsilon_{i} or ϵj\epsilon_{j} in (15), which implies that provided the cumulative error is lower than this threshold, the contraction condition is satisfied for each point in the data set.

The computational complexity of the training process in Algorithm 2 can be expressed in terms of the number of floating point operations (FLOPs). Feeding one element of the data set, e.g., the ii-th element {r,xk,xk+1,Ak,Bk}i\{r,x_{k},x_{k+1},A_{k},B_{k}\}_{i}, through the Siamese network in Fig. 3, the computation requires FLOPs=2j(2Ij1)Oj+2Nnode+2n3+n2+2i=1nFLOPsdethFLOPs=2\sum_{j}{(2I_{j}-1)O_{j}}+2N_{node}+2n^{3}+n^{2}+2\sum_{i=1}^{n}FLOPs_{det_{h}}, where IjI_{j} and OjO_{j} represent the number of inputs and outputs of layer jj respectively [22], NnodeN_{node} represents the number of nodes of one neural network in Fig. 2, nn is the order of the system and FLOPsdethFLOPs_{det_{h}} represents the number of FLOPs for the determinant calculation of an h×hh\times h matrix (see, e.g., [23] for more details).

Remark 4.

A number of existing strategies are available for quantifying the “success” of a trained DCCM neural network, e.g., through testing and verification or statistical analysis and performance metrics. As an example, we note that the training methodology presented, is capable of incorporating direct validation by splitting or generating multiple data sets, say one for training, 𝒟T\mathcal{D}_{T}, and another for validation, 𝒟V\mathcal{D}_{V}, whereby each set can be given context specific weighting, pending, e.g., the target system trajectories or known regions of typical or safety critical operation. Due to the task specific nature of this process and range of techniques available, we have omitted its presentation here for clarity and refer the interested reader to [24] for further details. Herein, and without loss of generality, we assume the training process was completed sufficiently, i.e., the training process was not stopped due to exceeding the maximum number of iterations, with a level of accuracy sufficient for the desired control application.

III-C Neural Network Embedded Contraction-based Controller

This section details the implementation of a contraction-based controller, of the form in (7), that is obtained by embedding a neural network representation of the function pair (M,K)(M,K), i.e., MNNM_{NN} and KNNK_{NN} (calculated using Algorithms 1 and 2). Foremost, the proposed neural network embedded contraction-based controller is described by (cf. (7))

uk=uk+01KNN(γ(s))γ(s)s𝑑s,u_{k}=u^{*}_{k}+\int_{0}^{1}K_{NN}(\gamma(s))\frac{\partial\gamma(s)}{\partial s}\,ds, (16)

where (xk,uk)(x_{k}^{*},u_{k}^{*}) are the state and control reference trajectories at time kk. When the desired state value, xkx_{k}^{*}, changes, the feed-forward component, uku_{k}^{*}, can be instantly updated, and the feedback component, KNNδγ𝑑s\int K_{NN}\delta_{\gamma}\,ds, can be automatically updated through online geodesic calculation. Note that this approach results in setpoint-independent control synthesis. From (5) and (6), the geodesic, γ\gamma, is calculated as

γ(x,x):\displaystyle\gamma(x,x^{*}): =argmincd(x,x)\displaystyle=\operatorname*{arg\,min}_{c}{d(x,x^{*})} (17)
=argminc01c(s)sTMNN(c(s))c(s)s𝑑s,\displaystyle=\operatorname*{arg\,min}_{c}\int_{0}^{1}{\frac{\partial c(s)}{\partial s}^{T}M_{NN}(c(s))\frac{\partial c(s)}{\partial s}ds},

where MNNM_{NN} and KNNK_{NN} are the function pair (M,K)(M,K) represented by the DCCM neural network (see Fig. 2), and recall from Section II-A that c(s)c(s) is an ss-parameterized smooth curve connecting xx (s=0s=0) to xx^{*} (s=1s=1). Implementing the contraction-based controller (7) requires integrating the feedback law along the geodesic, γ\gamma, in (6). Subsequently, one method to numerically approximate the geodesic is shown. Since (17) is an infinite dimensional problem over all smooth curves, without explicit analytical solution, the problem must be discretized to be numerically solved. Note that the integral can be approximated by discrete summation provided the discrete steps are sufficiently small. As a result, the geodesic (17) can be numerically calculated by solving the following optimization problem,

γ¯(x,x)=argminΔx~s\displaystyle\bar{\gamma}(x,x^{*})=\operatorname*{arg\,min}_{\Delta\tilde{x}_{s}} i=1NΔx~siTMNN(x~i)Δx~siΔsi\displaystyle\sum_{i=1}^{N}{\Delta\tilde{x}_{s_{i}}^{T}M_{NN}(\tilde{x}_{i})\Delta\tilde{x}_{s_{i}}\Delta s_{i}} (18)
s.t.\displaystyle s.t. x~1=x,x~N=x,\displaystyle\tilde{x}_{1}=x,~{}\tilde{x}_{N}=x^{*},

where γ¯(x,x)γ(x,x)\bar{\gamma}(x,x^{*})\approx\gamma(x,x^{*}) represents the numerically approximated geodesic, xx and xx^{*} are the endpoints of the geodesic, x~i\tilde{x}_{i} represents ii-th point on a discrete path in the state space, Δx~si:=Δx~i/Δsic(s)/s\Delta\tilde{x}_{s_{i}}:=\Delta{\tilde{x}_{i}}/\Delta{s_{i}}\approx{\partial c(s)}/{\partial s} can be interpreted as the displacement vector discretized with respect to the ss parameter, Δx~s:=(Δx~s1,,Δx~sN)\Delta\tilde{x}_{s}:=(\Delta\tilde{x}_{s_{1}},\dots,\Delta\tilde{x}_{s_{N}}) is the discretized path joining xx to xx^{*} (i.e., discretization of c(s) in (17)), all Δsi\Delta{s_{i}} are small positive scalar values chosen such that i=1NΔsi=1\sum_{i=1}^{N}\Delta s_{i}=1, NN is the chosen number of discretization steps (of s), x~i=j=1iΔx~sjΔsj+x\tilde{x}_{i}=\sum_{j=1}^{i}\Delta\tilde{x}_{s_{j}}\Delta s_{j}+x represents the numerical state evaluation along the geodesic.

Remark 5.

Note that (18) is the discretization of (17) with Δx~si\Delta\tilde{x}_{s_{i}} and Δsi\Delta_{s_{i}} as the discretizations of c(s)s\frac{\partial c(s)}{\partial s} and δs\delta_{s} respectively, whereby the constraints in (18) ensure that the discretized path connecting the start, xx, and end, xx^{*}, state values align with the continuous integral from s=0s=0 to s=1s=1. Hence, as Δsi\Delta_{s_{i}} approaches 0, i.e., for an infinitesimally small discretization step size, the approximated discrete summation in (18) converges to the smooth integral in (17).

After the geodesic is numerically calculated using (18), the control law in (7) can be analogously calculated using an equivalent discretization as follows

uk=uk+i=1NΔx~siΔsiKNN(x~i).u_{k}=u_{k}^{*}+\sum_{i=1}^{N}\Delta\tilde{x}_{s_{i}}\Delta s_{i}K_{NN}(\tilde{x}_{i}). (19)

The state reference, xx^{*}, is chosen to follow some desired trajectory, for which the corresponding instantaneous input, uu^{*}, can be computed via real-time optimization methods (see “Reference Generator” in Fig. 5), such that the triplet (xk,uk,xk+1)(x_{k}^{*},u_{k}^{*},x_{k+1}^{*}), obtained from (13), satisfies (9) for a specific value of the uncertain parameter, i.e., only when the modeled parameter matches the physical value, or r=rr^{*}=r. The choice for this reference value, rr^{*}, for the purpose of reference design, can be selected as the most likely or expected value for the uncertain parameter, i.e., r=𝔼[r]r^{*}=\operatorname{\mathbb{E}}[r]. Hence, the corresponding desired control input at any time, uku^{*}_{k}, can be calculated from (13) as the expected corresponding control effort, u=𝔼[uk]u^{*}=\operatorname{\mathbb{E}}[u^{*}_{k}], given both the desired state values, xk,xk+1x^{*}_{k},x^{*}_{k+1}, and expected value for rr. Suppose then, that there was some error (e.g., due to modeling) between the chosen uncertain parameter, rr^{*}, and the exact value for rr. Consequently, there will be some error when computing the corresponding control effort for the desired state trajectory (via (9)), and moreover, for the resulting control effort in (16), denoted by u~k=u¯kuk\tilde{u}_{k}=\bar{u}_{k}-u_{k}^{*}, where u¯k\bar{u}_{k} represents the control input reference generated using the correct parameter value rr. The resulting disturbed system, can be modeled, using (9), as

xk+1=f(r,xk)+g(r,xk)(uk+u~k),x_{k+1}=f(r,x_{k})+g(r,x_{k})(u_{k}+\tilde{u}_{k}), (20)

where uku_{k} has the same form as (7). Inspired by the results in [4], we have then have the following contraction result.

Lemma 1.

For the DCCM-based controller (7) that ensures a system without uncertainty (1) is contracting, when parametric uncertainty is present (20), the state trajectory, xx, is driven by (7) to the bounding ball around the target reference, xx^{*}, as

d(γk+1)(1β)12d(γk)+α2Gku~k.d(\gamma_{k+1})\leq(1-\beta)^{\frac{1}{2}}d(\gamma_{k})+\sqrt{\alpha_{2}}G_{k}\|\tilde{u}_{k}\|. (21)
Proof.

A Riemannian space is a metric space, thus from the definition of a metric function (see e.g.,[25]) and from Definition 1 we have the following inequality,

d(γ(xk+1,xk+1))=d(γ(xˇ+g(r,xk)u~k,xk+1))\displaystyle d(\gamma(x_{k+1},x_{k+1}^{*}))=d(\gamma(\check{x}+g(r,x_{k})\tilde{u}_{k},x_{k+1}^{*})) (22)
d(γ(xˇk+1,xk+1))+d(γ(xˇk+1+g(r,xk)u~k,xˇk+1)),\displaystyle\leq d(\gamma(\check{x}_{k+1},x_{k+1}^{*}))+d(\gamma(\check{x}_{k+1}+g(r,x_{k})\tilde{u}_{k},\check{x}_{k+1})),

where xˇk+1:=f(r,xk)+g(r,xk)uk\check{x}_{k+1}:=f(r,x_{k})+g(r,x_{k})u_{k}. Now, we consider the last two components of (22). Firstly, from (8), we have d(γ(xˇk+1,xk+1))(1β)12d(γ(xk,xk))d(\gamma(\check{x}_{k+1},x_{k+1}^{*}))\leq(1-\beta)^{\frac{1}{2}}d(\gamma(x_{k},x_{k}^{*})). Secondly, since the metric, MkM_{k}, is bounded by definition, then, d(γ(xˇk+1+g(r,xk)u~k,xˇk+1))α2Gku~kd(\gamma(\check{x}_{k+1}+g(r,x_{k})\tilde{u}_{k},\check{x}_{k+1}))\leq\sqrt{\alpha_{2}}G_{k}\|\tilde{u}_{k}\|, where Gk=maxxkg(r,xk)G_{k}=\max_{x_{k}}\|g(r,x_{k})\|. Thus we have the conclusion in (21). ∎

Remark 6.

The condition in (21) (cf. (8)) requires the disturbance term, gku~kg_{k}\tilde{u}_{k} in (20), to be bounded. The control deviation, u~k\tilde{u}_{k} is a constant, given a particular value for rr, and it is a reasonable assumption that in control practice, the control-to-state mapping, gkg_{k}, is also bounded for all kk.

The choice for the uncertain parameter, rr^{*}, when designing the reference trajectory, (x,u)(x^{*},u^{*}), directly affects the radius of the ball to which the system (1) contracts, and naturally, a finite upper limit on the radius, due to this design choice, exists and can be described by the maximum disturbance, i.e., maxα2gku~k\max\sqrt{\alpha_{2}}\|g_{k}\tilde{u}_{k}\|. For continuity, note that by designing the reference about the expected value of the uncertain parameter, the expected radius of the bounding ball in (21) is zero and hence (cf. (8)) recovers the undisturbed or exact contraction results of Section II-A (see specifically Definition 1) when the expected parameter value correctly matches the physical value. Following this idea, we will present a method in the following section to adjust the reference parameter, rr^{*}, such that it converges to the physical value, rr, hence facilitating offset-free tracking.

III-D Online Parameter Learning

As Lemma 1 provides conditions for closed-loop system stability for a range of uncertain parameters, it serves the foundation for “safe exploration” [14, 15], through the addition of an online parameter estimation module, whilst maintaining stabilizing control. The additional parameter learning module (e.g., neural network training algorithm) is included in the closed-loop to learn the correct value of any uncertain parameters, such that correct reference generation and hence offset-free control can be obtained. Naturally befitting the existing approach, we present here a neural network based online parameter identification method. The estimation neural network is constructed as shown in Fig. 4, whereby the input is the current system state, xk=(x1,,xn)x_{k}=(x_{1},\cdots,x_{n})^{\top}, and the output is the uncertain parameter estimate, r^k=(r^1,,r^)\hat{r}_{k}=(\hat{r}_{1},\cdots,\hat{r}_{\ell})^{\top}. This chosen neural network structure is a generalized treatment for parameter identification/estimation. It allows for extensions to state-dependent uncertain system parameters (e.g., the rate of a chemical reaction can be a function of the temperature (a state variable) in a chemical reactor) or a more general case that uncertain parameters can represent unknown/unmodeled system dynamics.

Refer to caption
Figure 4: Illustration of the online parameter estimation neural network training process.

To facilitate the learning process, as shown in Fig. 4, a loss function, LolL_{ol}, is constructed to represent the error of prediction, defined as

Lol=xkf(r^,xk1)g(r^,xk1,uk1).L_{ol}=\|x_{k}-f(\hat{r},x_{k-1})-g(\hat{r},x_{k-1},u_{k-1})\|. (23)

To clarify, rr^{*} is the value used for reference generation (as per Section III-C), which is updated by online parameter estimates, r^\hat{r}, for the physical system parameter, rr, using the proposed Algorithm 3. The initial estimate (used for reference generation), is taken as the expected (albeit potentially incorrect) value for the uncertain parameter, r¯\bar{r} (as per Section III-C).

Initialize the estimation neural network.
for Each time step kk do
       Append {xk1,uk1,xk}i\{x_{k-1},u_{k-1},x_{k}\}_{i} to the training data-set, 𝒟e\mathcal{D}_{e}, for the estimation neural network.
       for itermaxiterationnumberiter\leq max~{}iteration~{}number do
             for Each element ii in 𝒟e\mathcal{D}_{e} do
                   Calculate Lol,iL_{ol,i} using (23).
                   Backpropagate using Lol,iL_{ol,i}.
                  
             end for
            if maxiLol,i<ϵol\max_{i}L_{ol,i}<\epsilon_{ol} then Break.
       end for
      if r^k\hat{r}_{k}\in\mathcal{R} in (10) then
             Output r^k\hat{r}_{k}.
       else
             Output r^k1\hat{r}_{k-1}.
             Reinitialize the estimation neural network.
       end if
      
end for
Algorithm 3 Online Parameter Learning
Remark 7.

The learning algorithm needs sufficient non-repeating data (utilizing the reference model (13) with the past state, control input, reference target and uncertain parameter values) to meet the minimum requirement for parameter convergence. Moreover, the amount of data required for identifiability increases with the dimensionality of the parametric uncertainty (see, e.g., [26] for further discussion).

Algorithm 3 describes the procedure of parameter estimation in the time interval [k,k+1)[k,k+1). Suppose HH denotes the number of available recorded time steps (historical data elements), then the data set, 𝒟e\mathcal{D}_{e}, contains the collection of elements {xkH,xkH+1,,xk1}\{x_{k-H},x_{k-H+1},\cdots,x_{k-1}\}. Since the parameter estimation neural network is trained using backward propagation, if the number of elements is sufficiently large, this process can be batch executed (in parallel). The parameter learning process is finally terminated when the largest loss among elements in 𝒟e\mathcal{D}_{e} is small enough (using the arbitrarily small threshold ϵol\epsilon_{ol}), or the max number of predefined iterations is reached, implying that the estimation error is sufficiently small for each historical element in the data set. Importantly, the estimated parameter, r^k\hat{r}_{k}, is forced to lie inside the known bound (rmin,rmax)(r_{min},r_{max}), satisfying (10), as required to ensure that the contraction-based controller maintains stability (as per Lemma 1). As the estimated parameter, r^\hat{r}, converges to the physical value, rr, the reference model (13) converges to that of the physical system (9), leading to the following conclusion for the closed-loop.

Corollary 1.

The discrete-time nonlinear system (9), with neural network embedded controller (16), is stable with respect to a target reference (bounded convergence), in the sense of Lemma 1. Provided Algorithm 3 converges, the Riemannian distance between the system state and the desired reference additionally shrinks to zero.

Proof.

The proof is straightforward by noting that the uncertainty results of Lemma 1 collapse to that of Definition 1 when the uncertain parameter rr is correctly identified. From convergence of Algorithm 3, the reference generating model (13) matches precisely the physical system (9), i.e., r=r^=rr^{*}=\hat{r}=r. ∎

III-E Synthesis and Implementation Summary

Lemma 1 guarantees that a contraction-based controller (designed offline via Algorithms 1 and 2) will at least drive an uncertain nonlinear system to a small neighborhood about any reference generated using the model in (13). Since stability is guaranteed (in the sense of boundedness about the target trajectory), we can update online the reference model using the identified parameter in Algorithm 3 (provided the estimation satisfies (10)). As stated in Corollary 1, when the reference model matches precisely the physical system, i.e., the parametric uncertainty is removed through online identification (estimation), the neural network embedded contraction-based controller (16) also guarantees error free tracking. The proposed control synthesis and implementation (see Fig. 5) approach can be summarized as follows:

Offline:

  1. i.

    Using the system model (9), generate training data, 𝒟\mathcal{D}, via Algorithm 1.

  2. ii.

    Using the training data, 𝒟\mathcal{D}, learn the metric, MNNM_{NN}, and differential feedback gain, KNNK_{NN}, via Algorithm 2.

  3. iii.

    Assign the reference model parameter, rr^{*}, with the expected uncertain parameter value, r¯\bar{r}, i.e., r=r¯r^{*}=\bar{r}.

Online: For each time step kk

  1. i.

    Update the identified parameters r^k\hat{r}_{k} using Algorithm 3 and generate the reference triplet, (xk,uk,xk+1)(x_{k}^{*},u_{k}^{*},x_{k+1}^{*}) using the updated system model (13) with r=r^kr^{*}=\hat{r}_{k}.

  2. ii.

    Feed the state measurement, xkx_{k}, into the DCCM neural network to determine the current step metric and feedback gain, MNNM_{NN} and KNNK_{NN}, as per Fig. 2.

  3. iii.

    Calculate the numerical geodesic, γ¯(xk,xk)\bar{\gamma}(x_{k},x_{k}^{*}), connecting the state, xkx_{k}, to the desired reference xkx_{k}^{*}, via solution to (18) using the metric, MNNM_{NN}.

  4. iv.

    Using the geodesic information, γ¯k\bar{\gamma}_{k}, differential feedback gain, KNNK_{NN}, and the control reference, uku_{k}^{*}, implement the control, uku_{k}, via (19).

The proposed control approach is well suited for the dynamic control of modern industrial processes that are naturally highly nonlinear and modeled with uncertainty. Since the contraction metric, MNNM_{NN} (and thus the corresponding feedback control law (19)) is valid for the full range of parameter variation in rr (and hence r^)\hat{r}), the parameter used by the reference generator, rr^{*}, can be safely updated (explored) online simultaneously with control of the process. As a result, the proposed approach is capable of providing reference flexibility and efficient setpoint/trajectory tracking to ensure market competitiveness. Certificates for stability, to ensure safe and reliable operation, are explicitly detailed in the following section. The proposed contraction-based controller embeds neural networks, as shown in Fig. 5.

Refer to caption
Figure 5: Proposed neural network embedded contraction-based control scheme.

IV Design Analysis

In practice, the DCCM neural network should be trained with a finite data set to make using Algorithms 1 and 2 computationally tractable. The finite data set, 𝒟\mathcal{D}, is comprised of a grid of points in ×𝒳×𝒰\mathcal{R}\times\mathcal{X}\times\mathcal{U}, which naturally depends on the discretization step size or grid resolution (see Remark 2). In this section, we develop bounding conditions on the contraction properties for the entire region of interest, when only a discrete number of data points are available. For clarity of presentation, we begin with considering the control affine system without uncertainty in (1). The following theorem describes contraction regions in the form of a finite ball surrounding a known contracting point.

Theorem 1.

If the contraction condition in (4) holds for a state and control value pair (x,u)(x^{\star},u^{\star}) (satisfying (1)), then there exists a ball B((x,u),ξ)B((x^{\star},u^{\star}),\xi) with radius ξ=(ξx,ξu)\xi=(\xi_{x},\xi_{u}), centered at (x,u)(x^{\star},u^{\star}), in which the system (1) is locally contracting with a rate no slower than λLxuξ\lambda-L_{xu}\|\xi\|, where λ\lambda is the desired contraction rate and LxuL_{xu} is a Lipschitz constant.

Proof.

Consider a function

h(xk,uk):=maxeig((Θk1)Acl,kMk+1Acl,kΘk1I)),\displaystyle h(x_{k},u_{k}):=\max\operatorname*{eig}((\Theta_{k}^{-1})^{\top}A_{cl,k}^{\top}M_{k+1}A_{cl,k}\Theta_{k}^{-1}-I)), (24)

where Acl,k:=Ak+BkKkA_{cl,k}:=A_{k}+B_{k}K_{k} and Mk=:ΘkΘkM_{k}=:\Theta_{k}^{\top}\Theta_{k}. Since all arguments of hh are assumed to be smooth, we can apply a Lipschitz condition to function hh, yielding

|h(x+ξx,u+ξu)h(x,u)|Lxu|ξ|,|h(x^{\star}+\xi_{x},u^{\star}+\xi_{u})-h(x^{\star},u^{\star})|\leq L_{xu}|\xi|, (25)

where LxuL_{xu} is a Lipschitz constant. By definition [4], we have h(xk,uk)λh(x_{k},u_{k})\leq-\lambda . Hence, the largest variation of hh inside the ball can be upper bounded by

h(x+ξx,u+ξu)h(x,u)+Lxu|ξ|λ+Lxu|ξ|.h(x^{\star}+\xi_{x},u^{\star}+\xi_{u})\leq h(x^{\star},u^{\star})+L_{xu}|\xi|\leq-\lambda+L_{xu}|\xi|. (26)

Provided λ+Lxu|ξ|<0-\lambda+L_{xu}|\xi|<0, the system (1) is contracting inside the ball, for which, there always exists a |ξ||\xi| to ensure this negative condition. Moreover, the minimum contraction rate can be directly obtained by considering the maximum eigenvalue inside the ball. ∎

Theorem 1 describes a local contraction property in the space 𝒳×𝒰\mathcal{X}\times\mathcal{U}. This property is generalized to the space 𝒳\mathcal{X} in the following extension, by considering all possible control values, u𝒰u\in\mathcal{U}, for a particular state value, x𝒳x^{\star}\in\mathcal{X}.

Corollary 2.

If the ball B((x,uj),ξ)B((x^{\star},u^{j}),\xi) centered at (x,uj)(x^{\star},u^{j}) forms a local contraction region for the system in (1) (for some control value uju^{j}), and Bx(x,ξx)×𝒰𝑗B((x,uj),ξ)B_{x}(x^{\star},\xi_{x})\times\mathcal{U}\subseteq\underset{j}{\bigcup}B((x^{\star},u^{j}),\xi), then the system is locally contracting within Bx(x,ξx)B_{x}(x^{\star},\xi_{x}) at xx^{\star}.

Proof.

From (24), we have the contraction condition holds at different uju^{j} with radius ξu\xi_{u}. If these balls are connected, then, there exists a ball around xx^{\star} such that Bx(x,ξx)×𝒰𝑗B((x,uj),ξ)B_{x}(x^{\star},\xi_{x})\times\mathcal{U}\subseteq\underset{j}{\bigcup}B((x^{\star},u^{j}),\xi). ∎

These results are extended in the following to systems with parametric uncertainties by considering locally contracting regions in the space 𝒳×𝒰×\mathcal{X}\times\mathcal{U}\times\mathcal{R} and hence the entire space of uncertainty, \mathcal{R}.

Corollary 3.

If the contraction condition in (12) holds for the uncertain parameter value rr^{\star} with state and control pair (x,u)(x^{\star},u^{\star}) for the system (9), then there exists a ball B((x,u,r),ξ)B((x^{\star},u^{\star},r^{\star}),\xi) with radius ξ=(ξx,ξu,ξr)\xi=(\xi_{x},\xi_{u},\xi_{r}) centered at (x,u,r)(x^{\star},u^{\star},r^{\star}), for which the system (9) is locally contracting. Moreover, if Bx(x,ξx)×𝒰×j,B((x,uj,r),ξ)B_{x}(x^{\star},\xi_{x})\times\mathcal{U}\times\mathcal{R}\subseteq\underset{j,\ell}{\bigcup}B((x^{\star},u^{j},r^{\ell}),\xi), the system is locally contracting within Bx(x,ξx)B_{x}(x^{\star},\xi_{x}) at xx^{\star}.

Proof.

These results are straightforward extensions of Theorem 1 and Corollary 2, by considering an additional parameter rr and hence dimension, i.e., r\forall r\in\mathcal{R}. ∎

By combining multiple locally contracting regions, a larger region of interest, 𝒮\mathcal{S}, can be formed, for which we have the following immediate result.

Corollary 4.

If there exist multiple locally contracting regions Bx,i:=Bx(xi,ξx,i)B_{x,i}:=B_{x}(x^{i},\xi_{x,i}) such that Sx𝑖Bx,iS_{x}\subseteq\underset{i}{\bigcup}B_{x,i} (where Sx𝒳S_{x}\subseteq\mathcal{X} is an area of interest), then the area SxS_{x} is a contraction region with the minimum contraction rate λ𝒮x,min\lambda_{\mathcal{S}_{x},min} given by

λ𝒮x,min=mini(λLxurξi).\lambda_{\mathcal{S}_{x},min}=\min_{i}(\lambda-L_{xur}||\xi_{i}||). (27)
Proof.

This result is straightforward from Theorem 2, by following a similar approach to the proof of Corollary 2, where h(x+ξx,u+ξu,r+ξr)λ+Lxur|ξ|h(x^{\star}+\xi_{x},u^{\star}+\xi_{u},r^{\star}+\xi_{r})\leq-\lambda+L_{xur}|\xi| and LxurL_{xur} is a Lipschitz constant. The minimum contraction rate inside the region of interest is obtained by considering the maximum eigenvalue among local contraction regions covering the whole space of interest SxS_{x}. ∎

Theorem 1 and Corollaries 24 state that the contraction property of a nonlinear system with parametric uncertainty can be determined by checking a finite number of local conditions (e.g., across a grid of state values). In this way, a contraction rate close to the desired one can be achieved for an uncertain nonlinear system (1) using finite data sets, hence making Algorithms 1 and 2 tractable. As the number of data points increases (and hence, considering increasingly small balls about each point), the minimum contraction rate for the unified region of interest, SxS_{x}, approaches the desired contraction rate.

V Illustrative Example

To illustrate the proposed control design method and performance for both certain and uncertain nonlinear discrete-time systems, we present here two simulation examples which consider the following discrete-time model for a continuously stirred tank reactor (CSTR) [6]:

[x1k+1x2k+1]=[0.9x1k+0.1ϕ1(x1k)eαx2kα+x2k+0.1(1ζ)x1k0.9x2k+0.1Bϕ2(x1k)eαx2kα+x2k+uk],\begin{bmatrix}x_{1_{k+1}}\\ x_{2_{k+1}}\end{bmatrix}=\begin{bmatrix}\begin{aligned} &0.9x_{1_{k}}+0.1\phi_{1}(x_{1_{k}})e^{\frac{\alpha x_{2_{k}}}{\alpha+x_{2_{k}}}}+0.1(1-\zeta)x_{1_{k}}\\ &0.9x_{2_{k}}+0.1B\phi_{2}(x_{1_{k}})e^{\frac{\alpha x_{2_{k}}}{\alpha+x_{2_{k}}}}+u_{k}\end{aligned}\end{bmatrix}, (28)

where ϕi=Dai(1x1k)\phi_{i}=Da_{i}(1-x_{1_{k}}), Da1=1.25Da_{1}=1.25, Da2=2.5Da_{2}=2.5, ζ=0.1\zeta=0.1, α=0.8\alpha=0.8 and the uncertain parameter B[1,3]B\in[1,3] with the true value B=1B=1. The state and input constraints are x1k[0.1,1.1]x_{1_{k}}\in[0.1,1.1], x2k[0.1,1.1]x_{2_{k}}\in[0.1,1.1] and uk[1,1]u_{k}\in[-1,1], respectively. The normalized reactant concentration, reactor temperature and jacket temperature are denoted by x1kx_{1_{k}}, x2kx_{2_{k}} and uku_{k}, respectively. The time-varying state setpoints (based on the market demand and energy cost) are as follows:

(x1(t),x2(t))={(0.939,0.297),t[0,0.5)(0.945,0.547),t[0.5,1],(x_{1}^{*}(t),x_{2}^{*}(t))=\begin{cases}(0.939,0.297),&\!\forall t\in[0,0.5)\\ (0.945,0.547),&\!\forall t\in[0.5,1]\end{cases}, (29)

whereby the control reference uu^{*} can be computed analytically using the system model (28) and B=B=1B^{*}=B=1 as u=0.050u^{*}=0.050 t[0,0.5)\forall t\in[0,0.5) and u=0.1u^{*}=0.1 t[0.5,1]\forall t\in[0.5,1]. Similarly, when BB is incorrectly modeled, e.g., B=3B^{*}=3, the (incorrect) control reference is computed as u=0.0312u^{*}=0.0312 t[0,0.5)\forall t\in[0,0.5) and u=0.0811u^{*}=0.0811 t[0.5,1]\forall t\in[0.5,1].

Data generation was conducted offline using Algorithm 1 via a square mesh of state (xkx_{k}), control (uku_{k}), and uncertain parameter (BB) values, with steps of 160\frac{1}{60}, 110\frac{1}{10}, and 110\frac{1}{10} respectively. The DCCM and parameter estimation neural networks were both designed with ReLU hidden layer activation, linear input/output layer activation, a weight decay coefficient of 0.50.5, and decay rates of β1=0.1\beta_{1}=0.1, β2=0.9\beta_{2}=0.9. The function pair (MNN,KNN)(M_{NN},K_{NN}) was trained offline via Algorithm 2 using the DCCM neural network structure as in Fig. 2 and Fig. 3 (with a learning rate of 0.050.05, 33 hidden layers, and 1010 neurons per hidden layer). For the system in this example, processing one element of data using the proposed neural network (shown in Fig. 3) requires 32043204 FLOPs. To significantly reduce the training time, the DCCM neural network training algorithm was executed in parallel. Parameter estimates for BB were obtained via Algorithm 3 online, using the parameter estimation neural network as in Fig. 4 (with a learning rate of 0.000250.00025, 11 hidden layer, and 44 neurons per hidden layer).

The CSTR was simulated using the proposed control design (as shown in Fig. 5) for the scenario when the reference generator uses the correct system parameter B=B=1B^{*}=B=1 (hence, online learning is not required). Fig. 6 shows that when the exact model is known the discrete-time neural network embedded contraction-based controller (19) is capable of offset-free tracking. The system was then simulated with incorrect value of BB (with B=3B^{*}=3), and without online parameter learning. Fig. 7 shows that bounded tracking was achieved as per Lemma 1 (observe that the Riemannian geodesic distance, d(γ(x,x))d(\gamma(x,x^{*})), converges to a non-zero value comparatively), whereby the incorrect control reference uu^{*} generated using the incorrect value for BB caused the tracking offsets (see Section III-C). To further demonstrate the overall control approach, the same incorrectly modeled system was then simulated with the online parameter estimation module active from time t0.1ht\geq 0.1h. As shown in Fig. 8, the proposed approach achieved bounded reference tracking (as per Lemma 1) when parametric uncertainty was present (see t[0,0.1h)t\in[0,0.1h)), and after the online parameter learning algorithm converged, offset free tracking (see also d(γ(x,x))0d(\gamma(x,x^{*}))\to 0) was achieved as per Corollary 1.

Refer to caption
Figure 6: Simulation of CSTR control without parametric uncertainty.
Refer to caption
Figure 7: Simulation of CSTR control with parametric uncertainty and without parameter learning.
Refer to caption
Figure 8: Simulation of CSTR control with parametric uncertainty and online parameter learning active from t0.1ht\geq 0.1h.

VI Conclusion

In this article, a framework was developed to train a DCCM neural network (contraction metric and feedback gain) for contraction analysis and control using a nonlinear system model with parametric uncertainties. Considerations were made for the discrete-time contraction and stability for certain nonlinear systems, which for known bounds on modeling uncertainty, were then extended to provide direct analysis and controller synthesis tools for the contraction of uncertain nonlinear systems. An online parameter “safe” learning module was also included into the control-loop to facilitate correct reference generation and consequently offset-free tracking. The resulting contraction-based controller, which embeds the trained DCCM neural network, was shown capable of achieving efficient tracking of time-varying references, for the full range of model uncertainty, without the need for controller structure redesign.

References

  • [1] C. Zhang, Z. Shao, X. Chen, X. Gu, L. Feng, and L. T. Biegler, “Optimal flowsheet configuration of a polymerization process with embedded molecular weight distributions,” AIChE Journal, vol. 62, no. 1, pp. 131–145, 2016.
  • [2] N. N. Chokshi and D. C. McFarlane, “DRPC: Distributed reconfigurable process control,” A Distributed Coordination Approach to Reconfigurable Process Control, pp. 43–49, 2008.
  • [3] I. R. Manchester and J.-J. E. Slotine, “Control contraction metrics: Convex and intrinsic criteria for nonlinear feedback design,” IEEE Transactions on Automatic Control, vol. 62, no. 6, pp. 3046–3053, 2017.
  • [4] W. Lohmiller and J.-J. E. Slotine, “On contraction analysis for non-linear systems,” Automatica, vol. 34, no. 6, pp. 683–696, 1998.
  • [5] R. McCloy and J. Bao, “Contraction-based control of switched nonlinear systems using dwell times and switched contraction metrics,” IEEE Control Systems Letters, vol. 6, pp. 1382–1387, 2022.
  • [6] R. McCloy, R. Wang, and J. Bao, “Differential dissipativity based distributed MPC for flexible operation of nonlinear plantwide systems,” Journal of Process Control, vol. 97, pp. 45–58, 2021.
  • [7] S.-L. Dai, C. Wang, and M. Wang, “Dynamic learning from adaptive neural network control of a class of nonaffine nonlinear systems,” IEEE Transactions on Neural Networks and Learning Systems, vol. 25, no. 1, pp. 111–123, 2013.
  • [8] W. He, Y. Chen, and Z. Yin, “Adaptive neural network control of an uncertain robot with full-state constraints,” IEEE Transactions on Cybernetics, vol. 46, no. 3, pp. 620–629, 2016.
  • [9] H. D. Patino and D. Liu, “Neural network-based model reference adaptive control system,” IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), vol. 30, no. 1, pp. 198–204, 2000.
  • [10] T. Wang, H. Gao, and J. Qiu, “A combined adaptive neural network and nonlinear model predictive control for multirate networked industrial process control,” IEEE Transactions on Neural Networks and Learning Systems, vol. 27, no. 2, pp. 416–425, 2015.
  • [11] S. S. Ge, C. C. Hang, T. H. Lee, and T. Zhang, Stable Adaptive Neural Network Control.   Springer, 2013, vol. 13.
  • [12] D. Sheng and G. Fazekas, “A feature learning Siamese model for intelligent control of the dynamic range compressor,” in International Joint Conference on Neural Networks (IJCNN), 2019, pp. 1–8.
  • [13] G. Leitmann, “On one approach to the control of uncertain systems,” Journal of Dynamic Systems, Measurement, and Control, vol. 115, no. 2B, pp. 373–380, 1993.
  • [14] J. Shin, T. A. Badgwell, K.-H. Liu, and J. H. Lee, “Reinforcement learning–overview of recent progress and implications for process control,” Computers & Chemical Engineering, vol. 127, pp. 282–294, 2019.
  • [15] M. Črepinšek, S.-H. Liu, and M. Mernik, “Exploration and exploitation in evolutionary algorithms: A survey,” ACM computing surveys (CSUR), vol. 45, no. 3, pp. 1–33, 2013.
  • [16] M. do Carmo, Riemannian Geometry.   Birkhäuser, 1992.
  • [17] L. Wei, R. McCloy, and J. Bao, “Control contraction metric synthesis for discrete-time nonlinear systems,” in 11th IFAC Symposium on Advanced Control of Chemical Processes (Keynote Presentation), 2021.
  • [18] Q.-C. Pham, N. Tabareau, and J.-J. Slotine, “A contraction theory approach to stochastic incremental stability,” IEEE Transactions on Automatic Control, vol. 54, no. 4, pp. 816–820, 2009.
  • [19] R. Wang and J. Bao, “Distributed plantwide control based on differential dissipativity,” International Journal of Robust and Nonlinear Control, vol. 27, no. 13, pp. 2253–2274, 2017.
  • [20] F. Schroff, D. Kalenichenko, and J. Philbin, “FaceNet: A unified embedding for face recognition and clustering,” in Conference on Computer Vision and Pattern Recognition, 2015, pp. 815–823.
  • [21] D. P. Bertsekas, “On penalty and multiplier methods for constrained minimization,” SIAM Journal on Control and Optimization, vol. 14, no. 2, pp. 216–235, 1976.
  • [22] P. Molchanov, S. Tyree, T. Karras, T. Aila, and J. Kautz, “Pruning convolutional neural networks for resource efficient inference,” in 5th International Conference on Learning Representations, ICLR 2017-Conference Track Proceedings, 2019.
  • [23] S. P. Boyd and L. Vandenberghe, Convex optimization.   Cambridge University Press, 2004.
  • [24] B. J. Taylor, Methods and Procedures for the Verification and Validation of Artificial Neural Networks.   Springer, 2006.
  • [25] M. A. Armstrong, Basic Topology.   Springer, 2013.
  • [26] A. Olivier and A. W. Smyth, “On the performance of online parameter estimation algorithms in systems with various identifiability properties,” Frontiers in Built Environment, vol. 3, p. 14, 2017.