(1/45)*3**(1/2)*exp(-1/4*I*k_1 + (1/4)*I*k_2*3**(1/2)) +
(1/45)*3**(1/2)*exp(-1/8*I*k_1 - 1/8*I*k_2*3**(1/2)) +
(1/45)*3**(1/2)*exp((1/4)*I*k_1 - 1/4*I*k_2*3**(1/2)) +
(1/45)*3**(1/2)*exp((1/8)*I*k_1 + (1/8)*I*k_2*3**(1/2)) +
(1/45)*3**(1/2)*exp(-1/4*I*k_1) + (1/45)*3**(1/2)*exp((1/4)*I*k_1)
where k_1,k_2 are real numbers. What is the best way to automatically
rewrite this as a weighted sum of cosines?
all the best
--Colin
In [22]: print a.rewrite(cos)
3**(1/2)*(I*sin(k_1/4) + cos(k_1/4))/45 + 3**(1/2)*(-I*sin(k_1/4) + cos(k_1/4))/45 + 3**(1/2)*(-I*sin(I*(I*k_1/4 - I*k_2*3**(1/2)/4)) + cos(I*(I*k_1/4 - I*k_2*3**(1/2)/4)))/45 + 3**(1/2)*(-I*sin(I*(-I*k_1/4 + I*k_2*3**(1/2)/4)) + cos(I*(-I*k_1/4 + I*k_2*3**(1/2)/4)))/45 + 3**(1/2)*(-I*sin(I*(I*k_1/8 + I*k_2*3**(1/2)/8)) + cos(I*(I*k_1/8 + I*k_2*3**(1/2)/8)))/45 + 3**(1/2)*(I*sin(-I*(-I*k_1/8 - I*k_2*3**(1/2)/8)) + cos(-I*(-I*k_1/8 - I*k_2*3**(1/2)/8)))/45
You could then use expand() to simplify things.
Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
>
all the best
--Colin
Aaron Meurer
I have prepared the Debian package for it, but Debian's ftp-master is
down currently, so it will take couple days until they fix it, so that
I can upload it. It will get into Ubuntu eventually too.
Ondrej
all the best
--cjc
On 31 Mar, 16:30, "Aaron S. Meurer" <asmeu...@gmail.com> wrote:
Ah, don't worry - as_real_imag() does the trick!
--cjc