TI - 92 -- Predators and Prey
Springs and Masses

You may want to consult the TI-92 help modules below for this module.

In this lab we see how the TI-92 can be used to work with Euler's Method for estimating solutions to initial value probelms of the form

p' = f(p, q)

q' = g(p, q)

p(0) = a

q(0) = b

on a time interval of the form [0, T].

As an example we look at the predator-prey model

p' = (0.005 q - 1) p

q' = (1 - 0.005 p) q

p(0) = 300

q(0) = 300

The first step is to define the two functions, f(p, q) and g(p, q), on the right hand side of the differential equations as shown in the screen below.

Missing TI-92 screen

As we saw in this module, the next step is to choose the step size h for each step of Euler's Method or, equivalently, to choose the number, N, of steps to be used to find the solution on the time interval [0, T]. Notice that T = h N and h = T / N. So we can choose either N or h. For this particular model it is best to choose h and then continue the calculations for as long as is necessary to see the behavior of the model. In other words, since we don't really know how long the time interval [0, T] is, it is best just to work with h. We will start with h = 0.1 as shown in the TI-92 screen below.

Missing TI-92 screen

Next make sure that your TI-92 is set to the SEQUENCE MODE. In this mode we can produce several different kinds of graphs. Go to the Y= screen and under the F7 menu choose the AXES option TIME as shown in the screen below.

Missing TI-92 screen

Next we set up the Y= screen to do the Euler's method calculations as shown in the screen below. This will compute two sequences, u1(n) representing the estimates for the variable p and u2(n) representing estmates for the variable q. The initial values of these two sequences are the initial values for the two variables p and q.

Missing TI-92 screen

For our first attempt we will use 120 steps. Set up the WINDOW as shown below to graph 120 steps. The y-axis runs from zero to 600.

Missing TI-92 screen

Next press GRAPH to see the screen below.

Missing TI-92 screen

This graph is like the brown graphs in the Java applets in this module. It shows p and q as functions of time. The TI-92 can also produce graphs like the green graphs in the applets. Go to the Y= menu and choose the CUSTOM option for AXES as shown in the screen below.

Missing TI-92 screen

Because we want to use the x-axis for the sequence u1(n) and the y-axis for the sequence u2(n) we set up the axes as shown in the screen below.

Missing TI-92 screen

and we change the WINDOW settings as shown in the screen below.

Missing TI-92 screen

Now press GRAPH to see the screen below.

Missing TI-92 screen

Notice that this estimate is not very good. If it were perfect than we would see a closed loop. The screen below shows what happens when we change h to 0.05 and double the number of steps to 240.

Missing TI-92 screen

This is somewhat better but far from perfect.

You can also look at these results numerically using the TABLE feature as described in the help module for Making a table of sequence values. Some tabular results are shown in the screen below.

Missing TI-92 screen

Use your TI-92 to repeat some of the experiments with this model and also with spring-and-mass models from this module.


Copyright c 1996 by Frank Wattenberg, Department of Mathematics, Montana State University, Bozeman, MT 59717.