On 06/15/2013 01:27 PM, Aaron Meurer wrote:
And more specifically, to simplify square roots, use refine
In [50]: refine(sqrt((x + 1)**2), Q.positive(x + 1))
Out[50]: x + 1
Aaron Meurer
On Sat, Jun 15, 2013 at 12:24 PM, Matthew Rocklin <[email protected]> wrote:
This is possible in new assumptions
In [1]: expr = x**2
In [2]: ask(Q.positive(expr + 1), Q.positive(expr))
Out[2]: True
On Sat, Jun 15, 2013 at 12:21 PM, Alan Bromborsky <[email protected]>
wrote:
In the latest build is there anyway to specify that the sympy
expression/function (not symbol) you are taking the sqrt of is real and
positive?
--
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.
For more options, visit https://groups.google.com/groups/opt_out.
--
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.
For more options, visit https://groups.google.com/groups/opt_out.
My problem is I don't know the form of g to start with, but I do know it
is always positive.
>>> g = a**2*sin(b)**2
>>> refine(sqrt(g), Q.positive(g))
Abs(a)*Abs(sin(b))
rather than a*sin(b).
Is it possible to get replace all the Abs in an expression with their
arguments?
--
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.
For more options, visit https://groups.google.com/groups/opt_out.