Overall driver for Gauss-Jacobi quadrature. More...
Functions/Subroutines | |
subroutine | gauss_jacobi (npts, alpha, beta, x, wts, method) |
Compute the Gauss-Jacobi quadrature nodes and weights. More... | |
Overall driver for Gauss-Jacobi quadrature.
subroutine gaussjacobiquad::gauss_jacobi | ( | integer, intent(in) | npts, |
real(dp), intent(in) | alpha, | ||
real(dp), intent(in) | beta, | ||
real(dp), dimension(npts), intent(out) | x, | ||
real(dp), dimension(npts), intent(out) | wts, | ||
character(len=:), intent(in), allocatable | method | ||
) |
Compute the Gauss-Jacobi quadrature nodes and weights.
This subroutine calculates the Gauss-Jacobi quadrature nodes and weights for the given parameters \(\alpha\) and \(\beta\), using the specified method. Gauss-Jacobi quadrature is used to approximate integrals of the form: [ \int_{-1}^{1} (1 - x)^\alpha (1 + x)^\beta f(x) \,dx \approx \sum_{i=1}^{npts} wts_i f(x_i) ] where the weights and nodes are calculated with the Jacobi polynomial, which is defined as: [ P_n^{(\alpha, \beta)}(x) = \frac{(\alpha + 1)_n}{n!} \sum_{k=0}^n \binom{n}{k} \frac{(\beta + 1)_{n-k}}{(n-k)!} \left( \frac{x-1}{2} \right)^k \left( \frac{x+1}{2} \right)^{n-k} ]
[in] | npts | Number of quadrature points. |
[in] | alpha | Parameter alpha in the Jacobi polynomial. Must be greater than -1. |
[in] | beta | Parameter beta in the Jacobi polynomial. Must be greater than -1. |
[out] | x | Quadrature nodes. |
[out] | wts | Quadrature weights. |
[in] | method | Method used for calculation. Supported methods are "rec" and "gw". |
Definition at line 50 of file GaussJacobiQuad.f90.