Ask Your Question
1

Existence of a limit

asked 2012-07-18 07:04:23 +0100

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-07-18 09:25:09 +0100

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
edit flag offensive delete link more

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 ( 2012-07-18 10:06:14 +0100 )edit

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 ( 2012-07-18 10:27:52 +0100 )edit

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 ( 2012-07-18 10:35:02 +0100 )edit

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

kcrisman gravatar imagekcrisman ( 2012-07-18 10:36:20 +0100 )edit

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

Mathemage gravatar imageMathemage ( 2012-07-18 11:01:12 +0100 )edit

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: 2012-07-18 07:04:23 +0100

Seen: 1,289 times

Last updated: Jul 18 '12