Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Letting data reveal the rules
Physicists look for quantities that never change, such as energy and momentum, and for rules that say how a result must scale with the inputs. Both can be searched for in data. A conserved quantity is a combination of measured variables that stays constant along every recorded motion. A scaling law follows from units: a pendulum’s period can only depend on length and gravity through √(L/g), because no other combination of them has units of time.
Conservation laws and dimensional analysis are among the strongest constraints in physics; finding them from data narrows every later model.
- 1. A conserved quantity…
- 2. Units constrain a law because…
- 3. A pendulum's period depends on L and g through…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.By hand
- Conserved quantity: H(x, v) with dH/dt = 0 along trajectories. Written as H = Σ c_k θ_k(x, v) over a library of candidate terms, conservation means a matrix times c is zero: c is a null vector, found by the singular value decomposition.
- Two versions: with derivatives, the rows are d/dt of each library term; without derivatives, the rows are library values minus their mean along each trajectory, since H is constant there.
- Buckingham Π theorem: a law in n variables built from k independent units can be rewritten in n − k dimensionless groups. The exponents of the groups span the null space of the dimension matrix.
- Power-law fits: least squares on logarithms recovers exponents of y = C Π x_k^(a_k); units check the result.
- Beyond: symmetry discovery, Hamiltonian and Lagrangian neural networks, and automated search for invariants (Schmidt and Lipson, 2009; Liu and Tegmark, 2021).
- 1. A conserved H = Σ c_k θ_k is found as…
- 2. The Π theorem gives…
- 3. Exponents of a power law are fitted…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.Conserved quantities and periods
Exercise 1.
- The undamped Duffing oscillator x′ = v, v′ = −x − x³, integrated with RK4 (Δt = 0.01, 2000 steps) from 10 random starts in [−1.5, 1.5]².
- A library of the 14 monomials x^i v^j with degree 1 to 4; the energy x²/2 + v²/2 + x⁴/4 is one combination of them.
- The exact pendulum period 4√(L/g)·K(sin(θ0/2)), with the elliptic integral K computed by the arithmetic–geometric mean.
Practice.
- Scale library columns before the SVD so the smallest singular value is not set by units.
- Check the gap between the two smallest singular values: one tiny value means one invariant; several mean the library is redundant.
- Avoid numerical derivatives when possible; integral or value-based forms tolerate more noise.
- Use units first: reduce variables to dimensionless groups, then fit a function of fewer arguments.
- Tools: NumPy SVD, PySINDy for libraries, PySR for the remaining function, and Hamiltonian neural networks for learned invariants.
import numpy as np
L = library(trajectories) # (time, trajectory, terms)
D = (L - L.mean(axis=0)).reshape(-1, L.shape[-1]) # H constant along each trajectory
scale = np.linalg.norm(D, axis=0)
_, s, Vt = np.linalg.svd(D / scale, full_matrices=False)
c = Vt[-1] / scale # coefficients of the invariant
print(s[-1] / s[0], s[-2] / s[0]) # one tiny value: one invariant- 1. Library columns are scaled before the SVD so that…
- 2. One tiny singular value means…
- 3. A library for learned invariants with neural networks:
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Why the null vector. If H = Σ c_k θ_k is conserved, then Σ c_k dθ_k/dt = 0 at every sample, so the matrix of time derivatives times c is zero. On clean data the smallest singular value relative to the largest was 3e-10 with derivatives and 7e-10 with values, against 0.03 for the next one: a single invariant, recovered to better than 0.001.
Why noise breaks it. The noise enters the library itself, not only the target, so least squares no longer has an unbiased answer (an errors-in-variables problem). Numerical derivatives amplify noise by about 1/Δt, so at 0.1% noise the derivative-based search already returned wrong coefficients (largest relative error 1.0), while the value-based search kept 0.005. At 1% noise the value-based search failed too (0.6).
Dimensions first. For the period T of a pendulum with mass m, length L and gravity g, the dimension matrix has a one-dimensional null space, so T√(g/L) is the only dimensionless group and mass cannot appear. Everything else is a function of the amplitude θ0, whose series is 2π(1 + θ0²/16 + …).
- 1. At 0.1% noise the derivative-based search…
- 2. Noise inside the library causes…
- 3. Mass is absent from the pendulum law because…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.How reliably can a conserved quantity and a scaling law be discovered from noisy data, and what do derivatives and units change?
History.
- E. Buckingham (1914) stated the Π theorem.
- M. Schmidt and H. Lipson (2009) searched for invariants of motion data with symbolic regression.
- S. Greydanus, M. Dzamba and J. Yosinski (2019) introduced Hamiltonian neural networks.
- Z. Liu and M. Tegmark (2021) discovered conservation laws with machine learning.
Exercise 2. The Duffing trajectories of Exercise 1 with Gaussian noise, and 40 pendulum periods with 1% timing noise. Largest relative error of the energy coefficients (largest spurious coefficient in brackets), seed 0:
| noise | with derivatives | from values |
|---|---|---|
| 0 | under 0.001 (under 0.001) | under 0.001 (under 0.001) |
| 0.001 | 1.0 (0.2) | 0.005 (under 0.001) |
| 0.01 | 2.0 (0.2) | 0.6 (0.07) |
- Power law at small amplitude: T = 6.26·m^0.0·L^0.5·g^−0.5, so T = 2π√(L/g) with no mass dependence.
- Amplitude: T√(g/L) = 6.256 + 0.37 θ0² + 0.042 θ0⁴ for θ0 up to 2.5. The θ0² coefficient is close to the series value 2π/16 = 0.393; the θ0⁴ term absorbs higher orders and is not the series value 0.0225.
- Seeds 1 and 2: values-based errors 0.01 and 0.01 at 0.1% noise and 1.0 and 0.9 at 1%; derivative-based 2.0 at both noise levels; power-law constants 6.3 and 6.28; θ0² coefficients 0.296 and 0.344.
Discovery from data in practice
- Mechanics: invariants and Hamiltonians learned from video and sensor data.
- Fluids: scaling laws and dimensionless groups for drag, heat transfer and turbulence from experiments.
- Astrophysics: scaling relations between galaxy and halo properties.
- Engineering: dimensionless correlations that let small-scale tests predict full-scale behaviour.
References
- E. Buckingham (1914). “On physically similar systems; illustrations of the use of dimensional equations.” Physical Review.
- M. Schmidt and H. Lipson (2009). “Distilling free-form natural laws from experimental data.” Science.
- S. Greydanus, M. Dzamba and J. Yosinski (2019). “Hamiltonian neural networks.” NeurIPS.
- Z. Liu and M. Tegmark (2021). “Machine learning conservation laws from trajectories.” Physical Review Letters.
- G. I. Barenblatt (1996). Scaling, Self-Similarity, and Intermediate Asymptotics. Cambridge University Press.