Populations, chemistry & chaos

Logistic Map Bifurcation Lab

The logistic map x -> r x (1 - x) step by step: the orbit and its cobweb beside a twin that starts a hair away, the long-run behaviour after 1,000 steps (settled, a cycle of period 2 to 12, not settled, or chaotic) with its Lyapunov exponent, a 61-column bifurcation diagram over a zoomable window, the fixed point and the 2-cycle with their stability, and the superstable parameters R1 to R4 with the Feigenbaum ratios. Five challenges are scored for you. For learning how one growth rate turns order into chaos.

Last updated

Calculator overview

Inputs and outputs

This summary comes from the calculator's published input and output contract.

Inputs

Window left end (required)
About this input

The left end of the window of growth rates the bifurcation diagram shows, from 0 to 4. Set by dragging the window band on the diagram, or by the chips "Whole range 0 to 4" and "Reset to 2.8 to 4".

Default 2.8 Range 0 to 4
Window right end (required)
About this input

The right end of the diagram window, from 0 to 4 and at least 0.003 above the left end. The diagram spreads 61 growth rates evenly from the left end to the right end.

Default 4 Range 0 to 4
Twin's head start (required)
About this input

How far from x0 the twin orbit starts, from 0.000000000001 to 0.01. The twin starts at x0 + delta, or at x0 - delta when that would pass 1. In chaos the gap between the two roughly doubles every step.

Default 1E-08 Range 1E-12 to 0.01
Your prediction of the settled value
When omitted Blank
About this input

Challenge 1 only: the value you predict the orbit settles on at r = 2.8, from 0 to 1. It starts blank; the orbit and the results appear once you predict (0 is a real prediction).

Default Not set Range 0 to 1
Your prediction of the divergence step
When omitted Blank
About this input

Challenge 3 only: the first step at which you predict the two orbits differ by more than 0.1, a whole number from 1 to 60. It starts blank; the twin appears once you predict.

Default Not set Range 1 to 60
Challenge (required)
About this input

The challenge to play: 0 for none, 1 to 5 for the five challenges. A challenge fixes the inputs it does not leave to you.

Default 0 Range 0 to 5
Starting value x0 (required)
About this input

The starting value x0 of the orbit, from 0 to 1. Set by dragging the dot at the foot of the cobweb staircase. The diagram columns always start from 0.2.

Default 0.2 Range 0 to 1
Growth rate r (required)
About this input

The growth rate r of the map x -> r x (1 - x), from 0 to 4. Set by dragging the r marker along the axis of the bifurcation diagram, or typed exactly in its popover. Below 3 the orbit settles on one value; above about 3.57 it can be chaotic.

Default 3.2 Range 0 to 4

Outputs

The map curve f(x) = r x (1 - x) and its second iterate at 41 points
About this output

The map curve at 41 points x = 0, 0.025, ..., 1: x, f(x) = r x (1 - x) and f(f(x)). One header row, then 41 data rows.

No unit declared
Lyapunov exponent (estimated over 500 steps)
About this output

The Lyapunov exponent at your r: the mean of ln |r (1 - 2x)| over steps 501 to 1,000, shown as -10 when it is -10 or below. Negative for a stable cycle, positive for chaos.

No unit declared
Model version
About this output

The model version.

No unit declared
Model Status
About this output

OK, or the first problem found: NOT VALID with the input to fix (the results are then blank), or CHECK when a superstable bracket lost its sign change (never with the shipped constants).

No unit declared
Starting value used
About this output

The starting value the model used.

No unit declared
Multiplier at the fixed point
About this output

The slope f'(x*) at the fixed point: r for r up to 1, otherwise 2 - r. The fixed point is stable when its absolute value is below 1.

No unit declared
Fixed point
About this output

The fixed point in [0, 1]: 0 for r up to 1, otherwise 1 - 1/r, where the parabola meets the diagonal.

No unit declared
Growth rate used
About this output

The growth rate the model used: yours, or the challenge's.

No unit declared
Fixed point stability
About this output

Stable, Unstable, or Neutral (on the edge) when the multiplier is within one part in a billion of plus or minus 1.

No unit declared
Formula module versions
About this output

The versions of the formula modules.

No unit declared
Superstable growth rate R3
About this output

R3, the growth rate at which x = 1/2 lies on the 8-cycle, by 45 bisection steps.

No unit declared
Superstable growth rate R2
About this output

R2, the growth rate at which x = 1/2 lies on the 4-cycle, by 45 bisection steps.

No unit declared
Twin's head start used
About this output

The head start of the twin the model used.

No unit declared
Superstable growth rate R4
About this output

R4, the growth rate at which x = 1/2 lies on the 16-cycle, by 45 bisection steps.

No unit declared
Superstable growth rate R1
About this output

R1, the growth rate at which x = 1/2 lies on the 2-cycle (1 + sqrt(5)), by 45 bisection steps.

No unit declared
Window right end used
About this output

The right end of the diagram window the model used.

No unit declared
The orbit of x0 step by step, with the next value (the cobweb pair), the twin and the gap between them
About this output

The orbit of x0 for steps 0 to 60: the step, x, the next x (the cobweb pair), the twin and the gap between them (at least 1E-17). One header row, then 61 data rows.

No unit declared
Settled diagram columns
About this output

How many of the 61 diagram columns settle on a value or a cycle.

No unit declared
Window left end used
About this output

The left end of the diagram window the model used.

No unit declared
Challenge score
About this output

100 when the challenge is met, else 0.

No unit declared
Challenge: the value scored
About this output

The value the challenge scores: the fixed point (1), the period found (2, 4), the divergence step (3) or the window width (5); blank while a prediction is awaited.

No unit declared
Chaotic diagram columns
About this output

How many of the 61 diagram columns are chaotic.

No unit declared
Challenge result
About this output

No challenge selected, MET or NOT MET.

No unit declared
Challenge goal
About this output

The goal of the selected challenge.

No unit declared
Behaviour class
About this output

The behaviour as a code: 1 settled, 2 not settled after 1,000 steps, 3 chaotic, 4 no period up to 12.

No unit declared
Long-run behaviour
About this output

The long-run behaviour at your r after 1,000 steps, judged from the next 24: settles on one value, settles into a cycle of period p, not settled yet (close to a change of behaviour), chaotic (no repeating pattern), or no period up to 12.

No unit declared
Challenge feedback
About this output

The prompt while a prediction is awaited, then the met or not-met text.

No unit declared
The bifurcation diagram: for each of 61 growth rates across the window, its Lyapunov exponent, class, period and 24 long-run values
About this output

The bifurcation diagram: for each of 61 growth rates spread evenly across the window, r, its Lyapunov exponent, its class (1 settled, 2 not settled, 3 chaotic, 4 no period up to 12), its period and its 24 long-run values (steps 1,001 to 1,024 from the start 0.2). One header row, then 61 data rows.

No unit declared
Diagram column step
About this output

The spacing of the 61 diagram columns, (right end - left end)/60.

No unit declared
Feigenbaum ratio 1
About this output

(R1 - R0)/(R2 - R1) with R0 = 2: the first ratio of consecutive spacings, which approach the Feigenbaum constant 4.6692.

No unit declared
Step at which the twins separate
About this output

The first step from 1 to 60 at which the orbit and its twin differ by more than 0.1; blank when they never do.

No unit declared
Feigenbaum ratio 3
About this output

(R3 - R2)/(R4 - R3), within about 0.006 of 4.6692.

No unit declared
Feigenbaum ratio 2
About this output

(R2 - R1)/(R3 - R2).

No unit declared
Period found
About this output

The period of the settled cycle at your r (1 for a single value), blank unless the orbit settles.

No unit declared
Lower value of the 2-cycle
About this output

The lower value of the 2-cycle, (r + 1 - sqrt((r - 3)(r + 1)))/(2r); blank unless r > 3.

No unit declared
Upper value of the 2-cycle
About this output

The upper value of the 2-cycle, (r + 1 + sqrt((r - 3)(r + 1)))/(2r); blank unless r > 3.

No unit declared
2-cycle stability
About this output

Stable, Unstable or Neutral (on the edge) for the 2-cycle; blank unless r > 3.

No unit declared
Multiplier of the 2-cycle
About this output

The multiplier of the 2-cycle, 4 + r (2 - r); the 2-cycle is stable while its absolute value is below 1, from r = 3 to 1 + sqrt(6). Blank unless r > 3.

No unit declared
This page is provided by LogicCommons for informational purposes only. Results are analysis outputs computed from the inputs you supply and are not professional advice. Verify all inputs and results independently.

LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.

Methodology

Purpose and model boundary

This lab follows the logistic map, x -> r·x·(1 - x), for a growth rate r from 0 to 4 and values x from 0 to 1. It shows the orbit of a starting value step by step, as a cobweb on the parabola and as a time series, beside a twin orbit that starts a hair away. It judges the long-run behaviour at the chosen r after 1,000 steps (settled on one value, a cycle of period 2 to 12, not settled yet, chaotic, or no period up to 12), estimates the Lyapunov exponent, and draws a bifurcation diagram of 61 growth rates across a window you can zoom. Beside these it gives the fixed point and the 2-cycle with their stability and, at the Advanced level, the superstable growth rates R1 to R4 and the Feigenbaum ratios of their spacings. Five challenges are scored by the model.

It is a lab for learning how one growth rate turns order into chaos: how a stable value gives way to a 2-cycle, then 4, 8 and so on, how chaos appears near r = 3.57, how windows of order such as period 3 sit inside it, and why two orbits that start almost together soon part. It is not a population forecast; the map is the classic textbook example, used here for its mathematics.

The model is the calculation authority. The page sends the values you set to the model and draws only what it returns: the parabola, the diagonal and the cobweb staircase, the orbit and twin over time, the gap between them on a log scale, the bifurcation dots and the Lyapunov strip below them. The page computes no orbit value, period, Lyapunov exponent or fixed point itself.

Inputs and units

Every input is a pure number; the map has no units.

Input Meaning and unit
Growth rate r 0 to 4 (default 3.2).
Starting value x0 0 to 1 (default 0.2): the start of the orbit. The diagram columns always start from 0.2.
Twin's head start 1×10⁻¹² to 0.01 (default 1×10⁻⁸): how far from x0 the twin starts. The twin starts at x0 plus this, or x0 minus this when that would pass 1.
Window left end 0 to 4 (default 2.8): the left end of the growth rates the bifurcation diagram shows.
Window right end 0 to 4 (default 4), and at least 0.003 above the left end.
Challenge 0 for none, or 1 to 5.
Your prediction of the settled value Blank, or 0 to 1: your answer for challenge 1. 0 is a real prediction.
Your prediction of the divergence step Blank, or a whole number from 1 to 60: your answer for challenge 3.

The five model inputs and the challenge number are required; the two predictions start blank, which means not yet predicted.

Where each input is set:

  • On the canvas only: the growth rate, by dragging the r marker along the axis of the bifurcation diagram (an exact value can be typed in its popover); the starting value, by dragging the dot at the foot of the cobweb staircase; the window, by dragging the ends of the window band on the diagram's axis or with the chips Whole range 0 to 4 and Reset to 2.8 to 4; and the twin's head start, with the chips 1×10⁻¹², 1×10⁻¹⁰, 1×10⁻⁸, 1×10⁻⁶, 1×10⁻⁴ and 1×10⁻². None of these is in the input panel.
  • In the input panel: the challenge picker. The settled-value prediction box appears only in challenge 1, and the divergence-step prediction box only in challenge 3.

Governing relationships

The map. Each step is x_(n+1) = r·x_n·(1 - x_n), computed in exactly this order, (r·x)·(1 - x), in double precision arithmetic. For r from 0 to 4 and x from 0 to 1 the result stays in [0, 1], because the parabola's highest value is r/4.

The orbit and its twin. The orbit starts at x0 and runs 60 steps (61 values, plus the next value for the last cobweb pair). The twin starts at x0 + δ, or x0 - δ when x0 + δ would pass 1, with δ the head start, and runs the same map. The gap is |x_n - y_n|, shown as at least 1×10⁻¹⁷ so it can sit on a log axis. The divergence step is the first step from 1 to 60 at which the gap is strictly above 0.1, blank when it never is. In chaos the gap roughly doubles each step, so it passes 0.1 after about ln(0.1/δ)/ln 2 steps at r = 4.

