• Stars
    star
    620
  • Rank 72,387 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created about 10 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Pynamical is a Python package for modeling and visualizing discrete nonlinear dynamical systems, chaos, and fractals.

PyPI Version Anaconda Downloads Documentation Status 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 visualizations and animations to explore system behavior.

Pynamical comes packaged with the logistic map, the Singer map, and the cubic map predefined. The models may be run with a range of parameter values over a set of time steps, and the resulting numerical output is returned as a pandas DataFrame. Pynamical can then visualize this output in various ways, including with bifurcation diagrams, two-dimensional phase diagrams, three-dimensional phase diagrams, and cobweb plots.

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.

Install:

You can install pynamical with conda:

conda config --prepend channels conda-forge
conda create -n pynamical --strict-channel-priority jupyterlab pynamical

Alternatively, you can run pynamical + Jupyter directly from its Docker container, or you can install it with pip.

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 import 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:

Or define your own model and simulate it with pynamical.

More Repositories

1

osmnx

OSMnx is a Python package to easily download, model, analyze, and visualize street networks and other geospatial features from OpenStreetMap.
Python
4,812
star
2

osmnx-examples

Gallery of OSMnx tutorials, usage examples, and feature demonstations.
Jupyter Notebook
1,531
star
3

ppde642

USC urban data science course series with Python and Jupyter
Jupyter Notebook
1,260
star
4

data-visualization

Misc data visualization projects, examples, and demos: mostly Python (pandas + matplotlib) and JavaScript (leaflet).
Jupyter Notebook
736
star
5

cv

Geoff Boeing's academic CV in LaTeX
TeX
301
star
6

2014-summer-travels

Python-based spatial data analysis and visualization of the GPS location data from my 2014 summer travels.
Jupyter Notebook
100
star
7

street-network-models

Street network models and indicators for every urban area in the world
Python
76
star
8

lorenz-system

Model, visualizations, and animation of the Lorenz system
Jupyter Notebook
70
star
9

outlook-to-google-calendar

One-way sync from an outlook calendar to a google calendar, handling new, updated, and deleted events.
Python
64
star
10

ppd534

USC PPD534: Data, Evidence, and Communication for the Public Good
Jupyter Notebook
44
star
11

network-clustering

Jupyter Notebook
30
star
12

ppd430

USC PPD430: Urban Informatics
Jupyter Notebook
24
star
13

asa

Advanced Spatial Analysis of Urban Systems at Northeastern University
Jupyter Notebook
20
star
14

ms-bldg-footprints

Jupyter Notebook
18
star
15

machine-learning-course

11
star
16

dataverse-street-networks

Jupyter Notebook
9
star
17

social-media

Working with various social media APIs in Python and JavaScript.
Jupyter Notebook
9
star
18

travel-time-prediction

Jupyter Notebook
8
star
19

osmnx-notebook-paper

Jupyter Notebook
8
star
20

latex-template

A standard LaTeX template for starting research papers.
TeX
7
star
21

moses-caro

TeX
6
star
22

planetizen-python

Jupyter Notebook
5
star
23

osmnx-paper

The OSMnx reference paper and official citation.
TeX
4
star
24

street-orientations-one-state

viz of street orientations of the 25 largest cities in a state
Jupyter Notebook
3
star
25

tracts-streets-evolution

Jupyter Notebook
3
star
26

representation-paper

TeX
3
star
27

conda-scripts

scripts for configuring conda and updating its base environment
Batchfile
3
star
28

beer-locations

Processing PubQuest craft beer locations annual data sets into one analyzable data set
Jupyter Notebook
3
star
29

street-network-analysis

Jupyter Notebook
3
star
30

bayarea-street-network

Download and process the nine-county Bay Area's street network with OSMnx
Jupyter Notebook
3
star
31

gis-bok-notebooks

GIS BoK chapter on computational notebooks
TeX
3
star
32

dissertation-manuscript

Jupyter Notebook
2
star
33

representation-listings

Jupyter Notebook
2
star
34

multiscale-street-networks-paper

TeX
2
star
35

latin-america-streets

Jupyter Notebook
2
star
36

two-way-conversions

Jupyter Notebook
2
star
37

image-describer

Twitter bot that describes images using Microsoft's computer vision AI
Python
2
star
38

la-free-days

1
star
39

aster-gdem

Download and process ASTER GDEM data
Python
1
star
40

housing-prices-supply

Jupyter Notebook
1
star
41

planar-vs-nonplanar-paper

TeX
1
star
42

planar-vs-nonplanar

Jupyter Notebook
1
star
43

portland-msa-streets

Jupyter Notebook
1
star
44

onesquaremile-threadless

Jupyter Notebook
1
star
45

frontpages

a twitter bot to tweet the front pages of the world's newspapers
Python
1
star