BareStateSpace¶
Defined in module: wield.control.ss_bare.ss.BareStateSpace
- class BareStateSpace(A, B, C, D, E, *, hermitian: bool = True, time_symm: bool = False, flags={}, algorithm_choices=None, algorithm_ranking=None, dt=None)[source][github]¶
Bases:
objectState space class to represent MIMO Transfer functions using dense matrix representations
This class uses raw matrix representations and should not generally be used by users.
It is used internally by the SISO.SISOStateSpace and MIMO.MIMOStateSpace classes
- __init__(A, B, C, D, E, *, hermitian: bool = True, time_symm: bool = False, flags={}, algorithm_choices=None, algorithm_ranking=None, dt=None)[source][github]¶
Methods
L2_norm([mode, scale, tol])Using slycot ab13dd Return objects: The L2 or H2 norm of the system
Linf_norm([scale, tol])Using slycot ab13dd Return objects: gpeak : float The L-infinity norm of the system, i.e., the peak gain of the frequency response (as measured by the largest singular value in the MIMO case). fpeak : float The frequency where the gain of the frequency response achieves its peak value gpeak, i.e.,.
__init__(A, B, C, D, E, *[, hermitian, ...])adjoint()Return the transpose and conjugate (time-reversal) of the system TODO, adjust flags
balanceA([permute, which])Return a version of this statespace where A has been balanced for numerical stability.
balanceABC([which])Uses the slycot balancer tb01id or tg01ad
balanceBC_svd(which)This balances gains using the SVD of either B or C.
balance_and_truncate([rescale_io])balance_and_truncate_unscaled([method, nr, ...])To compute a reduced order model (Ar,Br,Cr,Dr) for an original state-space representation (A,B,C,D) by using either the square-root or the balancing-free square-root Singular Perturbation Approximation (SPA) model reduction method for the alpha-stable part of the system.
feedbackD(D)Feedback linkage for a single statespace.
feedbackDE(D)Feedback linkage for a single statespace.
fresponse_raw(*[, f, w, s, z, use_laub])fromD(D)inv()Invert statespace, by converting to a descriptor system
Invert statespace, assuming that the D matrix is full rank
minreal([job, scale, tol])Calculate a minimal realization, removes unobservable and uncontrollable states
minreal_controllable_split(nb[, scale, tol])Calculate a minimal observable realization on an nc-sized subset of the outputs.
minreal_observable_split(nc[, tol])Calculate a minimal observable realization on an nc-sized subset of the outputs.
minreal_rescaled([job, scale, tol])Apply a rescaling to the B and C matrix so that each Col, Row respectively, has norm 1.
reduceE()Utilize slycot tg01fd to reduce the statespace to a simpler form
reduceE2()Utilize slycot tg01gd to reduce the statespace to a simpler form
schurA([exact])Return a version of this statespace where A has been converted to a Schur triangular form.
set_algorithm_choices(algorithm_choices)stochastic_balance_and_truncate([method, ...])To compute a reduced order model (Ar,Br,Cr,Dr) for an original state-space representation (A,B,C,D) by using either the square-root or the balancing-free square-root Singular Perturbation Approximation (SPA) model reduction method for the alpha-stable part of the system.
Return the time reversal of the system
Return the transpose of the system
Attributes
- adjoint()[source][github]¶
Return the transpose and conjugate (time-reversal) of the system TODO, adjust flags
- balanceBC_svd(which)[source][github]¶
This balances gains using the SVD of either B or C.
It is not a very good technique as far as it has been tested
- balanceABC(which='A')[source][github]¶
Uses the slycot balancer tb01id or tg01ad
https://github.com/python-control/Slycot/blob/master/slycot/transform.py#L25
NOTE: there seems to be an error where it is giving bad output except for which=ABC
- balanceA(permute=True, which='A')[source][github]¶
Return a version of this statespace where A has been balanced for numerical stability.
TODO, use a pencil method to modify/account for E as well.
- schurA(exact=False)[source][github]¶
Return a version of this statespace where A has been converted to a Schur triangular form.
if exact is False, then it applies the Schur and keeps the small lower diagonal terms
- stochastic_balance_and_truncate(method='bfsqrt', equil=True, nr=None, alpha=None, beta=0.0001, tol1=0, tol2=0)[source][github]¶
To compute a reduced order model (Ar,Br,Cr,Dr) for an original state-space representation (A,B,C,D) by using either the square-root or the balancing-free square-root Singular Perturbation Approximation (SPA) model reduction method for the alpha-stable part of the system. - From SLYCOT Documentation for ab09nd
- Parameters:
sys (Bunch) – Bunch system with mod as attribute
method (str, optional) – Method to use for balancing. ‘sqrt’: use the square-root SPA method. ‘bfsqrt’: use the balancing-free square-root SPA method. Defaults to ‘sqrt’.
equil (bool, optional) – If True, preliminarily equilibrates the triplet (A,B,C). Defaults to True.
iod (dict, optional) – input/output dictionary. Defaults to None.
- Returns:
a similar StateSpace
- balance_and_truncate_unscaled(method='sqrt', nr=None, alpha=None, equil=True, tol1=0, tol2=0)[source][github]¶
To compute a reduced order model (Ar,Br,Cr,Dr) for an original state-space representation (A,B,C,D) by using either the square-root or the balancing-free square-root Singular Perturbation Approximation (SPA) model reduction method for the alpha-stable part of the system. - From SLYCOT Documentation for ab09nd
- Parameters:
sys (Bunch) – Bunch system with mod as attribute
method (str, optional) – Method to use for balancing. ‘sqrt’: use the square-root SPA method. ‘bfsqrt’: use the balancing-free square-root SPA method. Defaults to ‘sqrt’.
equil (bool, optional) – If True, preliminarily equilibrates the triplet (A,B,C). Defaults to True.
iod (dict, optional) – input/output dictionary. Defaults to None.
- Returns:
a similar StateSpace
- minreal(job='minimal', scale=True, tol=None)[source][github]¶
Calculate a minimal realization, removes unobservable and uncontrollable states
Originally from python-control!
- minreal_rescaled(job='minimal', scale=True, tol=None)[source][github]¶
Apply a rescaling to the B and C matrix so that each Col, Row respectively, has norm 1. This improves the scaling expected of tol for inputs and outputs with greatly differing scales.
- minreal_observable_split(nc, tol=0.0)[source][github]¶
Calculate a minimal observable realization on an nc-sized subset of the outputs. Then propagate the transformations into the full sized view.
This allows one to create reduced systems with the full set of inputs and outputs but at reduced order
- minreal_controllable_split(nb, scale=False, tol=0.0)[source][github]¶
Calculate a minimal observable realization on an nc-sized subset of the outputs. Then propagate the transformations into the full sized view.
This allows one to create reduced systems with the full set of inputs and outputs but at reduced order
TODO: Untested
- L2_norm(mode='L2', scale=True, tol=1e-14)[source][github]¶
Using slycot ab13dd Return objects:
The L2 or H2 norm of the system
Does not work with descriptor systems
- Linf_norm(scale=True, tol=1e-10)[source][github]¶
Using slycot ab13dd Return objects:
- gpeakfloat
The L-infinity norm of the system, i.e., the peak gain of the frequency response (as measured by the largest singular value in the MIMO case).
- fpeakfloat
The frequency where the gain of the frequency response achieves its peak value gpeak, i.e.,
|| G ( j*fpeak ) || = gpeak , if dico = ‘C’, or
j*fpeak
|| G ( e ) || = gpeak , if dico = ‘D’.
Works with descriptor systems