MATH 1170: Calculus for Biologists I (Fall 2010)

advertisement
MATH 1170: Calculus for Biologists I (Fall 2010)
Lab Meets: November 9, 2010
Report due date: November 16, 2010
Section 002: Tuesday 9:40−10:30am
Section 003: Tuesday 10:45−11:35am
Lab location − LCB 115
Lab instructor − Erica Graham, graham@math.utah.edu
Lab webpage − www.math.utah.edu/~graham/Math1170.html
Lab 09
General Lab Instructions
In−class Exploration
Review: Last time, we used the concept of second derivatives to further analyze the behavior of functions,
and practiced differentiation ad nauseum.
Background: This week, we’ll return to the concept of discrete−time dynamical systems from the point of
determining the stability of equilibria analytically (i.e. using derivatives). We’ll see how our results
compare to what we would see in a cobweb diagram. The Ricker model will be the primary focus of the
lab. Like the Beverton−Holt model we saw in Lab #2, it was developed to describe reproduction in
fisheries.
Toward the end of the lab, we will make use of the ’cobweb’ file we used quite a few weeks ago.
restart;
read("/u/ma/graham/public_html/Math1170/files/cobweb"): ## file
for making useful pictures
The discrete equation x[t+1]=F(x[t]) representing the Ricker model is characterized by the updating
function F(x)= r*x*exp(−x). r*exp(−x) is considered the per capita reproduction of the population. Our
goal this lab is to see what impact r may have on the stability of the system.
F:=x−>r*x*exp(−x);
F := x r x e x
(2.1)
There are many things we can do with this function. For one, we can use the eval( ) command to create
new updating functions for different values of r. Here, we will define functions for r = 2, 5, 8 and 13,
named f2(x), f5(x), f8(x) and f13(x), respectively. The first 4 lines actually define the functions, while the
last one actually shows us that Maple understood what we wanted it to do. Notice how it put in the values
we wanted it to in place of r.
f2:=x−>eval(F(x),r=2);
f5:=x−>eval(F(x),r=5);
f8:=x−>eval(F(x),r=8);
f13:=x−>eval(F(x),r=13);
f2(x); f5(x); f8(x); f13(x);
f2 := x F x
r=2
f5 := x F x
r=5
f8 := x
F x
r=8
f13 := x
F x
r = 13
2xe
x
5xe
x
8xe
x
x
13 x e
(2.2)
Now we can simultaneously graph all of our new functions along with the diagonal, which we will plot as
simply ’x.’
plot([x,f2(x),f5(x),f8(x),f13(x)],x=0..5,color="Black",linestyle=
[1,2,3,4,7],legend=["diagonal","r=2","r=5","r=9","r=13"],labels=
["x[t]","x[t+1]"]);
5
4
3
x[t+1]
2
1
0
0
1
2
diagonal
r=5
r=13
3
x[t]
4
5
r=2
r=9
There appear to be two equilibria, one at 0 and the other at some positive x[t] value. The above plot shows
us how the parameter r changes the location of the positive equilibrium. Notice that as we increase r, the
equilibria seem to move up along the diagonal. We can find the exact values of these positive equilibria by
using an old favorite, solve( ), for the equation f_(x) = x.
solve(f2(x)=x,x);
solve(f5(x)=x,x);
solve(f8(x)=x,x);
solve(f13(x)=x,x);
0, ln 2
0, ln 5
0, 3 ln 2
0, ln 13
(2.3)
You learned that we can determine the stability of an equilibrium point by seeing if the slope of the
updating function is less than 1 in absolute value at that point. Since each of our functions has two
equilibria (0 and ln(r)), we need to determine the slope for both of them. To do this, we’ll use the diff( ) and
eval( ) commands, in conjunction with a new command, evalf( ). Like the fsolve( ) command we learned
last time, evalf( ) will actually give a numerical approximation of a symbolic expression, which is
sometimes more useful. In our case, it would be better to know if the derivative were 0.3679 as opposed to
exp(−1). The tricky part is the fact that evalf( ) doesn’t allow us to put in values as we go, which is why we
need to use eval( ) first.
evalf(eval(diff(f2(x),x),x=0)),evalf(eval(diff(f2(x),x),x=ln(2)));
evalf(eval(diff(f5(x),x),x=0)),evalf(eval(diff(f5(x),x),x=ln(5)));
evalf(eval(diff(f8(x),x),x=0)),evalf(eval(diff(f8(x),x),x=ln(8)));
evalf(eval(diff(f13(x),x),x=0)),evalf(eval(diff(f13(x),x),x=ln(13)
));
2., 0.3068528194
5., 0.609437912
8., 1.079441542
13., 1.564949357
(2.4)
The results of our stability analysis show several things:
[1] for all r values, the equilibrium at 0 is always unstable (since the slopes are all > 1);
[2] the positive equilibria for r = 2 and r = 5 are both stable; and,
[3] the positive equilibria for r = 8 and r = 13 are both unstable.
We can see what these results look like graphically, by creating separate cobweb diagrams for each of our
functions. We will make use of the cweb( ) command within the cobweb file we loaded at the beginning to
construct the diagrams, saving them as individual plots. Then we will use plots[display]( ) along with the
new array( ) command to display them 2 by 2. array( ) basically allows us to organize plots in a table−like
format as we choose. In general, array( ) puts objects (usually numbers) into a matrix−like form. When
those objects are plots, the array looks like a table.
p1:=cweb(f2,0,15,0.15): ## of the form cweb(function,start_time,
end_time,x[0])
p2:=cweb(f5,0,20,1.1):
p3:=cweb(f8,0,50,2.3):
p4:=cweb(f13,0,30,2.7):
Like the last time we used the cobweb file, the red dot on the cobweb diagram indicates our starting
population size.
plots[display](array([[p1,p2],[p3,p4]]));
1
x[t+1] 0.6
0
00.2
0.8 1
3
2
x[t+1]
1
0
x[t]
4
x[t+1] 2
0
0 1 2 3 4
x[t]
0
1
2
3
x[t]
6
4
x[t+1]
2
0
0 1 2 3 4 5 6
x[t]
We can see that our analytical work was correct in classifying the stability of the various equilibria we
considered. What we couldn’t see analytically was how the solutions behaved within our iterations, i.e.
whether they oscillated or steadily increased. It’s evident from the above diagrams that if the maximum
possible per capita reproduction, r, is too high, the population can become extremely unstable, to the extent
that exceedingly large populations one year leads to depleted resources and diminished populations the
following year.
Lab 09 Homework Problems
Please copy this entire section into a new worksheet, and save it as something
you’ll remember.
Your Full Name:
Your (registered) Lab Section:
Useful Tip #1: Read each problem carefully, and be sure to follow the directions specified for each question!
Useful Tip #2: In case you missed it the first time, follow the directions specified for each question!!
Useful Tip #3: Here’s a little reminder to follow the directions specified for each question!!!
Useful Tip #4: Finally, don’t be afraid to troubleshoot! Does your answer make sense to you? If not, explore why. If
you’re still unsure, ask me.
Paper−saving tip: Make the size of your output graphs smaller to save paper when you print them. Please ask me if
you’re unsure of how to do this. (You can see how much paper you’d use beforehand by going to File
Print
Preview.)
(0)(a) Read the useful tips above. Put a star next to each one you read for an extra 1% per star (the paper−saving tip
included). To validate your extra points, write the take−home message of useful tips #1 through #3 below. (Hint:
there’s only one. Note: if you’re wrong, you won’t get any extra points.)
(0)(b) Read in the ’cobweb’ file we used in class today. (Just execute the following command.)
read("/u/ma/graham/public_html/Math1170/files/cobweb"):
(1) The current homework will be based on an analog of the logistic growth equation. The discrete−time dynamical
system we will consider is x[t+1] = x[t]*exp(r*(1−(x[t]/K))), where K is the carrying capacity of the population and
the ("density−dependent") per capita reproduction is given by exp(r*(1−(x[t]/K)). Define the function g(x) to be the
updating function of this system.
## Feel free to use this space for g(x).
(2)(a) Assuming that r > 0, for which x value between 0 and K is the per capita reproduction smallest? (Paper and
pencil might help.)
(b) Why might this make sense biologically?
(3)(a) Assign a value of 100 to K.
## Feel free to use this space for K.
(b) Find the equilibria of the system, and save the result to a list called eq.
## Feel free to use this space for eq.
(4)(a) To assess the stability of your equilibria, first find the derivative of g(x), and save it as the function dgdx(x) of
x using unapply( ). (Use your previous labs to help you with the unapply( ) command.)
## Feel free to use this space for dgdx(x).
(b) Evaluate dgdx(eq[1]) and dgdx(eq[2]).
## Feel free to use this space.
## Feel free to use this space.
Under the assumption (still) that r > 0, answer parts (c) and (d). (I don’t want to see information about anything
having to do with negative r values!)
(c) For what values/interval (if any) of r is eq[1] stable or unstable? Feel free to use paper/pencil/Maple to answer
this.
## Feel free to use (or delete) this space.
(d) For what values/interval (if any) of r is eq[2] stable or unstable? Feel free to use paper/pencil/Maple to answer
this.
## Feel free to use (or delete) this space.
(5) What’s your favorite song?
## Tell me.
(6)(a) Create a function g1(x) that evaluates g(x) for r = 0.75.
## Feel free to use this space for g2(x).
(b) Create a function g2(x) that evaluates g(x) for r = 1.75.
## Feel free to use this space for g2(x).
(c) Create a function g3(x) that evaluates g(x) for r = 2.75.
## Feel free to use this space for g3(x).
(7) Plot g1, g2, g3, and the diagonal, on the same set of axes for x between 0 and 200.
Required:
[1] Specify a different line style for the 4 functions.
[2] Include a legend to distinguish them (by r value or diagonal).
[3] Label your axes appropriately.
## Feel free to use this space for your plot.
(8) Use the cweb( ) function from class to create 3 cobwebs, corresponding to g1(x), g2(x) and g3(x). You should
have 3 separate graphs.
Note: You DO NOT need to use plots[display]. Just use cweb( ) followed by a semicolon.
(a) Create a cobweb for g1, for t=0 to t=15 and with x[0]=50.
## cobweb 1
(b) Create a cobweb for g2, for t=0 to t=30 and with x[0]=50.
## cobweb 2
(c) Create a cobweb for g3, for t=0 to t=50 and with x[0]=50.
## cobeweb 3
(9)(a) Describe the behavior of the solutions within each of your cobweb diagrams. Indicate which diagrams exhibit
oscillations, chaos, stability and/or instability. (One diagram can have several descriptions.)
(b) How does the stability you noted in the previous problem compare with the analysis you performed in exercise
(4)? More specifically, explain why the equilibria are stable or unstable in each cobweb diagram using the previous
analytical results.
(10)(a) Describe the difference between eval( ) and evalf( ).
(b) List the other two new commands (besides evalf) we used today. Describe what they do.
Download