Published February 27, 2026 | Version v2
Software Open

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

Authors/Creators

  • 1. Mustafa Kemal University Faculty of Arts and Science

Description

This repository contains the complete source code, simulation datasets, and analysis scripts required to reproduce the findings presented in the associated Swarm and Evolutionary Computation (SWEC) manuscript. The study introduces PyPhysDisc, a co-evolutionary genetic-programming framework that couples the evolution of mathematical expression trees with the autonomous adaptation of signal-processing parameters (Savitzky-Golay smoothing window), resolving the derivative-noise dilemma in symbolic regression.

Repository Contents:

  • code/pyphysdisc_core.py: The core DEAP-based library implementing the co-evolutionary algorithm. It encodes the smoothing window (w) as a co-evolving discrete gene within each individual, enabling synergistic adaptation under a single fitness pressure.
  • code/experiment_suite.py & code/benchmark_convergence.py: Master execution scripts to reproduce all experiments:
    • Experiment 1: Noise Robustness Sweep (Lorenz, Van der Pol, Duffing, Lotka-Volterra).
    • Experiment 2: Window Ablation Study (Co-Evo vs. Fixed-Window Variance).
    • Experiment 3: Strategy Comparison (Benchmark D: Oracle vs. Co-Evo vs. Random/Fixed).
    • Experiment 4: Co-evolutionary Dynamics Evidence (Per-generation entropy collapse).
    • Experiment 5 & 6: Non-Polynomial Laws (Pendulum) and Runtime Scaling.
  • code/gen*_fig.py: Plotting scripts to reproduce high-resolution publication figures (Fitness Landscape Shift, Convergence Curves, Ablation) following journal standards.
  • data/: Folder containing the raw .csv outputs from the experiments (e.g., benchmark_results.csv, coevo_dynamics.csv), allowing for the reproduction of figures and statistical tests without re-running intensive evolutionary searches.
  • requirements.txt: List of Python dependencies (DEAP, NumPy, SciPy, Pandas, Matplotlib) required to run the code.

Methodology Highlights:

  • Benchmark Systems: Lorenz (Chaotic), Van der Pol (Limit-cycle), Duffing (Stiff/Nonlinear), Lotka-Volterra (Periodic predator-prey), and Spinning Pendulum.
  • Technique: Co-evolutionary Symbolic Regression. Unlike standard sparse regression methods (e.g., SINDy) or standard GP that require external hyperparameter tuning, PyPhysDisc simultaneously evolves the equation structure and the smoothing window, resulting in complexity-aware filtering.

Key Results:

  • Genuine Co-evolution: Shannon entropy of the window-gene distribution drops by 82% over 40 generations, with elite window fraction reaching 1.0, proving directed selection rather than drift.
  • Near-Oracle Performance: Achieves R^2 = 0.961 on the Lorenz system at 20% noise without manual tuning, within 2.2 percentage points of an oracle holding the true optimal window, while variance is reduced by 95% compared to fixed-window GP.
  • Generality: Successfully discovers transcendental functions (-sin(theta) in the pendulum) from an elementary operator set.

Usage:

To reproduce the full suite of experiments:

  1. Install dependencies: pip install -r requirements.txt
  2. Run the master scripts: python code/experiment_suite.py (or benchmark_convergence.py for per-generation metrics)
  3. Select the desired experiment to run or generate figures via the plotting scripts.

Files

benchmark_convergence.csv

Files (315.6 kB)

Name Size Download all
md5:ed6601652f43bb9fb3ad2ec95fd3e9ac
2.6 kB Download
md5:17a22fed5290351f5f02de9be09fbfd1
2.9 kB Download
md5:1ced6d0cfbf968b1acde815868d04635
38.5 kB Preview Download
md5:7c1f9bf4dbd099fc1c08eb4dafce7e7a
3.2 kB Download
md5:e1e49f9397e6941955b54d8217e3ed0f
1.7 kB Preview Download
md5:8efe2fef8f4ab7077feb486bf0a0e434
2.1 kB Preview Download
md5:d6638cd73e275a57a78a5dfe7430c65e
2.0 kB Preview Download
md5:5af8c62dfc36a6389c9a9cf04d8432a0
11.5 kB Download
md5:c78fd27eebbd3d02857fc14ce57eea61
6.1 kB Preview Download
md5:eed9df951d05055f4ce1590e9ed8f7fb
2.4 kB Preview Download
md5:a21e9cb5651643e9d03b718da0c71c75
42.1 kB Preview Download
md5:52a07134d516c1986c4a2aecdaa5f742
634 Bytes Preview Download
md5:fb22195e30811bc3678a141579303f93
97.2 kB Preview Download
md5:325666677fe0c2d3d36450430e5ee11f
32.3 kB Preview Download
md5:47f0869537a2dc900d48cce685067cee
20.9 kB Download
md5:5ffd410ab6c0226e16706d8c438d8c41
21.4 kB Download
md5:338e371cb476c33e0577ca292517cc01
20.7 kB Download
md5:9338e0f8dcc1b8547e5217cd15a05284
7.4 kB Download

Additional details

Software

Programming language
Python
Development Status
Concept