control.gram
- control.gram(sys, type)[source]
Gramian (controllability or observability).
- Parameters
- sys
StateSpace
System description.
- typeString
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).
- sys
- Returns
- gram2D array
Gramian of system.
- Raises
- ValueError
If system is not instance of
StateSpace
class, orif
type
is not ‘c’, ‘o’, ‘cf’ or ‘of’, orif system is unstable (sys.A has eigenvalues not in left half plane).
- ControlSlycot
If slycot routine sb03md cannot be found or if slycot routine sb03od cannot be found.
Examples
>>> G = ct.rss(4) >>> Wc = ct.gram(G, 'c') >>> Wo = ct.gram(G, 'o') >>> Rc = ct.gram(G, 'cf') # where Wc = Rc' * Rc >>> Ro = ct.gram(G, 'of') # where Wo = Ro' * Ro