Chebyshev Polynomial Approximation

Armitage

Banned
Feb 23, 2001
8,086
0
0
This is pretty straight forward if you can evaluate the function to be approximated at the nodes of the Nth Chebyshev polynomial. I know it can be done for an arbitrary choice of points, but I haven't found any references as to how.

Any pointers?
 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
If you're dealing with this kind of polynomial (Chebyshev, Legendre, and so on), I highly recommend picking up the book by Abramowitz and Stegun. I finally broke down and bought it myself only yesterday when I found out it's only like $35. It's called "Handbook of Mathematical Functions." I can tell you how to do it later if you want, but that will have to wait since I have an exam today and decided to go to a Judas Priest/Anthrax concert last night instead of studying. :eek:
 

TuxDave

Lifer
Oct 8, 2002
10,571
3
71
Originally posted by: Armitage
This is pretty straight forward if you can evaluate the function to be approximated at the nodes of the Nth Chebyshev polynomial. I know it can be done for an arbitrary choice of points, but I haven't found any references as to how.

Any pointers?

If I had my numerical analysis book with me I could give you a better answer. But the classical and slow way is to just solve a set of N linear equations.
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
I think I have a way to do it by mapping my equidistant x values onto the Chebyshev nodes. I've got the mapping function worked out - I'll try the rest tomorrow. It ought to work :p
 

TuxDave

Lifer
Oct 8, 2002
10,571
3
71
Originally posted by: Armitage
I think I have a way to do it by mapping my equidistant x values onto the Chebyshev nodes. I've got the mapping function worked out - I'll try the rest tomorrow. It ought to work :p

If you have MATLAB, it should be fairly easy to map out. Solving a set of N linear equations is a quick matrix operation.

y = ax^N+bx^(N-1)+.... +z

Substitute your x and y values in and you get a linear equation of a,b,c,d,e..... solve with matrices and matlab since it's pretty good when working with vectors.
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Originally posted by: TuxDave
Originally posted by: Armitage
I think I have a way to do it by mapping my equidistant x values onto the Chebyshev nodes. I've got the mapping function worked out - I'll try the rest tomorrow. It ought to work :p

If you have MATLAB, it should be fairly easy to map out. Solving a set of N linear equations is a quick matrix operation.

y = ax^N+bx^(N-1)+.... +z

Substitute your x and y values in and you get a linear equation of a,b,c,d,e..... solve with matrices and matlab since it's pretty good when working with vectors.

Yep - I have access to Mathematica which could make short work of it as well. But I need C code as this will be integrated into a bigger program - not a one time thing that I can do in mathematica or matlab.

In any case, by mapping the points from my data table onto the Chebyshev nodes, I don't have to solve the general matrix equation: http://mathworld.wolfram.com/ChebyshevApproximationFormula.html
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Well, the mapping kind of works, but the accuracy goes to hell, particularly near the ends :(
Back to the drawing board.
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Meh - I'm bailing on the Chebyshev stuff - tried it primarily because it came highly reccomended by a senior guy at work. They still look like a really good deal if you can evaluate the original function at the nodes to build the Chebyshev model.

I put together a quick-n-dirty lagrange polynomial today and it's working great.
 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
Originally posted by: Armitage
Meh - I'm bailing on the Chebyshev stuff - tried it primarily because it came highly reccomended by a senior guy at work. They still look like a really good deal if you can evaluate the original function at the nodes to build the Chebyshev model.

I put together a quick-n-dirty lagrange polynomial today and it's working great.
Yeah, it's a lot easier with Lagrangian or Legendre polynomials. These are typically used for numerical solution techniques for that reason. I've yet to figure out the real benefit to using Chebyshev, but my application experience is pretty much zero, so I'm sure it is useful to someone. If you need any help with the other two, let me know.
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Originally posted by: CycloWizard
Originally posted by: Armitage
Meh - I'm bailing on the Chebyshev stuff - tried it primarily because it came highly reccomended by a senior guy at work. They still look like a really good deal if you can evaluate the original function at the nodes to build the Chebyshev model.

I put together a quick-n-dirty lagrange polynomial today and it's working great.
Yeah, it's a lot easier with Lagrangian or Legendre polynomials. These are typically used for numerical solution techniques for that reason. I've yet to figure out the real benefit to using Chebyshev, but my application experience is pretty much zero, so I'm sure it is useful to someone. If you need any help with the other two, let me know.

One application I found for the Chebyshev stuff was back in the 70s when storage and processor power was very limited, you could store the chebyshev approximation to a satellite orbit in much less space then a full ephemeris table, and process it much faster then a full-on propagator. I'm considering trying something similar for a project I'm working on that is very orbit propagation intensive. I can distribute the development of the Chebyshev approximations across the cluster.

But I've got alot of other things to do before I even think about that to much, and I suspect it would only be a net gain when we move to a higher order (aka slower) propagation model which may be close to an order of magnitude slower then what I'm using now. Or we could jast add a few more nodes to the cluster :p