Skip to content

Korteweg–de Vries

Soliton dynamics with third-order dispersion:

ut+uux+δ23ux3=0,δ=0.022,

with periodic boundaries and u(0,x)=cos(πx). The initial profile steepens and breaks into a train of interacting solitons.

Results

relative L2 error 1.5e-04recipe adaptive pseudo-time50k steps, single GPU

Adaptive pseudo-time stepping gives the best result on KdV: 1.5e-04 relative L2 error, about 2× better than the plain baseline (2.9e-04). The soliton train's fine dispersive structure is where the damping term helps — it suppresses the transient oscillations the optimizer otherwise chases during soliton fission. This example is also our cleanest optimizer comparison: swapping SOAP for Adam at identical settings costs 8× (2.2e-03) — see the SOAP deep-dive.

KdV prediction vs reference

Reference, PINN prediction, and absolute error across soliton fission and interaction.

KdV convergence

Training losses and relative L2 error of the showcase (pseudo-time) run.

Run

bash
cd examples/kdv
python3 main.py --config=configs/pseudo_time.py
ConfigDescription
configs/baseline.pyPirateNet + causal weighting
configs/pseudo_time.pyAdaptive pseudo-time stepping (showcase)
configs/fixed_pseudo_time.pyConstant pseudo-time weights

Notes

  • Third derivatives are computed with Taylor-mode automatic differentiation (jax.experimental.jet), which is much cheaper than nesting grad three times.

Released under the Apache 2.0 License.