Repository navigation
Fix NordsieckBDF trial-step interpolation for delay equations - #4559
Closed
svenzenker wants to merge 1 commit into
Closed
svenzenker wants to merge 1 commit into
svenzenker wants to merge 1 commit into
Conversation
7 of 8 tasks
Member
|
Superseded by #4575, which keeps the same diagnosis but generates the corrected trial interpolant on demand in |
ChrisRackauckas
added a commit
that referenced
this pull request
Sep 17, 2026
DelayDiffEq consumes the step's interpolation data inside perform_step! (advance_or_update_ode_integrator! and the fixed-point history refresh), before the adaptive acceptance controller runs. NordsieckBDF only published integrator.k on acceptance, so delayed RHS evaluations inside the current step saw the previous step's committed polynomial. Produce the trial interpolant on demand instead: while the Nordsieck array is in the predicted state (cache.predicted), a requested rebuild of the step's columns (always_calc_begin, or force_calc_end as DelayDiffEq's advance/update pass) yields the corrected trial polynomial zn[j] + l[j]*acor — exactly what nordsieck_complete! commits on acceptance. Evaluation-only callers keep the committed columns, so mid-step integrator(t) and saved-solution interpolation are unchanged. Also make nordsieck_predict! idempotent: DelayDiffEq's fixed-point iteration re-invokes perform_step! on the same uncommitted step, and zn must not be Pascal-shifted again while already predicted. Builds on the approach in #4559 by moving the trial/committed split into _ode_addsteps! and covering the lag < dt fixed-point path. Agent-Harness: Devin CLI 3000.10.27 Agent-Model: SWE-2 Max Agent-Session: local session transcript /home/crackauc/.local/share/devin/cli/summaries/history_fa4fe6012694472c.md Co-authored-by: ChrisRackauckas-Claude <[email protected]> Co-authored-by: Sven Zenker <[email protected]> Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Member
|
I merged the corrected version. |
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.
MethodOfSteps(NordsieckBDF())can return success while integrating against stale dense-history data. On the analytic DDEu'(t) = -exp(-0.2) * u(t-0.2), with historyexp(-t), the unpatched solver has about 1.8e-3 solution error and 1.6e-2 internal history error despitereltol=1e-9,abstol=1e-10.DelayDiffEq copies the trial step's interpolation coefficients immediately after
perform_step!, before the acceptance controller runs. NordsieckBDF currently only publishes its corrected adaptive-step coefficients instep_accept_controller!. Consequently, DelayDiffEq associates the previous polynomial with the new interval and feeds it into subsequent delayed RHS evaluations.This change publishes the corrected trial polynomial (
zn[j] + l[j] * acor) at the end of successful adaptiveperform_step!calls, for both mutable and constant caches. It does not commit or otherwise mutatezn: acceptance still owns the history update, and rejection can still undo the prediction. Fixed-step behavior and the acceptance-time polynomial refresh are retained.The regression test uses an analytic DDE with and without a continuous callback, for in-place and out-of-place RHS functions. It checks the returned solution, the separate internal history solution, and event timing; the initial step also forces rejection. The test is registered in DelayDiffEq's Integrators group.
Validation on Julia 1.13.0:
OrdinaryDiffEqBDF/test/nordsieck_tests.jl: 134/134 checks pass, covering ODE and DAE behavior.git diff --checkpasses. JuliaFormatter was run, with unrelated formatting changes excluded from the patch.The complete monorepo test suite and within-step delay fixed-point iteration were not validated locally; the regression uses steps shorter than the delay.
Created using OpenAI Codex