Reflection.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:em_examples 作者: geoscixyz 项目源码 文件源码
def getReflectionandTransmission(sig1, sig2, f, theta_i, eps1=epsilon_0, eps2=epsilon_0, mu1=mu_0, mu2=mu_0,dtype="TE"):
    """
    Compute reflection and refraction coefficient of plane waves
    """
    theta_i = np.deg2rad(theta_i)
    omega = 2*np.pi*f

    k1 = np.sqrt(omega**2*mu1*eps1-1j*omega*mu1*sig1)
    k2 = np.sqrt(omega**2*mu2*eps2-1j*omega*mu2*sig2)

    if dtype == "TE":
        bunmo = mu2*k1*np.cos(theta_i) + mu1*(k2**2-k1**2*np.sin(theta_i)**2)**0.5
        bunja_r = mu2*k1*np.cos(theta_i) - mu1*(k2**2-k1**2*np.sin(theta_i)**2)**0.5
        bunja_t = 2*mu2*k1*np.cos(theta_i)
    elif dtype == "TM":
        bunmo = mu2*k1*(k2**2-k1**2*np.sin(theta_i)**2)**0.5 + mu1*k2**2 * np.cos(theta_i)
        bunja_r = mu2*k1*(k2**2-k1**2*np.sin(theta_i)**2)**0.5 - mu1*k2**2 * np.cos(theta_i)
        bunja_t = 2*mu1*k2**2*np.cos(theta_i)
    else:
        raise Exception("XXX")

    r = bunja_r / bunmo
    t = bunja_t / bunmo

    theta_t = np.rad2deg(abs(np.arcsin(k1/k2 * np.sin(theta_i))))
    return r, t, theta_t
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号