Data-Driven Predictive Control of Interconnected Systems Using the Koopman Operator

: Interconnected systems are widespread in modern technological systems. Designing a reliable control strategy requires modeling and analysis of the system, which can be a complicated, or even impossible, task in some cases. However, current technological developments in data sensing, processing, and storage make data-driven control techniques an appealing alternative solution. In this work, a design methodology of a decentralized control strategy is developed for interconnected systems based only on local and interconnection time series. Then, the optimization problem associated with the predictive control design is deﬁned. Finally, an extension to interconnected systems coupled through their input signals is discussed. Simulations of two coupled Dufﬁng oscillators, a bipedal locomotion model, and a four water tank system show the effectiveness of the approach.


Introduction
Many problems in engineering involve coupled dynamics, and designing a reliable control strategy for these systems requires an adequate understanding of the underlying dynamics. Interconnected systems are present in several areas of science and technology, from robotics to power grids and social systems [1][2][3]. In these examples, there may be several subsystems that are interconnected in one way or another, and handling the interconnections presents significant challenges in the analysis and design of control strategies. Traditionally, the derivation of state equations comes from applying physical principles to generate control-oriented models. However, due to the complexity of the system, modeling its interactions is a difficult, or even impossible, task in some cases.
Nevertheless, current technological developments in data sensing, processing, and storage, together with the large amount of information available, make data-driven control techniques an appealing alternative solution [4]. Early approaches to address the control synthesis of systems with unknown dynamical coupling relied on the framework of adaptive control. In [5], the authors presented a decentralized adaptive control for estimating dynamical couplings among subsystems. This adaptive approach dealt with a class of nonlinear systems, and it was able to compensate the interconnection with only local measurements. The assumption of a matching condition was relaxed, transforming the systems into a strict feedback form and validating the boundedness of the tracking error through classical Lyapunov techniques. Similarly, in [6], the authors proposed parameter estimation in the feedback control to compensate dynamical interactions. Adaptivity was based on radial basis neural networks, and a guarantee on the asymptotic tracking error was provided without knowledge of bounds on coupling dynamics. In [7], the authors considered time delay in a model reference adaptive control scheme.
However, most of the aforementioned approaches require satisfying the condition of persistent excitation and also detailed knowledge of the interconnection structure, which can be difficult in practice. On the other hand, taking advantage of a data-driven approach is appealing, and the Koopman operator has gained attention for its ability to evolve nonlinear dynamics in a function-space (lifted space of observables) in a linear form. The main issue with this approach is that the lifted dynamics act in an infinite-dimensional space [8]. Some form of truncation will therefore be required, implying a compromise between accuracy and dimensionality. Recently, the extended dynamic mode decomposition algorithm (EDMD) has been shown to be successful in obtaining a finite approximation of linear operators on the subspace spanned by a set of basis functions. Therefore, traditional techniques for the control synthesis have been extended to the Koopman operator framework [9]. Additionally, the Koopman theory provides solutions for dynamical systems that include coupled dynamics. For instance, the authors of [10] presented a methodology for reduced-order modeling using the Koopman theory in stochastic nonlinear coupled dynamical systems. The authors developed an empirical data-driven methodology to reduce the system. Alternatively, the authors in [3] presented a model reduction of agent-based systems using the Koopman generator. An interesting example of the datadriven Koopman operator identification and its relation with networked systems was presented in [11]. The authors used the operator generator to approximate the vector field of a network with nonlinear couplings, providing in turn the network structure. Continuing with the relationship between the Koopman operator and network topology, in [12,13], the authors used the dynamic mode decomposition (DMD) algorithm to make an approximation of the underlying topology. Others variants for high-dimensional systems are focused on efficient computation. For example, reference [14] investigated the EDMD based on Cholesky decomposition for dealing with high-dimensional systems and evaluated its performance with a network of coupled oscillators and a large-scale power system.
To date (and to the best of our knowledge), Koopman-based lifting techniques have not been developed yet to control coupled nonlinear systems. The objective of this study is, therefore, to present a methodology to design a decentralized control for interconnected systems based on local and interconnection data time series (experimental measurements or simulation of an existing simulator in any format). The main contributions of this work are threefold: (a) a local control-oriented model is developed based on data without knowledge of local dynamics or interconnection, (b) the optimization problem associated with the predictive control design is formulated, and (c) an identification procedure for systems, which are coupled through their inputs, is proposed.
The remainder of this paper is structured as follows: Section 2 introduces the Koopman operator and its finite dimensional approximation. In Section 3, the local control-oriented model of interconnected systems is derived, while a decentralized predictive control strategy is developed in Section 4. In Section 5, the control strategy is applied to three representative case studies, and the simulations results are discussed. Finally, Section 6 concludes the work and presents some future directions.

Preliminaries
This section presents a brief description of the general framework of the Koopman operator for data-driven control, followed by its finite numerical approximation.

The Koopman Operator for Control Systems
Consider a discrete-time dynamical system where x(t) ∈ R n and u(t) ∈ R m , T : R n × R m → R n is assumed to be at least C 1 , and t ∈ Z ≥0 . The Koopman operator has gained attention for its ability to evolve nonlinear dynamics in a function-space, i.e., the lifted space of observables, in a linear form.
Given the vector space of measurement functions called observables F with observable functions ψ ∈ F , we can define the Koopman operator for the system with inputs As mentioned above, the Koopman operator is a linear representation of nonlinear dynamics in a lifted space, with the compromise that it is infinite-dimensional, making it intractable to implement directly in an engineering application. Hence, it is necessary to obtain a finite-dimensional approximation. The next section briefly presents the method to obtain the finite dimensional approximation.

Finite Dimensional Approximation
In line with the data-driven nature of the algorithm, it is assumed that enough snapshot pairs of data are available for the computation, where each pair corresponds to y = T(x, u) with and the vector of data inputs is denoted by U = [u 1 , · · · , u M ]. The objective is to build a linear model in lifted space as follows, where Ψ (·) are basis functions, A ∈ R K×K , B ∈ R K×m . It is, therefore, possible to determine the linear operators A and B that best fit the evolution of observables by solving the following optimization problem where F stands for the Frobenius norm [15,16]. The minimization problem gives a linear solution in the lifted space, where the evolution of the lifted state Ψ y = [ψ 1 (y), . . . , ψ K (y)] , is the lifted state, i.e., Ψ x = [ψ 1 (x), . . . , ψ K (x)] , weighted by the linear operator A plus the effect of the input. To retrieve the original states from the lifted space, we solve the least square problem as follows min where C ∈ R n×K ; alternatively, C may be computed explicitly as where † denotes the Pseudo-inverse. The selection of a set of basis functions can be arbitrary but the optimal choice to approximate the Koopman operator associated with complex systems is still a challenge. Possible choices are sets of orthogonal polynomials [17], orthogonal polynomials with functional embeddings [18], and radial-basis functions [11], among others. In the following, radial basis functions are selected in view of their performance in predicting the states, which is crucial in the MPC approach. For practical purposes, the observable functions may also contain the state variables; therefore, the solution to matrix C can be obtained in the form C = [I, 0].

Problem Statement
It is assumed that the composite system (1) can be decomposed as where f i and g ij are nonlinear maps for local and interconnected dynamics, N i are the neighboring systems that exchange energy with the local system, and B is the local input matrix. Let x i ∈ R n i be the local states, x j ∈ R n j the states of a particular neighbor, u i ∈ R m i control input, n = ∑ i n i , and m = ∑ i m i . The models of the component systems are unknown, but sets of measurements of inputs and local and coupled states are available. Our goal is to design a control strategy that considers the nonlinear dynamics with only the available data. The Koopman operator framework is used to find a local and finite linear approximation to model the nonlinear dynamics. Additionally, it is assumed that the linearization of each subsystem is controllable, and the coupling dynamics are Lipschitz bounded. Under the previous considerations, a linear representation in the lifted space is obtained with the following structure where z j represents the lifted state of the interconnection dynamics. In the next section, the construction of the linear representation is detailed.

EDMD for Interconnected Systems
In order to build the linear representation, it is assumed that data are available from the inputs to the local system, the measurements of the local state, and the value of the neighboring system states, which are interconnected with the local system. The notation for this data tuple is {x n i , y n i , x n j , y n j , u n i } M n=1 . The data in the lifted space is given by , and the input matrix U defined in Section 2.2. The operator approximation matrices come from the solution of the following least-squares problem with the explicit solution determined by Sometimes the time-series may be affected by noise, and the least-square optimization problem is solved with regularized terms as where α 1,2 are tuning parameters. With the main concepts of the Koopman operator and its finite-dimensional approximation, we have the basis to develop the data-driven control design in the next section.

Data-Driven Koopman-Based Control Design
In this section, a data-driven control design is developed based on the approximation of the Koopman operator. Hence, the linear representation is used for prediction and a decentralized model predictive control problem is solved.
Consider the following cost function where H p is the time horizon. The operator · 2 Q denotes the weighted Eucledian norm defined for any vector z and weighting matrix Q as z 2 Q = z Qz, and Q and R denote the positive definite weighting matrices for the lifted state and input vectors, respectively. Next, the optimal control problem is defined as where the constraints (16)- (18) are defined for all k ∈ {0, · · · , H p − 1}, and the finitedimensional approximation of the Koopman operator based on matrices (12) is used.
The control signals are defined as u i = (u i (0), · · · , u i (H p − 1)) and the lifted state variables as z i = (z i (0), · · · , z i (H p − 1)). In Figure 1, the structure of interconnection of each subsystem and the feedback control are depicted. It should be noticed that the coupling among subsystems is physical and not through the optimization cost. The control strategy is summarized in Algorithm 1, which consists of a first step with the initialization of the lifted data by the observables and parameters such as the time horizon H p . Then, the finite-dimensional approximation of the Koopman operator is obtained using the method presented in Section 3.1 using (11) and (12). Finally, the optimal control signal u * i (k) is applied to system (8) in the original state variables by means of the matrix C obtained in (7).   (11) and (12) Solve (15) Apply u * i (k) to system (8) end

Interconnection through the Input
Another important interconnection configuration is now considered, where the coupling among subsystems is also given by the input control. Specifically, we consider the class of systems described by where it is observed that the interaction or coupling between subsystems is through the control signals of the other subsystems. The data driven-linear representation of this structure is the following The implementation of the methodology developed in Section 3.1 is straightforward. The buffer of neighbor's input data {u n i , u n j } M n=1 , and the vector of observables are required, and the optimization problem (13) can be solved.
In the next section, several simulation cases are presented to illustrate the theoretical results introduced in this section.

Simulations
This section presents numerical examples using the data-driven predictive control based on the Koopman operator framework and its finite-dimensional representation. All the simulations codes were run using MATLAB ® on a computer with 16 GB of RAM and a 3.8 GHz Intel Core i7 processor. The optimization problems were solved by qpOASES [19]. For the finite-dimensional approximation of the linear control-oriented model, 100 thin plate spline radial basis functions with centers generated randomly with uniform distribution at x i were used. Each radial basis function was defined by Ψ . Three different numerical examples are presented to illustrate the proposed decentralized MPC in problems of diverse complexity and nonlinearity.

