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) Evaluate a transfer function at a single angular frequency.
evalfr(omega) Evaluate a transfer function at a single angular frequency.
feedback([other, sign]) Feedback interconnection between two FRD objects.
freqresp(omega) Evaluate the frequency response at a list 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
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)

Evaluate a transfer function at a single angular frequency.

self.evalfr(omega) returns the value of the frequency response at 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.

evalfr(omega)

Evaluate a transfer function at a single angular frequency.

self._evalfr(omega) returns the value of the frequency response at 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.

feedback(other=1, sign=-1)

Feedback interconnection between two FRD objects.

freqresp(omega)

Evaluate the frequency response at a list of angular frequencies.

Reports the value of the magnitude, phase, and angular frequency of the requency response evaluated at omega, where omega is a list of angular frequencies, and is a sorted version of the input omega.

Parameters:omega (array_like) – A list of frequencies in radians/sec at which the system should be evaluated. The list can be either a python list or a numpy array and will be sorted before evaluation.
Returns:
  • mag ((self.outputs, self.inputs, len(omega)) ndarray) – The magnitude (absolute value, not dB or log10) of the system frequency response.
  • phase ((self.outputs, self.inputs, len(omega)) ndarray) – The wrapped phase in radians of the system frequency response.
  • omega (ndarray or list or tuple) – The list of 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