[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-math] repeated series expansion
From: |
Ralf Hemmecke |
Subject: |
Re: [Axiom-math] repeated series expansion |
Date: |
Fri, 16 Jul 2010 14:08:26 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1 |
On 07/16/2010 12:52 PM, Vladimir Skokov wrote:
The problem is that my function contains logs, it is not just Taylor series.
For instance, I'd like to expand f(x,y)log(x) + g(x,y) at x=0, y=0.
So I expect to obtain
(expansion of f(x,y)) * log(x) + expansion of g(x,y)
Why don't people write exact specifications? The above is meaningless
unless you specify how your output should look like.
Do you want to have a taylor series in x which has coefficients being
taylor series in y? Or do you want the same with roles of x and y
exchanged? Or do you want a *univariate* power series whose coefficients
are (homogeneous) polynomials in x and y with a degree corresponding to
the degree of the power in the taylor series?
Specify exactly what you want otherwise nobody will be able to help you.
I am not willing to guess your specification.
e.g. for one variable "series" does a good job
series(sin(x)*log(x),x=0)
(5) ->
(5)
log(x) 3 log(x) 5 log(x) 7 log(x) 9 log(x) 11
log(x)x - ------ x + ------ x - ------ x + ------ x - -------- x
6 120 5040 362880 39916800
+
12
O(x )
Type: GeneralUnivariatePowerSeries(Expression
Integer,x,0)
However this is not Taylor series and therefore I cannot extract
coefficients as you specified.
????
Look at the type. So we have
(3) -> coefficient(s,1)
(3) log(x)
Type: Expression(Integer)
I agree, that this might not be what you expected, but that is the
problem with your input. You haven't exactly specified what you wanted.
Believe it or not, Axiom considers "log(x)" as a separate variable.
More natural would be something like
U := UnivariateTaylorSeries(Fraction Integer, 'x, 1)
x: U := x::U
log(x)
(3)
1 2 1 3 1 4 1 5 1
6
(x - 1) - - (x - 1) + - (x - 1) - - (x - 1) + - (x - 1) - - (x
- 1)
2 3 4 5 6
+
1 7 1 8 1 9 1 10 11
- (x - 1) - - (x - 1) + - (x - 1) - -- (x - 1) + O((x - 1) )
7 8 9 10
Type:
UnivariateTaylorSeries(Fraction(Integer),x,1)
Now the error message
(6) -> sin x
>> Error detected within library code:
"sincos: series expansion involves transcendental constants"
should be clear. The result is simply not representable, by a series
with just rational coefficients.
Try
V := UnivariateTaylorSeries(Expression Integer, 'y, 1)
y: V := y::V
sin(y)
sin(y)*log(y)
instead.
It all depends on what you want. AXIOM *is* different from other CAS.
Of course the example I have written is oversimplified. I do not know
the structure of the function, it can contain sin(log(x)) for example.
But you know what you want as a result.
Mathematica allows repeated series expansion, however it fails with
complicated expressions due to some memory limitation.
A Mathematica Series is a *truncated* series. Remove the initial terms
and all you are left with is an O(x^10) expression which will not
deliver any more coefficients. AXIOM's series really represent infinite
objects.
Ralf