This program, built using the Qt UI framework, simulates the 2D Vicsek model on an infinite plane using an additional inward force on the convex hull. To run it, you will need Qt. After opening the .pro file in the Qt editor, simply compile, play with the options and run the model! Features of this program include:
- Configurable density, speed and noise level parameters
- Configurable noise type (scalar vs vectorial)
- Various graphical aids such as choosing what to render and how often, tracking individual boids over many timesteps
- Implementing leadership
- Generation of various observables
- Plotting of said observables
- FFT of observables
- Saving of observables, system configurations
- Programming multiple runs of the models using various parameters for untouched simulation
This program simulates the collective 2D motion of agents using the Vicsek model for the purposes of analysing its qualitative and quantitative behaviour. It is composed of
In the original model, an observable
Later on, another mechanism for adding noise was implemented, which was able to probe this behaviour for much smaller systems. This noise, to contrast it with the scalar form of the original model, was called vectorial noise, and it was added to the neighbour average as a random unit vector, multiplied with the number of neighbours:
The fact that collective motion can occur at all, was a surprising result. A seeming violation of the Mermin-Wagner theorem, the explanation eventually provided by Toner and Tu was that the system is not in equilibrium from the start, and that the constant speed provides an asymmetry in the propagation of errors with respect to the motion of the flock. Toner has been giving a great talk on the subject for a while now, titled "Fish gotta swim, birds gotta fly, I gotta do Feynman graphs til I die!" which I can recommend if a deeper analysis involving hydrodynamics is something you fancy. There are recordings out there.
The novel alteration this version of the model is to move the Boids onto an infinite plane. While the original model used periodic boundary conditions, this variant provides an infinite surface of movement. Due to noise, the unmodified model would eventually turn to a gaseous, noninteracting state. To provide cohesion, a subset of Boids, those forming the convex hull, are provided an inward nudge. The exact form of this inward nudge can be chosen from 4 options ("force recipes"):
- Local curvature analogous to surface tension
- Near-neighbour to simulate the tendency to stay near neighbours on the hull
- Far-neighbour to simulate the tendency to keep hull density uniform locally
- Flock mean to simulate the tendency to follow the entire flock Each force recipe gives unique results in terms of the shape of the hull, so I encourage you to play around with it.
I created this program for my MSc Theoretical Physics thesis in 2016-2017 and only recently decided to add this readme to the repo. It is no longer actively being worked on, but I have played around with it recently (September 2022) using up-to-date Qt and C++ on Windows. A modified version of this program, returning it to a periodic-boundary model, is still in use by my supervisor for a course in Statistical Physics. I may publish it in a separate repo. From what I recall, there are some differences between compiling for Linux and Windows, specifically for enabling OpenMP to parallelize some functionality. In the past, I used both OS' to run the program, but your mileage may vary at this stage. It should only be a matter of editing the .pro file, but no guarantees. If not, try removing the OpenMP pragmas surrounding the interaction and movement loops in BoidSim2D.cpp. I still check Github every now and then so if anything fails, try and reach out :)
You're free to edit and reuse as you see fit, though I would love a mention if it ever turns into something worthwhile, like a publication!