Skip to content

Can a computation reproduce a soliton collision, including its position shifts? This laboratory compares periodic numerical evolution with the full exact two-soliton field on a long interval. Separate refinements expose different errors, and endpoint measurements distinguish numerical inaccuracy from the finite separation of the pulses. The calculation tests this specified finite-time problem; it does not prove a general inverse-scattering theorem.

Required background. The collision lesson derives the interacting field and its signed shifts. The one-soliton numerical laboratory develops Fourier differentiation, dealiasing and integrating-factor RK4. Python and NumPy are needed to execute the experiment; its tables can be interpreted without running code.

Helpful background. The conservation lesson explains why preserved integrals alone do not establish a small solution error.

Use the dimensionless, positive-field equation

ut+6uux+uxxx=0,x∈R,u_t+6uu_x+u_{xxx}=0,\qquad x\in\mathbb R,

with smooth decaying fields and no background. For κ1>κ2>0\kappa_1\gt\kappa_2\gt0, the target is

τ=1+eη1+eη2+Aeη1+η2,ηj=2κj(x−4κj2t−xj),A=(κ1−κ2κ1+κ2)2,u=2∂x2log⁡τ.\begin{aligned} \tau&=1+e^{\eta_1}+e^{\eta_2}+A e^{\eta_1+\eta_2},\\ \eta_j&=2\kappa_j(x-4\kappa_j^2t-x_j),\\ A&=\left(\frac{\kappa_1-\kappa_2}{\kappa_1+\kappa_2}\right)^2, \qquad u=2\partial_x^2\log\tau. \end{aligned}

Here xjx_j are phase parameters, not both incoming center intercepts. The Library derivation obtains this field from the two-bound-state Marchenko system, using Aktosun 2009, § IX, equations (9.1)–(9.3) with the opposite field sign translated.

The experiment fixes

κ1=1,κ2=12,A=19,xj=log⁡A4κj,−4≤t≤4.\kappa_1=1,\qquad \kappa_2=\frac12,\qquad A=\frac19,\qquad x_j=\frac{\log A}{4\kappa_j}, \qquad -4\le t\le4.

These phases give u(−x,−t)=u(x,t)u(-x,-t)=u(x,t). The pulses are well separated at both endpoints and overlap near zero. See the three exact profiles and their endpoint markers; those curves evaluate the exact formula, independently of numerical time stepping.

Large positive ηj\eta_j make direct exponentiation unsafe even when uu remains small. Write the four logarithmic terms as

z=(0,η1,η2,η1+η2+log⁡A),ws=ezs−max⁡z∑rezr−max⁡z.z=(0,\eta_1,\eta_2,\eta_1+\eta_2+\log A), \qquad w_s=\frac{e^{z_s-\max z}}{\sum_r e^{z_r-\max z}}.

Their xx-slopes are r=(0,2κ1,2κ2,2κ1+2κ2)r=(0,2\kappa_1,2\kappa_2,2\kappa_1+2\kappa_2). Since (log⁡τ)x=∑swsrs(\log\tau)_x=\sum_s w_sr_s, differentiation gives the stable formula

u=2∑sws(rs−r‾)2,r‾=∑swsrs.u=2\sum_s w_s(r_s-\overline r)^2, \qquad \overline r=\sum_s w_sr_s.

This centered variance avoids subtracting nearly equal large moments. Exponent rescaling avoids overflow; sufficiently small tails can still underflow to zero in binary64.

The program tests this evaluator in several independent ways. An exact rational expansion makes all coefficients of the KdV bilinear identity vanish. Analytic derivatives give a sampled PDE residual below 4.5×10−154.5\times10^{-15}. A direct two-by-two Marchenko matrix solve, at moderate positions and times for two unequal parameter pairs, agrees within 1.7×10−141.7\times10^{-14}. These checks test signs, interaction coefficient and normalization before accepting the target. The computation notes define the samples and calculations.

The code samples the full exact field at t=−4t=-4, projects it onto retained Fourier modes, and evolves a periodic field on [−ℓ/2,ℓ/2)[-\ell/2,\ell/2). This is a different boundary problem from the decaying line. Its usefulness depends on keeping boundary mismatch small throughout the selected time interval.

For NN equally spaced points, retain integer modes ∣m∣<N/3|m|\lt N/3. This strict two-thirds cutoff prevents aliases from the quadratic nonlinearity from entering the retained modes. With spatial wave numbers km=2πm/ℓk_m=2\pi m/\ell and Fourier coefficients vmv_m, evolve

