Vous êtes un professionnel et vous avez besoin d'une formation ?
Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé
Module « scipy.special »
Signature de la fonction yv
def yv(*args, **kwargs)
Description
help(scipy.special.yv)
yv(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])
yv(v, z, out=None)
Bessel function of the second kind of real order and complex argument.
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 Bessel function of the second kind, :math:`Y_v(x)`.
See Also
--------
yve : :math:`Y_v` with leading exponential behavior stripped off.
y0: faster implementation of this function for order 0
y1: faster implementation of this function for order 1
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)`.
References
----------
.. [1] Donald E. Amos, "AMOS, A Portable Package for Bessel Functions
of a Complex Argument and Nonnegative Order",
http://netlib.org/amos/
Examples
--------
Evaluate the function of order 0 at one point.
>>> from scipy.special import yv
>>> yv(0, 1.)
0.088256964215677
Evaluate the function at one point for different orders.
>>> yv(0, 1.), yv(1, 1.), yv(1.5, 1.)
(0.088256964215677, -0.7812128213002889, -1.102495575160179)
The evaluation for different orders can be carried out in one call by
providing a list or NumPy array as argument for the `v` parameter:
>>> yv([0, 1, 1.5], 1.)
array([ 0.08825696, -0.78121282, -1.10249558])
Evaluate the function at several points for order 0 by providing an
array for `z`.
>>> import numpy as np
>>> points = np.array([0.5, 3., 8.])
>>> yv(0, points)
array([-0.44451873, 0.37685001, 0.22352149])
If `z` is an array, the order parameter `v` must be broadcastable to
the correct shape if different orders shall be computed in one call.
To calculate the orders 0 and 1 for an 1D array:
>>> orders = np.array([[0], [1]])
>>> orders.shape
(2, 1)
>>> yv(orders, points)
array([[-0.44451873, 0.37685001, 0.22352149],
[-1.47147239, 0.32467442, -0.15806046]])
Plot the functions of order 0 to 3 from 0 to 10.
>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots()
>>> x = np.linspace(0., 10., 1000)
>>> for i in range(4):
... ax.plot(x, yv(i, x), label=f'$Y_{i!r}$')
>>> ax.set_ylim(-3, 1)
>>> ax.legend()
>>> plt.show()
Vous êtes un professionnel et vous avez besoin d'une formation ?
Coder avec une
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 :