Let's Play with the May Model!

Here is a function defined in Mathematica to run an Euler approximation to a solution of the May model for rabbit/fox populations, and to plot the resulting data.  You'll notice that it's a multivariable function—it takes 10 variable inputs (tfinal, numberofsteps, initial numbers of rabbits and foxes, and the 6 parameters of the model)—and this makes it very flexible.  Evaluate the cell below in order to be able to use the MayModel function.

MayModel[tfinal_,numberofsteps_,rab_,fox_,a_,b_,c_,d_, e_, f_] := Block[{t,tinitial,deltat, datapointsrab,datapointsfox, rprime, fprime,deltar,deltaf, foxes, rabbits,r, F},
datapointsrab = {};
datapointsfox = {};
tinitial=0;
t = tinitial;
r =rab;
F = fox;
deltat = (tfinal- tinitial)/numberofsteps;
For[k=1,k≤numberofsteps,
rprime =a r (1-r/b) - c r F /(r + d); 
fprime = e F (1 - F / (f r)); 
deltar = rprime*deltat; 
deltaf = fprime*deltat; 
t=t+deltat; 
r = r+deltar; 
F = F + deltaf; 
datapointsrab =Append[datapointsrab, {t,r}];
datapointsfox =Append[datapointsfox, {t,F}];
 k++];
ListPlot[{datapointsfox,datapointsrab}, PlotRange -> {0, Max[rab+5,fox+5]}]]

Go ahead and try it out for a sample set of parameters, initial values, etc.

MayModel[30,1000,20,10,.6, 10, .5, 1, .1, 2]

Now, here' s a Manipulate which allows you to play with the value of the parameter c, a la problem 6 d.

Manipulate[MayModel[200,1500,20,20,.6, 10, c, 1, .1, 2],{c,.1,.5}]

Notice that the MayModel function can be adapted to other systems of differential equations, such as S-i-R, Lotka-Volterra, etc.  Go crazy!