Skip to content

CoevolvingPredatorPrey

Systems / ODEs / Population dynamics

An eco-evolutionary predator–prey model with a changing prey trait. Sustained chaotic attraction at the shipped defaults is unconfirmed: tested long trajectories can escape, so a finite-time positive exponent is not evidence of a bounded attractor.

continuous · ODE3 dimensionsmixed

Start here

Python
import tsdynamics as ts

system = ts.systems.CoevolvingPredatorPrey()
traj = system.run(final_time=20.0, dt=0.01, seed=0)
ts.plot(traj)

traj.t contains the sample times and traj.y the state array; system.info shows the defaults. In a notebook the last line displays the plot. In a Python script, call .show() on it to open a window, or .save("trajectory.svg") to export it.

With an adaptive ODE solver, dt sets the output spacing; rtol and atol control local integration error. For a fixed-step solver, reduce dt to check numerical convergence.

state projection (x, y, alpha); playback follows arc length, not physical speed. Interactive: drag to rotate; use the play/pause control in the viewer.

This finite simulation illustrates one initial condition and view. The diagnostics below report their own inputs and observation windows.

Dynamics at the default parameters

Lyapunov exponents measure separation rates along an orbit. The Kaplan–Yorke dimension is derived from those rates, not a direct geometric measurement. Finite runs depend on the initial condition, transient and observation window; a value near zero needs a convergence check.

Lyapunov spectrum
Finite-time / numerical estimate
$+0.004666,\; -0.003028,\; -1.532$
per time unit
Method and evidence

Benettin QR tangent dynamics

Finite-time estimate, not a convergence certificate. All state-space directions were computed.

Settings

{
  "backend": "jit",
  "k": 3,
  "final_time": 400.0,
  "transient": 100.0,
  "dt": 0.1,
  "ic": [
    0.5,
    0.3,
    0.2
  ],
  "rtol": 1e-09,
  "atol": 1e-12,
  "solver": "rk45"
}

Preparation

{
  "seed": 285384327,
  "ic_policy": "declared/in-basin start, else seeded small ball"
}

Estimator runtime in the recorded environment: 0.0174 s.

Kaplan–Yorke dimension
Finite-time / numerical estimate
$D_{KY} = 2.001$
Method and evidence

Kaplan–Yorke interpolation of the recorded spectrum

Lyapunov dimension estimate; equality with a fractal or information dimension requires additional dynamical assumptions.

Settings

{
  "backend": "jit",
  "k": 3,
  "final_time": 400.0,
  "transient": 100.0,
  "dt": 0.1,
  "ic": [
    0.5,
    0.3,
    0.2
  ],
  "rtol": 1e-09,
  "atol": 1e-12,
  "solver": "rk45"
}
Divergence ∇·f
Symbolic summary
$2 d_{1} \delta^{2} k_{2} vv - d_{1} - d_{2}$ (constant part of $\nabla\!\cdot f$)
constant part shown — state-dependent remainder omitted (too large)
Method and evidence

constant part shown — state-dependent remainder omitted (too large)

Equilibria / fixed points
Finite-time / numerical estimate
8 equilibria found
0 stable · 8 unstable · 0 marginal / undetermined
Method and evidence

A seeded numerical search, not a completeness proof. Stability means linear asymptotic stability. Marginal/nonhyperbolic roots have no nonlinear stability verdict from this linearisation.

max Re(eigenvalue) for flows; max |multiplier| - 1 for maps. Boundary band: 1e-7 * max(1, max |eigenvalue|).

Settings

{
  "method": "newton",
  "n_seeds": 80,
  "seed": 0
}

Estimator runtime in the recorded environment: 0.0576 s.

Recorded parameters and software
{
  "parameters": {
    "a1": 2.5,
    "a2": 0.05,
    "a3": 0.4,
    "b1": 6.0,
    "b2": 1.333,
    "d1": 0.16,
    "d2": 0.004,
    "delta": 1,
    "k1": 6.0,
    "k2": 9.0,
    "k4": 9.0,
    "vv": 0.33333
  },
  "parameter_expressions": {},
  "state_dimension": 3,
  "explicit_time": false,
  "library_version": "6.0.3",
  "python": "3.14.8",
  "numpy": "2.4.4",
  "scipy": "1.17.1",
  "protocol_version": 1
}

Definition

\[ \begin{aligned} \dot{x} &= x \left(\frac{a_{1} \alpha \left(- k_{1} x \left(\alpha \delta - \alpha\right) + 1\right)}{\alpha b_{1} + 1} - \frac{a_{3} y}{b_{2} x + 1} - d_{1} \left(- k_{2} \left(\alpha^{2} \delta^{2} - \alpha^{2}\right) + k_{4} \left(\alpha^{4} \delta^{4} - \alpha^{4}\right) + 1\right)\right) \\ \dot{y} &= y \left(\frac{a_{2} x}{b_{2} x + 1} - d_{2}\right) \\ \dot{alpha} &= vv \left(- \frac{a_{1} \alpha \delta k_{1} x}{\alpha b_{1} + 1} - d_{1} \left(4 \alpha^{3} \delta^{4} k_{4} - 2 \alpha \delta^{2} k_{2}\right)\right) \end{aligned} \]

Parameters

Symbol Default Role
a1 2.5 predation / conversion rate coefficient
a2 0.05 predation / conversion rate coefficient
a3 0.4 predation / conversion rate coefficient
b1 6 saturation constant of the functional response
b2 1.333 saturation constant of the functional response
d1 0.16 prey intrinsic death rate
d2 0.004 predator intrinsic death rate
delta 1 trait-asymmetry parameter of the fitness landscape
k1 6 coupling strength of the fitness landscape
k2 9 coupling strength of the fitness landscape
k4 9 coupling strength of the fitness landscape
vv 0.33333 relative timescale of trait evolution vs population dynamics

State variables: x, y, alpha

Explore further

Reference

Gilpin & Feldman (2017), PLoS Comput. Biol. 13, e1005644
doi:10.1371/journal.pcbi.1005644

BibTeX
BibTeX
@misc{coevolvingpredatorprey,
  title = {CoevolvingPredatorPrey system},
  note = {Gilpin & Feldman (2017), PLoS Comput. Biol. 13, e1005644},
  doi = {10.1371/journal.pcbi.1005644}
}