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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s