@@ -166,7 +166,7 @@ def testAcker(self, fixedseed):
166
166
continue
167
167
168
168
# Place the poles at random locations
169
- des = rss (states , 1 , 1 );
169
+ des = rss (states , 1 , 1 )
170
170
poles = pole (des )
171
171
172
172
# Now place the poles using acker
@@ -339,6 +339,11 @@ def test_DLQR_3args(self, matarrayin, matarrayout, method):
339
339
K , S , poles = dlqr (dsys , Q , R , method = method )
340
340
self .check_DLQR (K , S , poles , Q , R )
341
341
342
+ def test_DLQR_4args (self , matarrayin , matarrayout ):
343
+ A , B , Q , R = (matarrayin ([[X ]]) for X in [0. , 1. , 10. , 2. ])
344
+ K , S , poles = dlqr (A , B , Q , R )
345
+ self .check_DLQR (K , S , poles , Q , R )
346
+
342
347
def test_lqr_badmethod (self ):
343
348
A , B , Q , R = 0 , 1 , 10 , 2
344
349
with pytest .raises (ControlArgument , match = "Unknown method" ):
@@ -469,8 +474,21 @@ def test_lqe_call_format(self):
469
474
with pytest .raises (ct .ControlDimension , match = "incorrect covariance" ):
470
475
L , P , E = lqe (sys .A , sys .B , sys .C , R , Q )
471
476
477
+ def check_DLQE (self , L , P , poles , G , QN , RN ):
478
+ P_expected = asmatarrayout (G .dot (QN ).dot (G ))
479
+ L_expected = asmatarrayout (0 )
480
+ poles_expected = - np .squeeze (np .asarray (L_expected ))
481
+ np .testing .assert_array_almost_equal (P , P_expected )
482
+ np .testing .assert_array_almost_equal (L , L_expected )
483
+ np .testing .assert_array_almost_equal (poles , poles_expected )
484
+
485
+ def test_DLQE (self , matarrayin ):
486
+ A , G , C , QN , RN = (matarrayin ([[X ]]) for X in [0. , .1 , 1. , 10. , 2. ])
487
+ L , P , poles = dlqe (A , G , C , QN , RN )
488
+ self .check_DLQE (L , P , poles , G , QN , RN )
489
+
472
490
def test_care (self , matarrayin ):
473
- """Test stabilizing and anti-stabilizing feedbacks , continuous"""
491
+ """Test stabilizing feedback , continuous"""
474
492
A = matarrayin (np .diag ([1 , - 1 ]))
475
493
B = matarrayin (np .identity (2 ))
476
494
Q = matarrayin (np .identity (2 ))
@@ -489,7 +507,7 @@ def test_care(self, matarrayin):
489
507
X , L , G = care (A , B , Q , R , S , E , stabilizing = False )
490
508
491
509
def test_dare (self , matarrayin ):
492
- """Test stabilizing and anti-stabilizing feedbacks , discrete"""
510
+ """Test stabilizing feedback , discrete"""
493
511
A = matarrayin (np .diag ([0.5 , 2 ]))
494
512
B = matarrayin (np .identity (2 ))
495
513
Q = matarrayin (np .identity (2 ))
0 commit comments