Hi 1) From the only example I found s = PowerSeriesRing(QQ,'s').gen() a=exp(s);a.pade(4, 0) type(a)

it seems this works for type 'sage.rings.power_series_poly.PowerSeries_poly'

But I have a type 'sage.symbolic.expression.Expression' b, and was unable to convert b to the type required to apply pade

2) There's an alternative rational.reconstruct , but that seems to be geared to computations modulo (n) 3) In conclusion, it seems at current stage the simplest is to write one's own Pade? Thanks, Florin

edit retag close merge delete

• Please give us a, or the b from (1), so that potential helpers have a clear idea what kind of expressions are involved, and give the solution working in that particular case in any case.
• There is a function rational_reconstruction, indeed. But i do not see it as an alternative, it is designed only for the special use described in its doc string, offered e.g. by typing rational_reconstruction? in the sage interpreter.
• No, i would say, simplest for me is to use the pade method inside the class where it is genuinely defined. So just start with a b which is some function in s - say, convert is somehow to a power series, get the result, and possibly come back. But why do we need such a complication, why is the input b not directly in the PowerSeriesRing of QQ ?!
( 2017-12-01 14:51:57 -0600 )edit

Sort by » oldest newest most voted

You need to convert your symbolic expression to a symbolic Taylor series, then to a formal power series.

Typical example:

sage: f=sin(x)+cos(x)
sage: g=f.series(x,28)
sage: h=QQ[['x']](g)
(127441/6601*x^4 - 481140/6601*x^3 - 2632500/6601*x^2 + 709560/943*x + 749040/943)/(x^4 - 10940/6601*x^3 + 265500/6601*x^2 - 39480/943*x + 749040/943)

more

it works now! Thanks both of you and excuses for my silly novice questions. Both series and taylor which I had tried before work fine (I guess both must have advantages sometimes if they are kept ?)

adding the QQ magic changed the donna Here's the example var('s') L_F=(exp(-s)-1+s)/(s^2)
t=L_F.series(s,6) #t = taylor(L_F,s,0,6) h=QQ['s'] h.pade(2,2)

( 2017-12-02 03:08:41 -0600 )edit