https://github.com/ctf-for-science/dmdvariants

https://github.com/ctf-for-science/dmdvariants

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 12 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.6%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: CTF-for-Science
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Size: 1.58 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created 10 months ago · Last pushed 9 months ago
Metadata Files
Readme License

README.md

Dynamic Mode Decomposition for Koopman Operator Learning

This directory contains implementations of various Dynamic Mode Decomposition (DMD) methods for learning the Koopman operator for CTF-for-Science.

Dynamic Mode Decomposition is a data-driven technique used to extract dynamic information from time-series data. This algorithm was developed by Schmid 2010 [1] to identify spatial and temporal coherent structures from high-dimensional data for fluid-dynamics applications. This algorithm provides a modal decomposition where each mode consists of spatially correlated structures with the same linear behavior in time (e.g., oscillations at a given frequency with growth or decay); thus, DMD finds the linear coordinate system that best fits the starting dataset. By ranking the importance of the modes through the singular values of the data matrix, which offer a measure of the 'information content' of the associated modes, DMD can build a low-dimensional surrogate linear model that can simulate the temporal evolution of these spatial modes [2].

More in detail, let $\mathbf{x}(t)\in R^{\mathcal{N}h}$ being some high-dimensional measurements of the state of the system over time $t$, collected at different time instants and arranged in a snapshot matrix of size $\mathcal{N}h \times Nt$ in the following way: ```math \mathbb{X} = [\mathbf{x}(t1) \mid \mathbf{x}(t2) \mid \dots \mid \mathbf{x}(t{Nt})] = [\mathbf{x}1 \mid \mathbf{x}2 \mid \dots \mid \mathbf{x}{Nt}] \in \mathbb{R}^{\mathcal{N}h \times Nt} ``` where $\mathcal{N}h$ is the number of spatial degrees of freedom of the FOM and $\mathcal{N}t$ is the number of saved time instants. The DMD seeks the best-fit linear operator $\mathbb{A}$ that best represents the dataset $\mathbb{X}$ and that allows the underlying system to advance in time, such that ```math \mathbf{x}{k+1} \approx \mathbb{A}\mathbf{x}_k ```




Different variants of DMD have been proposed to improve the performance of the original algorithm, such as: - Classic DMD: The original DMD algorithm, which uses the snapshot matrix to compute the DMD modes and eigenvalues. - Hankel Preprocessing: A preprocessing step that uses Hankel matrices to improve the DMD results by capturing the temporal correlations in the data. - Bagging Optimised DMD: A variant of DMD that uses bagging techniques to improve the robustness and accuracy of the DMD results by combining multiple DMD models trained on different subsets of the data.

Files

  • dmd.py: Contains the implementation of the DMD classes designed to work within CTF-for-Science, based on the model logic of pyDMD [3].
  • run.py: Batch runner script to create the DMD model across multiple sub-dataset within the CTF-for-Science framework.
  • config/: Directory containing configuration files for different datasets and DMD variants.

The configuration files specify the hyperparameters for the DMD methods, including the dataset to be used, the pair ID, and the specific DMD variant to be applied. The configuration files are in YAML format and can be easily modified to suit different datasets or DMD variants:

yaml dataset: name: <dataset_name> # name of the dataset (either 'ODE_Lorenz' or 'PDE_KS') pair_id: 'all' # or a specific pair ID as [1,2,3,4] model: name: DMD method: <dmd_method> # classic, hankel, highorder, bagging rank: <rank> # number of modes to keep parametric: <parametric_mode> # Mode to use to extend DMD to parametric systems (either `monolithic` or `partitioned`)

Usage

In the CTF-for-Science root directory, run the following command to install the package:

bash python models/DMDvariants/run.py models/DMDvariants/config/config_<dataset_name>_<method>.yaml

Dependencies

This repository rely on packages in the main requirements.txt: - pyyaml - numpy - pydmd - ezyrb

The packages can be installed using pip:

bash pip install -r requirements.txt

References

  1. P. J. Schmid, “Dynamic Mode Decomposition of numerical and experimental data,” Journal of Fluid Mechanics, 656, 5 (2010); 10.1017/S0022112010001217, URL https://doi.org/10.1017/S0022112010001217, publisher: Cambridge University Press.
  2. J. Nathan Kutz, Steven L. Brunton, Bingni W. Brunton, and Joshua L. Proctor, “Dynamic Mode Decomposition: Data-Driven Modeling of Complex Systems” SIAM-Society for Industrial and Applied Mathematics; 10.1137/1.9781611974508, URL https://epubs.siam.org/doi/abs/10.1137/1. 9781611974508.
  3. S. M. Ichinaga, F. Andreuzzi, N. Demo, M. Tezzele, K. Lapo, G. Rozza, S. L. Brunton, and J. N. Kutz, “PyDMD: A Python package for robust dynamic mode decomposition,” (2024) URL https://arxiv.org/abs/ 2402.07463.

Owner

  • Name: CTF for Science
  • Login: CTF-for-Science
  • Kind: organization

GitHub Events

Total
  • Push event: 1
  • Public event: 1
Last Year
  • Push event: 1
  • Public event: 1

Dependencies

requirements.txt pypi
  • ezyrb *
  • numpy *
  • pydmd *
  • pyyaml *