login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for TaylorSeries revision 4 of 8

1 2 3 4 5 6 7 8
Editor: Ralf Hemmecke
Time: 2014/08/24 08:52:59 GMT+0
Note:

changed:
-  In order to work with multivariate Taylor series one first
-  has to do a few preparation steps in order to create an
-  appropriate domain.
-
-  If you are not interested in a specific domain of multivariate
-  power series you can find a simpler solution below using a domain of
-  power series in infinitely many variables.
  Univariate !TaylorSeries

    FriCAS can deal with power series in a simple manner.

changed:
-Z==>Integer
-Q==>Fraction Z
-vl: List Symbol := [x,y]
-V==>OrderedVariableList vl
-E ==> DirectProduct(2, NonNegativeInteger)
-P==>SparseMultivariatePolynomial(Q, V)
-M==>TaylorSeries(Q,V,P)
-X:=monomial(1$M,x,1)
-Y:=monomial(1$M,y,1)
x:=taylor 'x
sinh(x)
\end{axiom}

    However, sometimes one wants to be more precise with the domain
    that the object lives in. If, for example, we don't want power
    series over the general expression domain as exemplified above,
    we can give the coefficient domain explicitly.

\begin{axiom}
Z ==> Integer
Q ==> Fraction Z
Ux ==> UnivariateTaylorSeries(Q, 'x, 0)
ux: Ux := 'x
sinh(ux)
\end{axiom}

  Combination of univariate !TaylorSeries

    The FriCAS interpreter is smart enough to create an appropriate
    type if two univariate Taylor series interact.

    However, as seen below, the resulting domain is something like
    $$Q[[x]][[y]],$$
    i.e., univariate power series in y with coefficients that are
    univariate power series in x that have rational coefficients.

\begin{axiom}
Uy ==> UnivariateTaylorSeries(Q, 'y, 0)
uy: Uy := 'y
cosh(uy)
sinh(ux)*cosh(uy)
\end{axiom}

    As a general rule, the FriCAS interpreter tries to find
    a "better coefficient domain" if something does not fit
    into the type of the current object in order to construct
    a more general domain that can hold the result of the operation.

    In the case above that is probably not what we expected or wanted.

  Multivariate !TaylorSeries in infinitely many variables

    There is a domain in FriCAS that is similar to the 'Polynomial(Q)' domain.
    'TaylorSeries(Q)' is the domain of power series over 'Q' in infinitely
    many variables.

    With that domain the input is as simple as for univariate power series.

\begin{axiom}
T ==> TaylorSeries Q
tx:T := 'x
ty:T := 'y
sinh(tx)*cosh(ty)
\end{axiom}

  Multivariate !TaylorSeries in two variables

    FriCAS allows to be more precise with multivariate power series.
    It is possible to create multivariate power series in a given
    number of variables. Such a construction is, however, a bit more
    involved.

    The domain (named 'M' below') is modelled as a univariate power series
    over bivariate polynomials where the n-th coefficient of the series is
    the polynomial consisting of all (bivariate) terms of degree n.

    Thus we first have to create a bivariate polynomial domain.
    From this construction, it should be clear how to create multivariate
    series in three or more variables.

\begin{axiom}
vl: List Symbol := ['x, 'y]
V ==> OrderedVariableList vl
P ==> SparseMultivariatePolynomial(Q, V)
M ==> SparseMultivariateTaylorSeries(Q, V, P)
X: M := monomial(1$M, 'x, 1)
Y: M := monomial(1$M, 'y, 1)

removed:
-
-From BillPage Fri Aug 22 21:19:19 +0000 2014
-From: Bill Page
-Date: Fri, 22 Aug 2014 21:19:19 +0000
-Subject: Naive solution
-Message-ID: <20140822211919+0000@axiom-wiki.newsynthesis.org>
-
-This is not what I expected:
-\begin{axiom}
-x:=taylor 'x
-y:=taylor 'y
-sinh(x)*cosh(y)
-\end{axiom}
-
-Can it be converted somehow to the solution above?
-
-Most simple solution
-
-  There is a domain in FriCAS that is similar to the 'Polynomial(Q)' domain,
-  i.e. 'TaylorSeries(Q)' is the domain of power series over 'Q' in infinitely many variables.
-
-  With that domain the input is as simple as above.
-
-\begin{axiom}
-T==>TaylorSeries Fraction Integer
-xx:T := 'x
-yy:T := 'y
-sinh(xx)*cosh(yy)
-\end{axiom}
-

Example for multivariate Taylor series expansion

Univariate TaylorSeries

FriCAS? can deal with power series in a simple manner.

fricas
x:=taylor 'x

\label{eq1}x(1)
Type: UnivariateTaylorSeries?(Expression(Integer),x,0)
fricas
sinh(x)

\label{eq2}x +{{1 \over 6}\ {{x}^{3}}}+{{1 \over{120}}\ {{x}^{5}}}+{{1 \over{5
040}}\ {{x}^{7}}}+{{1 \over{362880}}\ {{x}^{9}}}+{O \left({{x}^{11}}\right)}(2)
Type: UnivariateTaylorSeries?(Expression(Integer),x,0)

However, sometimes one wants to be more precise with the domain that the object lives in. If, for example, we don't want power series over the general expression domain as exemplified above, we can give the coefficient domain explicitly.

fricas
Z ==> Integer
Type: Void
fricas
Q ==> Fraction Z
Type: Void
fricas
Ux ==> UnivariateTaylorSeries(Q, 'x, 0)
Type: Void
fricas
ux: Ux := 'x

\label{eq3}x(3)
Type: UnivariateTaylorSeries?(Fraction(Integer),x,0)
fricas
sinh(ux)

\label{eq4}x +{{1 \over 6}\ {{x}^{3}}}+{{1 \over{120}}\ {{x}^{5}}}+{{1 \over{5
040}}\ {{x}^{7}}}+{{1 \over{362880}}\ {{x}^{9}}}+{O \left({{x}^{11}}\right)}(4)
Type: UnivariateTaylorSeries?(Fraction(Integer),x,0)

Combination of univariate TaylorSeries

The FriCAS? interpreter is smart enough to create an appropriate type if two univariate Taylor series interact.

However, as seen below, the resulting domain is something like

Q[[x]][[y]], 
i.e., univariate power series in y with coefficients that are univariate power series in x that have rational coefficients.

fricas
Uy ==> UnivariateTaylorSeries(Q, 'y, 0)
Type: Void
fricas
uy: Uy := 'y

\label{eq5}y(5)
Type: UnivariateTaylorSeries?(Fraction(Integer),y,0)
fricas
cosh(uy)

\label{eq6}1 +{{1 \over 2}\ {{y}^{2}}}+{{1 \over{24}}\ {{y}^{4}}}+{{1 \over{7
20}}\ {{y}^{6}}}+{{1 \over{40320}}\ {{y}^{8}}}+{{1 \over{3628
800}}\ {{y}^{10}}}+{O \left({{y}^{11}}\right)}(6)
Type: UnivariateTaylorSeries?(Fraction(Integer),y,0)
fricas
sinh(ux)*cosh(uy)

\label{eq7}\begin{array}{@{}l}
\displaystyle
x +{{1 \over 6}\ {{x}^{3}}}+{{1 \over{120}}\ {{x}^{5}}}+{{1 \over{5
040}}\ {{x}^{7}}}+{{1 \over{362880}}\ {{x}^{9}}}+{O \left({{x}^{11}}\right)}+ 
\
\
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
{{1 \over 2}\  x}+{{1 \over{12}}\ {{x}^{3}}}+{{1 \over{240}}\ {{x}^{5}}}+{{1 \over{10080}}\ {{x}^{7}}}+{{1 \over{725760}}\ {{x}^{9}}}+ 
\
\
\displaystyle
{O \left({{x}^{11}}\right)}
(7)
Type: UnivariateTaylorSeries?(UnivariateTaylorSeries?(Fraction(Integer),x,0),y,0)

As a general rule, the FriCAS? interpreter tries to find a "better coefficient domain" if something does not fit into the type of the current object in order to construct a more general domain that can hold the result of the operation.

In the case above that is probably not what we expected or wanted.

Multivariate TaylorSeries in infinitely many variables

There is a domain in FriCAS? that is similar to the Polynomial(Q) domain. TaylorSeries(Q) is the domain of power series over Q in infinitely many variables.

With that domain the input is as simple as for univariate power series.

fricas
T ==> TaylorSeries Q
Type: Void
fricas
tx:T := 'x

\label{eq8}x(8)
Type: TaylorSeries?(Fraction(Integer))
fricas
ty:T := 'y

\label{eq9}y(9)
Type: TaylorSeries?(Fraction(Integer))
fricas
sinh(tx)*cosh(ty)

\label{eq10}\begin{array}{@{}l}
\displaystyle
x +{\left({{1 \over 2}\  x \ {{y}^{2}}}+{{1 \over 6}\ {{x}^{3}}}\right)}+{\left({{1 \over{24}}\  x \ {{y}^{4}}}+{{1 \over{12}}\ {{x}^{3}}\ {{y}^{2}}}+{{1 \over{120}}\ {{x}^{5}}}\right)}+ 
\
\
\displaystyle
{\left({{1 \over{720}}\  x \ {{y}^{6}}}+{{1 \over{144}}\ {{x}^{3}}\ {{y}^{4}}}+{{1 \over{240}}\ {{x}^{5}}\ {{y}^{2}}}+{{1 \over{5
040}}\ {{x}^{7}}}\right)}+ 
\
\
\displaystyle
{\left({
\begin{array}{@{}l}
\displaystyle
{{1 \over{40320}}\  x \ {{y}^{8}}}+{{1 \over{4320}}\ {{x}^{3}}\ {{y}^{6}}}+{{1 \over{2880}}\ {{x}^{5}}\ {{y}^{4}}}+ 
\
\
\displaystyle
{{1 \over{10080}}\ {{x}^{7}}\ {{y}^{2}}}+{{1 \over{362880}}\ {{x}^{9}}}
(10)
Type: TaylorSeries?(Fraction(Integer))

Multivariate TaylorSeries in two variables

FriCAS? allows to be more precise with multivariate power series. It is possible to create multivariate power series in a given number of variables. Such a construction is, however, a bit more involved.

The domain (named M below') is modelled as a univariate power series over bivariate polynomials where the n-th coefficient of the series is the polynomial consisting of all (bivariate) terms of degree n.

Thus we first have to create a bivariate polynomial domain. From this construction, it should be clear how to create multivariate series in three or more variables.

fricas
vl: List Symbol := ['x, 'y]

\label{eq11}\left[ x , \: y \right](11)
Type: List(Symbol)
fricas
V ==> OrderedVariableList vl
Type: Void
fricas
P ==> SparseMultivariatePolynomial(Q, V)
Type: Void
fricas
M ==> SparseMultivariateTaylorSeries(Q, V, P)
Type: Void
fricas
X: M := monomial(1$M, 'x, 1)

\label{eq12}x(12)
Type: SparseMultivariateTaylorSeries?(Fraction(Integer),OrderedVariableList?([x,y]),SparseMultivariatePolynomial?(Fraction(Integer),OrderedVariableList?([x,y])))
fricas
Y: M := monomial(1$M, 'y, 1)

\label{eq13}y(13)
Type: SparseMultivariateTaylorSeries?(Fraction(Integer),OrderedVariableList?([x,y]),SparseMultivariatePolynomial?(Fraction(Integer),OrderedVariableList?([x,y])))
fricas
sinh(X)*cosh(Y)

\label{eq14}\begin{array}{@{}l}
\displaystyle
x +{\left({{1 \over 6}\ {{x}^{3}}}+{{1 \over 2}\ {{y}^{2}}\  x}\right)}+{\left({{1 \over{120}}\ {{x}^{5}}}+{{1 \over{12}}\ {{y}^{2}}\ {{x}^{3}}}+{{1 \over{24}}\ {{y}^{4}}\  x}\right)}+ 
\
\
\displaystyle
{\left({{1 \over{5040}}\ {{x}^{7}}}+{{1 \over{240}}\ {{y}^{2}}\ {{x}^{5}}}+{{1 \over{144}}\ {{y}^{4}}\ {{x}^{3}}}+{{1 \over{720}}\ {{y}^{6}}\  x}\right)}+ 
\
\
\displaystyle
{\left({
\begin{array}{@{}l}
\displaystyle
{{1 \over{362880}}\ {{x}^{9}}}+{{1 \over{10080}}\ {{y}^{2}}\ {{x}^{7}}}+{{1 \over{2880}}\ {{y}^{4}}\ {{x}^{5}}}+ 
\
\
\displaystyle
{{1 \over{4320}}\ {{y}^{6}}\ {{x}^{3}}}+{{1 \over{40320}}\ {{y}^{8}}\  x}
(14)
Type: SparseMultivariateTaylorSeries?(Fraction(Integer),OrderedVariableList?([x,y]),SparseMultivariatePolynomial?(Fraction(Integer),OrderedVariableList?([x,y])))