About Population Wave Simulation

This simulation models the spatial spread of an invasive species across a 2D landscape using the Fisher-KPP reaction-diffusion equation. Starting from a small central colony, watch the population wave expand outward at a predictable speed determined entirely by two parameters: diffusivity D and growth rate r.

The Fisher-KPP Equation

The governing equation is ∂u/∂t = D∇²u + ru(1−u), where u(x,y,t) is local population density normalized to [0,1]. The first term describes random dispersal (diffusion), the second describes logistic population growth. Fisher proved in 1937 that any localized initial population spreads as a travelling wave with minimum speed v = 2√(Dr).

Allee Effect

Enabling the Allee effect modifies the growth term to ru(u−a)(1−u). When local density falls below threshold a, the growth rate becomes negative — the population shrinks instead of growing. This creates a minimum viable population density for invasion, slowing or halting the wave front.

Numerical Method

The 150×150 grid is evolved using explicit finite differences with zero-flux (Neumann) boundary conditions. The time step is automatically constrained by the CFL condition dt ≤ dx²/(4D) for numerical stability. Color encodes density: blue (u=0, empty) → green (u=0.5, half capacity) → red (u=1, saturated). The bottom strip shows total population over time.

Frequently Asked Questions

What is the Fisher-KPP equation?
The Fisher-KPP equation is a partial differential equation that describes the spatial spread of a population through an environment. Proposed independently by Ronald Fisher and by Kolmogorov, Petrovskii, and Piscounov in 1937, it combines diffusion (the spread of individuals by random movement) with logistic growth (population increase limited by carrying capacity). The equation is ∂u/∂t = D∇²u + ru(1−u), where u is local population density (0 to 1), D is diffusivity, and r is the intrinsic growth rate.
What is the wave speed formula v=2√(Dr)?
Fisher proved that for the KPP equation with any localized initial condition, the population front travels at a minimum wave speed of v = 2√(Dr). This elegant result links two biological parameters: D (how fast individuals disperse) and r (how fast the population grows). Faster dispersal or faster growth both increase invasion speed proportionally — doubling D or r increases wave speed by a factor of √2. The wave front has a characteristic sigmoidal shape, transitioning from u=1 (saturated habitat) behind the front to u=0 (empty habitat) ahead of it.
What is the Allee effect and how does it slow invasion?
The Allee effect occurs when individuals in a sparse population have lower fitness than those at moderate density — for example, because finding mates is harder, predator dilution is reduced, or cooperative foraging fails at low density. In the modified equation ∂u/∂t = D∇²u + ru(u−a)(1−u), the threshold a > 0 creates a growth-rate penalty below density a. A population that starts below density a will shrink rather than grow, making it impossible to establish a colony from just one or two individuals. This dramatically slows or stops invasion fronts and creates a minimum viable propagule size.
How is the 2D diffusion simulated numerically?
The simulation uses the finite difference method with an explicit Euler time-stepping scheme. The Laplacian ∇²u is approximated using the five-point stencil: ∇²u ≈ (u[i+1,j] + u[i−1,j] + u[i,j+1] + u[i,j−1] − 4u[i,j]) / Δx². With grid spacing Δx=1 and time step Δt=0.1, the scheme is stable when Δt ≤ Δx²/(4D) (the CFL condition for 2D diffusion). Boundary conditions are zero-flux (Neumann): the density gradient is zero at the grid edges, so the population cannot leave the simulated region.
What causes the wave front to have a specific width?
The travelling wave solution to the Fisher-KPP equation has a front width that scales as √(D/r): high diffusivity spreads the front broadly, while high growth rate keeps it sharp. Physically, the front width represents the transition zone between established population (u≈1) and uncolonized habitat (u≈0). Within this zone, individuals are actively growing and dispersing. The front profile is approximately a logistic sigmoid, and its exact width depends on the wave speed relative to the minimum speed 2√(Dr).
What is a heterogeneous landscape and how does it affect spread?
A heterogeneous landscape has spatially varying diffusivity D(x,y) — some patches allow fast movement (open fields), others slow movement (dense forest, rivers). In the simulation, heterogeneous mode multiplies D by a random factor between 0.5 and 1.5 at each grid cell. This causes the invasion front to advance rapidly through high-D patches and stall in low-D patches, producing an irregular, fingered front shape rather than a smooth circular wave. This matches field observations of invasive species that spread faster along roads, rivers, or habitat corridors.
What real invasions has the Fisher-KPP model described?
The Fisher-KPP model has been applied to the spread of muskrats across Europe (introduced 1905, ~ 1 km/year, D≈51 km²/yr fitted), the advance of chestnut blight across North America, HIV spread through lymph nodes, and the historical spread of farming across Neolithic Europe (~1 km/year over millennia). In all cases the key prediction — a constant wave speed proportional to √(Dr) — fits well when D and r are estimated from field data.
How does the simulation measure wave speed?
The simulation tracks the radius at which population density equals 0.5 (the half-maximum contour) by scanning outward from the center. At each frame, the change in this radius divided by elapsed time gives an instantaneous wave speed in cells per unit time. In the Fisher-KPP regime this measured speed converges to the theoretical 2√(Dr) after a brief transient period while the front steepens from the initial smooth colony profile to the true travelling wave shape.
Can the invasion be stopped or reversed?
With Allee effect enabled and threshold a high enough, an invasion front can stall — the density at the leading edge falls below a and the local growth rate becomes negative, causing retreat. This bistability (either invades completely or dies out) is a key feature of the strong Allee effect model. Without Allee effect (standard Fisher-KPP), any positive initial density will eventually spread across the entire habitat — the trivial state u=0 is unstable. Control strategies such as biocontrol (reducing r) or barrier creation (reducing D locally) can slow but typically not stop a Fisher-KPP wave.
What other phenomena does reaction-diffusion modeling describe?
Reaction-diffusion equations like the Fisher-KPP model describe a wide variety of phenomena beyond biological invasion. Chemical wave propagation in the Belousov-Zhabotinsky reaction, tumor invasion in tissue, calcium waves in cells, the formation of animal coat patterns (Turing instability), and epidemic spread on networks all follow reaction-diffusion dynamics. The core insight is that the combination of local reaction (growth/decay) and spatial diffusion produces rich spatial patterns and propagating waves that are fundamentally different from either process alone.

About this simulation

This simulation models the spatial spread of an invasive species using the Fisher-KPP reaction-diffusion equation, ∂u/∂t = D∇²u + ru(1−u), solved numerically on a 150×150 grid. A small central colony expands outward as a travelling wave whose speed converges to the theoretical minimum v = 2√(Dr), and an optional Allee effect term can slow or stall the invasion below a density threshold.

🔬 What it shows

Population density u(x,y) evolving on a 150×150 grid via explicit finite differences with a five-point Laplacian stencil and zero-flux (Neumann) boundaries. Blue marks empty habitat (u=0), green marks half-capacity (u=0.5), and red marks a saturated colony (u=1). The strip below the grid plots total population over time, and the live stats compare the measured wave speed to the theoretical value 2√(Dr).

🎮 How to use

Adjust Diffusivity D and Growth rate r to change how fast individuals disperse and reproduce — watch the theoretical wave speed update instantly. Enable the Allee effect and raise the threshold a to see the invasion slow down or fail entirely. Toggle Heterogeneous landscape to randomise local diffusivity by ±50%, producing an irregular, fingered front instead of a smooth circle. Reset restarts from a fresh central colony; Pause/Play freezes the animation.

💡 Did you know?

The same v = 2√(Dr) formula that governs this simulated colony has been fitted to real invasions — muskrats spreading across Europe after their 1905 introduction advanced at roughly 1 km/year, matching a Fisher-KPP wave with D≈51 km²/yr. The same mathematics also describes the spread of chestnut blight, HIV within lymph nodes, and even the historical advance of farming across Neolithic Europe.

Frequently asked questions

What sliders control the simulation and what do they change?

Diffusivity D (0.1–3.0) sets how fast individuals disperse by random movement; Growth rate r (0.1–2.0) sets the logistic reproduction rate; and Allee threshold a (0–0.5) sets the minimum density penalty used when the Allee effect toggle is enabled. Both D and r feed directly into the theoretical wave speed shown as 2√(Dr), so moving either slider updates that stat immediately, while Reset reseeds a fresh 8-cell-radius colony at the centre of the 150×150 grid.

How does the simulation actually compute the wave each frame?

Each frame runs four explicit Euler steps of the Fisher-KPP equation. The Laplacian is approximated with the five-point stencil (sum of four neighbours minus four times the centre cell, divided by Δx²=1), the time step is capped at dt = min(0.1, 1/(4D)) to satisfy the 2D diffusion CFL stability condition, and growth uses either ru(1−u) or, with Allee effect on, ru(u−a)(1−u). Boundaries are zero-flux, so density cannot leave the grid.

How is the measured wave speed different from the "Theory 2√(Dr)" stat?

The simulation tracks the radius where density first drops to 0.5 by scanning outward from the centre, then divides the change in that radius by elapsed simulated time to get a measured speed, updated roughly every half a time unit. The "Theory 2√(Dr)" stat is the closed-form Fisher prediction computed directly from the current D and r sliders. Early in a run the measured speed is below theory while the front steepens from its initial smooth profile; after a short transient the two values converge.

What does enabling the Allee effect actually change in the model?

With the Allee toggle off, growth is the standard logistic term ru(1−u), and any positive density eventually invades the whole grid. Switching it on changes growth to ru(u−a)(1−u): once local density falls below the Allee threshold a, that term turns negative, so patches below a shrink instead of growing. Raising a with the slider makes the effective invasion threshold stricter, and a high enough value can stall the front completely or make the colony collapse rather than spread.

What happens when Heterogeneous landscape is switched on?

Turning it on builds a per-cell diffusivity map where each of the 150×150 cells gets D multiplied by a random factor between 0.5 and 1.5, generated once at reset. During stepping, the simulation uses this local value instead of the uniform D everywhere the toggle is active, so the wave front advances faster through high-diffusivity patches and lags in low-diffusivity ones — producing the same kind of irregular, fingered spread seen when real invasions follow roads, rivers, or forest corridors rather than open, uniform ground.