Re: Finding roots of equalities involving Legendre Polynomials

*To*: mathgroup at smc.vnet.net*Subject*: [mg66400] Re: Finding roots of equalities involving Legendre Polynomials*From*: Paul Abbott <paul at physics.uwa.edu.au>*Date*: Thu, 11 May 2006 02:16:18 -0400 (EDT)*Organization*: The University of Western Australia*References*: <e3mip0$7d0$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

In article <e3mip0$7d0$1 at smc.vnet.net>, Jens Hueschelrath <nospam_jens at hueschelrath.de> wrote: > in order to solve an electromagnetic scattering problem, I try to find > the positive roots of two equalities: > > LegendreP[p, -m, Cos[theta1]] == 0 > > theta1 is known and m = 0,1,2,... I doubt that exact solutions are possible, except for trivial cases. Assuming that you want to compute a list of numerical roots, you could use the RootSearch package by Ted Ersek: http://library.wolfram.com/infocenter/MathSource/4482/ This package returns all the roots over a specified range as a list of replacement rules. Alternatively, the more elementary RootsInRange function that appeared in "Finding Roots in an Interval" in The Mathematica Journal 7(2), 1998) should be sufficient: Needs["Utilities`FilterOptions`"] RootsInRange[d_, {l_, lmin_, lmax_}, opts___] := Module[{s, p, x, f = Function[l, Evaluate[d]]}, s = Plot[f[l], {l, lmin, lmax}, Compiled -> False, Evaluate[FilterOptions[Plot, opts]]]; p = Cases[s, Line[{x__}] -> x, Infinity]; p = Map[First, Select[Split[p, Sign[Last[#2]] == -Sign[Last[#1]] & ], Length[#1] == 2 & ], {2}]; Apply[FindRoot[f[l] == 0, {l, ##1}, Evaluate[FilterOptions[FindRoot, opts]]] &, p, {1}] ] Then you would evaluate, e.g., RootsInRange[LegendreP[p, -2, Cos[0.3]], {p, 0, 100}] If you need more roots and higher precision, RootsInRange[LegendreP[p, -2, Cos[0.3]], {p, 0, 300}, PlotRange -> All, WorkingPrecision -> 30] I note that the spacing between the roots appears to be approximately constant for fixed theta. > as well as > > D[LegendreP[q,-m, Cos[theta1]], theta1] == 0 > > with, again, theta1 known and m = 0,1,2,... Note that Mathematica can compute and simplify this derivative: der[q_,m_][theta_]= Simplify[D[LegendreP[q, -m, Cos[theta]], theta]] Then you would just use RootsInRange[der[q, -2][0.3], {q, 0, 100}] > The values of p and q are needed for series expressions like : > > E = Sum_{p}[....] + Sum_{q}[....] > > where p and q are all the positive roots of the equations from above. Clearly, you can use the approach above to compute the truncated sums. Also, are you aware of "Spheroidal Wave Functions in Electromagnetic Theory" by W Li, XK Kang, & MS Leong (New York: Wiley), 2001? The codes from this book are available at http://www.ece.nus.edu.sg/stfpage/elelilw/Codes.htm Cheers, Paul _______________________________________________________________________ Paul Abbott Phone: 61 8 6488 2734 School of Physics, M013 Fax: +61 8 6488 1014 The University of Western Australia (CRICOS Provider No 00126G) AUSTRALIA http://physics.uwa.edu.au/~paul