Gaussleg.m

From Spinach Documentation Wiki
Revision as of 19:57, 29 June 2021 by Kuprov (talk | contribs) (→‎See also)
Jump to: navigation, search

Computes Gauss-Legendre points and weights.

Syntax

    [x,w]=gaussleg(a,b,n)

Description

The function calculates Gauss-Legendre points and weights in [a,b] interval with accuracy order n. If all existing numerical integration methods, Gauss-Legendre quadrature is one of the most efficient and accurate.

Arguments

   a - left edge of the interval

   b - right edge of the interval

   n - accuracy order, the number of points in the 
       resulting grid will be n+1.

Returns

   x - Gauss-Legendre points

   w - Gauss-Legendre weights

Examples

Gauss-Legendre quadrature is used in Gd(III) EPR and DEER examples to integrate over the distribution in the zero field splitting parameters.

Notes

Gauss-Legendre quadratures of order exceeding 50 are numerically unstable, subdivide your interval instead of increasing the accuracy order.

See also

Integration grids, Appendix I: powder grids


Version 2.6, authors: Ilya Kuprov