Callahan
    8.1: 1(a)(b)(c), 2, 5(a)(b)(c)

[Graphics:Images/springwk3_gr_1.gif]

1)  Predator-prey models:

[Graphics:Images/springwk3_gr_2.gif]

    a)  The original Lotka-Volterra model:

[Graphics:Images/springwk3_gr_3.gif]
[Graphics:Images/springwk3_gr_4.gif]

    (1) Why is it a reasonable model and what is it saying about how the populations change?

    The [Graphics:Images/springwk3_gr_5.gif] equation:
    The rate of change of the rabbit population is proportional to the rabbit population, and to the negative product of the rabbit and fox populations.  We can think of the product term as an interaction term, where the frequency with which foxes encounters and eat rabbits is proportional to how big both the rabbit and fox populations.  This makes since because the more animals their are, the more encounters there will be.

    The [Graphics:Images/springwk3_gr_6.gif] equation:
    The rate of change of the fox population is proportional to the negative of the fox population, and to the product of the rabbit and fox populations.  The product term works the same as in the rabbit rate equation, except here it has a positive effect on the rate of change of the fox population.  The rate of change of the fox population being proportional to the negative of the fox population models the fact that in the absence of rabbits, the fox population can not survive and so must have a negative rate of change.

    (2) Plot (in red) the set of points where [Graphics:Images/springwk3_gr_7.gif], and mark the regions where [Graphics:Images/springwk3_gr_8.gif] and [Graphics:Images/springwk3_gr_9.gif].

[Graphics:Images/springwk3_gr_10.gif]
[Graphics:Images/springwk3_gr_11.gif]
[Graphics:Images/springwk3_gr_12.gif]

    (3) Plot (in green) the set of points where [Graphics:Images/springwk3_gr_13.gif], and mark the regions where [Graphics:Images/springwk3_gr_14.gif] and [Graphics:Images/springwk3_gr_15.gif].

[Graphics:Images/springwk3_gr_16.gif]
[Graphics:Images/springwk3_gr_17.gif]
[Graphics:Images/springwk3_gr_18.gif]

    (4) Mark the equilibrium points.  What color are they?

[Graphics:Images/springwk3_gr_19.gif]
[Graphics:Images/springwk3_gr_20.gif]

    (5) Plot the vector field and a few trajectories.    (p412)

[Graphics:Images/springwk3_gr_21.gif]

    (6) On the basis of your plots make a conjecture about the stability of the equilibrium points.

    The equilibrium point [Graphics:Images/springwk3_gr_22.gif] is totally stable (center), all trajectories are stable solutions, they don't change from cycle to cycle.  We know this because as we increase the number of steps used in Euler's method, the curve gets closer and closer to returning to where it started after one cycle.  The equilibrium point [Graphics:Images/springwk3_gr_23.gif] is unstable in the rabbit axis, but stable in the fox axis.

[Graphics:Images/springwk3_gr_24.gif]

    b)  The Leslie-Gower model:

[Graphics:Images/springwk3_gr_25.gif]
[Graphics:Images/springwk3_gr_26.gif]

    (1) Why is it a reasonable model and what is it saying about how the populations change?

    The [Graphics:Images/springwk3_gr_27.gif] equation:
    This is the same as for the Lotka-Volterra model.  The rate of change of the rabbit population is proportional to the rabbit population, and to the negative product of the rabbit and fox populations.  We can think of the product term as an interaction term, where the frequency with which foxes encounters and eat rabbits is proportional to how big both the rabbit and fox populations are in the given region.  This makes since because the more animals their are, the more encounters there will be.

    The [Graphics:Images/springwk3_gr_28.gif] equation:
    The rate of change of the fox population is proportional to the fox population scaled by a carrying capacity like term.  In the carrying capacity term, the rabbit population is proportional to the carrying capacity; the constants [Graphics:Images/springwk3_gr_29.gif] and [Graphics:Images/springwk3_gr_30.gif] act to scale the carrying capacity.  It makes sense to have the carrying capacity be proportional to the rabbit population because the fox population is dependent of the rabbits as a food source.

    (2) Plot (in red) the set of points where [Graphics:Images/springwk3_gr_31.gif], and mark the regions where [Graphics:Images/springwk3_gr_32.gif] and [Graphics:Images/springwk3_gr_33.gif].

