import Image from 'next/image';
import { References } from '@/components/articles/references';
import { BirdInspector } from '@/articles/bird-article/components/bird-inspector';
import { ModelExplanation } from './model-explanation';
import { references } from './references';
import { Cite } from './citation';
A few thousand birds can turn together, stretch into a ribbon, or divide around an obstacle without anyone appearing to direct traffic.
One way to animate a flock is to decide where every bird should go and draw the paths. Craig Reynolds took a different approach in his 1987 paper on *boids*. He gave simulated individuals local behaviors: avoid crowding, align with nearby individuals, and stay near the group. The flock’s motion followed from repeatedly applying those rules. As his abstract puts it, the birds (or equivalently *boids* for New Yorkers) “choose their own course” .
That is a useful start, but it leaves a lot unspecified. What counts as nearby? Do birds align their directions or their full velocities? How quickly can they turn? What happens when avoiding a collision conflicts with keeping up?
## Birds are not a gas at equilibrium (and flocks cannot be approximated as a sphere for that matter)
The connection to statistical physics is fairly direct. We have many interacting degrees of freedom, local fluctuations, and a collective state. But birds continually consume energy to move. Their speed does not simply decay by drag until everything comes to rest. They are examples of *active matter*: the constituents take in energy and convert it into motion or mechanical work .
These systems, as you can imagine, don't gradually settle to equilibrium. For birds, dissipation includes energy transferred to the air and heat. Flocks of birds form these familiar collective swarms. Walk under a flock and you may find out what else they dissipate on your freshly washed clothes.
In the model introduced by Vicsek and collaborators in 1995, particles move at a fixed speed and update their headings toward the local average, with added directional noise. There is no leader supplying the direction of travel. Nevertheless, coordinated motion can emerge . This simplified mechanic lets us ask about ordering without first determining the biomechanics of a wing, much as we can predict the orbit of a planet without worrying so much about how matter is distributed within it.
A convenient measure of directional order is the polarization,
$$
P=\left|\frac{1}{N}\sum_{i=1}^{N}\hat{\mathbf u}_i\right|,
$$
where $\hat{\mathbf u}_i$ is the unit vector along bird $i$’s velocity and $N$ is the number of birds. If all headings agree, $P=1$. If headings largely cancel, $P$ is small. However, this does not tell us everything. An organized flock moving around a circle can have a small total polarization.
Toner and Tu instead described slowly varying density and velocity fields. Their 1995 continuum equations are
$$
\begin{aligned}
\partial_t\mathbf v+(\mathbf v\cdot\nabla)\mathbf v
&=\alpha\mathbf v-\beta|\mathbf v|^2\mathbf v-\nabla p
+D_L\nabla(\nabla\cdot\mathbf v)\\
&\quad+D_1\nabla^2\mathbf v+D_2(\mathbf v\cdot\nabla)^2\mathbf v+\mathbf f,\\
\partial_t\rho+\nabla\cdot(\rho\mathbf v)&=0.
\end{aligned}
$$
Here $\rho$ is number density, $\mathbf v$ is the coarse-grained velocity, and $\mathbf f$ is random forcing. The density-dependent pressure is written $p$ here to distinguish it from polarization. The $\alpha,\beta$ terms select a nonzero speed when $\alpha>0$, the $D$ terms smooth spatial variations, and the second equation conserves bird number .
The convective term $(\mathbf v\cdot\nabla)\mathbf v$ carries orientation as the individuals move and exchange neighbors. Their analysis finds stable orientational order even in two dimensions. A moving state selects a direction although the equations select none: spontaneous symmetry breaking away from equilibrium. The equilibrium Mermin–Wagner restriction therefore does not decide this problem. The conclusion depends on the nonlinear dynamics, not just the uniform solution $|\mathbf v|=\sqrt{\alpha/\beta}$ .
## Seven neighbors $\neq$ seven meters
Suppose every bird responds to all other birds within a fixed radius. Compress the flock and the number of interaction partners increases. Let it spread out and that number decreases; eventually some birds lose contact altogether. This is a *metric* neighborhood,
$$
\mathcal N_i^{\rm metric}=\{j\ne i:|\mathbf x_j-\mathbf x_i|* neighbors rather than a constant distance .
* A notable pair of numbers in these modern times
Figure 1. “For both flocks, the structure becomes approximately isotropic between the sixth and the seventh nearest neighbor.” The labels 32-06 and 25-11 identify two reconstructed flock events, containing 781 and 1,168 birds, respectively. The horizontal line marks the isotropic value $\gamma=1/3$. Panel reproduced from Ballerini et al. (2008), supplied as a crop.
The inference of seven comes from spatial structure and is experimentally motivated as a starting point; it does not directly record which birds each individual was watching. Let's bring that into our working model.
There is also no reason to make every interaction topological. Two bodies can collide whether they are each other’s first or twentieth neighbor. The model for this article uses nearest-neighbor selection for social coordination and a separate distance-dependent rule for close encounters.
Try changing the neighbor count while leaving the other settings alone. Increasing it changes which information each bird averages. That doesn't guarantee a more responsive flock, as averaging over more individuals may also dilute a local changes.
## What starts a turnaround?
The original version of this animation had a straightforward problem: strong alignment, weak individual fluctuations, and no horizontal environmental preference. Adding a bird leading the pack on a prescribed route would create turns, but would also supply much of the answer in advance.
In a study of spontaneous turns, Attanasi and collaborators found initiators near the flock’s outer tips .
For the scene here, I have added a preference to remain near a roost. Hildenbrandt, Carere, and Hemelrijk’s *StarDisplay* combines local coordination with simplified flight mechanics and attraction toward a roosting region. Its horizontal return response depends on the bird’s heading: stronger when flying outward, weaker when already returning .
Our birds similarly turn back after leaving a region, then continue inward before releasing that preference. They respond individually and influence their neighbors through the social terms discussed in [What the simulation does](#simulation-model).
## How far does a turn travel?
A flock can have high polarization and still respond badly when something happens. Everyone might be traveling in the same direction, yet a turn by a few individuals could be lost before it reaches the rest. Photos of starling flocks alone don't settle this question.
In 2010, Cavagna and collaborators measured correlations between velocity fluctuations in starling flocks. The range of those correlations grew with the flock’s linear size. This is the sense in which the correlations were called *scale free*, meaning they did not reveal a fixed correlation length independent of the size of the group .
Figure 2. The speed fluctuations correlation length $\xi_{\rm sp}$ grows approximately as $\xi_{\rm sp}=aL$, where $L$ is the flock’s linear size and $a$ is the fitted slope. Reproduced from Cavagna et al. (2010), speed-correlation panel; supplied crop.
A bird can interact directly with a few neighbors while sharing correlated fluctuations with birds much farther away. You might interact regularly with a small group of friends and share tastes with a much wider circle. But by the time you get to Kevin Bacon (see [Six Degrees of Kevin Bacon](https://en.wikipedia.org/wiki/Six_Degrees_of_Kevin_Bacon)), there likely isn't much in common. Interaction range $\neq$ correlation length.
The distinction is made clear during a turn. Attanasi and collaborators reconstructed turning starling flocks and found directional information propagating with a “linear dispersion law and negligible attenuation.” Their theory introduced behavioral inertia: resistance to changing the curvature of a flight path. In the nearly planar, ordered limit, their equations (6) and (8) read
$$
\partial_t\varphi=\frac{s_z}{\chi},\qquad
\partial_t s_z=a^2J\nabla^2\varphi
\quad\Longrightarrow\quad
\partial_t^2\varphi=c_s^2\nabla^2\varphi,\qquad c_s^2=\frac{a^2J}{\chi}.
$$
Here $\varphi$ is the heading angle, $s_z$ is its conjugate spin variable, $\chi$ is behavioral inertia, $a$ is the average nearest-neighbor spacing, and $J$ is the theory’s alignment stiffness. These are the paper’s variables, not numerical values taken from our sliders. The resulting wave equation carries a turn with speed $c_s$.
The same paper explains why paths can cross during an *equal-radius turn*. Birds on opposite sides follow similar curved paths at similar speeds, changing their positions relative to the travel direction. Crossing trajectories do not imply a collision since their crossing points can be reached at different times, and projected paths can overlap at different heights.
## Why a flock darkens and divides
A bird presents a different silhouette when it banks. If nearby birds copy that maneuver, a dark band can travel through the flock without an equally large change in density. Hemelrijk and collaborators reproduced this effect with rolling maneuvers in a model of agitation waves . A two-dimensional view can also make birds at different heights appear to pass through one another.
Banking changes more than the view. Tilting the lift force makes some of it available for turning and leaves less to oppose gravity. Unless the bird increases lift, it loses height. In *StarDisplay*, coupling turns to flight mechanics helped produce changing flock shapes . Our birds now have a bank angle and a lift response that affect their trajectories, rather than only tilting a mesh after the turn has happened.
A split doesn't have to divide the flock in half. Papadopoulou and collaborators studied flocks pursued by a robotic falcon: different birds turned or dived at different times, and some groups separated while others remained connected . Those observations concern escape behavior. They do not establish that every changing flock shape requires a predator.
Occasional disturbances arise near the flock’s edge. Affected birds briefly prioritize a turn or dive, and neighbors can copy it after a delay. The response weakens as it spreads. Neither the number of resulting groups nor their sizes is specified. Once the maneuver ends, normal coordination returns; groups can join again when their paths bring them close. The disturbance’s cause is not simulated, and its timing and strength are chosen for this demonstration.
What the simulation does
The equations below specify an effective steering model. Their parameters have not been fitted to bird trajectories. In particular, the steering response time is not a measurement of behavioral inertia.
## Making motion look like a flock
The displayed orientation uses the bank angle from the flight controller above. The changing wing silhouette can therefore change the flock’s apparent darkness. The 50,000- and 100,000-point modes retain the movement rules but cannot display that wing-area effect. Wingbeats are just an animation and do not contribute in any aerodynamic way.
The camera follows the flock and adjusts its distance gently. Ground and horizon are optional scenery. Both the drawing and physics pause while the simulation is offscreen, so reading about birds gives the computer a rest.
And, because there are technically no feathers on our bird…
Behold! Plato’s Man!
This here sparrow has a 24-centimeter wingspan is made of 882 triangles. It was made with OpenAI’s GPT-6 Astra using the *Computer Use* tool in Blender, before I learned of the obsession the bird-watching physicists have with the starling.
As you can see by starting its wingbeat, this poor featherless bird's skull deforms with every never-ending flap of its wings. And with a few thousand more, we have our flock.