next up previous contents index
Next: condense Up: Eco Lab Model commands Previous: Eco Lab Model commands   Contents   Index


generate

This implements the basic Lotka-Volterra equations:

$\dot{\mbox{\boldmath {$n$}}} = \mbox{${\bf r}$}*\mbox{\boldmath {$n$}}+ \mbox{\boldmath {$n$}}*\mbox{\boldmath {$\beta$}}\mbox{\boldmath {$n$}}$

with ${\bf r}$ being the reproduction rate and $\beta$ being the interspecies interaction. This is implemented as a single line:

  density += repro_rate * density + (interaction * density) * density;

This command also increments the timestep counter tstep.

An optional argument specifies a number of timesteps to run the generate step. This improves the speed by amortising the real to integer conversion operation over a number of timesteps. The downside is that computation may fail if the problem is ill-conditioned (offdiagonal elements of $\beta$ too large with respect to the diagonal elements).



Russell Standish 2016-09-02