Physics-informed neural network

Also known as: PINN

On this page 7

A physics-informed neural network (PINN) is a neural network trained so that its output satisfies known physical laws, usually expressed as partial or ordinary differential equations, in addition to fitting any available measurements. The equations enter the loss function as residual terms computed with automatic differentiation, so the network learns a continuous solution that respects the physics everywhere it is evaluated.

Among neural networks, PINNs belong to the field of scientific machine learning. They are used to solve forward problems, where the equation and its conditions are known, and inverse problems, where unknown parameters such as viscosity or conductivity are inferred from sparse, noisy data.

How a physics-informed neural network is trained

A PINN is typically a multilayer perceptron that maps coordinates such as space and time to the physical field of interest, for example temperature or velocity. Training minimizes a composite loss that combines several terms, each penalizing a different kind of violation.

The PDE residual is the core of the method. At thousands of randomly sampled collocation points inside the domain, the network’s derivatives are computed exactly by automatic differentiation and inserted into the governing equation. Any nonzero result is penalized, so the network is pushed toward functions that obey the equation without needing a mesh.

The table below lists the standard loss components and what each enforces.

Loss termEvaluated atWhat it enforces
PDE residualCollocation points inside the domainThe governing differential equation
Boundary condition lossPoints on the domain boundaryPrescribed values or fluxes at edges
Initial condition lossPoints at the starting timeThe known initial state
Data lossMeasurement locationsAgreement with observed values
RegularizationNetwork weightsSmoothness or limited complexity
Components of a typical PINN loss function

Each term is multiplied by a weighting coefficient, and the balance between them strongly affects results. Optimization usually begins with Adam and finishes with a quasi-Newton method such as L-BFGS, which converges more precisely on the smooth loss landscapes that PINNs tend to produce near a solution.

Key design choices and parameters

PINN performance depends heavily on a few design decisions that practitioners tune for each problem. The activation function must be smooth enough to have nonzero higher derivatives, which is why tanh, sine and swish are common and plain ReLU is usually avoided for second-order equations.

The following table gives typical settings and their effects. The values are starting points that vary with the equation and domain size.

ParameterTypical choiceEffect
Network depth and width4 to 8 layers of 20 to 200 unitsCapacity versus training cost
Activation functionTanh, sine or swishSmooth derivatives for the residual
Collocation points10,000 to 1,000,000Resolution of physics enforcement
Sampling strategyUniform, Latin hypercube or adaptiveFocus on regions with high error
Loss weightsFixed, annealed or learnedBalance between physics and data
Input normalizationCoordinates scaled to a unit rangeStable gradients and faster training
Common PINN settings and their effects

Boundary conditions can also be imposed exactly through the network structure, by multiplying the output by a function that vanishes on the boundary. This hard constraint removes one loss term and often improves accuracy, at the cost of problem-specific engineering.

PINNs sit between classical numerical solvers and purely data-driven surrogates. Finite element and finite volume methods remain faster and more accurate for most well-posed forward problems, whereas PINNs gain an advantage when data and physics must be combined or when geometry and parameters are uncertain.

The comparison below summarizes when each approach tends to be appropriate.

MethodStrengthLimitation
Physics-informed neural networkMesh-free, merges data and equationsSlow training, retrained per problem
Finite element methodMature, accurate, error estimatesMeshing effort, weak at inverse problems
Purely data-driven networkFast inference once trainedNeeds large data, may violate physics
Neural operatorLearns a mapping across many inputsRequires many training simulations
Neural ordinary differential equationLearns unknown dynamics from trajectoriesNot designed for spatial PDEs
PINNs and alternative approaches to physical modeling

A frequent pattern is to use a PINN for parameter discovery and then hand the identified parameters to a conventional solver for production simulations, combining the strengths of both.

Typical applications

PINNs are applied wherever governing equations are known but data is sparse. In fluid mechanics, they reconstruct velocity and pressure fields from limited flow measurements. In heat transfer and materials science, they estimate unknown conductivities or diffusion coefficients. Biomedical engineers use them to infer blood-flow quantities from medical imaging, and geophysicists apply them to seismic wave propagation and subsurface characterization.

Limitations and failure modes

PINNs are harder to train than their simplicity suggests. Competing loss terms often have gradients of very different magnitude, so the optimizer satisfies one condition while ignoring another. Neural networks also show spectral bias, learning low-frequency components first, which makes sharp fronts, shocks and multiscale behavior difficult to capture.

The table below lists common symptoms, their usual causes and established remedies.

SymptomLikely causeTypical remedy
Trivial or flat solutionResidual loss dominates boundary termsAdaptive loss weighting
Missed sharp gradientsSpectral bias and sparse samplingFourier features, adaptive sampling
Wrong long-time behaviorCausality violated during trainingTime marching or causal weighting
Very slow convergencePoor scaling of inputs and outputsNondimensionalization of the equations
Good loss, wrong answerIll-posed problem or missing conditionsReview the problem formulation
Common PINN training problems

Another important limitation is that a standard PINN solves one problem instance per training run. Changing a boundary condition or a coefficient generally requires retraining, which is why parametric PINNs and neural operators are active research areas.

Put simply

Most neural networks learn only from examples. A physics-informed neural network also learns from the rules of nature. These rules are written as equations, such as those for heat flow or moving water.

During training, the network is scored on two things. It must match the measurements it has. It must also obey the equations at many test points. Breaking the physics costs points, just like missing the data.

This helps when measurements are scarce. The equations fill the gaps between data points. The result is a model that is both data-aware and physically sensible.

In practice

An engineering team needs the thermal conductivity of a new composite panel used in a battery enclosure. They can place only 12 temperature sensors on the panel, and the material’s properties are not listed in any datasheet.

They build a PINN with six hidden layers of 64 tanh units that maps position and time to temperature. The loss combines the sensor readings, the known heater input at one edge, and the heat equation residual at 50,000 collocation points. The conductivity is added as a trainable parameter alongside the network weights.

After about 20,000 Adam steps followed by L-BFGS refinement, the identified conductivity agrees with a later laboratory test within about 3 percent. The team then enters that value into its finite element model to simulate thermal runaway scenarios, using the PINN only for the inverse identification step.