v˙m=ikm3vm−3ikmu2^m.\dot v_m=ik_m^3v_m-3ik_m\widehat{u^2}_m.

The existing one-soliton solver supplies the integrating-factor RK4 step. It applies classical RK4 to the transformed variable and resets the integrating factor at every step. This is the method described in Kassam and Trefethen 2005, pp. 1215–1216, equations (1.5)–(1.9), PDF. Independent stage, Fourier-convolution and linear-wave checks run again; the old one-soliton inputs and results are not changed.

At each of the nine checkpoint times t=−4,−3,…,4t=-4,-3,\ldots,4, compare every spatial sample with the exact field, without shifting the numerical profile to align its peaks. If ej=ujnum−ujexacte_j=u_j^{\rm num}-u_j^{\rm exact}, use

ε2(t)=Δx∑j∣ej∣2Δx∑j∣ujexact∣2,ε∞(t)=max⁡j∣ej∣max⁡j∣ujexact∣.\varepsilon_2(t)= \frac{\sqrt{\Delta x\sum_j|e_j|^2}} {\sqrt{\Delta x\sum_j|u_j^{\rm exact}|^2}}, \qquad \varepsilon_\infty(t)= \frac{\max_j|e_j|}{\max_j|u_j^{\rm exact}|}.

The tables report the maximum over these nine checkpoints, not a bound at every intermediate time. The saved initial row also records the error introduced by projection.

The exact line integrals are

M=4∑jκj=6,P=163∑jκj3=6,E=325∑jκj5=6.6.M=4\sum_j\kappa_j=6,\qquad P=\frac{16}{3}\sum_j\kappa_j^3=6,\qquad E=\frac{32}{5}\sum_j\kappa_j^5=6.6.

Their definitions are M=∫u dxM=\int u\,dx, P=∫u2 dxP=\int u^2\,dx and E=∫(u3−ux2/2) dxE=\int(u^3-u_x^2/2)\,dx. Numerical drift is measured at every integration step, from the computed initial value, and divided by the corresponding exact line integral. Initial integral error is stored separately. This prevents a poorly resolved initial field from appearing accurate merely because its incorrect integral stays constant.

Refine time, space and interval separately

Section titled “Refine time, space and interval separately”

Fix ℓ=80\ell=80 and N=768N=768. The duration is 88, so the first row uses 6,4006{,}400 steps.

Step hhMaximum ε2\varepsilon_2Maximum ε∞\varepsilon_\infty
1/8001/8006.45×10−76.45\times10^{-7}5.92×10−75.92\times10^{-7}
1/16001/16002.68×10−82.68\times10^{-8}2.46×10−82.46\times10^{-8}
1/32001/32001.26×10−91.26\times10^{-9}1.17×10−91.17\times10^{-9}
1/64001/64006.08×10−116.08\times10^{-11}5.76×10−115.76\times10^{-11}

The observed orders log⁡2(ε2(h)/ε2(h/2))\log_2(\varepsilon_2(h)/\varepsilon_2(h/2)) are 4.594.59, 4.414.41 and 4.374.37. Report that finite sequence as measured: it is not an independent proof of an exact asymptotic order. The construction has classical fourth order for the fixed smooth semidiscrete problem; error constants, other discretization errors and floating-point effects affect a fitted order.

Fix ℓ=80\ell=80 and h=1/1600h=1/1600. The last column is the largest relative drift among M,P,EM,P,E.

Points NNMaximum ε2\varepsilon_2Maximum ε∞\varepsilon_\inftyLargest invariant drift
1283.22×10−13.22\times10^{-1}3.35×10−13.35\times10^{-1}5.45×10−115.45\times10^{-11}
1921.25×10−21.25\times10^{-2}1.35×10−21.35\times10^{-2}7.03×10−107.03\times10^{-10}
2563.70×10−43.70\times10^{-4}3.74×10−43.74\times10^{-4}1.90×10−91.90\times10^{-9}
3842.49×10−62.49\times10^{-6}2.10×10−62.10\times10^{-6}2.64×10−92.64\times10^{-9}
5123.15×10−83.15\times10^{-8}3.47×10−83.47\times10^{-8}2.66×10−92.66\times10^{-9}
7682.68×10−82.68\times10^{-8}2.46×10−82.46\times10^{-8}2.66×10−92.66\times10^{-9}

