Strange behavior with solve and pi

47 views
Skip to first unread message

Jeremy Roberts

unread,
May 11, 2016, 4:27:35 PM5/11/16
to sympy
Hi all,

I've been using SymPy quite a bit as I prepare a basic course in numerical and symbolic computation for engineers.  Along the way, I hit a strange problem:

>>> from sympy import *
>>> a, b = symbols('a b')
>>> solve([pi**2*a-b, b-1], [a, b])


which leads to an error with a final message of

NotAlgebraic: pi doesn't seem to be an algebraic element

The same system is solved as expected with linsolve:

>>> linsolve([pi**2*a-b, b-1], a, b)
{(pi**(-2), 1)}


I understand that solve is on its way out (based on the documentation), but I thought it relevant to point out.  Is this a bug?  Something else?

Jeremy

Aaron Meurer

unread,
May 11, 2016, 6:54:12 PM5/11/16
to sy...@googlegroups.com
Yes, this looks like a bug. solve() shouldn't be raising any
exceptions other than NotImplementedError.

Aaron Meurer
> --
> 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 sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> 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/8e2964cc-3a2e-4726-a0ed-5d89567c02a8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages