Program 7 - Bifurcation Diagram

This program produces the stable part of the bifurcation diagram of a one-parameter family of scalar maps. For illustration purposes we have selected the family F(a,x)=ax(1-x) but the program can be adjusted to other families. The first entry of the program is the starting value of the parameter, and the second entry is its ending value.The third entry represents how many values of the parameter are considered between its starting value and its ending value. The fourth entry is the initial point of the orbit used to check the bifurcation diagram. The fifth entry is the number of iterations discarded and the sixth  is the number of iterations which are plotted.

Program Code

OrbitDiagram[start_, finish_, n_,x0_, init_, final_] := Show[
	Graphics[{PointSize[0.001], 
		Table[
			Map[Point[{r, #}] &, NestList[f, Nest[f, x0, init], final]],
			{r, finish, start, (start - finish)/n}
		]}
	],
	PlotRange->{0,1}, 
	AxesOrigin->{start, 0}, Axes->True
];

Example

f[x_] := r x (1 - x)

q1 = OrbitDiagram[0, 2.8, 150, .3, 20, 4];

Notice that as long as the system has only one stable orbit which is either a fixed point or a periodic orbit of period 2 we should not use a lot of iterations to picture the bifurcation diagram. When the complexity of the stable orbit increases, more values will be needed.

q2 = OrbitDiagram[2.8, 3.6, 200, .3, 300, 100];

q3 = OrbitDiagram[3.6, 4, 100, .3, 300, 300];

Show[q1, q2, q3, 
      
DefaultFont -> {"Times", 12}, 
      
PlotRange -> {{0, 4}, {0, 1}}, 
      
Axes -> Automatic, 
      
AxesLabel -> {"a", "x"}, 
      
AspectRatio -> .5
];

Show[q1, q2, q3, 
 DefaultFont -> {"Times", 12}, 
      
PlotRange -> {{2.8, 4}, {0, 1}}, 
      
AxesOrigin -> {2.8, 0}, 
      
Axes -> True,  
      
AspectRatio -> .5
]