Go to CCP Homepage Go to Materials Page Go to Differential Calculus Materials Go to Table of Contents
Go Back One Page Go Forward One Page

Predator-Prey Models

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.

  1. Using the values of a, b, c, and p already in your worksheet, generate an Euler's Method solution for the trajectory starting from x(0) = 20, y(0) = 20, with Delta-t = 0.2 and t ranging from 0 to 10. Superimpose this trajectory on the direction field. Do you think this solution closely tracks a true trajectory of the system? Why or why not? What characteristic of Euler's Method causes the trajectory to behave the way it does?
  2. Change the step size to 0.1 and replot the trajectory. Now does the solution closely track a true trajectory of the system? Why or why not? Does the behavior of this solution confirm what you said about Euler's Method in the preceding step?
Go to CCP Homepage Go to Materials Page Go to Differential Calculus Materials Go to Table of Contents
Go Back One Page Go Forward One Page


Send comments to the authors <modules at math.duke.edu>

Last modified: November 11, 1997