Some Causes of the Variable Shape of Flocks of Birds

Flocks of birds are highly variable in shape in all contexts (while travelling, avoiding predation, wheeling above the roost). Particularly amazing in this respect are the aerial displays of huge flocks of starlings (Sturnus vulgaris) above the sleeping site at dawn. The causes of this variability are hardly known, however. Here we hypothesise that variability of shape increases when there are larger local differences in movement behaviour in the flock. We investigate this hypothesis with the help of a model of the self-organisation of travelling groups, called StarDisplay, since such a model has also increased our understanding of what causes the oblong shape of schools of fish. The flocking patterns in the model prove to resemble those of real birds, in particular of starlings and rock doves. As to shape, we measure the relative proportions of the flock in several ways, which either depend on the direction of movement or do not. We confirm that flock shape is usually more variable when local differences in movement in the flock are larger. This happens when a) flock size is larger, b) interacting partners are fewer, c) the flock turnings are stronger, and d) individuals roll into the turn. In contrast to our expectations, when variability of speed in the flock is higher, flock shape and the positions of members in the flock are more static. We explain this and indicate the adaptive value of low variability of speed and spatial restriction of interaction and develop testable hypotheses.


Introduction
The beautiful coordination in flocks of birds has raised scientific interest since ages in both laymen and scientists [1,2,3,4,5]. Flocks of birds have great variation in shape: often different flocks have different shapes and a single flock changes its shape over time [1,5,6]. Extreme changes in shape and density of flocks occur during the aerial displays of thousands of starlings at dusk. For instance, sometimes during turning the flock may change in relative proportions, density and volume [7,8], whereas at other times the shape of a flock may remain intact while only changing its orientation relative to the movement direction [4]. Further, during turning individuals may reposition their location within a flock in an amazing way [1,4,5,8]. This variability of shape differs markedly from what is described for schools of fish. Schools of fish are usually oblong in the movement direction [9,10,11]. However, under specific conditions, shapes of schools of fish are variable too, for instance, when a school is very large, and also when it is attacked by a predator. Very large schools have been described to be amorphous and to comprise extensions at the border, so-called pseudopodia, and sparse areas in the interior, called vacuoles, as if they consist of subgroups that move in somewhat different directions [12]. Similarly, in our model of very large schools (comprising up till 10.000 individuals) in which individuals have a limited view because it is blocked by those that are closest around them, shape appears more variable than in other models. This is due to the occurrence of subgroups with different movement directions in the school (Kunz and Hemelrijk, under review). Further, when being under attack of a predator, the shape of schools may become highly diverse. The shapes that emerge are for instance coined as 'bend', 'flash expansion', 'herd', 'split', and 'hour glass' [13]. Computer models of such attacks show that this diversity arises from the local differences of prey behaviour in the flock [14,15]. These depend on the prey's distance to the predator: Individuals close to the predator are avoiding it, while those further away from the predator are coordinating with the other school members. In conclusion it seems that the variability of school shape may arise from local differences in movement behaviour, thus, from reduced synchronisation of the school of fish.
Since it is very difficult to study empirically [16] whether local differences in behaviour lead to a greater variation of shapes of flocks of birds, we will study it in a model of self-organised travelling groups, because such models have helped to create a better understanding of travelling groups in many aspects, such as their alignment [17,18,19] and direction choice [20,21] and, most importantly, also their shape. They show, for instance, that shape of a group of fish and birds changes when it is under attack of a predator [14,15,22], that shape of fish schools depends on the synchronisation of spawning tendency [23], and on density and school size [24,25,26].
Our models of fish schools have shown that the commonly observed oblong shape in the movement direction emerges as a side-effect of coordination and slowing down to avoid collisions [24,27,28]. The elongated shape emerges, for all school sizes, in models in two dimensions or three, when individuals move at slow speed or fast and when a single school comprises individuals of a single body size or of two sizes. Furthermore, in our models of fish schools, schools appear to be more oblong the greater the number of individuals they include. We have confirmed these patterns in our empirical studies of three-dimensional positions of individuals in schools of 10 to 60 mullets: larger schools are both, denser and more oblong [25]. We attribute the fact that larger schools are more oblong to the higher number of adjustments necessary to avoid collisions in larger schools, because in larger schools individuals are closer to their nearest neighbours up till a certain saturation point [24]. Individual fish in larger schools are closer to their nearest neighbours. This emerges, because the attraction to other school members in larger schools is stronger because of the higher number of interaction partners.
In our model of bird flocks [26], however, like in flocks of real birds [4], the relationship between density and group size is known to be absent. This may be due to the usually much larger group sizes that are investigated in studies of flocks of birds than of schools of fish: The flock sizes studied are already in the range in which density is saturated.
In our present study of bird flocks we will use a model, called StarDisplay [26]. StarDisplay combines an adapted version of our former model of travelling schools of fish with characteristics of birds [24,26]. Modelled individuals fly following simplified aerodynamics, i.e. they experience lift, drag and the force of gravity [29] and in order to fly along a curve, like real birds, individuals roll into the direction of the turn until they are at a certain angle to the horizontal plane, the so-called banking angle [30]. The model is parameterised so that individuals resemble starlings, as regards body weight, speed, lift-drag coefficient [31], roll rate [26], number of interaction partners [4] and the way in which the flocks remain above a sleeping site of size similar to that of Termini in Rome [7,32].
Its patterns of flocking have been shown to resemble remarkably those of huge flocks of real starlings when flying above the roost recently studied with the help of stereo-photography above Rome [4]. The resemblance concerns the flat shape of flocks, the relative proportions (aspect ratios) of the flock shapes, their distribution of distances and angles to the nearest neighbours, their orientation, their balanced density between front and back and the way flocks turn [26].
Here, we investigate to what degree flock shape and its variability depends on local differences in behaviour. We assume that greater local differences in behaviour arise from larger flock size, lower number of interaction partners, sharp turning, rolling during turning and greater adjustment (and thus variability) of speed. We confirm that these traits cause larger differences in behaviour among individuals that indeed result in a greater variability of shape, except for one trait, namely variability of speed. We explain how high variability of speed results in low variability of shape of the flock. We derive testable hypotheses for real animals and speculate about the adaptive value of locality of interaction and adjustment of speed.

The Model
The behaviour of each individual in StarDisplay is based on its cruise speed, its social environment (i.e. the position and heading of its nearby neighbours), its attraction to the roost and the simplified aerodynamics of flight which includes banking while turning [26]. Following other studies [2,24,33], we model social coordination in terms of (social) forces. Because flying implies movement in all directions, our model is three dimensional. We built the model in SI units and choose real parameter values where available (Tab. 1).

Details of behavioural rules
Each individual is characterised by its mass, m, its speed, v, and its location, p. Its orientation in space is given by its local coordinate system (e x ,e y ,e z ). Following the model by Reynolds [2], its orientation is indicated by its forward direction, e x , its sideward direction, e y , and its upward direction, e z , which it changes by rotating around these three principal axes (roll, pitch and yaw) (Fig. 1).
As to its speed, a force, f ti (Equ. 1) brings an individual back to its cruise speed v 0 after it has deviated from it [24].?up?> where t represents the relaxation time, m is the mass of the individual i and v 0 its cruise speed, v i is its speed, and e x i its forward direction.
To make each individual interact with a specific constant number of its closest neighbours (i.e. topological range), each individual i in the model adjusts its metric interaction range, R i (t) [24] following Equ. 2,3.
where Du is the reaction time, s is an interpolation factor, R max is the maximal metric interaction range, N i (t) is the neighbourhood of individual i at time t, i.e. the set of neighbours of an individual i which is composed of N i (t) j jneighbours from the total flock, n c is the fixed number of topological interaction partners it strives to have and d ij is the distance between individual i and j given by p j {p i where p i gives the position of an individual i. Thus, the radius of interaction at the next step in reaction-time, R i (tzDu), increases whenever the number of interaction partners N i (t) j j is smaller than the targeted number n c , and it is decreased if it is larger than that; it remains as before if N i (t) j jequals n c . Here R i can neither decrease below the hard sphere in which individuals are maximally avoiding each other r h (Equ. 4, Fig. 2) nor increase beyond R max . s, the interpolation factor, determines the step-size of the changes and thus, the variance of the number of actual influential neighbours.
As to separation, individual i is led by a force f si to move in the opposite direction of the average direction of the locations of the N i (t) j j others in its neighbourhood (Fig. 2). Following others [14,33], we have omitted the blind angle at the back (Equ. 4 and see Parameterization & Experiments). We gave individuals a hard sphere with radius r h as mentioned above, in which they avoid each other maximally (Equ. 4). Outside the hard sphere, but inside the radius of separation r sep , the degree of avoidance of others decreases with the distance to the neighbour following a halved Gaussian, g(x), with s the standard deviation of the Gaussian set so that at the border of the separation zone the force is almost zero, g(r sep )~0:01 (Equ. 4).
Here, N i (t) j jis the number of individuals in the neighbourhood of interaction (Equ. 3) and d ij is the distance from individual i to individual j. The direction from individual i to individual j is specified by the unit vector d ij~( p j {p i )= p j {p i and w s is the weighting factor for separation (Tab. 1). As to cohesion, individual i is attracted by a force f ci to the direction of the centre of mass (i.e. the average x, y, z position) of the group of N Ã i (t) individuals located in its topological neighbourhood, but not in its blind angle, in a way similar to models of others [27,28,33,34,35]. Here, w c is the weighing factor for cohesion (Equ. 5, Tab. 1). Within the radius of the hard sphere r h , we ignore cohesion with others (Equ. 5). To represent fear of predators [36] and build a sharp boundary of the flock [4], we make individuals cohere more strongly when they are at the border of the flock than in its interior by multiplying the force of cohesion by a factor indicating the degree to which an individual is peripheral (Equ. 5, 7). This factor, called 'centrality' in the group, C i (t), we calculate as the length of the average vector of the direction of all its neighbours N G (t) relative to the individual i, [37]. A high value indicates that the individual is peripheral; a lower value indicates that it is located more in the centre of the group. The 'neighbouring' individuals are all N G (t) j jindividuals in a radius of twice the actual perceptual distance of the individual i (Equ. 7).  Figure 1. Local co-ordinate system. The local co-ordinate systems of 2 birds with different orientations in space and at different distances to the viewer. e x is the bird's forward direction; e y , its sideways direction; and e z , its upward direction. It can change these by rotating around these 3 principal axes (roll, pitch and yaw).
As regards its alignment behaviour (Equ. 8), individual i feels a force, f ai , to align with the average forward direction of its N Ã i (t) interaction neighbours (the same neighbours as to whom it is attracted, Fig. 2BC).
Here, e x i and e x j are the vectors indicating the forward direction of individuals direction of individuals i and j and w a is the fixed weighting factor for alignment (Tab. 1). The 'social force' is the sum of these three forces (Equ. 9).
Individuals fly at a similar height above the sleeping site like real starlings [7], because we made them experience both in a horizontal and vertical direction a force of attraction f Roost to the 'roosting area' (Equ. 10, 11, 12, Fig. 3). The strength of the horizontal attraction, f RoostH , is greater, the more radially it moves away from the roost; it is weaker if it is already returning (Fig. 3A).
The strength is calculated using the dot product, i.e. the angle between the forward direction of individual i, e x i , and the horizontal outward-pointing normal n of the boundary. The range of the result [21.
.1] is transformed to [0..1] by halving the dot product and summing it with a 1/2. The actual direction of the horizontal attraction force to the roost is given by e y i which is the individual's lateral direction. The sign in Equ. 11 is chosen to reduce the outward heading. The actual direction of the horizontal attraction force is given by e y i which is the individual's lateral direction. Vertical attraction, f RoostV , is proportional to the vertical distance from the preferred height z 0 above the roost (arbitrarily called the zero level, Fig. 3B). Here z is the vertical unit vector. w RoostH and w RoostV are fixed weighting factors.
f Roost i~f RoostH i zf RoostV i Roost attraction ð10Þ f RoostV i~{ w RoostV p x i -z 0 À Á : z; z~(0,0,1) T Vertical ð12Þ The random force indicates unspecified stochastic influences (Equ. 13) with f being a random unit vector from a uniform distribution and w f being a fixed scaling factor. The sum of the social force, the forces that control speed and ranging and the random force is labeled as 'steering force' (Equ. 14).
Physics of flight in the model follows the standard equations of fixed wing aerodynamics which link the lift L, the drag D and the thrust T produced by a bird to attain its current speed v (Equ. 15a, Fig. 4):  where r is the density of the air and S represents the wing area of the bird (of identical size for all birds). The quotient of C L and C D of the dimensionless lift and drag coefficients in the model is fixed, resembling the almost fixed ratio in reality [29]. When a bird is flying horizontally while maintaining a constant cruise speed v 0 its lift balances its weight mg (mass times gravity) and its thrust balances its drag (Equ. 15b, Fig. 4A). Division of L by L 0 and of D by L in Equ. 15ab yields Equ. 15c in which the lift and the drag only depend on the actual speed. Gravity is directed towards the global 'down' direction, g~(0,0,{g), the lift upwards operates towards the local 'up' direction e z of the bird and the drag is pointing in the direction opposite to its actual 'forward' direction e x (Fig. 4). Thus, the flight forces are: Real birds roll into the turn in order to make turns [30]. Because in the absence of external influence we assume that birds 'intend' to fly with their wings at a horizontal level in order to move straightforward, we give the model-birds a tendency to roll back. To represent banked turns (Fig. 4B), we first calculate the degree to which individuals want to turn, i.e. their lateral acceleration, a l , which is exerted by the steering force. Banking implies that the individual rolls around its forward axis in the direction of its lateral acceleration, a l . The lateral acceleration follows the first law of Newton (F~m : a), where b i is the actual banking angle, w b in and w b out , respectively are the weights for rolling in and out the curve of turning, Dt is the update time and b in and b out are the angles over which an individual intends to move inwards and outwards. The tendency to roll into the turn increases with the strength of the tendency to turn sideways, which is due to the urge to coordinate with its  topological neighbours and to stay above the roost (Equ. 18, Fig. 4B). Once an individual has banked in the model, its tendency to roll back to the horizontal is proportional to its actual banking angle (Equ. 19). The actual banking angle (Equ. 20) is the sum of the current angle and the tendencies to roll-in and to roll-out. The ratio of w b in and w b out determines the roll rate. Note that by banking the individual creates a centripetal force at the cost of lift (Fig. 4B). Consequently it temporarily tends to move downwards. After summing the forces of steering and flying, we use Euler integration to calculate the position and velocity at the end of each time-step Dt: where v i is the velocity of individual i, m its mass, p i its location, and Dt is the update time. For the default values, see table 1.

Parameterization and Experiments
We have used the parameterization to realistic data of birds, especially of starlings, from our earlier version of StarDisplay (Tab. 1) [26]. To study the effects of locality of interaction we performed several experiments in the model [38], that concern 1) the group size, 2) the number of influential neighbours (i.e. topological range), 3) the attraction to the roost, 4) the banking during turning, and 5) the variability of speed.

Measurements
We measured the following properties of a flock: its shape (relative proportions and orientation), its volume, the correlation length of the deviations from the average velocity among its group members, its polarization (global and local), and its average degree of banking.
In our timeseries, we represent each property averaged over all individuals of a flock, if appropriate. When characterising a flock of a certain size, we averaged values also over time (i.e. 30 minutes while measuring it once per second).
The flock shape we measure in several ways, namely by its relative dimensions in three aspect ratios, by the degree to which it is oblong as measured by the longest dimension over the medium one I 3 =I 2 and by the degree to which it is elongated in the direction of movement, L/W (Fig. 5). We measure the relative dimensions of the flock by enclosing the flock in the bounding box of minimumvolume parallel to the longest dimension. This bounding box is calculated by means of a principal component analysis (PCA) of the coordinates of the flock members [39] (Movie S1). The eigenvectors that are associated with the smallest/medium/largest eigenvalue of the covariance matrix provide an orthonormal coordinate system oriented along the axes defining the shortest/medium/longest dimensions of the flock, respectively, I 1 ,I 2 ,I 3 . Note that the shortest dimension I 1 corresponds to the height of the flock, since flocks are flat [4,26]. We measure the shape of the flock by the aspect ratios of the longest relative to the shortest dimension I 3 =I 1 and of the longest over the medium one I 3 =I 2 . The last ratio (I 3 =I 2 ), we use as an indication of the degree to which the shape of the flock is oblong independent of the movement direction. We measure the degree to which flocks are elongated in the movement direction as the quotient of its length divided by its width [27,28]. For this, we enclose the flock in a bounding box parallel to the direction of movement of the centre of gravity of the flock.
The orientation of the shape of the flock is measured by the angle between its longest dimension I 3 and the direction of the velocity of its centre of gravity v v. If the angle is acute, the flock is oblong (or elongated) in its movement direction, otherwise the flock is wide (or broad).
The volume of a flock is measured by mapping the position of the individuals on a cubic lattice and counting the occupied lattice cells, the so-called voxelisation method. Here, the cell size is set at the average distance to the nearest neighbours in the flock.
The correlation length of the deviation of the velocity from the average velocity among group members reflects the size of the domains or subgroups of individuals that are closely coordinating and have similar deviations in their velocity. We calculate the correlation length in three steps as was done for real starlings [40].

