MIMOStateSpace¶
Defined in module: wield.control.MIMO.ss.MIMOStateSpace
- class MIMOStateSpace(*args, A=None, B=None, C=None, D=None, E=None, inputs=None, outputs=None, inout=None, hermitian=True, time_symm=False, dt=None, fiducial_rtol=None, fiducial_atol=None, algorithm_choices=None, algorithm_ranking=None)[source][github]¶
Bases:
BareStateSpaceUser,MIMOState space class to represent MIMO Transfer functions using dense matrix representations
This class allows both string-based and number based indexing
inputs and outputs can either be a list of names or a dictionary of names to indices.
inputs and outputs can contain overlapping indices
- __init__(*args, A=None, B=None, C=None, D=None, E=None, inputs=None, outputs=None, inout=None, hermitian=True, time_symm=False, dt=None, fiducial_rtol=None, fiducial_atol=None, algorithm_choices=None, algorithm_ranking=None)[source][github]¶
Form a MIMO LTI system from statespace matrices.
There are lots of ways to create LTI systems. From the arguments
Methods
L2_norm(**kwargs)Linf_norm(**kwargs)__init__(*args[, A, B, C, D, E, inputs, ...])Form a MIMO LTI system from statespace matrices.
balance([inputs, outputs])Balance the system matrix.
balanceABC(**kwargs)balance_and_truncate(**kwargs)TODO rename as Gramian order reduction
block_diagonalize(**kwargs)constraint([outputs, matrix])Adds an output constraint to the system and returns the altered system
constraints([output_matrix])Adds multiple output constraints to the system and returns the altered system
dissect(*, ilists, inames, olists, onames)This implements the dissection interface to break the statespace into blocks.
dissectB(iname)dissectC(oname)dissectD(iname, oname)extend_io(*[, inputs, outputs, overwrite])Extends individual inputs or outputs with shaped SISO statespaces, single gains, or defaults to gain of 1.
feedback_connect(*[, connections, gain])Feedback linkage for a single statespace.
fresponse(*[, f, w, s])grammian_order_reduction([inputs, outputs])Balance the system matrix.
inverse(inputs, outputs)Creates the inverse between the set of inputs and outputs.
minreal([job, scale, rescale_in, ...])namespace(ns)prepend a namespace to all inputs and outputs and return the new system
permute_UT(**kwargs)TODO remove
reduceE(**kwargs)reduceE2(**kwargs)reduceE3(**kwargs)rename(renames[, which])Rename inputs and outputs of the statespace and return the new systems
rename_inputs(renames)rename_outputs(renames)rescale()scale_io([inputs, outputs, scale_in, scale_out])Balance the system matrix.
schur_form(**kwargs)secondaries([outputs])Return a new system with additional inputs and outputs created from the names of the originals
series_connect(*[, input_connections, ...])Like feedback but extends inputs and outputs through gain or gain systems in series
set_algorithm_choices(algorithm_choices)similarity_diagonal(D, **kw)similarity_triangular_left(S, **kw)similarity_triangular_right(S, **kw)siso(row, col)convert a single output (row) and input (col) into a SISO representation
stochastic_balance_and_truncate(**kwargs)topological_sort(**kwargs)Attributes
- secondaries(outputs=None)[source][github]¶
Return a new system with additional inputs and outputs created from the names of the originals
Properly implementing should use a topological sort on inputs and outputs to check for cycles and ensure that the index dependency is resolvable
- siso(row, col)[source][github]¶
convert a single output (row) and input (col) into a SISO representation
- dissect(*, ilists, inames, olists, onames)[source][github]¶
This implements the dissection interface to break the statespace into blocks. This is useful for a number of advanced control synthesis and analysis routines that depend on categories of input and output blocks
- namespace(ns)[source][github]¶
prepend a namespace to all inputs and outputs and return the new system
TODO: rename this as prefix
- rename(renames, which='both')[source][github]¶
Rename inputs and outputs of the statespace and return the new systems
renames: dictionary mapping from:to name pairs or a function(from) -> to which: can be “inputs”, “outputs”, or “both” (the default).
- balance(inputs=None, outputs=None, **kwargs)[source][github]¶
Balance the system matrix.
TODO: Document
- grammian_order_reduction(inputs=None, outputs=None, **kwargs)[source][github]¶
Balance the system matrix.
TODO: Document
- scale_io(inputs=None, outputs=None, scale_in=None, scale_out=None)[source][github]¶
Balance the system matrix.
TODO: Document
- constraint(outputs=None, matrix=None)[source][github]¶
Adds an output constraint to the system and returns the altered system
outputs: this is a list of outputs which establishes an order matrix: this is a matrix for the list of outputs which adds the system constraint G:=matrix -> G @ C @ x = 0 by augmenting the A and E matrices
- constraints(output_matrix=[])[source][github]¶
Adds multiple output constraints to the system and returns the altered system
output_matrix is a list of output, matrix pairs. This function is equivalent to calling constraint many times with the list, but is faster to perform all at once
- inverse(inputs, outputs)[source][github]¶
Creates the inverse between the set of inputs and outputs. the size of inputs and outputs must be the same.
- series_connect(*, input_connections=None, output_connections=None, gain=1)[source][github]¶
Like feedback but extends inputs and outputs through gain or gain systems in series
the gain terms can be SISO systems, StateSpaceRaw, D, ABCD, or ABCDE blocks
- extend_io(*, inputs=[], outputs=[], overwrite=False)[source][github]¶
Extends individual inputs or outputs with shaped SISO statespaces, single gains, or defaults to gain of 1.
- Parameters:
inputs (list) – list of tuples describing the inputs to extend. Each tuple is a (newname, oldname, gain) triple. The gain term can be ignored and will default to 1 if not included. The gain term can be a number or a SISO system.
outputs (list) – list of tuples describing the outputs to extend. Each tuple is a (newname, oldname, gain) triple. The gain term can be ignored and will default to 1 if not included. The gain term can be a number or a SISO system.
- each tuple can instead be a dictionary with the following arguments inside
new (str): old (str): gain (SISO or Number, optional): overwrite (bool, False): if a newname overlaps with an existing name, it will drop the existing name and replace it with
the new one which this is True. Otherwise (default) name clashes throw an error. This can be used to rename outputs.
rename (bool): rename the old to the new after applying the gain.
for inputs, the newname will pass through the gain and plug into the oldname. For outputs, the oldname output will pass through the gain to form the newname output.
TODO: support vector IO TODO: example
- feedback_connect(*, connections=None, gain=1, **kw)[source][github]¶
Feedback linkage for a single statespace.
connections is a list of row, col pairs or row,col,gain tuples
gain is the connection gain to apply. It can be a scalar or a matrix
TODO: allow gain to be a SISO response, StateSpaceRaw, D, ABCD, or ABCDE blocks TODO: add a feedback_connectE TODO: automatic conditioning