title: Solve ODE in Python with a time-delay
body: <p>Can anybody give me some advice how to solve an ODE in Python that has a time-delay implemented in it? I can't seem to figure out how to do it using scipy.integrate.odeint. What I am looking for should look like:</p>
  
  <pre><code># the constants in the equation
  b = 1/50
  d = 1/75
  a = 0.8
  G = 10 ** (-2)
  tau = 0.5
  u = [b, d, tau, a, G]
  
  # enter initial conditions
  N0 = 0.1
  No0 = 10
  w = [N0, No0]
  
  def logistic(w, t, u):
      N, No = w
      b, d, tau, a, G = u
      dNdt = b * (No(t) - N(t) ) * (N(t) / No(t) ) - d * N(t - tau)
      dNodt = G * (a * No(t) - N(t) ) * (N(t) / No(t) )
      return [dNdt, dNodt]
  
  # create timescale
  # create timescale
  stoptime = 1000.0
  numpoints = 10000
  t = np.linspace(0, stoptime, numpoints)
  
  # in my previous code I would use scipy.integrate.odeint here to integrate my 
  # equations, but with a time-delay that doesn't work (I think)
  soln = ...
  </code></pre>
  
  <p>Where the N(t), N(t - tau) etc. indicate the time arguments of the functions. Does a good library exist to solve these types of equations? Many thanks in advance!</p>