Hi all,
I'm currently to solve an EVP "over S2". The context is mostly unimportant, but I'm trying to solve for gravity-mode eigenfunctions under strong magnetic fields.
I am trying to do this problem in general on S2, but, because I need to accommodate NCCs in phi, it seems I can unfortunately not use the spherical harmonic basis. Instead, the main difficulty is trying to solve this problem using some sort of Chebyshev basis in theta and somehow enforcing regularity at the poles. I am running into some pretty unusual (but distinctive) issues which I hope you might have some explanation for.
Four scripts (and diagnostic output) are attached to dense-solve the "same problem", but with varying levels of "abstraction" removed. The test case is to try to recover the m=+1 associated Legendre polynomials.
1. "spharm_test_P_noreduce.py": This tries to directly solve the m=+1 generalized Legendre equation using Chebyshev polynomials as a basis:
(1-u^2)*P'' - 2*u*P' - P/(1-u^2) + lambda*P = 0
Afterwards, upon transforming the output eigenvectors to coefficients in terms of normalized associated Legendre polynomials, I find the following (sensible) behavior:
- The eigenvectors are approximately, but not "exactly", orthogonal to each other.
- The eigenvectors are mostly close to single associated Legendre polynomials, with greater mixing between components for higher eigenvalues.
- The eigenvalues are a few percent off.
I roughly understand this behavior: for odd m, associated Legendre polynomials are not analytic at the endpoints. Regularity conditions assert that they generally scale as ~sqrt(1-u^2), which has an infinite slope at the poles.
2. "spharm_test_P.py": This tries to analytically "factor out" ~sqrt(1-u^2), i.e., solve the problem by replacing P with sqrt(1-u^2)*P everywhere and simplifying the equations. This means solving the following:
(1-u^2)*P'' - 4*u*P' - 2*P + lambda*P = 0
This is the mysterious behavior:
- Every other eigenvector is correct (i.e., a single associated Legendre polynomial), but the others (those with l-1 = even) are contaminated specifically by a (often very large) l=m=1 component.
I'm puzzled, since it seems this equation should be equivalent. I'm not sure if I have accidentally introduced a null direction that Dedalus is trying to find.
For lambda = l*(l+1), WolframAlpha says (expectedly) that the above equation possesses closed-form solutions without using hypergeometric functoins, but they tend not to be analytic at the poles (cf. lambda=2, solved by P'=const./(1-u^2)^2), so I hoped that they wouldn't be in the span of the Chebyshev basis (but maybe that's numerically naive). However, the original generalized Legendre equation also has non-analytic basis functions in its span (Legendre Q functions), so I don't know why this feature would be the issue.
3. "spharm_test_PT.py": This is one layer closer to what I'm actually trying to do. Here, I solve for two fields P, T:
λ*P + s**2*T'' - 4*c*T' - 2*T = 0
-s**2*T + c*T + s**2*P' - c*P = 0
Physically, T is some potential function generating a (physical!) vector field over the sphere. There is definitely a gauge freedom, but on S2 that gauge freedom is just a constant offset which in principle only matters for m=0 (but not necessarily in practice?).
The second equation is actually basically trivial and is solved by P=T. This time:
- Half of the eigenvectors are the same eigenvectors as before, with the same l-1=0 contamination.
- The other half return eigenvalues = infinity, and the eigenvectors have P~0 and T which are (sparse) combinations of a few components.
4. "spharm_test_PTF.py": This is even one layer closer to what I'm trying to do. Here, I solve for three fields P, T, F:
λ*P + s**2*T'' - 4*c*T' - 2*T = 0
-s**2*T' + (1-q)*c*T - 1j*q*s**2*c*F' - 1j*(1-q*c**2)*F + s**2*P' - c*P = 0
-s**2*F' + (1-q)*c*F + 1j*q*s**2*c*T' + 1j*(1-q*c**2)*T - 1j*P = 0
Here, F is something like a stream function for the same vector field, with the same caveats about gauge freedom. Here, q can be taken to be a small number (without which there is a singularity error), but it has a real interpretation related to the rotation rate of the star.
Observed behavior:
- 1/3rd of the eigenvalues/vectors are the same as before (with F=0), 2/3rds have eigenvalues = infinity which look like sparse combinations of T and F
--
Additional context:
My actual equations generalize these further by adding terms (related to magnetism) which couple across different m. I'm ultimately trying to solve those equations (for one set of fields P, T, F for each m included -- not relying on the built-in Fourier basis, and with gauge fixed). My main problem at the moment however boils down to those in the previous examples (l=|m| contamination for modes where l-|m| = even).
Preliminary runs where I don't care about regularity at all and solve the problem in Chebyshev(theta) (not Chebyshev(cos theta) to ensure differentiability near poles) seemed to behave okay because "regularity" was approximately enforced by singular prefactors ~sin theta, but for some modes this wasn't exact and some eigenfunctions would fail to vanish at the poles at the level ~1e-3 when they were supposed to.
I know I'm probably stress-testing Dedalus outside a regime where it may be appropriate, but if you have any idea what's going on please let me know.
Thanks,
Nicholas