This simulation needs WebAssembly, and it could not start in this browser.
The image is a frame from a real run. Check that JavaScript is on, or try another browser.
Tamás Vicsek and colleagues introduced this model in 1995 as the simplest possible description of a flock. Every particle moves at the same speed and copies the average heading of its neighbors, but it makes a random error each time. Nothing else: no attraction, no repulsion, no leader. With little noise the particles end up moving together in one direction; with a lot of noise they move like a gas.
The ordered state was a surprise. In equilibrium, the Mermin-Wagner theorem rules out long-range order of a continuous direction in two dimensions with short-range interactions, yet large Vicsek flocks stay aligned over the whole system. John Toner and Yuhai Tu explained why in 1995: the particles move, so they carry their heading to new neighbors, a way of spreading order that systems in equilibrium do not have. The model became the reference point of active matter, the physics of systems whose parts propel themselves. Later large simulations (Guillaume Grégoire and Hugues Chaté, 2004) found that the transition is discontinuous and that near it the order travels in dense bands; those need far more particles than this simulation runs.
What you see
Up to 600 particles in an 800 by 800 pixel box whose edges wrap around. Each particle is an arrowhead colored by its heading, so an aligned flock has one color and a disordered gas all colors. The Polarization Φ readout and the line at the bottom of the canvas show the order parameter. Trails leaves fading tracks behind the particles.
Rule
All particles update at once. Particle takes the mean direction of all particles within the interaction radius , itself included, adds a random angle, and steps forward at speed :
where is uniform in , drawn anew for every particle and step, so the noise turns each particle by at most either way. Distances are measured across the wrapped edges.
The order parameter is the length of the mean heading vector,
1 when all particles move the same way. For random headings it is about , 0.05 for 300 particles. The behavior depends on the noise and on the density in units of the interaction radius, with box size ; the defaults give . At that density drops from about 0.9 at to about 0.67 at and 0.2 at .
Presets
All presets use pixels per step. Averages are over 9000 steps after the first 3000; one step is one frame, so 60 steps are a second.
Ordered (low noise): 300 particles, , . Starting from random headings, passes 0.5 after about 200 steps and 0.9 after about 850 (14 seconds), then averages 0.95.
Near the transition: , where the fluctuations are largest at this density. averages 0.5 but swings between 0.03 and 0.87: order builds up across the box and breaks down again.
Disordered (high noise): . averages 0.13, a little above the 0.05 of random headings.
Dense flock: 600 particles with , a density of , and . averages 0.66, while 300 particles with at the same noise reach only 0.27: the denser the particles, the more noise the flock can take.
Parameters
Particles: 20 to 600 (default 300), applies on Reset.
Speed v₀ (pixels per step): 0.5 to 5 (default 1.5).
Interaction radius r (pixels): 5 to 120 (default 30). A larger radius raises the density .
Noise η (radians): 0 to (default 1). At the new heading is completely random.
These three apply immediately.