Lotka-Volterra MATLAB model

I’m starting to play with dynamical systems so I figured I’d post a baby model. It essentially shows the growth of two populations co-existing together, one being the prey, the other the predators. A small time step (dt) shows that the system is stable; a larger one leads to instability and thus highlights the importance of parameter choice.

Small dt example (populations oscillate in a stable manner):

Population growth with small changes in time.

Population growth with small changes in time.

Plotting the two populations in the phase plane yields this:

Phase plane for the system.

Phase plane for the system.

Large dt example, where the population growth is without bounds:

Population growth with large changes in time.

Population growth with large changes in time.

Plotting the two populations in the phase plane yields something quite different:

Phase plane for the system.

Phase plane for the system.

As always, the code is over on my GitHub.