sympy hangs when trying to solve a simple algebraic equation

后端 未结 2 1260
梦毁少年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.)

提交回复
热议问题