使用python控件包绘制错误的Nyquist绘图

使用python控件包绘制错误的Nyquist绘图,python,transfer-function,nyquist,Python,Transfer Function,Nyquist,我正在尝试使用python绘制奈奎斯特图。然而,我不能把它弄对 这是我正在使用的代码: 导入控制 将matplotlib.pyplot作为plt导入 #创建传递函数G s=控制。传递函数。s K0=10 T=10 G=K0/(s**2*(T*s+1)) 控制。奈奎斯特(G) plt.grid(真) 产品名称(“G(s)的奈奎斯特图”) plt.xlabel('Re(s)' plt.ylabel('Im(s)' plt.show() 代码输出此图: 但情节应该是这样的(来自wolfram):

我正在尝试使用python绘制奈奎斯特图。然而,我不能把它弄对

这是我正在使用的代码:

导入控制
将matplotlib.pyplot作为plt导入
#创建传递函数G
s=控制。传递函数。s
K0=10
T=10
G=K0/(s**2*(T*s+1))
控制。奈奎斯特(G)
plt.grid(真)
产品名称(“G(s)的奈奎斯特图”)
plt.xlabel('Re(s)'
plt.ylabel('Im(s)'
plt.show()
代码输出此图:

但情节应该是这样的(来自wolfram):

为什么控制包中的奈奎斯特图是错误的?我怎样才能把它做好


非常感谢。

您必须通过matplotlib参数来调整。您正在使用的奈奎斯特函数将传递**kwars到matplotlib

你可以看到

control.nyquist
是的别名

# Function aliases
bode = bode_plot
nyquist = nyquist_plot
其中有以下输入:

def nyquist_plot(syslist, omega=None, Plot=True, color=None,
             labelFreq=0, *args, **kwargs):
"""
Nyquist plot for a system

Plots a Nyquist plot for the system over a (optional) frequency range.

Parameters
----------
syslist : list of LTI
    List of linear input/output systems (single system is OK)
omega : freq_range
    Range of frequencies (list or bounds) in rad/sec
Plot : boolean
    If True, plot magnitude
color : string
    Used to specify the color of the plot
labelFreq : int
    Label every nth frequency on the plot
*args
    Additional arguments for :func:`matplotlib.plot` (color, linestyle, etc)
**kwargs:
    Additional keywords (passed to `matplotlib`)

Returns
-------
real : array
    real part of the frequency response array
imag : array
    imaginary part of the frequency response array
freq : array
    frequencies

将xlim和ylim设置为以开头。我也相信你没有像wolfram传说中所说的那样规范化Im和Re的值