Skip to content

Instantly share code, notes, and snippets.

@dominem
Created June 6, 2018 19:30
Show Gist options
  • Save dominem/877a92fbef58618b06fe6cb343f32fd5 to your computer and use it in GitHub Desktop.
Save dominem/877a92fbef58618b06fe6cb343f32fd5 to your computer and use it in GitHub Desktop.
from math import e
import numpy as np
import matplotlib.pyplot as plot
a_arr = np.array([1, 1 / 4])
c_arr = np.array([1, 1 / 4])
t_arr = np.linspace(0, 8, 200)
data = np.array([
[1000, 1, 1, 'b.'],
[1000, 1, 1/4, 'r.'],
[1000, 1/4, 1, 'g.'],
[500, 1, 1, 'b--'],
[500, 1, 1/4, 'r--'],
[500, 1/4, 1, 'g--'],
[100, 1, 1, 'b'],
[100, 1, 1/4, 'r'],
[100, 1/4, 1, 'g'],
])
def gompertz(t, n0, a, c):
return n0 * pow(e, -(c * (pow(e, a * t) - 1)))
for row in data:
y_arr = np.array([gompertz(t, float(row[0]), float(row[1]), float(row[2])) for t in t_arr])
plot.plot(t_arr, y_arr, row[3])
plot.axis([0, 8, 0, 1000])
plot.grid()
plot.show()
@dominem
Copy link
Author

dominem commented Jun 6, 2018

gompertz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment