[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Having Fun With a Chaotic Equation



PureBytes Links

Trading Reference Links

Having Fun With a Chaotic Equation:
Using a Spreadsheet Program to Plot the Logistic Equation
Gay S. Coleman
Ph.D. Student at Clemson University


Much of the math of chaos theory is difficult for many social scientists to
master, but some of it is well within the grasp of even to mathematically
impaired. Spreadsheet programs can be used for developing an understanding
of this math and for experimentation with chaos. A easy equation with which
to begin your chaotic adventure is the simple population growth equation
 more formally called the logistic difference equation):


X(new) = r X(old) ( 1 - X(old) )

In this equation, X(new) refers to the estimate of a population's size based
upon "r," or population growth rate, and X(old), the current population size
for X . To make the calculation easy let's make X(old) = .1 ( population
size must be a fractional amount) throughout our experiment, and allow "r"
to assume various values, from those that lead to stable populations (r = 1,
for example), to those that cause a population to bifurcate (or jumps back
and forth between two number, such as r = 3.2), to values that cause
population size to fluctuate chaotically (r = 3.57 thru 4).

To experiment with this equation, one starts with initial values for X(old)
and for r, and solves for X(new). This solution is then inserted into the
equation as X(old) and a new X(new) is calculated (r does not change). This
process is repeated until one of three pattern is observed in X(new): it
settles to a constant value (equilibrium); it fluctuates between two (or
four, or eight, etc.) values (bifurcation}; or it refuses to settle at all
(chaos).

Here's how to set up an EXCEL (version 5) spreadsheet on the Mac to plot the
logistic equation--appropriate adjustments can be made in other spreadsheet
programs. The information within quotes should be typed into the spreadsheet
as indicated.

1. In Column A, line 1, you may want to write the title of the program.
2. In Column A, line 2, you may want to write a description of the outcome.
3. In Column A, line 3, type "r ="
4. In Column B, line 3, type "3.2" [this value can be changed for
experimentation]
5. In Column C, line 3, type "initial X="
6. In Column D, line 3, type ".1" [any fractional value can be used]
7. In Column C, line 4, type "X(new)"
8. In Column C, line 5, type " = $B$3*D3*(1 - D3)"; don't leave out the
equal sign
9. In Column C, line 6, type " = $B$3*C5*(1 - C5)"

Now you are ready to iterate (copy) the equation for use in graphing.
1. Click and hold on Column C, line 6 entry entry and drag down 100 or 200
cells. [cells should appear solid black.]
2. Release the mouse button, press and hold the open apple key, and press
'd;' appropriate numbers should appear in the cells.
3. Click on any cell to return to normal color background.

HERE'S THE FUN PART !
Now you want to see what your data looks like. Follow these directions:
1. Click on cell C5 and drag down to darken some or all cells that contain
calculated values of X (column C only; experiment to determine how many
cells give the best graph).
2. Go to the Insert pull down menu and select Chart, then select "On this
page." [Some earlier versions of EXCEL may not have this selection --
consult your manual on creating line graphs]
3. Go to a clear place on your spreadsheet, hold clicker on the mouse and
drag a box for the graph.
4. The Chart Wizard window will appear, click on "Next".
5. The graph types will appear; any of these choices will do, but number 2,
a simple line graph, might be the most satisfactory.
6. Click "Finish" and the wizard will draw the graph. You might need to
enlargen your graph some to get a good perspective.

This (with r = 3.2) gives a graph of a bifurcation in which the graph splits
into two lines. To see an additional bifurcation use r = 3.4. Now try
changing your "r" value for other outcomes. See the first paragraph for some
suggested values of r. See what happens to some of the graphs when you
extend "r" by adding a "1" in the next decimal position or by adding very
small increments, such as 0.0001". The more you play with this equation, the
more you'll understand the properties associated with an equation that goes
chaotic.