On May 16, 2:44 am, Dan Pillone <[EMAIL PROTECTED]> wrote:
>
> Is there a way to plot x^x correctly?

A lovely article by Mark Meyerson entitled "The x^x Spindle"
appeared in Mathematics Magazine back in June of 96.  The
article shows how to interpret the graph of x^x in 3-space,
using the complex values of x^x.  This may be plotted in
sage as follows:

def f(x,k):
    if x != 0:
        z = exp(x*(maxima.log(x) + 2*I*pi*k))
        return [x, real(z), imag(z)]
    else:
        return [0, 1, 0]
dx = 0.02
pic = line([[0,1,0],[0,1,0]]);
for k in range(-3,4):
    points = [f(x*dx,k) for x in range(-4/dx,2/dx)]
    pic = pic + line(points)
pic.show(frame_aspect_ratio=[2,1,1], figsize=8)

The above commands take *way* too long, presumably due to the
repeated calls to maxima's complex log function.  Sage's log
function doesn't work.  I was able to  perform the loop in
maxima, but I was unable to get the result back into sage for
plotting.

The result is quite nice, though.  There are countably many
different threads, corresponding to the different branches of
the complex log; they all spiral about the x-axis.  You can
see the graph here:
https://www.sagenb.org/home/pub/1830/

The published notebook also shows a plot of x^x for x>0
together with points of the form (-p/q)^(-p/q) for odd q.
These points all lie where one of the threads pierces the
x-re(z) plane.

Mark


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to