Predator-Prey modeling in Clojure

(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at:


Introduction to Predator-Prey Systems
In this edition of the blog, I’ll discuss how you can use Clojure to solve a system of nonlinear differential equations. The particular system I’ll be solving is the Predator-Prey or Lotka-Volterra Model, which you can read all about right here. The basic concept is that you are modeling a population of predators and prey (e.g. Foxes and Rabbits, which we’ll use here). How the two populations change over time can be modeled like so:


These are differential equations, meaning equations that model the change of the system as a function of its state as opposed to an equation that allows you to directly compute the system’s state.