19.03.2011 00:06, Aaron S. Meurer пишет:
On Mar 18, 2011, at 4:18 AM, Alexey U. Gudchenko wrote:
18.03.2011 12:42, Chris Smith пишет:
Hector wrote:
On Fri, Mar 18, 2011 at 4:57 AM, Aaron S. Meurer
<[email protected]> wrote:
For issue 2200, we didn't decide if limit(sin(x), x, oo)
should raise an error or should return nan (or something
else).
Hello everyone,
Hi Aaron, I was wondering why limit(sin(x),x,oo) should have
any other value than 0 ? Is it not equal to k/oo where k is
some finite number in [-1,1], which clearly tends to zero ?
It is sin(x), not sin(x)/x that has the problem. This continues
to oscillate between `+/-1` regardless of how large x becomes.
According strict mathematical definition of limits at infinity
limit in this case is not exists.
But, the nature aim of "limit" is the answer what is the behavior
of function in infinity. So the question is only to determine the
way how to tell to the user that sin(x) has arbitary value in range
[-1, 1].
I offer split into steps of realization:
1. If limit is not exist then return Non or something else It is
requirement.
2. If it is possible to known range ([-1, 1]) as in the sin(x) at
oo example, then return it. But it is enchantment.
-- Alexey U.
I agree that returning nan is better than raising an error.
As to returning the range, I think it requires some more thought. If
limit() return a Set object instead of an expression, then that might
break a lot of things that expect an expression.
Yes.
> Also, there are some other questions:
- How exactly are we defining the set returned. Is it a tight bound
set as the function goes to infinity, or is it just the closed set
[lim inf f(x), lim sup f(x)]? The two are the same if the function
is continuous, but for a counterexample, consider a combination of
two of the functions discussed in this thread, abs(sin(x))/sin(x).
This function takes on values of 1 and -1 forever to infinity. Would
limit(abs(sin(x))/sin(x)) return [-1, 1] or set([-1, 1])?
- Are there any algorithms to compute these things?
- What does the interface look like?
Aaron Meurer
Now in sympy:
In [1]: limit(sin(1/x), x, 0)
Out[1]: sin(oo)
In [2]: limit(sin(x), x, oo)
Out[2]: sin(oo)
Though it is incorrect (strictly saying limit is not exists
mathematically), but I see that some embryo intelligence present now too.
I think that when CAS (Matlab as I remember you said) return only
segment [-1, 1] it is more advertising of intelligence possibility than
pure mathematic.
I check Wolfram Alfa [1]: its result is more accurate. It returns that
limit is undefined, and it is essential singularity ([2], [3]) and
describe interval too.
I think that analytic about singularity will be useful in sympy too.
But I a still tend to destinguish it from pure mathematical limit()
procedure.
So I see a few similar variants:
# variant 1
>>> limit(sin(x), x, oo)
None
but there is method about singularity analysis (with classification of
it) in sympy, f.e.
>>> singularity(sin(x), x, oo)
Singularity(type="essential", interval=[-1, 1])
# variant 2
if limit is not exists then it return Singularity expression right
immediately
In both variant encapsulation of singularity analysis to singularity()
and Singularity class is used. So issue for singularity can be separeted
from limit (especially first).
About algorithms, first of all I think that Chris is more specialist
about it, I supposed that algorithm is combination of series's analysis and
some recurrent for interval (f.e. (sin(oo))**2 consecutively yield [0,
1]) involved.
[1] http://www.wolframalpha.com/input/?i=limit%28sin%28x%29%2C+x%2C+oo%29
[2] http://en.wikipedia.org/wiki/Classification_of_discontinuities
[3] http://en.wikipedia.org/wiki/Mathematical_singularity
--
Alexey U.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.