Introduction
One of the most popular and widely known strange attractors is the Rössler strange attractor. We will explore this mathematical object using Python in a series of blog posts. Before we go into any detail about what it is, what is a strange attractor, and so on, let’s first take a quick look at it using some simple Python code.
Simple Integration using Euler’s method
This is a quick intro, and hopefully part of a longer series on using Python to analyze the Rössler Strange Attractor.
We begin by importing the basic libraries that we will use as follows:
|
|
Define Rössler System
Next we define a python function which will define the Rössler equations for us to integrate and graph. The Rössler equestions are
$$ \dot{x} = -y -z $$ $$ \dot{y} = x + ay $$ $$ \dot{z} = b + z(x-c) $$
They function over a number of parameters, something we will explore in more detail in future posts. For now, let’s just pick a pretty common set of parameters:
|
|
Numerical Integration
These equations can’t be solved for non-trivial sets of parameters, so we must integrate them numerically. Here, we use a very simpler Euler’s method of integration to get us out the door. This method is never a good idea to use for non-trivial applications, but is a quick easy way to get started.
Euler’s method makes use of the definition of a derivative:
$$\dot{x} = \frac{dx}{dt} = \lim_{\Delta \rightarrow 0} \frac{\Delta x}{\Delta t} $$
To create a simplistic way to numerical integrate where:
$$ \Delta x = \dot{x} \Delta t $$
This isn’t very accurate over the long term, but with small enough $\Delta t$ can give a fair approximation in the short term. For this simple demo, we choose to let $dt = 0.05 s$ and choose to plot 1000 points for a total of 50 seconds of data.
|
|
Next we set up NUMPY arrays that will hold the 1000 points for each dimension, and then set intitial values (what initial values to use will be explained in more detail in a post where we discuss the parameters as well).
|
|
|
|
Next, we run the Euler’s method integration to populate the arrays:
|
|
Plot
Our final step is to plot the results so that we can see the trajectory
of the Rössler system over these 50 seconds of integration.
|
|