Population Biology · Community Ecology · ODEs
📅 July 2026 ⏱ ≈ 11 min read 🎯 Beginner–Intermediate · Last updated: 3 July 2026

Ecological Niches and Competition

An ecological niche is not a place — it is the complete set of conditions and resources a species needs to survive and reproduce. When two species draw on overlapping niches, competition follows, and the outcome — coexistence, exclusion, or resource partitioning — is one of the oldest and most productive questions in population biology. This article builds the theory from Hutchinson's n-dimensional hypervolume to the Lotka–Volterra competition equations, and ends with a working JavaScript simulation.

1. What is an ecological niche?

The word "niche" has been defined three distinct — and historically important — ways in ecology:

📍
Grinnellian niche

Joseph Grinnell (1917): the niche as habitat — the physical address a species occupies, defined by broad environmental variables like climate and vegetation type.

🍽️
Eltonian niche

Charles Elton (1927): the niche as profession — a species' functional role in the community, defined by what it eats and what eats it.

🧊
Hutchinsonian niche

G. Evelyn Hutchinson (1957): the niche as an n-dimensional hypervolume — every environmental axis (temperature, pH, food size, nesting height...) a species needs, plotted as one axis in n-dimensional space.

Hutchinson's formalisation is the one used in almost all modern quantitative ecology. Formally, the fundamental niche is the region of an n-dimensional resource/condition space within which a population can maintain a positive growth rate in the absence of competitors or predators:

N_fundamental = { (x₁, x₂, ..., xₙ) ∈ ℝⁿ : r(x₁, ..., xₙ) > 0 } ← every combination of conditions where growth rate r is positive

The realized niche is always a subset of the fundamental niche — the portion actually occupied once competitors, predators, and dispersal limits are taken into account. The gap between fundamental and realized niche is exactly what interspecific competition carves away, and it is the central subject of this article.

Why "hypervolume" and not "habitat"? A niche axis does not have to be spatial. Prey body size, activity time of day, soil nitrogen concentration, and foraging height in a tree canopy are all legitimate niche dimensions. Two species can occupy the exact same physical location yet have almost no niche overlap if they are separated along a non-spatial axis — for example, a nocturnal owl and a diurnal hawk hunting the same field.

2. Gause's competitive exclusion principle

In 1934, Georgy Gause grew two species of Paramecium (P. aurelia and P. caudatum) separately and together in identical test-tube cultures feeding on the same bacterial food source. Grown alone, both species reached stable logistic population sizes. Grown together, P. aurelia consistently drove P. caudatum to local extinction within about three weeks.

