Skip to content

Validate discrete gain crossovers on the unit circle - #1273

Open
galleonli wants to merge 1 commit into
python-control:mainfrom
galleonli:fix/discrete-gain-crossovers
Open

galleonli wants to merge 1 commit into
python-control:mainfrom
galleonli:fix/discrete-gain-crossovers

Conversation

@galleonli

@galleonli galleonli commented Nov 10, 2026 •

Copy link
Copy Markdown

The old tolerance grew with system order, so points where the gain was well below 1 could still count as crossovers. That led to incorrect phase margins.

This change checks the gain again on the unit circle. When a candidate is slightly off, it solves for a nearby root and keeps the point only if the gain is close to 1.

All five new regression cases fail on main and pass with this change. The local margin, FRD, transfer-function, and LTI tests finished with 419 passed and 130 skipped.

I used OpenAI Codex to write the patch and regression tests and run the local checks.

Refs #1266.

@slivingston

Copy link
Copy Markdown
Member

@galleonli Can you run the checks locally yourself, without using OpenAI ? Just confirming as a proof-of-understanding.

@galleonli

Copy link
Copy Markdown
Author

@galleonli Can you run the checks locally yourself, without using OpenAI ? Just confirming as a proof-of-understanding.

Sure! I ran all four test modules locally myself: 419 passed, 130 skipped.

@slivingston
slivingston self-requested a review November 11, 2026 22:40
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.

2 participants