Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc84debb

Browse files
committed
BugFix: pole of stateless StateSpace object is empty array
1 parent09f9bab commitc84debb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

‎control/statesp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def freqresp(self, omega):
399399
defpole(self):
400400
"""Compute the poles of a state space system."""
401401

402-
returneigvals(self.A)
402+
returneigvals(self.A)ifself.stateselsenp.array([])
403403

404404
defzero(self):
405405
"""Compute the zeros of a state space system."""

‎control/tests/statesp_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,12 @@ def testPole(self):
378378
self.assertTrue(abs(z)<1)
379379

380380

381+
deftestPoleStatic(self):
382+
"""Regression: pole() of static gain is empty array"""
383+
np.testing.assert_array_equal(np.array([]),
384+
StateSpace([],[],[],[[1]]).pole())
385+
386+
381387
defsuite():
382388
returnunittest.TestLoader().loadTestsFromTestCase(TestStateSpace)
383389

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp