bessel_jn_derivative Function

private function bessel_jn_derivative(n, x) result(der)

Compute derivative for Bessel function of first kind of order n.

Arguments

Type IntentOptional Attributes Name
integer :: n

The order of the function.

real(kind=rk), intent(in) :: x

The evaluation point.

Return Value real(kind=rk)

The function value.


Source Code

  function bessel_jn_derivative(n,x) result(der)
    ! --------------------------------------------------------------------------
    !> The order of the function.
    integer :: n
    !> The evaluation point.
    real(kind=rk), intent(in) :: x
    !> The function value.
    real(kind=rk) :: der
    ! --------------------------------------------------------------------------
    ! --------------------------------------------------------------------------

    ! Calculate the derivative by recursive relation
    der = 0.5_rk*(bessel_jn(n-1,x)-bessel_jn(n+1,x))

  end function bessel_jn_derivative