25.02.2011 16:03, Ronan Lamy пишет:
Le vendredi 25 février 2011 à 16:26 +0545, Chris Smith a écrit :
Alexey U. Gudchenko wrote:
25.02.2011 08:59, Alexey U. Gudchenko пишет:
Conversely, internal calling of series method therefore must be with
option (..., somthing_hack=True) if it options is needed.
If you mean that something internal wants the unshifted series, then
yes sudo=True should be used and the O term removed. This would be the
same thing as getting the shifted series, removing the O term and
doing the substitution yourself of `s.removeO().subs(x, x-x0)`.
So if there are no objections, I'll commit this in about 5 hours.
Wait. I don't think that adding yet another option is a good idea,
particularly when its purpose is to choose between two bad workarounds.
And 'sudo' is a bad name anyway.
Excuse me,
> choose between two bad workarounds.
Why f.e. this variant:
> h[2]>>> cos(x).series(x,1,n=2)
> (1 - x)*sin(1) + cos(1) + O((x - 1)**2)
is bad ?
(except canonical representation of series, and your remarks that it is
"asymptotic expansion" indeed, not series)
I.
If there are problems with O((x - 1)**2) and its behavior then problem
is there in O((x - 1)**2) itself.
Generaly, I can obtain so called "asymptotic expansion" manually without
usage of series.
>>> 1 + x + O(x**2)
1 + x + O(x**2)
and I can use operation with this
>>> ae = 1 + x + O(x**2)
>>> (ae * ae).expand()
1 + 2*x + O(x**2)
This way I can operate with "asymptotic expansion" expression manually
(without any knowlage of series).
And it is needed to support x0 in O(x) too. Though, now even constructor
of Order do not permit to specify x0 point, but suppose that it does,
first of all simply as object property, even without right
representation or behavior.
First step.
Then Chris can have all the rights to use this constructor of O for
final result of series
Second step.
And other problems (which are concerned with operations with "asymptotic
expansion" expression resulted by "series()", or concerned with
operations with O() and even concerned with representations of O()) -
they will be encapsulated in O, because they will be raised with
manually usage "asymptotic expansion" itself too.
Third step - solve problems with O() and "asymptotic expansion" at the
point x0.
I do not consider now the cases with 1/oo or rational powers, but they
will be separated by the same way, with remarks that various kind of
classes may be defined probably.
And I warn, about third step that the problems with O itself and with
operations by "asymptotic expansion" expression in manually mode will be
hard, (without of series structure knowledge). On the other hand
problems with "series()" Chris's work will be logically and tactical
separated.
II.
if you mean that ".series()" it is "asymptotic expansion" indeed, not
series, then it is another question.
I wrote earlier some remarks, offers and its arguments, that work with
"asymptotic expansion" can be executed in parallel mode.
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.