pymor
pymor copied to clipboard
pH DMD Algorithm
This PR implements the pH DMD algorithm from @Jonas-Nicodemus arXiv preprint. This algorithm suits itself to non-intrusive inference of port-Hamiltonian systems from time domain system data. Alongside the basic algorithm a simple demo has been implemented showing the use of this algorithm on a full order MSD model and a reduced model thereof.
Currently, the main source is only available as a preprint, upon possible publication, an update in the bibliography may be necessary.
It depends on merging #1836 beforehand to make use of the pH reductors implemented there.
Mirroring external branch in external_pr_2027
The demo and tests are failing, probably because the msd
model was changed in the meantime.
This requires some thought on time-stepping, so I postponed it to the next milestone.
This requires some thought on time-stepping, so I postponed it to the next milestone.
With regards to time-stepping the main difference consists in the way the implicit methods sample from the control. This point is particularly relevant because in the corresponding paper the authors mention just after Remark 2.3 that they replaced the usual formulation $u((i + \frac{1}{2}) \cdot \delta_t)$ by averaging both control data $\frac{1}{2} (u_{i} + u_{i + 1})$. Unfortunately, the whole procedure depends on the choice of time-stepping algorithm, wherefore the results largely vary even for a "small" MSD model of order $n = 6$ if a different choice is made.
From my point of view, the easiest way forward would be to implement an additional TimeStepper
for the pH DMD algorithm providing the required replacement of the control's midpoint evaluation. Alternatively, I could implement the algorithm such that it deviates from the original paper and uses the data we can currently compute within pyMOR, however I do not think that this would be the best choice. What is your opinion on this matter, @pmli?
EDIT: I noticed that the signs in the implicit step are no issue, I misread some code there...
pymortests/demos.py
should be updated to runpymordemos/phdmd.py
(the demo is failing currently)
I resolved the conflicts, however I'm having trouble with getting the demos test to run locally. As far as I am aware, adding the line
('phdmd', ['--fom-order=4', '--rom-order=10'])
in the demo test file should allow the demo to run, but for some reason this test just does not cooperate with me. Could you have another look at it @pmli ?
Running the demo works fine for me, e.g., using
cd src/pymortests
xvfb-run pytest 'demos.py::test_demos[phdmd:"--fom-order=4 --rom-order=10"]'
I tried fixing the implementation, but the demo and tests still fail, so I'll postpone working on this (including if the implementation can be generalized to Operators
and VectorArrays
).
@peoe , @Jonas-Nicodemus, are you still interested in working on this PR? Otherwise we would close it ..
What needs to be done? Unfortunately, to be honest this is not to high on my priority list right now :/
What needs to be done?
The tests and demos are failing (the algorithm doesn't converge when it is expected to converge). I tried comparing with your code, but I couldn't find a significant difference, so I don't know what the issue is.
There is also the design issue of a specialized time-stepper used in the tests and demos. In principle, it would be better to have it inside pymor.algorithms.timestepping
, but that raises questions about whether time steppers should return control and derivative snapshots.