Skip to content

furmanlukasz/KuramatoFireflys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Kuramoto Fireflies Simulation

This project simulates the synchronization behavior of fireflies using the Kuramoto model, a conceptual framework used to study the synchronization of coupled oscillators. The simulation is implemented in Python using the Pygame library, providing a visual representation of the fireflies' flashing patterns as they interact with each other.

Fireflies

Getting Started

To run the Kuramoto Fireflies simulation, you'll need to have Python installed on your system along with the Pygame library.

Prerequisites

  • Python 3.6 or later
  • Pygame

Installation

First, make sure you have Python installed.

Next, install Pygame using pip:

pip install pygame

Running the Simulation

With Python and Pygame installed, you can run the simulation by executing the script:

python Kuramato_pygame.py

This will open a window displaying the simulation of the fireflies. The fireflies will move around the screen and flash with a certain frequency. Over time, you'll observe them synchronizing their flashing, a phenomenon inspired by the real-world behavior of fireflies.

Simulation Details

  • NUM_FIREFLIES: The number of fireflies in the simulation.
  • FLY_CLOCK_SPEED: The base speed at which a firefly's internal clock progresses.
  • FLY_RADIUS: The radius within which fireflies influence each other's clock speed.
  • FLY_PULL: The strength of the pull fireflies exert on each other to synchronize.
  • FLY_SYNC: A boolean indicating whether fireflies are trying to synchronize.

Firefly Behavior

Each firefly is represented as a point on the screen with its own phase and frequency. The fireflies influence each other within a certain radius (FLY_RADIUS), nudging their neighbors' phases to be closer to their own.

Controls

There are no interactive controls for this simulation; it's purely observational. Watch as the patterns emerge and change over time as the fireflies come into sync and then drift apart again.

License

This project is dedicated to the public domain under the CC0 1.0 Universal license.

Acknowledgements

  • The Kuramoto model and its application to firefly synchronization is a well-studied phenomenon in complex systems and nonlinear dynamics.
  • This simulation is inspired by the collective behavior of fireflies and is meant for educational and entertainment purposes.
  • Inspired by the work of Steven Strogatz and other researchers in the field of synchronization.
  • Implementation inspired by this repository Fireflies by Nicky Case.
  • link to the original Kuramoto model
  • link to interactive and educational simulation Fireflies by Nicky Case.
  • YT video Fireflies by user 'robin meier'.

Feel free to adjust the content to better fit your project's specifics or to add more details if necessary.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages