Docsity

Analyzing Single Species Population Models - Lecture Notes | MATH 410, Study notes of Algebra

Toggle sidebar
bg1
Math 410(510) Notes (2)
Analyzing Single Species Population Models
Ordinary Differential Equations
Junping Shi
Since we learn the word equation, we always want to solve an equation, which means to find the
solution(s) of the equation. For example
(1) x2−3x+ 2 = 0.Solve: x1= 2, x2= 1.
Once an equation is solved, that is the end of the story: we find all and only solutions to the equation.
But this is not always the case. Another example:
(2) x7−5x+ 2 = 0.
There is no good way to solve the equation. But still we can have ways to get the information of the solutions
to the equation. A) By using computer or calculator, we can graph the function f(x) = x7−5x+ 2, and
on the graph we can “see” and roughly locate the roots; B) we can use the Newton’s method or other
numerical method to find highly accurate approximate solutions. So for the algebraic equation like (2),
first we try to solve it, that is called analytic method; if that wouldn’t work, we can analyze its graph, that
is called qualitative method or geometric method; finally we can use numerical method to find approximate
solution.
For differential equation, all three methods are still useful but techniques are quite different. In this
notes, we describe all three methods for equation:
(3) dP
dt =f(P).
Equation (3) is called a first order autonomous ordinary differential equation. First there are two kinds
of differential equations: ordinary differential equation (ODE) and partial differential equation (PDE).
A solution of an ODE is a function P(t), which depends on only one variable; a solution of a PDE is a
function like P(t, x, y), which depends on more than one variables. (3) is called first order since there is
only the first order derivative dP/dt in the equation. Here are some higher order equations:
(4) P00 + 3P0−200P= 2; (2nd order) d3P
dt3= sin t. (3rd order)
Finally it is called autonomous since the right hand side of the equation only depends on Pbut not t. A
non-autonomous equation is like: dP /dt =P2+t, or more general
(5) dP
dt =f(t, P ).
1. Analytic method: how to solve the equation?
This is how it basically goes:
dP
dt =f(P)⇒dP
f(P)=dt ⇒ZdP
f(P)=Zdt ⇒ZdP
f(P)=t+C,
where Cis a constant, and you should solve the integral, then solve Pin term of t. We show that we can
do this for the exponential model and logistic model.
pf3
pf4

Partial preview of the text

Download Analyzing Single Species Population Models - Lecture Notes | MATH 410 and more Study notes Algebra in PDF only on Docsity!

Math 410(510) Notes (2)

Analyzing Single Species Population Models

Ordinary Differential Equations

Junping Shi

Since we learn the word equation, we always want to solve an equation, which means to find the solution(s) of the equation. For example

(1) x^2 − 3 x + 2 = 0. Solve: x 1 = 2, x 2 = 1.

Once an equation is solved, that is the end of the story: we find all and only solutions to the equation. But this is not always the case. Another example:

(2) x^7 − 5 x + 2 = 0.

There is no good way to solve the equation. But still we can have ways to get the information of the solutions to the equation. A) By using computer or calculator, we can graph the function f (x) = x^7 − 5 x + 2, and on the graph we can “see” and roughly locate the roots; B) we can use the Newton’s method or other numerical method to find highly accurate approximate solutions. So for the algebraic equation like (2), first we try to solve it, that is called analytic method ; if that wouldn’t work, we can analyze its graph, that is called qualitative method or geometric method ; finally we can use numerical method to find approximate solution.

For differential equation, all three methods are still useful but techniques are quite different. In this notes, we describe all three methods for equation:

(3) dP dt

= f (P ).

Equation (3) is called a first order autonomous ordinary differential equation. First there are two kinds of differential equations: ordinary differential equation (ODE) and partial differential equation (PDE). A solution of an ODE is a function P (t), which depends on only one variable; a solution of a PDE is a function like P (t, x, y), which depends on more than one variables. (3) is called first order since there is only the first order derivative dP/dt in the equation. Here are some higher order equations:

(4) P ′′^ + 3P ′^ − 200 P = 2; (2nd order)

d^3 P dt^3 = sin t. (3rd order)

Finally it is called autonomous since the right hand side of the equation only depends on P but not t. A non-autonomous equation is like: dP/dt = P 2 + t, or more general

dP dt

= f (t, P ).

  1. Analytic method: how to solve the equation?

This is how it basically goes: dP dt

= f (P ) ⇒ dP f (P )

= dt ⇒

dP f (P )

dt ⇒

dP f (P )

= t + C,

where C is a constant, and you should solve the integral, then solve P in term of t. We show that we can do this for the exponential model and logistic model.

Exponential Model:

dP dt = kP,

dP P = kdt,

dP P

kdt, ln |P | = kt + C, |P | = ekt+C^ = Cekt, so we

obtain P (t) = Cekt, where C is a constant. Note that C here can be any constant, and it changes in ekt+C to Cekt. Indeed by the property of exponential function we have ekt+C^ = ekteC^ , so our new constant C is eC^ in the previous expression. But eC^ is still a constant, we don’t need to keep track how the constant changes here, so we just still call it C. Als o we can drop the absolute value | · | on P if we allow C to be negative, since |P | = ±P.

Initial Value Problem: Since C can be any number in the above expression, then the differential equation P ′^ = kP has infinite many solutions. Which one is useful for us? Usually in applications, we know the initial population, i.e. P (0), or just population at any given time. Then we can actually solve the constant C by using this information. For example, consider

dP dt

= 3P, P (0) = 100.

From above, we first get P (t) = Ce^3 t, this is called the general solution of the equation P ′^ = 3P. Now we substitute P (0) = 100 into the general solution: 100 = P (0) = Ce^0 = C, so C = 100 and the unique solution to the initial value problem is P (t) = 100e^3 t.

In general, the solution of

dP dt = kP, P (0) = P 0

is P (t) = P 0 ekt. When k > 0, this population has an exponential growth; when k < 0, the population has an exponential decay.

Logistic Equation:

Consider

(8)

dP dt

= 2P (1 − P ), P (0) = 0. 6.

dP P (1 − P )

= 2dt,

P

1 − P

dP = 2dt, ln |P | − ln | 1 − P | = t + C, ln

∣∣^ P

1 − P

∣∣ = t + C, P 1 − P

= Cet.

Since P (0) = 0.6, then

= Ce^0 , so C = 3/2.

P

1 − P

et, P =

(1 − P )et, P =

et^ −

etP , so

P (t) = (3/2)et 1 + (3/2)et^

3 et 2 + 3et^

Why dP P (1 − P )

can be broken into

P

1 − P

dP? This is because dP P (1 − P )

P

1 − P

by

the partial fraction technique, which you should learn in Calculus II (Math 112) course. In general, the solution of

(9)

dP dt = kP

P

N

, P (0) = P 0 ,

is P (t) =

N P 0

P 0 + (N − P 0 )e−kt^

. (see Polking’s textbook Chapter 3, page 129-130.)

  1. Geometric method: how to see the equation?

As you may expect, we cannot solve all the differential equations. In the computer age, we can easily draw various kinds of “graphs”of the differential equations. Here we consider an equation dP/dt = f (t, P ). If the function P (t) is a solution of the equation and if its graph passes through the point (t 0 , P 0 ) where

flow for a short time ∆t, we will have moved a distance f (t 0 , P 0 )∆t because distance = rate × time. Of course, that’s not quite right, because our velocity was changing a little bit throughout the step. But over a sufficient small step, the velocity will be nearly constant and our approximation should be reasonably good. Hence our new position P (t 0 + ∆t) is approximately P 0 + f (t 0 , P 0 )∆t. Let’s call this approximation P 1. Thus

(10) P (t 0 + ∆t) ≈ P 1 = P 0 + f (t 0 , P 0 )∆t.

Now we repeat this procedure (we call it iterations in mathematics.) We step forward from P 1 = P 0 + f (t 0 , P 0 )∆t, to P 2 = P 1 + f (t 1 , P 1 )∆t where t 1 = t 0 + ∆t. In general the update rule is

(11) tn = tn− 1 + ∆t, Pn = Pn− 1 + f (tn− 1 , Pn− 1 )∆t.

This is the simplest possible numerical scheme of finding approximate solution of differential equation, which we call Euler’s method. Some examples can be found at

http://www.sosmath.com/diffeq/first/numerical/numerical.html. The approximate solution is not a real solution, but it gives a set of data:

(t 0 , P 0 ), (t 1 , P 1 ), (t 2 , P 2 ), · · · , (tn, Pn), · · ·

which is close to the values of a real solution at ti. The error of the approximate solution and real solution can be measured by E = |P (tn) − Pn| for a given stepsize ∆. Note that although we may not know the value of P (tn), but usually we can have an estimate of E. Of course, E → 0 as ∆t → 0, but in some methods, E → 0 faster than others. For Euler’s method, the error is proportional to ∆t, so we call it first order method. Next we introduce without explanation two better numerical algorithms. First one is the improved Euler method :

(12) tn = tn− 1 + ∆t, P˜n = Pn− 1 + f (tn− 1 , Pn− 1 )∆t, Pn = Pn− 1 +

[f (tn− 1 , Pn− 1 ) + f (tn, P˜n)]∆t,

for which the error is proportional to (∆t)^2 ., so it is a second order method. In practice, the following fourth-order Runge-Kutta method is widely used by scientists:

˜t = tn− 1 +^1 2

∆t,

k 1 = f (tn− 1 , Pn− 1 )∆t, k 2 = f (˜t, Pn− 1 +

k 1 )∆t,

k 3 = f (˜t, Pn− 1 +

k 2 )∆t, k 4 = f (tn, Pn− 1 + k 3 )∆t,

Pn = Pn− 1 +

(k 1 + 2k 2 + 2k 3 + k 4 ).

This method generally gives accurate results without requiring an excessively small stepsize ∆.

All these methods are easy to write program (for example, C, C++, Pascal, Visual Basic and probably best today: Java) on a computer. And even better, you can do it real time online without knowing any of these programming languages. Here is a link for Euler’s method,

http://mss.math.vanderbilt.edu/~pscrooke/MSS/euler.html. I couldn’t find a link for the other two methods. But John Polking also write a few routines of Matlab programs for Euler method, 2nd order Runge-Kutta and 4th order Runge-Kutta methods. Details will be given in another handout.