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
Fifth order EPIRK methods #417
Conversation
# Compute the second group for U3 | ||
B = [zeros(R2) zeros(R2) zeros(R2) R2] | ||
K = phiv_timestep([dt/2, 9dt/10], A, B; kwargs...) | ||
U3 .+= 216/(25*dt^2) .* K[:, 1] + 8/dt^2 .* K[:, 2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own future reference, 216 = 8*27, the 8 = 1/2^3 is the factor from the Krylov subspace algorithm because this calculates phi_i / t^i
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this line isn't fusing because of the scalar operations BTW. Just @.
it. But optimizations can come later.
I'm not sure there's a typo in your code. I double checked your coefficient calculations and it looked solid to me. |
I wrote a classical ExpRK implementation of EPIRK5s3 (using single step I have high suspicion that there is a mistake in the original formula. Since the coefficients are originally derived by symbolically solving a set of order conditions using Mathematica by the authors, I can try to substitute back the coefficients to check consistency. Another angle I can tackle is to implement more EPIRK methods, like the original EPIRK5-P1/P2 integrators by Tokman. If all these don't have problems, then the likelihood that EPIRK5s3 is wrong will certainly increase. |
Please do EPIRK5-P1. That one seems to be the most efficient when it doesn't have order loss (i.e. not too stiff) so it would be a pretty essential algorithm to have. EPIRK5s3 is really beat out in any case by EXPRB53s3 anyways, so if it doesn't exist then it doesn't have much of a practical difference (though I do like the completionism to be able to verify benchmarks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Merge when tests pass, and depwarns can be fixed later.
Note on the choice coefficients for EPIRK5-P1/P2: the |
Again, the integrators EPIRK5s3 and EXPRB53s3 comes from this paper. Unfortunately current EPIRK5s3 produces large test error and seems to have only first order convergence. This is most likely a result of a typo/bug and not because of the underlying framework (since the other fifth order method EXPRB53s3 works without problem).