scipy-based implementation of ss2tf · python-control/python-control@e539c72
@@ -10,9 +10,9 @@
1010import pytest
11111212import control as ct
13-from control import (StateSpace, TransferFunction, defaults, evalfr, isctime,
14- isdtime, reset_defaults, rss, sample_system, set_defaults,
15- ss, ss2tf, tf, tf2ss, zpk)
13+from control import StateSpace, TransferFunction, defaults, evalfr, isctime, \
14+isdtime, reset_defaults, rss, sample_system, set_defaults, ss, ss2tf, tf, \
15+tf2ss, zpk
1616from control.statesp import _convert_to_statespace
1717from control.tests.conftest import slycotonly
1818from control.xferfcn import _convert_to_transfer_function, _tf_close_coeff
@@ -186,7 +186,6 @@ def test_reverse_sign_siso(self):
186186np.testing.assert_allclose(sys2.num, [[[-1., -3., -5.]]])
187187np.testing.assert_allclose(sys2.den, [[[1., 6., 2., -1.]]])
188188189-@slycotonly
190189def test_reverse_sign_mimo(self):
191190"""Negate a MIMO system."""
192191num1 = [[[1., 2.], [0., 3.], [2., -1.]],
@@ -228,7 +227,6 @@ def test_add_siso(self):
228227np.testing.assert_allclose(sys3.num, [[[20., 4., -8]]])
229228np.testing.assert_allclose(sys3.den, [[[1., 6., 1., -7., -2., 1.]]])
230229231-@slycotonly
232230def test_add_mimo(self):
233231"""Add two MIMO systems."""
234232num1 = [[[1., 2.], [0., 3.], [2., -1.]],
@@ -276,7 +274,6 @@ def test_subtract_siso(self):
276274np.testing.assert_allclose(sys4.num, [[[-2., -6., 12., 10., 2.]]])
277275np.testing.assert_allclose(sys4.den, [[[1., 6., 1., -7., -2., 1.]]])
278276279-@slycotonly
280277def test_subtract_mimo(self):
281278"""Subtract two MIMO systems."""
282279num1 = [[[1., 2.], [0., 3.], [2., -1.]],
@@ -327,7 +324,6 @@ def test_multiply_siso(self):
327324np.testing.assert_allclose(sys3.num, sys4.num)
328325np.testing.assert_allclose(sys3.den, sys4.den)
329326330-@slycotonly
331327def test_multiply_mimo(self):
332328"""Multiply two MIMO systems."""
333329num1 = [[[1., 2.], [0., 3.], [2., -1.]],
@@ -714,7 +710,6 @@ def test_call_dtime(self):
714710sys = TransferFunction([1., 3., 5], [1., 6., 2., -1], 0.1)
715711np.testing.assert_array_almost_equal(sys(1j), -0.5 - 0.5j)
716712717-@slycotonly
718713def test_call_mimo(self):
719714"""Evaluate the frequency response of a MIMO system at one frequency."""
720715@@ -755,7 +750,6 @@ def test_frequency_response_siso(self):
755750np.testing.assert_array_almost_equal(phase, truephase)
756751np.testing.assert_array_almost_equal(omega, trueomega)
757752758-@slycotonly
759753def test_freqresp_mimo(self):
760754"""Evaluate the MIMO magnitude and phase at multiple frequencies."""
761755num = [[[1., 2.], [0., 3.], [2., -1.]],
@@ -852,7 +846,6 @@ def test_common_den_nonproper(self):
852846_, den2, _ = tf2._common_den(allow_nonproper=True)
853847np.testing.assert_array_almost_equal(den2, common_den_ref)
854848855-@slycotonly
856849def test_pole_mimo(self):
857850"""Test for correct MIMO poles."""
858851sys = TransferFunction(
@@ -936,7 +929,6 @@ def test_append(self):
936929tf_appended_2 = tf1.append(tf2).append(tf3)
937930assert _tf_close_coeff(tf_exp_2, tf_appended_2)
938931939-@slycotonly
940932def test_convert_to_transfer_function(self):
941933"""Test for correct state space to transfer function conversion."""
942934A = [[1., -2.], [-3., 4.]]
@@ -1023,7 +1015,6 @@ def test_state_space_conversion_mimo(self):
10231015np.testing.assert_array_almost_equal(H.num[1][0], H2.num[1][0])
10241016np.testing.assert_array_almost_equal(H.den[1][0], H2.den[1][0])
102510171026-@slycotonly
10271018def test_indexing(self):
10281019"""Test TF scalar indexing and slice"""
10291020tm = ss2tf(rss(5, 3, 3))
@@ -1213,7 +1204,6 @@ def test_printing_polynomial(self, args, outputfmt, var, dt, dtstring):
12131204assert len(polystr[0].split('\n')) == 4
12141205assert polystr[2] == outputfmt.format(var=var)
121512061216-@slycotonly
12171207def test_printing_mimo(self):
12181208"""Print MIMO, continuous time"""
12191209sys = ss2tf(rss(4, 2, 3))
@@ -1332,7 +1322,6 @@ def test_printing_zpk_mimo(self, num, den, output):
13321322res = str(G)
13331323assert res.partition('\n\n')[2] == output
133413241335-@slycotonly
13361325def test_size_mismatch(self):
13371326"""Test size mismacht"""
13381327sys1 = ss2tf(rss(2, 2, 2))