-
-
Notifications
You must be signed in to change notification settings - Fork 233
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Take the following...
using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
pars = @parameters begin
a = 1
b = 2
end
vars = @variables begin
x(t)=0
y(t)=0
xi(t)::Int, [input=true]
yi(t), [input=true]
end
eqs = [
D(x) ~ a*xi
D(y) ~ b*yi
]
@mtkcompile sys = System(eqs, t, vars, pars) inputs=[xi,yi]Gives...
ERROR: AssertionError: issorted(input_idxs)
Stacktrace:
[1] complete(sys::System; split::Bool, flatten::Bool, add_initial_parameters::Bool)
@ ModelingToolkit c:\Users\bradl\.julia\packages\ModelingToolkit\b28X4\src\systems\abstractsystem.jl:689
[2] mtkcompile(sys::System; additional_passes::Vector{…}, simplify::Bool, split::Bool, allow_symbolic::Bool, allow_parameter::Bool, conservative::Bool, fully_determined::Bool, inputs::Vector{…}, outputs::Vector{…}, disturbance_inputs::Vector{…}, kwargs::@Kwargs{})
@ ModelingToolkit C:\Users\bradl\.julia\packages\ModelingToolkit\b28X4\src\systems\systems.jl:53
[3] top-level scope
@ C:\Users\bradl\.julia\packages\ModelingToolkit\b28X4\src\systems\abstractsystem.jl:2392Note: this error occurs because xi is specified as Int type and is defined earlier then yi. Switching the order (i.e. making yi::Int and xi assumed Float64) does not produce the error.
Also this bug is avoided by using the split=false option for mtkcompile
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working