Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion control/statesp.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def _matrix(a):
module.
"""
from numpy import matrix
am = matrix(a)
am = matrix(a, dtype=float)
if (1, 0) == am.shape:
am.shape = (0, 0)
return am
Expand Down
10 changes: 10 additions & 0 deletions control/tests/xferfcn_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,16 @@ def test_dcgain_discr(self):
sys = TransferFunction([1,-1], [1], True)
np.testing.assert_equal(sys.dcgain(), 0)

def test_ss2tf(self):
A = np.array([[-4, -1], [-1, -4]])
B = np.array([[1], [3]])
C = np.array([[3, 1]])
D = 0
sys = ss2tf(A, B, C, D)
true_sys = TransferFunction([6., 14.], [1., 8., 15.])
np.testing.assert_almost_equal(sys.num, true_sys.num)
np.testing.assert_almost_equal(sys.den, true_sys.den)


def suite():
return unittest.TestLoader().loadTestsFromTestCase(TestXferFcn)
Expand Down