|
12 | 12 | from numpy import inf, nan |
13 | 13 | from numpy.testing import assert_allclose |
14 | 14 |
|
15 | | -from control.frdata import FrequencyResponseData |
16 | | -from control.margins import (margin, phase_crossover_frequencies, |
17 | | - stability_margins) |
18 | | -from control.statesp import StateSpace |
19 | | -from control.xferfcn import TransferFunction |
20 | | -from control.exception import ControlMIMONotImplemented |
| 15 | +from control import ControlMIMONotImplemented, FrequencyResponseData, \ |
| 16 | + StateSpace, TransferFunction, margin, phase_crossover_frequencies, \ |
| 17 | + stability_margins |
21 | 18 |
|
22 | 19 | s = TransferFunction.s |
23 | 20 |
|
@@ -111,15 +108,17 @@ def test_margin_3input(tsys): |
111 | 108 | out = margin((mag, phase*180/np.pi, omega_)) |
112 | 109 | assert_allclose(out, np.array(refout)[[0, 1, 3, 4]], atol=1.5e-3) |
113 | 110 |
|
114 | | - |
115 | 111 | @pytest.mark.parametrize( |
116 | 112 | 'tfargs, omega_ref, gain_ref', |
117 | 113 | [(([1], [1, 2, 3, 4]), [1.7325, 0.], [-0.5, 0.25]), |
118 | 114 | (([1], [1, 1]), [0.], [1.]), |
119 | 115 | (([2], [1, 3, 3, 1]), [1.732, 0.], [-0.25, 2.]), |
120 | 116 | ((np.array([3, 11, 3]) * 1e-4, [1., -2.7145, 2.4562, -0.7408], .1), |
121 | 117 | [1.6235, 0.], [-0.28598, 1.88889]), |
| 118 | + (([200.0], [1.0, 21.0, 20.0, 0.0]), |
| 119 | + [4.47213595, 0], [-0.47619048, inf]), |
122 | 120 | ]) |
| 121 | +@pytest.mark.filterwarnings("error") |
123 | 122 | def test_phase_crossover_frequencies(tfargs, omega_ref, gain_ref): |
124 | 123 | """Test phase_crossover_frequencies() function""" |
125 | 124 | sys = TransferFunction(*tfargs) |
|
0 commit comments