Английская Википедия:Gauss–Legendre quadrature
Шаблон:Short description In numerical analysis, Gauss–Legendre quadrature is a form of Gaussian quadrature for approximating the definite integral of a function. For integrating over the interval Шаблон:Math, the rule takes the form:
- <math>\int_{-1}^1 f(x)\,dx \approx \sum_{i=1}^n w_i f(x_i)</math>
where
- n is the number of sample points used,
- wi are quadrature weights, and
- xi are the roots of the nth Legendre polynomial.
This choice of quadrature weights wi and quadrature nodes xi is the unique choice that allows the quadrature rule to integrate degree Шаблон:Math polynomials exactly.
Many algorithms have been developed for computing Gauss–Legendre quadrature rules. The Golub–Welsch algorithm presented in 1969 reduces the computation of the nodes and weights to an eigenvalue problem which is solved by the QR algorithm.[1] This algorithm was popular, but significantly more efficient algorithms exist. Algorithms based on the Newton–Raphson method are able to compute quadrature rules for significantly larger problem sizes. In 2014, Ignace Bogaert presented explicit asymptotic formulas for the Gauss–Legendre quadrature weights and nodes, which are accurate to within double-precision machine epsilon for any choice of n ≥ 21.[2] This allows for computation of nodes and weights for values of n exceeding one billion.[3]
History
Carl Friedrich Gauss was the first to derive the Gauss–Legendre quadrature rule, doing so by a calculation with continued fractions in 1814.[4] He calculated the nodes and weights to 16 digits up to order n=7 by hand. Carl Gustav Jacob Jacobi discovered the connection between the quadrature rule and the orthogonal family of Legendre polynomials. As there is no closed-form formula for the quadrature weights and nodes, for many decades people were only able to hand-compute them for small n, and computing the quadrature had to be done by referencing tables containing the weight and node values. By 1942 these values were only known for up to n=16.
Definition
For integrating f over <math>[-1,1]</math> with Gauss–Legendre quadrature, the associated orthogonal polynomials are Legendre polynomials, denoted by Шаблон:Math. With the Шаблон:Mvar-th polynomial normalized so that Шаблон:Math, the Шаблон:Mvar-th Gauss node, Шаблон:Mvar, is the Шаблон:Mvar-th root of Шаблон:Mvar and the weights are given by the formula[5]
- <math> w_i = \frac{2}{\left( 1 - x_i^2 \right) \left[P'_n(x_i)\right]^2}.</math>
Some low-order quadrature rules are tabulated below for integrating over <math>[-1,1] </math>.
Number of points, n | Points, Шаблон:Mvar | Weights, Шаблон:Mvar | ||
---|---|---|---|---|
1 | 0 | 2 | ||
2 | <math>\pm\frac{1}{\sqrt{3}}</math> | ±0.57735… | 1 | |
3 | 0 | <math>\frac{8}{9}</math> | 0.888889… | |
<math>\pm\sqrt{\frac{3}{5}}</math> | ±0.774597… | <math>\frac{5}{9}</math> | 0.555556… | |
4 | <math>\pm\sqrt{\frac{3}{7} - \frac{2}{7}\sqrt{\frac{6}{5}}}</math> | ±0.339981… | <math>\frac{18 + \sqrt{30}}{36}</math> | 0.652145… |
<math>\pm\sqrt{\frac{3}{7} + \frac{2}{7}\sqrt{\frac{6}{5}}}</math> | ±0.861136… | <math>\frac{18 - \sqrt{30}}{36}</math> | 0.347855… | |
5 | 0 | <math>\frac{128}{225}</math> | 0.568889… | |
<math>\pm\frac{1}{3}\sqrt{5 - 2\sqrt{\frac{10}{7}}}</math> | ±0.538469… | <math>\frac{322 + 13\sqrt{70}}{900}</math> | 0.478629… | |
<math>\pm\frac{1}{3}\sqrt{5 + 2\sqrt{\frac{10}{7}}}</math> | ±0.90618… | <math>\frac{322 - 13\sqrt{70}}{900}</math> | 0.236927… |
For integrating over a general real interval <math>[a,b] </math>, a change of interval can be applied to convert the problem to one of integrating over <math>[-1,1]</math>.
Algorithms
Newton–Raphson methods
Several researchers have developed algorithms for computing Gauss–Legendre quadrature nodes and weights based on the Newton–Raphson method for finding roots of functions. Various optimizations for this specific problem are used. For instance, some methods compute <math> \theta_i = \arccos x_i </math> to avoid issues associated with clustering of the roots <math> x_i </math> near the ends of the interval <math> -1 </math> and <math> 1 </math>.[6][7] Some methods utilize formulas to approximate the weights and then use a few iterations of Newton-Raphson to lower the error of the approximation to below machine precision.[8][6]
Golub–Welsch
In 1969, Golub and Welsch published their method for computing Gaussian quadrature rules given the three term recurrence relation that the underlying orthogonal polynomials satisfy.[1] They reduce the problem of computing the nodes of a Gaussian quadrature rule to the problem of finding the eigenvalues of a particular symmetric tridiagonal matrix. The QR algorithm is used to find the eigenvalues of this matrix. By taking advantage of the symmetric tridiagonal structure, the eigenvalues can be computed in <math> \mathcal O(n^2) </math> time, as opposed to the <math> \mathcal O(n^3) </math> time expected for a generic eigenvalue problem.
Asymptotic formulas
Various methods have been developed that use approximate closed-form expressions to compute the nodes. As mentioned above, in some methods formulas are used as approximations to the nodes, after which some Newton-Raphson iterations are performed to refine the approximation. In a 2014 paper, Ignace Bogaert derives asymptotic formulas for the nodes that are exact up to machine precision for <math> n \geq 21 </math> and for the weights that are exact up to machine precision for <math> n \geq 30 </math>.[2] This method does not require any Newton-Raphson iterations or evaluations of Bessel functions as other methods do. As shown in the paper, the method was able to compute the nodes at a problem size of one billion in 11 seconds. Since the nodes near the endpoints of <math>[-1,1] </math> become very close to each other at this problem size, this method of computing the nodes is sufficient for essentially any practical application in double-precision floating point.
Higher precision
Johansson and Mezzarobba[9] describe a strategy to compute Gauss–Legendre quadrature rules in arbitrary-precision arithmetic, allowing both small and large <math>n</math>. A rule of order <math>n = 1000</math> with 1000 digits of precision can be calculated in around one second. Their method uses Newton–Raphson iteration together with several different techniques for evaluating Legendre polynomials. The algorithm also provides a certified error bound.
Gil, Segura and Temme[10] describe iterative methods with fourth order convergence for the computation of Gauss–Jacobi quadratures (and, in particular, Gauss–Legendre). The methods do not require a priori estimations of the nodes to guarantee its fourth-order convergence. Computations of quadrature rules with even millions of nodes and thousands of digits become possible in a typical laptop.
Comparison with other quadrature rules
Gauss–Legendre quadrature is optimal in a very narrow sense for computing integrals of a function f over Шаблон:Math, since no other quadrature rule integrates all degree Шаблон:Math polynomials exactly when using n sample points. However, this measure of accuracy is not generally a very useful one---polynomials are very simple to integrate and this argument does not by itself guarantee better accuracy on integrating other functions.
Clenshaw–Curtis quadrature is based on approximating f by a polynomial interpolant at Chebyshev nodes and integrates polynomials of degree up to n exactly when given n samples. Even though it does not integrate polynomials or other functions that are analytic in a large neighborhood of Шаблон:Math as well as Gauss–Legendre quadrature, Clenshaw–Curtis converges at approximately the same rate as Gauss–Legendre quadrature for most (non-analytic) integrands.[11] Also, Clenshaw–Curtis shares the properties that Gauss–Legendre quadrature enjoys of convergence for all continuous integrands f and robustness to numerical rounding errors.[12] Clenshaw–Curtis is straightforward to implement in <math>\mathcal{O}(n \log n)</math> time by FFT-based methods.
Newton–Cotes quadrature is based on approximating f by a polynomial interpolant at equally-spaced points in Шаблон:Math, and like Clenshaw–Curtis also integrates polynomials of degree up to n exactly when given n samples. However, it suffers from Runge's phenomenon as n increases; Newton–Cotes does not converge for some continuous integrands f, and when it does converge it may suffer from numerical rounding errors.[12] Thus, both Clenshaw–Curtis and Gauss–Legendre enjoy substantial benefits over Newton–Cotes for moderate to large n.
References
Sources
- ↑ 1,0 1,1 Ошибка цитирования Неверный тег
<ref>
; для сносокGolub69
не указан текст - ↑ 2,0 2,1 Ошибка цитирования Неверный тег
<ref>
; для сносокBogaert14
не указан текст - ↑ Ошибка цитирования Неверный тег
<ref>
; для сносокTownsend15
не указан текст - ↑ Ошибка цитирования Неверный тег
<ref>
; для сносокGauss14
не указан текст - ↑ Шаблон:Harv
- ↑ 6,0 6,1 Ошибка цитирования Неверный тег
<ref>
; для сносокHale13
не указан текст - ↑ Ошибка цитирования Неверный тег
<ref>
; для сносокSwartztrauber03
не указан текст - ↑ Ошибка цитирования Неверный тег
<ref>
; для сносокBogaert12
не указан текст - ↑ Ошибка цитирования Неверный тег
<ref>
; для сносокJohansson18
не указан текст - ↑ Ошибка цитирования Неверный тег
<ref>
; для сносокGil19
не указан текст - ↑ Ошибка цитирования Неверный тег
<ref>
; для сносокTrefethen12
не указан текст - ↑ 12,0 12,1 Ошибка цитирования Неверный тег
<ref>
; для сносокTrefethen08
не указан текст