Why a movie?
A picture is worth a thousand words! A movie could do even better. Non-linear dynamics relies on images to understand the organizing features in the complicated solutions that emerge from typically simple non-linear systems. This section is to study the Duffing Oscillator via a poor man movie technique.
Making a movie
The production of a movie requires a word of explanation. The idea is to produce a set of data files and to require Gnuplot to plot these individual data sets in the appropriate sequence to form frames for the movie. The following provides a skeleton structure to start from.
gifsicle abc/*.gif > anim.gif
which will create an animated GIF file.
This example illustrates a Gaussian curve of varying width. The code gaussian.c calculates the Gaussian curve with a width specified on the command line.
The code Lcode.c organizes the calculation of Gaussian curves of various widths and the plotting of the data via gnuplot. It does so by building commands in strings and submitting these command to the operating system via the C function system(command).
The code Lcode.c runs a loop over k (width of the Gaussian). For each k values, Lcode.c instruct the Linux OS to
Duffing Oscillator
Movie of the Duffing Strange Attractor
The Duffing Oscillator strange attractors (one or two well regimes) are generated by a stroboscopic map projection of any single orbit originating from within its basin of attraction. Once past some transient time period the trajectory converges to a neighborhood region of a trajectory which generates the strange attractor by projection.
An interesting aspect of the generation of the strange attractor is that it is generated all at once so to speak. Namely the attractor is built by adding dots to it that fall everywhere on the attractor seemingly at random. The attractor is therefore refined all at once.
This build-up of the strange attractor is best illustrated by a movie.
Exercise I
Modify the code Lcode.c and
gnuplotinput data file from the previous section to make this movie.
Careful - download the files in a new directory not to clobber
the previous files. You will also need the duffing_RK4.c and
stroboscopic.c codes
to produce the movie. Use the two-well chaotic solution, i.e.,
,
,
, and
.
Build the images of the chaotic attractor using 200 dots
to 20,000 dots by increment of 200 dots.
Hint: The time is in unit of
.
Dynamical study
Finding the bifurcation digram of a non-linear model is not easy. The movie tool might help...
Exercise II
The Chaotic Attractor revisited
The stroboscopic projection of the Duffing Oscillator
in the chaotic regime generates an image of the
chaotic attractor. This attractor is produced
via a capture of the position in phase space,
and
, at time values
where
is the period of the
driving term and
an integer.
Projections at times in between full periods produce images of the chaotic attractor that look different but carry the same information about the solution.
Exercise III
Building the Duffing Strange Attractor in a movie
We now want to build the Duffing Strange Attractor in a movie in front of your own eyes. We want to do so by launching 10,000 trajectories from an arbitrary small square with a 100x100 grid of initial conditions, as we did previously in the subsection ``Strange Attractor'' in the two well model, and following strobostically the evolution of each trajectory. This can be done using only BASH scripts and GNUPLOT.
Enjoy the movies!