This experiment crystallised into the competitive exclusion principle (also called Gause's law):

Competitive exclusion principle: Two species that compete for the exact same limiting resource, in the same way, cannot stably coexist indefinitely — the species with even a marginally superior competitive ability will eventually eliminate the other. Colloquially: "complete competitors cannot coexist."

The principle is often stated more usefully in its contrapositive form: if two competing species are observed to coexist stably, then by necessity their niches must differ along at least one axis. This corollary reframes exclusion from a doom-and-gloom rule into a powerful diagnostic tool — persistent coexistence is itself evidence for niche differentiation, even when the differentiating axis is not obvious to an observer.

3. Lotka–Volterra competition equations — derivation

To put the exclusion principle on quantitative footing, extend the logistic growth equation to two species sharing resources. Let N₁(t) and N₂(t) be the population sizes of species 1 and 2:

r₁, r₂ — intrinsic growth rates

Per-capita growth rate of each species when rare and alone. Sets how fast a population recovers from low density.

K₁, K₂ — carrying capacities

Maximum population each species could sustain alone on the shared resource base, in the absence of the other species.

α₁₂ — competition coefficient

Per-capita effect of species 2 on species 1's growth, in units of "equivalent species-1 individuals." α₁₂ > 1 means each individual of species 2 suppresses species 1 more than a species-1 individual would.

α₂₁ — competition coefficient

The reverse: per-capita effect of species 1 on species 2's growth, measured in equivalent species-2 individuals.

The governing equations are:

dN₁/dt = r₁·N₁·(1 − (N₁ + α₁₂·N₂)/K₁) ← species 1: logistic, penalised by species 2 via α₁₂
dN₂/dt = r₂·N₂·(1 − (N₂ + α₂₁·N₁)/K₂) ← species 2: logistic, penalised by species 1 via α₂₁

Term breakdown:
N₁/K₁ — self-limitation (intraspecific competition, same as plain logistic growth)
α₁₂·N₂/K₁ — interspecific penalty: each species-2 individual eats/occupies α₁₂ "shares" of species 1's resource

Setting α₁₂ = α₂₁ = 0 decouples the equations into two independent logistic curves — no interaction, no exclusion. Setting α₁₂ = α₂₁ = 1 makes both species functionally identical competitors for a single pooled resource, the strongest possible form of competition and the scenario closest to Gause's Paramecium experiment.

Where do α₁₂ and α₂₁ come from mechanistically? MacArthur and Levins (1967) showed that if each species has a resource-utilization curve over a shared continuous resource axis (e.g. seed size), the competition coefficients can be derived as the overlap integral of the two utilization curves — connecting the phenomenological Lotka–Volterra α's to a measurable niche overlap (see Section 5).

4. Isoclines, equilibria, and the four possible outcomes

Set dN₁/dt = 0 and dN₂/dt = 0 separately to get two straight-line zero-growth isoclines in the (N₁, N₂) phase plane:

Species 1 isocline: N₁ = K₁ − α₁₂·N₂ ← intercepts: (K₁, 0) and (0, K₁/α₁₂)
Species 2 isocline: N₂ = K₂ − α₂₁·N₁ ← intercepts: (K₂/α₂₁, 0) and (0, K₂)

The relative position of these two lines — specifically, whether each isocline's intercepts lie inside or outside the other's — determines which of exactly four qualitative outcomes the system produces:

Interior equilibrium (Outcomes C and D):
N₁* = (K₁ − α₁₂·K₂) / (1 − α₁₂·α₂₁)
N₂* = (K₂ − α₂₁·K₁) / (1 − α₁₂·α₂₁)

Stability condition for coexistence: α₁₂·α₂₁ < 1
i.e. intraspecific limitation > interspecific limitation, for both species

Outcome D is the mathematical heart of coexistence theory: a pair of species can share a habitat forever only if each is harder on its own kind than it is on its competitor — precisely the condition that niche differentiation (Section 5) tends to produce.

5. Niche overlap and resource utilization

MacArthur and Levins modelled each species' resource use along a continuous niche axis (e.g. seed size, prey length) as a utilization function uᵢ(x), typically a Gaussian centred on the species' preferred resource value with standard deviation w (niche breadth):

uᵢ(x) = (1 / (w·√(2π))) · exp( −(x − μᵢ)² / (2w²) ) ← Gaussian resource-use curve, mean μᵢ, breadth w

The competition coefficient between two species whose niche centres are separated by distance d = |μ₁ − μ₂| is the normalized overlap of their utilization curves:

α₁₂ = ∫ u₁(x)·u₂(x) dx / ∫ u₁(x)² dx = exp( −d² / (4w²) ) ← overlap integral of two Gaussians, same breadth w

This single equation links the phenomenological α's of Section 3 to a directly measurable ecological quantity: how far apart, in units of niche breadth (d/w), two species' resource preferences sit. When d = 0 the species are identical resource users and α = 1 — Gause's scenario. As d/w grows, α falls exponentially toward zero and coexistence (Outcome D, Section 4) becomes possible even with high total resource demand.

Limiting similarity: MacArthur and Levins (1967) and later Robert May (1973) showed that for a fixed resource spectrum and typical population fluctuation levels, stably coexisting species along a single niche axis tend to be spaced by roughly d/w ≈ 1–2. Closer packing than this is possible in principle but becomes increasingly fragile to environmental noise — a rule of thumb ecologists still use when interpreting body-size ratios in guilds of similar species.

6. Character displacement and niche partitioning

When two similar species come into contact and compete, natural selection can push their traits apart along the shared niche axis — a process called character displacement. Traits diverge more where the species co-occur (sympatry) than where either lives alone (allopatry).

Character displacement and resource partitioning are the empirical fingerprints of Outcome D from Section 4: populations shift their realized niches until interspecific competition drops below intraspecific competition, at which point coexistence becomes locally stable rather than a knife-edge priority effect.

7. JavaScript implementation with RK4

The competition equations are a nonlinear coupled ODE system — RK4 gives fourth-order accuracy for a modest cost per step, exactly as for Lotka–Volterra predator–prey:

// Lotka–Volterra competition right-hand side
function competition(N1, N2, r1, r2, K1, K2, a12, a21) {
  return {
    dN1dt: r1 * N1 * (1 - (N1 + a12 * N2) / K1),
    dN2dt: r2 * N2 * (1 - (N2 + a21 * N1) / K2),
  };
}

// RK4 single step
function rk4Step(N1, N2, h, params) {
  const { r1, r2, K1, K2, a12, a21 } = params;
  const f = (n1, n2) => competition(n1, n2, r1, r2, K1, K2, a12, a21);

  const k1 = f(N1,                 N2);
  const k2 = f(N1 + h/2*k1.dN1dt, N2 + h/2*k1.dN2dt);
  const k3 = f(N1 + h/2*k2.dN1dt, N2 + h/2*k2.dN2dt);
  const k4 = f(N1 + h*k3.dN1dt,   N2 + h*k3.dN2dt);

  return {
    N1: N1 + (h/6) * (k1.dN1dt + 2*k2.dN1dt + 2*k3.dN1dt + k4.dN1dt),
    N2: N2 + (h/6) * (k1.dN2dt + 2*k2.dN2dt + 2*k3.dN2dt + k4.dN2dt),
  };
}

// Simulate for T time units with step h, guarding against negative populations
function simulate(N1_0, N2_0, params, T, h = 0.05) {
  const history = [{ t: 0, N1: N1_0, N2: N2_0 }];
  let N1 = N1_0, N2 = N2_0;

  for (let t = h; t <= T; t += h) {
    ({ N1, N2 } = rk4Step(N1, N2, h, params));
    if (N1 < 0) N1 = 0;
    if (N2 < 0) N2 = 0;
    history.push({ t, N1, N2 });
  }
  return history;
}

// Outcome D: stable coexistence — intraspecific > interspecific for both
const coexist = { r1: 0.8, r2: 0.6, K1: 100, K2: 80, a12: 0.5, a21: 0.4 };
// a12 * a21 = 0.20 < 1 → stable coexistence

// Outcome A: species 1 always wins (Gause-like exclusion)
const exclude = { r1: 0.8, r2: 0.6, K1: 100, K2: 80, a12: 0.3, a21: 1.6 };
// a12 * a21 = 0.48, but K1 > K2/a21 and K2 < K1*a12 fails → check isocline crossing directly

const data = simulate(10, 10, coexist, 60);
// data[i].N1, data[i].N2 → population sizes at time data[i].t

Classifying the outcome from parameters

// Return one of 'A' (species 1 wins), 'B' (species 2 wins),
// 'C' (unstable coexistence / priority effect), 'D' (stable coexistence)
function classifyOutcome(K1, K2, a12, a21) {
  const sp1Beats2 = K1 > K2 / a21;   // species 1's isocline intercept exceeds species 2's
  const sp2Beats1 = K2 > K1 * a12;   // species 2's isocline intercept exceeds species 1's

  if (sp1Beats2 && !sp2Beats1) return 'A';   // species 1 always wins
  if (!sp1Beats2 && sp2Beats1) return 'B';   // species 2 always wins
  if (sp1Beats2 && sp2Beats1)  return 'C';   // priority effect: founder wins
  return 'D';                             // stable coexistence
}

8. Extensions: n-species competition and real-world tests

n-species Lotka–Volterra competition

The two-species model generalises directly to n species using an interaction matrix A where entry αᵢⱼ is the effect of species j on species i (αᵢᵢ = 1 by convention):

dNᵢ/dt = rᵢ·Nᵢ·(1 − (Σⱼ αᵢⱼ·Nⱼ) / Kᵢ), for i = 1...n ← sum runs over all species including i itself (αᵢᵢ = 1)

For n > 2, feasible (all-positive) equilibria and their stability depend on the eigenvalues of the community matrix — the same tools used to analyse stability in Section 4, generalised to higher dimensions. Robert May's 1972 result that "large complex systems tend to be less stable" originates from exactly this n-species Lotka–Volterra framework.

Apparent competition

Two species that never directly interact can still suppress each other indirectly if they share a common predator or parasite — a rise in one prey species' density boosts predator numbers, which then depresses the other prey species. The mathematics is formally analogous to direct competition even though no resource is shared, which is why "apparent competition" is easy to mistake for classic niche overlap in field data.

Coexistence via storage effect and fluctuating resources

Peter Chesson's modern coexistence theory shows that species can persist together even when α₁₂·α₂₁ > 1 at any single instant, provided environmental conditions fluctuate and each species responds differently to the fluctuations — buffering losses during bad years with reserves built during good years (the storage effect). This relaxes Gause's principle from an absolute law into a statement about time-averaged, not instantaneous, competitive balance.

Testing the theory in the field: Joseph Connell's 1961 removal experiments on barnacles (Chthamalus and Balanus) on Scottish shorelines directly demonstrated realized-versus-fundamental niche separation: Chthamalus could survive across the whole intertidal zone when Balanus was experimentally removed, but was normally confined to the upper zone by competitive exclusion — a textbook field confirmation of the theory built in Sections 2–4.