← Back to Autonomy

Scientific Machine Learning · Merged introduction

Physics-Informed Neural Networks

A neural network that learns from your data and from the equations of physics at the same time — the intuition, the interactive sims, and where it earns its keep.

Interactive Monograph · Scientific Machine Learning

Physics-Informed
Neural Networks, in plain words

A neural network that is not allowed to ignore physics. It learns from your data and from the equations that govern your system at the same time, so its answers stay obedient to the laws of nature even where you have no measurements.

01 / The one idea

Two teachers instead of one

A normal neural network has a single teacher: data. You show it examples, it adjusts itself to match them, and between the examples it guesses. If the data is sparse or noisy, those guesses can be nonsense.

A Physics-Informed Neural Network (PINN) adds a second teacher: the governing equation. Most physical systems are described by a differential equation, a sentence in the language of calculus that says how things change. A swinging pendulum, heat spreading through metal, current in a motor winding, all obey such equations.

The PINN is scored on two questions at once. First, do you match the measurements? Second, do you obey the equation everywhere, even where there is no measurement? A network that answers yes to both has learned a solution that is both data-consistent and physically lawful.

In a sentence

A PINN is a neural network trained to fit data and to satisfy a known physical equation, by adding the equation's error directly into the loss the network is trying to minimize.

02 / A worked example

A mass on a spring, with friction

Picture a weight hanging on a spring. Pull it down and let go. It bounces, but friction slowly steals its energy, so the bounces shrink until it stops. This is a damped harmonic oscillator, and its motion follows one tidy equation.

m u″(t)  +  μ u′(t)  +  k u(t)  =  0
u = position · u′ = velocity · u″ = acceleration
m mass · μ friction · k spring stiffness

Suppose you can only measure the position at a handful of moments early on, with a slightly noisy sensor. A plain network, trying only to pass through the dots, will wiggle freely between and beyond them. The PINN cannot: the equation forbids physically impossible motion, so it is pulled toward the one true curve. Toggle the physics below.

noisy measurements true motion network output
Conceptual illustration. The plain network threads the dots but invents wild swings where no data exists. The PINN, penalized whenever it breaks the spring equation, settles onto the true decaying wave even in the unmeasured region on the right.
03 / The system in 3D

Feel the physics first

Before any network, look at the thing itself. Below is the real mechanical system: a mass on a coil spring, with a damper (the cylinder) standing in for friction. Drag it to rotate. The three sliders are exactly the three numbers in the equation. Change them and watch the motion answer.

1.00 kg 0.40 4.0 N/m
Live simulation. The animation plays the exact solution of m u″ + μ u′ + k u = 0 for your chosen numbers. More stiffness bounces faster, more friction dies out sooner, more mass makes it sluggish. This same equation is what the PINN will be forced to obey.

How this physics becomes part of the network

The recipe is short. Take the network's predicted position, call the computer's automatic differentiation to get its velocity and acceleration, and substitute all three into the left side of the equation. If the network were perfect, the result would be exactly zero. Whatever is left over is the residual, a direct measure of how much physics is being broken. Squaring and averaging that residual gives the physics loss, which we add to the ordinary data loss.

04 / Architecture

What is actually inside

The network itself is ordinary. It takes a time t and returns a predicted position u. The cleverness is in what happens to the output afterward: it is differentiated and checked against the equation.

t input: time hidden layers (the network) û predicted position Data loss compare û to the measured dots Physics loss autodiff → û′, û″ plug into equation m û″ + μ û′ + k û should equal 0
Architecture. One small network maps time to position. Its output splits two ways: compared against measurements (data loss), and differentiated and fed into the governing equation (physics loss). Both feed the single number the optimizer drives down.
05 / The heart of it

The loss function does the work

Everything special about a PINN lives in one equation: the recipe for the score it tries to minimize. It is a sum of penalties.

Loss = Ldata  +  λ Lphysics

Ldata   =  average of ( û − umeasured )²  at the dots
Lphysics = average of ( m û″ + μ û′ + k û )²  at many collocation points
  • Data loss keeps the curve honest where you actually measured. Standard supervised learning.
  • Physics loss is the new piece. We sample many points in time (called collocation points) and check, at each, how far the equation is from satisfied. No labels needed, only the equation. This is where physics enters.
  • The weight λ is a dial that balances how loudly each teacher speaks. Starting conditions are folded in the same way, as extra points the network must respect.
Why this is powerful

The physics loss needs no measurements. Scatter collocation points anywhere, even where you never observed, and the equation still grades the network there. That is how a PINN smooths noise and stays sensible in the gaps.

06 / Watch it learn

A real PINN, training in your browser

This is not a recording. A small network (built from scratch, no libraries) starts from random weights and learns the spring's motion live. Each step it compares against a few noisy measurements and checks the equation at many points, then nudges its weights downhill. Press start and watch the red curve find the true motion while both losses fall.

Epoch
0
Data loss
Physics loss
measurements true motion network (learning) collocation points
Genuine training. The network reads time, predicts position, and is corrected by data and physics every step. Early on the red curve is a meaningless squiggle. Within a few hundred steps the physics term irons it into the true decaying wave, and the loss panel below shows both penalties collapsing toward zero.
07 / Inspect the physics

Probing the residual

What does the physics loss actually measure? Slide the marker to any instant. The page reads the network you trained above, computes its velocity and acceleration there, and assembles the equation. The leftover, the residual, is shown as a bar. A well-trained network keeps it near zero everywhere; an untrained one cannot.

2.00 s
Train the network above, then slide to read the residual.
equation violation (residual magnitude)
The residual is the physics teacher's red pen. Reset and probe an untrained network and the bar is long: the equation is badly broken. Train it and probe again, the bar shrinks to a sliver. Driving that bar to zero, everywhere at once, is precisely what the physics loss does.
08 / How the interface works

One training step, end to end

Every step runs the same little assembly line. While the network trains above, the matching stage lights up here so you can see data flow through it. When training is idle, press play to walk the loop on its own.

STEP 1
Sample points
pick data dots + collocation times
STEP 2
Forward pass
network predicts û at each point
STEP 3
Autodiff
get û′ and û″ exactly
STEP 4
Score
data error + equation residual
STEP 5
Backprop
gradient of loss to every weight
STEP 6
Update & loop
nudge weights, repeat
The data flow. Sample, predict, differentiate, score, backprop, update, then back to the start. The only stages a plain network does not have are autodiff for physics and the residual half of the score. Everything else is ordinary deep learning.
09 / The balance dial

How loud should physics be?

The weight λ sets how much the physics teacher is allowed to override the data teacher. Train on deliberately noisy measurements and sweep it. With no physics the network chases the noise; with too much, it stops listening to the data at all. The sweet spot in between denoises while staying faithful.

λ = 0.00
Set a value for λ and train. At λ = 0 you get an ordinary network that overfits the noisy dots.
noisy data true motion network
The denoising dial. Physics acts as a principled regularizer. Because the true motion both fits the data and obeys the equation, leaning on physics pulls the fit off the noise and onto the real signal. The caveat: this only helps when the equation is right, which the next sections stress-test.
10 / Sparse and noisy

A head-to-head race

Here is the central claim made literal. Two networks, identical in every way except one has the physics term and one does not, train on the same six early measurements. Add sensor noise and run them. Watch what each does once the data runs out.

0.06
data true plain (data only) PINN
Same data, different teachers. Both fit the dots on the left. In the unmeasured region the plain network drifts to whatever the math allows, while the PINN keeps following the spring equation and tracks the true decay. This is the failure a physics term is designed to prevent.
11 / Inverse problem

Discovering a hidden parameter

Turn the idea around. Suppose you can measure the motion but you do not know the friction μ. Make it a trainable unknown and let the network learn the curve and the coefficient together, so that data and physics agree. The friction value falls out as a by-product. This is exactly how you would infer an effective damping or stiffness from observed behavior, the backbone of parameter estimation for health monitoring.

