I/O system improvements: linearize, interconnect, docstrings by murrayrm · Pull Request #497 · python-control/python-control
This PR implements a couple of enhancements for the I/O systems package, mainly related to linear systems:
-
The
linearizecommand now preserves signal names for the linearized system, so that you can use signal names when forming andInterconnectedSystem. -
Interconnections of
LinearIOSystems are now treated asLinearICSystems(a subclass ofInterconnectedSystemandLinearIOSystem) so thatStateSpacefunctions will still work on them and they still keep track of the underlying interconnection structure. -
There is now an
interconnectfunction that allows the construction of anLinearICSystemsor aInterconnectedSystemdepending on whether the subsystems are all linear or not. This basically serves as a replacement for theconnectfunction for LTI systems and allows named interconnection of linear or nonlinear systems.
In addition, I cleaned up the description for how to specify interconnections so that tuples are only used for the lowest level signal descriptions; everything else is a list. (Tuples will still work, but there are some ambiguities when you use tuples since outlist=(3, 2, 1) could be interpreted as a signal description for a single signal (subsystem 3, signal 2, with gain 1) or as a list of signals for SISO systems (the single outputs from subsystems 3, 2, and 1).
Additional small changes:
-
The
rssanddrssfunctions now allow thestrictly_properkeyword, which sets the D matrix to zero. (I needed this to avoid occasional errors in unit tests for theinterconnectfunction. -
Added some configuration variables that allow you to change the way that states in interconnected systems are named (default was
sys.statebut issys_statefor 0.9+) and the way that duplicate systems are named (default wascopy of sysbut issys$copyfor 0.9+). -
Added unit tests for all of the above.
-
Updated examples to match the newly documented conventions for signal list specification.