Skip to content

Fix zero-input interconnect D matrix shape#1221

Merged
murrayrm merged 1 commit into
python-control:mainfrom
marko1olo:fix-zero-input-interconnect-dmatrix
Jun 8, 2026
Merged

Fix zero-input interconnect D matrix shape#1221
murrayrm merged 1 commit into
python-control:mainfrom
marko1olo:fix-zero-input-interconnect-dmatrix

Conversation

@marko1olo

Copy link
Copy Markdown
Contributor

Fixes #1176.

Summary

  • preserves explicitly shaped empty state-space matrices such as (1, 0) in _ssmatrix
  • allows interconnect() to linearize systems with zero inputs and one or more outputs without collapsing D to (0, 0)
  • adds a regression test for the zero-input/one-output feedback interconnection case

Validation

  • python -m pytest control\tests\interconnect_test.py -q -k "zero_input_one_output or linear_interconnect or interconnect_series"
  • python -m pytest control\tests\statesp_test.py -q
  • python -m ruff check control\statesp.py control\tests\interconnect_test.py
  • python -m compileall -q control\statesp.py control\tests\interconnect_test.py
  • git diff --check

AI-assisted contribution: implemented with OpenAI Codex and reviewed locally before submission.

Preserve explicitly shaped empty state-space matrices so linearized interconnections with zero inputs and nonzero outputs keep a (noutputs, 0) D matrix.

Co-authored-by: OpenAI Codex <[email protected]>
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 94.736%. remained the same — marko1olo:fix-zero-input-interconnect-dmatrix into python-control:main

@murrayrm murrayrm merged commit da3bb13 into python-control:main Jun 8, 2026
24 of 25 checks passed
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.

Possible bug: control.interconnect fails to construct a extended system with zero input and one output (D matrix shape mismatch)

3 participants