Symbolic Physical Laws DiscoveryLaws in practice

Module 8PDEs, fields and graphs

Many laws live in space as well as time: a temperature in a solid, a concentration in a fluid, a plant spreading along a coast. With our own simulations of a plant on a 100-km coast (the Fisher–KPP equation) we see why second derivatives from noisy sensors fail, and how the weak form in space and time avoids them; read initial and boundary conditions as evidence, since one front sliding through a window looks like drift; check conservation without derivatives; and choose among plausible laws with an experiment the fit never saw. Then the plant moves to forty ponds with no grid at all: spread becomes a sum over neighbours on a graph, the edges become part of the model, a delay offered to the search turns out to come from the noise, the law transfers to a new map, and a beetle that eats the plant shows what coupled fields need from the data.

By the end you should be able to estimate what a field law needs and use the weak form in space and time, read initial and boundary conditions as evidence, check conservation, choose among plausible laws with held-out experiments, write laws on graphs with the edges as part of the model, test delays with a negative control, transfer a graph law to a new map, and report benchmarks you can trust.

Key ideas, one per video

  • Video 16At 1 km spacing the true curvature of the cover profile was five times smaller than the noise of its three-point estimate; finite differences never found the law, while the weak form found it in 20, 20 and 19 of 20 draws at 0.2, 0.5 and 1% noise, and in none at 2%. Total cover matched summed growth within 0.6%, and on two merging releases the true three-term law forecast best; a cubic term fit slightly better and forecast worse.
  • Video 17On forty ponds the lowest fit error came from the graph we simulated with in 20 of 20 draws; it forecast a new introduction within a median 0.75 weeks, while nearest-neighbour graphs missed by 11.5 and 14.5 weeks. A one-week delay improved the fit and was chosen every time at 1% noise, never with cleaner data, and forecast 3.25 weeks off. The law transferred to a new map within 0.75 weeks, and the coupled plant and beetle laws went from 11 and 12 of 20 draws to 20 and 20 with a second run.

Book: Chapter 8 of Computational Methods for Symbolic Physical Laws Discovery by Teddy Lazebnik (coming soon). The videos and slides follow the chapter’s topics in our own words, figures and simulations; nothing is copied from the book.

The title slide of Module 8: PDEs, fields and graphs

25 slides, written to be read on your own, with worked examples, our own small simulations and check-yourself questions (answers at the end). PDF, 1.8 MB.

Watch

2 videos for this module, each about 8 to 15 minutes. Pick one from the list, and open the transcript to read along: each timestamp plays the video from there. The narration is generated with a voice clone of Teddy, used with his permission.

Video 16 · 8:36

Laws in space and time

Watching one front pass a 40-km stretch of coast, a law-finding search wrote a drift that isn't there. A release in the middle gave the true law.

At 1 km spacing the true curvature of the cover profile was five times smaller than the noise of its three-point estimate; finite differences never found the law, while the weak form found it in 20, 20 and 19 of 20 draws at 0.2, 0.5 and 1% noise, and in none at 2%. Total cover matched summed growth within 0.6%, and on two merging releases the true three-term law forecast best; a cubic term fit slightly better and forecast worse.

TranscriptVideo 16
0:00

A plant on the coast. A plant is spreading along a hundred kilometres of coast. Sensors every kilometre report how much of the ground it covers, four times a week. We simulated it, added one percent noise, and gave a law-finding search the readings from a forty-kilometre stretch while one front passed through. It wrote five terms, including a drift, as if a wind were pushing the plant along the coast. Nineteen noise draws out of twenty included that drift. Then we released the same plant in the middle of the coast and gave the search the whole coast from the start. Three terms: growth, crowding and spread. The law we simulated, in nineteen draws out of twenty. Same plant, same law, same noise. What changed was what the data saw. This video is about laws in space and time. This is Module eight: partial differential equations, fields and graphs. Part one: fields and their noisy derivatives. Part two: libraries and the weak form in space and time. Part three: initial and boundary conditions as evidence. Part four: conservation. Part five: choosing among plausible laws.

1:11

A field and its law. A field is a quantity with a value at every place and every time. Here, u is the fraction of ground the plant covers, between zero and one, at each point along the coast, in each week. The law we simulated is a classic. The rate of change of u equals 0.5 times u times one minus u, plus 4 times the second derivative of u in space. The first part is growth that slows as the ground fills up. The second is spread: plant moves from crowded stretches into empty ones. Laws like this make fronts that travel. Theory says the front's speed settles at 2.8 kilometres a week. Over our 24 weeks, the front averaged 2.5, still speeding up toward that limit. Before any search, look at what the field shows. The release flattens and widens. Two fronts move apart at the same speed. And after about twenty-one weeks, they reach the closed ends of the coast, where nothing leaves. Where does 2.8 come from? At the leading edge, the plant is sparse, so crowding hardly matters yet. There, growth and spread alone set the pace, and the speed works out to twice the square root of the growth rate times the spread rate: twice the square root of 0.5 times 4.

2:25

Derivatives in a field. Part one: derivatives in a field. The law needs the second derivative in space, the curvature of the cover profile. With a sensor every kilometre, the simplest estimate takes three neighbouring readings: left plus right, minus twice the middle. At week twelve, the largest true curvature anywhere on the coast was 0.005 per square kilometre. With one percent noise, the error of that three-point estimate was 0.023. The noise is five times the biggest signal. The signal is small because the profile bends gently over many kilometres, while the noise of three readings adds up. Finite differences failed at every noise level we tried, even at 0.2 percent. In a field, the derivative problem from Module five comes back stronger: more derivatives, and higher ones.

3:17

Libraries and the weak form. Part two: libraries and the weak form. Our library has seven candidate terms. Cover, its square and its cube, for growth and crowding. The first derivative in space, for drift. The second, for spread. Cover times its first derivative, for transport that depends on cover. And a third derivative, which appears in some wave equations. The weak form now works in two directions. Take a window, twelve kilometres by three weeks. Multiply the law by a smooth bump that vanishes at the window's edges, and integrate. Integration by parts moves every derivative, in space and in time, onto the bump, which we know exactly. On the middle release at one percent noise, it returned the growth term, 0.50 u; the crowding term, minus 0.50 u squared; and 3.99 times the second derivative, for the spread. Each weight within one percent of the truth. What's left are integrals of the readings themselves, which average the noise. Across twenty noise draws, the weak form found the law every time at 0.2 percent noise, every time at 0.5 percent, and nineteen times at one percent. It has a limit. At two percent noise it failed too, every time. Past that point, the fix is better data: more sensors, or more frequent readings. A weak form doesn't make noise disappear. It moves the derivatives to where we know them exactly. There's a second gift. Every window gives one equation, and a coast watched for twenty-four weeks holds many windows, so the search sees the same law tested in many places and times at once.

4:49

Initial and boundary conditions as evidence. Part three: initial and boundary conditions are evidence. Back to the opening puzzle. Why did one front, crossing a forty-kilometre stretch, produce a drift? Pause and predict. A front that keeps its shape and moves at a steady speed: which law explains it, growth with spread, or pure drift? Both. A shape sliding at a steady speed satisfies the drift law exactly. Inside that window, the front was close to sliding, so drift and spread could explain the same readings, and the search mixed them. The release in the middle broke the tie. A bump of plant spreads both ways at once, and no single drift can explain that. Two fronts moving apart, a peak that flattens, and closed ends where nothing leaves: each is a place where the candidate laws disagree. Where an experiment starts, and where its edges are, are part of the data. Choose them so that the laws you're comparing must disagree. In practice, ask for the parts of an experiment that look boring: how it starts, what happens at the edges, the moment two fronts meet. Those are where a wrong law gets caught.

5:56

Conservation. Part four: conservation. Many field laws share one shape: the change at a place equals what flows in, minus what flows out, plus what's made there. Spread is a flow. Growth is making. That gives a check that needs no derivative of the field at all. With closed ends, flow only moves plant around. So the total cover along the coast can change only through growth. We checked it on the middle release. At every reading but the first and the last, the rate of change of the total matched the growth summed along the coast to within 0.6 percent of its peak. This splits the library in two. Terms that only move plant should be written as differences of a flow, so they sum to zero over a closed coast. Only growth terms may change the total. Building that split into the library removes candidates before the search begins. Conservation is a law about the law. Check it on the data, then build it into the library.

6:47

Choosing among plausible laws. Part five: choosing among plausible laws. We fitted four candidates to the middle release, then asked each to predict a new experiment: two releases, at 25 and 75 kilometres, whose fronts run into each other. Growth with spread: fit error 0.046, forecast error 0.002 of cover. Add a cubic growth term, and the fit gets slightly better, 0.045, while the forecast gets slightly worse, 0.003. Drift with growth fits four times worse, and misses the merger by 0.6. Spread with growth that never slows misses by about as much: 0.6 again. The cubic term's weight was 0.01, small enough to look harmless. It bought a better fit and a worse forecast. Choose among laws with experiments they haven't seen, designed where they disagree. Fit error alone always rewards an extra term.

7:41

Recap. Let's recap. A field law needs derivatives in space and time, and the higher ones drown in noise. The weak form moves them onto a bump we know exactly. Initial and boundary conditions decide which laws the data can tell apart. One front sliding through a window can't separate drift from spread. Conservation gives a check without derivatives, and a cleaner library. And between plausible laws, held-out experiments decide, not the fit. In the lab, you'll choose the experiment, the noise and the method, and see which laws survive. Next video: what if there's no grid at all? Laws on graphs.

Interactive lab

Field discovery

Choose an experiment on the coast, the noise, the pipeline and the threshold, and run sparse regression on seven candidate field terms. See a window that watches one front invent a drift, find where the weak form stops working, and test the law you find on two releases that merge, an experiment the fit never saw.

The plant is simulated in your browser with the Fisher–KPP equation (sensors every 1 km, four readings a week for 24 weeks, Gaussian noise, closed ends). Four challenges are checked as you go.

Simple math

A plant on the coast, one field law

The page simulates a plant spreading along 100 km of coast with the Fisher–KPP equation: ∂u/∂t = 0.5·u·(1 − u) + 4·∂²u/∂x², where u is the fraction of ground covered. Sensors every 1 km read u four times a week for 24 weeks, with the noise you choose; the ends of the coast are closed. Everything runs in your browser.

A library of field terms
u, u², u³, u_x, u_xx, u·u_x, u_xxx

Growth and crowding, drift, spread, transport that depends on cover, and a wave term.

The weak form
∬ φ·∂u/∂t = −∬ ∂φ/∂t·u

A smooth bump on windows 12 km × 3 weeks takes every derivative; the readings are only integrated.

A held-out test
two releases that merge

The found law runs on an experiment it never saw; the error is in cover, 0 to 1.

–

The law found

Sparse regression on the readings the search saw (map below: green is more cover; time runs down).

–

Terms kept
–
The plant’s law?
–

A test the fit never saw

Two releases, at 25 and 75 km, whose fronts merge. Dashed: the true plant. Orange: the found law from the same start.

Forecast error (RMS, 24 weeks)
–

Challenges

Each one is checked as you go.

  1. Find the plant’s three-term law at 1% noise or more. Hint: the pipeline matters.
  2. Watch one front through the 40-km window and get a law with a drift term; then find the plant’s law from the middle release, with the same noise and method.
  3. Find where the weak form stops working on the middle release: the law found at 1% noise and missed at 2%.
  4. Forecast the merging fronts to within 0.005 of cover (RMS) with a law found at 1% noise or more.