Skip to main content

Practice: Collective Motion

Module 2: Synchronization and Collective Behaviour

This is an ungraded practice page. Choose one option and work on it after the lab. It uses the code you wrote in the Vicsek animation lab and the models of Vicsek and Couzin.

Option A: Couzin model

Theory: The Couzin Model.

  • Implement the Couzin rules and motion in two dimensions.
  • Animate the individuals moving. Reuse the structure of Animation.
  • Implement the group polarization \(p_{\text{group}}\) and the angular momentum \(m_{\text{group}}\) defined in Couzin et al. (2002). Compare \(p_{\text{group}}\) with the Vicsek order parameter.
  • Explore the widths \(\Delta r_o\) and \(\Delta r_a\) and find the four collective behaviours described by Couzin et al. (2002): swarm, torus, dynamic parallel group and highly parallel group.
TipOptional extension
  • Add sliders to change parameters in real time.
  • Test collective memory: slowly increase \(\Delta r_o\) and then decrease it again, and check whether the group state follows the same path both ways.
  • Implement the model in 3D, as in the original paper.

Option B: Vicsek model with predator avoidance

Guide: Predator Avoidance.

The predator can be a fixed point, a random walker, or your mouse cursor. Particles inside the predator radius turn directly away from it, as in the Couzin repulsion rule.

  • Implement the full Vicsek animation from Animation.
  • Add the predator avoidance rule and draw the predator.
  • Explore the parameter space. How does the predator affect the order parameter? Is there a regime where the group splits and later merges again? Can you find a regime where the particles escape the predator?

Option C: Confusion effect

Theory: The Confusion Effect.

  • Start from your Couzin code (Option A) and add one predator that swims toward the nearest prey, faster than the prey.
  • Make the predator lock on the most isolated prey in its field of view. Break the lock whenever another prey enters a narrow window around the line of sight, and give up the pass after three broken locks.
  • When the predator reaches its target, capture it with probability \(1/(1 + c\,\bar n)\), where \(\bar n\) is the mean number of look-alikes in the window during the approach.
  • Measure the captures per attack for several widths of the zone of attraction \(\Delta r_a\). Is a tight school safer?
TipOptional extension
  • Add an odd prey that cannot lose its lock, and see how the capture probability changes.
  • Measure the captures per unit time against the density of prey, and compare the curve with the Holling functional responses.

A reference version is in amlab/collective_motion/couzin_predator.py, with an animation in couzin_predator_animation.py.

Option D: Faster is slower

Theory: Faster Is Slower: Crowds at a Door and The Social Force Model.

  • Implement pedestrians as discs with the wish-to-move term, the repulsion and the body force of the model. Add walls with one door.
  • Measure the evacuation time and the flow through the door for several desired speeds. Find the speed with the shortest evacuation.
  • Add a column in front of the door and move it. Does the flow change?
TipOptional extension
  • Add sliding friction between bodies, and compare the pressure at the door with and without it.
  • Give only 10% of the people a high desired speed. How many are needed to slow everybody down?

A reference version is in amlab/collective_motion/crowd_exit.py, with an animation in crowd_exit_animation.py.

Option E: Cucker–Smale flocking

Theory: Flocking Without Noise: The Cucker–Smale Model.

  • Integrate the model with scipy.integrate.solve_ivp for \(k = 20\) birds in the plane and reproduce the velocity spread \(\Lambda(t)\) of the figure on that page.
  • Measure the flocking time, the first time at which \(\Lambda < 10^{-6}\), as a function of \(\beta\) and of the size of the starting square.
  • Compute the Fiedler number of the weight matrix at every saved time and compare \(\Lambda(t)\) with the bound \(\Lambda_0 e^{-2t\Phi_t}\).
TipOptional extension
  • Replace the weights \(a_{ij}\) by the Vicsek weights (\(a_{ij} = 1\) if \(\|\mathbf{x}_i - \mathbf{x}_j\| \le r\) and \(0\) otherwise). Does the flock still reach a common velocity from your initial conditions? How does it depend on \(r\)?
  • Add noise to the velocity equation and look at how \(\Lambda\) behaves for small and large noise.

Option F: Squid ink

Theory: Squid Ink: Hiding in a Cloud.

  • Implement the ink field on a periodic grid with the spreading rule of that page: each cell keeps a fraction \(1 - s\) of its ink, gives \(s/4\) to each neighbour, and cells below a threshold are reset to 0. Check that the total amount of ink is conserved when the threshold is 0.
  • Add a squid that flees from the nearest fish and releases a bolus of ink when it still has ink, and a school of fish that pursue it.
  • Multiply the pursuit of every fish by the transmission \(\exp(-\kappa\,\bar c\,d)\) along its line of sight. Measure the probability that the squid is caught within a fixed time, against the opacity \(\kappa\) and against the reload time.
TipOptional extension
  • Give the squid a limited stock of ink and find the best way to spend it.
  • Add a decoy: fish near the ink maximum steer toward it for a few time units. Compare the decoy with the smoke screen alone.
  • Replace the ink by a flow disturbance that the fish sense through its gradient, as described at the end of the theory page.

A reference version is in amlab/collective_motion/squid_ink.py, with an animation in squid_ink_animation.py.

Exit question

NoteExercise

In the Vicsek model you double both \(N\) and \(L^2\), keeping the density and the noise fixed. Which features of the order parameter curve \(v_a(\eta)\) should stay the same, and which should change?

The density \(\rho = N/L^2\) is unchanged, so in the ordered phase \(v_a\) should be about the same. At high noise, \(v_a\) is set by the finite-size floor of order \(1/\sqrt{N}\), which decreases by a factor \(\sqrt{2}\). The transition region should become sharper. This is the pattern in Figure 2(a) of Vicsek et al. (1995).

References

Couzin, Iain D, Jens Krause, Richard James, Graeme D Ruxton, and Nigel R Franks. 2002. “Collective Memory and Spatial Sorting in Animal Groups.” Journal of Theoretical Biology 218 (1): 1–11. https://doi.org/10.1006/jtbi.2002.3065.
Vicsek, Tamás, András Czirók, Eshel Ben-Jacob, Inon Cohen, and Ofer Shochet. 1995. “Novel Type of Phase Transition in a System of Self-Driven Particles.” Physical Review Letters 75 (6): 1226–29. https://doi.org/10.1103/PhysRevLett.75.1226.