# Identifying Strange Attractors

Articles —> Identifying Strange Attractors

An attractor can be defined as a system of equations whose behavior evolves over time. One of the more famous attractors is the Lorenz Attractor, a system of differential equations whose behavior, when visualized in two or three dimensions - resembles that of a butterfly.

The Lorenz attractor is perhaps the most studied attractor, however there are other attractors of note, for instance the Aizawa and DeJong Attractors. In all likelihood however, an infinite number of attractors exist.

An attractor can be mathematically defined as:

x_{n} = x_{n-1} + t * f_{x}(x_{n-1}, y_{n-1}, z_{n-1})

y_{n} = y_{n-1} + t * f_{y}(x_{n-1}, y_{n-1}, z_{n-1})

z_{n} = z_{n-1} + t * f_{z}(x_{n-1}, y_{n-1}, z_{n-1})

Where t is time and the f is a function dependent upon - in this context - 3-dimension values (any number of dimensions can be represented, but this article focuses on 3-dimensions for visualization reasons).

In an effort to discover new, aesthetically pleasing attractor systems, I constructed an algorithm to generate random sets of equations for use in the above system of equations. The algorithm treats each equation as a syntax tree - each node of the tree is one of three types of nodes:

**Constant Node**: This node is simply a constant floating point numeric value. This node has no children.**Input Node**: This node represents a value from the previous calculations. This node has no children.**Function Node**: This node represents a mathematical function, be it multiplication, addition, subtraction, sin, cos, etc...Function nodes have one or two child nodes, depending upon the functional parameters. For instance, addition works on two values and thus has two children, whereas cosine works on a single value and thus has one child node.

The value of the equation can be calculated by recursive traversal of the tree: for each node determining the value of its child node, and passing this value to its parent. An example of an equation tree is depicted below:

The dx equation of the Lorenz system represented as a binary tree.

Constructing a tree from the random selection of the nodes results in a random equation. Of course, randomly generating equations can result in all sorts of behavior, from the function returning a constant, to alternation between values, to function which converge to a value (including infinite and 0). To better focus the attention of the algorithm on attractors, several rules were implemented. First, a function cannot cannot produce a constant. Second, a function cannot produce non-mathematically defined values, for instance NaN or infinite. Third, the system does not converge over a reasonable time. Lastly, the values created over a reasonable period of time are contained within a reasonable bounds - for instance in the 3-dimensional systems constructed here values are contained within a cube centered at 0 and a width of 20.

The above algorithm was implemented in java* and visualized using two and three dimensional rendering in Swing. The generated systems of equations typically result in a wide array of behaviors, many of which lack one of my requirement as being aesthetically pleasing. Occasionally however, a system of equations is discovered that produces incredible behavior. Below I list several systems of equations discovered with this approach.

**Spring**: This attractor is defined by the following equations:f

_{x}= cos(y)f

_{y}= 0.56 + x - zf

_{z}= 0.13 * (y-z)**Windmill**: This attractor is defined by the following equations:f

_{x}= sin(cos(y))f

_{y}= sin(sin(cos(0.96)) / x)f

_{z}= sin(y-z)**Vortex**: This attractor is defined by the following equations:f

_{x}= (z-0.86) * z / 0.96f

_{y}= z * (y+x)f

_{z}= (0.3069 - y)*(0.35-x)

Systems were also generated in which each new value is dependent upon the function alone, and were found to more frequently generate aesthetic behavior relative to the method above. Mathematically:

x_{n} = f_{x}(x_{n-1}, y_{n-1}, z_{n-1})

**Embryo**: This system is defined by the following equations:f

_{x}= z*y / 0.92f

_{y}= y - x + 0.32f

_{z}= 0.69 + y

More rules can be applied to the generation algorithm which can increase the frequency of discovering an interesting system of equations. In addition, a similar method can be used to generate colors for each point, resulting in coloration schemes rather than the single color images seen above.

*Java source code available upon request

There are no comments on this article.