Symbolic Associated Legendre Polynomials

25 vues (au cours des 30 derniers jours)
Marko Simic
Marko Simic le 21 Juil 2020
Modifié(e) : Masa le 2 Août 2021
Hello!
I am trying to create the symbolic associated legendre polynomials of degree n and order m.
I found this forum entry: https://www.mathworks.com/matlabcentral/answers/9485-how-do-i-specify-m-for-orthpoly-legendre but unfortunately MuPad has been removed and I have no idea how I can implement that in the same way.
Is there any possibility? The function legendreP gives me only the unassociated legendre polynomial.
I am currently using Matlab R2018a with the Symbolic Toolbox.
Thank you in advance!

Réponse acceptée

Masa
Masa le 2 Août 2021
Modifié(e) : Masa le 2 Août 2021
associated Legendre functions could be found from Legendre functions according to the following formula
so in MATLAB you can define a function like this
function plm = assocLegendre(l,m)
% get symbolic associated legendre function P_lm(x) based on
% legendre function P_l(x)
syms x;
% get symbolic form of Legendre function P_l(x)
leg = legendreP(l,x);
% differentiate it m times
legDiff = diff(leg,x,m);
% calculate associated legendre function P_lm(x)
plm = ((-1)^m)*((1 - x^2)^(m/2))*legDiff;
end
to get associated Legendre functions in symbolic form.

Plus de réponses (0)

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by