Sunday, May 1, 2011

System Dynamics with NetLogo

About 1 year ago I purchased an old book by Jay Forrester on dynamic systems. I really enjoyed the book and looked around for more information on modeling these systems. I ran into NetLogo . It has some basic models already built and it works on Macs and PCs well. My favorite model is the wolf, sheep, and grass simulation. Basically, the grass grows, the sheep eat the grass, and the wolves eat the sheep. Parameters are grass regrow speed, breeding dynamics, and how much energy is gained by eating. Each animal has an energy level that is reduced each "tick" of the simulation. If it runs out of energy, it dies. You can also change the starting # of sheep and wolves.

They have the simulation setup so if you run it, it eventually settles into a volatile but sustainable steady state between grass, wolves, and sheep.

The interesting part is changing some of the parameters to see what happens. When you do, you quickly learn that intuition takes a holiday in system dynamics. For instance, I changed how much energy the sheep gain from eating grass from 4 to 5 (for whatever reason, they improve their utilization). What do you think happens in the steady state values of grass, sheep, and wolves? I expect that the same amount of grass would sustain more sheep and wolves due to the sheep extracting more energy every tick.


Turns out, the wolf population goes down! Change the sheep gain to 6 and the wolves die off totally after a while. What happens is the additional sheep create increasingly large oscillations in the wolf population that eventually wipes them out. Certainly gave me something to think about.

0 comments: