# Symbolic regression driven by dimensional analysis for the automated discovery of physical laws and constants of nature

Wassim Tenachi, Rodrigo Ibata, Foivos I Diakogiannis

► To cite this version:

Wassim Tenachi, Rodrigo Ibata, Foivos I Diakogiannis. Symbolic regression driven by dimensional analysis for the automated discovery of physical laws and constants of nature. Journées 2023 de la Société Française d'Astronomie & d'Astrophysique (SF2A)., Jun 2023, Strasbourg, France. pp.107-108. hal-04325284

HAL Id: hal-04325284

https://hal.science/hal-04325284v1

Submitted on 7 Dec 2023

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
# SYMBOLIC REGRESSION DRIVEN BY DIMENSIONAL ANALYSIS FOR THE AUTOMATED DISCOVERY OF PHYSICAL LAWS AND CONSTANTS OF NATURE

Wassim Tenachi<fnref n="1" />, Rodrigo Ibata<fnref n="1" /> and Foivos I. Diakogiannis<fnref n="2" />

**Abstract.** Given the abundance of empirical laws in astrophysics, the rise of agnostic and automatic methods to derive them from data is of great interest. This concept is embodied in symbolic regression, which seeks to identify the best functional form fitting a dataset. Here we present a protocol for deducing both physical laws but also the constants of nature appearing in those with their associated units. Our method is grounded in the Physical Symbolic Optimization framework, which integrates dimensional analysis with deep reinforcement learning. We showcase our approach on a panel of equations from (astro)-physics.

**Keywords:** Symbolic regression, Dimensional Analysis, Reinforcement learning

## 1 Introduction

Physical theories, including astrophysical ones, often originate from empirical laws. Typically, physicists observe phenomena, derive empirical laws, and then formulate overarching theories that encompass these laws, e.g., Newton's law of universal gravitation ? which describes both the movement of objects on Earth and the movement of planets themselves. However, with the rise of deep learning, many empirical laws are now represented as neural networks, complicating their integration into broader theories. While neural networks are indispensable for modeling complex or high-dimensional data, such as images, there are instances where these models can be distilled into simpler analytical expressions (see e.g., ?), bridging the gap between empirical laws and theoretical understanding.

Our research project aims to build a method for agnostically bridging this gap. In Section ??, we briefly summarize how we employ dimensional analysis alongside reinforcement learning to derive physical analytical expressions through our Physical Symbolic Optimization framework detailed in ?. Subsequently, in Section ??, we introduce a protocol to simultaneously identify concise physical laws and the constants that should appear in those with appropriate units such that the resulting law is accurate, succinct, and adheres to dimensional analysis principles.

## 2 Recovering physical laws

Symbolic regression (SR) consists in the inference of a free-form symbolic analytical function $f: \mathbb{R}^n \rightarrow \mathbb{R}$ that fits $y = f(x)$ given $(x, y)$ data. It is distinct from numerical parameter optimization procedures in that it consists in a search in the space of functional forms themselves by optimizing the arrangement of mathematical symbols (e.g. $x, +, -, \times, /, \sin, \exp, \log, ...$).

Here we adopt the Physical Symbolic Optimization (Φ-SO) framework detailed in ? which was built from the ground up for physics. In this framework, the search space is reduced by leveraging physical units constraints (e.g., cos is dimensionless, velocity + length/□ $\Leftrightarrow$ □ is a time etc.) and proposing physically meaningful expressions only. Φ-SO relies on a recurrent neural network (RNN) to generate multiple trial analytical expressions. Fit quality of these expressions can then be assessed against data. The best expressions are then reinforced and the process is repeated until the RNN converges and yields a set of high quality expressions.

Φ-SO was evaluated using a standard benchmark of 120 equations from the Feynman Lectures on Physics (?) following the SRBench procedure (?), with the objective of accurately recovering the expressions from their associated datasets. It achieved state-of-the-art performance in the presence of noise (exceeding 0.1%) and showed robust performances even in the presence of substantial (10%) noise.

<footnote n="1">¹ Université de Strasbourg, CNRS, Observatoire astronomique de Strasbourg, UMR 7550, F-67000 Strasbourg, France</footnote>

<footnote n="2">² Data61, CSIRO, Kensington, WA 6155, Australia</footnote>
## 3 Composing natural constants

For new scientific discovery, there are instances where the appropriate free parameters and their corresponding units are not immediately evident. In such situations, we propose a protocol wherein Φ-SO is allowed one free parameter for each input variable, sharing the same units, and another free parameter reflecting the units of the output variable. Specifically, for an SR problem consisting in the deduction of y from {$x_1, ..., x_n$}, we would permit the inclusion of {$\theta_y, \theta_{x_1}, ..., \theta_{x_n}$} as free constants. This grants Φ-SO the flexibility to selectively combine or omit these free parameters to construct new parameters that align with dimensional analysis constraints. In this setup, we demonstrate that Φ-SO can adeptly resolve the SR challenges outlined in Table ??, yielding both the precise symbolic expressions and their corresponding physical constants with accurate units.

<table><caption>**Table 1.** Target expressions. Input variables are colored in red with recovered natural constants to recover left in black.</caption><thead><tr><td>Case</td><td>Expression</td></tr></thead><tbody><tr><td>Ideal Gas Law</td><td>P = <sup>nRT</sup>&frasl;<sub>V</sub></td></tr><tr><td>Free Fall Terminal Velocity</td><td>v<sub>t</sub> = &radic;<span style="text-decoration: overline;"><sup>2mg</sup>&frasl;<sub>&rho;AC<sub>d</sub></sub></span></td></tr><tr><td>Classical Gravity</td><td>F = <sup>Gm<sub>1</sub>m<sub>2</sub></sup>&frasl;<sub>r<sup>2</sup></sub></td></tr><tr><td>Black Body Photon Count</td><td>n = 1/(e<sup>h&nu;</sup>/<sub>k<sub>b</sub>T</sub> - 1)</td></tr></tbody></table>

For illustration, Φ-SO successfully derives the equation describing the equation of state of an ideal gas $P = C \frac{nT}{V}$ with $C = \frac{\theta_P \theta_V}{\theta_n \theta_T}$ having units $M.L^2.T^{-2}.K^{-1}.N^{-1}$ effectively rediscovering the ideal gas constant usually denoted by R. Similarly, Φ-SO is able to recover the expression for the terminal velocity of a free falling object as a function of its mass $m$, its surface area $A$ and the density of the medium it traverses $\rho$ as $v_t = \sqrt{\frac{C \frac{m}{\rho A}}{\theta}}$ by unveiling its proportionality to the square root of an acceleration $\sqrt{C}$, formulated by Φ-SO as $\sqrt{\frac{\theta v_t}{\theta_A}}$, corresponding to the Earth surface gravity $\sqrt{g}$ and other scale factors.

Interestingly, while the discussion on interpretability often revolves around the agnostic recovery of functional forms (as in our main study ?), incorporating dimensional analysis introduces fresh perspectives. Specifically, it offers a method to agnostically determine the most straight forward units of the degrees of freedom such that these units are the simplest combination of the problem's natural units, and that the resulting expression is not only predictive but also physically sound and concise.

## Code availability

The documented code for the Φ-SO algorithm along with demonstration notebooks are available on GitHub [github.com/WassimTenachi/PhySO](https://github.com/WassimTenachi/PhySO).

RI acknowledges funding from the European Research Council (ERC) under the European Unions Horizon 2020 research and innovation programme (grant agreement No. 834148).

## References

* Feynman, R. P., Leighton, R. B., Sands, M., et al. 1971, The Feynman lectures on physics, Vol. 1-3 (Addison-Wesley Reading, MA)

* La Cava, W., Orzechowski, P., Burlacu, B., et al. 2021, in Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks, ed. J. Vanschoren & S. Yeung, Vol. 1 (Curran). https://datasets-benchmarks-proceedings.neurips.cc/paper_files/paper/2021/file/c0c7c76d30bd3dcaefc96f40275bdc0a-Paper-round1.pdf

* Newton, I. 1687, Philosophiae Naturalis Principia Mathematica

* Tenachi, W., Ibata, R., & Diakogiannis, F. I. 2023a, arXiv e-prints, arXiv:2305.16845, doi: 10.48550/arXiv.2305.16845
—. 2023b, arXiv e-prints, arXiv:2303.03192, doi: 10.48550/arXiv.2303.03192