On Wed, Dec 7, 2011 at 11:58 AM, Ronan Lamy <[email protected]> wrote:
> Le mercredi 07 décembre 2011 à 20:36 +0100, [email protected] a
> écrit :
>> How should assumptions be used? More precisely why the following code
>> does what it does
>>
>> In [18]: global_assumptions.clear()
>>
>> In [19]: x = Symbol('x', positive=True)
^^^ This is old assumptions, that will be eventually removed
>>
>> In [20]: ask(Q.positive(x)) # Why does it return None?
New assumptions.
>>
>> In [21]: x > 0
>> Out[21]: True
Old assumptions.
And so on. We need to write documentation how to use the new
assumptions. I hit the same problems. Here is an example:
+ >>> from sympy import var, solve, S, refine, Q
+ >>> var("a z")
+ (a, z)
+ >>> f = z / (a**2+z**2)**(S(5)/2)
+ >>> solve(f.diff(z), z)
+ [-a/2, a/2]
+ >>> f.subs(z, a/2)
+ 16*sqrt(5)*a/(125*(a**2)**(5/2))
+ >>> refine(f.subs(z, a/2), Q.positive(a))
+ 16*sqrt(5)/(125*a**4)
and we just need to document it well, then improve refine and other
things, and then eventually remove the old assumptions.
Ondrej
--
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.