Find compatibility and gauge before dividing by a wave number
On a periodic interval of length \(2\pi\), solve \(-u''=f\). Integrating over one period gives \(0=\int f\) because periodic derivative values agree at the ends. This is an existence condition. If a solution exists, adding a constant changes neither field gradient nor source, so specify a mean \(u_0\) separately to fix uniqueness. These two roles sometimes get conflated in numerical code that simply sets the Fourier coefficient at zero to zero. Setting \(u_0=0\) fixes a gauge; deleting nonzero \(f_0\) removes a physical mean source and changes an incompatible model. Check the measured source mean before applying a projected solve.
For \(f(x)=\sum_k f_ke^{ikx}\), take \(u_k=f_k/k^2\) for \(k\ne0\). For a length \(L\) in physical units replace \(k\) by \(2\pi j/L\). A compatible source \(f=\cos3x+0.2\sin x\) gives mean-zero \(u=\cos3x/9+0.2\sin x\). Higher spatial frequencies are smoothed by the inverse Laplacian; data noise at low but nonzero wavenumber can affect the inferred field more strongly than visually rapid fluctuations of equal source amplitude. A compatible constant reference level of potential cannot be inferred from this equation even with noiseless source data.
Compare an exact spectral solve with a discrete operator
On \(N\) equispaced nodes, an FFT diagonalises any periodic translation-invariant discrete convolution, but the diagonal symbol depends on the operator being solved. A spectral second derivative uses \(k^2\) for \(-u''\), while a second-order periodic difference stencil uses \(\lambda_h(k)=4\sin^2(kh/2)/h^2\), \(h=2\pi/N\). The same FFT can invert either symbol. Verify a solver by applying the matching discrete operator back to its result. A Fourier result with tiny residual for the finite-difference stencil is a precise solution of that stencil; it does not thereby reproduce the continuum Fourier amplitude exactly.
At \(N=16,k=4\), \(kh/2=\pi/4\), hence \(\lambda_h=2/h^2=12.97\), compared with continuum \(k^2=16\). A unit cosine source has spectral potential amplitude 0.0625; the finite-difference inverse gives approximately 0.0771. Both can pass a discrete residual at machine precision in their appropriate systems. At fixed physical mode the symbols approach one another as \(N\) increases; at mode number constantly near the Nyquist limit their relative discrepancy need not vanish. A convergence test keeping \(k/N\) fixed follows different physical sources at each refinement.
Identify aliased modes before applying the inverse
For \(N\) samples, Fourier modes with indices differing by an integer multiple of \(N\) coincide at all nodes. Suppose a source includes \(v^2\), where \(v=\cos(5x)\) on a 12-point grid. Squaring exactly yields \([1+\cos(10x)]/2\). But sampled \(\cos10x=\cos2x\), so the grid reports an apparent low \(k=2\) component. Subtracting the known mean gives a compatible source, but the resulting potential amplitude becomes \(0.5/2^2=0.125\) at the wrong spatial frequency rather than \(0.5/10^2=0.005\) at the true one. The inverse Laplacian magnifies the false low-mode contribution, transforming a sampling error into a large field error.
To obtain the product projected on a retained Fourier band, zero-pad the input Fourier coefficients on a sufficiently enlarged grid, transform to space, multiply there, transform back and discard unretained output modes. For modes \(|k|\le K\), a quadratic product extends to \(2K\). To ensure none of its high modes folds back into the retained range, choose multiplication grid size strictly greater than \(3K\), or handle endpoint/Nyquist modes explicitly. This is the usual three-halves padding rule relative to a base grid around \(2K\). Different FFT normalisations require scaling when padding and truncating. Simply padding already multiplied samples cannot recover frequency information that has already aliased.
For a deliberately filtered small problem one can instead drop the top third of the spectrum on a fixed grid before nonlinear multiplication, retaining only \(|k|<N/3\). This avoids erroneous feedback into the retained modes but also discards legitimate high-frequency information. Choosing a finer physical grid can be preferable when the physical quantity of interest depends on those modes. Dealiasing corrects a numerical representation of the chosen projected equations; it does not supply a physical closure for unresolved turbulence, interfaces or material fluctuations.
Follow one unresolved harmonic through the Poisson inverse
The simulation multiplies a cosine of mode m by itself, removes its exact mean and inverts the periodic Poisson operator. The continuum curve retains the true product mode 2m. The unpadded curve uses whichever harmonic the coarse point samples represent, while the third curve shows the correctly projected solution restricted to the original resolvable Fourier band. At 12 samples and m equal to 5, coarse multiplication creates a false mode two whose potential amplitude is 25 times the desired continuum amplitude. The resolved-band projection correctly eliminates that harmonic rather than inventing a low mode.
Increase N until the true product is representable. The three answers then agree, including the phase of the spatial variation. The control limits the actual input frequency to a representable non-Nyquist input and reports the mode used, so changing the grid cannot silently inject an impossible input. A projected curve equal to zero means none of this particular product survives the retained band. It does not mean the continuum product or the underlying fine-scale field vanishes.
Tutorial · verify mean source, discrete response and nonlinear products
Detect an impossible boundary-value problem
A periodic source has \(f(x)=0.03+\sin x\). A program reports \(u=\sin x\) and a machine-small residual after dropping the zero Fourier mode. Evaluate the actual residual and explain its interpretation.
Work through the solution
For the reported solution \(-u''=\sin x\), so the original pointwise residual \(-u''-f=-0.03\) everywhere and its integral is \(-0.06\pi\). There is no periodic solution to the original equation. The programme exactly solved the mean-subtracted problem. An external sink or a physically justified zero-mean correction could make such a model appropriate, but the removed source must be stated and checked.
Predict the grid error of a low physical mode
For \(k=1\), expand \(\lambda_h(k)\) and find the leading relative error in the finite-difference solution amplitude for a fixed unit cosine source.
Work through the solution
Using \(\sin^2 z=z^2-z^4/3+\cdots\) gives
Inversion yields
The discrete potential amplitude is too large to leading order. Refining at the same \(k\) by halving \(h\) should reduce the amplitude error by roughly four. This statement differs from finding the residual of the already solved stencil.
Choose a padding size from the desired output band
Input modes occupy \(|k|\le5\), and only output modes \(|k|\le5\) of their quadratic product will be kept. Compare multiplication grids with 14 and 16 points.
Work through the solution
With 14 points a possible product \(k=10\) aliases to \(-4\), contaminating the retained range. With 16 points all modes \(6,\ldots,10\) which wrap do so outside \([-5,5]\); for example 10 wraps to \(-6\). Thus 16 is sufficient for retained coefficients. It is not sufficient to represent and report the complete \(k=10\) output wave itself, which needs a larger bandwidth. Distinguish accuracy of a projected nonlinear evolution from recovery of every generated physical harmonic.