{ "cells": [ { "cell_type": "markdown", "id": "afa52ed3", "metadata": {}, "source": [ "# Multiscroll chaotic attractor (多卷波混沌吸引子)\n", "\n", "[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/brainpy/examples/blob/main/classical_dynamical_systems/Multiscroll_attractor.ipynb)\n", "[![Open in Kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://github.com/brainpy/examples/blob/main/classical_dynamical_systems/Multiscroll_attractor.ipynb)" ] }, { "cell_type": "markdown", "id": "ea64a825", "metadata": {}, "source": [ "Multiscroll attractors also called n-scroll attractor include the Chen attractor, the Lu Chen attractor, the modified Chen chaotic attractor, PWL Duffing attractor, Rabinovich Fabrikant attractor, modified Chua chaotic attractor, that is, multiple scrolls in a single attractor." ] }, { "cell_type": "code", "execution_count": 1, "id": "93d0212c", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:16.764762400Z", "start_time": "2023-07-22T05:46:15.815834500Z" } }, "outputs": [], "source": [ "import brainpy as bp\n", "import brainpy.math as bm\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 2, "id": "9ebef44c0fcbd7f3", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:16.772117400Z", "start_time": "2023-07-22T05:46:16.756010300Z" }, "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "'2.4.3'" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bp.__version__" ] }, { "cell_type": "code", "execution_count": 3, "id": "49c1255c", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:16.819000400Z", "start_time": "2023-07-22T05:46:16.772117400Z" } }, "outputs": [], "source": [ "def run_and_visualize(runner, duration=100, dim=3, args=None):\n", " assert dim in [3, 2]\n", " if args is None:\n", " runner.run(duration)\n", " else: \n", " runner.run(duration, args=args)\n", "\n", " if dim == 3:\n", " fig = plt.figure()\n", " ax = fig.add_subplot(111, projection='3d')\n", " for i in range(runner.mon.x.shape[1]):\n", " plt.plot(runner.mon.x[100:, i], runner.mon.y[100:, i], runner.mon.z[100:, i])\n", " ax.set_xlabel('x')\n", " ax.set_ylabel('y')\n", " ax.set_zlabel('z')\n", " else:\n", " for i in range(runner.mon.x.shape[1]):\n", " plt.plot(runner.mon.x[100:, i], runner.mon.y[100:, i])\n", " plt.xlabel('x')\n", " plt.xlabel('y')\n", " plt.show()" ] }, { "cell_type": "markdown", "id": "c3575f97", "metadata": {}, "source": [ "## Chen attractor" ] }, { "cell_type": "markdown", "id": "4003b80a", "metadata": {}, "source": [ "The Chen system is defined as follows [1]\n", "\n", "$$\n", "\\begin{aligned}\n", "\\frac{d x(t)}{d t} &=a(y(t)-x(t)) \\\\\n", "\\frac{d y(t)}{d t} &=(c-a) x(t)-x(t) z(t)+c y(t) \\\\\n", "\\frac{d z(t)}{d t} &=x(t) y(t)-b z(t)\n", "\\end{aligned}\n", "$$" ] }, { "cell_type": "code", "execution_count": 4, "id": "26a59d92", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:16.819000400Z", "start_time": "2023-07-22T05:46:16.787877400Z" } }, "outputs": [], "source": [ "@bp.odeint(method='euler')\n", "def chen_system(x, y, z, t, a=40, b=3, c=28):\n", " dx = a * (y - x)\n", " dy = (c - a) * x - x * z + c * y\n", " dz = x * y - b * z\n", " return dx, dy, dz" ] }, { "cell_type": "code", "execution_count": 5, "id": "36fb9b02", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:17.804778300Z", "start_time": "2023-07-22T05:46:16.819000400Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "No GPU/TPU found, falling back to CPU. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "62dda8864c4d4ef4b574a88370ba1bd8", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/100000 [00:00" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "runner = bp.IntegratorRunner(\n", " chen_system,\n", " monitors=['x', 'y', 'z'],\n", " inits=dict(x=-0.1, y=0.5, z=-0.6),\n", " dt=0.001\n", ")\n", "run_and_visualize(runner, 100)" ] }, { "cell_type": "markdown", "id": "1004801e", "metadata": {}, "source": [ "## Lu Chen attractor" ] }, { "cell_type": "markdown", "id": "b3216e0d", "metadata": {}, "source": [ "An extended Chen system with multiscroll was proposed by Jinhu Lu (吕金虎) and Guanrong Chen [2].\n", "\n", "$$\n", "\\begin{aligned}\n", "\\frac{d x(t)}{d t} &=a(y(t)-x(t)) \\\\\n", "\\frac{d y(t)}{d t} &=x(t)-x(t) z(t)+c y(t)+u \\\\\n", "\\frac{d z(t)}{d t} &=x(t) y(t)-b z(t)\n", "\\end{aligned}\n", "$$" ] }, { "cell_type": "markdown", "id": "8450d9b2", "metadata": {}, "source": [ "1. 当 u ≤-11 时,Lṻ Chen 混沌吸引子为左卷波混沌吸引子,\n", "2. 当u 在 -10 和 10 之间 时为麻花型吸引子,\n", "3. 当 u≥ 11 ,是右卷波混沌吸引子。" ] }, { "cell_type": "code", "execution_count": 6, "id": "ee8b5c1d", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:17.835402200Z", "start_time": "2023-07-22T05:46:17.804778300Z" } }, "outputs": [], "source": [ "@bp.odeint(method='rk4')\n", "def lu_chen_system(x, y, z, t, a=36, c=20, b=3, u=-15.15):\n", " dx = a * (y - x)\n", " dy = x - x * z + c * y + u\n", " dz = x * y - b * z\n", " return dx, dy, dz" ] }, { "cell_type": "code", "execution_count": 7, "id": "ef9f6776", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:18.942963600Z", "start_time": "2023-07-22T05:46:17.819729100Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "732bc2a66e234d8386b7645ee4cd50f9", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/50000 [00:00" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "0acdf3af70634cf5969901ec9549ccfe", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/50000 [00:00" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "runner = bp.IntegratorRunner(\n", " lu_chen_system,\n", " monitors=['x', 'y', 'z'],\n", " inits=dict(x=0.1, y=0.3, z=-0.6),\n", " dt=0.002\n", ")\n", "run_and_visualize(runner, 100, args=dict(u=-15.15),)\n", "\n", "runner = bp.IntegratorRunner(\n", " lu_chen_system,\n", " monitors=['x', 'y', 'z'],\n", " inits=dict(x=0.1, y=0.3, z=-0.6),\n", " dt=0.002\n", ")\n", "run_and_visualize(runner, 100, args=dict(u=-8),)" ] }, { "cell_type": "code", "execution_count": 8, "id": "da7f9c07", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:19.442449200Z", "start_time": "2023-07-22T05:46:18.942963600Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "396f7cde2caf47cf890d9bcee7afd8a8", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/50000 [00:00" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "runner = bp.IntegratorRunner(\n", " lu_chen_system,\n", " monitors=['x', 'y', 'z'],\n", " inits=dict(x=0.1, y=0.3, z=-0.6),\n", " dt=0.002\n", ")\n", "run_and_visualize(runner, 100, args=dict(u=11),)" ] }, { "cell_type": "code", "execution_count": 9, "id": "012ae32d", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:19.964372200Z", "start_time": "2023-07-22T05:46:19.442449200Z" }, "lines_to_next_cell": 2 }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "c835da74822345ce876366c066c30559", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/50000 [00:00" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "runner = bp.IntegratorRunner(\n", " lu_chen_system,\n", " monitors=['x', 'y', 'z'],\n", " inits=dict(x=0.1, y=0.3, z=-0.6),\n", " dt=0.002\n", ")\n", "run_and_visualize(runner, 100, args=dict(u=12),)" ] }, { "cell_type": "markdown", "id": "6cb71b2f", "metadata": {}, "source": [ "## Modified Lu Chen attractor" ] }, { "cell_type": "markdown", "id": "20ad63ed", "metadata": { "lines_to_next_cell": 2 }, "source": [ "System equations:\n", "\n", "$$\n", "\\begin{aligned}\n", "\\frac{d x(t)}{d t} &=a(y(t)-x(t)) \\\\\n", "\\frac{d y(t)}{d t} &=(c-a) x(t)-x(t) f+c y(t) \\\\\n", "\\frac{d z(t)}{d t} &=x(t) y(t)-b z(t)\n", "\\end{aligned}\n", "$$\n", "\n", "where\n", "\n", "$$\n", "{ f=d0z(t)+d1z(t-\\tau )-d2\\sin(z(t-\\tau ))}\n", "$$" ] }, { "cell_type": "code", "execution_count": 10, "id": "e481191e", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:19.991325200Z", "start_time": "2023-07-22T05:46:19.956167500Z" } }, "outputs": [], "source": [ "class ModifiedLuChenSystem(bp.Dynamic):\n", " def __init__(self, num, a=35, b=3, c=28, d0=1, d1=1, d2=0., tau=.2, dt=0.1):\n", " super(ModifiedLuChenSystem, self).__init__(num)\n", "\n", " # parameters\n", " self.a = a\n", " self.b = b\n", " self.c = c\n", " self.d0 = d0\n", " self.d1 = d1\n", " self.d2 = d2\n", " self.tau = tau\n", " self.delay_len = int(tau/dt)\n", "\n", " # variables\n", " self.z = bm.Variable(bm.ones(num) * 14)\n", " self.z_delay = bm.LengthDelay(self.z,\n", " delay_len=self.delay_len,\n", " initial_delay_data=14.)\n", " self.x = bm.Variable(bm.ones(num))\n", " self.y = bm.Variable(bm.ones(num))\n", "\n", " # functions\n", " def derivative(x, y, z, t, z_delay):\n", " dx = self.a * (y - x)\n", " f = self.d0 * z + self.d1 * z_delay - self.d2 * bm.sin(z_delay)\n", " dy = (self.c - self.a) * x - x * f + self.c * y\n", " dz = x * y - self.b * z\n", " return dx, dy, dz\n", "\n", " self.integral = bp.odeint(derivative, method='rk4')\n", "\n", " def update(self):\n", " self.x.value, self.y.value, self.z.value = self.integral(\n", " self.x.value, self.y.value, self.z.value, bp.share['t'],\n", " self.z_delay(self.delay_len), bp.share['dt']\n", " )\n", " self.z_delay.update(self.z)" ] }, { "cell_type": "code", "execution_count": 11, "id": "d70bf53b", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:20.575333600Z", "start_time": "2023-07-22T05:46:19.975235900Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "970d73454bee430999101052cd349241", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/50000 [00:00" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "runner = bp.DSRunner(ModifiedLuChenSystem(1, dt=0.001),\n", " monitors=['x', 'y', 'z'],\n", " dt=0.001)\n", "\n", "run_and_visualize(runner, 50)" ] }, { "cell_type": "markdown", "id": "be8ff599", "metadata": {}, "source": [ "## Chua’s system" ] }, { "cell_type": "markdown", "id": "04ae4051", "metadata": {}, "source": [ "The classic Chua’s system is described by the following dimensionless equations [3]\n", "\n", "$$\n", "\\begin{aligned}\n", "&\\dot{x}=\\alpha(y-x)-\\alpha f(x) \\\\\n", "&\\dot{y}=x-y+z \\\\\n", "&\\dot{z}=-\\beta y-\\gamma z\n", "\\end{aligned}\n", "$$\n", "\n", "where $\\alpha$, $\\beta$, and $\\gamma$ are constant parameters and\n", "\n", "$$\n", "f(x)=b x+0.5(a-b)(|x+1|-|x-1|)\n", "$$\n", "\n", "\n", "with $a,b$ being the slopes of the inner and outer segments of $f(x)$. Note that the parameterγis usually ignored; that is, $\\gamma=0$." ] }, { "cell_type": "code", "execution_count": 12, "id": "37dbea77", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:20.607975Z", "start_time": "2023-07-22T05:46:20.576396100Z" } }, "outputs": [], "source": [ "@bp.odeint(method='rk4')\n", "def chua_system(x, y, z, t, alpha=10, beta=14.514, gamma=0, a=-1.197, b=-0.6464):\n", " fx = b * x + 0.5 * (a - b) * (bm.abs(x + 1) - bm.abs(x - 1))\n", " dx = alpha * (y - x) - alpha * fx\n", " dy = x - y + z\n", " dz = -beta * y - gamma * z\n", " return dx, dy, dz" ] }, { "cell_type": "code", "execution_count": 13, "id": "d0db2ff2", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:21.207129200Z", "start_time": "2023-07-22T05:46:20.591177100Z" }, "scrolled": false }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "b4c304a9d4b3459fbe884fbc757fe059", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/50000 [00:00" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "runner = bp.IntegratorRunner(\n", " chua_system,\n", " monitors=['x', 'y', 'z'],\n", " inits=dict(x=0.001, y=0, z=0.),\n", " dt=0.002\n", ")\n", "run_and_visualize(runner, 100)" ] }, { "cell_type": "code", "execution_count": 14, "id": "b63eb721", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:21.741050600Z", "start_time": "2023-07-22T05:46:21.207129200Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "bc20618fa8f843c89b3014d63d0d3ef7", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/50000 [00:00" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "runner = bp.IntegratorRunner(\n", " chua_system,\n", " monitors=['x', 'y', 'z'],\n", " inits=dict(x=9.4287, y=-0.5945, z=-13.4705),\n", " dt=0.002\n", ")\n", "run_and_visualize(runner, 100, args=dict(alpha=8.8, beta=12.0732, gamma=0.0052, a=-0.1768, b=-1.1468),)" ] }, { "cell_type": "code", "execution_count": 15, "id": "2f198a8e", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:22.369104300Z", "start_time": "2023-07-22T05:46:21.741050600Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "ab886d18e3fd428abae3b2138de81add", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/50000 [00:00" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "runner = bp.IntegratorRunner(\n", " chua_system,\n", " monitors=['x', 'y', 'z'],\n", " inits=dict(x=[-6.0489, 6.0489],\n", " y=[0.0839, -0.0839],\n", " z=[8.7739, -8.7739]),\n", " dt=0.002\n", ")\n", "run_and_visualize(runner, 100, args=dict(alpha=8.4562, beta=12.0732, gamma=0.0052, a=-0.1768, b=-1.1468),)" ] }, { "cell_type": "markdown", "id": "bf0124c5", "metadata": {}, "source": [ "## Modified Chua chaotic attractor" ] }, { "cell_type": "markdown", "id": "b95bbc81", "metadata": {}, "source": [ "In 2001, Tang et al. proposed a modified Chua chaotic system:\n", "\n", "$$\n", "\\begin{aligned}\n", "&\\frac{d x(t)}{d t}=\\alpha(y(t)-h) \\\\\n", "&\\frac{d y(t)}{d t}=x(t)-y(t)+z(t) \\\\\n", "&\\frac{d z(t)}{d t}=-\\beta y(t)\n", "\\end{aligned}\n", "$$\n", "\n", "where \n", "\n", "$$\n", "h=-b \\sin \\left(\\frac{\\pi x(t)}{2 a}+d\\right)\n", "$$" ] }, { "cell_type": "code", "execution_count": 16, "id": "f463aa65", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:22.394622300Z", "start_time": "2023-07-22T05:46:22.353214300Z" } }, "outputs": [], "source": [ "@bp.odeint(method='rk4')\n", "def modified_chua_system(x, y, z, t, alpha=10.82, beta=14.286, a=1.3, b=.11, d=0):\n", " dx = alpha * (y + b * bm.sin(bm.pi * x / 2 / a + d))\n", " dy = x - y + z\n", " dz = -beta * y\n", " return dx, dy, dz" ] }, { "cell_type": "code", "execution_count": 17, "id": "0faf1378", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:23.140062400Z", "start_time": "2023-07-22T05:46:22.369104300Z" }, "lines_to_next_cell": 2 }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "26e895eb6d844fbaac654d65b77224e1", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/100000 [00:00" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "runner = bp.IntegratorRunner(\n", " modified_chua_system,\n", " monitors=['x', 'y', 'z'],\n", " inits=dict(x=1, y=1, z=0.),\n", " dt=0.01\n", ")\n", "run_and_visualize(runner, 1000)" ] }, { "cell_type": "markdown", "id": "60bd3287", "metadata": {}, "source": [ "## PWL Duffing chaotic attractor" ] }, { "cell_type": "markdown", "id": "3db482c4", "metadata": { "lines_to_next_cell": 2 }, "source": [ "Aziz Alaoui investigated PWL Duffing equation in 2000:\n", "\n", "$$\n", "\\begin{aligned}\n", "&\\frac{d x(t)}{d t}=y(t) \\\\\n", "&\\frac{d y(t)}{d t}=-m_{1} x(t)-\\left(1 / 2\\left(m_{0}-m_{1}\\right)\\right)(|x(t)+1|-|x(t)-1|)-e y(t)+\\gamma \\cos (\\omega t)\n", "\\end{aligned}\n", "$$" ] }, { "cell_type": "code", "execution_count": 18, "id": "5e2bef06", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:23.155366Z", "start_time": "2023-07-22T05:46:23.140961500Z" } }, "outputs": [], "source": [ "@bp.odeint(method='rk4')\n", "def PWL_duffing_eq(x, y, t, e=0.25, m0=-0.0845, m1=0.66, omega=1, i=-14):\n", " gamma = 0.14 + i / 20\n", " dx = y\n", " dy = -m1 * x - (0.5 * (m0 - m1)) * (abs(x + 1) - abs(x - 1)) - e * y + gamma * bm.cos(omega * t)\n", " return dx, dy" ] }, { "cell_type": "code", "execution_count": 19, "id": "de535dbd", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:23.973061900Z", "start_time": "2023-07-22T05:46:23.155366Z" }, "lines_to_next_cell": 2 }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "cdd2b0d2207840c0bcd6031972d8b0e9", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/100000 [00:00" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "runner = bp.IntegratorRunner(\n", " PWL_duffing_eq,\n", " monitors=['x', 'y'],\n", " inits=dict(x=0, y=0),\n", " dt=0.01\n", ")\n", "run_and_visualize(runner, 1000, dim=2)" ] }, { "cell_type": "markdown", "id": "fca82efa", "metadata": {}, "source": [ "## Modified Lorenz chaotic system" ] }, { "cell_type": "markdown", "id": "0b388c01", "metadata": { "lines_to_next_cell": 2 }, "source": [ "Miranda & Stone proposed a modified Lorenz system:\n", "\n", "$$\n", "\\begin{aligned}\n", "&\\frac{d x(t)}{d t}=1 / 3 *(-(a+1) x(t)+a-c+z(t) y(t))+\\left((1-a)\\left(x(t)^{2}-y(t)^{2}\\right)+(2(a+c-z(t))) x(t) y(t)\\right) \\frac{1}{3 \\sqrt{x(t)^{2}+y(t)^{2}}} \\\\\n", "&\\frac{d y(t)}{d t}=1 / 3((c-a-z(t)) x(t)-(a+1) y(t))+\\left((2(a-1)) x(t) y(t)+(a+c-z(t))\\left(x(t)^{2}-y(t)^{2}\\right)\\right) \\frac{1}{3 \\sqrt{x(t)^{2}+y(t)^{2}}} \\\\\n", "&\\frac{d z(t)}{d t}=1 / 2\\left(3 x(t)^{2} y(t)-y(t)^{3}\\right)-b z(t)\n", "\\end{aligned}\n", "$$\n" ] }, { "cell_type": "code", "execution_count": 20, "id": "981c3fd4", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:23.989349200Z", "start_time": "2023-07-22T05:46:23.973061900Z" } }, "outputs": [], "source": [ "@bp.odeint(method='euler')\n", "def modified_Lorenz(x, y, z, t, a=10, b=8 / 3, c=137 / 5):\n", " temp = 3 * bm.sqrt(x * x + y * y)\n", " dx = (-(a + 1) * x + a - c + z * y) / 3 + ((1 - a) * (x * x - y * y) + (2 * (a + c - z)) * x * y) / temp\n", " dy = ((c - a - z) * x - (a + 1) * y) / 3 + (2 * (a - 1) * x * y + (a + c - z) * (x * x - y * y)) / temp\n", " dz = (3 * x * x * y - y * y * y) / 2 - b * z\n", " return dx, dy, dz" ] }, { "cell_type": "code", "execution_count": 21, "id": "470885b1", "metadata": { "ExecuteTime": { "end_time": "2023-07-22T05:46:24.872638500Z", "start_time": "2023-07-22T05:46:23.989349200Z" }, "scrolled": false }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "ac4f759b191e406f85ce308f88f71ff5", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/100000 [00:00" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "runner = bp.IntegratorRunner(\n", " modified_Lorenz,\n", " monitors=['x', 'y', 'z'],\n", " inits=dict(x=-8, y=4, z=10),\n", " dt=0.001\n", ")\n", "run_and_visualize(runner, 100, dim=3)" ] }, { "cell_type": "markdown", "id": "fc077bc3", "metadata": {}, "source": [ "## References\n", "\n", "- [1] CHEN, GUANRONG; UETA, TETSUSHI (July 1999). \"Yet Another Chaotic Attractor\". International Journal of Bifurcation and Chaos. 09 (7): 1465–1466.\n", "- [2] Chen, Guanrong; Jinhu Lu (2006). \"Generating Multiscroll Chaotic Attractors: Theories, Methods and Applications\" (PDF). International Journal of Bifurcation and Chaos. 16 (4): 775–858. Bibcode:2006IJBC...16..775L. doi:10.1142/s0218127406015179. Retrieved 2012-02-16.\n", "- [3] L. Fortuna, M. Frasca, and M. G. Xibilia, “Chuas circuit implementations: yesterday, today and tomorrow,” World Scientific, 2009." ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "-all", "formats": "ipynb,auto:light", "notebook_metadata_filter": "-all" }, "kernelspec": { "display_name": "brainpy", "language": "python", "name": "brainpy" }, "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.9.12" }, "latex_envs": { "LaTeX_envs_menu_present": true, "autoclose": false, "autocomplete": true, "bibliofile": "biblio.bib", "cite_by": "apalike", "current_citInitial": 1, "eqLabelWithNumbers": true, "eqNumInitial": 1, "hotkeys": { "equation": "Ctrl-E", "itemize": "Ctrl-I" }, "labels_anchors": false, "latex_user_defs": false, "report_style_numbering": false, "user_envs_cfg": false }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 5 }