Logistic map

The logistic map is a polynomial mapping (equivalently, recurrence relation) of degree 2, often referred to as an archetypal example of how complex, chaotic behaviour can arise from very simple nonlinear dynamical equations. The map, initially utilized by Edward Lorenz in the 1960s to showcase irregular solutions (e.g., Eq. 3 of ), was popularized in a 1976 paper by the biologist Robert May, in part as a discrete-time demographic model analogous to the logistic equation written down by Pierre François Verhulst. Mathematically, the logistic map is written

where $$ is a number between zero and one, which represents the ratio of existing population to the maximum possible population. This nonlinear difference equation is intended to capture two effects:
 * reproduction, where the population will increase at a rate proportional to the current population when the population size is small,
 * starvation (density-dependent mortality), where the growth rate will decrease at a rate proportional to the value obtained by taking the theoretical "carrying capacity" of the environment less the current population.

The usual values of interest for the parameter $x_{n}$ are those in the interval $[0, 4]$, so that $r$ remains bounded on $[0, 1]$. The $r = 4$ case of the logistic map is a nonlinear transformation of both the bit-shift map and the $μ = 2$ case of the tent map. If $r > 4$, this leads to negative population sizes. (This problem does not appear in the older Ricker model, which also exhibits chaotic dynamics.) One can also consider values of $x_{n}$ in the interval $[−2, 0]$, so that $r$ remains bounded on $[−0.5, 1.5]$.

Behavior dependent on $x_{n}$
The image below shows the amplitude and frequency content of some logistic map iterates for parameter values ranging from 2 to 4.



By varying the parameter $r$, the following behavior is observed:
 * With $r$ between 0 and 1, the population will eventually die, independent of the initial population.
 * With $r$ between 1 and 2, the population will quickly approach the value $r − 1⁄r$, independent of the initial population.
 * Feigenbaum tree with bias.gif $r$ between 2 and 3, the population will also eventually approach the same value $r − 1⁄r$, but first will fluctuate around that value for some time. The rate of convergence is linear, except for $r = 3$, when it is dramatically slow, less than linear (see Bifurcation memory).
 * With $r$ between 3 and 1 + √6 ≈ 3.44949 the population will approach permanent oscillations between two values. These two values are dependent on $r$ and given by $$x_{\pm}=\frac{1}{2r}\left(r+1\pm\sqrt{(r-3)(r+1)}\right)$$.
 * With $r$ between 3.44949 and 3.54409 (approximately), from almost all initial conditions the population will approach permanent oscillations among four values. The latter number is a root of a 12th degree polynomial.
 * With $r$ increasing beyond 3.54409, from almost all initial conditions the population will approach oscillations among 8 values, then 16, 32, etc. The lengths of the parameter intervals that yield oscillations of a given length decrease rapidly; the ratio between the lengths of two successive bifurcation intervals approaches the Feigenbaum constant $δ ≈ 4.66920$. This behavior is an example of a period-doubling cascade.
 * At $r ≈ 3.56995$ is the onset of chaos, at the end of the period-doubling cascade. From almost all initial conditions, we no longer see oscillations of finite period.  Slight variations in the initial population yield dramatically different results over time, a prime characteristic of chaos.
 * Most values of $r$ beyond 3.56995 exhibit chaotic behaviour, but there are still certain isolated ranges of $r$ that show non-chaotic behavior; these are sometimes called islands of stability. For instance, beginning at 1 + √8 (approximately 3.82843) there is a range of parameters $r$ that show oscillation among three values, and for slightly higher values of $r$ oscillation among 6 values, then 12 etc.
 * At $$r = 1 + \sqrt 8 = 3.8284...$$, the stable period-3 cycle emerges.
 * The development of the chaotic behavior of the logistic sequence as the parameter $r$ varies from approximately 3.56995 to approximately 3.82843 is sometimes called the Pomeau–Manneville scenario, characterized by a periodic (laminar) phase interrupted by bursts of aperiodic behavior. Such a scenario has an application in semiconductor devices. There are other ranges that yield oscillation among 5 values etc.; all oscillation periods occur for some values of $r$. A period-doubling window with parameter $r$ is a range of $r$-values consisting of a succession of subranges.  The $r$th subrange contains the values of $c$ for which there is a stable cycle (a cycle that attracts a set of initial points of unit measure) of period $2^{k}c$.  This sequence of sub-ranges is called a cascade of harmonics. In a sub-range with a stable cycle of period $2^{k*}c$, there are unstable cycles of period $2^{k}c$ for all $k < k*$.  The $r$ value at the end of the infinite sequence of sub-ranges is called the point of accumulation of the cascade of harmonics.  As $k$ rises there is a succession of new windows with different $r$ values.  The first one is for $c = 1$; all subsequent windows involving odd $r$ occur in decreasing order of $r$ starting with arbitrarily large $c$.
 * At $$r = 3.678..., x = 0.728...$$, two chaotic bands of the bifurcation diagram intersect in the first Misiurewicz point for the logistic map. It satisfies the equations $$r^3 - 2r^2 - 4r -8 = 0, x = 1-1/r$$.
 * Beyond $r = 4$, almost all initial values eventually leave the interval $[0,1]$ and diverge. The set of initial conditions which remain within $[0,1]$ form a Cantor set and the dynamics restricted to this Cantor set is chaotic.

