25.02.2011 13:41, Chris Smith пишет:
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.
/c
Sorry, no.
I try to rewrite (more for me) again more exactly.
My soft objection was to define option "sudo" as default to be True.
End-user have not to know about internal methods (shifting or not) for
obtaining correct result on a whole, and about "sudo" option in particular.
In your example
h[2] >>> cos(x).series(x,1,n=2)
-x*sin(1) + cos(1) + O(x**2)
h[3] >>> cos(x).series(x,1,n=2,sudo=True)
(1 - x)*sin(1) + cos(1) + O((x - 1)**2)
result h[2] is incorrect and out of sense for end-user, but result h[3]
is valid.
I do not understand why you call valid result h[3] as special "unshifted
series" and was concentrated to this (special case is rather "shifted"
h[2], and only incorerct h[2] can be used for internal usage, I have do
mean it)
So I offer change:
def series(self, x=None, x0=0, n=6, dir="+", sudo=False):
...
to
def series(self, x=None, x0=0, n=6, dir="+", sudo=True):
...
at least formally.
This bring to:
h[2] >>> cos(x).series(x,1,n=2)
(1 - x)*sin(1) + cos(1) + O((x - 1)**2)
h[3] >>> cos(x).series(x,1,n=2,sudo=False)
-x*sin(1) + cos(1) + O(x**2)
so h[2] became correct now.
(more deeper also change name-token because it become something confused
meaning)
But:
It may be impossible (I think because of the architecture) or hard
(because of all calling of series() in core must be reformed).
So my objection was a kind of wanning rather.
Nevertheless, In any case, this all written is not principally because
of temporarily usage of this option in core (I hope until O((x - 1)**2)
will be enabled) and it is not worth the trouble.
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.