Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve: GeneratorsNeeded with system involving constant equation #20610

Closed
oscarbenjamin opened this issue Dec 15, 2020 · 1 comment · Fixed by #20773
Closed

Solve: GeneratorsNeeded with system involving constant equation #20610

oscarbenjamin opened this issue Dec 15, 2020 · 1 comment · Fixed by #20773
Labels

Comments

@oscarbenjamin
Copy link
Contributor

I don't think solve should convert all equations to Poly because it can be slow but at least there should be some checking for this case:

>>> from sympy import *
>>> from sympy.abc import x, y
>>> solve([x + y, sqrt(2)], [x, y])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/enojb/current/sympy/sympy/sympy/solvers/solvers.py", line 1099, in solve
    solution = _solve_system(f, symbols, **flags)
  File "/Users/enojb/current/sympy/sympy/sympy/solvers/solvers.py", line 1774, in _solve_system
    subsol = _solve_system(subexpr, subsyms, **flags)
  File "/Users/enojb/current/sympy/sympy/sympy/solvers/solvers.py", line 1805, in _solve_system
    poly = g.as_poly(*symbols, extension=True)
  File "/Users/enojb/current/sympy/sympy/sympy/core/expr.py", line 1109, in as_poly
    poly = Poly(self, *gens, **args)
  File "/Users/enojb/current/sympy/sympy/sympy/polys/polytools.py", line 162, in __new__
    return cls._from_expr(rep, opt)
  File "/Users/enojb/current/sympy/sympy/sympy/polys/polytools.py", line 292, in _from_expr
    return cls._from_dict(rep, opt)
  File "/Users/enojb/current/sympy/sympy/sympy/polys/polytools.py", line 229, in _from_dict
    raise GeneratorsNeeded(
sympy.polys.polyerrors.GeneratorsNeeded: can't initialize from 'dict' without generators
@ForceBru
Copy link

This is still present as of SymPy 1.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants