Skip to content

fandreuz/PyDMD

 
 

Repository files navigation

Python Dynamic Mode Decomposition

JOSS DOI Software License PyPI version CI Status

PyDMD: Python Dynamic Mode Decomposition

Table of contents

Description

PyDMD is a Python package that uses Dynamic Mode Decomposition for a data-driven model simplification based on spatiotemporal coherent structures.

Dynamic Mode Decomposition (DMD) is a model reduction algorithm developed by Schmid (see "Dynamic mode decomposition of numerical and experimental data"). Since then has emerged as a powerful tool for analyzing the dynamics of nonlinear systems. DMD relies only on the high-fidelity measurements, like experimental data and numerical simulations, so it is an equation-free algorithm. Its popularity is also due to the fact that it does not make any assumptions about the underlying system. See Kutz ("Dynamic Mode Decomposition: Data-Driven Modeling of Complex Systems") for a comprehensive overview of the algorithm and its connections to the Koopman-operator analysis, initiated in Koopman ("Hamiltonian systems and transformation in Hilbert space"), along with examples in computational fluid dynamics.

In the last years many variants arose, such as multiresolution DMD, compressed DMD, forward backward DMD, higher order DMD, and physics-informed DMD among others, in order to deal with noisy data, big dataset, or spurius data for example. We implemented in Python the majority of the DMD extensions currently present in the literature with a user friendly interface. We also provide many tutorials that show all the characteristics of the software. See the Examples section below and the Tutorials to have an idea of the potential of this package.

Dependencies and installation

PyDMD requires requires numpy, scipy, matplotlib, future, sphinx (for the documentation) and pytest (for local test). The code is tested for Python 3, while compatibility of Python 2 is not guaranteed anymore. It can be installed using pip or directly from the source code.

Installing via PIP

Mac and Linux users can install pre-built binary packages using pip. To install the package just type:

> pip install pydmd

To uninstall the package:

> pip uninstall pydmd

Installing from source

The official distribution is on GitHub, and you can clone the repository using

> git clone https://github.com/mathLab/PyDMD

To install the package just type:

> pip install -e .

To uninstall the package type:

> pip uninstall pydmd

Documentation

PyDMD uses Sphinx for code documentation. You can view the documentation online here. To build the html version of the docs locally simply:

> cd docs
> make html

The generated html can be found in docs/build/html. Open up the index.html you find there to browse.

Testing

We are using GitHub actions for Continuous Integration. You can check the current status here.

To run tests locally (pytest is required):

> pytest

Examples and Tutorials

You can find useful tutorials on how to use the package in the tutorials folder.

Here we show a simple application (taken from tutorial 2): we collect few snapshots from a toy system with some noise and reconstruct the entire system evolution.

The original snapshots used as input for the dynamic mode decomposition


The system evolution reconstructed with dynamic mode decomposition

Awards

  • First prize winner in DSWeb 2019 Contest Tutorials on Dynamical Systems Software (Junior Faculty Category). You can read the winner tutorial (PDF format) in the tutorials folder.

How to cite

If you use this package in your publications please cite the package as follows:

Demo et al., (2018). PyDMD: Python Dynamic Mode Decomposition. Journal of Open Source Software, 3(22), 530, https://doi.org/10.21105/joss.00530

Or if you use LaTeX:

