Question: How get numerical result when evalf fails

In the following worksheet, I can evaluate S(32), but not S(31). As a result, I can't use any value that depends on S(31) (or any i<31), for example, the graph is incomplete. How can I get Maple to evaluate S(31)?

restart

sigma := 167:

t := proc (i) options operator, arrow; exp(-(1/2)*i^2/sigma^2) end proc:

S := proc (l) options operator, arrow; 1+2*(sum(t(i), i = l .. infinity)) end proc:

evalf(S(32))

356.9784188

(1)

evalf(S(31))

1.+2.*(sum(exp(-(1/55778)*i^2), i = 31 .. infinity))

(2)

Expected result of evalf(S(31)):

evalf(S(32)+2*t(31))

358.9442559

(3)

plot(S(y), y = 20 .. 50)

 

``


All told, S(i) fails for i in [0..31], i = 115,116, and 221. S(i) succeeds for all other i < 3500.

Download test.mw

 

Please Wait...