control.tf2io

control.tf2io(sys[, ...])[source]

Convert a transfer function into an I/O system

The function accepts either 1 or 2 parameters:

tf2io(sys)

Convert a linear system into space space form. Always creates a new system, even if sys is already a StateSpace object.

tf2io(num, den)

Create a linear I/O system from its numerator and denominator polynomial coefficients.

For details see: tf()

Parameters
  • sys (LTI (StateSpace or TransferFunction)) – A linear system.

  • num (array_like, or list of list of array_like) – Polynomial coefficients of the numerator.

  • den (array_like, or list of list of array_like) – Polynomial coefficients of the denominator.

  • inputs (str, or list of str, optional) – List of strings that name the individual signals of the transformed system. If not given, the inputs and outputs are the same as the original system.

  • outputs (str, or list of str, optional) – List of strings that name the individual signals of the transformed system. If not given, the inputs and outputs are the same as the original system.

  • name (string, optional) – System name. If unspecified, a generic name <sys[id]> is generated with a unique integer id.

Returns

out – New I/O system (in state space form).

Return type

LinearIOSystem

Raises
  • ValueError – if num and den have invalid or unequal dimensions, or if an invalid number of arguments is passed in.

  • TypeError – if num or den are of incorrect type, or if sys is not a TransferFunction object.

See also

ss2io, tf2ss

Examples

>>> num = [[[1., 2.], [3., 4.]], [[5., 6.], [7., 8.]]]
>>> den = [[[9., 8., 7.], [6., 5., 4.]], [[3., 2., 1.], [-1., -2., -3.]]]
>>> sys1 = tf2ss(num, den)
>>> sys_tf = tf(num, den)
>>> sys2 = tf2ss(sys_tf)