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

Commitbf6c446

Browse files
committed
Added singularity check to the residualization method
* Changed the unit test in matlab_test.py so that no error is thrown
1 parent1fe639c commitbf6c446

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎control/modelsimp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ def modred(sys, ELIM, method='matchdc'):
181181
# if matchdc, residualize
182182

183183
# Check if the matrix A22 is invertible
184-
#if np.linalg.matrix_rank(A22) != len(ELIM):
185-
# raise ValueError("Matrix A22 is singular to working precision.")
184+
ifnp.linalg.matrix_rank(A22)!=len(ELIM):
185+
raiseValueError("Matrix A22 is singular to working precision.")
186186

187187
# Now precompute A22\A21 and A22\B2 (A22I = inv(A22))
188188
# We can solve two linear systems in one pass, since the

‎control/tests/matlab_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def testBalred(self):
363363

364364
deftestModred(self):
365365
modred(self.siso_ss1, [1])
366-
modred(self.siso_ss2*self.siso_ss3, [1,2])
366+
modred(self.siso_ss2*self.siso_ss3, [0,1])
367367
modred(self.siso_ss3, [1],'matchdc')
368368
modred(self.siso_ss3, [1],'truncate')
369369

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp