Euler's method and logistic models

Print the chapter

Every lesson of the chapter, ready for paper. Exercise sets are lettered A, B, C… and answered at the end.

To save a PDF, choose “Save as PDF” in the print dialog.

1. Euler's method

Warm-up

Three quick questions from earlier lessons.

Discover

y′=yy' = y, y(0)=1y(0) = 1. At (0,1)(0, 1) the slope is 1. Follow the tangent line for a step of 0.50.5. Where do you land?

  1. (0.5, 1.5)(0.5,\ 1.5)
  2. (0.5, 2)(0.5,\ 2)

Key idea

Walk along short tangent lines.

Euler's method for y′=f(x,y)y' = f(x, y), y(x0)=y0y(x_0) = y_0, step hh: xn+1=xn+hx_{n+1} = x_n + h, yn+1=yn+h f(xn,yn)y_{n+1} = y_n + h\,f(x_n, y_n). Smaller steps give better estimates.

Worked example

y′=x+yy' = x + y, y(0)=1y(0) = 1, h=0.5h = 0.5. Estimate y(1)y(1).

y1=1+0.5⋅1=1.5y_1 = 1 + 0.5 \cdot 1 = 1.5
Slope at (0, 1) is 1.
y2=1.5+0.5⋅2=2.5y_2 = 1.5 + 0.5 \cdot 2 = 2.5
Slope at (0.5, 1.5) is 2.
y(1)≈2.5y(1) \approx 2.5
Two steps reach x = 1.

Your turn, guided

Your turn: y′=2yy' = 2y, y(0)=3y(0) = 3, one step with h=0.1h = 0.1.

y(0.1)≈3.6y(0.1) \approx 3.6
3 + 0.1 × 6.

Practice ★

  1. dydx=1x+y\dfrac{dy}{dx} = 1x + y and y(1)=3y(1) = 3. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).
  2. dydx=4x+y\dfrac{dy}{dx} = 4x + y and y(1)=8y(1) = 8. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).
  3. dydx=9x+y\dfrac{dy}{dx} = 9x + y and y(1)=4y(1) = 4. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).

Watch out!

Practice ★★

  1. dydx=y\dfrac{dy}{dx} = y and y(0)=8y(0) = 8. Use Euler's method with two steps of size h=12h = \tfrac{1}{2} to estimate y(1)y(1).
  2. dydx=y\dfrac{dy}{dx} = y and y(0)=4y(0) = 4. Use Euler's method with two steps of size h=12h = \tfrac{1}{2} to estimate y(1)y(1).
  1. The solution of dydx=y\dfrac{dy}{dx} = y, y(0)=1y(0) = 1, is concave up. Does Euler's method with h>0h > 0 over- or underestimate y(1)y(1)?
    1. Underestimate: each step follows a tangent line, which lies below a concave-up curve
    2. Overestimate
    3. It is exact

Exit ticket

Three questions to check you have got it.

  1. dydx=1x+y\dfrac{dy}{dx} = 1x + y and y(1)=3y(1) = 3. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).
  2. dydx=4x+y\dfrac{dy}{dx} = 4x + y and y(1)=8y(1) = 8. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).
  3. dydx=9x+y\dfrac{dy}{dx} = 9x + y and y(1)=4y(1) = 4. Use one step of Euler's method with h=0.1h = 0.1 to estimate y(1.1)y(1.1).

Summary card

Euler's method

yn+1=yn+h f(xn,yn)y_{n+1} = y_n + h\,f(x_n, y_n): slope at the current point × step.

Watch out: update the slope at each new point.

2. Logistic growth: carrying capacity and fastest growth

Warm-up

Three quick questions from earlier lessons.

Discover

A population starts at 10 and follows a logistic model with carrying capacity kk. Move kk.

Logistic curves starting at 10 with carrying capacity k: slow growth, then fast growth in the middle, then levelling off at k.

Where on the curve is the population growing fastest?

  1. Halfway to kk
  2. Just before it reaches kk

Key idea

Growth slows as resources run out.

Logistic model: dPdt=rP(1−PK)\dfrac{dP}{dt} = rP\left(1 - \dfrac{P}{K}\right). Equilibria P=0P = 0 and P=KP = K (the carrying capacity). For 0<P00 < P_0, P(t)→KP(t) \to K. Growth is fastest at P=K2P = \tfrac{K}{2}.

Worked example

dPdt=0.4P(1−P500)\dfrac{dP}{dt} = 0.4P\left(1 - \dfrac{P}{500}\right).

Carrying capacity K=500K = 500
Set the rate to 0.
Fastest growth at P=250P = 250
Half of K.
Maximum rate 5050 per unit time
0.4 × 250 × ½.

Your turn, guided

Your turn: dPdt=0.2P(1−P800)\dfrac{dP}{dt} = 0.2P\left(1 - \dfrac{P}{800}\right). Fastest growth at…

P=400P = 400
K/2.

Practice ★

  1. A population follows dPdt=710P(1−P558)\dfrac{dP}{dt} = \dfrac{ 7 }{10}P\left(1 - \dfrac{P}{ 558 }\right). What is its carrying capacity?
  2. A population follows dPdt=910P(1−P428)\dfrac{dP}{dt} = \dfrac{ 9 }{10}P\left(1 - \dfrac{P}{ 428 }\right). What is its carrying capacity?
  1. dPdt=310P(1−P280)\dfrac{dP}{dt} = \dfrac{ 3 }{10}P\left(1 - \dfrac{P}{ 280 }\right). For which population PP is it growing fastest?
  2. dPdt=910P(1−P590)\dfrac{dP}{dt} = \dfrac{ 9 }{10}P\left(1 - \dfrac{P}{ 590 }\right). For which population PP is it growing fastest?

