bundles / scipy 1.17.1 / scipy / special / _orthogonal / gegenbauer
function
scipy.special._orthogonal:gegenbauer
Signature
def gegenbauer ( n , alpha , monic = False ) Summary
Gegenbauer (ultraspherical) polynomial.
Extended Summary
Defined to be the solution of
for ; is a polynomial of degree .
Parameters
n: intDegree of the polynomial.
alpha: floatParameter, must be greater than -0.5.
monic: bool, optionalIf
True, scale the leading coefficient to be 1. Default isFalse.
Returns
C: orthopoly1dGegenbauer polynomial.
Notes
The polynomials are orthogonal over with weight function .
Examples
import numpy as np from scipy import special import matplotlib.pyplot as plt✓
p = special.gegenbauer(3, 0.5, monic=False) p✓
p(1)
✗x = np.linspace(-3, 3, 400) y = p(x)✓
fig, ax = plt.subplots()
✓ax.plot(x, y) ax.set_title("Gegenbauer (ultraspherical) polynomial of degree 3") ax.set_xlabel("x") ax.set_ylabel("G_3(x)")✗
plt.show()
✓
Aliases
-
scipy.special.gegenbauer