8000 Merge pull request #996 from wueestry/nyquist_frd · python-control/python-control@dbc998d · GitHub
[go: up one dir, main page]

Skip to content

Commit dbc998d

Browse files
authored
Merge pull request #996 from wueestry/nyquist_frd
Fix nyquist plotting from FrequencyResponseData. I have another PR coming where I can add the capability I describe above.
2 parents e1d21d2 + 7fa5960 commit dbc998d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

control/freqplot.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,6 +2468,14 @@ def _determine_omega_vector(syslist, omega_in, omega_limits, omega_num,
24682468
"""
24692469
omega_range_given = True
24702470

2471+
if omega_in is None:
2472+
for sys in syslist:
2473+
if isinstance(sys, FrequencyResponseData):
2474+
# FRD already has predetermined frequencies
2475+
if omega_in is not None and not np.all(omega_in == sys.omega):
2476+
raise ValueError("List of FrequencyResponseData systems can only have a single frequency range between them")
2477+
omega_in = sys.omega
2478+
24712479
if omega_in is None:
24722480
if omega_limits is None:
24732481
omega_range_given = False

control/tests/frd_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ def testNyquist(self):
192192
# plt.savefig('/dev/null', format='svg')
193193
plt.figure(2)
194194
freqplot.nyquist(f1, f1.omega)
195+
plt.figure(3)
196+
freqplot.nyquist(f1)
195197
# plt.savefig('/dev/null', format='svg')
196198

197199
@slycotonly

0 commit comments

Comments
 (0)
0