{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\nThe bifurcation diagram\n==========================\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "Link to the logistic map\n-----------------------------\nIt is very easy to build the bifurcation diagram of the logistic map. You only need to iterate the logistic map long enough for a value\nof $r$ ($x_{n+1}=rx_n(1-x_n)$) and then plot the last point. The goal of iterating the sequence a lot of time is to see where\nthe points are attracted to.\nIf you only need the values of the bifurcation diagram and not the actual plot, only pass the value False to the argument show.\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import chaoseverywhere as chaos\n\nchaos.bifurcation(show=True)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "An animated visualization\n-------------------------------\nThe bifurcation diagram surprinsgly has a link to the Mandelbrot set. Indeed, there is a bijection between the growth ratio $r$ and\nvalue (real part) of $c$ in the Mandelbrot formula.\n\n\n.. raw:: html\n\n    <iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/xYQbqML1eE4\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\n\n\nAnother way to look at it is: if we plot the real part of the iterates of the points\nin the Mandelbrot set, then we get the bifurcation diagram.\n\n"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.7.3"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}