On Wed, Feb 23, 2011 at 3:12 PM, Aaron S. Meurer <[email protected]> wrote:
>
> On Feb 23, 2011, at 3:32 PM, Alexander Eberspächer wrote:
>
> Hello,
>
> On Wednesday, February 23, 2011 10:13:24 PM UTC+1, asmeurer wrote:
>>
>> I agree.  1 + x + x**2/2 + O(x**3) is not a series.  A series would be
>> something like summation(x**n/factorial(n), (n, 0, oo)).  We don't have
>> anything like that implemented (though it would be awesome if we did).
>
> +1. Extremely useful. Also: +1 on Laurent series!

I think that:

1 + x + x**2/2 + O(x**3)

is a series expansion. So I like the method name series().

>
> Do you know of any algorithms do to this?  The only thing I can think of is
> to implement (for example with Taylor series) the most common cases (like
> exp(x), sin(x), etc.) and also the formulas for multiplying, adding, etc.
> series.  But maybe there is some more general method that involves
> generating and solving some recurrence relations.

Algorithm for what? Laurent series? I think that is already implemented:

>>> e = sin(x)/x**4
>>> e.series(x, 0, 5)
   1    1
- ─── + ── + O(x)
  6⋅x    3
        x
>>> e.series(x, 0, 10)
                   3       5
 x     1    1     x       x
─── - ─── + ── - ──── + ────── + O(x**6)
120   6⋅x    3   5040   362880
            x
>>> e.series(x, 0, 15)
                   3       5         7           9
 x     1    1     x       x         x           x
─── - ─── + ── - ──── + ────── - ──────── + ────────── + O(x**11)
120   6⋅x    3   5040   362880   39916800   6227020800
            x


>
> The expansion 1 + x + x**2/2 + O(x**3) would be called "truncated Taylor
> series of order 2".
>>
>> I think the answer is just to be clear in the docstring.
>
> Yes. However, if in doubt, I think the standard maths terminology is to
> prefer over the terminology used in other computer algebra systems.
>
> Another thing to consider is that the name "series" already exists in SymPy,
> and has for some time, so any changing would be a break in compatibility.
>  But I agree that we should only use other CASs as guides, not as rules for
> what we should do.

I would stick to series(), as a general method for calculating the
most general series expansion around a point. I think that it can be
well defined. And possibly adding a kwarg "method", with values
"taylor", "laurent", "asymptotic", or anything else, to restrict it,
so that for example (sin(x)/x**4).series(method="taylor") returns an
exception, rather than the Laurent series above.

Ondrej

-- 
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.

Reply via email to