Table of Contents
Physics-Informed ML Explained: Teaching AI Nature's Rules
Physics-informed ML explained for parents: how Penn State's flood model fuses neural networks with water physics, and a bathtub experiment kids can run.
A pure neural network trained on thirty years of river gauges will do a very good job predicting next week’s flow in the rivers it studied, and a poor job on a river it has never seen. That gap is the problem physics-informed machine learning solves. Here is physics-informed ML explained in one line: it is machine learning where known scientific laws are built into the model itself, so its predictions cannot violate them. Penn State researchers published a global hydrology model doing exactly this, and lead author Chaopeng Shen put the reason plainly: neural networks “aren’t as good at predicting beyond that range. That’s why combining them with process-based models grounded in physics matters.”
Key Takeaways
- Physics-informed ML embeds equations (conservation of mass, energy, momentum) into a neural network so violations get penalized during training.
- Penn State’s differentiable hydrology model, published in Nature Communications with Chaopeng Shen as corresponding author, simulates areas as small as 36 km² globally and 6 km² where better data exists.
- The neural network learns the parameters of physical processes (infiltration, recharge, evapotranspiration) rather than replacing them.
- The payoff is generalization: usable forecasts in regions with almost no local measurement history, which is where flood deaths concentrate.
- Kids can grasp the core idea in fifteen minutes with a bucket, a measuring cup, and a rule that water cannot vanish.
What Penn State built, and why it matters
A hydrologic model predicts where rain goes: into soil, into groundwater, into a river, back to the sky. Penn State’s team, led by Chaopeng Shen with Yalan Song, Kathryn Lawson, Jiangtao Liu, Haoyu Ji, Tadd Bindas, and Farshid Rahmani, published a global model in Nature Communications that runs at 36 square kilometers worldwide (about 14 square miles per cell) and zooms to 6 square kilometers where detailed data exists. It was funded by the National Science Foundation, NOAA, the US Department of Energy, and NASA.
The architecture is the interesting part. This is not a neural network that eats rainfall and emits streamflow. It keeps explicit physical components for rainfall, soil infiltration, groundwater recharge, streamflow routing, and evapotranspiration, and uses neural networks to learn the parameters that control those processes: how fast this particular soil absorbs water, how much this particular vegetation transpires. Because the whole system is written in a differentiable framework, gradients flow through the physics as well as the network, so observations of river flow can tune parameters deep inside the model automatically. Shen called the result a major shift for global hydrology, and specifically pointed to underdeveloped regions that have lacked these services.
The same lab’s related work, including “Physics-Informed, Differentiable Hydrologic Models for Capturing Unseen Extreme Events” in Water Resources Research (Song et al., 2026), tests the claim that matters most: can the model handle floods bigger than anything in its training data? That is where pure data-driven models fail hardest, and where the physics constraint earns its keep.
Physics-informed ML explained: how a law gets into a loss function
Neural networks learn by minimizing a loss, a number that measures how wrong they are. Standard training uses one term: prediction error against observed data. Physics-informed neural networks, formalized by Raissi, Perdikaris, and Karniadakis in the Journal of Computational Physics (2019), add a second term. You write the governing differential equation, plug the network’s output into it, and measure how badly the equation is violated. That violation becomes part of the loss. Now the network is punished for being wrong about the data and for being wrong about physics.
Make it concrete with water. Conservation of mass says: water in, minus water out, equals change in storage. If a network predicts that 100 millimeters of rain produced 140 millimeters of river flow with no other source, mass conservation is broken. In a pure ML model, nothing stops that output; it just looks like a bad prediction. In a physics-informed model, the imbalance itself is a penalty the network must reduce. Over training, the network learns only the solutions that obey the law.
There are two flavors worth distinguishing, because they get conflated in press coverage.
The soft-constraint version (the Raissi-style PINN) adds the equation as a penalty. The model can still violate physics a little; it is just discouraged. The hard-constraint or hybrid version (what Penn State built) keeps real physical process modules in the computational graph and uses the network to supply their parameters. Violations are structurally impossible for the parts that are hard-coded. The hybrid approach is usually more accurate for operational forecasting and is harder to build.
Both share one big advantage: sample efficiency. A model that already knows water is conserved does not need to learn that fact from a million examples. It can spend its limited data budget learning the local specifics, which is exactly why these models transfer to ungauged basins. And both share one honest limitation: your physics has to be right. If the governing equations are incomplete, as they often are for soil processes or cloud microphysics, the constraint encodes an approximation. The model becomes confidently consistent with a slightly wrong world. That is a subtler failure than a pure ML model’s obvious nonsense, and arguably more dangerous.
How to Teach Your Kid About Physics-Informed ML
Ages 5–8: The water cannot disappear rule
Fill a measuring cup with exactly 500 mL. Pour it into a bowl with a sponge in it. Ask: where is the water now? Squeeze the sponge back into the cup and measure. Some is missing (on the counter, in the air, still in the sponge). Write on paper: “water in = water out + water stored.” Then make a guessing game: you pour a secret amount, your kid guesses the total using the rule. The rule makes their guess better than a random guess. That is the whole idea.
Ages 9–12: Two guessers, one rule
Have your kid guess tomorrow’s temperature two ways. Guess A: the average of the last five days (pure data). Guess B: the average, but constrained by a rule you supply, like “it cannot be more than 5 degrees off today’s, and it cannot go below freezing in July.” Track both for two weeks in a notebook. Guess B will usually be less wildly wrong, even when it is not more accurate on average. Then ask the sharp question: what happens if my rule is wrong?
Ages 13+: Build the constraint
In a spreadsheet, make a simple bucket model with three columns: rain (input), outflow, and stored water. Column three must equal previous storage plus rain minus outflow. Let your teen fit an outflow rule (outflow = k × storage) to invented data by adjusting k until predictions match. They have just built a one-parameter conceptual hydrology model with a hard mass-balance constraint. Then have them read the abstract of the Raissi et al. 2019 paper and identify the two loss terms. Most high schoolers can follow it once they have built the bucket.
The question to ask: “If the model’s physics rule were slightly wrong, would you be able to tell from its predictions? How?”
Pure ML versus physics-informed ML
| Question | Pure machine learning | Physics-informed / hybrid |
|---|---|---|
| What it learns | A mapping from inputs to outputs | Parameters and residuals inside known equations |
| Data needed | Large labeled histories | Much less; physics supplies structure |
| Behavior outside training range | Unreliable, can be absurd | Constrained by conservation laws |
| Works in an ungauged basin | Poorly | Designed for it |
| Interpretability | Low; weights are opaque | Moderate; parameters have physical meaning |
| Main failure mode | Confident nonsense | Confidently consistent with wrong physics |
| Cost to build | Lower | Higher; needs domain scientists |
The row that should change how you read science news is the second-to-last one. Both approaches fail. They fail differently, and the physics-informed failure is quieter.
What to actually do at home
Use the phrase “what rule did it have to obey?”
When your kid shows you an AI prediction, from a weather app to a chatbot’s math, the useful question is whether anything constrained it. Chatbots have almost no hard constraints, which is why they produce arithmetic that violates arithmetic. Weather models have many. That single question separates most AI tools into two piles.
Connect it to the science your kid is already assigned
Conservation of mass and energy show up in middle-school science, and most kids experience them as vocabulary to memorize. Physics-informed ML is the rare example where a conservation law does something visible: it makes a computer program better at predicting floods. Use the Penn State model as the answer to “why do I need to know this?”
Point at the local version
The National Weather Service publishes river forecasts for gauges near you through its water prediction service, and USGS publishes real-time streamflow. Pull up the nearest gauge with your kid after a storm and watch the response curve: rain, then a delay, then a rise. That delay is the soil doing its job, and it is precisely what the model’s infiltration parameters describe.
Keep the careers real without overselling
Hydrologic modeling is a small field that is currently hiring, partly because differentiable modeling requires people who can do both PDEs and PyTorch. If your teen likes water and code, that intersection is unusually underpopulated. Our hydrologist and AI water careers piece covers the actual path, and Penn State’s hybrid hydrology model goes deeper on the paper.
What not to do
Do not let “AI plus physics” become a phrase your kid repeats without a mechanism. If they cannot state one law the model obeys, they have learned a slogan. The bucket exercise fixes this in one afternoon.
What to Watch For Over the Next 3 Months
- Week 4: Your kid can state one conservation law and explain, in their own words, how a computer program could be punished for breaking it.
- Month 2 red flags: Your kid treats any model with “physics” in the description as trustworthy; or cannot distinguish a constrained prediction from a chatbot guess.
- Month 3 self-check: After the next big storm in your area, check whether the official forecast matched what happened at the local gauge. Model skepticism is built by watching real forecasts, not by reading about them.
Frequently Asked Questions
Is physics-informed ML the same as a simulation?
No. A traditional simulation encodes physics and requires you to supply the parameters. A pure ML model learns from data with no physics. Physics-informed ML sits between: the physics is encoded, and the parameters are learned from data. That middle position is what makes it work in places with little data.
Does this only apply to water?
No. The same approach is used in fluid dynamics, materials science, plasma physics, structural engineering, and climate modeling. Water is just where the public payoff is most obvious, since flood forecasting saves lives in regions with no monitoring infrastructure.
Why can’t we just collect more data?
Because river gauges cost money to install and maintain, and the regions with the worst flood risk often have the fewest. That is the whole argument for physics-informed and foundation-model approaches: the constraint or the pretraining substitutes for measurement history you will never have.
Is this related to AI weather models like GraphCast?
Related but different. Models like GraphCast and WeatherNext are largely learned from reanalysis data without explicit equations in the loss, and they do very well at short and medium range. Physics-informed hybrids are more common where data is sparse or where extrapolation beyond observed extremes matters. Our explainer on graph neural networks for weather and molecules covers that family.
What math does my teen need for this field?
Differential equations and linear algebra, plus enough programming to use PyTorch or JAX. Realistically that means calculus in high school and a physics or engineering track in college. The differentiable-programming part is learnable in months once the math is in place.
How accurate are these flood models in practice?
Good enough to be operationally useful and not good enough to stop evacuating. The Penn State model’s contribution is coverage and resolution at global scale, not perfect local accuracy. Treat any single forecast as a probability, which is how hydrologists treat it.
About the author
Ricky Flores is the founder of HiWave Makers and an electrical engineer with 15+ years of experience building consumer technology at Apple, Samsung, and Texas Instruments. He writes about how kids learn to build, think, and create in a tech-saturated world. Read more at hiwavemakers.com.
Sources
- Penn State. “AI-powered model predicts floods, improves water management worldwide.” Penn State News. https://www.psu.edu/news/research/story/ai-powered-model-predicts-floods-improves-water-management-worldwide
- Song, Y., et al. (2026). “Physics-Informed, Differentiable Hydrologic Models for Capturing Unseen Extreme Events.” Water Resources Research. https://agupubs.onlinelibrary.wiley.com/doi/10.1029/2025WR040414
- 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. https://doi.org/10.1016/j.jcp.2018.10.045
- Shen, C., et al. “Distinct hydrologic response patterns and trends worldwide revealed by physics-embedded learning.” arXiv 2504.10707. https://arxiv.org/pdf/2504.10707
- Phys.org. (2025, October). “Physics-based model can predict floods and improve water management worldwide.” https://phys.org/news/2025-10-physics-based-worldwide.html
- US Geological Survey. “National Water Dashboard: real-time streamflow.” https://dashboard.waterdata.usgs.gov/
- NOAA National Water Prediction Service. https://water.noaa.gov/