当前位置: 首页>>代码示例>>Python>>正文


Python special.hankel1方法代码示例

本文整理汇总了Python中scipy.special.hankel1方法的典型用法代码示例。如果您正苦于以下问题:Python special.hankel1方法的具体用法?Python special.hankel1怎么用?Python special.hankel1使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在scipy.special的用法示例。


在下文中一共展示了special.hankel1方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: neumann

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import hankel1 [as 别名]
def neumann(n, z):
    """Bessel function of second kind (Neumann / Weber function) of order n at kr.
    Implemented as (hankel1(n, z) - besselj(n, z)) / 1j

    Parameters
    ----------
    n : array_like
       Order
    z: array_like
       Argument

    Returns
    -------
    Y : array_like
       Values of Hankel function of order n at position z
    """
    return (hankel1(n, z) - besselj(n, z)) / 1j 
开发者ID:AppliedAcousticsChalmers,项目名称:sound_field_analysis-py,代码行数:19,代码来源:sph.py

示例2: hankel1

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import hankel1 [as 别名]
def hankel1(n, z):
    """Bessel function of third kind (Hankel function) of order n at kr.
    Wraps scipy.special.hankel1(n, z)

    Parameters
    ----------
    n : array_like
       Order
    z: array_like
       Argument

    Returns
    -------
    H1 : array_like
       Values of Hankel function of order n at position z
    """
    return scy.hankel1(n, z) 
开发者ID:AppliedAcousticsChalmers,项目名称:sound_field_analysis-py,代码行数:19,代码来源:sph.py

示例3: sphankel1

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import hankel1 [as 别名]
def sphankel1(n, kr):
    """Spherical Hankel (first kind) of order n at kr

    Parameters
    ----------
    n : array_like
       Order
    kr: array_like
       Argument

    Returns
    -------
    hn1 : complex float
       Spherical Hankel function hn (first kind)
    """
    n, kr = scalar_broadcast_match(n, kr)
    hn1 = _np.full(n.shape, _np.nan, dtype=_np.complex_)
    kr_nonzero = kr != 0
    hn1[kr_nonzero] = _np.sqrt(_np.pi / 2) / _np.lib.scimath.sqrt(kr[kr_nonzero]) * hankel1(n[kr_nonzero] + 0.5,
                                                                                            kr[kr_nonzero])
    return hn1 
开发者ID:AppliedAcousticsChalmers,项目名称:sound_field_analysis-py,代码行数:23,代码来源:sph.py

示例4: sears_CL_freq_resp

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import hankel1 [as 别名]
def sears_CL_freq_resp(k):
    """
    Frequency response of lift coefficient according Sear's solution.
    Ref. Palacios and Cesnik, Chap.3
    """

    # hanckel functions
    H1 = scsp.hankel1(1, k)
    H0 = scsp.hankel1(0, k)

    # Sear's function
    S12star = 2. / (np.pi * k * (H0 + 1.j * H1))
    S0 = np.exp(-1.0j * k) * S12star.conj(S12star)

    # CL frequency response
    CL = 2. * np.pi * S0

    return CL 
开发者ID:ImperialCollegeLondon,项目名称:sharpy,代码行数:20,代码来源:analytical.py

示例5: test_hankel1

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import hankel1 [as 别名]
def test_hankel1(self):
        cephes.hankel1(1,1) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:4,代码来源:test_basic.py

示例6: test_negv1

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import hankel1 [as 别名]
def test_negv1(self):
        assert_almost_equal(special.hankel1(-3,2), -special.hankel1(3,2), 14) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:4,代码来源:test_basic.py

示例7: test_hankel1e

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import hankel1 [as 别名]
def test_hankel1e(self):
        hank1e = special.hankel1e(1,.1)
        hankrle = special.hankel1(1,.1)*exp(-.1j)
        assert_almost_equal(hank1e,hankrle,8) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:6,代码来源:test_basic.py

示例8: sears_fun

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import hankel1 [as 别名]
def sears_fun(kg):
    """
    Produces Sears function
    """

    S12 = 2. / np.pi / kg / (scsp.hankel1(0, kg) + 1.j * scsp.hankel1(1, kg))
    S = np.exp(-1.j * kg) * S12.conj()

    return S 
开发者ID:ImperialCollegeLondon,项目名称:sharpy,代码行数:11,代码来源:analytical.py

