Predator-Prey Model

Manipulate[
pic=VectorPlot[{a*x-α*y*x,-c*y+γ*y*x},{x,0,7},{y,0,5},StreamPoints->{{p[[1]],p[[2]]}},StreamStyle->{Red,Thick},VectorScale->{Tiny,Automatic,None},VectorStyle->"Segment",ImageSize->{350,350},FrameLabel->{Row[{"rabbits ",Style["x",Italic]}],Row[{"foxes ",Style["y",Italic]}]}];
sol=NDSolve[{{x1'[t]==a*x1[t]-α*y1[t]*x1[t],y1'[t]==-c*y1[t]+γ*y1[t]*x1[t]},{x1[0]==p[[1]],y1[0]==p[[2]]}},{x1[t],y1[t]},{t,0,tend}];
x2[t_]=x1[t]/.sol[[1,1]];
y2[t_]=y1[t]/.sol[[1,2]];
plotx=Plot[x2[t],{t,0,tend},PlotLabel->Row[{"rabbits ",Style["x",Italic]}],PlotStyle->Red,PlotRange->{0,10},ImageSize->{200,100},AspectRatio->.5];
ploty=Plot[y2[t],{t,0,tend},PlotLabel->Row[{"foxes ",Style["y",Italic]}],PlotStyle->Blue,PlotRange->{0,10},ImageSize->{200,100},AspectRatio->.5];
Show[pic],
Style["parameters",Bold],
{{a,1,"a"},0,1,.1,Appearance->"Labeled",ImageSize->Tiny},
{{α,.5,"α"},0,1,.1,Appearance->"Labeled",ImageSize->Tiny},
{{c,.75,"c"},0,1,.1,Appearance->"Labeled",ImageSize->Tiny},
{{γ,.25,"γ"},0,1,.1,Appearance->"Labeled",ImageSize->Tiny},
{{plotx,Graphics[]},ControlType->None},
{{ploty,Graphics[]},ControlType->None},
Delimiter,
{{tend,10,"end time (Subscript[t, max])"},10,100,5,Appearance->"Labeled",ImageSize->Tiny},
Delimiter,
Dynamic[Show[plotx],SynchronousUpdating->False],
Delimiter,
Dynamic[Show[ploty],SynchronousUpdating->False],
{{p,{.5,.5}},{0,0},{7,5},Locator},
{{plotx,Graphics[]},ControlType->None},
{{ploty,Graphics[]},ControlType->None},
ControlPlacement->Left,
AutorunSequencing->{1,3},
TrackedSymbols:>{a,α,c,γ,tend,p},
SynchronousUpdating->False]

CAPTION

This Demonstration illustrates the predator-prey model with two species, foxes and rabbits. Foxes prey on rabbits that live on vegetation. The rabbit population is x and the fox population is y; both depend on time t.

1. In the absence of foxes, the rabbit population grows at a rate proportional to its current population; thus dx/dt=a x when y=0 with a>0.

2. In the absence of rabbits, the foxes die out; thus dy/dt=-c y when x=0 with c>0.

3. The number of encounters between the species is proportional to the product of their populations. Each encounter tends to increase y and decrease x. Thus the growth rate of x includes a term of the form -α x y and that of y includes a term of the form γ x y, where α and γ positive. The parameters a, α, c, and γ are independent of t. These assumptions lead to the equations:

((dx)/(dt)) = a x-α x y=x(a-α y),

((dy)/(dt))=-c y+γ x y=y(-c+γ x).

DETAILS

This example comes from [1], Section 7.4, Predator Prey Equations.

Reference:

[1] J. R. Brannan and W. E. Boyce, Differential Equations with Boundary Value Problems: An Introduction to Modern Methods and Applications, New York: John Wiley and Sons, 2010.

THIS NOTEBOOK IS THE SOURCE CODE FROM

"Predator-Prey Model" from the Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/PredatorPreyModel/

Contributed by: Stephen Wilkerson

(United States Military Academy West Point, Department of Mathematics)

A full-function Wolfram Mathematica system (Version 6 or higher) is required to edit this notebook.
GET WOLFRAM MATHEMATICA »

© Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »