fix: HinfSyn Bk sign + 105 hardening tests from python-control audit#25
Merged
fix: HinfSyn Bk sign + 105 hardening tests from python-control audit#25
Conversation
The observer gain L is stored with negative sign convention:
L = -(Y*C2' + S2)*R2^{-1}. The DGKF central controller requires
Bk = -Zp*L to get positive observer correction, but the code had
Bk = Zp*L — missing the negation.
This produced controllers with unstable closed-loop poles for plants
with open-loop RHP eigenvalues (e.g., Scherer et al. IEEE TAC 1997
Example 7). Previously tested stable plants masked the sign error.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Systematic audit of python-control issues (100+), PRs (40+), test suites, Jupyter notebooks (14), and example scripts (17) to extract edge cases, MATLAB-validated vectors, and numerical pitfalls. Tests organized by functional area: - hardening_test.go: Riccati, LQR/LQE, symmetry, cross-terms (22) - hardening_placement_test.go: Acker, Place, Ctrb duality (10) - hardening_feedback_test.go: Feedback, Series, Parallel, TF (11) - hardening_gramian_test.go: MATLAB Gramians, HSV, H2/Hinf norms (13) - hardening_response_test.go: Step, impulse, DC gain, c2d (10) - hardening_lyapcanon_test.go: Lyapunov, modal/companion forms (13) - hardening_margin_test.go: GM/PM, phase unwrap, DT margins (12) - hardening_synthesis_test.go: Scherer H2 (norm=7.7484), PVTOL (5) - hardening_robust_test.go: Disk margins, Type 2/3, bandwidth (9) Key reference systems: PVTOL aircraft (6-state MIMO), Scherer et al. IEEE TAC 1997 (published H2 norm), Skogestad mixed-sensitivity, coupled spring-mass (transmission zero), inverted pendulum. python-control-audit.md documents all findings with test vectors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Bkwas missing negation, producing unstable closed-loop poles for plants with RHP eigenvaluesBug fix
hinfsyn.go:156— The DGKF central controller requiresBk = -Zp*L(observer gainLis stored with negative convention), but code hadBk = Zp*L. This masked itself on stable plants but failed on the Scherer et al. (IEEE TAC 1997) benchmark with open-loop poles at1.69±2.50j.New tests by area
hardening_test.gohardening_placement_test.gohardening_feedback_test.gohardening_gramian_test.gohardening_response_test.gohardening_lyapcanon_test.gohardening_margin_test.gohardening_synthesis_test.gohardening_robust_test.goKey reference systems
Test plan
🤖 Generated with Claude Code