diff --git a/books/bookvol10.4.pamphlet b/books/bookvol10.4.pamphlet index e0998f2..8da962b 100644 --- a/books/bookvol10.4.pamphlet +++ b/books/bookvol10.4.pamphlet @@ -130855,6 +130855,260 @@ RationalFunctionSign(R:GcdDomain): Exports == Implementation where @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{package SUMRF RationalFunctionSum} +<>= +)set break resume +)sys rm -f RationalFunctionSum.output +)spool RationalFunctionSum.output +)set message test on +)set message auto off +)clear all + +--S 1 of 13 +sum(i::Polynomial(Integer),variable(i=1..n)) +--R +--R +--R 2 +--R 6i - 6i + 1 +--R (1) ------------ +--R 12 +--R Type: Fraction Polynomial Integer +--E 1 + +--S 2 of 13 +sum(i::Fraction(Polynomial(Integer)),i::Symbol) +--R +--R +--R 2 +--R 6i - 6i + 1 +--R (2) ------------ +--R 12 +--R Type: Union(Fraction Polynomial Integer,...) +--E 2 + +--S 3 of 13 +sum(i,i=1..n) +--R +--R +--R 2 +--R n + n +--R (3) ------ +--R 2 +--R Type: Fraction Polynomial Integer +--E 3 + +--S 4 of 13 +sum(i::Fraction(Polynomial(Integer)),i=1..n) +--R +--R +--R 2 +--R n + n +--R (4) ------ +--R 2 +--R Type: Union(Fraction Polynomial Integer,...) +--E 4 + +--S 5 of 13 +s:=i=1..n +--R +--R +--R (5) i= 1..n +--R Type: SegmentBinding Polynomial Integer +--E 5 + +--S 6 of 13 +hiseg:=high(segment(s)) +--R +--R +--R (6) n +--R Type: Polynomial Integer +--E 6 + +--S 7 of 13 +loseg:=low(segment(s)) +--R +--R +--R (7) 1 +--R Type: Polynomial Integer +--E 7 + +--S 8 of 13 +v:=variable s +--R +--R +--R (8) i +--R Type: Symbol +--E 8 + +--S 9 of 13 +p:=i::Polynomial(Integer) +--R +--R +--R (9) i +--R Type: Polynomial Integer +--E 9 + +--S 10 of 13 +f:=sum(p,v) +--R +--R +--R 2 +--R 6i - 6i + 1 +--R (10) ------------ +--R 12 +--R Type: Fraction Polynomial Integer +--E 10 + +--S 11 of 13 +t1:=eval(f,v,(1+hiseg)) +--R +--R +--R 2 +--R 6n + 6n + 1 +--R (11) ------------ +--R 12 +--R Type: Fraction Polynomial Integer +--E 11 + +--S 12 of 13 +t2:=eval(f,v,loseg) +--R +--R +--R 1 +--R (12) -- +--R 12 +--R Type: Fraction Polynomial Integer +--E 12 + +--S 13 of 13 +t1-t2 +--R +--R +--R 2 +--R n + n +--R (13) ------ +--R 2 +--R Type: Fraction Polynomial Integer +--E 13 + +)spool + +@ +<>= +==================================================================== +RationalFunctionSum examples +==================================================================== + +There are 4 different forms of the sum operator in this domain. +They are variations of the types of the input + + sum(i::Polynomial(Integer),variable(i=1..n)) + + 2 + 6i - 6i + 1 + ------------ + 12 + + + sum(i::Fraction(Polynomial(Integer)),i::Symbol) + + 2 + 6i - 6i + 1 + ------------ + 12 + + + sum(i,i=1..n) + + 2 + n + n + ------ + 2 + + + sum(i::Fraction(Polynomial(Integer)),i=1..n) + + 2 + n + n + ------ + 2 + + +We can compute the sum form on part at a time to see what happens. +First, we make a SegmentBinding(Polynomial(Integer)): + + s:=i=1..n + + i= 1..n + + +We pick out the upper and lower bounds of the segment: + + hiseg:=high(segment(s)) + + n + + + loseg:=low(segment(s)) + + 1 + + +We pick out the variable from the segment: + + v:=variable s + + i + + +We create a polynomial we wish to sum: + + p:=i::Polynomial(Integer) + + i + + +And we create the sum for that polynomial: + + f:=sum(p,v) + + 2 + 6i - 6i + 1 + ------------ + 12 + + +The new evaluate it at the upper endpoint: + + t1:=eval(f,v,(1+hiseg)) + + 2 + 6n + 6n + 1 + ------------ + 12 + +And the lower endpoint: + + t2:=eval(f,v,loseg) + + 1 + -- + 12 + + +And we take the difference of the endpoints: + + t1-t2 + + 2 + n + n + ------ + 2 + + +See Also: +o )show RationalFunctionSum + +@ \pagehead{RationalFunctionSum}{SUMRF} \pagepic{ps/v104rationalfunctionsum.ps}{SUMRF}{1.00} @@ -130869,60 +131123,68 @@ RationalFunctionSign(R:GcdDomain): Exports == Implementation where ++ Date Last Updated: 19 April 1991 ++ Description: Computes sums of rational functions; RationalFunctionSum(R): Exports == Impl where - R: Join(IntegralDomain, OrderedSet, RetractableTo Integer) + R: Join(IntegralDomain, OrderedSet, RetractableTo Integer) - P ==> Polynomial R - RF ==> Fraction P - FE ==> Expression R - SE ==> Symbol + P ==> Polynomial R + RF ==> Fraction P + FE ==> Expression R + SE ==> Symbol - Exports ==> with - sum: (P, SE) -> RF - ++ sum(a(n), n) returns \spad{A} which - ++ is the indefinite sum of \spad{a} with respect to - ++ upward difference on \spad{n}, i.e. \spad{A(n+1) - A(n) = a(n)}. - sum: (RF, SE) -> Union(RF, FE) - ++ sum(a(n), n) returns \spad{A} which - ++ is the indefinite sum of \spad{a} with respect to - ++ upward difference on \spad{n}, i.e. \spad{A(n+1) - A(n) = a(n)}. - sum: (P, SegmentBinding P) -> RF - ++ sum(f(n), n = a..b) returns \spad{f(a) + f(a+1) + ... f(b)}. - sum: (RF, SegmentBinding RF) -> Union(RF, FE) - ++ sum(f(n), n = a..b) returns \spad{f(a) + f(a+1) + ... f(b)}. + Exports ==> with + sum: (P, SE) -> RF + ++ sum(a(n), n) returns \spad{A} which + ++ is the indefinite sum of \spad{a} with respect to + ++ upward difference on \spad{n}, i.e. \spad{A(n+1) - A(n) = a(n)}. + ++ + ++X sum(i::Polynomial(Integer),variable(i=1..n)) + sum: (RF, SE) -> Union(RF, FE) + ++ sum(a(n), n) returns \spad{A} which + ++ is the indefinite sum of \spad{a} with respect to + ++ upward difference on \spad{n}, i.e. \spad{A(n+1) - A(n) = a(n)}. + ++ + ++X sum(i::Fraction(Polynomial(Integer)),i::Symbol) + sum: (P, SegmentBinding P) -> RF + ++ sum(f(n), n = a..b) returns \spad{f(a) + f(a+1) + ... f(b)}. + ++ + ++X sum(i,i=1..n) + sum: (RF, SegmentBinding RF) -> Union(RF, FE) + ++ sum(f(n), n = a..b) returns \spad{f(a) + f(a+1) + ... f(b)}. + ++ + ++X sum(i::Fraction(Polynomial(Integer)),i=1..n) - Impl ==> add - import RationalFunction R - import GosperSummationMethod(IndexedExponents SE, SE, R, P, RF) - - innersum : (RF, SE) -> Union(RF, "failed") - innerpolysum: (P, SE) -> RF - - sum(f:RF, s:SegmentBinding RF) == - (indef := innersum(f, v := variable s)) case "failed" => - summation(f::FE,map((z:RF):FE +->z::FE,s) - $SegmentBindingFunctions2(RF,FE)) - eval(indef::RF, v, 1 + hi segment s) - - eval(indef::RF, v,lo segment s) - - sum(an:RF, n:SE) == - (u := innersum(an, n)) case "failed" => summation(an::FE, n) - u::RF - - sum(p:P, s:SegmentBinding P) == - f := sum(p, v := variable s) - eval(f, v, (1 + hi segment s)::RF) - eval(f,v,lo(segment s)::RF) - - innersum(an, n) == - (r := retractIfCan(an)@Union(P, "failed")) case "failed" => - an1 := eval(an, n, -1 + n::RF) - (u := GospersMethod(an/an1, n, new$SE)) case "failed" => - "failed" - an1 * eval(u::RF, n, -1 + n::RF) - sum(r::P, n) + Impl ==> add + import RationalFunction R + import GosperSummationMethod(IndexedExponents SE, SE, R, P, RF) + + innersum : (RF, SE) -> Union(RF, "failed") + innerpolysum: (P, SE) -> RF + + sum(f:RF, s:SegmentBinding RF) == + (indef := innersum(f, v := variable s)) case "failed" => + summation(f::FE,map((z:RF):FE +->z::FE,s) + $SegmentBindingFunctions2(RF,FE)) + eval(indef::RF, v, 1 + hi segment s) + - eval(indef::RF, v,lo segment s) + + sum(an:RF, n:SE) == + (u := innersum(an, n)) case "failed" => summation(an::FE, n) + u::RF + + sum(p:P, s:SegmentBinding P) == + f := sum(p, v := variable s) + eval(f, v, (1 + hi segment s)::RF) - eval(f,v,lo(segment s)::RF) + + innersum(an, n) == + (r := retractIfCan(an)@Union(P, "failed")) case "failed" => + an1 := eval(an, n, -1 + n::RF) + (u := GospersMethod(an/an1, n, new$SE)) case "failed" => + "failed" + an1 * eval(u::RF, n, -1 + n::RF) + sum(r::P, n) - sum(p:P, n:SE) == - rec := sum(p, n)$InnerPolySum(IndexedExponents SE, SE, R, P) - rec.num / (rec.den :: P) + sum(p:P, n:SE) == + rec := sum(p, n)$InnerPolySum(IndexedExponents SE, SE, R, P) + rec.num / (rec.den :: P) @ <>= diff --git a/changelog b/changelog index 34ed227..8ec5951 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +20091103 tpd src/axiom-website/patches.html 20091103.02.tpd.patch +20091103 tpd books/bookvol10.4 Examples, Help, Regress RationalFunctionSum +20091103 tpd src/algebra/Makefile RationalFunctionSum 20091103 tpd src/axiom-website/patches.html 20091103.01.tpd.patch 20091103 tpd books/bookvol0 rename ListOfTerms to listOfTerms 20091103 tpd books/bookvol10.2 rename ListOfTerms to listOfTerms diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet index 3dae6d4..7cd5a81 100644 --- a/src/algebra/Makefile.pamphlet +++ b/src/algebra/Makefile.pamphlet @@ -16549,6 +16549,7 @@ SPADHELP=\ ${HELP}/Queue.help \ ${HELP}/RadicalSolvePackage.help \ ${HELP}/RadixExpansion.help \ + ${HELP}/RationalFunctionSum.help \ ${HELP}/RealClosure.help \ ${HELP}/RealSolvePackage.help \ ${HELP}/RegularTriangularSet.help \ @@ -16682,6 +16683,7 @@ REGRESS= \ Queue.regress \ RadicalSolvePackage.regress \ RadixExpansion.regress \ + RationalFunctionSum.regress \ RealClosure.regress \ RealSolvePackage.regress \ RegularTriangularSet.regress \ @@ -17804,6 +17806,18 @@ ${HELP}/RadixExpansion.help: ${BOOKS}/bookvol10.3.pamphlet >${INPUT}/RadixExpansion.input @echo "RadixExpansion (RADIX)" >>${HELPFILE} +${HELP}/RationalFunctionSum.help: ${BOOKS}/bookvol10.4.pamphlet + @echo 7965 create RationalFunctionSum.help from \ + ${BOOKS}/bookvol10.4.pamphlet + @${TANGLE} -R"RationalFunctionSum.help" \ + ${BOOKS}/bookvol10.4.pamphlet \ + >${HELP}/RationalFunctionSum.help + @cp ${HELP}/RationalFunctionSum.help ${HELP}/SUMRF.help + @${TANGLE} -R"RationalFunctionSum.input" \ + ${BOOKS}/bookvol10.4.pamphlet \ + >${INPUT}/RationalFunctionSum.input + @echo "RationalFunctionSum (SUMRF)" >>${HELPFILE} + ${HELP}/RealClosure.help: ${BOOKS}/bookvol10.3.pamphlet @echo 7970 create RealClosure.help from ${BOOKS}/bookvol10.3.pamphlet @${TANGLE} -R"RealClosure.help" ${BOOKS}/bookvol10.3.pamphlet \ diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 6e1ff46..8e815b8 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -2217,5 +2217,7 @@ books/bookvol10.4 RadicalSolvePackage input, help, examples
src/input/solveperf.input added
20091103.01.tpd.patch rename ListOfTerms to listOfTerms
+20091103.02.tpd.patch +books/bookvol10.4 Examples, Help, Regress RationalFunctionSum