Repository navigation
VeryChord: treat increments below kappa as converged - #783
Open
raashish1601 wants to merge 1 commit into
Open
raashish1601 wants to merge 1 commit into
raashish1601 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #782
When the prediction of an implicit stage is already exact, every
VeryChordincrement is a rounding error. Scaled by tight tolerances these are still well above_small's threshold, soterminatecompares the ratio of two rounding errors, often finds it above 2 and reports a divergence. The step is rejected and the same thing happens on the next one, untilmax_steps.As suggested in the issue,
terminatenow also treats an increment smaller thankappa(in units of the tolerances) as converged, whatever its ratio to the previous one._smallis kept for the case wherekappais set very small.With the reproducer from the issue,
Kvaerno5now takes 52 accepted and 0 rejected steps instead of hittingmax_steps(19 accepted, 1981 rejected). They' = 1.25 ycase mentioned there is unchanged (270 steps).Tests: added
test_exact_predictiontotest/test_very_chord.py, which fails on main and passes with this change.test/test_very_chord.py,test/test_solver.py,test/test_integrate.pyandtest/test_adaptive_stepsize_controller.pypass locally (CPU, float64).