An effective hydrodynamic description of marching locusts

A fundamental question in complex systems is how to relate interactions between individual components (‘microscopic description’) to the global properties of the system (‘macroscopic description’). Furthermore, it is unclear whether such a macroscopic description exists and if such a description can capture large-scale properties. Here, we address the validity of a macroscopic description of a complex biological system using the collective motion of desert locusts as a canonical example. One of the world’s most devastating insect plagues begins when flightless juvenile locusts form ‘marching bands’. These bands display remarkable coordinated motion, moving through semiarid habitats in search of food. We investigated how well macroscopic physical models can describe the flow of locusts within a band. For this, we filmed locusts within marching bands during an outbreak in Kenya and automatically tracked all individuals passing through the camera frame. We first analyzed the spatial topology of nearest neighbors and found individuals to be isotropically distributed. Despite this apparent randomness, a local order was observed in regions of high density in the radial distribution function, akin to an ordered fluid. Furthermore, reconstructing individual locust trajectories revealed a highly aligned movement, consistent with the one-dimensional version of the Toner-Tu equations, a generalization of the Navier–Stokes equations for fluids, used to describe the equivalent macroscopic fluid properties of active particles. Using this effective Toner–Tu equation, which relates the gradient of the pressure to the acceleration, we show that the effective ‘pressure’ of locusts increases as a linear function of density in segments with the highest polarization (for which the one-dimensional approximation is most appropriate). Our study thus demonstrates an effective hydrodynamic description of flow dynamics in plague locust swarms.


I. INTRODUCTION
The behavior of large animal collectives can be described through individual-level mutual interactions (this is termed a "microscopic description"), much like describing a material through the interactions between its molecules.For fluids there is a complementary large-scale description in the continuum limit, the Navier-Stokes equations, which characterize fluids in terms of macroscopic parameters.An important question is whether large animal collectives, which appear to have an animate fluid-like character, can be effectively described by equivalent hydrodynamic descriptions of macroscopic properties such as pressure and viscosity [1].
From the perspective of physics, large animal collectives can be thought of as a form of "active matter", a general name for agents or constituents that can convert stored energy into directed motion, forces, and shape deformations [2][3][4].It is not evident that an effective macroscopic description of active matter always exists and if such a description can correctly capture the systems main macroscopic properties.Living systems provide the preeminent example of active matter and spontaneous emergence of ordered movement in a group of many organisms.Here, we study marching locusts, that offer an intriguing opportunity to delve into the dynamics of such large animal collectives and a system where we can examine these questions about the macroscopic effective description.We note that such collective behaviors appear, in addition to locust swarms, in many other collectives including migrating cell sheets [5], and large aggregates of mobile group-living animals [6].
Locusts, a form of grasshopper, are considered a notorious agricultural pest due to their ability to form swarms that can cause widespread crop damage.Locust swarms can extend over several hundred square kilometers with up to 800,000 individuals per hectare, threatening the food supplies of millions [7].The formation of swarms begins when flightless juvenile locusts form so-called "marching bands".Facing challenges in obtaining sufficient nutrients in arid areas and under the risks of cannibalism [8,9], marching bands make long-distance diurnal marching bouts.Field observations describe bands moving in a highly coherent direction and maintain relatively defined structures of columnar streams and planar fronts [10][11][12].However, due to the unpredictable nature of locust plagues and restricted access to infested areas, access to high-resolution field data is limited (with a few notable exceptions including detailed descriptive studies of [10] and [13,14] on desert locusts, and [11,[15][16][17] on Australian plague locusts).With recent advances in computer vision and automated animal tracking (e.g., [18][19][20][21]), large quantities of trajectory data can now be extracted automatically (e.g., see [11] for manual, and [22] for automated tracking of comparable data sets) for fine-scale analyses of the structure of marching bands starting from the motion of individual animals [22].
Laboratory and modelling studies advance our understanding of locust swarming behaviour by deciphering local interaction rules that govern collective locust motion [8,23], foraging decisions [24,25] and global group structures/dynamics [12,26,27].Supported by empirical evidence that non-cooperative interactions such as cannibalism can drive locust collective motion [8], the principal models of attraction and repulsion [23] have been extended to anisotopic interactions of escape and pursuits, allowing the reproduction of a wide range of collective dynamics and social phenotypes [26,28,29].
Here we want to examine whether a macroscopic description of marching locusts exists and to what extent this description is successful.Since flightless juvenile locust swarms move, predominantly, in two dimensions, and are so large, they provide a meaningful system with which to ask questions about the continuum limit of active matter (in two dimensions).Systems of active matter are far from thermodynamic equilibrium as a result of the constant energetic input (chemical energy from nutrients in the case of biological active matter or external fields in the case of engineered active matter), the energy is not conserved and therefore time reversal symmetry is broken.However, as shown below, some symmetries and conservation laws are still valid, like invariance under rotations and translations, and mass conservation [2].
One of the first models that became very popular to consider the physics of collectives, due to its simplicity and universality was the Vicesk model [30].This model is based only on local alignment interactions between the individuals and demonstrated how such interactions can account for the spontaneous emergence of ordered movement at large length-scales [31,32].The prediction of this model of a transition from disordered to ordered movement above a critical density was confirmed in locusts [23].Here we want to take another step forward.Since living organisms exhibit an overall complexity that should be, in principle, described by a large number of variables, it may seem counter-intuitive that such simple models like the Vicesk model, may be appropriate descriptors of macroscopic collective properties, such as long-range alignment.However, much as understanding the properties of fluids does not depend on an atomic-level description, it may be possible for active matter to also consider an effective theory to describe its movement using a continuous media approach that takes into account a small number of variables.The continuous media approach gives a macroscopic long-wavelength description of the system by writing down the most general continuum equations of motion consistent with the symmetries and conservation laws of the system.Such a description of systems works for a large number of individuals while taking averages of the relevant quantities over long periods of time, assuming that the changes are slow in time and small in space (over the characteristic times and sizes of the system).Importantly, this approach does not depend on a specific microscopic description but rather introduces constraints on any microscopic model.Those constraints are introduced through the functional dependence of the variables in the continuous description; the velocity field ⃗ v and the density ρ.In addition, there are phenomenological parameters in those equations, whose numerical value will depend on the detailed microscopic description of the interactions in the system.We can measure those parameters from the data and any new microscopic model in the future should provide us with those values.
The Navier-Stokes equation is the most general equation that describes fluids up to second order derivatives with respect to the spatial coordinates and is compatible with rotational and translational symmetry (for example see [33]).Motivated by the inherently discrete Vicsek model, Toner and Tu generalized the Navier-Stokes equation to accommodate for the inherent properties of active fluids (absence of Galilean invariance; that is the laws of motion may not be the same in all inertial frames of reference) and to include an alignment force.The marching locusts that are analyzed in this paper provide us with a unique opportunity to evaluate how the continuous media approximation works in general and the Toner-Tu equation (2) in particular since fits to the Toner-Tu equation are usually studied in simulations or artificial active matter and not in living matter, except for some unique works on starlings [34,35].In this paper we will concentrate on the leading order terms in derivatives of Eq. ( 2) and we leave the sub-leading effects, e.g.viscosity, for future studies.
The data for the analysis presented here were collected in 2020 during a major locust outbreak in northern Kenya.A "funnel" was constructed using multiple rocks within a vast swarm, and a places as an obstruction (see Fig. 1A).The obstacle and the "funnel" together were designed in order to maximize the spatial variation of the density.Recordings of the locusts moving through this configuration were made by filming an area of 3x2 meters approximately, directly down, and the individual trajectories of all locusts passing through were tracked.The first analysis that we present here is that of nearest neighbors distribution and radial distribution function (RDF).The RDF suggests that the structure is fluid-like and motivates us to consider the continuous media approximation, namely the Toner-Tu equations.We extracted the trajectories in two long strips on both sides of the obstacle and found long time periods (130-300sec) in which the movement is in a steady state.It means that the spatial average density and velocity (over a strip) are approximately constant up to small variations.This allows us to ignore terms with explicit time derivatives in the Toner-Tu equations and simplify the analysis.Moreover, it allows us to look at long time averages and compare quantities, like density and velocity, at different points along the strip.Only when we have steady state time average is meaningful for a specific point in space.
In addition to the consistency of the continuous media approach, we found a simple equation of state that holds in the system -a simple relation of the hydrodynamic pressure with the density for a significant range of densities.Apriori we do not expect to find that an equation of state holds for active fluids.We usually find equations of state in thermal equilibria and the current system is far from it.In addition, the general functional form of the pressure is unknown, but based on the data, we can find its approximate dependence on the density.Some recent studies of an equation of state for active matter and systems far from equilibrium include simple models of active particles and active colloids [36][37][38][39][40][41][42][43] and only a few examples for biological systems [44][45][46].The analysis below shows, a strong linear relationship between the pressure and density for a wide range of densities, namely The linear dependence is similar to ideal gas-like behavior.A similar resemblance to ideal gas has been observed in human crowd dynamics (see, for example, [44]).Additionally, a non-linear generalized ideal gas law has been used to describe the thermodynamics of swarming midges [45,46].It suggests that the thermal equilibrium may be a good approximation in those regimes.Then the equation of state gives a predictive power for a wide range of densities and boundary conditions that were not considered here.This equation of state (Eq. 1) for the hydrodynamic pressure motivated us to look in addition at the mechanical pressure, which is related to deformations and not to the kinetics of the fluid.In thermal equilibrium they are balanced and equal.Therefore, we do not expect them to be equal when the system is far from thermal equilibrium (see also [47]), as in the current active system, which is studied here.Nevertheless, we find a similar linear relationship between the pressure and density for a similar range of densities.

I.1. The Toner-Tu Equations
The Toner-Tu equation [48,49] can be written in the following schematic form: where λ 1 , λ 2 , λ 3 are coefficients of advection/convection-like terms.This is the most general form of such terms.Under the requirement of Galilean invariance, which means that the laws of motion are the same in all inertial frames of reference, the equation is reduced to the Navier-Stokes equation when λ 1 = 1, λ 2 = λ 3 = 0. F (|⃗ v|) is an effective restoring force that keeps the speed constant at v 0 , i.e., F (v) is a one-dimensional function so that F (v 0 ) = 0.This preferred speed breaks Galilean invariance for active matter.P (⃗ x) is the hydrodynamic pressure whose gradient gives the total acceleration of the fluid particles (the local and the convective accelerations).This pressure is identified as the trace of the bulk stress tensor, whose microscopic definition is in terms of momentum fluxes [50].As mentioned above, for active matter this definition does not coincide in general with the mechanical pressure that is described below [47].D B , D T , D 2 are coefficients of the viscosity-like terms.They contain the second order derivatives with respect to the spatial coordinates and are thus important when there are rapid spatial variations.In our case, they are subleading to the convective terms (which are first order in the derivatives) since we concentrate on slow spatial variations in the long wavelength approximation.We will see that in our approximation ∆v/∆x < 1 and therefore ∆v/∆x 2 < ∆v/∆x, which justifies the hierarchy of the derivative expansion.The ⃗ F i s are all of the additional external forces that may act on the fluid.

II. LOCAL ORDER AND THE DISTRIBUTION OF NEIGHBORS
In order to better understand the spatial structure of locust bands, we started by computing the radial distribution function of nearest neighbors.From the tracked data (see Fig. 1A) we measured the nearest neighbor distribution from all locusts grouped by an α-shape polygon (see appendix C).
As individuals defining the α-shape's borders are surrounded by more empty space and thus have overall larger nearest neighbour distances, we corrected for this edge effect by applying a simplified Hanisch correction [51,52]: For each locust, both the distance to the shape border and the nearest neighbour distance were calculated.Only pairs where the distance to the nearest neighbour was smaller than the distance to the border were included, thus preventing an edge bias.These calculations were conducted once per second and used to calculate heatmaps of the nearest neighbour distributions (Fig. 2C. To quantify potential anisotropy, we binned the distributions in angular quadrants: front and back (135°-225°, 315°-45°), left and right (45°-135°, 225°-315, see Fig. 2A).We calculated then the proportion of neighbors on the sides out of the total number of neighbors in all quadrants, N sides /N T otal , and took this ratio as a measure of the isotropy (Fig. 2A and Fig. 13 in appendix D for the definition of the quadrants).For an isotropic distribution this value is 0.5.In the raw data (Fig. 2Ci) there is a clear anisotropy, with near neighbors more likely to be found on the sides than the front or back.This, however, might be an artifact of the animal's body shape; locusts are not circular but have an elliptical body shape.Elongated shape allows nematic ordering which could be evolutionary adaptive for collective movement.Because of the elongated shape, it is more likely to measure a near neighbor on the side.We can correct for this bias by rescaling with the aim being to take the elliptical body shapes and transform them to circles.In this data set the alignment is high since the locusts are all marching the same direction through a channel, and the velocity vectors (and hence the orientations) of all individuals lie along roughly the same direction.Because of this alignment we can apply the same transformation to all individuals with approximately the same result.Since we rotate our data so that the mean velocities are always along a principle direction we can preform this rescaling operation by simply multiplying the coordinates along one principle direction by a scale factor.The scale factor is derived from the aspect ratio of the bounding boxes from the tracking.We then used this scale factor to correct the shape by squeezing the long x-axis to obtain a 1:1 ratio.This data is referred to as 'rescaled' and an example of the result of this process is shown in Fig. 1B-C.The nearest neighbor distribution over the rescaled data is roughly uniform (Fig. 2Cii), indicating that there is no preference for side to side distribution (Fig. 2B).The effect of rescaling is consistent across all recordings (Fig. 2A).

III. THE RADIAL DISTRIBUTION FUNCTION
Since the distribution of neighbors (in the corrected coordinates) is radially symmetric we can use the radial distribution of neighbors as a way of quantifying the physical structure of the group.The radial distribution function (RDF) is a common way of quantifying the local structure of materials and small molecules.The RDF measures the local density of neighbors relative to a focal particle (or in our case individual), averaged over all particles, as a function of radius.On a perfectly ordered lattice the RDF will display sharp peaks at radial distances corresponding to the locations of neighbors.The shape of the RDF can provides qualitative information about the state of a material system.For example, as a system heats up, the particles oscillate about their equilibrium positions and the sharp peaks in the RDF which would be observed for static particles become more diffuse [53].More diffuse peaks indicate higher disorder.For our data we calculate the RDF as a way of qualitatively comparing the distribution of marching locusts to the expected RDF for various states of matter to understand what physical state the marching locusts most resemble.The RDF is calculated as where n(r) is the number of individuals in an annulus of radius r relative to a focal individual, a(r) is the area of this annulus (thus n(r)/a(r) is the density of individuals in the annulus of radius r) and the brackets denote the average over all individuals.This is computed for specific regions in two of the recordings where we expect densities to be the highest.The focus is on regions which are above and below the obstacle.In these regions the densities are high but the channels are narrow so the number of individuals and their neighbors is somewhat low.Further, many individuals are close to edges, which strongly skews the RDF.To mitigate this a supercell is constructed from each of the regions.This is effectively considering the region boundaries to be periodic.With this consideration we eliminate the effect of the edges without losing the contributions of the individuals that lie near an edge.There calculation are all performed on the rescaled data.
We focus the analysis on the two videos with the highest density, video 1 and video 2, (significantly higher packing fraction than the other recordings, see Fig. 2A and Fig. 12 for the comparison of the packing fraction of all the nine recordings) which are sufficient for time averaging and the continuous media approximation (that we consider below) to hold.
The placement of the elongated obstacle varies across the two recordings.In video 1 the channel is nearly symmetric with the elongated obstacle placed in the center.In the other the elongated obstacle is placed asymmetrically, closer to one side of the channel.Because of this placement there is a wide channel and a narrow channel.We only include the wide channels in calculating the RDF for this recording.For the nearly symmetric recording we calculate the RDF in both channels (labeld "top" and "bottom" in Fig. 3 B).
The calculated RDFs are shown in Fig. 3.There is a clear first neighbor peak sometimes followed by a weak second neighbor peak.This second peak only appears in the highest densities and indicates some qualitative similarity to a liquid crystal [54] especially as compared to random packed hard spheres [55] for instance.The presence of some amount of order in the RDF lends support to our consideration of this system as fluid like.

IV. THE HYDRODYNAMIC PRESSURE
The elongated obstacle (the bottle) splits the stream into two narrower streams.Together with the funnel shape of the boundaries it contributed to the spatial variation of the density and speed.Our goal is to extract values of velocity and density on a range as wide as possible at various points in space in order to check the validity of the hydrodynamic effective description and an equation of state like the one in Eq. 1.For this purpose we defined two long strips on both sides of the obstacle, extracted trajectories, and looked at long periods of time in which the average density and velocity are approximately constant.Only then spatial differences are meaningful.The strips are shown in Fig. 4A and defined in detail in appendix A. In the following analysis we compare the dynamics of the locust movement in the continuum limit with the Toner-Tu equation.To complete the full continuum description of the Toner-Tu equation, we require continuity equation which is a mass conservation statement: From equations ( 2) and ( 4) we see that we have three requirements for a steady flow; the density, the speed and the direction of motion should all remain constant.We consider the system in a time segment to be in a steady flow if for a quantity M its standard deviation is less than 10 percent of its mean value.We show in appendix A how they are satisfied for long periods of time in the two strips of video 1 (330 sec approximately for the bottom strip and 120 sec for the top strip).

IV.1. The one-dimensional approximation
In this section we only consider time segments when our steady flow conditions are satisfied.Then we can look at the average velocity and density over time, compare different points in space, and concentrate on the effect of the geometry of the environment on the motion.The experimental arrangement in the field created an effective two-dimensional funnel that focuses the marching locusts towards the elongated obstacle (the bottle in the recording) around which the density is higher and the speed is reduced.Past the obstacle the locusts spread out, lowering their density but increasing their speed.Thus the movement can be divided into three sections relative to the obstacle in the middle (see Fig. 4A-D and appendix C for packing fraction in the three sections).Note that every point in the plots of Fig. 4 is obtained by averaging over a long time period in which the strip is in steady state.
The funneling effect of this geometrical structure makes it attractive to consider a one-dimensional approximation as the first approximation for the dynamics of the system.We then consider mean values of the variables along narrow vertical strips at constant x and, this way, neglect their variation with respect to the vertical coordinate y.Within this approximation, the alignment force becomes a lower order effect relative to the convective acceleration, and the Toner-Tu equation ( 2) is reduced to the following: We look at strips whose width is 50 pixels (roughly 4 cm, the average length of a locust), since this is the relevant scale for spatial variations.In Figures 4B and 4D we see the density and the horizontal component of the velocity v x as a function of the horizontal distance, x, where the angle brackets represent averages over time.
When we look at the ratio v 2 y /v 2 x as a function of the position on the horizontal axis, x, we find that it is less than 0.1 (Fig. 4C) and thus the term v 2 y can be neglected, and we get the following equation: where In addition, we find that in steady flow the local acceleration is negligible compared to the convective one.That is an aditional simplification of Eq. ( 7).We can see that by taking the average over time of Eq. ( 6).From the integration of the first term of the left-hand side over a time segment T we get the mean acceleration which is bounded by a x as a function of -⟨ρ⟩ for the bottom strip.The red points correspond to strong alignment ⟨Q⟩ > 0.95 (from Fig. 4) and the yellow points are the rest.The linear fit of the points with strong alignment is in red and R 2 = 0.84.When we include all the points in the fit we get the dashed yellow line with R 2 = 0.11.
small number for a long time of measurement (∼ 300 sec, see Fig. 9) compared to the second term where λ ef f ∼ O(1) and v 2 x ∼ 60(cm/s) 2 .In conclusion, we see from the data that in the one-dimensional approximation the convective acceleration is the dominant term in its contribution to the total acceleration.

IV.2. The alignment order parameter
If the assumption about the linear dependence of the pressure on the density in Eq. ( 1) is correct and the onedimensional approximation is good enough, we get from Eq. ( 6) that the density should be linear with the velocity squared: However, the accuracy of this relation depends mainly on the accuracy of the one-dimensional approximation of the hydrodynamic equations.When all individuals are aligned, this linear relation should be valid.To check this we can quantify how much the system is aligned by introducing an alignment order parameter [3] which is the average of cos(2 χ) over all individuals where χ is the angle between the local velocity and the average direction of movement (see Fig. 4A).The overline denotes the average over all individuals.Q = 0 is when all the particles are in random orientation and Q = 1 when they are perfectly aligned.From the Toner-Tu equation ( 2), we expect that when the alignment is stronger, the one-dimensional approximation should be better and then the linear relation (9) should hold.The average alignment over steady flow is given in Fig. 4E.In the bottom strip the alignment is maximal (⟨Q⟩ > 0.95) for 90 < x < 200 cm (marked by blue lines in Fig. 4E, and for 100 < x < 175 cm in the top strip, see appendix B).For those segments we then check the linear correlation of −⟨ρ⟩ with ⟨v 2 x ⟩ and show that it is stronger in the segments where the alignment is stronger.In Fig. 4D and F the segments where the alignment is strongest are marked according to Fig. 4E.In Fig. 5 we compare the linear fit (⟨v 2 x ⟩ vs. −⟨ρ⟩) of the segment with strongest alignment (red line and red points) with the linear fit using all points (yellow dashed line).We see that indeed the linear fit is significantly better when only the region of strong alignment is included.This way we could sample the locust dynamics in the regions where the one-dimensional approximation is good enough and find that the relation in Eq. ( 1) indeed holds.The geometrical constraints (the funnel and the bottle) were good enough in creating such conditions, so that the one-dimensional approximation is successful.We obviously expect that the equation of state holds everywhere where the pressure is high enough and does not depend on the particular boundary conditions.We checked the same linear relation for more recordings but most of them, as evident in Fig. 12, are at densities which are too low to contain a sufficient number of animals for analysis, and the polarization is lower as well (up to 0.8 on average).The results for the top strip of video 1 are given in appendix B (Figs. 10,11).In the second recording the top strip turned out to be too narrow for a significant stream.Therefore in Fig. 6 we summarized values of the velocity squared vs. the density for three segments of strips with highest alignment (Q > 0.95) and obtained very good linear fits.
-0.24 -0.22 -0.20 -0.18 -0.16 -0.14 -0.12 x as a function of -⟨ρ⟩ for segments of strong alignment (⟨Q⟩ > 0.95) with linear fits for cases where they exist: The red points correspond to the top strip of video 1 (R 2 = 0.88), the yellow points for the bottom strip (R 2 = 0.84) and the purple points are for the bottom strip of video 2 (R 2 = 0.9).

V. MECHANICAL PRESSURE
In the previous section we develop a hydrodynamic definition of the pressure, which depends on the squared velocity.Additionally, we can define a static pressure through an analogy with the mechanical stress.The mechanical stress is defined as the force per unit area acting on the faces of a cubic volume element and is related to the strain (or deformation) by a generalized version of Hooke's Law [56].This concept relates the force acting on an object (pressure) to the resultant deformation of that object.In the context of marching locusts we can think of the object as the area which an individual locust occupies and can calculate the force that must be exerted to shrink or grow that area relative to a fixed reference.We approximate the area occupied by a locust as the Voronoi area around the individual.Because the distribution of neighbors in the corrected coordinates is radially symmetric we can then approximate the deformation as acting on a circle of the same area as the Voronoi cell so that the mechanical pressure is radially isotropic (only acts on the radius of the circle) and one-dimensional.We can relate this to the hydrostatic stress, which is simply the isotropic component of the mechanical stress.We write this relationship as: where σ ij is the mechanical stress, E is the elastic modulus, and ϵ ij is the strain.The isotropic component of the pressure acting on the radius of a circle is then σ ii = σ r ≡ P mech , where P mech is our mechanical pressure and we get where r is the radius of the circle representing the area occupied by a single locust and ∆r = r − r m is the change in the radius relative to a reference radius, r m .To calculate the area occupied by a single locust we start by computing the Voronoi tessellation of a single frame, including the positions of all locusts.The area of each Voronoi cell is calculated and taken to be the total area around each locust.The radius, r, is then calculated for each individual as the radius of a circle which has the same area as the Voronoi cell.This process is illustrated in Fig. 7.In what follows we calculate the reference radius, r m , per frame as the mean radius taken over all locusts in that frame.In addition to the pressure we calculate the local packing fraction around each locust.
where the summation is over all neighbors within a fixed radius, r 0 of a focal individual, A j is the area of the bounding box of a single neighboring locust and A 0 is the area of the circle with radius r 0 .We choose r 0 to be roughly 9 locust body lengths and from this calculate the number of locusts in the that circle.This is because the maximum value of the local density distribution is constant for r 0 values above 6 (350px) body lengths but drops off, due to edge effects, for values higher than 12 (750px).Thus we choose a value between these bounds and from this calculate the number of locusts in that circle.The mechanical pressure vs packing fraction is shown in Fig. 8.There is, as with the hydrodynamic pressure, a strong linear relationship between the mechanical pressure and the local density.In general there is not always a well defined pressure in active systems [47,57].Here we find a consistent linear relationship between two definitions of pressure with the density, indicating that despite the active nature of this system the pressure is a well defined state function for a range of densities.

VI. DISCUSSION
In this paper we used tracked coordinate data obtained from recordings of marching locusts in the field.We find that, when accounting for the elliptical shape of the locust's body, neighbors are randomly distributed around a focal individual.Marching locusts, at least at the densities studied here, have no apparent preference for their position relative to their neighbors.Looking further at the distribution of neighbor distances we calculated the radial distribution function (RDF) for high density strips, finding that the RDF resembles that of fluid.FIG. 8.The mechanical pressure (Eq.12) vs local packing fraction (Eq.13) for two recordings which span a high range of densities (video 1 and video 2).The points are the mean values of all points in fixed size bins (all containing the same number of samples) and the spread of the bands is the first standard deviation.The black lines are linear regressions on the displayed regions of each recording.The R 2 values for videos 1 and 2 are 0.933 and 0.985 respectively.The dotted line is the line y = 0. Note that the mechanical pressure here is defined dimensionless P mech = ∆r/rm (without an elastic constant) and is relative to the mean radius in a given frame.
We then show that marching locust bands can be effectively described by a hydrodynamic description which is compatible with the Toner-Tu equations (the equivalent of the Navier-Stokes equations for active matter).In particular we find that an effective equation of state holds for a wide range of densities (Fig. 6).The fact that the linear relation in ( 9) fits well to the data supports the relevance of the Toner-Tu equation 2 to describe the dynamics and supports the linear relation between the hydrodynamic pressure and the density (Eq.( 1)).In addition we find another linear relationship between the mechanical pressure and local packing fraction over the same range of densities.We do not expect these relations to hold for all values of density but expect it to break down at low densities due to a change in the nature of mutual interactions of the locusts.At high densities the interactions are short range and predominant by effective hydrodynamic properties while at low densities long range interaction dominate.In general the existence of an equation of state for the pressure is the exception for active matter [47], and we find here that it exists for packing fractions in the range of 0.1-0.25.However, we see that although the linear relation in the hydrodynamic pressure holds for three separate strips (Fig. 6), the slope is different, even for two strips from the same recording.This slope is a phenomenological parameter that depends on the detailed microscopic description of the interactions in the system.It characterizes the specific material that is examined.Therefore in non-biological matter we expect it to be constant in contrary with the findings for this biological active matter.It therefore shows the ability of organisms to change effective macroscopic properties according to environmental conditions while preserving the same basic interactions which are reflected by this equation of state.
The effective macroscopic description that we found provides constraints on any microscopic model.Any assumptions on the functional form of the interactions between individual locusts should reproduce the equation of state that was found and explain how adaptation to different environmental conditions can be reflected by different phenomenological parameters.

VII.1. Data collection
Here, we analyze motion trajectories of juvenile marching bands (nymphs of 3rd to 5th stage) of desert locust Schistocerca gregaria.Data were collected during a major locust outbreak in February and March 2020 in Samburu County, northern Kenya.Nine recordings of marching bands were used in the analysis with a total duration of 42.41 minutes and 160,164 assigned locust ids (note that the actual number of locusts might be lower as new ids were assigned once a locust disappeared for at least one second).All were recorded in 25 fps, with Sony Alpha II cameras placed on tripods facing the ground vertically, covering approximately an area of 3 x 2 meters.The cameras were set up in front of the marching bands to capture the locust flow once they reached the camera range without disturbance.The areas were all configured with a "funnel" built from rocks which forced the locusts into a narrow channel, where an elongated obstacle (a bottle) was placed.An example of a typical setup is shown in Fig. 1.The nine videos were selected as to capture variation in the locust density and natural surroundings (such as fine sand or grainy sand substrate).While other recorded videos were used for obtaining training data, they were excluded due to reasons such as spontaneous change of direction, bidirectional flow, diagonal movement through the frame, propagating jumps or external perturbations.

VII.2. Visual tracking of animals in the field
A training data set of 95 images was obtained by sampling 5 images spaced over the whole recording duration each for 18 recordings (one recording contributed 10 images).All locusts in these images were then manually annotated using the annotation software CVAT [58].In total 48131 locusts were annotated.These annotations were used to train a pre-trained faster R-CNN model with a ResNet-50 + Feature Pyramid Network backbone to detect locusts in each image using Facebook AI's detectron2 API (faster rcnn R 50 FPN 3x [59]).The trained model was then used for inference on all images of the recording, yielding a bounding box (x, y, height, width) for each detected locust.Only detections with a certainty of at least 0.6 were kept and their quality displayed and reviewed in an annotated video file (see the video in the SI).Next, all the detections were linked using trackpy [60] with a search range of 100 pixels and memory of 25 frames (i.e., 1 second) using a k-d tree linking method.While creating these trajectories no interpolation took place; only an assignment of an estimated ID for each point was used.All IDs which were only present in one frame were subsequently removed.The tracked data was then further processed in preparation for data analysis.All detections within one locust's body length of the recording edges were removed to prevent tracking artifacts from appearing and disappearing locusts.Furthermore, stones, bushes, and other obstacles on the edges and the central obstacle were annotated so that all detections outside the experiment's boundaries could be excluded (see Fig. 1A).From the remaining trajectories, we estimated the median heading direction of all locusts and rotated the data so that the median heading direction was approximately aligned with the horizontal axis (locusts moving from left to right in the recording).

VII.3.2. Assigning strips
On the y-axis (orthogonal to the movement direction), two rectangle strips were assigned (see Fig. 12A).The first spanning the shortest vertical path between the top boundary and the top of the obstacle annotation, the second between the shortest vertical path from the bottom of the obstacle to the lower boundary.Both strips have a margin of one body length distance from the boundaries.On the x-axis (along the movement direction), we separated the area into three regions according to the density of locusts over the whole duration of the recording.The first segment ends at the point of the highest observed density, the second segment ends at the first drop in density, and the third segment continues until reaching the right edge.These regions are shown in Fig. 12A.x as a function of -⟨ρ⟩ for the top strip.The red points correspond to strong alignment ⟨Q⟩ > 0.95 (from Fig. 10) and the yellow points are the rest.The linear fit of the points with strong alignment is in red and R 2 = 0.88.When we include all the points in the fit we get the dashed yellow line with R 2 = 0.28

FIG. 1 .
FIG. 1. (A)Example of a frame in a typical video frame.Each detected locust is surrounded by a bounding box (turquoise) and assigned a unique ID (white).(B) Moving locust groups were grouped together in an α-shape (green polygon, see appendix C).Each point represents a locust.Due to the ellipsoid body shape of locusts, a correction was made by adjusting the distance along the moving direction by the body length/width ratio.(C) This reshaping led to the condensed shape shown, which was used to control for body shape induced phenomena.

FIG. 2 .
FIG. 2. (A)Anisotropy (number of nearest neighbours on sides / total) of each recording for empirical data (full circles) and scaled data (crosses), which accounts for locust body shape.The overall pattern remains stable across recordings despite varying packing fractions, with a higher numbers of locusts on the sides in empirical data.In rescaled data, this anisotropy disappears and approaches isotropy (dotted line).(B) Anisotropy for empirical and rescaled data over all recordings.As in (A), the nearest neighbour distribution approaches isotropy once data is rescaled.The areas are defined in appendix D. (C) Heatmap of nearest neighbour distribution across all recordings within 2 body lengths around focal locust.Anisotropy is evident in empirical data (left), but disappears in rescaled data (right).Concentric white circles represent distance from focal locust in half body lengths.0°is moving direction, also indicated by a white arrow.

FIG. 3 .
FIG. 3. Panel A is a cartoon of the radial distribution function for Lennard-Jones disks in the solid, liquid, and gas phases.The radial distribution functions for the highest density regions in videos 1 and 2 are shown in B. The dashed line is y = 1, which the RDF should converge to at long distances.

FIG. 4 .
FIG. 4. (A) A snapshot of video 1 with the areas took for analysis marked by white boxes.All panels show analysis of quantities averaged over time for the bottom strip for which the definition of the alignment angle χ and horizontal distance ruler are marked (in cm).(B) The horizontal component of the velocity vx as a function of the horizontal coordinate x (average over time).(C) the ratio of the velocity components squared as a function of x. (D) The density ⟨ρ⟩ (packing fraction) as a function of the horizontal coordinate x. (E) The alignment order parameter as a function of x.The horizontal blue line denotes the segment where the alignment is maximal ⟨Q⟩ > 0.95.(F) The horizontal component of the velocity vx squared as a function of x.

2 〉
FIG. 6. v 2x as a function of -⟨ρ⟩ for segments of strong alignment (⟨Q⟩ > 0.95) with linear fits for cases where they exist: The red points correspond to the top strip of video 1 (R 2 = 0.88), the yellow points for the bottom strip (R 2 = 0.84) and the purple points are for the bottom strip of video 2 (R 2 = 0.9).

FIG. 7 .
FIG. 7.An illustration of the process for determining the radii, r, used in calculating the mechanical pressure.A snapshot of the locusts with the tracked centroids overlaid is shown in A. The image is stretched to match with the centroids in the rescaled coordinates.B shows the Voronoi tesselation over these points and C shows the circles generated from this tesselation.Each circle in C has an area equal to the corresponding Voronoi cell area.

VII. 3 .
Pre-processing of trajectory data VII.3.1.Filtering VIII.ACKNOWLEDGMENTS D.G. and I.D.C. acknowledge support from the Office of Naval Research Grant N0001419-1-2556, Germany's Excellence Strategy-EXC 2117-422037984 (to I.D.C.) and the Max Planck Society, as well as the European Union's Horizon 2020 research and innovation programme under the Marie Sk lodowska-Curie Grant agreement (to I.D.C.; #860949).

FIG. 9 .
FIG. 9. (A) A frame from video 1.Each frame is 3840x2160 pixels where here the corners of the top strip are at (40,637) and (845,3800).The corners of the bottom strip are at (40,1064) and (1410,3800).The coordinates are measured from the upper left corner of the frame.(B) The density of the locusts as a function of time in the bottom strip normalized as packing fraction.Starting from tmin = 40sec the flow is steady since the fluctuations around the mean value (the black line) are small (less than 10%).The red dashed lines are standard deviations around the mean value.(C) The speed in the bottom strip for t > tmin.The black dashed line marks the average speed over the time and the red points are the long wavelength approximation that shows the fluctuations around the average value.(D) The vertical component of the velocity vy in the bottom strip.The black dashed line is the average and the red points are the fluctuations around the average like in C. (E) The density of the locusts as a function of time in the top strip normalized as packing fraction.Starting from tmin = 250sec the flow is steady since the fluctuations around the mean value (the black line) are small (less than 10%).(F) The speed in the bottom strip for t > tmin.The black dashed line marks the average speed over the time and the red points are the long wavelength approximation that shows the fluctuations around the average value.(G) The vertical component of the velocity vy in the top strip.The black dashed line is the average and the red points are the fluctuations around the average like in F.