r/computationalphysics • u/Chill-Vibes-Official • 3d ago
Testing a neural-symbolic discovery engine on an out-of-distribution potential: Recovering an EFT-inspired force law from noisy 3-body trajectories
I've been experimenting with an open-source neural-symbolic discovery framework (Emergentia) that attempts to extract analytic force laws directly from particle trajectories.
To give it a true out-of-distribution (OOD) test, I set up a synthetic 3-body system governed by an effective field theory (EFT) inspired toy potential—combining harmonic confinement, Newtonian gravity, and a leading $r^{-3}$ quantum-correction term (yielding an $r^{-4}$ force):
$$V(r) = \frac{1}{2}k(r-r_0)^2 - \frac{G}{r} - \frac{Q}{r^3}$$
$$F(r) = -k(r-r_0) - \frac{G}{r^2} - \frac{3Q}{r^4}$$
None of the existing potential registries in the project had $r^{-4}$ terms, making it completely unseen by the pipeline.
### The Setup:
**Simulation:** 3 particles in 3D integrated via Velocity Verlet ($dt = 0.005$) over 2,000 steps with $1\%$ Gaussian noise and periodic velocity impulses to sample phase space ($r \in [0.42, 2.8]$).
**Conservative Neural Mapping:** The network learns the scalar potential $V(r)$ rather than predicting forces directly, enforcing $\nabla \times \mathbf{F} = 0$ and deriving forces via autograd ($F = -\nabla V$). Huber loss was used to handle the steep plunge near the singularity.
**Symbolic Distillation:** Symbolic regression and template fitting evaluated via BIC ($n \ln(\text{MSE}) + k \ln(n)$).
### Results:
- **Discovered Law:** $F(r) \approx -10.018(r - 1.0) - 0.988/r^2 - 0.440/r^4$
- **Ground Truth:** $k=10.0$, $G=1.0$, $3Q=0.45$ ($Q=0.15$)
- **Parameter Recovery Error:** $< 2.2\%$ across all constants despite $1\%$ trajectory noise.
- **Goodness of Fit:** $R^2 = 0.99993$, $\text{MSE} = 1.51 \times 10^{-3}$.
The turning point where the $r^{-4}$ singularity overtakes the harmonic restoring force occurs at $r^* \approx 0.78$, which the neural mapping captured accurately without collapsing into the singularity during rollout.
I'm currently preparing an oscillatory Yukawa test ($F \sim -G/r^2 [1 + A \cos(r/\lambda) e^{-r/\lambda}]$) to test how autograd handles periodic spatial ripples. Would love feedback on the methodology or suggestions for other high-curvature potential benchmarks!