Merge pull request #7596 from takluyver/lorenz-py3

Make Lorenz differential equations example compatible with Python 3
This commit is contained in:
Min RK 2015-01-26 11:33:50 -08:00
commit a5b7af4cc0

View File

@ -111,8 +111,9 @@
" ax.set_ylim((-35, 35))\n",
" ax.set_zlim((5, 55))\n",
" \n",
" def lorenz_deriv((x, y, z), t0, sigma=sigma, beta=beta, rho=rho):\n",
" \"\"\"Compute the time-derivative of a Lorentz system.\"\"\"\n",
" def lorenz_deriv(x_y_z, t0, sigma=sigma, beta=beta, rho=rho):\n",
" \"\"\"Compute the time-derivative of a Lorenz system.\"\"\"\n",
" x, y, z = x_y_z\n",
" return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]\n",
"\n",
" # Choose random starting points, uniformly distributed from -15 to 15\n",
@ -13428,7 +13429,24 @@
]
}
],
"metadata": {},
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.4.2"
}
},
"nbformat": 4,
"nbformat_minor": 0
}