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
- Host: GitHub
- URL: https://github.com/vdesmond/attractors
- Owner: vdesmond
- License: mit
- Created: 2021-06-08T12:35:34.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-26T21:26:02.000Z (about 1 year ago)
- Last Synced: 2025-09-27T06:14:38.523Z (5 months ago)
- Topics: attractor, chaotic-attractors, matplotlib, matplotlib-animation, strange-attractors
- Language: Python
- Homepage: http://attractors.vdesmond.com
- Size: 73.2 MB
- Stars: 22
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
attractors
in chaos, emerges beauty
A package for simulation and visualization of strange attractors.
# 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)