Skip to content

Nyquist plot with imaginary poles, semi-circles only working after 'trick' #613

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

Closed
kevindekemele opened this issue Apr 22, 2021 · 2 comments · Fixed by #620
Closed

Nyquist plot with imaginary poles, semi-circles only working after 'trick' #613

kevindekemele opened this issue Apr 22, 2021 · 2 comments · Fixed by #620

Comments

@kevindekemele
Copy link

I'm plotting the Nyquist diagram of a transfer function which has poles on the imaginary axis:


import control
import matplotlib.pyplot as plt
import numpy as np

K = 1

Gp =  control.tf([1], [1,1,0,0,0]) 
Gc = control.tf([K], [1]) 


control.nyquist_plot(Gp*Gc,plot=True,omega_num=1000)
plt.show()

Which results in the following incorrect plot, that does not show infinte semicircles, but something incorrect:
image

Also using indent_direction and indent_radius did not solve this.
The trick I found that makes it work is if I add omega_limits=[0.001,10000] to nyquist_plot:

image

Can you please fix such that the incorrect 'line' does not appear?

@bnavigator
Copy link
Contributor

bnavigator commented Apr 24, 2021

Yes, the algorithm to determine the default omega vector for the system starts with a lower frequency of 0.1, because the lowest non-zero pole of the system is at -1.

# This code looks at the poles and zeros of all of the systems that
# we are plotting and sets the frequency range to be one decade above
# and below the min and max feature frequencies, rounded to the nearest
# integer. It excludes poles and zeros at the origin. If no features
# are found, it turns logspace(-1, 1)

The "trick" to manually define the omega limits is the correct way to override the default omega vector determination.

@kevindekemele
Copy link
Author

Perhaps if there is a pole at the origin, the lower limit of the omega vector should be below the indent_radius ?

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

Successfully merging a pull request may close this issue.

2 participants