Numerical way to deal with Dirac delta. I have been wondering about this:
I have a differential equation $y'(t) = y(t) + n \delta(t) y(t)$ with $y(-1) :=y_0$
Thus I want to apply a short delta pulse at some particular point $0$ to my system with a strength controlled by some sort of coefficient $n$. My question is: How do I simulate this numerically?- If I want to apply some canonical numerical ODE solver to this ODE( is this even possible here?).  
 A: To deal with these type of questions, it is best to treat the delta function as zero everywhere, that is to solve $y'(t) = y(t)$ with $y( - 1) = {y_0}$. But the effect of the delta is that your solution step should break at $t=0$. Actually by integrating the equation on a small domain around $t=0$ you could see that $$y({0^ + }) = y({0^ - }) + ny(0)$$ which is again equivalent to $y'(t) = ny(t)\delta (t)$ (notice that we are examining the dynamic of the equation in very small times around the origin). Now, the solution in this small domain for $\varepsilon  > 0$ is $y(t) = y( - \varepsilon ){e^{nU(t)}}$, which gives $y({0^ + }) = {e^n}y({0^ - })$.Summarizing, you should solve your main equation until $t=0$, then having these solutions you should solve $$\begin{array}{l}y'(t) = y(t)\\y({0^ + }) = {e^n}y({0^ - })\end{array}$$ for $t>0$.
A: A dirac delta functions can be modelled numerically using a box-car function with width approaching a small number, and it can also be modelled using a gaussian with half-width approaching a small value. In general, you model a dirac delta in space with box-car and time with gaussian !
