pyflocking

Simulations of flocking behaviour in active agents, using a simple Viscek model

https://github.com/ajinkya-kulkarni/pyflocking

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.4%) to scientific vocabulary

Keywords

active-matter agent-based-modeling animation collective-behavior complex-systems flocking self-organization simulation social-dynamics swarming viscek-model
Last synced: 6 months ago · JSON representation ·

Repository

Simulations of flocking behaviour in active agents, using a simple Viscek model

Basic Info
  • Host: GitHub
  • Owner: ajinkya-kulkarni
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 67.1 MB
Statistics
  • Stars: 4
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 1
Topics
active-matter agent-based-modeling animation collective-behavior complex-systems flocking self-organization simulation social-dynamics swarming viscek-model
Created about 4 years ago · Last pushed about 2 years ago
Metadata Files
Readme License Citation

README.md

License: GPL v3 DOI GitHub commit activity GitHub release (latest by date)

Viscek Model Simulation

Introduction

The Viscek model is a system of N self-propelled particles moving in 2D space. The particles align their velocities with those of their neighbors within a certain radius of influence. The model exhibits collective behavior such as swarming and phase transitions as the density of particles and the radius of influence are varied. This implementation allows the user to simulate the Viscek model [1] and output a .gif animation of the particles' motion over time.

Installation

To run the simulation, you will need to have the following dependencies installed: - numpy - pandas - matplotlib - imageio - tqdm

You can install the latest versions of the dependencies using the following command: pip install numpy pandas matplotlib imageio tqdm

Output

The output of the simulation is a .gif animation of the particles' motion over time. The animation will be saved as animation.gif in the working directory.

Usage

To run the simulation, follow these steps: 1. Adjust the simulation parameters in the parameters.py file. 2. Run the MainProgram.py script. 3. The output animation will be saved as animation.gif in the working directory.

You can adjust the following parameters in the parameters.py file: - N: number of particles - L: size of simulation domain - Pspeed: self-propulsion speed of particles - eta: noise parameter - rad_influence: radius of interaction - Tstart: start time of simulation - Tend: end time of simulation - deltat: time step - bcond: boundary condition ('periodic' or 'reflective')

Example

Run the simulation using this command: python MainProgram.py

Example animation generated by this implementation for high noise (chaotic motion) and low noise (organized motion):

AnimationAnimation

References

  • [1] Vicsek, T., Czirók, A., Ben-Jacob, E., Cohen, I., I., & Shochet, O. (1995). Novel type of phase transition in a system of self-driven particles. Physical Review Letters, 75(6), 1226–1229. doi:10.1103/PhysRevLett.75.1226
  • [2] Kulkarni, A., Thampi, S. P., & Panchagnula, M. V. (2019). Sparse game changers restore collective motion in panicked human crowds. Physical Review Letters, 122(4), 048002. doi:10.1103/PhysRevLett.122.048002

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE Version 3 - see the LICENSE file for details.

Owner

  • Name: Ajinkya Kulkarni
  • Login: ajinkya-kulkarni
  • Kind: user
  • Location: Göttingen
  • Company: Max Planck Institute for Multidisciplinary Sciences

Image Data Scientist @mpi_nat working in Translational Oncology

Citation (CITATION.cff)

cff-version: 1.1.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: Ajinkya
    given-names: Kulkarni
    orcid: https://orcid.org/0000-0003-1423-3676
title: PyFlocking
version: v1.0
date-released: 2023-04-09
doi: 10.5281/zenodo.7811623
url: "https://github.com/ajinkya-kulkarni/PyFlocking"

GitHub Events

Total
  • Fork event: 1
Last Year
  • Fork event: 1