Skip to content

Wave

Second-order wave equation with a two-mode standing-wave solution:

2ut2=c22ux2,c=2,(t,x)[0,1]×[0,1],

with u(0,x)=sin(πx)+asin(2πx), ut(0,x)=0, and homogeneous Dirichlet boundaries. Both the displacement and velocity initial conditions enter the loss.

Results

relative L2 error 1.2e-05recipe baseline (dynamic grad-norm weighting essential)100k steps, single GPU

The baseline recipe reproduces the standing wave to a relative L2 error of 1.2e-05. What makes this example instructive is why: the wave equation's three loss terms (displacement IC, velocity IC, residual) have wildly different gradient scales, and our experiments show that freezing the loss weights at constant values degrades the error by more than three orders of magnitude (to 2.6e-02) — the largest single-ingredient effect we measured anywhere in the suite. Grad-norm balancing, not the architecture or the optimizer, is what carries this problem.

Wave prediction vs reference

Reference, PINN prediction, and absolute error.

Wave convergence

Training losses and relative L2 error of the showcase run.

Run

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

Notes

Released under the Apache 2.0 License.