Skip to content

Advection

1D linear transport of a periodic profile at high speed — the classic sanity check for causal PINN training, since the solution must propagate strictly forward in time:

ut+cux=0,c=30,(t,x)[0,2]×[0,2π],

with periodic boundary conditions and u(0,x)=sinx. The exact solution u(t,x)=sin(xct) is used as the reference.

Results

relative L2 error 4.3e-02recipe baseline + causal tol 0.01100k steps, single GPU

Fast transport turns out to hinge on one hyperparameter: the causal tolerance. With the default tol = 1.0, the large residuals of high-speed advection drive every causal gate to zero — only the earliest sliver of time ever trains, the initial condition is fit perfectly, and the rest of the domain is garbage (relative L2 error stuck at ~0.8-0.9 across every architecture and embedding we tried). Relaxing the tolerance to tol = 0.01 (now the config default, with 32 chunks) lets the causal front actually sweep the domain and the same network reaches 4.3e-02, with the error growing gently along the transport direction. A cautionary counterexample: increasing the Fourier embedding scale to "help" the fast dynamics made things worse (0.38) — the fix was in the training schedule, not the representation.

Advection prediction vs reference

Reference, PINN prediction, and absolute error; the transported profile stays phase-locked across the full horizon.

Advection convergence

Training losses and relative L2 error of the showcase run.

Run

bash
cd examples/advection
python3 main.py --config=configs/baseline.py
ConfigDescription
configs/baseline.pyPirateNet + causal weighting
configs/plain.pyMinimal MLP + Adam, no bells and whistles
configs/pseudo_time.pyAdaptive pseudo-time stepping
configs/fixed_pseudo_time.pyConstant pseudo-time weights

Notes

  • Exact periodicity is enforced through PeriodEmbs on the spatial axis, so no boundary loss is needed.
  • The high advection speed makes plain PINN training collapse to trivial solutions; causal weighting fixes this (see Training Techniques).
  • The advection speed is configurable: --config.problem.c=....

Released under the Apache 2.0 License.