I’m not sure if this sounds correct, you are talking about the function append
which performs block-diagonal concatenation, i.e., the operation below
u1 ┌───┐ y1
───►│ P1├──► u1 ┌─────┐ y1
└───┘ ──►│ ├──►
────► ──►│ P12├──►
u2 ┌───┐ y2 u2 └─────┘ y2
───►│ P2├──►
└───┘
but you’re asking for it to behave like vertical concatenation P12 = [P1; P2]
u ┌───┐ y1
───►│ P1├──► ┌─────┐ y1
└───┘ ──►│ ├──►
────► u │ P12├──►
u ┌───┐ y2 └─────┘ y2
───►│ P2├──►
└───┘
Can’t what you’re asking for be realized using the connect
function?
s1 = ssrand(1,2,2)
s2 = ssrand(1,2,2)
sys1 = named_ss(s1, "A", u=[:u1, :u2]) # Input u2 appears in both systems
sys2 = named_ss(s2, "B", u=[:u2, :u3])
sys12 = connect(
[sys1, sys2],
Pair{Symbol, Symbol}[]; # Empty connection vector of the correct type
w1 = [:u1, :u2, :u3],
z1 = [sys1.y; sys2.y],
unique = false
)
The resulting system has the input u2
merged.
julia> sys12 = connect([sys1, sys2], Pair{Symbol, Symbol}[], w1 = [:u1, :u2, :u3], z1 = [sys1.y; sys2.y], unique=false)
NamedStateSpace{Continuous, Float64}
A =
-0.06812632965152318 0.5720015099467834 0.0 0.0
-0.9590957208034123 -1.2581734396885567 0.0 0.0
0.0 0.0 0.20021007961714576 -0.7677092543034114
0.0 0.0 0.6655398066449922 -1.8810324473875886
B =
-0.5285225476394938 -1.3112160323503186 0.0
-0.6058648756516474 -1.1713675813478548 0.0
0.0 -0.3626155828058133 1.6492509268100324
0.0 1.1480210367263297 -0.4767449301439349
C =
0.8695036855393466 -0.8001568554043171 0.0 0.0
0.0 0.0 -0.8301044609973323 -0.6223243969601403
D =
0.5287883123468724 1.3107581033813325 0.0
0.0 -0.37456658050500763 3.507504356656879
Continuous-time state-space model
With state names: Ax1##feedback#226 Ax2##feedback#226 Bx1##feedback#226 Bx2##feedback#226
input names: u1 u2 u3
output names: Ay By