Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Learning goals

Reading

Three pieces

  1. Neural network — usually input tt (and maybe known parameters / controls); output x^(t)\hat{x}(t)

  2. Data loss — match measurements or labeled simulator trajectories

Ldata≈∥x^(t)−xmeas(t)∥2\mathcal{L}_{\mathrm{data}} \approx \|\hat{x}(t) - x^{\mathrm{meas}}(t)\|^2
  1. Physics loss — collocation residual of the ODE/DAE fragment

Lphys≈∥r(x^,x^˙,u,θ)∥2\mathcal{L}_{\mathrm{phys}} \approx \|r(\hat{x},\dot{\hat{x}},u,\theta)\|^2

Total loss:

L=Ldata+λphysLphys+⋯\mathcal{L} = \mathcal{L}_{\mathrm{data}} + \lambda_{\mathrm{phys}}\mathcal{L}_{\mathrm{phys}} + \cdots

Plain words: the network is pulled toward the data and toward obeying physics. λphys\lambda_{\mathrm{phys}} sets how hard the physics pull is.

Forward-style use

In a forward PINN, parameters θ\theta inside the residual are known and fixed. The network learns trajectories (or a surrogate solution) consistent with physics and any available labels.

If λphys=0\lambda_{\mathrm{phys}}=0If you ignore data
You may fit waveforms that violate physicsYou may get a residual-minimizing curve that misses measurements

Worked example

For the classical swing equations with known (H,D)(H,D), place collocation points in time and write rδr_\delta and rωr_\omega explicitly. Train with a small labeled window plus residual.

Strengths and limits of physics losses

The points below follow the discussion of physical losses in Thuerey et al. (2021), rewritten for the swing equation.

StrengthLimit
Needs no solver: only the network, AD, and the residual rδ,rωr_\delta, r_\omegaSoft constraint. The residual is only penalized, so a trained x^(t)\hat{x}(t) still violates the swing equation by some amount. Report the residual next to trajectory error
Works with sparse or partial measurements (e.g. only ω\omega measured)Collocation cost. The residual is only checked at collocation points. Fault switching at tft_f and tct_c needs points concentrated around the events
Same code pattern for forward and inverse problemsLoss weighting. Ldata\mathcal{L}_{\mathrm{data}}, rδr_\delta and rωr_\omega have different scales, so λphys\lambda_{\mathrm{phys}} (and per-term weights) change the answer. See gradient scaling
Smooth, differentiable output in ttWeak extrapolation. A network trained on t∈[0,2]t \in [0, 2] s is not a simulator. Outside the training window, or for a new clearing time, it must be re-checked against Lab 1

Plain words: a PINN is a curve fitted to data and nudged toward the physics. It is not a solver that guarantees the physics.

Lab

Further reading

Common misconceptions

References
  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. 10.1016/j.jcp.2018.10.045
  2. Thuerey, N., Holzschuh, B., Holl, P., Kohl, G., Lino, M., Liu, Q., Schnell, P., & Trost, F. (2021). Physics-based Deep Learning. arXiv. 10.48550/arXiv.2109.05237