...
running...
The science
The flow is built from potential-flow superposition. In 2D an incompressible, irrotational flow satisfies ∇·u = 0 and ∇×u = 0 away from singularities, so solutions can simply be added. Here we add a uniform stream and two point vortices of opposite sign (a vortex pair, the idealised wake of a lifting wing or the cross-section of a smoke ring).
u(x,y) = U + Σₖ Γₖ/(2π) · (−(y−yₖ), (x−xₖ)) / (rₖ² + a²)
The core radius a removes the 1/r singularity (a Rankine/Lamb-Oseen style regularisation, a = 0.12 here) so tracers never receive infinite speed. A vortex pair of circulation Γ and separation d translates itself at speed Γ/(2πd); with the free stream added, the pair drifts and the streamlines bend around two stagnation regions.
Honest simplifications: the vortices are fixed in space (they do not induce motion on each other here) and viscosity is ignored. A real vortex pair would self-propagate and diffuse. The numerical check below verifies the two defining properties: zero divergence (central differences) and that the line integral of velocity around a loop enclosing one vortex equals Γ (Kelvin circulation theorem).
What is checked and why you can trust it
Every time the page loads, and whenever you press Re-run check, the simulation evaluates its own mathematics against an independent reference, such as a closed-form formula, a finite-difference derivative or an exhaustive count. Each line above reports PASS or FAIL together with the measured numbers, so you can see by how much it agrees. Results are also published on window.__msChecks for automated testing. The check never uses the same code path as the animation it validates, otherwise it would only confirm itself.
How to read a failure: a FAIL line means the measured discrepancy exceeded the stated tolerance for the current slider values. Try Reset, then move the sliders back toward their defaults; if a check still fails at the defaults it is a bug worth reporting. Tolerances are chosen from the numerical method itself, never tuned to make a test pass: round-off level (1e-9) for exact algebra, about 1e-3 for finite differences and Monte Carlo estimates with a few hundred thousand samples, and a documented margin for stochastic learning runs.
Reproducibility: the particle and pen simulations use the browser random generator for initial positions, so exact pixels differ between visits, but the checks depend only on mathematics and not on those positions. Fixed wave tables (curl noise) and fixed grammars (L-system) are deterministic.
This is an educational model. It shows the mechanism clearly, but it is deliberately simplified; the science panel lists what was left out.