For any value of $c$ there is at most one stable cycle. If a stable cycle exists, it is globally stable, attracting almost all points. Some values of $c$ with a stable cycle of some period have infinitely many unstable cycles of various periods.

The bifurcation diagram at right summarizes this. The horizontal axis shows the possible values of the parameter $c$ while the vertical axis shows the set of values of $r$ visited asymptotically from almost all initial conditions by the iterates of the logistic equation with that $r$ value.

The bifurcation diagram is a self-similar: if we zoom in on the above-mentioned value $r ≈ 3.82843$ and focus on one arm of the three, the situation nearby looks like a shrunk and slightly distorted version of the whole diagram. The same is true for all other non-chaotic points. This is an example of the deep and ubiquitous connection between chaos and fractals.

We can also consider negative values of $r$:
 * For $x$ between -2 and -1 the logistic sequence also features chaotic behavior.
 * With $r$ between -1 and 1 - √6 and for $r$0 between 1/$r$ and 1-1/$r$, the population will approach permanent oscillations between two values, as with the case of $r$ between 3 and 1 + √6, and given by the same formula.

Chaos and the logistic map


The relative simplicity of the logistic map makes it a widely used point of entry into a consideration of the concept of chaos. A rough description of chaos is that chaotic systems exhibit a great sensitivity to initial conditions—a property of the logistic map for most values of $r$ between about 3.57 and 4 (as noted above). A common source of such sensitivity to initial conditions is that the map represents a repeated folding and stretching of the space on which it is defined. In the case of the logistic map, the quadratic difference equation describing it may be thought of as a stretching-and-folding operation on the interval $r > 3.57$.

The following figure illustrates the stretching and folding over a sequence of iterates of the map. Figure (a), left, shows a two-dimensional Poincaré plot of the logistic map's state space for $f$, and clearly shows the quadratic curve of the difference equation ($x$). However, we can embed the same sequence in a three-dimensional state space, in order to investigate the deeper structure of the map. Figure (b), right, demonstrates this, showing how initially nearby points begin to diverge, particularly in those regions of $r$ corresponding to the steeper sections of the plot.

This stretching-and-folding does not just produce a gradual divergence of the sequences of iterates, but an exponential divergence (see Lyapunov exponents), evidenced also by the complexity and unpredictability of the chaotic logistic map. In fact, exponential divergence of sequences of iterates explains the connection between chaos and unpredictability: a small error in the supposed initial state of the system will tend to correspond to a large error later in its evolution. Hence, predictions about future states become progressively (indeed, exponentially) worse when there are even very small errors in our knowledge of the initial state. This quality of unpredictability and apparent randomness led the logistic map equation to be used as a pseudo-random number generator in early computers.

