没有 Sympy 的两侧限制? [英] No Sympy two-sided limits?
问题描述
我无法让 Sympy 处理两侧限制.在 Jupyter notebook 中运行,Anaconda 安装:
from sympy import *x = 符号('x')限制(1/x,x,0)
给出了oo
的答案.此外,
限制(1/x,x,0)
打印为右侧限制.事实上,我所有的两侧限制都漂亮地打印"为右侧限制.他们似乎也被这样评价.找不到强制双面的方法.当然,我们可以编写一个简短的程序来解决这个问题.
我做错了什么?
limit
有第四个参数,dir
,它指定一个方向:
默认是从右边开始.双向限制尚未直接实施,但您可以轻松检查两个方向.
I can't get Sympy to handle two-sided limits. Running in a Jupyter notebook, Anaconda installation:
from sympy import *
x = symbols('x')
limit(1/x,x,0)
gives an answer of oo
. Furthermore,
Limit(1/x,x,0)
prints as a right-sided limit. In fact, all of my two-sided limits 'pretty-print' as right-sided limits. They seem to be evaluated that way, too. Can't find a way to force two-sided. Of course, one could write a short program to remedy this.
What am I doing wrong?
limit
has a fourth argument, dir
, which specifies a direction:
>>> limit(1/x, x, 0, '+')
oo
>>> limit(1/x, x, 0, '-')
-oo
>>> limit(1/x, x, 0)
oo
The default is from the right. Bidirectional limits are not directly implemented yet, but you can easily check both directions.
这篇关于没有 Sympy 的两侧限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!