Hi,
On 9/20/06, Joel B. Mohler <joel at kiwistrawberry.us> wrote:
> I'm attempting to get numerical results by using the "float" function. I'm
> not real clear on how it is supposed to work and the results I'm getting
> confuse me even more.
>
> (%i2) float(%e^(2/3*%pi*%i));
> (%o2) .8660254037844386*%i-0.5
> (%i3) float(%e^(10/21*%pi*%i));
> (%o3) 2.718281828459045^(10*%i*%pi/21)
>
> Why does %o2 turn out to be written directly as a complex number, but %o3 not
> get simplified at all? Is there another function I should be using rather
> than "float"? I want the expressions simplified to be written as a complex
> number like %o2.
To simplify complex expressions, you can use the demoivre variable.
For instance:
(%i7) float(%e^(10/21*%pi*%i));
(%o7) 2.718281828459045^(10*%i*%pi/21)
(%i8) demoivre;
(%o8) false
(%i9) float(%e^(2/3*%pi*%i));
(%o9) .8660254037844386*%i-0.5
(%i10) demoivre:true;
(%o10) true
(%i11) float(%e^(2/3*%pi*%i));
(%o11) .8660254037844386*%i-0.5
(%i12) float(%e^(10/21*%pi*%i));
(%o12) .9972037971811801*%i+.07473009358642439
and:
(%i13) %e^(10/21*%pi*%i);
(%o13) %i*sin(10*%pi/21)+cos(10*%pi/21)
See:
http://maxima.sourceforge.net/docs/manual/en/maxima_7.html#IDX190
Bye,
--
Juan Pablo Romero Bernal
Grupo Linux Universidad Distrital
Blog: http://jpromerobx.blogspot.com/
Canal IRC (IRC Channel)
#glud (irc.freenode.org)
Visita el sitio web de Software Libre en Colombia:
http://www.el-directorio.org