Math 2.0

Numerical analysis Definition

Five-point stencil

Builds on Finite difference coefficientsLaplacian

Definition

Let h>0h > 0 be a grid spacing.

  1. In one dimension, the five-point stencil at x∈ℝx \in \R is the set of points x−2h,x−h,x,x+h,x+2hx - 2h, x - h, x, x + h, x + 2h. The associated formulas for a function ff are f′(x)≈−f(x+2h)+8f(x+h)−8f(x−h)+f(x−2h)12h,f'(x) \approx \frac{-f(x + 2h) + 8 f(x + h) - 8 f(x - h) + f(x - 2h)}{12 h}, f′′(x)≈−f(x+2h)+16f(x+h)−30f(x)+16f(x−h)−f(x−2h)12h2.f''(x) \approx \frac{-f(x + 2h) + 16 f(x + h) - 30 f(x) + 16 f(x - h) - f(x - 2h)}{12 h^2}.
  2. In two dimensions, the five-point stencil at (x,y)∈ℝ2(x, y) \in \R^2 is the set of points (x,y)(x, y), (x±h,y)(x \pm h, y), (x,y±h)(x, y \pm h). The associated five-point Laplacian of a function uu is Δhu(x,y)=u(x+h,y)+u(x−h,y)+u(x,y+h)+u(x,y−h)−4u(x,y)h2.\Delta_h u(x, y) = \frac{u(x + h, y) + u(x - h, y) + u(x, y + h) + u(x, y - h) - 4 u(x, y)}{h^2}.

Remarks

The one-dimensional weights are the finite difference coefficients for the stencil −2,−1,0,1,2-2, -1, 0, 1, 2. For f∈C5f \in C^5, the first formula has error −h430f(5)(ξ)-\frac{h^4}{30} f^{(5)}(\xi) for some ξ\xi in (x−2h,x+2h)(x - 2h, x + 2h), so it has order 44; the second has order 44 for f∈C6f \in C^6. Check of the second formula on f(s)=s2f(s) = s^2 at x=0x = 0: −4h2+16h2+16h2−4h212h2=2=f′′(0)\frac{-4h^2 + 16h^2 + 16h^2 - 4h^2}{12h^2} = 2 = f''(0). For u∈C4u \in C^4, each one-dimensional second difference has error h212∂4u\frac{h^2}{12} \partial^4 u at an intermediate point, so ∣Δhu−Δu∣≤h212(max⁡∣uxxxx∣+max⁡∣uyyyy∣)\abs{\Delta_h u - \Delta u} \le \frac{h^2}{12} \big( \max \abs{u_{xxxx}} + \max \abs{u_{yyyy}} \big) and the five-point Laplacian approximates the Laplacian to second order. Non-example: the nine-point and the diagonal five-point stencil (x±h,y±h)(x \pm h, y \pm h) also approximate Δu\Delta u, the latter as 12h2(∑u(x±h,y±h)−4u(x,y))\frac{1}{2h^2}\big(\sum u(x \pm h, y \pm h) - 4u(x,y)\big), but it uses different points and is not the five-point stencil defined here.

Reading path

To understand this page from the ground up, read these 13 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Euclidean space object
  2. Finite difference coefficients concept
  3. Function concept
  4. Total derivative concept
  5. Function of several variables concept
  6. Vector-valued function concept
  7. Differentiable function of several variables concept
  8. Partial derivative concept
  9. Vector field concept
  10. Gradient concept
  11. Divergence concept
  12. Laplacian concept
  13. Five-point stencil definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Five-point_stencil
About this page
TagDHRDTHFBFA
URIm2://DHRDTHFBFA
Kinddefinition
WritingW0 stub
MSC65N06, 65D25
DefinesFive-point stencil
UsesFinite difference coefficients, Laplacian

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.