# The Lorenz Strange Attractor

## Strange Attractors

First, we need to set the stage with the idea of a dynamical system. Instead of a formal definition, I think a few examples will convey the idea best. Think about the movement of a pendulum, a planet and moon orbiting a star in our solar system, or a bouncing ball on your kitchen floor. An attractor for such a system is the behavior, or set of behaviors, the system will approach after a long enough time. In the case of the bouncing balls, the attractor is quite simple -- it is the flat surface of the floor. Attractors don't need to be so simple. Consider for example the orbiting planet. In this case, the attractor might be a complex orbit. Now, a strange attractor is an attractor that is "complicated".

The thing that makes strange attractors so fascinating is that they show the overall patterns of a dynamical system in spite of the fact that the systems described are unbelievably complex. The way a body orbits three or more gravitating bodies is a very good example. Another good example is the strange attractor attributed to Lorenz discussed on this page.

## The Lorenz Strange Attractor

Lorenz was studying weather prediction, and he developed a rather simple model involving a differential equation in three dimensional Euclidean space. He had great difficulty solving this equation numerically because it is very sensitive to its initial conditions. Each time he would solve the system, even with tiny rounding changes in the 6th digit, he would obtain radically different solutions. This sort of sensitivity has come to be part of the definition of chaotic systems. The differential equation he was working with was: or with the following initial condition: while not part of the system proper, a common set of parameters are: The picture below is a plot of this equation projected onto the XY-plane. The equation was solved using a short program implementing a very simple version of Euler's method (Source code in C, perl, or POV-Ray). The solution was then graphed with POV-Ray (Source for the POV-Ray scene is here). For such a simple graph POV-Ray is overkill, but it demonstrates the basic idea of using a ray tracer to obtain nice plots -- like the ones below. Euler's method is the most common numerical ODE algorithm used to solve this equation; however, a more sophisticated solution method is required to obtain high quality plots of the curve. When graphing a curve, the best plots are usually obtained when the sample points used to draw the curve are evenly spaced along the curve. Unfortunately Euler's method generates solution points that are not uniformly spaced along the curve in spite of the fact that the input variable delta is held constant. One option is to modify Euler's method by adaptively changing the input variable delta so that the solution points are never too far apart. The resulting programs (Source code in C, and perl) are a bit more complex -- complex enough that I didn't implement a pure POV-Ray version. We will still connect the dots with cylinders, but the cylinders will be very short -- so the curve will appear to be smooth. The images and movies below were all generated with POV-Ray (Scene source is here, here, and here).

The adaptive Euler's method above sets tight upper bounds on maximum step size so that we may obtain visually appealing graphs of the Lorenz system. This methodology is, in a way, at direct odds with most modern, advanced numerical ODE algorithms that generally use adaptive step control to make the largest steps possible while still controlling error. By observing the sizes of the steps taken by such algorithms, we can learn a bit about the systems -- where they are more and less stable for example. In the image below the solution points produced by a fourth order Runge–Kutta algorithm are visible as blue stripes on the curve. The viewpoint has been changed to more clearly illustrate how tightly packed together the solution points are near the central parts of the spiral.

## Code

This section simply gathers together some of the source code links above along with a few other resoruces that might be helpfull for anyone wishing to create similar images.

makefile
Makefile used for most of the images on this page.
lorenz2.pl lorenz2.pov lorenz2.c
Fixed step size Euler method solver for the Lorenz system
lorenz2.pl lorenz2.c
Adaptive step size Euler method solver for the Lorenz system
lorenz_s1.pov lorenz_s2.pov lorenz_s3.pov lorenz_s4.pov lorenz_s5.pov lorenz_s6.pov
POV-Ray scene files.

## References

For a very interesting introduction to the history of Chaos I would suggest James Glick's book: "CHAOS: Making a New Science" (ISBN: 0-14-009250-1). This book has almost no mathematics or formal material regarding Fractals or dynamical systems, but is well worth the read for the historical perspective.

If you are looking for a good introduction to dynamical systems, I would suggest Steven Storgatz's book: "Nonlinear Dynamics and Chaos" ISBN 0-7382-0453-6).

For a good, encyclopedic, introduction to the field in general, I strongly suggest "Chaos and Fractals: New Frontiers of Science" by Peitgen, Jurgens, and Saupe. This book is notable because of it's clear presentation and breadth of coverage. It's a great book to have around for the casual reader because it is broken up into semi self-contained sections that one can just pick up and read.

© 2009 Mitch Richling