This repository contains the source code for the open-access journal article Kinon, P. L., Morandin, R. & Schulze, P. (2025): Discrete gradient methods for port-Hamiltonian differential-algebraic equations.
If you found our project helpful or you have used it in your academic work, please consider citing it:
@article{kinon_morandin_schulze_2026,
title = {Discrete gradient methods for port-Hamiltonian differential-algebraic equations},
author = {Philipp L. Kinon and Riccardo Morandin and Philipp Schulze},
journal = {Applied Numerical Mathematics},
year = {2026},
volume = {223},
pages = {45-75},
issn = {0168-9274},
doi = {https://doi.org/10.1016/j.apnum.2025.12.006},
}and the latest Zenodo-DOI. Please see the license.
The implementation of time integrators and example systems has been done in the package pydykit, which is used here.
-
Clone this repository to your machine.
-
Open a terminal and navigate to your local clone.
-
Create a new virtual environment and activate it. We recommend using
venv:python3.12 -m venv .venv source .venv/bin/activate
pip install pydykit==0.0.6This repo can be used in two ways:
-
For validation:
Extract your desired result data as
.csv-file data from the results folder. -
For verification:
In the terminal, with the activated environment, run your desired script:
python scripts/*.pyThis will overwrite the correspoding results file in the results folder. For the error analysis choose the desired integration scheme in the respective script.