Fix FunctionMap DiscreteProblem import; correct Hard DAE test assertion#3469
Merged
ChrisRackauckas merged 1 commit intoSciML:v7from Apr 19, 2026
Merged
Conversation
- FunctionMap: import DiscreteProblem/DiscreteFunction from SciMLBase. v7's OrdinaryDiffEq no longer re-exports these. - Hard DAE: the test asserted `abs(sol(2-2^-10, idxs=1)) <= 1e-4` expecting u[1] to decay from 5 toward 0, but the DAE's algebraic constraint `u[2] = u[1]` (from mass matrix row 2 = 0) makes `du[1] = -100*(u[1]-u[1]) = 0`, so u[1] = 5 (constant) — the correct solution. The old solver had imperfect constraint enforcement that let u[1] drift, which the test relied on. v7's solver correctly snaps u[2] to u[1] from step 1. Change the assertion to `sol(2-2^-10, idxs=1) ≈ 5.0 atol=1e-4`. Also add `initializealg = BrownFullBasicInit()` since v7's default `CheckInit` rejects the inconsistent u0 = [5, 0, 0]. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 tasks
ChrisRackauckas
added a commit
that referenced
this pull request
Apr 20, 2026
…on (#3469) - FunctionMap: import DiscreteProblem/DiscreteFunction from SciMLBase. v7's OrdinaryDiffEq no longer re-exports these. - Hard DAE: the test asserted `abs(sol(2-2^-10, idxs=1)) <= 1e-4` expecting u[1] to decay from 5 toward 0, but the DAE's algebraic constraint `u[2] = u[1]` (from mass matrix row 2 = 0) makes `du[1] = -100*(u[1]-u[1]) = 0`, so u[1] = 5 (constant) — the correct solution. The old solver had imperfect constraint enforcement that let u[1] drift, which the test relied on. v7's solver correctly snaps u[2] to u[1] from step 1. Change the assertion to `sol(2-2^-10, idxs=1) ≈ 5.0 atol=1e-4`. Also add `initializealg = BrownFullBasicInit()` since v7's default `CheckInit` rejects the inconsistent u0 = [5, 0, 0]. Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ChrisRackauckas
added a commit
that referenced
this pull request
Apr 21, 2026
…on (#3469) - FunctionMap: import DiscreteProblem/DiscreteFunction from SciMLBase. v7's OrdinaryDiffEq no longer re-exports these. - Hard DAE: the test asserted `abs(sol(2-2^-10, idxs=1)) <= 1e-4` expecting u[1] to decay from 5 toward 0, but the DAE's algebraic constraint `u[2] = u[1]` (from mass matrix row 2 = 0) makes `du[1] = -100*(u[1]-u[1]) = 0`, so u[1] = 5 (constant) — the correct solution. The old solver had imperfect constraint enforcement that let u[1] drift, which the test relied on. v7's solver correctly snaps u[2] to u[1] from step 1. Change the assertion to `sol(2-2^-10, idxs=1) ≈ 5.0 atol=1e-4`. Also add `initializealg = BrownFullBasicInit()` since v7's default `CheckInit` rejects the inconsistent u0 = [5, 0, 0]. Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
FunctionMap —
DiscreteProblemnot in scopev7's OrdinaryDiffEq no longer re-exports
DiscreteProblem. Import from SciMLBase.Hard DAE — test assertion was wrong, not solver
The test asserted
abs(sol(2 - 2^-10, idxs=1)) <= 1e-4, expectingu[1]to decay from 5 toward 0. But the DAE has:The algebraic constraint (row 2) is
u2 = u1. Substituting:du1 = -100*(u1 - u1) = 0. Sou1 = 5(constant) — this is the correct solution.The old solver had imperfect algebraic constraint enforcement:
u2didn't snap tou1immediately, leaving a smallu1 - u2residual that droveu1down over 2000 steps. v7's implicit Euler correctly enforcesu2 = u1from step 1, confirmed locally:Fix: assert
sol(2-2^-10, idxs=1) ≈ 5.0(the correct DAE solution). Also addinitializealg = BrownFullBasicInit()since v7 defaults toCheckInitwhich rejects inconsistentu0 = [5, 0, 0].🤖 Generated with Claude Code