Gauss-Legendre Nodes (gauss_legendre_nodes)¶
- class pypint.integrators.node_providers.gauss_legendre_nodes.GaussLegendreNodes[source]¶
Bases: pypint.integrators.node_providers.i_nodes.INodes
Provider for Gauss-Legendre integration nodes with variable count.
- _compute_nodes()[source]¶
Computats nodes for the Gauss-Legendre quadrature of order \(n>1\) on \([-1,+1]\).
(ported from MATLAB code, reference see below, original commend from MATLAB code:)
Unlike many publicly available functions, this function is valid for \(n>=46\). This is due to the fact that it does not rely on MATLAB’s build-in ‘root’ routines to determine the roots of the Legendre polynomial, but finds the roots by looking for the eigenvalues of an alternative version of the companion matrix of the n’th degree Legendre polynomial. The companion matrix is constructed as a symmetrical matrix, guaranteeing that all the eigenvalues (roots) will be real. On the contrary, MATLAB’s ‘roots’ function uses a general form for the companion matrix, which becomes unstable at higher orders \(n\), leading to complex roots.
—original MATLAB function by: Geert Van Damme <geert@vandamme-iliano.be> (February 21, 2010)
- init(n_nodes, interval=None)[source]¶
Initializes and computes Gauss-Legendre nodes.
Parameters: n_nodes (int) – The number of desired Gauss-Legendre nodes See also
INodes.init() : overridden method
- num_nodes[source]¶
Accessor of number of Gauss-Legendre nodes.
Raises: ValueError – if n_nodes is smaller than 2 (only Setter). See also
INodes.num_nodes : overridden method
- std_interval = array([-1., 1.])¶
Standard integration interval