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


Python special.ellipj方法代码示例

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


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

示例1: test_cospi_zeros

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import ellipj [as 别名]
def test_cospi_zeros():
    eps = np.finfo(float).eps
    dx = np.r_[-np.logspace(0, -13, 3), 0, np.logspace(-13, 0, 3)]
    dy = dx.copy()
    dx, dy = np.meshgrid(dx, dy)
    dz = dx + 1j*dy
    zeros = (np.arange(-100, 100, 1) + 0.5).reshape(1, 1, -1)
    z = (zeros + np.dstack((dz,)*zeros.size)).flatten()
    dataset = []
    for z0 in z:
        dataset.append((z0, complex(mpmath.cospi(z0))))

    dataset = np.array(dataset)
    FuncData(_cospi, dataset, 0, 1, rtol=2*eps).check()


# ------------------------------------------------------------------------------
# ellipj
# ------------------------------------------------------------------------------ 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:21,代码来源:test_mpmath.py

示例2: _vratio

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import ellipj [as 别名]
def _vratio(u, ineps, mp):
    [s, c, d, phi] = special.ellipj(u, mp)
    ret = abs(ineps - s / c)
    return ret 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:6,代码来源:filter_design.py

示例3: test_ellipj

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

示例4: test_ellipj_nan

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import ellipj [as 别名]
def test_ellipj_nan(self):
        """Regression test for #912."""
        special.ellipj(0.5, np.nan) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:5,代码来源:test_basic.py

示例5: test_ellipfun_sn

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import ellipj [as 别名]
def test_ellipfun_sn(self):
        # Oscillating function --- limit range of first argument; the
        # loss of precision there is an expected numerical feature
        # rather than an actual bug
        assert_mpmath_equal(lambda u, m: sc.ellipj(u, m)[0],
                            lambda u, m: mpmath.ellipfun("sn", u=u, m=m),
                            [Arg(-1e6, 1e6), Arg(a=0, b=1)],
                            atol=1e-20) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:10,代码来源:test_mpmath.py

示例6: test_ellipfun_dn

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import ellipj [as 别名]
def test_ellipfun_dn(self):
        # see comment in ellipfun_sn
        assert_mpmath_equal(lambda u, m: sc.ellipj(u, m)[2],
                            lambda u, m: mpmath.ellipfun("dn", u=u, m=m),
                            [Arg(-1e6, 1e6), Arg(a=0, b=1)],
                            atol=1e-20) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:8,代码来源:test_mpmath.py

示例7: test_ellipfun_sn

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import ellipj [as 别名]
def test_ellipfun_sn(self):
        def sn(u, m):
            # mpmath doesn't get the zero at u = 0--fix that
            if u == 0:
                return 0
            else:
                return mpmath.ellipfun("sn", u=u, m=m)

        # Oscillating function --- limit range of first argument; the
        # loss of precision there is an expected numerical feature
        # rather than an actual bug
        assert_mpmath_equal(lambda u, m: sc.ellipj(u, m)[0],
                            sn,
                            [Arg(-1e6, 1e6), Arg(a=0, b=1)],
                            rtol=1e-8) 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:17,代码来源:test_mpmath.py

示例8: test_ellipfun_cn

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import ellipj [as 别名]
def test_ellipfun_cn(self):
        # see comment in ellipfun_sn
        assert_mpmath_equal(lambda u, m: sc.ellipj(u, m)[1],
                            lambda u, m: mpmath.ellipfun("cn", u=u, m=m),
                            [Arg(-1e6, 1e6), Arg(a=0, b=1)],
                            rtol=1e-8) 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:8,代码来源:test_mpmath.py

示例9: test_ellipfun_dn

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import ellipj [as 别名]
def test_ellipfun_dn(self):
        # see comment in ellipfun_sn
        assert_mpmath_equal(lambda u, m: sc.ellipj(u, m)[2],
                            lambda u, m: mpmath.ellipfun("dn", u=u, m=m),
                            [Arg(-1e6, 1e6), Arg(a=0, b=1)],
                            rtol=1e-8) 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:8,代码来源:test_mpmath.py


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