Skip to content

Commit 9c68700

Browse files
committed
FIX:
- in singular_values_plot: the complex argument to be evaluated for the frequency response is now computed in the if branch - fixed typos in freqresp_test.py: the siso system is now also tested
1 parent 3b09ae7 commit 9c68700

3 files changed

Lines changed: 35 additions & 2999 deletions

File tree

control/freqplot.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
from .exception import ControlMIMONotImplemented
5555
from .statesp import StateSpace
5656
from .xferfcn import TransferFunction
57-
from .lti import evalfr
5857
from . import config
5958

6059
__all__ = ['bode_plot', 'nyquist_plot', 'gangof4_plot', 'singular_values_plot',
@@ -1157,10 +1156,12 @@ def singular_values_plot(syslist, omega=None,
11571156
# limit up to and including nyquist frequency
11581157
omega_sys = np.hstack((
11591158
omega_sys[omega_sys < nyquistfrq], nyquistfrq))
1159+
omega_complex = np.exp(1j * omega * sys.dt)
11601160
else:
11611161
nyquistfrq = None
1162+
omega_complex = 1j*omega
11621163

1163-
fresp = sys(1j*omega if sys.isctime() else np.exp(1j * omega * sys.dt), squeeze=False)
1164+
fresp = sys(omega_complex, squeeze=False)
11641165

11651166
fresp = fresp.transpose((2, 0, 1))
11661167
sigma = np.linalg.svd(fresp, compute_uv=False)

control/tests/freqresp_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,12 +573,12 @@ def ss_siso_t():
573573

574574

575575
@pytest.fixture
576-
def tsystem(request, ss_mimo_t, ss_miso_t, ss_simo_t):
576+
def tsystem(request, ss_mimo_t, ss_miso_t, ss_simo_t, ss_siso_t):
577577

578578
systems = {"ss_mimo": ss_mimo_t,
579579
"ss_miso": ss_miso_t,
580580
"ss_simo": ss_simo_t,
581-
"ss_siso": ss_simo_t
581+
"ss_siso": ss_siso_t
582582
}
583583
return systems[request.param]
584584

0 commit comments

Comments
 (0)