mean velocitypath of the centre of massstartle pointwaypoint
Couldn't start the 3D scene.

Flocking System: Alignment, Separation and Cohesion in a 3D Bird Flock

A flock of up to 250 birds in three dimensions, each following three rules written as forces: Cucker-Smale alignment (a bird accelerates toward the velocities of birds within range), separation (repulsion closer than a preferred spacing) and cohesion (attraction up to a finite range). Because every interaction is equal and opposite, the total momentum is conserved exactly and the only energy sink is alignment, with dE/dt = -(lambda/N) sum psi |dv|^2. Scatter the headings and watch the polarization climb toward 1, shorten the alignment range and watch sub-flocks form, startle a bird and watch the disturbance travel, or steer everyone toward a moving waypoint. The birds, wings (they flap), trees and meadow are Blender models; the camera follows the centre of mass. Fourteen independent numerical checks cover the exp(-lambda t) relaxation, momentum and centre-of-mass motion, the energy balance with a Simpson integral of the alignment loss, energy conservation without alignment, force equals minus the gradient of the potential, and the random-heading polarization 0.886/sqrt(N). Educational model, not fitted to real birds.

Made with 🟠 Blender · Three.js