# can series make mistakes?

series seems to make errors . luckily, taylor works correctly. start with L_F=(exp(-s)-1+s)/(s^2/2) (laplace transform of the "equilibrium" uniform density) and switch to Pollaczek laplace transform L_F /(1- epsilon * L_F);
You can check that the moments expansions t, t1 differ

var('s');n=2 L_F=(exp(-s)-1+s)/(s^2/2) #satisfies L_F(s=0)=1 L_L=L_F/(1-L_F/3) t = L_L.series(s,2n+2) t1= taylor(L_L,s,0,2n+2) print t1

edit retag close merge delete

Please format your code! If you make indentation by four spaces, you got nicely printed code like

x = 3
print(x)

( 2017-12-02 05:29:12 -0500 )edit

Sort by ยป oldest newest most voted

The output of L_L.series(s, 2*n+2) is erroneous because of the division by s^2, which causes some trouble at s=0. You have to simplify the expression of L_L, via simplify_full(), prior to the call to series. Then you will get a correct result:

sage: L_L = L_L.simplify_full()
sage: L_L.series(s, 2*n+2)
3/2 + (-3/4)*s + 5/16*s^2 + (-29/240)*s^3 + 263/5760*s^4 + (-4157/241920)*s^5 + Order(s^6)
sage: taylor(L_L, s, 0, 2*n+2)
93881/14515200*s^6 - 4157/241920*s^5 + 263/5760*s^4 - 29/240*s^3 + 5/16*s^2 - 3/4*s + 3/2


On general grounds, it is usually preferable to simplify an expression before manipulating it.

more