solve for polynomial equation runs endless

55 views
Skip to first unread message

Arnaud Usciati

unread,
Jan 30, 2015, 8:27:35 AM1/30/15
to sy...@googlegroups.com
Hello,

I try to find solutions for : 8.99*x*(-x + 1)**1.9 + 3.1*(-x + 1)**2.1 - 3.1*(-x + 1)**2.9 == 0
I use >>> solve(8.99*x*(-x + 1)**1.9 + 3.1*(-x + 1)**2.1 - 3.1*(-x + 1)**2.9, x) but it runs endless !!!!

Any ideas to fix it ?

PS : sorry for my english, i'm french :)

Aaron Meurer

unread,
Jan 31, 2015, 2:51:45 PM1/31/15
to sy...@googlegroups.com
Is this in the latest version of SymPy? For me, it returns [0.0, 1.0] after a few seconds.

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 http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/c2cdcafa-ec7b-41f0-9b15-2c5d1104fe8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arnaud Usciati

unread,
Feb 11, 2015, 3:54:40 AM2/11/15
to sy...@googlegroups.com
I use sympy-0.7.6.win32.
I tried it with a faster computer and it returns that : 

solve(8.99*x*(-x + 1)**1.9 + 3.1*(-x + 1)**2.1 - 3.1*(-x + 1)**2.9, x)
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    solve(8.99*x*(-x + 1)**1.9 + 3.1*(-x + 1)**2.1 - 3.1*(-x + 1)**2.9, x)
  File "C:\Python34\lib\site-packages\sympy\solvers\solvers.py", line 909, in solve
    solution = _solve(f[0], *symbols, **flags)
  File "C:\Python34\lib\site-packages\sympy\solvers\solvers.py", line 1218, in _solve
    u = unrad(f_num)
  File "C:\Python34\lib\site-packages\sympy\solvers\solvers.py", line 2885, in unrad
    neq = unrad(eq, *syms, cov=cov, dens=dens, n=len(rterms), rpt=rpt, take=_take)
  File "C:\Python34\lib\site-packages\sympy\solvers\solvers.py", line 2885, in unrad
    neq = unrad(eq, *syms, cov=cov, dens=dens, n=len(rterms), rpt=rpt, take=_take)
  File "C:\Python34\lib\site-packages\sympy\solvers\solvers.py", line 2781, in unrad
    eq = _mexpand(eq)
  File "C:\Python34\lib\site-packages\sympy\simplify\sqrtdenest.py", line 13, in _mexpand
    return expand_mul(expand_multinomial(expr))
  File "C:\Python34\lib\site-packages\sympy\core\function.py", line 2006, in expand_multinomial
    power_base=False, basic=False, multinomial=True, log=False)
  File "C:\Python34\lib\site-packages\sympy\core\cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "C:\Python34\lib\functools.py", line 458, in wrapper
    result = user_function(*args, **kwds)
  File "C:\Python34\lib\site-packages\sympy\core\expr.py", line 2871, in expand
    expr, hit = Expr._expand_hint(expr, hint, deep=deep, **hints)
  File "C:\Python34\lib\site-packages\sympy\core\expr.py", line 2804, in _expand_hint
    arg, arghit = Expr._expand_hint(arg, hint, **hints)
  File "C:\Python34\lib\site-packages\sympy\core\expr.py", line 2804, in _expand_hint
    arg, arghit = Expr._expand_hint(arg, hint, **hints)
  File "C:\Python34\lib\site-packages\sympy\core\expr.py", line 2812, in _expand_hint
    newexpr = getattr(expr, hint)(**hints)
  File "C:\Python34\lib\site-packages\sympy\core\power.py", line 819, in _eval_expand_multinomial
    expansion_dict = multinomial_coefficients(len(p), n)
  File "C:\Python34\lib\site-packages\sympy\ntheory\multinomial.py", line 145, in multinomial_coefficients
    return dict(multinomial_coefficients_iterator(m, n))
  File "C:\Python34\lib\site-packages\sympy\ntheory\multinomial.py", line 237, in multinomial_coefficients_iterator
    t1 = _tuple(t)
MemoryError

Aaron Meurer

unread,
Feb 11, 2015, 4:51:53 PM2/11/15
to sy...@googlegroups.com
Sorry, I must have tried in the git version, not 0.7.6. I see the same
thing in 0.7.6, but it works fine in the git master.

Aaron Meurer
> https://groups.google.com/d/msgid/sympy/9bb8b46d-d005-4c49-95c2-bbafdc05cdcc%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages