Skip to content

Commit cc4508c

Browse files
committed
fix bad lqr test case (cross term not pos def)
1 parent 84681cd commit cc4508c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

control/tests/matlab_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,14 @@ def testAcker(self):
414414
@unittest.skipIf(not slycot_check(), "slycot not installed")
415415
def testLQR(self):
416416
(K, S, E) = lqr(self.siso_ss1.A, self.siso_ss1.B, np.eye(2), np.eye(1))
417+
418+
# Should work if [Q N;N' R] is positive semi-definite
419+
(K, S, E) = lqr(self.siso_ss2.A, self.siso_ss2.B, 10*np.eye(3), \
420+
np.eye(1), [[1], [1], [2]])
421+
422+
@unittest.skip("check not yet implemented")
423+
def testLQR_checks(self):
424+
# Make sure we get a warning if [Q N;N' R] is not positive semi-definite
417425
(K, S, E) = lqr(self.siso_ss2.A, self.siso_ss2.B, np.eye(3), \
418426
np.eye(1), [[1], [1], [2]])
419427

0 commit comments

Comments
 (0)