Arg, of course. These symbols are always positive and I forgot to provide the assumptions kwarg. Sorry I forgot about this.
Thank you for the extra info on posify. I didn't know about this function. Best, Casey On Mon, Feb 20, 2012 at 1:11 AM, prateek papriwal <[email protected] > wrote: > also (a**2)**0.5 and (a)**1 are not the same things .. > > > On Mon, Feb 20, 2012 at 2:35 PM, Chris Smith <[email protected]> wrote: > >> Since such a transformation is not generally valid, it is disallowed >> (e.g. if a = -1 then your expression would give 1 while the "simplified" >> version would give -1). The transformation *is* valid if 'a' is positive, >> so you can either create a with a positive assumption >> >> >>> a = Symbol('a', positive=True) >> >>> (a**2)**.5 >> a >> >> or let posify handle the conversion: >> >> >>> eq >> (a**2)**0.5 >> >>> posify(eq) >> (_a**1.0, {_a: a}) >> >>> p, r = posify(eq); p.subs(r) >> a >> >> Chris >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sympy" 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?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "sympy" 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?hl=en. > -- You received this message because you are subscribed to the Google Groups "sympy" 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?hl=en.