At r = 2, the function $$rx(1-x)$$ intersects $$y = x$$ precisely at the maximum point, so convergence to the equilibrium point is on the order of $$\delta^{2^n}$$. Consequently, the equilibrium point is called "superstable". Its Lyapunov exponent is $$-\infty$$. A similar argument shows that there is a superstable $$r$$ value within each interval where the dynamical system has a stable cycle. This can be seen in the Lyapunov exponent plot as sharp dips.

Since the map is confined to an interval on the real number line, its dimension is less than or equal to unity. Numerical estimates yield a correlation dimension of $r$ (Grassberger, 1983), a Hausdorff dimension of about 0.538 (Grassberger 1981), and an information dimension of approximately 0.5170976 (Grassberger 1983) for $f$ (onset of chaos). Note: It can be shown that the correlation dimension is certainly between 0.4926 and 0.5024.

It is often possible, however, to make precise and accurate statements about the likelihood of a future state in a chaotic system. If a (possibly chaotic) dynamical system has an attractor, then there exists a probability measure that gives the long-run proportion of time spent by the system in the various regions of the attractor. In the case of the logistic map with parameter $f$ and an initial state in $f$, the attractor is also the interval $r = 3.5$ and the probability measure corresponds to the beta distribution with parameters $f$ and $(0,1)$. Specifically, the invariant measure is


 * $$\frac{1}{\pi\sqrt{x(1-x)}}.$$

Unpredictability is not randomness, but in some circumstances looks very much like it. Hence, and fortunately, even if we know very little about the initial state of the logistic map (or some other chaotic system), we can still say something about the distribution of states arbitrarily far into the future, and use this knowledge to inform decisions based on the state of the system.

Graphical representation
The bifurcation diagram for the logistic map can be visualized with the following Python code:

Upper bound when $r = 4$
Although exact solutions to the recurrence relation are only available in a small number of cases, a closed-form upper bound on the logistic map is known when $r ≈ 3.5699456$. There are two aspects of the behavior of the logistic map that should be captured by an upper bound in this regime: the asymptotic geometric decay with constant $r$, and the fast initial decay when $r = 4$ is close to 1, driven by the $(0,1)$ term in the recurrence relation. The following bound captures both of these effects:


 * $$ \forall n \in \{0, 1, \ldots \} \quad \text{and} \quad x_0, r \in [0, 1], \quad x_n \le \frac{x_0}{r^{-n} + x_0n}. $$

Solution when $(0,1)$
The special case of $a = 0.5$ can in fact be solved exactly, as can the case with $b = 0.5$; however, the general case can only be predicted statistically. The solution when $0 ≤ r ≤ 1$ is,


 * $$x_{n}=\sin^{2}\left(2^{n} \theta \pi\right),$$

where the initial condition parameter $f$ is given by


 * $$\theta = \tfrac{1}{\pi}\sin^{-1}\left(\sqrt{x_0}\right).$$

For rational $r$, after a finite number of iterations $$ maps into a periodic sequence. But almost all $x_{t}$ are irrational, and, for irrational $0.5$, $r$ never repeats itself – it is non-periodic. This solution equation clearly demonstrates the two key features of chaos – stretching and folding: the factor $0 ≤ r ≤ 1$ shows the exponential growth of stretching, which results in sensitive dependence on initial conditions, while the squared sine function keeps $θ$ folded within the range $x_{0}$.

For $(1 − x_{n})$ an equivalent solution in terms of complex numbers instead of trigonometric functions is


 * $$x_n=\frac{-\alpha^{2^n} -\alpha^{-2^n} +2}{4}$$