示例9: test_ticket_853

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import hankel1 [as 别名]
def test_ticket_853(self):
        """Negative-order Bessels"""
        # cephes
        assert_tol_equal(special.jv(-1, 1), -0.4400505857449335)
        assert_tol_equal(special.jv(-2, 1), 0.1149034849319005)
        assert_tol_equal(special.yv(-1, 1), 0.7812128213002887)
        assert_tol_equal(special.yv(-2, 1), -1.650682606816255)
        assert_tol_equal(special.iv(-1, 1), 0.5651591039924851)
        assert_tol_equal(special.iv(-2, 1), 0.1357476697670383)
        assert_tol_equal(special.kv(-1, 1), 0.6019072301972347)
        assert_tol_equal(special.kv(-2, 1), 1.624838898635178)
        assert_tol_equal(special.jv(-0.5, 1), 0.43109886801837607952)
        assert_tol_equal(special.yv(-0.5, 1), 0.6713967071418031)
        assert_tol_equal(special.iv(-0.5, 1), 1.231200214592967)
        assert_tol_equal(special.kv(-0.5, 1), 0.4610685044478945)
        # amos
        assert_tol_equal(special.jv(-1, 1+0j), -0.4400505857449335)
        assert_tol_equal(special.jv(-2, 1+0j), 0.1149034849319005)
        assert_tol_equal(special.yv(-1, 1+0j), 0.7812128213002887)
        assert_tol_equal(special.yv(-2, 1+0j), -1.650682606816255)

        assert_tol_equal(special.iv(-1, 1+0j), 0.5651591039924851)
        assert_tol_equal(special.iv(-2, 1+0j), 0.1357476697670383)
        assert_tol_equal(special.kv(-1, 1+0j), 0.6019072301972347)
        assert_tol_equal(special.kv(-2, 1+0j), 1.624838898635178)

        assert_tol_equal(special.jv(-0.5, 1+0j), 0.43109886801837607952)
        assert_tol_equal(special.jv(-0.5, 1+1j), 0.2628946385649065-0.827050182040562j)
        assert_tol_equal(special.yv(-0.5, 1+0j), 0.6713967071418031)
        assert_tol_equal(special.yv(-0.5, 1+1j), 0.967901282890131+0.0602046062142816j)

        assert_tol_equal(special.iv(-0.5, 1+0j), 1.231200214592967)
        assert_tol_equal(special.iv(-0.5, 1+1j), 0.77070737376928+0.39891821043561j)
        assert_tol_equal(special.kv(-0.5, 1+0j), 0.4610685044478945)
        assert_tol_equal(special.kv(-0.5, 1+1j), 0.06868578341999-0.38157825981268j)

        assert_tol_equal(special.jve(-0.5,1+0.3j), special.jv(-0.5, 1+0.3j)*exp(-0.3))
        assert_tol_equal(special.yve(-0.5,1+0.3j), special.yv(-0.5, 1+0.3j)*exp(-0.3))
        assert_tol_equal(special.ive(-0.5,0.3+1j), special.iv(-0.5, 0.3+1j)*exp(-0.3))
        assert_tol_equal(special.kve(-0.5,0.3+1j), special.kv(-0.5, 0.3+1j)*exp(0.3+1j))

        assert_tol_equal(special.hankel1(-0.5, 1+1j), special.jv(-0.5, 1+1j) + 1j*special.yv(-0.5,1+1j))
        assert_tol_equal(special.hankel2(-0.5, 1+1j), special.jv(-0.5, 1+1j) - 1j*special.yv(-0.5,1+1j)) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:45,代码来源:test_basic.py

示例10: test_ticket_853

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import hankel1 [as 别名]
def test_ticket_853(self):
        """Negative-order Bessels"""
        # cephes
        assert_allclose(special.jv(-1, 1), -0.4400505857449335)
        assert_allclose(special.jv(-2, 1), 0.1149034849319005)
        assert_allclose(special.yv(-1, 1), 0.7812128213002887)
        assert_allclose(special.yv(-2, 1), -1.650682606816255)
        assert_allclose(special.iv(-1, 1), 0.5651591039924851)
        assert_allclose(special.iv(-2, 1), 0.1357476697670383)
        assert_allclose(special.kv(-1, 1), 0.6019072301972347)
        assert_allclose(special.kv(-2, 1), 1.624838898635178)
        assert_allclose(special.jv(-0.5, 1), 0.43109886801837607952)
        assert_allclose(special.yv(-0.5, 1), 0.6713967071418031)
        assert_allclose(special.iv(-0.5, 1), 1.231200214592967)
        assert_allclose(special.kv(-0.5, 1), 0.4610685044478945)
        # amos
        assert_allclose(special.jv(-1, 1+0j), -0.4400505857449335)
        assert_allclose(special.jv(-2, 1+0j), 0.1149034849319005)
        assert_allclose(special.yv(-1, 1+0j), 0.7812128213002887)
        assert_allclose(special.yv(-2, 1+0j), -1.650682606816255)

        assert_allclose(special.iv(-1, 1+0j), 0.5651591039924851)
        assert_allclose(special.iv(-2, 1+0j), 0.1357476697670383)
        assert_allclose(special.kv(-1, 1+0j), 0.6019072301972347)
        assert_allclose(special.kv(-2, 1+0j), 1.624838898635178)

        assert_allclose(special.jv(-0.5, 1+0j), 0.43109886801837607952)
        assert_allclose(special.jv(-0.5, 1+1j), 0.2628946385649065-0.827050182040562j)
        assert_allclose(special.yv(-0.5, 1+0j), 0.6713967071418031)
        assert_allclose(special.yv(-0.5, 1+1j), 0.967901282890131+0.0602046062142816j)

        assert_allclose(special.iv(-0.5, 1+0j), 1.231200214592967)
        assert_allclose(special.iv(-0.5, 1+1j), 0.77070737376928+0.39891821043561j)
        assert_allclose(special.kv(-0.5, 1+0j), 0.4610685044478945)
        assert_allclose(special.kv(-0.5, 1+1j), 0.06868578341999-0.38157825981268j)

        assert_allclose(special.jve(-0.5,1+0.3j), special.jv(-0.5, 1+0.3j)*exp(-0.3))
        assert_allclose(special.yve(-0.5,1+0.3j), special.yv(-0.5, 1+0.3j)*exp(-0.3))
        assert_allclose(special.ive(-0.5,0.3+1j), special.iv(-0.5, 0.3+1j)*exp(-0.3))
        assert_allclose(special.kve(-0.5,0.3+1j), special.kv(-0.5, 0.3+1j)*exp(0.3+1j))

        assert_allclose(special.hankel1(-0.5, 1+1j), special.jv(-0.5, 1+1j) + 1j*special.yv(-0.5,1+1j))
        assert_allclose(special.hankel2(-0.5, 1+1j), special.jv(-0.5, 1+1j) - 1j*special.yv(-0.5,1+1j)) 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:45,代码来源:test_basic.py


注:本文中的scipy.special.hankel1方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。