Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 1242 by [email protected]: Simplifying of complex exponentials
http://code.google.com/p/sympy/issues/detail?id=1242
I was toying around with the idea of converting trig functions to
exponentials for the purposes of
simplification, however the results of simplify appear to be non-optimal:
>>> x = Symbol('x')
>>> c = cos(x)._eval_rewrite_as_exp(x)
>>> t = tan(x)._eval_rewrite_as_exp(x)
>>> c * t
I*(1/2*exp(I*x) + 1/2*exp(-I*x))*(-exp(I*x) + exp(-I*x))/(exp(I*x) +
exp(-I*x))
>>> simplify(_)
>>> (2*I*exp(I*x) - 2*I*exp(5*I*x))/(4*exp(2*I*x) + 4*exp(4*I*x))
Although the simplification is valid, it is not the expected result. t * c
can be reduced quite
simply by hand if you first combine 1/2*exp(I*x) + 1/2*exp(-I*x) to give:
1/2*(exp(I*x) + exp(-I*x));
take the 1/2 'down' to give
I*(exp(I*x) + exp(-I*x))*(-exp(I*x) + exp(-I*x))/(2*(exp(I*x) + exp(-I*x)));
cancel exp(I*x) + exp(-I*x)
(I*(-exp(I*x) + exp(-I*x))) / 2;
which is our good old friend sin(x).
I am not sure exactly how the current simplify function works, but it would
be good if it could
'pick-up' on this case (and others similar).
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
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/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---