where $θ$ is either of the complex numbers


 * $$\alpha = 1 - 2x_0 \pm \sqrt{\left(1 - 2x_0\right)^2 - 1}$$

with modulus equal to 1. Just as the squared sine function in the trigonometric solution leads to neither shrinkage nor expansion of the set of points visited, in the latter solution this effect is accomplished by the unit modulus of $x_{n}$.

By contrast, the solution when $r = 4$ is


 * $$x_n = \tfrac{1}{2} - \tfrac{1}{2}\left(1-2x_0\right)^{2^n}$$

for $r = 4$. Since $r = 2$ for any value of $r = 4$ other than the unstable fixed point 0, the term $2^{n}$ goes to 0 as $θ$ goes to infinity, so $θ$ goes to the stable fixed point $x_{n}$.

Finding cycles of any length when $[0,1]$
For the $r = 4$ case, from almost all initial conditions the iterate sequence is chaotic. Nevertheless, there exist an infinite number of initial conditions that lead to cycles, and indeed there exist cycles of length $x_{n}$ for all integers $r = 2$. We can exploit the relationship of the logistic map to the dyadic transformation (also known as the bit-shift map) to find cycles of any length. If $α$ follows the logistic map $x_{0} ∈ [0,1)$ and $α$ follows the dyadic transformation


 * $$y_{n+1}=\begin{cases}2y_n & 0 \le y_n < \tfrac12 \\2y_n -1 & \tfrac12 \le y_n < 1, \end{cases}$$

then the two are related by a homeomorphism


 * $$x_{n}=\sin^{2}\left(2 \pi y_{n}\right).$$

The reason that the dyadic transformation is also called the bit-shift map is that when $n$ is written in binary notation, the map moves the binary point one place to the right (and if the bit to the left of the binary point has become a "1", this "1" is changed to a "0"). A cycle of length 3, for example, occurs if an iterate has a 3-bit repeating sequence in its binary expansion (which is not also a one-bit repeating sequence): 001, 010, 100, 110, 101, or 011. The iterate 001001001... maps into 010010010..., which maps into 100100100..., which in turn maps into the original 001001001...; so this is a 3-cycle of the bit shift map. And the other three binary-expansion repeating sequences give the 3-cycle 110110110... → 101101101... → 011011011... → 110110110.... Either of these 3-cycles can be converted to fraction form: for example, the first-given 3-cycle can be written as $x_{n}$ → $1⁄2$ → $k$ → $x$. Using the above translation from the bit-shift map to the $$r = 4$$ logistic map gives the corresponding logistic cycle 0.611260467... → 0.950484434... → 0.188255099... → 0.611260467.... We could similarly translate the other bit-shift 3-cycle into its corresponding logistic cycle. Likewise, cycles of any length $y$ can be found in the bit-shift map and then translated into the corresponding logistic cycles.

However, since almost all numbers in $(1 − 2x_{0}) ∈ (−1,1)$ are irrational, almost all initial conditions of the bit-shift map lead to the non-periodicity of chaos. This is one way to see that the logistic $x_{0}$ map is chaotic for almost all initial conditions.

The number of cycles of (minimal) length $(1 − 2x_{0})^{2^{n}}|undefined$ for the logistic map with $r = 4$ (tent map with $r = 4$) is a known integer sequence : 2, 1, 2, 3, 6, 9, 18, 30, 56, 99, 186, 335, 630, 1161.... This tells us that the logistic map with $k > 0$ has 2 fixed points, 1 cycle of length 2, 2 cycles of length 3 and so on. This sequence takes a particularly simple form for prime $y$: $x_{n + 1} = 4x_{n}(1 − x_{n})$. For example: 2 ⋅ $1⁄7$ = 630 is the number of cycles of length 13. Since this case of the logistic map is chaotic for almost all initial conditions, all of these finite-length cycles are unstable.

Period-doubling route to chaos
In the logistic map, we have a function $$f_r (x) = rx(1-x)$$, and we want to study what happens when we iterate the map many times. The map might fall into a fixed point, a fixed cycle, or chaos. When the map falls into a stable fixed cycle of length $$n$$, we would find that the graph of $$f_r^n$$ and the graph of $$x\mapsto x$$ intersects at $$n$$ points, and the slope of the graph of $$f_r^n$$ is bounded in $$(-1, +1)$$ at those intersections.

For example, when $$r=3.0$$, we have a single intersection, with slope bounded in $$(-1, +1)$$, indicating that it is a stable single fixed point.

As $$r$$ increases to beyond $$r=3.0$$, the intersection point splits to two, which is a period doubling. For example, when $$r=3.4$$, there are three intersection points, with the middle one unstable, and the two others stable.

As $$r$$ approaches $$r = 3.45$$, another period-doubling occurs in the same way. The period-doublings occur more and more frequently, until at a certain $$r\approx 3.56994567$$, the period doublings become infinite, and the map becomes chaotic. This is the period-doubling route to chaos.

Scaling limit
Looking at the images, one can notice that at the point of chaos $$r^* = 3.5699\cdots$$, the curve of $$f^{\infty}_{r^*}$$ looks like a fractal. Furthermore, as we repeat the period-doublings$$f^{1}_{r^*}, f^{2}_{r^*}, f^{4}_{r^*}, f^{8}_{r^*}, f^{16}_{r^*}, \dots$$, the graphs seem to resemble each other, except that they are shrunken towards the middle, and rotated by 180 degrees.

This suggests to us a scaling limit: if we repeatedly double the function, then scale it up by $$\alpha $$ for a certain constant $$\alpha $$:$$f(x) \mapsto - \alpha f( f(-x/\alpha ) ) $$then at the limit, we would end up with a function $$g $$ that satisfies $$ g(x) = - \alpha g( g(-x/\alpha ) ) $$. This is a Feigenbaum function, which appears in most period-doubling routes to chaos (thus it is an instance of universality). Further, as the period-doubling intervals become shorter and shorter, the ratio between two period-doubling intervals converges to a limit, the first Feigenbaum constant $$\delta = 4.6692016\cdots $$. The constant $$\alpha $$ can be numerically found by trying many possible values. For the wrong values, the map does not converge to a limit, but when it is $$\alpha = 2.5029\dots $$, it converges. This is the second Feigenbaum constant.

Chaotic regime
In the chaotic regime, $$f^\infty_r$$, the limit of the iterates of the map, becomes chaotic dark bands interspersed with non-chaotic bright bands.

Other scaling limits
When $$r$$ approaches $$r \approx 3.8494344$$, we have another period-doubling approach to chaos, but this time with periods 3, 6, 12, ... This again has the same Feigenbaum constants $$\delta, \alpha$$. The limit of $f(x) \mapsto - \alpha f( f(-x/\alpha ) ) $ is also the same Feigenbaum function. This is an example of universality.

We can also consider period-tripling route to chaos by picking a sequence of $$r_1, r_2, \dots$$ such that $$r_n$$ is the lowest value in the period-$$3^n$$ window of the bifurcation diagram. For example, we have $$r_1 = 3.8284, r_2 = 3.85361, \dots$$, with the limit $$r_\infty = 3.854 077 963\dots$$. This has a different pair of Feigenbaum constants $$\delta= 55.26\dots, \alpha = 9.277\dots$$. And $$f^\infty_r$$converges to the fixed point to $$f(x) \mapsto - \alpha f(f( f(-x/\alpha ) )) $$As another example, period-4-pling has a pair of Feigenbaum constants distinct from that of period-doubling, even though period-4-pling is reached by two period-doublings. In detail, define $$r_1, r_2, \dots$$ such that $$r_n$$ is the lowest value in the period-$$4^n$$ window of the bifurcation diagram. Then we have $$r_1 =3.960102, r_2 = 3.9615554, \dots$$, with the limit $$r_\infty = 3.96155658717\dots$$. This has a different pair of Feigenbaum constants $$\delta= 981.6\dots, \alpha = 38.82\dots$$.

