Le samedi 23 avril 2011 à 06:29 +0545, Chris Smith a écrit :
>
> nseries is allowed to give (quickly) something close to the request.
> It may not. series used to not give what was requested. Now it tries
> to and raises an error if it can't. What it needs is a method of
> knowing when the 6 terms *cannot* be computed and shouldn't be
> expected.
It seems difficult do know when the term *cannot* be computed, and I'm
not sure it is what is asked by the user. If it cannot be computed, the
ValueError still makes sense.
Another strategy seems possible, and I think, simple enough for me to
program. However, I'm not a programmer, and I don't know sympy well
enough to know if my idea is stupid or not.
I think about a parameter to series() to manually tell it should only
return the best result obtained so far instead of raising an error ?
Something like
def series(self, x=None, x0=0, n=6, dir="+", nstrict=True)
where inputting nstrict=False would not raise an error, while
nstrict=True keeps the current behaviour.
Another more general possibility would be to introduce an nmin
parameter, defaulting to n. series() then tries to compute the expansion
up to O(x**n) but raises a ValueError only if it does not manage to
reach O(x**nmin).
What would be the preferred solution ?
Frédéric
--
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.