From order to chaos: exploring the logistic map

Fixed-point stability, period doubling and the structure hidden inside a simple recurrence

Dynamical Systems
Nonlinear Dynamics
Computational Mathematics
I combined stability analysis with time series, cobweb diagrams and a bifurcation sweep to investigate the logistic map.
Published

October 28, 2025

A single nonlinear recurrence is enough to produce a surprisingly complicated sequence. In this investigation, I followed the logistic map as its growth parameter increased: first towards a stable equilibrium, then through period doubling, and finally into a region containing irregular motion and new periodic windows.

I used two complementary approaches. The derivative of the map tells me when a fixed point loses stability. Time series, cobweb diagrams and a parameter sweep show what happens to the iterates after that loss of stability. Keeping these approaches together was important: a plot suggests behaviour, while the stability calculation explains a specific local transition.

Bifurcation diagram showing one branch, period doubling and a dense collection of iterates as r increases from 2 to 4.
Figure 1: My original bifurcation diagram for the logistic map, generated by sweeping the growth parameter from 2 to 4.

The model and the question

I considered the discrete dynamical system

\[ x_{n+1}=f(x_n)=r x_n(1-x_n),\qquad r\in(0,4]. \tag{1}\]

Here \(n\) counts iterations and \(r\) controls the growth. The quadratic term limits the growth that the linear term would otherwise produce. My report considered \(x_n\geq0\) in the population interpretation and focused on how changing \(r\) changes the long-term behaviour.

The question was not only whether a sequence converges. I wanted to identify the structures through which convergence is lost: the exchange of stability at one parameter value, the flip of a multiplier at another, and the periodic windows visible later in the sweep.

Finding the fixed points

A fixed point satisfies \(x_{n+1}=x_n=x^*\), so

\[ x^*=r x^*(1-x^*) \quad\Longrightarrow\quad x^*\bigl[r(1-x^*)-1\bigr]=0. \]

This gives the two branches

\[ x_1^*=0,\qquad x_2^*=1-\frac1r. \tag{2}\]

To determine their local stability, I differentiated the map:

\[ f'(x)=r(1-2x). \]

The multipliers at the two fixed points are therefore

\[ \lambda_1=f'(0)=r, \qquad \lambda_2=f'\!\left(1-\frac1r\right)=2-r. \]

For a discrete map, the multiplier criterion is \(|\lambda|<1\) for local asymptotic stability and \(|\lambda|>1\) for instability. Applying it gives

\[ |r|<1\quad\Longrightarrow\quad 0<r<1 \]

for the zero state, and

\[ |2-r|<1\quad\Longrightarrow\quad 1<r<3 \]

for the nonzero state.

Fixed point Multiplier Stable range in the report
\(0\) \(r\) \(0<r<1\)
\(1-1/r\) \(2-r\) \(1<r<3\)

For \(0<r<1\), the nonzero branch is negative and was not physically relevant to the population interpretation. The equality cases \(|\lambda|=1\) sit at the transitions rather than inside these strict stability intervals.

Two local bifurcations

At \(r=1\), the two fixed-point branches meet at zero and exchange stability. I identified this as a transcritical bifurcation.

At \(r=3\), the multiplier of the nonzero branch reaches \(-1\). The branch loses stability as \(r\) increases further. I identified this as a flip bifurcation, followed numerically by a two-cycle. These calculations give the first landmarks in the parameter sweep before looking at more complicated trajectories.

Following the iterates

I generated time series at

\[ r=0.9,\quad 2.9,\quad 3.0,\quad 3.449,\quad 3.544. \]

The original time-series listing allocated 50 entries including the starting value. At \(r=0.9\), the displayed trajectory approaches the zero state. At \(r=2.9\), it approaches the positive fixed point with alternating deviations. The remaining plots examine behaviour close to the first period-doubling transitions.

Original logistic-map time series at r equals 0.9.

Original time series at r=0.9.

Original logistic-map time series at r equals 2.9.

Original time series at r=2.9.

Original logistic-map time series at r equals 3.0.

Original time series at r=3.0.

Original logistic-map time series at r equals 3.449.

Original time series at r=3.449.

Original logistic-map time series at r equals 3.544.

Original time series at r=3.544.

Reading a cobweb diagram

The cobweb construction makes the recurrence geometric. From a point on the horizontal axis, I move vertically to \(y=f(x)\) and horizontally to \(y=x\). Repeating those two steps produces the successive iterates. An inward cobweb indicates convergence; a persistent loop reveals a cycle.

I used an initial value of \(x_0=0.1\) for the cobweb diagrams, with the same five parameter values as the time series.

Building the bifurcation diagram

For the wider sweep, I used \(r=2:0.01:4\), \(x_0=0.1\) and an array of 1,000 entries at each parameter value, including the initial state. The code plots array indices 900 through 1,000 inclusive, retaining 101 points after the earlier transient. Those retained iterates form Figure 1.

At first, a single branch records convergence towards the stable fixed point. The branch splits as a two-cycle appears, and then splits again. My report interprets the increasingly rapid splitting as a period-doubling route towards the onset of irregular behaviour, using \(r_\infty\approx3.569946\) as its reference value.

At that value I also examined an individual time series and cobweb. The finite time series contains short stretches that resemble lower-period patterns without maintaining one throughout the displayed run. In the report, I interpreted this as evidence of the changing behaviour near the accumulation point.

Original finite logistic-map time series at r equals 3.569946.
Figure 2: Original time series at r=3.569946.

Original cobweb with multiple closely spaced passes at r equals 3.569946.

The corresponding original cobweb at r=3.569946.

Looking for periodic windows

I then used iterated maps in Desmos. For a candidate three-cycle, I plotted \(y=x\) and \(y=f(f(f(x)))\) and varied \(r\) to look for new intersections. I repeated the idea with higher iterates and compared the candidates with MATLAB time series.

The report records the following approximate values and interpretations:

Parameter used Interpretation recorded in the report
\(r\approx3.828\) Candidate onset of a three-cycle
\(r\approx3.74\) Five-cycle example
\(r\approx3.64\) Candidate six-cycle pattern
\(r=3.701\) A transient pattern described as the ghost of a seven-cycle

The later periodic patterns differ from the initial period-doubling sequence. Intersections of the iterated maps helped me locate candidate periods, and the corresponding time series show how those patterns appear in the iterates.

MATLAB implementation

The MATLAB listings below show how I generated the time series, cobwebs and bifurcation diagram.

clear; clc; close all;
r_values = [0.9, 2.9, 3, 3.449, 3.544];
N = 50;
for i = 1:5
    r = r_values(i);
    x0 = 0.1;
    x = zeros(1, N);
    x(1) = x0;
    for n = 1:N
        x(n+1) = r*x(n)*(1-x(n));
    end
    y0 = 1.5;
    y = zeros(1, N);
    y(1) = y0;
    for n = 1:N
        y(n+1) = r*y(n)*(1-y(n));
    end
    figure;
    plot(0:N, x, 'b-o', 'LineWidth', 1.2);
    hold on;
    plot(0:N, y, 'r--o', 'LineWidth', 1.2);
    xlabel('Iteration n'); ylabel('x_n');
    title(['Logistic Map Time Series (r = ', num2str(r), ')']);
    legend('x_0 = 0.1', 'x_0 = 1.5', 'Location', 'best');
    grid on; box on;
    ylim([0, max([x y]) + 0.1]);
end
clear; clc; close all;
r_values = [0.9, 2.9, 3, 3.449, 3.544];
x0 = 0.1; N = 50;
for i = 1:5
    r = r_values(i);
    f = @(x) r*x.*(1-x);
    figure; hold on; box on; grid on;
    fplot(f, [0 1], 'b', 'LineWidth', 1.2);
    fplot(@(x) x, [0 1], 'k--', 'LineWidth', 1);
    xlabel('x_n'); ylabel('x_{n+1}');
    title(['Cobweb Diagram (r = ', num2str(r), ...
           ', x_0 = ', num2str(x0), ')']);
    x = x0;
    for n = 1:N
        x_next = f(x);
        plot([x x], [x x_next], 'r', 'LineWidth', 1);
        plot([x x_next], [x_next x_next], 'r', 'LineWidth', 1);
        x = x_next;
    end
    plot(x0, 0, 'ro', 'MarkerFaceColor', 'none', 'MarkerSize', 6);
    xlim([0 1]); ylim([0 1]);
end
clear; clc; close all;
r_vec = 2:0.01:4;
x0 = 0.1; N = 1000;
figure; hold on;
for k = 1:length(r_vec)
    r = r_vec(k);
    x = zeros(1, N);
    x(1) = x0;
    for n = 1:N-1
        x(n+1) = r*x(n)*(1-x(n));
    end
    r_values = r * ones(1, 101);
    plot(r_values, x(900:1000), '.', ...
         'Color', [0.2 0.6 1], 'MarkerSize', 4);
end
xlabel('r'); ylabel('x');
title('Bifurcation Diagram of the Logistic Map');
xlim([2 4]); ylim([0 1]);
grid on; box on; hold off;

What the investigation established

The fixed-point calculation gives precise local stability intervals and identifies the transcritical and flip transitions. The numerical work places those results in a much wider picture: repeated splitting, irregular finite trajectories and periodic windows appearing inside a complicated parameter range.

A change in the growth parameter can take this simple recurrence from a stable fixed point through repeated period doubling. Near the accumulation point the finite trajectories show irregular behaviour, while at larger parameter values periodic patterns reappear.

Reference used in the report

S. H. Strogatz, Nonlinear Dynamics and Chaos, 2nd ed., Chapman & Hall/CRC, 2015.

Originally completed as part of MAM2042S · Non-linear Dynamics, University of Cape Town, 2025.