Skip to content

Add DAE initialisation helpers (Brown init check, operating point) - #142

Merged
xtalax merged 2 commits into
SciML:masterfrom
xtalax-droid:forge/dae-helpers
Oct 28, 2026
Merged

xtalax merged 2 commits into
SciML:masterfrom
xtalax-droid:forge/dae-helpers

Conversation

@xtalax-droid

Copy link
Copy Markdown
Contributor

Problem. MethodOfLines holds discretizer-independent helpers for building a DAEProblem without mtkcompile. They classify differential and algebraic unknowns per element or slice, check whether BrownFullBasicInit() is safe for a system's initialization equations, and build the operating point. Other discretizers, such as the planned FiniteElementMethod.jl (design spec section 4.3), need them too.

Fix. Add src/dae_support.jl with BrownFullBasicInitUnsafeError, brown_init_offenders, differential_unknowns, dae_operating_point and time_derivative_order. The logic is copied from MethodOfLines apart from names and imports. One deliberate difference: slice regions now expand a colon index to its whole dimension, so slices such as u[:, 2:4] no longer throw a MethodError. The five names are declared public through @public and documented in docs/src/api.md. MethodOfLines is untouched.

Tests. New test/dae_support.jl covers each helper on a scalar system (differential, algebraic, coupled and derivative offenders, the error message, the operating point) and on array systems (slice-mask classification, element and slice offenders, a slice straddling an algebraic boundary, an array operating point, colon slices). GROUP=Core and GROUP=QA pass on Julia 1.12; lts and pre were not run locally.

Review notes. The colon expansion uses size(unknown) of a symbolic array, exercised only for [1:3, 1:5] shapes. MethodOfLines has the same _region bug until it imports these helpers. The first line of the showerror text changed so PDEBase does not name MethodOfLines; the rest is unchanged.


🤖 Posted by an AI agent · harness: Claude Code 2.1.310 · model: claude-sonnet-5-5
Review: unreviewed
Session: a20a681b-e8cc-4c82-a40d-a5b8349014e2

xtalax and others added 2 commits October 24, 2026 20:08
Brown init offender check, differential unknown classification, DAE operating point and time derivative order are discretizer-independent, so they live in PDEBase (FiniteElementMethod spec 4.3).

Agent-Harness: Claude Code 2.1.310
Agent-Model: claude-sonnet-5-5
Agent-Session: a20a681b-e8cc-4c82-a40d-a5b8349014e2
Agent-Review: unreviewed
Co-authored-by: Claude Code <[email protected]>
differential_unknowns threw a MethodError for slices such as u[:, 2:4] because CartesianIndices cannot take a Colon. _region now takes the parent unknown and expands a colon to its dimension.

Agent-Harness: Claude Code 2.1.310
Agent-Model: claude-sonnet-5-5
Agent-Session: a20a681b-e8cc-4c82-a40d-a5b8349014e2
Agent-Review: unreviewed
Co-authored-by: Claude Code <[email protected]>
@xtalax
xtalax merged commit 677a0c3 into SciML:master Oct 28, 2026
27 checks passed
xtalax-droid pushed a commit to xtalax-droid/PDEBase.jl that referenced this pull request Oct 28, 2026
Integration only: master now contains SciML#141, SciML#142, SciML#143, SciML#144 and SciML#160.

Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: a20a681b-e8cc-4c82-a40d-a5b8349014e2
Agent-Review: unreviewed
Co-authored-by: Claude Code <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants