prysm.jacobi

High performance / recursive jacobi polynomial calculation.

prysm.jacobi.weight(alpha, beta, x)

The weight function of the jacobi polynomials for a given alpha, beta value.

prysm.jacobi.a(n, alpha, beta, x)

The leading term of the recurrence relation from Wikipedia, * P_n^(a,b).

prysm.jacobi.b(n, alpha, beta, x)

The second term of the recurrence relation from Wikipedia, * P_n-1^(a,b).

prysm.jacobi.c(n, alpha, beta, x)

The third term of the recurrence relation from Wikipedia, * P_n-2^(a,b).

prysm.jacobi.jacobi(n, alpha, beta, x, Pnm1=None, Pnm2=None)

Jacobi polynomial of order n with weight parameters alpha and beta.

Notes

This function is faster than scipy.special.jacobi when Pnm1 and Pnm2 are supplied and is stable to high order. Performance benefit ranges from 2-5x.

Parameters
  • n (int) – polynomial order

  • alpha (float) – first weight parameter

  • beta (float) – second weight parameter

  • x (numpy.ndarray) – x coordinates to evaluate at

  • Pnm1 (numpy.ndarray, optional) – The n-1th order jacobi polynomial, evaluated at the given points

  • Pnm2 (numpy.ndarray, optional) – The n-2th order jacobi polynomial, evaluated at the given points

Returns

jacobi polynomial evaluated at the given points

Return type

numpy.ndarray

prysm.jacobi.jacobi_sequence(n_max, alpha, beta, x)

Jacobi polynomials of order 0..n_max with weight parameters alpha and beta.

Parameters
  • n_max (int) – maximum polynomial order

  • alpha (float) – first weight parameter

  • beta (float) – second weight parameter

  • x (numpy.ndarray) – x coordinates to evaluate at

Returns

array of shape (n_max+1, len(x))

Return type

numpy.ndarray