Ask Your Question
1

using pade approx

asked 2017-12-01 11:13:14 +0100

florin gravatar image

updated 2023-05-19 14:31:57 +0100

FrédéricC gravatar image

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 flag offensive close merge delete

Comments

  • 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 ?!
dan_fulea gravatar imagedan_fulea ( 2017-12-01 21:51:57 +0100 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2017-12-01 21:46:54 +0100

FrédéricC gravatar image

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)
sage: h.pade(4,4)
(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)
edit flag offensive delete link more

Comments

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)

florin gravatar imageflorin ( 2017-12-02 10:08:41 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-12-01 11:13:14 +0100

Seen: 641 times

Last updated: Dec 02 '17