Skip to content

Instantly share code, notes, and snippets.

@kimitoboku
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimitoboku/d290b198390bbe5c69f9 to your computer and use it in GitHub Desktop.
Save kimitoboku/d290b198390bbe5c69f9 to your computer and use it in GitHub Desktop.
import scipy.integrate
import numpy as np
import matplotlib.pyplot as plt
def allee(x,t,r,a,k):
return r*x*(x-a)*(1.0 - x/k)
x0 = 18
r = 0.03
a = 20.0
k = 100.0
time = np.linspace(0,50,10000)
traject = scipy.integrate.odeint(allee, x0 ,time, args=(r,a,k,))
x0 = 22
time2 = np.linspace(0,50,10000)
traject2 = scipy.integrate.odeint(allee, x0 ,time2, args=(r,a,k,))
x0 = 120
time3 = np.linspace(0,50,10000)
traject3 = scipy.integrate.odeint(allee, x0 ,time3, args=(r,a,k,))
plt.plot(time, traject, '-r')
plt.plot(time2, traject2, '-b')
plt.plot(time3, traject3, '-y')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment