Skip to content

Commit

Permalink
add test for MIMO extended_gangoffour
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed May 17, 2023
1 parent d39a213 commit f62c25c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ControlSystemsBase/src/sensitivity_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ T = G[2, 2]
# For MIMO P
S = G[1:P.ny, 1:P.nu]
PS = G[1:P.ny, P.nu+1:end]
CS = G[P.ny+1:end, 1:P.nu]
T = G[P.ny+1:end, P.nu+1:end]
PS = G[1:P.ny, P.ny+1:end]
CS = G[P.ny+1:end, 1:P.ny]
T = G[P.ny+1:end, P.ny+1:end] # Input complimentary sensitivity function
```
The gang of four can be plotted like so
Expand Down
15 changes: 15 additions & 0 deletions lib/ControlSystemsBase/test/test_connections.jl
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,21 @@ G = extended_gangoffour(P, K, true)
@test tf(G[2,2]) tf(-input_comp_sensitivity(P, K))


## MIMO
P = ssrand(3,2,1,proper=false)
K = ssrand(2,3,1,proper=false)
G = extended_gangoffour(P, K, false)
S = G[1:P.ny, 1:P.nu]
PS = G[1:P.ny, P.ny+1:end]
CS = G[P.ny+1:end, 1:P.ny]
T = G[P.ny+1:end, P.ny+1:end]

@test tf(S) tf(sensitivity(P, K))
@test tf(CS) tf(G_CS(P, K))
@test tf(PS) tf(G_PS(P, K))
@test tf(T) tf(input_comp_sensitivity(P, K))


# https://github.com/JuliaControl/ControlSystems.jl/issues/815
function feedback_ctrl(G, K)
ny,nu = size(G)
Expand Down

0 comments on commit f62c25c

Please sign in to comment.