The model (Vicsek, 1995)
Every step, each bird turns to the average heading of the birds it follows, then wobbles by a random angle, then flies on at the same speed.
The order φ is the length of the average heading: 1 when every bird flies the same way, close to 0 when they point everywhere.
| θᵢ, θ̄ᵢ | the heading of bird i, and the average heading of the birds it follows |
| xᵢ | the position of bird i, written as a complex number, so eiθ is a step of length 1 in direction θ |
| Nᵢ | the birds bird i follows: itself and either its 7 nearest birds, however far away (what starlings do: Ballerini et al., 2008), or every bird within a fixed reach r, set so that at spread ×1 the average bird has 7 |
| η | noise: each turn is off by a random angle of up to ±η·180°, so at most ±36° here |
| s | spread: the distance between birds multiplied by s. A bird that follows everyone within reach then has 7/s² neighbours on average; a bird that follows its 7 nearest still has 7 |
| v₀ | the speed, the same for every bird |
| hawk | a bird inside the hawk's circle stops following anyone and flies straight away from it, give or take 17°. The slider sets the circle's diameter as a share of the sky's width |
The two curves on the right were computed once, 400 birds, six runs a point, each averaged over its last 2000 steps; the yellow dot is the flock on the left, measured as it flies.