[Graphics:Images/springwk3_gr_34.gif]
[Graphics:Images/springwk3_gr_35.gif]
[Graphics:Images/springwk3_gr_36.gif]

    (3) Plot (in green) the set of points where [Graphics:Images/springwk3_gr_37.gif], and mark the regions where [Graphics:Images/springwk3_gr_38.gif] and [Graphics:Images/springwk3_gr_39.gif].

[Graphics:Images/springwk3_gr_40.gif]
[Graphics:Images/springwk3_gr_41.gif]
[Graphics:Images/springwk3_gr_42.gif]

    (4) Mark the equilibrium points.  What color are they?

    The equilibrium points occur anywhere the [Graphics:Images/springwk3_gr_43.gif] and [Graphics:Images/springwk3_gr_44.gif] lines cross:

    To find the [Graphics:Images/springwk3_gr_45.gif] coordinate of an equilibrium point, we set the equations of a [Graphics:Images/springwk3_gr_46.gif] line equal to a [Graphics:Images/springwk3_gr_47.gif] line:

[Graphics:Images/springwk3_gr_48.gif]
[Graphics:Images/springwk3_gr_49.gif]

    So:

[Graphics:Images/springwk3_gr_50.gif]

    And we already had the [Graphics:Images/springwk3_gr_51.gif] coordinate of the equilibrium point:

[Graphics:Images/springwk3_gr_52.gif]

    So our equilibrium points are:

[Graphics:Images/springwk3_gr_53.gif]
[Graphics:Images/springwk3_gr_54.gif]

    (5) Plot the vector field and a few trajectories.

[Graphics:Images/springwk3_gr_55.gif]

    (6) On the basis of your plots make a conjecture about the stability of the equilibrium points.

    The equilibrium point [Graphics:Images/springwk3_gr_56.gif] is totally stable (spiral sink).  The equilibrium point [Graphics:Images/springwk3_gr_57.gif] is unstable in the rabbit axis, but stable in the fox axis.

[Graphics:Images/springwk3_gr_58.gif]

    c)  The Leslie-Gower model with carrying capacity for rabbits:

[Graphics:Images/springwk3_gr_59.gif]
[Graphics:Images/springwk3_gr_60.gif]

    (1) Why is it a reasonable model and what is it saying about how the populations change?

    The [Graphics:Images/springwk3_gr_61.gif] equation:
    The rate of change of the rabbit population is proportional to the rabbit population scaled by a carrying capacity term, and to the negative product of the rabbit and fox populations.  We can think of the product term as an interaction term, where the frequency with which foxes encounters and eat rabbits is proportional to how big both the rabbit and fox populations are in the given region.  This makes since because the more animals their are, the more encounters there will be.  The carrying capacity term simply equals zero when [Graphics:Images/springwk3_gr_62.gif], is greater than zero when [Graphics:Images/springwk3_gr_63.gif], and is less than zero when [Graphics:Images/springwk3_gr_64.gif].

    The [Graphics:Images/springwk3_gr_65.gif] equation:
    The rate of change of the fox population is proportional to the fox population scaled by a carrying capacity like term.  In the carrying capacity term, the rabbit population is proportional to the carrying capacity; the constants [Graphics:Images/springwk3_gr_66.gif] and [Graphics:Images/springwk3_gr_67.gif] act to scale the carrying capacity.  It makes sense to have the carrying capacity be proportional to the rabbit population because the fox population is dependent of the rabbits as a food source.

    (2) Plot (in red) the set of points where [Graphics:Images/springwk3_gr_68.gif], and mark the regions where [Graphics:Images/springwk3_gr_69.gif] and [Graphics:Images/springwk3_gr_70.gif].

