Fix scalar feedback for square MIMO state-space systems#1232
Open
marko1olo wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Local verification on this branch: The only local warning was pytest being unable to write |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix
feedback(sys)/feedback(sys, scalar)for square MIMOStateSpacesystems by treating scalar feedback asscalar * Iwith the system input/output size.Before this change, the default
sys2=1was converted to a 1x1 static state-space system, so square MIMO systems failed the feedback dimension check even though explicit identity feedback worked.Rectangular MIMO systems keep the existing incompatible-dimensions error.
Checks
ct.feedback(ct.ss([], [], [], [[1, 0], [0, 2]]))failed withValueError: State space systems don't have compatible inputs/outputs for feedback.ct.feedback(ct.rss(2, 2, 2))failed with the same dimension error.np.eye(n)feedback for static and dynamic systems.python -m pytest control/tests/bdalg_test.py::TestFeedback::test_mimo_ss_scalar_feedback -qpassed: 1 passed.python -m pytest control/tests/bdalg_test.py control/tests/statesp_test.py control/tests/type_conversion_test.py -qpassed: 1226 passed, 112 skipped, 1 xfailed, 1 warning.python -m ruff check control/statesp.py control/tests/bdalg_test.pypassed.python -m compileall -q control/statesp.py control/tests/bdalg_test.pypassed.git diff --check HEAD~1..HEADpassed.