Repository navigation
Carry the QNDF2 difference array across steps - #4455
Closed
singhharsh1708 wants to merge 1 commit into
Closed
singhharsh1708 wants to merge 1 commit into
singhharsh1708 wants to merge 1 commit into
Conversation
singhharsh1708
force-pushed
the
qndf2-difference-array
branch
from
September 6, 2026 08:55
228dfa1 to
b7354ba
Compare
Member
|
Supersceded and merged. |
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.
QNDF2rebuilt its backward differences fromuprev,uprev2anduprev3on every step and corrected a change of step size with a first-order scaling, so an O(h^2) error sat inside a quantity whose signal is O(h^3) and the local error estimate trackeddt/dtₙ₋₁instead of the error. There was no step size at which the estimate settled near 1, so the controller alternated between growing by the maximum factor and rejecting.Dnow stays at the step size its differences were formed with, a step that changesdtscales them through the exactR * Utransform into locals, and a successful step commits the new differences incrementally, which is what variable-orderQNDFalready does. ReadingDand writing locals also removes the aliasing inD[2] = D[1] * R[1, 2] + D[2] * R[2, 2], which used theD[1]assigned on the line above; that was inert because(R * U)[1, 2]is zero fork = 2.On
u' = -uat1e-8,QNDF2goes from 4211 accepted and 6427 rejected to 765 and 2. On the issue's stiff 2x2 at1e-8,QBDF2goes from 5491 and 10456 to 923 and 23. On Robertson at1e-8,QNDF2goes from 5874 and 6115 to 1505 and 11, and the mass matrix form from 6214 and 11144 to 1504 and 9. Fixed-step convergence is unchanged at 1.88, 2.00, 2.01, 2.01.The regression test asserts
QNDF2andQBDF2reject fewer than a tenth of the steps they accept onu' = -uat1e-8; on master they reject more than they accept.This still reproduced on master after #4328, which was suggested as the fix on the issue. Fixes #4332.
AI Disclosure: Claude assisted with this change.