Skip to content

Commit

Permalink
Merge pull request #996 from wueestry/nyquist_frd
Browse files Browse the repository at this point in the history
Fix nyquist plotting from FrequencyResponseData.

I have another PR coming where I can add the capability I describe above.
  • Loading branch information
murrayrm committed Jun 8, 2024
2 parents e1d21d2 + 7fa5960 commit dbc998d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
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

0 comments on commit dbc998d

Please sign in to comment.