Skip to content

Use the initial point to avoid singular dummy-derivative selections and solve directions - #164

Draft
pankgeorg wants to merge 1 commit into
JuliaComputing:mainfrom
pankgeorg:dd-initial-point-selection
Draft

pankgeorg wants to merge 1 commit into
JuliaComputing:mainfrom
pankgeorg:dd-initial-point-selection

Conversation

@pankgeorg

@pankgeorg pankgeorg commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Dummy-derivative selection and tearing only look at structure, so a coordinate whose constraint-Jacobian column vanishes at t0 can be made algebraic, or an equation can be solved by dividing by a coefficient like sin(ω t) that is zero at t0 (SciML/ModelingToolkit.jl#5212).

  • StateSelection.dummy_derivative_graph! takes a numjac callback; when the structural selection of an SCC is numerically rank-deficient at the initial point, the candidates are reordered by a greedy numerically independent set (in priority order, widened with unassigned highest derivatives incident to the SCC if needed) and re-selected. Non-singular selections are unchanged.
  • ModelingToolkitTearing: TearingState lazily evaluates expressions at the initial point (initial_conditions, bindings, the start of the system's tspan, and an explicit initial_point map when given; guesses are not used); find_eq_solvables! adds no solvable edge for a coefficient that is exactly zero there. Evaluation is exception-safe.

Tested: new unit tests in both packages; end-to-end tests live in the companion ModelingToolkit PR (car axis, pendulum and two-constraint analogs of the slider crank and Andrews problems).

🤖 Generated with Claude Code

Dummy-derivative selection and tearing only looked at structure, so a
coordinate whose constraint-Jacobian column vanishes at the initial point
could be made algebraic, or an equation solved by dividing by a
coefficient such as `sin(ω*t)` that is zero at the initial time.

StateSelection: `dummy_derivative_graph!` accepts a `numjac` callback
returning the Jacobian of an SCC evaluated at the initial point. After the
structural selection at each differentiation level, the selected columns
are checked for numerical rank (row-equilibrated); only when they are
rank-deficient are the candidates reordered by a greedy numerically
independent set (in priority order, widened with unassigned highest
derivatives incident to the SCC if needed) and selected again.

ModelingToolkitTearing: `TearingState` lazily evaluates expressions at the
initial point, built from bindings, initial conditions, the start of the
system's `tspan` and an optional explicit `initial_point` map (guesses are
not used), and `find_eq_solvables!` adds no solvable edge for a
coefficient that is exactly zero there.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@baggepinnen

Copy link
Copy Markdown
Contributor

To the AI bot, please run the tests of MultibodyComponents.jl with this PR before merging.

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