All problems
Logistic Derivative at Point
Problem
The logistic solution is y(t) = k / (1 + ((k - y0) / y0) * e^(-r*t)). Its rate of change is y'(t) = r * y(t) * (1 - y(t) / k).
Given t, the initial population y0 > 0, the rate r, and the carrying capacity k, compute y(t) and return the derivative at that time.
Hint
First evaluate the closed-form population, then plug it into the logistic rate law.
Test cases
case 1
in: [0,10,1,100]
expected: 9
case 2
in: [10,10,1,100]
expected: 0.04082656655153957
case 3
in: [1,50,1,100]
expected: 19.66119332414819
case 4
in: [0,4,0.5,8]
expected: 1
Starter codePython
def logistic_derivative(t, y0, r, k):
# Your code here
pass4 test cases · run your code against them in the editor