bundles / scipy latest / scipy / special / _ellip_harm / ellip_harm
function
scipy.special._ellip_harm:ellip_harm
source: build-install/usr/lib/python3.14/site-packages/scipy/special/_ellip_harm.py:7
Signature
def ellip_harm(h2, k2, n, p, s, signm = 1, signn = 1)Summary
Ellipsoidal harmonic functions .
Extended Summary
These are also known as Lamé functions of the first kind, and are solutions to the Lamé equation:
where and is the eigenvalue (not returned) corresponding to the solutions.
Parameters
h2: floath**2.k2: floatk**2; should be larger thanh**2.n: intDegree.
p: intOrder, can range between .
s: floatCoordinate.
signm: {1, -1}, optionalSign of prefactor of functions. Can be +/-1. See Notes.
signn: {1, -1}, optionalSign of prefactor of functions. Can be +/-1. See Notes.
Returns
E: floatthe harmonic .
Notes
The geometric interpretation of the ellipsoidal functions is explained in [2], [3], [4]. The signm and signn arguments control the sign of prefactors for functions according to their type
K : +1 L : signm M : signn N : signm*signn
Examples
from scipy.special import ellip_harm w = ellip_harm(5,8,1,1,2.5)✓
w
✗np.float64(2.5)Check that the functions indeed are solutions to the Lamé equation:
import numpy as np from scipy.interpolate import UnivariateSpline def eigenvalue(f, df, ddf): r = (((s**2 - h**2) * (s**2 - k**2) * ddf + s * (2*s**2 - h**2 - k**2) * df - n * (n + 1)*s**2*f) / f) return -r.mean(), r.std() s = np.linspace(0.1, 10, 200) k, h, n, p = 8.0, 2.2, 3, 2 E = ellip_harm(h**2, k**2, n, p, s) E_spl = UnivariateSpline(s, E)✓
a, a_err = eigenvalue(E_spl(s), E_spl(s,1), E_spl(s,2)) a, a_err⚠
Traceback (most recent call last):
File "<doctest scipy.special._ellip_harm:ellip_harm[0]>", line 1, in <module>
a, a_err
^
NameError: name 'a' is not defined. Did you mean: 'ua'?
See also
Aliases
scipy.special.ellip_harm