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
@named sys =ODESystem([D(x) ~-x + u], tv) # both u and x are unbound
12
+
@named sys1 =ODESystem([D(x) ~-x + v[1] + v[2]], tv) # both v and x are unbound
12
13
@named sys2 =ODESystem([D(x) ~-sys.x], tv, systems = [sys]) # this binds sys.x in the context of sys2, sys2.x is still unbound
14
+
@named sys21 =ODESystem([D(x) ~-sys.x], tv, systems = [sys1]) # this binds sys.x in the context of sys2, sys2.x is still unbound
13
15
@named sys3 =ODESystem([D(x) ~-sys.x + sys.u], tv, systems = [sys]) # This binds both sys.x and sys.u
16
+
@named sys31 =ODESystem([D(x) ~-sys.x + sys1.v[1]], tv, systems = [sys1]) # This binds both sys.x and sys1.v[1]
14
17
15
18
@named sys4 =ODESystem([D(x) ~-sys.x, u ~ sys.u], tv, systems = [sys]) # This binds both sys.x and sys3.u, this system is one layer deeper than the previous. u is directly forwarded to sys.u, and in this case sys.u is bound while u is not
16
19
@@ -23,13 +26,19 @@ D = Differential(tv)
23
26
@testget_namespace(sys.x) =="sys"
24
27
@testget_namespace(sys2.x) =="sys2"
25
28
@testget_namespace(sys2.sys.x) =="sys2₊sys"
29
+
@testget_namespace(sys21.sys1.v) =="sys21₊sys1"
26
30
27
31
@test!is_bound(sys, u)
28
32
@test!is_bound(sys, x)
29
33
@test!is_bound(sys, sys.u)
30
34
@testis_bound(sys2, sys.x)
31
35
@test!is_bound(sys2, sys.u)
32
36
@test!is_bound(sys2, sys2.sys.u)
37
+
@testis_bound(sys21, sys.x)
38
+
@test!is_bound(sys21, sys1.v[1])
39
+
@test!is_bound(sys21, sys1.v[2])
40
+
@testis_bound(sys31, sys1.v[1])
41
+
@test!is_bound(sys31, sys1.v[2])
33
42
34
43
# simplification turns input variables into parameters
0 commit comments