### Authors

Maziar Raissi, Paris Perdikaris, and George Em Karniadakis

### Abstract

We introduce physics informed neural networks – neural networks that are trained to solve supervised learning tasks while respecting any given law of physics described by general nonlinear partial differential equations. We present our developments in the context of solving two main classes of problems: data-driven solution and data-driven discovery of partial differential equations. Depending on the nature and arrangement of the available data, we devise two distinct classes of algorithms, namely continuous time and discrete time models. The resulting neural networks form a new class of data-efficient universal function approximators that naturally encode any underlying physical laws as prior information. In the first part, we demonstrate how these networks can be used to infer solutions to partial differential equations, and obtain physics-informed surrogate models that are fully differentiable with respect to all input coordinates and free parameters. In the second part, we focus on the problem of data-driven discovery of partial differential equations.

### Data-driven Solutions of Nonlinear Partial Differential Equations

In this first part of our two-part treatise, we focus on computing data-driven solutions to partial differential equations of the general form

where denotes the latent (hidden) solution, is a nonlinear differential operator, and is a subset of . In what follows, we put forth two distinct classes of algorithms, namely continuous and discrete time models, and highlight their properties and performance through the lens of different benchmark problems. All code and data-sets are available here.

#### Continuous Time Models

We define to be given by

and proceed by approximating by a deep neural network. This assumption results in a physics informed neural network . This network can be derived by the calculus on computational graphs: Backpropagation.

**Example (Burgers’ Equation)**

As an example, let us consider the Burgers’ equation. In one space dimension, the Burger’s equation along with Dirichlet boundary conditions reads as

Let us define to be given by

and proceed by approximating by a deep neural network. To highlight the simplicity in implementing this idea let us include a Python code snippet using Tensorflow. To this end, can be simply defined as

```
def u(t, x):
u = neural_net(tf.concat([t,x],1), weights, biases)
return u
```

Correspondingly, the physics informed neural network takes the form

```
def f(t, x):
u = u(t, x)
u_t = tf.gradients(u, t)[0]
u_x = tf.gradients(u, x)[0]
u_xx = tf.gradients(u_x, x)[0]
f = u_t + u*u_x - (0.01/tf.pi)*u_xx
return f
```

The shared parameters between the neural networks and can be learned by minimizing the mean squared error loss

where

and

Here, denote the initial and boundary training data on and specify the collocations points for . The loss corresponds to the initial and boundary data while enforces the structure imposed by the Burgers’ equation at a finite set of collocation points.

The following figure summarizes our results for the data-driven solution of the Burgers’ equation.

Burgers’ equation:Top:Predicted solution along with the initial and boundary training data. In addition we are using 10,000 collocation points generated using a Latin Hypercube Sampling strategy.Bottom:Comparison of the predicted and exact solutions corresponding to the three temporal snapshots depicted by the white vertical lines in the top panel. Model training took approximately 60 seconds on a single NVIDIA Titan X GPU card.

**Example (Shrödinger Equation)**

This example aims to highlight the ability of our method to handle periodic boundary conditions, complex-valued solutions, as well as different types of nonlinearities in the governing partial differential equations. The nonlinear Schrödinger equation along with periodic boundary conditions is given by

where is the complex-valued solution. Let us define to be given by

and proceed by placing a complex-valued neural network prior on . In fact, if denotes the real part of and is the imaginary part, we are placing a multi-out neural network prior on . This will result in the complex-valued (multi-output) physic informed neural network . The shared parameters of the neural networks and can be learned by minimizing the mean squared error loss

where

and

Here, denotes the initial data, corresponds to the collocation points on the boundary, and represents the collocation points on . Consequently, corresponds to the loss on the initial data, enforces the periodic boundary conditions, and penalizes the Schrödinger equation not being satisfied on the collocation points.

The following figure summarizes the results of our experiment.

Shrödinger equation:Top:Predicted solution along with the initial and boundary training data. In addition we are using 20,000 collocation points generated using a Latin Hypercube Sampling strategy.Bottom:Comparison of the predicted and exact solutions corresponding to the three temporal snapshots depicted by the dashed vertical lines in the top panel.

One potential limitation of the continuous time neural network models considered so far, stems from the need to use a large number of collocation points in order to enforce physics informed constraints in the entire spatio-temporal domain. Although this poses no significant issues for problems in one or two spatial dimensions, it may introduce a severe bottleneck in higher dimensional problems, as the total number of collocation points needed to globally enforce a physics informed constrain (i.e., in our case a partial differential equation) will increase exponentially. In the next section, we put forth a different approach that circumvents the need for collocation points by introducing a more structured neural network representation leveraging the classical Runge-Kutta time-stepping schemes.

#### Discrete Time Models

Let us employ the general form of Runge-Kutta methods with stages and obtain

Here, for . This general form encapsulates both implicit and explicit time-stepping schemes, depending on the choice of the parameters . The above equations can be equivalently expressed as

where

We proceed by placing a multi-output neural network prior on

This prior assumption along with the above equations result in a physics informed neural network that takes as an input and outputs

**Example (Allen-Cahn Equation)**

This example aims to highlight the ability of the proposed discrete time models to handle different types of nonlinearity in the governing partial differential equation. To this end, let us consider the Allen-Cahn equation along with periodic boundary conditions

The Allen-Cahn equation is a well-known equation from the area of reaction-diffusion systems. It describes the process of phase separation in multi-component alloy systems, including order-disorder transitions. For the Allen-Cahn equation, the nonlinear operator is given by

and the shared parameters of the neural networks can be learned by minimizing the sum of squared errors

where

and

Here, corresponds to the data at time .

The following figure summarizes our predictions after the network has been trained using the above loss function.

Allen-Cahn equation:Top:Solution along with the location of the initial training snapshot at t=0.1 and the final prediction snapshot at t=0.9.Bottom:Initial training data and final prediction at the snapshots depicted by the white vertical lines in the top panel.

### Data-driven Discovery of Nonlinear Partial Differential Equations

In this second part of our study, we shift our attention to the problem of data-driven discovery of partial differential equations. To this end, let us consider parametrized and nonlinear partial differential equations of the general form

where denotes the latent (hidden) solution, is a nonlinear operator parametrized by , and is a subset of . Now, the problem of data-driven discovery of partial differential equations poses the following question: given a small set of scattered and potentially noisy observations of the hidden state of a system, what are the parameters that best describe the observed data?

In what follows, we will provide an overview of our two main approaches to tackle this problem, namely continuous time and discrete time models, as well as a series of results and systematic studies for a diverse collection of benchmarks. In the first approach, we will assume availability of scattered and potential noisy measurements across the entire spatio-temporal domain. In the latter, we will try to infer the unknown parameters from only two data snapshots taken at distinct time instants. All data and codes used in this manuscript are publicly available on GitHub.

#### Continuous Time Models

We define to be given by

and proceed by approximating by a deep neural network. This assumption results in a physics informed neural network . This network can be derived by the calculus on computational graphs: Backpropagation. It is worth highlighting that the parameters of the differential operator turn into parameters of the physics informed neural network .

**Example (Navier-Stokes Equation)**

Our next example involves a realistic scenario of incompressible fluid flow as described by the ubiquitous Navier-Stokes equations. Navier-Stokes equations describe the physics of many phenomena of scientific and engineering interest. They may be used to model the weather, ocean currents, water flow in a pipe and air flow around a wing. The Navier-Stokes equations in their full and simplified forms help with the design of aircraft and cars, the study of blood flow, the design of power stations, the analysis of the dispersion of pollutants, and many other applications. Let us consider the Navier-Stokes equations in two dimensions (2D) given explicitly by

where denotes the -component of the velocity field, the -component, and the pressure. Here, are the unknown parameters. Solutions to the Navier-Stokes equations are searched in the set of divergence-free functions; i.e.,

This extra equation is the continuity equation for incompressible fluids that describes the conservation of mass of the fluid. We make the assumption that

for some latent function . Under this assumption, the continuity equation will be automatically satisfied. Given noisy measurements

of the velocity field, we are interested in learning the parameters as well as the pressure . We define and to be given by

and proceed by jointly approximating using a single neural network with two outputs. This prior assumption results into a physics informed neural network . The parameters of the Navier-Stokes operator as well as the parameters of the neural networks and can be trained by minimizing the mean squared error loss

A summary of our results for this example is presented in the following figures.

Navier-Stokes equation:Top:Incompressible flow and dynamic vortex shedding past a circular cylinder at Re=100. The spatio-temporal training data correspond to the depicted rectangular region in the cylinder wake.Bottom:Locations of training data-points for the the stream-wise and transverse velocity components.

Navier-Stokes equation:Top:Predicted versus exact instantaneous pressure field at a representative time instant. By definition, the pressure can be recovered up to a constant, hence justifying the different magnitude between the two plots. This remarkable qualitative agreement highlights the ability of physics-informed neural networks to identify the entire pressure field, despite the fact that no data on the pressure are used during model training.Bottom:Correct partial differential equation along with the identified one.

Our approach so far assumes availability of scattered data throughout the entire spatio-temporal domain. However, in many cases of practical interest, one may only be able to observe the system at distinct time instants. In the next section, we introduce a different approach that tackles the data-driven discovery problem using only two data snapshots. We will see how, by leveraging the classical Runge-Kutta time-stepping schemes, one can construct discrete time physics informed neural networks that can retain high predictive accuracy even when the temporal gap between the data snapshots is very large.

#### Discrete Time Models

We begin by employing the general form of Runge-Kutta methods with stages and obtain

Here, for . This general form encapsulates both implicit and explicit time-stepping schemes, depending on the choice of the parameters . The above equations can be equivalently expressed as

where

We proceed by placing a multi-output neural network prior on

This prior assumption result in two physics informed neural networks

and

Given noisy measurements at two distinct temporal snapshots and of the system at times and , respectively, the shared parameters of the neural networks along with the parameters of the differential operator can be trained by minimizing the sum of squared errors

where

and

Here, , , , and .

**Example (Korteweg–de Vries Equation)**

Our final example aims to highlight the ability of the proposed framework to handle governing partial differential equations involving higher order derivatives. Here, we consider a mathematical model of waves on shallow water surfaces; the Korteweg-de Vries (KdV) equation. The KdV equation reads as

with being the unknown parameters. For the KdV equation, the nonlinear operator is given by

and the shared parameters of the neural networks along with the parameters of the KdV equation can be learned by minimizing the sum of squared errors given above.

The results of this experiment are summarized in the following figure.

KdV equation:Top:Solution along with the temporal locations of the two training snapshots. Middle: Training data and exact solution corresponding to the two temporal snapshots depicted by the dashed vertical lines in the top panel.Bottom:Correct partial differential equation along with the identified one.

**Conclusion**

Although a series of promising results was presented, the reader may perhaps agree that this two-part treatise creates more questions than it answers. In a broader context, and along the way of seeking further understanding of such tools, we believe that this work advocates a fruitful synergy between machine learning and classical computational physics that has the potential to enrich both fields and lead to high-impact developments.

**Acknowledgements**

This work received support by the DARPA EQUiPS grant N66001-15-2-4055 and the AFOSR grant FA9550-17-1-0013. All data and codes are publicly available on GitHub.

## Citation

```
@article{raissi2019physics,
title={Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations},
author={Raissi, Maziar and Perdikaris, Paris and Karniadakis, George E},
journal={Journal of Computational Physics},
volume={378},
pages={686--707},
year={2019},
publisher={Elsevier}
}
@article{raissi2017physicsI,
title={Physics Informed Deep Learning (Part I): Data-driven Solutions of Nonlinear Partial Differential Equations},
author={Raissi, Maziar and Perdikaris, Paris and Karniadakis, George Em},
journal={arXiv preprint arXiv:1711.10561},
year={2017}
}
@article{raissi2017physicsII,
title={Physics Informed Deep Learning (Part II): Data-driven Discovery of Nonlinear Partial Differential Equations},
author={Raissi, Maziar and Perdikaris, Paris and Karniadakis, George Em},
journal={arXiv preprint arXiv:1711.10566},
year={2017}
}
```