ArticleslgStudy

mathematics

Compact stencil

Compact stencil is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Compact stencil rather than just read about it. In short: In mathematics, especially in the areas of numerical analysis called numerical partial differential equations, a compact stencil is a type of stencil that uses only nine nodes for its discretization method in two dimensions. It uses only the center node and the adjacent nodes.

Compact stencil — main illustration
Compact stencil — illustration

Key takeaways

  • Compact stencil belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Compact stencil to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Compact stencil from memory before moving on to harder problems.

Reference excerpt

In mathematics, especially in the areas of numerical analysis called numerical partial differential equations, a compact stencil is a type of stencil that uses only nine nodes for its discretization method in two dimensions. It uses only the center node and the adjacent nodes. For any structured grid utilizing a compact stencil in 1, 2, or 3 dimensions the maximum number of nodes is 3, 9, or 27 respectively. Compact stencils may be compared to non-compact stencils. Compact stencils are implemented in many partial differential equation solvers, including several in the topics of CFD, FEA, and other mathematical solvers relating to PDEs

Two point stencil example

The two point stencil for the first derivative of a function is given by: f′(x0)=f(x0+h)−f(x0−h)2h+𝒪(h2). This is obtained from the Taylor series expansion of the first derivative of the function given by: f′(x0)=f(x0+h)−f(x0)h−f″(x0)2!h−f(3)(x0)3!h2−f(4)(x0)4!h3+⋯. Replacing h with −h, we have: f′(x0)=−f(x0−h)−f(x0)h+f″(x0)2!h−f(3)(x0)3!h2+f(4)(x0)4!h3+⋯. Addition of the above two equations together results in the cancellation of the terms in odd powers of h: 2f′(x0)=f(x0+h)−f(x0)h−f(x0−h)−f(x0)h−2f(3)(x0)3!h2+⋯f′(x0)=f(x0+h)−f(x0−h)2h−f(3)(x0)3!h2+⋯=f(x0+h)−f(x0−h)2h+𝒪(h2).

Three point stencil example For example, the three point stencil for the second derivative of a function is given by: f″(x0)=f(x0+h)+f(x0−h)−2f(x0)h2+𝒪(h2). This is obtained from the Taylor series expansion of the first derivative of the function given by: f′(x0)=f(x0+h)−f(x0)h−f″(x0)2!h−f(3)(x0)3!h2−f(4)(x0)4!h3+⋯. Replacing h with −h, we have: f′(x0)=−f(x0−h)−f(x0)h+f″(x0)2!h−f(3)(x0)3!h2+f(4)(x0)4!h3+⋯. Subtraction of the above two equations results in the cancellation of the terms in even powers of h: 0=f(x0+h)−f(x0)h+f(x0−h)−f(x0)h−2f(2)(x0)2!h−2f(4)(x0)4!h3+⋯.f(2)(x0)=f(x0+h)+f(x0−h)−2f(x0)h2−2f(4)(x0)4!h2+⋯.f(2)(x0)=f(x0+h)+f(x0−h)−2f(x0)h2+𝒪(h2).

See also Five-point stencil Nine-point stencil

References

Illustrations

Compact stencil: A 2D compact stencil using all 8 adjacent nodes, plus the center node (in red).
A 2D compact stencil using all 8 adjacent nodes, plus the center node (in red).

Worked examples

Example 1 — a first encounter with Compact stencil

Start with the simplest possible case. Write down what Compact stencil claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Compact stencil before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Compact stencil ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Compact stencil

In research
Compact stencil appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Compact stencil in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Compact stencil is common in secondary-school and first-year university syllabi. It links to neighbouring topics Numerical differential equations, so understanding it makes those chapters shorter.
In everyday life
Look for Compact stencil outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Compact stencil” →

How to study Compact stencil in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Compact stencil means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Compact stencil out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Compact stencil in simple terms?

In mathematics, especially in the areas of numerical analysis called numerical partial differential equations, a compact stencil is a type of stencil that uses only nine nodes for its discretization method in two dimensions. It uses only the center node and the adjacent nodes.

Why does Compact stencil matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Compact stencil?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Compact stencil.

Tags

  • Numerical differential equations

Keep exploring