本文整理汇总了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
# ------------------------------------------------------------------------------
示例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
示例3: test_ellipj
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import ellipj [as 别名]
def test_ellipj(self):
cephes.ellipj(0,1)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)