I am trying to use python to plot a Nyquist plot. However, I can't get it right.
This is the code I am using:
import control
import matplotlib.pyplot as plt
#Creating a transfer function G
s = control.TransferFunction.s
K0 = 10
T = 10
G = K0 / (s**2 * (T*s + 1))
control.nyquist(G)
plt.grid(True)
plt.title('Nyquist Diagram of G(s)')
plt.xlabel('Re(s)')
plt.ylabel('Im(s)')
plt.show()
The code outputs this graph:
But the plot should look like this (from wolfram):
Why is the Nyquist plot from the control package wrong? How can I get it right?
Thank you very much.
You'll have to adjust that via matplotlib parameters. The nyquist funtion you are using passes **kwars to matplotlib.
You can see that
is an alias for
which has this inputs: