TExcelTAD
Home › Differential Equations › Population Models and Harvesting

Population Models and Harvesting

Population dynamics is where differential equations meet data most directly: fisheries, wildlife management, bacteria in a bioreactor, users of an app. This lesson collects the standard single-species models, fits one to data, and studies harvesting policies, using tools from Separable Equations and Autonomous Equations.

Three models

Model Equation Behaviour
Exponential (Malthus) P′=rPP' = rP unlimited growth, doubling time ln⁡2r\frac{\ln 2}{r}
Logistic (Verhulst) P′=rP(1−PK)P' = rP\left(1 - \frac{P}{K}\right) S-curve to the carrying capacity KK
Gompertz P′=rPln⁡KPP' = rP\ln\frac{K}{P} S-curve with an earlier, slower approach; used for tumour growth
Allee effect P′=rP(PA−1)(1−PK)P' = rP\left(\frac{P}{A} - 1\right)\left(1 - \frac{P}{K}\right) extinction below the threshold AA

The Allee effect models species that need a minimum density to find mates or defend themselves: 00 and KK are stable, AA is an unstable threshold.

python · try it yourself
import numpy as np
from scipy.integrate import solve_ivp

r, K, A = 0.5, 1000.0, 100.0
models = {
    "logistic": lambda t, P: r * P * (1 - P / K),
    "Gompertz": lambda t, P: r * P * np.log(K / P),
    "Allee":    lambda t, P: r * P * (P / A - 1) * (1 - P / K),
}
for name, f in models.items():
    for P0 in (50.0, 150.0):
        sol = solve_ivp(f, (0, 30), [P0], t_eval=[5, 10, 30], rtol=1e-9, atol=1e-9)
        print(f"{name:9s} P0 = {P0:5.0f}: P(5, 10, 30) =", np.round(sol.y[0], 1))
logistic  P0 =    50: P(5, 10, 30) = [ 390.7  886.5 1000. ]
logistic  P0 =   150: P(5, 10, 30) = [ 682.5  963.2 1000. ]
Gompertz  P0 =    50: P(5, 10, 30) = [ 782.  980. 1000.]
Gompertz  P0 =   150: P(5, 10, 30) = [ 855.8  987.3 1000. ]
Allee     P0 =    50: P(5, 10, 30) = [8.  0.7 0. ]
Allee     P0 =   150: P(5, 10, 30) = [1000. 1000. 1000.]

With P0=50P_0 = 50 (below the Allee threshold 100), the Allee population dies out while the others thrive.

Fitting the logistic model to data

Given counts over time, estimate rr and KK by least squares on the closed-form solution. The data below are synthetic, generated from known parameters with a seeded random generator, so we can check the fit recovers them.

python · try it yourself
import numpy as np
from scipy.optimize import curve_fit

def logistic(t, r, K, P0):
    return K / (1 + (K / P0 - 1) * np.exp(-r * t))

rng = np.random.default_rng(42)
t = np.arange(0, 21, 2.0)
true = (0.45, 800.0, 20.0)
data = logistic(t, *true) * (1 + 0.05 * rng.normal(size=t.size))
params, cov = curve_fit(logistic, t, data, p0=(0.3, 600, 10))
err = np.sqrt(np.diag(cov))
for name, p, e, tv in zip(("r", "K", "P0"), params, err, true):
    print(f"{name:2s} = {p:8.3f} +- {e:6.3f}   (true {tv})")
r  =    0.419 +-  0.027   (true 0.45)
K  =  809.194 +- 14.599   (true 800.0)
P0 =   22.879 +-  4.908   (true 20.0)

All three estimates lie within about one standard error of the true values. KK is the best determined parameter (2 % relative error) because the data reach the plateau.

Harvesting: constant quota versus constant effort

Constant quota P′=rP(1−P/K)−HP' = rP(1 - P/K) - H: the maximum sustainable yield is H=rK4H = \frac{rK}{4}, taken at P=K2P = \frac{K}{2}. But at that quota the equilibrium is semistable, and any bad year drives the stock to collapse. Quotas near the maximum are dangerous.

Constant effort P′=rP(1−P/K)−EPP' = rP(1 - P/K) - EP (catch proportional to stock): the equilibrium P∗=K(1−Er)P^* = K\left(1 - \frac{E}{r}\right) is stable for E<rE < r, and the yield EP∗EP^* is largest at E=r2E = \frac{r}{2}, giving the same rK4\frac{rK}{4}, but now the system recovers from shocks.

python · try it yourself
import numpy as np
from scipy.integrate import solve_ivp

r, K = 0.5, 1000.0
quota = lambda t, P: r * P * (1 - P / K) - 0.95 * r * K / 4
effort = lambda t, P: r * P * (1 - P / K) - (r / 2) * P
for name, f in (("95% of max quota", quota), ("optimal effort  ", effort)):
    for P0 in (500.0, 300.0):                  # healthy stock, and a stock hit by a bad year
        dead = lambda t, P: P[0] - 1.0; dead.terminal = True
        sol = solve_ivp(f, (0, 200), [P0], events=dead, rtol=1e-9)
        end = "collapse at t = %.1f" % sol.t_events[0][0] if sol.t_events[0].size else "P(200) = %.1f" % sol.y[0][-1]
        print(f"{name} from P0 = {P0:.0f}: {end}")
95% of max quota from P0 = 500: P(200) = 611.8
95% of max quota from P0 = 300: collapse at t = 7.2
optimal effort   from P0 = 500: P(200) = 500.0
optimal effort   from P0 = 300: P(200) = 500.0

In software

  • Fisheries agencies run age-structured versions of these models (systems of ODEs or difference equations) to set catch limits.
  • Product analytics fit logistic and Gompertz curves to user adoption; the fitted KK is the "market size" estimate, and its error bar is usually much larger than people would like.

Exercises

Exercise 1: Doubling time

A bacterial culture grows exponentially and doubles every 20 minutes. What is rr per hour?

Answer

r=3ln⁡2≈2.079r = 3\ln 2 \approx 2.079 per hour.

Solution

er⋅1/3=2e^{r \cdot 1/3} = 2 gives r=3ln⁡2r = 3\ln 2.

Exercise 2: Maximum sustainable yield

For r=0.8r = 0.8 per year and K=50,000K = 50{,}000 fish, what is the maximum sustainable yield, and at which stock is it taken?

Answer

10,000 fish per year at a stock of 25,000.

Solution

rK4=0.8⋅50,0004=10,000\frac{rK}{4} = \frac{0.8 \cdot 50{,}000}{4} = 10{,}000, at P=K2P = \frac{K}{2}.

Exercise 3: Allee threshold (code)

For the Allee model of the lesson, starting at P0=99P_0 = 99 and P0=101P_0 = 101, where does each population go?

Answer

P0=99P_0 = 99 dies out; P0=101P_0 = 101 grows to K=1000K = 1000.

Solution

A=100A = 100 is an unstable equilibrium separating the two basins.

python · try it yourself
import numpy as np
from scipy.integrate import solve_ivp
f = lambda t, P: 0.5 * P * (P / 100 - 1) * (1 - P / 1000)
for P0 in (99.0, 101.0):
    print(P0, round(solve_ivp(f, (0, 60), [P0], rtol=1e-10, atol=1e-12).y[0][-1], 3))
99.0 0.0
101.0 1000.0

Test yourself

The maximum sustainable yield of the logistic model with constant quota is…

  1. rKrK
  2. rK/4rK/4
  3. K/2K/2
  4. r/4r/4

The Allee effect means…

  1. populations grow without limit
  2. below a threshold density the population declines to extinction
  3. the carrying capacity is zero
  4. growth is linear

Why is constant-effort harvesting safer than a near-maximal constant quota?

  1. It catches more fish
  2. Its equilibrium is stable, so the stock recovers from shocks
  3. It has no equilibrium
  4. It ignores the stock size