Professional Documents
Culture Documents
Lab 4 - Chaos in Discrete Logistic Equation
Lab 4 - Chaos in Discrete Logistic Equation
Lab 4 - Chaos in Discrete Logistic Equation
1
Exercise 3. Iterate the discrete logistic 20 times for r = 3.9 and an initial
state of X = 0.4. Plot the time series. (You’ll probably want to use the option
plotjoined=True). Then, do the same thing using 0.401 for the initial state.
Overlay the plots and observe the relationship between the time series.
Exercise 4. Do the same thing for at least three more pairs of initial conditions,
using values of r between 3.7 and 4.0. What can you say about the relationship
between pairs of time series?
Exercise 5. Using a for loop, compute the absolute value of the difference
between the first 8 pairs of corresponding values for the simulation you ran in
Exercise 3. Plot the results and briefly describe what you see.
Order in chaos
We have now seen the unpredictability that gives chaotic behavior its name.
However, chaos is not randomness. If we look at chaotic data the right way, we
can see the order behind the unpredictability.
Exercise 6. Using the data you generated in Exercise 3 with an initial value of
0.4, plot Xt+1 against Xt . Briefly describe the resulting plot. HINT: What are
the indices of the entries that should go on the horizontal axis? On the vertical
axis?
Exercise 7. Plot f (X) = 3.9X(1 − X) for 0 ≤ X ≤ 1 and overlay this plot on
top of the one you made in the previous exercise. What do you observe? Why
does this result make sense?
2
x
1
0.8
0.6
0.4
0.2
0 r
2 2.5 3 3.5 4
indexing to get part of a list. For example, to show a list starting with item 20,
use listname[20:].
Exercise 8. For r = 3.5, iterate the logistic equation 250 times and make a
list of the results. Then, make a new list that excludes the first 100 values of
X. Using the new list, make a list of points (2-element lists) of the form (r, X).
(HINT: What function do you know that can do this?) Print the list. How
many different values of X do you see?
Exercise 9. In the previous exercise, why did we throw away the first 100
values?
3
Exercise 10. Recreate Figure 1. Your program will need to run the code you
developed in Exercise 8 for values of r ranging from 2.0 to 4.0 in steps of 0.01.
(Skip the printing step.) All (r, X) points should placed in a single master list,
which you can do by adding the lists. (You can literally use + to join lists end
to end.) Once the list is made, plot it. You may want to use the option size=1
to make the plot look nicer.
Exercise 11. Use your plot or Figure 1 to approximate the values of r that
produce chaotic behavior.
Exercise 12. Describe what this plot tells you about how the behavior of the
discrete logistic model changes as r increases. Compare your observations here
with your results from #1.