MATH-424 · Lesson 4 of 12 · 24 min
Discrete-time models: difference equations and cobwebs
Many systems change in steps rather than continuously. Walleye spawn once a year in spring, a savings account is credited monthly, and a bus passes one stop after another. A discrete-time model describes the state after each step as a function of the state before it. This lesson develops the basic tools: linear difference equations, fixed points and their stability, cobweb diagrams, and the remarkable behavior of simple nonlinear maps, which can oscillate and even become chaotic. We finish by turning the bus bunching argument of lesson 1 into a difference equation and using it to design a holding strategy.
First-order difference equations
A first-order difference equation, or map, has the form \[x_{t+1} = F(x_t), \qquad t = 0, 1, 2, \dots,\] where \(x_t\) is the state at step \(t\) and \(F\) is a given function. Starting from an initial value \(x_0\), the equation determines \(x_1 = F(x_0)\), \(x_2 = F(x_1)\), and so on. The sequence \(x_0, x_1, x_2, \dots\) is called an orbit. Unlike a differential equation, a difference equation can always be solved numerically exactly, simply by iterating, so the question is never whether a solution exists but how it behaves.
The simplest case is linear growth, \(x_{t+1} = \lambda x_t\), with solution \(x_t = \lambda^tx_0\). If \(|\lambda| < 1\) the orbit tends to 0; if \(|\lambda| > 1\) it grows without bound; if \(\lambda < 0\) it alternates in sign. Adding a constant input gives the affine equation \(x_{t+1} = \lambda x_t + c\). Its fixed point, the value that does not change, solves \(x^* = \lambda x^* + c\), so \(x^* = \frac{c}{1 - \lambda}\) when \(\lambda \ne 1\). Writing \(y_t = x_t - x^*\) gives \(y_{t+1} = \lambda y_t\), so \[x_t = x^* + \lambda^t(x_0 - x^*).\]
Worked problem
Stocking a lake
A pond loses 40% of its trout each year to natural causes and angling, and the hatchery adds 600 young trout each autumn. Starting from 200 trout, find the long-term population and the population after 5 years.
Show solution
- The model is \(x_{t+1} = 0.6x_t + 600\), so \(\lambda = 0.6\) and \(c = 600\).
- The fixed point is \(x^* = \frac{600}{1 - 0.6} = 1500\).
- The solution is \(x_t = 1500 + 0.6^t(200 - 1500) = 1500 - 1300 \times 0.6^t\).
- After 5 years, \(0.6^5 = 0.0778\), so \(x_5 \approx 1500 - 101 = 1399\).
Answer: The population approaches 1500 trout; after 5 years it is about 1400.
Fixed points and linear stability
For a nonlinear map, a fixed point \(x^*\) satisfies \(F(x^*) = x^*\). To decide whether nearby orbits approach it, linearize. Write \(x_t = x^* + y_t\) with \(y_t\) small. Then by Taylor's theorem \[x^* + y_{t+1} = F(x^* + y_t) = F(x^*) + F^\prime(x^*)y_t + O(y_t^2),\] so to first order \(y_{t+1} \approx F^\prime(x^*)y_t\). The perturbation behaves like the linear equation with \(\lambda = F^\prime(x^*)\).
Theorem 4.1 (linear stability of fixed points). Let \(F\) be continuously differentiable near a fixed point \(x^*\). If \(|F^\prime(x^*)| < 1\), then \(x^*\) is locally asymptotically stable: orbits starting close enough to \(x^*\) converge to it. If \(|F^\prime(x^*)| > 1\), then \(x^*\) is unstable. If \(0 < F^\prime(x^*) < 1\) the approach is monotone, and if \(-1 < F^\prime(x^*) < 0\) it is oscillatory, with the orbit jumping from one side of \(x^*\) to the other.
Proof sketch for the stable case. Choose \(k\) with \(|F^\prime(x^*)| < k < 1\). By continuity of \(F^\prime\) there is \(\delta > 0\) with \(|F^\prime(x)| \le k\) for \(|x - x^*| \le \delta\). By the mean value theorem, if \(|x_t - x^*| \le \delta\) then \(|x_{t+1} - x^*| = |F(x_t) - F(x^*)| \le k|x_t - x^*|\), which is again at most \(\delta\). By induction \(|x_t - x^*| \le k^t|x_0 - x^*| \to 0\). This is the same contraction argument that proves the Banach fixed point theorem. \(\square\)
When \(|F^\prime(x^*)| = 1\) the linear test is inconclusive and higher-order terms decide. Such borderline cases mark the boundaries between different kinds of behavior and are called bifurcation points.
Cobweb diagrams
A cobweb diagram shows the orbit of a one-dimensional map geometrically. Plot the graph \(y = F(x)\) together with the diagonal \(y = x\); fixed points are where they cross. From \((x_0, x_0)\) on the diagonal, move vertically to the graph, reaching \((x_0, x_1)\), then horizontally back to the diagonal at \((x_1, x_1)\), then vertically to \((x_1, x_2)\), and so on. The staircase or spiral that results shows at a glance whether the orbit converges, oscillates or wanders.
Near a fixed point the slope of the graph decides the shape. A slope between 0 and 1 gives a staircase converging monotonically; a slope between \(-1\) and 0 gives a spiral converging with oscillation; a slope below \(-1\) gives a spiral moving outward. This is Theorem 4.1 in pictures, and drawing a cobweb is the fastest way to build intuition about an unfamiliar map.
Spawning stock and recruitment
Walleye in Larch Lake spawn each spring, and the number of young fish that survive to join the adult population, called recruitment, depends on the number of spawners. When spawners are few, recruitment rises in proportion; when they are many, young fish compete for food and are eaten by adults, so recruitment levels off or even declines. Two classical models capture these cases. The Beverton–Holt model \[N_{t+1} = \frac{RN_t}{1 + \frac{(R - 1)N_t}{K}}\] has recruitment that saturates, while the Ricker model \[N_{t+1} = N_te^{r(1 - N_t/K)}\] has recruitment that falls at high density. In both, \(K\) is a positive fixed point, the carrying capacity.
Worked problem
Stability of the Ricker model
Find the fixed points of the Ricker map \(F(N) = Ne^{r(1 - N/K)}\) with \(r > 0\), and decide when the positive one is stable.
Show solution
- Fixed points: \(N = Ne^{r(1 - N/K)}\) gives \(N = 0\) or \(e^{r(1 - N/K)} = 1\), that is \(N = K\).
- Derivative: \(F^\prime(N) = e^{r(1 - N/K)}(1 - \frac{rN}{K})\). So \(F^\prime(0) = e^r > 1\), and the extinction state is unstable.
- At \(N = K\): \(F^\prime(K) = 1 - r\).
- Stability requires \(|1 - r| < 1\), that is \(0 < r < 2\). The approach is monotone for \(r < 1\) and oscillatory for \(1 < r < 2\).
Answer: \(K\) is stable for \(0 < r < 2\), monotonically if \(r < 1\) and with damped oscillations if \(1 < r < 2\); it is unstable for \(r > 2\).
For the Beverton–Holt model, \(F^\prime(K) = \frac{1}{R}\), which lies between 0 and 1 whenever \(R > 1\). Its positive equilibrium is always stable, and the approach is always monotone. The two models agree near equilibrium when \(r\) is small but behave very differently for large \(r\), so the choice between them matters. Fisheries biologists decide between them from stock and recruitment data, which for many species show a clear decline at high spawner numbers.
Beyond stability: cycles and chaos
What happens to the Ricker model when \(r > 2\)? The fixed point is unstable, but orbits remain bounded, since \(F(N) \le \frac{K}{r}e^{r - 1}\) for all \(N\). Just above \(r = 2\) the orbit settles into a cycle of period 2, alternating between a high and a low value. Such a cycle consists of fixed points of the second iterate \(F^2 = F \circ F\), and its stability is decided by \(|(F^2)^\prime| = |F^\prime(p)F^\prime(q)| < 1\), where \(p\) and \(q\) are the two values. As \(r\) increases further the 2-cycle loses stability to a 4-cycle, then an 8-cycle, in a cascade of period doublings that accumulates near \(r \approx 2.69\). Beyond that, for most values of \(r\), the orbit never settles: it is chaotic.
Chaos means sensitive dependence on initial conditions: two orbits that start very close separate exponentially fast, so long-range prediction is impossible even though the model is completely deterministic. Robert May drew attention to this in 1976, pointing out that the simplest nonlinear population models could produce apparently random fluctuations without any external noise. Whether real populations are chaotic is still debated; but the discovery changed how ecologists interpret fluctuating data, since irregular counts need not mean that the environment is irregular.
import math
def ricker(N, r, K=1.0):
return N * math.exp(r * (1 - N / K))
for r in [0.8, 1.8, 2.3, 2.6, 3.0]:
N = 0.2
for _ in range(1000): # discard the transient
N = ricker(N, r)
tail = []
for _ in range(8):
N = ricker(N, r); tail.append(N)
print(f"r = {r}: " + " ".join(f"{x:.3f}" for x in tail))
# sensitive dependence: two orbits starting 1e-9 apart when r = 3.0
a, b = 0.3, 0.3 + 1e-9
for t in range(1, 41):
a, b = ricker(a, 3.0), ricker(b, 3.0)
if t % 8 == 0:
print(f"step {t:2d}: difference {abs(a - b):.2e}")r = 0.8: 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 r = 1.8: 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 r = 2.3: 1.592 0.408 1.592 0.408 1.592 0.408 1.592 0.408 r = 2.6: 1.523 0.391 1.905 0.181 1.523 0.391 1.905 0.181 r = 3.0: 2.331 0.043 0.760 1.562 0.289 2.440 0.032 0.592 step 8: difference 1.52e-08 step 16: difference 1.02e-07 step 24: difference 6.68e-06 step 32: difference 5.11e-04 step 40: difference 3.10e-02
The output shows each regime. For \(r = 0.8\) and \(1.8\) the orbit sits at the equilibrium \(N = K = 1\). For \(r = 2.3\) it alternates between two values, for \(r = 2.6\) it cycles through four, and for \(r = 3.0\) it shows no pattern. The second part shows a difference of one part in a billion growing to the size of the population itself within a few dozen steps.
Bus bunching as a difference equation
Return to Route 9. Let \(d_s\) be the delay of a bus, in minutes behind schedule, as it leaves stop \(s\), and suppose the bus ahead is on time. As computed in lesson 1, the bus finds \(\lambda(H + d_s)\) passengers at the next stop, where \(H\) is the scheduled headway, so its dwell time exceeds the scheduled \(\beta H\) by \(\beta d_s\), where \(\beta = b\lambda\). Thus \[d_{s+1} = (1 + \beta)d_s,\] a linear map with multiplier \(1 + \beta > 1\). The on-time state \(d = 0\) is an unstable fixed point, and any delay grows geometrically, as \(d_s = (1 + \beta)^sd_0\).
A holding strategy changes the map. Suppose that at every stop where a bus is early, or at a timing point, a controller removes a fraction \(\alpha\) of the current deviation, by holding early buses and by telling late buses to skip the layover. The map becomes \(d_{s+1} = (1 + \beta)(1 - \alpha)d_s\), which is stable when \((1 + \beta)(1 - \alpha) < 1\), that is \(\alpha > \frac{\beta}{1 + \beta}\). With \(\beta = 0.1\), correcting just over 9% of the deviation at each stop is enough to stop bunching from growing. Real transit agencies implement this through schedules with slack at timing points, and more recently through headway-based control using real-time vehicle locations.
Worked problem
Designing the control
On Route 9, \(\beta = 0.1\). A bus leaves the first stop 2 minutes late. Compare its delay after 15 stops with no control and with \(\alpha = 0.2\).
Show solution
- No control: \(d_{15} = 1.1^{15} \times 2 \approx 4.18 \times 2 = 8.4\) minutes.
- With control: the multiplier is \(1.1 \times 0.8 = 0.88\), so \(d_{15} = 0.88^{15} \times 2 \approx 0.147 \times 2 = 0.29\) minutes.
- The control turns an unstable map into a stable one, and the delay decays instead of growing.
Answer: About 8.4 minutes late without control, about 0.3 minutes with \(\alpha = 0.2\).
Higher-order equations and systems
Some discrete models involve more than one past value, such as \(x_{t+1} = ax_t + bx_{t-1}\). Trying \(x_t = \mu^t\) gives the characteristic equation \(\mu^2 = a\mu + b\), and the general solution is a combination of \(\mu_1^t\) and \(\mu_2^t\). The solution decays to zero exactly when both roots satisfy \(|\mu| < 1\). Equivalently, writing \(u_t = (x_t, x_{t-1})\) turns the equation into a first-order system \(u_{t+1} = Au_t\) whose eigenvalues are the roots. Age-structured population models, with separate counts of juveniles and adults, are systems of exactly this kind. Their long-run growth rate is the dominant eigenvalue of a matrix called the Leslie matrix, and lesson 9 meets a closely related matrix in Markov chains.
Common mistakes
MistakeTesting stability with the sign of the derivative instead of its absolute value.
InsteadA fixed point of a map is stable when \(|F^\prime(x^*)| < 1\); a derivative of \(-1.5\) gives an unstable, oscillating fixed point.
MistakeAssuming a discrete model behaves like the continuous model with the same rate.
InsteadThe logistic differential equation always approaches K; the Ricker map with r > 2 does not.
MistakeReading chaos as randomness in the model.
InsteadChaotic maps are deterministic; their unpredictability comes from sensitive dependence on initial conditions.
MistakeDrawing a cobweb by moving horizontally first.
InsteadStart on the diagonal, move vertically to the graph, then horizontally back to the diagonal.
Summary and key terms
- A map \(x_{t+1} = F(x_t)\) generates an orbit by iteration; fixed points solve \(F(x^*) = x^*\).
- The affine equation \(x_{t+1} = \lambda x_t + c\) has solution \(x_t = x^* + \lambda^t(x_0 - x^*)\).
- A fixed point is stable if \(|F^\prime(x^*)| < 1\) and unstable if \(|F^\prime(x^*)| > 1\); a negative derivative gives oscillation.
- The Ricker equilibrium is stable for \(0 < r < 2\), then period doubling leads to chaos near \(r \approx 2.69\).
- Bus delays obey \(d_{s+1} = (1 + \beta)d_s\), which is unstable; holding a fraction \(\alpha > \frac{\beta}{1 + \beta}\) stabilizes it.
- Higher-order linear equations are analyzed through their characteristic roots or as first-order systems.
- Orbit
- The sequence \(x_0, F(x_0), F(F(x_0)), \dots\) generated by a map.
- Fixed point
- A state with \(F(x^*) = x^*\).
- Cobweb diagram
- A graphical construction of an orbit using the graph of F and the diagonal.
- Period doubling
- A bifurcation in which a cycle of period p is replaced by a stable cycle of period 2p.
- Chaos
- Bounded, aperiodic behavior with sensitive dependence on initial conditions.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Solve \(x_{t+1} = 1.05x_t - 100\) with \(x_0 = 1000\). Describe the long-run behavior.
Show answer
\(x^* = \frac{-100}{1 - 1.05} = 2000\), so \(x_t = 2000 - 1000 \times 1.05^t\), which decreases and becomes negative after about 15 steps: the fixed point is unstable.
Find the fixed points of \(x_{t+1} = 3x_t(1 - x_t)\) and classify them.
Show answer
\(x = 0\) with \(F^\prime = 3\), unstable; \(x = \frac{2}{3}\) with \(F^\prime = 3 - 6 \cdot \frac{2}{3} = -1\), the borderline case where a 2-cycle is born.
Show that the Beverton–Holt map has \(F^\prime(K) = \frac{1}{R}\).
Show answer
\(F^\prime(N) = \frac{R}{(1 + (R - 1)N/K)^2}\); at \(N = K\) the denominator is \(R^2\).
For the bus model with \(\beta = 0.25\), what is the smallest fraction \(\alpha\) of the deviation that must be corrected at each stop?
Show answer
\(\alpha > \frac{0.25}{1.25} = 0.2\).
Find the general solution of \(x_{t+1} = x_t + 2x_{t-1}\).
Show answer
The characteristic equation \(\mu^2 = \mu + 2\) has roots 2 and \(-1\), so \(x_t = A2^t + B(-1)^t\).
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.