Ecosystems and food webs can be described using a compartment model. In principle, each compartment represents one species or one type of species. Species which feed on each other are connected by an interchange flow modeling their predating pattern, as described in the last section.
Of course, the more detailed the ecosystem description is, the more detailed and more realistic the compartment model will be. For example, it is possible to divide a species into several distinct classes, each living spatially separated or equipped with distinctive anatomic features. Each of these classes would then be represented by a separate compartment.
To give the reader some inkling of what can be achieved with this kind of model, we describe some simple examples from the literature for ecosystems or parts of ecosystems modeled as compartment models.