Repository navigation
Fix false positive algebraic loop in interconnect for MIMO feedthrough (#1257) - #1258
paneendrakumar0 wants to merge 1 commit into
Conversation
python-control#1257) In InterconnectedSystem._compute_static_io, the iteration bound cycle_count was previously capped at len(self.syslist) + 1. For MIMO systems with direct feedthrough, an acyclic feedthrough path can traverse multiple channels of the same subsystem block more than once, requiring more propagation passes than the number of subsystems. Update cycle_count bound to max(len(self.syslist), ninputs) + 1, where ninputs is the total number of internal subsystem inputs. Add unit regression tests covering MIMO feedthrough without algebraic loops and true algebraic loop detection. Fixes python-control#1257. Signed-off-by: paneendrakumar0 <paneendra100@gmail.com>
|
@paneendrakumar0 Can you disclose your use of AI tools, if any? Please read https://numpy.org/doc/stable/dev/ai_policy.html |
|
Hi @slivingston, Thanks for pointing me to the policy! Yes, I used an AI assistant (Google Antigravity / Gemini) during the development of this PR to assist with searching the repository, analyzing the iteration loop bound in InterconnectedSystem._compute_static_io, and formatting the regression test case. In accordance with the NumPy AI Policy: Understanding and verification: I have fully read, reviewed, and verified the mathematical logic and implementation myself. The root cause is that for MIMO interconnected systems with direct feedthrough (such as decentralized control of multi-channel plants), acyclic signal propagation paths can visit multiple distinct input/output channels of the same block sequentially, requiring up to ninputs + 1 iterations (or topological signal ordering) rather than len(self.syslist) + 1 (which assumed SISO blocks). Please let me know if you would like any adjustments to the approach or additional test coverage! |
|
@paneendrakumar0 Are you using an AI agent that automatically opened this PR and produced the above comment? |
|
Hi @slivingston, No, it was not automatically opened by any bot. I(Paneendra) is doing all the tests and posting here manually. Since you asked me for disclosure about NumPy policy, I have used some AI to help me draft the disclosure statement in such a way that it adheres to the policy checklist, hence sounding like a template. But, Iam the who is investigating the problem, writing and testing the code, and handling this PR. Just so you know, I use the AI only for checking and doing changes in the code after me. And I am not even at the stage where I can use Agentic AI or something like AGent or Bot that auto repiles or comments in a PR:). I am here just to handle this PR discussion, so please let me know your thoughts on this! |
|
@paneendrakumar0 Thanks for explaining! I will review this soon. |
Fixes #1257.
Summary of Changes
In
InterconnectedSystem._compute_static_io, the maximum number of iterations allowed for fixed-point signal propagation was previously bounded bylen(self.syslist) + 1.While an acyclic feedthrough path visits each subsystem block at most once in SISO interconnections, in MIMO systems with direct feedthrough, an acyclic path can traverse through different input/output channels of the same block multiple times (for example, decentralized PI control coupled to a 2x2 plant with direct feedthrough). Because
len(self.syslist) + 1was exceeded before reaching the convergence check,ct.interconnectraisedRuntimeError: algebraic loop detectedeven when the interconnection was well-posed and strictly free of algebraic loops.This PR updates the iteration bound:
where
ninputsis the total number of internal subsystem inputs acrossself.syslist.Testing
test_interconnect_mimo_feedthrough_no_algebraic_loop: verifies the 2x2 MIMO plant with decentralized PI control interconnects without error and matches the analytical closed-loop poles fromct.feedback.test_interconnect_algebraic_loop_detection: verifies that true algebraic loops (such as static positive feedback around feedthrough blocks) continue to be correctly detected and raiseRuntimeError("algebraic loop detected").control/tests/interconnect_test.py,control/tests/iosys_test.py,control/tests/statesp_test.py, andcontrol/tests/nlsys_test.pypass cleanly (1045 passed).