Ballistics. Between flaps the bird is a projectile: y(t) = y0 + vft - ½ g t². It peaks after t = vf/g at h = vf²/2g above the flap point and is back at the flap height after twice that. A harder flap or weaker gravity makes a taller arc: on the Moon the same flap goes 6 times higher.
Flap rate. If the bird flaps every 1/f seconds its vertical speed falls from vf to vf - g/f and jumps back, so the mean is vf - g/2f. The slowest flapping that can keep altitude is f = g/2vf (about 1.1 flaps/s here); the fastest climb is capped by how often you can tap.
Hover envelope. An autopilot that flaps whenever the bird falls to a trigger line moves between the line and h above it. To pass an endless corridor the gap must hold that envelope plus the body: G ≥ h + 2r. Real pipes are short, so slightly narrower gaps can be passed by good timing.
Lag. If a flap takes effect τ after the decision, the bird keeps falling: it goes below the trigger line by d = τ vc + gτ²/2, where vc = √(2g(h - d)) is its speed at the line. The fixed point of that map exists up to τ = √(2h/g), but is only stable while τg < vc; beyond that the hover wobbles and diverges. A fixed safety margin works only while d < margin.
Prediction. A controller that knows τ replaces the observed state with the ballistic state τ later and triggers on that, so the lowest point is the floor itself for any lag and the corridor limit is unchanged. It needs a model of its own physics; a human relies on practice instead.
Integration. RK4 with 1 ms steps matches the exact solution to rounding. Explicit Euler at the frame rate Δt evaluates the speed at the start of each step, so heights are off by ∼ vfΔt/2: 3.7 % at 60 Hz, 7.4 % at 30 Hz. With drag (terminal speed slider) the formulas above are only approximate.
Simplifications. Point bird with circular hit box, constant forward speed, ground kills, ceiling clamps, flaps are instantaneous. The bird is an abstract character; wing animation is cosmetic.