Spectral Collocation
How many numbers are needed to resolve a smooth bound-state profile? A local difference stencil uses nearby values to estimate derivatives. Spectral collocation differentiates one interpolating function through the entire grid. For a sufficiently smooth solution this can reduce the required point count dramatically, but it also makes boundary conditions, smoothness and rounding errors decisive.
We construct Chebyshev and Fourier differentiation, then compute a kink fluctuation with the same finite-interval conditions used by a difference method. Separate tests expose the domain error and a nonlinear alias that a larger grid does not automatically cure.
Preparation: Finite differences and residuals, polynomial interpolation and Fourier series. The physical kink normalization is developed in soliton stability.
Nondimensionalize the bound-state problem
For the scalar kink, use the dimensionless coordinate , where is the tree-level vacuum curvature mass. The fluctuation equation is
The physical frequency satisfies . On the half-line, the odd shape mode obeys and decays at infinity:
Indeed, substituting the profile gives , and gives .
Our first numerical problem instead has
The exact half-line profile is nonzero at finite . Thus comparing a numerical eigenvalue directly with mixes discretization and boundary error. We first compare two methods at the same and only then increase . The shooting calculation also distinguishes a finite Dirichlet wall from a spectral decay condition.
Differentiate the interpolating polynomial
On a reference interval , take the ascending Chebyshev–Lobatto nodes
There are points. If are the field values, the unique degree-at-most- interpolant is
Differentiation is linear:
For the Chebyshev nodes, let and otherwise. The entries are
The diagonal formula enforces the derivative of a constant. This construction is derived in Trefethen, Chapter 6, Theorem 7, pp. 51–55 (PDF). The source orders nodes from to ; reversing both rows and columns gives the ascending convention used here.
Map to :
The scale factor is squared for a second derivative. An elementary but discriminating implementation test is , followed by derivatives of several polynomials on intervals of different lengths.
For homogeneous Dirichlet data, first form the full second-derivative matrix, then remove endpoint unknowns:
Deleting endpoints from before squaring would differentiate a different intermediate interpolant. For nonzero Dirichlet values, retain their contributions as known terms on the right. A Neumann or Robin condition instead supplies an endpoint row involving the appropriate derivative and value; it cannot be imposed by deleting the endpoint blindly.
This point-collocation matrix is generally not symmetric in the Euclidean norm of its nodal values. The companion uses a general eigensolver, records imaginary parts and residuals, and selects the smallest positive eigenvalue satisfying a stated realness test. The collocation eigenvalues need not be variational upper bounds.
Recovering the finite-box shape mode
The retained calculation uses and Chebyshev degrees . Degrees and provide a reference refinement check for each finite boundary problem. Eigenvectors are normalized by integrating their interpolating polynomial with Gauss–Legendre quadrature; changing the quadrature from to points checks that normalization.
At , the degree- reference gives . Its change from degree is , so differences at that scale are numerical floors rather than additional certified digits.
| Method | Interior unknowns | |
|---|---|---|
| Centered differences | ||
| Centered differences | ||
| Centered differences | ||
| Chebyshev collocation | ||
| Chebyshev collocation | ||
| Chebyshev collocation |
The smooth profile is resolved with far fewer collocation points. This comparison counts unknowns, not wall-clock cost: the Chebyshev matrix is dense, whereas the difference matrix is tridiagonal. A large multidimensional calculation must account for storage, matrix application and solver structure as well.
The left panel compares discretizations of exactly the same Dirichlet problem at . Differences near are comparable to the reference refinement, not guaranteed continuum accuracy. The right shows the normalized profile at , where the finite wall visibly changes its tail relative to the half-line shape.
A nodal eigen-residual alone can be small even when the interpolating function is poor between nodes. The driver therefore differentiates the interpolating polynomial at independent quadrature points. At , the maximum off-grid ODE residual is at degree , at degree , and at degree . It then rises to at degree : high derivatives amplify rounding error. The normalized profile difference at degree relative to the reference is in . These diagnostics measure different aspects of the approximation and need not attain their minima at the same degree.
Now vary the boundary:
| Finite-Dirichlet eigenvalue | ||
|---|---|---|
The degree- to changes range from to . The domain effect is much larger than that refinement at the smaller . A well-resolved finite box is still a finite box.
Fourier differentiation and the Nyquist mode
On a periodic interval of length , sample at . The discrete Fourier coefficients are
For resolved modes, first and second derivatives multiply coefficients by and . In matrix form,
Here denotes the matching discrete transform. For even , the real interpolant represents the Nyquist component by . Its first derivative vanishes at every grid point, so the first-derivative multiplier is set to zero there. Its second derivative is and does not vanish. Consequently and the proper Fourier differ on that mode. This is a convention about unresolved sine data, not a failure of calculus.
For the analytic periodic function , the exact second derivative is
The maximum nodal errors at are respectively , , and . The rapid decrease reaches a rounding floor.
Smoothness is essential. For , which has cusps, the RMS function interpolation errors at are , , , and . The convergence is algebraic. We do not compare an ordinary second derivative at the cusps, where a distributional treatment is needed. Likewise, a smooth function on an interval can acquire an endpoint jump when periodically extended; using a Fourier grid does not remove that jump.
Nonlinear products create unresolved modes
Collocation evaluates products at the grid points. A product can generate frequencies above the resolved band even if every input is resolved. On an -point grid,
so the higher frequency is indistinguishable from a lower one: this is aliasing.
For example,
At , the second term appears as a constant and gives a false mean , although the continuum mean is zero. A more demanding example is . Its frequency- term aliases to frequency on both and points. Merely applying the familiar factor- padding associated with quadratic products is insufficient for this cubic product.
If the inputs and desired output satisfy , a cubic creates modes up to . To keep those modes from wrapping into on a product grid of size , a sufficient strict condition is
Pad the resolved input coefficients with zeros, evaluate on that grid, multiply, transform back, then keep the desired output band. The companion tests the known trigonometric inputs by reevaluating them on product points; for these exactly resolved inputs this is equivalent to zero-padding. With , removes the false frequency- component to roundoff. The driver is a concrete alias check, not a general-purpose nonlinear padding library.
Summary
Spectral differentiation follows directly from an interpolating function. It can resolve smooth field profiles efficiently, provided coordinates, boundary equations and derivative conventions are consistent. The kink calculation separates point-count convergence from the finite wall, while the Fourier tests distinguish analytic convergence, rounding floors, limited smoothness and nonlinear aliasing.
Exercises
1. Square before eliminating endpoints
Construct the first-derivative matrix at the ascending nodes . Compare the interior entry of with the square of the interior submatrix of . How does the result scale on ?
Solution
Differentiating the three quadratic Lagrange polynomials gives
For zero endpoint values, the correct interior second derivative is . Removing the endpoint rows and columns first leaves the matrix , whose square is zero. That procedure incorrectly discards the derivative information carried by the endpoint values of the intermediate polynomial.
Under , multiply by and by . Thus the single interior entry for the second derivative is . Checking independently catches an orientation or scale error before solving an eigenproblem.
2. Why quadratic padding fails for a cubic
An input has Fourier support . Show explicitly why an -point product grid corrupts the retained band for , and derive a sufficient grid size for any cubic of such inputs.
Solution
The exact product is
On points, is equivalent to modulo . Since the cosine is even, the unwanted term becomes inside the retained band. The incorrect coefficient is not a small discretization remainder.
For general input support , convolution gives cubic support . A positive high mode can wrap into the retained interval if for some . Excluding this possibility requires , or ; the negative side gives the same condition. For , any integer suffices under this support convention, and the retained test uses . After multiplication one must still project back to the desired output band.
References
- SciPy community,
scipy.linalg.eig, SciPy 1.13.1 manual: general left/right eigenproblem and its distinction from the Hermitian routine. - L. N. Trefethen, Spectral Methods in MATLAB, SIAM, 2000, author’s page. Consulted Chapter 6, pp. 51–55, Theorem 7 and Eqs. (6.1)–(6.6), including
cheb.m, in the author’s sample (PDF); also the official errata, including the corrected eigenvalue scaling for Program 15.
Scrollable formula. Use Left and Right arrow keys to reveal hidden content.
Scrollable table. Use Left and Right arrow keys to reveal hidden columns.
Scrollable figure. Use Left and Right arrow keys to reveal hidden content.