From 84681cd459f88ead01cd4656add9042ab899aca8 Mon Sep 17 00:00:00 2001 From: Richard Murray Date: Thu, 20 Dec 2018 22:24:43 -0800 Subject: [PATCH 1/2] TRV: docstring fix --- control/statesp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/control/statesp.py b/control/statesp.py index b55a8c681..6385642eb 100644 --- a/control/statesp.py +++ b/control/statesp.py @@ -385,7 +385,7 @@ def evalfr(self, omega): with input value s = i * omega. """ - warn("StateSpace.evalfr(omega) will be depracted in a future " + warn("StateSpace.evalfr(omega) will be deprecated in a future " "release of python-control; use evalfr(sys, omega*1j) instead", PendingDeprecationWarning) return self._evalfr(omega) From cc4508c82c8b12df74601c13ac0c6cfaf78b4b40 Mon Sep 17 00:00:00 2001 From: Richard Murray Date: Thu, 20 Dec 2018 22:25:20 -0800 Subject: [PATCH 2/2] fix bad lqr test case (cross term not pos def) --- control/tests/matlab_test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/control/tests/matlab_test.py b/control/tests/matlab_test.py index efde21c1d..d187f6125 100644 --- a/control/tests/matlab_test.py +++ b/control/tests/matlab_test.py @@ -414,6 +414,14 @@ def testAcker(self): @unittest.skipIf(not slycot_check(), "slycot not installed") def testLQR(self): (K, S, E) = lqr(self.siso_ss1.A, self.siso_ss1.B, np.eye(2), np.eye(1)) + + # Should work if [Q N;N' R] is positive semi-definite + (K, S, E) = lqr(self.siso_ss2.A, self.siso_ss2.B, 10*np.eye(3), \ + np.eye(1), [[1], [1], [2]]) + + @unittest.skip("check not yet implemented") + def testLQR_checks(self): + # Make sure we get a warning if [Q N;N' R] is not positive semi-definite (K, S, E) = lqr(self.siso_ss2.A, self.siso_ss2.B, np.eye(3), \ np.eye(1), [[1], [1], [2]])