Description
When composing a system with MTK (8.7.0), empty callbacks (i.e. of the form ModelingToolkit.SymbolicContinuousCallback(Equation[], Equation[])
) are sometimes created. These callbacks seem to trip the assertion on
Here's code for reproducing the issue: https://gist.github.com/DaniGlez/22c98bd7d8b3bba479cf98082c62da56
In this example, four callbacks end up in the system after structural_simplify():
4-element Vector{ModelingToolkit.SymbolicContinuousCallback}: ModelingToolkit.SymbolicContinuousCallback(Equation[], Equation[]) ModelingToolkit.SymbolicContinuousCallback(Equation[m₊x(t) ~ 1.0], Equation[m₊v(t) ~ -m₊v(t)]) ModelingToolkit.SymbolicContinuousCallback(Equation[m₊x(t) ~ -1.0], Equation[m₊v(t) ~ -m₊v(t)]) ModelingToolkit.SymbolicContinuousCallback(Equation[], Equation[])
The assertion mentioned above therefore fails, since the largest index mapping to an affect is 3 while there are four affect functions (even if the last one is a dummy function)