# TGN: A Temporal Graph Network for Physics Prediction
## 3 Methodology  
### Problem Definition and Overview  
Our aim is to model and predict the dynamics of complex physical systems using deep learning algorithms. These physical systems are usually governed by a set of nonlinear partial differential equations (PDEs), and the spatiotemporal solution of the physical system can be obtained by given initial and boundary conditions. Currently, mesh-based finite element simulation is the basis of popular methods in PDE systems. It discretizes the physical space into an unstructured mesh \(M=(\mathcal{V},\mathcal{E})\), where each node \(i\in\mathcal{V}\) is connected by mesh edges \(E\) and \(|\mathcal{V}|=N\), i.e., the unstructured mesh contains \(N\) mesh points. A mesh consists of nodes and topological relationships of nodes, which can be naturally understood as a graph. Thus, we denote the mesh \(M\) of the current physical system as a graph \(G=(\mathcal{V},\mathcal{E})\), the mesh nodes become graph nodes \(\mathcal{V}\), the mesh edges become bi-directional edges \(\mathcal{E}\) in the graph, and utilize the graph \(G\) to describe the topology of the mesh. We fix the graph \(G\) in all time steps. At moment \(t\), each node \(i\in\mathcal{V}\) uses the physical quantity \(\mathbf{q}_{i,t}\) (velocity, density, or pressure) as its attribute. The attributes of these nodes can then be used to define the state field \(\mathbf{S}_{t}=\{\mathbf{q}_{i,t}:i\in\mathcal{V}\}\) at moment \(t\). Solving such discrete systems using traditional methods involves complex numerical integration of time and space and is usually costly. Therefore, our objective is to develop a learned simulator \(f\) that, given the mesh topology \(G\) and the state field sequence at the initial \(t\) moments, can quickly predict the state field sequence at the next \(T\) moments, as shown in Equation (1):  
\[(\mathbf{S}_{t+1},\dots,\mathbf{S}_{t+T})=f(G;(\mathbf{S}_{1},\dots,\mathbf{S}_{t})). \tag{1}\]  
These physical systems involve complex spatiotemporal dependence, whereas GSE excels at aggregating local information to learn the topology of the graph, and AutoLinear is able to capture periodic and trending information well from time series (Section 4.3). We fuse these two models and propose a new method, TGN, to predict the dynamics of physical systems. For each time step, we use the GSE to aggregate local information to obtain spatially characterized node representations, and summarize these node representations to create a low-dimensional vector representation for each time step (Section 3.2). These low-dimensional vectors constitute the historical time series, and we use a simple moving average kernel to decompose the spatially characterized historical time series into a trend component and a seasonal component, and focus on the seasonal pattern, alternating between linear transformations and decompositions of the intermediate results of the forecasting process, progressively refining the seasonal component and continuously accumulating the trend component. Finally, two linear models are applied to each of these two components and the results are added together to update the system state in the next step (Section 3.3). The combination of GSE and AutoLinear can effectively utilize spatiotemporal correlations to make stable and accurate predictions (Section 3.4). Figure 2 shows the visualization scheme of the TGN architecture.  
Figure 2: The diagram of the TGN. We first represent the physical space as a graph and then use GSE to capture the topology of the graph. The latent vector \(\mathbf{z}_{i}\) consists of nodes with spatial featuresand represents the state at time step \(t\). The AutoLinear model captures temporal features from the sequence of latent vectors and uses a decoder to extract derivatives for each node, which are then utilized to update the graph for predicting the next-step state \(S_{t+1}\).