abs and plot problems [closed]
Hi there. I am encountering problems trying to plot some functions. The following example shows how I am able to plot the modulus of a simple function using my own modulus function, but it fails using abs(). Which is really weird.
_ = var('a,x')
MODULUS(x) = sqrt(real(x)^2 + imag(x)^2)
Hmod = MODULUS(ax + ix^2)
Habs = abs(ax + ix^2)
plot([Hmod(a=n) for n in [1..5]], (x,0, 2))
plot([Habs(a=n) for n in [1..5]], (x,0, 2))
Hmod can be plotted, while Habs will return "TypeError: unable to coerce to a real number".
Anyone can help on that? I have seriously more complicated cases that I seem to be unable to plot because of this very problem. Thanks a lot.