TExcelTAD
Home › Calculus in Depth › Models for Population Growth

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 dPdt=kP\frac{dP}{dt} = kP says the relative growth rate 1P⋅dPdt\frac{1}{P} \cdot \frac{dP}{dt} is a constant kk. Its solution P=P0ektP = P_0 e^{kt} grows without bound. Real populations slow down as they approach a carrying capacity MM. The simplest way to encode that is to let the relative growth rate fall linearly from kk (when PP is tiny) to 0 (when P=MP = M):

1P⋅dPdt=k(1−PM)  ⟺  dPdt=kP(1−PM)\frac{1}{P} \cdot \frac{dP}{dt} = k\left(1 - \frac{P}{M}\right) \quad \iff \quad \frac{dP}{dt} = kP\left(1 - \frac{P}{M}\right)

This is the logistic differential equation. Before solving it, read its behaviour off the right-hand side f(P)=kP(1−P/M)f(P) = kP(1 - P/M):

PP sign of dP/dtdP/dt behaviour
P=0P = 0 or P=MP = M 0 equilibrium solutions
0<P<M0 < P < M positive PP increases toward MM
P>MP > M negative PP decreases toward MM

So MM is a stable equilibrium and 0 is unstable.

Solving it

The equation is separable. Partial fractions give MP(M−P)=1P+1M−P\frac{M}{P(M - P)} = \frac{1}{P} + \frac{1}{M - P}, so

∫(1P+1M−P)dP=∫k dtln⁡∣P∣−ln⁡∣M−P∣=kt+CM−PP=A⋅e−kt,A=M−P0P0P(t)=M1+A⋅e−kt\begin{aligned} \int \left(\frac{1}{P} + \frac{1}{M - P}\right) dP &= \int k\,dt \\ \ln\lvert P \rvert - \ln\lvert M - P \rvert &= kt + C \\ \frac{M - P}{P} &= A \cdot e^{-kt}, \qquad A = \frac{M - P_0}{P_0} \\ P(t) &= \frac{M}{1 + A \cdot e^{-kt}} \end{aligned}

Check the limits: as t→∞t \to \infty, e−kt→0e^{-kt} \to 0 and P→MP \to M, whatever the (positive) starting value.

Theorem (fastest growth at M/2M/2). On a solution with 0<P0<M0 < P_0 < M, the growth rate dP/dtdP/dt is largest when P=M/2P = M/2, and that maximum rate is kM/4kM/4.

Proof. dP/dt=f(P)=kP−kP2/MdP/dt = f(P) = kP - kP^2/M is a downward parabola in PP, with f′(P)=k−2kP/M=0f'(P) = k - 2kP/M = 0 at P=M/2P = M/2, giving f(M/2)=kM/4f(M/2) = kM/4. Since PP increases through every value in (0,M)(0, M), the solution passes through M/2M/2 exactly once, at t∗=ln⁡(A)/kt^* = \ln(A)/k, which is the inflection point of the S-curve. ∎

python · try it yourself
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 M⋅P0ekt/(M+P0(ekt−1))M \cdot P_0 e^{kt}/(M + P_0(e^{kt} - 1)) is ours with numerator and denominator multiplied by P0ektP_0 e^{kt}. In the concrete case A=950/50=19A = 950/50 = 19, so t∗=ln⁡(19)/0.4≈7.36t^* = \ln(19)/0.4 \approx 7.36 days.

Harvesting and tipping points

Suppose a fishery removes a constant hh fish per year: dPdt=kP(1−PM)−h\frac{dP}{dt} = kP\left(1 - \frac{P}{M}\right) - h. Equilibria solve kP(1−P/M)=hkP(1 - P/M) = h, a quadratic. Its discriminant is positive exactly when h<kM/4h < kM/4, giving two equilibria: the upper one is stable, the lower one is a threshold (below it the stock collapses to 0). At h=kM/4h = kM/4 they merge, and for any larger hh 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.

python · try it yourself
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 P′=kPP' = kP constant relative growth
Logistic P′=kP(1−P/M)P' = kP(1 - P/M) symmetric S-curve, inflection at M/2M/2
Gompertz P′=cP⋅ln⁡(M/P)P' = cP \cdot \ln(M/P) asymmetric S-curve, inflection at M/eM/e (tumour growth, product adoption)
Allee effect P′=kP(P/m−1)(1−P/M)P' = kP(P/m - 1)(1 - P/M) below the threshold mm the population dies out
Harvesting P′=kP(1−P/M)−hP' = kP(1 - P/M) - h collapse when h>kM/4h > kM/4

Fitting a logistic curve to data

Given counts over time, estimate kk and MM with least squares. The data below are generated from a logistic curve plus seeded noise, so the fit should recover parameters near the true M=800M = 800, k=0.6k = 0.6, P0=20P_0 = 20.

python · try it yourself
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 MM. Many failed epidemic and user-growth forecasts are this effect.

