control.gram

control.gram(sys, type)

Gramian (controllability or observability)

Parameters:
  • sys (StateSpace) – State-space system to compute Gramian for
  • 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:

array

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)
  • ImportError – if slycot routine sb03md cannot be found if slycot routine sb03od cannot be found

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