/WeiDMD

Predicting rate kernels via dynamic mode decomposition. Code for article [https://doi.org/10.1063/5.0170512].

Primary LanguagePythonMIT LicenseMIT

Python Dynamic Mode Decomposition

Software License PyPI version

Table of contents

Description

WeiDMD is a Python package designed for Dynamic Mode Decomposition (DMD), a data-driven method used for analyzing and extracting spatiotemporal coherent structures from time-varying datasets. It provides a comprehensive and user-friendly interface for performing DMD analysis, making it a valuable tool for researchers, engineers, and data scientists working in various fields.

With WeiDMD, users can easily decompose complex, high-dimensional datasets into a set of coherent spatial and temporal modes, capturing the underlying dynamics and extracting important features. See the Examples section below and the Tutorials to have an idea of the potential of this package. Also see the diagram below for a summary of all available tools and functionalities. Currently in-progress contributions are represented by semi-transparent boxes.

Dependencies and installation

Installing via PIP

WeiDMD is available on PyPI, therefore you can install the latest released version with:

> pip install weidmd

Installing from source

To install the bleeding edge version, clone this repository with:

> git clone https://github.com/Weitheskmt/WeiDMD

and then install the package in development mode:

> pip install -e .

Dependencies

The core features of WeiDMD depend on numpy and scipy. In order to use the plotting functionalities you will also need matplotlib.

Examples and Tutorials

You can quickly know how to use the package in the tutorials.

Using WeiDMD

To perform DMD, simply begin by initializing a WeiDMD module that implements your DMD method of choice. Here, we demonstrate how a user might build a customized WeiDMD model. Models may then be fitted by calling the fit() method and passing in the necessary data.

from weidmd import WeiDMD

# Build a Wei's DMD (WeiDMD) model.
DMD = WeiDMD(
    time=t,  # time series time = (m,) numpy array of times of data collection
    kernel=K,  # kernel K = (n, m) numpy array of time-varying snapshot data
    num_snapshots=2000,  # the number of snapshots, and default is len(K)
    nskip=1,  # K[:num_snapshots][::nskip]
)

# Fit the DMD model and display a summary of the DMD results.
DMD.fit(
  tf=1200, # end of predicted time
  name=None, # Can be defaulted and None will not store DMD results. Setting any string, such as' k1 ', will result in DMD_ The results folder found the corresponding saved file for 'k1'
  d='default', # It can be defaulted and empirical values will be used. If the effect is poor, it can be considered as an adjustment.)

References

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

  • WeiDMD: Wei Liu, Zi-Hao Chen, Yu Su, Yao Wang, and Wenjie Dou. Predicting rate kernels via dynamic mode decomposition. The Journal of Chemical Physics 159, no. 14 (2023). [DOI] [bibitem]