flowchart LR
S((source)) -->|growth = rP| P[Population P]flowchart LR
S((source)) -->|growth = rP| P[Population P]
Module 2.2 · Student follow-along
If a population grows at a rate proportional to its current size, how can we turn that idea into a simulation?
By the end of class, you should be able to:
A population begins with 100 individuals and grows continuously at a rate of 10% per hour.
Without calculating, predict the population after 8 hours:
Then sketch the graph you expect. Will the population gain the same number of individuals every hour?
Let \(P(t)\) be the population at time \(t\).
| Symbol | Meaning | Units |
|---|---|---|
| \(P\) | current population | individuals |
| \(P_0\) | initial population | individuals |
| \(r\) | per-capita growth rate | per hour |
| \(t\) | time | hours |
What must be true for the population to keep growing this way? Think about resources, births and deaths, movement, and whether every individual is alike.
The population’s rate of change is proportional to the current population.
On the board, translate that sentence into an equation:
\[ \frac{dP}{dt} = \boxed{\phantom{rP}} \]
For a short time step \(\Delta t\), we approximate the change with
\[ \Delta P \approx \text{rate of change} \times \text{time step}. \]
Complete the update rule:
\[ P_{\text{new}} = P_{\text{old}} + \boxed{\phantom{rP_{\text{old}}\Delta t}} \]
If \(r\) has units of 1/hour, \(P\) has units of individuals, and \(\Delta t\) has units of hours, what units does \(rP\Delta t\) have?
Use \(P_0 = 100\), \(r = 0.10\) per hour, and \(\Delta t = 1\) hour.
\[ P_1 = \underline{\hspace{7em}} \]
Before doing a second step, answer this: should the next increase be the same size, larger, or smaller?
The population is a stock: an amount that accumulates. Growth is a flow: a rate that changes the stock.
flowchart LR
S((source)) -->|growth = rP| P[Population P]
The feedback loop matters:
\[ \text{larger population} \longrightarrow \text{more growth} \longrightarrow \text{larger population}. \]
Which of these is the initial condition? Which is the model parameter?
How many values should time contain? Make a prediction before running it.
Why does the initial population belong in position 1 even though time begins at 0?
Read the loop aloud in plain English. What does one trip through the loop represent?
Check the first two rows against the step you calculated by hand.
The differential equation also has an exact solution:
\[ P(t) = P_0 e^{rt}. \]
Add the exact solution to the results:
Then add it to the graph:
Do the two curves agree exactly? What part of our simulation introduced the difference?
Change time_step from 1 to 0.25 and run the model again.
What single change would turn growth into decay?
Before running the code, predict the graph’s shape. Does the model ever produce a negative population?
In one or two sentences, explain the update rule
\[ P_{\text{new}} = P_{\text{old}} + rP_{\text{old}}\Delta t \]
without using mathematical symbols.
A simulation repeatedly applies a small update. The update comes from the model—not from R. R simply helps us repeat it, store the history, and see the consequences.