The 1D acoustic wave equation
Learning objectives
- State the 1D acoustic wave equation in the form a PINN can consume
- Construct the PINN loss with PDE + IC (position) + IC (velocity) + BC terms
- Train against a problem with a known analytic solution and measure relative-L²
- Recognise that the 4-term loss is the canonical seismic-PINN setup that scales to 2D and 3D
Part 0 built the neural-network toolkit. Parts 1–3 turned that toolkit into a PINN engine: residual-based loss, AD for derivatives, architecture survey, training pathologies. Part 4 puts seismology into the engine. Every section in this Part is a wave equation — the underlying physics of every seismic experiment, from a single hammer-blow on a road shoulder to a 4D Sleipner survey.
The 1D acoustic wave equation
The simplest wave equation in seismology is the 1D acoustic wave equation,
with the pressure perturbation (or the equivalent scalar wavefield in elastic settings under simplifying assumptions) and the wave-propagation speed. We drive the equation with an initial wavefield , an initial velocity , and boundary conditions on and .
For this section we pick the simplest non-trivial test case:
- Domain , .
- IC: .
- BC: (Dirichlet, "fixed walls").
- Speed : a slider parameter the widget exposes.
The exact solution is the standing-wave mode
which we will use as the ground-truth reference. The PINN never sees this analytic answer during training; it sees only the PDE residual and the IC/BC samples. The relative-L² error against the analytic solution is the only metric that does not lie.
The PINN loss
The training loss is a four-term sum:
where, with the network output,
- ,
- ,
- ,
- .
The four loss terms are weighted by NTK-balanced values (§3.3 machinery: residual-Jacobian Frobenius norm, EMA-smoothed, clamped to ). This is mandatory: with naive on all four terms, the IC-velocity loss (a second-order term in disguise, since it requires at ) takes over and the PDE residual stalls.
Try it
Pick a wave speed between 0.5 and 2.0 and click ▶ Train. The widget runs 2500 epochs, then reports:
- The four per-term loss curves on a log-scale.
- Three time-slice snapshots of at — full crest, zero crossing, full trough.
- A side-by-side spacetime heatmap of the predicted wavefield versus the analytic solution.
- Relative-L² error over the grid.
What you should observe
- For (the default) the PINN reaches relative-L² in the few-percent range. The standing wave is a low-frequency target (one spatial mode, one temporal mode); a small 2-32-32-1 Tanh MLP suffices.
- For the temporal frequency doubles ( vs ). Spectral bias enters: the same architecture either takes longer to converge or saturates at higher relative-L². This is the §0.9 / §2.2 problem reasserting itself in seismic clothing.
- The IC-position term decreases first (it is a pure regression target), then the BC term, then the PDE residual catches up. The IC-velocity term is the slowest because it depends on at , which the AD machinery has to expose to the gradient.
- The NTK-derived values stabilise within a few hundred epochs; without NTK weighting the PDE residual stalls at .
Why second-order time matters
The wave equation is second-order in time. That changes two things compared to the first-order parabolic problems (Burgers, advection) we met in earlier parts:
- The IC must specify both position and velocity. A first-order PDE needs only ; a wave equation needs AND . The PINN loss has an extra term, and the architecture must produce a clean at the boundary .
- The PDE residual involves . Forward-mode AD computes Hessian diagonals; the input means the diagonal has two entries: and . The PDE residual reads off both. Activation choice matters: Tanh is differentiable to all orders; ReLU dies at the second derivative. We are using Tanh.
From this widget to seismic-FWI
Real seismic forward modelling (and inverse problems built on top) replaces the toy IC with a Ricker wavelet source, replaces the Dirichlet BC with absorbing or PML BCs (§4.6, §4.7), goes from 1D to 2D or 3D, and uses spatially-varying as the medium of interest. The PINN loss structure remains the same four-term recipe; the per-term machinery is what gets heavier. Section 4.2 turns to 2D, where the same construction starts to show why FDTD remains competitive (Part 5) and where PINN pays off in the inverse setting (Part 6).
References
- Raissi, M., Perdikaris, P., Karniadakis, G.E. (2019). Physics-informed neural networks: a deep learning framework for solving forward and inverse problems. JCP 378.
- Rasht-Behesht, M., Huber, C., Shukla, K., Karniadakis, G.E. (2022). Physics-informed neural networks (PINNs) for wave propagation and full-waveform inversions. J. Geophys. Res. Solid Earth 127.
- Moseley, B., Markham, A., Nissen-Meyer, T. (2020). Solving the wave equation with physics-informed deep learning. arXiv:2006.11894.