Skip to content
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

Plotting nyquist plot from FrequencyResponseData fails #992

Closed
wueestry opened this issue Apr 16, 2024 · 3 comments
Closed

Plotting nyquist plot from FrequencyResponseData fails #992

wueestry opened this issue Apr 16, 2024 · 3 comments
Labels

Comments

@wueestry
Copy link
Contributor

When trying to create the nyquist plot from an FRD system

freq_response = ct.FRD(response, frequencies)
ct.nyquist_plot(freq_response)

the plotting fails with the following error
AttributeError: 'FrequencyResponseData' object has no attribute 'poles' during the call of _default_frequency_range

version: 0.10.0

@slivingston
Copy link
Member

Is it possible to make a Nyquist plot given only frequency response data?

@murrayrm
Copy link
Member

You can get a valid Nyquist plot from the frequency response in some instances and with some assumptions. Basically, if the open loop dynamics are assumed stable, the zero frequency gain is finite, and the high frequency gain is zero, it should work.

The error above comes when it tries to compute the default frequency range for the plot, but in the case of frequency response data you don't actually need to do that.

A quick fix is to change the call to be ct.nyquist_plot(freq_response, freq_response.omega), which bypasses the computation of the default frequency range.

@murrayrm
Copy link
Member

Fixed in #996.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants