Created
June 6, 2018 19:30
-
-
Save dominem/877a92fbef58618b06fe6cb343f32fd5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Author
dominem
commented
Jun 6, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment