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

Commitcab7fa0

Browse files
authored
Merge pull request#219 from murrayrm/fix_slycot-zero
Fix slycot zeroSmall fix of a bug that is blocking 0.8.0 release => merging without external review.
2 parentsf79fbe4 +87ec281 commitcab7fa0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

‎control/statesp.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,11 @@ def zero(self):
525525
out=ab08nd(self.A.shape[0],self.B.shape[1],self.C.shape[0],
526526
self.A,self.B,self.C,self.D)
527527
nu=out[0]
528-
returnsp.linalg.eigvals(out[8][0:nu,0:nu],out[9][0:nu,0:nu])
528+
ifnu==0:
529+
returnnp.array([])
530+
else:
531+
returnsp.linalg.eigvals(out[8][0:nu,0:nu],out[9][0:nu,0:nu])
532+
529533
exceptImportError:# Slycot unavailable. Fall back to scipy.
530534
ifself.C.shape[0]!=self.D.shape[1]:
531535
raiseNotImplementedError("StateSpace.zero only supports "

‎control/tests/statesp_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ def testPole(self):
4242

4343
np.testing.assert_array_almost_equal(p,true_p)
4444

45+
deftestEmptyZero(self):
46+
"""Test to make sure zero() works with no zeros in system"""
47+
sys=_convertToStateSpace(TransferFunction([1], [1,2,1]))
48+
np.testing.assert_array_equal(sys.zero(),np.array([]))
49+
4550
@unittest.skipIf(notslycot_check(),"slycot not installed")
4651
deftestMIMOZero_nonsquare(self):
4752
"""Evaluate the zeros of a MIMO system."""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp