<?xml version="1.0" encoding="UTF-8"?>
<Worksheet><Version major="6" minor="1"/><View-Properties><Hide name="Section Range"/><Hide name="Group Range"/><Zoom percentage="100"/></View-Properties><Styles><Layout alignment="centred" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="_pstyle273" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Layout alignment="centred" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="_pstyle272" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Layout alignment="centred" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="_pstyle271" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Layout alignment="centred" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="_pstyle270" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Layout alignment="left" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Heading 1" rightmargin="0.0" spaceabove="6.0" spacebelow="6.0"/><Layout alignment="left" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Heading 1269" rightmargin="0.0" spaceabove="6.0" spacebelow="6.0"/><Layout alignment="left" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Heading 1268" rightmargin="0.0" spaceabove="6.0" spacebelow="6.0"/><Layout alignment="left" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Normal" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Layout alignment="centred" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="_pstyle275" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Layout alignment="centred" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="_pstyle274" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Font background="[0,0,0]" bold="true" executable="false" family="Arial" foreground="[0,0,0]" italic="true" name="Heading 1" readonly="false" size="18" underline="false"/><Font background="[0,0,0]" bold="true" executable="true" family="Monospaced" foreground="[255,0,0]" name="Maple Input"/><Font background="[0,0,0]" family="Times New Roman" name="Page Number" underline="false"/><Font background="[0,0,0]" bold="false" executable="false" family="Arial" foreground="[0,0,0]" italic="true" name="Normal" readonly="false" size="12" underline="false"/><Font background="[0,0,0]" bold="false" executable="false" family="Arial" foreground="[0,0,0]" italic="true" name="_pstyle275" readonly="false" size="14" underline="false"/><Font background="[0,0,0]" bold="false" executable="false" family="Arial" foreground="[0,0,0]" italic="true" name="_pstyle274" readonly="false" size="14" underline="false"/><Font background="[0,0,0]" bold="false" executable="false" family="Arial" foreground="[0,0,0]" italic="true" name="_pstyle273" readonly="false" size="12" underline="false"/><Font background="[0,0,0]" bold="false" executable="false" family="Arial" foreground="[0,0,0]" italic="true" name="_pstyle272" readonly="false" size="12" underline="false"/><Font background="[0,0,0]" name="_cstyle262" underline="true"/><Font background="[0,0,0]" name="_cstyle261" underline="true"/><Font background="[0,0,0]" name="_cstyle260" underline="true"/><Font background="[0,0,0]" bold="true" executable="false" family="Arial" foreground="[0,0,0]" italic="true" name="Heading 1269" readonly="false" size="12" underline="false"/><Font background="[0,0,0]" bold="true" executable="false" family="Arial" foreground="[0,0,0]" italic="true" name="Heading 1268" readonly="false" size="12" underline="false"/><Font background="[0,0,0]" name="_cstyle259" size="12"/><Font background="[0,0,0]" bold="true" name="_cstyle258"/><Font background="[0,0,0]" name="_cstyle257" underline="true"/></Styles><Page-Numbers enabled="false" first-number="1" first-numbered-page="1" horizontal-location="right" style="Page Number" vertical-location="bottom"/><Group><Input><Text-field layout="_pstyle270" style="_cstyle260"><Font bold="true" family="Arial" foreground="[0,0,0]" italic="false" size="24">Biological populations with non-overlapping generations:</Font></Text-field><Text-field layout="_pstyle271" style="_cstyle261"><Font bold="true" family="Arial" foreground="[0,0,0]" italic="false" size="24">stable points, stable cycles and chaos</Font></Text-field><Text-field layout="_pstyle274" style="_pstyle274">by Prof. Matt Miller, Department of Mathematics, University of South Carolina</Text-field><Text-field layout="_pstyle275" style="_pstyle275"><Font bold="false" family="Arial" foreground="[0,0,0]" italic="true" size="14" style="_cstyle262">email:</Font> miller@math.sc.edu</Text-field><Text-field layout="Normal" style="Normal"/><Text-field layout="_pstyle272" style="_pstyle272">based upon Maple worksheet to accompany Robert M. May, 1974 , </Text-field><Text-field layout="_pstyle273" style="_pstyle273"> <Font bold="false" family="Arial" foreground="[0,0,0]" italic="true" size="12" style="_cstyle257">Biological populations with non-overlapping generations:  stable points, stable cycles and chaos</Font> , Science, <Font family="Arial" foreground="[0,0,0]" italic="true" size="12" style="_cstyle258" underline="false">186</Font>: 645-647.</Text-field><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal" style="Normal">This worksheet has three parts.  In the first two parts (also available as a Release 3 worksheet chaos.ms) we look at the model itself, and especially at the long term behaviour of the trajectories and how this may depend on initial conditions, growth parameters, etc. In section 1 we consider the dynamics of a single species; in section 2 we consider two competing species.  The third part (originally bifurc.ms) introduces the idea of a bifurcation diagram, which is a record of the repeated "stable points" that occur for different growth parameter values.</Text-field><Text-field layout="Normal" style="Normal"/></Input></Group><Section collapsed="true"><Title><Text-field layout="Heading 1268" style="Heading 1268">Section 1.  Stable cycles and chaos.</Text-field></Title><Group><Input><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal" style="Normal">May examines the behavior of difference equation analogues of the logistic equation.  He looks at two equations:</Text-field><Text-field layout="Normal" style="Normal">       1.  N(t+1) = N(t) * exp[r * (1 - N(t)/K]</Text-field><Text-field layout="Normal" style="Normal">       2.  N(t+1) = N(t) * [ 1 + r * (1 - N(t)/K)]  </Text-field><Text-field layout="Normal" style="Normal">Both are non-linear equations, and both have a stable equilibrium at N = K, when 2 &gt; r &gt; 0. The second, although more clearly "logistic-based" has the unfortunate tendancy to permit overshoot in which the population can dip negative under extreme oscillation, even with reasonably small stepsize. The reader is invited to experiment with this model as well, but in this worksheet all computations in this model have been "commented out".</Text-field><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal" style="Normal">We can demonstrate this stability by calculating the trajectory of populations from an initial size of 10 individuals, over 30 time steps.  We will try several values of r from 0.5 to 2.0.  We will use equation 1 as May did in his paper.  To avoid having extraneous "junk" getting printed, we suppress all printing and plotting in the main loop (under control of r), give the plots names, and plot them afterwards using the animation feature.  Two plots are created: plot_list gives N as a function of t; pairs gives N(t+1) against N(t). Clustering of points in the latter is an indication of stable cyclic behaviour.</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">restart:  with(plots):</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">N[0]:= 10 ;  K:= 1000 ; # initial condition and `carrying capacity`
title1:=`N(t+1) vs N(t) when r= `: title2:=`N(t) vs t when r= `: # title blanks for plots
sample_r:= [0.4, 0.7, 1.0, 1.3, 1.6, 1.9]; P_frames:= NULL: R_frames:= NULL:</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">for r in sample_r  do
plot_list:= [0, N[0]]:  pairs:= NULL:  # initialize the plots</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">   for t from 0 to 30 do
   #N[t+1]:= N[t] + ( r / k ) * N[t] * ( K - N[t] ):  # logistic model
   N[t+1]:= N[t] * exp(r * (1 - N[t] / K)):
   pairs:= pairs,  [N[t+1], N[t]]:
   plot_list:= plot_list, [t+1, N[t+1]]:
   od:</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">R[r]:= plot([ pairs ], style=point, color=green, title=cat(title1, convert(r,string))):
R_frames:= R_frames, R[r]:
P[r]:= plot([ plot_list ], style=line, color=plum, title=cat(title2, convert(r,string))):
P_frames:= P_frames,  P[r] :
od:</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">display([P_frames],  insequence=true);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">display([ R_frames ],  insequence=true); </Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">
You should now have six graphs of the trajectory of the population reaching a stable equilibrium of K, at growth rates r of 0.4, 0.7, 1.0, 1.3, 1.6, and 1.9.  Let us now try values of r close to 2.0 and see if the behavior indeed changes where May says it does.  This time we use a slightly different idea to plot the list of points: we use the "repeater" symbol $.  You do need to be a little bit careful with this; the repeater variable can't be one that you have already used (so having used t already in the worksheet, the safest thing to do is to be sure Maple forgets any previous values it may have had by resetting it to be just the neutral variable "t" once again).</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">N[0]:= 10 ; K:= 1000 ; sample_r:= [1.99, 1.999, 2.001, 2.01]; </Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">P_frames:= NULL:  R_frames:= NULL: t:= 't';</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">for r in sample_r  do</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">   for i from 0 to 2000 do
   #N[i+1]:= N[i] + ( r / K ) * N[i] * ( K - N[i] );
   N[i+1]:= N[i] * exp( r * (1 - N[i] / K));
   od:</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">R[r]:=plot([[N[1+ t], N[t]] $t=1900 .. 2000], style=point, color=green, title=cat(title1, convert(r,string))): 
P[r]:=plot([[t,N[t]] $t=1900 .. 2000], style=line, color= coral, title=cat(title2, convert(r, string))):
P_frames:= P_frames, P[r]:   R_frames:= R_frames,  R[r] :
od:</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">display( [P_frames], insequence = true ); </Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">display( [R_frames], insequence = true);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">
We have plotted from time step 1900 to time step 2000 on the graphs to see whether the populations have reached an equilibrium or whether they have stabilized.  The model with r=1.999 appears to be a damped oscillation which is still damping, whereas the model with r=2.001 appears to have entered into a stable oscillation.
</Text-field><Text-field layout="Normal" style="Normal">Let us now try examining the regions where May says there is a 2 point cycle (2.526 &gt; r &gt; 2.0), a 4 point cycle (2.656 &gt; r &gt; 2.526), an 8 point cycle (2.685 &gt; r &gt; 2.656), a cycle of 16 or 32 points (2.692&gt;r&gt;2.685).  We will also plot graphs of N(t+1) vs N(t) to see the underlying structure in the data:</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">N[0]:= 10; K:= 1000; sample_r:= [2.4, 2.6, 2.67, 2.69]; </Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">P_frames:= NULL: R_frames:= NULL:</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">for r in sample_r do</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">   for i from 0 to 60 do
   #N[i+1]:= (N[i] + ( r / K ) * N[i] * ( K - N[i] ));  # logistic-based model
   N[i+1]:= N[i] * exp( r * (1 - N[i] / K )); 
  od:</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">R[r]:= plot([[N[1+ t], N[t]] $t=0 .. 60], style=point, color=green, title=cat(title1, convert(r,string))): 
P[r]:= plot([ [t,N[t] ] $t=0 .. 60], style=line, color= plum, title=cat(title2, convert(r,string))):
R_frames:= R_frames, R[r]:  P_frames:= P_frames, P[r]:
od:</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">display( [P_frames], insequence = true );</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">display( [R_frames], insequence = true );</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">
Now let us examine May's assertion that in the region of chaotic behavior, the initial conditions determine the pattern of behavior.  Let us try four simulations with r = 3.3, each with a different starting population.  The starting conditions used in the second and fourth graphs correspond to May's conditions of No/K = 0.02 (No = 20) and No/K = 1.5 (No = 1500); see Fig 1(d) and Fig 1(e).  We run the time up to 50 instead of 30 (why stop when you're having fun?).</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">R_frames:= NULL:  P_frames:= NULL:
title1:=`N(t+1) vs N(t) when N(0)= `: title2:=`N(t) vs t when N(0)= `:
r:= 3.3; K:= 1000; sample_inits:= [10, 20, 500, 1500]; # parameters and initial conditions</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">for j in sample_inits do
N[0]:= j;</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">     for i from 0 to 50 do
     #N[i+1]:= N[i] + ( r / K ) * N[i] * ( K - N[i] ); # logistic-based model </Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">     N[i+1]:= N[i] * exp( r * (1 - N[i] / K));
     od;</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">R[j]:=plot([[N[1+ t], N[t]] $t=0 .. 50], style=point, color=green, title=cat(title1, convert(j, string))):
R_frames:= R_frames, R[ j ]: 
P[j]:= plot([[t,N[t]] $t=0 .. 50], style=line, color=blue, title=cat(title2, convert(j, string))):
P_frames:= P_frames, P[ j ] :</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">od:</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">display( [ P_frames ], insequence = true);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">display( [ R_frames ], insequence = true);</Font></Text-field></Input></Group></Section><Section collapsed="true"><Title><Text-field layout="Heading 1" style="Heading 1"><Font bold="true" family="Arial" foreground="[0,0,0]" italic="true" style="_cstyle259" underline="false">Section 2.  Mutispecies interactions</Font>.</Text-field></Title><Group><Input><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal" style="Normal">We turn now to May's discussion of multispecies interactions.  He suggests an analog of the Lotka-Volterra competition equations (his equations 5a and 5b).  </Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">header:= `N(t) vs t when r= `:
alpha:=0.5; beta:=0.5; K1:=1000; K2:=1000; # competition parameters
frames:= NULL: N1[0] := 100; N2[0]:= 100; # initial conditions
sample_r:= [1.1, 1.5, 2.5, 4.0];   #  sample r  values</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">for r in sample_r  do
r1:= r:    r2:=2 * r1:</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">     for i from 0 to 30 do
     #N1[i+1]:= (N1[i] + ( r1 / K1 ) * N1[i] * ( K1 - N1[i] - alpha*N2[i] )):
     N1[i+1]:= N1[i] * exp( ( r1 / K1 ) * ( K1 - N1[i] - alpha * N2[i] ) ):
     #N2[i+1]:= (N2[i] + ( r2 / K2 ) * N2[i] * ( K2 - N2[i] - beta*N1[i] ));
     N2[i+1]:= N2[i] * exp( ( r2 / K2 ) * ( K2- N2[i] - beta * N1[1] ) );
     od:</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">P[r]:= plot([[t,N1[t]] $t = 0 .. 30], style=line, color=plum, title=cat(header, convert(r,string))):
Q[r]:= plot([[t,N2[t]] $t = 0 .. 30], style=line, color=green, title=cat(header, convert(r,string))):
frames:= frames, display([ P[r], Q[r] ]):  # overlay both plots and make video</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">od:</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">display( [ frames ], insequence = true, axes = framed);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">
Compare the graphs you just printed with Figure 2 in the May paper.  Do you see similar dynamics?</Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal" style="Normal">Let's now check his stability conditions.  May states (see equation 6) that the continuous version (differential equations version) of the Lotka-Volterra type system given by equations 5a and 5b exhibits coexistence of the two species with a stable equilibrium if and only if  
                                         D = a11*a22 - a21*a12 &gt; 0.  
In our equations, a11 = a22 = 1  and a12 = a21 = 0.5.  Therefore  D = 1 - 0.25 = 0.75 &gt; 0.  (For the logistic version of the continuous model, you have already see this analysis, though not in precisely these terms. Take a look at section 6.3 of E-K.)  In the difference equation version of the competition model, the stability criteria are  given in equations 7:</Text-field><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal" style="Normal">                        A &gt; D &gt; 0                       if  A &lt; 2            (7a)</Text-field><Text-field layout="Normal" style="Normal">                        A &gt; D &gt; (2A -4)              if A &gt; 2             (7b)</Text-field><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal" style="Normal">where D is defined as above, N1* and N2* are the equilibrium solutions of  equations 5, and May defines 

                        A = (a11 K2/(r2 N2*)) + (a22 K1/(r1 N1*)).

Try solving equations 5 for the equilibrium population sizes of N1 and N2.  Then try calculating A and see if the stability conditions in equations 7 are accurate. Do you understand why it is enough to solve the following equations to find the equilibria?
</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">eq5a:= 0=(K1-N1 -alpha*N2);   eq5b:= 0=(K2-N2 -beta*N1);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">parameters:= {a11 = 1, a22 = 1, a12 = 0.5, a21 = 0.5, c1= r1, c2 = r2};</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">answer:= solve({ eq5a, eq5b}, {N1, N2});</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">N1equil:= subs( answer, N1);  N2equil:= subs( answer, N2);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">
Let's calculate the values of A and D (we have to use little d, because Maple has reserved D for its own purposes).</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">A:=subs( parameters,  a11*K2/(c2 * N2equil) + a22*K1/(c1 * N1equil)); </Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">d:=subs(parameters, a11*a22 - a21*a12);</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">
It's plain that equation 7a is relevant since A &lt; 2, but the condition fails since A is obviously not greater than d, although we do have d &gt; 0. Therefore, according to May, the species will coexist, but not in stable equilibrium. Does this make sense, knowing the value of r1 that you last used?  We can remind ourselves what this value was:
</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">r1:= r1; r2:= r2;</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">
Try other values for c1 and c2 in the parameter set above, and see if there are conditions under which the system should be stable.</Text-field><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal" style="Normal">What do you think about the stability of the difference equation competition model compared to the difference equation single species growth model?  Under what conditions on r do you observe damped oscillations in the single species model?  What is the range for the competition model?  What about 2-point oscillations in the single species model  versus the competition model?  How different are the growth rates r over which this occurs?</Text-field><Text-field layout="Normal" style="Normal">
Make yourself a table of behaviors analogous to May's Table 1:</Text-field><Text-field layout="Normal" style="Normal">
Behavior                                          Value of "r"</Text-field><Text-field layout="Normal" style="Normal">                                         Equation 1                   Equation 5</Text-field><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal" style="Normal">Stable equilibrium                   2&gt;r&gt;0                         1.49?&gt;r&gt;0</Text-field><Text-field layout="Normal" style="Normal">2-point cycle                   2.526&gt;r&gt;2                                  ?</Text-field><Text-field layout="Normal" style="Normal">4-point cycle                   2.656&gt;r&gt;2.526                           ?</Text-field><Text-field layout="Normal" style="Normal">8-point cycle                   2.685&gt;r&gt;2.656                           ?</Text-field><Text-field layout="Normal" style="Normal">Chaos                                       r&gt;2.692                           r&gt;2.49?</Text-field></Input></Group></Section><Section collapsed="true"><Title><Text-field layout="Heading 1269" style="Heading 1269">Section 3. Bifurcation analysis.</Text-field></Title><Group><Input><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal" style="Normal">We recall that May examines the behavior of difference equation analogues of the logistic equation.  He looks at two equations:</Text-field><Text-field layout="Normal" style="Normal">       1.  N(t+1) = N(t) * exp[r * (1 - N(t)/K]</Text-field><Text-field layout="Normal" style="Normal">       2.  N(t+1) = N(t) * [ 1 + r * (1 - N(t)/K)]</Text-field><Text-field layout="Normal" style="Normal">Both are non-linear equations, and both have a stable equilibrium at N = K, when 2 &gt; r &gt; 0.  In the long term the population N(t) exhibits cyclic behaviour, which becomes more pronounced  as the value of the growth parameter r increases. The extremes of the oscillations, known as stable points, recur periodically. Here we examine the distribution of stable points as a function of the growth rate parameter r.  For the purpose of this exercise we will assume the system becomes stable after 20 time steps, so the last 10 time steps will be used to estimate the locations of the 'stable points'.  This kind of plot is called a bifurcation plot (see discussion on p. 53 in Edelstein-Keshet).</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">number_of_steps:= 30;  record_after_step:= 20;</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">N[0]:= 10 ;   K:= 1000 ; plot_list:= NULL:</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Normal"><Font italic="true" size="12" style="Maple Input" underline="false">for r from 1.0 to 3.0 by 0.02 do
    for t from 0 to number_of_steps do
    #N[t+1]:= N[t] + ( r / K ) * N[t] * ( K - N[t] );  #  discrete logistic model
    N[t+1]:= N[t] * exp(r * (1-N[t] / K)):  # May's eq 1 (see E-K problem 4, page 62)</Font>   </Text-field><Text-field layout="Normal" style="Normal">Save the "stable points"  in a data list called plot_list.  Only use data from time steps  21 - 30 in each run.</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">       if t &gt; record_after_step then
       plot_list:= plot_list, [r, N[t+1]]:# add (r, N(t+1)) to the points to be plotted
       fi:  # Maplese to indicate the if-then-else stuff is done
    od:  # loop terminator for t (r fixed) 
od:  # loop terminator for r (go back and re-run with new r value)</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal" style="Normal">Plot the bifurcation diagram using the saved values of the stable points and corresponding r values.  </Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">plot( [ plot_list ], style = point, title=`May eq 1:  Bifurcation Map K vs r` );</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">
Examine once again May's discussion of multispecies interactions.  He suggests an analog of the Lotka-Volterra competition equations (equations 5a and 5b).  Note that the competition is completely symmetric (K1 = K2, alpha = beta), except that the intrinsic growth rate for sp 2 is twice that of sp 1. </Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">alpha:=0.5;  beta:=0.5;  K1:=1000;  K2:=1000;  # competition parameter values
N1[0]:= 100;  N2[0]:=100;  # initial values 
plot_list1:= NULL:  plot_list2:= NULL:</Font></Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">number_of_steps:= 30;  record_after_step:= 20;</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">for r from 1.0 to 3.0  by 0.02 do
r1:=r:  r2:= 2 * r1:
    for t from 0 to 30 do
    #N1[t+1]:= (N1[t] + ( r1 / K1 ) * N1[t] * ( K1 - N1[t] - alpha*N2[t] )); # logistic-based model
    N1[t+1]:=N1[t] * exp((r1 / K1) * (K1 - N1[t] -alpha * N2[t]));
    #N2[t+1]:= (N2[t] + ( r2 / K2 ) * N2[t] * ( K2 - N2[t] - beta * N1[t] )); # logistic-based model
    N2[t+1]:= N2[t]  * exp((r2 / K2) * (K2 - N2[t] - beta * N1[t]));
          if t &gt; record_after_step  then
         plot_list1:= plot_list1, [r, N1[t+1]]: # add (r, N1(t+1)) to list of points
         plot_list2:= plot_list2, [r, N2[t+1]]: # add (r, N2(t+1)) to list of points
         fi;
    od:  # loop terminator for t (r fixed)
od:  # loop terminator for r (go back and re-run with new r value)</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">plot([ plot_list1 ], style = point, title=`May competition Bifurcation Map N1 vs r` );</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">plot([ plot_list2 ], style = point, title=`May competition Bifurcation Map N2 vs r` );</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal">
How do you account for the difference in the last two diagrams?  You might want to try some other experiments: for instance what happens if r1 = r = r2, but the competition is asymmetrical (take alpha = 0.5, beta = 0.8, or perhaps try different carrying capacities)?</Text-field><Text-field layout="Normal" style="Normal">
Compare the bifurcation diagram for a single species with one of the diagrams for a species that is experiencing competition. Which system shows greater stability?  Look at the positions of the branch points.  These are the values of the growth rate "r" at which the population begins to oscillate between two stable points.  These locations are not exactly correct, because we have sampled at time steps 20 - 30, before the damped oscillations have fully disappeared.  Hence we are underestimating the positions of the branch points. </Text-field><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal" style="Normal">If you want better estimates of the branch points, change the number_of_ steps to 60 (or higher) and change record_after_step to 40 (for example) in both parts of the worksheet.  This will take longer to execute, but should give better estimates of  the branch points, since the models damp out more fully after  40 time steps than after 20.  You can also change the stepsize for r from 0.2 to 0.1 (giving finer resolution in the graphs, but calling for twice as much computation).  Do these results agree qualitatively with your simulations from the  first section of this worksheet?</Text-field><Text-field layout="Normal" style="Normal"/><Text-field layout="Normal" style="Normal">Why do you think that the competition model oscillates at lower values of r than the logistic model?</Text-field><Text-field layout="Normal" style="Normal">
How do the values of r in the competition model compare with values for real organisms?  Do you believe that this kind of instability is likely to occur in real organisms?  If so, which ones?</Text-field><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="true" size="12" underline="false">restart:</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group></Section><Text-field/></Worksheet>