Applications & Mathematical Modeling

a compartment model

Whenever you want to track a substance flowing through a system of connected stores — water through linked tanks, a drug through organs of the body, infected people through stages of a disease — you can picture each store as a box and the system as a set of boxes with arrows between them. A compartment model is exactly this: a handful of well-mixed 'compartments', with substance flowing from one to another at rates you specify. It is one of the most reusable modeling templates in all of applied mathematics.

The bookkeeping is beautifully simple and always the same: for each compartment, the rate of change of its contents equals everything flowing IN minus everything flowing OUT. If compartment 1 holds amount x1 and loses material to compartment 2 at rate k12 while gaining from it at rate k21, you write x1' = (inflows) - (outflows) = k21 x2 - k12 x1, and similarly for each box. The result is always a system of first-order linear (or sometimes nonlinear) differential equations — one equation per compartment — with the flow constants as parameters.

The reason this template is so powerful is that wildly different fields turn out to share its skeleton. The SIR model of epidemics is a compartment model (boxes S, I, R). A drug spreading through blood and tissue is a compartment model (boxes for plasma and peripheral tissue). The carbon cycle, heat flowing between rooms, nutrients moving through an ecosystem — all are compartment models. Learn to read the box-and-arrow diagram and translate it into rate equations, and you can model any of them with the same few steps.

The standing assumption to keep honest is 'well-mixed': each compartment is treated as uniform, so a molecule anywhere inside it is equally likely to leave next, and there is no notion of where it sits within the box. This is excellent when mixing really is fast compared with the flows between boxes, and misleading when it is not — for instance, where spatial gradients or delays matter, a compartment model smooths over detail that a fuller spatial model would keep.

Two rooms share a doorway; warm air flows between them. Let T1, T2 be the temperatures. Each room's temperature changes by inflow minus outflow of heat: T1' = k(T2 - T1) and T2' = k(T1 - T2). This two-box compartment model predicts the rooms equalize toward a common temperature, the rate set by k.

Same template, any field: rate of change in each box equals inflow minus outflow.

The whole framework rests on the 'well-mixed' assumption — each compartment is uniform inside. Where position within a box matters (spatial gradients, slow diffusion, transit delays), a compartment model averages away real structure and a spatial or delay model is needed instead.

Also called
compartmental modelbox model房室模型箱模型