CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Help on chebyshev polynomials (https://www.cfd-online.com/Forums/main/120978-help-chebyshev-polynomials.html)

 shubiaohewan July 18, 2013 11:03

Help on chebyshev polynomials

Hi all,

I want to see the orthogonality of the chebyshev polynomials in Matlab.

The nodes I choose is the Chebyshev nodes, . i=1.....n

According to the approximation theory, I can have

Now, how can I numerically show that the orthogonality? What I did is
(1) I generate the chebyshev polynomials in Matlab, stored in p(:,i), i is the order 0....n
(2) sum(p(:,i).*p(:,j)), meaning that the component-wise sum of the i-th order chebyshev and j-th one.

But it turns out that some of the results work, some of them don't.

Did I do something wrong here? I didn't mention the weight function since for the chebyshev nodes, the weight function is constant pi/n. So at least, it should affect the orthogonality.