sorted_incidence_matrix documents that a structurally simplified System with a schedule is sufficient. On current master (754b9679a017aae5d3a632d1d95dfd0c82229b41), a scalar ODE satisfies those preconditions but errors while applying the SCC column permutation.
Reproducer (Julia 1.12.6):
using ModelingToolkit
@independent_variables t
@variables x(t)
D = Differential(t)
@named sys = System([D(x) ~ -x], t)
compiled = mtkcompile(sys)
@assert ModelingToolkit.get_schedule(compiled) !== nothing
ModelingToolkit.sorted_incidence_matrix(compiled)
Observed error:
ERROR: DimensionMismatch: the length of column-permutation argument `q`, `length(q) (= 1)`, must match source argument `A`'s column count, `size(A, 2) (= 2)`
The failure is at src/structural_transformation/utils.jl:22, where the implementation passes reduce(vcat, sched.var_sccs) to permute!. git log -S sorted_incidence_matrix and blame identify 1e564207241814265fc9870a100625f382f84a60 (feat: implement sorted_incidence_matrix(sys)) as the introduction of this System overload and the failing line.
This was reproduced from a clean worktree after Pkg.instantiate(). No changes from the structural-transformation developer API documentation PR are involved.
sorted_incidence_matrixdocuments that a structurally simplifiedSystemwith a schedule is sufficient. On currentmaster(754b9679a017aae5d3a632d1d95dfd0c82229b41), a scalar ODE satisfies those preconditions but errors while applying the SCC column permutation.Reproducer (Julia 1.12.6):
Observed error:
The failure is at
src/structural_transformation/utils.jl:22, where the implementation passesreduce(vcat, sched.var_sccs)topermute!.git log -S sorted_incidence_matrixand blame identify1e564207241814265fc9870a100625f382f84a60(feat: implement sorted_incidence_matrix(sys)) as the introduction of thisSystemoverload and the failing line.This was reproduced from a clean worktree after
Pkg.instantiate(). No changes from the structural-transformation developer API documentation PR are involved.