Skip to content
/ GODE Public
forked from ETH-IBK-SMECH/GODE

This repository contains the code of the paper 'Grammar-based Ordinary Differential Equation Discovery' by K. Yu, E. Chatzi and G. Kissas.

License

Notifications You must be signed in to change notification settings

carcruz97/GODE

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grammar-based Ordinary Differential Equation Discovery (GODE)

This repository contains the code for the journal paper 'Grammar-based Ordinary Differential Equation Discovery' published in Mechanical Systems & Signal Processing by K. Yu, E. Chatzi and G. Kissas, available under https://doi.org/10.1016/j.ymssp.2025.113395.

GODE is a methodology for the end-to-end discovery of symbolic ordinary differential equations (ODEs). It combines formal grammars with dimensionality reduction and stochastic search to efficiently search high-dimensional combinatorial spaces. Grammars allow us to seed domain knowledge and structure in both the generation of large pretrained libraries as well as inference processes, effectively reducing the exploration space. This method has been validated on first- and second-order linear and nonlinear ODEs with examples from structural dynamics.

Folder structure

  • GODE: contains code to train the GODE and discover equations with the GODE.
  • odeformer: code to discover equations with ODEFormer. It was slightly adapted to fit the purpose of the comparison and to generate own models. (https://github.com/sdascoli/odeformer)
  • ProGED: code to discover equations with ProGED, used version is 0.8.5. (https://github.com/brencej/ProGED)
  • PySR: code to discover equations with PySR, used version is 0.19.4. (https://github.com/MilesCranmer/PySR)
  • Plots: contains csv-files of the discovered equations by all models and jupyter notebooks to visualize the results

Getting started

To test GODE, please install the requirements of the file 'requirements.txt' in the GODE folder.

The paper presents three benchmarks: Benchmark 1 on one-dimensional explicit ODEs, Benchmark 2 on linear and nonlinear ODEs, Benchmark 3 on nonlinear ODEs from structural dynamics and Benchmark 4 contains the Silverbox benchmark.

For each benchmark, a separate model has been trained (besides Benchmark 3 and 4 use the same model). Depending on the benchmark, different grammars with different maximum lengths of the rule sequence are used, this needs to be specified udner 'grammar/common_args.py'. To for instance test example ID 5 from Benchmark 1 with three runs, after specifying the maximum length of the rule sequence 'MAX_LEN', run in the command line:

python GODE/EquationDiscovery_B1.py 5 3

Disclaimer

Some code snippets from the files 'GODE/parser/cfg_parser.py', 'GODE/model/vae.py' are from the SDVAE implementation: https://github.com/Hanjun-Dai/sdvae, however, the GVAE algorithm follows the original GVAE implementation (https://github.com/mkusner/grammarVAE).

Citing

If you are using the code or find it useful, please consider citing the journal paper.

@article{yu_grammar-based_2025,
    title = {Grammar-based ordinary differential equation discovery},
    volume = {240},
    issn = {08883270},
    url = {https://linkinghub.elsevier.com/retrieve/pii/S0888327025010969},
    doi = {10.1016/j.ymssp.2025.113395},
    language = {en},
    urldate = {2025-10-02},
    journal = {Mechanical Systems and Signal Processing},
    author = {Yu, Karin and Chatzi, Eleni and Kissas, Georgios},
    month = nov,
    year = {2025},
    pages = {113395},
}

About

This repository contains the code of the paper 'Grammar-based Ordinary Differential Equation Discovery' by K. Yu, E. Chatzi and G. Kissas.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 93.5%
  • Python 6.5%