Consider the PDE \begin{equation} \frac{d^2}{dx^2} g(x) = \frac{d}{dx} \delta(x-x_0), \end{equation} with $x, x_0 \in [0,1]$ and $g(0)=g(1)=0$. What is the best method to discretise the derivative of the delta function using finite differences?

  • 6
    $\begingroup$ In what context? If you plan to use this as part of a RHS in a weak formulation of a problem, it might be best to integrate it by parts and apply the definition of the delta function to the resulting integrals directly to generate RHS terms. If this is in the discretization of a PDE in its strong form, then you may have to try other approaches. $\endgroup$
    – Bill Barth
    Apr 19 '16 at 17:05
  • 2
    $\begingroup$ You should write into your question your PDE with the delta function appearing wherever it does. Someone might have a suggestion for you then. $\endgroup$
    – Bill Barth
    Apr 19 '16 at 21:54
  • $\begingroup$ Indeed. More details in the question = more better! $\endgroup$ Apr 19 '16 at 23:02
  • 1
    $\begingroup$ This PDE isn't well-posed in the strong form, so you cannot use finite differences (or really, any method) to discretize it. Bill's suggestion is correct: you need to look at the weak form (and even that might not be useful, depending on the boundary conditions) or, even better, a boundary integral formulation. Alternatively, you could use a mollified delta distribution to approximate the equation (if the mollification parameter is small enough, the error should be below the discretization error). $\endgroup$ Apr 20 '16 at 11:07
  • $\begingroup$ As a two-point boundary value problem, you're two boundary conditions short of a well-posed problem at the very least. Given compatible BCs, the distributional solution to this equation should be $H(x-x_0)$, i.e. the Heaviside step function centered at $x_0$, plus some factors due to integration. This might be very hard to impossible to reproduce in a finite-difference method that assumes continuity of the solution throughout the domain, though you might be able to come up with something using a mollification as @ChristianClason points out, or in a finite element or finite volume setting. $\endgroup$
    – Bill Barth
    Apr 20 '16 at 13:06

As noted by others, this PDE is not well-posed in the Strong Form. However, you can take some function which asymtopically approximates the Dirac Delta and use that (where the error in the approximation is below truncation error). For example, you can use

$$ \eta_\epsilon = \epsilon^{-n} \eta(x/\epsilon) $$


$$ \eta(x) = \exp(-1/(1-|x|^2)) \chi_{|x|<1} $$

and $n$ is the dimension.You can easily take the derivative of this and choose a small enough $\epsilon$ such that this is close enough to the Dirac delta.

  • $\begingroup$ I wouldn't expect it to be stable/converge for small $\epsilon$ because in that case it's extremely stiff. Also, these functions (and any function) only converges to the appropriate delta in the weak sense, any function will give you numerical issues if you approximate "close" enough. The way around this is to use an FEM method and approximate the derivative of the delta in the weak sense. But if you really don't want to do that, this is a quick and dirty way to get it done (just make sure $\epsilon$ is big enough). $\endgroup$ Apr 21 '16 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.