SwiftHohenberg¶
Systems / ODEs / Spatial fields
The prototype pattern-forming PDE — stripes and hexagons from a single scalar field near a finite-wavelength instability.
Definition¶
@staticmethod
def _equations(Y, t, *, N, L, r):
h = L / N
inv_h2 = 1.0 / (h * h)
inv_h4 = inv_h2 * inv_h2
def idx(rr, cc):
return (rr % N) * N + (cc % N)
rhs = []
for rr in range(N):
for cc in range(N):
def u(dr, dc, rr=rr, cc=cc):
return Y(idx(rr + dr, cc + dc))
u0 = u(0, 0)
lap = (u(1, 0) + u(-1, 0) + u(0, 1) + u(0, -1) - 4 * u0) * inv_h2
# Compact 13-point biharmonic (∇⁴) stencil on a periodic grid.
bih = (
20 * u0
- 8 * (u(1, 0) + u(-1, 0) + u(0, 1) + u(0, -1))
+ 2 * (u(1, 1) + u(1, -1) + u(-1, 1) + u(-1, -1))
+ (u(2, 0) + u(-2, 0) + u(0, 2) + u(0, -2))
) * inv_h4
# u_t = r u - (1 + ∇²)² u - u³ = r u - (u + 2 ∇²u + ∇⁴u) - u³
rhs.append(r * u0 - (u0 + 2.0 * lap + bih) - u0 * u0 * u0)
return rhs
Parameters¶
| Symbol | Default | Role |
|---|---|---|
N |
32 |
grid points per side (structural — changing it recompiles) |
L |
40 |
domain length per side |
r |
0.3 |
linear growth control (unstable bandwidth) |
Properties¶
Lyapunov spectrum
TODO — dim 1024 > 6 — full spectrum too slow
Kaplan–Yorke dimension
TODO — requires a numeric Lyapunov spectrum
Divergence ∇·f
$\nabla\!\cdot f = 1024 r - 1024 + \frac{8388608.0}{L^{2}} - \frac{21474836480.0}{L^{4}}$
+ per-cell nonlinear terms (over the 1024-cell field)
+ per-cell nonlinear terms (over the 1024-cell field)
Equilibria
TODO — dim 1024 > 8 — equilibrium search skipped
Define it in TSDynamics¶
import tsdynamics as ts
sys = ts.systems.SwiftHohenberg()
traj = sys.integrate(final_time=100.0, dt=0.01)
exps = sys.lyapunov_spectrum()
ts.kaplan_yorke_dimension(exps)
Reference¶
Swift & Hohenberg (1977), Phys. Rev. A 15, 319-328