GithubHelp home page GithubHelp logo

gboeing / pynamical Goto Github PK

View Code? Open in Web Editor NEW
616.0 32.0 109.0 1.77 MB

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

Home Page: https://geoffboeing.com/publications/nonlinear-chaos-fractals-prediction/

License: MIT License

Python 90.78% Dockerfile 5.65% Shell 3.57%
chaos nonlinear fractal logistic visualization modeling animation math physics python

pynamical's Introduction

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.

pynamical's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pynamical's Issues

Installation

Hello,

A bit new to python and I am trying to install your module: pynamical.

I tried in terminal: pip3 install pynamical... but the module could not be found.

Let me know how to get it installed.

Thanks
Eric

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.