Ejemplo n.º 1
0
def riccati_jn(n,x):
    """Compute the Ricatti-Bessel function of the first kind and its
    derivative for all orders up to and including n.
    """
    if not (isscalar(n) and isscalar(x)):
        raise ValueError("arguments must be scalars.")
    if (n!= floor(n)) or (n<0):
        raise ValueError("n must be a non-negative integer.")
    if (n == 0): n1 = 1
    else: n1 = n
    nm,jn,jnp = specfun.rctj(n1,x)
    return jn[:(n+1)],jnp[:(n+1)]
Ejemplo n.º 2
0
Archivo: basic.py Proyecto: minrk/scipy
def riccati_jn(n, x):
    """Compute the Ricatti-Bessel function of the first kind and its
    derivative for all orders up to and including n.
    """
    if not (isscalar(n) and isscalar(x)):
        raise ValueError, "arguments must be scalars."
    if (n != floor(n)) or (n < 0):
        raise ValueError, "n must be a non-negative integer."
    if (n == 0): n1 = 1
    else: n1 = n
    nm, jn, jnp = specfun.rctj(n1, x)
    return jn[:(n + 1)], jnp[:(n + 1)]