seemps.analysis.expansion.LegendreExpansion#

class seemps.analysis.expansion.LegendreExpansion#

Bases: OrthogonalExpansion

Expansion in the Legendre basis. The polynomials are orthogonal on [−1, 1] with uniform weight.

Recurrence:

(k+1) Pₖ₊₁(x) = (2k+1) x Pₖ(x) − k Pₖ₋₁(x).

get_recurrence(k: int) tuple[float, float, float][source]#

Legendre recurrence: (k+1) P_{k+1}(x) = (2k+1) x P_k(x) - k P_{k-1}(x)

property p1_factor: float#

Return the scalar κ such that the first-degree basis polynomial satisfies P_1(x) = κ·x. Used to correctly seed the three-term recurrence relation.

classmethod project(func: Callable[[ndarray[tuple[Any, ...], dtype[_ScalarT]]], float], start: float = -1.0, stop: float = 1.0, order: int | None = None) LegendreExpansion[source]#

Project func defined on (start, stop) onto the orthogonal polynomial basis up to the given order.