PyDMD: A Python package for robust dynamic mode decomposition

Sara M. Ichinaga, Francesco Andreuzzi, Nicola Demo, Marco Tezzele, Karl Lapo, Gianluigi Rozza, Steven L. Brunton, J. Nathan KutzarXiv 2024 · DOI

Abstract

Dynamic Mode Decomposition (DMD) has emerged as a fundamental technique for extracting spatiotemporal patterns from high-dimensional data. However, the standard "Exact DMD" algorithm often fails when confronted with the noise, non-linearity, and multiscale complexities inherent in real-world scientific data. This paper presents PyDMD 1.0, a major update to the Python library that provides a modular, robust suite of state-of-the-art DMD algorithms. We detail the library's architecture and its support for noise-robust variants, latent variable discovery via time-delay embeddings, and physics-informed constraints. Through synthetic benchmarks, we demonstrate the package's ability to accurately recover system dynamics and frequencies in challenging scenarios.

Introduction

Dynamic Mode Decomposition is a staple for researchers analyzing complex dynamical systems, from fluid dynamics to neuroscience. By identifying a linear operator that best describes system evolution, DMD facilitates dimensionality reduction and future-state prediction. Despite its popularity, the "Exact DMD" algorithm typically taught in introductory courses is fragile; it assumes linearity and is highly sensitive to measurement noise. Real-world data is rarely so well-behaved, often being under-sampled or governed by strong nonlinearities. PyDMD 1.0 bridges this gap, offering a practical toolkit for data scientists and engineers to apply DMD to complex, noisy datasets.

Methods and Implementation

PyDMD 1.0 moves beyond textbook implementations to offer a comprehensive taxonomy of DMD variants. The library is built on a modular DMDBase structure, allowing users to wrap preprocessing steps—such as centering or time-delay embeddings—around any specific DMD variant.

Taxonomy of noise-robust, multiscale, and physics-informed DMD methods implemented in PyDMD 1.0.

Key methodological advancements include:

  • Noise-Robustness: Methods like Optimized DMD (OptDMD) and Bagging Optimized DMD (BOP-DMD) utilize nonlinear optimization and statistical resampling to stabilize results against noise.
  • Latent Variable Discovery: Hankel/Time-delay preprocessing stacks shifted versions of data to reveal hidden variables not directly measured.
  • Nonlinear and Multiscale Dynamics: The package incorporates HAVOK and LANDO for highly nonlinear systems, alongside CoSTS for systems with dynamics spanning multiple timescales.
  • Physics-Informed Constraints: Researchers can embed physical laws, such as energy conservation or symmetry, directly into the DMD model to ensure physically consistent solutions.

Results

The efficacy of PyDMD 1.0 is demonstrated using a synthetic spatiotemporal dataset consisting of a stationary pulse and a "breather" signal oscillating at distinct frequencies.

Diagnostic output from PyDMD showing singular value variance, eigenvalue distribution, and extracted mode dynamics for a synthetic system.

Key results include:

  • True Rank Recovery: While raw data matrices may appear lower-rank, the application of time-delay embeddings allows PyDMD to correctly identify the true rank-4 dynamics of the system.
  • Frequency and Mode Accuracy: The library successfully extracts precise frequencies (2.3 and 2.8) and their corresponding spatial modes.
  • Robustness to Noise: The authors highlight BOP-DMD as a superior general-purpose recommendation for noisy, real-world applications compared to standard Exact DMD.

Discussion and Future Work

PyDMD 1.0 significantly lowers the barrier to using advanced DMD techniques. However, the authors note that selecting the optimal variant still requires domain expertise regarding the data's physical properties and noise characteristics. To assist users, the paper provides a decision flowchart for navigating the library's offerings. Future extensions of the package are expected to include tensorized DMD and more recent robust methods to further enhance its utility for the scientific community.

Summary updated

BibTeX
@misc{ichinaga2024pydmd,
  author = {Sara M. Ichinaga and Francesco Andreuzzi and Nicola Demo and Marco Tezzele and Karl Lapo and Gianluigi Rozza and Steven L. Brunton and J. Nathan Kutz},
  title = {{PyDMD: A Python package for robust dynamic mode decomposition}},
  year = {2024},
  eprint = {2402.07463},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.07463},
}
Figure