2D smooth velocity: PINN vs FDTD
Learning objectives
- Race a PINN against a same-problem FDTD reference and measure both
- Quantify the wall-clock cost overhead of PINN vs FDTD for forward modelling
- See that PINN takes 100–1000× longer AND produces less accurate output
- Internalise the §5 verdict: forward PINN loses to FDTD on every metric
§5.1 verified the PINN against an analytic answer in 1D. Now we step to 2D and compare two solvers running the same forward problem: PINN (the §4.2 recipe) and FDTD (2nd-order central differences, the textbook classical approach).
The setup
Solve on . Smooth velocity field — slow on top, fast on bottom, smoothly varying. Initial pulse , . Closed-box BCs.
The two solvers
- FDTD: 2nd-order central differences, 60×60 spatial × ~120 time steps (chosen by CFL stability). Implementation lives in
fdtd-utils.js; the entire 2D solve is ~30 lines of JavaScript. Treated as ground truth at this resolution — , well below the dominant pulse wavelength . - PINN: 3-48-48-1 Tanh, 384 PDE collocation points, 1500 epochs of NTK-balanced training. The §4.2 recipe.
Try it
What you should observe
- FDTD finishes in – ms.
- PINN takes minutes — a wall-clock cost ratio of roughly .
- The PINN's relative-L² against the FDTD ground truth is typically –. So PINN is also less accurate.
- Side-by-side wavefield snapshots at and : FDTD shows a clean propagating pulse; PINN shows a smeared version with visible amplitude errors at the wavefront.
The unambiguous verdict
For a single 2D forward run on a fixed velocity, FDTD wins on cost (1000×) AND on accuracy. The same conclusion holds in 1D and 3D, on Marmousi and Sleipner velocity fields, and across the full range of seismic frequencies. There is no PINN tuning that closes this gap — at this problem class.
This is not a knock on PINN. It is a recognition that PINN is the wrong tool for forward modelling. The right tool is FDTD (or one of its modern relatives: pseudospectral, finite-volume, discontinuous-Galerkin). PINN's actual value lies elsewhere — the inverse setting, where the unknown is the velocity field itself and FDTD has nothing useful to say (Part 6).
References
- Yee, K.S. (1966). Numerical solution of initial boundary value problems involving Maxwell's equations in isotropic media. IEEE Trans. Antennas. The original FDTD paper.
- Virieux, J. (1986). P-SV wave propagation in heterogeneous media: Velocity-stress finite-difference method. Geophysics 51(4). Standard reference for elastic FDTD.
- Devito (Louboutin et al. 2019). Devito: an embedded domain-specific language for finite differences and geophysical exploration. Modern open-source seismic FDTD framework.