This homework involves writing a program
to construct a bifurcation diagram
for the logistic map.
This program will need to take
several input arguments:
initial condition; a range of r values,
including a step size;
the number of initial iterates;
and a number of transients to discard.
The program should then output a plot
of the logistic map bifurcation diagram
for a range of r.
We'll then check this program
by constructing a bifurcation plot
in the given range
with the given step size.
Throughout the rest of this homework,
you'll not only learn how to explore
this algorithm and its parameters,
but you'll also explore the logistic map
bifurcation diagram in more detail.
Here's such a program
I decided to write in Matlab.
Notice the bifurcation diagram
takes in an initial condition;
an r-min, which is the left range
of the r values;
an r-max, the right end of the r values;
an r-step; an n, which is the number
of iterates per r value;
and l, the number of transients to remove.
Notice that this program
is simply a wrapper
or a for loop
around the logistic map program
that you wrote in unit 1.
For convenience,
that function is given right here.
At each step of the loop,
we simply plot the trajectory
from the point where the transient
is being removed
to the n value against that r value.
With our program developed,
our first test was to generate
a bifurcation diagram
starting at r = 2.4 to r = 4
with a step size of 0.01.
This is precisely the plot you see
on the lower part of your screen.
We then needed to compare this plot
to the plot seen in the homework.
As you can see, if you squint your eyes,
these two figures look fairly similar.
However, near bifurcation points,
for example,
our plot seems to be a lot fuzzier.
This is actually the answer
to the first question.
The reason for this fuzziness
near bifurcation points
is that transients get a lot longer
near bifurcation values.
For example, consider
the time series plot for r = 2.99.
See how long the transient behavior is?
This extended transient behavior causes
the fuzzing in the bifurcation plot.
This is the answer to question b.
If transient really is the cause of
this fuzziness in the bifurcation diagram,
then simply deleting more of the transient
for each r value
should solve this problem.
In this figure, instead of plotting
from x₅ to x₁₀₀₀,
as we did in the first figure,
we plot from x₅₀₀ to x₁₀₀₀.
As you can see, the fuzziness
has been eliminated
This answers question 2c.
Question 3 asks us to generate
a bifurcation diagram
starting at 2.8 to 3.6
This is the bifurcation diagram
shown on the screen.
It then asks, what is the last n-cycle
that is clearly different visibly
from the chaotic region on your plot?
So obviously, the fixed points,
the period 2,
and the period 4 are clearly visible.
However, if we zoom
into this region,
you can see that period 8
is also very visible.
But period 16 is not so visible.
This is actually the answer
to question 3a, n = 8.
For our knowledge
about bifurcation diagrams,
we know in this period doubling cascade
there is a period 16
that lies directly after this period 8.
However, it is not clearly visible
in this plot.
So what algorithmic parameter
could we increase to make it visible?
My decision is the period 16 bifurcation,
as well as the higher-order bifurcations,
exist in between these window slices.
In this case,
if we increase the step size,
which specifies
how many slices our plot has,
we can see these higher-order periods.
To test this hypothesis,
I created a bifurcation diagram
with r-step equal to 10⁻⁵,
and keeping all other parameters the same.
As you can see,
not only are the period 8 visible,
but now the period 16
are also clearly visible.
So, r-step is the answer to question 3b.
As an aside, I would also like to note
that a combination of increasing r-step
as well as zooming in
to different ranges of x values
can aid in seeing small features
of the bifurcation diagram.
For example, this top fork
of the bifurcation diagram
is somewhat squished in this version.
If we not only increase r-step,
as we just did,
but then zoom in to this red region,
we can make this top fork
much more visible.
This top fork, which is somewhat invisible
in the first picture,
is now clearly visible.
Also, notice how similar this picture
looks to a standard bifurcation diagram.
This is the self-similarity
or fractal nature
that we have talked about
throughout this unit.