Now You See It, Now You Don't: Ten (or so) Easy Steps to Visualizing Chaos

Laurie Waisel
waisel@cs.cmu.edu

What happens when a macroscopic orderly natural process (such as fluid flow or population growth) starts to break down? There is no line of demarcation, no sharp edge (think how strange it would be if there were). Instead, there is a gradual transition from order to disorder. This transition period is chaos. Contrary to popular belief, the scientific definition of chaos is not complete randomness; rather, it is the interface between order and disorder---sort of a demilitarized zone, neither military nor civilian, but with elements of both.

So exactly what IS it? What does the twilight zone between order and disorder look like? In this paper, we use a simple visualization method to increase the reader's understanding of chaos.

Where did the idea of chaos come from? In his popular 1987 book, Gleick describes the work of biologist Robert May in the 1970's. May was investigating the behavior of simple ecological systems over time. He was especially interested in how system behavior varied with changing population growth parameters. May used bifurcations diagrams to illustrate how ecological systems behaved for certain growth parameters. James Yorke and Tien-Yien Li coined the word "chaos" for this kind of behavior in their seminal 1975 paper, "Period Three Implies Chaos (PDF)."

In this paper, we recreate May's bifurcation diagrams with simple spreadsheet charting. Let's start with a simple model of population growth: x_next = rx(1-x). x is the starting population and r is the population growth parameter. To simulate population growth for any given paramater r , we set the next generation's x equal to this generation's x_next..

Step 1. Create a spreadsheet simulating population growth with this model. Use r = 2 for now, and set the starting population to .02. Plot population on the y-axis and number of generations (or iterations of the simulation) on the x-axis.. You will see that the population quickly reaches a steady state. The yellow squares are the data values, and the blue line is the curve fitted through those values. With a starting population of .02, the population quickly rises to .5 and reaches a steady state.

If we gradually increase the value of r , we will see that the system continues to exhibit the steady-state behavior until r reaches 3, which is why Yorke and Li named their paper "Period Three Implies Chaos."

Step 2. Create a new column in the spreadsheet to simulate the population growth model with r = 3.1. We see from the plot that the population now oscillates between two steady states. Period-doubling is the name for this two-state oscililation.

Step 3. Create another column, this time with r = 3.5. We see that the period-doubling occurs again, and the population now oscillates among four steady states

Steps 4 - 5. Create more columns, with r getting arbitrarily close to 4. The successive period-doublings continue, with the population oscillating among 8 steady states, then 16, then 32, and so on. Eventually, as r approaches 4, the steady states vanish and the population jumps around in complete disorder.

With r = 4, we leave chaos territory and cross over into the much less interesting region of complete disorder. It's there, then it's gone.

Step 6. The purpose of May's bifurcation diagram is to be able to see the successive period doublings that constitute the descent into chaos. The first step in creating a bifurcation diagram is to assemble sequence of period-doubling plots. Turn off the curve-fitting or line-drawing option on the plots you've done so far so that all you can see are the data points. Now, change the data marker to a short horizontal line and compress the x-axis so the data markers run together. You should get a series of plots that look like these. The numbers at the top of these plots show the parameter value, and the y-axis scale has been compressed to make the plotted points run together in a line. The left-most plot, with r = 3.51, shows period 4: we can see four recurring population steady-states. The middle plot, with r = 3.56, shows period 8. In the plot on the right, with r = 3.65, we can see period 8 beginning to turn into period 16. But this is still a series of separate plots. How do we get the bifurcation diagram?

Step 7. One way to get a bifurcation diagram out of a spreadsheet is to stack the data from all parameters into a single column and plot the column, still with population on the y-axis and number of generations on the x-axis. Try using about 150 iterations for each parameter value.

Step 7 1/2. The bifurcation diagram is an interesting visualization, but it might be more useful if we could see exactly where the parameter changes occurred. The parameter values are color-coded in the plot's legend. To create this visualization, put each parameter's data in a different column, but still stacked, to get series data. So, if one column's last iteration occurs in row 200, the next column's first iteration should be in row 201. The data will have a stepped appearance. With this plot, the increasing disorder becomes more apparent. The first few period-doublings appear perfectly smooth; from period 16 on, the steady-state oscillations become increasingly ragged.

Step 8. What are some other ways to visualize bifurcation? One way is to overlay the data, looking at the data for all parameters at once, instead of sequentially. Again, each series shows data for a different parameter value. It's not clear what, if any, advantage this visualization has over the previous one.

Step 9. A radial plot is a striking visualization. The iteration number is shown in angular distance, with population as the radius. The single flattish arc of dark blue at about 1 o'clock represents r = 2. Period 2, at r = 3.1, is in fuschia. Period 4 is yellow, and period doubling continues to progress in a clockwise direction.

Step 10. If you've been doing these plots, you're probably pretty tired by now. Doing bifurcation plots in a spreadsheet is not complicated, but it's tedious and labor-intensive. A more efficient way to get the job done is to use an application like The Mathworks' Matlab. Matlab's visual precision makes it possible to see the period-doublings much more clearly. The vertical lines extending below the body of the visualizations are an artifact of the plotting algorithm.

References

Gleick, J. (1987). Chaos: making a new science. New York: Viking.
Yorke, J., & Li, T.-Y. (1975). Period three implies chaos. American Mathematical Monthly, 82, 985-992.