>   

lab3.mws --- Logistic Growth Model

>   

>    restart;
with( plots ):

>   

Lab Overview

This lab introduces and investigates the logistic growth model . The logistic model is a simple modification of the exponential growth model. While the differential equations that define the exponential and logisic models are quite similar, their solutions are noticeably different. These differences make the logistic model more appropriate for many biological applications.

We begin by reviewing the exponential model - using Maple. Then, the logistic model is motivated and formulated. The questions will lead you to some of the important properties of the solution to the logistic equation.

>   

Exponential Growth Model with Maple

We follow the approach used on the handout for exponential growth models.

Model Formulation

Beginning with the ``The Idea'' section, let P(t)  denote the population at time t . Then, for the time interval [t, t+dt]  the change in population is

>    dP := P(t+dt) - P(t);

>   

The exponential growth model assumes the number of births and deaths during [t, t+dt]  are proportional to the current size of the population and the length of the interval:

>    birth := beta*P(t)*dt;
death := delta*P(t)*dt;

The balance law for this situation is

>    q1 := dP = birth-death;

Eqauation (1) from the handout is obtained when we use k = beta-delta  and the equation is divided by dt  :

>    q2 := simplify( eval( q1, beta=k+delta ) );
eq1 := q2/dt;

The differential equation is the limit of this equation as dt approaches 0

>    q3 := limit( eq1, dt=0 );

Note that the left-hand side of this equation stands for the deriviative of P at t. We can convert this to our standard notation as follows:

>    odeE := convert( q3, diff );

>   

Step-by-step derivation of the general solution

This differential equation can be solved by separating variables. Here, equation (2) is obtained by dividing the differential equation by P(t) :

>    eq2 := odeE / P(t);

>   

To reproduce the steps in the solution of this differential equation it is necessary to rewrite P(t) = P. Then, the left-hand side is integrated with respect to P while the right-hand side is integrated with respect to t:

>    q4 := Int( 1/P, P ) = Int( k, t ) + C;

The integrals are evaluated using

>    q5 := value( q4 );

Applying the exponential function to both sides of this equation yields

>    q6 := exp( lhs(q5) ) = exp( rhs(q5) );

Two alternate approaches: the map  and isolate  commands

Note that the above command could also have been written more compactly - but somewhat less clearly - as

>    map( exp, q5 );

This command says to apply the exp  function to both sides of the equation called q5 .

>   

A second alternative would be ask Maple to attempt to isolate P on one side of the equation.

>    isolate( q5, P );

Note that all three approaches yield the exact same result.

Initial conditions and the constant C  

If an initial condition, P(0) = P[0] , is given, this information can be used to find a value for C . In general, exp(C) = P[0]  so that

>    q7 := C = ln( p[0] );

When this information is inserted into the formula for the general solution (and simplified), we find

>    simplify( eval( q6, q7 ) );

>   

The dsolve  command

The steps used to find these solutions are combined into a single, very powerful, Maple command: dsolve . This command is used, in general, to attempt to find solutions to a differential equation. For example, the general solution to the exponential growth model can be found with

>    dsolve( odeE, P(t) );

Note that Maple has written the solution in terms of an indpendent parameter, _C1 . This parameter is related to our constant of integration C   by _C1  = exp(C) .

The dsolve  command can also handle initial conditions. For example,

>    ic := P(0) = p[0];

>    dsolve( { odeE, ic }, P(t) );

This is obviously the same result as we obtained by more explicit steps.

>   

Logistic Growth Model

Description of the Logistic Model

The fundamental difference between the exponential and logistic models can be explained in terms of the per capita growth equation. For the exponential model the per capita growth rate is constant.

>    per_capE := eq2;

However, in reality, the per capita growth rate decreases as the population increases

  Diff(P(t),t)/P = g(P)    where    g(0) = k  and diff(g(P),P)*`<`*0  

This decrease continues until the population reaches its ultimate capacity. That is, assuming the threshold population is P = L ,

  g(L) = 0 .

The simplest continuous function satisfying these conditions is the linear function passing through the points ( 0, k  ) and ( L , 0 ).

Maple code to produce the following plot -- skip unless you are really interested

>    k := 2:
L := 5:
p1 := plot( [ k, k-k/L*P ], P=0..L, tickmarks=[0,0], color=[red,blue], legend=["Exponential","Logistic"] ):
p2 := textplot( [0,k+0.2,"(0,k)"], align={ABOVE} ):
p3 := textplot( [L,0.2,"(L,0)"], align={ABOVE} ):
p4 := textplot( [-0.1,k/2,"g(P)"], align={LEFT} ):
p5 := textplot( [L/2,-0.1,"P"], align={BELOW} ):
#display( [p1,p2,p3,p4,p5], title="Per capita growth rates", scaling=constrained, view=[-0.2..6,-0.2..2.2] );
unassign( 'k', 'L' ):

[Maple Plot]

That is:

>    g := P -> k - k/L * P;

The logistic growth model can be written in per capita form as

>    per_capL := diff(P(t),t)/P(t) = g(P(t));

or as a differential equation in which the (absolute) growth rate is a quadratic function of the current population size

>    odeL := per_capL * P(t);

>   

Solution of the Logistic Model

Step-by-step derivation of the general solution

This differential equation can be solved by separating variables. In this case it is necessary to divide the differential equation by P(t)*(1-P(t)/L)  -- note that it is essential that you write P(t)  if you expect Maple to cancel common factors and to simplify the equation.

>    r1 := simplify( odeL / ( P(t) * (1-P(t)/L) ) );

>   

The left-hand side is integrated with respect to P while the right-hand side is integrated with respect to t.

>    r2 := Int( L/(P*(L-P)), P ) = Int( k, t ) + C;

Unlike the exponential model, we do not yet know how to evaluate the integral on the left-hand side of this equation. But, using Maple, the integrals are found to be

>    r3 := value( r2 );

Applying the exponential function to both sides of this equation yields

>    r4 := exp( lhs(r3) ) = exp( rhs(r3) );

Since the exponential and logarithm functions are inverse functions, the combinations on the left-hand side of the equation should simplify:

>    r5 := simplify( r4 );

With a little more algebra it is possible to solve for P:

>    r6 := isolate( r5, P );

>   

Initial conditions and the constant C  

If an initial condition, P(0) = P[0] , is given, this information can be used to find a value for C .

>    r7 := eval( r6, [P=p[0], t=0] );

>    r8 := isolate( r7, C );

When this information is inserted into the formula for the general solution (and simplified), we find

>    r9 := simplify( eval( r6, r8 ) );

>   

The dsolve  command

The dsolve  command can find the general solutions to the logistic model:

>    s1 := dsolve( odeL, P(t) );

This solution looks somewhat similar to -- but also somewhat different from -- the one found above

>    r9;

The dsolve  command can also handle initial conditions. For example,

>    ic := P(0) = p[0];

>    s2 := dsolve( { odeL, ic }, P(t) );

>    s3 := simplify( s2 );

>   

Analysis of the Solution

While the logistic growth model is not much different from the exponential growth model, the logistic solution is significantly more complicated. It is no longer possible to simply look at the solution and know almost everything about the solution. To begin to understand the solution to the logistic model, define a Maple function that returns the solution for a specific value of k , L , and p[0] :

>    solP := unapply( rhs(r9), (k,L,p[0]) );

For example, the solution to the logistic model with intrinsic growth rate k = 1 , threshold population L = 10 , and initial population p[0] = 3  is

>    solP(1,10,3);

>   

One way to use this solution function is to plot a collection of curves with different initial populations.

>    p0_vals := [0, 50, 100, 150, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1200, 1400];

>    plot( [ seq( solP(0.0005,1000,p0), p0=p0_vals) ], t=0..20000 );

>   

Notice that  solutions with the smaller initial values have one inflection point (where the concavity changes from concave up to concave down).  One interesting property of the logistic growth model is that the time  at which the population passes through this inflection point depends on k , L , and p[0] , but the size  of the population at the inflection point depends only on L . To better undestand this property we need to work with the second derivative of the solution: P''( t ).

Approach # 1: Differentiate the explicit solution

One approach is to differentiate the explicit solution.

>    D2Pa := diff( rhs(r9), t, t );

This involves the application of the quotient rule twice and produces a real mess! The mess does simplify

>    u1 := simplify( D2Pa );

but I do not want to think about setting this equal to 0 and solving for t! We can ask Maple to attempt to factor  the second derivative:

>    u2 := factor( D2Pa );

This is much better. I leave it to you to solve for the times when solutions change concavity, i.e., change concavity. (Once you find the time when the solutions have an inflection point, you should compute the corresponding population size. Does this agree with the result found below using Approach #2?)

>   

>   

>   

>   

>   

>   

>   

>   

Approach # 2: Differentiate the differential equation

Many differential equations cannot be solved explicitly. Even if an explicit solution is not known it is still possible to do a lot of analysis of the solution. For example, critical points in a solution occur whenever the first derivative is zero. In the case of the logistic growth model this means that critical points occur when

>    crit_pt_eq := rhs(odeL) = 0;

The solution(s) to this equation are

>    crit_pt := solve( crit_pt_eq, {P(t)} );

Note that these are the two constant solutions to the logistic growth model. Similarly, inflection points can be found by differentiating the differential equation with respect to t:

>    d1 := diff( odeL, t );

and then using the differential equation to replace all occurrences of diff( P(t), t ) on the right-hand side:

>    d2 := lhs(d1) = eval( rhs(d1), odeL );

>    d3 := simplify( d2 );

The possible inflection points are now found to occur when

>    poss_infl_pt := solve( rhs(d3)=0, {P(t)} );

It is not surprising to see the two constant solutions. The last solution is new - and interesting. (Is this consistent with your findings from Approach #1?)

>   

>   

>   

Lab Questions

1. Consider the logistic growth model with k =0.0005, L =1000, and p[0] =200. Estimate the time at which the population reaches 95% of L .

>   

2. Consider the logistic growth model with k =0.0005 and L =1000. Plot the solutions with initial populations p[0]  = 200, 400, 600, 800, and 1000 on the time interval [0, 20000]. Copy and paste this plot into a Word document.

>   

3. Consider the logistic growth model with L =1000 and p[0] =200. Plot the solutions with k  = 0.0005, 0.001, 0.003, and 0.005 on the time interval [0, 10000]. Copy and paste this plot into a Word document.

>   

4. Consider the logistic growth model with k =0.0005 and p[0] =200. Plot the solutions with L =100, 200, 300, 400, and 500 on the time interval [ 0, 10000 ]. Copy and paste this plot into a Word document.

>   

5. Consider the five curves in Question 4. For each solution, what is the population size when t =10000? Express each answer as the population size and as a percentage of the corresponding value of L .

>   

Essay Question. Find a formula for the time when the solution to the logisitic growth model has an inflection point. Use this formula to explain why solutions with p[0]  > L/2  do not have inflection points.

>   

>