Reaction-Diffusion Simulator Back
Self-Organization

Reaction-Diffusion Simulator

Generate Turing patterns — spots, stripes, bubbles, coral — in real time using the Gray-Scott model. Freely adjust diffusion coefficients, feed rate, and kill rate.

Parameters

Du (U diffusion)0.20
Dv (V diffusion)0.05
F (feed rate)0.0350
k (kill rate)0.0650
Speed5

Presets

0
Steps
Spots
Pattern
0
FPS
U mean

Gray-Scott Model

$$\frac{\partial u}{\partial t}=D_u\nabla^2 u - uv^2+F(1-u)$$

$$\frac{\partial v}{\partial t}=D_v\nabla^2 v + uv^2-(F+k)v$$

U concentration shown in false color (blue=0, yellow=1). Different F/k combinations yield diverse patterns.

What is Reaction-Diffusion?

🧑‍🎓
What exactly is a "reaction-diffusion" system? The name sounds complicated.
🎓
Basically, it's a simple concept: two chemicals spread out (diffuse) and react with each other. In practice, this interplay can create incredibly complex, self-organizing patterns out of a uniform state. For instance, the stripes on a zebra or the spots on a leopard are thought to form this way. Try moving the "Feed Rate (F)" slider in the simulator above to see how a simple change can trigger pattern formation from a blank state.
🧑‍🎓
Wait, really? So the simulator is modeling two fake chemicals? What do the "U" and "V" stand for?
🎓
Exactly. In the Gray-Scott model used here, "U" is a substrate or "food" chemical that is constantly fed into the system. "V" is an "activator" or "pigment" chemical that consumes U to reproduce, but also decays. The colors you see represent the concentration of U. When you change the "Kill Rate (k)" parameter, you're controlling how quickly V decays, which dramatically changes the pattern.
🧑‍🎓
That makes sense! So the "Du" and "Dv" sliders control how fast they spread. Why does that matter for making spots versus stripes?
🎓
Great question! It's all about instability. For patterns to form, the inhibitor (U, which spreads faster with a higher Du) must diffuse away more quickly than the activator (V). This allows V to form concentrated spots or bands without being immediately suppressed. A common case is setting Dv much lower than Du. Try the "Spots" preset button—it sets this diffusion ratio and adjusts F and k to create a stable spotted pattern.

Physical Model & Key Equations

The Gray-Scott model is defined by two coupled partial differential equations that govern the concentrations of chemicals U and V over time and space.

$$ \frac{\partial u}{\partial t}=D_u\nabla^2 u - uv^2+F(1-u) $$

$u(x,y,t)$: Concentration of substrate U.
$D_u$: Diffusion rate of U (how fast it spreads).
$\nabla^2 u$: The diffusion term (spreading).
$-uv^2$: The reaction term (U is consumed by V).
$F(1-u)$: Feed term (fresh U is added).

The second equation describes the dynamics of the activator chemical V.

$$ \frac{\partial v}{\partial t}=D_v\nabla^2 v + uv^2-(F+k)v $$

$v(x,y,t)$: Concentration of activator V.
$D_v$: Diffusion rate of V (typically slower than $D_u$).
$+uv^2$: Reaction term (V reproduces by consuming U).
$-(F+k)v$: Decay term; V is removed. Here, $k$ is the crucial "kill rate" parameter you control with a slider.

Real-World Applications

Biological Pattern Formation: This is the classic example. The equations provide a plausible model for how animal coat patterns (zebra stripes, leopard spots, angelfish stripes) self-organize from a uniform embryonic state. The parameters (like feed and kill rates) could be controlled by genetic and environmental factors.

Corrosion & Material Degradation: Reaction-diffusion models simulate how corrosive agents (like oxygen or ions) diffuse through a protective coating or material and react with the substrate. Engineers use these simulations to predict failure points and design more resistant materials.

Combustion & Flame Propagation: The spread of a flame front in an engine or burner is a reaction-diffusion process. Fuel and oxidizer diffuse together, and a reaction (combustion) occurs when conditions are right. Simulating this is key to designing efficient and safe engines.

Electrochemical Systems & Battery Design: In a battery, ions diffuse through an electrolyte and react at the electrodes. Modeling this with reaction-diffusion equations helps optimize battery performance, lifespan, and safety by understanding the formation of potentially damaging concentration patterns.

Common Misconceptions and Points to Note

First, do you think "the initial state can be anything"? In reality, the initial state is extremely important; slight noise (randomness) acts as the "seed" for pattern formation. Nothing emerges from a perfectly uniform state. This simulator places a V-shaped "seed" in the center as the initial state, but in practical applications, you need to set noise based on real observational data.

Next, you might expect to quickly create a "desired pattern" through parameter tuning, but the combination of F and k is very delicate. For example, when transitioning from the preset "spots" to "stripes", disordered patterns (chaos) often appear at intermediate parameters. This is not a bug but an essential feature of the system's nonlinearity. In practice, systematically sweeping the parameter space to find "stable regions" is the first step.

Also, be cautious of the misconception that "the diffusion coefficient ratio (Dv/Du) can be fixed". The essence of the Gray-Scott model lies in the fact that the activator V remains in a much narrower region than the inhibitor U (Dv < Du). If you bring this ratio close to 1, patterns will not form, and the system will converge to a uniform state. If you don't see patterns in your simulation, first check this premise.

Related Engineering Fields

The computational method of this simulator is precisely "numerical solution of partial differential equations". Specifically, the finite difference method is often used for calculating the diffusion term, which is also foundational in heat conduction and fluid flow analysis. In other words, tweaking parameters with this tool is quite similar to experiencing the solver settings of CFD (Computational Fluid Dynamics).

Regarding applications, battery and fuel cell development is interesting. At the interface between the electrode and electrolyte, lithium-ion insertion/extraction and chemical reactions occur locally, describable by "reaction" and "diffusion". If this proceeds non-uniformly, it can cause spot-like degradation (dendrite growth), leading to fire risk. Research is advancing to apply extended Gray-Scott models to predict such interfacial instabilities.

Furthermore, connections are deepening in the field of additive manufacturing (3D printing). For instance, phenomena like "balling" (where molten metal forms spheres) during laser melting of metal powder for layering, or resin curing patterns, can be modeled as reaction-diffusion processes of heat and material. The theory of pattern formation is aiding in controlling defects in actual manufacturing.

For Further Learning

The first next step is to try implementing a "classic reaction-diffusion system" yourself. Using Python with NumPy and Matplotlib, code a finite difference method (e.g., using a 5-point stencil for the Laplacian calculation) on a 100×100 grid. Changing initial conditions or experimenting with how to introduce noise yields discoveries beyond textbooks.

To deepen your mathematical understanding, grasp the concept of linear stability analysis. This method determines whether a small perturbation (a wave with wavenumber $k$) added to a uniform steady state will grow or decay. From the growth condition, you can theoretically derive the characteristic wavelength of the emerging pattern. In equations, this involves finding the condition where the real part of the eigenvalues of the Jacobian matrix becomes positive.

Moving forward, we recommend learning about "the universality of pattern formation". The Gray-Scott model is just one example of an "activator-inhibitor system". Comparing other models in the same category, like the FitzHugh-Nagumo model (nerve excitation conduction) or the Shiba-Inoue model (snow crystal growth), reveals a common mathematical principle where order emerges from the combination of nonlinearity and diffusion, even across vastly different fields, which will dramatically broaden your perspective.