Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Duckweed spreads over a village pond. Nisha counts the fronds every days:
| Day | Fronds |
|---|---|
| 0 | 40 |
| 3 | 95 |
| 6 | 210 |
| 9 | 400 |
| 12 | 610 |
| 15 | 760 |
| 18 | 830 |
| 21 | 865 |
Fit a logistic curve with fronds fixed, using curve_fit. What are and ? On which day does the duckweed reach half of ?
For exponential counts, : np.polyfit(t, np.log(N), 1) returns the slope and the intercept . Doubling time . curve_fit(model, t, N, p0=guess) returns the parameters after t, in order, that make the sum of squared misses smallest.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Step 1. The model. logistic(t, r, K) returns .
Step 2. The fit. curve_fit(logistic, days, fronds, p0=[0.2, 900]) gives per day and fronds.
Step 3. Half of K. days.
Answer: per day, fronds, and half of on about day .
Log in to join the discussion.
Loading…