Giraffe and acacia - 2D foraging

A giraffe walks from tree to tree and must decide how long to browse each one; the marginal value theorem finds the best time.

Switch to 3D

Presets

Playback

Giraffe and trees

Browsing details

Choose Optimal giraffe for the best stay time, or a preset that sets it by hand.

Model checks

The science

Marginal value theorem

A tree gives diminishing returns: g(t) = G (1 − e−t/τ) as leaves become harder to reach and tougher to eat. With travel time T between trees the long-run intake is R(t) = g(t) / (t + T). It is largest where g′(t*) = R(t*), the tangent from the travel point on the time axis, which for this curve means et*/τ = 1 + (t* + T)/τ. Longer travel (sparser trees) means staying longer at each tree.

Reach niche and blood pressure

Only the part of the canopy above about 2 m is free of other browsers, so the share of leaves a giraffe can use grows with its reach. Lifting blood a height h above the heart needs an extra pressure ρblood g h ≈ 1060 × 9.81 × h, about 78 mmHg per metre.

Honest simplifications: the energy values are illustrative round numbers, trees are all identical and never revisited, defence only scales gain and handling time, and reach is mapped to canopy access with a simple linear rule. The animation is schematic, not a gait model.

What to try
  • Compare Optimal giraffe, Leaves too early and Stays too long on the energy graph.
  • Press Sparse trees: the optimal time per tree increases.
  • Press Short-necked browser: the reach niche disappears.
Gain curve and tangent
Long-run intake against stay time
Cumulative energy