Re: repeated series expansion

Vladimir Skokov <[email protected]> Fri, 16 Jul 2010 16:10:17 +0200
Newsgroups gmane.comp.mathematics.axiom.general
Message-ID <[email protected]>
--===============1649266451==
Content-Type: multipart/alternative; boundary=0015175cd7f27ae4e3048b81c815

--0015175cd7f27ae4e3048b81c815
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Dear Ralf,
thank you for help! I have got program working.
I am sorry for being annoying, but I only start using axiom.
Thank you ;)

On Fri, Jul 16, 2010 at 2:08 PM, Ralf Hemmecke <[email protected]> wrote:

> 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=3D0, y=3D0.
>> 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 exchang=
ed?
> 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=3D0)
>> (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 proble=
m
> 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 :=3D UnivariateTaylorSeries(Fraction Integer, 'x, 1)
> x: U :=3D 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 :=3D UnivariateTaylorSeries(Expression Integer, 'y, 1)
> y: V :=3D 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 an=
d
> 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
>
>
> _______________________________________________
> Axiom-math mailing list
> [email protected]
> http://lists.nongnu.org/mailman/listinfo/axiom-math
>



--=20

_____________________________________________

Dr. Vladimir Skokov

Theory Division
GSI Helmholtzzentrum f=FCr Schwerionenforschung GmbH
Planckstra=DFe 1
D-64291 Darmstadt
------------------------------------------------------------------------
email:   [email protected]
phone: +49 6159-71 2751
fax  :    +49 6159-71 2990

--0015175cd7f27ae4e3048b81c815
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Dear=A0Ralf,=A0<div>thank you for help! I have got program working.=A0</div=
><div>I am sorry for being=A0annoying, but I only start using axiom.=A0</di=
v><div>Thank you ;) =A0<br><br><div class=3D"gmail_quote">On Fri, Jul 16, 2=
010 at 2:08 PM, Ralf Hemmecke <span dir=3D"ltr">&lt;<a href=3D"mailto:ralf@=
hemmecke.de">[email protected]</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;"><div class=3D"im">On 07/16/2010 12:52 PM, V=
ladimir Skokov wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
The problem is that my function contains logs, it is not just Taylor series=
.<br>
</blockquote>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
For instance, I&#39;d like to =A0expand f(x,y)log(x) + g(x,y) at x=3D0, y=
=3D0.<br>
So I expect to obtain<br>
 =A0(expansion of f(x,y)) * log(x) + expansion of g(x,y)<br>
</blockquote>
<br></div>
Why don&#39;t people write exact specifications? The above is meaningless u=
nless you specify how your output should look like.<br>
<br>
Do you want to have a taylor series in x which has coefficients being taylo=
r 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 p=
ower in the taylor series?<br>


<br>
Specify exactly what you want otherwise nobody will be able to help you.<br=
>
I am not willing to guess your specification.<div class=3D"im"><br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
e.g. for one variable &quot;series&quot; does a good job<br>
series(sin(x)*log(x),x=3D0)<br>
(5) -&gt;<br>
 =A0 =A0(5)<br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0log(x) =A03 =A0 log(x) =A05 =A0 log(x) =A07=
 =A0 log(x) =A09 =A0 =A0log(x) =A0 11<br>
 =A0 =A0 =A0log(x)x - ------ x =A0+ ------ x =A0- ------ x =A0+ ------ x =
=A0- -------- x<br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 6 =A0 =A0 =A0 =A0 =A0120 =A0 =A0 =A0 =
=A05040 =A0 =A0 =A0 362880 =A0 =A0 =A039916800<br>
 =A0 =A0+<br>
 =A0 =A0 =A0 =A0 12<br>
 =A0 =A0 =A0O(x =A0)<br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Type: GeneralUnivariatePowerSeries(=
Expression<br>
Integer,x,0)<br>
</blockquote>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
However this is not Taylor series and therefore I cannot extract<br>
coefficients as you specified.<br>
</blockquote>
<br></div>
????<br>
<br>
Look at the type. So we have<br>
<br>
(3) -&gt; coefficient(s,1)<br>
<br>
 =A0 (3) =A0log(x)<br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Type: =
Expression(Integer)<br>
<br>
I agree, that this might not be what you expected, but that is the problem =
with your input. You haven&#39;t exactly specified what you wanted.<br>
Believe it or not, Axiom considers &quot;log(x)&quot; as a separate variabl=
e.<br>
<br>
More natural would be something like<br>
<br>
U :=3D UnivariateTaylorSeries(Fraction Integer, &#39;x, 1)<br>
x: U :=3D x::U<br>
log(x)<br>
<br>
 =A0 (3)<br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 1 =A0 =A0 =A0 =A02 =A0 1 =A0 =A0 =A0 =A03 =A0 =
1 =A0 =A0 =A0 =A04 =A0 1 =A0 =A0 =A0 =A05 =A0 1 =A0 =A0 =A06<br>
 =A0 =A0 (x - 1) - - (x - 1) =A0+ - (x - 1) =A0- - (x - 1) =A0+ - (x - 1) =
=A0- - (x - 1)<br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 2 =A0 =A0 =A0 =A0 =A0 =A03 =A0 =A0 =A0 =A0 =A0=
 =A04 =A0 =A0 =A0 =A0 =A0 =A05 =A0 =A0 =A0 =A0 =A0 =A06<br>
 =A0 +<br>
 =A0 =A0 1 =A0 =A0 =A0 =A07 =A0 1 =A0 =A0 =A0 =A08 =A0 1 =A0 =A0 =A0 =A09 =
=A0 =A01 =A0 =A0 =A0 =A010 =A0 =A0 =A0 =A0 =A0 =A011<br>
 =A0 =A0 - (x - 1) =A0- - (x - 1) =A0+ - (x - 1) =A0- -- (x - 1) =A0 + O((x=
 - 1) =A0)<br>
 =A0 =A0 7 =A0 =A0 =A0 =A0 =A0 =A08 =A0 =A0 =A0 =A0 =A0 =A09 =A0 =A0 =A0 =
=A0 =A0 =A010<br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Type: UnivariateTaylorS=
eries(Fraction(Integer),x,1)<br>
<br>
Now the error message<br>
<br>
<br>
(6) -&gt; sin x<br>
<br>
 =A0 &gt;&gt; Error detected within library code:<br>
 =A0 &quot;sincos: series expansion involves transcendental constants&quot;=
<br>
<br>
<br>
should be clear. The result is simply not representable, by a series with j=
ust rational coefficients.<br>
<br>
Try<br>
<br>
V :=3D UnivariateTaylorSeries(Expression Integer, &#39;y, 1)<br>
y: V :=3D y::V<br>
sin(y)<br>
sin(y)*log(y)<br>
<br>
instead.<br>
<br>
It all depends on what you want. AXIOM *is* different from other CAS.<div c=
lass=3D"im"><br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Of course the example I have written is oversimplified. I do not know<br>
the structure of the function, it can contain sin(log(x)) for example.<br>
</blockquote>
<br></div>
But you know what you want as a result.<div class=3D"im"><br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Mathematica allows repeated series expansion, however it fails with<br>
complicated expressions due to some memory limitation.<br>
</blockquote>
<br></div>
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 m=
ore coefficients. AXIOM&#39;s series really represent infinite objects.<br>

<font color=3D"#888888">
<br>
Ralf</font><div><div></div><div class=3D"h5"><br>
<br>
_______________________________________________<br>
Axiom-math mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">Axiom-math@nongn=
u.org</a><br>
<a href=3D"http://lists.nongnu.org/mailman/listinfo/axiom-math" target=3D"_=
blank">http://lists.nongnu.org/mailman/listinfo/axiom-math</a><br>
</div></div></blockquote></div><br><br clear=3D"all"><br>-- <br><br>_______=
______________________________________<br><br>Dr. Vladimir Skokov<br><br>Th=
eory Division<br>GSI Helmholtzzentrum f=FCr Schwerionenforschung GmbH<br>Pl=
anckstra=DFe 1<br>

D-64291 Darmstadt<br>------------------------------------------------------=
------------------<br>email:=A0=A0 [email protected]<br>phone: +49 6159-71 27=
51<br>fax=A0 :=A0 =A0 +49 6159-71 2990<br>
</div>

--0015175cd7f27ae4e3048b81c815--


--===============1649266451==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Axiom-math mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/axiom-math

--===============1649266451==--