Skip to content

Commit 8ac8e8b

Browse files
committed
warn against diskmargin for delay system
1 parent bd5ab40 commit 8ac8e8b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/diskmargin.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,9 @@ plot(dms; lower=true, phase=true)
171171
See also [`ncfmargin`](@ref) and [`loop_diskmargin`](@ref).
172172
"""
173173
function diskmargin(L::LTISystem, σ::Real=0; l=1e-3, u=1e3, kwargs...)
174+
L isa DelayLtiSystem && @warn "To compute the diskmargin of delay systems, consider approximating the delay with a Pade-approximation (`pade`) or discretize the system (`c2d`)."
174175
issiso(L) || return sim_diskmargin(L, σ, l, u)
175-
M = 1/(1 + L) +-1)/2
176+
M = feedback(1, L) +-1)/2
176177
n,ω0 = hinfnorm2(M; kwargs...)
177178
diskmargin(L, σ, ω0)
178179
end
@@ -186,8 +187,9 @@ See also [`ncfmargin`](@ref).
186187
diskmargin(L::LTISystem, σ::Real, ω::AbstractArray) = map(w->diskmargin(L, σ, w), ω)
187188

188189
function diskmargin(L::LTISystem, σ::Real, ω0::Real)
190+
L isa DelayLtiSystem && @warn "To compute the diskmargin of delay systems, consider approximating the delay with a Pade-approximation (`pade`) or discretize the system (`c2d`)."
189191
issiso(L) || return sim_diskmargin(L, σ, [ω0])[]
190-
M = 1/(1 + L) +-1)/2
192+
M = feedback(1, L) +-1)/2
191193
freq = isdiscrete(L) ? cis(ω0*L.Ts) : complex(0, ω0)
192194
= evalfr(M, freq)[]
193195
αmax = 1/abs(Sω)

0 commit comments

Comments
 (0)