predprey
plot the phase space of a predator-prey system
predprey -help
or
predprey
[-width integer] [-height integer] [-skip integer]
[-points integer] [-alpha double] [-delta integer]
[-dt double] [-x0 double] [-y0 double] [-z0 double]
[-data] [-xp string] [-yp string] [-factor double]
[-inv] [-mag integer] [-term string]
Plots the phase space of a three-species predator-prey system (described by differential equations) which may be fractal in shape. Both plain phase-space plots and delayed state-space plots are possible.
The phase space of a three species predator-prey system, which is described by the three differential equations
dx/dt = x * (1.1 - x / 2 - y / 2 - z / 10),
dy/dt = y * (-0.5 + x / 2 + y / 10 - z / 10), and
dz/dt = z (alpha + 0.2 - alpha x - y / 10 - z / 10),
is plotted according to the specified parameters. Valid arguments passed with the -xp and -yp options can be any one of x(t), y(t), z(t), x(t-delta), y(t-delta), or z(tdelta). Thus, the displayed plot can take the form of a state space plot or a delayed coordinate plot.
Miscellany
The plot region is determined by the points that are initially skipped. If this number is too small (i.e., it is not very representative of the range of the plotted values), then you may need to increase the number specified by the -skip option. Alternatively, you can adjust the value given to -factor, which simply fractionally increases the border of the plot.
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
-width | Width of the plot in pixels. | 480 |
-height | Height of the plot in pixels. | 480 |
-skip | Number of initial points to skip. | 2000 |
-points | Number of points to plot. | 5000 |
-alpha | Value of the alpha parameter. | 1.5 |
-delta | Time delay term. | 20 |
-dt | Time step. | 0.1 |
-x0 | Initial X value. | 0.5 |
-y0 | Initial Y value. | 0.5 |
-z0 | Initial Z value. | 0.5 |
-data | Don't plot, but print points. | False |
-xp | X-coordinate for plot. | x(t) |
-yp | Y-coordinate for plot. | y(t) |
-factor | Auto-scale expansion factor. | 0.2 |
-inv | Invert all colors? | False |
-mag | Magnification factor. | 1 |
-term | How to plot points. | None |