I know this way, but is there any way to change  this after symbol creation?

On Thursday, December 4, 2014 6:29:27 PM UTC+2, Ondřej Čertík wrote:
>
> On Thu, Dec 4, 2014 at 7:38 AM, Paul Royik <distan...@gmail.com 
> <javascript:>> wrote: 
> > Suppose that I have an expression 
> > 
> > e = x**2+sqrt(a**2*b**2) 
> > What is the best way to assign to expression assumption that all 
> variables 
> > are Positive, so that equivalent of e is x**2+ab? 
>
> It should be done like this: 
>
> In [11]: refine(e, Q.positive(a) & Q.positive(b)) 
> Out[11]: 
>         _______ 
>  2     ╱  2  2 
> x  + ╲╱  a ⋅b 
>
>
> But unfortunately that doesn't work. So the only other way is the old 
> way like this: 
>
> In [12]: a = Symbol("a", positive=True) 
>
> In [13]: b = Symbol("b", positive=True) 
>
> In [14]: x**2+sqrt(a**2*b**2) 
> Out[14]: 
>        2 
> a⋅b + x 
>
>
> Ondrej 
>

-- 
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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
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/0057f9b0-377e-4409-aee8-d8284e1e0f06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to