Abstract
In this paper, we introduce a novel framework for combining scientific knowledge within physics-based models and recurrent neural networks to advance scientific discovery in many dynamical systems. We will first describe the use of outputs from physics-based models in learning a hybrid-physics-data model. Then, we further incorporate physical knowledge in real-world dynamical systems as additional constraints for training recurrent neural networks. We will apply this approach on modeling lake temperature and quality where we take into account the physical constraints along both the depth dimension and time dimension. By using scientific knowledge to guide the construction and learning the data-driven model, we demonstrate that this method can achieve better prediction accuracy as well as scientific consistency of results.
Introduction
Modeling complex dynamical systems, such as lake water quality, has traditionally relied on two distinct approaches: physics-based models and black-box machine learning (ML). Physics-based models are grounded in scientific principles but often suffer from "missing physics" or oversimplified parameters. Conversely, pure ML models excel at pattern recognition but frequently ignore physical realities, leading to scientifically inconsistent predictions—such as cold, dense water floating atop warm, light water. Furthermore, scientific data is often sparse, making it difficult for standard ML models to generalize. This paper introduces Physics-Guided Recurrent Neural Networks (PGRNN) to bridge this gap by embedding physical laws directly into the architecture and loss functions of deep learning models.
Methodology
The PGRNN framework integrates physical knowledge into a Long Short-Term Memory (LSTM) network through two primary mechanisms:
Hybrid-Physics-Data Architecture
Rather than relying solely on raw meteorological drivers (e.g., wind, precipitation, radiation), the framework incorporates the outputs of traditional physics-based models ($Y_{phy}$) as input features. This allows the LSTM to leverage a scientifically grounded baseline, focusing its learning capacity on correcting the residuals or errors inherent in the physics model.
Physics-Guided Loss Functions
The training process is augmented with penalty terms that enforce scientific consistency:
- Density-Depth Constraint: The model is penalized if it predicts a temperature profile where water density does not monotonically increase with depth, adhering to known physical equations.
- Energy Conservation: Constraints ensure that temperature changes over time remain consistent with the lake's energy budget, balancing solar radiation against heat loss.
Experimental Setup
The study was conducted using data from Lake Mendota (Wisconsin, USA), comprising 13,543 observations from 1980 to 2015. The model utilized 11 meteorological variables as input drivers to predict surface phosphorus concentration and water temperature profiles across varying depths.
Results and Discussion
The PGRNN consistently outperformed both standalone physics models and standard RNNs in terms of accuracy and physical consistency. For water temperature modeling, the PGRNN achieved an RMSE of 1.4791, compared to 2.6544 for the physics model and 1.6042 for a standard RNN.
Crucially, the "Phy-inconsistency" metric—measuring violations of the density-depth rule—dropped from 0.2024 in a standard RNN to 0.0732 in the PGRNN. Qualitative improvements were also evident in the visualization of the thermocline; the PGRNN produced a smoother and more realistic evolution of temperature layers over time compared to models lacking energy conservation constraints.
In phosphorus prediction, the PGRNN achieved an overall RMSE of 0.0237, again surpassing both the physics-only (0.0266) and standard RNN (0.0247) benchmarks. These results suggest that physical laws act as a powerful regularizer, forcing the model to search within a physically plausible hypothesis space.
Conclusion
By using scientific knowledge to guide the construction and learning of data-driven models, the PGRNN framework achieves superior predictive performance and scientific integrity. Future work will focus on generalizing these constraints to different dynamical systems and automating the weighting of physical penalties relative to data-driven errors.
Summary updated