Skip to content

Commit 535cbb5

Browse files
authored
Fix double-negative error message in TransferFunction call (#1061)
The discrete-only call methods for TransferFunction threw an ArgumentError with the message "It only makes no sense to call this function with discrete systems" — a double negative that asserts the opposite of the actual requirement. Rephrase to "This function can only be called with discrete-time systems".
1 parent ec4afdc commit 535cbb5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/ControlSystemsBase/src/freqresp.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ function (sys::TransferFunction)(s)
295295
end
296296

297297
function (sys::TransferFunction)(z_or_omega::Number, map_to_unit_circle::Bool)
298-
isdiscrete(sys) || throw(ArgumentError("It only makes no sense to call this function with discrete systems"))
298+
isdiscrete(sys) || throw(ArgumentError("This function can only be called with discrete-time systems"))
299299
if map_to_unit_circle
300300
isreal(z_or_omega) ? evalfr(sys,exp(im*z_or_omega.*sys.Ts)) : error("To map to the unit circle, omega should be real")
301301
else
@@ -304,7 +304,7 @@ function (sys::TransferFunction)(z_or_omega::Number, map_to_unit_circle::Bool)
304304
end
305305

306306
function (sys::TransferFunction)(z_or_omegas::AbstractVector, map_to_unit_circle::Bool)
307-
isdiscrete(sys) || throw(ArgumentError("It only makes no sense to call this function with discrete systems"))
307+
isdiscrete(sys) || throw(ArgumentError("This function can only be called with discrete-time systems"))
308308
vals = sys.(z_or_omegas, map_to_unit_circle)# evalfr.(sys,exp.(evalpoints))
309309
# Reshape from vector of evalfr matrizes, to (in,out,freq) Array
310310
nu,ny = size(vals[1])

0 commit comments

Comments
 (0)