Korteweg–de Vries
Intuition
Section titled “Intuition”Shallow water has a rule: taller waves move faster. A hump therefore steepens at its front, like a wave about to break on a beach. But shallow water also has dispersion, which spreads a hump out. The Korteweg–de Vries equation is the simplest model that contains both effects, and it has an exact hump shape where they cancel perfectly.
Notice the shape never changes and the speed is constant. Taller solitons are narrower and faster. That is not a coincidence. Height, width and speed are locked together by one parameter.
Now watch two of them meet.
The fast one catches the slow one, they merge into a single hump for a moment, and then both reappear exactly as before. The only trace of the collision is that the fast soliton is a little ahead of where it would have been, and the slow one is a little behind.
What if you start with a shape that is not a soliton?
The bump sorts itself into a line of solitons, tallest first, leaving behind a small ripple that spreads away. The number and heights of the solitons that come out are determined by the initial shape alone. That is the inverse scattering transform at work.
The mathematics
Section titled “The mathematics”The equation, in the normalisation this engine uses, is
The term is the nonlinear steepening and is the dispersion. Look for a travelling wave and you find the single-soliton solution
One parameter, the speed , fixes the amplitude and the width .
The equation has infinitely many conserved quantities. The engine tracks the first three:
| Name | Expression |
|---|---|
| Mass | |
| Momentum | |
| Energy |
The energy is the Hamiltonian that generates the flow, .
The numerics
Section titled “The numerics”On a periodic domain the engine writes the equation as with
In Fourier space is just a number for each wavenumber, so the linear part is handled exactly. The nonlinear part is computed in physical space and transformed back. This is the pseudo-spectral method. Time stepping uses ETDRK4, which treats the stiff dispersive term exactly and the nonlinear term to fourth order.
Validation
Section titled “Validation”| Test | Setup | Result |
|---|---|---|
| Single soliton | , , , , | max error |
| Two solitons | and , 8000 steps | invariant drift below |
| Collision | and | fast soliton amplitude restored to within |
Source: crates/soliton-core/src/equations/kdv.rs
and its tests.