Search

Search papers and lessons

Dynamic Mode Decomposition

Level 4 · 11 min read

Dynamic mode decomposition fits a linear rule to a sequence of snapshots of a system, then reads off its modes, growth rates and frequencies from the eigen-decomposition of that rule.

On this page

  • Colour = topic mix
  • Linear algebra
  • Probability
  • Discrete math
  • Calculus
  • Control systems
  • Mechanical engineering
  • Sign in to see your progress

TL;DR

Dynamic mode decomposition, or DMD, watches a system through a list of snapshots, one measurement per time step, and asks for the simplest linear rule that carries each snapshot to the next. That rule is a matrix. Its eigenvectors give spatial patterns, called modes, and its eigenvalues give how each pattern grows or decays and how fast it oscillates.

It works even when the system is not linear, provided its behaviour is close to linear around the regime you measured. The method needs no equations of motion, only data.

Where you'll see it: in the wake behind a cylinder or an aircraft wing, where it isolates the shedding frequency and its decay, in power-grid monitoring from sensor logs, and in video analysis, where it separates a static background from a moving foreground.

Intuition

Watching a system through snapshots

Imagine a pond with ripples. You photograph the surface every hundredth of a second and store each photo as a long column of brightness values. You now have a sequence of columns, one per time step, and you want to know what the ripples are doing. Are they travelling, fading, or repeating?

If the ripples follow a simple rule (a linear dynamical system), each photo is a fixed matrix times the previous photo. The matrix is too big to write down for a real pond, since it has one row for every pixel. DMD gets around this. It finds the rule restricted to the few patterns that actually carry the motion, and those patterns, the modes, are what you want to see.

Why the rule has eigenvalues

The matrix that carries one snapshot to the next has eigenvectors and eigenvalues, as described in eigenvalues and eigenvectors. An eigenvector is a pattern the rule only scales. If the scale is λ\lambda, then after kk steps the pattern is multiplied by λk\lambda^k. A scale below 1 in size means the pattern dies out, a scale above 1 means it grows, and a complex scale means it rotates. So the eigenvalues carry the whole story of growth and oscillation, and DMD's job is to estimate them from data.

When the system is nonlinear, no single matrix is exact, but a matrix can still fit the snapshots well near the regime you measured. That best-fit matrix is what DMD estimates.

The math

Setup

Record m+1m + 1 snapshots x0,x1,…,xm\mathbf{x}_0, \mathbf{x}_1, \dots, \mathbf{x}_m in Rn\mathbb{R}^n, where nn is the number of measured values, such as pixels or sensors. Stack the first mm snapshots and the last mm snapshots into two matrices:

X=[x0x1⋯xm−1],X′=[x1x2⋯xm].X = \begin{bmatrix} \mathbf{x}_0 & \mathbf{x}_1 & \cdots & \mathbf{x}_{m-1} \end{bmatrix}, \qquad X' = \begin{bmatrix} \mathbf{x}_1 & \mathbf{x}_2 & \cdots & \mathbf{x}_{m} \end{bmatrix}.

Each column of X′X' is the next time step of the matching column of XX. If the system is linear, there is a single matrix AA, of size n×nn \times n, with X′≈AXX' \approx AX.

The best fit

The least-squares estimate of AA minimises the squared error ∥X′−AX∥F2\|X' - AX\|_F^2, where ∥⋅∥F\|\cdot\|_F is the Frobenius norm, the square root of the sum of squared entries. The solution is A=X′X+A = X' X^{+}, where X+X^{+} is the pseudoinverse, the generalisation of the matrix inverse to non-square matrices. Computing this directly is impossible when nn is in the millions, because AA would have trillions of entries.

Reduce with the SVD

DMD reduces the problem first. Take the singular value decomposition of XX and keep the rr largest singular values:

X≈UrΣrVr∗,X \approx U_r \Sigma_r V_r^{*},

