24.02.2011 03:10, Ondrej Certik пишет:
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:
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...
Ondrej
I supposed that name-token "series" was arised traditionally in the
historical way of CASs.
At first step there was a function that return series for the aim to
find it out, to learn it, to view of its terms (more exactly to view
coefficients of it), but it is obviously that computer machine can't
represent this terms infinitely on the screen, so it printed only some
terms and finished by "+ ..." f.e. ("1 + x + x^2/2 + ..."). So parameter
"n" was used for representation only.
Then it was improved, by adding the operations to work with the
truncated part (first n terms), in the beginning it was implemented as
operations by ordinary polynomials ("1 + x + x^2/2") (parameter "n" was
used for truncation to convert to polynomials). Then on the next step as
the series object (for performance aim also) , and on this step it was
required enhancement to track reminder part with the O(x) notation and
behavior. Also "..." was replaced by this one.
So at the end "series" turn into "asymptotic expansion". But at the same
time internal representation of Series (tracking of coefficients as
array) was saved too, and (I call attention) that "asymptotic expansion"
in this case not ordinary expression with O(x) but have internal
structure inherited from Series.
It is my estimates, I have not work with dinosaur CASs with series or do
not remember. but I see the rudiments and can explain them so as I written.
BTW, Sympy also begin this historical way, but the first step ("+ ...")
was omitted as I know.
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).
Generally, coefficients of the series can be represented not always by
formulas. So instead of "summation(a(n)* x**n/factorial(n), (n, 0, oo))"
(I have added "a(n)" to this example), the series object can be written
originally as "Series( exp(x), x0)" only (compare with Derivative).
And only if it is known that, Series can be represented as some
summation, then it can be shown (trough the some method logically).
More over, Series can be defined not from the function expansion, but
trough the manually definition of coefficients (by formula, or array in
the case of truncated "asymptotic expansion").
Then, I have seen that Ronan told about fields and ring structure of
series (infinity summations). So I having a right to ask is it planned
to consider Series (infinity case) with some operation with each other?
In the case of infinity summations, I do not realize how to use formulas
(aplyed upon coefficients f.e.) to do this because of infinity , and I
do not realize the usage of those operations exactly (may be only in the
case if formula of coefficients a(n) is known).
So my opinion do not create Serias class (infinity case), right now at
least.
Well, now I have come to conclusion that there are three kinds of
series/asymptotic expansion:
1) "Series" (infinity case)
This represent infinity summation, can be obtained from
function or manually defined by coefficients formula.
2) "asymptotic expansion" but with the saving of structure of Series.
It is truncated series. It can be obtained from function or
manually defined by coefficients formula or finite array, or it can be
obtaioned from "Series" expr.
And though it is really asymptotic expansion, but it maintain
series structure, for simplicity and perfomance of operations.
3) "asymptotic expansion" without maintaining structure of Series,
that is ordinary sympy expression with general O(x) term.
It can be obtained by the ways as writen before, but also can be
totaly defined as expr with the O term manually.
All three cases conected with each other in one way (forward only): the
last can be derived from the previous.
BTW, now in sympy the way is implemented so, that the 3) obtained
immediately with omitting previous steps (but they assumes).
> 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...
>
> Ondrej
>
In any case transformations with "series" name-token must be with careful.
All tests in many branches will be corrupted.
And also end user, who was accustomed to traditional meaning, can be
confused.
I propose to construct "asymptotic expansion", "Series" and so on in the
parallel mode (with other names token). Finally, (as variant) after
producing of them, then it can be applied as separate transaction to
reform traditional ".series" in a way just to use only the results of
"asymptotic expansion", "Series" and so on.
> 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
>
I again chose the point of view as the end-user aims.
When I ask sympy for "series()" I mean "I do not know about various
names of series, please give me something, show me what you can do
intellectually". So "series()" do additional distribution job.
The result of this method yield specific series (I vote that it must be
separated classes "SeriesTeylor" and so on, so first of all I can see
what kind of series is returned, also implementation and behavior of
them are various).
Of course, some expresion can be written as variouse types of series
(Furrier or Taylor). Or I want to so specify more exactly what I need.
So I agree that it can be kwarg "method" and exception if it can't exists.
And I have some little question about Laurent.
exp(1/x).series(x, oo) = 1 + 1/x + 1/(2*x**2) ...
Is it Laurent or power series?
--
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.