@article{demo18pydmd,
  Author = {Demo, Nicola and Tezzele, Marco and Rozza, Gianluigi},
  Title = {{PyDMD: Python Dynamic Mode Decomposition}},
  Journal = {The Journal of Open Source Software},
  Volume = {3},
  Number = {22},
  Pages = {530},
  Year = {2018},
  Doi = {https://doi.org/10.21105/joss.00530}
}

References

To implement the various versions of the DMD algorithm we follow these works:

  • Kutz, Brunton, Brunton, Proctor. Dynamic Mode Decomposition: Data-Driven Modeling of Complex Systems. SIAM Other Titles in Applied Mathematics, 2016. [DOI] [bibitem].
  • Gavish, Donoho. The optimal hard threshold for singular values is 4/sqrt(3). IEEE Transactions on Information Theory, 2014. [DOI] [bibitem].
  • Matsumoto, Indinger. On-the-fly algorithm for Dynamic Mode Decomposition using Incremental Singular Value Decomposition and Total Least Squares. 2017. [arXiv] [bibitem].
  • Hemati, Rowley, Deem, Cattafesta. De-biasing the dynamic mode decomposition for applied Koopman spectral analysis of noisy datasets. Theoretical and Computational Fluid Dynamics, 2017. [DOI] [bibitem].
  • Dawson, Hemati, Williams, Rowley. Characterizing and correcting for the effect of sensor noise in the dynamic mode decomposition. Experiments in Fluids, 2016. [DOI] [bibitem].
  • Kutz, Fu, Brunton. Multiresolution Dynamic Mode Decomposition. SIAM Journal on Applied Dynamical Systems, 2016. [DOI] [bibitem].
  • Erichson, Brunton, Kutz. Compressed dynamic mode decomposition for background modeling. Journal of Real-Time Image Processing, 2016. [DOI] [bibitem].
  • Le Clainche, Vega. Higher Order Dynamic Mode Decomposition. Journal on Applied Dynamical Systems, 2017. [DOI] [bibitem].
  • Andreuzzi, Demo, Rozza. A dynamic mode decomposition extension for the forecasting of parametric dynamical systems. 2021. [arXiv] [bibitem].
  • Jovanović, Schmid, Nichols Sparsity-promoting dynamic mode decomposition. 2014. [arXiv] [bibitem].

Recent works with PyDMD

Here there is a list of the scientific works involving PyDMD you can consult and/or cite. If you want to add one, please open a PR.

  • Tezzele, Demo, Rozza. A non-intrusive approach for proper orthogonal decomposition modal coefficients reconstruction through active subspaces. Comptes Rendus de l'Academie des Sciences DataBEST 2019 Special Issue. [arXiv] .

  • Tezzele, Demo, Rozza. Shape Optimization through Proper Orthogonal Decomposition with Interpolation and Dynamic Mode Decomposition Enhanced by Active Subspaces. In The Proceedings of VIII International Conference on Computational Methods in Marine Engineering, pages 122–133, 2019. [DOI] [arXiv].

  • Tezzele, Demo, Mola, Rozza. An integrated data-driven computational pipeline with model order reduction for industrial and applied mathematics. Submitted, 2018. [arXiv].

  • Demo, Tezzele, Gustin, Lavini, Rozza. Shape optimization by means of proper orthogonal decomposition and dynamic mode decomposition. In Technology and Science for the Ships of the Future: Proceedings of NAV 2018: 19th International Conference on Ship & Maritime Research, 2018. [DOI] [arXiv].

  • Tezzele, Demo, Gadalla, Mola, Rozza. Model Order Reduction by means of Active Subspaces and Dynamic Mode Decomposition for Parametric Hull Shape Design Hydrodynamics. In Technology and Science for the Ships of the Future: Proceedings of NAV 2018: 19th International Conference on Ship & Maritime Research, 2018. [DOI] [arXiv].

  • Demo, Tezzele, Mola, Rozza. An efficient shape parametrisation by free-form deformation enhanced by active subspace for hull hydrodynamic ship design problems in open source environment. 2018. [arXiv].

  • Tezzele, Demo, Stabile, Mola, Rozza. Enhancing CFD predictions in shape design problems by model and parameter space reduction. 2020. [arXiv].

  • Tezzele. Data-driven parameter and model order reduction for industrial optimisation problems with applications in naval engineering, PhD Thesis. 2021. [Iris].

Developers and contributors

The main developers are

We warmly thank all the contributors that have supported PyDMD!

Do you want to join the team? Read the Contributing guidelines and the Tutorials for Developers before starting to play!

Made with contrib.rocks.

Funding

A significant part of PyDMD has been written either as a by-product for other projects people were funded for, or by people on university-funded positions. There are probably many of such projects that have led to some development of PyDMD. We are very grateful for this support!

Beyond this, PyDMD has also been supported by some dedicated projects that have allowed us to work on extensions, documentation, training and dissemination that would otherwise not have been possible. In particular, we acknowledge the following sources of support with great gratitude:

License

See the LICENSE file for license rights and limitations (MIT).

About

Python Dynamic Mode Decomposition

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.0%
  • TeX 1.0%