Skip to content

Integrating-factor and exponential Runge–Kutta methods for KdV

KdV’s highest Fourier modes have linear frequencies proportional to k3k^3. Treating that part exactly still leaves a nonlinear term to approximate. An exact periodic traveling wave lets us measure fourth-order time convergence, then check the phase change caused by adding a constant to the initial field. A perturbed wave gives a second test without an exact waveform. The Korteweg–de Vries equation is named for the paper that derived it in 1895 for long waves in a shallow canal. Korteweg and de Vries (1895)

Required background. Fourier products in KdV describes the dealiased quadratic projection. Use the same spatial grid and nonlinear product at every temporal refinement.

Use ut+6uux+uxxx=0u_t+6uu_x+u_{xxx}=0 with periodic data. In the Fourier convention u(x)=∑kvkeikxu(x)=\sum_k v_k e^{ikx} write v˙=Lv+N(v)\dot v=Lv+N(v) with Lk=ik3L_k=ik^3 and Nk=−3ik u2^kN_k=-3ik\,\widehat{u^2}_k. On a step beginning at tnt_n, w(s)=e−sLv(tn+s)w(s)=e^{-sL}v(t_n+s) satisfies w′=F(s,w)=e−sLN(esLw)w'=F(s,w)=e^{-sL}N(e^{sL}w). Evaluate classical RK4 on FF at s=0,h/2,h/2,hs=0,h/2,h/2,h, starting with w(0)=v(tn)w(0)=v(t_n), then multiply its output by ehLe^{hL}. This is the integrating-factor scheme in the single-pulse benchmark. Kassam and Trefethen, pp. 1215–1216, equations (1.5)–(1.9), PDF · Single-pulse benchmark (ZIP)

For exponential time differencing set z=hLz=hL, E=ezE=e^z, E2=ez/2E_2=e^{z/2} and φj(z)=∑ℓ≥0zℓ/(ℓ+j)!\varphi_j(z)=\sum_{\ell\ge0}z^\ell/(\ell+j)!. Define Q=(h/2)φ1(z/2)Q=(h/2)\varphi_1(z/2) and form

a=E2v+QN(v),b=E2v+QN(a),c=E2a+Q[2N(b)−N(v)]. \begin{aligned} a&=E_2v+Q N(v),& b&=E_2v+Q N(a),\\ c&=E_2a+Q[2N(b)-N(v)] . \end{aligned}

With all φj\varphi_j below evaluated at zz, use

f1=h(φ1−3φ2+4φ3),f2=h(φ2−2φ3),f3=h(4φ3−φ2),v′=Ev+f1N(v)+2f2[N(a)+N(b)]+f3N(c). \begin{aligned} f_1&=h(\varphi_1-3\varphi_2+4\varphi_3),\\ f_2&=h(\varphi_2-2\varphi_3),\qquad f_3=h(4\varphi_3-\varphi_2),\\ v'&=Ev+f_1N(v)+2f_2[N(a)+N(b)]+f_3N(c). \end{aligned}

At z=0z=0 the limits φj(0)=1/j!\varphi_j(0)=1/j! give Q=h/2Q=h/2 and f1=f2=f3=h/6f_1=f_2=f_3=h/6, the classical RK4 weights with the displayed factors of two. Direct subtraction in the quotient definitions of the φj\varphi_j can lose precision near zero. The companion averages the analytic coefficients at 48 equally spaced midpoints on a full unit circle about each zz. For imaginary KdV eigenvalues the coefficients have physical imaginary parts. Taking their real parts as one might for a real diffusion symbol changes the method. Kassam and Trefethen, §2, ETDRK4 stages and contour formula (2.6), pp. 1218–1220, PDF

For m=0.8m=0.8, period 2K(m)2K(m) and 96 Fourier nodes, take u(x,t)=2m cn2(x−ct∣m)u(x,t)=2m\,\mathrm{cn}^2(x-ct\mid m), c=4(2m−1)c=4(2m-1). In these formulas mm is the elliptic parameter. The Jacobi identities give uxx=4m(1−m)+cu−3u2u_{xx}=4m(1-m)+c u-3u^2. Differentiation verifies KdV and the exact speed. Unlike cutting a line soliton off in a finite box, this profile and all its derivatives match across the seam.

At final time 0.20.2, use three-halves padding in every nonlinear stage. Compare discrete ℓ2\ell^2 error relative to the reference norm. Let k1=π/K(m)k_1=\pi/K(m) be the fundamental wave number. For a second test add 0.06cos⁡(2k1x)0.06\cos(2k_1 x) to the initial field. Its reference uses the same spatial discretization and 2048 time steps.

