0

I want to create a Bifurcation Diagram with the Logistic Map and I have open questions about the correct algorithm. Here is how I understood it so far:

  • logistic map $x_{i+1} = rx_{i}(1-x_{i})$
  • take a start population, e.g. $x_{0} = 0.5$
  • generate multiple growth rate values evenly distributed between 0.0 and 4.0, e.g. $r = 3.5$
  • define a number of iterations (generations), e.g. $i = 200$
  • for each growth rate $r$ from 0.0 to 4.0, run the logistic map with start value $x_{0}$ for $i$ iterations
  • draw a point for $r$ on the x-axis and $x_{i}$ on the y-axis

Where the confusion sets in: do I need to draw a point for each iteration (values of $x_{1} .. x_{200}$) or just for the final iteration (value of $x_{200}$)?

When I draw all iterated $x_{i}$ values for each growth rate $r$ I get the following diagram: enter image description here

When I draw the last iterated $x_{200}$ value for each growth rate $r$ I get the following diagram:

enter image description here

But what I actually want to get is the following diagram:

enter image description here

Where is my error?

zirkelc
  • 101

1 Answers1

1

Your issue is in the starting value $x_0$ - it takes time for this value to settle into a stable value or become chaotic. Try iterating without drawing the values to about $x_{10}$ to $x_{50}$, then draw all the iterations like in your first image. This should generate the proper map.

Max
  • 167
  • I did that and it looks slightly better. When I search on the Internet, there seem to be multiple variants of the algorithm. There's the option with a fixed starting value $x_{0}=0.5$ and to skip the first N iterations like you suggested. On the other hand, some implementations generate also random values for $x_{0}$ and draw the final iteration of each x and r pair. What is the "correct way"? – zirkelc Oct 19 '21 at 07:12
  • They are functionally the same. However, the latter seems to be faster, although I'm not sure. Try skipping more iterations to see if it matches your desired image. I assume "correct way" is the bifurcation diagram, which shows the attractors for any x. Maybe see https://mathworld.wolfram.com/LogisticMap.html – Max Oct 19 '21 at 14:04