Pynamical: quick overview

Citation info: Boeing, G. 2016. "Visual Analysis of Nonlinear Dynamical Systems: Chaos, Fractals, Self-Similarity and the Limits of Prediction." Systems, 4 (4), 37. doi:10.3390/systems4040037.

Pynamical documentation: http://pynamical.readthedocs.org

This notebook provides a quick overview of using pynamical.


In [1]:
from pynamical import logistic_map, simulate, bifurcation_plot

Simulate a model and visualize its bifurcation diagram:


In [2]:
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:


In [3]:
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:


In [4]:
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)

In [5]:
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:


In [6]:
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)


Or animate them with pynamical-demo-3d-animation.ipynb:


In [7]:
import IPython.display as IPdisplay
IPdisplay.Image(url='images/phase-animate/05-logistic-3d-phase-diagram-chaotic-regime.gif')


Out[7]:

Or create animated cobweb plots with pynamical-demo-cobweb-plots.ipynb:


In [8]:
IPdisplay.Image(url='images/animated-logistic-cobweb.gif')


Out[8]: