Skip to content

Allen–Cahn

Phase separation with a stiff double-well reaction term:

ut1042ux2+5u35u=0,(t,x)[0,1]×[1,1],

with periodic boundary conditions and u(0,x)=x2cos(πx). Sharp transition layers form early and persist — a classic hard case for vanilla PINNs.

Results

relative L2 error 4.0e-06recipe baseline (PirateNet + SOAP + grad-norm balancing + causal)100k steps, single GPU

The standard JAXPI recipe solves Allen–Cahn to machine-practical accuracy: the trained network matches the reference to a relative L2 error of 4.0e-06, with the absolute error concentrated in thin bands around the transition layers and three orders of magnitude below the solution scale. Historically this benchmark is where PINNs collapse to the trivial equilibrium without causal weighting; interestingly, our experiments show the modern stack is so robust here that disabling causal weighting barely matters (4.6e-06) — the remaining ingredients compensate. Adaptive pseudo-time stepping is equally harmless (4.1e-06) but unnecessary.

Allen-Cahn prediction vs reference

Reference, PINN prediction, and absolute error over the full space-time domain.

Allen-Cahn convergence

Training losses and relative L2 error of the showcase run.

Run

bash
cd examples/allen_cahn
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.