control.zpk

control.zpk(zeros, poles, gain[, dt])[source]

Create a transfer function from zeros, poles, gain.

Given a list of zeros z_i, poles p_j, and gain k, return the transfer function:

H(s) = k \frac{(s - z_1) (s - z_2) \cdots (s - z_m)}
               {(s - p_1) (s - p_2) \cdots (s - p_n)}

Parameters
zerosarray_like

Array containing the location of zeros.

polesarray_like

Array containing the location of poles.

gainfloat

System gain.

dtNone, True or float, optional

System timebase. 0 (default) indicates continuous time, True indicates discrete time with unspecified sampling time, positive number is discrete time with specified sampling time, None indicates unspecified timebase (either continuous or discrete time).

inputs, outputs, statesstr, or list of str, optional

List of strings that name the individual signals. If this parameter is not given or given as None, the signal names will be of the form ‘s[i]’ (where ‘s’ is one of ‘u’, ‘y’, or ‘x’). See InputOutputSystem for more information.

namestring, optional

System name (used for specifying signals). If unspecified, a generic name ‘sys[id]’ is generated with a unique integer id.

display_formatNone, ‘poly’ or ‘zpk’, optional

Set the display format used in printing the TransferFunction object. Default behavior is polynomial display and can be changed by changing config.defaults['xferfcn.display_format'].

Returns
outTransferFunction

Transfer function with given zeros, poles, and gain.

Examples

>>> G = ct.zpk([1], [2, 3], gain=1, display_format='zpk')
>>> print(G)