Presets
Playback
Flock, wind and fuel
Behaviour
Camera
Layers
Quality
Model check
The science
The wind triangle. A butterfly flying at air speed Va in direction e over air that moves with velocity W travels over the ground with v = Va e + W. If it simply points at the goal (e = g) a crosswind pushes it off the line: its track angle is atan2(W⊥, Va + W∥) off the goal. A navigator that knows the wind (from visual flow over the ground) can instead choose e = (G g - W)/Va with G = W∥ + √(Va2 - W⊥2); the track then lies exactly on the goal line at ground speed G. When the crosswind exceeds the airspeed no heading can hold the line (the graphs show where fixed heading and compensation diverge). Monarchs navigate with a time-compensated sun compass; how well they correct for drift in the wild is still researched, so the switch lets you see both strategies.
Soaring and gliding. A thermal is modelled as a Gaussian updraft w(r) = w0 exp(-(r/R)2). Inside it the butterfly stops flapping and climbs at w - s (s = 0.5 m/s sink); outside it glides forward at 2.4 m/s sinking at 0.5 m/s (glide ratio about 4.8) until it reaches the cruising height, then flaps again. Gliding costs a small fraction of the flapping power.
Energy budget. Lipid holds about 39.5 J per milligram (37 to 39 kJ per gram). Flapping power is taken as Pf = 45 mW (9 Hz wingbeat), scaled with the square of the wingbeat frequency; gliding costs 6 mW. The reserve falls as dE/dt = -P; at the end of each flight day (17:00) the butterflies roost, nectar adds the refuelling amount (capped at the starting reserve), and the next morning they fly again. A butterfly with E = 0 lands (grounded).
Honest simplifications. The powers, glide speed, thermal sizes, compass noise (an Ornstein-Uhlenbeck error of about 0.1 rad) and the flocking rule are order-of-magnitude illustrative values, not measurements of a particular monarch population. Real monarchs roost in trees, feed on specific flowers, are influenced by temperature and cannot fly at night; here the day is 09:00 to 17:00 and the night is skipped. The scene is a local window around the flock: the ground scrolls under it while the flock stays at the centre, and the butterflies are drawn up to 30 times larger than their real 10 cm so they can be seen. Wind gusts are a smooth analytic field, not turbulence.