dmd: Perform Dynamic Mode Decomposition (DMD) on a matrix of...

View source: R/dmd.R

dmdR Documentation

Perform Dynamic Mode Decomposition (DMD) on a matrix of snapshots of a system.

Description

Dynamic mode composition (DMD) is a method for approximating the eigenvalue and eigenvectors of the Koopman operator of a system. That is, DMD yields the eigendecomposition of the linear map of a system from time t to time t+1.

Usage

dmd(x, y = NULL, r, dt)

Arguments

x

A matrix of snapshots of a system.

y

A matrix of snapshot paired to x.

r

An integer; the specific number of singular vectors to include.

dt

Numeric; the time-lag between two subsequent time series measurements.

Value

An object of class 'dmd' with the following components:

  • dmdResult - TBD

  • timeDynamics - TBD

  • dmdModes - TBD

  • dmdAmplitudes - TBD

  • dtEigen - TBD

  • ctEigen - TBD

References

Kutz, J. N., Brunton, S. L., Brunton, B. W., & Proctor, J. L. (2016). Dynamic mode decomposition: data-driven modeling of complex systems. Society for Industrial and Applied Mathematics.

Examples

library(pracma)

# Generate data
x <- seq(-5, 5, length.out = 128)
t <- seq(0, 4*pi, length.out = 256)

grids <- meshgrid(x, t)

# First periodic function
f1xt <- t(sech(grids$X + 3)*exp(2.3i*grids$Y))

# Second periodic function
f2xt <- t(2*sech(grids$X)*tanh(grids$X)*exp(2.8i*grids$Y))

# Observed values
fxt <- f1xt + f2xt

dmd(fxt, r = 2, dt = 1)

RobertGM111/havok documentation built on July 8, 2023, 8:23 p.m.