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

fricas
a!
 (1)
Type: Variable(a!)
fricas
!:=operator '!
 (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)
 (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
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
)
 (4)
Type: DistributedMultivariatePolynomial?([k,l],Fraction(Integer))
fricas
eval(aa,[k=0,l=l])
 (5)
Type: DistributedMultivariatePolynomial?([k,l],Polynomial(Fraction(Integer)))
fricas
eval(aa,[k=k,l=0])
 (6)
Type: DistributedMultivariatePolynomial?([k,l],Polynomial(Fraction(Integer)))
fricas
eval(aa,[k=1.0,l=1.0])
 (7)
Type: Polynomial(Float)
fricas
eval(aa,[k=0,l=0])
 (8)
Type: DistributedMultivariatePolynomial?([k,l],Polynomial(Fraction(Integer)))
fricas
eval(aa,[k=-1,l=-1])::Float
 (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)
 (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)
 (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)
 (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)
 (13)
Type: DistributedMultivariatePolynomial?([x,y],Fraction(Integer))

fricas
eq1:=(l=-4*(k[1]*k[2])^2)::EQ EXPR INT
 (14)
Type: Equation(Expression(Integer))
fricas
eq2:=(k=k[1]^2+k[2]^2)::EQ EXPR INT
 (15)
Type: Equation(Expression(Integer))
fricas
sol:=solve([eq1,eq2],[k[1],k[2]]); # sol
 (16)
Type: PositiveInteger?
fricas
sol.1
 (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)
 (18)
Type: Expression(Integer)
fricas
ans0:=eval(a0,sol.1)
 (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)
 (20)
Type: Expression(Integer)
fricas
ans1:=eval(a1,sol.1)
 (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
GnuDraw is now explicitly exposed in frame initial
GnuDraw 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
Transmitting data...
Type: Void

 Subject:   Be Bold !! ( 15 subscribers )