Source code
lotka
integrate the Lotka-Volterra system
predprey -help
or
predprey
[-seed integer] [-points integer] [-f0 double] [-s0
double] [-a double] [-b double] [-c double] [-d
double] [-dt double]
Simulates the two-species Lotka-Volterra predator-prey system with a second-order Euler's method. This program serves as a simple introduction to differential equations.
Integrates the two-species Lotka-Volterra predator-prey system,
dF/dt = F(a - bS), dS/dt = S(cF - d),
according to the specified parameters.
Miscellany
The program uses a second-order Euler's method to perform the numerical integration, which is sufficient for simple tasks such as this.
Bugs
No sanity checks are performed to make sure that any of
the options make sense.
Options
-seed | Seed for random parameters. | -1 |
-points | Number of points to produce. | 2500 |
-f0 | Initial fish population. | 1.0 |
-s0 | Initial shark population. | 0.2 |
-a | Fish growth rate. | 1.5 |
-b | Shark consumption rate. | 1.5 |
-c | Fish nutritional value. | 0.5 |
-d | Shark death rate. | 1.5 |
-dt | Time step increment. | 0.1 |