control.gram

control.gram(sys, type)[source]

Gramian (controllability or observability)

Parameters
  • sys (StateSpace) – System description

  • type (String) – Type of desired computation. type is either ‘c’ (controllability) or ‘o’ (observability). To compute the Cholesky factors of Gramians use ‘cf’ (controllability) or ‘of’ (observability)

Returns

gram – Gramian of system

Return type

2D array (or matrix)

Raises
  • ValueError

    • if system is not instance of StateSpace class

    • if type is not ‘c’, ‘o’, ‘cf’ or ‘of’

    • if system is unstable (sys.A has eigenvalues not in left half plane)

  • ControlSlycot – if slycot routine sb03md cannot be found if slycot routine sb03od cannot be found

Notes

The return type for 2D arrays depends on the default class set for state space operations. See use_numpy_matrix().

Examples

>>> Wc = gram(sys, 'c')
>>> Wo = gram(sys, 'o')
>>> Rc = gram(sys, 'cf'), where Wc = Rc' * Rc
>>> Ro = gram(sys, 'of'), where Wo = Ro' * Ro