Solve Burgers Equation with PhysicsNeMo

Train a neural network to satisfy a PDE — no simulation mesh required.

Undergraduate Computational Physics 3–5 weeks
Last reviewed: March 2026

Overview

Physics-Informed Neural Networks (PINNs) are a class of machine learning models that embed physical laws — expressed as partial differential equations — directly into the loss function used to train a neural network. Rather than requiring a computational mesh, PINNs evaluate the PDE residual at a set of collocation points scattered through the domain, making them particularly attractive for irregular geometries, inverse problems, and situations where data and physics must be jointly satisfied.

The 1D viscous Burgers equation is the ideal starting problem for learning PINNs. It combines nonlinear convection with viscous diffusion and produces shock-like solutions at low viscosity — features that challenge classical numerical methods. NVIDIA PhysicsNeMo provides a high-level Python API for defining PINN problems, sampling collocation points, constructing composite losses (PDE residual + boundary conditions + initial conditions), and training on GPU with automatic differentiation. Working through the Burgers problem in PhysicsNeMo gives you a reusable template for harder aerospace PDEs like the Euler or RANS equations.

This project is foundational for anyone interested in scientific machine learning, computational aerodynamics, or digital engineering. The PhysicsNeMo framework is increasingly used in industry for thermal, structural, and fluid simulations where classical solvers are too slow for real-time digital twin applications, making this skill directly employable at companies like NVIDIA, aerospace OEMs, and simulation software vendors.

What You'll Learn

  • Formulate a PINN loss function combining PDE residual, boundary condition, and initial condition terms
  • Use NVIDIA PhysicsNeMo to define geometry, sample collocation points, and train a PINN
  • Monitor PINN training convergence and diagnose common failure modes (gradient pathology, point starvation)
  • Compare PINN solutions against a finite-difference reference solver and quantify L2 error
  • Extend a trained PINN to an inverse problem: inferring the viscosity parameter from sparse observations

Step-by-Step Guide

1

Derive the Burgers PINN loss formulation

Write out the 1D viscous Burgers equation (∂u/∂t + u·∂u/∂x = ν·∂²u/∂x²) and identify the three loss components: PDE residual at interior collocation points, initial condition (sinusoidal IC), and Dirichlet boundary conditions at x=0 and x=1. Document the expected behaviour at different viscosity values (ν = 0.01, 0.1) including shock formation at low ν.

2

Set up the PhysicsNeMo project

Install PhysicsNeMo and its dependencies. Define the 1D space-time domain (x ∈ [0,1], t ∈ [0,1]) using a PointwiseGeometry object. Sample 10,000 interior collocation points using Latin hypercube sampling, 200 boundary points, and 200 initial condition points. Visualise the point distribution to confirm adequate coverage.

3

Define and train the PINN model

Construct a fully connected network (4 hidden layers, 64 neurons each, tanh activation) that maps (x, t) → u. Define PhysicsNeMo Equation objects for the Burgers PDE using automatic differentiation. Assemble a Solver with Adam optimiser (lr=1e-3) and train for 20,000 iterations, logging the component losses separately to monitor balance.

4

Implement a finite-difference reference solver

Write a simple explicit finite-difference solver for the Burgers equation using Lax–Wendroff or Crank–Nicolson scheme on a 256-point grid. Generate the reference solution for the same initial and boundary conditions used to train the PINN. Ensure your FD solver is stable (CFL condition satisfied) before using it as ground truth.

5

Compare and visualise results

Evaluate the trained PINN on a dense (x,t) grid and plot the solution as a space-time heatmap. Overlay PINN and FD solutions at t = 0.25, 0.5, 0.75, and 1.0. Compute the global L2 error and identify where the PINN deviates most (typically near shock formation). Experiment with increasing collocation points in the shock region and report the improvement.

6

Solve the inverse problem: infer viscosity from data

Treat ν as a learnable parameter initialised at 0.5 (far from the true value of 0.01). Add 50 sparse "measurement" points sampled from the FD reference solution as a data fidelity term in the loss. Retrain and plot the convergence of ν toward its true value alongside the loss curves. Discuss what makes the inverse PINN well- or ill-conditioned.

Go Further

  • Extend the PINN to the 2D Burgers equation and compare training time and accuracy as domain complexity grows.
  • Implement adaptive collocation point refinement: add points automatically in regions where the PDE residual is highest after each training phase.
  • Use PhysicsNeMo's geometry module to define a non-rectangular domain (e.g., a channel with a bump) and solve the 2D Burgers equation in it.
  • Compare the PINN solution against an OpenFOAM finite-volume solver for the same case and quantify the trade-off between setup time and accuracy.