Re: [sympy] Assumptions in solve()

101 views
Skip to first unread message

Sudhanshu Mishra

unread,
Sep 23, 2015, 5:43:23 AM9/23/15
to sy...@googlegroups.com
Hi,

Assumptions on those symbols are not working?

e.g.

>>> V, r = symbols('V, r', positive=True)
>>> Do solve here




Sudhanshu Mishra

On Tue, Sep 22, 2015 at 10:20 PM, Justin <jbly...@gmail.com> wrote:
Hey,

So I am going through the advanced example in the tutorial: Solve for r given V=4/3 * pi * r**3.  

The solution is correct but I am wondering if I can get rid of unneeded solutions by giving a "list" of assumption like [ V>0, r>0 ].

Justin

--
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+un...@googlegroups.com.
To post to this group, send email to sy...@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/535aecc0-8bb5-4dba-b7bc-dd99ae83f852%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Justin

unread,
Sep 24, 2015, 1:15:16 AM9/24/15
to sympy
I deleted that post because I figured it out.  I actually made a commit in regards to adding documentation in solve() and really think more should be done on the documentation for flags.  See my pull request.

Coming from Mathematica and not extensively examining the symbol() documentation or (at the time) solve()'s source code it was not clear how to go about putting in assumptions in solve().  This shouldn't really matter for A=pi*r^2 stuff but when there are 100s of solutions then it's nice to weed some of them out, and really feel there should be a brief discussion in some of the functions in sympy/solvers on how to do that right out of the box to hit the ground running with complicated dsolve()s.  That is when people come to these kind of programs, that or undergrads in calc 1.

Regards,
Justin
Reply all
Reply to author
Forward
0 new messages