Derived module from for classic dmd.


Get the reduced Koopman operator A, called A tilde.


Get the timesteps of the reconstructed states.


Get the time evolution of each mode.


Get the eigenvalues of A tilde.

Compute the Dynamic Modes Decomposition to the input data.


Get the matrix containing the DMD modes, stored by column.


Get the timesteps of the original snapshot.


Plot the eigenvalues.


Plot the DMD Modes.


Plot the snapshots.


Get the reconstructed data.


Get the original input data.

class DMD(svd_rank=0, tlsq_rank=0, exact=False, opt=False, rescale_mode=None, forward_backward=False, sorted_eigs=False, tikhonov_regularization=None)[source]

Bases: pydmd.dmdbase.DMDBase

Dynamic Mode Decomposition

  • svd_rank (int or float) – the rank for the truncation; If 0, the method computes the optimal rank and uses it for truncation; if positive interger, the method uses the argument for the truncation; if float between 0 and 1, the rank is the number of the biggest singular values that are needed to reach the ‘energy’ specified by svd_rank; if -1, the method does not compute truncation.

  • tlsq_rank (int) – rank truncation computing Total Least Square. Default is 0, that means TLSQ is not applied.

  • exact (bool) – flag to compute either exact DMD or projected DMD. Default is False.

  • opt (bool or int) – argument to control the computation of DMD modes amplitudes. See DMDBase. Default is False.

  • rescale_mode ({'auto'} or None or numpy.ndarray) – Scale Atilde as shown in 10.1016/j.jneumeth.2015.10.010 (section 2.4) before computing its eigendecomposition. None means no rescaling, ‘auto’ means automatic rescaling using singular values, otherwise the scaling factors.

  • forward_backward (bool) – If True, the low-rank operator is computed like in fbDMD (reference: Default is False.

  • sorted_eigs ({'real', 'abs'} or False) – Sort eigenvalues (and modes/dynamics accordingly) by magnitude if sorted_eigs=’abs’, by real part (and then by imaginary part to break ties) if sorted_eigs=’real’. Default: False.

  • tikhonov_regularization (int or float) – Tikhonov parameter for the regularization. If None, no regularization is applied, if float, it is used as the \lambda tikhonov parameter.


Compute the Dynamic Modes Decomposition to the input data.


X (numpy.ndarray or iterable) – the input snapshots.


Predict the output Y given the input X using the fitted DMD model.

Xnumpy array

Input data.

Ynumpy array

Predicted output.