solve() is incapable of proving that solutions don't exist. If you get NotImplementedError or even an empty dictionary, it doesn't necessarily mean there are no solutions, only that it couldn't find any. solveset is capable of doing this, but it doesn't support systems yet.
I'm unsure if solve_poly_system returning None necessarily means that there are no solutions, as Kshitij suggests. It may be the case, but it isn't documented, so we would need to check the code to be sure. Aaron Meurer On Wed, Mar 16, 2016 at 8:43 AM, Sylvain Meunier <[email protected]> wrote: > Hello, > > I'm trying to prove the following system has no solution using sympy (one of > my first attempt to use sympy) : > > a_1 = Symbol('a_1') > a_2 = Symbol('a_2') > a_3 = Symbol('a_3') > a_4 = Symbol('a_4') > b_1 = Symbol('b_1') > b_2 = Symbol('b_2') > b_3 = Symbol('b_3') > b_4 = Symbol('b_4') > > system = [ > a_1*b_2 - a_2*b_1 - 1, > a_1*b_3 - a_3*b_1, > a_1*b_4 - a_4*b_1, > a_2*b_3 - a_3*b_2, > a_2*b_4 - a_4*b_2, > a_3*b_4 - a_4*b_3 - 1 > ] > > unknowns = [ > a_1, a_2, a_3, a_4, b_1, b_2, b_3, b_4 > ] > > result = solve(system, unknowns) > > I expect result would be an empty dictionary but an exception is raised : > > Traceback (most recent call last): > File "D:\Sandbox\galgebra\tests\test_chapter2.py", line 162, in test > R = solve(system, unknowns) > File > "D:\Tools\WinPython-2.7\python-2.7.10.amd64\lib\site-packages\sympy\solvers\solvers.py", > line 911, in solve > solution = _solve_system(f, symbols, **flags) > File > "D:\Tools\WinPython-2.7\python-2.7.10.amd64\lib\site-packages\sympy\solvers\solvers.py", > line 1522, in _solve_system > raise NotImplementedError('no valid subset found') > NotImplementedError: no valid subset found > > Best regards > > Sylvain > > -- > 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 https://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/3af4090c-6e34-455a-afc0-7e11bf39c172%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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 https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2B_Dn3STW1AE1Z2WXzPYqCvNnkVQ9BeUi5YUfzZwKThuw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
