Table of Contents
Fetching ...

A hands-on introduction to Physics-Informed Neural Networks for solving partial differential equations with benchmark tests taken from astrophysics and plasma physics

Hubert Baty

Abstract

I provide an introduction to the application of deep learning and neural networks for solving partial differential equations (PDEs). The approach, known as physics-informed neural networks (PINNs), involves minimizing the residual of the equation evaluated at various points within the domain. Boundary conditions are incorporated either by introducing soft constraints with corresponding boundary data values in the minimization process or by strictly enforcing the solution with hard constraints. PINNs are tested on diverse PDEs extracted from two-dimensional physical/astrophysical problems. Specifically, we explore Grad-Shafranov-like equations that capture magnetohydrodynamic equilibria in magnetically dominated plasmas. Lane-Emden equations that model internal structure of stars in sef-gravitating hydrostatic equilibrium are also considered. The flexibility of the method to handle various boundary conditions is illustrated through various examples, as well as its ease in solving parametric and inverse problems. The corresponding Python codes based on PyTorch/TensorFlow libraries are made available.

A hands-on introduction to Physics-Informed Neural Networks for solving partial differential equations with benchmark tests taken from astrophysics and plasma physics

Abstract

I provide an introduction to the application of deep learning and neural networks for solving partial differential equations (PDEs). The approach, known as physics-informed neural networks (PINNs), involves minimizing the residual of the equation evaluated at various points within the domain. Boundary conditions are incorporated either by introducing soft constraints with corresponding boundary data values in the minimization process or by strictly enforcing the solution with hard constraints. PINNs are tested on diverse PDEs extracted from two-dimensional physical/astrophysical problems. Specifically, we explore Grad-Shafranov-like equations that capture magnetohydrodynamic equilibria in magnetically dominated plasmas. Lane-Emden equations that model internal structure of stars in sef-gravitating hydrostatic equilibrium are also considered. The flexibility of the method to handle various boundary conditions is illustrated through various examples, as well as its ease in solving parametric and inverse problems. The corresponding Python codes based on PyTorch/TensorFlow libraries are made available.
Paper Structure (34 sections, 37 equations, 36 figures)

This paper contains 34 sections, 37 equations, 36 figures.

Figures (36)

  • Figure 1: Schematic representation of the structure for a Neural Network (NN) applied to a non-linear approximation problem. The input layer has two input variables (i.e. two neurons) for the two space coordinate variables $x$ and $y$. Three hidden layers with five neurons per layer are connected with the input and the output layer, where the latter has a single variable (one neuron) representing the predicted solution $u_\theta (x, y)$. The minimization procedure using the loss function $L_{data}(\theta)$ is obtained by comparing $u_\theta$ to a training data set of values $u^{data}$ taken in the 2D domain $\Omega$. In this simplified example, $\theta$ represents a total number of $81$ scalar parameters.
  • Figure 2: Schematic representation of the structure for a Physics-Informed Neural Network applied for solving a PDE associated to a 2D direct problem with Dirichlet-like BCs (soft constraints). The input layer has two input variables (i.e. two neurons) for the two space coordinate variables $x$ and $y$. Three hidden layers with five neurons per layer are connected with the input and the output layer, where the latter has a single variable (one neuron) representing the predicted solution $u_\theta (x, y)$. Automatic Differentiation (AD) is used in the procedure in order to evaluate the partial derivatives (i.e. $u_{x, \theta}$, $u_{xy \theta}$...) necessary to form the PDE loss function $L_{ PDE} (\theta)$. The loss function $L_{data}(\theta)$ is obtained with soft constraints (i.e. via the training data set) imposed on the boundary domain $\partial \Omega$.
  • Figure 3: Schematic representation variant of previous figure where Neumann or Neumann-Dirichlet BCs are involved instead of purely Dirichlet BCs. The training data set includes additional knowledge on the exact derivatives $u^{'data}$.
  • Figure 4: Schematic representation of a hard constraints BCs problem corresponding to previous figure (see text). The boundary constraints are enforced via trial function.
  • Figure 5: Schematic representation of an inverse problem. A 1D differential equation is considered (ODE in fact) parametrized with an unknown coefficient $\mu$ to be discovered. The training data set must include data from the whole domain $\Omega$ (not only at boundaries).
  • ...and 31 more figures