Skip to content

Fix nyquist plotting from FrequencyResponseData #996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions control/freqplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2468,6 +2468,14 @@ def _determine_omega_vector(syslist, omega_in, omega_limits, omega_num,
"""
omega_range_given = True

if omega_in is None:
for sys in syslist:
if isinstance(sys, FrequencyResponseData):
# FRD already has predetermined frequencies
if omega_in is not None and not np.all(omega_in == sys.omega):
raise ValueError("List of FrequencyResponseData systems can only have a single frequency range between them")
omega_in = sys.omega

if omega_in is None:
if omega_limits is None:
omega_range_given = False
Expand Down
2 changes: 2 additions & 0 deletions control/tests/frd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ def testNyquist(self):
# plt.savefig('/dev/null', format='svg')
plt.figure(2)
freqplot.nyquist(f1, f1.omega)
plt.figure(3)
freqplot.nyquist(f1)
# plt.savefig('/dev/null', format='svg')

@slycotonly
Expand Down
Loading