The coarse run preserves its integrals very well while representing the field poorly. Increasing NN eventually exposes the time-error floor at this fixed step. The finer time study lowers that floor.

Fix Δx=1/8\Delta x=1/8 and h=1/1600h=1/1600, increasing NN along with ℓ\ell. The final column is the largest absolute exact-field value at either boundary, sampled at 161161 times.

Length ℓ\ellPoints NNMaximum ε2\varepsilon_2Sampled boundary magnitude
403202.34×10−32.34\times10^{-3}8.04×10−38.04\times10^{-3}
483847.48×10−77.48\times10^{-7}2.71×10−62.71\times10^{-6}
645122.68×10−82.68\times10^{-8}4.45×10−124.45\times10^{-12}
806402.68×10−82.68\times10^{-8}1.39×10−151.39\times10^{-15}

The saved results also include endpoint value and derivative mismatches. The last two rows are limited by other errors; the table does not establish that the boundary error is exactly zero or bound it between sample times.

The final reference combines ℓ=80\ell=80, N=768N=768 and h=1/6400h=1/6400. It has maximum checkpoint errors 6.08×10−116.08\times10^{-11} and 5.76×10−115.76\times10^{-11} in the two norms. Its largest relative invariant drift is 2.25×10−122.25\times10^{-12}.

For an isolated endpoint maximum, locate the zero of uxu_x near the predicted center. The code brackets each maximum within 1/κj1/\kappa_j of its asymptotic position and bisects; it uses the derivative of the Fourier interpolant for numerical data. It does not assign two peak trajectories during the overlap.

For endpoints −T-T and TT, a measured shift is

Δxj^(T)=xjpeak(T)−xjpeak(−T)−8κj2T.\widehat{\Delta x_j}(T) =x_j^{\rm peak}(T)-x_j^{\rm peak}(-T)-8\kappa_j^2T.

Even the exact field has finite-separation corrections to this estimate. At T=4T=4:

PulseAsymptotic shiftExact finite-time estimateNumerical estimate
Fast1.0986122886681.0986122886681.0986111061941.0986111061941.0986111061221.098611106122
Slow−2.197224577336-2.197224577336−2.197224576956-2.197224576956−2.197224576964-2.197224576964

The numerical errors relative to exact finite-time estimates are about −7.18×10−11-7.18\times10^{-11} and −8.55×10−12-8.55\times10^{-12}. In contrast, the finite-time biases relative to asymptotic shifts are −1.18×10−6-1.18\times10^{-6} and 3.80×10−103.80\times10^{-10}. Refining the time step cannot remove those latter biases. The broad slow-pulse tail perturbs the fast maximum more strongly.

Using the exact formula alone, the fast-pulse bias decreases from approximately −4.80×10−4-4.80\times10^{-4} at T=2T=2 to −1.18×10−6-1.18\times10^{-6} at T=4T=4 and −2.93×10−9-2.93\times10^{-9} at T=6T=6. These are progressively better separated endpoints, not additional PDE solver runs.

Reject an attractive but incorrect approximation

Section titled “Reject an attractive but incorrect approximation”

Add two independent one-soliton fields u1+u2u_1+u_2, using their correct incoming intercepts. Each term solves KdV, but their sum has residual

(u1+u2)t+6(u1+u2)(u1+u2)x+(u1+u2)xxx=6∂x(u1u2).(u_1+u_2)_t+6(u_1+u_2)(u_1+u_2)_x+(u_1+u_2)_{xxx} =6\partial_x(u_1u_2).

The incoming sum starts close to the exact field: relative L2L^2 error is 3.73×10−63.73\times10^{-6} at t=−4t=-4. At t=0t=0, its maximum sampled PDE residual is 3.213.21; by t=4t=4, its relative field error is 0.8600.860. It lacks the outgoing position shifts. Good incoming agreement therefore cannot justify replacing the interacting solution by a sum throughout the collision.

Download the complete collision experiment ZIP. It includes the shared solver in the correct sibling folder. Extract it and follow the root README; from integrable-kdv-collision/kdv-collision, the command is python3 experiment.py --check with the supplied NumPy dependency installed.

For inspection or individual downloads: collision experiment, inputs, saved results, requirements and notes, plus the shared one-soliton solver. Preserve sibling folders named kdv-collision and kdv; both programs retain their filename experiment.py.