Time stepsExact traveling wavePerturbed field
321.16×10−61.16\times10^{-6}8.49×10−68.49\times10^{-6}
645.89×10−85.89\times10^{-8}5.71×10−75.71\times10^{-7}
1283.66×10−93.66\times10^{-9}3.66×10−83.66\times10^{-8}
2562.29×10−102.29\times10^{-10}2.30×10−92.30\times10^{-9}

In the last refinement the error ratios are about 16 on both fields. The 1024- and 2048-step perturbed references differ by less than 1.5×10−111.5\times10^{-11} in maximum absolute nodal value. This comparison tests the step at fixed spatial resolution and time. Resolving a radiating solution on the line also calls for enlarging the domain and refining its modes. Run the periodic refinements (Python)

Although N0=0N_0=0 fixes the mean at every step, that mean enters the product at every nonzero mode. If uu solves KdV, then ub(x,t)=b+u(x−6bt,t)u_b(x,t)=b+u(x-6bt,t) also solves it. The extra −6bux-6b u_x from the time derivative cancels 6bux6b u_x from the nonlinear term. Thus adding bb at time zero changes the phase of each nonzero coefficient by −6kbt-6kbt. In the coefficient-one convention of Angulo Pava, Bona and Scialom the field is 6u6u and their boost parameter is γ=−6b\gamma=-6b. Angulo Pava, Bona and Scialom, p. 1326, equations (3.2)–(3.3), author PDF

Add b=1/4b=1/4 to the cnoidal wave above. At t=0.2t=0.2 the expected additional displacement is 0.30.3. Compare the first Fourier coefficients of the boosted and original numerical fields through their ratio r=vb,k1/vk1r=v_{b,k_1}/v_{k_1}. The displacement −arg⁡(r)/k1-\arg(r)/k_1 is unambiguous here because 0.30.3 is less than half a period. At 48 nodes and 1024 steps the measured displacement is 0.2999999999990.299999999999. Simply adding bb back to an evolved unboosted field would reproduce the mean and give zero additional displacement.

The exact boosted profile also allows a spatial refinement at fixed time step. Normalize the nodal ℓ2\ell^2 field error by the norm of the exact wave after subtracting the added background. At 1024 steps, grids of 12, 16, 24 and 32 points give 5.20×10−55.20\times10^{-5}, 5.13×10−75.13\times10^{-7}, 9.08×10−119.08\times10^{-11} and 1.98×10−121.98\times10^{-12}. Increasing the grid to 48 points leaves the last value unchanged to three significant digits. At 48 points, doubling the time steps reduces it to 1.23×10−131.23\times10^{-13}. This attributes the plateau to time stepping at the stated resolution. Run the background, phase and resolution checks (Python)

Measure the displaced pulses as well as the field

Section titled “Measure the displaced pulses as well as the field”

In the independent two-soliton benchmark, ut+6uux+uxxx=0u_t+6uu_x+u_{xxx}=0, κ1=1,κ2=1/2\kappa_1=1,\kappa_2=1/2 and the exact solution is restricted to a periodic interval of length 8080. At t=−4t=-4 and +4+4 identify the two separated peaks by their respective velocities 4κj24\kappa_j^2. Refine each peak position on the Fourier interpolant and subtract the free flight 4κj2(8)4\kappa_j^2(8) between the endpoints. The 768-point, 51,200-step reference gives displacements 1.09861110611.0986111061 and −2.1972245770-2.1972245770. Against the exact peaks at the same finite times, the errors are −7.2×10−11-7.2\times10^{-11} and −8.6×10−12-8.6\times10^{-12} in position units. Over nine checkpoints the maximum relative field L2L^2 error is 6.1×10−116.1\times10^{-11}. The first displacement still differs from its infinite-separation value log⁡3\log3 by about 1.18×10−61.18\times10^{-6} because the slower pulse’s tail remains at the observation planes. Shrinking the numerical time step cannot remove this finite-window bias. Comparison inputs · Benchmark procedure · Recorded results

  • D. J. Korteweg and G. de Vries, “On the change of form of long waves advancing in a rectangular canal, and on a new type of long stationary waves,” The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science 39 (1895), 422–443. DOI
  • Angulo Pava, J., J. L. Bona, and M. Scialom (2006). “Stability of cnoidal waves.” Advances in Differential Equations 11 (12), 1321–1374. Author PDF.
  • Kassam, A.-K., and L. N. Trefethen (2005). “Fourth-order time-stepping for stiff PDEs.” SIAM Journal on Scientific Computing 26, 1214–1233. DOI.