Skip to main content

Belousov-Zhabotinsky

About

The python package you never knew you needed! Now you can appreciate all the glory of the Belousov-Zhabotinsky reaction from the comfort of your console window in a state of the art ASCII art rendering. Your life will never be the same!

This a little python script I made for a class sometime ago. You can play around with the equations coefficients and rendering parameters with command line arguments (see usage). Besides the BZ equation there's also the FitzHugh-Nagumo (for Turing patterns), Gray-Scoot and Cahn-Hilard (simulates phase separation) equations.

Theory

The Belousov-Zhabotinsky reaction is the classical examples of non-linear/oscillatory dynamics in chemical systems. The equations that describe the process are reaction-diffusion equations:

BZ Equations:

Numerally you iterate the equations in a 2D grid. The Laplace operator in a discrete grid is simply a convolution.

You can learn more about the Belousov-Zhabotinsky reaction here:

  • Dynamics and Chaos - Steven H. Strogatz

  • Chaotic Dynamics, an introduction - G. L. Baker and J. P. Gollub

Inspired by the following blog posts:

scipy blog

degenerate state

Installation

Should work in any python3 version

Needs numpy and scipy

See piplock file

You can pip install the python module with the following command

pip install --user belousov-zhabotinsky

Usage

$ belousov-zhabotinsky

or

$ python -m belousov-zhabotinsky

Check cli options with:

$ belousov-zhabotinsky --help

You can exit the program by pressing any key

  • Gray-Scott mode requires a terminal size bigger than 100x100 to work properly
  • There's a plot.py script thay can be use to plot the system in matplotlib.

$ python -m belousov-zhabotinsky.plot

Future

  • Fix Gray-Scott
  • Make it faster

My First GitHub project; HOORAY!

Metadata

Release files for belousov-zhabotinsky 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for belousov-zhabotinsky 0.7.0
File Size Uploaded Provenance Actions
belousov-zhabotinsky-0.7.0.tar.gz 6.2 kB Without provenance Details for belousov-zhabotinsky-0.7.0.tar.gz

Release files / belousov-zhabotinsky-0.7.0.tar.gz

Download URL belousov-zhabotinsky-0.7.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
477fb7af336fd91fabaf228defb54427558bd808a230f6f9106ce9c9bde298c1
BLAKE2b-256 checksum
How to use checksums
da7ed8e28e00f23e1e7081e86dd097675fe70c756b25af1ebc0c16ee01adc535
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Security for belousov-zhabotinsky 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page