Computational Physics Lab 3
Chaotic Dynamic Systems
The
goal of this lab is to explore the behavior of two dynamic systems
known to be chaotic at certain parameter settings: the logistic map and
the driven physical pendulum with dissipation. You
should
familiarize yourself with sections 3.1 through 3.5 in Giordano and
Nakanishi before starting your work.
Part 1. The Logistic Map
The
logistic map is a very simple nonlinear system with only one parameter.
Nevertheless, it can exhibit rich chaotic behavior. The goal of this
part of the lab is to explore logistic map properties.
1)
Write code which produces the logistic map sequence. Plot the
value of xn
vs. n for
mu values of
0.5 -- population goes extinct (and any other mu < 1)
2.8 -- period-one cycle
3.3 -- period-two cycle
3.5 -- period-four cycle
3.8 -- chaotic
3.828427 -- period-three "window" in a chaotic regime
2) Build the
bifurcation diagram for the system. To build this diagram, you can do
the following:
- Break up the range 1 <= mu <= 4 into 1000
steps and loop through them.
- In order not to miss any structures in your bifurcation
diagram, loop over initial x0 values as well.
Useful x0 values are between 0 and 1 (but
excluding 0 and 1).
- Wait for at least 200 generations for the transients to die
out, and then print out next several hundred values of (mu, xn) into a file.
Print xn with
three decimal places only. A simple way to do this is to print
0.001*int(xn*1000).
- Eliminate duplicate pairs of (mu, xn) from your file.
You can use "sort -u" UNIX command for this purpose.
- Use the program from homework 1 to make a scatter plot of
the remaining points. Use very small size points.
- Enlarge
sections of your plot and notice that a similar bifurcation diagram
tends to be contained within each magnified portion (this is called self-similarity).
Part 2. Driven Physical Pendulum with Dissipation
The
driven physical pendulum with dissipation is a significantly more
complicated system than the logistic map. It has four parameters:
Natural oscillation frequency (determined for small oscillation
amplitudes and without dissipation)
Amplitude of the driving force
Frequency of the driving force
The dissipation coefficient
Please download the following files:
cpode.py
-- ODE solver class.
physical_pendulum.py
-- Generalized force model for the pendulum.
pendulum_simulation.py
-- Code which illustrates plotting of the phase space diagrams, etc.
You will also need modules cpforces.py
and v3.py
from previous classes.
Make
the "pendulum_simulation.py" file executable and run it. Change the F_D
parameter to the following values: 0.5, 1.2, 1.35, 1.44, 1.5. For which
values of F_D the system exhibits chaotic behavior?
Build
the bifurcation diagram for F_D values between 0.5 and 2.5. Note that
this diagram should include pendulum angle values in phase
with the driving force: that is, at times separated by the driving
force period (for more details see section 3.4 in G&N). Use the
"interpolate" function of the ODE solver class to obtain the angle
values at these exact times. Convert these values to the standard range
between −π and π using the "standard_angle" function.
Buliding
this bifurcation diagram will be a time-consuming process: if, let say,
you skip 200
initial periods and then run for 200 more periods while using 100
different starting points for the initial angle, processing a single
value of F_D can take several minutes -- Python is rather slow for this
kind of heavy number crunching. Because of this, you should plan your
calculations carefully: check that your code works fine with just a few
F_D points, estimate the time needed per point, pick the number of F_D
points so that your calculation will be finished in a day or so, and
then run with the full set of points in such a way that your program
continues running when you log out (so that you can visualize the
results later). The latter can be achieved with the help
of UNIX
"nohup" command. If, let say, your script name is
"my_bifurcation_diagram.py" and you made it executable, you can run it
unattended as follows:
nohup
./my_bifurcation_diagram.py >&
my_bifurcation_diagram.out &
In
this case both the standard output and the standard error printouts
from your scripts will be redirected into the file named
"my_bifurcation_diagram.out".
Submit your lab report by email before
2 pm 02/05/2008. In your report, include just the
bifurcation diagrams from the two parts of the lab and your conclusions
-- e.g.,
about interesting parameter values (when the period doubling starts,
when the system transitions into chaotic regime, etc.). Do not
include the code.