High-performance CUDA kernel generation and benchmarking framework
View the Project on GitHub jasonlarkin/cuda-stencil-benchmark
This document presents the modified wavenumber analysis of the 4th-order finite difference scheme used in the FDTD implementation. The analysis follows Moin’s Numerical Analysis (Section 5.3) to assess the accuracy and dispersion characteristics of the numerical scheme in wavenumber space.
For a finite difference approximation of the second derivative, the exact wavenumber $k$ is replaced by a modified wavenumber $k_{mod}$ that depends on the grid spacing $h$ and the specific finite difference stencil used.
For the 4th-order central difference scheme: \(\frac{\partial^2 u}{\partial x^2} \approx \frac{-u_{i-2} + 16u_{i-1} - 30u_i + 16u_{i+1} - u_{i+2}}{12h^2}\)
The modified wavenumber is given by: \(k_{mod}^2 = \frac{30 - 32\cos(kh) + 2\cos(2kh)}{12h^2}\)
The phase velocity error is: \(\frac{c_{phase,mod}}{c_{phase,exact}} = \frac{k_{mod}}{k}\)
The group velocity is the derivative of the modified wavenumber: \(\frac{dk_{mod}}{dk} = \frac{1}{2k_{mod}} \frac{d(k_{mod}^2)}{dk}\)
The analysis was performed for different grid spacings. Example plots are provided:
Fine grid (h = 0.01)
Medium grid (h = 0.05)
The phase velocity error shows consistent behavior across all grid spacings:
The group velocity error reaches 100% at high wavenumbers, indicating significant dispersion effects for short wavelengths.
The analysis reveals the following resolution requirements for different accuracy levels:
| Error Level | Points per Wavelength |
|---|---|
| 1% error | 5.27 |
| 5% error | 3.39 |
| 10% error | 2.76 |
The modified wavenumber analysis reveals that the 4th-order scheme exhibits:
For practical FDTD simulations:
The analysis confirms the expected behavior of a 4th-order finite difference scheme:
The results are consistent with established finite difference theory:
The 4th-order finite difference scheme provides:
For practical applications:
The scheme exhibits significant numerical dispersion at high wavenumbers, which is characteristic of finite difference methods. This dispersion must be considered when interpreting results for short-wavelength phenomena.