Five model taxa share a gut segment. Change what arrives (fibre, sugar, protein), how fast it flows and see who wins, who feeds whom, how pH moves and how the immune cells respond.
The science
Chemostat. Each taxon i grows on one resource S with Monod kinetics μ = μmax S / (Ks + S) · fpH; dNi/dt = (μi − D − di) Ni + m (D = transit dilution, d = loss, m = tiny immigration from a reservoir). Resources: dS/dt = D(Sin − S) − Σ Ni μi / Yi.
Competition (R* rule). On a single limiting resource the taxon with the lowest S* = Ks(D + d)/(μmax − D − d) drives the resource below everyone else's break-even level and excludes them. Coexistence needs different resources, cross-feeding, or pH niches.
Cross-feeding. The fibre fermenter releases sugar and lactate; sugar users turn sugar into lactate and SCFA; the lactate converter lives on lactate and makes SCFA. A product of one is the food of the next.
pH. pH = 7.4 − 0.045 (SCFA + lactate) (illustrative), SCFA are absorbed by the host at 0.3 per hour; the cardinal pH model f = (pH−pHmin)(pH−pHmax) / [(pH−pHmin)(pH−pHmax) − (pH−pHopt)²] gives each taxon a pH niche.
Immune loop. Signal σ = ND/(ND + K); activation obeys dI/dt = (σ − I)/τ, τ = 8 h, and adds a loss rate to the opportunist only (tolerance to the others).
Diversity. Shannon H′ = −Σ p ln p; more even communities have higher H′ (max ln 5 = 1.61). Diversity alone does not say "good" or "bad".
Simplifications. Well-mixed compartment, five generic taxa, one limiting resource each, no spatial gradients in the equations (the 3D neighbourhood is a drawing of a sample of the cells), no host genetics, no real species. Scale in the picture is not true to life. Models built with Blender, scene by Three.js.