Skip to content

I/O system improvements: linearize, interconnect, docstrings #497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jan 5, 2021

Conversation

murrayrm
Copy link
Member

@murrayrm murrayrm commented Jan 2, 2021

This PR implements a couple of enhancements for the I/O systems package, mainly related to linear systems:

  • The linearize command now preserves signal names for the linearized system, so that you can use signal names when forming and InterconnectedSystem.

  • Interconnections of LinearIOSystems are now treated as LinearICSystems (a subclass of InterconnectedSystem and LinearIOSystem) so that StateSpace functions will still work on them and they still keep track of the underlying interconnection structure.

  • There is now an interconnect function that allows the construction of an LinearICSystems or a InterconnectedSystem depending on whether the subsystems are all linear or not. This basically serves as a replacement for the connect function 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 rss and drss functions now allow the strictly_proper keyword, which sets the D matrix to zero. (I needed this to avoid occasional errors in unit tests for the interconnect function.

  • Added some configuration variables that allow you to change the way that states in interconnected systems are named (default was sys.state but is sys_state for 0.9+) and the way that duplicate systems are named (default was copy of sys but is sys$copy for 0.9+).

  • Added unit tests for all of the above.

  • Updated examples to match the newly documented conventions for signal list specification.

@coveralls
Copy link

coveralls commented Jan 2, 2021

Coverage Status

Coverage decreased (-0.02%) to 87.51% when pulling 5ed0f96 on murrayrm:linearize_named_signals into 8f5d8e5 on python-control:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 87.37% when pulling ff4a351 on murrayrm:linearize_named_signals into 383e7a4 on python-control:master.

@murrayrm murrayrm force-pushed the linearize_named_signals branch from 18ffe2e to 488edf5 Compare January 5, 2021 03:32
@bnavigator
Copy link
Contributor

https://travis-ci.org/github/python-control/python-control/jobs/752920076#L2029

_______________ TestIOSys.test_linearize_named_signals[arrayout] _______________
....
E       PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
...
FAILED control/tests/iosys_test.py::TestIOSys::test_linearize_named_signals[arrayout]
FAILED control/tests/iosys_test.py::TestIOSys::test_sys_naming_convention[arrayout]
FAILED control/tests/iosys_test.py::TestIOSys::test_signals_naming_convention_0_8_4[arrayout]
FAILED control/tests/iosys_test.py::TestIOSys::test_duplicates[arrayout] - Pe...

Autouse fixture matarrayout defines matrixerrorfilter, which is not overridden by matrixfilter. You need to locally override matarrayout.

@murrayrm murrayrm merged commit 4103688 into python-control:master Jan 5, 2021
@murrayrm murrayrm deleted the linearize_named_signals branch January 14, 2021 07:05
@murrayrm murrayrm added this to the 0.9.0 milestone Mar 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants