control.matlab.evalfr
- control.matlab.evalfr(sys, x, squeeze=None)[source]
Evaluate transfer function of LTI system at complex frequency.
Returns the complex frequency response
sys(x)wherexissfor continuous-time systems andzfor discrete-time systems, withm = sys.ninputsnumber of inputs andp = sys.noutputsnumber of outputs.To evaluate at a frequency omega in radians per second, enter
x = omega * 1jfor continuous-time systems, orx = exp(1j * omega * dt)for discrete-time systems, or usefreqresp(sys, omega).- Parameters:
- sys
StateSpaceorTransferFunction Linear system.
- xcomplex scalar or 1D array_like
Complex frequency(s).
- squeezebool, optional (default=True)
If
squeeze= True, remove single-dimensional entries from the shape of the output even if the system is not SISO. Ifsqueeze= False, keep all indices (output, input and, if omega is array_like, frequency) even if the system is SISO. The default value can be set usingconfig.defaults['control.squeeze_frequency_response'].
- sys
- Returns:
- frespcomplex ndarray
The frequency response of the system. If the system is SISO and squeeze is not True, the shape of the array matches the shape of omega. If the system is not SISO or squeeze is False, the first two dimensions of the array are indices for the output and input and the remaining dimensions match omega. If
squeezeis True then single-dimensional axes are removed.
See also
LTI.__call__,frequency_response,bode_plot
Notes
This function is a wrapper for
StateSpace.__call__andTransferFunction.__call__.Examples
>>> G = ct.ss([[-1, -2], [3, -4]], [[5], [7]], [[6, 8]], [[9]]) >>> fresp = ct.evalfr(G, 1j) # evaluate at s = 1j