sage-devel
[Prev] Thread [Next] | [Prev] Date [Next]
[sage-devel] Re: problem with complex_plot and real_part Burcin Erocal Fri Jun 26 06:00:29 2009
On Fri, 26 Jun 2009 08:27:44 -0300
Golam Mortuza Hossain <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> On Thu, Jun 25, 2009 at 11:31 PM, Nick
> Alexander<[EMAIL PROTECTED]> wrote:
> >
> > Can someone verify that this is a bug? Any hope a fix? (This is
> > with sage-4.0.2 on sage.math.)
> >
> > {{{
> > sage: complex_plot((x^2 + I).sqrt().real_part(), (-2, 2), (-2, 2))
> > ---------------------------------------------------------------------------
> ...
> > RuntimeError: cannot find SFunction in table
> > }}}
>
> It seems, its not just complex_plot issue. It is happening for other
> plots. For example, the following works fine in 3.4 but fails with
> the same error in 4.0.2
> -----
> sage: x,y=var('x,y'); plot3d( log(x+I*y).imag(), (x,-2,2), (y,-2,2))
> ...
> RuntimeError: cannot find SFunction in table
> -----
sage: %debug
> /home/burcin/sage/sage-4.0.2.rc0/expression.pyx(3115)sage.symbolic.expression.Expression.operator
> (sage/symbolic/expression.cpp:15268)()
ipdb> u
> /home/burcin/sage/sage-4.0.2.rc0/local/lib/python2.5/site-packages/sage/symbolic/expression_conversions.py(206)__call__()
205
--> 206 operator = ex.operator()
207 if operator is None:
ipdb> print ex
arctan2(real_part(y) + imag_part(x), real_part(x) - imag_part(y))
Both of these fail because Sage doesn't define a symbolic arctan2
function. There is instead a simple wrapper around arctan in
sage/functions/trig.py:
sage: arctan2(x,y)
arctan(x/y)
It's possible that this worked on 4.0, and I broke it with #6244.
I opened a ticket:
http://trac.sagemath.org/sage_trac/ticket/6421
I don't think I will have time to fix this in the next few days. Feel
free to replicate one of the Function_* classes in
sage/functions/trig.py to define a new symbolic function called
arctan2, with ginac conversion atan2.
Thanks.
Burcin
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---
- [sage-devel] problem with complex_plot and real_part Nick Alexander
- [sage-devel] Re: problem with complex_plot and real_part David Joyner
- [sage-devel] Re: problem with complex_plot and real_part Golam Mortuza Hossain