0.70
network's estimate µ̂ = hidden truth = 0.70
Learning the law and its constants at once. The unknown μ starts at a poor guess and is nudged, every step, in whatever direction makes the equation agree with the data. It converges to the hidden value. No separate experiment to measure friction is needed; the trajectory already contains it.
12 / Garbage in

Believing the wrong law

A PINN is only as honest as the equation you hand it. Tell the network the spring is stiffer or softer than it really is, then let physics dominate. It will produce a clean, confident, completely wrong answer. This is the most important caution in the whole subject.

k = 9.0
The data came from a system with k = 4. Pick a different assumed k, train, and watch the network confidently obey the wrong physics.
data (k=4) true network
Obedient to a fault. The network has no way to know your equation is wrong. It splits the difference between the real data and the false law, landing on a smooth curve that is wrong in a believable way. Physics priors are powerful precisely because they are trusted, so they must be correct.
13 / Prognostics

The residual as a fault detector

This is where the residual earns its keep. Fix a model of the healthy system, stiffness k₀ = 4. Now let the real hardware degrade, a crack softens it, wear stiffens it, and feed the measured motion through the healthy model's equation. As long as the system is healthy the residual sits at zero. The moment reality drifts from the assumed law, the residual lights up. It is a physically grounded alarm.

k = 4.0 N/m
fault index (RMS residual) = 0.000HEALTHY
Reading the residual. The dashed teal line is what the healthy model expects; the dark line is the measured motion; the rust trace below is the residual between them. Drift the stiffness away from 4 and the residual grows in proportion to the mismatch, turning a parity check into a quantitative fault index. This is innovation-based monitoring in one picture.
14 / Forcing and resonance

Driving the system

Add a periodic push, m u″ + μ u′ + k u = F₀ cos(ωt), and a richer behavior appears. Sweep the driving frequency ω and the steady response swells to a peak when you hit the system's natural rhythm. That peak is resonance, and a PINN handles the forced equation as readily as the free one, the drive simply joins the residual.

ω = 1.00 rad/s
steady amplitude =
The resonance peak. On the left, response amplitude against drive frequency; on the right, the matching steady oscillation. Near ω ≈ 1.98 the curve spikes: a small push produces a large swing. Damping μ sets how tall and sharp that peak is, which is why friction is what keeps real structures from shaking themselves apart.
15 / Beyond time

From a curve to a field

Nothing about the recipe is limited to one input. Swap the time-only problem for one that varies in space and time, like heat spreading along a bar, and the same machinery applies. The network now takes two inputs, position and time, and the residual checks a partial differential equation instead of an ordinary one.

∂u/∂t  =  α  ∂²u/∂x²   the heat equation
Temperature along a bar, cooling over time. A hot profile relaxes toward zero at the clamped ends. The sharp wiggles fade first; the smooth bulge lingers, exactly as diffusion predicts.

To train a PINN here you scatter collocation points across the whole space-time rectangle and check the heat equation at each, while separate points pin down the known edges. The grading is identical to the spring: residual squared, plus the boundary and initial conditions.

Where the equation is checked. Interior points enforce the physics; edge points enforce what is known. A mesh-free solver that learns a smooth field from scattered checks, the same idea that powers PINNs for fluids, elasticity, and electromagnetics.
16 / Why bother

Plain network versus PINN

Plain neural network

Needs lots of clean data. Guesses freely between samples. Can violate conservation of energy, mass, or momentum without noticing. Knows nothing about your system beyond the examples.

Physics-informed network

Works with sparse, noisy data. Stays physically sensible in the gaps. Can even discover unknown constants in the equation. Brings centuries of physics for free.

Where engineers reach for them

  • Filling gaps in sensor data, reconstructing a full field from a few probes.
  • Solving differential equations where a traditional mesh-based solver is awkward or expensive.
  • Inverse problems and parameter discovery, inferring a hidden material property or damping value from observed behavior.
  • Health monitoring and prognostics, where a physics-anchored model can flag when a system drifts from its expected, lawful behavior.
17 / Honest limits

What to watch out for

PINNs are not magic. They can be slow and finicky to train, because the optimizer is balancing competing teachers, and the λ weight matters a lot. Sharp shocks, turbulence, and stiff equations can stall training. Oscillatory solutions like this one often need a little help, such as the sinusoidal input features the trainer above quietly uses. And you must actually know the governing equation; if the physics is wrong or incomplete, the network will faithfully obey the wrong law. They complement traditional solvers and data-driven models, they do not retire them.

18 / Plain-words glossary

The five words to keep

Governing equation
The known physical law of your system, written as a differential equation.
Residual
What you get when you plug the network's answer into the equation. Zero means perfectly obeyed.
Collocation points
Times or places where you check the equation. They need no measured labels.
Automatic differentiation
The automatic way the computer finds the network's derivatives, the velocities and accelerations the physics needs.
Loss weight (λ)
The dial that balances fitting the data against obeying the physics.
19 / Under the hood

Math appendix

For the curious, the machinery the trainer on this page actually runs. Everything is vanilla JavaScript with no libraries, and the network really does learn live.

The full loss, written out

The network û(t) is scored on three penalties summed together:

Loss = mean(û − udata + λ mean( m û″ + μ û′ + k û )²

The first term runs over the measured dots, the second over many collocation times. The physics term needs no labels, only the equation. The weight λ is annealed upward during training so the network first learns the rough shape from data, then is tightened onto the equation.

Enforcing the initial conditions exactly

Rather than penalize the start point softly, the output is wrapped so the conditions u(0) = 1 and u′(0) = 0 hold by construction:

û(t) = 1 + (1 − e−t)² · N(t)

At t = 0 the multiplier and its slope are both zero, so û(0) = 1 and û′(0) = 0 no matter what the raw network N(t) does. This removes two competing penalties and makes training far more stable.

How the derivatives and their gradients are computed

The velocity and acceleration are taken by central finite differences in time, which makes the residual a simple linear blend of the network at three nearby instants:

r = a û(t+h) + b û(t) + c û(t−h)
a = m/h² + μ/2h   b = −2m/h² + k   c = m/h² − μ/2h

Because r is linear in those three outputs, the gradient of the physics loss with respect to every weight is the same blend of three ordinary backprop passes. The residual is divided by k to keep the three coefficients well scaled.

Why the input carries sine and cosine features

A plain tanh network struggles to represent several oscillation periods when the input is squashed to a small range. The time input is therefore expanded into a handful of sinusoids before entering the network:

feat(t) = [ t/5−1, sin(0.6t), cos(0.6t), sin(1.2t), … ]

This positional encoding gives the network an easy oscillatory basis to combine, so it can match the decaying wave with a small number of units. The frequencies bracket the system's natural rhythm without being handed the exact answer.

The optimizer

Weights are updated with Adam, which keeps a running estimate of the gradient's mean and variance per parameter and scales each step accordingly. The learning rate decays over training. In the inverse-problem section the unknown coefficient μ is just one more parameter handed to the same optimizer, with its gradient coming from how the residual depends on û′.

Part 2 · A Working Introduction — problems, failure modes & VHM fit
Scientific Machine Learning · Monograph

Physics-Informed Neural Networks

How to teach a neural network the laws of physics, so it can fill in what the data leaves out.

The one-sentence version. A physics-informed neural network (PINN) is an ordinary neural network that is trained not only to match data, but also to obey a governing equation, by adding the equation's own residual into the loss function. The result is a model that respects conservation laws and physics even where you have almost no measurements.

01 / MOTIVATIONWhy combine physics and learning

Two ways of modelling the world have always been in tension, and PINNs sit deliberately in the gap between them.

Physics-based models (the differential equations of mechanics, heat, fluids, electromagnetism) are trustworthy and extrapolate well, because they encode causal structure. But they need a mesh, a solver, boundary conditions you actually know, and material parameters you often do not. Solving them on complex domains can be slow, and inverse problems (inferring an unknown parameter from sparse measurements) are painful.

Pure machine learning models are flexible and fast at inference, and they happily ingest messy real data. But they are data-hungry, they extrapolate badly, and they will cheerfully predict things that violate conservation of energy or mass, because nothing in their training told them not to.

A PINN keeps the network's flexibility while bolting the physics back on. Instead of trusting the model to infer the physics from enough examples, you tell it the governing equation directly and penalise any output that breaks it. The payoff is the headline feature of the whole field: PINNs can produce sensible solutions from small, sparse, or noisy data, precisely the regime where ordinary deep learning falls apart.

The mental model Data tells the network where the solution has been pinned down. Physics tells the network what shape it is allowed to take everywhere in between. Together they leave far fewer degrees of freedom than either constraint alone.

02 / THE CENTRAL IDEAA network that is the solution

Start with the thing we usually want: the solution of a differential equation. Say we are looking for a field u(x, t), the temperature along a rod, the displacement of a beam, the velocity of a flow. A classical solver computes u at a finite set of grid points. A PINN does something different: it makes the neural network be the solution.

# The network is a smooth function of the coordinates themselves
uθ(x, t) ← NeuralNet( inputs = [x, t] , weights = θ )

So the inputs are spatial and temporal coordinates, not features in the usual ML sense, and the single output is the value of the field at that coordinate. The weights θ are what we train. Because a neural network with smooth activations (such as tanh) is itself a smooth, differentiable function, we can do something a lookup table of grid values could never do: we can take its exact derivatives with respect to its own inputs, analytically, at any point we like. That single fact is the whole trick.

Why “mesh-free” matters Because the network is defined everywhere on the domain (not just on grid nodes), you can evaluate it and its derivatives at arbitrary scattered points. There is no mesh to generate, which is a real advantage on awkward geometries and in high dimensions, where classical meshing is the bottleneck.

03 / THE ENGINEAutomatic differentiation, not finite differences

To check whether the network obeys a differential equation, we need its derivatives: ∂u/∂t, ∂²u/∂x², and so on. PINNs get these from automatic differentiation (autodiff), the same machinery that already computes gradients for training. This is not a numerical approximation like a finite difference; it applies the chain rule exactly through the network's own operations, so the derivatives are accurate to machine precision and free of grid-spacing error.

Concretely, the same computational graph that lets us differentiate the loss with respect to the weights also lets us differentiate the output with respect to the inputs. Need a second derivative for a diffusion term? Differentiate twice. Need a mixed partial? Autodiff handles it. This is why a PINN can encode almost any PDE you can write down, without ever discretising the operator by hand.

# A diffusion (heat) equation, as the network must satisfy it
residual(x,t) = ∂uθ/∂t − α · ∂²uθ/∂x²
# every derivative above comes straight from autodiff on the net

If the network exactly solved the heat equation, this residual would be zero at every point. It will not be, at first. Driving that residual toward zero is what training does.

04 / THE COMPOSITE LOSSThree jobs, one objective

Here is the heart of the method. A PINN minimises a weighted sum of loss terms, each enforcing a different requirement. For a typical forward problem there are three.

L(θ) = λd·Ldata + λp·Lphysics + λb·Lbc/ic

# 1. match any measurements you have
Ldata = mean[ ( uθ(xi,ti) − umeasured,i )² ]

# 2. obey the PDE at scattered "collocation" points
Lphysics = mean[ residual(xc,tc)² ]

# 3. respect boundary and initial conditions
Lbc/ic = mean[ ( uθ(boundary) − known )² ]

Three ideas deserve to be named clearly:

  • Collocation points. The points where we enforce the physics. Crucially, they need no labels. We just sample coordinates across the domain and demand that the residual be small there. This is why PINNs are so frugal with data: the physics term supplies “free” supervision everywhere.
  • The loss weights λ. They balance the terms. Getting them wrong is the single most common reason a PINN fails to train (more on this in section 09).
  • Soft constraints. Boundary conditions added as a loss term are “soft”: encouraged, not guaranteed. There is a stronger alternative, baking them into the architecture so they hold exactly, which we revisit later.
L_data fit the measurements L_physics PDE residual ≈ 0 L_bc / ic boundaries & t=0 × λd × λp × λb Σ = L(θ) Adam / L-BFGS update θ gradient feedback updates the same network θ
Figure 1. The composite objective. Three loss terms, each weighted, are summed and minimised by gradient descent. The physics term needs no labelled data, only coordinates.

05 / ARCHITECTUREThe whole pipeline, end to end

Putting the pieces together, here is what one forward pass and one training step look like. Notice that the network on the left is completely ordinary; everything distinctive happens in how the loss is built on the right.

x t inputs tanh layers (θ) uθ(x,t) AUTODIFF ∂u/∂t , ∂u/∂x ∂²u/∂x² , ... exact derivatives residual → L_physics u vs data → L_data u vs bc/ic → L_bc L(θ) minimise via gradients backprop: update weights θ to shrink the total loss
Figure 2. One PINN training step. The coordinate inputs pass through an ordinary fully-connected network; autodiff produces the derivatives the PDE needs; three loss terms are assembled and minimised; gradients flow back to the same weights. The novelty is entirely in the loss, not the network.

06 / SEE IT LEARNA real PINN, trained in your browser

Everything above is concrete enough to run live. Below is an actual neural network (a small tanh network, trained by gradient descent right here in JavaScript, no pre-baked animation) learning the decay problem

du/dt = −k·u , with u(0) = 1 , true answer u(t) = e−k t

You are given only a few noisy measurements, and only in the first half of the time window. Toggle the physics term on and off and watch what happens past the last data point. With data alone, the network has no reason to behave sensibly where there is no data. With the physics residual switched on, the same network extrapolates correctly across the whole window, because the equation constrains it everywhere.

Decay PINN sandbox

true e−kt network prediction collocation points noisy data
step 0  |  L_total --  |  L_data --  |  L_physics --
What to try Turn physics off, train, and watch the red curve wander away after the last black dot. Then turn physics back on and retrain: the curve snaps onto the true exponential across the whole range. Now turn data off but keep physics and the initial condition: the network reconstructs the solution from the equation alone. That is the PINN promise in one panel.

07 / WORKED EXAMPLEThe damped oscillator, by hand

The decay demo is first order. Most real systems are at least second order, so consider a damped, driven mass-spring system, a stand-in for a great deal of vibration and structural dynamics work:

m·u″(t) + c·u′(t) + k·u(t) = F(t)

To turn this into a PINN you do exactly three things:

  1. Define the network uθ(t), input time, output displacement.
  2. Form the residual using autodiff for the first and second derivatives:
    r(t) = m·∂²uθ/∂t² + c·∂uθ/∂t + k·uθ − F(t)
  3. Assemble the loss: penalise r(t)² at collocation times, plus the initial conditions u(0) and u′(0), plus any sensor data you happen to have.

That is the entire recipe, and it generalises directly to partial differential equations. The canonical PINN test case, used in the original 1999-era-style benchmark and ever since, is the one-dimensional Burgers equation, a fluid model that develops a sharp shock:

∂u/∂t + u·∂u/∂x = ν·∂²u/∂x²

Here the inputs are (x, t), the nonlinearity u·∂u/∂x is no obstacle at all (autodiff does not care whether terms are linear), and the network learns the moving shock from the equation plus the initial and boundary conditions, with little or no interior data. This single example, from Raissi and colleagues, is what put PINNs on the map.

Reading the residual The residual is the most useful diagnostic you have. Plotting r across the domain tells you exactly where the network is still violating the physics, usually near sharp features, steep gradients, or shocks. That map is what motivates most of the advanced variants in section 10.

08 / TWO MODESForward problems and inverse problems

PINNs come into their own across two distinct kinds of question, and the second is arguably where they beat classical solvers most clearly.

Forward problem

You know the equation and its coefficients, and you want the solution. The PINN plays the role of a mesh-free solver. Honest assessment: for clean, well-posed problems on simple domains, a mature classical solver is usually faster and more accurate. PINNs get interesting when the geometry is nasty, the dimension is high, or you want a single smooth model you can differentiate later.

Inverse problem

You have sparse, noisy measurements and you do not know some coefficient in the equation, a diffusivity, a damping constant, a reaction rate, a material property. Here is the elegant part: you simply promote that unknown to a trainable parameter and let the optimiser fit it alongside the network weights.

# the unknown coefficient α is just another learnable variable
minimiseθ, α [ Ldata(θ) + Lphysics(θ, α) ]
# the physics term is what makes α identifiable from sparse data

The data anchors the solution to reality; the physics term ties the solution to the equation; and the only way to satisfy both at once is to land on the true coefficient. This unified treatment of forward and inverse problems, in one framework with one loss, is the reason PINNs drew so much attention. It is also the mode most relevant to health monitoring and diagnostics, where the “unknown parameter” is often the very thing you are trying to estimate, such as a degrading stiffness or a growing fault coefficient.

09 / PRACTICAL NOTESWhat actually goes wrong, and how to fix it

PINNs are easy to write and surprisingly hard to train well. Most of the field's research effort goes into the failure modes below. Knowing them saves weeks.

Unbalanced loss terms

If L_physics and L_data differ by orders of magnitude, the optimiser ignores the smaller one and the model collapses to a useless solution. Fixes: tune the weights λ, or better, use adaptive weighting schemes that rebalance them automatically during training (learning-rate annealing, gradient-norm balancing, or self-adaptive per-point weights).

Spectral bias

Networks learn smooth, low-frequency functions far more readily than sharp, high-frequency ones. So PINNs struggle with steep gradients, boundary layers, and oscillatory solutions. Fixes: Fourier feature embeddings of the inputs, sinusoidal activations, or domain decomposition.

Stiff and multi-scale problems

For convection-dominated or stiff systems, the loss landscape becomes brutally ill-conditioned and naive training simply fails. This is a documented, characterised failure mode, not user error. Fixes that help: curriculum / causal training (learn early times before late times, so the solution propagates forward the way the physics does), and domain decomposition (a separate network per subregion).

Soft constraints leak

Boundary and initial conditions added as loss terms are only approximately satisfied. When they must hold exactly, use a hard-constraint ansatz: structure the output so the conditions are true by construction, for example uθ(x,t) = g(x,t) + B(x,t)·NN(x,t) where g matches the boundary and B vanishes on it. This removes a whole loss term and usually trains better.

KnobSensible defaultWhen to change it
Activationtanhswitch to sin / Fourier features for high frequency
Width / depth~4–8 layers, 20–128 widedeeper for harder PDEs, not always better
OptimiserAdam, then L-BFGS to polishL-BFGS finishes the last digits of accuracy
Collocationuniform or Latin hypercuberesidual-adaptive resampling near sharp features
Loss weightsstart equal, then adaptalmost always needs adaptive balancing
Inputsnormalise to O(1)non-negotiable for stable training
When NOT to reach for a PINN If you have a fast, validated classical solver and a clean forward problem, use it. If you have abundant high-quality data and no trustworthy equation, use ordinary ML. PINNs win in the middle ground: scarce data and a known (or partially known) physical law, especially for inverse problems and inference from sensors.

10 / THE FAMILY TREEVariants you will hear about

“PINN” is now an umbrella. A quick orientation so the acronyms stop being scary:

XPINNcPINN Domain decomposition. Split the domain into pieces, put a separate network on each, and stitch them with interface conditions. cPINNs enforce conservation across interfaces; XPINNs generalise this in space and time. Good for large or multi-scale domains and easy to parallelise.

vPINN / hp-VPINN Use the equation's weak (variational) form instead of the strong residual, which can lower the derivative order the network must produce and handle discontinuities more gracefully.

B-PINN Bayesian PINNs. Put distributions over the weights so you get uncertainty estimates, which is essential when the downstream decision is safety-critical.

Self-adaptive Per-point trainable loss weights that automatically pour attention onto the hardest regions (such as a shock), one of the more effective fixes for the balancing problem.

DeepONetFNO A different philosophy worth knowing. Instead of learning one solution, operator learning learns the whole solution operator, the map from inputs (a forcing function, a boundary profile, parameters) to solutions. Train once, then infer new solutions almost instantly, no retraining per case. DeepONet and Fourier Neural Operators are the headline methods, and physics-informed variants of both exist. If you need many solutions across varying conditions (a fleet, a sweep, a digital twin queried repeatedly), operator learning is often the better tool than a plain PINN.

11 / IN PRACTICEWhere it earns its keep

PINNs have landed in fluid dynamics (reconstructing flow fields from sparse velocimetry), heat transfer, solid mechanics, subsurface flow, power systems, biomedical modelling, and increasingly in prognostics and health management. That last one is worth drawing out, because it is exactly the sweet spot the method was built for.

Why PHM and vehicle health monitoring fit so well

  • Sparse, noisy field data. You rarely have dense labelled measurements from a degrading component; you have a handful of noisy sensor channels. That is the regime where the physics term does the heavy lifting.
  • Inverse parameter estimation. Estimating a hidden state, a damping coefficient drifting with wear, a thermal resistance rising as a joint degrades, a capacity fading in a cell, is exactly the inverse-problem mode of section 08.
  • Physics you already trust. Equivalent-circuit models, lumped thermal networks, fatigue and crack-growth laws, and electrochemical models are known and partial. A PINN lets you fuse that trusted structure with whatever data the asset actually produces, rather than discarding either.
  • Extrapolation toward end-of-life. Remaining-useful-life estimation is an extrapolation question, and physics-constrained models extrapolate far more defensibly than data-only ones, which matters when the decision is whether to keep operating.

The honest framing: a PINN is not a silver bullet for diagnostics, but it is a principled way to inject domain physics into a learned model so that estimates stay physically plausible when data runs thin, which is precisely when health-monitoring decisions are hardest and most consequential.

12 / REFERENCESWhere to go next

  1. Raissi, M., Perdikaris, P., & Karniadakis, G. E. (2019). Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational Physics, 378, 686–707. (the founding paper)
  2. Karniadakis, G. E., Kevrekidis, I. G., Lu, L., Perdikaris, P., Wang, S., & Yang, L. (2021). Physics-informed machine learning. Nature Reviews Physics, 3, 422–440. (the standard review)
  3. Cuomo, S., et al. (2022). Scientific machine learning through physics-informed neural networks: Where we are and what's next. Journal of Scientific Computing, 92(88). (broad, practical survey)
  4. Wang, S., Teng, Y., & Perdikaris, P. (2021). Understanding and mitigating gradient flow pathologies in physics-informed neural networks. SIAM Journal on Scientific Computing, 43(5), A3055–A3081. (loss balancing)
  5. Krishnapriyan, A., Gholami, A., Zhe, S., Kirby, R., & Mahoney, M. W. (2021). Characterizing possible failure modes in physics-informed neural networks. Advances in Neural Information Processing Systems (NeurIPS). (why training fails)
  6. Wang, S., Sankaran, S., Wang, H., & Perdikaris, P. (2023). An expert's guide to training physics-informed neural networks. arXiv:2308.08468. (hard-won training advice)
  7. Lu, L., Meng, X., Mao, Z., & Karniadakis, G. E. (2021). DeepXDE: A deep learning library for solving differential equations. SIAM Review, 63(1), 208–228. (the go-to software library)
  8. Lu, L., Jin, P., Pang, G., Zhang, Z., & Karniadakis, G. E. (2021). Learning nonlinear operators via DeepONet. Nature Machine Intelligence, 3, 218–229. (operator learning)
  9. Jagtap, A. D., & Karniadakis, G. E. (2020). Extended physics-informed neural networks (XPINNs). Communications in Computational Physics, 28(5), 2002–2041. (domain decomposition)