Distilled Symbolic Laws (SINDy Sparse Identification)
How Machines Learn the Structure of Reality
Physical laws are not mere arbitrary regression fits—they reflect deep symmetry groups and conservation principles (Noether's Theorem). When neural architectures or symbolic engines inspect physical trajectories, they identify invariants: quantities that remain precisely constant along the system's vector field.
This workbench implements SINDy (Sparse Identification of Nonlinear Dynamics):
- Phase Reconstruction: We record coordinate-momentum pairs $\mathbf{x}(t) = [q(t), p(t)]$ and compute finite-difference velocity vectors $\dot{\mathbf{x}}(t)$.
- Nonlinear Library Matrix $\Theta(\mathbf{X})$: We build candidate basis functions: $[1, q, p, q^2, qp, p^2, q^3, \sin(q), \cos(q)]$.
- Sparse Ridge Thresholding: We solve $\dot{\mathbf{x}} = \Theta(\mathbf{x})\mathbf{\Xi}$ via sequential thresholded least squares, zeroing coefficients below $\lambda$. Parsimony drives the model to choose the exact natural law.
- Symplectic Invariant Recovery: By computing the curl and verifying $\frac{\partial H}{\partial p} = \dot{q}$ and $-\frac{\partial H}{\partial q} = \dot{p}$, the algorithm reconstructs the system's Hamiltonian without human supervision.
Understanding Conserved Quantities
Try selecting different dynamical systems above:
- Nonlinear Pendulum: Transition from linear harmonic oscillation at low energy to large-amplitude nonlinear periods, where $\sin(q) \neq q$.
- Kepler 2-Body: Inverse-square gravitational orbits conserving both total energy $E$ and angular momentum $L = r^2 \dot{\theta}$.
- Duffing Oscillator: A double-well potential exhibiting bistability and chaotic separatrix crossing under perturbation.
- Lotka-Volterra: Ecological predator-prey dynamics preserving a non-polynomial logarithmic conserved manifold $V(x,y)$.
Why is parsimony (sparsity) critical for physical discovery?
Dense models like unconstrained deep neural networks can overfit any empirical curve but generalize poorly outside the training distribution. Physical reality follows minimal action; sparse symbolic regression finds the simplest equation that generates the data, preventing spurious high-order polynomial artifacts.
Can this handle noisy sensor measurements?
Yes. Increase the sensor noise slider to simulate measurement uncertainty. Notice how increasing the sparsity threshold $\lambda$ strips out noise terms while preserving the dominant physical attractor.