Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finding limits of sequences. #9836

Merged
merged 13 commits into from Sep 1, 2015
Merged

Finding limits of sequences. #9836

merged 13 commits into from Sep 1, 2015

Conversation

leosartaj
Copy link
Member

This PR implements the algorithm as defined in the poster "Computing Limits of Sequences" by Manuel Kauers.

This algorithm works fine for some simple functions and computes their limit at infinity which currently SymPy is unable to handle. However, it still needs work as it is not very robust and often fails. Admissible functions need to be carefully defined. This is a still a work in progress.

Ping @jcrist @flacjacket

@leosartaj
Copy link
Member Author

The poster does not explain the case when there is no unique dominant term. I have tried to get it working but have failed to come to a good solution. Currently in this case, the function returns None.

To clarify as to what to do in this case. I wrote an email to Manuel Kauers.

Hi,
I am a contributor to the SymPy(https://github.com/sympy/sympy) project. I am currently working on an implementation of the algorithm as described in the poster on Computing Limits of Sequences. However, the poster does not explain the case when there is not a unique a dominant term in an expression. Any pointers as to what to do in this case will be very helpful.

I am still waiting for a reply. If anybody else has any ideas, feel free to discuss.

@leosartaj
Copy link
Member Author

I got a reply to my email to Manuel Kauers.

Dear Sartaj,

sorry for the late reply. I am in China at the moment, and since China
blocks Google (and gmail), doing email is rather cumbersome.

It is nice to hear that you are implementing l'Hospital for sequences.
Unfortunately, there is no follow-up work for the case when there is
no unique dominant term. Of course when you have something like
(a+b)/c where a and b have the same order of growth, you can try to
compute the limits of a/c and b/c, and if you are lucky they are both
finite. But if they are not, you would need to compute some sort of
asymptotic expansion of a and b up to the first order at which they
differ, and then apply the algorithm to their difference.

Greetings from Beijing,
Manuel

@leosartaj
Copy link
Member Author

I am stuck in the last two xfailed test-cases. According to the paper these should be solvable, but the function gets stuck in infinite recursion. I have been unable to pin-point the exact cause. Maybe it has to do with limitations in automatic simplification.

@leosartaj leosartaj changed the title [WIP]Finding limits of infinite sequences. Finding limits of infinite sequences. Aug 20, 2015
@leosartaj
Copy link
Member Author

This is mostly ready for review now. @jcrist @flacjacket

@leosartaj leosartaj changed the title Finding limits of infinite sequences. Finding limits of sequences. Aug 24, 2015
@leosartaj leosartaj self-assigned this Aug 24, 2015

O = Order
dd = difference_delta
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather this wasn't shortened (short functions/variables may clash with user things).

@jcrist
Copy link
Member

jcrist commented Aug 25, 2015

Besides my comments above, this looks good to me.

* Add paramter section in docstring of limit_seq.
* Remove dd from the global namespace.
* Simple code cleanup.
@leosartaj
Copy link
Member Author

I have addressed the comments. Please have a look @jcrist.

@leosartaj
Copy link
Member Author

Can you please have a look @jcrist. I would like to submit this in my code sample.

@jcrist
Copy link
Member

jcrist commented Sep 1, 2015

Sorry for the delay. Looks good to me, thanks for your hard work! Merging.

jcrist added a commit that referenced this pull request Sep 1, 2015
Finding limits of sequences.
@jcrist jcrist merged commit 733da51 into sympy:master Sep 1, 2015
@leosartaj leosartaj deleted the limitseq branch September 2, 2015 07:40
@leosartaj
Copy link
Member Author

Thanks @jcrist for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants