Models for Population Growth
Exponential growth is the right model only while resources are unlimited. This lesson derives the logistic equation and its closed-form solution, proves where its growth is fastest, adds harvesting and shows the sudden collapse it can cause, and points out that the logistic curve is the sigmoid used all over machine learning.
For the basic exponential model, see Exponential Growth and Decay; for the separation technique used below, see Separable Equations.
From exponential to logistic
The natural growth model says the relative growth rate is a constant . Its solution grows without bound. Real populations slow down as they approach a carrying capacity . The simplest way to encode that is to let the relative growth rate fall linearly from (when is tiny) to 0 (when ):
This is the logistic differential equation. Before solving it, read its behaviour off the right-hand side :
| sign of | behaviour | |
|---|---|---|
| or | 0 | equilibrium solutions |
| positive | increases toward | |
| negative | decreases toward |
So is a stable equilibrium and 0 is unstable.
Solving it
The equation is separable. Partial fractions give , so
Check the limits: as , and , whatever the (positive) starting value.
Theorem (fastest growth at ). On a solution with , the growth rate is largest when , and that maximum rate is .
Proof. is a downward parabola in , with at , giving . Since increases through every value in , the solution passes through exactly once, at , which is the inflection point of the S-curve. ∎
import sympy as sp
t, k, M, P0 = sp.symbols("t k M P_0", positive=True)
P = sp.Function("P")
sol = sp.dsolve(sp.Eq(P(t).diff(t), k * P(t) * (1 - P(t) / M)), P(t), ics={P(0): P0})
print(sp.simplify(sol.rhs))
# a concrete case: M = 1000, k = 0.4 per day, P0 = 50
Pt = sp.simplify(sol.rhs.subs({M: 1000, k: sp.Rational(2, 5), P0: 50}))
print("P(t) =", Pt)
t_star = sp.solve(sp.Eq(Pt, 500), t)[0]
print("P = M/2 at t =", t_star, "≈", round(float(t_star), 3), "days")
print("max rate kM/4 =", sp.Rational(2, 5) * 1000 / 4, "per day")M*P_0*exp(k*t)/(M + P_0*exp(k*t) - P_0)
P(t) = 1000*exp(2*t/5)/(exp(2*t/5) + 19)
P = M/2 at t = 5*log(19)/2 ≈ 7.361 days
max rate kM/4 = 100 per day
SymPy's form is ours with numerator and denominator multiplied by . In the concrete case , so days.
Harvesting and tipping points
Suppose a fishery removes a constant fish per year: . Equilibria solve , a quadratic. Its discriminant is positive exactly when , giving two equilibria: the upper one is stable, the lower one is a threshold (below it the stock collapses to 0). At they merge, and for any larger there is no equilibrium at all: the population dies out from every starting point. This merging-and-vanishing is a saddle-node bifurcation, and it explains why a small increase in quota can destroy a fishery that had been stable for years.
import numpy as np
k, M = 0.5, 10_000 # growth per year, carrying capacity
print("critical harvest kM/4 =", k * M / 4)
for h in (500, 1000, 1250, 1300):
roots = np.roots([-k / M, k, -h]) # -k/M·P² + kP - h = 0
real = sorted(float(r.real) for r in roots if abs(r.imag) < 1e-9)
print(f"h = {h:5d}:", [round(r, 1) for r in real] if real else "no equilibrium (collapse)")critical harvest kM/4 = 1250.0
h = 500: [1127.0, 8873.0]
h = 1000: [2763.9, 7236.1]
h = 1250: [5000.0, 5000.0]
h = 1300: no equilibrium (collapse)
Other growth models
| Model | Equation | Feature |
|---|---|---|
| Natural growth | constant relative growth | |
| Logistic | symmetric S-curve, inflection at | |
| Gompertz | asymmetric S-curve, inflection at (tumour growth, product adoption) | |
| Allee effect | below the threshold the population dies out | |
| Harvesting | collapse when |
Fitting a logistic curve to data
Given counts over time, estimate and with least squares. The data below are generated from a logistic curve plus seeded noise, so the fit should recover parameters near the true , , .
import numpy as np
from scipy.optimize import curve_fit
def logistic(t, M, k, P0):
return M / (1 + (M - P0) / P0 * np.exp(-k * t))
rng = np.random.default_rng(7)
t = np.arange(0, 16)
data = logistic(t, 800, 0.6, 20) + rng.normal(0, 15, t.size)
(M, k, P0), _ = curve_fit(logistic, t, data, p0=[1000, 0.5, 10])
print(f"M ≈ {M:.1f}, k ≈ {k:.3f}, P0 ≈ {P0:.1f}")
print(f"forecast P(25) ≈ {logistic(25, M, k, P0):.1f}")M ≈ 798.1, k ≈ 0.620, P0 ≈ 17.6
forecast P(25) ≈ 798.0
Note: Forecasting with a logistic fit is fragile before the inflection point: early data look exponential and barely constrain . Many failed epidemic and user-growth forecasts are this effect.
In software
- The sigmoid is the logistic solution. With , , , the solution is , the activation in logistic regression and classic neural networks. The logistic equation itself is the famous identity , which makes backpropagation through a sigmoid cheap.
- Adoption curves: growth teams fit logistic or Gompertz curves to daily active users to estimate market saturation .
- Epidemics: early in an SIR model the infected count is approximately logistic; contact-tracing apps and capacity planning used such fits.
- Simulations and games: city builders and ecosystem simulations update populations with a discrete logistic step . Too large a makes that update oscillate or turn chaotic (the logistic map), even though the ODE never does.
Exercises
Exercise 1: Read the equilibria
For , list the equilibria, say which is stable, and give the largest possible growth rate.
Answer
Equilibria (unstable) and (stable); largest rate per unit time, reached at .
Solution
Exercise 2: Half-way time
With , , , when does the population reach 300?
Answer
Solution
import math
print(round(math.log(14) / 0.3, 3))8.797
Exercise 3: Sustainable quota
A lake has per year and fish. What is the largest constant annual catch that does not eventually wipe out the population (for a suitable starting stock), and at what stock does it balance?
Answer
fish per year, balanced at .
Solution
Equilibria need , which has a solution only when , which is , at . (At exactly the equilibrium is semi-stable: any dip below 2500 leads to collapse, so real quotas stay well below it.)
Exercise 4: Discrete logistic gone wrong
Iterate from for 60 steps with , and , and print the last four values (rounded to 4 places). What do you see?
Answer
and settle at 1 (1.8 after damped oscillation), while never settles: the values jump around irregularly (chaos), unlike the ODE.
Solution
The step is Euler's method for with playing the role of . Linearising at the fixed point 1 gives a multiplier : convergence needs , i.e. . Beyond 2 the fixed point is unstable and the map period-doubles into chaos.
for r in (0.5, 1.8, 2.7):
P = 0.1
tail = []
for n in range(60):
P = P + r * P * (1 - P)
if n >= 56:
tail.append(round(P, 4))
print(f"r = {r}: {tail}")r = 0.5: [1.0, 1.0, 1.0, 1.0]
r = 1.8: [1.0, 1.0, 1.0, 1.0]
r = 2.7: [0.4735, 1.1466, 0.6927, 1.2674]
Test yourself
On a logistic solution starting below , the population grows fastest when equals…
The sigmoid satisfies which differential equation?
With harvesting , what happens when exceeds ?
- The carrying capacity rises
- There is no equilibrium and the population collapses
- The population oscillates forever
- Nothing changes