Computation of Gauss-Jacobi quadrature rule nodes and weights
|
The Gauss-Jacobi quadrature formula is used to numerically calculate the integral by using the formula 
Here α>-1, β>-1
With the help of a change in the variables (which changes both weights wi and nodes xi ), we can get onto the arbitrary interval [a, b], but we'll consider only the simplest case here. If you perform a change of variables, you should take into account that the formula of error term is changed along with the nodes and weights (you can get a new form by changing the variables in the formula).
The Gauss-Jacobi quadrature formula for each number of points and order α is completely defined by the set of nodes xi and weights wi . The algorithm finds these numbers.
Algorithm of nodes and weights calculation
The closed form of the nodes and weights is known only for some sets of α, β and n. Generally, we have to find them numerically. The integration nodes for the n points formula are found as a root of the Jacobi polynomial of order n. The root search is an iterative process. An initial approximation is selected for each root and then the roots are found by using the Newton method. Therefore, the bigger n was selected, the bigger order the Jacobi polynomial has, and more time is required to find a root with the desired accuracy.
The recurrence formula for Jacobi polynomials calculation has the following form:



The coefficients cj , dj , ej and fj have the following values:
cj = 2(j+ 1)(j+α+β+1)(2j+α+β)
dj = (2j+α+β+1)(α 2 - β 2)
ej = (2j+α+β)(2j+α+β+1)(2j+α+β+2)
fj = 2(j+α)(j+β)(2j+α+β+2)
After calculating xi (roots of the Jacobi polynomials of n-th order) weights wi are calculated by using the following formula:


Error term
The formula with n points is accurate for the polynomials of order 2n-1 and lower. Error term En is:
![E_n_ = div(Γ(n+α+1)Γ(n+β+1)Γ(n+α+β+1)power(2,2n+α+β+1)n!,(2n+α+β+1)power(Γ(2n+α+β+1),2)(2n)!)power(f,(2n))(ξ) ξ∈[-1,1]](/SMScripts/visualize.php?mode=normal&code=E_n_%20%3D%20%20div%28%26Gamma%3B%28n%2B%26alpha%3B%2B1%29%26Gamma%3B%28n%2B%26beta%3B%2B1%29%26Gamma%3B%28n%2B%26alpha%3B%2B%26beta%3B%2B1%29power%282%2C2n%2B%26alpha%3B%2B%26beta%3B%2B1%29n%21%2C%282n%2B%26alpha%3B%2B%26beta%3B%2B1%29power%28%26Gamma%3B%282n%2B%26alpha%3B%2B%26beta%3B%2B1%29%2C2%29%282n%29%21%29power%28f%2C%282n%29%29%28%26xi%3B%29%20%20%20%26xi%3B%26in%3B%5B-1%2C1%5D)
Subroutine description
The algorithm gets as the input
- n - required number of nodes.
- alpha - power of the first factor of the weighting function. alpha > -1.
- beta - power of the second factor of the weighting function. beta > -1.
The algorithm returns:
- x - array of nodes. Its index ranges within 0 and n-1.
- w - array of weighting coefficients. Its index ranges between 0 and n-1.
The source code was designed by using information from the QUADRULE library.
Links- Eric W. Weisstein. "Jacobi-Gauss Quadrature." From MathWorld--A Wolfram Web Resource
Report a bug
C#
C# 1.0 source.
gqgenjacobi.csharp.zip - Computation of Gauss-Jacobi quadrature rule nodes and weights
C++
C++ source.
gqgenjacobi.cpp.zip - Computation of Gauss-Jacobi quadrature rule nodes and weights
ablas.zip - optimized basic linear algebra subroutines with SSE2 support (for C++ sources only)
C++, multiple precision arithmetic
C++ source. MPFR/GMP is used.
GMP source is available from gmplib.org. MPFR source is available from www.mpfr.org.
gqgenjacobi.mpfr.zip - Computation of Gauss-Jacobi quadrature rule nodes and weights
mpfr.zip - precompiled Win32 MPFR/GMP binaries
Delphi
Delphi source.
Can be compiled under FPC (in Delphi compatibility mode).
gqgenjacobi.delphi.zip - Computation of Gauss-Jacobi quadrature rule nodes and weights
Visual Basic 6
Visual Basic 6 source.
gqgenjacobi.vb6.zip - Computation of Gauss-Jacobi quadrature rule nodes and weights
Zonnon beta
Zonnon source.
Zonnon is an experimental language developed at ETH Zurich.
See www.zonnon.ethz.ch for more information.
gqgenjacobi.zonnon.zip - Computation of Gauss-Jacobi quadrature rule nodes and weights
|