In software

  • The sigmoid is the logistic solution. With k=1k = 1, M=1M = 1, A=1A = 1, the solution is σ(t)=1/(1+e−t)\sigma(t) = 1/(1 + e^{-t}), the activation in logistic regression and classic neural networks. The logistic equation itself is the famous identity σ′=σ(1−σ)\sigma' = \sigma(1 - \sigma), which makes backpropagation through a sigmoid cheap.
  • Adoption curves: growth teams fit logistic or Gompertz curves to daily active users to estimate market saturation MM.
  • 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 P←P+kP(1−P/M)⋅ΔtP \leftarrow P + kP(1 - P/M) \cdot \Delta t. Too large a kΔtk\Delta t makes that update oscillate or turn chaotic (the logistic map), even though the ODE never does.

Exercises

Exercise 1: Read the equilibria

For dPdt=0.3P(1−P600)\frac{dP}{dt} = 0.3P\left(1 - \frac{P}{600}\right), list the equilibria, say which is stable, and give the largest possible growth rate.

Answer

Equilibria P=0P = 0 (unstable) and P=600P = 600 (stable); largest rate kM/4=45kM/4 = 45 per unit time, reached at P=300P = 300.

Solution
f(P)=0.3P(1−P/600)=0  ⟺  P=0 or P=600f>0 on (0,600), f<0 for P>600⇒600 attracts, 0 repelsmax of f at P=M/2=300:f(300)=0.3⋅300⋅0.5=45\begin{aligned} &f(P) = 0.3P(1 - P/600) = 0 \quad \iff \quad P = 0 \text{ or } P = 600 \\ &f > 0 \text{ on } (0, 600),\ f < 0 \text{ for } P > 600 \quad \Rightarrow \quad 600 \text{ attracts, } 0 \text{ repels} \\ &\text{max of } f \text{ at } P = M/2 = 300{:}\quad f(300) = 0.3 \cdot 300 \cdot 0.5 = 45 \end{aligned}

Exercise 2: Half-way time

With M=600M = 600, k=0.3k = 0.3, P0=40P_0 = 40, when does the population reach 300?

Answer

t=ln⁡(14)/0.3≈8.797t = \ln(14)/0.3 \approx 8.797

Solution
A=M−P0P0=56040=14P=M2  ⟺  A⋅e−kt=1  ⟺  t=ln⁡(A)k=ln⁡140.3\begin{aligned} &A = \frac{M - P_0}{P_0} = \frac{560}{40} = 14 \\ &P = \frac{M}{2} \quad \iff \quad A \cdot e^{-kt} = 1 \quad \iff \quad t = \frac{\ln(A)}{k} = \frac{\ln 14}{0.3} \end{aligned}
python · try it yourself
import math

print(round(math.log(14) / 0.3, 3))
8.797

Exercise 3: Sustainable quota

A lake has k=0.8k = 0.8 per year and M=5000M = 5000 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

h=kM/4=1000h = kM/4 = 1000 fish per year, balanced at P=2500P = 2500.

Solution

Equilibria need kP(1−P/M)=hkP(1 - P/M) = h, which has a solution only when h≤max of the left sideh \le \text{max of the left side}, which is kM/4=0.8⋅5000/4=1000kM/4 = 0.8 \cdot 5000/4 = 1000, at P=M/2=2500P = M/2 = 2500. (At exactly h=1000h = 1000 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 P←P+r⋅P(1−P)P \leftarrow P + r \cdot P(1 - P) from P=0.1P = 0.1 for 60 steps with r=0.5r = 0.5, 1.81.8 and 2.72.7, and print the last four values (rounded to 4 places). What do you see?

Answer

r=0.5r = 0.5 and r=1.8r = 1.8 settle at 1 (1.8 after damped oscillation), while r=2.7r = 2.7 never settles: the values jump around irregularly (chaos), unlike the ODE.

Solution

The step is Euler's method for P′=P(1−P)P' = P(1 - P) with rΔtr\Delta t playing the role of rr. Linearising at the fixed point 1 gives a multiplier 1−r1 - r: convergence needs ∣1−r∣<1\lvert 1 - r \rvert < 1, i.e. 0<r<20 < r < 2. Beyond 2 the fixed point is unstable and the map period-doubles into chaos.

python · try it yourself
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 MM, the population grows fastest when PP equals…

  1. MM
  2. M/4M/4
  3. M/2M/2
  4. P0P_0

The sigmoid σ(t)=1/(1+e−t)\sigma(t) = 1/(1 + e^{-t}) satisfies which differential equation?

  1. σ′=σ\sigma' = \sigma
  2. σ′=σ(1−σ)\sigma' = \sigma(1 - \sigma)
  3. σ′=1−σ2\sigma' = 1 - \sigma^2
  4. σ′=−σ\sigma' = -\sigma

With harvesting P′=kP(1−P/M)−hP' = kP(1 - P/M) - h, what happens when hh exceeds kM/4kM/4?

  1. The carrying capacity rises
  2. There is no equilibrium and the population collapses
  3. The population oscillates forever
  4. Nothing changes