where UrU_r holds the leading spatial patterns, Σr\Sigma_r is a diagonal matrix of singular values, and Vr∗V_r^{*} is the conjugate transpose of the right singular vectors. The superscript ∗* means conjugate transpose, and for real data it is just transpose. Now project the unknown AA onto the span of UrU_r:

A~=Ur∗A Ur=Ur∗X′VrΣr−1.\tilde{A} = U_r^{*} A\, U_r = U_r^{*} X' V_r \Sigma_r^{-1}.

The right-hand side uses only data that we have. A~\tilde{A} is only r×rr \times r, so it is cheap to handle.

Eigen-decomposition

Solve the small eigenproblem A~W=WΛ\tilde{A} W = W \Lambda. The diagonal entries λj\lambda_j of Λ\Lambda are the DMD eigenvalues. The exact DMD modes are

Φ=X′VrΣr−1W,\Phi = X' V_r \Sigma_r^{-1} W,

and the columns ϕj\boldsymbol{\phi}_j of Φ\Phi are the modes. These are the eigenvectors of AA itself, recovered in the full space. The eigenvalues λj\lambda_j of A~\tilde{A} are the eigenvalues of AA restricted to the captured subspace.

Reconstruction

Write the first snapshot in the mode basis, x0=Φb\mathbf{x}_0 = \Phi \mathbf{b}, and solve for the amplitudes b\mathbf{b}. Then the whole sequence is

xk≈∑j=1rbj ϕj λj k.\mathbf{x}_k \approx \sum_{j=1}^{r} b_j\, \boldsymbol{\phi}_j\, \lambda_j^{\,k}.

Each mode is a fixed pattern with amplitude bjb_j, multiplied each step by its own λj\lambda_j. This is the main output: a few patterns, each with an interpretable rate.

Reading growth and frequency

If the snapshots are taken every Δt\Delta t seconds, convert each eigenvalue to a continuous-time pair. Write λj=e(σj+iωj)Δt\lambda_j = e^{(\sigma_j + i\omega_j)\Delta t}. Then σj=ln⁡∣λj∣/Δt\sigma_j = \ln|\lambda_j| / \Delta t is the growth rate per second (negative for decay), and ωj=arg⁡(λj)/Δt\omega_j = \arg(\lambda_j) / \Delta t is the angular frequency in radians per second. The frequency in hertz is ωj/2π\omega_j / 2\pi. Here ln⁡\ln is the natural logarithm, and arg⁡\arg is the angle of a complex number.

0510152000.20.40.60.81time step kmode amplitude |λ|^k
  • |λ| = 0.985 per step
  • neutral
A mode with |λ| below 1 decays steadily. After 10 steps the amplitude is about 0.86 of its start.

Worked examples

Example
Example 1: two decoupled modes, tiny and exact

Let the true rule be A=[0.5002]A = \begin{bmatrix} 0.5 & 0 \\ 0 & 2 \end{bmatrix}, and start from x0=(1,1)\mathbf{x}_0 = (1, 1). Generate three snapshots.

  1. x1=Ax0=(0.5,2)\mathbf{x}_1 = A\mathbf{x}_0 = (0.5, 2).
  2. x2=Ax1=(0.25,4)\mathbf{x}_2 = A\mathbf{x}_1 = (0.25, 4).
  3. Stack them: X=[10.512]X = \begin{bmatrix} 1 & 0.5 \\ 1 & 2 \end{bmatrix} and X′=[0.50.2524]X' = \begin{bmatrix} 0.5 & 0.25 \\ 2 & 4 \end{bmatrix}.
  4. Here XX is square and invertible with determinant 2−0.5=1.52 - 0.5 = 1.5, so X−1=11.5[2−0.5−11]X^{-1} = \frac{1}{1.5}\begin{bmatrix} 2 & -0.5 \\ -1 & 1 \end{bmatrix}.
  5. Compute ADMD=X′X−1A_{\text{DMD}} = X' X^{-1}. The first row is 11.5(0.5⋅2+0.25⋅(−1),  0.5⋅(−0.5)+0.25⋅1)=(0.5,0)\frac{1}{1.5}(0.5 \cdot 2 + 0.25 \cdot (-1),\; 0.5 \cdot (-0.5) + 0.25 \cdot 1) = (0.5, 0). The second row is 11.5(2⋅2+4⋅(−1),  2⋅(−0.5)+4⋅1)=(0,2)\frac{1}{1.5}(2 \cdot 2 + 4 \cdot (-1),\; 2 \cdot (-0.5) + 4 \cdot 1) = (0, 2).
  6. So DMD recovers AA exactly, and its eigenvalues are 0.50.5 and 22, with eigenvectors (1,0)(1,0) and (0,1)(0,1).

