Cobweb Diagram
Visualize fixed-point iteration \(x_{n+1}=f(x_n)\) — watch convergence, period-doubling, and chaos unfold step by step.
What is a Cobweb Diagram?
A cobweb diagram (also called a Verhulst diagram or staircase diagram) is a graphical method for visualizing the iterates of a one-dimensional map \(f : \mathbb{R} \to \mathbb{R}\). Given an initial condition \(x_0\), the sequence \(x_1=f(x_0),\; x_2=f(x_1),\ldots\) is generated by repeated function application. The diagram draws two curves — the graph of \(y=f(x)\) and the diagonal \(y=x\) — and traces a zigzag path that encodes every iterate:
- Start at \((x_0, x_0)\) on the diagonal.
- Move vertically to \((x_0, f(x_0))\) on the curve — this gives \(x_1\).
- Move horizontally to \((x_1, x_1)\) on the diagonal — this "transfers" \(x_1\) to the \(x\)-axis.
- Repeat. The path's long-term behavior reveals stability, periodicity, or chaos.
Fixed Points & Their Location
A fixed point \(x^*\) satisfies \(f(x^*)=x^*\), i.e., it lies at the intersection of the curve \(y=f(x)\) and the diagonal \(y=x\). Every fixed point appears as a corner where the cobweb path could get "stuck" permanently.
Stability Classification via the Derivative
The local stability of \(x^*\) is governed entirely by the magnitude of \(f'(x^*)\):
Nearby orbits converge. Cobweb spirals inward.
Special case \(f'(x^*)=0\): superattracting (e.g., Newton's method).
Nearby orbits diverge away. Cobweb spirals outward.
Stability undetermined by linearization alone. Often a bifurcation point.
Dense, unpredictable orbit. Lyapunov exponent \(\lambda > 0\).
Reading the Cobweb Shape
- Inward spiral: \(f'(x^*) \in (-1, 0)\) — oscillatory stable convergence.
- Staircase to the right: \(f'(x^*) \in (0, 1)\) — monotone stable convergence.
- Outward spiral: \(f'(x^*) \in (-\infty,-1)\) — oscillatory divergence.
- Rectangle / 2-cycle: orbit bounces between two values — period-2 orbit.
- Dense zig-zag filling a region: chaotic orbit, sensitive to initial conditions.
Periodic Orbits & Period-Doubling Cascade
A period-\(n\) orbit satisfies \(f^n(x^*)=x^*\) but \(f^k(x^*)\ne x^*\) for \(1 \le k < n\). For the logistic map \(f(x)=rx(1-x)\), the parameter \(r\) controls behavior:
- \(r \in (1,3)\): unique stable fixed point \(x^*=(r-1)/r\).
- \(r \in (3, 1+\sqrt{6})\approx 3.449\): stable period-2 orbit.
- Successive period-doublings at \(r\approx 3.449,\,3.544,\,3.5644,\ldots\)
- \(r\approx 3.5699\ldots\) (Feigenbaum constant): onset of chaos.
- \(r=4\): fully chaotic; Lyapunov exponent \(\lambda=\ln 2\).
Lyapunov Exponent & Chaos
The Lyapunov exponent measures the average rate of separation of nearby orbits:
- \(\lambda < 0\): attracting — orbits converge (stable fixed point or periodic orbit).
- \(\lambda = 0\): neutral — bifurcation boundary or neutral fixed point.
- \(\lambda > 0\): chaos — exponential divergence of nearby orbits.
The Lyapunov exponent is displayed in real time below the animation controls.
How to Interact
- Scroll or pinch on the cobweb canvas to zoom in/out.
- Drag the canvas to pan the view.
- Double-click the canvas to reset the view.
- Use Play/Step/All to animate, advance one step, or jump to all iterations.
- Drag parameter sliders to see the cobweb change in real time.
- Click anywhere on the cobweb canvas to set a new initial condition \(x_0\).
Interactive cobweb diagram showing the orbit of the selected map under fixed-point iteration. The blue curve is y=f(x), the dashed line is y=x, and the red path traces the iteration. Fixed points appear as coloured dots: green for stable, red for unstable, dark amber for neutral. Use the controls above to animate step by step or all at once.
Stability Classification
● Stable Node
\(0 < f'(x^*) < 1\)
Monotone approach from one side. Staircase cobweb.
↻ Stable Spiral
\(-1 < f'(x^*) < 0\)
Oscillatory approach, alternating sides. Inward spiral cobweb.
★ Superattracting
\(f'(x^*) = 0\)
Fastest possible convergence (e.g., Newton's method near root).
↗ Unstable Node
\(f'(x^*) > 1\)
Monotone escape away from fixed point.
↗ Unstable Spiral
\(f'(x^*) < -1\)
Oscillatory escape, alternating and growing. Outward spiral.
→ Neutral / Bifurcation
\(|f'(x^*)| = 1\)
Stability undetermined by linearization. Period-doubling bifurcation.
~ Period-2 Orbit
Cobweb traces a rectangle, bouncing between two values. Fixed point of \(f\circ f\).
∿ Chaos (\(\lambda>0\))
Dense cobweb filling a region. Sensitive dependence on initial conditions. \(\lambda > 0\).