# TGN: A Temporal Graph Network for Physics Prediction
## 4 Experiments
### Model Analysis  
**Role of spatial encoding. ** Since GSE aggregates neighborhood information on meshes through multiple rounds of message passing, we believe that GSE can capture the topology of irregular unstructured meshes. To investigate the effect of GSE, we remove GSE from TGN but retain the time encoder (AutoLinear). AutoLinear directly processes the raw data from both datasets and performs flow field predictions. In Figure 6, we compare the prediction precision of the model variants AutoLinear and TGN on the cylinder flow and the airfoil flow. We can clearly observe that AutoLinear has a large prediction error and that TGN significantly outperforms AutoLinear, indicating that GSE is necessary for modeling spatiotemporal correlations of complex physical systems. In cylinder flow, we also visualized the nodes in the low-dimensional vector \(\mathbf{z}_{t}\) and showed that GSE can capture the relative positions of the mesh nodes. We first randomly selected three nodes on the mesh of the cylinder flow dataset, as shown in Figure 7 (left). To visualize the nodes after GSE encoding, we use principal component analysis (PCA) to reduce the dimensionality of the nodes in \(\mathbf{z}_{t}\) to two and plot the three selected nodes in Figure 7 (middle). The relative positions of the three nodes are consistent with their actual positions in the mesh, indicating that the GSE learns the topology of the mesh and that each node contains information about its relative position with respect to other nodes. We also apply PCA directly to the nodes in the state field (\(\mathbf{S}_{t}\)) and plot these nodes in Figure 7 (right). These three nodes from the state field are essentially on a straight line, and their relative positions are significantly different from the true relative positions. This poses a  
Figure 5: Illustration of averaged error over velocity variable (Y-axis) of four models on cylinder flow (**left**) and airfoil flow (**right**). Our model show smaller error accumulation compared to both the next-step model and the model variants. Figure 6: Illustration of averaged error over all state variables (Y-axis) of AutoLinear and TGN on cylinder flow (**left**) and airfoil flow (**right**). The RMSE of the TGN model is significantly lower than that of the AutoLinear model, which only considers temporal features. challenge for AutoLinear to recognize the topology of the mesh and explains why its error is much higher than that of TGN. **Role of Temporal encoding. ** In the process of autoregressive forecasting, noise is inevitably present in the historical time series, which can significantly affect the accuracy of forecasts and is the main reason for error accumulation. We believe that the accuracy of long-term forecasting depends on whether the model is able to capture the periodicity and trend well from the noise-filled historical time series. To test the ability of our time encoder (AutoLinear) for long-term prediction, we use single-step prediction and add Gaussian noise with different distributions to the historical time series. For the cylinder flow, we add noise obeying the Gaussian distribution \(N\in(0,\sigma^{2})(\sigma\in(0.002,0.004,0.006,0.008,0.01,0.02,0.03))\) to the velocity. In Figure 8, (left), we show how the average prediction error of all models for the whole trajectory varies with the noise. It can be seen that our model outperforms the next-step model and model variants in terms of error and stability, regardless of the noise distribution. This indicates that our model is able to resist the interference of noise and extract the inherent periodicity and trend information from the time series. On the other hand, MeshGraphNets can maintain a stable error when the noise is small. However, its error increases dramatically as the noise increases, which explains why MeshGraphNets suffers from severe error accumulation in long-term forecasting.