Ask Your Question
0

can series make mistakes?

asked 7 years ago

florin gravatar image

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

Preview: (hide)

Comments

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

x = 3
print(x)
vdelecroix gravatar imagevdelecroix ( 7 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 7 years ago

eric_g gravatar image

updated 7 years ago

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.

Preview: (hide)
link

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: 7 years ago

Seen: 272 times

Last updated: Dec 03 '17