I need GLL (Gauss-Legendre-Lobatto) nodes for the Legendre-Galerkin-NI spectral method. It requires me to find the roots of the derivatives of Legendre polynomials.
My Matlab program calculates the coefficients of the derivatives of the Legendre polynomials just fine, but the issue is finding their roots. Matlab's built in roots function works fine up to 21st degree polynomials, but when N=22 and the coefficients reach 4*10⁷ (and rest are very badly scaled), it starts giving me imaginary roots.
Does anyone have ideas on how to find the roots for N>21, or an alternate way to find the GLL nodes?
Use a CAS that allows arbitrary precision, e.g. Maple or Mathematica.
In Maple, for example, here are the roots of the Legendre polynomial of order $38$, to $20$ digits accuracy:
$$- 0.99804993053568761981,\; - 0.98973945426638557194,\;- 0.97484632859015350764,\;- 0.95346633093352959567,\;- 0.92574133204858439682,\;- 0.89185573900463221679,\;- 0.85203502193236218886,\;- 0.80654416760531681555,\;- 0.75568590375397068074,\;- 0.69979868037918435591,\;- 0.63925441582968170718,\;- 0.57445602104780708113,\;- 0.50583471792793110324,\;- 0.43384716943237648437,\;- 0.35897244047943501326,\;- 0.28170880979016526136,\;- 0.20257045389211670320,\;- 0.12208402533786741987,\;- 0.040785147904578239913,\; 0.040785147904578239913,\; 0.12208402533786741987,\; 0.20257045389211670320,\; 0.28170880979016526136,\; 0.35897244047943501326,\; 0.43384716943237648437,\; 0.50583471792793110324,\; 0.57445602104780708113,\; 0.63925441582968170718,\; 0.69979868037918435591,\; 0.75568590375397068074,\; 0.80654416760531681555,\; 0.85203502193236218886,\; 0.89185573900463221679,\; 0.92574133204858439682,\; 0.95346633093352959567,\; 0.97484632859015350764,\; 0.98973945426638557194,\; 0.99804993053568761981 $$