The 2D acoustic wave equation

Part 4 — Wave equations in PINN form

Learning objectives

  • Generalise the 1D PINN of §4.1 to the 2D acoustic wave equation
  • Train a PINN with 3D input (x, z, t) and Hessian-diagonal AD on three coordinates
  • Verify the 2D standing-wave eigenmode against the analytic solution
  • See where the compute cost grows: same recipe as 1D, but ~3× heavier per epoch

The 2D acoustic wave equation,

2ut2(x,z,t)  =  c2(2ux2+2uz2),\frac{\partial^2 u}{\partial t^2}(x, z, t) \;=\; c^2 \left( \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial z^2} \right) ,

is the underlying physics of every 2D seismic shot record. The PINN has three inputs (x,z,tx, z, t) instead of two, and the PDE residual involves three Hessian-diagonal entries (uxx,uzz,uttu_{xx}, u_{zz}, u_{tt}). The IC and BC bookkeeping is otherwise identical to §4.1.

Setup

To get a clean analytic solution we use the 2D analogue of §4.1's separable mode:

  • Domain (x,z)[1,1]2, t[0,1](x, z) \in [-1, 1]^2,\ t \in [0, 1].
  • IC: u(x,z,0)=sin(πx)sin(πz),ut(x,z,0)=0u(x, z, 0) = \sin(\pi x) \sin(\pi z), \quad u_t(x, z, 0) = 0.
  • BC: u=0u = 0 on all four edges.

Because sin(πx)sin(πz)\sin(\pi x) \sin(\pi z) is an eigenmode of the Laplacian with eigenvalue 2π2-2 \pi^2, the exact solution is

u(x,z,t)=sin(πx)sin(πz)cos(π2ct),u(x, z, t) = \sin(\pi x) \sin(\pi z) \, \cos(\pi \sqrt{2}\, c \, t) ,

which oscillates uniformly across the domain at angular frequency cπ2c \pi \sqrt{2}. The temporal frequency is 2\sqrt{2} times higher than the 1D case at the same cc.

The compute budget

Going from 1D to 2D triples the per-point AD cost (3 input dimensions instead of 2). To stay tractable in-browser we use a smaller collocation grid: 8 × 8 × 6 = 384 PDE points, 36 IC points, ~96 BC points. With 1500 epochs of 4-term NTK-balanced training, the run takes ~2–3 minutes. Production seismic-PINN papers (Rasht-Behesht 2022, Moseley 2020) use 10⁴–10⁵ collocation points and run on a GPU for hours; the recipe scales but the wall-clock cost grows roughly linearly with Nc×epochsN_c \times \textrm{epochs}.

Try it

Wave 2dInteractive figure — enable JavaScript to interact.

What you should observe

  • For c=1.0c = 1.0 the PINN reaches relative-L² of ~10–15% in the browser-feasible compute budget. The IC and BC terms are tight (104\sim 10^{-4}); the PDE residual is what bottlenecks the spacetime accuracy. This is the 2D-vs-1D lesson: the same recipe scales but at quadratic compute cost, and the in-browser budget is not enough to drive PDE residual to the 10210^{-2} level §4.1 reaches in 1D.
  • For c=1.5c = 1.5 the temporal frequency reaches 1.5π26.661.5 \pi \sqrt{2} \approx 6.66, putting ~1.06 cycles inside [0,1][0, 1]. Spectral-bias error grows; relative-L² climbs into the 20–30% range. Production codes (Rasht-Behesht 2022) use Fourier features (§2.2) and 10× more colloc points to handle higher temporal frequencies.
  • The IC-velocity term ut(x,z,0)=0u_t(x, z, 0) = 0 is the slowest to converge initially, because it depends on tuθ\partial_t u_\theta at a 2D boundary surface. NTK rebalancing is what eventually drives it down.
  • The PINN and analytic spacetime fields differ visibly only at the late-time crests where the temporal frequency stresses the network width. Time-zero and the first peak match cleanly.

From the eigenmode toy to the real shot record

The eigenmode test is pedagogical, not realistic. A real 2D seismic forward model has:

  • A localised source term (Ricker wavelet) on the right-hand side of the wave equation, not just an initial condition. The PINN PDE residual gains a source term: uttc2(uxx+uzz)f(x,z,t)=0u_{tt} - c^2 (u_{xx} + u_{zz}) - f(x, z, t) = 0.
  • A spatially-varying velocity field c(x,z)c(x, z) — the medium being imaged. For the forward problem this is a fixed input to the PDE; for the inverse problem (Part 6) it becomes another trainable network.
  • Boundary conditions tailored to a half-space: a free surface at z=0z = 0 (§4.5) and absorbing/PML boundaries on the other three sides (§4.6, §4.7).

All of these change the residuals in the PINN loss, not the structure of the loss itself. The 4-term NTK-balanced recipe is robust to these changes; it is the same recipe Moseley et al. (2020) used for the original wave-equation PINN paper.

References

  • Moseley, B., Markham, A., Nissen-Meyer, T. (2020). Solving the wave equation with physics-informed deep learning. arXiv:2006.11894.
  • Rasht-Behesht, M., Huber, C., Shukla, K., Karniadakis, G.E. (2022). Physics-informed neural networks (PINNs) for wave propagation and full-waveform inversions. JGR Solid Earth 127, e2021JB023120.

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.