Ask Your Question

Revision history [back]

Hello,

I got the same problem (using sage-6.4).

At least, here is a workaround using fast_callable (which is also much faster)

sage: expr = abs(1000*(2*pi*f*i)/(0.1*(2*pi*f*i)^2+1000*(2*pi*f*i)+c))
sage: g = fast_callable(expr.subs(c=1E6), domain=CDF, vars=[f])
sage: find_local_maximum(g, 1000, 3000)
(1.0, (1591.549431507781+0j))
sage: g = fast_callable(expr.subs(c=1E7), domain=CDF, vars=[f])
sage: find_local_maximum(g, 1000, 3000)
(1.0, (1591.549431507781+0j))

fast_callable somehow tries to compile your expression in a fast function. If you intend to evaluate a lot an expression it is always a good idea.

One annoying thing is that you need to declare the function to be over complex because you use i in your formula.

Vincnet