Delta Banner

Mathematics & Science Learning Center
Computer Laboratory


Applications of Systems of Differential Equations

Predator-Prey Problems

(continued from last page...)

The Effect of the Initial Conditions

The next part of our investigation answers the question: What happens to the above graph if the initial conditions are changed?

In fact, we will now do a series of problems in which we repeatedly generate graphs similar to the one we just made, but we keep changing one little aspect of the problem between plots—the initial conditions. In order to do this we will simply repeat most of the work that we did to produce our last graph, with a few basic changes.

The next problem, then, is as follows:

Produce the rabbit-fox graph of the Lotka-Volterra model:

System Initial Conditions
r′(t) = 2 r(t) - 0.01 r(t) f(t)
f′(t) = - f(t) + 0.01 r(t) f(t)
r(0) = 150
f(0) = 200

(Note that the only change here from our original problem is a new set of initial conditions.) Plot it on the interval 0 ≤ t ≤ 10. Read the solution into the variable rabfox2 and read the plot into the variable rabfoxplot2.

Now where should we start? Well, by looking back at what we did last time might be a good idea! However, some of the work we did before is no longer required. In this new problem we are only asked for a single picture, the rabbits versus foxes graph. This is the parametrically generated plot that we did in the very last step. The individual plots of rabbits versus time and foxes versus time are not requested here. That's fine by us, right? Less work!

So let's condense the steps required to make our picture down to the bare essentials. The following pair of commands should be sufficient:

NDSolve[{r'[t]==2r[t]-0.01 r[t] f[t],
   f'[t]==-f[t]+0.01 r[t] f[t],


Switch to Mathematica and enter them in separate cells, hitting [ENTER] after each. (Of course, you could Copy and Paste if you liked.)

Now let's go see what you should have gotten...

Compass If you're lost, impatient, want an overview of this laboratory assignment, or maybe even all three, you can click on the compass button on the left to go to the table of contents for this laboratory assignment.

ODE Laboratories: A Sabbatical Project by Christopher A. Barker

©2017 San Joaquin Delta College, 5151 Pacific Ave., Stockton, CA 95207, USA