# Identification of Crude Distillation Unit: A Comparison between Neural Network and Koopman Operator
## 2 Modeling and Methodology
### Koopman Operator Theory  
In this section, a brief introduction to the Koopman operator is provided; for more details, readers should refer to [40]. First, consider a discrete nonlinear autonomous system in the following form:  
\[x_{k+1}=f(x_{k}) \tag{6}\]  
where \(x_{k}\in\mathbb{X}\subset\mathbb{R}^{n}\) is the vector of state variables, \(\mathbb{X}\) is the state space, and \(f:\mathbb{X}\rightarrow\mathbb{X}\) is a map function that represents the evolution of the state. The infinite-dimensional Koopman operator \(\mathcal{K}\) acting on a set of observation functions \(g\) is defined as  
\[\mathcal{K}g(x_{k})=g(f(x_{k}))=g(x_{k+1}) \tag{7}\]  
where \(\mathcal{K}:\mathbb{G}\rightarrow\mathbb{G}\) and \(g:\mathbb{X}\rightarrow\mathbb{G}\). \(\mathbb{G}\) denotes the lifted space. The Koopman operator advances the value of the observable function forward in time. One might obtain a finite approximation of the Koopman operator by restricting it to an invariant subspace \(\mathbb{G}_{\mathbb{N}}\subset\mathbb{G}\), which is spanned by a set of Koopman eigenfunctions that satisfy the following property  
\[\lambda\phi(x)=\varphi(f(x)) \tag{8}\]  
Figure 1: The NARX\(-\)NN model representation. where the eigenvalue \(\lambda\) corresponds to the eigenfunction \(\varphi(x)\). Using the Koopman Mode Decomposition (KMD) [27], the observation function \(g(x_{k})\) can be represented as  
\[g(x(k))=\mathcal{K}^{k}g(x_{0})=\sum\lambda_{j}^{k}\varphi_{j}(x_{0})v_{j} \tag{9}\]  
where \(v_{j}\) is the \(j\)th Koopman mode associated with the eigenfunction \(\varphi_{j}\) and the eigenvalue \(\lambda_{j}\). For a discrete-time control system, where \(u\in\mathbb{U}\subset\mathbb{R}^{m}\),  
\[x_{k+1}=f(x_{k},u_{k}) \tag{10}\]  
We define an extended state \(\widetilde{x}:=[x^{T},u^{T}]^{T}\), and let \(g(x,u):\mathbb{X}\times\mathbb{U}\rightarrow\mathbb{G}\) be a set of scalar observable function of the extended state space. The Koopman operator advances measurement functions according to  
\[\mathcal{K}g(x_{k},u_{k})=g(f(x_{k},u_{k}),u_{k})=g(x_{k+1},u_{k+1}) \tag{11}\]  
The Koopman eigenpairs \((\varphi,\lambda)\) associated with Equation (11) satisfy  
\[\mathcal{K}\varphi(x_{k},u_{k}) =\varphi(f(x_{k},u_{k}),u_{k}) \tag{12}\] \[=\varphi(x_{k+1},u_{k+1})=\lambda\varphi(x_{k},u_{k})\]  
Assuming that the observation function can be separated into two parts:  
\[g(x,u)=[g_{x}(x,u);g_{u}(x,u)] \tag{13}\]  
Then, the expression for the Koopman operator would have the following form [41; 42]:  
\[ \begin{bmatrix}g_{x}(x_{k+1},u_{k+1})\\ u_{k+1}\end{bmatrix} = \begin{bmatrix}A&B\\ C&D\end{bmatrix}\begin{bmatrix}g_{x}(x,u)\\ g_{u}(x,u)\end{bmatrix}  \tag{14}\]  
where \(A,B,C,D\) are submatrices of the [PERSON] operator matrix \(\mathcal{K}\). We assume that \(g_{x}(x,u)\) depends only on the system's state, \(g_{x}(x,u)=g_{x}(x)\). An embedding ANN, \(\vartheta(x_{k}):\mathbb{R}^{n}\rightarrow\mathbb{R}^{d}\), where \(d\) is a tunable hyperparameter, shall be used to learn the observation function \(g_{x}(x)\). Furthermore, the control inputs in the lifted space are assumed to remain unchanged compared to those in the nonlinear space; hence, \(g_{u}(x,u)=u\). Denoting \(z_{k}=g_{x}(x_{k},u_{k})\) as the state within the lifted dynamics, a linear relationship of the state variable \(z\) can be obtained as follows  
\[z_{k+1}=Az_{k}+Bu_{k} \tag{15}\]  
By employing the Koopman Canonical Transformation (KCT) [43], the Koopman bilinear form (KBF) [44] is given by,  
\[z_{k+1}=Az_{k}+\sum_{i=1}^{m}B_{i}u_{i} \tag{16}\]  
A schematic representation of the Koopman dynamics based on an ANN is presented in Figure 2.  
Furthermore, the original states are concatenated with the output of \(\vartheta\), allowing for the direct retrieval of the original states:  
\[z_{k}= \begin{bmatrix}x_{k}\\ \vartheta(x_{k})\end{bmatrix}  \tag{17}\] \[x_{k}=C_{x}z_{k},\quad C_{x}= \begin{bmatrix}I_{n}&0\end{bmatrix}