You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using ModelingToolkit
using ModelingToolkit: t_nounits as t
functionbuggy(ϵval)
@variablesx(t)
ϵ, =GlobalScope.(@parameters ϵ) # never namespace@named A =ODESystem(Equation[], t)
@named B =ODESystem([substitute(ϵ*x ~0, ϵ => ϵval)], t)
C =compose(A, B)
returnequations(C)
endbuggy(-1) # [-B₊x(t) ~ 0], as expectedbuggy(0) # [0 ~ 0], as expectedbuggy(1) # [x(t) ~ 0], but expected [B₊x(t) ~ 0]buggy(2) # [2B₊x(t) ~ 0], as expected
Why is the namespacing on x dropped only when ϵ => 1 is substituted?
This blocks me from programmatically generating a more complex hierarchical system.
The text was updated successfully, but these errors were encountered:
To be perfectly honest, I'm also pretty baffled. It might have to do with the 1*x => x rule getting in the way, but I don't see why that would effect namespacing.
I am puzzled by this behavior:
Why is the namespacing on
x
dropped only whenϵ => 1
is substituted?This blocks me from programmatically generating a more complex hierarchical system.
The text was updated successfully, but these errors were encountered: