B
B
brubanter2015-09-22 23:00:13
Python
brubanter, 2015-09-22 23:00:13

Why doesn't SymPy calculate the system of equations?


import sympy
a,b = sympy.symbols('a,b')
equations = [sympy.Eq((9*a+b)%32,14), sympy.Eq((15*a+b)%32, 5)]
sympy.solve(equations)
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.4/site-packages/sympy/solvers/solvers.py" , line 911, in solve
solution = _solve_system(f, symbols, **flags)
File "/usr/local/lib/python3.4/site-packages/sympy/solvers/solvers.py", line 1646, in _solve_system
raise NotImplementedError('could not solve %s' % eq2)
NotImplementedError: could not solve Mod(9*a + b, 32) - 14

What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tsarevfs, 2015-09-23
@tsarevfs

Well, these are Diophantine equations, as far as I understand. There is a separate module for them .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question