Skip to main content

Dynamic mode decompositon in python.

Project description

Documentation Status MIT License

Dynamic mode decomposition (DMD)is a tool for analyzing the dynamics of nonlinear systems.

This is an experimental DMD codebase for research purposes.

Alternatively, check out PyDMD, a professionally maintained open source DMD codebase for Python.

Installation:

pip install dmdlab

Usage:

from dmdlab import DMD, plot_eigs
import numpy as np
from scipy.linalg import logm

# Generate toy data
ts = np.linspace(0,6,50)

theta = 1/10
A_dst = np.array([[np.cos(theta), -np.sin(theta)],
                  [np.sin(theta), np.cos(theta)]])
A_cts = logm(A_dst)/(ts[1]-ts[0])

x0 = np.array([1,0])
X = np.vstack([expm(A_cts*ti)@x0 for ti in ts]).T

# Fit model
model = DMD.from_full(X, ts)

# Print the eigenvalue phases
print(np.angle(model.eigs))

>>> [0.1, -0.1]

For a technical reference, check out the DMD book.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dmdlab-0.1.1.tar.gz (8.0 kB view hashes)

Uploaded Source

Built Distribution

dmdlab-0.1.1-py3-none-any.whl (8.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page