A from-scratch study of diffusion-driven instability: linear stability analysis derived by hand (derivations based on known Schnakenberg model equations), implemented in Python, and tested against independent numerical simulation in one and two dimensions.
The central result is a quantitative prediction confirmed two ways. For the reference parameters (*a=*0.1, b=0.9; see below), the critical diffusion ratio is derived analytically as D_c = 8.5676. Simulations decay at D = 8.5 (just below D_c) and pattern at D = 8.6 (just above D_C).
Colour shows the diffusion ratio each parameter set requires; the contour marks where D = 10 suffices
(value used in this simulation).
Two species react and diffuse on a bounded domain with zero-flux boundaries:
u is self-activating through the u²v term; v is a substrate consumed by
that reaction and replenished at rate b. Because v diffuses D times faster,
depletion spreads outward and suppresses u nearby — local activation, lateral
inhibition. γ sets the reaction rate relative to diffusion.
The homogeneous steady state is
Perturbing the steady state by a mode of wavenumber
-
The uniform state is stable without diffusion:
$\mathrm{tr} J < 0$ and$\det J > 0$ . -
Diffusion destabilises some finite
$k$ :$\det M(k) < 0$ for some$k > 0$ .
Writing
Three results follow directly and are checked in the code:
-
γ does not affect whether a pattern forms. It factors out of the discriminant
as
$\gamma^2$ , so$D_c$ depends only on$(a, b)$ . However, it does set the wavelength:$k^2_{\max} \propto \gamma$ . Existence is set by the kinetics' structure and the diffusion ratio; length scale is set by the reaction rate. -
Self-activation requires
$b > a$ . The condition$\partial f/\partial u > 0$ reduces to$(b - a)/(a + b) > 0$ . -
Only discrete modes exist. Zero-flux boundaries admit
$k_n = n\pi/L$ , and mode$n$ has$n/2$ peaks. Boundaries fix the pattern's position, not just its spacing.
Reference parameters:
| Quantity | Predicted | Observed |
|---|---|---|
| Threshold |
8.5676 (analytic root) | between 8.5 and 8.6 (simulation) |
| Winning mode at |
|
3 peaks |
| Growth rate of |
≈ 54 | 53.57 |
|
|
identical | identical across the |
Linear theory describes growth from infinitesimal noise. Past onset, nonlinear competition between neighbouring modes can shift the final peak count by one, depending on the initial noise.
The parameter map has two excluded regions with distinct meanings. Below the
trace boundary, the uniform state is unstable without diffusion (Turing–Hopf
territory, not a pure Turing instability). Below the line u is not
self-activating and no diffusion ratio can produce a pattern.
![]() |
![]() |
In two dimensions the linear theory is unchanged with
(see figures folder for ring and stripe patterns)
- Explicit Euler time-stepping with a 3-point (1D) or 5-point (2D) Laplacian.
- Zero-flux boundaries by edge-padding, which conserves total mass exactly.
- Timestep
$\Delta t = 0.2 \Delta x^2 / (2 d D_{\max})$ in$d$ dimensions.
The explicit scheme is simple and transparent but expensive: because
src/turing/
├── kinetics.py steady state, reaction terms, Jacobian
├── analysis.py dispersion matrix, growth rates, critical D
├── solver.py Laplacian, initial conditions, time integration
└── plotting.py kymograph, dispersion, threshold map and slice
tests/ one test file per module
notebooks/
├── 01_simulation_1D.ipynb
├── 02_linear_stability.ipynb
└── 03_simulation_2D.ipynb
kinetics knows only the chemistry; analysis and solver build on it; plotting
draws data it is given and computes nothing. Swapping in different kinetics means
rewriting one module.
Most tests check a result against an independent route to the same answer:
- the analytic Jacobian against a finite-difference estimate from the reaction terms
- eigenvalue and trace/determinant growth rates against each other
-
$D_c$ against the hand-derived quadratic root - growth-rate sign change across
$D_c$ -
$\gamma$ -invariance of$D_c$ - Laplacian: zero on constants, exact on
$x^2$ , mass-conserving
git clone https://github.com/Patra-arya/turing_pattern.git
cd turing_pattern
pip install -e .
pytestRequires NumPy, SciPy, Matplotlib, and pytest.
- Am, Turing. "The chemical basis of morphogenesis." Phil Trans R Soc B 237 (1952): 37-72.
- Schnakenberg, Jürgen. "Simple chemical reaction systems with limit cycle behaviour." Journal of theoretical biology 81.3 (1979): 389-400.
- Murray, J. D. (2003). Mathematical Biology II, 3rd ed., ch. 2. Springer.
- Kondo, Shigeru, and Takashi Miura. "Reaction-diffusion model as a framework for understanding biological pattern formation." science 329.5999 (2010): 1616-1620.
- Raspopovic, Jelena, et al. "Digit patterning is controlled by a Bmp-Sox9-Wnt Turing network modulated by morphogen gradients." Science 345.6196 (2014): 566-570.
- Marcon, Luciano, et al. "High-throughput mathematical analysis identifies Turing networks for patterning with equally diffusing signals." Elife 5 (2016): e14022.
AI was used to modify and sometimes co-write code. The author takes full responsibility.
MIT

