[SciPy-user] Numerical stability and Legendre polynomials

Yaroslav Bulatov yaroslavvb at gmail.com
Wed Sep 7 13:28:05 EDT 2005


I'm trying to approximate a function using an expansion over few dozen
of Legendre polynomials, but I'm running into a large numerical error.

For instance the following
    special.legendre(30).integ()(1)-special.legendre(30).integ()(-1)
evaluates to 2e-4, instead of 0

So my question is -- is such numerical error normal? Is it realistic
to try to approximate a function using 30 Legendre polynomials?


-- 
Yaroslav Bulatov
bulatov at cs.oregonstate.edu
Dearborn 102
Oregon State University
Corvallis, OR




More information about the SciPy-User mailing list