gpt4 book ai didi

python plotly smith 图表函数行为与 scikit-rf 不同

转载 作者:行者123 更新时间:2023-12-05 03:31:26 31 4
gpt4 key购买 nike

有人可以解释为什么这两个 smith chart plot function for exactly same circle of plotly 和 scikit-rf 如此不同吗?我怎样才能像 scikit-rf 那样绘制 plotly plot,因为我需要从 smith chart 读取值,而 scikit-rf plot 并不容易?

def calc_circle(c, r):
theta = np.linspace(0, 2*np.pi, 1000)
return c + r*np.exp(1.0j*theta)

c,r=0.4,0.2
fig = go.Figure(go.Scattersmith(imag=np.imag(calc_circle(c, r)), real=np.real(calc_circle(c, r)),marker_color="green",showlegend=True,name='Hello'))
fig.show()

This is what plotly plot

    n = rf.Network(name="out", s=calc_circle(c, r))
n.plot_s_smith(lw=2,draw_labels=True)

This is what scikit-rf plot

最佳答案

Plotly Scattersmith 要求以归一化阻抗值而不是反射系数值的形式提供图像和实际数据。这意味着您的函数 calc_circle 的结果需要使用简单公式 z = (1 + rho)/(1 - rho) 进行转换,其中 z 是归一化阻抗,rho 是您使用 calc_circle 函数获得的反射系数。

关于python plotly smith 图表函数行为与 scikit-rf 不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70649445/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com