For Aaron's case the expression is turned into

sin (Symbol )**(Integer (2 )('x' ))*Symbol ('x' )

For the original case the expression is turned into

Integer (10 )*sin (Symbol )**(Integer (120 )('x' ))*Symbol ('x' )**Integer 
(2 )+Integer (3 )*Symbol ('x' )*Symbol ('y' )*Symbol ('z' )+tan (Symbol 
('theta' ))

so the exponent/argument is not being properly captured. IIRC because this 
works at the token level it only handles the case where the exponent is 
something simple like just a symbol or integer, and not a product of 
symbols and integers. This might make sense to reimplement as an AST 
transformation instead, or otherwise the transformation would have to do 
some actual parsing of the tokens.

David

On Thursday, February 19, 2015 at 10:35:21 PM UTC-5, Aaron Meurer wrote:
>
> A simpler example is sin**(2*x) x. 
>
> Aaron Meurer 
>
> On Thu, Feb 19, 2015 at 1:44 AM, Paul Royik <[email protected] 
> <javascript:>> wrote: 
> > Just noticed, that official example works: 
> > from sympy.parsing.sympy_parser import (parse_expr, 
> > standard_transformations, implicit_multiplication_application) 
> > parse_expr("10sin**2 x**2 + 3xyz + tan 
> > theta",transformations=(standard_transformations 
> > +(implicit_multiplication_application,))) 
> > 
> > But 
> > parse_expr("10sin**(120*x) x**2 + 3xyz + tan 
> > theta",transformations=(standard_transformations 
> > +(implicit_multiplication_application,))) 
> > raises exception (see sine exponent): 
> > 
> > TypeError: unbound method could_extract_minus_sign() must be called with 
> > Symbol instance as first argument (got nothing instead) 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "sympy" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to [email protected] <javascript:>. 
> > To post to this group, send email to [email protected] 
> <javascript:>. 
> > Visit this group at http://groups.google.com/group/sympy. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/sympy/b88049b4-502a-4f00-9796-506188245ebe%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/37134ee3-dcc2-4ec2-aca4-6893af066d5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to