PyPhysDisc: Autonomous Discovery of Physical Laws from Noisy Data via Co-evolutionary Symbolic Regression and Smoothing

Read full text
Authors: Ali Tozar
Cited by: 0

Abstract

This repository contains the complete source code, simulation datasets, and analysis scripts required to reproduce the findings presented in the associated manuscript. The study introduces PyPhysDisc, a co-evolutionary framework that couples the evolution of mathematical model structures with the autonomous optimization of data preprocessing parameters (smoothing window size), addressing the "derivative-noise dilemma" in symbolic regression. Repository Contents: code/pyphysdisc_core.py: The core library implementing the co-evolutionary algorithm. It integrates Genetic Programming (via DEAP) with an adaptive Savitzky-Golay filter gene, treating the smoothing window ($w$) as an evolvable trait. code/experiment_runner.py: The master execution script that reproduces all experiments presented in the paper via an interactive menu: Experiment 1: Noise Robustness Sweep (Lorenz, Lotka-Volterra, SIR, Duffing). Experiment 2: Ablation Study (Comparison of Fixed Window vs. Co-Evolution). Experiment 3: Convergence Analysis (Impact of the square operator). Experiment 4: Computational Scaling Tests. code/plotting_utils.py: Plotting scripts to reproduce high-resolution publication figures (Figures 1–4 and Supplementary Figures S1–S7) following CPC style guidelines. data/: Folder containing the raw .csv outputs from the experiments (e.g., exp_01_results.csv, benchmark_vanderpol.csv), allowing for the reproduction of figures without re-running computationally intensive evolutionary searches. requirements.txt: List of Python dependencies (DEAP, NumPy, SciPy, Pandas, etc.) required to run the code. README.md: Detailed instructions on installation, usage, and citation. Methodology Highlights: Benchmark Systems: Lorenz Attractor (Chaotic), Lotka-Volterra (Periodic), SIR Model (Asymptotic/Slow), Duffing Oscillator (Stiff/Nonlinear), and Spinning Pendulum. Technique: Co-evolutionary Symbolic Regression. Unlike standard methods (e.g., SINDy) that require manual preprocessing, PyPhysDisc simultaneously evolves the symbolic equation tree and the smoothing parameters ($w$) to find the Pareto-optimal balance between noise suppression and feature preservation. Key Results: Autonomous Adaptation: The algorithm correctly identifies system-specific time scales (e.g., selecting $w \approx 17$ for Lorenz to preserve chaos, and $w=51$ for SIR to suppress noise). Noise Robustness: Maintains high accuracy ($R^2 > 0.90$) up to 20% noise levels, where fixed-window benchmarks fail. Generality: Successfully recovers non-polynomial laws (e.g., $\sin(\theta)$ in the Spinning Pendulum) without predefined library assumptions. Usage: To reproduce the full suite of experiments: Install dependencies: pip install -r requirements.txt Run the master script: python code/experiment_runner.py Select the desired experiment from the menu.

Fields of Study & Subjects

Evolutionary Algorithms and Applications Metaheuristic Optimization Algorithms Research Model Reduction and Neural Networks

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
15 January 2026