Two Duffing Oscillators
As a first numerical example, consider an interconnection of two duffing oscillators, where the parameters yield a dynamic behavior with two basins of attraction. The free-body diagram of a mechanical duffing oscillator is depicted in Figure 2, and the differential equations that describe this system are given by, where x i1 , x i2 are the position and velocity of the mass i. The viscosity damping is denoted by δ i , and β i , α i are both constants representing the stiffness of the spring, respectively. The local input of each system is given by u i = F i (t), more detail for an ideal interconnection can be found in [20]. In this example, δ i = 0.5, β i = −1, α i = 1, and the interconnection parameter η i = 0.5. To obtain the local linear representation, we used one-step time-series data with 10 5 random initial conditions uniformly distributed in the domain [−0.8, 0.8] × [−0.8, 0.8] with sample time T s = 0.01. The input matrix was approximated using 10 4 random inputs over the interval [−1, 1]. Notice that each subsystem required neighborhood state measurements to identify the coupling dynamics. The radial basis function centers were uniformly distributed in the domain. To evaluate the performance of the interconnected model, we compared the uncontrolled system states using an input u i = 0.5 cos(t). The comparison between the linear representation and the original system for the initial condition x 0 = [0.31, −0.34, −0.33, 0.31] is shown in Figure 3. It is apparent that including the coupling term in the model improved the prediction capacity. The objective of the control problem was to stabilize the system in the origin. The cost function weights were chosen as Q = I, H p = 50, and R = 0.01, and the input constraint was −1 ≤ u ≤ 1 for the two subsystems. The closed-loop local phase-plane and input signals are presented in Figure 4.

Bipedal Robot Locomotion Model
As a second example, consider the thigh and knee dynamics of a walking bipedal robot locomotion modeled through three coupled Van der Pol oscillators [21].
where θ i andθ i are the angle (rad) and angular velocity (rad/s), respectively. The states of each subsystem are denoted x i = θ i − θ ie , and u i is the control input. A diagram which represents the interconnection in the state space is depicted in Figure 5. In this example, we used locally one-step time-series data with 10 4 random initial conditions uniformly distributed in the domain [−π/2, π/2] × [−1, 1] with sample time T s = 0.01. The input matrix was approximated using 10 3 random inputs over the interval [−1, 1]. The radial basis function centers were again uniformly distributed in the domain. The control design was subject to the following constraints − π 2 ≤ θ i − θ ie ≤ π 2 and |u i | ≤ 1. The desired constant angles for i ∈ {1, 2, 3} were θ 1e = 0, θ 2e = −π/12, and θ 3e = π/6. The parameters for each decentralized local control were Q = I, H p = 100, R = 0.1. The effectiveness of the control algorithm can be observed in Figure 6, where the angles achieved the desired values, and the input constraints were satisfied.   Figure 6. Angle, angular velocity, and input of the bipedal locomotor.

Four Water Tanks
Finally, the four water tank control benchmark, illustrated in Figure 7, where two subsystems are coupled by means of the input, is considered. The coupled dynamics is modeled asẋ 11 where S is the cross-section area, and a i is the discharge constant of each tank. Let q i and γ i with i ∈ {1, 2} denote the flow and the ratio of the three-way valve of pump i, respectively, and g the gravitational acceleration. The system parameters can be found in [22]. In this example, we used one-step time-series data with 10 4 random initial conditions uniformly distributed in the domain [0, 1] × [0, 1] with sample time T s = 0.001. The local input matrix was approximated using 10 5 random inputs over the interval [−1, 1] and 10 3 random points of neighbor's input. In this control problem, level tracking had to be achieved. The objective function in the data-driven predictive control is defined by where the matrix C selects only the first state. The cost function weights were chosen as Q = I, H p = 100, R = 0.001, the level constraint was 0.1 ≤ x i1 ≤ 1, and the flow maximum was q i = 0.5 for the two subsystems. The results of the simulation are shown in Figure 8. The decentralized data-driven controller was able to regulate the system to the given set-points while guaranteeing that the state and input constraints were satisfied.

Conclusions
Based on the framework of the Koopman operator and the extended dynamic mode decomposition, we proposed a method to design a model-free and decentralized control for interconnected systems. The method uses only local and interconnection series-time of synthetic data or measurements. No prior knowledge of local dynamics or interconnection is required. We have shown how to construct the optimization problem associated with the predictive control design, and an extension to systems coupled through their inputs was developed. Some simulation results were shown to illustrate the effectiveness of the proposed approach. Future work will focus on more complex systems involving more subsystems and on testing different basis functions in order to improve the performance of the linear predictor model.

Data Availability Statement:
The data presented in this study are available on request from the authors.