本文整理匯總了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)