Skip to content

Commit

Permalink
Merge pull request #22005 from praneethratna/21999_polysys
Browse files Browse the repository at this point in the history
solvers - fixes issue #21999 and solve_poly_system returns correct output for some equations.
  • Loading branch information
smichr committed Sep 2, 2021
2 parents 2c83657 + 33f2d66 commit 3b03b95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sympy/solvers/polysys.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ def _solve_reduced_system(system, gens, entry=False):

univariate = list(filter(_is_univariate, basis))

if len(basis) < len(gens):
raise NotImplementedError(filldedent('''
only zero-dimensional systems supported
(finite number of solutions)
'''))

if len(univariate) == 1:
f = univariate.pop()
else:
Expand Down
5 changes: 5 additions & 0 deletions sympy/solvers/tests/test_polysys.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def test_solve_poly_system():
[z, -2*x*y**2 + x + y**2*z, y**2*(-z - 4) + 2]))
raises(PolynomialError, lambda: solve_poly_system([1/x], x))

raises(NotImplementedError, lambda: solve_poly_system(
[x-1,], (x, y)))
raises(NotImplementedError, lambda: solve_poly_system(
[y-1,], (x, y)))


def test_solve_biquadratic():
x0, y0, x1, y1, r = symbols('x0 y0 x1 y1 r')
Expand Down

0 comments on commit 3b03b95

Please sign in to comment.