Watch out!

Practice ★★

  1. dPdt=0.2P(1−P750)\dfrac{dP}{dt} = 0.2P\left(1 - \dfrac{P}{ 750 }\right) with P(0)>0P(0) > 0. Tick all the true statements.
    1. P=0P = 0 and P=750P = 750 are equilibrium solutions
    2. If P(0)>750P(0) > 750, then PP decreases towards 750
    3. lim⁡t→∞P(t)=750\displaystyle\lim_{t \to \infty} P(t) = 750
    4. Starting below 750, PP eventually exceeds 750
    5. lim⁡t→∞P(t)=0.2\displaystyle\lim_{t \to \infty} P(t) = 0.2
  1. Boss problem. dPdt=210P(1−P388)\dfrac{dP}{dt} = \dfrac{ 2 }{10}P\left(1 - \dfrac{P}{ 388 }\right).

Exit ticket

Three questions to check you have got it.

  1. dPdt=310P(1−P280)\dfrac{dP}{dt} = \dfrac{ 3 }{10}P\left(1 - \dfrac{P}{ 280 }\right). For which population PP is it growing fastest?
  2. dPdt=910P(1−P590)\dfrac{dP}{dt} = \dfrac{ 9 }{10}P\left(1 - \dfrac{P}{ 590 }\right). For which population PP is it growing fastest?
  3. dPdt=110P(1−P342)\dfrac{dP}{dt} = \dfrac{ 1 }{10}P\left(1 - \dfrac{P}{ 342 }\right). For which population PP is it growing fastest?

Summary card

Logistic growth

  • P′=rP(1−P/K)P' = rP(1 - P/K); equilibria 00 and KK.
  • P→KP \to K; fastest growth at K/2K/2.

Watch out: rr is a rate, KK is a population.

3. The logistic solution

Warm-up

Three quick questions from earlier lessons.

Discover

The logistic solution is P(t)=K1+Ae−rtP(t) = \dfrac{K}{1 + Ae^{-rt}}. What does P(t)P(t) approach as t→∞t \to \infty?

  1. KK
  2. 00

Key idea

The explicit solution, fitted to the start.

dPdt=rP(1−PK)\dfrac{dP}{dt} = rP\left(1 - \dfrac{P}{K}\right), P(0)=P0P(0) = P_0 has the solution P(t)=K1+Ae−rtP(t) = \dfrac{K}{1 + Ae^{-rt}} with A=K−P0P0A = \dfrac{K - P_0}{P_0}.

Worked example

K=1000K = 1000, P0=200P_0 = 200, r=0.5r = 0.5.

A=4A = 4
(1000 − 200)/200.
P(t)=10001+4e−0.5tP(t) = \dfrac{1000}{1 + 4e^{-0.5t}}
Substitute.
P(0)=200P(0) = 200
Check t = 0: 1000/5.

Your turn, guided

Your turn: K=600K = 600, P0=100P_0 = 100. Find AA.

A=5A = 5
(600 − 100)/100.

Practice ★

  1. The logistic solution P(t)=2031+Ae−rtP(t) = \dfrac{ 203 }{1 + Ae^{-rt} } has P(0)=58P(0) = 58. Find AA.
  2. The logistic solution P(t)=7551+Ae−rtP(t) = \dfrac{ 755 }{1 + Ae^{-rt} } has P(0)=48P(0) = 48. Find AA.
  1. P(t)=2771+5e−0.3tP(t) = \dfrac{ 277 }{1 + 5e^{-0.3t} }. Find the initial population P(0)P(0).
  2. P(t)=7421+4e−0.3tP(t) = \dfrac{ 742 }{1 + 4e^{-0.3t} }. Find the initial population P(0)P(0).

Watch out!

Practice ★★

  1. dPdt=210P(1−P253)\dfrac{dP}{dt} = \dfrac{ 2 }{10}P\left(1 - \dfrac{P}{ 253 }\right). How fast is the population growing when P=2532P = \dfrac{ 253 }{2}?
  2. dPdt=710P(1−P556)\dfrac{dP}{dt} = \dfrac{ 7 }{10}P\left(1 - \dfrac{P}{ 556 }\right). How fast is the population growing when P=5562P = \dfrac{ 556 }{2}?

Exit ticket

Three questions to check you have got it.

  1. The logistic solution P(t)=2031+Ae−rtP(t) = \dfrac{ 203 }{1 + Ae^{-rt} } has P(0)=58P(0) = 58. Find AA.
  2. The logistic solution P(t)=7551+Ae−rtP(t) = \dfrac{ 755 }{1 + Ae^{-rt} } has P(0)=48P(0) = 48. Find AA.
  3. The logistic solution P(t)=7701+Ae−rtP(t) = \dfrac{ 770 }{1 + Ae^{-rt} } has P(0)=24P(0) = 24. Find AA.

Summary card

The logistic solution

P(t)=K1+Ae−rtP(t) = \dfrac{K}{1 + Ae^{-rt}}, A=K−P0P0A = \dfrac{K - P_0}{P_0}, P→KP \to K.

Watch out: check AA by computing P(0)P(0).