archimedes.quadrature.gauss_lobattoΒΆ

archimedes.quadrature.gauss_lobatto(
n: int,
a: float | None = None,
b: float | None = None,
) → QuadratureRuleΒΆ

Gauss-Lobatto quadrature rule including both endpoints.

Lobatto rules fix both endpoints \(\pm 1\) as nodes and choose the remaining \(n - 2\) interior nodes to maximize the polynomial degree of exactness – the roots of the Jacobi polynomial \(P_{n-2}^{(1,1)}(x)\), equivalently the roots of \(P_{n-1}' (x)\), the derivative of the degree-\((n-1)\) Legendre polynomial. The rule is exact for polynomials up to degree \(2n - 3\).

Parameters:
  • n (int) – Number of quadrature nodes, including both endpoints.

  • a (float, optional) – Bounds of the target interval, forwarded to map_to(). Must both be given, or neither (the default, giving the reference interval \([-1, 1]\)).

  • b (float, optional) – Bounds of the target interval, forwarded to map_to(). Must both be given, or neither (the default, giving the reference interval \([-1, 1]\)).

Returns:

rule – Gauss-Lobatto rule with n nodes on \([-1, 1]\), exact to degree \(2n - 3\), mapped onto \([a, b]\) if given.

Return type:

QuadratureRule

Raises:

ValueError – If n < 2.