control.FrequencyResponseData

class control.FrequencyResponseData(d, w)

A class for models defined by frequency response data (FRD)

The FrequencyResponseData (FRD) class is used to represent systems in frequency response data form.

The main data members are ‘omega’ and ‘fresp’, where omega is a 1D array with the frequency points of the response, and fresp is a 3D array, with the first dimension corresponding to the output index of the FRD, the second dimension corresponding to the input index, and the 3rd dimension corresponding to the frequency points in omega. For example,

>>> frdata[2,5,:] = numpy.array([1., 0.8-0.2j, 0.2-0.8j])

means that the frequency response from the 6th input to the 3rd output at the frequencies defined in omega is set to the array above, i.e. the rows represent the outputs and the columns represent the inputs.

__init__(*args, **kwargs)

Construct an FRD object.

The default constructor is FRD(d, w), where w is an iterable of frequency points, and d is the matching frequency data.

If d is a single list, 1d array, or tuple, a SISO system description is assumed. d can also be

To call the copy constructor, call FRD(sys), where sys is a FRD object.

To construct frequency response data for an existing LTI object, other than an FRD, call FRD(sys, omega)

Methods

__init__(*args, **kwargs)

Construct an FRD object.

damp()

Natural frequency, damping ratio of system poles

dcgain()

Return the zero-frequency gain

eval(omega[, squeeze])

Evaluate a transfer function at angular frequency omega.

feedback([other, sign])

Feedback interconnection between two FRD objects.

freqresp(omega)

(deprecated) Evaluate transfer function at complex frequencies.

frequency_response(omega[, squeeze])

Evaluate the linear time-invariant system at an array of angular frequencies.

isctime([strict])

Check to see if a system is a continuous-time system

isdtime([strict])

Check to see if a system is a discrete-time system

issiso()

Check to see if a system is single input, single output

Attributes

epsw

inputs

outputs

damp()

Natural frequency, damping ratio of system poles

Returns

  • wn (array) – Natural frequencies for each system pole

  • zeta (array) – Damping ratio for each system pole

  • poles (array) – Array of system poles

dcgain()

Return the zero-frequency gain

eval(omega, squeeze=None)

Evaluate a transfer function at angular frequency omega.

Note that a “normal” FRD only returns values for which there is an entry in the omega vector. An interpolating FRD can return intermediate values.

Parameters
  • omega (float or 1D array_like) – Frequencies in radians per second

  • squeeze (bool, optional) – If squeeze=True, remove single-dimensional entries from the shape of the output even if the system is not SISO. If squeeze=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 using config.defaults[‘control.squeeze_frequency_response’].

Returns

fresp – 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 squeeze is True then single-dimensional axes are removed.

Return type

complex ndarray

feedback(other=1, sign=- 1)

Feedback interconnection between two FRD objects.

freqresp(omega)

(deprecated) Evaluate transfer function at complex frequencies.

frequency_response(omega, squeeze=None)

Evaluate the linear time-invariant system at an array of angular frequencies.

Reports the frequency response of the system,

G(j*omega) = mag*exp(j*phase)

for continuous time systems. For discrete time systems, the response is evaluated around the unit circle such that

G(exp(j*omega*dt)) = mag*exp(j*phase).

In general the system may be multiple input, multiple output (MIMO), where m = self.ninputs number of inputs and p = self.noutputs number of outputs.

Parameters
  • omega (float or 1D array_like) – A list, tuple, array, or scalar value of frequencies in radians/sec at which the system will be evaluated.

  • squeeze (bool, optional) – If squeeze=True, remove single-dimensional entries from the shape of the output even if the system is not SISO. If squeeze=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 using config.defaults[‘control.squeeze_frequency_response’].

Returns

  • mag (ndarray) – The magnitude (absolute value, not dB or log10) of the system frequency response. If the system is SISO and squeeze is not True, the array is 1D, indexed by frequency. If the system is not SISO or squeeze is False, the array is 3D, indexed by the output, input, and frequency. If squeeze is True then single-dimensional axes are removed.

  • phase (ndarray) – The wrapped phase in radians of the system frequency response.

  • omega (ndarray) – The (sorted) frequencies at which the response was evaluated.

isctime(strict=False)

Check to see if a system is a continuous-time system

Parameters
  • sys (LTI system) – System to be checked

  • strict (bool, optional) – If strict is True, make sure that timebase is not None. Default is False.

isdtime(strict=False)

Check to see if a system is a discrete-time system

Parameters

strict (bool, optional) – If strict is True, make sure that timebase is not None. Default is False.

issiso()

Check to see if a system is single input, single output