1

The finite discrete approximation of the 2D Laplacian at a point $(x,y)$ is given by

$$\tag{1}\Delta f(x,y) \approx \frac{f(x-h,y) + f(x+h,y) + f(x,y-h) + f(x,y+h) - 4f(x,y)}{h^2}$$

As I understand from this thread, in 3D, the Laplacian at a point is proportional to the difference between the average value over a small sphere of our scalar function and the value at the very center of the sphere, i.e, $$\Delta f(p)\propto [\textrm{average of}~ f ~\textrm{over a sphere centered at p} - f(p)].$$

And so my intuition, and please correct me if I'm wrong, says in 2D, the Laplacian at a point $p$ should be also proportional to the difference between the average of $f$ over a circle centered at $p$ and $f(p)$, i.e.,

$$\Delta f(p)\propto [\textrm{average of}~ f ~\textrm{over a circle centered at p} - f(p)].$$

But then how does Eq. $(1)$ fit within this context? The approximation is obviously over a square centered at $(x,y)$, but I can't really see the "average over square - value at center of square" idea. What is the intuition behind Eq. $(1)$?

Hilbert
  • 747

2 Answers2

1

Write your approximation under the form :

$$\tag{1}\Delta f(x,y) \approx \underbrace{\frac{f(x-h,y) + f(x+h,y) -2 f(x,y)}{h^2}}_{\approx \ \partial^2f/\partial x^2}+ \underbrace{\frac{f(x,y-h) + f(x,y+h) - 2f(x,y)}{h^2}}_{\approx \ \partial^2 f/\partial y^2}$$

Explanation for the second (partial) derivatives $\partial^2f/\partial x^2$ and $\partial^2f/\partial y^2$ :

It is a consequence of the fact that for a single-variable function, say $\varphi$:

$${\frac{\varphi(x-h) + \varphi(x+h) -2 \varphi(x)}{h^2}} \approx \varphi''(x)$$

itself a consequence of adding the following three equations (two of them being Taylor expansions) :

$$\begin{cases} \varphi(x-h)&\approx&&\varphi(x)-h \varphi'(x)+\frac{1}{2}h^2\varphi''(x)\\ -2 \ \ \varphi(x)&=&-2&\varphi(x)\\ \varphi(x+h)&\approx&&\varphi(x)+h \varphi'(x)+\frac{1}{2}h^2\varphi''(x) \end{cases}$$

Jean Marie
  • 81,803
  • With all due respect, the answer does not address the question. – Hilbert Feb 10 '20 at 22:54
  • @Hilbert It is true that I do not address the "spherical" part, because it does not seem me to be important vs. the fact that you seem to want to understand the approximation of the Laplacian in 2D. – Jean Marie Feb 10 '20 at 23:02
  • 1
    But I am the OP! The question isn't about how the equation was derived, but rather about how to rewrite it in such a way that we can see it as being a difference between an average part and a value at the center part, in the same context as the spherical interpretation. – Hilbert Feb 10 '20 at 23:05
  • I just realized that... And rewrote my answer accordingly... A question, because I am confused now : are you the great Hilbert ? – Jean Marie Feb 10 '20 at 23:07
0

Taylor expansion, pretty much. You find that the $f_x$ terms cancel out because of the coefficients of $f(x+h,y)$ and $f(x-h,y)$ being equal. Same deal for the $f_y$ terms. There are no mixed partial terms appearing because you stay on axis-aligned lines through $(x,y)$. This leaves only the unmixed second partials to show up to within second order, and again they show up "equally", so the second order Taylor expansion of $f(x+h,y)+f(x-h,y)+f(x,y+h)+f(x,y-h)-4f(x,y)$ about $h=0$ is proportional to $\Delta f(x,y) h^2$ (with a constant that doesn't depend on $p,f$ or $h$).

Ian
  • 101,645
  • Thank you. But the question isn't so much about the derivation than about how to see the equation as being a difference between an average of a function over a square and the value at the center of the same square. – Hilbert Feb 10 '20 at 21:46
  • 1
    @Hilbert It isn't really even the average over the square. It's the average of it at those particular points. Basically I don't think the clean intuitive answer that you're asking for here is really available. At best you can examine how the result is exact for quadratic polynomials in $x,y$ and then see how general functions differ. – Ian Feb 11 '20 at 17:44
  • I think you're right, I can't really see how the equation can be viewed in a kind of average-over-square-minus-value-at-center way, and it possibly can't. But when you said it's an average at the points, even then I can't see how. If we are looking after an average of the differences $f(\textbf{x}+\textbf{h}{i})-f(\textbf{x})$, then shouldn't we divided over $4$: $$\frac{\sum{i} {f(\textbf{x}+\textbf{h}_{i})-f(\textbf{x})}}{4}$$, as opposed to $h^{2}$? – Hilbert Feb 11 '20 at 18:23
  • 1
    @Hilbert In this respect you can think of it as the average difference (what you wrote) divided by the area ($4h^2$). You need to divide by the area somewhere just to get the units straight. – Ian Feb 11 '20 at 19:35
  • @Hilbert Do note though that the $4$'s don't cancel in the way that you want them to, so there is this extra factor of $16$ involved. – Ian Feb 11 '20 at 23:41