From 850883f04228119b1aa57f0071fe01e649443b42 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Fri, 15 May 2026 19:40:23 +0200 Subject: [PATCH] Fix double-negative error message in TransferFunction call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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". Co-Authored-By: Claude Opus 4.7 (1M context) --- lib/ControlSystemsBase/src/freqresp.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ControlSystemsBase/src/freqresp.jl b/lib/ControlSystemsBase/src/freqresp.jl index 0206e1074..9ec2f9b3d 100644 --- a/lib/ControlSystemsBase/src/freqresp.jl +++ b/lib/ControlSystemsBase/src/freqresp.jl @@ -295,7 +295,7 @@ function (sys::TransferFunction)(s) end function (sys::TransferFunction)(z_or_omega::Number, map_to_unit_circle::Bool) - isdiscrete(sys) || throw(ArgumentError("It only makes no sense to call this function with discrete systems")) + isdiscrete(sys) || throw(ArgumentError("This function can only be called with discrete-time systems")) if map_to_unit_circle isreal(z_or_omega) ? evalfr(sys,exp(im*z_or_omega.*sys.Ts)) : error("To map to the unit circle, omega should be real") else @@ -304,7 +304,7 @@ function (sys::TransferFunction)(z_or_omega::Number, map_to_unit_circle::Bool) end function (sys::TransferFunction)(z_or_omegas::AbstractVector, map_to_unit_circle::Bool) - isdiscrete(sys) || throw(ArgumentError("It only makes no sense to call this function with discrete systems")) + isdiscrete(sys) || throw(ArgumentError("This function can only be called with discrete-time systems")) vals = sys.(z_or_omegas, map_to_unit_circle)# evalfr.(sys,exp.(evalpoints)) # Reshape from vector of evalfr matrizes, to (in,out,freq) Array nu,ny = size(vals[1])