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):
Plotting the two populations in the phase plane yields this:
Large dt example, where the population growth is without bounds:
Plotting the two populations in the phase plane yields something quite different:
As always, the code is over on my GitHub.