StreamTaylorSeriesOperations A¶
sttaylor.spad line 1 [edit on github]
A: Ring
StreamTaylorSeriesOperations implements Taylor series arithmetic, where a Taylor series is represented by a stream of its coefficients.
- *: (A, Stream A) -> Stream A
r * areturns the power series scalar multiplication ofrbya:r * [a0, a1, ...] = [r * a0, r * a1, ...]
- *: (Stream A, A) -> Stream A
a * rreturns the power series scalar multiplication ofabyr:[a0, a1, ...] * r = [a0 * r, a1 * r, ...]
- *: (Stream A, Stream A) -> Stream A
a * breturns the power series (Cauchy) product ofaandb:[a0, a1, ...] * [b0, b1, ...] = [c0, c1, ...]whereck = sum(i + j = k, ai * bk).
- +: (Stream A, Stream A) -> Stream A
a + breturns the power series sum ofaandb:[a0, a1, ..] + [b0, b1, ..] = [a0 + b0, a1 + b1, ..]
- -: (Stream A, Stream A) -> Stream A
a - breturns the power series difference ofaandb:[a0, a1, ..] - [b0, b1, ..] = [a0 - b0, a1 - b1, ..]
- -: Stream A -> Stream A
- areturns the power series negative ofa:- [a0, a1, ...] = [- a0, - a1, ...]
- /: (Stream A, Stream A) -> Stream A
a / breturns the power series quotient ofabyb. An error message is returned ifbis not invertible. This function is used in fixed point computations.
- addiag: Stream Stream A -> Stream A
addiag(x)performs diagonal addition of a stream of streams. ifx=[[a<0, 0>, a<0, 1>, ..], [a<1, 0>, a<1, 1>, ..], [a<2, 0>, a<2, 1>, ..], ..]andaddiag(x) = [b<0, b<1>, ...], then b<k> = sum(i+j=k, a<i, j>).
- coerce: A -> Stream A
coerce(r)converts a ring elementrto a stream with one element.
- compose: (Stream A, Stream A) -> Stream A
compose(a, b)composes the power seriesawith the power seriesb.
- deriv: Stream A -> Stream A
deriv(a)returns the derivative of the power series with respect to the power series variable. Thusderiv([a0, a1, a2, ...])returns[a1, 2 a2, 3 a3, ...].
- eval: (Stream A, A) -> Stream A
eval(a, r)returns a stream of partial sums of the power seriesaevaluated at the power series variable equal tor.
- evenlambert: Stream A -> Stream A
evenlambert(st)computesf(x^2) + f(x^4) + f(x^6) + ...ifstis a stream representingf(x). This function is used for computing infinite products. Iff(x)is a power series with constant coefficient 1, thenprod(f(x^(2*n)), n=1..infinity) = exp(evenlambert(log(f(x)))).
- exquo: (Stream A, Stream A) -> Union(Stream A, failed)
exquo(a, b)returns the power series quotient ofabyb, if the quotient exists, and “failed” otherwise
- gderiv: (Integer -> A, Stream A) -> Stream A
gderiv(f, [a0, a1, a2, ..])returns[f(0)*a0, f(1)*a1, f(2)*a2, ..].
- general_Lambert_product: (Stream A, Integer, Integer) -> Stream A
general_Lambert_product(f(x), a, d)returnsf(x^a)*f(x^(a + d))*f(x^(a + 2 d))* ....f(x)should have constant coefficient equal to one andaanddshould be positive.
- generalLambert: (Stream A, Integer, Integer) -> Stream A
generalLambert(f(x), a, d)returnsf(x^a) + f(x^(a + d)) + f(x^(a + 2 d)) + ....f(x)should have zero constant coefficient andaanddshould be positive.
- int: A -> Stream A
int(r)returns [r,r+1,r+2, …], whereris a ring element.
- integrate: (A, Stream A) -> Stream A if A has Algebra Fraction Integer
integrate(r, a)returns the integral of the power seriesawith respect to the power series variable whererdenotes the constant of integration. Thusintegrate(a, [a0, a1, a2, ...]) = [a, a0, a1/2, a2/3, ...].
- invmultisect: (Integer, Integer, Stream A) -> Stream A
invmultisect(a, b, st)substitutesx^((a+b)*n)forx^nand multiplies byx^b.
- lagrange: Stream A -> Stream A
lagrange(g)produces the power series forfwherefis implicitly defined asf(z) = z*g(f(z)).
- lambert: Stream A -> Stream A
lambert(st)computesf(x) + f(x^2) + f(x^3) + ...ifstis a stream representingf(x). This function is used for computing infinite products. Iff(x)is a power series with constant coefficient 1 thenprod(f(x^n), n = 1..infinity) = exp(lambert(log(f(x)))).
- lazyGintegrate: (Integer -> A, A, () -> Stream A) -> Stream A if A has Field
lazyGintegrate(f, r, g)is used for fixed point computations.
- lazyIntegrate: (A, () -> Stream A) -> Stream A if A has Algebra Fraction Integer
lazyIntegrate(r, f)is a version of integrate used for fixed point computations.
- mapdiv: (Stream A, Stream A) -> Stream A if A has Field
mapdiv([a0, a1, ..], [b0, b1, ..])returns[a0/b0, a1/b1, ..].
- mapmult: (Stream A, Stream A) -> Stream A
mapmult([a0, a1, ..], [b0, b1, ..])returns[a0*b0, a1*b1, ..].
- multisect: (Integer, Integer, Stream A) -> Stream A
multisect(a, b, st)selects the coefficients ofx^((a+b)*n+a), and changes them tox^n.
- nlde: Stream Stream A -> Stream A if A has Algebra Fraction Integer
nlde(u)solves a first order non-linear differential equation described byuof the form[[b<0, 0>, b<0, 1>, ...], [b<1, 0>, b<1, 1>, .], ...]. the differential equation has the formy' = sum(i=0 to infinity, j=0 to infinity, b<i, j>*(x^i)*(y^j)).
- oddlambert: Stream A -> Stream A
oddlambert(st)computesf(x) + f(x^3) + f(x^5) + ...ifstis a stream representingf(x). This function is used for computing infinite products. Iff(x) is a power series with constant coefficient 1 thenprod(f(x^(2*n-1)), n=1..infinity) = exp(oddlambert(log(f(x)))).
- power: (A, Stream A) -> Stream A if A has Field
power(a, f)returns the power seriesfraised to the powera.
- powern: (Fraction Integer, Stream A) -> Stream A if A has Algebra Fraction Integer
powern(r, f)raises power seriesfto the powerr.
- prodiag: Stream Stream A -> Stream A
prodiag(x)performs “diagonal” infinite product of a stream of streams. Whenx(i)is interpreted as stream of coefficients of seriesf_i(z), i=1,..., thenprodiag(x) = (1 + z*f_1(z))*(1 + z^2*f_2(x))*...