![]() |
|||||||
Mathematics & Science
Learning Center |
|||||||
Applications of Systems of Differential EquationsPredator-Prey Problems(continued from last page...) The Lotka-Volterra system:
is said to be coupled. This means that both equations involve both variables. As a result we must solve the equations simultaneously. We saw in an earlier lab that in such situations we can make Mathematica do the work for us, provided we know the initial conditions. Let me refresh your memory of the syntax of the NDSolve command: ?NDSolve NDSolve[eqns,y,{x,xmin,xmax}] finds a numerical solution to the ordinary differential equations eqns for the function y with the independent variable x in the range xmin to xmax. As we have already seen, when we're dealing with a system of differential equations, the third form of NDSolve listed above is the one we want. The differential equations we need to enter in the list of equations are obvious—they're given in the Lotka-Volterra system at the top of this page, but what about the initial conditions? Well the initial conditions are simply the two original population sizes. Let's say that there were originally 300 rabbits and 150 foxes. This translates into the initial conditions:
Putting these together with the original system of differential equations, we have everything we need to enter into the NDSolve command. Whoops! No we don't! We also need to specify an interval upon which the numerical solution is to be found. Let's use 0 ≤ t ≤ 10. If we want to read the answer into the variable rabfox1, the command becomes:
rabfox1=NDSolve[{r'[t]==2r[t]-0.01 r[t] f[t], Go ahead—enter and evaluate it! ![]() Now let's go see what you should have gotten... |
|||||||
ODE Laboratories: A Sabbatical Project by Christopher A. Barker ©2017 San Joaquin Delta College, 5151 Pacific Ave., Stockton, CA 95207, USA e-mail: cbarker@deltacollege.edu |