On 06/22/2010 12:41:17 PM, 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.1 http://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
tree of the expression? But of course that's crazy.
There must be a "normal" way to simplify it!
> sage: latex(f)
> e^{\left(I \, \pi n x + \left(-2 I\right) \, \pi n\right)}
>
> # Why the "extra" parentheses around -2I ?
No idea. Pynac usually handles these sorts of things; I'm not sure
whether I would call it a bug, though it does seem strange. Perhaps
Pynac represents this as a complex internally and so this happens?
Burcin will know :)
- kcrisman
--
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
--
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