Compact finite difference

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)

This article may be in need of reorganization to comply with Wikipedia's layout guidelines. Please help by editing the article to make improvements to the overall structure. (January 2015) (Learn how and when to remove this message)

|

This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (January 2015) (Learn how and when to remove this message)

|

This article relies excessively on references to primary sources. Please improve this article by adding secondary or tertiary sources.
Find sources: "Compact finite difference" – news · newspapers · books · scholar · JSTOR (January 2015) (Learn how and when to remove this message)

|

This article is an orphan, as no other articles link to it. Please introduce links to this page from related articles; try the Find link tool for suggestions. (November 2016)

|

(Learn how and when to remove this message)

The compact finite difference formulation, or Hermitian formulation, is a numerical method to compute finite difference approximations. Such approximations tend to be more accurate for their stencil size (i.e. their compactness) and, for hyperbolic problems, have favorable dispersive error and dissipative error properties when compared to explicit schemes.[1] A disadvantage is that compact schemes are implicit and require to solve a diagonal matrix system for the evaluation of interpolations or derivatives at all grid points. Due to their excellent stability properties, compact schemes are a popular choice for use in higher-order numerical solvers for the Navier-Stokes Equations.

## Example

[edit]

The classical Pade scheme for the first derivative at a cell with index  i {\displaystyle i} ( f i ′ {\displaystyle f'_{i}} ) reads;

1 4 f i − 1 ′ + f i ′ + 1 4 f i + 1 ′ = 3 2 f i + 1 − f i − 1 2 Δ . {\displaystyle {\frac {1}{4}}f'_{i-1}+f'_{i}+{\frac {1}{4}}f'_{i+1}={\frac {3}{2}}{\frac {f_{i+1}-f_{i-1}}{2\Delta }}.}

Where  Δ {\displaystyle \Delta } is the spacing between points with index  i − 1 , i & i + 1 {\displaystyle i-1,\ i\ \&\ i+1} . The equation yields a fourth-order accurate solution for  f ′ {\displaystyle f'} when supplemented with suitable boundary conditions (typically periodic). When compared to the 4th-order accurate central explicit method;

f i ′ = − f i + 2 + 8 f i + 1 − 8 f i − 1 + f i − 2 12 Δ , {\displaystyle f'_{i}={\frac {-f_{i+2}+8f_{i+1}-8f_{i-1}+f_{i-2}}{12\Delta }},}

the former (implicit) method is compact as it only uses values on a 3-point stencil instead of 5.

## Derivation of compact schemes

[edit]

Compact schemes are derived using a Taylor series expansion. Say we wish to construct a compact scheme with a three-point stencil (as in the example):

α 1 f i − 1 ′ + f i ′ + α 2 f i + 1 ′ = b 1 f i + 1 + a f i + b 2 f i − 1 . {\displaystyle \alpha _{1}f'_{i-1}+f'_{i}+\alpha _{2}f'_{i+1}=b_{1}f_{i+1}+af_{i}+b_{2}f_{i-1}.}

From a symmetry argument we deduce  α 1 = α 2 = α {\displaystyle \alpha _{1}=\alpha _{2}=\alpha } ,  a = 0 {\displaystyle a=0} and  b 1 = − b 2 = − b {\displaystyle b_{1}=-b_{2}=-b} , resulting in a two-parameter system,

α f i − 1 ′ + f i ′ + α f i + 1 ′ + b f i + 1 − b f i − 1 = 0. {\displaystyle \alpha f'_{i-1}+f'_{i}+\alpha f'_{i+1}+bf_{i+1}-bf_{i-1}=0.}

We write the expansions around  x i {\displaystyle x_{i}} up to a reasonable number of terms and using notation  d n f d x n = f n {\displaystyle {\frac {\mathrm {d} ^{n}f}{\mathrm {d} x^{n}}}=f^{n}} ,

f i + 1 = f i + Δ f i ′ + 1 2 Δ 2 f i 2 + 1 6 Δ 3 f i 3 + 1 24 Δ 4 f i 4 + e t c . , f i − 1 = f i − Δ f i ′ + 1 2 Δ 2 f i 2 − 1 6 Δ 3 f i 3 + 1 24 Δ 4 f i 4 + e t c . , f i ′ = f i ′ , f i + 1 ′ = f i ′ + Δ f i 2 + 1 2 Δ 2 f i 3 + 1 6 Δ 3 f i 4 + 1 24 Δ 4 f i 5 + e t c . , f i − 1 ′ = f i ′ − Δ f i 2 + 1 2 Δ 2 f i 3 − 1 6 Δ 3 f i 4 + 1 24 Δ 4 f i 5 + e t c . , {\displaystyle {\begin{aligned}f_{i+1}&=&f_{i}+\Delta &f'_{i}+{\frac {1}{2}}\Delta ^{2}&f_{i}^{2}+{\frac {1}{6}}\Delta ^{3}&f_{i}^{3}+{\frac {1}{24}}\Delta ^{4}f_{i}^{4}+\mathrm {etc.} ,\\\f_{i-1}&=&f_{i}-\Delta &f'_{i}+{\frac {1}{2}}\Delta ^{2}&f_{i}^{2}-{\frac {1}{6}}\Delta ^{3}&f_{i}^{3}+{\frac {1}{24}}\Delta ^{4}f_{i}^{4}+\mathrm {etc.} ,\\\f'_{i}&=&&f'_{i},\\\f'_{i+1}&=&&f'_{i}+\Delta &f_{i}^{2}+{\frac {1}{2}}\Delta ^{2}&f_{i}^{3}+{\frac {1}{6}}\Delta ^{3}f_{i}^{4}+{\frac {1}{24}}\Delta ^{4}f_{i}^{5}+\mathrm {etc.} ,\\\f'_{i-1}&=&&f'_{i}-\Delta &f_{i}^{2}+{\frac {1}{2}}\Delta ^{2}&f_{i}^{3}-{\frac {1}{6}}\Delta ^{3}f_{i}^{4}+{\frac {1}{24}}\Delta ^{4}f_{i}^{5}+\mathrm {etc.} ,\\\\\end{aligned}}}

Each column on the right-hand side gives an equation for the coefficients  α , b {\displaystyle \alpha ,b} ,

f i : b − b = 0 , ( T r i v i a l ) f i ′ : 2 Δ b + 1 + 2 α = 0 , ( e q . 1 ) f i 2 : b − b + α − α = 0 , ( T r i v i a l ) f i 3 : 1 3 b Δ 3 + Δ 2 α = 0. ( e q . 2 ) . {\displaystyle {\begin{aligned}f_{i}:&\ \ \ b-b&=0,&\ \mathrm {(Trivial)} \\\f'_{i}:&\ \ \ 2\Delta b+1+2\alpha &=0,&\ \mathrm {(eq.\ 1)} \\\f_{i}^{2}:&\ \ \ b-b+\alpha -\alpha &=0,&\ \mathrm {(Trivial)} \\\f_{i}^{3}:&\ \ \ {\frac {1}{3}}b\Delta ^{3}+\Delta ^{2}\alpha &=0.&\ \mathrm {(eq.\ 2)} .\end{aligned}}}

We now have two equations for two unknowns and therefore stop checking for higher-order-term equations.

e q . 2 : b = − 3 Δ α , -> e q . 1 : − 6 α + 1 + 2 α = 0 , -> α = 1 4 , a n d , -> b = − 3 4 Δ , {\displaystyle {\begin{aligned}\mathrm {eq.\ 2} :&\ b={\frac {-3}{\Delta }}\alpha ,\rightarrow \\\\\mathrm {eq.\ 1} :&\ -6\alpha +1+2\alpha =0,\rightarrow \\\&\alpha ={\frac {1}{4}},\ \mathrm {and} ,\ \rightarrow \\\&b=-{\frac {3}{4\Delta }},\end{aligned}}}

which is indeed the scheme from the example.

## Evaluation of a compact scheme

[edit]

Compact finite difference schemes are a class of numerical methods used to approximate derivatives with high accuracy while maintaining a minimal stencil size. Unlike standard finite difference methods that use explicit expressions, compact schemes rely on implicit relations between function values and derivatives at neighboring points. This implicitness enables them to achieve spectral-like resolution and higher-order accuracy with fewer grid points. The valuation of a compact finite difference scheme typically refers to assessing its order of accuracy, spectral resolution, dispersion and dissipation errors and computational cost vs. accuracy [2]

### Order of Accuracy (Formal Valuation)

[edit]

One of the primary measures of value in a finite difference scheme is its order of accuracy, which reflects how rapidly the approximation error decreases as the grid is refined. A compact scheme can achieve an order of accuracy of  O ( h 2 p ) {\displaystyle {O}(h^{2p})} , where hh is the grid spacing and pp is an integer denoting the formal order.

### Spectral Resolution

[edit]

Compact schemes are valued for their ability to resolve a broad range of spatial frequencies, a property often referred to as spectral-like resolution. This makes them particularly effective for problems involving wave propagation, sharp gradients, or turbulent flows, where high-frequency information is critical. Compared to explicit schemes, compact methods more accurately reproduce the amplitude and phase of sinusoidal components across a wide range of wavenumbers, closely mimicking the behavior of spectral (Fourier-based) methods.

### Dispersion and Dissipation Characteristics

[edit]

Another advantage of compact schemes is their favorable dispersion and dissipation properties:

* Low dispersion error ensures that numerical waves travel at speeds close to the true physical wave speeds, preserving phase accuracy.
* Low dissipation error reduces artificial attenuation, which is especially important in simulations of long-term wave phenomena or turbulence.

These properties make compact schemes suitable for Direct Numerical Simulation (DNS) and other high-fidelity fluid dynamics applications.

### Computational Cost vs. Accuracy

[edit]

While compact schemes require solving a linear system (typically tridiagonal) to compute derivatives, this modest increase in computational effort is offset by their high accuracy and compactness.

## List of compact schemes

[edit]

### First derivative  f i ′ {\displaystyle f'_{i}}

[edit]

4th order central scheme:

1 4 f i − 1 ′ + f i ′ + 1 4 f i + 1 ′ = 3 2 f i + 1 − f i − 1 2 Δ . {\displaystyle {\frac {1}{4}}f'_{i-1}+f'_{i}+{\frac {1}{4}}f'_{i+1}={\frac {3}{2}}{\frac {f_{i+1}-f_{i-1}}{2\Delta }}.}

6th order central scheme:

1 3 f i − 1 ′ + f i ′ + 1 3 f i + 1 ′ = 14 9 f i + 1 − f i − 1 2 Δ + 1 9 f i + 2 − f i − 2 4 Δ . {\displaystyle {\frac {1}{3}}f'_{i-1}+f'_{i}+{\frac {1}{3}}f'_{i+1}={\frac {14}{9}}{\frac {f_{i+1}-f_{i-1}}{2\Delta }}+{\frac {1}{9}}{\frac {f_{i+2}-f_{i-2}}{4\Delta }}.}

### Second derivative  f i ″ {\displaystyle f''_{i}}

[edit]

4th order central scheme:

1 10 f i − 1 ″ + f i ″ + 1 10 f i + 1 ″ = 6 5 f i + 1 − 2 f i + f i − 1 Δ 2 . {\displaystyle {\frac {1}{10}}f''_{i-1}+f''_{i}+{\frac {1}{10}}f''_{i+1}={\frac {6}{5}}{\frac {f_{i+1}-2f_{i}+f_{i-1}}{\Delta ^{2}}}.}

## References

[edit]

1. ^ Lele, S.K. (August 1992). "Compact finite difference schemes with spectral-like resolution". Journal of Computational Physics. 103 (1): 16–43\. Bibcode:1992JCoPh.103...16L. doi:10.1016/0021-9991(92)90324-R.
2. ^ LeVeque, R.J. (2007). "Finite Difference Methods for Ordinary and Partial Differential Equations: Steady-State and Time-Dependent Problems". Society for Industrial and Applied Mathematics (SIAM).