Status: Valid
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3793 by [email protected]: Integrate hangs
http://code.google.com/p/sympy/issues/detail?id=3793

Try this:

from sympy import var, integrate, pi, sin, S
var("x y z c L")
f = 12*pi**2*L**2*c**2*sin(pi*(2*L*c*x - c + S(1)/2))**2*sin(pi*(2*L*c*y - c + S(1)/2))**2*sin(pi*(2*L*c*z - c + S(1)/2))**2
i = integrate(f, (x, 0, L), (y, 0, L), (y, 0, L))

The integrate command "hangs" (probably just takes forever). But the structure of this expression really isn't that complicated, so I am not quite sure what is happening.

It hangs here when I hit ctrl-C:

Traceback (most recent call last):
  File "a.py", line 4, in <module>
    i = integrate(f, (x, 0, L), (y, 0, L), (y, 0, L))
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/utilities/decorator.py", line 25, in threaded_func
    return func(expr, *args, **kwargs)
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/integrals/integrals.py", line 1360, in integrate
    return integral.doit(deep = False, meijerg = meijerg, conds = conds)
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/integrals/integrals.py", line 734, in doit
    antideriv = self._eval_integral(function, xab[0], meijerg1)
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/integrals/integrals.py", line 998, in _eval_integral
    h = heurisch(g, x, hints=[])
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/integrals/risch.py", line 459, in heurisch result = heurisch(f, x, mappings=mappings, rewrite=rewrite, hints=hints, retries=retries-1) File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/integrals/risch.py", line 459, in heurisch result = heurisch(f, x, mappings=mappings, rewrite=rewrite, hints=hints, retries=retries-1) File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/integrals/risch.py", line 276, in heurisch
    result = heurisch(f, x, rewrite=True, hints=hints)
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/integrals/risch.py", line 434, in heurisch
    result = _integrate('Q')
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/integrals/risch.py", line 429, in _integrate
    solution = solve(equations.values(), *coeffs)
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/solvers/solvers.py", line 782, in solve
    solution = _solve_system(f, symbols, **flags)
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/solvers/solvers.py", line 1275, in _solve_system
    result = solve_linear_system(matrix, *symbols, **flags)
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/solvers/solvers.py", line 1684, in solve_linear_system
    matrix.row(k, lambda x, j: simplify(x - matrix[i, j]*coeff))
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/matrices/matrices.py", line 3680, in row
    self[i, j] = f(self[i, j], j)
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/solvers/solvers.py", line 1684, in <lambda>
    matrix.row(k, lambda x, j: simplify(x - matrix[i, j]*coeff))
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/simplify/simplify.py", line 2911, in simplify
    expr1 = cancel(expr0)
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/polys/polytools.py", line 5563, in cancel
    c, P, Q = F.cancel(G)
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/polys/polytools.py", line 3178, in cancel
    result = F.cancel(G, include=include)
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/polys/polyclasses.py", line 649, in cancel
    cF, cG, F, G = dmp_cancel(F, G, lev, dom, include=False)
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/polys/euclidtools.py", line 1884, in dmp_cancel
    _, p, q = dmp_inner_gcd(f, g, u, K)
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/polys/euclidtools.py", line 1587, in dmp_inner_gcd
    J, (f, g) = dmp_multi_deflate((f, g), u, K)
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/polys/densebasic.py", line 1356, in dmp_multi_deflate
    B[i] = igcd(B[i], m)
File "/nh/nest/u/ondrej/repos/python-hpcmp2/local/lib/python2.7/site-packages/sympy/core/numbers.py", line 93, in igcd
    return _gcdcache[(a,b)]
KeyboardInterrupt


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to