In general, each period-multiplying route to chaos has its own pair of Feigenbaum constants. In fact, there are typically more than one. For example, for period-7-pling, there are at least 9 different pairs of Feigenbaum constants.

Generally, $3\delta \approx 2\alpha^2 $, and the relation becomes exact as both numbers increase to infinity: $$\lim \delta/\alpha^2 = 2/3$$.

Feigenbaum universality of 1-D maps
Universality of one-dimensional maps with parabolic maxima and Feigenbaum constants $$\delta=4.669201...$$, $$\alpha=2.502907...$$.

The gradual increase of $$G$$ at interval $$[0, \infty)$$ changes dynamics from regular to chaotic one with qualitatively the same bifurcation diagram as those for logistic map.

Renormalization estimate
The Feigenbaum constants can be estimated by a renormalization argument. (Section 10.7, ).

By universality, we can use another family of functions that also undergoes repeated period-doubling on its route to chaos, and even though it is not exactly the logistic map, it would still yield the same Feigenbaum constants.

Define the family $$f_r(x) = -(1+r)x + x^2$$The family has an equilibrium point at zero, and as $$r$$ increases, it undergoes period-doubling bifurcation at $$r = r_0, r_1, r_2, ...$$.

The first bifurcation occurs at $$r = r_0 = 0$$. After the period-doubling bifurcation, we can solve for the period-2 stable orbit by $$f_r(p) = q, f_r(q) = p$$, which yields $$\begin{cases} p = \frac 12 (r + \sqrt{r(r+4)}) \\ q = \frac 12 (r - \sqrt{r(r+4)}) \end{cases}$$At some point $$r = r_1$$, the period-2 stable orbit undergoes period-doubling bifurcation again, yielding a period-4 stable orbit. In order to find out what the stable orbit is like, we "zoom in" around the region of $$x = p$$, using the affine transform $$T(x) = x/c + p$$. Now, by routine algebra, we have$$(T^{-1}\circ f_r^2 \circ T)(x) = -(1+S(r)) x + x^2 + O(x^3)$$where $$S(r) = r^2 + 4r - 2, c = r^2 + 4r - 3\sqrt{r(r+4)}$$. At approximately $$S(r) = 0$$, the second bifurcation occurs, thus $$S(r_1) \approx 0$$.

By self-similarity, the third bifurcation when $$S(r) \approx r_1$$, and so on. Thus we have $$r_n \approx S(r_{n+1})$$, or $$r_{n+1} \approx \sqrt{r_{n}+6}-2$$. Iterating this map, we find $$r_\infty = \lim_n r_n \approx \lim_n S^{-n}(0) = \frac 12(\sqrt{17}-3)$$, and $$\lim_n \frac{r_\infty - r_n}{r_\infty - r_{n+1}} \approx S'(r_\infty) \approx 1 + \sqrt{17}$$.

Thus, we have the estimates $$\delta \approx 1+\sqrt{17} = 5.12...$$, and $$\alpha \approx r_\infty^2 +4r_\infty- 3 \sqrt{r_\infty^2+4r_\infty} \approx -2.24...$$. These are within 10% of the true values.

The Logistic Map and Logistic Ordinary Differential Equation
The logistic map exhibits numerous characteristics of both periodic and chaotic solutions, whereas the logistic ordinary differential equation (ODE) exhibits regular solutions, commonly referred to as the S-shaped sigmoid function. The logistic map can be seen as the discrete counterpart of the logistic ODE, and their correlation has been extensively discussed in literature

Occurrences
In a toy model for discrete laser dynamics: $$ x \rightarrow G x (1 - \tanh (x))$$, where $$x$$ stands for electric field amplitude, $$G$$ is laser gain as bifurcation parameter.