Hi

On Fri, Jan 12, 2018 at 4:10 PM, João Alberto de França Ferreira
<[email protected]> wrote:
> Is there a way to compute the local maximum of the absolute value of a
> polynomial with complex coefficients? the below snippet should exemplify my
> problem.
...

Maybe a trick like this works:
f(x) = x^2 + 2*I*x + 2
g = lambda x: abs(f(x))
find_local_maximum(g,-1,1)

this gives
(3.6055511727769516, 0.99999996297566163)

while
find_local_maximum(abs(f(x)),-1,1)
gives
TypeError: unable to coerce to a real number

The difference is that one is a python function while
the other one is a SymbolicExpression, not sure
why one works and the other doesn't.


Thanks,
-- 
Vegard

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to