/usr/share/axiom-20170501/src/algebra/UTSODETL.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | )abbrev package UTSODETL UTSodetools
++ Author: Manuel Bronstein
++ Date Created: 31 January 1994
++ Date Last Updated: 3 February 1994
++ Description:
++ \spad{RUTSodetools} provides tools to interface with the series
++ ODE solver when presented with linear ODEs.
UTSodetools(F, UP, L, UTS) : SIG == CODE where
F : Ring
UP : UnivariatePolynomialCategory F
L : LinearOrdinaryDifferentialOperatorCategory UP
UTS: UnivariateTaylorSeriesCategory F
SIG ==> with
UP2UTS : UP -> UTS
++ UP2UTS(p) converts \spad{p} to a Taylor series.
UTS2UP : (UTS, NonNegativeInteger) -> UP
++ UTS2UP(s, n) converts the first \spad{n} terms of \spad{s}
++ to a univariate polynomial.
LODO2FUN : L -> (List UTS -> UTS)
++ LODO2FUN(op) returns the function to pass to the series ODE
++ solver in order to solve \spad{op y = 0}.
if F has IntegralDomain then
RF2UTS : Fraction UP -> UTS
++ RF2UTS(f) converts \spad{f} to a Taylor series.
CODE ==> add
fun: (Vector UTS, List UTS) -> UTS
UP2UTS p ==
q := p(monomial(1, 1) + center(0)::UP)
+/[monomial(coefficient(q, i), i)$UTS for i in 0..degree q]
UTS2UP(s, n) ==
xmc := monomial(1, 1)$UP - center(0)::UP
xmcn:UP := 1
ans:UP := 0
for i in 0..n repeat
ans := ans + coefficient(s, i) * xmcn
xmcn := xmc * xmcn
ans
LODO2FUN op ==
a := recip(UP2UTS(- leadingCoefficient op))::UTS
n := (degree(op) - 1)::NonNegativeInteger
v := [a * UP2UTS coefficient(op, i) for i in 0..n]$Vector(UTS)
r := (l1: List UTS): UTS +-> fun(v, l1)
r
fun(v, l) ==
ans:UTS := 0
for b in l for i in 1.. repeat ans := ans + v.i * b
ans
if F has IntegralDomain then
RF2UTS f == UP2UTS(numer f) * recip(UP2UTS denom f)::UTS
|