An open API service indexing awesome lists of open source software.

https://github.com/vdesmond/attractors

package for simulation and visualization of strange attractors
https://github.com/vdesmond/attractors

attractor chaotic-attractors matplotlib matplotlib-animation strange-attractors

Last synced: 15 days ago
JSON representation

package for simulation and visualization of strange attractors

Awesome Lists containing this project

README

          



attractors


in chaos, emerges beauty



A package for simulation and visualization of strange attractors.


codecov
Actions status
PyPI - Version
PyPI - Python Version


# Core Features

- A curated collection of 20+ strange attractors including classics and rare gems
- High-performance numerical solving using Numba-accelerated Runge-Kutta solvers
- Stunning visualizations with various themes and color mappings
- Modular design that welcomes extensions and experimentation

Read the full creator's note [here](https://attractors.vdesmond.com/#creators-note)

> [!NOTE]
> The version 2.x of attractors is a complete rewrite and is not backward compatible with the previous versions. Especially the API has been completely revamped, and the CLI support has been removed (though it might be added back in the future). If you are looking for the older version, you can find it in the [v1-legacy branch](https://github.com/vdesmond/attractors/tree/v1-legacy) and its related [documentation](https://attractors.rtfd.io/)

# Setup

For end user, it is just a pip installation

```bash
pip install attractors
```

Note that attractors depends on numba, so the system must be able to compile it. If any issues arise, look at [numba installation docs](https://numba.readthedocs.io/en/stable/user/installing.html).

# Basic Usage

In **v2.x** of attractors, registries are introduced to facilitate easier creation and usage of existing as well as new, custom systems solvers and themes. The following simple script demonstrates that well:

```python
from attractors import SystemRegistry, SolverRegistry, integrate_system
import matplotlib.pyplot as plt
from attractors.visualizers import StaticPlotter
from attractors.themes import ThemeManager

# Get system and solver from registry
system = SystemRegistry.get("lorenz") # Using default parameters
solver = SolverRegistry.get("rk4") # 4th order Runge-Kutta

# Generate trajectory
trajectory, time = integrate_system(system, solver, steps=10000, dt=0.01)

# Create visualization
theme = ThemeManager.get("nord") # Using Nord color theme
plotter = StaticPlotter(system, theme)
plotter.visualize(trajectory)
plt.show()
```

Check out some [examples](examples/) for more inspiration. The [banner.py](examples/banner.py) for example was the code used to generate the README banner!

For a deeper dive into the package's capabilities, explore the complete [documentation](https://attractors.vdesmond.com/).

# License

In spirit of open source code - [MIT License](LICENSE)