{"action":"created","issue":{"url":"https://api.github.com/repos/sympy/sympy/issues/9673","labels_url":"https://api.github.com/repos/sympy/sympy/issues/9673/labels{/name}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/9673/comments","events_url":"https://api.github.com/repos/sympy/sympy/issues/9673/events","html_url":"https://github.com/sympy/sympy/issues/9673","id":94775644,"number":9673,"title":"solve([k + m, k + m*exp(-6.28*k)], [k, m]) hangs","user":{"login":"asmeurer","id":71486,"avatar_url":"https://avatars.githubusercontent.com/u/71486?v=3","gravatar_id":"","url":"https://api.github.com/users/asmeurer","html_url":"https://github.com/asmeurer","followers_url":"https://api.github.com/users/asmeurer/followers","following_url":"https://api.github.com/users/asmeurer/following{/other_user}","gists_url":"https://api.github.com/users/asmeurer/gists{/gist_id}","starred_url":"https://api.github.com/users/asmeurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmeurer/subscriptions","organizations_url":"https://api.github.com/users/asmeurer/orgs","repos_url":"https://api.github.com/users/asmeurer/repos","events_url":"https://api.github.com/users/asmeurer/events{/privacy}","received_events_url":"https://api.github.com/users/asmeurer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-13T17:57:00Z","updated_at":"2015-07-16T03:47:06Z","closed_at":null,"body":"As reported on the mailing list https://groups.google.com/forum/#!topic/sympy/q-PFfax0YmU.\r\n\r\nHere is what happens when keyboard interrupting\r\n\r\n```\r\nIn [17]: solution2= solve([k + m*exp(-k*0), k + m*exp(-k*6.28)],[k,m])\r\n^C---------------------------------------------------------------------------\r\nKeyboardInterrupt                         Traceback (most recent call last)\r\n<ipython-input-17-ad4d0c7c0b30> in <module>()\r\n----> 1 solution2= solve([k + m*exp(-k*0), k + m*exp(-k*6.28)],[k,m])\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/solvers/solvers.py in solve(f, *symbols, **flags)\r\n   1034         solution = _solve(f[0], *symbols, **flags)\r\n   1035     else:\r\n-> 1036         solution = _solve_system(f, symbols, **flags)\r\n   1037\r\n   1038     #\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/solvers/solvers.py in _solve_system(exprs, symbols, **flags)\r\n   1773                 for s in ok_syms:\r\n   1774                     try:\r\n-> 1775                         soln = _solve(eq2, s, **flags)\r\n   1776                     except NotImplementedError:\r\n   1777                         continue\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/solvers/solvers.py in _solve(f, *symbols, **flags)\r\n   1589         flags.pop('tsolve', None)  # allow tsolve to be used on next pass\r\n   1590         try:\r\n-> 1591             soln = _tsolve(f_num, symbol, **flags)\r\n   1592             if soln is not None:\r\n   1593                 result = soln\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/solvers/solvers.py in _tsolve(eq, sym, **flags)\r\n   2468             f = factor(powdenest(lhs - rhs))\r\n   2469             if f.is_Mul:\r\n-> 2470                 return _solve(f, sym, **flags)\r\n   2471             if rhs:\r\n   2472                 f = logcombine(lhs, force=flags.get('force', True))\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/solvers/solvers.py in _solve(f, *symbols, **flags)\r\n   1311         result = set()\r\n   1312         for m in f.args:\r\n-> 1313             soln = _solve(m, symbol, **flags)\r\n   1314             result.update(set(soln))\r\n   1315         result = list(result)\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/solvers/solvers.py in _solve(f, *symbols, **flags)\r\n   1600\r\n   1601     if flags.get('simplify', True):\r\n-> 1602         result = list(map(simplify, result))\r\n   1603         # we just simplified the solution so we now set the flag to\r\n   1604         # False so the simplification doesn't happen again in checksol()\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/simplify/simplify.py in simplify(expr, ratio, measure, fu)\r\n    501                     str(terms), str(symbol))\r\n    502                 )\r\n--> 503\r\n    504             result = parse_expression(terms, symbol)\r\n    505\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/functions/elementary/exponential.py in _eval_simplify(self, ratio, measure)\r\n    609         if (len(self.args) == 2):\r\n    610             return simplify(self.func(*self.args), ratio=ratio, measure=measure)\r\n--> 611         expr = self.func(simplify(self.args[0], ratio=ratio, measure=measure))\r\n    612         expr = expand_log(expr, deep=True)\r\n    613         return min([expr, self], key=measure)\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/simplify/simplify.py in simplify(expr, ratio, measure, fu)\r\n    554     Examples\r\n    555     ========\r\n--> 556\r\n    557     >>> from sympy.simplify import rcollect\r\n    558     >>> from sympy.abc import x, y\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/simplify/trigsimp.py in trigsimp(expr, **opts)\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/simplify/trigsimp.py in <lambda>(x)\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/simplify/trigsimp.py in futrig(e, **kwargs)\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/simplify/simplify.py in bottom_up(rv, F, atoms, nonbasic)\r\n    916             c, d, allsol = _ratsimpmodprime(c, d, allsol, N - steps, D)\r\n    917\r\n--> 918         return c, d, allsol\r\n    919\r\n    920     # preprocessing. this improves performance a bit when deg(num)\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/simplify/trigsimp.py in <lambda>(x)\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/simplify/trigsimp.py in _futrig(e, **kwargs)\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/strategies/core.py in minrule(expr)\r\n    115     objective = kwargs.get('objective', identity)\r\n    116     def minrule(expr):\r\n--> 117         return min([rule(expr) for rule in rules], key=objective)\r\n    118     return minrule\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/strategies/core.py in <listcomp>(.0)\r\n    115     objective = kwargs.get('objective', identity)\r\n    116     def minrule(expr):\r\n--> 117         return min([rule(expr) for rule in rules], key=objective)\r\n    118     return minrule\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/strategies/core.py in chain_rl(expr)\r\n     42     def chain_rl(expr):\r\n     43         for rule in rules:\r\n---> 44             expr = rule(expr)\r\n     45         return expr\r\n     46     return chain_rl\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/strategies/core.py in minrule(expr)\r\n    115     objective = kwargs.get('objective', identity)\r\n    116     def minrule(expr):\r\n--> 117         return min([rule(expr) for rule in rules], key=objective)\r\n    118     return minrule\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/strategies/core.py in <listcomp>(.0)\r\n    115     objective = kwargs.get('objective', identity)\r\n    116     def minrule(expr):\r\n--> 117         return min([rule(expr) for rule in rules], key=objective)\r\n    118     return minrule\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/simplify/trigsimp.py in <lambda>(x)\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/simplify/trigsimp.py in _eapply(func, e, cond)\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/function.py in _mexpand(expr, recursive)\r\n   2006\r\n   2007 # These are simple wrappers around single hints.\r\n-> 2008\r\n   2009\r\n   2010 def expand_mul(expr, deep=True):\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/function.py in expand_multinomial(expr, deep)\r\n   2048     Wrapper around expand that only uses the log hint.  See the expand\r\n   2049     docstring for more information.\r\n-> 2050\r\n   2051     Examples\r\n   2052     ========\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/expr.py in expand(self, deep, modulus, power_base, power_exp, mul, log, multinomial, basic, **hints)\r\n   2914                 hint = '_eval_expand_' + hint\r\n   2915                 expr, hit = Expr._expand_hint(expr, hint, deep=deep, **hints)\r\n-> 2916\r\n   2917         while True:\r\n   2918             was = expr\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/expr.py in _expand_hint(expr, hint, deep, **hints)\r\n   2847             for arg in expr.args:\r\n   2848                 arg, arghit = Expr._expand_hint(arg, hint, **hints)\r\n-> 2849                 hit |= arghit\r\n   2850                 sargs.append(arg)\r\n   2851\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/expr.py in _expand_hint(expr, hint, deep, **hints)\r\n   2855         if hasattr(expr, hint):\r\n   2856             newexpr = getattr(expr, hint)(**hints)\r\n-> 2857             if newexpr != expr:\r\n   2858                 return (newexpr, True)\r\n   2859\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/power.py in _eval_expand_multinomial(self, **hints)\r\n    845                 from sympy import multinomial_coefficients\r\n    846                 from sympy.polys.polyutils import basic_from_dict\r\n--> 847                 expansion_dict = multinomial_coefficients(len(p), n)\r\n    848                 # in our example: {(3, 0): 1, (1, 2): 3, (0, 3): 1, (2, 1): 3}\r\n    849                 # and now construct the expression.\r\n\r\n/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/ntheory/multinomial.py in multinomial_coefficients(m, n)\r\n    172             if t[k]:\r\n    173                 t[k] -= 1\r\n--> 174                 v += r[tuple(t)]\r\n    175                 t[k] += 1\r\n    176         t[0] -= 1\r\n\r\nKeyboardInterrupt:\r\n```\r\n\r\nSo it is another instance of fu doing way too much and being really slow (I wonder if the expression even has trig functions in it). "},"comment":{"url":"https://api.github.com/repos/sympy/sympy/issues/comments/121819603","html_url":"https://github.com/sympy/sympy/issues/9673#issuecomment-121819603","issue_url":"https://api.github.com/repos/sympy/sympy/issues/9673","id":121819603,"user":{"login":"asmeurer","id":71486,"avatar_url":"https://avatars.githubusercontent.com/u/71486?v=3","gravatar_id":"","url":"https://api.github.com/users/asmeurer","html_url":"https://github.com/asmeurer","followers_url":"https://api.github.com/users/asmeurer/followers","following_url":"https://api.github.com/users/asmeurer/following{/other_user}","gists_url":"https://api.github.com/users/asmeurer/gists{/gist_id}","starred_url":"https://api.github.com/users/asmeurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmeurer/subscriptions","organizations_url":"https://api.github.com/users/asmeurer/orgs","repos_url":"https://api.github.com/users/asmeurer/repos","events_url":"https://api.github.com/users/asmeurer/events{/privacy}","received_events_url":"https://api.github.com/users/asmeurer/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T03:47:06Z","updated_at":"2015-07-16T03:47:06Z","body":"It's probably both. I remember seeing that fu was calling some expensive stuff a while back that was causing some performance issues (the @sympy/mechanics guys may remember the specifics), and I don't think it was ever fixed. "}}