Skip to content

Commit 060627f

Browse files
SebastianM-Cclaude
andcommitted
fix: only examine RHS in equation_dependencies
Symbolics@5fe7a2d6 added a `search_variables!` method for `Equation` that searches both LHS and RHS. This broke `equation_dependencies` which relies on finding only RHS dependencies. The original MTK behavior (from 2020, commit 3160770) explicitly only examined `eq.rhs`. This fix restores that behavior by passing `eq.rhs` directly instead of relying on the generic `Equation` method. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 7120de8 commit 060627f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ModelingToolkitBase/src/systems/dependency_graphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function equation_dependencies(
4444
depeqs_to_vars = Vector{Vector}(undef, length(eqs))
4545

4646
for (i, eq) in enumerate(eqs)
47-
get_variables!(deps, eq, variables)
47+
get_variables!(deps, eq.rhs, variables)
4848
depeqs_to_vars[i] = [value(v) for v in deps]
4949
empty!(deps)
5050
end

0 commit comments

Comments
 (0)