title: Python - Using a Kronecker Delta with ODEINT
body: <p>I'm trying to plot the output from an ODE using a Kronecker delta function which should only become 'active' at a specific time = t1.
  This should give a sawtooth like response where the initial value decays down exponentially until t=t1 where it rises again instantly before decaying down once again.
  However, when I plot this it looks like the solver is seeing the Kronecker delta function as zero for all time t. Is there anyway to do this in Python?</p>
  
  <pre><code>from scipy import KroneckerDelta
  import scipy.integrate as sp
  import matplotlib.pyplot as plt
  import numpy as np
  
  def dy_dt(y,t):
  
      dy_dt = 500*KroneckerDelta(t,t1) - 2y
  
  return dy_dt
  
  t1 = 4
  y0 = 500
  t = np.arrange(0,10,0.1)
  
  y = sp.odeint(dy_dt,y0,t)
  
  plt.plot(t,y)
  
  </code></pre>