Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

C-STACK overflow during integration

I am trying to run the following chunk of code

i = a*(1 + exp(-(b*x)^2/4)*cos(c*x)*cos(d*x))
i0 = i.subs(x=0)
W = 2*i - i0
G = integrate(W*exp(-I*k*x),(x,-oo,oo),algorithm="fricas").full_simplify()

with a,b,c,d,k,x being variables. When I do, I get the error

TypeError: ECL says: C-STACK overflow at size 1048576. Stack can probably be resized. Proceed with caution

The interesting thing is that when I have

 i = a*(1 + exp(-b*x^2/4)*cos(c*x)*cos(d*x))

and everything else the same, the integral can be performed. I was wondering either how to resize the stack as the error message suggests or how to fix the overflow?

Thank you for your time