With NumPy installed, a checkout uses:

Terminal window
python3 public/computations/kdv-collision/experiment.py --check

For separate downloads, run python3 computations/kdv-collision/experiment.py --check from above those folders. The notes give virtual-environment instructions. The recorded calculation uses Python 3.9.6, NumPy 2.0.2 and binary64 arithmetic; last digits can vary across platforms.

The check rejects changed inputs, reruns the independent checks and all refinements, and compares scientific outputs with the stated tolerances. It writes no files. Regenerating results requires the explicit --write option; routine site builds do not execute the solver.

Guided: check the field at maximum overlap

Section titled “Guided: check the field at maximum overlap”

For the stated parameters at t=0t=0, show that τ=(1+ex)3\tau=(1+e^x)^3 and derive u(x,0)u(x,0). Does that profile imply a single travelling soliton of inverse width 1/21/2?

Hint

Here eη1=3e2xe^{\eta_1}=3e^{2x} and eη2=3exe^{\eta_2}=3e^x. Differentiate 3log⁡(1+ex)3\log(1+e^x) twice. Compare the result with the amplitude–width relation for one soliton.

Solution

The mixed term is e3xe^{3x}, so τ=1+3ex+3e2x+e3x=(1+ex)3\tau=1+3e^x+3e^{2x}+e^{3x}=(1+e^x)^3. Hence

u(x,0)=6ex(1+ex)2=32sech⁡2(x/2).u(x,0)=\frac{6e^x}{(1+e^x)^2} =\frac32\operatorname{sech}^2(x/2).

A single soliton with κ=1/2\kappa=1/2 would have height 2κ2=1/22\kappa^2=1/2, not 3/23/2. This is an instantaneous collision profile. Its later evolution cannot be inferred by translating this shape rigidly.

Independent: diagnose the coarse calculation

Section titled “Independent: diagnose the coarse calculation”

A colleague accepts the N=128N=128 run because its largest invariant drift is below 6×10−116\times10^{-11}. Assess that decision using the recorded field errors. Which refinement addresses the dominant problem? Would reducing hh alone establish an accurate continuum solution?

Hint

Compare the first and last spatial rows, and distinguish conservation of the projected field from its agreement with the exact field.

Solution

The relative field errors reach 0.3220.322 and 0.3350.335, despite the small drift. The initial field and its evolution lack sufficient spatial resolution. Increasing NN at fixed hh reduces those errors to about 2.7×10−82.7\times10^{-8}, where time error becomes important. Reducing hh on the coarse grid mainly converges to its inaccurate finite-dimensional evolution. A continuum claim also needs spatial and boundary checks, with the actual norm and finite-time scope stated.

Transfer: request a more accurate phase shift

Section titled “Transfer: request a more accurate phase shift”

You need the fast soliton’s asymptotic shift to absolute accuracy 10−810^{-8}. Is the reference calculation at T=4T=4 enough? Propose a changed experiment using the exact endpoint-time evidence, and explain why simply extending the time on an unchanged small periodic box can fail.

Hint

Compare the fast numerical error with its finite-time bias. The fast pulse travels at speed 44.

Solution

No. Its numerical error is about 7.2×10−117.2\times10^{-11}, but the endpoint bias is about 1.18×10−61.18\times10^{-6}. The exact T=6T=6 bias is about 2.93×10−92.93\times10^{-9}, so those endpoints are a promising starting point. Recheck full-field errors, peak errors and the boundary mismatch for a numerical run over [−6,6][-6,6]; the existing run does not certify that new experiment.

At t=6t=6, the fast asymptotic center is near 24.5524.55. A box of length 4848 ends at 2424, so this pulse has reached the periodic seam. Increase the interval as needed while retaining spatial resolution, and refine the time step separately. A smaller time step alone removes neither finite-separation bias nor the wrong boundary problem.

  • Aktosun, Tuncay. “Inverse Scattering Transform and the Theory of Solitons.” In Encyclopedia of Complexity and Systems Science, Springer, 2009, pp. 4960–4971. DOI. Author version, arXiv:0905.4746v1, § IX, equations (9.1)–(9.3).
  • Kassam, Aly-Khan, and Lloyd N. Trefethen. “Fourth-order time-stepping for stiff PDEs.” SIAM Journal on Scientific Computing 26(4), 2005, pp. 1214–1233. DOI. Author PDF, pp. 1215–1216, equations (1.5)–(1.9).