Which refinement changed the error?
A traveling wave gives a useful calibration for a soliton code before adding nonlinear scattering. Transport a unit Gaussian at unit speed for unit time. The exact solution on the line is . Replacing the line by a periodic box, replacing the derivative by a difference, and stepping forward in time are three separate choices. By introducing an exact reference between consecutive choices we can measure the contribution from each.
Required background. Residuals and forward errors defines the discrepancy between an approximate solution and the chosen reference.
What the box changes
Section titled “What the box changes”Consider with smooth data. On a circle of length choose the exact periodic initial profile
The periodic solution at time one is . At the peak its difference from the line solution is . For this is respectively , and . There is no integration scheme in this computation. The change is a modeling error if the intended experiment is on the line. It is part of the correct solution if the experiment is on a ring. Away from the peak use the image sum at the actual observation point.
One box can resolve the peak and miss the tail
Section titled “One box can resolve the peak and miss the tail”Compare the line and circle on one cell centered at the moving peak. At its opposite point , two periodic copies contribute equally. Subtracting the isolated line Gaussian leaves the nearest image and pairs of more distant images. Writing for the image bias at offset gives
At the peak bias is , while the bias opposite the peak is . The isolated tail there is itself , so the box has almost doubled the field in that measurement. As grows, the leading peak bias decays as and the opposite-point bias as . The latter tends to zero in absolute units while its ratio to the isolated tail tends to one. An error tolerance for a tail measurement therefore needs both an observation point and a choice of absolute or relative units.
There is also a precision limit to subtracting two peak values. At , adding the images to the unit peak and subtracting one returns zero in binary64. Summing the images directly gives . This deficit is already smaller than half the spacing between one and the next larger floating-point value. Reproduce both observation points and the cancellation (Python)
Keep the spatial model fixed while testing time
Section titled “Keep the spatial model fixed while testing time”Take and use the periodic centered difference . A Fourier grid mode then has time generator , compared with for a resolved continuum Fourier mode. The expansion explains the leading second-order phase error for a fixed physical wave number. At on an even grid the alternating nodal mode is stationary under the centered scheme. Its amplitude remains exactly constant while the continuum mode changes phase. Trefethen’s plane-wave calculation uses the opposite transport direction, . Trefethen, §5.1, p. 193, equations (5.1.1)–(5.1.3), chapter PDF
Using an FFT of the sampled initial data, multiply each mode by to integrate the semidiscrete problem exactly to time one. To test the usual fourth-order Runge–Kutta method on the same spatial problem, use equal steps and replace this multiplier by
The polynomial follows by applying the four stages to the scalar test equation . It is stable along the imaginary axis for , as follows by multiplying it by its complex conjugate. Check stability again when refining the space grid at a fixed time step.
A refinement matrix with a known reference in each column
Section titled “A refinement matrix with a known reference in each column”For measure the spatial error as the maximum over grid points of the difference between the exactly evolved centered scheme and . Measure the temporal error separately on 64 spatial points by comparing RK4 with the exact evolution of that grid. Each row shows two independent experiments.
| Spatial points | Spatial sup error | Time steps on 64 points | Temporal sup error |
|---|---|---|---|
| 32 | 0.03968959 | 8 | |
| 64 | 0.01013910 | 16 | |
| 128 | 0.00253593 | 32 | |
| 256 | 0.00063545 | 64 |
Second-order spatial convergence reduces the error by about four on doubling . Fourth-order temporal convergence reduces it by about sixteen on doubling . At the total error against the exact periodic wave is at 32 steps and at 64 steps. Space already contributes . A time solver can agree to seven digits with its own spatial reference while a field value still differs from the periodic wave by about . In a total-error comparison the two contributions can also cancel at a particular point. Preserve the componentwise comparisons before taking a norm. Reproduce the three refinements (Python)
For a nonlinear wave, replace the exactly evolved spatial system by a much tighter time solve and independently test that reference. A Fourier-mode cutoff, a rapidity cutoff, the number of physical particles, and arithmetic precision each change a different object. Vary them separately while holding the physical density, boundary data and observation time appropriate to the stated limit. A changed-input exercise is to track the width or phase of the pulse instead of its height; those observables weight the Fourier modes differently. A fully nonlinear worked transfer is the two-soliton collision laboratory.
References
Section titled “References”- L. N. Trefethen, Finite Difference and Spectral Methods for Ordinary and Partial Differential Equations, unpublished text, 1996, chapters 2–5. Author’s text
Connected readings