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

Edit detail for SandBoxDoublePowerSeries revision 19 of 19

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Editor: Bill page
Time: 2014/08/30 21:32:47 GMT+0
Note:

changed:
-ans1:=eval(a0,sol.1)
ans0:=eval(a0,sol.1)
a1:=(-k[2]^2*sinh(k[1])/k[1]+k[1]^2*sinh(k[2])/k[2])/(k[1]^2-k[2]^2)
ans1:=eval(a1,sol.1)

fricas
a!

\label{eq1}a !(1)
Type: Variable(a!)
fricas
!:=operator '!

\label{eq2}!(2)
Type: BasicOperator?
fricas
a(i,j)==(1+(j-1)*i)/!(2*i+4*j)
Type: Void
fricas
a0:=matrix [[a(i,j)*k^i*l^j for i in 0..5] for j in 1..4]
fricas
Compiling function a with type (NonNegativeInteger, PositiveInteger)
       -> Expression(Integer)

\label{eq3}\left[ 
\begin{array}{cccccc}
{l \over{! \left({4}\right)}}&{{k \  l}\over{! \left({6}\right)}}&{{{{k}^{2}}\  l}\over{! \left({8}\right)}}&{{{{k}^{3}}\  l}\over{! \left({1
0}\right)}}&{{{{k}^{4}}\  l}\over{! \left({12}\right)}}&{{{{k}^{5}}\  l}\over{! \left({14}\right)}}
\
{{{l}^{2}}\over{! \left({8}\right)}}&{{2 \  k \ {{l}^{2}}}\over{! \left({10}\right)}}&{{3 \ {{k}^{2}}\ {{l}^{2}}}\over{! \left({1
2}\right)}}&{{4 \ {{k}^{3}}\ {{l}^{2}}}\over{! \left({14}\right)}}&{{5 \ {{k}^{4}}\ {{l}^{2}}}\over{! \left({16}\right)}}&{{6 \ {{k}^{5}}\ {{l}^{2}}}\over{! \left({18}\right)}}
\
{{{l}^{3}}\over{! \left({12}\right)}}&{{3 \  k \ {{l}^{3}}}\over{! \left({14}\right)}}&{{5 \ {{k}^{2}}\ {{l}^{3}}}\over{! \left({1
6}\right)}}&{{7 \ {{k}^{3}}\ {{l}^{3}}}\over{! \left({18}\right)}}&{{9 \ {{k}^{4}}\ {{l}^{3}}}\over{! \left({20}\right)}}&{{{11}\ {{k}^{5}}\ {{l}^{3}}}\over{! \left({22}\right)}}
\
{{{l}^{4}}\over{! \left({16}\right)}}&{{4 \  k \ {{l}^{4}}}\over{! \left({18}\right)}}&{{7 \ {{k}^{2}}\ {{l}^{4}}}\over{! \left({2
0}\right)}}&{{{10}\ {{k}^{3}}\ {{l}^{4}}}\over{! \left({22}\right)}}&{{{1
3}\ {{k}^{4}}\ {{l}^{4}}}\over{! \left({24}\right)}}&{{{16}\ {{k}^{5}}\ {{l}^{4}}}\over{! \left({26}\right)}}
(3)
Type: Matrix(Expression(Integer))
fricas
a(i:INT,j:INT):FRAC INT == (1+(j-1)*i)/Gamma(1+2*i+4*j)
Function declaration a : (Integer, Integer) -> Fraction(Integer) has been added to workspace. Compiled code for a has been cleared. 1 old definition(s) deleted for function or rule a
Type: Void
fricas
aa:DMP([k,l], FRAC INT) := 1+reduce(+,concat [[a(i,j)*k^i*l^j for i in 0..3] for j in 1..3])
fricas
Compiling function a with type (Integer, Integer) -> Fraction(
      Integer)

\label{eq4}\begin{array}{@{}l}
\displaystyle
{{1 \over{914624815104000}}\ {{k}^{3}}\ {{l}^{3}}}+{{1 \over{2
1794572800}}\ {{k}^{3}}\ {{l}^{2}}}+ 
\
\
\displaystyle
{{1 \over{3628800}}\ {{k}^{3}}\  l}+{{1 \over{4184557977600}}\ {{k}^{2}}\ {{l}^{3}}}+{{1 \over{159667200}}\ {{k}^{2}}\ {{l}^{2}}}+ 
\
\
\displaystyle
{{1 \over{40320}}\ {{k}^{2}}\  l}+{{1 \over{29059430400}}\  k \ {{l}^{3}}}+{{1 \over{1814400}}\  k \ {{l}^{2}}}+{{1 \over{7
20}}\  k \  l}+ 
\
\
\displaystyle
{{1 \over{479001600}}\ {{l}^{3}}}+{{1 \over{40320}}\ {{l}^{2}}}+{{1 \over{24}}\  l}+ 1 
(4)
Type: DistributedMultivariatePolynomial?([k,l],Fraction(Integer))
fricas
eval(aa,[k=0,l=l])

\label{eq5}{{1 \over{479001600}}\ {{l}^{3}}}+{{1 \over{40320}}\ {{l}^{2}}}+{{1 \over{24}}\  l}+ 1(5)
Type: DistributedMultivariatePolynomial?([k,l],Polynomial(Fraction(Integer)))
fricas
eval(aa,[k=k,l=0])

\label{eq6}1(6)
Type: DistributedMultivariatePolynomial?([k,l],Polynomial(Fraction(Integer)))
fricas
eval(aa,[k=1.0,l=1.0])

\label{eq7}1.0431059938 \<u> 809735313(7)
Type: Polynomial(Float)
fricas
eval(aa,[k=0,l=0])

\label{eq8}1(8)
Type: DistributedMultivariatePolynomial?([k,l],Polynomial(Fraction(Integer)))
fricas
eval(aa,[k=-1,l=-1])::Float

\label{eq9}0.9597219508 \<u> 1267275382(9)
Type: Float

fricas
x:TaylorSeries FRAC INT
Type: Void
fricas
y:TaylorSeries FRAC INT
Type: Void
fricas
cos(x*y)+sinh(x*y)+cosh(x*y)*sinh(x*y)

\label{eq10}1 +{2 \  x \  y}-{{1 \over 2}\ {{x}^{2}}\ {{y}^{2}}}+{{5 \over 6}\ {{x}^{3}}\ {{y}^{3}}}+{{1 \over{24}}\ {{x}^{4}}\ {{y}^{4}}}+{{{17}\over{120}}\ {{x}^{5}}\ {{y}^{5}}}+{O \left({11}\right)}(10)
Type: TaylorSeries(Fraction(Integer))

Q: Why doesn't this work?

fricas
cosh(sqrt x)
>> Error detected within library code: ^: rational power does not exist

Because sqrt(x) does not have a Taylor series. Even though cosh(sqrt(x)) does have a Taylor series, it can not be constructed this way.

Ans: Use GSERIES

fricas
x:GeneralUnivariatePowerSeries(FRAC INT,'x,0)
Type: Void
fricas
cosh(sqrt x)

\label{eq11}1 +{{1 \over 2}\  x}+{{1 \over{24}}\ {{x}^{2}}}+{{1 \over{720}}\ {{x}^{3}}}+{{1 \over{40320}}\ {{x}^{4}}}+{{1 \over{3628800}}\ {{x}^{5}}}+{O \left({{x}^{{11}\over 2}}\right)}(11)
Type: GeneralUnivariatePowerSeries?(Fraction(Integer),x,0)
fricas
poly(s,n)==reduce(+,[ [(i.c)*variable(s)^(i.k) for i in terms s].j for j in 1..n])
Type: Void
fricas
poly(sinh(sqrt x),5)
fricas
Compiling function poly with type (GeneralUnivariatePowerSeries(
      Fraction(Integer),x,0), PositiveInteger) -> Expression(Integer)

\label{eq12}{{\left({{x}^{4}}+{{72}\ {{x}^{3}}}+{{3024}\ {{x}^{2}}}+{{604
80}\  x}+{362880}\right)}\ {\sqrt{x}}}\over{362880}(12)
Type: Expression(Integer)

fricas
y:GeneralUnivariatePowerSeries(GeneralUnivariatePowerSeries(FRAC INT,'x,0),'y,0)
Type: Void
fricas
poly2(ss,n,m)==reduce(+,[ [poly(i.c,n)*variable(ss)^(i.k) for i in terms ss].j for j in 1..m])
Type: Void
fricas
poly2((2*cosh(sqrt x)-x)*sinh(sqrt y)/sqrt(y),3,4)::DMP(['x,'y],FRAC INT)
fricas
Compiling function poly2 with type (GeneralUnivariatePowerSeries(
      GeneralUnivariatePowerSeries(Fraction(Integer),x,0),y,0), 
      PositiveInteger, PositiveInteger) -> Expression(Integer)

\label{eq13}\begin{array}{@{}l}
\displaystyle
{{1 \over{1814400}}\ {{x}^{3}}\ {{y}^{3}}}+{{1 \over{43200}}\ {{x}^{3}}\ {{y}^{2}}}+{{1 \over{2160}}\ {{x}^{3}}\  y}+{{1 \over{3
60}}\ {{x}^{3}}}+ 
\
\
\displaystyle
{{1 \over{60480}}\ {{x}^{2}}\ {{y}^{3}}}+{{1 \over{1440}}\ {{x}^{2}}\ {{y}^{2}}}+{{1 \over{72}}\ {{x}^{2}}\  y}+{{1 \over{12}}\ {{x}^{2}}}+{{1 \over{2520}}\ {{y}^{3}}}+ 
\
\
\displaystyle
{{1 \over{60}}\ {{y}^{2}}}+{{1 \over 3}\  y}+ 2 
(13)
Type: DistributedMultivariatePolynomial?([x,y],Fraction(Integer))

fricas
eq1:=(l=-4*(k[1]*k[2])^2)::EQ EXPR INT

\label{eq14}l = -{4 \ {{k_{1}}^{2}}\ {{k_{2}}^{2}}}(14)
Type: Equation(Expression(Integer))
fricas
eq2:=(k=k[1]^2+k[2]^2)::EQ EXPR INT

\label{eq15}k ={{{k_{2}}^{2}}+{{k_{1}}^{2}}}(15)
Type: Equation(Expression(Integer))
fricas
sol:=solve([eq1,eq2],[k[1],k[2]]); # sol

\label{eq16}8(16)
Type: PositiveInteger?
fricas
sol.1

\label{eq17}\left[{{k_{1}}= -{{\sqrt{{\sqrt{l +{{k}^{2}}}}+ k}}\over{\sqrt{2}}}}, \:{{k_{2}}= -{{\sqrt{-{\sqrt{l +{{k}^{2}}}}+ k}}\over{\sqrt{2}}}}\right](17)
Type: List(Equation(Expression(Integer)))
fricas
a0:=(-k[2]^2*cosh(k[1])+k[1]^2*cosh(k[2]))/(k[1]^2-k[2]^2)

\label{eq18}{-{{{k_{1}}^{2}}\ {\cosh \left({k_{2}}\right)}}+{{{k_{2}}^{2}}\ {\cosh \left({k_{1}}\right)}}}\over{{{k_{2}}^{2}}-{{k_{1}}^{2}}}(18)
Type: Expression(Integer)
fricas
ans0:=eval(a0,sol.1)

\label{eq19}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left({\sqrt{l +{{k}^{2}}}}- k \right)}\ {\cosh \left({{\sqrt{{\sqrt{l +{{k}^{2}}}}+ k}}\over{\sqrt{2}}}\right)}}+ 
\
\
\displaystyle
{{\left({\sqrt{l +{{k}^{2}}}}+ k \right)}\ {\cosh \left({{\sqrt{-{\sqrt{l +{{k}^{2}}}}+ k}}\over{\sqrt{2}}}\right)}}
(19)
Type: Expression(Integer)
fricas
a1:=(-k[2]^2*sinh(k[1])/k[1]+k[1]^2*sinh(k[2])/k[2])/(k[1]^2-k[2]^2)

\label{eq20}{-{{{k_{1}}^{3}}\ {\sinh \left({k_{2}}\right)}}+{{{k_{2}}^{3}}\ {\sinh \left({k_{1}}\right)}}}\over{{{k_{1}}\ {{k_{2}}^{3}}}-{{{k_{1}}^{3}}\ {k_{2}}}}(20)
Type: Expression(Integer)
fricas
ans1:=eval(a1,sol.1)

\label{eq21}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left({\sqrt{l +{{k}^{2}}}}- k \right)}\ {\sqrt{-{\sqrt{l +{{k}^{2}}}}+ k}}\ {\sinh \left({{\sqrt{{\sqrt{l +{{k}^{2}}}}+ k}}\over{\sqrt{2}}}\right)}}+ 
\
\
\displaystyle
{{\left({\sqrt{l +{{k}^{2}}}}+ k \right)}\ {\sqrt{{\sqrt{l +{{k}^{2}}}}+ k}}\ {\sinh \left({{\sqrt{-{\sqrt{l +{{k}^{2}}}}+ k}}\over{\sqrt{2}}}\right)}}
(21)
Type: Expression(Integer)

fricas
interpret(eval(ans1,[k='x,l='y])::InputForm)
>> Error detected within library code: ^ rational power of coefficient undefined

fricas
)lib GDRAW
OldGnuDraw is now explicitly exposed in frame initial OldGnuDraw will be automatically loaded when needed from /var/aw/var/LatexWiki/GDRAW.NRLIB/GDRAW gnuDraw(ans1,k=-30..60,l=-30..30,"SandBoxDoublePowerSeries1.dat",title=="Generating Function")
fricas
Compiling function %C with type (DoubleFloat, DoubleFloat) -> 
      DoubleFloat
Type: Void

[terminal=pslatex,terminaloptions=color,scale=1.3]
set view 60, 30, 0.85, 1.1
set samples 20, 20
set isosamples 21, 21
set contour base
set cntrparam levels auto 20
set xlabel "k axis" 
set ylabel "l axis" 
load "SandBoxDoublePowerSeries1.dat"