Iterated maps

Eugeniy E. Mikhailov and Greg Bentsen

Agenda

Today


Big idea:  Simple deterministic rules can generate surprisingly complicated behavior when repeated over and over.


Three examples:

Iterated Maps

Iterated maps

An iterated map repeatedly applies the same rule:

xn+1=F(xn).x_{n+1} = F(x_n).

Starting from an initial value x0x_0, we generate an orbit

x0,x1,x2,x3,…x_0,\quad x_1,\quad x_2,\quad x_3,\quad \ldots

Computationally:

x = x0

for n in range(N):
    x = F(x)


Today we will ask:

What happens after we apply FF over and over again?

A simple linear example

Consider the iterated linear map

F(x)=ax. F(x)=a x.

Starting from x0x_0, the orbit is x0,ax0,a2x0,…,x_0, \quad a x_0, \quad a^2 x_0, \quad \ldots, \quad The exact solution is therefore

xn=anx0. x_n=a^n x_0.

Different values of aa give qualitatively different long-time behavior. Starting from x0=1x_0=1:

a=12a=\frac{1}{2} convergence to 00

1,12,14,18,⋯,0 1, \quad \frac12, \quad \frac14, \quad \frac18, \quad \cdots, \quad 0


a=−12a=-\frac{1}{2} oscillatory convergence to 00

1,−12,14,−18,⋯,0 1, \quad -\frac12, \quad \frac14, \quad -\frac18, \quad \cdots, \quad 0

a=−1a=-1 persistent oscillation

1,−1,1,−1,⋯ 1, \quad -1, \quad 1, \quad -1, \quad \cdots



a=2a=2 divergence

1,2,4,8,⋯ 1, \quad 2, \quad 4, \quad 8, \quad \cdots

Fixed points

A fixed point x*x^* satisfies

F(x*)=x*F(x^*) = x^*

meaning that the orbit is constant for all time.


If the orbit approaches x*x^*,

xn→x*,x_n \rightarrow x^*,

then x*x^* is a stable (attractive) fixed point.

If the orbit diverges from the fixed point, it is repulsive.

Stability of a fixed point

Suppose we start close to a fixed point:

xn=x*+δn.x_n = x^* + \delta_n.

For small δn\delta_n we may Taylor expand:

F(x*+δn)≈F(x*)+F′(x*)δn=x*+δn+1 \begin{aligned} F(x^*+\delta_n) &\approx F(x^*) + F'(x^*)\delta_n \\ &= x^* + \delta_{n+1} \end{aligned}

Since F(x*)=x*F(x^*)=x^*,

δn+1≈F′(x*)δn.\delta_{n+1} \approx F'(x^*)\delta_n.

Therefore:

|F′(x*)|<1⇒stable|F'(x^*)| < 1 \quad \Rightarrow \quad \text{stable}

|F′(x*)|>1⇒unstable|F'(x^*)| > 1 \quad \Rightarrow \quad \text{unstable}


Stability in the linear example

F(x)=ax. F(x)=a x.

Since

F′(x)=a, F'(x)=a,

the fixed point x*=0x^*=0 is stable when

|a|<1,a=12:1,12,14,18,⋯,0 |a|<1, \quad \quad \quad \quad \quad \quad \quad a = \frac{1}{2}: \quad \quad 1, \quad \frac12, \quad \frac14, \quad \frac18, \quad \cdots, \quad 0

and unstable when

|a|>1,a=2:1,2,4,8,⋯ |a|>1, \quad \quad \quad \quad \quad \quad a = 2: \quad \quad 1, \quad 2, \quad 4, \quad 8, \quad \cdots

and marginal when

|a|=1,a=−1:1,−1,1,−1,⋯ |a|=1, \quad \quad \quad \quad \quad \quad a = -1: \quad \quad 1, \quad -1, \quad 1, \quad -1, \quad \cdots

A nonlinear example

For the linear example, it doesn’t matter what initial condition x0x_0 you choose. The iterated map is globally stable or unstable depending on the parameter aa.

Things get more interesting for nonlinear maps. Consider

F(x)=x2F(x) = x^2

The fixed points x*x^* satisfy x*=(x*)2x^* = (x^*)^2, so we have two fixed points

x*=0,1x^* = 0, \quad 1

Are these fixed points stable or unstable? Use the derivative criterion |F′(x)|<1|F'(x)| < 1.

F′(x)=2xF'(x) = 2 x

Cobweb plots

We can find and study fixed points visually in the x−yx-y plane.

To do this, let’s split each step of the iterated map onto two pieces:

y=F(x)x=yy = F(x) \quad \quad \quad \quad x = y

Fixed points satisfy F(x*)=x*F(x^*) = x^*. This can be viewed as the intersection of these two functions.

And long-term behavior can be viewed as “ping-ponging” back and forth between these two functions.

F(x) = a x, a = 1/2
F(x)=ax,a=1/2F(x) = a x, a = 1/2
F(x) = x^2
F(x)=x2F(x) = x^2

Newton-Raphson as an Iterated Map

Newton-Raphson revisited

Newton-Raphson finds roots of

f(x)=0f(x)=0

using

xn+1=xn−f(xn)f′(xn).x_{n+1} = x_n-\frac{f(x_n)}{f'(x_n)}.

Define the Newton map

F(x)=x−f(x)f′(x).F(x)=x-\frac{f(x)}{f'(x)}.

Then Newton-Raphson is simply

xn+1=F(xn).x_{n+1}=F(x_n).


Every root x*x^* of ff is a fixed point:

f(x*)=0⇒F(x*)=x*.f(x^*)=0 \quad\Rightarrow\quad F(x^*)=x^*.

Root-finding in the complex plane

Consider finding roots of

f(z)=z3−1.f(z)=z^3-1.

The roots are complex

z1=1,z_1=1,

z2=e2πi/3,z3=e4πi/3.z_2=e^{2\pi i/3}, \qquad z_3=e^{4\pi i/3}.

Q: can we find these roots via Newton-Raphson? From the previous slide we obtain the Newton map:

F(z)=z−f(z)f′(z)=z−z3−13z2 F(z) = z-\frac{f(z)}{f'(z)} = z-\frac{z^3-1}{3z^2}

or

F(z)=23z+13z2 F(z) = \frac{2}{3}z+\frac{1}{3z^2}

Clearly the roots z1,z2,z3z_1,z_2,z_3 are fixed points of this map.

Question:  Given an initial guess z0z_0, which root does Newton-Raphson find?

Demo: Newton-Raphson in the complex plane

For each starting point

z0=x+iy,z_0=x+iy,

run Newton-Raphson until it converges.

Color the starting point according to the root it reaches.


Algorithm:

  1. Make a grid of initial conditions z0z_0.
  2. Iterate Newton-Raphson at every point.
  3. Determine which root each point approaches.
  4. Assign each root a different color.

Basins of attraction

Each root has a basin of attraction:

Bi={z0:zn→zi}.B_i = \left\{ z_0: z_n \rightarrow z_i \right\}.

Points in the same basin converge to the same root.

Source: https://paulbourke.net/fractals/newtonraphson/
Source: https://paulbourke.net/fractals/newtonraphson/

What happens near the boundary?

Points that begin very close together can converge to different roots.

Zooming into the boundary reveals new structure at smaller and smaller scales.


This is our first example of a fractal.

A useful working definition:

A fractal has nontrivial structure that persists as we examine it at finer scales.

A lesson from Newton-Raphson

Newton-Raphson is:

Yet its global behavior can be extremely complicated.


The complexity does not come from randomness.

It comes from repeatedly applying a nonlinear map.


Simple rule + iteration →\rightarrow complex structure

Mandelbrot Set

An even simpler map

Consider

zn+1=zn2+c\boxed{ z_{n+1}=z_n^2+c }

with

z0=0z_0=0

and c=a+ibc = a+i b a complex number.

For each complex value of cc, generate the orbit

0,c,c2+c,…0,\quad c,\quad c^2+c,\quad \ldots

Then ask:

Does the orbit remain bounded, or does it escape to infinity?

Demo: iterate zn+1=zn2+cz_{n+1}=z_n^2+c

For one value of cc:

z = 0

for n in range(N):
    z = z*z + c

    if abs(z) > 2:
        break

Try several choices of cc.

Observe:

The Mandelbrot set

The Mandelbrot set is the collection of parameters cc for which the orbit remains bounded:

ℳ={c∈ℂ:zn+1=zn2+c,z0=0 remains bounded}. \mathcal{M} = \left\{ c\in\mathbb{C}: z_{n+1}=z_n^2+c,\; z_0=0 \text{ remains bounded} \right\}.

The Mandelbrot set, fractals, and self-similarity

Newton fractal vs. Mandelbrot set

Newton fractal Mandelbrot set
Fix the map Change the map
Vary the initial condition z0z_0 Vary the parameter cc
Ask: Which attractor? Ask: Bounded or unbounded?


Both reveal complicated structure by running a simple algorithm many times.


Computational strategy:  Scan over many inputs, iterate, then classify the long-time behavior.

Logistic Map

Population growth

Suppose xnx_n is the population during generation nn, normalized so that

0≤xn≤1.0\leq x_n\leq 1.

With unlimited resources, we might expect

xn+1=rxn.x_{n+1}=r x_n.

But unlimited exponential growth is unrealistic.

Growth should slow when the population becomes large.

The logistic map

A simple discrete model is

xn+1=rxn(1−xn).\boxed{ x_{n+1}=r x_n(1-x_n) }.

Interpretation:

xn⏟current population(1−xn)⏟limited resourcesr⏟growth parameter \underbrace{x_n}_{\text{current population}} \; \underbrace{(1-x_n)}_{\text{limited resources}} \; \underbrace{r}_{\text{growth parameter}}

For 0≤r≤40\leq r\leq4 and suitable initial conditions, the population remains between 0 and 1.


Question:  What happens to the population after many generations?

Fixed points of the logistic map

A fixed population satisfies

x*=rx*(1−x*).x^*=r x^*(1-x^*).

Therefore the two fixed points are

x*=0x^*=0

and

x*=1−1r.x^*=1-\frac{1}{r}.

But finding fixed points is not enough.


We must also ask:

Is the fixed point stable?

Stability changes as rr changes

For

F(x)=rx(1−x),F(x)=rx(1-x),

we have

F′(x)=r(1−2x).F'(x)=r(1-2x).

At the trivial fixed point x*=0x^* = 0 we have F′(0)=rF'(0) = r, so this point is stable for 0≤r<10 \leq r < 1.


At the nonzero fixed point x*=1−1/rx^* = 1 - 1/r,

F′(x*)=2−rF'(x^*)=2-r

So stability |F′(x*)|<1|F'(x^*)| < 1 requires 1<r<3.1<r<3.


At r=3r=3, the fixed point loses stability.

What replaces it?

Demo: change the growth parameter

Start from the same initial population, for example

x0=0.2.x_0=0.2.

Try:

r=0.8r=0.8

r=2.0r=2.0

r=3.2r=3.2

r=3.5r=3.5

r=3.9r=3.9


Observe the long-time population.

From stability to oscillation

As rr increases:


This sequence is called period doubling:

1→2→4→8→⋯1 \rightarrow 2 \rightarrow 4 \rightarrow 8 \rightarrow \cdots

The bifurcation diagram

For each rr:

  1. Choose an initial condition x0x_0.
  2. Iterate many times to remove the transient behavior.
  3. Plot the next several values of xnx_n.
  4. Repeat for many values of rr.

Deterministic chaos

In the chaotic regime, two nearby initial populations

x0andx0+ϵx_0 \qquad\text{and}\qquad x_0+\epsilon

can eventually produce very different trajectories.


The system is still completely deterministic.

There is no random number generator.


This is deterministic chaos:

simple equations + sensitivity to initial conditions + long-time unpredictability

Review

Three maps, one idea

Newton-Raphson:

zn+1=zn−f(zn)f′(zn) z_{n+1} = z_n-\frac{f(z_n)}{f'(z_n)}

Which fixed point do we reach?


Mandelbrot:

zn+1=zn2+c z_{n+1}=z_n^2+c

Does the orbit remain bounded?


Logistic:

xn+1=rxn(1−xn) x_{n+1}=rx_n(1-x_n)

What long-time behavior emerges?

The computational pattern

For each problem:

  1. Choose a map FF.
  2. Choose an initial condition.
  3. Iterate: xn+1=F(xn).x_{n+1}=F(x_n).
  4. Discard transient behavior when appropriate.
  5. Classify or visualize the long-time behavior.
  6. Repeat over many initial conditions or parameters.


A few lines of code can reveal structures that are very difficult to anticipate analytically.

Takeaways


Simple deterministic rules can generate extraordinarily complex behavior.