Skip to content

Commit 16f419d

Browse files
committed
drop statefbk_matrix_test.py
1 parent 0174901 commit 16f419d

File tree

2 files changed

+15
-366
lines changed

2 files changed

+15
-366
lines changed

control/tests/statefbk_matrix_test.py

Lines changed: 0 additions & 365 deletions
This file was deleted.

control/tests/statefbk_test.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import numpy as np
99
import pytest
1010

11-
from control import pole, rss, ss, tf
11+
from control import lqe, pole, rss, ss, tf
1212
from control.exception import ControlDimension
1313
from control.mateqn import care, dare
1414
from control.statefbk import ctrb, obsv, place, place_varga, lqr, gram, acker
@@ -324,6 +324,20 @@ def test_LQR_3args(self):
324324
K, S, poles = lqr(sys, Q, R)
325325
self.check_LQR(K, S, poles, Q, R)
326326

327+
def check_LQE(self, L, P, poles, G, QN, RN):
328+
P_expected = np.array(np.sqrt(G*QN*G * RN))
329+
L_expected = P_expected / RN
330+
poles_expected = np.array([-L_expected], ndmin=2)
331+
np.testing.assert_array_almost_equal(P, P_expected)
332+
np.testing.assert_array_almost_equal(L, L_expected)
333+
np.testing.assert_array_almost_equal(poles, poles_expected)
334+
335+
@slycotonly
336+
def test_LQE(self):
337+
A, G, C, QN, RN = 0., .1, 1., 10., 2.
338+
L, P, poles = lqe(A, G, C, QN, RN)
339+
self.check_LQE(L, P, poles, G, QN, RN)
340+
327341
@slycotonly
328342
def test_care(self):
329343
#unit test for stabilizing and anti-stabilizing feedbacks

0 commit comments

Comments
 (0)