This respository contains the code for the paper: Flocking by stopping -- a mechanism of consensus in collective movement (https://doi.org/10.1103/lnrz-wrf4)
- A Python code (
phaseplane.py) to calculate and plot the phase plane of the ordinary differential equations of the pairwise stop model. The output is a phase plane with axes polarization(m) and average speed(v), in Figure 2 of the manuscript - A Python code (
SDE_Simulation.py) to perform numerical integration of the stochastic differential equation of the pairwise stop model. The output is a time series of the group polarization and average speed, in the Figure 6 & Figure 4 of the manuscript - A Python code (
Gillespie_Simulation.py) to perform numerical simulation of the discrete pairwise stop model. The output is a time series of the group polarization and average speed, in the Figure 6 & Figure 4 of the manuscript - A Python code (
Bifurcation.py) to plot a bifurcation diagram of the ordinary differential equations of the pairwise stop model. The output is a bifurcation plot for group polarization and average group speed, in Figure 3 of the manuscript. - A Python code (
2D_Simulation.py) to simulate the 2D model from the paper and plot the time series and histogram polarization. The output is Figure 5 of the manuscript.