ML for Science and Engineering — Lecture 10
Schmid, "Dynamic mode decomposition of numerical and experimental data," J. Fluid Mech. 656, 2010
Brunton & Kutz, Data-Driven Science and Engineering, Cambridge UP, 2019
Two masses connected by springs: a classic linear system.
$m_1=m_2=1,\; k_1=k_2=k_3=1,\; x_1(0)=1,\; x_2(0)=0$
Any square matrix can be decomposed as
Written out for an $n \times n$ matrix:
Starting from $\dot{\mathbf{x}} = A\mathbf{x}$, substitute $A = V\Lambda V^{-1}$:
Multiply both sides on the left by $V^{-1}$:
Define a new variable $\mathbf{z} = V^{-1}\mathbf{x}$, so $\dot{\mathbf{z}} = V^{-1}\dot{\mathbf{x}}$:
For symmetric $A$: $V^{-1} = V^T$, so the change of basis is just a rotation.
For $z_i(t) = z_i(0)\,e^{\lambda_i t}$, the eigenvalue $\lambda_i$ controls the behavior:
Click the complex plane to place an eigenvalue $\lambda$. See the resulting trajectory $z(t) = e^{\lambda t}$.
For our spring-mass system with $m_1=m_2=1$, $k_1=k_2=k_3=1$:
The stiffness matrix $K$ has eigenvalues $\mu_i$ (stiffness per mode).
Natural frequencies: $\omega_i = \sqrt{\mu_i}$. System eigenvalues: $\lambda_i = \pm\, i\omega_i$.
The full solution is a superposition:
With $x_1(0) = 1, x_2(0) = 0$: $c_1 = c_2 = \tfrac{1}{2}$
The general solution in original coordinates:
Fluid flowing past a cylinder produces vortex shedding: alternating vortices behind the obstacle.
Mean-subtracted vorticity: oscillating vortex street
Brunton & Kutz, Data-Driven Science and Engineering, Cambridge UP, 2019
Stack each snapshot as a column to form the data matrix $X$, then decompose it:
Truncated SVD: keep only the $r$ largest singular values (rank-$r$ approximation of $X$).
Spatial modes (columns of $U$, reshaped to 449×199)






Each $\mathbf{u}_i \in \mathbb{R}^{89{,}351}$ is reshaped to 449×199 for display. Orthogonal, ranked by $\sigma_i$.
Temporal modes $\sigma_i \mathbf{v}_i^T$ (weighted rows of $V^T$)
If the dynamics are (approximately) linear, then each snapshot maps to the next:
Stack snapshots into two matrices:
One-step-forward matrix:
If $X' = AX$, how can we recover $A$?
We need some kind of "inverse" of $X$, but $X$ is rectangular ($n \times (m{-}1)$).
The pseudo-inverse $X^\dagger$ gives the least-squares solution:
Using the SVD $X = U\Sigma V^T$, the pseudo-inverse is $X^\dagger = V\Sigma^{-1}U^T$, so:
If the data lives in a low-dimensional subspace, we don't need the full $A$. Project onto the dominant $r$ SVD modes:
We want eigenvectors of $A$, but $A$ is $n \times n$. Instead, define a reduced operator:
$U_r$ projects from $\mathbb{R}^n$ into the $r$-dimensional subspace; $U_r^T$ projects back. $\tilde{A}$ is only $r \times r$.
Substituting $A = X' V \Sigma^{-1} U^T$ and truncating:
Does the cylinder flow data actually have low-rank structure? The SVD spectrum of $X$ confirms it:
def DMD(X, Xprime, r):
# Step 1: SVD of X, truncate to rank r
U, S, Vt = np.linalg.svd(X, full_matrices=False)
Ur, Sr, Vtr = U[:, :r], np.diag(S[:r]), Vt[:r, :]
# Step 2: Project dynamics onto SVD basis
Atilde = Ur.T @ Xprime @ Vtr.T @ np.linalg.inv(Sr)
# Step 3: Eigendecomposition of reduced operator
Lambda, W = np.linalg.eig(Atilde)
# Step 4: Recover full-space DMD modes
Phi = Xprime @ Vtr.T @ np.linalg.inv(Sr) @ W
return Phi, Lambda
DMD gives us modes $\boldsymbol{\phi}_i$, eigenvalues $\lambda_i$, and amplitudes $b_i$.
The 21 DMD eigenvalues in the complex plane. Points near the unit circle are persistent modes.
The columns of $\Phi$: each mode captures a coherent spatial oscillation pattern.
Each mode oscillates at its own frequency: $b_i\,\lambda_i^t$
How do the temporal modes from SVD and DMD compare?
SVD temporal modes ($\sigma_i \mathbf{v}_i^T$)
DMD temporal modes (Re($b_i \lambda_i^t$))
How many modes do we need for a good reconstruction?
Original snapshot at $t=100$
DMD reconstruction at $t=100$
| DMD | SINDy | |
|---|---|---|
| Assumes | Linear dynamics | Sparse nonlinear |
| Method | Spectral decomp. | Sparse regression |
| Output | Global modes | Local equations |
| Scales to | Very high dim. | Low-moderate dim. |
Ref: Schmid (2010), J. Fluid Mech. | Brunton & Kutz (2019) Ch. 7