harold.transfer_to_state

harold.transfer_to_state(G, output='system')

Converts a Transfer to a State

Given a Transfer() object of a tuple of numerator and denominator, converts the argument into the state representation. The output can be selected as a State() object or the A,B,C,D matrices if ‘output’ keyword is given with the option ‘matrices’.

If the input is a State() object it returns the argument with no modifications.

For SISO systems, the algorithm is returning the controllable companion form.

For MIMO systems a variant of the algorithm given in Section 4.4 of W.A. Wolowich, Linear Multivariable Systems (1974). The denominators are equaled with haroldlcm() Least Common Multiple function.

Parameters:
  • G ({Transfer, State, (num, den)}) – The system or a tuple containing the numerator and the denominator
  • output ({'system','matrices'}) – Selects whether a State() object or individual state matrices will be returned.
Returns:

  • Gs (State) – If ‘output’ keyword is set to ‘system’
  • A,B,C,D ({(nxn),(nxm),(p,n),(p,m)} 2D Numpy-arrays) – If the ‘output’ keyword is set to ‘matrices’

Notes

If G is a State object, it is returned directly.