JacobiZeros
Zeros of Jacobi polynomials.
INTERFACE
MODULE FUNCTION JacobiZeros(n, alpha, beta) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: n
!! order of jacobi polynomial
REAL(DFP), INTENT(IN) :: alpha
REAL(DFP), INTENT(IN) :: beta
REAL(DFP) :: ans(n)
END FUNCTION JacobiZeros
END INTERFACE
Examples
- ️܀ See example
- ↢
This example shows the usage of JacobiZeros
method which is defined in [[JacobiPolynomialUtility]] MODULE. This routine returns the zeros of a jacobi polynomial.
program main
use easifembase
implicit none
integer( i4b ) :: n
real( dfp ), allocatable :: pt( : )
real( dfp ), parameter :: alpha=0.0_DFP, beta=0.0_DFP
type(string) :: msg, astr
n = 1; call callme
See results
x |
---|
0 |
n = 2; call callme
results
Zeros of J(x), n = 2 alpha=0 beta=0
| -0.57735 | 0.57735 |
n = 3; call callme
See results
Zeros of J(x), n = 3 alpha=0 beta=0
| -0.7746 | 3.71231E-16 | 0.7746 |
contains
subroutine callme
pt = JacobiZeros( n=n, alpha=alpha, beta=beta )
msg = "Zeros of J(x), n = " &
& // tostring( n ) // " alpha="//tostring( alpha ) // &
& " beta="//tostring( beta )
call display(msg%chars())
astr = MdEncode( pt )
call display( astr%chars(), "" )
end subroutine
end program main