1
$\begingroup$

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?

$\endgroup$
  • 2
    $\begingroup$ 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. $\endgroup$ – Ian Dec 18 '14 at 23:04
  • $\begingroup$ 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. $\endgroup$ – Ian Dec 18 '14 at 23:06
  • $\begingroup$ Cross-posted to Computational Science $\endgroup$ – user147263 Dec 19 '14 at 21:24
1
$\begingroup$

Ian made two excellent points in comments:

  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.

$\endgroup$
  • $\begingroup$ 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? $\endgroup$ – Josh Greenhalgh Dec 19 '14 at 14:14
  • $\begingroup$ 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. $\endgroup$ – Kirill Dec 19 '14 at 19:35
  • $\begingroup$ I expanded my comment into this answer. $\endgroup$ – Kirill Dec 19 '14 at 21:21
  • $\begingroup$ @Kirill Thanks for expanding the comment. I don't really do numerics, so my answer is somewhat amateurish. $\endgroup$ – user147263 Dec 19 '14 at 21:26

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.