Reaction–diffusion: from concentrations to spots and mazes
Open reaction–diffusion. Drag to seed a disturbance and watch spots split, extend or join into bands. Following Karl Sims’ reaction–diffusion tutorial, the experiment evolves concentrations of two virtual substances on a grid rather than individual molecules.
Controls
Maze, Spots and Coral select different parameters and reseed the field. Dragging adds a patch with high B concentration. With the canvas focused, use the arrows to move the cursor and Enter or Space to seed. Pause and Step expose changes along local edges.
Reset restores Maze parameters and the default seeds. Initialization already performs 160 reaction steps, so the first image is not the freshly seeded circles. Preset names describe typical appearances; seeds, disturbances and elapsed time still affect the shape.
Gray–Scott updates
For concentrations , the model uses:
This implementation sets , and time step 1. Its nine-point diffusion stencil weights the center , axial neighbors each and diagonal neighbors each. The feed parameter replenishes A; and contribute to removing B.
Grid and color
The grid wraps at its edges. Each simulation update, including Step, performs six reaction steps. Alternating float buffers keep newly updated neighbors out of the current calculation. Concentrations are clamped to after each step as a numerical guard for this display implementation.
Color maps only B: is clipped to and passed through a smooth curve before palette lookup. The legend ends at because larger concentrations share the endpoint color. The pixel field is smoothly enlarged; a larger canvas does not increase simulation resolution.
Unlike the binary cells of the Game of Life, neighboring sites exchange continuous concentrations here. This texture model is not calibrated to the physical units or rates of a specific chemical reaction.