[Graphics:Images/springwk3_gr_71.gif]
[Graphics:Images/springwk3_gr_72.gif]
[Graphics:Images/springwk3_gr_73.gif]

    (3) Plot (in green) the set of points where [Graphics:Images/springwk3_gr_74.gif], and mark the regions where [Graphics:Images/springwk3_gr_75.gif] and [Graphics:Images/springwk3_gr_76.gif].

[Graphics:Images/springwk3_gr_77.gif]
[Graphics:Images/springwk3_gr_78.gif]
[Graphics:Images/springwk3_gr_79.gif]

    (4) Mark the equilibrium points.  What color are they?

    The equilibrium points occur anywhere the [Graphics:Images/springwk3_gr_80.gif] and [Graphics:Images/springwk3_gr_81.gif] lines cross:

    To find the [Graphics:Images/springwk3_gr_82.gif] coordinate of an equilibrium point, we set the equations of a [Graphics:Images/springwk3_gr_83.gif] line equal to a [Graphics:Images/springwk3_gr_84.gif] line:

[Graphics:Images/springwk3_gr_85.gif]
[Graphics:Images/springwk3_gr_86.gif]

    So:

[Graphics:Images/springwk3_gr_87.gif]

    And it is easy to find the [Graphics:Images/springwk3_gr_88.gif] coordinate:

[Graphics:Images/springwk3_gr_89.gif]

    Also we have a equilibrium point on the [Graphics:Images/springwk3_gr_90.gif] axes, where the [Graphics:Images/springwk3_gr_91.gif] line intersects it:

[Graphics:Images/springwk3_gr_92.gif]
[Graphics:Images/springwk3_gr_93.gif]

    So:

[Graphics:Images/springwk3_gr_94.gif]

    So our equilibrium points are:

[Graphics:Images/springwk3_gr_95.gif]
[Graphics:Images/springwk3_gr_96.gif]
[Graphics:Images/springwk3_gr_97.gif]

    (5) Plot the vector field and a few trajectories.

[Graphics:Images/springwk3_gr_98.gif]

    (6) On the basis of your plots make a conjecture about the stability of the equilibrium points.

    The equilibrium point [Graphics:Images/springwk3_gr_99.gif] is totally stable (spiral sink).  The equilibrium point [Graphics:Images/springwk3_gr_100.gif] is unstable in the rabbit axis, but stable in the fox axis.  The equilibrium point [Graphics:Images/springwk3_gr_101.gif] is stable in the rabbit axis, but unstable in the fox axis.

from visual.graph import *
from visual import *
field = display(background=color.white)
graph1 = gdisplay()

a = 0.1
b = 0.005
c = 0.00004
d = 0.04
e = 0.001
f = 0.05
g = 0.04
h = 0.004
K = 10000.0


# Create the vector field (auto scaled):    
arrowsize = 3.5
dt = arrowsize
xmax = 2000.0
xmin = 100.0
rangeX = xmax - xmin
ymax = 23.0
ymin = 15.0
rangeY = ymax - ymin
z = 0

xstep = rangeX/10.0
ystep = rangeY/10.0

if rangeX > rangeY:
    normalizeX = rangeX/rangeY
else:
    normalizeX = 1

if rangeY > rangeX:
    normalizeY = rangeY/rangeX
else:
    normalizeY = 1

field.center=((xmax-(rangeX/2.0))/normalizeX,(ymax-(rangeY/2.0))/normalizeY,0)
field=[]
for x in arange(xmin,xmax,xstep):
    for y in arange(ymin,ymax,ystep):
        Xprime = a*x*(1-(x/K))-b*x*y
        Yprime = (e-f*(y/x))*y
        
        deltaX = Xprime * dt
        deltaY = Yprime * dt
        
        vec=arrow(pos=(x/normalizeX,y/normalizeY,z),axis=(deltaX/normalizeX,deltaY/normalizeY,0),shaftwidth=arrowsize/5.0,color=(0,0,0))
        field.append(vec)

# Plot the function:    
tinitial = 0
tfinal = 2000

t = tinitial
x = 1000
y = 22

numberofsteps = 10000
deltat = (tfinal - tinitial) / float(numberofsteps)

Xcurve = gcurve(gdisplay=graph1)
Ycurve = gcurve(gdisplay=graph1)
XYcurve = curve(color=(0,0,0))

for k in range(numberofsteps):
    Xprime = a*x*(1-(x/K))-b*x*y
    Yprime = (e-f*(y/x))*y
    
    deltaX = Xprime * deltat
    deltaY = Yprime * deltat
    
    t = t + deltat
    x = x + deltaX
    y = y + deltaY
    
    Xcurve.plot(pos=(t,x))
    Ycurve.plot(pos=(t,y))
    XYcurve.append(pos=(x/normalizeX,y/normalizeY,0))

# Plot the X'=0 lines(RED):
numberofsteps = 2

Rzero = curve(color=(1,0,0))
yinitial = 0
yfinal = ymax
y = yinitial
deltay = (yfinal - yinitial)/float(numberofsteps)
for k in range(0,numberofsteps+1) :
    x = 0
    Rzero.append(pos=(x/normalizeX,y/normalizeY,0))
    y = y + deltay

xinitial = 0
xfinal = xmax
x = xinitial
deltax = (xfinal - xinitial)/float(numberofsteps)
for k in range(0,numberofsteps+1) :
    y = (a/b)-(a/(b*K))*x
    Rzero.append(pos=(x/normalizeX,y/normalizeY,0))
    x = x + deltax

# Plot the Y'=0 lines(GREEN):
Fzero = curve(color=(0,1,0))
xinitial = 0
xfinal = xmax
x = xinitial
deltax = (xfinal - xinitial)/float(numberofsteps)
for k in range(0,numberofsteps+1) :
    y = 0
    Fzero.append(pos=(x/normalizeX,y/normalizeY,0))
    x = x + deltax

yinitial = 0
yfinal = ymax
y = yinitial
deltay = (yfinal - yinitial)/float(numberofsteps)
for k in range(0,numberofsteps+1) :
    x = (f/e)*y
    Fzero.append(pos=(x/normalizeX,y/normalizeY,0))
    y = y + deltay

[Graphics:Images/springwk3_gr_102.gif]

5(a)(b)(c):  More on Lotka-Volterra model

[Graphics:Images/springwk3_gr_103.gif]
[Graphics:Images/springwk3_gr_104.gif]
[Graphics:Images/springwk3_gr_105.gif]

    a) Sketch the vector field, together with some typical trajectories, in the rest of the R-F plane, include negative values.  What happens to any trajectory starting at a state with a negative R or F value?

[Graphics:Images/springwk3_gr_106.gif]

    Any trajectory that starts with a negative R or F value diverges to infinity, these solutions are not phisically meaningful

    b) Using Euler's method draw the first 500 segments of the trajectory, use the values of a, b, c, and d given above, start at the point [Graphics:Images/springwk3_gr_107.gif], and use a time step of [Graphics:Images/springwk3_gr_108.gif].

[Graphics:Images/springwk3_gr_109.gif]

    Does the trajectory look like a closed loop?

    No.

    How small does [Graphics:Images/springwk3_gr_110.gif] have to be before the trajectory looks like it closes?  Can you explain the phenomenon?

    In order for it to look like a closed loop we must have [Graphics:Images/springwk3_gr_111.gif] of about 0.5.  The problem is due to the inherent error involved in the process of Euler's method.

    c) Using Euler's method draw the first 1000 segments of the trajectory, use the values of a, b, c, and d given above, start at the point [Graphics:Images/springwk3_gr_112.gif], and use a time step of [Graphics:Images/springwk3_gr_113.gif].

    What happens?

    The computer gives the error "Result too large" because the solution goes to infinity very quickly.

[Graphics:Images/springwk3_gr_114.gif]

2)  Symbiosis and mutualism:  In this model [Graphics:Images/springwk3_gr_115.gif] is the number of bees per acre, measured in hundreds of bees, while C is the weight of clover per acre, in thousands of pounds.  Time is measured in months.

[Graphics:Images/springwk3_gr_116.gif]
[Graphics:Images/springwk3_gr_117.gif]
[Graphics:Images/springwk3_gr_118.gif]
[Graphics:Images/springwk3_gr_119.gif]
[Graphics:Images/springwk3_gr_120.gif]

    a)  Do these equations describe symbiosis?

    Yes.  The interaction terms [Graphics:Images/springwk3_gr_121.gif] are both positive.

    b)  Each equation has a negative term in it.  What aspect of reality is this term capturing?

    Rewriting each equation as above, we can see that the negative term is part of the "carrying capacity".  If the population is above the carrying capacity, then some will die off because their is insufficient food to sustain that great of a population.

    c)  Sketch the vector field for this system in the [Graphics:Images/springwk3_gr_122.gif] plane, mark the equilibrium points.

    The set of points where [Graphics:Images/springwk3_gr_123.gif]:

[Graphics:Images/springwk3_gr_124.gif]

    The set of points where [Graphics:Images/springwk3_gr_125.gif]:

[Graphics:Images/springwk3_gr_126.gif]

[Graphics:Images/springwk3_gr_127.gif]

from visual.graph import *
from visual import *
field = display(background=color.white)
graph1 = gdisplay()

a = 0.1
b = 0.0005
c = 0.03
d = 0.0012
Kb = 100
Kc = 10


# Create the vector field (auto scaled):    
arrowsize = 1.5
dt = arrowsize
xmax = 200.0
xmin = 0
rangeX = xmax - xmin
ymax = 120.0
ymin = 0
rangeY = ymax - ymin
z = 0

xstep = rangeX/10.0
ystep = rangeY/10.0

if rangeX > rangeY:
    normalizeX = rangeX/rangeY
else:
    normalizeX = 1

if rangeY > rangeX:
    normalizeY = rangeY/rangeX
else:
    normalizeY = 1

field.center=((xmax-(rangeX/2.0))/normalizeX,(ymax-(rangeY/2.0))/normalizeY,0)
field=[]
for x in arange(xmin,xmax,xstep):
    for y in arange(ymin,ymax,ystep):
        Xprime = a*x*(1-(x/Kb))+b*x*y
        Yprime = c*y*(1-(y/Kc))+d*x*y
        
        deltaX = Xprime * dt
        deltaY = Yprime * dt
        
        vec=arrow(pos=(x/normalizeX,y/normalizeY,z),axis=(deltaX/normalizeX,deltaY/normalizeY,0),shaftwidth=arrowsize/5.0,color=(0,0,0))
        field.append(vec)

# Plot the function:    
tinitial = 0
tfinal = 100

start = [5,10,50,120,90,5,200,5,200,50,150,120]

for i in range(len(start)/2):
    t = tinitial
    x = start[0+(2*i)]
    y = start[1+(2*i)]
    print x, y

    numberofsteps = 10000
    deltat = (tfinal - tinitial) / float(numberofsteps)

    Xcurve = gcurve(gdisplay=graph1)
    Ycurve = gcurve(gdisplay=graph1)
    XYcurve = curve(color=(0,0,0))

    for k in range(numberofsteps):
        Xprime = a*x*(1-(x/Kb))+b*x*y
        Yprime = c*y*(1-(y/Kc))+d*x*y
        
        deltaX = Xprime * deltat
        deltaY = Yprime * deltat
        
        t = t + deltat
        x = x + deltaX
        y = y + deltaY
        
        Xcurve.plot(pos=(t,x))
        Ycurve.plot(pos=(t,y))
        XYcurve.append(pos=(x/normalizeX,y/normalizeY,0))

# Plot the X'=0 lines(RED):
numberofsteps = 10

Rzero = curve(color=(1,0,0))
yinitial = 0
yfinal = ymax
y = yinitial
deltay = (yfinal - yinitial)/float(numberofsteps)
for k in range(0,numberofsteps+1) :
    x = 0
    Rzero.append(pos=(x/normalizeX,y/normalizeY,0))
    y = y + deltay

xinitial = 0
xfinal = xmax
x = xinitial
deltax = (xfinal - xinitial)/float(numberofsteps)
for k in range(0,numberofsteps+1) :
    y = (a/(b*Kb))*x-(a/b)
    Rzero.append(pos=(x/normalizeX,y/normalizeY,0))
    x = x + deltax

# Plot the Y'=0 lines(GREEN):
Fzero = curve(color=(0,1,0))
xinitial = 0
xfinal = xmax
x = xinitial
deltax = (xfinal - xinitial)/float(numberofsteps)
for k in range(0,numberofsteps+1) :
    y = 0
    Fzero.append(pos=(x/normalizeX,y/normalizeY,0))
    x = x + deltax

yinitial = 0
yfinal = ymax
y = yinitial
deltay = (yfinal - yinitial)/float(numberofsteps)
for k in range(0,numberofsteps+1) :
    x = (c/(d*Kc))*y-(c/d)
    Fzero.append(pos=(x/normalizeX,y/normalizeY,0))
    y = y + deltay

    d)  Determine the stability of the equilibrium points:

    The equilibrium points occur anywhere the [Graphics:Images/springwk3_gr_128.gif] and [Graphics:Images/springwk3_gr_129.gif] lines cross:

    To find the [Graphics:Images/springwk3_gr_130.gif] coordinate of an equilibrium point, we set the equations of a [Graphics:Images/springwk3_gr_131.gif] line equal to a [Graphics:Images/springwk3_gr_132.gif] line:

[Graphics:Images/springwk3_gr_133.gif]
[Graphics:Images/springwk3_gr_134.gif]

    So:

[Graphics:Images/springwk3_gr_135.gif]
[Graphics:Images/springwk3_gr_136.gif]

    And it is easy to find the [Graphics:Images/springwk3_gr_137.gif] coordinate:

[Graphics:Images/springwk3_gr_138.gif]

    Also we have a equilibrium point on the [Graphics:Images/springwk3_gr_139.gif] axes, where the [Graphics:Images/springwk3_gr_140.gif] line intersects it:

[Graphics:Images/springwk3_gr_141.gif]
[Graphics:Images/springwk3_gr_142.gif]

    So:

[Graphics:Images/springwk3_gr_143.gif]

    And we have a equilibrium point on the [Graphics:Images/springwk3_gr_144.gif] axes, where the [Graphics:Images/springwk3_gr_145.gif] line intersects it:

[Graphics:Images/springwk3_gr_146.gif]
[Graphics:Images/springwk3_gr_147.gif]

    So:

[Graphics:Images/springwk3_gr_148.gif]

    So our equilibrium points are:

[Graphics:Images/springwk3_gr_149.gif]
[Graphics:Images/springwk3_gr_150.gif]
[Graphics:Images/springwk3_gr_151.gif]
[Graphics:Images/springwk3_gr_152.gif]

    The equilibrium point [Graphics:Images/springwk3_gr_153.gif] is totally stable (sink).  All other equilibrium points tend toward this equilibrium point.

    e)  Suppose an acre of land has [Graphics:Images/springwk3_gr_154.gif] pounds of clover on it, and a hive of [Graphics:Images/springwk3_gr_155.gif] bees is introduced.  What happens?

[Graphics:Images/springwk3_gr_156.gif]

    f)

[Graphics:Images/springwk3_gr_157.gif]

    g)

[Graphics:Images/springwk3_gr_158.gif]

[Graphics:Images/springwk3_gr_159.gif]


Converted by Mathematica      April 19, 2004