Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Let suppose that I have a function $f[x]$ I want to approximate using a Pade expansion and that I decide what would be maximum number of terms to be used.

Is there any way with Mathematica to find what have to be the degrees of numerator and denominator in order to have the best approximation over a given range of $x$ ?

Doing this manually is, as one could expect, quite tedious. Any help and suggestion will be really appreciated.

share|improve this question
1  
I'm not really sure how this question can be well-posed, because it's not clear what you mean by "best." Is that maximum absolute deviation? Mean deviation? And then, how do you reconcile that with the fact that the order $(n,d)$ Padé approximant generally improves with increasing $n$ and $d$? If your condition is to fix the sum of polynomial degrees, then it then becomes a computational exercise to go through all the approximants and measure the "goodness" by whatever metric you want. –  heropup Feb 4 at 7:53
    
@heropup. I said that $n+d$ if fixed as well as the interval of $x$. What I would like is to be able to "automate" the process. The "best" could be defined the manner you want (say : lowest maximum absolute deviation). –  Claude Leibovici Feb 4 at 7:59
add comment

1 Answer 1

up vote 1 down vote accepted

This is very slow but here it goes:

wPade[F_, x_, xo_, a_, b_, n_] := Sort[Table[{{m, n - m}, NIntegrate[Abs[F - PadeApproximant[F, {x, xo, {m, n - m}}]], {x, a, b}]} , {m, 1, n}] , #1[[2]] < #2[[2]] &][[1, 1]]
wPade[Sin[x], x, 0, 0, 1, 5]

where F is the function, x the variable, xo where the approximation is about, a and b the limits of the region, and n the sum of the upper and lower degrees

share|improve this answer
1  
Thanks a lot. This is exactly what I was looking for. –  Claude Leibovici Feb 5 at 9:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.