本文整理汇总了Python中scipy.special.jv方法的典型用法代码示例。如果您正苦于以下问题:Python special.jv方法的具体用法?Python special.jv怎么用?Python special.jv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scipy.special
的用法示例。
在下文中一共展示了special.jv方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: computeRadiationAnalytical
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import jv [as 别名]
def computeRadiationAnalytical(self,z0, theta, phi, dwRel = 0.1, npoints=100):
w1 = 1.0 / ( (1.0 + self.K*self.K/2.0 + self.gamma*self.gamma*theta) / (2*self.kw*speed_of_light*self.gamma**2) ) # first harmonic
dw = w1 * dwRel
step_w = dw / npoints
w = np.arange(w1-dw, w1+dw, step_w)
phis = theta * theta * w * z0 / (2.0 * speed_of_light)
delta_w = w - w1
u = w * self.K*self.K / (8*self.kw*speed_of_light*self.gamma*self.gamma)
ajj = sf.jv(0,u) - sf.jv(1,u)
I = self.Nw * self.lw * self.K * w * np.exp(1j * phis) / ( z0 * self.gamma) * np.sinc(pi*self.Nw*(w-w1)/w1) * ajj
I = np.real(I)
self.fundamentalWavelength = self.lw / (2*self.gamma**2) * (1+ self.K**2 / 2.0 + self.gamma**2 * theta)
print( 'test', h_eV_s*speed_of_light / self.fundamentalWavelength)
return w1, w, I
示例2: kaiser_bessel_ft
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import jv [as 别名]
def kaiser_bessel_ft(om, npts, alpha, order, d):
"""Computes FT of KB function for scaling in image domain.
Args:
om (ndarray): An array of coordinates to interpolate to.
npts (int): Number of points to use for interpolation in each
dimension.
order (ind, default=0): Order of Kaiser-Bessel kernel.
alpha (double or array of doubles): KB parameter.
Returns:
ndarray: The scaling coefficients.
"""
z = np.sqrt((2 * np.pi * (npts / 2) * om)**2 - alpha**2 + 0j)
nu = d / 2 + order
scaling_coef = (2 * np.pi)**(d / 2) * ((npts / 2)**d) * (alpha**order) / \
special.iv(order, alpha) * special.jv(nu, z) / (z**nu)
scaling_coef = np.real(scaling_coef)
return scaling_coef
示例3: test_ticket_854
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import jv [as 别名]
def test_ticket_854(self):
"""Real-valued Bessel domains"""
assert_(isnan(special.jv(0.5, -1)))
assert_(isnan(special.iv(0.5, -1)))
assert_(isnan(special.yv(0.5, -1)))
assert_(isnan(special.yv(1, -1)))
assert_(isnan(special.kv(0.5, -1)))
assert_(isnan(special.kv(1, -1)))
assert_(isnan(special.jve(0.5, -1)))
assert_(isnan(special.ive(0.5, -1)))
assert_(isnan(special.yve(0.5, -1)))
assert_(isnan(special.yve(1, -1)))
assert_(isnan(special.kve(0.5, -1)))
assert_(isnan(special.kve(1, -1)))
assert_(isnan(special.airye(-1)[0:2]).all(), special.airye(-1))
assert_(not isnan(special.airye(-1)[2:4]).any(), special.airye(-1))
示例4: eigenvalue_equation
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import jv [as 别名]
def eigenvalue_equation(u, m, V):
'''Evaluates the eigenvalue equation for a circular step-index fiber.
Parameters
----------
u : scalar
The normalized propagation constant.
m : int
The azimuthal order
V : scalar
The normalized frequency parameter of the fiber.
Returns
-------
scalar
The eigenvalue equation value
'''
w = np.sqrt(V**2 - u**2)
return jv(m, u) / (u * jv(m + 1, u)) - kn(m, w) / (w * kn(m + 1, w))
示例5: besselj
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import jv [as 别名]
def besselj(n, z):
"""Bessel function of first kind of order n at kr.
Wraps scipy.special.jn(n, z).
Parameters
----------
n : array_like
Order
z: array_like
Argument
Returns
-------
J : array_like
Values of Bessel function of order n at position z
"""
return scy.jv(n, _np.complex_(z))
示例6: Jn
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import jv [as 别名]
def Jn(r, n):
return np.sqrt(np.pi / (2 * r)) * sp.jv(n + 0.5, r)
示例7: test_jv
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import jv [as 别名]
def test_jv(self):
assert_equal(cephes.jv(0,0),1.0)
示例8: test_hankel1
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import jv [as 别名]
def test_hankel1(self):
hank1 = special.hankel1(1,.1)
hankrl = (special.jv(1,.1) + special.yv(1,.1)*1j)
assert_almost_equal(hank1,hankrl,8)
示例9: test_hankel2
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import jv [as 别名]
def test_hankel2(self):
hank2 = special.hankel2(1,.1)
hankrl2 = (special.jv(1,.1) - special.yv(1,.1)*1j)
assert_almost_equal(hank2,hankrl2,8)
示例10: test_negv_jv
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import jv [as 别名]
def test_negv_jv(self):
assert_almost_equal(special.jv(-3,2), -special.jv(3,2), 14)
示例11: test_jvp
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import jv [as 别名]
def test_jvp(self):
jvprim = special.jvp(2,2)
jv0 = (special.jv(1,2)-special.jv(3,2))/2
assert_almost_equal(jvprim,jv0,10)
示例12: test_jv_cephes_vs_amos
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import jv [as 别名]
def test_jv_cephes_vs_amos(self):
self.check_cephes_vs_amos(special.jv, special.jn, rtol=1e-10, atol=1e-305)
示例13: test_ticket_623
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import jv [as 别名]
def test_ticket_623(self):
assert_tol_equal(special.jv(3, 4), 0.43017147387562193)
assert_tol_equal(special.jv(301, 1300), 0.0183487151115275)
assert_tol_equal(special.jv(301, 1296.0682), -0.0224174325312048)
示例14: test_besselj
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import jv [as 别名]
def test_besselj(self):
assert_mpmath_equal(sc.jv,
_exception_to_nan(lambda v, z: mpmath.besselj(v, z, **HYPERKW)),
[Arg(-1e100, 1e100), Arg(-1e3, 1e3)],
ignore_inf_sign=True)
# loss of precision at large arguments due to oscillation
assert_mpmath_equal(sc.jv,
_exception_to_nan(lambda v, z: mpmath.besselj(v, z, **HYPERKW)),
[Arg(-1e100, 1e100), Arg(-1e8, 1e8)],
ignore_inf_sign=True,
rtol=1e-5)
示例15: test_besselj_complex
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import jv [as 别名]
def test_besselj_complex(self):
assert_mpmath_equal(lambda v, z: sc.jv(v.real, z),
_exception_to_nan(lambda v, z: mpmath.besselj(v, z, **HYPERKW)),
[Arg(), ComplexArg()])