Interpretation: one pattern shrinks by half each step and the other doubles. Because the data was noise-free and the system had two states, DMD recovered the rule with no error.

Example
Example 2: a rotating, decaying pattern

Take the rule A=[0.9−0.40.40.9]A = \begin{bmatrix} 0.9 & -0.4 \\ 0.4 & 0.9 \end{bmatrix}, which rotates and shrinks each state.

  1. The eigenvalues satisfy λ2−(trace)λ+det⁡A=0\lambda^2 - (\text{trace})\lambda + \det A = 0. The trace is 1.81.8 and the determinant is 0.81+0.16=0.970.81 + 0.16 = 0.97.
  2. So λ=0.9±0.4i\lambda = 0.9 \pm 0.4i, a complex pair.
  3. The size of each eigenvalue is ∣λ∣=0.97≈0.98489|\lambda| = \sqrt{0.97} \approx 0.98489. The pattern loses about 1.5 percent of its size each step.
  4. The angle is arg⁡(λ)=arctan⁡(0.4/0.9)≈0.4182\arg(\lambda) = \arctan(0.4/0.9) \approx 0.4182 radians per step.
  5. DMD on enough noise-free snapshots from this system returns the same complex pair, and the modes come out as a conjugate pair of complex patterns.
  6. After 10 steps the amplitude is 0.9848910≈0.8590.98489^{10} \approx 0.859 of its start.

Interpretation: DMD does not just find that something decays. It finds a rotating pattern, its rate of decay and its angular speed per step, all from the data alone.

Example
Example 3: a sensor trace with a known frequency

Suppose a sensor on a vibrating structure is sampled every Δt=0.01\Delta t = 0.01 seconds, and DMD returns one eigenvalue λ=0.998 ei 0.628\lambda = 0.998\, e^{i\,0.628}. These numbers are chosen for illustration, not taken from a real measurement.

  1. Growth rate: σ=ln⁡(0.998)/0.01≈−0.2002\sigma = \ln(0.998)/0.01 \approx -0.2002 per second. The mode decays slowly.
  2. Angular frequency: ω=0.628/0.01=62.8\omega = 0.628/0.01 = 62.8 radians per second.
  3. Frequency in hertz: ω/(2π)=62.8/6.283≈10.0\omega/(2\pi) = 62.8/6.283 \approx 10.0 Hz.
  4. Read the mode's spatial shape from its eigenvector ϕ\boldsymbol{\phi}. Its large entries show where on the structure the 10 Hz motion is strongest.

Interpretation: a single complex eigenvalue has told us the structure rings near 10 Hz, fading about 18 percent per second (since e−0.2002≈0.82e^{-0.2002} \approx 0.82), and where it rings most. This is the kind of summary engineers use to decide whether a vibration is a danger.

Tradeoffs and failure modes

SituationWhat goes wrongBetter choice
System is strongly nonlinearOne matrix cannot describe the motion across regimesUse a nonlinear lift, or DMD on a shorter window
Snapshots are too few or too closeThe fit is poorly conditioned and modes are unstableCollect more snapshots spread over time
Noise is largeEigenvalues are biased toward or away from the unit circleUse optimised or total least-squares DMD (variants that account for noise in both XX and X′X')
Many modes, each with little energyTruncation discards real dynamicsKeep more modes, or check the singular value spectrum
Transients dominateThe mode set describes the transient, not the steady stateDiscard early snapshots, or add a forcing term

The main failure is treating the output as more reliable than the data. DMD returns a rule for whatever you fed it, including noise and sampling artefacts. Always check the singular values, look at whether the eigenvalues cluster near the unit circle (which suggests sustained oscillation), and test the reconstruction on snapshots that were not used in the fit.

Alternatives include proper orthogonal decomposition (POD, essentially PCA applied to snapshots), which ranks modes by energy but does not model their time evolution, and regression-based identification of a full model. DMD sits between them: it gives the time behaviour of the patterns without requiring the full equations.

History

Peter Schmid introduced DMD for fluid dynamics in the late 2000s. His 2010 paper in the Journal of Fluid Mechanics showed that the modes of a flow, such as the shedding behind a cylinder, could be extracted from experimental and numerical snapshots. The method was linked to earlier ideas that Clarence Rowley and colleagues used for model reduction of flows.

The deeper roots lie in the 1931 work of Bernard Koopman, who showed that a nonlinear system can be studied through a linear operator acting on functions of its state. That idea, now called the Koopman operator, explains why a linear rule on measurements can describe a nonlinear system. DMD became popular because it was simple to compute from data, and it spread quickly to video analysis, neuroscience and power systems in the following decade.

Recap

DMD takes a sequence of snapshots, fits the best linear rule that moves each one to the next, and reduces that rule with the SVD. The eigen-decomposition of the reduced rule gives modes, each with an eigenvalue that encodes growth and frequency. The result is a short list of patterns and rates that summarise the system. From here, the natural extension is the Koopman operator, which gives the theory for why a linear fit can capture nonlinear motion.

Check yourself

QuestionFor the rule A equal to diag(0.5, 2) in Example 1, what is the DMD eigenvalue for the pattern that doubles each step, and what does it mean for the amplitude after three steps?Show answer

The eigenvalue is 2. After three steps that pattern's amplitude is multiplied by 23=82^3 = 8, so an initial amplitude of 1 becomes 8. The mode grows eightfold over three steps, which is why it would dominate any long-term reconstruction.

QuestionA DMD eigenvalue has modulus 0.95 and sampling interval 0.1 seconds. Is the mode growing or decaying, and by how much per second?Show answer

The modulus is below 1, so the mode decays. The growth rate is σ=ln⁡(0.95)/0.1≈−0.513\sigma = \ln(0.95)/0.1 \approx -0.513 per second. Each second the amplitude is multiplied by about e−0.513≈0.60e^{-0.513} \approx 0.60, so it loses roughly 40 percent per second.

QuestionWhy does DMD project the unknown matrix onto the SVD basis instead of solving for the full matrix directly?Show answer

The full matrix has n×nn \times n entries, and nn can be in the millions for a flow or image, which makes it impossible to store or invert. Projecting onto the leading rr singular vectors gives an r×rr \times r matrix that captures the dominant dynamics, and it can be computed from the data without ever forming the full matrix.

QuestionExplain why a complex eigenvalue appears as a conjugate pair in real data and what that pair represents.Show answer

A real rule has real entries, so its complex eigenvalues come in conjugate pairs. The pair describes one real oscillating pattern. The two eigenvalues are e(σ+iω)Δte^{(\sigma + i\omega)\Delta t} and its conjugate, and together they produce a real pattern that grows or decays at rate σ\sigma and oscillates at frequency ω\omega. Reading only one of them gives the same information.

QuestionA sensor trace gives eigenvalue 1.0 exactly. What does this suggest about the mode?Show answer

An eigenvalue of exactly 1 has modulus 1 and angle 0, so the pattern keeps the same amplitude and does not oscillate: it is a steady, constant pattern. (A complex eigenvalue with modulus 1 and nonzero angle would be a sustained oscillation.) Eigenvalues on or near the unit circle therefore mark persistent behaviour in the data.

Sources