Python TeX
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs update docs May 15, 2018
examples update examples May 15, 2018
paper update paper May 15, 2018
pynamical version bump May 15, 2018
tests increase coverage Dec 23, 2016
.gitignore update gitignore May 15, 2018
.travis.yml travis pip install coveralls Mar 2, 2017
CHANGELOG.md version bump May 15, 2018
LICENSE.txt updates May 15, 2018
MANIFEST.in version bump and changelog Mar 2, 2017
README.md update readme May 15, 2018
setup.py updates May 15, 2018

README.md

PyPI version Anaconda-Server Badge Build Status Coverage Status

pynamical

Python package for modeling, simulating, visualizing, and animating discrete nonlinear dynamical systems and chaos

pynamical uses pandas, numpy, and numba for fast simulation, and matplotlib for beautiful visualizations and animations to explore system behavior. Compatible with Python 2+3.

Install:

You can install pynamical with conda:

conda install -c conda-forge pynamical

Or with pip:

pip install pynamical

Documentation:

Available on readthedocs.

Demos/tutorial:

  1. Pynamical: quick overview
  2. Pynamical: the logistic model and bifurcation diagrams
  3. Pynamical: 2D and 3D phase diagrams
  4. Pynamical: static and animated cobweb plots
  5. Pynamical: animated 3D phase diagrams
  6. Pynamical: demonstrating other models

Quick walkthrough:

First load pynamical. Then simulate some model and visualize its bifurcation diagram in just 2 lines of code:

from pynamical import logistic_map, simulate, bifurcation_plot
pops = simulate(model=logistic_map, num_gens=100, rate_min=0, rate_max=4, num_rates=1000, num_discard=100)
bifurcation_plot(pops)

Zoom into a slice of this bifurcation diagram to see its fractal structure:

pops = simulate(model=logistic_map, num_gens=100, rate_min=3.7, rate_max=3.9, num_rates=1000, num_discard=100)
bifurcation_plot(pops, xmin=3.7, xmax=3.9)

Plot a two-dimensional phase diagram of the logistic map:

from pynamical import phase_diagram
pops = simulate(model=logistic_map, num_gens=4000, rate_min=3.6, rate_max=4.0, num_rates=50, num_discard=100)
phase_diagram(pops, xmin=0.25, xmax=0.75, ymin=0.8, ymax=1.01, size=7, color='viridis')

Or a three-dimensional phase diagram of the cubic map:

from pynamical import cubic_map, phase_diagram_3d
pops = simulate(model=cubic_map, num_gens=3000, rate_min=3.5, num_rates=30, num_discard=100)
phase_diagram_3d(pops, xmin=-1, xmax=1, ymin=-1, ymax=1, zmin=-1, zmax=1, alpha=0.2, color='viridis', azim=330)

Animate the 3D phase diagram of the logistic map to reveal the strange attractor's structure:

Animate a cobweb plot of the logistic map's parameter space to explore sensitivity and behavior: