The science
What is simulated
Every bird flies at about constant speed v₀ and only steers. Each step it chooses a desired direction d from its neighbours (Couzin-style zones: repulsion, orientation, attraction), adds angular noise, and turns towards it with a limited, inertial turn rate. The only difference between the two modes is who counts as a neighbour.
d = wa·⟨ĥⱼ⟩ + wc·c(x) − wr·Σ_(rᵢⱼ<r_r) r̂ᵢⱼ + η·ξ̂ + (leash, falcon, level-flight terms)
ω̇ = (ω_target − ω)/τᴵ, ω_target = min(ω_max, α/τ)·(ĥ × d̂)/|ĥ × d̂|
ĥ(t+dt) = rotation of ĥ about ω by |ω|·dt (exact, Rodrigues)
x(t+dt) = x + v·dt·sinc(θ/2)·mid(ĥ, ĥ′), θ = |ω|dt (exact arc chord)
α is the angle between heading and desired direction, c is the offset of the neighbours' centroid in units of their range (with a dead band, so only birds at the flock edge feel cohesion), ξ̂ is a random unit vector.
Topological vs metric (Ballerini et al. 2008)
Field measurements of starling flocks reconstructed in 3D found that each bird interacts with a roughly fixed number of nearest neighbours, about 6–7 (as published), almost independent of how far away they are. A metric rule uses every bird within a radius R: the number of neighbours then rises when the flock is squeezed and collapses when it is stretched. Use Stretch and Squeeze and compare the readouts. In this simplified model the topological rule keeps the flock ordered (Φ stays high) after stretching, while the metric rule loses neighbours and order; cohesion in the strict "one connected cluster" sense is not better for either, which is why both numbers are reported honestly in Experiment 4.
Measured quantities
Φ = |(1/N) Σ v̂ᵢ| polarisation (1 = all parallel)
u_i = v̂ᵢ − ⟨v̂⟩ velocity fluctuation
C(r) = ⟨uᵢ·uⱼ⟩_(rᵢⱼ≈r) / ⟨u²⟩ correlation function
ξ = first r with C(r) = 0 correlation length
L = 5–95 % range of positions along the principal axis
thickness/length = σ₃/σ₁ (PCA of positions) flocks are flat
ρ = N / [(4π/3)(2σ₁)(2σ₂)(2σ₃)] ellipsoid estimate
Cavagna et al. 2010 reported that in real flocks ξ grows linearly with the flock size L, so no characteristic scale limits how far a change of heading is felt (scale-free correlations). Experiment 2 measures ξ(L) in the model for both rules and reports the fitted slope and R² as found; the metric rule typically gives a worse linear fit.
Turn waves and the falcon
A heading change spreads from bird to bird through the neighbour network, not by the birds flying faster. Attanasi et al. 2014 reported waves in starling flocks with speeds of order 20–40 m/s (approximate), clearly above the 10–15 m/s flight speed. Here the front is measured against a control flock with identical random numbers: the signed heading shift along the stimulus direction is averaged inside distance shells (this averages out chaotic divergence), and a shell is "reached" when the mean passes a threshold. The model's fronts are noisy and typically 5–15 m/s, i.e. comparable to the bird speed and slower than reported for real flocks, because its reaction time (≈0.07 s plus 0.25 s of turning inertia) is longer than that of real birds. Experiment 3 shows how the measured speed depends on bird speed.
The falcon is an abstract moving point: birds within about 38 m steer away; nobody is ever touched (a 4 m exclusion bubble is enforced and the closest approach is shown). The agitation wave you see is the orange colouring of birds that have turned away from the flock's mean heading as the alarm spreads, with Φ dipping while it passes.
What is simplified
- Birds are points with a turn-rate limit; no aerodynamics, no roll or pitch physics, speed varies only a little (±30 %).
- Cohesion needs a weak leash to the roost to keep the flock in view for minutes; Experiments switch it off.
- Neighbour search is exact (grid with ring expansion) but limited to 30 m vision.
- Birds are drawn up to 10× larger than life; wing flapping is a shader animation of the Blender model, not simulated.
- The flock is not a thermodynamic system: stationary-state measures such as ξ(L) come from flocks relaxed for ~15 s, then averaged over 8 snapshots.
Starling facts (approximate)
Common starling Sturnus vulgaris: body length about 20–22 cm, wingspan about 31–44 cm, mass about 60–90 g, cruising speed roughly 10–20 m/s, wingbeat roughly 10 Hz. Winter roosts can hold tens of thousands to hundreds of thousands of birds and the dusk murmuration over a reed bed is a well-known sight. Plumage is dark with a purple-green iridescent sheen and pale speckles in winter.
Sources
Ballerini et al., PNAS 105 (2008) “Interaction ruling animal collective behavior depends on topological rather than metric distance”. Cavagna et al., PNAS 107 (2010) “Scale-free correlations in starling flocks”. Attanasi et al., Nature Physics 10 (2014) “Information transfer and behavioural inertia in starling flocks”. Couzin et al., J. Theor. Biol. 218 (2002). Vicsek et al., Phys. Rev. Lett. 75 (1995).
How this differs from other flocking pages
This lab is about the neighbour rule itself (k nearest vs fixed radius), measured quantities of real starling field studies (Φ, flock shape, C(r), ξ ∝ L, turn-wave front) and a Blender-modelled instanced flock of up to 24 000 birds, rather than a basic boids demo. Not affiliated with the cited authors.