Create Your Own Active Matter Simulation (With Python)
For today’s recreational coding exercise, we simulate active matter, i.e., swarming. Such a system may describe a flock of birds or a school of fish. We will look at how very simple rules may lead to the emergence of self-ordered motions.
You may find the accompanying Python code on github.
But first, below is a gif of what running our simulation looks like:
Viscek model for flocking behavior
We will describe a famous minimal model for active matter called the Viscek model (1995). Despite its simplicity, the model is able to describe universal properties of swarming behavior.
The model consists of N moving particles, indexed by i=1,…,N. Each particle has an angle Θᵢ representing the direction in which it moves. All particles move with the same speed v₀. Particles will interact with each other within an interaction radius R, which will force them to change their direction (angle).
At each timestep, each particle i has its position rᵢ updated as