Skip to content

GrayScott

Systems / ODEs / Spatial fields

A reaction–diffusion system whose spots, stripes, and self-replicating patterns are a landmark of Turing morphogenesis.

continuous · ODE4608 dimensionspatterns

spatiotemporal field — plays automatically

Definition

@staticmethod
def _equations(Y, t, *, N, Du, Dv, F, k):
    # State layout: [u (N*N), v (N*N)]; unit grid spacing (h = 1).
    def uidx(r, c):
        return (r % N) * N + (c % N)

    def vidx(r, c):
        return N * N + (r % N) * N + (c % N)

    rhs = []
    # u-block.
    for r in range(N):
        for c in range(N):
            u0 = Y(uidx(r, c))
            v0 = Y(vidx(r, c))
            lap_u = (
                Y(uidx(r + 1, c))
                + Y(uidx(r - 1, c))
                + Y(uidx(r, c + 1))
                + Y(uidx(r, c - 1))
                - 4 * u0
            )
            rhs.append(Du * lap_u - u0 * v0 * v0 + F * (1 - u0))
    # v-block.
    for r in range(N):
        for c in range(N):
            u0 = Y(uidx(r, c))
            v0 = Y(vidx(r, c))
            lap_v = (
                Y(vidx(r + 1, c))
                + Y(vidx(r - 1, c))
                + Y(vidx(r, c + 1))
                + Y(vidx(r, c - 1))
                - 4 * v0
            )
            rhs.append(Dv * lap_v + u0 * v0 * v0 - (F + k) * v0)
    return rhs

Parameters

Symbol Default Role
N 48 grid points per side (structural — changing it recompiles)
Du 0.16 u diffusion
Dv 0.08 v diffusion
F 0.06 feed rate
k 0.062 kill rate

Field blocks: u, v

Properties

Lyapunov spectrum
TODO — dim 4608 > 6 — full spectrum too slow
Kaplan–Yorke dimension
TODO — requires a numeric Lyapunov spectrum
Divergence ∇·f
$\nabla\!\cdot f = - 9216 Du - 9216 Dv - 4608 F - 2304 k$
+ per-cell nonlinear terms (over the 2304-cell field)
Equilibria
TODO — dim 4608 > 8 — equilibrium search skipped

Define it in TSDynamics

import tsdynamics as ts

sys = ts.systems.GrayScott()
traj = sys.integrate(final_time=100.0, dt=0.01)

exps = sys.lyapunov_spectrum()
ts.kaplan_yorke_dimension(exps)

Reference

Pearson (1993), Science 261, 189-192

BibTeX
@misc{grayscott,
  title = {GrayScott system},
  note = {Pearson (1993), Science 261, 189-192}
}