Ask Your Question
1

Existence of a limit

asked 12 years ago

Mathemage gravatar image

How does one (i.e. automatically in an own program) recognize existence of a limit?

So far I've discovered that -oo, oo, ind, und cause the non-existence, I just dunno how to test these "values". Obvious

if limit(f, x=oo, dir='+') == und:
  ...

does not work...

Sage 5.1 Kubuntu 12.04

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 12 years ago

twch gravatar image

Hi as far as I understand the problem is that oo so on are symbolic expressios. If you try to compare them with == sage returns as a new symbolic expression the symbolic equationion:

var('x,y')
print x==y
print type(x==y)

returns

x == y
<type 'sage.symbolic.expression.Expression'>

A soultion seems to be to cast the symbolic equation to a boolean:

print bool(x==y)
print bool(x==x)

which returns

False
True
Preview: (hide)
link

Comments

1

Unfortunately, `ind` is unknown to sage for some reason: sage: bool( lim(sin(x), x=oo) == ind) --------------------------------------------------------------------------- NameError Traceback (most recent call last) NameError: name 'ind' is not defined

Mathemage gravatar imageMathemage ( 12 years ago )

I dont know if this is the correct way to fix this problem (I'm also no expert with these symbolic expression) but print bool(SR('ind')==limit(sin(x),x=oo)) Seems to solve the problem for me.

twch gravatar imagetwch ( 12 years ago )

Hmm, that's true. We allow it as a result from Maxima for e.g. lim(sin(1/x),x=0) or your example, but I guess we just print it out. I've made this http://trac.sagemath.org/sage_trac/ticket/13269, though I'm not sure what exactly could be done.

kcrisman gravatar imagekcrisman ( 12 years ago )

@Tobias; that doesn't really solve the problem, though it probably is good enough for some of the checking purposes.

kcrisman gravatar imagekcrisman ( 12 years ago )

ThanX, the `SR('ind')` *hack* solved my problem :-)

Mathemage gravatar imageMathemage ( 12 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 12 years ago

Seen: 1,434 times

Last updated: Jul 18 '12