Skip to content

Commit 29ef316

Browse files
fix: handle array symbolics in observed_equations_used_by
1 parent 3e33d96 commit 29ef316

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,8 @@ function observed_equations_used_by(sys::AbstractSystem, exprs;
10761076

10771077
obsidxs = BitSet()
10781078
for sym in involved_vars
1079-
idx = findfirst(isequal(sym), obsvars)
1079+
arrsym = iscall(sym) && operation(sym) === getindex ? arguments(sym)[1] : nothing
1080+
idx = findfirst(v -> isequal(v, sym) || isequal(v, arrsym), obsvars)
10801081
idx === nothing && continue
10811082
idx in obsidxs && continue
10821083
parents = dfs_parents(graph, idx)

0 commit comments

Comments
 (0)