STRATA
Skip to study
XLVII

XLVII / Experiments

Workbench

Change a condition, inspect what happens, and keep the result. Six experiments connect an equation with a visible outcome, a numerical record, and questions you can pursue.

Diffusion in a closed field

What changes when a field spreads, and what is conserved?

Two concentrated patches spread across a closed grid. At each step, a cell exchanges part of its value with its four nearest neighbors. Follow the decreasing peaks and increasing spread while checking whether the total survives the update.

The field spreads across a closed grid.

Initial field

48 columns × 30 rows

After 80 steps

48 columns × 30 rows
00.965 field units
Both panels use the same linear grayscale, from black at zero to white at the initial peak. The boundaries exchange no field with the outside.

A slice through the middle row

InitialCurrent
Field value (dimensionless)00.260.510.771.02011.7523.535.2547Horizontal cell coordinate
The profile follows row 15 of the grid; every horizontal position uses the same cell in the initial and evolved field.
Retained field total
57.9058

Sum of all 1440 cell values.

Relative total drift
6.1e-16

Numerical roundoff under closed boundaries.

Peak value
0.1518

Initial peak: 0.9650.

Spatial variance
1.21e-3

Variance of cell values, in field units squared.

The initial and evolved fields use the same grid and scale. Spatial variance is computed across all cells.
StateField totalPeak valueSpatial variance
Initial57.9058360.9650361.5473e-2
After 80 steps57.9058360.1517851.2109e-3

Keep a reproducible record.

The JSON includes parameters, model assumptions, sources, and full results. The CSV contains all 1,440 cells, including coordinates and initial and current values.

Method

The calculation follows these rules.

An explicit finite-difference update adds the discrete Laplacian times a coefficient. At the outer edge, a missing neighbor takes the boundary cell’s own value, giving zero outward flux. Every internal exchange has an equal counterpart in its neighboring cell.

u_next = u + q × (u_left + u_right + u_up + u_down − 4u); 0 ≤ q ≤ 1/4.

Read the result within its assumptions.

  • Coordinates are grid cells, elapsed time is model steps, and field values are dimensionless. A material-specific diffusion constant and physical cell size have not been assigned.
  • There are no sources, sinks, reactions, advection, or flow through the boundary. Field total should remain constant to floating-point precision.
  • The heatmap uses the initial peak for its color scale, so a dimmer field indicates lower local values rather than an automatically rescaled image.

Take the experiment further.

01

Check conservation.

Compare the field total at 0, 80, and 240 steps. Distinguish a lower peak from a loss of total field.

02

Compare exchange rates.

Hold the step count at 80 and compare coefficients of 0.05 and 0.20. Inspect both the heatmap and the numerical variance.

03

Use a simpler geometry.

Switch to the vertical band. Explain why the center-row profile is enough to show its horizontal spreading.

Read the sources behind the model.

  1. MIT 18.086, Finite Differences for the Heat Equation

    Gilbert Strang introduces finite-difference approximations for diffusion and the heat equation.

Watch one model run.

12 seconds · Original model visualization · Silent

Diffusion in a closed field

Redistribute a concentrated field while accounting for every cell.

Read the explanation and method

Two concentrated patches occupy a 48 by 30 grid. The color scale is fixed to the initial maximum, so fading represents a lower concentration.

A five-point diffusion update transfers material between adjacent cells. The coefficient is 0.2 and boundary cells reflect flux back into the domain.

After 240 steps the peaks are lower and the field is smoother. The total remains conserved to floating-point precision; no material crosses the boundary.

Method. An explicit finite-difference update adds the discrete Laplacian times a coefficient. At the outer edge, a missing neighbor takes the boundary cell’s own value, giving zero outward flux. Every internal exchange has an equal counterpart in its neighboring cell.

Apply the model to a research question.

These dossiers explain how this experiment relates to a larger question, including the observation or comparison that the model leaves unresolved.

Try another experiment.