A cave colony leaves at dusk to hunt insects by echolocation. Does the night's catch pay for the flight and the day's roost?
The science
Sonar equation. Echo level at the bat: EL = SL + TS − 40 log10(r/0.1 m) − 2αr (dB, spherical spreading out and back from the 0.1 m reference, atmospheric absorption α dB/m each way). The bat detects the insect while EL ≥ DT; rmax is found by bisection. With α = 0 and a large target: rmax = 0.1·10(SL+TS−DT)/40 m, which the page checks.
Frequency trade-off. Absorption grows about as f1.8 (empirical, 1.3 dB/m at 40 kHz, 20 °C, 50 % RH, scaled by a simple humidity factor), so high frequencies reach less far. But a target smaller than the wavelength scatters weakly: TS = TS0 + 10 log10(ka4/(1+ka4)), k = 2π/λ, a = insect radius. Together they give a best call frequency for each prey size. Beam half-angle is taken as asin(0.61 λ/8 mm) (piston-like emitter, rough).
Encounters. A forward cone of range r and half-angle θ sweeps new volume at ρ v π r² sin²θ; the agent model should reproduce this rate for its detection events. Detection volume of the cone is (2π/3) r³ (1 − cos θ) (Monte Carlo check).
Flight cost. Pennycuick-style: induced + parasite + profile power, divided by muscle efficiency 0.23, plus basal metabolism. The profile term (8 W/kg) is a lumped illustrative constant, giving about 0.6 W for a 12 g bat, a plausible order of magnitude, not a species value.
Roost. Euthermic bat: P = max(BMR, G1 n−1/3 (37 − Tc)): a cluster of n bats exposes area ∝ n2/3, so conductance per bat falls as n−1/3. Torpor: body temperature max(Tc+1.5, 5 °C) and rate BMR·Q10(Tb−37)/10 (Q10 = 2.5), with a regulation floor in cold caves; arousal costs the heat to re-warm the body (3.4 J/g/K).
Cave air. The colony's heat plus rock exchange equals ventilation loss through the entrance: Pcol(Tc) + Gw(Trock − Tc) = ρacp V̇ (Tc − Tout), with stack flow V̇ = 0.6 A √(2 g H ΔT / T), H = 15 m. Solved by bisection; more bats warm the cave, which lowers each bat's own heating cost.
Simplifications: one prey size, no clutter, no jamming, no group effects on foraging, fixed prey energy. Numbers are typical orders of magnitude for a ~12 g insectivorous bat; check species data before quoting. No bats are harmed in the model: when a reserve runs out the page only reports a deficit. Models (bats, cave, valley, trees, insects) built with Blender and rendered with Three.js.