scipy-based implementation of ss2tf by murrayrm · Pull Request #1108 · python-control/python-control

Expand Up @@ -10,9 +10,9 @@ import pytest
import control as ct from control import (StateSpace, TransferFunction, defaults, evalfr, isctime, isdtime, reset_defaults, rss, sample_system, set_defaults, ss, ss2tf, tf, tf2ss, zpk) from control import StateSpace, TransferFunction, defaults, evalfr, isctime, \ isdtime, reset_defaults, rss, sample_system, set_defaults, ss, ss2tf, tf, \ tf2ss, zpk from control.statesp import _convert_to_statespace from control.tests.conftest import slycotonly from control.xferfcn import _convert_to_transfer_function, _tf_close_coeff Expand Down Expand Up @@ -186,7 +186,6 @@ def test_reverse_sign_siso(self): np.testing.assert_allclose(sys2.num, [[[-1., -3., -5.]]]) np.testing.assert_allclose(sys2.den, [[[1., 6., 2., -1.]]])
@slycotonly def test_reverse_sign_mimo(self): """Negate a MIMO system.""" num1 = [[[1., 2.], [0., 3.], [2., -1.]], Expand Down Expand Up @@ -228,7 +227,6 @@ def test_add_siso(self): np.testing.assert_allclose(sys3.num, [[[20., 4., -8]]]) np.testing.assert_allclose(sys3.den, [[[1., 6., 1., -7., -2., 1.]]])
@slycotonly def test_add_mimo(self): """Add two MIMO systems.""" num1 = [[[1., 2.], [0., 3.], [2., -1.]], Expand Down Expand Up @@ -276,7 +274,6 @@ def test_subtract_siso(self): np.testing.assert_allclose(sys4.num, [[[-2., -6., 12., 10., 2.]]]) np.testing.assert_allclose(sys4.den, [[[1., 6., 1., -7., -2., 1.]]])
@slycotonly def test_subtract_mimo(self): """Subtract two MIMO systems.""" num1 = [[[1., 2.], [0., 3.], [2., -1.]], Expand Down Expand Up @@ -327,7 +324,6 @@ def test_multiply_siso(self): np.testing.assert_allclose(sys3.num, sys4.num) np.testing.assert_allclose(sys3.den, sys4.den)
@slycotonly def test_multiply_mimo(self): """Multiply two MIMO systems.""" num1 = [[[1., 2.], [0., 3.], [2., -1.]], Expand Down Expand Up @@ -714,7 +710,6 @@ def test_call_dtime(self): sys = TransferFunction([1., 3., 5], [1., 6., 2., -1], 0.1) np.testing.assert_array_almost_equal(sys(1j), -0.5 - 0.5j)
@slycotonly def test_call_mimo(self): """Evaluate the frequency response of a MIMO system at one frequency."""
Expand Down Expand Up @@ -755,7 +750,6 @@ def test_frequency_response_siso(self): np.testing.assert_array_almost_equal(phase, truephase) np.testing.assert_array_almost_equal(omega, trueomega)
@slycotonly def test_freqresp_mimo(self): """Evaluate the MIMO magnitude and phase at multiple frequencies.""" num = [[[1., 2.], [0., 3.], [2., -1.]], Expand Down Expand Up @@ -852,7 +846,6 @@ def test_common_den_nonproper(self): _, den2, _ = tf2._common_den(allow_nonproper=True) np.testing.assert_array_almost_equal(den2, common_den_ref)
@slycotonly def test_pole_mimo(self): """Test for correct MIMO poles.""" sys = TransferFunction( Expand Down Expand Up @@ -936,7 +929,6 @@ def test_append(self): tf_appended_2 = tf1.append(tf2).append(tf3) assert _tf_close_coeff(tf_exp_2, tf_appended_2)
@slycotonly def test_convert_to_transfer_function(self): """Test for correct state space to transfer function conversion.""" A = [[1., -2.], [-3., 4.]] Expand Down Expand Up @@ -1023,7 +1015,6 @@ def test_state_space_conversion_mimo(self): np.testing.assert_array_almost_equal(H.num[1][0], H2.num[1][0]) np.testing.assert_array_almost_equal(H.den[1][0], H2.den[1][0])
@slycotonly def test_indexing(self): """Test TF scalar indexing and slice""" tm = ss2tf(rss(5, 3, 3)) Expand Down Expand Up @@ -1213,7 +1204,6 @@ def test_printing_polynomial(self, args, outputfmt, var, dt, dtstring): assert len(polystr[0].split('\n')) == 4 assert polystr[2] == outputfmt.format(var=var)
@slycotonly def test_printing_mimo(self): """Print MIMO, continuous time""" sys = ss2tf(rss(4, 2, 3)) Expand Down Expand Up @@ -1332,7 +1322,6 @@ def test_printing_zpk_mimo(self, num, den, output): res = str(G) assert res.partition('\n\n')[2] == output
@slycotonly def test_size_mismatch(self): """Test size mismacht""" sys1 = ss2tf(rss(2, 2, 2)) Expand Down