Correlation function ð24Þ
Here, d(d{d ij ) is a smoothed Dirac d-function, d ij is the distance between two birds and c 0 is a scaling factor such that C(0)~1.
High values of C(d) indicate strong correlations in velocity among all flock members at a certain distance. As is typical in flocks the values of the correlation are greater for short distances and become negative for large distances. The correlation length j is the distance among birds for which the correlation function is zero. This value reflects the average size of the correlated domains (i.e. the size of the coordinating subgroups). Polarization is measured globally and locally. Polarization is measured as: Here, N i is the set of individuals in the local neighborhood of individual i (Equ. 4), N k is the set of N k j j individuals in the flock, v i is the velocity of individual i and v v is the velocity of the flock, i.e. the average velocity of its members. Since polarization is based on the dot product of unit vectors it ranges between 0 and 1. Higher values indicate stronger polarization, i.e. higher alignment in the flock. The average degree of banking is the average over all flock members of the angle between the wings and the horizontal plane.

Results
In the model sharp turns in the trajectory of a flock arise because individuals that are outside the sleeping site are attracted back to it (Fig. 3, Fig. 6A). The turning involves banking (Fig. 6B) and whereas this hardly affects the thickness of the flock, I 1 (Fig. 6C), it strongly distorts the aspect ratio, particularly of the longest over the shortest dimension, I 3 =I 1 (Fig. 6D) and the volume of the flock (Fig. 6E) (and the average distance to the nearest neighbour; data available on request).
In line with our hypothesis that variability of shape increases when individuals in a flock are less synchronised, higher variability of shape occurs a) when flock size is larger, b) when the number of interaction partners is smaller, c) when the flock turns more strongly, d) when individuals roll into a turn versus when they do not, but, in contrast to our hypothesis, variability of shape decreases when the variability of speed is higher.
The shape of large flocks is more variable than that of small ones, because individuals at different locations in the flock are more likely to differ in velocity (Movie S2). In larger groups larger sub-flocks form, as reflected in the longer correlation length of the deviation of the velocity from the average (i.e. a scale free correlation, Fig. 7AB). These sub-flocks are not only larger but also more diverse in their movement direction. This becomes clear from the decrease of the global polarisation with flock size, while the local polarisation remains the same (Fig. 7C). Consequently, the variability of behaviour is higher in larger flocks. Besides, in large flocks some individuals bank to return to the roost sooner than others, and consequently turn and lose height earlier than others (Movie S3). By subsequently meeting those above the roost that are still flying outwards, the flock changes shape (aspect ratio) and volume (Fig. 6DE). When the total flock is smaller (N = 200 instead of N = 2000), the shape is more static (Fig. 6DE, movie S4) because a) interactions are more global and b) individuals experience more often the same environment (above or outside the roost).
Similarly, when they have fewer interaction partners, different flock members are more prone to behave differently, because they react to different local environments (Movie S3). When they have more interaction partners synchronisation is stronger which can be seen from two facts (Movie S5). First, the sub-flocks are larger, which is apparent from the stronger increase of the correlation length with the flock size when individuals interact with more neighbours (i.e. with 50 neighbours the slope of the regression line is 0.79 whereas with 6.5 interacting neighbours it is 0.44) and second, their movement direction is less diverse. This is apparent from the stronger local and global polarisation (Fig. 7C, Global polarisation: Wilcoxon matched-pairs signed ranks test, N = 6, Tau = 0, P,0.03 two-tailed; Local polarisation, Mann-Whitney U test, N = 200, z = 9.98, P,0.0001***). Thus, the number of subflocks is lower, and their diversity of movement direction is lower and therefore the variability of shape of the flock is less than when there are fewer interaction partners (Fig. 6DE, movie S5 vs S3).
Strong turning happens when individuals fly outside the roost. In large flocks with few interaction partners strong turning induces more variability of shape than moving above the roost with only mild turns (Movie S6). Strong turning, compression of volume of the flock and changes in altitude [26] happen only if individuals roll into the turn. The changes in altitude are a consequence of a temporary reduction of effective lift at the cost of the generation of a centripetal force. If individuals cannot roll, they only turn mildly, remain at the same altitude and the shape of the flock is oblong and continuously bends along the outer edge of the sleeping site (Movie S7). This shape does not resemble real flocks of starlings, because it lacks vertical movement and it is static.
Even if we completely omit the force that causes individuals to return to cruise speed (equation 1) it appears possible to increase the variability of speed only marginally from a coefficient of variation of 0.01 to 0.015. This is probably a consequence of the stabilising effect of aerodynamic forces. This increase in speed variability is too small to result in qualitative differences in variability of shape when making sharp turns over the roost. However, when flock members are turning only mildly while flying above the roost, even this small increase of the variability of speed causes flocks of almost all group sizes to become more oblong in the movement direction than at lower variability of speed (Fig. 8A).
Besides, at a low variability of speed the shape of flocks of different sizes appears to be more oblong in other directions than in the movement direction (I 3 =I 2 wL=W , Fig. 8B). The angle between the movement direction and the longest dimension I 3 appears to be diverse (Fig. 8C). This diversity of angles is a consequence of the low adjustment of speed, which during turns makes different individuals follow a path of equal length and curvature. Thus they change their movement direction relative to the shape of the flock. This automatically implies that the flock changes its shape relative to the movement direction, e.g. before a sharp turn of 90 degrees, the flock shape is wide and after the turn, it is oblong (Fig. 8D) and it implies that they swap their location in the flock (e.g. before the turn, individual 1 is located at the left, after the turn it is located at the rear).
Because we can increase variability of speed over a larger range in our fish model [24] than in our bird model, we verify effects of adjustment of speed in our fish model. Upon increasing the parameter tau for the adjustment of speed from 0.05 to 0.34 (Equ. 1) the coefficient of variance of speed increases over a larger range than in our bird model, from 0.05 till 0.20 (whereas in the bird model from 0.01 to 0.015). This results in an increase of the elongation of the shape of the school in the movement direction from being about 1.1 as long as wide to almost 3.5 times (Fig. 9A). Interestingly, in the fish model at parameters, where the coefficient of variance of speed is relatively high, even during turning the shape of the school remains oblong ( Fig. 9B; for colour version, Supplementary material, figure S1). This arises, because individuals in the inner corner automatically slow down to avoid collisions and in the outer corner they speed up to remain close to others (Fig. 9C, S2). Consequently, when turning, individuals stick to approximately the same location in the school (indicated in different grey shades, Fig. 9B, S2). At extreme low variability of speed, like in our bird model, during turning school-shape changes its orientation and individuals swap position (Fig. 9D, S3).

