Vous êtes un professionnel et vous avez besoin d'une formation ?
Calcul scientifique
avec Python
Voir le programme détaillé
Module « scipy.special »
Signature de la fonction yve
def yve(*args, **kwargs)
Description
help(scipy.special.yve)
yve(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])
yve(v, z, out=None)
Exponentially scaled Bessel function of the second kind of real order.
Returns the exponentially scaled Bessel function of the second
kind of real order `v` at complex `z`::
yve(v, z) = yv(v, z) * exp(-abs(z.imag))
Parameters
----------
v : array_like
Order (float).
z : array_like
Argument (float or complex).
out : ndarray, optional
Optional output array for the function results
Returns
-------
Y : scalar or ndarray
Value of the exponentially scaled Bessel function.
See Also
--------
yv: Unscaled Bessel function of the second kind of real order.
Notes
-----
For positive `v` values, the computation is carried out using the
AMOS [1]_ `zbesy` routine, which exploits the connection to the Hankel
Bessel functions :math:`H_v^{(1)}` and :math:`H_v^{(2)}`,
.. math:: Y_v(z) = \frac{1}{2\imath} (H_v^{(1)} - H_v^{(2)}).
For negative `v` values the formula,
.. math:: Y_{-v}(z) = Y_v(z) \cos(\pi v) + J_v(z) \sin(\pi v)
is used, where :math:`J_v(z)` is the Bessel function of the first kind,
computed using the AMOS routine `zbesj`. Note that the second term is
exactly zero for integer `v`; to improve accuracy the second term is
explicitly omitted for `v` values such that `v = floor(v)`.
Exponentially scaled Bessel functions are useful for large `z`:
for these, the unscaled Bessel functions can easily under-or overflow.
References
----------
.. [1] Donald E. Amos, "AMOS, A Portable Package for Bessel Functions
of a Complex Argument and Nonnegative Order",
http://netlib.org/amos/
Examples
--------
Compare the output of `yv` and `yve` for large complex arguments for `z`
by computing their values for order ``v=1`` at ``z=1000j``. We see that
`yv` returns nan but `yve` returns a finite number:
>>> import numpy as np
>>> from scipy.special import yv, yve
>>> v = 1
>>> z = 1000j
>>> yv(v, z), yve(v, z)
((nan+nanj), (-0.012610930256928629+7.721967686709076e-19j))
For real arguments for `z`, `yve` returns the same as `yv` up to
floating point errors.
>>> v, z = 1, 1000
>>> yv(v, z), yve(v, z)
(-0.02478433129235178, -0.02478433129235179)
The function can be evaluated for several orders at the same time by
providing a list or NumPy array for `v`:
>>> yve([1, 2, 3], 1j)
array([-0.20791042+0.14096627j, 0.38053618-0.04993878j,
0.00815531-1.66311097j])
In the same way, the function can be evaluated at several points in one
call by providing a list or NumPy array for `z`:
>>> yve(1, np.array([1j, 2j, 3j]))
array([-0.20791042+0.14096627j, -0.21526929+0.01205044j,
-0.19682671+0.00127278j])
It is also possible to evaluate several orders at several points
at the same time by providing arrays for `v` and `z` with
broadcasting compatible shapes. Compute `yve` for two different orders
`v` and three points `z` resulting in a 2x3 array.
>>> v = np.array([[1], [2]])
>>> z = np.array([3j, 4j, 5j])
>>> v.shape, z.shape
((2, 1), (3,))
>>> yve(v, z)
array([[-1.96826713e-01+1.27277544e-03j, -1.78750840e-01+1.45558819e-04j,
-1.63972267e-01+1.73494110e-05j],
[1.94960056e-03-1.11782545e-01j, 2.02902325e-04-1.17626501e-01j,
2.27727687e-05-1.17951906e-01j]])
Vous êtes un professionnel et vous avez besoin d'une formation ?
Sensibilisation àl'Intelligence Artificielle
Voir le programme détaillé
Améliorations / Corrections
Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.
Emplacement :
Description des améliorations :