Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/ControlSystemsBase/src/ControlSystemsBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ export LTISystem,
output_comp_sensitivity,
G_PS,
G_CS,
resolvent,
input_resolvent,
# Discrete
c2d,
c2d_x0map,
Expand Down
29 changes: 29 additions & 0 deletions lib/ControlSystemsBase/src/sensitivity_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,32 @@ function extended_gangoffour(P, C, pos=true)
end
end

"""
input_resolvent(sys::AbstractStateSpace)
Return the input-mapped resolvent of `sys`
```math
(sI - A)^{-1}B
```
i.e., the system `ss(A, B, I, 0)`.
"""
function input_resolvent(sys::AbstractStateSpace)
A,B,C,D = ssdata(sys)
ss(A, B, I, 0, timeevol(sys))
end

"""
resolvent(sys::AbstractStateSpace)
Return the resolvent of `sys`
```math
(sI - A)^{-1}
```
i.e., the system `ss(A, I, I, 0)`.
See also [`input_resolvent`](@ref).
"""
function resolvent(sys::AbstractStateSpace)
A,B,C,D = ssdata(sys)
ss(A, I(sys.nx), I, 0, timeevol(sys))
end
12 changes: 12 additions & 0 deletions lib/ControlSystemsBase/test/test_connections.jl
Original file line number Diff line number Diff line change
Expand Up @@ -416,4 +416,16 @@ function feedback_ctrl(G, K)
end
@test_throws ErrorException feedback_ctrl(tf([1], [0.1, 1]), delay(0.1))

Pr = resolvent(P)
@test Pr.A == P.A
@test Pr.B == I
@test Pr.C == I
@test iszero(Pr.D)

Pr = input_resolvent(P)
@test Pr.A == P.A
@test Pr.B == P.B
@test Pr.C == I
@test iszero(Pr.D)

end
Loading