Skip to content

Commit

Permalink
add test for mixed append/vcat operation using connect
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Dec 14, 2023
1 parent 6b98102 commit 0e0aff0
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion test/test_named_systems2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -379,4 +379,23 @@ sys_connect2 = connect([sys_1, sys_2, sys_3, split1, split2],
unique = false
)
sys_connect2.x .= sys_connect.x
@test sys_connect == sys_connect2
@test sys_connect == sys_connect2


##
s1 = ssrand(1,2,2)
s2 = ssrand(1,2,2)
sys1 = named_ss(s1, "A", u=[:u1, :u2])
sys2 = named_ss(s2, "B", u=[:u2, :u3])

sys12 = connect(
[sys1, sys2],
Pair{Symbol, Symbol}[];
w1 = [:u1, :u2, :u3],
z1 = [sys1.y; sys2.y],
unique=false
)

@test sys12.B[1:2,1] == sys1.B[:, 1]
@test sys12.B[:,2] == [sys1.B[:, 2]; sys2.B[:, 1]]
@test sys12.B[3:4,3] == sys2.B[:, 2]

0 comments on commit 0e0aff0

Please sign in to comment.