Skip to content

Commit 007123c

Browse files
author
Kevin Chen
committed
Added test that ctrb and obsv are dual. Also removed accidental extra .hgignore that I shouldn't have added.
Steven Brunton <sbrunton@princeton.edu>
1 parent baf444d commit 007123c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎src/TestStatefbk.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ def testObsvMIMO(self):
3232
Wotrue = N.matrix("5. 6.; 7. 8.; 23. 34.; 31. 46.")
3333
Wo = obsv(A,C)
3434
N.testing.assert_array_almost_equal(Wo, Wotrue)
35+
36+
def testCtrbObsvDuality(self):
37+
A = N.matrix("1.2 -2.3; 3.4 -4.5")
38+
B = N.matrix("5.8 6.9; 8. 9.1")
39+
Wc = ctrb(A,B);
40+
A = N.transpose(A)
41+
C = N.transpose(B)
42+
Wo = N.transpose(obsv(A,C));
43+
N.testing.assert_array_almost_equal(Wc,Wo)
3544

3645
if __name__ == '__main__':
3746
unittest.main()

0 commit comments

Comments
 (0)