Skip to content

Commit

Permalink
Merge pull request #21602 from shashankks0987/nonlinsolve
Browse files Browse the repository at this point in the history
Fix: Bug in nonlinsolve
  • Loading branch information
smichr committed Jun 11, 2021
2 parents a185e95 + 9617133 commit eec3dd6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sympy/solvers/solveset.py
Expand Up @@ -3119,7 +3119,7 @@ def _append_eq(eq, result, res, delete_soln, n=None):
u = Dummy('u')
if n:
eq = eq.subs(n, 0)
satisfy = checksol(u, u, eq, minimal=True)
satisfy = eq if eq in (True, False) else checksol(u, u, eq, minimal=True)
if satisfy is False:
delete_soln = True
res = {}
Expand Down
2 changes: 2 additions & 0 deletions sympy/solvers/tests/test_solveset.py
Expand Up @@ -1581,6 +1581,8 @@ def test_nonlinsolve_basic():
assert nonlinsolve([x**2 -1], sin(x)) == FiniteSet((S.EmptySet,))
assert nonlinsolve([x**2 -1], 1) == FiniteSet((x**2,))
assert nonlinsolve([x**2 -1], x + y) == FiniteSet((S.EmptySet,))
assert nonlinsolve([Eq(1, x + y), Eq(1, -x + y - 1), Eq(1, -x + y - 1)], x, y) == FiniteSet(
(-S.Half, 3*S.Half))


def test_nonlinsolve_abs():
Expand Down

0 comments on commit eec3dd6

Please sign in to comment.