Optimisation of unsteady flight in learned avian perching manoeuvres

Flight is the most energetically costly activity that animals perform, making its optimisation crucial to evolutionary fitness. Steady flight behaviours like migration and commuting are adapted to minimise cost-of-transport or time-of-flight1, but the optimisation of unsteady flight behaviours is largely unexplored2,3. Unsteady manoeuvres are important in attack, evasion, and display, and ubiquitous during take-off and landing. Whereas smaller birds may touchdown slowly by flapping2,4–8, larger birds swoop upward to perch9,10 – presumably because adverse scaling of their power margin prohibits slow flapping flight11, and because swooping transfers excess kinetic to potential energy9,10,12. Landing is especially risky in larger birds7,13 and entails reaching the perch with appropriate velocity and pose14–17, but it is unknown how this challenging behaviour is optimised. Here we show that Harris’ hawks Parabuteo unicinctus minimise neither time nor energy when swooping between perches for food, but instead minimise the gap they must close under hazardous post-stall conditions. By combining high-speed motion capture of 1,592 flights with dynamical modelling and numerical optimization, we found that the birds’ choice of where to transition from powered dive to unpowered climb minimised the distance from the perch at which they stalled. Time and energy are therefore invested to maintain the control authority necessary to execute a safe landing, rather than being minimized continuously as they have been in applications of autonomous perching under nonlinear feedback control15 and deep reinforcement learning18,19. Naïve birds acquire this behaviour through end-to-end learning, so penalizing stall distance using machine learning may provide robustness in autonomous systems.

retroreflective markers enabling us to reconstruct their flight trajectories at 120 or 200 Hz (Fig.   1). Three of the = 4 birds were juveniles that had only flown short hops previously; the other was an experienced adult. We collected trajectory data from 1,592 flights during 11 weeks of trials, following an initial fitness-training period at 12 m perch spacing (see Methods). The juvenile birds flew directly between the perches on their first few training flights ( Fig. 2A), but soon adopted the swooping behaviour characteristic of experienced birds (Fig. 2B-E).
Swooping was initiated by jumping forwards into a dive involving several powerful wingbeats, which transitioned into a climb involving a rapid pitch-up manoeuvre that ended with the body almost vertical and the wings outstretched as the feet contacted the perch (Fig. 1). Climbing comprised mainly gliding flight, with occasional half-flaps that we interpret as corrective control inputs, rather than as wingbeats supplying forward thrust. Trajectory geometry was well summarised by the location of its point of minimum height, where the transition from powered to unpowered flight occurred. The birds dived deeper at wider perch spacing, but the longitudinal position of the transition point was always similar relative to the perches, at 61.2 ± 2.84 % of the spacing distance (mean ± s.d.). The birds only dived to within one semispan (≤ 0.5 m) of the ground at 12 m perch spacing (Fig. 2E), so although ground effect may have briefly assisted flight in this case 30 , its exploitation is unlikely to have motivated swooping in general.
The consistency with which different birds independently acquired the same characteristic swooping behaviour (Fig. 2) suggests that this is the result of individual reinforcement learning against some common optimisation criterion. Take-off and landing are energetically demanding flight behaviours because of the high aerodynamic power requirements of slow flight. Guided by previous work on perching parrotlets 2 , we therefore hypothesised that our hawks learned trajectories minimising the energetic cost of flight between perches. An alternative hypothesis is that the hawks learned trajectories minimising time of flight 1 , which could make sense for a predator adapted to exploit fleeting feeding opportunities 3 . This would also have maximised the net rate of energy gain 1 , because the energy gained through feeding greatly exceeded the energy expended to obtain it. Can either hypothesis explain the swooping that we observed? Diving uses gravitational acceleration to reach faster speeds quicker 31 , which could reduce flight duration if the increased path length were outweighed by the gain in speed. This is analogous to the classical brachistochrone problem, in which a curved path minimises the travel time of a particle falling between two points under the influence gravity 32 . Flying faster also reduces the mechanical work required at speeds below the minimum power speed 31 , so it seems intuitive that swooping could reduce both the time and energetic cost of flight.
We used a simulation model to assess how these two performance objectives were influenced by the choice of flight trajectory, comparing the optimal solutions to the trajectories observed at different perch spacings. We used a two-phase model comprising a powered dive switching to an unpowered climb at the point flight became level (see Methods). This captures the characteristic swooping behaviour of experienced birds and includes the direct flight behaviour of inexperienced birds as a limiting case. Our simulations incorporated individual variation in flight morphology and take-off speed (Table 1), and we assumed for simplicity that the aerodynamic lift and power were held constant on each flight phase. We calculated aerodynamic thrust as the ratio of power to speed, and modelled aerodynamic drag by parameterising a theoretical drag polar using published measurements from Harris' hawks 33 .
With these assumptions, and for a given power setting, every modelled flight trajectory is parameterised by its initial flight path angle ( ! ) and lift setting ( "#$% ) on the dive phase. These two parameters jointly determine the entry conditions for the unpowered climb phase, defined by the position ( & , & ) and velocity ( & , 0) of the bird at the transition point. The lift setting for the unpowered climb phase ( '(#)* ) is then uniquely determined by the constraint that the trajectory must intercept the landing perch at a reasonable landing speed. By setting the terminal speed of the simulations to the mean contact speed for each bird (Table 1), we identified a line of feasible parameter settings that would bring the bird safely to the perch (Fig.   3). A maximum specific anaerobic power output of 50 W kg -1 was estimated previously 34 from Harris' hawks climbing with loads. However, it is unlikely our birds would have flown at full power when diving, so we estimated a specific power setting for each bird to best match the observed data across all distances (Fig. 3). Minimising the sum of the squared distance of the observed transition points to the line of feasible transition points predicted by the model yielded specific power estimates ranging from 18.7 to 22.9 W kg -1 (Table 1). This is less than the additional power that Harris' hawks use for climbing 34,35 , suggesting that our birds used less than half their available power when diving.
The simulations reveal some unexpected results. First, although diving allows faster speeds to be reached quicker, it also reduces the powered fraction of the flight. Shortening the unpowered climb phase proves more effective in decreasing flight duration, and the timeoptimal solution is therefore a shallow powered dive followed by a short unpowered climb ( Fig. 3C). Second, although the lift-to-drag ratio is reduced at the higher speeds reached in a dive, this increased efficiency of lift production is outweighed by the increased lift required to turn into the climb. The energy-optimal solution is therefore an almost straight flight trajectory with a long, flat unpowered phase in which airspeed is lost to maintain altitude (Fig. 3A).
Hence, neither time nor energy minimization can straightforwardly explain the deep swooping behaviour of experienced birds, which contrasts with most steady, and some unsteady, flight behaviours 1,2 . It is possible in principle that the hawks made a particular trade-off between time and energy leading to the selection of an intermediate transition point, but we think it more likely that they optimised a different performance objective entirely.
Minimizing either time or energy requires very high lift coefficients, where is lift, is air density, is airspeed, and is wing area. In the time-optimal case, this arises because of the need to provide high lift for braking on a short unpowered climb (Fig.   3C). In the energy-optimal case, it arises because of the need to sustain weight support at everdecreasing airspeed on a long unpowered phase (Fig. 3A). High lift coefficients can be achieved transiently during unsteady perching manoeuvres 36,37 , with peak values up to + ≤ 5 predicted in modelling of the rapid pitch-up manoeuvre 29 . Nevertheless, stall cannot be delayed indefinitely, and will compromise control authority on final approach 12,15,20,24 . This suggests a different performance objective relevant to unsteady flight behaviours: minimise the distance flown post-stall. We implemented this optimisation criterion by selecting the transition point that minimised the distance flown at + > 4, which accommodates the very high lift coefficients that can be achieved transiently during a rapid pitch-up manoeuvre, whilst nevertheless penalising deep stall. The predicted location of the optimal transition point was robust to this choice, moving ≤ 1.6% of perch spacing distance per unit decrement in the threshold value of + .
The stall-optimal solution is a swooping trajectory resembling those observed in experienced birds in both its overall shape (Fig. 3B) and the precise location of its transition point (Fig. 4). The model closely predicted the shape of the observed climb trajectories, but produced a more concave dive trajectory than those we observed (Fig. 3). This discrepancy reflects the model's simplifying assumption of constant lift, which means that turning occurs throughout each phase of the flight (see Methods). Nevertheless, at every combination of bird and perch spacing, over half the observed transition points lay within 6% of the optimum predicted to minimise stall distance, where the total deviation is normalised by perch spacing.
In fact, the longitudinal position of the observed transition points did not differ significantly from the predicted optima in a generalized linear mixed effects model fitting the combination of bird and perch spacing as a random effect (mean longitudinal deviation: -0.9%; 95% CI: -2.6%, 0.8%). The vertical position of the observed transition points was biased upwards slightly (mean vertical deviation: 0.5%; 95% CI: 0.0%, 1.0%) but the variation in both axes was comparable between (longitudinal SD: 3.5%; vertical SD: 1.0%) and within (longitudinal SD: 3.3%; vertical SD: 1.0%) groups. Given the simplicity of the model and the variety of the dynamics it produces (Fig. 3), its close quantitative fit to the data over a range of different perch spacings ( Fig. 4)  is the approach taken in one recent implementation of autonomous perching 18 . In practice, we think it more likely that the birds learned to command and regulate their parameter settings directly to produce the nominal swooping trajectory. Having jumped at an initial dive angle ! , the lift settings "#$% and '(#)* could be regulated using force feedback from the muscle Golgi tendon organs 38 to command wing or tail pitch. The power setting "#$% might also be regulated using strain rate feedback from the muscle spindle cells 38 to command motor unit recruitment.
Proprioceptive feedback could further be used to detect incipient stall, perhaps supplemented by sensing of feather deflection under flow reversal 9,10 . This mechanosensory information would have to be combined with optic flow expansion 2,14,39 or static visual cues 6 to enable estimation and minimisation of the gap remaining to be closed under hazardous post-stall conditions. Visual cues will also be important in modifying the nominal trajectory to account for the effects of wind 8 . Vision combined with proprioceptive feedback may therefore be key to the learning and control of the entire perching manoeuvre.
Because the aerodynamic forces that perturb flight can be sensed before any measurable disturbance to the kinematic state of the system has had time to evolve, force feedback has a lower latency than state feedback 40,41 . This is a key attraction of fly-by-feel

Experimental setup. We flew = 4 captive-bred Harris' Hawks (Parabuteo unicinctus)
between two 1.25 m high A-frame perches positioned 5, 7, 9, or 12 m apart in a purpose-built motion capture studio ( Fig. 1; Supplementary Movie 1). The sample comprised 3 inexperienced juvenile males (approximately 4-6 months old), and an experienced adult female (7 years old); see Table 1 Consequently, although the Nexus software reconstructed the positions of all visible markers to a high degree of accuracy, it was not always able to label each marker reliably, or to identify every marker on every frame. We therefore wrote a custom script in MATLAB v2018a (Mathworks, MA, USA) which analysed the pattern of pairwise distances between markers in the rigid templates to label the anonymous markers (see Supporting Code).
Marker labelling. The anonymous markers were labelled separately for each frame by using Procrustes analysis to match any visible markers to the known backpack template. We used the centroid of the resulting set of candidate backpack markers as an initial estimate of backpack position and fitted a quintic spline to interpolate its position on frames with missing data. We (1) where = 1.23 kg m -3 is air density, is wingspan, and where is wing area which we assumed to be maximal throughout the manoeuvre ( Table 1) where is gravitational acceleration and is the bird's mass.
We modelled the resulting flight trajectories in lab-fixed Cartesian coordinates ( , ) by coupling Eqs. 1-2 for ̇ and ̇ with the component kinematics equations: with = [ / , + 0 , . We integrated these ordinary differential equations numerically using the ode45 solver in MATLAB, which is based on an explicit Runge-Kutta (4,5) formula, the Dormand-Price pair.
Trajectory simulations. We simulated each bird individually to account for variation in flight morphology. We matched the initial speed (0) of the simulations to the mean take-off speed \ ! observed for each bird at the threshold horizontal distance of 0.65 m from the take-off perch (Table 1). We treated the initial dive angle (0) as a free parameter ! , so the initial conditions