# Discretize Poisson equation with derivative of delta function as source

Consider the PDE $$\frac{d^2}{dx^2} g(x) = \frac{d}{dx} \delta(x-x_0),$$ 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?

• 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. – Bill Barth Apr 19 '16 at 17:05
• You should write into your question your PDE with the delta function appearing wherever it does. Someone might have a suggestion for you then. – Bill Barth Apr 19 '16 at 21:54
• Indeed. More details in the question = more better! – Wolfgang Bangerth Apr 19 '16 at 23:02
• 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). – Christian Clason Apr 20 '16 at 11:07
• 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. – Bill Barth Apr 20 '16 at 13:06

$$\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.
• 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). – Chris Rackauckas Apr 21 '16 at 15:35