-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Order (and series) at point != 0 and oo #2427
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
Conversation
|
Add some examples to the docstring. |
|
Thanks a lot for working on this. Very useful and we should have it in sympy. |
|
The early commits in this pull request are from other pull requests, some of which are controversial (or at least I personally haven't been convinced that the mathematics are correct). Particularly for the derivative and the conjugation ones. Are they necessary for later commits? |
|
If so, let's finish the discussion on those and merge them first before we merge this one. |
|
I guess one of the reasons this has not been implemented yet is the difficulty in making |
|
Some more old mailing list discussions that might contain some useful information https://groups.google.com/forum/#!topic/sympy/Fa0Xp8w2LA8 https://groups.google.com/forum/#!topic/sympy/AlFy3-mmMBM (from #61). |
Yes, we can skip them here, if that is an issue.
Of course. |
|
Well, now I'm not so sure about the autoevaluation of Also, we can reproduce this "issue" in the master, e.g. |
|
Yes, let's leave it unevaluated. It's as easy as calling series() on the input again to get it to evaluate (we could even make it easier to call series again on an expression with an O() in it without all the arguments again somehow). |
|
This can't be merged. I guess because the other commits were merged separately. |
Fixed. Meantime, I've squashed some commits from others pulls (conjugation, derivatives). |
sympy/series/order.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change "XXX: can't do substitution in the multivariate Order symbol yet" -> "Substitution in multivariate Order symbols not implemented yet" or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, new and _eval_subs methods needs a cleanup, it's in todo.
|
Otherwise it looks good. Shouldn't you add more tests for this new functionality? Does this implement expansions about arbitrary points now? |
|
I'm still unsure about the conjugate and derivative changes (especially the conjugate one). |
|
On Fri, Sep 20, 2013 at 10:04:34AM -0700, Ondřej Čertík wrote:
May be.
Yes. But only at numeric point, one can't be symbolic, e.g. O(x - a). |
|
On Fri, Sep 20, 2013 at 10:14:44AM -0700, Aaron Meurer wrote:
This stuff was removed from the current pr. |
OK.
I didn't realize that. What needs to be implemented to support that? Multivariate order? |
I guess so. |
|
But why exactly is that? |
|
I agree with the comments that have already been mentioned, this looks pretty promising. |
Weel. The main reason, I think, is the syntax of Order() for this case. Currently we can't distinguish between O(expr, x, y), where x and This problem with the current O() syntax was noted above. Perhaps, This funny syntax was introduced in the commit 0b13b0f (by @jrioux) and |
|
Oh, I've only opted for this syntax to make it forward compatible, but I didn't expect that we would be extending this to arbitrary points. The syntax you suggests sounds reasonable, and we can still make it forward compatible: if only symbols are provided rather than (sym, point) pairs, take Zero as the extension point. |
|
For reference, the change was made in #2268 (the pull request might give more context). |
|
On Wed, Oct 30, 2013 at 02:31:52AM -0700, Julien Rioux wrote:
Ok. I'll try to patch this before the next release. |
|
BTW, I wonder if it's reasonable to keep the current multivariate May be it's a good idea to scrap all this and start with univariate |
|
Is there code that relies on the multivariate O? |
|
On Mon, Nov 04, 2013 at 08:23:10PM -0800, Aaron Meurer wrote:
There isn't. Also, it's not easy to imagine (for me) how |
|
Well assuming it is possible to make some actual (correct) computations on a multivariate order symbol, it could be useful. |
|
@mrocklin this is arguably one reason why we should release before the SciPy tutorial. It changes the series conventions at points != 0 (for example), to a way which is both less confusing, and backwards incompatible. What are your thoughts? |
|
We should merge this. It fixes a bug. So of course it is incompatible - Sent from my mobile phone.
|
Please explain a little. |
|
It's not really a printer, just a special ordering of Add that orders the terms in reverse when there is an O term present. But for the tan series I pasted, the x/3 term should go before the -pi/6, not at the end before the order. |
Order (and series) at point != 0 and oo
|
Can you update the release notes. |
Oh. I don't think this is possible. At least, unless we change Add to something more sophisticated, e.g. some stream-like structure to represent series expansion...
Sure. |
|
Thanks for fixing this Sergey! |
|
I don't think any special classes are needed. We just need to extend what is there to make it smarter. I opened #7623 for it. |
TODO:
Related issues: #7203, #7207, #7231 (partially)