DiffSWE2d: a differentiable Shallow Water Equations solver for end-to-end flood and tsunami modelling
Abstract
Solving inverse and optimisation problems with traditional shallow water equations (SWE) solvers can be computationally expensive, particularly when gradients with respect to model inputs or parameters must be estimated through repeated forward simulations. In this paper, we introduce DiffSWE2d, an open-source differentiable shallow water equations solver for end-to-end flood and tsunami modelling implemented in PyTorch. By leveraging automatic differentiation, DiffSWE2d represents the time-marching physics as a differentiable computational graph, enabling gradients to be propagated directly through the numerical solver. We validate the solver against two established benchmark cases and demonstrate its application to tsunami waveform inversion, showing its ability to infer model inputs through gradient-based optimisation. DiffSWE2d provides a flexible framework for integrating physics-based hydrodynamic modelling with modern optimisation and machine learning methods. The source code and reproducible examples are publicly available at: https://github.com/ZhonghouXu/DiffSWE2d
Related
- Spatial machine learning modelling reveals that soil indicators and tree type best explain shallow landslide release
- Advancing global crop simulations with differentiable modelling
- How Sparse and How Noisy? Systematic Benchmarking of Inverse Physics-Informed Neural Networks for Manning Friction Estimation in Shallow Water Equations
- Two large unstable slopes in West Greenland illustrates an emerging Arctic tsunami hazard
- Approaches and challenges in estimating economic loss from tsunami damage models
BibTeX
@misc{xu2026diffswe2d,
title = {{DiffSWE2d: a differentiable Shallow Water Equations solver for end-to-end flood and tsunami modelling}},
author = {Zhonghou Xu},
howpublished = {arXiv},
year = {2026},
month = sep,
doi = {10.48550/arxiv.2609.11426},
eprint = {2609.11426},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2609.11426},
note = {CC BY-NC-ND 4.0},
}
RIS
TY - UNPB
TI - DiffSWE2d: a differentiable Shallow Water Equations solver for end-to-end flood and tsunami modelling
AU - Zhonghou Xu
PY - 2026
DA - 2026/09/10
PB - arXiv
DO - 10.48550/arxiv.2609.11426
UR - https://arxiv.org/abs/2609.11426
AB - Solving inverse and optimisation problems with traditional shallow water equations (SWE) solvers can be computationally expensive, particularly when gradients with respect to model inputs or parameters must be estimated through repeated forward simulations. In this paper, we introduce DiffSWE2d, an open-source differentiable shallow water equations solver for end-to-end flood and tsunami modelling implemented in PyTorch. By leveraging automatic differentiation, DiffSWE2d represents the time-marching physics as a differentiable computational graph, enabling gradients to be propagated directly through the numerical solver. We validate the solver against two established benchmark cases and demonstrate its application to tsunami waveform inversion, showing its ability to infer model inputs through gradient-based optimisation. DiffSWE2d provides a flexible framework for integrating physics-based hydrodynamic modelling with modern optimisation and machine learning methods. The source code and reproducible examples are publicly available at: https://github.com/ZhonghouXu/DiffSWE2d
ER -