Bug with plotting cube roots

173 vues
Accéder directement au premier message non lu

Bruce Bartlett

non lue,
20 mars 2009, 06:40:0720/03/2009
à sage-s...@googlegroups.com
When I type in

plot(x^(1/3), -1, 1)

Sage balks at me. Apparantly it doesn't understand that the cube root of a negative number is well defined. Is this a bug? I found no easy way to get around it.



Ajay Rawat

non lue,
20 mars 2009, 06:46:4220/03/2009
à sage-s...@googlegroups.com
No i don't think so it is plotting for me.
--
Ajay Rawat
Kalpakkam, IGCAR

-------------------------------------------------------------------------
Save Himalayas....
-------------------------------------------------------------------------

Mike Hansen

non lue,
20 mars 2009, 07:02:1220/03/2009
à sage-support
Hello,

On Mar 20, 3:40 am, Bruce Bartlett <brucehbartl...@googlemail.com>
wrote:
In the documentation for plot (which you can see by doing plot?), it
says

To plot the negative real cube root, use something like the
following::

sage: plot(lambda x : RR(x).nth_root(3), (x,-1, 1))

--Mike

kcrisman

non lue,
20 mars 2009, 08:53:3920/03/2009
à sage-support
Just for context, this was discussed ad nauseam a long time ago, and
essentially the argument is that a) there are way too many places
where (-1)^(1/3) should be in fact the primitive complex root of
negative unity, even when it is not explicitly asked for via using the
complex number framework in Sage and b) it's not clear that there is
any way to make the plotting code "know" that one is plotting
something like this, because there are too many similar things to
catch. I also believe Maple does not plot the negative values.

I wish there were an easier way around this, but none has occurred to
any of us so far. Believe me, I'd be the first to implement something
which allowed a) to work but which still caught cases of b).

- kcrisman

ma...@mendelu.cz

non lue,
20 mars 2009, 11:53:1420/03/2009
à sage-support


On 20 Bře, 13:53, kcrisman <kcris...@gmail.com> wrote:

> something like this, because there are too many similar things to
> catch. I also believe Maple does not plot the negative values.
>

You are right, Maple plots x^(1/3) only for positive x. As a side
effect, if you try to plot the function y=(x^2-1)^(1/3) which I have
seen in many textbooks, you get only partial answer.

What about Mathematica? The online tools at http://calc101.com/webMathematica/sketch.jsp
consider also negative x. Is this default setting in Mathematica?

Robert

Jason Grout

non lue,
20 mars 2009, 12:20:5520/03/2009
à sage-s...@googlegroups.com


Mathematica also doesn't plot the negative real cube root. It's the
same as Sage.

Jason

Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message