1D Burgers' equation, end to end

Part 1, The PINN formulation

Learning objectives

  • Write Burgers' equation with its initial and boundary conditions as one loss of three terms, and train a network on it
  • Score the trained network against the exact Cole-Hopf solution, a reference not taken from the network
  • Read where the error gathers, at the front the small viscosity steepens, and why a low loss at the collocation points does not prevent it
  • Say why the book keeps this one benchmark that is not seismology

The Recipe, End to End

A physics-informed network is the residual of its equation and each of its conditions written as terms of one loss, trained, and scored against a solution that is not the network. Burgers' equation shows it end to end: nonlinear, with a front that its small viscosity steepens into a near-shock, and an exact solution by the Cole-Hopf transform. The book's network of 921 parameters is 0.28 from Cole-Hopf in relative L2 over the whole of xx and tt; up to t=0.25t = 0.25 it is within 0.02 of it, and at t=1.00t = 1.00 its error is 0.69, nearly all of it at the front.

Burgers Against Cole HopfInteractive figure, enable JavaScript to interact.

Why Burgers' Equation

This is the book's one benchmark that is not seismology and not the Marmousi2 window, and it is dimensionless. It is kept because its answer is known exactly: every claim about the network can be scored against a formula, and the formula is checked here by a second quadrature. The wave equation on the column has no such formula; it is scored against finite differences instead (Sections 1.1, 1.2 and 1.4).

The Problem and the Loss

ut+u ux=ν uxx,x∈[βˆ’1,1],Β t∈[0,1],u(x,0)=βˆ’sin⁑πx,u(Β±1,t)=0,u_t + u\,u_x = \nu\,u_{xx}, \qquad x \in [-1, 1],\ t \in [0, 1], \qquad u(x, 0) = -\sin \pi x, \qquad u(\pm 1, t) = 0,

with Ξ½=0.01/Ο€\nu = 0.01/\pi. The initial sine steepens as its two halves run into each other at x=0x = 0, until the viscosity holds the front at a width of the order of Ξ½\nu. The loss has three terms, each a mean square at its own points: the residual ut+uuxβˆ’Ξ½uxxu_t + u u_x - \nu u_{xx} at 1000 collocation points drawn by the book's generator, 101 points on the initial line and 51 on each end, every term weighted 1:

β„’(ΞΈ)=1Kβˆ‘k(ut+u uxβˆ’Ξ½β€‰uxx)2+1Iβˆ‘i(u(xi,0)+sin⁑πxi)2+1Bβˆ‘bu(Β±1,tb)2.\mathcal L(\theta) = \frac1K \sum_k \big(u_t + u\,u_x - \nu\,u_{xx}\big)^2 + \frac1I \sum_i \big(u(x_i, 0) + \sin \pi x_i\big)^2 + \frac1B \sum_b u(\pm 1, t_b)^2.

The network has three hidden layers of 20 tanh units, 921 parameters, and the book's build trains it by 4000 L-BFGS steps from the seed's network, with a memory of 50 and a strong Wolfe line search, and replays it here.

The Reference

The Cole-Hopf transform u=βˆ’2ν ϕx/Ο•u = -2\nu\,\phi_x/\phi turns Burgers' equation into the heat equation for Ο•\phi, whose solution is an integral of the initial data against a Gaussian. The book evaluates it by the trapezoid rule on a 201 by 51 grid with 401 nodes, over a range of the integration variable wide enough for the front; the gate evaluates it again by Simpson's rule in another variable, and checks that it solves the equation. The reference is never taken from the network.

Where the Error Is

After 1000 steps the network is 0.28 from Cole-Hopf, and after 4000, 0.28, while its loss falls from 0.0023 to 0.00021. At the worst time its largest difference there, 1.466 at x=βˆ’0.05x = βˆ’0.05, is the front itself, placed or shaped wrong. The loss is the residual at the collocation points, and the front, narrower than the spacing of the collocation points, falls between them: a network can drive the residual down at every point it is asked about and still be wrong between them. A low loss is not a low error, which is why the reference is scored and not the loss. Raissi, Perdikaris and Karniadakis (2017) introduced physics-informed networks for nonlinear partial differential equations; the book's network is small, its points few and its training short, all chosen for a build of minutes.

What Comes Next

Section 1.4 returns to the Marmousi2 column and asks what a soft initial or boundary term holds, and what it does not.

References

  • Raissi, M., Perdikaris, P. and Karniadakis, G. E. (2017). Physics informed deep learning (Part I): data-driven solutions of nonlinear partial differential equations. arXiv:1711.10561.

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