How to generate ORTHONORMAL basis of Legendre polynomials on [0,1]?
I tried using many modules, but they usually don’t provide normalisation and change of interval. Is there some general normalizing factor? Or formula for change of the interval?
How to generate ORTHONORMAL basis of Legendre polynomials on [0,1]?
I tried using many modules, but they usually don’t provide normalisation and change of interval. Is there some general normalizing factor? Or formula for change of the interval?
Copyright © 2021 Jogjafile Inc.
You can get the Legendre polynomials on
[-1, 1]withscipy.special.legendre. They are orthogonal but not orthonormal. But it is known that the integral ofLn(x)*Ln(x)over[-1, 1]is2 / (2*n +1), whereLndenotes the Legendre polynomial of degreen. So you can normalize the Legendre polynomials as follows:Now, to change the interval, you can do a linear change of variables: define
Pnon[0, 1]byPn(x) = sqrt(2) * Ln_normalized(2*x-1). Then thePnare orthonormal.