Git Product home page Git Product logo

chaos's Introduction

Chaos

Visualizations connecting chaos theory, fractals, and the logistic map!

Written by Jonny Hyman, 2020

This code was developed for this YouTube video from Veritasium

This is not a library, but rather a collection of standalone scripts! As such, there is a bit of code duplication between scripts.

Quick start guide

Install these requirements

  • Python 3.6+ (tested on Python 3.6 and Python 3.7, macOS Catalina and Windows 10)
  • Numpy package : pip install numpy
  • Numba package : pip install numba

Run guide for total beginners

  1. Open "Terminal" on macOS & Linux, "Powershell" or "Command Prompt" on Windows
  2. Download this repository and unzip it or run git clone https://github.com/jonnyhyman/Chaos.git
  3. Change directory into the folder where you extracted files cd ~/route/to/your/folder
  4. Run the program you're interested in, like python logistic_interactive.py
  5. To make changes to the code, install a text editor like Atom and then open the file you want to edit. If this is your first python project, GO FOR IT, but also it might not be the easiest to get your head wrapped around (I use a lot of nuanced python functionality).

If you run into problems

  1. Google the problem you're running into
  2. If it seems to be a problem with this code, post in "Issues"

Logistic Map - Interactive

python logistic_interactive.py Interactive

Additional Requirements

  • PyQt5 : pip install pyqt5
  • PyQtGraph : pip install pyqtgraph (Python 3.6, 3.7) or pip install pyqtgraph==0.11.0rc0 (Python 3.8)

This visualization creates a cobweb plot, time series graph, and bifurcation plot for visualizing the logistic map. The font pictured is "Avenir Next" which is licensed as part of macOS. Other OSes will see their default font.

Shortcuts:

  • Spacebar: play/pause
  • Backspace: reset view & animation

3D Mandelbrot Set

python logistic_mandelbrot.py Mandelbrot Set within Logistic Map GIF

Here we see the Mandelbrot set on the x-y plane, and iterations of the Mandelbrot set in the z axis. This reveals the bifurcation plot beneath the Mandelbrot set!

Final visualization is accomplished by a volume rendering of 1000x1000x1000 voxels, oversampled by 16 to reduce aliasing.

Additional Requirements


Logistic Map Zoom

python logistic_zoom.py Logistic Map Zoom GIF

  • Vispy : pip install vispy
    • Note: The final version of the visualization used a custom version of Vispy, modified to improve the appearance of axes. I have not released this and don't plan to, but if you really need it please post in Issues a feature request.

chaos's People

Contributors

abhi011999 avatar jonnyhyman avatar thepuzzlemaker avatar

Watchers

 avatar

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.