Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dense output for FineRKN5 #2056

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

HenryLangner
Copy link
Contributor

Implementation of a specialized dense_output (6th order Hermite-Interpolation) for FineRKN5 derived in https://doi.org/10.1007/BF02307711 (for ref. view #677).

As shown in the convergence plots below, the Interpolation works fine (for In-Place ODEs, more on that below) and the dense_error is reduced significantly compared to the standard 3rd order Hermite-Interpolation:

In-Place (i) and Out-of-Place (o) convergence tests with and without dense error for the harmonic oscillator using the new dense output:
harmonic_oscillator_convergence_plots

In-Place (i) and Out-of-Place (o) convergence tests with and without dense error for the harmonic oscillator using the standard dense output:
harm_oscillator_convergence_plots_with3rdOrderHermit

However testing the convergence with the new dense output for ODEs dependent on the first derivative (velocity dependent) results in breaking the Out-of-Place implementation in the sense, that the convergence worsen compared to the In-Place implementation. The difference can be seen in the plots below:

In-Place (i) and Out-of-Place (o) convergence tests with and without dense error for the damped oscillator using the new dense output:
damped_oscillator_convergence_plots

I can not find the mistake in my Out-of-Place implementation.
Looking at the plots I am certain the mistake is not related to the coefficients since both implementations share the same ones and the In-Place on works regardless.

Any help is appreciated!

The code used for the convergence tests and plots is attached and can directly be pasted in the REPL for easy testing and replication of my results.
FineRKN5convergenceTests.txt

@ranocha

Comment on lines +315 to +317
k9 = f.f1(kdu, ku, p, t + dt * c9)
k10 = uprev + dt * (duprev + dt * (btilde1_1 * k1 + btilde2_1 * k2 + btilde3_1 * k3 + btilde4_1 * k4 + btilde5_1 * k5 + btilde6_1 * k6 + btilde7_1 * k7 + btilde8_1 * k8 + btilde9_1 * k9)) # higher order Evaluations for ytilde_{n+1} (as donated in corresponding Paper)
k11 = uprev + dt * (duprev * 0.5 + dt * (btilde1_12 * k1 + btilde2_12 * k2 + btilde3_12 * k3 + btilde4_12 * k4 + btilde5_12 * k5 + btilde6_12 * k6 + btilde7_12 * k7 + btilde8_12 * k8 + btilde9_12 * k9)) # higher order Evaluations for ytilde_{n+1/2} (as donated in corresponding Paper)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be done lazily like is done with Vern?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it can be done lazily. As a matter of fact that was the idea I had in mind after getting the dense-output to work. I just did not know that the Vern solvers use that option already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants