|
|
Part 3: Euler's Method for Systems
In the preceding Part, we used your helper application to generate trajectories of the Lotka-Volterra equations. These trajectories were not coming from the near-useless formula for trajectories, but rather from the differential equations themselves. This suggests the use of a numerical solution method, such as Euler's Method, which we introduced in the Limited Population and Raindrop modules.
Recall the idea of Euler's Method: If we have a "slope formula," i.e., a way to calculate dy/dt at any point (t,y), then we can generate a sequence of y-values,
y0, y1, y2, y3, ...
by starting from a given y0, and computing each rise as slope x run. That is,
yk = yk-1 + slopek-1 Delta-t
where Delta-t is a suitably small step size in the time domain.
It really doesn't matter in this calculation if the slope formula happens to depend not just on t and y but on some other variable x -- as long as we know how x is related to t and y. If x happens to be another dependent variable in a system of differential equations (as in the predator-prey model), we can generate values of x in the same way. This leads to a pair of Euler formulas of the form
xk = xk-1 + x-slopek-1 Delta-t,
yk = yk-1 + y-slopek-1 Delta-t.
More specifically, given the Lotka-Volterra equations,
dx/dt = ax - bxy,
dy/dt = -cy + pxy,
the Euler formulas become
xk = xk-1 + (axk-1 - bxk-1yk-1) Delta-t,
yk = yk-1 + (-cyk-1 + pxk-1yk-1) Delta-t.
Of course, to calculate something from these formulas, we must have explicit values for a, b, c, p, x(0), y(0), and Delta-t. In this Part we explore the adequacy of these formulas for generating solutions of the Lotka-Volterra equations. If your helper application has Euler's Method as an option, we will use that rather than construct the formulas from scratch.
|
|
Last modified: November 11, 1997