ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 04 Sep 2013 14:13:04 +02003dplot of modulus of complex functionhttps://ask.sagemath.org/question/10502/3dplot-of-modulus-of-complex-function/Even though abs(x+I*y) should always be real... I get the following error:
plot3d(abs(x+I*y),(x,-5,5),(y,-5,5))
ERROR: unable to coerce to a real numberWed, 04 Sep 2013 13:55:44 +0200https://ask.sagemath.org/question/10502/3dplot-of-modulus-of-complex-function/Answer by tmonteil for <p>Even though abs(x+I*y) should always be real... I get the following error: </p>
<p>plot3d(abs(x+I*y),(x,-5,5),(y,-5,5))
ERROR: unable to coerce to a real number</p>
https://ask.sagemath.org/question/10502/3dplot-of-modulus-of-complex-function/?answer=15413#post-id-15413This is may not be a good answer explaining why is the `Symbolic Ring` not working here, but at least a workaround: forget about symbolic functions and use Python lambda functions instead:
sage: plot3d(lambda x,y: abs(x+I*y), (x,-5,5), (y,-5,5))
or even:
sage: plot3d(lambda x,y: abs(x+I*y), (x,-5,5), (y,-5,5), adaptive=True)
Wed, 04 Sep 2013 14:13:04 +0200https://ask.sagemath.org/question/10502/3dplot-of-modulus-of-complex-function/?answer=15413#post-id-15413