Discussion
We show that local variability of behaviour in a group generally leads to more variable flock-shape, but not in cases of local variability of speed. Instead, high variability of speed results in an oblong shape that is permanently oriented in the movement direction. Remarkably, a lower variability of speed, thus, a stronger synchronisation in a flock, leads to a variable orientation of the longest dimension of the shape relative to the movement direction.
The present study shows that group size has a great impact on the variability of shape. The local variation in larger flocks is greater as is apparent from the greater changes in volume during sharp turns, from the lower global polarisation, and from the scale free correlation of the deviation from the average velocity with flock size in the model. The scale free correlation resembles that in real starlings [40]. The increase in the size of the subgroups with flock size is however larger in our model than in real starlings (gradient of the scale free correlation in the model is 0.44 and in starlings 0. 35) indicating that in the model there is less local variation than in reality. This may arise from the greater uniformity of the environment in the model, due to the absence of all kinds of disturbances (such as other birds, including predators, wind, airplanes and very high buildings) [26]. The greater uniformity of environment may also be the cause that the volume of the flock in the model is smaller than in reality [26].
A higher number of interaction partners in our model decreases the variability of flock shape as a consequence of the greater synchronisation of the flock-members (as is apparent from the stronger scale free correlation between subgroup size and flock size, from the stronger global and local polarisation and the smaller changes of volume during turns). Similarly, when in a model of predation on fish schools prey-individuals interact with more neighbours while evading attacks of a predator, the shape of their schools becomes less diverse than when interacting with fewer partners [15].
Turning has a big impact on the variability of shape. Turning in the model resembles descriptions of turning of real flocks, for instance, of rock doves in several aspects [8]. This concerns the temporary changes of volume of the flock and its loss of altitude during a turn, see Fig. 6C of our earlier work [26], the frequently occurring change in orientation of the flock and the repositioning of individuals as shown by Pomeroy and Heppner for rock doves in their Fig. 4B and 5 [8]. Large changes in volume arise only when flocks are large and individuals interact with few neighbours, because in this case individuals sometimes experience different environments (above and outside the roost), which desynchronises behaviour in the flock. Rolling into a turn is essential for creating both the reduction in volume and the loss in altitude in our model. The loss of altitude is a consequence of the reduced lift that individuals experience when banking. Without banking, the shape of the bird flock resembles that of a fish school, since it is very elongated in the movement direction (Movie S7). Together these traits (large flock size, few interaction neighbours and rolling into a turn) cause the great variability of shape.
Change of shape during turning and repositioning of individuals are a consequence of low variability of speed. Repositioning has been observed in several species, such as dunlins [5], pewits [1], rock doves [8] and starlings [4]. Repositioning of individuals in the flock arises, because all individuals follow an equal path length during a turn, as show for rock doves [8]. Low variability of speed causes the change of orientation of the flock and the repositioning of individuals, as is shown in our fish model, because these traits are absent when variability of speed is high (Fig. 9). Here, when adjustability is high, due to the close proximity in the inner corner of the turn individuals slow down and in the outer corner, due to the large inter-individual distances, they speed up. Consequently, during a turn the shape of the school is maintained and individuals stay at approximately the same location in the school. This can be seen in Fig. 9B in which we gave individuals different grey-shades depending on their location in the group in the initial snapshot: they appear to be faithful to approximately the same location, left, front etcetera during the whole series of snapshots (for colour-version see Supplementary material, S1). The permanency of shape during turning due to high variability of speed extends our former theory about the causation of the oblong shape of fish schools to include turning behaviour [25]. This theory implies that the group shape becomes more oblong due to frequent slowing down by its members in order to avoid collisions [24,25,27,28]. Our finding that in StarDisplay variability of speed is accompanied also by elongation of the flock in the movement direction, suggests that if their speed could deviate from cruise speed more, this mechanism of elongation would work for birds also. Since shape of fish-schools is more oblong than that of bird flocks, we hypothesise that the variability of speed of birds is lower than that of fish.
There may be several biological advantages to locality of interaction and low variability of speed. Locality of interaction may result in greater variability of behaviour among individuals in a flock. This may confuse predators and reduce their success at catching of prey. Low variability of speed, may confuse predators also through the accompanying repositioning of flock members during turns, the so-called 'crossing paths' [8,41]. Further, it may be advantageous by saving of energy through elimination of acceleration and for avoiding collisions by preventing collisions from front to back [26] (Hemelrijk & Hildenbrandt in prep). Collision avoidance may be more important for birds than for fish, because collisions are more dangerous for birds, because their movement is faster and the viscosity of their medium is lower.
Despite its usefulness, our model has shortcomings. First, of such complex animals as birds, it concerns merely their movement behaviour in relation to the position and heading of others and of the roost, while using a simple model of flying behaviour, ignoring e.g. flapping flight. It ignores any behaviour related to other motivations, such as nutritional [42], reproductive [23] or motivations to avoid a predator [15]. It also ignores environmental disturbances, e.g. by physical forces, such as wind. Thus, in nature, there will definitively be additional reasons that cause flock shape to be variable beyond those that we consider in this paper. Indeed, in the model the variability of shape of, for instance, small flocks of 200 birds is below that observed in real flocks in nature.
A number of the explanations generated by our model can be used as testable hypotheses for empirical data, not only of birds but also of other animals moving in groups. Testable hypotheses from the present investigation concern effects of locality of interaction and variability of speed (Table 2). Particularly in the light of the great effort and difficulties of collecting empirical data of three dimensional positions of animal groups [25] and particularly of flocks of birds [6,16], such model-based hypotheses are valuable. Figure S1 (TIF) Figure S2 (TIF) Figure S3 (TIF)

Supporting Information
Movie S1 Measurement of school shape. This movie shows a bounding box around the flock in black. Its dimensions are calculated with the PCA. The the shortest dimension is the height.  The flock is clearly asymmetrical or oblong. Simultaneously the movie shows the bounding box for measuring the degree to which the flock is elongated in the movement direction (white).