58
3 Legendre Polynomials and Legendre Functions
figure,plot(imag(z),imag(Res)),shg
format long
% result via x +- 0i:
ergr = 0.5 * exp(-mu * pi * i) * ...
(exp(-0.5 * mu * pi * i) * Res(11)+exp(0.5 * mu * pi * i) * Res(10))
ergQr = legQr(nu,mu,x)
% result for x
>> testlegQr_3
ergr =
-0.703971934492560 - 0.000000000000000i
ergQr =
-0.703971934492560
testlegQr_3 is the name of the script. By running the script, the two figures
uncover the limiting process. “ergr” is the result based on Eq. (3.38), and “ergQr” is
based on Eq. (3.24d).
Associate Legendre functions can be computed with the help of the class PQnumufun:
>> [obj, res] = PQnumufun(nu,mu,z,PorQ).
The input variables “nu,” “mu” (degree and order), and “z” are arbitrary complex
arrays. If “nu” and “mu” both are either row or column vectors of the same
size, the evaluation will be pairwise, and if they are of different size, all possible
combinations will be used. The input variable “PorQ” is optional, with possible
values 1 or “P” (default; for associate Legendre functions of first kind) and 2 or
“Q” for Legendre functions of second kind. Output values are the object “obj” with
properties, “value” for the function value, “z” the corresponding function input,
and “numu” lists the “nu” and “mu” parameter values pairwise, and “info” some
general information on which computational methods were used; “res” is equal to
obj.value. For scalar “nu” and “mu” inputs, “obj.values” will be of the same
size as “z,” otherwise row-like, which means each row belongs to one nu–mu pair
and the n-th column to z(n).
Example
x = [linspace(1.5,2.8,250),linspace(2.8025,7,250),...
linspace(7.025,12,150),linspace(12.1,20)];
nu= 0.5 + 100 * i;
mu = 5;
PQnumufun(nu, mu, x).plot;
Figure 3.5 shows an example for P
μ
ν (x) for ν =
1
2 + iτ . In contrast to the Mehler
function, the function values are complex. This could be easily understood by the
following identity: P
μ
ν (z) = P
μ
−ν−1 (z). For ν = −
1
2 + iτ (the Mehler function),
we get −ν − 1 = −
1
2 − iτ , the complex conjugated degree, whereas for ν =
+
1
2 + iτ , Fig. 3.5, we get −ν − 1 = −
3
2 − iτ . Of course, this is as well uncovered
by the hypergeometric series expansion.
3 Legendre Polynomials and Legendre Functions
figure,plot(imag(z),imag(Res)),shg
format long
% result via x +- 0i:
ergr = 0.5 * exp(-mu * pi * i) * ...
(exp(-0.5 * mu * pi * i) * Res(11)+exp(0.5 * mu * pi * i) * Res(10))
ergQr = legQr(nu,mu,x)
% result for x
>> testlegQr_3
ergr =
-0.703971934492560 - 0.000000000000000i
ergQr =
-0.703971934492560
testlegQr_3 is the name of the script. By running the script, the two figures
uncover the limiting process. “ergr” is the result based on Eq. (3.38), and “ergQr” is
based on Eq. (3.24d).
Associate Legendre functions can be computed with the help of the class PQnumufun:
>> [obj, res] = PQnumufun(nu,mu,z,PorQ).
The input variables “nu,” “mu” (degree and order), and “z” are arbitrary complex
arrays. If “nu” and “mu” both are either row or column vectors of the same
size, the evaluation will be pairwise, and if they are of different size, all possible
combinations will be used. The input variable “PorQ” is optional, with possible
values 1 or “P” (default; for associate Legendre functions of first kind) and 2 or
“Q” for Legendre functions of second kind. Output values are the object “obj” with
properties, “value” for the function value, “z” the corresponding function input,
and “numu” lists the “nu” and “mu” parameter values pairwise, and “info” some
general information on which computational methods were used; “res” is equal to
obj.value. For scalar “nu” and “mu” inputs, “obj.values” will be of the same
size as “z,” otherwise row-like, which means each row belongs to one nu–mu pair
and the n-th column to z(n).
Example
x = [linspace(1.5,2.8,250),linspace(2.8025,7,250),...
linspace(7.025,12,150),linspace(12.1,20)];
nu= 0.5 + 100 * i;
mu = 5;
PQnumufun(nu, mu, x).plot;
Figure 3.5 shows an example for P
μ
ν (x) for ν =
1
2 + iτ . In contrast to the Mehler
function, the function values are complex. This could be easily understood by the
following identity: P
μ
ν (z) = P
μ
−ν−1 (z). For ν = −
1
2 + iτ (the Mehler function),
we get −ν − 1 = −
1
2 − iτ , the complex conjugated degree, whereas for ν =
+
1
2 + iτ , Fig. 3.5, we get −ν − 1 = −
3
2 − iτ . Of course, this is as well uncovered
by the hypergeometric series expansion.
