control.matlab.gram
- control.matlab.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
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