control.ss2tf

control.ss2tf(sys)

Transform a state space system to a transfer function.

The function accepts either 1 or 4 parameters:

ss2tf(sys)
Convert a linear system into space system form. Always creates a new system, even if sys is already a StateSpace object.
ss2tf(A, B, C, D)

Create a state space system from the matrices of its state and output equations.

For details see: ss()

Parameters:
  • sys (StateSpace) – A linear system
  • A (array_like or string) – System matrix
  • B (array_like or string) – Control matrix
  • C (array_like or string) – Output matrix
  • D (array_like or string) – Feedthrough matrix
Returns:

out – New linear system in transfer function form

Return type:

TransferFunction

Raises:
  • ValueError – if matrix sizes are not self-consistent, or if an invalid number of arguments is passed in
  • TypeError – if sys is not a StateSpace object

See also

tf(), ss(), tf2ss()

Examples

>>> A = [[1., -2], [3, -4]]
>>> B = [[5.], [7]]
>>> C = [[6., 8]]
>>> D = [[9.]]
>>> sys1 = ss2tf(A, B, C, D)
>>> sys_ss = ss(A, B, C, D)
>>> sys2 = ss2tf(sys_ss)