Long-run behaviour. For each diagram column and for the chosen r, the map runs 1,000 transient steps and then records 24 values, x_1001 to x_1024. For each lag p from 1 to 12 it compares the last two recorded values with the values p steps earlier: d_p = max(|x_1024 - x_(1024-p)|, |x_1023 - x_(1023-p)|). The smallest lag with d_p at most 1×10⁻⁶ is the candidate period. Then:

  • settled (on one value when the period is 1, or a cycle of that period): a lag repeats, and every lag that is a proper divisor of it differs by at least 1×10⁻³;
  • not settled after 1,000 steps: a lag repeats but a divisor lag is not yet clearly apart, which happens close to a change of behaviour;
  • chaotic: no lag up to 12 repeats and the Lyapunov exponent is at least 0.01;
  • no period up to 12: no lag repeats and the exponent is below 0.01, which means a cycle longer than 12 or very slow settling at a bifurcation point.

The Lyapunov exponent. λ is the mean of ln|r·(1 - 2·x_n)|, the logarithm of the slope of the map, over steps 501 to 1,000. A slope of exactly 0 (x = 1/2) is replaced by 1×10⁻³⁰⁰ inside the logarithm, and λ is shown as -10 when it is -10 or below. λ is negative for a stable cycle and positive for chaos; at r = 4 it is ln 2.

The bifurcation diagram. Column i, from 0 to 60, has r_i = left end + i·(right end - left end)/60 (the last column is exactly the right end); its dots are its 24 recorded values from the start 0.2, with its exponent, class and period. The model also counts the settled and the chaotic columns.

The fixed point. For r up to 1 the fixed point in [0, 1] is 0, with slope (multiplier) r; above 1 it is x* = 1 - 1/r, where the parabola meets the diagonal, with multiplier 2 - r. A fixed point or cycle is stable when the size of its multiplier is below 1, unstable when above 1, and neutral (on the edge) when it is within one part in a billion of 1.

The 2-cycle. For r above 3 the two values of the 2-cycle are (r + 1 ± √((r - 3)·(r + 1)))/(2·r), and its multiplier, the product of the slopes at the two values, is 4 + r·(2 - r). It is stable from r = 3 to 1 + √6 ≈ 3.449, where the multiplier reaches -1 and the cycle doubles into a 4-cycle.

Superstable growth rates and the Feigenbaum ratios. R_n is the growth rate at which x = 1/2 lies on the cycle of period 2^n, so that applying the map 2^n times to 1/2 returns 1/2; R0 = 2. The model finds R1 to R4 by 45 fixed bisection steps each, inside fixed brackets below the onset of chaos, each holding exactly one root. R1 is 1 + √5. The ratios (R_k - R_(k-1))/(R_(k+1) - R_k) for k = 1, 2, 3 approach the Feigenbaum constant, about 4.6692.

Calculation sequence

  1. Check the inputs in the order of the list under Errors and warnings, on the values entered.
  2. In a challenge, replace the inputs the challenge fixes with its own values.
  3. Run the orbit and the twin for 60 steps and read the gap and the divergence step.
  4. For the chosen r and each of the 61 diagram columns, run 1,000 transient steps, sum the Lyapunov terms over steps 501 to 1,000, record steps 1,001 to 1,024, and classify the behaviour.
  5. Compute the fixed point, the 2-cycle and their stability, the map curve and its second iterate at 41 points, and the superstable growth rates and ratios by bisection.
  6. Count the settled and chaotic columns, set the status and, in a challenge, score it.

Nothing iterates to convergence: every orbit has a fixed number of steps and every bisection a fixed number of halvings.

Outputs and interpretation

  • Long-run behaviour (with its class code 1 to 4) and the period found, blank unless the orbit settles.
  • Lyapunov exponent (estimated over 500 steps).
  • Step at which the twins separate: the divergence step, blank when they never do.
  • Fixed point, its multiplier and stability.
  • Upper and lower values of the 2-cycle, its multiplier and stability, blank unless r is above 3.
  • Settled and chaotic diagram columns and the diagram column step.
  • Superstable growth rates R1 to R4 and Feigenbaum ratios 1 to 3.
  • Settings used: the growth rate, starting value, head start and window in effect (a challenge may fix them), and the model version.
  • Tables: the orbit (step, x, next x, twin x, gap) for steps 0 to 60; the bifurcation diagram (r, exponent, class, period and 24 values per column); and the map curve, x, f(x) and f(f(x)) at x = 0, 0.025, ... 1.

Reading the canvas: on the cobweb, each vertical segment goes from the diagonal to the parabola (one step of the map) and each horizontal segment back to the diagonal; a staircase that closes in on a point is settling, one that circles a loop is a cycle. On the bifurcation diagram each column's dots are its long-run values, one dot for a settled value, p dots for a cycle of period p, and a smear for chaos; the strip below shades the chaotic columns.

A note on chaotic values: from r about 3.57 upward, a difference in the 16th digit of a single step grows until it changes every dot, so a recalculated copy of this lab can show different dots in the chaotic region while the overall pattern stays the same. The model computes every step in exact double-precision arithmetic in one fixed order, so its results are reproducible; in chaos the later individual values are that reproducible result, not the exact mathematical orbit, while their spread and the Lyapunov exponent remain faithful.

What to take from the lab: one rule with one parameter can settle, cycle or behave chaotically; each doubling of the period comes sooner than the last, in a ratio that tends to about 4.669; and in chaos a tiny difference in the start grows step by step until the two orbits share nothing.

Challenges

Each challenge fixes the inputs it does not leave to you. The model scores each one MET (100) or NOT MET (0) and gives a hint while it is not met.

  1. Where does it settle? The growth rate is 2.8 and the orbit starts at 0.2. Predict the value the orbit settles on. Met when your prediction is within 0.01 of the fixed point.
  2. Make a 4-cycle. Change only the growth rate so that the orbit settles into a cycle that repeats every 4 steps. Met when the behaviour is settled with period 4.
  3. The butterfly. At r = 4 two orbits start 1×10⁻⁸ apart. Predict the first step at which they differ by more than 0.1. Met when your prediction is within 2 steps of the divergence step.
  4. Order inside chaos. Somewhere between r = 3.8 and 3.9 the chaos briefly stops. Find a growth rate where the orbit settles into a cycle of period 3. Met when the behaviour is settled with period 3.
  5. Zoom into the window. Zoom the diagram to a window at most 0.03 wide that shows both a settled cycle of period 3 and one of period 6. Met when the window is at most 0.03 wide and holds at least one settled period-3 column and one settled period-6 column.

Held-back results:

  • Challenge 1, until you predict: the orbit after step 0, the parabola and its second iterate, the fixed point and its stability, the behaviour, period and exponent, and the diagram's dots are blank. Once you enter a number, 0 included, everything appears and the challenge is scored.
  • Challenge 3, until you predict: the twin, the gap, the divergence step, the exponent and the diagram's exponent column are blank; the single orbit stays.
  • Challenge 2, while not met: the diagram's dots and classes, the column counts, the superstable block and the 2-cycle's multiplier and stability are blank; the behaviour, period and orbit at your r stay as feedback.
  • Challenge 4, while not met: the diagram's dots and classes and the column counts are blank.
  • Challenge 5, while not met: the diagram's exponent, class and period columns and the counts are blank; the dots stay, to be judged by eye.

Validation and status logic

The status reads the first match in the list under Errors and warnings. The NOT VALID checks use the values you entered, before a challenge replaces any. The window check allows a width within 1×10⁻⁹ of 0.003. A challenge number that is not a whole number from 0 to 5 counts as no challenge. Under the one CHECK message the superstable values and ratios are blank and every other result is shown; it cannot occur with the fixed brackets.

Assumptions and limitations

  • The logistic map only, with r from 0 to 4 and x from 0 to 1.
  • Long-run behaviour is judged from steps 1,001 to 1,024 after 1,000 transient steps, with lags up to 12. Cycles longer than 12 read no period up to 12, and near a bifurcation point settling is very slow and can read not settled or no period up to 12.
  • The Lyapunov exponent is a 500-step estimate: at r = 4 it reads about 0.694 to 0.697 against the exact ln 2 ≈ 0.6931. For a settled cycle whose period does not divide 500 the estimate includes part of a cycle.
  • The diagram columns start from 0.2 whatever the starting value of the orbit.
  • Chaotic values are double-precision orbits: from about r = 3.57 upward the computed orbit departs from the exact mathematical orbit after a few dozen steps.
  • For r below 1 the orbit decays to 0 and can pass through numbers too small for normal double precision.
  • A value close to a threshold (the period tests, the chaos test, the divergence line, the stability band or a challenge band) may fall either side of it.

Restrictions and non-computing states

Under NOT VALID every result and every table entry is blank, except the status, the model version, the challenge result (No challenge selected, or NOT MET with a challenge selected), a score of 0, and the goal and hint of a selected challenge.

The 2-cycle results are blank for r up to 3, the period is blank unless the orbit settles, and the divergence step is blank when the twins never separate. In challenges the results listed under Challenges are held back.

Errors and warnings

The status messages, first match wins:

  • NOT VALID: the growth rate r must be a number from 0 to 4 (outside that range the orbit leaves the interval from 0 to 1 and runs off to minus infinity)
  • NOT VALID: the starting value must be a number from 0 to 1
  • NOT VALID: the twin's head start must be a number from 0.000000000001 to 0.01
  • NOT VALID: each end of the diagram window must be a number from 0 to 4
  • NOT VALID: the diagram window must be at least 0.003 wide, with its right end above its left end
  • NOT VALID: the challenge number must be a whole number from 0 to 5
  • NOT VALID: the settled-value prediction must be blank or a number from 0 to 1
  • NOT VALID: the divergence-step prediction must be blank or a whole number from 1 to 60
  • CHECK: a superstable bracket lost its sign change, so the superstable values and ratios are not shown: a guard on the fixed brackets; it cannot occur with the brackets the model uses.
  • OK

References

This laboratory is an educational model of the logistic map, x -> r·x·(1 - x), the classic example of a simple rule whose behaviour moves from a settled value through a cascade of period doublings into chaos. Long-run behaviour is judged by testing whether the orbit repeats after a fixed run, and chaos by the Lyapunov exponent, the time average of the logarithm of the map's slope along the orbit. Fixed points and cycles are tested for stability by their multipliers. The superstable growth rates are found by bisection, and the ratios of their spacings are set beside the Feigenbaum constant.

Sources and further reading

  • The logistic map, its fixed point, the 2-cycle from r = 3, the 4-cycle from 1 + √6, the onset of chaos near r = 3.5699 and the period-3 window from 1 + √8: G. Elert, The Chaos Hypertextbook, section 4.2, Logistic Equation. The Chaos Hypertextbook
  • The Feigenbaum constant as the limit of the ratio of successive bifurcation intervals: G. Elert, The Chaos Hypertextbook, section 1.3, Universality. The Chaos Hypertextbook
  • The Lyapunov exponent of a discrete-time map as a time average of the logarithm of its slope: H. Sayama, Introduction to the Modeling and Analysis of Complex Systems, section 9.3, Lyapunov Exponent, LibreTexts Mathematics. LibreTexts
  • Simple maps with complicated dynamics: R. M. May, "Simple mathematical models with very complicated dynamics", Nature 261, 1976, pages 459-467. doi:10.1038/261459a0
  • The universal ratio of period-doubling intervals: M. J. Feigenbaum, "Quantitative universality for a class of nonlinear transformations", Journal of Statistical Physics 19(1), 1978, pages 25-52. doi:10.1007/BF01020332
  • One-dimensional maps, cobwebs, superstable cycles and the multiplier test: S. H. Strogatz, Nonlinear Dynamics and Chaos, 2nd edition, Westview Press, 2015, chapter 10, One-Dimensional Maps.

No table or text from any of these publications is reproduced, and none of their authors or publishers has reviewed or endorses this laboratory.

This laboratory is for learning. Its results hold only within its stated ranges; in the chaotic region the individual orbit values are reproducible double-precision results, not the exact mathematical orbit.

Links were current at build time. If one moves, search the document's title rather than reporting a broken link as a defect.

Results are informational and not professional advice. See our Terms of Use. Powered by SpreadsheetWeb · About · Privacy · Terms