Playground Home

Predator–Prey with Processing Delay

Explore how digestion/maturation delay shapes dynamics. Move any slider to recompute the full trajectory instantly.

Parameters

1.00
r — intrinsic prey growth rate

How fast prey would grow without predators, per unit time.

Higher r → faster rebound of the prey population.

1
K — prey carrying capacity

Upper bound set by resources; prey logistic growth slows as it nears K.

1.00
m — encounter/attack rate

Rate at which predators meet & capture prey (Holling type I).

Higher m → stronger predation pressure.

0.020
s — predator mortality rate

Background per-time death rate. Larger s reduces predator persistence unless compensated by food.

0.60
Y — conversion efficiency

How efficiently eaten prey biomass becomes predator biomass.

Higher Y boosts predator growth from each capture.

0.0
τ — processing/maturation delay

Time between prey capture and its contribution to predator growth.

Only a fraction e−sτ of predators survive through the delay.

Initial conditions & numerics

0.10
Initial prey level

Used for the whole pre-history (t ≤ 0) and the start at t = 0.

0.10
Initial predator level

Used for the whole pre-history (t ≤ 0) and the start at t = 0.

0.0100
Numerical time step

Smaller Δt = more stable & accurate (but slower). If plots “blow up,” reduce Δt.

1200
Total simulated time

How long to compute the trajectory. Longer T shows more long-term behavior.

Model equations & plain-language meaning

Unscaled predator–prey with discrete delay:

\[ \frac{dx(t)}{dt} = r\,x(t)\!\left(1 - \frac{x(t)}{K}\right) - m\,x(t)\,y(t) \]
Prey rule (words): natural logistic growth limited by \(K\) minus losses to predation.

\[ \frac{dy(t)}{dt} = -s\,y(t) + Y\,e^{-s\tau}\,m\,x(t-\tau)\,y(t-\tau) \]
Predator rule (words): natural deaths plus growth from prey eaten \(\tau\) time units ago; only a fraction \(e^{-s\tau}\) of predators survive that delay, and a fraction \(Y\) of prey biomass is converted to predator biomass.

Term-by-term (predator gain): \(Y\) (efficiency) × \(e^{-s\tau}\) (survival through delay) × \(m\,x(t-\tau)\,y(t-\tau)\) (past predation rate).

How the computer solves these (forward differences)

Idea: slice time into small steps of size \(\Delta t\). Approximate change per step = derivative × step size.

1) Pre-history for the delay. For all times \(t \le 0\), we set \(x=x_0\), \(y=y_0\). This gives values to look back to when we need \(x(t-\tau)\), \(y(t-\tau)\).

2) Convert the delay into a “look-back” index. We take \(d = \mathrm{round}(\tau/\Delta t)\). The past values \(x(t-\tau), y(t-\tau)\) are read from \(d\) steps earlier in memory.

3) Forward Euler updates each step.

\[ x_{n+1} = x_n + \Delta t\,\Big[ r\,x_n\!\left(1-\frac{x_n}{K}\right) - m\,x_n\,y_n \Big] \] \[ y_{n+1} = y_n + \Delta t\,\Big[ -s\,y_n + Y\,e^{-s\tau}\,m\,x_{n-d}\,y_{n-d} \Big] \]

4) Practical tips. Use smaller \(\Delta t\) for stability/accuracy; keep populations ≥ 0 by flooring negatives at 0; choose \(T\) big enough to see long-term behavior.

Time series

Prey \(x(t)\) Predator \(y(t)\)

Phase plane: predator vs prey

Trajectory