Logistic map (source code)

= Logistic map
{title2=$F_r(x)=rx(1-x),\quad0\leq r\leq4$}
{wiki}

The logistic map repeatedly applies a <quadratic function>:
$$
x_{n+1}=F_r(x_n)=rx_n(1-x_n),\qquad x_0\in[0,1],\qquad0\leq r\leq4.
$$
The <closed interval> $[0,1]$ is a <positively invariant set>: $0\leq F_r(x)\leq r/4\leq1$. An <orbit> is the entire resulting <sequence> $x_0,x_1,x_2,\ldots$, not just one application of the formula. For example, with $r=2$ and $x_0=0.2$, the first states are $0.2,0.32,0.4352,0.49160192,\ldots$, approaching the <fixed point> $1/2$.

As a simple model of <population dynamics>, $x_n$ is a scaled abundance in generation $n$. When abundance is small, $x_{n+1}/x_n=r(1-x_n)$ is close to $r$; increasing abundance reduces this per-capita multiplier. The falling side of the <quadratic function> represents sufficiently severe crowding reducing the next generation. The scale $x=1$ is not generally the <carrying capacity>: the positive <fixed point> is $1-1/r$. The <logistic map> is a discrete-generation model; the continuous-time <logistic growth equation> has a different evolution rule and does not produce its <period-doubling cascade>.

The practical question is how abundance behaves after the initial adjustment: does it settle, alternate, or continue varying? The same formula permits all these possibilities. The following figure shows three <orbits>, their <cobweb plots>, and a <bifurcation diagram>. In a <cobweb plot>, moving vertically to $y=F_r(x)$ calculates the next state, and moving horizontally to $y=x$ makes that value the input for the next step.

\Image[/logistic-map-dynamics.png]
{title=Logistic-map orbits, cobweb plots, and bifurcation diagram}
{description=All three upper examples start at $x_0=0.2$. At $r=2.8$, the <orbit> approaches a <fixed point>; at $r=3.2$ and $r=3.5$, it approaches <periodic orbits> of periods two and four. Filled red marks in the <cobweb plots> indicate an attracting <fixed point>, while hollow red marks indicate a repelling one. The lower <bifurcation diagram> retains 240 <orbit> states per parameter after discarding 2000 initial steps. Each column samples one <orbit>, rather than all possible <orbits>; the highlighted period-three window shows why larger parameters need not mean sensitive attracting motion.}

The <fixed points> solve $F_r(x)=x$:
$$
x=0,\qquad x_*=1-\frac1r\quad(r>0).
$$
The second <fixed point> is in $[0,1]$ for $r\geq1$ and coincides with zero at $r=1$. The <derivative> is $F_r'(x)=r(1-2x)$, so the <fixed-point multipliers> are $r$ at zero and $2-r$ at $x_*$. The <fixed point stability for an iteration> test gives an attracting zero for $0\leq r<1$, and a <locally asymptotically stable> positive <fixed point> for $1<r<3$. A multiplier of modulus one needs a nonlinear argument; the strict <derivative> test alone settles neither $r=1$ nor $r=3$.

This <derivative> test has a direct interpretation. A small error $e_n=x_n-x_*$ obeys
$$
e_{n+1}=(2-r)e_n-re_n^2.
$$
At $r=2.8$, the leading multiplier is $-0.8$: the error changes sign, explaining the alternating approach, while its magnitude eventually shrinks by approximately a factor $0.8$ per step. At $r=3.2$, the multiplier is $-1.2$, and the positive <fixed point> repels nearby states. However, a different outcome has <asymptotic stability>: the <logistic map two-cycle> attracts nearby <orbits>.

For $3<r<1+\sqrt6$, the attracting <period-two orbit> has the two values
$$
x_\pm=\frac{r+1\pm\sqrt{(r-3)(r+1)}}{2r}.
$$
At $r=3.2$ they are approximately $0.513045$ and $0.799455$, with $F_r(x_-)=x_+$ and $F_r(x_+)=x_-$. Their <periodic-orbit multiplier> is $4+2r-r^2=0.16$, so a small displacement shrinks over two steps even though the <fixed point> is unstable. The brief algebraic justification is to factor $F_r^2(x)-x$, remove the <fixed point> factors, and multiply the two <derivatives> using the <chain rule>.

At $r=3$, the positive <fixed-point multiplier> passes through $-1$ and a <period-doubling bifurcation> creates the <period-two orbit>. At $r=1+\sqrt6\approx3.44949$, its <periodic-orbit multiplier> passes through $-1$ and an attracting period-four <periodic orbit> emerges. At $r=3.5$, the period-four values are approximately $0.382820,0.826941,0.500884,0.874997$ in that order. Further <period-doubling bifurcations> accumulate near $r\approx3.56995$. Beyond that value there are also parameter windows with attracting <periodic orbits>, including a period-three window near $r=3.83$. Neither a crowded numerical plot nor a parameter beyond the accumulation value proves <sensitive dependence on initial conditions> on the attracting set.

The endpoint $r=4$ supplies an analytically transparent example. The <homeomorphism> $h(u)=\sin^2(\pi u/2)$ satisfies
$$
F_4\circ h=h\circ T,
$$
where $T$ is the full <tent map>. Thus these maps have <topological conjugacy>; stretching and folding in the <tent map> explain <sensitive dependence on initial conditions> and <Devaney chaos> for $F_4$ on $[0,1]$. This does not make every individual <orbit> nonperiodic: $x_0=3/4$ stays fixed, and $x_0=1/2$ follows $1/2,1,0,0,\ldots$. Sensitivity means that these exceptional <orbits> also have arbitrarily close initial states that eventually depart substantially.

Robert M. May's "Simple mathematical models with very complicated dynamics" (1976), Nature 261, pp. 459–467, reviewed how simple deterministic <recurrence relations> can pass from stable abundances through <period-doubling cascades> to irregular behaviour. May presented the <logistic map> as an especially accessible example and discussed the relevance of such models to <population dynamics>. The paper explicitly describes itself as a review of results found by several researchers, bringing their findings together for a broad scientific audience.https://doi.org/10.1038/261459a0[May's 1976 Nature review]{ref}