sphPlm_deriv(lmax, x)

Version (1.55 KB) by Ludvig
Normalized associated Legendre function for spherical harmonics, with derivative.


Updated 7 Nov 2014

View License

[y, d] = sphPlm_deriv(lmax, x)
Computes the normalized associated Legendre polynomial
\sqrt{(2l+1)/(4\pi)} \sqrt{(l-m)!/(l+m)!} P_l^m(x)
and its derivative, suitable for use in spherical harmonics, for l=0,...,lmax and m=0,...,l.
Vectorized in x, returns matrix with scaled P_l^m(x) at y(:, l+1,m+1) and scaled d/dx P_l^m(x) at d(:, l+1,m+1).
Based on recursion formulas found in:
W.H. Press, Numerical Recipes 3rd edition, p. 292
T. Limpanuparb, J. Milthorpe, arXiv:1410.1748v1 [physics.chem-ph]
using the implementation gsl_sf_legendre_sphPlm_deriv_array found in the Gnu Scientific Library as a template.

Cite As

Ludvig (2023). sphPlm_deriv(lmax, x) (https://www.mathworks.com/matlabcentral/fileexchange/48377-sphplm_deriv-lmax-x), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Numerical Integration and Differential Equations in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Removed confusion about l and n

Removed confusion about l and n.