On 06/24/2010 06:15:52 AM, kcrisman wrote:


> > > sage: n=var('n')
> > > sage: f=e^(i*x*pi*n-i*2*pi*n)
> > > sage: f.simplify_full()
> > > e^(I*pi*n*x - 2*I*pi*n)
>
> > > # Is there a way I can get this to simplify?
>
> > This apparently isn't even that easy in Maxima.
>
> > Maxima 5.21.1http://maxima.sourceforge.net
> > using Lisp ECL 10.4.1
> > Distributed under the GNU Public License. See the file COPYING.
> > Dedicated to the memory of William Schelter.
> > The function bug_report() provides bug reporting information.
> > (%i5) radcan(%e^(%pi*n-2*%pi));
> >                                   %pi n - 2 %pi
> > (%o5)                           %e
> > (%i6) expand(%e^(%pi*n-2*%pi));
> >                                   %pi n - 2 %pi
> > (%o6)                           %e
>
> > There are several Maxima experts on the list, though, who may know
> > about a flag to set in such a case to factor the exponent first.  I > > couldn't find one in the simplification documentation for Maxima, but
> > it may be elsewhere.
>
> Well, I hope to hear from one of these Maxima experts!
>
> > Of course, you can do this ahead of time:
>
> > sage: e^((n*pi-pi*2).factor())
> > e^((n - 2)*pi)
>
> > but this is probably not what you want.
>
> Right. This crops up in the middle of a more complicated
> expression. If I could figure out how to break the expression
> up in the right way, then I guess I could search for parts
> that are exponential functions, take the log of those, and
> then simplify the logs. I know how to ultimately find all
> the pieces of the function with .operands(), but I don't
> then know any way to put them back together with the
> proper operators. Maybe there's a way to access the parsed

I believe there is, but I can't figure out how to do it without going
through fast_callable, which doesn't seem right.  This information is
in Pynac, but I can't find a method or underscore method that accesses
it.  This is now http://trac.sagemath.org/sage_trac/ticket/9329 .

> tree of the expression? But of course that's crazy.
> There must be a "normal" way to simplify it!
>

I don't know about that.  Many other discussions about 'obvious'
simplifications have led me to agree that this is a much harder
problem than one thinks.

On the other hand, it can be hard to find references to additional
packages in Maxima that might do this; it turns out that lots of
things one wants to do are not automatically available.  Try
http://maxima.sourceforge.net/docs/manual/en/maxima_71.html#SEC298 for
ways you might be able to do this directly in Maxima, though I
couldn't see for sure if that is part of its functionality.

sage: maxima_console()

(%i4) demo("facexp");

Annoyingly, it continues this thing of asking whether 2*%pi is an
integer which one often sees...

I hope this helps.

- kcrisman

This is all good information, thanks. It helps to at least know
that I'm not missing something obvious. It's the combination with
that latex issue that results in some really ugly output.

I've noticed too about how maxima continues to ask things that
(it would seem) you have already told it. I guess it would be
in my best interests to learn more about maxima.

Thanks again,

-Mike






--
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-support
URL: http://www.sagemath.org

Reply via email to