import math
def adoption(t, k, t0):
return 100 / (1 + math.exp(-k * (t - t0)))
def first_year_reaching(target, k, t0):
t = 0
while adoption(t, k, t0) < target:
t += 1
return t
for t in [0, 5, 10, 15, 20]:
print(t, round(adoption(t, 0.6, 10), 1))
print("90% reached in year", first_year_reaching(90, 0.6, 10))
The model from the graph. math.exp(x) computes e to the power x.