Read this lesson as text

RK4 for Predator-Prey System

Differential Equations · Axiom Academy

EXAMPLE RK4 for a Predator-Prey System Apply the vector form of RK4 to one step of the Lotka-Volterra predator-prey system. The Lotka-Volterra equations model a rabbit population r(t) (prey) and a fox population f(t) (predator): Take one RK4 step from r_0 = 40 , f_0 = 30 with step size h = 0.5 . You just applied RK4 to a system of two coupled equations. Here's what carries over from the single-equation case: Systems become one vector function: folds both equations into a single map — RK4 never needs to know it's secretly two equations. Every is a 2-vector: each carry a prey-component and a predator-component, computed together at every stage — you can't update r without knowing f , because of the coupling term (and ). The formula doesn't change: is exactly the scalar RK4 update, just applied component-wise to a vector. One step here isn't the whole story: Lotka-Volterra's true long-run behavior is a closed periodic orbit — the populations cycle forever, they never spiral toward a fixed point or fly off to infinity. A single RK4 step only samples one instant along that cycle. This is the whole trick for systems: stack the equations into one vector, apply RK4 exactly as before, and every k_i -evaluation naturally keeps the coupling intact.

This is the written version of the interactive lesson above. See the full Differential Equations course.