sympy hangs when trying to solve a simple algebraic equation

后端 未结 2 1256
梦毁少年i
梦毁少年i 2021-01-21 00:42

I recently reinstalled my python environment and a code that used to work very quickly now creeps at best (usually just hangs taking up more and more memory).

The point

相关标签:
2条回答
  • 2021-01-21 01:13

    The rational=False flag was introduced for such cases as this.

    >>> q=14.7296138519
    >>> solve(exp(-alpha * q**2) - 0.01, alpha, rational=False)
    [0.0212257459123917]
    

    (The explanation is given in the issue cited above.)

    0 讨论(0)
  • 2021-01-21 01:19

    Rolling back from version 0.7.2 to 0.7.1 solved this problem.

    easy_install sympy==0.7.1
    

    I've reported this as a bug to sympy's google code.

    0 讨论(0)
提交回复
热议问题