Skip to content

input output handling does not work on array variables #1807

Closed
@ValentinKaisermayer

Description

@ValentinKaisermayer

Since the code relies on string comparisons - which seems very fragile - it breaks with the new way of specifiying array variables in Symbolics.jl v4.9.

@parameters t
D = Differential(t)
@variables x(t) u(t)[1:2] [input = true]
@named sys = ODESystem([D(x) ~ -x + u[1] + u[2]], t) 
@named sys2 = ODESystem([D(x) ~ -sys.x], t, systems = [sys]) 

julia> ModelingToolkit.get_namespace(sys2.sys.u)
"(sys2₊sys"

An array variable test is missing from https://github.com/SciML/ModelingToolkit.jl/blob/master/test/input_output_handling.jl that would have caught this.
This is what breaks SciML/ModelingToolkitStandardLibrary.jl#99

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions