@@ -166,7 +166,7 @@ def testAcker(self, fixedseed):
166166 continue
167167
168168 # Place the poles at random locations
169- des = rss (states , 1 , 1 );
169+ des = rss (states , 1 , 1 )
170170 poles = pole (des )
171171
172172 # Now place the poles using acker
@@ -339,6 +339,11 @@ def test_DLQR_3args(self, matarrayin, matarrayout, method):
339339 K , S , poles = dlqr (dsys , Q , R , method = method )
340340 self .check_DLQR (K , S , poles , Q , R )
341341
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+
342347 def test_lqr_badmethod (self ):
343348 A , B , Q , R = 0 , 1 , 10 , 2
344349 with pytest .raises (ControlArgument , match = "Unknown method" ):
@@ -469,8 +474,21 @@ def test_lqe_call_format(self):
469474 with pytest .raises (ct .ControlDimension , match = "incorrect covariance" ):
470475 L , P , E = lqe (sys .A , sys .B , sys .C , R , Q )
471476
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+
472490 def test_care (self , matarrayin ):
473- """Test stabilizing and anti-stabilizing feedbacks , continuous"""
491+ """Test stabilizing feedback , continuous"""
474492 A = matarrayin (np .diag ([1 , - 1 ]))
475493 B = matarrayin (np .identity (2 ))
476494 Q = matarrayin (np .identity (2 ))
@@ -489,7 +507,7 @@ def test_care(self, matarrayin):
489507 X , L , G = care (A , B , Q , R , S , E , stabilizing = False )
490508
491509 def test_dare (self , matarrayin ):
492- """Test stabilizing and anti-stabilizing feedbacks , discrete"""
510+ """Test stabilizing feedback , discrete"""
493511 A = matarrayin (np .diag ([0.5 , 2 ]))
494512 B = matarrayin (np .identity (2 ))
495513 Q = matarrayin (np .identity (2 ))
0 commit comments