# The rate of convergence for finite difference methods for Poisson's equation with piecewise constant data

I am solving the following PDE;

$$\nabla^2 u = \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} = \rho,$$

where $\rho(0.5,0.5) = 2$ (zero elsewhere), $0\leq x,y\leq1$ and the boundaries will satisfy the condition $u = 0$.

I am solving by finite differences using both a 5 point second order stencil and a 9 point fourth order stencil. It is my understanding that the solution to this PDE is the zero function and this is what I am using to calculate rates of convergence. I have used various error measures including the average difference, max difference and the value at the point $(0.5,0.5)$.

For each error measure I am getting convergence rates of approximately order 2 for both stencils, is there a reason why the fourth order stencil would not converge with order 4?

• In the absence of nice smoothness properties in the equation, nice convergence properties of a numerical method can fail. For example, the usual error estimate for the trapezoidal rule assumes there are two continuous derivatives; the convergence rate is generally worse if there is only one. – Ian Dec 18 '14 at 23:04
• That said, in this particular case I think there might be an analytic way to see what's going on. Your numerical method is actually an accurate solver for a Poisson problem where the right side is the indicator function of a small square whose side length has order $h$. (You can see this because finite difference methods are more or less finite element methods with piecewise constant basis functions.) I think the convergence rate of the solution to this problem to the solution of the original problem may already be only second order, in which case refining the method can't improve anything. – Ian Dec 18 '14 at 23:06
• Cross-posted to Computational Science – user147263 Dec 19 '14 at 21:24

1. In the absence of nice smoothness properties in the equation, nice convergence properties of a numerical method can fail.

2. Your numerical method is actually an accurate solver for a Poisson problem where the right side is the indicator function of a small square whose side length has order $h$. I think the convergence rate of the solution to this problem to the solution of the original problem may already be only second order, in which case refining the method can't improve anything.

I will elaborate on the second point. The discrete values of $\rho$ you feed into any finite difference method do not represent pointwise values of $\rho$, but rather its averages on scale $h$. So, feeding in $\rho=2$ at $(0.5,0.5)$ (which I assume is one of the grid points) corresponds to prescribing the Laplacian of $2$ on the square with vertices $(0.5\pm h/2, 0.5\pm h/2)$. The analytic solution to the latter problem is of order $h^2$. Indeed, it is given by the integral of Green's function $G$: $$u(x,y) = \int_{0.5-h/2}^{0.5+h/2}\int_{0.5-h/2}^{0.5+h/2} 2G(x,y;x',y')\,dx'\,dy'$$ which, at a point $(x,y)\ne (0.5,0.5)$, is asymptotic to $h^2 G(x,y,0.5,0.5)$.

At $(x,y)=(0.5,0.5)$ the analytic solution is actually slightly larger: $h^2\log(1/h)$, but this is probably not apparent in the numerical results.

• Thank you for the answer, I will need to get my head around greens function to fully understand but will give it a go. Am I right in taking from this that no matter how accurate a stencil I use this particular problem will never converge better than order 2? – Josh Greenhalgh Dec 19 '14 at 14:14
• I agree with your answer, but I want to point something out: "The discrete values of ρ you feed into any finite difference method do not represent pointwise values of ρ, but rather its averages on scale h." This is mostly true (but not exactly) for finite-difference methods because to define an FD approximation one assumes the function is differentiable enough times. But this is completely (rigourously) true for finite volume methods, because such averages is just what they deal with. Another way to arrive at the exact same answer is to just replace the FD method with the equivalent FV method. – Kirill Dec 19 '14 at 19:35
• I expanded my comment into this answer. – Kirill Dec 19 '14 at 21:21
• @Kirill Thanks for expanding the comment. I don't really do numerics, so my answer is somewhat amateurish. – user147263 Dec 19 '14 at 21:26