MATH 1180: Calculus for Biologists II (Spring 2011)

advertisement
MATH 1180: Calculus for Biologists II (Spring 2011)
Lab Meets: January 26, 2011
Report due date: February 2, 2011
Section 002: Wednesday 9:40−10:30am
Section 003: Wednesday 10:45−11:35am
Lab location − LCB 115
Lab instructor − Erica Graham, graham@math.utah.edu
Lab webpage − www.math.utah.edu/~graham/Math1180.html
Lab office hours − Monday, 9:00 − 10:30 a.m., LCB 115
Lab 03
General Lab Instructions
In−class Exploration
Review: Last time, we compared Euler’s Method for solving autonomous differential equations to the
default method used by Maple. We also saw an example of how we can use various mathematical
techniques to determine the information given within the solution of a differential equation.
Background: This week, we will use Maple to find the equilibrium points of a differential equation and to
identify their stability properties. Here, we’ll explore a variant of the basic disease model, by studying the
behavior of the fraction of infected individuals in a population.
restart;
with(DEtools): ## useful tool for differential equations
Suppose the change in the fraction of infected people is given by the differential equation dE/dt = g(E),
where g(E) = b*E^2*(1−E)−E.
g:=E−>b*E^2*(1−E)−E;
g := E b E2 1 E
E
(2.1)
Let’s plot dE/dt for b=5 from E=0 to 1.
plot(eval(g(E),b=5),E=0..1,labels=["E","dE/dt"]);
0
0.2
0.2
0.4
0.6
0.8
1
E
0.4
dE/dt
0.6
0.8
1
Whenever we analyze a differential equation, the first thing we want to do is determine the equilibria.
Recall that the equilibrium points exist whenever dE/dt = 0. When b=5, there are 3 equilibria. Let’s tell
Maple to solve for them.
Estar5:=fsolve(eval(g(E),b=5)=0,E);
Estar5 := 0., 0.2763932023, 0.7236067977
(2.2)
Now, we can analyze the stability of the equilibria. The graph can give us an idea of what the stability
behavior might be.
(1) Between 0 and the 2nd point, the fraction of infected people decreases toward 0, since dE/dt < 0.
(2) Between the 2nd and 3rd points, this fraction increases toward ~0.7, since dE/dt > 0.
(3) Between the 3rd point and 1, the fraction now decreases toward ~0.7.
Notice that E always seems to move away from ~0.28. This suggests that the 2nd point is unstable.
Further, E=0 appears to be stable, based on observation (1). Lastly, (2) and (3) suggest that the 3rd point is
also stable.
Let’s verify our observations mathematically. To begin, we need to differentiate g(E) when b=5 with
respect to E, which we’ll save to the function gprime(E).
gprime:=unapply(diff(eval(g(E),b=5),E),E);
gprime := E 10 E 1 E
5 E2 1
(2.3)
Now, we can substitute each of the 3 points we saved in ’eq’ into ’gprime(E)’. If the result is greater than
zero, the corresponding equilibrium is unstable. If the result is negative, the corresponding equilibrium is
stable.
Recap:
unstable when g’(E*) > 0 and stable when g’(E*) < 0.
gprime(Estar5[1]);
gprime(Estar5[2]);
gprime(Estar5[3]);
1.
0.618033989
1.618033988
(2.4)
This confirms what we inferred from the graph. Of course, this analysis is only valid for the particlular case
when b=5.
How does b change the number and stability of equilibrium points? To examine this question, we will
graph the actual equilibrium values as functions of b. First, we’ll need to solve g(E)=0 for all b values.
Estar:=solve(g(E)=0,E);
1 b
b2 4 b
1 b
b2 4 b
,
(2.5)
2
b
2
b
Now we will plot each E* versus the parameter b. The dotted line (linestyle 2) indicates unstable points,
while the solid lines denote stable equilibria.
plot([Estar[1],Estar[2],Estar[3]],b=0..5,color="red",linestyle=[1,
1,2],thickness=4,
labels=["b","E*"]);
Estar := 0,
0.7
E* 0.4
0.2
0
0
1
2
3
4
5
b
Notice that when b=5, the solid lines are located at E* = 0 and E* ~ 0.7. This graph summarizes our
analytical findings above, and is called a bifurcation diagram. If we were to complete the same analysis
for different values of b, we would find that any E* values between ~0.25 and ~0.5 would always be
unstable, while those between ~0.5 and ~0.7 would always be stable. In addition, E*=0 is always a stable
point too. The graph also indicates how many equilibrium points there are for a particular value of b, which
you will explore in the homework.
Finally, we can use the new DEplot( ) command (from the DEtools package we imported at the beginning)
with b=5 to get an idea of how different solutions look based on where the initial fraction of infected
individuals is. DEplot( ) numerically solves a differential equation and then plots the solution. We will
save a bunch of DEplots using different initial conditions for E, which we will plot along with the equilibria
corresponding to when b=5. Below, ’Eplot’ will be assigned to all of the plot commands for our differential
equation, and ’Estar5plot’ will plot the 3 lines we found above in Estar5 (E*=0, ~0.28 and ~0.7).
b:=5: # parameter value
ode:=diff(E(t),t)=g(E(t)): # the diff. equation we want to solve
ic_vec:=[seq(0.05..1,0.05)]: # various initial fractions we want
to use
ics:=[seq(E(0)=i,i in ic_vec)]; # create init. condition in the
form of E(0)=f for each one
Eplot:=[seq(DEplot([ode],E(t),t=0..10,E=0..1,[j],
linecolor=black,stepsize=0.1,E=0..1,arrows=none,thickness=1),j in
ics)]: ## DEplot
ics := E 0 = 0.05, E 0 = 0.10, E 0 = 0.15, E 0 = 0.20, E 0 = 0.25, E 0 = 0.30, E 0 = 0.35, (2.6)
E 0 = 0.40, E 0 = 0.45, E 0 = 0.50, E 0 = 0.55, E 0 = 0.60, E 0 = 0.65, E 0 = 0.70,
E 0 = 0.75, E 0 = 0.80, E 0 = 0.85, E 0 = 0.90, E 0 = 0.95, E 0 = 1.00
Estar5plot:=plot([Estar5[1],Estar5[2],Estar5[3]],t=0..10,E=0..1,
color="Red",linestyle=[1,2,1],thickness=4): ## horizontal lines of
equilibria
plots[display](Estar5plot,Eplot,labels=["days (t)","infected
fraction E(t)"],labeldirections=["horizontal","vertical"]);
infected fraction E(t)
1
0.8
0.6
0.4
0.2
0
0
2
4
6
8
10
days (t)
Think about how the results in this graph compare with our inferences from the plot of g(t) at the beginning
of the lab.
Please copy the entire section below into a new worksheet, and save it as something you’ll
remember.
Lab 03 Homework Problems
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! I will take a vow of silence if you ask me a question that is clearly stated in a problem.
Useful Tip #2: Don’t be afraid to troubleshoot! Does your answer make sense to you? If not, explore why.
If you’re still unsure, ask me.
Useful Tip #3: When in doubt, restart!
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.)
NOTE: For this assignment, you should re−define/assign any parameters or functions we used in class, as
needed. This will require an understanding of what’s being asked of you.
(0)(a) Read the useful tips. Pay particular attention to #1.
(b) Import the DEtools package for later use.
with(DEtools):
(1)(a) Plot dE/dt = g(E) from class for b = 3.5, 4 and 4.5 on the same set of axes for E=0 to E=1.
Required:
[1] Specify a single color for all three curves.
[2] Specify a different line style for each curve.
[3] Include a descriptive legend to distinguish between your curves.
Note: The above requirements must be included within your plot command.
## feel free to use this space
## feel free to use this space
(b) How many equilibrium points are there for each value of b you used above?
(2)(a) Reproduce the bifurcation diagram from the in−class exploration (start with copy and paste!), with
the following modifications:
[1] Plot from b=3 to b=5.
[2] Include grid lines on your graph. (Search in Help for ’gridlines’ if you don’t remember how these work.)
## feel free to use this space
(b) Given that all possible equilibrium values, denoted E*, are along the y−axis, what does this diagram say
about the number of equilibria for b=3.5, 4 and 4.5? Recall that the red line indicated where the equilibria
are located for each value of b. If there’s only one red line passing through a b value, then there’s only one
equilibrium point.
(c) How do these numbers compare to your answers in problem 1(b)?
(3) Using your graph of g(E) and your modified bifurcation diagram, guess the approximate locations of the
equilibria of the differential equation and their stability for each b value. Do this by filling in the following
table. *Put an X through any unused boxes.
Potentially useful tidbit: An equilibrium point at which the sign of the derivative does not change on
either side is sometimes called ’semi−stable’ and usually has a derivative of zero.
eqm 1
b
value
# of equil.
location
eqm 2
stability
location
eqm 3
stability
location
stability
3.5
4.0
4.5
(4)(a) Choose either b=4 or b=4.5, and verify your table results using Maple.
You will need to:
[1] solve for the equilibria.
[2] compute g’(E).
[3] substitute each unique equilibrium into the derivative.
[4] interpret the results.
## feel free to use this space
## feel free to use this space
## feel free to use this space
(b) What does Maple say about the stability of each equilibrium for the b value you chose?
(c) How do your computational results compare to your guesses regarding stability?
(5)(a) Use DEplot to draw many solutions to dE/dt = g(E) using the same range of initial conditions we
used in class.
Assign b=4, use the same options we used in class, and save your list of plots to something useful.
## feel free to use this space
Save a plot of the equilibrium points for b=4, using the same options we used in class. Then use plots
[display]( ) to put both plots on the same set of axes, plotting the equilibrium points first.
## feel free to use this space
(b) What happens to the population of infected individuals if its initial number is 25% of the total
population?
(c) What happens to the population of infected individuals if its initial number is 75% of the total
population?
(6)(a) What new command (there’s only one) did we use in class today, and what does it do?
(b) List any (at least one) old commands we used today that you may have forgotten about, and describe
what they do. (’plot’ is not allowed!)
Did you remember to save paper?
Download