Alan Bromborsky wrote:
> Ondrej Certik wrote:
>   
>> Hi Alan!
>>
>> On Thu, Mar 26, 2009 at 6:15 AM, Alan Bromborsky <abro...@verizon.net> wrote:
>>   
>>     
>>> I have copied the trigsimp code from simplify.py and modified it to work
>>> with hyperbolic trig functions (see below).  I am not ready to submit it
>>> as a patch yet.  I want to get more complicated examples of hyperbolic
>>> trig simplification (ones that require the recursion option) and would
>>> also like to get examples that contain both trig and hyperbolic trig
>>> functions to see if sequential application of trigsimp and
>>> hyperbolicsimp would work and if the order of application is important.
>>> Would anyone who have any possible examples please post them (or just
>>> take the code below and run their own examples).
>>>     
>>>       
>> That is awesome, thanks a lot!
>>
>> There are lot's of examples in the curivlinear_coordinates.py demo,
>> just enable the more complicated tranforms, or define your own. Then
>> you get tons of expressios involving both trig and hyperbolic
>> functions, that sympy cannot yet simplify.
>>
>> Ondrej
>>
>>     
>>   
>>     
> It look like in curivlinear_coordinates.py your are not using the fact 
> that you are defining an orthogonal coordinating system to simplify the 
> calculation of g and g**(-1).  Is this correct?
>
> >
>
>   
Here is a trigsimp problem, although the problem is not really in trigsimp.

Run this code:

from sympy import *
x = Symbol('x')
y = Symbol('y')
s = sin(x)
c = cos(x)
S = sin(y)
C = cos(y)
e = (1-S**2)*(1+c)*(s**2+c**2)+C**2*(1-s**2)*c**3+C**2*(1-c**2)*c**3
e = expand(e)
print e
print trigsimp(e,deep=True,recursive=True)

and get:

sin(x)**2*cos(x) - sin(x)**2*sin(y)**2*cos(x) + cos(x)**2 + sin(x)**2 - 
cos(x)**2*sin(y)**2 -
     cos(x)**3*sin(y)**2 - cos(x)**5*cos(y)**2 - sin(x)**2*sin(y)**2 + 
2*cos(x)**3*cos(y)**2 -
     cos(x)**3*cos(y)**2*sin(x)**2 + cos(x)**3

(cos(x)**3)**(2/3)*cos(y)**2 - (cos(x)**3)**(5/3)*cos(y)**2 + 
3*cos(x)**3*cos(y)**2 +
     cos(x)**2*cos(y)**2*tan(x)**2 + cos(x)**5*cos(y)**2*tan(x)**4

The problem is expressions of the form: (cos(x)**3)**(5/3)
which probably prevent trigsimp from further simplification.  Is their 
any simple way to insure3
that (cos(x)**3)**(5/3) would be replaced by cos(x)**5!



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-patches" group.
To post to this group, send email to sympy-patches@googlegroups.com
To unsubscribe from this group, send email to 
sympy-patches+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sympy-patches?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to