You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(20) |
Dec
(17) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(39) |
Feb
(21) |
Mar
(33) |
Apr
(135) |
May
(53) |
Jun
(88) |
Jul
(47) |
Aug
(59) |
Sep
(207) |
Oct
(40) |
Nov
(7) |
Dec
(26) |
2003 |
Jan
(49) |
Feb
(39) |
Mar
(117) |
Apr
(50) |
May
(62) |
Jun
(6) |
Jul
(19) |
Aug
(24) |
Sep
(11) |
Oct
(11) |
Nov
(49) |
Dec
(9) |
2004 |
Jan
(29) |
Feb
(123) |
Mar
(32) |
Apr
(53) |
May
(52) |
Jun
(19) |
Jul
(33) |
Aug
(10) |
Sep
(76) |
Oct
(86) |
Nov
(171) |
Dec
(163) |
2005 |
Jan
(147) |
Feb
(121) |
Mar
(120) |
Apr
(126) |
May
(120) |
Jun
(213) |
Jul
(76) |
Aug
(79) |
Sep
(140) |
Oct
(83) |
Nov
(156) |
Dec
(202) |
2006 |
Jan
(181) |
Feb
(171) |
Mar
(157) |
Apr
(98) |
May
(96) |
Jun
(97) |
Jul
(193) |
Aug
(76) |
Sep
(130) |
Oct
(63) |
Nov
(196) |
Dec
(253) |
2007 |
Jan
(256) |
Feb
(293) |
Mar
(276) |
Apr
(258) |
May
(181) |
Jun
(91) |
Jul
(108) |
Aug
(69) |
Sep
(107) |
Oct
(179) |
Nov
(137) |
Dec
(121) |
2008 |
Jan
(124) |
Feb
(129) |
Mar
(192) |
Apr
(201) |
May
(90) |
Jun
(86) |
Jul
(115) |
Aug
(142) |
Sep
(49) |
Oct
(91) |
Nov
(95) |
Dec
(218) |
2009 |
Jan
(230) |
Feb
(149) |
Mar
(118) |
Apr
(72) |
May
(77) |
Jun
(68) |
Jul
(102) |
Aug
(72) |
Sep
(89) |
Oct
(76) |
Nov
(125) |
Dec
(86) |
2010 |
Jan
(75) |
Feb
(90) |
Mar
(89) |
Apr
(121) |
May
(111) |
Jun
(66) |
Jul
(75) |
Aug
(66) |
Sep
(66) |
Oct
(166) |
Nov
(121) |
Dec
(73) |
2011 |
Jan
(74) |
Feb
|
Mar
|
Apr
(14) |
May
(22) |
Jun
(31) |
Jul
(53) |
Aug
(37) |
Sep
(23) |
Oct
(25) |
Nov
(31) |
Dec
(28) |
2012 |
Jan
(18) |
Feb
(11) |
Mar
(32) |
Apr
(17) |
May
(48) |
Jun
(37) |
Jul
(23) |
Aug
(54) |
Sep
(15) |
Oct
(11) |
Nov
(19) |
Dec
(22) |
2013 |
Jan
(11) |
Feb
(32) |
Mar
(24) |
Apr
(37) |
May
(31) |
Jun
(14) |
Jul
(26) |
Aug
(33) |
Sep
(40) |
Oct
(21) |
Nov
(36) |
Dec
(84) |
2014 |
Jan
(23) |
Feb
(20) |
Mar
(27) |
Apr
(24) |
May
(31) |
Jun
(27) |
Jul
(34) |
Aug
(26) |
Sep
(21) |
Oct
(45) |
Nov
(23) |
Dec
(73) |
2015 |
Jan
(33) |
Feb
(8) |
Mar
(24) |
Apr
(45) |
May
(27) |
Jun
(19) |
Jul
(21) |
Aug
(51) |
Sep
(43) |
Oct
(29) |
Nov
(61) |
Dec
(86) |
2016 |
Jan
(99) |
Feb
(52) |
Mar
(80) |
Apr
(61) |
May
(24) |
Jun
(23) |
Jul
(36) |
Aug
(30) |
Sep
(41) |
Oct
(43) |
Nov
(27) |
Dec
(46) |
2017 |
Jan
(57) |
Feb
(34) |
Mar
(40) |
Apr
(31) |
May
(78) |
Jun
(49) |
Jul
(72) |
Aug
(33) |
Sep
(26) |
Oct
(82) |
Nov
(69) |
Dec
(29) |
2018 |
Jan
(43) |
Feb
(9) |
Mar
|
Apr
(40) |
May
(34) |
Jun
(49) |
Jul
(45) |
Aug
(8) |
Sep
(51) |
Oct
(75) |
Nov
(103) |
Dec
(80) |
2019 |
Jan
(153) |
Feb
(78) |
Mar
(47) |
Apr
(48) |
May
(63) |
Jun
(54) |
Jul
(10) |
Aug
(7) |
Sep
(17) |
Oct
(24) |
Nov
(29) |
Dec
(17) |
2020 |
Jan
(22) |
Feb
(74) |
Mar
(47) |
Apr
(48) |
May
(12) |
Jun
(44) |
Jul
(13) |
Aug
(18) |
Sep
(26) |
Oct
(36) |
Nov
(25) |
Dec
(23) |
2021 |
Jan
(28) |
Feb
(25) |
Mar
(58) |
Apr
(76) |
May
(72) |
Jun
(70) |
Jul
(25) |
Aug
(67) |
Sep
(17) |
Oct
(24) |
Nov
(30) |
Dec
(30) |
2022 |
Jan
(51) |
Feb
(39) |
Mar
(72) |
Apr
(65) |
May
(30) |
Jun
(72) |
Jul
(129) |
Aug
(44) |
Sep
(45) |
Oct
(30) |
Nov
(48) |
Dec
(275) |
2023 |
Jan
(235) |
Feb
(232) |
Mar
(68) |
Apr
(16) |
May
(52) |
Jun
(87) |
Jul
(143) |
Aug
(32) |
Sep
(26) |
Oct
(15) |
Nov
(20) |
Dec
(74) |
2024 |
Jan
(119) |
Feb
(32) |
Mar
(61) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Andrej V. <an...@us...> - 2007-01-08 12:13:11
|
Update of /cvsroot/maxima/maxima/share/contrib/solve_rec In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23581 Modified Files: closed_form.mac closed_form_test.mac Added Files: rtest_closed_form.mac Log Message: closed_form: changed atom to mapatom closed_form_test: added new tests for sums of rational functions rtest_closed_form.mac: new file with regression tests for closed_form --- NEW FILE: rtest_closed_form.mac --- /*************************************** * * This file contains some examples for closed_form function * * Use: * load("closed_form"); * load("closed_form_test"); * ***************************************/ ( test_sum(s, ass, use_gamma, smp) := block( [product_use_gamma : use_gamma, cs, f], if length(ass)>0 then apply(assume, ass), cs : closed_form(s), for f in smp do cs : apply(f, [cs]), cs ), 0 ); 0; test_sum( sum(r/k*binom(n,r)*binom(m,k-r)/binom(n+m,k),r,0,k), [n>k, m>k-1], true, [makefact, minfactorial] ); n/(n+m); test_sum( sum(binom(n,k)/(k+1), k, 0, n), [], true, [] ); (2^(n+1)-1)/(n+1); test_sum( sum((-1)^k * binomial(a+b, a+k) * binomial(b+c, b+k) * binomial(c+a, c+k), k, -a, a), [a<b, a<c], true, [factcomb] ); (c+b+a)!/(a!*b!*c!); test_sum( sum((-1)^k * binom(n,k)*x/(x+k), k, 0, n), [], true, [factcomb] ); (n!*x!)/(x+n)!; test_sum( sum((-1)^k * binomial(2*n, k)^2, k, 0, 2*n), [], false, [] ); ((product(2*%l+1,%l,0,n-1))*(-1)^n*2^n)/n!; test_sum( sum((binom(3*k+1,k)*binom(3*(n-k),n-k))/(3*k+1), k, 0, n), [], false, [] ); ((product(3*%j+2,%j,0,n-1))*(product(3*%j+4,%j,0,n-1))*3^n)/((product(2*%j+3,%j,0,n-1))*2^n*n!); test_sum( sum(binomial(n, k) * binomial(m, r - k), k, 0, r), [m>r, n>r], true, [factcomb] ); (n+m)!/((-r+n+m)!*r!); test_sum( sum(binomial(2*n,2*k), k, 0, n), [], true, [] ); 4^n/2; test_sum( sum((-1)^k*binom(x-2*k,n-k)*binom(x-k+1,k),k,0,n), [x>2*n, x>n-1], true, [] ); ((-1)^n+1)/2; test_sum( sum((-1)^s*binom(2*m, s)^3, s, 0, 2*m), [], false, [] ); ((product(3*%l+1,%l,0,m-1))*(product(3*%l+2,%l,0,m-1))*(-1)^m*3^m)/m!^2; test_sum( sum((-1)^k*binom(k,n-k), k, 0, n), [], true, [rectform, trigreduce] ); (3*cos((2*%pi*n)/3)-sqrt(3)*sin((2*%pi*n)/3))/3; test_sum( sum(binom(n,k)^2*binom(3*n+k,2*n), k, -inf, inf), [n>0], false, [] ); ((product(3*%l+1,%l,0,n-1))^2*(product(3*%l+2,%l,0,n-1))^2*9^n)/((product(2*%l+1,%l,0,n-1))^2*4^n*n!^2); test_sum( sum((-1)^k*binom(n-k,k)*2^(n-2*k), k, 0, n), [], true, [] ); n+1; test_sum( sum(binom(x,k)*binom(y,k), k, 0, y), [x>y], true, [factcomb] ); (y+x)!/(x!*y!); test_sum( sum((-1)^(n-k)*binom(n,k)*binom(k+b,k), k, 0, n), [b>0], true, [factcomb] ); b!/((b-n)!*n!); test_sum( sum(binom(n+k,k)/2^k,k,0,n), [], true, [] ); 2^n; test_sum( sum((2^(4*k)*binom(2*n-2*k,n-k))/(2*k*(2*k+1)*binom(2*k,k)), k, 1, n), [], true, [] ); -(4*binom(-2*(1-n),n-1)*(1-2*n))/(2*n+1); test_sum( sum(k^2 * binomial(n, k), k, 1, n), [], true, [] ); ((n^2+n)*2^n)/4; test_sum( sum(2^(n-k)*binom(n+k,2*k),k,-inf,inf), [n>0], true, [] ); (2*4^n+1)/3; test_sum( sum(((-1)^k*binom(2*k,k)*binom(n,k))/4^k,k,0,n), [], true, [] ); ((2*n-1)/2)!/(sqrt(%pi)*n!); test_sum( sum((-1)^k*binom(2*k,k)*binom(2*n,k)*binom(4*n-2*k,2*n-k),k,0,2*n), [], true, [] ); (4^n*2^(2*n)*((2*n-1)/2)!^2)/(%pi*n!^2); test_sum( sum((n^2+n+1)/(n^4-2*n^2+1),n,2,inf), [], true, [ratsimp, multthru] ); %pi^2/6-5/16; test_sum( sum(1/n/(2*n+1),n,1,inf), [], true, [ratsimp, multthru] ); 2-2*log(2); test_sum( sum(1/(5*n^2-1),n,1,inf), [], true, [ratsimp, multthru] ); (sqrt(5)*psi[0]((sqrt(5)+1)/sqrt(5)))/10-(sqrt(5)*psi[0]((sqrt(5)-1)/sqrt(5)))/10; test_sum( sum(1/(5*n^2-3),n,1,inf), [], true, [ratsimp, multthru] ); (sqrt(3)*sqrt(5)*psi[0]((sqrt(3)*sqrt(5)+3)/(sqrt(3)*sqrt(5))))/30-(sqrt(3)*sqrt(5)*psi[0]((sqrt(3)*sqrt(5)-3)/(sqrt(3)*sqrt(5))))/30; test_sum( sum(1/(n^2+1),n,1,inf), [], true, [ratsimp, multthru] ); (%i*psi[0](1-%i))/2-(%i*psi[0](%i+1))/2; test_sum( sum(1/n/(n+a), n, 1, inf), [], true, [ratsimp, multthru] ); psi[0](a+1)/a+%gamma/a; Index: closed_form.mac =================================================================== RCS file: /cvsroot/maxima/maxima/share/contrib/solve_rec/closed_form.mac,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- closed_form.mac 3 Jan 2007 09:09:50 -0000 1.7 +++ closed_form.mac 8 Jan 2007 12:13:07 -0000 1.8 @@ -65,7 +65,7 @@ closed_form(expr) := /* Check if we have a sum - if not then simplify all arguments. */ - if atom(expr) then expr + if mapatom(expr) then expr else if part(expr, 0)#nounify(sum) then map(closed_form, expr) else block( Index: closed_form_test.mac =================================================================== RCS file: /cvsroot/maxima/maxima/share/contrib/solve_rec/closed_form_test.mac,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- closed_form_test.mac 21 Apr 2006 00:49:35 -0000 1.1 +++ closed_form_test.mac 8 Jan 2007 12:13:07 -0000 1.2 @@ -112,13 +112,6 @@ )$ test_sum( - sum(k*binom(2*n+k,2*k+1), k, 0, 2*n-1), - [n>0], - true, - [] -)$ - -test_sum( sum(binom(x,k)*binom(y,k), k, 0, y), [x>y], true, @@ -173,3 +166,47 @@ true, [] )$ + +test_sum( + sum((n^2+n+1)/(n^4-2*n^2+1),n,2,inf), + [], + true, + [ratsimp, multthru] +)$ + + +test_sum( + sum(1/n/(2*n+1),n,1,inf), + [], + true, + [ratsimp, multthru] +)$ + +test_sum( + sum(1/(5*n^2-1),n,1,inf), + [], + true, + [ratsimp, multthru] +)$ + +test_sum( + sum(1/(5*n^2-3),n,1,inf), + [], + true, + [ratsimp, multthru] +)$ + + +test_sum( + sum(1/(n^2+1),n,1,inf), + [], + true, + [ratsimp, multthru] +)$ + +test_sum( + sum(1/n/(n+a), n, 1, inf), + [], + true, + [ratsimp, multthru] +)$ |
From: Andrej V. <an...@us...> - 2007-01-08 11:46:49
|
Update of /cvsroot/maxima/maxima/share/contrib/Zeilberger In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12179 Modified Files: rtest_zeilberger.mac Log Message: Added a comment at the top. Fixed the last test (the order of i and n). All tests are OK with the cvs version of Zeilberger. Index: rtest_zeilberger.mac =================================================================== RCS file: /cvsroot/maxima/maxima/share/contrib/Zeilberger/rtest_zeilberger.mac,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- rtest_zeilberger.mac 7 Jan 2007 20:02:57 -0000 1.1 +++ rtest_zeilberger.mac 8 Jan 2007 11:46:46 -0000 1.2 @@ -4,6 +4,7 @@ done$ +/* New regression tests are at end */ /*=================================================================*/ /* converted from testZeilberger.mac (mvdb) */ @@ -162,16 +163,13 @@ 1/k$ /* suggested by Andrej */ -/* currently failing */ AntiDifference(2^(k^2), k); NON_HYPERGEOMETRIC$ -/* currently failing */ AntiDifference(k^k, k); NON_HYPERGEOMETRIC$ -/* currently failing; works correctly with i replaced by j. */ -Zeilberger(binomial(n,i), n, i); -[[(n-i)/(i+1),[1]]]$ -zb_prove(binomial(n,i),n,i,%); +Zeilberger(binomial(n,i), i, n); +[[i/(n-i+1), [2, -1]]]$ +zb_prove(binomial(n,i),i,n,%); true$ |
From: Andrej V. <an...@us...> - 2007-01-08 11:37:29
|
Update of /cvsroot/maxima/maxima/share/contrib/Zeilberger In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7974 Modified Files: shiftQuotient.mac zb_prover.mac makeGosperForm.mac Log Message: - changed the names of some local variables from i and j to i__ and j__. - shiftQuotient.mac: changed the way shift quotient is computed if the operator of the expression is "^" Index: shiftQuotient.mac =================================================================== RCS file: /cvsroot/maxima/maxima/share/contrib/Zeilberger/shiftQuotient.mac,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- shiftQuotient.mac 10 Jun 2006 16:49:42 -0000 1.6 +++ shiftQuotient.mac 8 Jan 2007 11:37:24 -0000 1.7 @@ -128,7 +128,7 @@ shiftFactPoly(first(expr),k,j)*shiftFactPoly(second(expr),k,j)^(-1) else if op(expr) = "*" then - product(shiftFactPoly(part(expr,i),k,j),i,1,length(expr)) + product(shiftFactPoly(part(expr,i__),k,j),i__,1,length(expr)) else if op(expr) = "^" then if integerp(second(expr)) then @@ -160,11 +160,11 @@ isPolynomial(expr,k) := - if freeof(k,expr) or expr=k or expr=-k then + if freeof(k,expr) or expr=k or expr=-k or constantp(expr) then true else if op(expr) = "^" then - freeof(k,second(expr)) and isPolynomial(first(expr),k) + ( freeof(k,second(expr)) and isPolynomial(first(expr),k) ) else if op(expr) = "-" then isPolynomial(first(expr),k) @@ -195,7 +195,7 @@ xthru_expr : xthru(removeBinomial(expr)), sq_res : shiftQuoHypCheckAux(xthru_expr,k,HYP), - if ?ratp(sq_res[1],k) then + if rationalp(sq_res[1],k) then return(sq_res) else return([sq_res[1],NO_HYP]) @@ -215,8 +215,8 @@ return([(k+1)/k,HYP]) else if op(expr) = "*" then - return(product(shiftQuoHypCheckAux(part(expr,i),k,hyp_flag), - i,1,length(expr))) + return(product(shiftQuoHypCheckAux(part(expr,i__),k,hyp_flag), + i__,1,length(expr))) else if op(expr) = "//" then ( @@ -227,17 +227,19 @@ else if op(expr) = "^" then ( - - if freeof(k,first(expr)) then - sq_base : [first(expr),hyp_flag] - else - sq_base : shiftQuoHypCheckAux(first(expr),k,hyp_flag), - sq_exp : leadCoeff(second(expr),k), - if integerp(sq_exp) then - return([first(sq_base)^sq_exp,second(sq_base)]) - else - return([first(sq_base)^sq_exp,NO_HYP]) - + if (freeof(k, second(expr))) then + ( + sq_base : shiftQuoHypCheckAux(first(expr), k, hyp_flag), + if sq_base[2]=NO_HYP then return([expr, NO_HYP]) + else return([sq_base[1]^second(expr), hyp_flag]) + ) + else if (freeof(k, first(expr))) then + ( + sq_exp: bothcoef(second(expr), k), + if not(freeof(k, second(sq_exp))) then return([expr, NO_HYP]) + else return([first(expr)^first(sq_exp), hyp_flag]) + ) + else return([expr, NO_HYP]) ) else if op(expr) = "!" then @@ -246,12 +248,12 @@ else if leadCoeff(first(expr),k)>0 then return( - [product(factor(first(expr)+i),i,1,leadCoeff(first(expr),k)), + [product(factor(first(expr)+i__),i__,1,leadCoeff(first(expr),k)), hyp_flag]) else [ - 1/product(factor(first(expr)-i+1), - i,1,-leadCoeff(first(expr),k)),hyp_flag] + 1/product(factor(first(expr)-i__+1), + i__,1,-leadCoeff(first(expr),k)),hyp_flag] /* else if op(expr) = binomial then @@ -269,6 +271,10 @@ ) */ else + if op(expr) = "-" then block( + return(shiftQuoHypCheckAux(-expr, k, hyp_flag)) + ) + else if op(expr) = "+" then return([shiftFactPoly(expr,k,1)/expr,hyp_flag]) else Index: zb_prover.mac =================================================================== RCS file: /cvsroot/maxima/maxima/share/contrib/Zeilberger/zb_prover.mac,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- zb_prover.mac 10 Jun 2006 05:15:05 -0000 1.1 +++ zb_prover.mac 8 Jan 2007 11:37:24 -0000 1.2 @@ -54,16 +54,16 @@ /* Routines related to the proof writer for Zeilberger's algoritm */ zb_meaning(zb_in,k,n,zb_cert,zb_rec) := - block([j], + block([j__], - print(sum(zb_rec[j]*subst(n+j-1,n,zb_in),j,1,length(zb_rec))," = "), + print(sum(zb_rec[j__]*subst(n+j__-1,n,zb_in),j__,1,length(zb_rec))," = "), print(subst(k+1,k,zb_cert*zb_in)-zb_cert*zb_in,";") ); zb_reduced_meaning(zb_in,k,n,zb_cert,zb_rec) := - block([i,j], + block([i__,j__], - return([sum(zb_rec[j]*product(subst(n+i-1,n,shiftQuo(zb_in,n)),i,1,j-1),j,1,length(zb_rec)), + return([sum(zb_rec[j__]*product(subst(n+i__-1,n,shiftQuo(zb_in,n)),i__,1,j__-1),j__,1,length(zb_rec)), subst(k+1,k,zb_cert)*shiftQuo(zb_in,k)-zb_cert]) ); Index: makeGosperForm.mac =================================================================== RCS file: /cvsroot/maxima/maxima/share/contrib/Zeilberger/makeGosperForm.mac,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- makeGosperForm.mac 10 Jun 2006 05:15:05 -0000 1.5 +++ makeGosperForm.mac 8 Jan 2007 11:37:24 -0000 1.6 @@ -114,7 +114,7 @@ /* Local variables */ [num,den,numList,denList,lengthNumList,lengthDenList, test, - i,j,h,minExp,pulledPoly,pPoly,curExp,compPoly,formSign, + i__,j,h,minExp,pulledPoly,pPoly,curExp,compPoly,formSign, p,q,r,pList,qList,rList, negNumFlag,negDenFlag, intLinNum,nonIntLinNum,intLinDen,nonIntLinDen, @@ -329,7 +329,7 @@ ), /* end of inner loop */ -q : q * product(norm2polyPower(part(candNumList,i)),i,1,length(candNumList)) +q : q * product(norm2polyPower(part(candNumList,i__)),i__,1,length(candNumList)) ), /* end of outer loop */ @@ -339,9 +339,9 @@ print("denList : ", denList) ), if numList # [] then - q : q * product(norm2polyPower(part(numList,i)),i,1,length(numList)), + q : q * product(norm2polyPower(part(numList,i__)),i__,1,length(numList)), if denList # [] then - r : r * product(norm2polyPower(part(denList,i)),i,1,length(denList)), + r : r * product(norm2polyPower(part(denList,i__)),i__,1,length(denList)), if mode>= verbose then ( @@ -446,7 +446,7 @@ denExp:second(first(candDenList)), minExp:min(numExp,denExp), - p : p * product(subst(k+i,k,norm2intLin(first(candDenList),k)^minExp),i,0,diff-1), + p : p * product(subst(k+i__,k,norm2intLin(first(candDenList),k)^minExp),i__,0,diff-1), if mode>= verbose then print("p computed : ", p), if(numExp>denExp) then @@ -476,19 +476,19 @@ /* out of inner cycle */ if (candNumList # []) then - q : q * product(norm2polyPower(part(candNumList,i)),i,1,length(candNumList)), + q : q * product(norm2polyPower(part(candNumList,i__)),i__,1,length(candNumList)), if(candDenList # []) then - r : r * product(norm2polyPower(part(candDenList,i)),i,1,length(candDenList)) + r : r * product(norm2polyPower(part(candDenList,i__)),i__,1,length(candDenList)) ), /* end unless */ if (numList # []) then - q : q*product(norm2polyPower(part(numList,i)),i,1,length(numList)), + q : q*product(norm2polyPower(part(numList,i__)),i__,1,length(numList)), if (denList # []) then - r : r*product(norm2polyPower(part(denList,i)),i,1,length(denList)), + r : r*product(norm2polyPower(part(denList,i__)),i__,1,length(denList)), r : subst(k-1,k,r), |
From: Jorge B. <fic...@us...> - 2007-01-08 08:12:15
|
Update of /cvsroot/maxima/maxima/doc/info/pt_BR In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12609 Modified Files: Plotting.texi Log Message: Brazilian Portuguese translation Plotting.texi -> recovering the last bad update Index: Plotting.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/pt_BR/Plotting.texi,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Plotting.texi 8 Jan 2007 08:03:54 -0000 1.5 +++ Plotting.texi 8 Jan 2007 08:12:11 -0000 1.6 @@ -57,12 +57,12 @@ @end deffn -@deffn {Fun@,{c}@~ao} plot2d (@var{expr}, @var{range}, ..., @var{options}, ...) -@deffnx {Fun@,{c}@~ao} plot2d (@var{parametric_expr}) -@deffnx {Fun@,{c}@~ao} plot2d ([@var{expr_1}, ..., @var{expr_n}], @var{x_range}, @var{y_range}) -@deffnx {Fun@,{c}@~ao} plot2d ([@var{expr_1}, ..., @var{expr_n}], @var{x_range}) -@deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}, @var{y_range}) -@deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}) +@deffn {Fun@,{c}@~ao} plot2d (@var{expr}, @var{range}, ..., @var{options}, ...) +@deffnx {Fun@,{c}@~ao} plot2d (@var{parametric_expr}) +@deffnx {Fun@,{c}@~ao} plot2d ([@var{expr_1}, ..., @var{expr_n}], @var{x_range}, @var{y_range}) +@deffnx {Fun@,{c}@~ao} plot2d ([@var{expr_1}, ..., @var{expr_n}], @var{x_range}) +@deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}, @var{y_range}) +@deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}) @deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}) @deffnx {Fun@,{c}@~ao} plot2d ([@var{name_1}, ..., @var{name_n}], @var{x_range}, @var{y_range}) @deffnx {Fun@,{c}@~ao} plot2d ([@var{name_1}, ..., @var{name_n}], @var{x_range}) @@ -755,7 +755,8 @@ @end defvr @deffn {Fun@,{c}@~ao} plot3d ([@var{expr_1}, @var{expr_2}, @var{expr_3}], @var{x_range}, @var{y_range}, ..., @var{options}, ...) -@deffnx {Fun@,{c}@~ao} plot3d (@var{expr}, @var{x_range}, @var{y_range}, ..., @var{options}, ...)@deffnx {Fun@value{cedilha}@~ao} plot3d (@var{name}, @var{x_range}, @var{y_range}, ..., @var{options}, ...) +@deffnx {Fun@,{c}@~ao} plot3d (@var{expr}, @var{x_range}, @var{y_range}, ..., @var{options}, ...) +@deffnx {Fun@,{c}@~ao} plot3d (@var{name}, @var{x_range}, @var{y_range}, ..., @var{options}, ...) @deffnx {Fun@,{c}@~ao} plot3d ([@var{expr_1}, @var{expr_2}, @var{expr_3}], @var{x_rge}, @var{y_rge}) @deffnx {Fun@,{c}@~ao} plot3d ([@var{name_1}, @var{name_2}, @var{name_3}], @var{x_range}, @var{y_range}, ..., @var{options}, ...) |
From: Jorge B. <fic...@us...> - 2007-01-08 08:05:48
|
Update of /cvsroot/maxima/maxima/doc/info/pt_BR In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv8366 Modified Files: maxima.texi Lists.texi Integration.texi Log Message: maxima.texi -> updating to English cvs version 1.39 Integration.texi -> updating to English cvs version 1.30 Lists.texi -> updating to English cvs version 1.28 Index: maxima.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/pt_BR/maxima.texi,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- maxima.texi 5 Jan 2007 11:30:37 -0000 1.16 +++ maxima.texi 8 Jan 2007 08:05:37 -0000 1.17 @@ -1,5 +1,5 @@ \input texinfo -@c /maxima.texi/1.38/Sun Dec 24 05:28:50 2006/-ko/ +@c /maxima.texi/1.39/Mon Jan 8 04:17:51 2007/-ko/ @c Language: Brazilian Portuguese, Encoding: iso-8859-1 @c -*-texinfo-*- @@ -226,6 +226,7 @@ * opsubst:: Comandos para subsitui@,{c}@~oes. * orthopoly:: Polin@'omios ortogonais. * plotdf:: Gr@'aficos de campos de direc@,{c}@~oes. +* romberg:: M@'etodo de Romberg para integra@,{c}@~ao numerica. * simplex:: Programa@,{c}@~ao linear. * simplification:: Fun@,{c}@~oes e regras de simplifica@,{c}@~ao. * solve_rec:: Rela@,{c}@~oes de recorr@^encias lineares. @@ -558,6 +559,10 @@ * Introdu@value{cedilha}@~ao a plotdf:: * Defini@value{cedilha}@~oes para plotdf:: +romberg + +* Definitions for romberg:: + simplex * Introdu@value{cedilha}@~ao a simplex:: @@ -867,11 +872,15 @@ @chapter orthopoly @include orthopoly.texi -@node plotdf, simplex, orthopoly, Top +@node plotdf, romberg, orthopoly, Top @chapter plotdf @include plotdf.texi -@node simplex, simplification, plotdf, Top +@node romberg, simplex, plotdf, Top +@chapter romberg +@include romberg.texi + +@node simplex, simplification, romberg, Top @chapter simplex @include simplex.texi Index: Lists.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/pt_BR/Lists.texi,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Lists.texi 24 Dec 2006 11:07:34 -0000 1.2 +++ Lists.texi 8 Jan 2007 08:05:38 -0000 1.3 @@ -1,5 +1,5 @@ @c Language: Brazilian Portuguese, Encoding: iso-8859-1 -@c /Lists.texi/1.27/Sat Jul 8 08:14:46 2006/-ko/ +@c /Lists.texi/1.28/Mon Jan 8 04:17:44 2007/-ko/ @menu * Introdu@value{cedilha}@~ao a Listas:: * Defini@value{cedilha}@~oes para Listas:: @@ -432,6 +432,41 @@ @end deffn +@deffn {Fun@,{c}@~ao} sublist_indices (@var{L}, @var{P}) + +Retorna os @'indices dos elementos @code{x} da lista @var{L} para os quais +o predicado @code{maybe(@var{P}(x))} retornar @code{true}; +isso inclui @code{unknown} bem como @code{false}. +@var{P} pode ser um nome de fun@,{c}@~ao ou uma express@~ao lambda. +@var{L} deve ser uma lista literal. + +Exemplos: +@c ===beg=== +@c sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], lambda ([x], x='b)); +@c sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], symbolp); +@c sublist_indices ([1 > 0, 1 < 0, 2 < 1, 2 > 1, 2 > 0], identity); +@c assume (x < -1); +@c map (maybe, [x > 0, x < 0, x < -2]); +@c sublist_indices ([x > 0, x < 0, x < -2], identity); +@c ===end=== + +@example +(%i1) sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], lambda ([x], x='b)); +(%o1) [2, 3, 7, 9] +(%i2) sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], symbolp); +(%o2) [1, 2, 3, 4, 7, 9] +(%i3) sublist_indices ([1 > 0, 1 < 0, 2 < 1, 2 > 1, 2 > 0], identity); +(%o3) [1, 4, 5] +(%i4) assume (x < -1); +(%o4) [x < - 1] +(%i5) map (maybe, [x > 0, x < 0, x < -2]); +(%o5) [false, true, unknown] +(%i6) sublist_indices ([x > 0, x < 0, x < -2], identity); +(%o6) [2] +@end example + +@end deffn + @deffn {Fun@,{c}@~ao} tenth (@var{expr}) Retorna o d@'ecimo item da express@~ao ou lista @var{expr}. Veja @code{first} para maiores detalhes. Index: Integration.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/pt_BR/Integration.texi,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Integration.texi 7 Jan 2007 11:36:16 -0000 1.4 +++ Integration.texi 8 Jan 2007 08:05:38 -0000 1.5 @@ -1,5 +1,5 @@ @c Language: Brazilian Portuguese, Encoding: iso-8859-1 -@c /Integration.texi/1.29/Sun Jan 7 05:49:36 2007/-ko/ +@c /Integration.texi/1.30/Mon Jan 8 04:17:39 2007/-ko/ @menu * Introdu@value{cedilha}@~ao a Integra@value{cedilha}@~ao:: * Defini@value{cedilha}@~oes para Integra@value{cedilha}@~ao:: @@ -13,9 +13,8 @@ Maxima tem muitas rotinas para manusear integra@,{c}@~ao. A fun@,{c}@~ao @code{integrate} faz uso de muitas dessas. Exite tamb@'em o pacote @code{antid}, que manuseia uma fun@,{c}@~ao n@~ao especificada (e suas -derivadas, certamente). Para usos num@'ericos, existe a fun@,{c}@~ao -@code{romberg}; um -e um conjunto de integradores adaptativos de Quadpack, +derivadas, certamente). Para usos numericos, +existe um conjunto de integradores adaptativos de QUADPACK, a saber @code{quad_qag}, @code{quad_qags}, etc., os quais s@~ao descritos sob o t@'opico @code{QUADPACK}. Fun@,{c}@~oes hipergeom@'etricas est@~ao sendo trabalhadas, veja @code{specint} para detalhes. @@ -549,207 +548,6 @@ @end deffn -@c NEEDS WORK BUT DON'T BOTHER TO CLEAN IT UP: -@c THE GAUSS-KRONROD FUNCTIONS (QUADPACK) MAKE THIS OBSOLETE -@deffn {Fun@,{c}@~ao} romberg (@var{expr}, @var{x}, @var{a}, @var{b}) -@deffnx {Fun@,{c}@~ao} romberg (@var{expr}, @var{a}, @var{b}) -Integra@,{c}@~ao de Romberg. -Existem dois caminhos para usar essa fun@,{c}@~ao. O primeiro @'e um caminho -ineficiente como a vers@~ao de integral definida de @code{integrate}: -@code{romberg (<integrando>, <vari@'avel of integra@,{c}@~ao>, <lower limit>, <upper limit>)}. - -Exemplos: - -@example -(%i1) showtime: true$ -(%i2) romberg (sin(y), y, 0, %pi); -Evalua@,{c}@~ao took 0.00 seconds (0.01 elapsed) using 25.293 KB. -(%o2) 2.000000016288042 -(%i3) 1/((x-1)^2+1/100) + 1/((x-2)^2+1/1000) + 1/((x-3)^2+1/200)$ -(%i4) f(x) := ''%$ -(%i5) rombergtol: 1e-6$ -(%i6) rombergit: 15$ -(%i7) romberg (f(x), x, -5, 5); -Evalua@,{c}@~ao took 11.97 seconds (12.21 elapsed) using 12.423 MB. -(%o7) 173.6730736617464 -@c INCLUDE THIS COMPARISON TO EXACT RESULT ??? YIELDS A LOT OF "RAT replaced" MESSAGES !!! -@c integrate (f(x), x, -5, 5) - %, numer; -@end example - -O segundo @'e um caminho eficiente que @'e usado como segue: - -@example -romberg (<fun@,{c}@~ao name>, <lower limit>, <upper limit>); -@end example - -Continuando o exemplo acima, temos: -@example -(%i8) f(x) := (mode_declare ([fun@,{c}@~ao(f), x], float), ''(%th(5)))$ -(%i9) translate(f); -(%o9) [f] -(%i10) romberg (f, -5, 5); -Evalua@,{c}@~ao took 3.51 seconds (3.86 elapsed) using 6.641 MB. -(%o10) 173.6730736617464 -@end example - -O primeiro argumento deve ser uma fun@,{c}@~ao trauzida ou compilada. (Se for -compilada isso deve ser declarado para retorno a @code{flonum}.) Se o primeiro -argumento n@~ao for j@'a traduzido, @code{romberg} n@~ao tentar@'a -traduz@'i-lo mas resultar@'a um erro. - -A precis@~ao da integra@,{c}@~ao @'e governada pelas vari@'aveis globais -@code{rombergtol} (valor padr@~ao 1.E-4) e @code{rombergit} (valor padr@~ao 11). -@code{romberg} retornar@'a um resultado se a diferen@,{c}a relativa em sucessivas -aproxima@,{c}@~oes for menor que @code{rombergtol}. Isso tentar@'a dividir ao meio o -tamanho do passo @code{rombergit} vezes antes que isso seja abandonado. O n@'umero de itera@,{c}@~oes -e avalia@,{c}@~oes da fun@,{c}@~ao que @code{romberg} far@'a @'e governado por -@code{rombergabs} e @code{rombergmin}. - -@code{romberg} pode ser chamada recursivamente e dessa forma pode fazer integrais duplas e -triplas. - -Exemplo: -@example -(%i1) assume (x > 0)$ -(%i2) integrate (integrate (x*y/(x+y), y, 0, x/2), x, 1, 3)$ -(%i3) radcan (%); - 26 log(3) - 26 log(2) - 13 -(%o3) - -------------------------- - 3 -(%i4) %,numer; -(%o4) .8193023963959073 -(%i5) define_variable (x, 0.0, float, "Global vari@'avel in fun@,{c}@~ao F")$ -(%i6) f(y) := (mode_declare (y, float), x*y/(x+y))$ -(%i7) g(x) := romberg ('f, 0, x/2)$ -(%i8) romberg (g, 1, 3); -(%o8) .8193022864324522 -@end example - -A vantagem com esse caminho @'e que a fun@,{c}@~ao @code{f} pode ser usada para outros -prop@'ositos, como imprimir gr@'aficos. A desvantagem @'e que voc@^e tem que inventar -um nome para ambas a fun@,{c}@~ao @code{f} e sua vari@'avel independente @code{x}. -Ou, sem a vari@'avel global: - -@example -(%i1) g_1(x) := (mode_declare (x, float), romberg (x*y/(x+y), y, 0, x/2))$ -(%i2) romberg (g_1, 1, 3); -(%o2) .8193022864324522 -@end example - -A vantagem aqui @'e que o c@'odigo @'e menor. - -@example -(%i3) q (a, b) := romberg (romberg (x*y/(x+y), y, 0, x/2), x, a, b)$ -(%i4) q (1, 3); -(%o4) .8193022864324522 -@end example - -Isso @'e sempre o caminho mais curto, e as vari@'aveis n@~ao precisam ser declaradas -porque elas est@~ao no contexto de @code{romberg}. -O uso de @code{romberg} para integrais multiplas pode ter grandes desvantagens, -apesar disso. O amontoado de c@'alculos extras necess@'arios por causa da -informa@,{c}@~ao geom@'etrica descartada durante o processo pela express@~ao de integrais multiplas por -esse caminho pode ser incr@'ivel. O usu@'ario dever@'a ter certeza de entender e -usar os comutadores @code{rombergtol} e @code{rombergit}. - -@end deffn - -@defvr {Vari@'avel de op@,{c}@~ao} rombergabs -Valor padr@~ao: 0.0 - -Assumindo que estimativas sucessivas -produzidas por @code{romberg} s@~ao @code{y[0]}, @code{y[1]}, @code{y[2]}, etc., ent@~ao @code{romberg} -retornar@'a ap@'os @code{n} itera@,{c}@~oes se (grasseiramente falando) - -@example - (abs(y[n]-y[n-1]) <= rombergabs ou - abs(y[n]-y[n-1])/(if y[n]=0.0 then 1.0 else y[n]) <= rombergtol) -@end example - -for @code{true}. (A condi@,{c}@~ao sobre o n@'umero de itera@,{c}@~oes dadas por -@code{rombergmin} deve tamb@'em ser satisfeita.) -Dessa forma se @code{rombergabs} @'e 0.0 (o padr@~ao) voc@^e apenas pega o teste -de erro relativo. A utilidade de uma vari@'avel adicional vem quando voc@^e -executar uma integral, quando a contribui@,{c}@~ao dominante vem -de uma pequena regi@~ao. Ent@~ao voc@^e pode fazer a integral sobre uma pequena -regi@~ao dominante primeiro, usando a verifica@,{c}@~ao relativa de precis@~ao, seguida pela -integral sobre o restante da regi@~ao usando a verifica@,{c}@~ao absoluta -de erro. - -Exemplo: Suponha que voc@^e quer calcular - -@example -'integrate (exp(-x), x, 0, 50) -@end example - -(numericamente) com uma precis@~ao relativa de 1 parte em 10000000. -Defina a fun@,{c}@~ao. @code{n} @'e o contador, ent@~ao n@'os podemos ver quantas -avalia@,{c}@~oes de fun@,{c}@~ao foram necess@'arias. -Primeiro de tudo tente fazer a integral completa de uma s@'o vez. - -@example -(%i1) f(x) := (mode_declare (n, integer, x, float), n:n+1, exp(-x))$ -(%i2) translate(f)$ -Warning-> n @'e an undefined global variable. -(%i3) block ([rombergtol: 1.e-6, romberabs: 0.0], n:0, romberg (f, 0, 50)); -(%o3) 1.000000000488271 -(%i4) n; -(%o4) 257 -@end example - -Que aproximadamente precisou de 257 avalia@,{c}@~oes de fun@,{c}@~ao . - Agora fa@,{c}a a integral inteligentemente, primeiro fazendo - @code{'integrate (exp(-x), x, 0, 10)} e ent@~ao escolhendo @code{rombergabs} para 1.E-6 vezes (nessa - integral parcial). -Isso aproximdamente pega somente 130 avalia@,{c}@~oes de fun@,{c}@~ao. - -@example -(%i5) block ([rombergtol: 1.e-6, rombergabs:0.0, sum:0.0], - n: 0, sum: romberg (f, 0, 10), rombergabs: sum*rombergtol, rombergtol:0.0, - sum + romberg (f, 10, 50)); -(%o5) 1.000000001234793 -(%i6) n; -(%o6) 130 -@end example - -Ent@~ao se @code{f(x)} onde a fun@,{c}@~ao pegou um longo tempo de computa@,{c}@~ao, o -segundo m@'etodo fez a mesma tarefa 2 vezes mais r@'apido. - -@end defvr - -@defvr {Vari@'avel de op@,{c}@~ao} rombergit -Valor padr@~ao: 11 - -A precis@~ao do comando @code{romberg} de -integra@,{c}@~ao @'e governada pelas vari@'aveis globais @code{rombergtol} e -@code{rombergit}. @code{romberg} retornar@'a um resultado se a diferen@,{c}a -relativa em sucessivas approxima@,{c}@~oes @'e menor que @code{rombergtol}. Isso -tentar@'a dividir ao meio o tamanho do passoe @code{rombergit} vezes antes disso ser abandonado. - -@end defvr - -@defvr {Vari@'avel de op@,{c}@~ao} rombergmin -Valor padr@~ao: 0 - -@code{rombergmin} governa o n@'umero m@'inimo de avalia@,{c}@~oes de -fun@,{c}@~ao que @code{romberg} far@'a. @code{romberg} avaliar@'a seu primeiro -argumento pelo menos @code{2^(rombergmin+2)+1} vezes. Isso @'e @'util para -integrar fun@,{c}@~oes oscilat@'orias, onde o teste normal de converg@^encia pode -lgumas vezes inadequadamente passar. - -@end defvr - -@defvr {Vari@'avel de op@,{c}@~ao} rombergtol -Valor padr@~ao: 1e-4 - -A precis@~ao do comando de integra@,{c}@~ao de @code{romberg} -@'e governada pelas vari@'aveis globais @code{rombergtol} e -@code{rombergit}. @code{romberg} retornar@'a um resultado se a difere@,{c}a -relativa em sucessivas aproxima@,{c}@~oes @'e menor que @code{rombergtol}. Isso -tentar@'a dividir ao meio o tamanho do passo @code{rombergit} vezes antes disso ser abandonado. - -@end defvr - @c NEEDS EXPANSION, CLARIFICATION, AND EXAMPLES @deffn {Fun@,{c}@~ao} tldefint (@var{expr}, @var{x}, @var{a}, @var{b}) Equivalente a @code{ldefint} com @code{tlimswitch} escolhido para @code{true}. |
From: Jorge B. <fic...@us...> - 2007-01-08 08:03:58
|
Update of /cvsroot/maxima/maxima/doc/info/pt_BR In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7404 Modified Files: Plotting.texi Log Message: maxima.texi -> updating to English cvs version 1.39 Integration.texi -> updating to English cvs version 1.30 Lists.texi -> updating to English cvs version 1.28 Index: Plotting.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/pt_BR/Plotting.texi,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Plotting.texi 7 Jan 2007 19:33:16 -0000 1.4 +++ Plotting.texi 8 Jan 2007 08:03:54 -0000 1.5 @@ -57,12 +57,12 @@ @end deffn -@deffn {Fun@,{c}@~ao} plot2d (@var{expr}, @var{range}, ..., @var{options}, ...) -@deffnx {Fun@,{c}@~ao} plot2d (@var{parametric_expr}) -@deffnx {Fun@,{c}@~ao} plot2d ([@var{expr_1}, ..., @var{expr_n}], @var{x_range}, @var{y_range}) -@deffnx {Fun@,{c}@~ao} plot2d ([@var{expr_1}, ..., @var{expr_n}], @var{x_range}) -@deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}, @var{y_range}) -@deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}) +@deffn {Fun@,{c}@~ao} plot2d (@var{expr}, @var{range}, ..., @var{options}, ...) +@deffnx {Fun@,{c}@~ao} plot2d (@var{parametric_expr}) +@deffnx {Fun@,{c}@~ao} plot2d ([@var{expr_1}, ..., @var{expr_n}], @var{x_range}, @var{y_range}) +@deffnx {Fun@,{c}@~ao} plot2d ([@var{expr_1}, ..., @var{expr_n}], @var{x_range}) +@deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}, @var{y_range}) +@deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}) @deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}) @deffnx {Fun@,{c}@~ao} plot2d ([@var{name_1}, ..., @var{name_n}], @var{x_range}, @var{y_range}) @deffnx {Fun@,{c}@~ao} plot2d ([@var{name_1}, ..., @var{name_n}], @var{x_range}) @@ -755,8 +755,7 @@ @end defvr @deffn {Fun@,{c}@~ao} plot3d ([@var{expr_1}, @var{expr_2}, @var{expr_3}], @var{x_range}, @var{y_range}, ..., @var{options}, ...) -@deffnx {Fun@,{c}@~ao} plot3d (@var{expr}, @var{x_range}, @var{y_range}, ..., @var{options}, ...) -@deffnx {Fun@,{c}@~ao} plot3d (@var{name}, @var{x_range}, @var{y_range}, ..., @var{options}, ...) +@deffnx {Fun@,{c}@~ao} plot3d (@var{expr}, @var{x_range}, @var{y_range}, ..., @var{options}, ...)@deffnx {Fun@value{cedilha}@~ao} plot3d (@var{name}, @var{x_range}, @var{y_range}, ..., @var{options}, ...) @deffnx {Fun@,{c}@~ao} plot3d ([@var{expr_1}, @var{expr_2}, @var{expr_3}], @var{x_rge}, @var{y_rge}) @deffnx {Fun@,{c}@~ao} plot3d ([@var{name_1}, @var{name_2}, @var{name_3}], @var{x_range}, @var{y_range}, ..., @var{options}, ...) |
From: Robert D. <rob...@us...> - 2007-01-08 04:57:49
|
Update of /cvsroot/maxima/maxima/doc/info In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25238/doc/info Modified Files: Lists.texi Log Message: New function sublist_indices, like sublist but it returns the indices of the items instead of the items themselves. - src/nset.lisp: Implementation of $sublist_indices - doc/info/Lists.texi: documentation - tests/rtestnset.mac: test cases Index: Lists.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/Lists.texi,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- Lists.texi 25 Jun 2006 11:08:10 -0000 1.27 +++ Lists.texi 8 Jan 2007 04:57:46 -0000 1.28 @@ -432,6 +432,41 @@ @end deffn +@deffn {Function} sublist_indices (@var{L}, @var{P}) + +Returns the indices of the elements @code{x} of the list @var{L} for which +the predicate @code{maybe(@var{P}(x))} returns @code{true}; +this excludes @code{unknown} as well as @code{false}. +@var{P} may be the name of a function or a lambda expression. +@var{L} must be a literal list. + +Examples: +@c ===beg=== +@c sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], lambda ([x], x='b)); +@c sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], symbolp); +@c sublist_indices ([1 > 0, 1 < 0, 2 < 1, 2 > 1, 2 > 0], identity); +@c assume (x < -1); +@c map (maybe, [x > 0, x < 0, x < -2]); +@c sublist_indices ([x > 0, x < 0, x < -2], identity); +@c ===end=== + +@example +(%i1) sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], lambda ([x], x='b)); +(%o1) [2, 3, 7, 9] +(%i2) sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], symbolp); +(%o2) [1, 2, 3, 4, 7, 9] +(%i3) sublist_indices ([1 > 0, 1 < 0, 2 < 1, 2 > 1, 2 > 0], identity); +(%o3) [1, 4, 5] +(%i4) assume (x < -1); +(%o4) [x < - 1] +(%i5) map (maybe, [x > 0, x < 0, x < -2]); +(%o5) [false, true, unknown] +(%i6) sublist_indices ([x > 0, x < 0, x < -2], identity); +(%o6) [2] +@end example + +@end deffn + @deffn {Function} tenth (@var{expr}) Returns the 10'th item of expression or list @var{expr}. See @code{first} for more details. |
From: Robert D. <rob...@us...> - 2007-01-08 04:57:49
|
Update of /cvsroot/maxima/maxima/tests In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25238/tests Modified Files: rtestnset.mac Log Message: New function sublist_indices, like sublist but it returns the indices of the items instead of the items themselves. - src/nset.lisp: Implementation of $sublist_indices - doc/info/Lists.texi: documentation - tests/rtestnset.mac: test cases Index: rtestnset.mac =================================================================== RCS file: /cvsroot/maxima/maxima/tests/rtestnset.mac,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- rtestnset.mac 27 Dec 2006 16:22:22 -0000 1.6 +++ rtestnset.mac 8 Jan 2007 04:57:46 -0000 1.7 @@ -1496,6 +1496,8 @@ cartesian_product(setify(makelist(i,i,1,15)),setify(makelist(j,j,1,15))))); true$ +/* Tests for random_permutation */ + (set_random_state (make_random_state (1234)), 0); 0; @@ -1511,25 +1513,36 @@ apply ("+", makelist (if random_permutation ([1, 2, 3, 4]) = [4,2,1,3] then 1 else 0, i, 1, 1000)); 41; -(print("nset version ",get(nset,'version)),0); -0$ - - - - - - - - - +/* Tests for sublist_indices */ +sublist_indices ([], lambda([x], x='b)); +[]; +errcatch (sublist_indices (1, lambda([x], x='b))); +[]; +sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], lambda ([x], x='b)); +[2, 3, 7, 9]; +sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], lambda ([x], integerp (x))); +[5, 6, 8]; +sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], symbolp); +[1, 2, 3, 4, 7, 9]; +sublist_indices ([true, false, false, true, true], identity); +[1, 4, 5]; +sublist_indices ([1 > 0, 1 < 0, 2 < 1, 2 > 1, 2 > 0], identity); +[1, 4, 5]; +(kill (P), P(x) := ordergreatp (x, 'm), sublist_indices ('[a, %pi, x, z, h, y, %e, 1, s], P)); +[3, 4, 6, 9]; +sublist_indices ('[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], lambda ([x], evenp(x) and primep(x))); +[3]; +/* Finale */ +(print("nset version ",get(nset,'version)),0); +0$ |
From: Robert D. <rob...@us...> - 2007-01-08 04:57:49
|
Update of /cvsroot/maxima/maxima/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25238/src Modified Files: nset.lisp Log Message: New function sublist_indices, like sublist but it returns the indices of the items instead of the items themselves. - src/nset.lisp: Implementation of $sublist_indices - doc/info/Lists.texi: documentation - tests/rtestnset.mac: test cases Index: nset.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/src/nset.lisp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- nset.lisp 27 Dec 2006 16:22:22 -0000 1.17 +++ nset.lisp 8 Jan 2007 04:57:45 -0000 1.18 @@ -1374,4 +1374,13 @@ (thread y (cdr n) (caar n))) (t `(($moebius simp) ,n)))) +; Find indices of elements which satisfy a predicate. +; Thanks to Bill Wood (wil...@co...) for his help. +; Released under terms of GNU GPL v2 with Bill's approval. +(defun $sublist_indices (items pred) + (let ((items (require-list items "$sublist_indices"))) + (do ((i 0 (1+ i)) + (xs items (cdr xs)) + (acc '() (if (definitely-so (mfuncall pred (car xs))) (cons (1+ i) acc) acc))) + ((endp xs) `((mlist) ,@(nreverse acc)))))) |
From: Robert D. <rob...@us...> - 2007-01-08 01:45:22
|
Update of /cvsroot/maxima/maxima/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32494/src Modified Files: Makefile.am acl-depends.mk clisp-depends.mk cmucl-depends.mk gcl-depends.mk openmcl-depends.mk sbcl-depends.mk scl-depends.mk maxima.system sys-proclaim.lisp lmdcls.lisp trdata.lisp Removed Files: rombrg.lisp Log Message: Move romberg function from src to share, since QUADPACK is a better numerical integration package. This topic was discussed on the Maxima mailing list circa 2007/01/02. Also revise the documentation for romberg. Also rename romberg files from rombrg.* to romberg.* . After these changes, make; make check; make install succeeds. run_testsuite is happy and ? romberg shows documentation. New files: - doc/info/romberg.texi: romberg stuff from Integration.texi, revised Moved files: - demo/rombrg.dem --> demo/romberg.dem - doc/share/rombrg.usg --> doc/share/romberg.usg - src/rombrg.lisp --> share/numeric/romberg.lisp Modified files: - demo/Makefile.am: rombrg.dem --> romberg.dem - doc/info/Integration.texi: remove romberg stuff - doc/info/Makefile.am: list new file romberg.texi - doc/info/maxima.texi: romberg stuff now separate from Integration - doc/share/Makefile.am: rombrg.usg --> romberg.usg - share/Makefile.am: list new file numeric/romberg.lisp - src/Makefile.am src/{acl,clisp,cmucl,gcl,openmcl,sbcl,scl}-depends.mk: remove rombrg.lisp from list of files - src/maxima.system: remove rombrg from list of files - src/sys-proclaim.lisp: remove romberg symbols from list - src/lmdcls.lisp: remove romberg symbols from list - src/trdata.lisp: remove romberg stuff (paste to share/numeric/romberg.lisp) - tests/rtest1.mac: remove test for romberg Index: Makefile.am =================================================================== RCS file: /cvsroot/maxima/maxima/src/Makefile.am,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- Makefile.am 25 Nov 2006 12:00:04 -0000 1.63 +++ Makefile.am 8 Jan 2007 01:45:17 -0000 1.64 @@ -396,7 +396,6 @@ residu.lisp \ result.lisp \ risch.lisp \ -rombrg.lisp \ rpart.lisp \ runtim.lisp \ rzmac.lisp \ Index: acl-depends.mk =================================================================== RCS file: /cvsroot/maxima/maxima/src/acl-depends.mk,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- acl-depends.mk 4 Sep 2006 12:27:16 -0000 1.2 +++ acl-depends.mk 8 Jan 2007 01:45:17 -0000 1.3 @@ -218,7 +218,6 @@ binary-acl/maxima.dxl : airy.lisp binary-acl/maxima.dxl : numer.lisp binary-acl/maxima.dxl : intpol.lisp -binary-acl/maxima.dxl : rombrg.lisp binary-acl/maxima.dxl : nparse.lisp binary-acl/maxima.dxl : displa.lisp binary-acl/maxima.dxl : nforma.lisp Index: clisp-depends.mk =================================================================== RCS file: /cvsroot/maxima/maxima/src/clisp-depends.mk,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- clisp-depends.mk 4 Sep 2006 12:27:16 -0000 1.23 +++ clisp-depends.mk 8 Jan 2007 01:45:17 -0000 1.24 @@ -218,7 +218,6 @@ binary-clisp/maxima.mem : airy.lisp binary-clisp/maxima.mem : numer.lisp binary-clisp/maxima.mem : intpol.lisp -binary-clisp/maxima.mem : rombrg.lisp binary-clisp/maxima.mem : nparse.lisp binary-clisp/maxima.mem : displa.lisp binary-clisp/maxima.mem : nforma.lisp Index: cmucl-depends.mk =================================================================== RCS file: /cvsroot/maxima/maxima/src/cmucl-depends.mk,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- cmucl-depends.mk 4 Sep 2006 12:27:16 -0000 1.24 +++ cmucl-depends.mk 8 Jan 2007 01:45:17 -0000 1.25 @@ -218,7 +218,6 @@ binary-cmucl/maxima.core : airy.lisp binary-cmucl/maxima.core : numer.lisp binary-cmucl/maxima.core : intpol.lisp -binary-cmucl/maxima.core : rombrg.lisp binary-cmucl/maxima.core : nparse.lisp binary-cmucl/maxima.core : displa.lisp binary-cmucl/maxima.core : nforma.lisp Index: gcl-depends.mk =================================================================== RCS file: /cvsroot/maxima/maxima/src/gcl-depends.mk,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- gcl-depends.mk 4 Sep 2006 12:27:16 -0000 1.26 +++ gcl-depends.mk 8 Jan 2007 01:45:17 -0000 1.27 @@ -224,7 +224,6 @@ binary-gcl/maxima : airy.lisp binary-gcl/maxima : numer.lisp binary-gcl/maxima : intpol.lisp -binary-gcl/maxima : rombrg.lisp binary-gcl/maxima : nparse.lisp binary-gcl/maxima : displa.lisp binary-gcl/maxima : nforma.lisp Index: openmcl-depends.mk =================================================================== RCS file: /cvsroot/maxima/maxima/src/openmcl-depends.mk,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- openmcl-depends.mk 4 Sep 2006 12:27:16 -0000 1.12 +++ openmcl-depends.mk 8 Jan 2007 01:45:17 -0000 1.13 @@ -169,7 +169,6 @@ binary-openmcl/maxima.image : ellipt.lisp binary-openmcl/maxima.image : numer.lisp binary-openmcl/maxima.image : intpol.lisp -binary-openmcl/maxima.image : rombrg.lisp binary-openmcl/maxima.image : nparse.lisp binary-openmcl/maxima.image : displa.lisp binary-openmcl/maxima.image : nforma.lisp Index: sbcl-depends.mk =================================================================== RCS file: /cvsroot/maxima/maxima/src/sbcl-depends.mk,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- sbcl-depends.mk 4 Sep 2006 12:27:16 -0000 1.15 +++ sbcl-depends.mk 8 Jan 2007 01:45:17 -0000 1.16 @@ -126,6 +126,8 @@ binary-sbcl/maxima.core : numerical/slatec/derf.lisp binary-sbcl/maxima.core : numerical/slatec/de1.lisp binary-sbcl/maxima.core : numerical/slatec/dei.lisp +binary-sbcl/maxima.core : numerical/slatec/d9upak.lisp +binary-sbcl/maxima.core : numerical/slatec/dspenc.lisp binary-sbcl/maxima.core : numerical/slatec/dqwgtf.lisp binary-sbcl/maxima.core : numerical/slatec/dqcheb.lisp binary-sbcl/maxima.core : numerical/slatec/dqk15w.lisp @@ -180,6 +182,7 @@ binary-sbcl/maxima.core : nalgfa.lisp binary-sbcl/maxima.core : ufact.lisp binary-sbcl/maxima.core : result.lisp +binary-sbcl/maxima.core : ifactor.lisp binary-sbcl/maxima.core : rat3a.lisp binary-sbcl/maxima.core : rat3b.lisp binary-sbcl/maxima.core : rat3d.lisp @@ -215,7 +218,6 @@ binary-sbcl/maxima.core : airy.lisp binary-sbcl/maxima.core : numer.lisp binary-sbcl/maxima.core : intpol.lisp -binary-sbcl/maxima.core : rombrg.lisp binary-sbcl/maxima.core : nparse.lisp binary-sbcl/maxima.core : displa.lisp binary-sbcl/maxima.core : nforma.lisp Index: scl-depends.mk =================================================================== RCS file: /cvsroot/maxima/maxima/src/scl-depends.mk,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- scl-depends.mk 13 Sep 2006 23:20:47 -0000 1.6 +++ scl-depends.mk 8 Jan 2007 01:45:17 -0000 1.7 @@ -218,7 +218,6 @@ binary-scl/maxima.core : airy.lisp binary-scl/maxima.core : numer.lisp binary-scl/maxima.core : intpol.lisp -binary-scl/maxima.core : rombrg.lisp binary-scl/maxima.core : nparse.lisp binary-scl/maxima.core : displa.lisp binary-scl/maxima.core : nforma.lisp Index: maxima.system =================================================================== RCS file: /cvsroot/maxima/maxima/src/maxima.system,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- maxima.system 4 Sep 2006 12:27:16 -0000 1.51 +++ maxima.system 8 Jan 2007 01:45:17 -0000 1.52 @@ -442,8 +442,7 @@ (:file "airy" :depends-on ("ellipt")) (:file "numer") - (:file "intpol") - (:file "rombrg"))) + (:file "intpol"))) (:module reader :source-pathname "" :depends-on (compatibility-macros) :components ((:file "nparse"))) Index: sys-proclaim.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/src/sys-proclaim.lisp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- sys-proclaim.lisp 5 Jan 2007 18:33:12 -0000 1.12 +++ sys-proclaim.lisp 8 Jan 2007 01:45:17 -0000 1.13 @@ -574,7 +574,7 @@ MAXIMA::PGSUBST MAXIMA::TEX-MEXPT MAXIMA::EXPTAN-FUNS MAXIMA::SUBFUNMAKE MAXIMA::TEX-ATOM MAXIMA::THNO35 MAXIMA::LHSIMP MAXIMA::PCSUB2 MAXIMA::$MINOR MAXIMA::COLOUT - MAXIMA::EXPSEC-FUNS MAXIMA::$ROMBERG_SUBR MAXIMA::TEX-ARRAY + MAXIMA::EXPSEC-FUNS MAXIMA::TEX-ARRAY MAXIMA::THNO34 MAXIMA::EXPASIN-FUNS MAXIMA::$FIND_ROOT_SUBR MAXIMA::PUTPROP1 MAXIMA::INTEGRATE-USE-ROOTSOF MAXIMA::SPLITPFQ MAXIMA::DECLVALUE MAXIMA::EXPPLYGAM-FUNS @@ -1769,7 +1769,7 @@ MAXIMA::$POISDIFF MAXIMA::HALFANGLEAUX MAXIMA::PEXPTSQ MAXIMA::RESULTANT MAXIMA::SIMP2F1 MAXIMA::STORE-MACRO-HELPER MAXIMA::FACTPLUS2 - MAXIMA::HERMPOL MAXIMA::ROMBERG-MACRO MAXIMA::PSTERM1 + MAXIMA::HERMPOL MAXIMA::PSTERM1 MAXIMA::TIMESLOOP MAXIMA::RATQU MAXIMA::INTGREAT MAXIMA::ATAN MAXIMA::XTORTERM MAXIMA::KBATEMANTW MAXIMA::LAPSHIFT MAXIMA::$POISEXPT MAXIMA::$REMRULE @@ -2168,4 +2168,4 @@ MAXIMA::$DRAW_NGONS MAXIMA::SORT-NGONS)) (PROCLAIM '(FTYPE (FUNCTION NIL (VALUES T T)) MAXIMA::GENSUMINDEX - MAXIMA::SCAN-LISP-STRING MAXIMA::SCAN-MACSYMA-STRING)) \ No newline at end of file + MAXIMA::SCAN-LISP-STRING MAXIMA::SCAN-MACSYMA-STRING)) Index: lmdcls.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/src/lmdcls.lisp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- lmdcls.lisp 30 Dec 2006 19:14:31 -0000 1.13 +++ lmdcls.lisp 8 Jan 2007 01:45:17 -0000 1.14 @@ -91,8 +91,7 @@ $poislim $powerdisp $prederror $programmode $props $radexpand $ratalgdenom $ratdenomdivide $ratepsilon $ratexpand $ratfac $ratmx $ratprint $ratsimpexpons $ratvars $ratweights - $ratwtlvl $realonly $refcheck $resultant $rmxchar $rombergabs - $rombergit $rombergit_used $rombergmin $rombergtol $rootsconmode + $ratwtlvl $realonly $refcheck $resultant $rmxchar $rootsconmode $rules $savedef $savefactors $scalarmatrixp $setcheck $setcheckbreak $setval $showtime $signbfloat $simp $simpsum $solvedecomposes $solveexplicit $solvefactors $solvenullwarn Index: trdata.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/src/trdata.lisp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- trdata.lisp 13 Sep 2006 23:15:34 -0000 1.6 +++ trdata.lisp 8 Jan 2007 01:45:18 -0000 1.7 @@ -26,7 +26,7 @@ ;; this should go someplace else perhaps. -(def-autoload-translate $romberg $find_root) +(def-autoload-translate $find_root) ;;; MODEDECLARE(FUNCTION(LENGTH),FIXNUM) @@ -37,11 +37,8 @@ '($length $nterms random $nroots $rank $polysign $time $array_dimension_n)) -;;; MODEDECLARE(FUNCTION(ROMBERG_SUBR),FLOAT) -;;; ROMBERG is a macsyma macro. - (mapc #'(lambda (x) (putprop x '$float 'function-mode)) - '($romberg_subr $find_root_subr)) + '($find_root_subr)) ;;; Functions of BOOLEAN return VALUE. i.e. PREDICATES --- rombrg.lisp DELETED --- |
From: Robert D. <rob...@us...> - 2007-01-08 01:45:22
|
Update of /cvsroot/maxima/maxima/share/numeric In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32494/share/numeric Added Files: romberg.lisp Log Message: Move romberg function from src to share, since QUADPACK is a better numerical integration package. This topic was discussed on the Maxima mailing list circa 2007/01/02. Also revise the documentation for romberg. Also rename romberg files from rombrg.* to romberg.* . After these changes, make; make check; make install succeeds. run_testsuite is happy and ? romberg shows documentation. New files: - doc/info/romberg.texi: romberg stuff from Integration.texi, revised Moved files: - demo/rombrg.dem --> demo/romberg.dem - doc/share/rombrg.usg --> doc/share/romberg.usg - src/rombrg.lisp --> share/numeric/romberg.lisp Modified files: - demo/Makefile.am: rombrg.dem --> romberg.dem - doc/info/Integration.texi: remove romberg stuff - doc/info/Makefile.am: list new file romberg.texi - doc/info/maxima.texi: romberg stuff now separate from Integration - doc/share/Makefile.am: rombrg.usg --> romberg.usg - share/Makefile.am: list new file numeric/romberg.lisp - src/Makefile.am src/{acl,clisp,cmucl,gcl,openmcl,sbcl,scl}-depends.mk: remove rombrg.lisp from list of files - src/maxima.system: remove rombrg from list of files - src/sys-proclaim.lisp: remove romberg symbols from list - src/lmdcls.lisp: remove romberg symbols from list - src/trdata.lisp: remove romberg stuff (paste to share/numeric/romberg.lisp) - tests/rtest1.mac: remove test for romberg --- NEW FILE: romberg.lisp --- ;;; -*- Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*- ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; The data in this file contains enhancments. ;;;;; ;;; ;;;;; ;;; Copyright (c) 1984,1987 by William Schelter,University of Texas ;;;;; ;;; All rights reserved ;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; (c) Copyright 1982 Massachusetts Institute of Technology ;;; ;;; Original code by CFFK. Modified to interface correctly with TRANSL ;;; ;;; and the rest of macsyma by GJC ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :maxima) (macsyma-module rombrg) (load-macsyma-macros transm numerm) (declare-top(special user-timesofar)) ;;; the following code if for historical frame of reference. ;;;(defun fmeval3 (x1) ;;; (cond ((integerp (setq x1 (meval x1))) (float x1)) ;;; ((floatp x1) x1) ;;; (t (displa x1) (error '|not floating point|)))) ;;; ;;;(defun qeval3 (y1 x1 z) ;;; (cond (x1 (fmeval3 (list '($ev) y1 (list '(mequal) x1 z) '$numer))) ;;; (t (funcall y1 z)))) (defmvar $rombergit 11. "the maximum number of iterations" fixnum) (defmvar $rombergmin 0. "the minimum number of iterations" fixnum) (defmvar $rombergtol 1.0e-4 "the relative tolerance of error" flonum) (defmvar $rombergabs 0.0 "the absolute tolerance of error" flonum) (defmvar $rombergit_used 0 "the number of iterations actually used." fixnum) (defvar romb-print nil ) ; " For ^]" (defun $romberg_subr (function left right) (bind-tramp1$ f function (let ((a (float left)) (b (float right)) (x 0.0) (tt (make-array $rombergit :element-type 'double-float)) (rr (make-array $rombergit :element-type 'double-float)) (user-timesofar (cons 'romb-timesofar user-timesofar)) (romb-print nil)) (setq x (-$ b a)) (setf (aref$ tt 0) (*$ x (+$ (fcall$ f b) (fcall$ f a)) 0.5)) (setf (aref$ rr 0.) (*$ x (fcall$ f (*$ (+$ b a) 0.5)))) (do ((l 1. (f1+ l)) (m 4. (f* m 2.)) (y 0.0) (z 0.0) (cerr 0.0)) ((= l $rombergit) (merror "`romberg' failed to converge")) (declare (flonum y z cerr) (fixnum l m)) (setq y (float m) z (//$ x y)) (setf (aref$ tt l) (*$ (+$ (aref$ tt (f1- l)) (aref$ rr (f1- l))) 0.5)) (setf (aref$ rr l) 0.0) (do ((i 1. (f+ i 2.))) ((> i m)) (cond (romb-print (setq romb-print nil) ;^] magic. (mtell "Romberg: ~A iterations; last error =~A;~ calculating F(~A)." i cerr (+$ (*$ z (float i)) a)))) (setf (aref$ rr l) (+$ (fcall$ f (+$ (*$ z (float i)) a)) (aref$ rr l)))) (setf (aref$ rr l) (*$ z (aref$ rr l) 2.0)) (setq y 0.0) (do ((k l (f1- k))) ((= k 0.)) (declare (fixnum k)) (setq y (+$ (*$ y 4.0) 3.0)) (setf (aref$ tt (f1- k)) (+$ (//$ (-$ (aref$ tt k) (aref$ tt (f1- k))) y) (aref$ tt k))) (setf (aref$ rr (f1- k)) (+$ (//$ (-$ (aref$ rr k) (aref$ rr (f1- k))) y) (aref$ rr k)))) (setq y (*$ (+$ (aref$ tt 0.) (aref$ rr 0.)) 0.5)) ;;; this is the WIN condition test. (cond ((and (or (not (< $rombergabs (setq cerr (abs (-$ (aref$ tt 0.) (aref$ rr 0.)))))) (not (< $rombergtol ;; cerr = "calculated error"; used for ^] (setq cerr (//$ cerr (cond ((= y 0.0) 1.0) (t (abs y)))))))) (> l $rombergmin)) (setq $rombergit_used l) #+maclisp (progn (*rearray tt) (*rearray rr)) (return y))))))) (defun romb-timesofar () (setq romb-print t)) ;^] function. ;;; Making the ^] scheme work through this special variable makes ;;; it possible to avoid various timing screws and having to have ;;; special variables for communication between the interrupt and MP ;;; function. On the other hand, it may make it more difficult to ;;; have multiple reports (double integrals etc.). ;;; TRANSL SUPPORT. (defprop $romberg_subr $float function-mode) (defun romberg-macro (form translatep) (setq form (cdr form)) (cond ((= (length form) 3) (cond (translatep `(($romberg_subr) ,@form)) (t `((mprog) ((mlist) ((msetq) $numer t) ((msetq) $%enumer t)) (($romberg_subr) ,@form))))) ((= (length form) 4) (destructuring-let (((exp var . bnds) form)) (cond (translatep `(($romberg_subr) ((lambda-i) ((mlist) ,var) (($modedeclare) ,var $float) ,exp) ,@bnds)) (t `((mprog) ((mlist) ((msetq) $numer t) ((msetq) $%enumer t)) (($romberg_subr) ((lambda) ((mlist) ,var) ,exp) ,@bnds)))))) (t (wna-err '$romberg)))) (defmspec $romberg (form) (meval (romberg-macro form nil))) (def-translate-property $romberg (form) (let (($tr_numer t)) (translate (romberg-macro form t)))) ; Following stuff (from here to end of file) is copied from src/trdata.lisp (def-autoload-translate $romberg) (eval-when (load) (mapc #'(lambda (x) (putprop x '$float 'function-mode)) '($romberg_subr))) |
From: Robert D. <rob...@us...> - 2007-01-08 01:45:22
|
Update of /cvsroot/maxima/maxima/tests In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32494/tests Modified Files: rtest1.mac Log Message: Move romberg function from src to share, since QUADPACK is a better numerical integration package. This topic was discussed on the Maxima mailing list circa 2007/01/02. Also revise the documentation for romberg. Also rename romberg files from rombrg.* to romberg.* . After these changes, make; make check; make install succeeds. run_testsuite is happy and ? romberg shows documentation. New files: - doc/info/romberg.texi: romberg stuff from Integration.texi, revised Moved files: - demo/rombrg.dem --> demo/romberg.dem - doc/share/rombrg.usg --> doc/share/romberg.usg - src/rombrg.lisp --> share/numeric/romberg.lisp Modified files: - demo/Makefile.am: rombrg.dem --> romberg.dem - doc/info/Integration.texi: remove romberg stuff - doc/info/Makefile.am: list new file romberg.texi - doc/info/maxima.texi: romberg stuff now separate from Integration - doc/share/Makefile.am: rombrg.usg --> romberg.usg - share/Makefile.am: list new file numeric/romberg.lisp - src/Makefile.am src/{acl,clisp,cmucl,gcl,openmcl,sbcl,scl}-depends.mk: remove rombrg.lisp from list of files - src/maxima.system: remove rombrg from list of files - src/sys-proclaim.lisp: remove romberg symbols from list - src/lmdcls.lisp: remove romberg symbols from list - src/trdata.lisp: remove romberg stuff (paste to share/numeric/romberg.lisp) - tests/rtest1.mac: remove test for romberg Index: rtest1.mac =================================================================== RCS file: /cvsroot/maxima/maxima/tests/rtest1.mac,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- rtest1.mac 14 Nov 2004 06:17:35 -0000 1.2 +++ rtest1.mac 8 Jan 2007 01:45:18 -0000 1.3 @@ -70,5 +70,3 @@ g(fun,a,b):=print(fun," applied to ",a," and ",b," is ",fun(a,b))$ g(f[2,1],sin(%pi),2*c); 2*c$ -romberg(sin(y),y,1,%pi); -1.540302306426815$ |
From: Robert D. <rob...@us...> - 2007-01-08 01:45:21
|
Update of /cvsroot/maxima/maxima/doc/share In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32494/doc/share Modified Files: Makefile.am Added Files: romberg.usg Removed Files: rombrg.usg Log Message: Move romberg function from src to share, since QUADPACK is a better numerical integration package. This topic was discussed on the Maxima mailing list circa 2007/01/02. Also revise the documentation for romberg. Also rename romberg files from rombrg.* to romberg.* . After these changes, make; make check; make install succeeds. run_testsuite is happy and ? romberg shows documentation. New files: - doc/info/romberg.texi: romberg stuff from Integration.texi, revised Moved files: - demo/rombrg.dem --> demo/romberg.dem - doc/share/rombrg.usg --> doc/share/romberg.usg - src/rombrg.lisp --> share/numeric/romberg.lisp Modified files: - demo/Makefile.am: rombrg.dem --> romberg.dem - doc/info/Integration.texi: remove romberg stuff - doc/info/Makefile.am: list new file romberg.texi - doc/info/maxima.texi: romberg stuff now separate from Integration - doc/share/Makefile.am: rombrg.usg --> romberg.usg - share/Makefile.am: list new file numeric/romberg.lisp - src/Makefile.am src/{acl,clisp,cmucl,gcl,openmcl,sbcl,scl}-depends.mk: remove rombrg.lisp from list of files - src/maxima.system: remove rombrg from list of files - src/sys-proclaim.lisp: remove romberg symbols from list - src/lmdcls.lisp: remove romberg symbols from list - src/trdata.lisp: remove romberg stuff (paste to share/numeric/romberg.lisp) - tests/rtest1.mac: remove test for romberg --- NEW FILE: romberg.usg --- ROMBERG is now MACSYM;ROMBRG FASL and is autoloading. Just call ROMBERG and it will be there. - JPG GJC@MIT-MC 01/12/81 13:50:27 To: (FILE [SHARE;ROMBRG USAGE]) at MIT-MC The old conventions of what are efficient ways to call ROMBERG, or what are ways which work in at all, are now repaired. Given F(N):=ROMBERG(expression,VAR,0,N)$ If F is translated/compiled then the expression will also be translated/compiled! Also, the old "efficient" way, which could ONLY BE USED ON TRANSLATED FUNCTIONS, (what a pain in the neck right?), now works on all functions. This change is made possible due to the increased power of the macsyma->lisp translator, and some reworking of the numerical code. [Anonymous functions, i.e. LAMBDA expressions, are now translated into lisp functions.] The entry point to ROMBERG is now ROMBERG_SUBR, which only takes 3 arguments, the first being a function. [This is never seen by the user.] ROMBERG(F,A,B) => ROMBERG_SUBR(F,A,B) ROMBERG(X^2,X,A,B) => ROMBERG_SUBR(LAMBDA([X],X^2),A,B) The arrow "=>" signifies a transformation which takes place through the same mechanisms as the *new* macsyma "macro" feature. To see how this feature can be useful in numerical applications see SHARE;SIMPSN MACRO. Proper use of MODE_DECLARE is still important of course. p.s. These same extensions apply to the syntax of the INTERPOLATE command. However, the restrictions on the use of the PLOT2 command unfortunately still hold. This takes lots of work on PLOT2 to fix. GJC@MIT-MC 03/20/80 19:09:30 To: (FILE [SHARE;ROMBRG USAGE]) at MIT-MC The source for ROMBERG is now MAXSRC;ROMBRG > and NUMER;ROMBRG MMACRO. The three argument version of ROMBERG now works for macsyma functions, not just translated functions. Problems with arguments not getting properly floated, e.g. ROMBERG(X,X,1/10,2/10) have been fixed, problems with the arguments to ROMBERG not getting evaluated in compiled code have been fixed. CFFK@MIT-MC 12 AUG 1979 1743-EDT To: (FILE [SHARE;ROMBRG USAGE]) at MIT-MC At SK's suggestion, ROMBERG (BROMBERG) will now exit if an absolute error condition is satisfied. This is governed by the new variable ROMBERGABS (BROMBERABS) - default value 0.0 (0.0B0). Assuming that successive estimates produced by ROMBERG are Y[0], Y[1], Y[2] etc., then ROMBERG will return after N iterations if (roughly speaking) (ABS(Y[N]-Y[N-1]) <= ROMBERGABS OR ABS(Y[N]-Y[N-1])/(IF Y[N]=0.0 THEN 1.0 ELSE Y[N]) <= ROMBERGTOL) is TRUE. (The condition on the number of iterations given by ROMBERGMIN must also be satisfied.) (The old exit condition, was on the relative error if ABS(Y[N]) > 1.0, and on the absolute error otherwise. Pretty random!) Thus if ROMBERGABS is 0.0 (the default) you just get the relative error test. The usefulness of the additional variable comes when you want to perform an integral, where the dominant contribution comes from a small region. Then you can do the integral over the small dominant region first, using the relative accuracy check, followed by the integral over the rest of the region using the absolute accuracy check. Example: Suppose you want to compute Integral(exp(-x),x,0,50) (numerically) with a relative accuracy of 1 part in 10000000. /* Define the function. N is a counter, so we can see how many function evaluations were needed. */ F(X):=(MODEDECLARE(N,INTEGER,X,FLOAT),N:N+1,EXP(-X))$ TRANSLATE(F)$ /* First of all try doing the whole integral at once */ BLOCK([ROMBERGTOL:1.E-6,ROMBERABS:0.],N:0,ROMBERG(F,0,50)); ==> 1.00000003 N; ==> 257 /* Number of function evaluations*/ /* Now do the integral intelligently, by first doing Integral(exp(-x),x,0,10) and then setting ROMBERGABS to 1.E-6*(this partial integral). */ BLOCK([ROMBERGTOL:1.E-6,ROMBERGABS:0.,SUM:0.], N:0,SUM:ROMBERG(F,0,10),ROMBERGABS:SUM*ROMBERGTOL,ROMBERGTOL:0., SUM+ROMBERG(F,10,50)); ==> 1.00000001 /* Same as before */ N; ==> 130 So if F(X) were a function that took a long time to compute, the second method would be about 2 times quicker. CFFK@MIT-MC 05/04/78 16:52:43 To: (FILE [SHARE;ROMBRG USAGE]) at MIT-MC There is a new option ROMBERGMIN whose default value is 0, that govern the minimum number of function evaluations that ROMBERG will make. ROMBERG will evaluate its first arg. at least 2^(ROMBERGMIN+2)+1 times. This is useful for integrating oscillatory functions, when the normal converge test might sometimes wrongly pass. There are 2 ways of using this function: 1) An inefficient way that looks like the definite integral version of INTEGRATE: ROMBERG(<integrand>,<variable of integration>,<lower limit>, <upper limit>); Examples: ROMBERG(SIN(Y),Y,1,%PI); TIME= 39 MSEC. 1.5403023 F(X):=1/(X^5+X+1); ROMBERG(F(X),X,1.5,0); TIME= 162 MSEC. - 0.75293843 2) An efficient way that is more like RJF's ROMBERG function: ROMBERG(<function name>,<lower limit>,<upper limit>); Example: F(X):=(MODEDECLARE([FUNCTION(F),X],FLOAT),1/(X^5+X+1)); TRANSLATE(F); ROMBERG(F,1.5,0); TIME= 13 MSEC. - 0.75293843 The first argument must be a TRANSLATEd or compiled function, which returns a floating point number. (If it is compiled it must be declared to return a FLONUM.) If the first argument is not already TRANSLATEd, ROMBERG will not attempt to TRANSLATE it but will give an error. The accuracy of the integration is governed by the global variables ROMBERGTOL (default value 1.E-4) and ROMBERGIT (default value 11). ROMBERG will return a result if the relative difference in successive approximations is less than ROMBERGTOL. It will try halving the stepsize ROMBERGIT times before it gives up. ROMBERG may be called recursively and thus can do double and triple integrals. Example: INTEGRATE(INTEGRATE(X*Y/(X+Y),Y,0,X/2),X,1,3); 13/3 (2 LOG(2/3) + 1) %,NUMER; 0.81930233 DEFINE_VARIABLE(X,0.0,FLOAT,"Global variable in function F")$ F(Y):=(MODE_DECLARE(Y,FLOAT), X*Y/(X+Y) )$ G(X):=ROMBERG('F,0,X/2)$ ROMBERG(G,1,3); 0.8193023 The advantage with this way is that the function F can be used for other purposes, like plotting. The disadvantage is that you have to think up a name for both the function F and its free variable X. Or, without the global: G1(X):=(MODE_DECLARE(X,FLOAT), ROMBERG(X*Y/(X+Y),Y,0,X/2))$ ROMBERG(G1,1,3); 0.8193023 The advantage here is shortness. Q(A,B):=ROMBERG(ROMBERG(X*Y/(X+Y),Y,0,X/2),X,A,B)$ Q(1,3); 0.8193023 It is even shorter this way, and the variables do not need to be declared because they are in the context of ROMBERG. Use of ROMBERG for multiple integrals can have great disadvantages, though. The amount of extra calculation needed because of the geometric information thrown away by expressing multiple integrals this way can be incredible. The user should understand and use the ROMBERGTOL and ROMBERGIT switches. Index: Makefile.am =================================================================== RCS file: /cvsroot/maxima/maxima/doc/share/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 8 Jan 2006 09:02:22 -0000 1.5 +++ Makefile.am 8 Jan 2007 01:45:17 -0000 1.6 @@ -1,3 +1,3 @@ include $(top_srcdir)/common.mk -docshare_DATA = bessel.usg brchre.txt rombrg.usg translation_hints.txt +docshare_DATA = bessel.usg brchre.txt romberg.usg translation_hints.txt EXTRA_DIST = $(docshare_DATA) --- rombrg.usg DELETED --- |
From: Robert D. <rob...@us...> - 2007-01-08 01:45:21
|
Update of /cvsroot/maxima/maxima/share In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32494/share Modified Files: Makefile.am Log Message: Move romberg function from src to share, since QUADPACK is a better numerical integration package. This topic was discussed on the Maxima mailing list circa 2007/01/02. Also revise the documentation for romberg. Also rename romberg files from rombrg.* to romberg.* . After these changes, make; make check; make install succeeds. run_testsuite is happy and ? romberg shows documentation. New files: - doc/info/romberg.texi: romberg stuff from Integration.texi, revised Moved files: - demo/rombrg.dem --> demo/romberg.dem - doc/share/rombrg.usg --> doc/share/romberg.usg - src/rombrg.lisp --> share/numeric/romberg.lisp Modified files: - demo/Makefile.am: rombrg.dem --> romberg.dem - doc/info/Integration.texi: remove romberg stuff - doc/info/Makefile.am: list new file romberg.texi - doc/info/maxima.texi: romberg stuff now separate from Integration - doc/share/Makefile.am: rombrg.usg --> romberg.usg - share/Makefile.am: list new file numeric/romberg.lisp - src/Makefile.am src/{acl,clisp,cmucl,gcl,openmcl,sbcl,scl}-depends.mk: remove rombrg.lisp from list of files - src/maxima.system: remove rombrg from list of files - src/sys-proclaim.lisp: remove romberg symbols from list - src/lmdcls.lisp: remove romberg symbols from list - src/trdata.lisp: remove romberg stuff (paste to share/numeric/romberg.lisp) - tests/rtest1.mac: remove test for romberg Index: Makefile.am =================================================================== RCS file: /cvsroot/maxima/maxima/share/Makefile.am,v retrieving revision 1.102 retrieving revision 1.103 diff -u -d -r1.102 -r1.103 --- Makefile.am 6 Jan 2007 19:19:31 -0000 1.102 +++ Makefile.am 8 Jan 2007 01:45:18 -0000 1.103 @@ -549,6 +549,7 @@ numeric/newton.mac\ numeric/newton1.mac\ numeric/riemsum.mac\ +numeric/romberg.lisp\ numeric/simpsn.dem\ numeric/simpsn.mac\ numeric/submac.dem\ |
From: Robert D. <rob...@us...> - 2007-01-08 01:45:20
|
Update of /cvsroot/maxima/maxima/doc/info In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32494/doc/info Modified Files: Integration.texi Makefile.am maxima.texi Added Files: romberg.texi Log Message: Move romberg function from src to share, since QUADPACK is a better numerical integration package. This topic was discussed on the Maxima mailing list circa 2007/01/02. Also revise the documentation for romberg. Also rename romberg files from rombrg.* to romberg.* . After these changes, make; make check; make install succeeds. run_testsuite is happy and ? romberg shows documentation. New files: - doc/info/romberg.texi: romberg stuff from Integration.texi, revised Moved files: - demo/rombrg.dem --> demo/romberg.dem - doc/share/rombrg.usg --> doc/share/romberg.usg - src/rombrg.lisp --> share/numeric/romberg.lisp Modified files: - demo/Makefile.am: rombrg.dem --> romberg.dem - doc/info/Integration.texi: remove romberg stuff - doc/info/Makefile.am: list new file romberg.texi - doc/info/maxima.texi: romberg stuff now separate from Integration - doc/share/Makefile.am: rombrg.usg --> romberg.usg - share/Makefile.am: list new file numeric/romberg.lisp - src/Makefile.am src/{acl,clisp,cmucl,gcl,openmcl,sbcl,scl}-depends.mk: remove rombrg.lisp from list of files - src/maxima.system: remove rombrg from list of files - src/sys-proclaim.lisp: remove romberg symbols from list - src/lmdcls.lisp: remove romberg symbols from list - src/trdata.lisp: remove romberg stuff (paste to share/numeric/romberg.lisp) - tests/rtest1.mac: remove test for romberg --- NEW FILE: romberg.texi --- @menu * Definitions for romberg:: @end menu @node Definitions for romberg, , Top, Top @section Definitions for romberg @deffn {Function} romberg (@var{expr}, @var{x}, @var{a}, @var{b}) @deffnx {Function} romberg (@var{F}, @var{a}, @var{b}) Computes a numerical integration by Romberg's method. @code{romberg(@var{expr}, @var{x}, @var{a}, @var{b})} returns an estimate of the integral @code{integrate(@var{expr}, @var{x}, @var{a}, @var{b})}. @var{expr} must be an expression which evaluates to a floating point value when @var{x} is bound to a floating point value. @code{romberg(@var{F}, @var{a}, @var{b})} returns an estimate of the integral @code{integrate(@var{F}(x), x, @var{a}, @var{b})} where @code{x} represents the unnamed, sole argument of @var{F}; the actual argument is not named @code{x}. @var{F} must be a Maxima or Lisp function which returns a floating point value when the argument is a floating point value. @var{F} may name a translated or compiled Maxima function. The accuracy of @code{romberg} is governed by the global variables @code{rombergabs} and @code{rombergtol}. @code{romberg} terminates successfully when the absolute difference between successive approximations is less than @code{rombergabs}, or the relative difference in successive approximations is less than @code{rombergtol}. Thus when @code{rombergabs} is 0.0 (the default) only the relative error test has any effect on @code{romberg}. @code{romberg} halves the stepsize at most @code{rombergit} times before it gives up; the maximum number of function evaluations is therefore @code{2^rombergit}. If the error criterion established by @code{rombergabs} and @code{rombergtol} is not satisfied, @code{romberg} prints an error message. @code{romberg} always makes at least @code{rombergmin} iterations; this is a heuristic intended to prevent spurious termination when the integrand is oscillatory. @code{romberg} repeatedly evaluates the integrand after binding the variable of integration to a specific value (and not before). This evaluation policy makes it possible to nest calls to @code{romberg}, to compute multidimensional integrals. However, the error calculations do not take the errors of nested integrations into account, so errors may be underestimated. Also, methods devised especially for multidimensional problems may yield the same accuracy with fewer function evaluations. @code{load(romberg)} loads this function. See also @code{QUADPACK}, a collection of numerical integration functions. Examples: A 1-dimensional integration. @c ===beg=== @c load (romberg); @c f(x) := 1/((x - 1)^2 + 1/100) + 1/((x - 2)^2 + 1/1000) + 1/((x - 3)^2 + 1/200); @c rombergtol : 1e-6; @c rombergit : 15; @c estimate : romberg (f(x), x, -5, 5); @c exact : integrate (f(x), x, -5, 5); @c abs (estimate - exact) / exact, numer; @c ===end=== @example (%i1) load (romberg); (%o1) /usr/share/maxima/5.11.0/share/numeric/romberg.lisp (%i2) f(x) := 1/((x - 1)^2 + 1/100) + 1/((x - 2)^2 + 1/1000) + 1/((x - 3)^2 + 1/200); 1 1 1 (%o2) f(x) := -------------- + --------------- + -------------- 2 1 2 1 2 1 (x - 1) + --- (x - 2) + ---- (x - 3) + --- 100 1000 200 (%i3) rombergtol : 1e-6; (%o3) 9.9999999999999995E-7 (%i4) rombergit : 15; (%o4) 15 (%i5) estimate : romberg (f(x), x, -5, 5); (%o5) 173.6730736617464 (%i6) exact : integrate (f(x), x, -5, 5); (%o6) 10 sqrt(10) atan(70 sqrt(10)) + 10 sqrt(10) atan(30 sqrt(10)) + 10 sqrt(2) atan(80 sqrt(2)) + 10 sqrt(2) atan(20 sqrt(2)) + 10 atan(60) + 10 atan(40) (%i7) abs (estimate - exact) / exact, numer; (%o7) 7.5527060865060088E-11 @end example A 2-dimensional integration, implemented by nested calls to @code{romberg}. @c ===beg=== @c load (romberg); @c g(x, y) := x*y / (x + y); @c rombergtol : 1e-6; @c estimate : romberg (romberg (g(x, y), y, 0, x/2), x, 1, 3); @c assume (x > 0); @c integrate (integrate (g(x, y), y, 0, x/2), x, 1, 3); @c exact : radcan (%); @c abs (estimate - exact) / exact, numer; @c ===end=== @example (%i1) load (romberg); (%o1) /usr/share/maxima/5.11.0/share/numeric/romberg.lisp (%i2) g(x, y) := x*y / (x + y); x y (%o2) g(x, y) := ----- x + y (%i3) rombergtol : 1e-6; (%o3) 9.9999999999999995E-7 (%i4) estimate : romberg (romberg (g(x, y), y, 0, x/2), x, 1, 3); (%o4) 0.81930239628356 (%i5) assume (x > 0); (%o5) [x > 0] (%i6) integrate (integrate (g(x, y), y, 0, x/2), x, 1, 3); 3 2 log(-) - 1 9 2 9 (%o6) - 9 log(-) + 9 log(3) + ------------ + - 2 6 2 (%i7) exact : radcan (%); 26 log(3) - 26 log(2) - 13 (%o7) - -------------------------- 3 (%i8) abs (estimate - exact) / exact, numer; (%o8) 1.3711979871851024E-10 @end example @end deffn @defvr {Option variable} rombergabs Default value: 0.0 The accuracy of @code{romberg} is governed by the global variables @code{rombergabs} and @code{rombergtol}. @code{romberg} terminates successfully when the absolute difference between successive approximations is less than @code{rombergabs}, or the relative difference in successive approximations is less than @code{rombergtol}. Thus when @code{rombergabs} is 0.0 (the default) only the relative error test has any effect on @code{romberg}. See also @code{rombergit} and @code{rombergmin}. @end defvr @defvr {Option variable} rombergit Default value: 11 @code{romberg} halves the stepsize at most @code{rombergit} times before it gives up; the maximum number of function evaluations is therefore @code{2^rombergit}. @code{romberg} always makes at least @code{rombergmin} iterations; this is a heuristic intended to prevent spurious termination when the integrand is oscillatory. See also @code{rombergabs} and @code{rombergtol}. @end defvr @defvr {Option variable} rombergmin Default value: 0 @code{romberg} always makes at least @code{rombergmin} iterations; this is a heuristic intended to prevent spurious termination when the integrand is oscillatory. See also @code{rombergit}, @code{rombergabs}, and @code{rombergtol}. @end defvr @defvr {Option variable} rombergtol Default value: 1e-4 The accuracy of @code{romberg} is governed by the global variables @code{rombergabs} and @code{rombergtol}. @code{romberg} terminates successfully when the absolute difference between successive approximations is less than @code{rombergabs}, or the relative difference in successive approximations is less than @code{rombergtol}. Thus when @code{rombergabs} is 0.0 (the default) only the relative error test has any effect on @code{romberg}. See also @code{rombergit} and @code{rombergmin}. @end defvr Index: Integration.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/Integration.texi,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- Integration.texi 6 Jan 2007 19:19:30 -0000 1.29 +++ Integration.texi 8 Jan 2007 01:45:16 -0000 1.30 @@ -11,9 +11,8 @@ Maxima has several routines for handling integration. The @code{integrate} function makes use of most of them. There is also the @code{antid} package, which handles an unspecified function (and its -derivatives, of course). For numerical uses, there is the @code{romberg} -function; -and a set of adaptive integrators from Quadpack, +derivatives, of course). For numerical uses, +there is a set of adaptive integrators from QUADPACK, named @code{quad_qag}, @code{quad_qags}, etc., which are described under the heading @code{QUADPACK}. Hypergeometric functions are being worked on, see @code{specint} for details. @@ -549,207 +548,6 @@ @end deffn -@c NEEDS WORK BUT DON'T BOTHER TO CLEAN IT UP: -@c THE GAUSS-KRONROD FUNCTIONS (QUADPACK) MAKE THIS OBSOLETE -@deffn {Function} romberg (@var{expr}, @var{x}, @var{a}, @var{b}) -@deffnx {Function} romberg (@var{expr}, @var{a}, @var{b}) -Romberg integration. -There are two ways to use this function. The first is an inefficient -way like the definite integral version of @code{integrate}: -@code{romberg (<integrand>, <variable of integration>, <lower limit>, <upper limit>)}. - -Examples: - -@example -(%i1) showtime: true$ -(%i2) romberg (sin(y), y, 0, %pi); -Evaluation took 0.00 seconds (0.01 elapsed) using 25.293 KB. -(%o2) 2.000000016288042 -(%i3) 1/((x-1)^2+1/100) + 1/((x-2)^2+1/1000) + 1/((x-3)^2+1/200)$ -(%i4) f(x) := ''%$ -(%i5) rombergtol: 1e-6$ -(%i6) rombergit: 15$ -(%i7) romberg (f(x), x, -5, 5); -Evaluation took 11.97 seconds (12.21 elapsed) using 12.423 MB. -(%o7) 173.6730736617464 -@c INCLUDE THIS COMPARISON TO EXACT RESULT ??? YIELDS A LOT OF "RAT replaced" MESSAGES !!! -@c integrate (f(x), x, -5, 5) - %, numer; -@end example - -The second is an efficient way that is used as follows: - -@example -romberg (<function name>, <lower limit>, <upper limit>); -@end example - -Continuing the above example, we have: -@example -(%i8) f(x) := (mode_declare ([function(f), x], float), ''(%th(5)))$ -(%i9) translate(f); -(%o9) [f] -(%i10) romberg (f, -5, 5); -Evaluation took 3.51 seconds (3.86 elapsed) using 6.641 MB. -(%o10) 173.6730736617464 -@end example - -The first argument must be a translated or compiled function. (If it -is compiled it must be declared to return a @code{flonum}.) If the first -argument is not already translated, @code{romberg} will not attempt to -translate it but will give an error. - -The accuracy of the integration is governed by the global variables -@code{rombergtol} (default value 1.E-4) and @code{rombergit} (default value 11). -@code{romberg} will return a result if the relative difference in successive -approximations is less than @code{rombergtol}. It will try halving the -stepsize @code{rombergit} times before it gives up. The number of iterations -and function evaluations which @code{romberg} will do is governed by -@code{rombergabs} and @code{rombergmin}. - -@code{romberg} may be called recursively and thus can do double and triple -integrals. - -Example: -@example -(%i1) assume (x > 0)$ -(%i2) integrate (integrate (x*y/(x+y), y, 0, x/2), x, 1, 3)$ -(%i3) radcan (%); - 26 log(3) - 26 log(2) - 13 -(%o3) - -------------------------- - 3 -(%i4) %,numer; -(%o4) .8193023963959073 -(%i5) define_variable (x, 0.0, float, "Global variable in function F")$ -(%i6) f(y) := (mode_declare (y, float), x*y/(x+y))$ -(%i7) g(x) := romberg ('f, 0, x/2)$ -(%i8) romberg (g, 1, 3); -(%o8) .8193022864324522 -@end example - -The advantage with this way is that the function @code{f} can be used for other -purposes, like plotting. The disadvantage is that you have to think up -a name for both the function @code{f} and its free variable @code{x}. -Or, without the global: - -@example -(%i1) g_1(x) := (mode_declare (x, float), romberg (x*y/(x+y), y, 0, x/2))$ -(%i2) romberg (g_1, 1, 3); -(%o2) .8193022864324522 -@end example - -The advantage here is shortness. - -@example -(%i3) q (a, b) := romberg (romberg (x*y/(x+y), y, 0, x/2), x, a, b)$ -(%i4) q (1, 3); -(%o4) .8193022864324522 -@end example - -It is even shorter this way, and the variables do not need to be declared -because they are in the context of @code{romberg}. -Use of @code{romberg} for multiple integrals can have great disadvantages, -though. The amount of extra calculation needed because of the -geometric information thrown away by expressing multiple integrals -this way can be incredible. The user should be sure to understand and -use the @code{rombergtol} and @code{rombergit} switches. - -@end deffn - -@defvr {Option variable} rombergabs -Default value: 0.0 - -Assuming that successive estimates -produced by @code{romberg} are @code{y[0]}, @code{y[1]}, @code{y[2]}, etc., then @code{romberg} will -return after @code{n} iterations if (roughly speaking) - -@example - (abs(y[n]-y[n-1]) <= rombergabs or - abs(y[n]-y[n-1])/(if y[n]=0.0 then 1.0 else y[n]) <= rombergtol) -@end example - -is @code{true}. (The condition on the number of iterations given by -@code{rombergmin} must also be satisfied.) -Thus if @code{rombergabs} is 0.0 (the default) you just get the relative -error test. The usefulness of the additional variable comes when you -want to perform an integral, where the dominant contribution comes -from a small region. Then you can do the integral over the small -dominant region first, using the relative accuracy check, followed by -the integral over the rest of the region using the absolute accuracy -check. - -Example: Suppose you want to compute - -@example -'integrate (exp(-x), x, 0, 50) -@end example - -(numerically) with a relative accuracy of 1 part in 10000000. -Define the function. @code{n} is a counter, so we can see how many -function evaluations were needed. -First of all try doing the whole integral at once. - -@example -(%i1) f(x) := (mode_declare (n, integer, x, float), n:n+1, exp(-x))$ -(%i2) translate(f)$ -Warning-> n is an undefined global variable. -(%i3) block ([rombergtol: 1.e-6, romberabs: 0.0], n:0, romberg (f, 0, 50)); -(%o3) 1.000000000488271 -(%i4) n; -(%o4) 257 -@end example - -That approach required 257 function evaluations. - Now do the integral intelligently, by first doing - @code{'integrate (exp(-x), x, 0, 10)} and then setting @code{rombergabs} to 1.E-6 times (this - partial integral). -This approach takes only 130 function evaluations. - -@example -(%i5) block ([rombergtol: 1.e-6, rombergabs:0.0, sum:0.0], - n: 0, sum: romberg (f, 0, 10), rombergabs: sum*rombergtol, rombergtol:0.0, - sum + romberg (f, 10, 50)); -(%o5) 1.000000001234793 -(%i6) n; -(%o6) 130 -@end example - -So if @code{f(x)} were a function that took a long time to compute, the -second method would be about 2 times quicker. - -@end defvr - -@defvr {Option variable} rombergit -Default value: 11 - -The accuracy of the @code{romberg} integration -command is governed by the global variables @code{rombergtol} and -@code{rombergit}. @code{romberg} will return a result if the relative -difference in successive approximations is less than @code{rombergtol}. It -will try halving the stepsize @code{rombergit} times before it gives up. - -@end defvr - -@defvr {Option variable} rombergmin -Default value: 0 - -@code{rombergmin} governs the minimum number of function -evaluations that @code{romberg} will make. @code{romberg} will evaluate its first -arg. at least @code{2^(rombergmin+2)+1} times. This is useful for -integrating oscillatory functions, when the normal converge test might -sometimes wrongly pass. - -@end defvr - -@defvr {Option variable} rombergtol -Default value: 1e-4 - -The accuracy of the @code{romberg} integration -command is governed by the global variables @code{rombergtol} and -@code{rombergit}. @code{romberg} will return a result if the relative -difference in successive approximations is less than @code{rombergtol}. It -will try halving the stepsize @code{rombergit} times before it gives up. - -@end defvr - @c NEEDS EXPANSION, CLARIFICATION, AND EXAMPLES @deffn {Function} tldefint (@var{expr}, @var{x}, @var{a}, @var{b}) Equivalent to @code{ldefint} with @code{tlimswitch} set to @code{true}. Index: Makefile.am =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/Makefile.am,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- Makefile.am 15 Dec 2006 13:40:06 -0000 1.46 +++ Makefile.am 8 Jan 2007 01:45:16 -0000 1.47 @@ -33,7 +33,7 @@ mnewton.texi lsquares.texi plotdf.texi lindstedt.texi impdiff.texi \ ggf.texi f90.texi eval_string.texi diag.texi cholesky.texi dynamics.texi\ bode.texi augmented_lagrangian.texi opsubst.texi stats.texi stirling.texi\ - implicit_plot.texi interpol.texi lbfgs.texi + implicit_plot.texi interpol.texi lbfgs.texi romberg.texi figurefiles = \ figures/dynamics1.gif\ Index: maxima.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/maxima.texi,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- maxima.texi 24 Dec 2006 08:23:04 -0000 1.38 +++ maxima.texi 8 Jan 2007 01:45:16 -0000 1.39 @@ -161,6 +161,7 @@ * opsubst:: Substitutions utility. * orthopoly:: Orthogonal polynomials. * plotdf:: Direction fields plots. +* romberg:: Romberg method for numerical integration. * simplex:: Linear programming. * simplification:: Simplification rules and functions. * solve_rec:: Linear recurrences. @@ -495,6 +496,10 @@ * Introduction to plotdf:: * Definitions for plotdf:: +romberg + +* Definitions for romberg:: + simplex * Introduction to simplex:: @@ -804,11 +809,15 @@ @chapter orthopoly @include orthopoly.texi -@node plotdf, simplex, orthopoly, Top +@node plotdf, romberg, orthopoly, Top @chapter plotdf @include plotdf.texi -@node simplex, simplification, plotdf, Top +@node romberg, simplex, plotdf, Top +@chapter romberg +@include romberg.texi + +@node simplex, simplification, romberg, Top @chapter simplex @include simplex.texi |
From: Robert D. <rob...@us...> - 2007-01-08 01:45:20
|
Update of /cvsroot/maxima/maxima/demo In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32494/demo Modified Files: Makefile.am Added Files: romberg.dem Removed Files: rombrg.dem Log Message: Move romberg function from src to share, since QUADPACK is a better numerical integration package. This topic was discussed on the Maxima mailing list circa 2007/01/02. Also revise the documentation for romberg. Also rename romberg files from rombrg.* to romberg.* . After these changes, make; make check; make install succeeds. run_testsuite is happy and ? romberg shows documentation. New files: - doc/info/romberg.texi: romberg stuff from Integration.texi, revised Moved files: - demo/rombrg.dem --> demo/romberg.dem - doc/share/rombrg.usg --> doc/share/romberg.usg - src/rombrg.lisp --> share/numeric/romberg.lisp Modified files: - demo/Makefile.am: rombrg.dem --> romberg.dem - doc/info/Integration.texi: remove romberg stuff - doc/info/Makefile.am: list new file romberg.texi - doc/info/maxima.texi: romberg stuff now separate from Integration - doc/share/Makefile.am: rombrg.usg --> romberg.usg - share/Makefile.am: list new file numeric/romberg.lisp - src/Makefile.am src/{acl,clisp,cmucl,gcl,openmcl,sbcl,scl}-depends.mk: remove rombrg.lisp from list of files - src/maxima.system: remove rombrg from list of files - src/sys-proclaim.lisp: remove romberg symbols from list - src/lmdcls.lisp: remove romberg symbols from list - src/trdata.lisp: remove romberg stuff (paste to share/numeric/romberg.lisp) - tests/rtest1.mac: remove test for romberg --- NEW FILE: romberg.dem --- define_variable(pi,apply('ev,[%pi,numer:true]),float)$ define_variable(freq,3.3,float,"the frequency in radians/second")$ v(x):=(modedeclare(x,float),x*abs(sin(freq*x)))$ h1(freq):=romberg('v,0,pi)$ /* an alternative syntax is */ h2(freq):=romberg(x*abs(sin(freq*x)),x,0,pi)$ h1(5.5); h2(5.5); translate(h1,v,h2)$ h1(5.5); h2(5.5); compile(functions); h1(5.5); h2(5.5); Index: Makefile.am =================================================================== RCS file: /cvsroot/maxima/maxima/demo/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 16 Aug 2002 18:24:37 -0000 1.3 +++ Makefile.am 8 Jan 2007 01:45:17 -0000 1.4 @@ -11,7 +11,7 @@ manual.demo\ newfac.dem\ plots.mac\ -rombrg.dem\ +romberg.dem\ subscr.dem\ sumcon.dem\ trgsmp.dem --- rombrg.dem DELETED --- |
From: Robert D. <rob...@us...> - 2007-01-07 20:03:03
|
Update of /cvsroot/maxima/maxima In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv14475 Removed Files: rtest_zeilberger_extreme.mac rtest_zeilberger.mac Log Message: Move zeilberger rtest files to share/contrib/Zeilberger. Putting them in top-level maxima directory was unintended. Commit message for original versions of these files: Regression test files derived from testZeilberger.mac by Michel van den Bergh, as in email message 2007/01/07, and copied verbatim. --- rtest_zeilberger_extreme.mac DELETED --- --- rtest_zeilberger.mac DELETED --- |
From: Robert D. <rob...@us...> - 2007-01-07 20:03:00
|
Update of /cvsroot/maxima/maxima/share/contrib/Zeilberger In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv14475/share/contrib/Zeilberger Added Files: rtest_zeilberger_extreme.mac rtest_zeilberger.mac Log Message: Move zeilberger rtest files to share/contrib/Zeilberger. Putting them in top-level maxima directory was unintended. Commit message for original versions of these files: Regression test files derived from testZeilberger.mac by Michel van den Bergh, as in email message 2007/01/07, and copied verbatim. --- NEW FILE: rtest_zeilberger_extreme.mac --- /* converted from testZeilberger.mac */ kill(all); done$ (load(zeilberger),done); done$ /* EXTREME_TEST */ f5 : binomial(n,k)^5; binomial(n,k)^5$ zb_prove(f5,k,n,parGosper(f5,k,n,3)); true$ /* Wilson polynomials recurrence */ h6: binomial(n,k) * (n+a+b+c+d-2+k)! * (a+x+k-1)! * (a-x+k-1)! / (n+a+b+c+d-2)! / (a+b+k-1)! / (a+c+k-1)! / (a+d+k-1)! * (-1)^k; binomial(n,k) * (n+a+b+c+d-2+k)! * (a+x+k-1)! * (a-x+k-1)! / (n+a+b+c+d-2)! / (a+b+k-1)! / (a+c+k-1)! / (a+d+k-1)! * (-1)^k$ zb_prove(h6,k,n,parGosper(h6,k,n,2)); true$ /* Third special case of Strehl identity (MEMO, Feb 25, 1992) */ h12: binomial(n, k)^2 * binomial( 2*k, k) * binomial(2*k,n-k); binomial(n, k)^2 * binomial( 2*k, k) * binomial(2*k,n-k)$ zb_prove(h12,k,n,parGosper(h12,k,n,5)); true$ --- NEW FILE: rtest_zeilberger.mac --- kill(all); done$ (load(zeilberger),done); done$ /*=================================================================*/ /* converted from testZeilberger.mac (mvdb) */ /* ------------------------------ */ /* Gosper's algorithm's Test File */ /* GOSPER_TEST */ g1:(-1)^k*k/(4*k^2-1); k*(-1)^k/(4*k^2-1)$ zb_prove(g1,k,n,parGosper(g1,k,n,0)); true$ g2:1/(4*k^2-1); 1/(4*k^2-1)$ zb_prove(g2,k,n,parGosper(g2,k,n,0)); true$ g3:x^k; x^k$ zb_prove(g3,k,n,parGosper(g3,k,n,0)); true$ g4:(-1)^k*a!/(k!*(a-k)!); (-1)^k*a!/(k!*(a-k)!)$ zb_prove(g4,k,n,parGosper(g4,k,n,0)); true$ g5:k*k!; k*k!$ zb_prove(g5,k,n,parGosper(g5,k,n,0)); true$ g6:(k+1)*k!/(k+1)!; (k+1)*k!/(k+1)!$ zb_prove(g6,k,n,parGosper(g6,k,n,0)); true$ /* --------------------------------- */ /* Zeiberger's Algorithm's Test File */ /* EASY_TEST */ f1 : binomial(n,k); binomial(n,k)$ zb_prove(f1,k,n,parGosper(f1,k,n,1)); true$ f2 : binomial(n,k)^2; binomial(n,k)^2$ zb_prove(f2,k,n,parGosper(f2,k,n,1)); true$ f3 : binomial(n,k)^3; binomial(n,k)^3$ zb_prove(f3,k,n,parGosper(f3,k,n,2)); true$ f4 : binomial(n,k)^4; binomial(n,k)^4$ zb_prove(f4,k,n,parGosper(f4,k,n,2)); true$ /* Binomial theorem */ h1: binomial(n,k)*x^k; binomial(n,k)*x^k$ zb_prove(h1,k,n,parGosper(h1,k,n,1)); true$ /* Vandermonde identity recurrence */ h2: binomial(a, k)* binomial(b, n-k); binomial(a, k)* binomial(b, n-k); zb_prove(h2,k,n,parGosper(h2,k,n,1)); true$ /* Fibonacci-Recurrence */ h8: (-k+n)! / k! / (-2*k+n)!; (-k+n)! / k! / (-2*k+n)!$ zb_prove(h8,k,n,parGosper(h8,k,n,2)); true$ /* Trinomial coefficients */ h9: n! / k! / (k+m)! / (-2*k-m+n)!; n! / k! / (k+m)! / (-2*k-m+n)!$ zb_prove(h9,k,n,parGosper(h9,k,n,2)); true$ /* First special case of Strehl identity (MEMO, Feb 25, 1992) */ h10: binomial(n, k)^2 * binomial( 2*k, k); binomial(n, k)^2 * binomial( 2*k, k)$ zb_prove(h10,k,n,parGosper(h10,k,n,2)); true$ /* Fibonacci recurrence */ h13: (n+k)! * n! / k!^3 / (n-k)!^2; (n+k)! * n! / k!^3 / (n-k)!^2$ zb_prove(h13,k,n,parGosper(h13,k,n,2)); true$ /* Debugging artificial examples */ d1 : (2*n+k-1)!/(4*n+2*k)!; (2*n+k-1)!/(4*n+2*k)!$ zb_prove(d1,k,n,parGosper(d1,k,n,1)); true$ d2 : (3*n+k-1)!/(6*n+2*k)!; (3*n+k-1)!/(6*n+2*k)!$ zb_prove(d2,k,n,parGosper(d2,k,n,1)); true$ /* HARD_TEST */ /* Dixon's identity */ h3: binomial(n+b, n+k)* binomial(n+c, c+k)*binomial(b+c, b+k)*(-1)^k; binomial(n+b, n+k)* binomial(n+c, c+k)*binomial(b+c, b+k)*(-1)^k$ zb_prove(h3,k,n,parGosper(h3,k,n,1)); true$ /* Karlsson-Gosper identity 1 */ h4: binomial(n,k)*(n-1/4)!/(n-k-1/4)!/(2*n+k + 1/4)!*9^(-k); binomial(n,k)*(n-1/4)!/(n-k-1/4)!/(2*n+k + 1/4)!*9^(-k)$ zb_prove(h4,k,n,parGosper(h4,k,n,1)); true$ /* Karlsson-Gosper identity 2 */ h5: binomial(n,k) * (n-1/4)! / (n-k-1/4)! / (2*n+k+5/4)! * 9^(-k); binomial(n,k) * (n-1/4)! / (n-k-1/4)! / (2*n+k+5/4)! * 9^(-k)$ zb_prove(h5,k,n,parGosper(h5,k,n,1)); true$ /* Laguerre-Orthogonality */ h7: (k+k2)! * (n1)! * (n2)! / (k)! / (n1-k)! / (k2)! / (n2-k2)! / (k)! / (k2)! * (-1)^k; (k+k2)! * (n1)! * (n2)! / (k)! / (n1-k)! / (k2)! / (n2-k2)! / (k)! / (k2)! * (-1)^k$ zb_prove(h7,k,n1,parGosper(h7,k,n1,1)); true$ /* Second special case of Strehl identity (MEMO, Feb 25, 1992) */ h11: binomial(n, k)^2 * binomial( 2*k, k+a); binomial(n, k)^2 * binomial( 2*k, k+a)$ zb_prove(h11,k,n,parGosper(h11,k,n,3)); true$ /* EXTREME_TEST */ /* See rtest_zeilberger_extreme.mac */ /* End of converted file */ /* ================================================== */ /* test for unary minus, currently failing, fixed by Andrej */ ratsimp(AntiDifference(-1/(k*(k+1)),k)); 1/k$ /* suggested by Andrej */ /* currently failing */ AntiDifference(2^(k^2), k); NON_HYPERGEOMETRIC$ /* currently failing */ AntiDifference(k^k, k); NON_HYPERGEOMETRIC$ /* currently failing; works correctly with i replaced by j. */ Zeilberger(binomial(n,i), n, i); [[(n-i)/(i+1),[1]]]$ zb_prove(binomial(n,i),n,i,%); true$ |
From: Robert D. <rob...@us...> - 2007-01-07 19:58:21
|
Update of /cvsroot/maxima/maxima In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12746 Added Files: rtest_zeilberger_extreme.mac rtest_zeilberger.mac Log Message: Regression test files derived from testZeilberger.mac by Michel van den Bergh, as in email message 2007/01/07, and copied verbatim. --- NEW FILE: rtest_zeilberger_extreme.mac --- /* converted from testZeilberger.mac */ kill(all); done$ (load(zeilberger),done); done$ /* EXTREME_TEST */ f5 : binomial(n,k)^5; binomial(n,k)^5$ zb_prove(f5,k,n,parGosper(f5,k,n,3)); true$ /* Wilson polynomials recurrence */ h6: binomial(n,k) * (n+a+b+c+d-2+k)! * (a+x+k-1)! * (a-x+k-1)! / (n+a+b+c+d-2)! / (a+b+k-1)! / (a+c+k-1)! / (a+d+k-1)! * (-1)^k; binomial(n,k) * (n+a+b+c+d-2+k)! * (a+x+k-1)! * (a-x+k-1)! / (n+a+b+c+d-2)! / (a+b+k-1)! / (a+c+k-1)! / (a+d+k-1)! * (-1)^k$ zb_prove(h6,k,n,parGosper(h6,k,n,2)); true$ /* Third special case of Strehl identity (MEMO, Feb 25, 1992) */ h12: binomial(n, k)^2 * binomial( 2*k, k) * binomial(2*k,n-k); binomial(n, k)^2 * binomial( 2*k, k) * binomial(2*k,n-k)$ zb_prove(h12,k,n,parGosper(h12,k,n,5)); true$ --- NEW FILE: rtest_zeilberger.mac --- kill(all); done$ (load(zeilberger),done); done$ /*=================================================================*/ /* converted from testZeilberger.mac (mvdb) */ /* ------------------------------ */ /* Gosper's algorithm's Test File */ /* GOSPER_TEST */ g1:(-1)^k*k/(4*k^2-1); k*(-1)^k/(4*k^2-1)$ zb_prove(g1,k,n,parGosper(g1,k,n,0)); true$ g2:1/(4*k^2-1); 1/(4*k^2-1)$ zb_prove(g2,k,n,parGosper(g2,k,n,0)); true$ g3:x^k; x^k$ zb_prove(g3,k,n,parGosper(g3,k,n,0)); true$ g4:(-1)^k*a!/(k!*(a-k)!); (-1)^k*a!/(k!*(a-k)!)$ zb_prove(g4,k,n,parGosper(g4,k,n,0)); true$ g5:k*k!; k*k!$ zb_prove(g5,k,n,parGosper(g5,k,n,0)); true$ g6:(k+1)*k!/(k+1)!; (k+1)*k!/(k+1)!$ zb_prove(g6,k,n,parGosper(g6,k,n,0)); true$ /* --------------------------------- */ /* Zeiberger's Algorithm's Test File */ /* EASY_TEST */ f1 : binomial(n,k); binomial(n,k)$ zb_prove(f1,k,n,parGosper(f1,k,n,1)); true$ f2 : binomial(n,k)^2; binomial(n,k)^2$ zb_prove(f2,k,n,parGosper(f2,k,n,1)); true$ f3 : binomial(n,k)^3; binomial(n,k)^3$ zb_prove(f3,k,n,parGosper(f3,k,n,2)); true$ f4 : binomial(n,k)^4; binomial(n,k)^4$ zb_prove(f4,k,n,parGosper(f4,k,n,2)); true$ /* Binomial theorem */ h1: binomial(n,k)*x^k; binomial(n,k)*x^k$ zb_prove(h1,k,n,parGosper(h1,k,n,1)); true$ /* Vandermonde identity recurrence */ h2: binomial(a, k)* binomial(b, n-k); binomial(a, k)* binomial(b, n-k); zb_prove(h2,k,n,parGosper(h2,k,n,1)); true$ /* Fibonacci-Recurrence */ h8: (-k+n)! / k! / (-2*k+n)!; (-k+n)! / k! / (-2*k+n)!$ zb_prove(h8,k,n,parGosper(h8,k,n,2)); true$ /* Trinomial coefficients */ h9: n! / k! / (k+m)! / (-2*k-m+n)!; n! / k! / (k+m)! / (-2*k-m+n)!$ zb_prove(h9,k,n,parGosper(h9,k,n,2)); true$ /* First special case of Strehl identity (MEMO, Feb 25, 1992) */ h10: binomial(n, k)^2 * binomial( 2*k, k); binomial(n, k)^2 * binomial( 2*k, k)$ zb_prove(h10,k,n,parGosper(h10,k,n,2)); true$ /* Fibonacci recurrence */ h13: (n+k)! * n! / k!^3 / (n-k)!^2; (n+k)! * n! / k!^3 / (n-k)!^2$ zb_prove(h13,k,n,parGosper(h13,k,n,2)); true$ /* Debugging artificial examples */ d1 : (2*n+k-1)!/(4*n+2*k)!; (2*n+k-1)!/(4*n+2*k)!$ zb_prove(d1,k,n,parGosper(d1,k,n,1)); true$ d2 : (3*n+k-1)!/(6*n+2*k)!; (3*n+k-1)!/(6*n+2*k)!$ zb_prove(d2,k,n,parGosper(d2,k,n,1)); true$ /* HARD_TEST */ /* Dixon's identity */ h3: binomial(n+b, n+k)* binomial(n+c, c+k)*binomial(b+c, b+k)*(-1)^k; binomial(n+b, n+k)* binomial(n+c, c+k)*binomial(b+c, b+k)*(-1)^k$ zb_prove(h3,k,n,parGosper(h3,k,n,1)); true$ /* Karlsson-Gosper identity 1 */ h4: binomial(n,k)*(n-1/4)!/(n-k-1/4)!/(2*n+k + 1/4)!*9^(-k); binomial(n,k)*(n-1/4)!/(n-k-1/4)!/(2*n+k + 1/4)!*9^(-k)$ zb_prove(h4,k,n,parGosper(h4,k,n,1)); true$ /* Karlsson-Gosper identity 2 */ h5: binomial(n,k) * (n-1/4)! / (n-k-1/4)! / (2*n+k+5/4)! * 9^(-k); binomial(n,k) * (n-1/4)! / (n-k-1/4)! / (2*n+k+5/4)! * 9^(-k)$ zb_prove(h5,k,n,parGosper(h5,k,n,1)); true$ /* Laguerre-Orthogonality */ h7: (k+k2)! * (n1)! * (n2)! / (k)! / (n1-k)! / (k2)! / (n2-k2)! / (k)! / (k2)! * (-1)^k; (k+k2)! * (n1)! * (n2)! / (k)! / (n1-k)! / (k2)! / (n2-k2)! / (k)! / (k2)! * (-1)^k$ zb_prove(h7,k,n1,parGosper(h7,k,n1,1)); true$ /* Second special case of Strehl identity (MEMO, Feb 25, 1992) */ h11: binomial(n, k)^2 * binomial( 2*k, k+a); binomial(n, k)^2 * binomial( 2*k, k+a)$ zb_prove(h11,k,n,parGosper(h11,k,n,3)); true$ /* EXTREME_TEST */ /* See rtest_zeilberger_extreme.mac */ /* End of converted file */ /* ================================================== */ /* test for unary minus, currently failing, fixed by Andrej */ ratsimp(AntiDifference(-1/(k*(k+1)),k)); 1/k$ /* suggested by Andrej */ /* currently failing */ AntiDifference(2^(k^2), k); NON_HYPERGEOMETRIC$ /* currently failing */ AntiDifference(k^k, k); NON_HYPERGEOMETRIC$ /* currently failing; works correctly with i replaced by j. */ Zeilberger(binomial(n,i), n, i); [[(n-i)/(i+1),[1]]]$ zb_prove(binomial(n,i),n,i,%); true$ |
From: Jorge B. <fic...@us...> - 2007-01-07 19:33:19
|
Update of /cvsroot/maxima/maxima/doc/info/pt_BR In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv1915 Modified Files: Plotting.texi Log Message: Brazilian Portuguese translation. Plotting.texi -> adjusting the plot3d header Index: Plotting.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/pt_BR/Plotting.texi,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Plotting.texi 7 Jan 2007 11:36:16 -0000 1.3 +++ Plotting.texi 7 Jan 2007 19:33:16 -0000 1.4 @@ -57,12 +57,12 @@ @end deffn -@deffn {Fun@,{c}@~ao} plot2d (@var{expr}, @var{range}, ..., @var{options}, ...) -@deffnx {Fun@,{c}@~ao} plot2d (@var{parametric_expr}) -@deffnx {Fun@,{c}@~ao} plot2d ([@var{expr_1}, ..., @var{expr_n}], @var{x_range}, @var{y_range}) -@deffnx {Fun@,{c}@~ao} plot2d ([@var{expr_1}, ..., @var{expr_n}], @var{x_range}) -@deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}, @var{y_range}) -@deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}) +@deffn {Fun@,{c}@~ao} plot2d (@var{expr}, @var{range}, ..., @var{options}, ...) +@deffnx {Fun@,{c}@~ao} plot2d (@var{parametric_expr}) +@deffnx {Fun@,{c}@~ao} plot2d ([@var{expr_1}, ..., @var{expr_n}], @var{x_range}, @var{y_range}) +@deffnx {Fun@,{c}@~ao} plot2d ([@var{expr_1}, ..., @var{expr_n}], @var{x_range}) +@deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}, @var{y_range}) +@deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}) @deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}) @deffnx {Fun@,{c}@~ao} plot2d ([@var{name_1}, ..., @var{name_n}], @var{x_range}, @var{y_range}) @deffnx {Fun@,{c}@~ao} plot2d ([@var{name_1}, ..., @var{name_n}], @var{x_range}) @@ -755,7 +755,8 @@ @end defvr @deffn {Fun@,{c}@~ao} plot3d ([@var{expr_1}, @var{expr_2}, @var{expr_3}], @var{x_range}, @var{y_range}, ..., @var{options}, ...) -@deffnx {Fun@,{c}@~ao} plot3d (@var{expr}, @var{x_range}, @var{y_range}, ..., @var{options}, ...)@deffnx {Fun@value{cedilha}@~ao} plot3d (@var{name}, @var{x_range}, @var{y_range}, ..., @var{options}, ...) +@deffnx {Fun@,{c}@~ao} plot3d (@var{expr}, @var{x_range}, @var{y_range}, ..., @var{options}, ...) +@deffnx {Fun@,{c}@~ao} plot3d (@var{name}, @var{x_range}, @var{y_range}, ..., @var{options}, ...) @deffnx {Fun@,{c}@~ao} plot3d ([@var{expr_1}, @var{expr_2}, @var{expr_3}], @var{x_rge}, @var{y_rge}) @deffnx {Fun@,{c}@~ao} plot3d ([@var{name_1}, @var{name_2}, @var{name_3}], @var{x_range}, @var{y_range}, ..., @var{options}, ...) |
From: Jorge B. <fic...@us...> - 2007-01-07 11:36:26
|
Update of /cvsroot/maxima/maxima/doc/info/pt_BR In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5129 Modified Files: linearalgebra.texi Input.texi Series.texi Plotting.texi Integration.texi Log Message: Brazilian Portuguese translation. linearalgebra.texi -> adjusting first line only. Input.texi -> updating to English cvs version 1.52. Series.texi -> updating to English cvs version 1.16. Plotting.texi -> updating to English cvs version 1.31. Integration.texi -> updating for English cvs version 1.29 Index: linearalgebra.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/pt_BR/linearalgebra.texi,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- linearalgebra.texi 5 Jan 2007 08:52:11 -0000 1.7 +++ linearalgebra.texi 7 Jan 2007 11:36:16 -0000 1.8 @@ -1,5 +1,5 @@ @c Language: Brazilian Portuguese, Encoding: iso-8859-1 -@c /linearalgebra.texi/1.10/Thu Jan 4 07:59:33 2007// +@c /linearalgebra.texi/1.11/Fri Jan 5 17:01:04 2007// @menu * Introdu@value{cedilha}@~ao a linearalgebra:: * Defini@value{cedilha}@~oes para linearalgebra:: Index: Input.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/pt_BR/Input.texi,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Input.texi 30 Dec 2006 13:05:27 -0000 1.3 +++ Input.texi 7 Jan 2007 11:36:16 -0000 1.4 @@ -1,5 +1,5 @@ @c Language: Brazilian Portuguese, Encoding: iso-8859-1 -@c /Input.texi/1.51/Sat Dec 30 04:04:47 2006/-ko/ +@c /Input.texi/1.52/Sun Jan 7 05:49:17 2007/-ko/ @menu * Introdu@value{cedilha}@~ao a Entrada e Sa@'ida:: * Coment@'arios:: @@ -1463,8 +1463,8 @@ @deffnx {Fun@,{c}@~ao} save (@var{filename}, [@var{m}, @var{n}]) @deffnx {Fun@,{c}@~ao} save (@var{filename}, @var{name_1}=@var{expr_1}, ...) @deffnx {Fun@,{c}@~ao} save (@var{filename}, all) -@c @defunx save (@var{filename}, @var{name_1}=@var{expr_1},@var{name_2}=@var{expr_2}, ...) -@c PRECEDING @defunx IS LONGER THAN 1 LINE, CAUSES cl-info.lisp TO STUMBLE; WORK AROUND IT +@deffnx {Fun@,{c}@~ao} save (@var{filename}, @var{name_1}=@var{expr_1}, @var{name_2}=@var{expr_2}, ...) + Armazena os valores correntes de @var{name_1}, @var{name_2}, @var{name_3}, ..., em @var{filename}. Os argumentos s@~ao os nomes das vari@'aveis, fun@,{c}@~oes, ou outros objetos. Se um nome n@~ao possui valore ou fun@,{c}@~ao associada a ele, esse nome sem nenhum valor ou fun@,{c}@~ao associado ser@'a ignorado. Index: Series.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/pt_BR/Series.texi,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Series.texi 24 Dec 2006 11:07:35 -0000 1.2 +++ Series.texi 7 Jan 2007 11:36:16 -0000 1.3 @@ -1,5 +1,5 @@ @c Language: Brazilian Portuguese, Encoding: iso-8859-1 -@c /Series.texi/1.15/Sat Nov 25 04:03:20 2006/-ko/ +@c /Series.texi/1.16/Sun Jan 7 05:49:50 2007/-ko/ @menu * Introdu@value{cedilha}@~ao a S@'eries:: * Defini@value{cedilha}@~oes para S@'eries:: @@ -414,11 +414,7 @@ @deffnx {Fun@value{cedilha}@~ao} taylor (@var{expr}, [@var{x_1}, @var{x_2}, ...], @var{a}, @var{n}) @deffnx {Fun@value{cedilha}@~ao} taylor (@var{expr}, [@var{x}, @var{a}, @var{n}, 'asymp]) @deffnx {Fun@value{cedilha}@~ao} taylor (@var{expr}, [@var{x_1}, @var{x_2}, ...], [@var{a_1}, @var{a_2}, ...], [@var{n_1}, @var{n_2}, ...]) -@c THIS ONE (above) IS LONG TOO, BUT APPARENTLY IT IS OK IF THE LAST @defunx IS LONG -@c THIS NEXT ARGUMENT LIST TICKLES A BUG IN CL-INFO OR SOMETHING: -@c APPARENTLY IF SOME ARGUMENT LIST IS LONGER THAN 1 LINE, REMAINDER OF THE DESCRIPTION IS LOST -@c @defunx taylor (@var{expr}, [@var{x_1}, @var{a_1}, @var{n_1}], [@var{x_2}, @var{a_2}, @var{n_2}], ...) - +@deffnx {Fun@value{cedilha}@~ao} taylor (@var{expr}, [@var{x_1}, @var{a_1}, @var{n_1}], [@var{x_2}, @var{a_2}, @var{n_2}], ...) @code{taylor (@var{expr}, @var{x}, @var{a}, @var{n})} expande a express@~ao @var{expr} em uma s@'erie truncada de Taylor ou de Laurent na vari@'avel @var{x} em torno do ponto @var{a}, Index: Plotting.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/pt_BR/Plotting.texi,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Plotting.texi 24 Dec 2006 11:07:35 -0000 1.2 +++ Plotting.texi 7 Jan 2007 11:36:16 -0000 1.3 @@ -1,5 +1,5 @@ @c Language: Brazilian Portuguese, Encoding: iso-8859-1 -@c /Plotting.texi/1.30/Mon Dec 11 2006/ +@c /Plotting.texi/1.31/Sun Jan 7 05:49:41 2007/-ko/ @menu * Defini@value{cedilha}@~oes para Montagem de Gr@'aficos:: @end menu @@ -63,16 +63,13 @@ @deffnx {Fun@,{c}@~ao} plot2d ([@var{expr_1}, ..., @var{expr_n}], @var{x_range}) @deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}, @var{y_range}) @deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}) -@deffnx {Fun@value{cedilha}@~ao} plot2d (@var{expr}, @var{x_range}) -@deffnx {Fun@value{cedilha}@~ao} plot2d ([@var{name_1}, ..., @var{name_n}], @var{x_range}, @var{y_range}) -@deffnx {Fun@value{cedilha}@~ao} plot2d ([@var{name_1}, ..., @var{name_n}], @var{x_range}) -@deffnx {Fun@value{cedilha}@~ao} plot2d (@var{name}, @var{x_range}, @var{y_range}) -@deffnx {Fun@value{cedilha}@~ao} plot2d (@var{name}, @var{x_range}) -@c TOO LONG !!! (TICKLES CL-INFO BUG) -@c @defunx plot2d ([@var{expr_1}, ..., @var{expr_n}], @var{x_range}, ..., @var{options}, ...) -@c TOO LONG !!! (TICKLES CL-INFO BUG) -@c @defunx plot2d ([..., @var{expr}, ..., @var{parametric_expr}, ...], @var{x_range}, ..., @var{options}) - +@deffnx {Fun@,{c}@~ao} plot2d (@var{expr}, @var{x_range}) +@deffnx {Fun@,{c}@~ao} plot2d ([@var{name_1}, ..., @var{name_n}], @var{x_range}, @var{y_range}) +@deffnx {Fun@,{c}@~ao} plot2d ([@var{name_1}, ..., @var{name_n}], @var{x_range}) +@deffnx {Fun@,{c}@~ao} plot2d (@var{name}, @var{x_range}, @var{y_range}) +@deffnx {Fun@,{c}@~ao} plot2d (@var{name}, @var{x_range}) +@deffnx {Fun@,{c}@~ao} plot2d ([@var{expr_1}, ..., @var{expr_n}], @var{x_range}, ..., @var{options}, ...) +@deffnx {Fun@,{c}@~ao} plot2d ([..., @var{expr}, ..., @var{parametric_expr}, ...], @var{x_range}, ..., @var{options}) Mostra a montagem de uma ou mais express@~oes como uma fun@,{c}@~ao de uma vari@'avel. @@ -757,12 +754,10 @@ @end defvr -@c LONG LINE TICKLES CL-INFO BUG, COMMENT OUT TIL FIXED -@c @deffnx {Fun@value{cedilha}@~ao} plot3d ([@var{expr_1}, @var{expr_2}, @var{expr_3}], @var{x_range}, @var{y_range}, ..., @var{options}, ...) -@deffn {Fun@,{c}@~ao} plot3d (@var{expr}, @var{x_range}, @var{y_range}, ..., @var{options}, ...) -@deffnx {Fun@value{cedilha}@~ao} plot3d (@var{name}, @var{x_range}, @var{y_range}, ..., @var{options}, ...) -@deffnx {Fun@value{cedilha}@~ao} plot3d ([@var{expr_1}, @var{expr_2}, @var{expr_3}], @var{x_rge}, @var{y_rge}) -@deffnx {Fun@value{cedilha}@~ao} plot3d ([@var{name_1}, @var{name_2}, @var{name_3}], @var{x_range}, @var{y_range}, ..., @var{options}, ...) +@deffn {Fun@,{c}@~ao} plot3d ([@var{expr_1}, @var{expr_2}, @var{expr_3}], @var{x_range}, @var{y_range}, ..., @var{options}, ...) +@deffnx {Fun@,{c}@~ao} plot3d (@var{expr}, @var{x_range}, @var{y_range}, ..., @var{options}, ...)@deffnx {Fun@value{cedilha}@~ao} plot3d (@var{name}, @var{x_range}, @var{y_range}, ..., @var{options}, ...) +@deffnx {Fun@,{c}@~ao} plot3d ([@var{expr_1}, @var{expr_2}, @var{expr_3}], @var{x_rge}, @var{y_rge}) +@deffnx {Fun@,{c}@~ao} plot3d ([@var{name_1}, @var{name_2}, @var{name_3}], @var{x_range}, @var{y_range}, ..., @var{options}, ...) Mostra um gr@'afico de uma ou tr@^es express@~oes como fun@,{c}@~oes de duas vari@'aveis. Index: Integration.texi =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/pt_BR/Integration.texi,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Integration.texi 6 Jan 2007 19:19:30 -0000 1.3 +++ Integration.texi 7 Jan 2007 11:36:16 -0000 1.4 @@ -1,5 +1,5 @@ @c Language: Brazilian Portuguese, Encoding: iso-8859-1 -@c /Integration.texi/1.28/Sat Jun 24 06:45:35 2006/-ko/ +@c /Integration.texi/1.29/Sun Jan 7 05:49:36 2007/-ko/ @menu * Introdu@value{cedilha}@~ao a Integra@value{cedilha}@~ao:: * Defini@value{cedilha}@~oes para Integra@value{cedilha}@~ao:: @@ -14,11 +14,11 @@ A fun@,{c}@~ao @code{integrate} faz uso de muitas dessas. Exite tamb@'em o pacote @code{antid}, que manuseia uma fun@,{c}@~ao n@~ao especificada (e suas derivadas, certamente). Para usos num@'ericos, existe a fun@,{c}@~ao -@code{romberg}; -e uma escolha de integradores adaptativos de Quadpack, +@code{romberg}; um +e um conjunto de integradores adaptativos de Quadpack, a saber @code{quad_qag}, @code{quad_qags}, etc., os quais s@~ao descritos sob o t@'opico @code{QUADPACK}. Fun@,{c}@~oes hipergeom@'etricas est@~ao sendo trabalhadas, -veja @code{specint} for details. +veja @code{specint} para detalhes. Geralmente falando, Maxima somente manuseia integrais que s@~ao integr@'aveis em termos de "fun@,{c}@~oes elementares" (fun@,{c}@~oes racionais, trigonometricas, logar@'itmicas, exponenciais, radicais, etc.) e umas poucas |
From: Robert D. <rob...@us...> - 2007-01-07 04:22:40
|
Update of /cvsroot/maxima/maxima/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20269/src Modified Files: asum.lisp Log Message: In MEVALSUMARG, cut out unnecessary MEVALATOMS (which caused an extra evaluation of atoms, leading to spurious results). Make a new test case for the example which triggered the bug report. Index: asum.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/src/asum.lisp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- asum.lisp 17 Sep 2006 18:45:50 -0000 1.15 +++ asum.lisp 7 Jan 2007 04:22:36 -0000 1.16 @@ -489,13 +489,6 @@ (let (($simp nil)) (setq summand ($substitute gensym-ind ind summand))) - (setq summand - (mbinding ((list ind) (list ind)) - (mevalatoms summand))) - - (let (($simp nil)) - (setq summand ($substitute gensym-ind ind summand))) - (setq foo (mbinding ((list gensym-ind) (list gensym-ind)) (resimplify (meval summand)))) |
From: Robert D. <rob...@us...> - 2007-01-07 04:22:40
|
Update of /cvsroot/maxima/maxima/tests In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20269/tests Modified Files: rtestsum.mac Log Message: In MEVALSUMARG, cut out unnecessary MEVALATOMS (which caused an extra evaluation of atoms, leading to spurious results). Make a new test case for the example which triggered the bug report. Index: rtestsum.mac =================================================================== RCS file: /cvsroot/maxima/maxima/tests/rtestsum.mac,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- rtestsum.mac 19 Nov 2006 08:00:39 -0000 1.7 +++ rtestsum.mac 7 Jan 2007 04:22:36 -0000 1.8 @@ -822,3 +822,9 @@ (kill(f), block ([x : product (sum (f(i), i, 1, inf), j, 1, inf)], block ([simp : false], is (x = 'product ('sum (f(i), i, 1, inf), j, 1, inf))))); true; + +/* Test for bug reported by Amit Aronovitch to mailing list 2006/01/06 + */ + +(kill(f), f(x) := sum (x^n/n!, n, 0, inf), f(2*x)); +'sum (2^n*x^n/n!, n, 0, inf); |
From: Robert D. <rob...@us...> - 2007-01-06 19:19:41
|
Update of /cvsroot/maxima/maxima/archive/share/trash In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19120/archive/share/trash Added Files: qq.dem qq.lisp qq.usg Log Message: Cut out package qq (containing function quanc8) and expunge all mention of the qq package and quanc8. Move qq files (qq.dem, qq.lisp, qq.usg) to archive/share/trash/. quanc8 is superseded by QUADPACK functions. Topic was discussed on the mailing list circa 2007/01/02. --- NEW FILE: qq.dem --- /* Numerical Integration Demo for QUANC8*/ /* SETUP_AUTOLOAD(QQ,QUANC8); */ /* show the time and the garbage collection time, and use the GC-demon to make better use of flonum space */ showtime:'all; /* IF STATUS(FEATURE,ITS)=TRUE THEN LOAD("GCDEMN"); */ /* Sample highly oscillatory problem */ g(x):=(mode_declare(x,float),sin(1.0/x)); /* inefficient way to use QUANC8 */ quanc8(g(x),x,0.01,0.1); /* give G as the thing to compile, then a semi-colon to read it in */ compile('g); /* see how much faster now, using fast version of QUANC8 */ quanc8('g,0.01,0.1); /* note that romberg doesn't easily manage oscillatory behaviors */ errcatch(romberg('g,0.01,0.1)); /* a function with two large and narrow peaks, so hard to integrate with a fixed step-size */ h(x):=(mode_declare(x,float),1.0/(.0001+(x-.3)^2)+1.0/(.0025+(x-.9)^2)); /* give H and a semi-colon in response */ compile('h); /* the exact answer for integrate(h(x),x) is 100.0*atan(100.0*x-30.0)+20.0*atan(20.0*x-18.0) */ /* the exact answer for integrate(h(x),x,0.0,1.0) is 361.847622. note that the romberg result is more accurate in this case */ romberg('h,0.0,1.0); /* but at a large time cost compared to adaptive */ quanc8('h,0.0,1.0); /* reduce QUANC8's relative error tolerance by a factor of 10 */ quanc8_relerr:1.0E-5; /* does not take much longer, and gives much better result now */ quanc8('h,0.0,1.0); /* put QUANC8_RELERR back to 1.0e-4 */ quanc8_relerr:1.0E-4$ /* the exact answer for integrate(h(x),x,0.0,10.0) is 372.33606. while too tough for fixed step size method */ errcatch(romberg('h,0.0,10.0)); /*QUANC8 is still super speedy even now */ quanc8('h,0.0,10.0); /* double integral of sample function exp(x)*sin(y) from x=0.0 to 2.0, y=0.0 to 1.0 */ /* you must be sure that the quanc8 source is loaded (load("qq");) before you translate a call to quanc8 in a function, else an error in macro expansion will occur when it can't figure out if the 3 or 4 arg version is used */ /* the exact answer for integrate(integrate(exp(x)*sin(y),x,0.0,2.0),y,0.0,1.0) is 2.93703434. integrate over y to get the final answer */ quanc8(quanc8(exp(x)*sin(y),x,0.0,2.0),y,0.0,1.0); p():=quanc8(lambda([y],mode_declare(y,float), quanc8(lambda([x],mode_declare(x,float), exp(x)*sin(y)), 0.0,2.0)),0.0,1.0); p(); translate(p); p(); /* give p and a semi-colon */ compile('p); p(); --- NEW FILE: qq.lisp --- ;;;;;;;;;;;;;;;;;;; -*- Mode: Lisp; Package: Macsyma -*- ;;;;;;;;;;;;;;;;;;; ;;; (c) Copyright 1982 Massachusetts Institute of Technology ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :maxima) (macsyma-module qq) ;; (load-macsyma-macros Numerm) ;;; 10:55 pm Sept 25, 1981 - LPH & GJC ;;; added $numer and $float set to T so that quanc8(x,x,0,1/2); works. this ;;; is done inside the prog for $quanc8 so that they are put back when done. ;;; 3:30 pm Feb 12, 1982 - JPG, LPH, & GJC ;;; removed the $numer:$float:true and replaced with mto-float which is ;;; defined in maxsrc;numer > . ;;; 3:45 am April 11, 1982 - LPH ;;; fixed an error in estimating TOLERR due to neglect of sub-interval size ;;; when abserr check is made. (defmvar $quanc8_flag 0.0 "integer part-how many regions failed to converge. fractional part- how much of the interval was left when it failed") (defmvar $quanc8_errest 0.0 "an estimated error based on the difference between one- and two-panel calculation of an interval, summed over the whole region") (defmvar $quanc8_abserr 1.0e-8 "absolute error tolerance for reasonable single-precision answers") (defmvar $quanc8_relerr 1.0e-4 "relative error condition for reasonable run-times") ;; (DEFUN ($QUANC8 TRANSLATED-MMACRO) (F A B &OPTIONAL (C NIL C-P)) ;; (IF (NOT C-P) ;; `((CALL-QUANC8) ,F ,A ,B) ;; `((CALL-QUANC8) ((LAMBDA) ((MLIST) ,A) ,F) ,B ,C))) (defmspec $quanc8 (form) (if (cdddr (setq form (cdr form))) (apply #'call-quanc8 (meval `((lambda) ((mlist) ,(cadr form)) ,(car form))) (mapcar #'meval (cddr form))) (apply #'call-quanc8 (mapcar #'meval form)))) (def%tr $quanc8 (form) `($float ,@(cdr (tr-lisp-function-call (if (cdddr (setq form (cdr form))) `((call-quanc8) ((lambda) ((mlist) ,(cadr form)) ,(car form)) ,@(cddr form)) `((call-quanc8) ,@form)) nil)))) (defvar quanc8-free-list () "For efficient calls to quanc8 keep arrays we need on a free list.") (defvar quanc8-|^]| ()) (defun quanc8-|^]| () (setq quanc8-|^]| t)) (defun call-quanc8 (fun a b) (bind-tramp1$ fun fun (let ((vals (if quanc8-free-list (pop quanc8-free-list) (list (*array nil 'flonum 17.) (*array nil 'flonum 17.) (*array nil 'flonum 9. 31.) (*array nil 'flonum 9. 31.) (*array nil 'flonum 32.)))) (user-timesofar (cons #'quanc8-|^]| user-timesofar))) (prog1 (quanc8 fun (mto-float a) (mto-float b) (car vals) (car (cdr vals)) (car (cddr vals)) (car (cdddr vals)) (car (cddddr vals))) (push vals quanc8-free-list))))) (defun quanc8 (fun a b x-arr f-arr xsave-arr fsave-arr qright-arr) (declare (type (simple-array cl:float) x-arr f-arr xsave-arr fsave-arr qright-arr)) ;; local macros for typing convenience. (macrolet ((x (j) `(arraycall flonum x-arr ,j)) (f (j) `(arraycall flonum f-arr ,j)) (xsave (j k) `(arraycall flonum xsave-arr ,j ,k)) (fsave (j k) `(arraycall flonum fsave-arr ,j ,k)) (qright (j) `(arraycall flonum qright-arr ,j))) ;; Rudimentary (non-ansi GCL compatible) error handling. (let (errset) (or (car (errset (prog ((levmin 1.) (levmax 30.) (levout 6.) (nomax 5000.) (nofin 0) (w0 (//$ 3956.0 14175.0)) (w1 (//$ 23552.0 14175.0)) (w2 (//$ -3712.0 14175.0)) (w3 (//$ 41984.0 14175.0)) (w4 (//$ -18160.0 14175.0)) (result 0.0) (cor11 0.0) (area 0.0) (nofun 0.) (lev 0.) (nim 1.) (qprev 0.0) (stone (//$ (-$ b a) 16.0)) (i 0.) (step 0.0) (qleft 0.0) (qnow 0.0) (qdiff 0.0) (esterr 0.0) (tolerr 0.0) (temp 0.0) ($numer t) ($float t)) (declare (cl:float w0 w1 w2 w3 w4 result cor11 area qprev stone step qleft qnow qdiff esterr tolerr temp) (fixnum i levmin levmax levout nomax nofin nofun lev nim) (boolean $numer $float)) (setq $quanc8_flag 0.0 $quanc8_errest 0.0 nofin (- nomax (* 8 (+ levmax (* -1. levout) (expt 2. (1+ levout)))))) (cond ((= a b) (return 0.0))) (setf (x 0.) a) (setf (x 16.) b) (setf (x 8.) (*$ 0.5 (+$ (x 0.) (x 16.)))) (setf (x 4.) (*$ 0.5 (+$ (x 0.) (x 8.)))) (setf (x 12.) (*$ 0.5 (+$ (x 16.) (x 8.)))) (setf (x 2.) (*$ 0.5 (+$ (x 0.) (x 4.)))) (setf (x 6.) (*$ 0.5 (+$ (x 4.) (x 8.)))) (setf (x 10.) (*$ 0.5 (+$ (x 12.) (x 8.)))) (setf (x 14.) (*$ 0.5 (+$ (x 12.) (x 16.)))) do-25 (when quanc8-|^]| (mtell "QUANC8 calculating at X= ~S" (x i)) (setq quanc8-|^]| nil)) (setf (f i) (fcall$ fun (x i))) (setq i (+ 2. i)) (if (> i 16.) (go do-25-done)) (go do-25) do-25-done (setq nofun 9.) tag-30 (setq i 1.) do-30 (setf (x i) (*$ 0.5 (+$ (x (1- i)) (x (1+ i))))) (when quanc8-|^]| (mtell "QUANC8 calculating at X= ~S" (x i)) (setq quanc8-|^]| nil)) (setf (f i) (fcall$ fun (x i))) (setq i (+ 2. i)) (if (> i 15.) (go do-30-done)) (go do-30) do-30-done (setq nofun (+ 8. nofun)) (setq step (//$ (-$ (x 16.) (x 0.)) 16.0)) (setq qleft (*$ step (+$ (*$ w0 (+$ (f 0.) (f 8.))) (*$ w1 (+$ (f 1.) (f 7.))) (*$ w2 (+$ (f 2.) (f 6.))) (*$ w3 (+$ (f 3.) (f 5.))) (*$ w4 (f 4.))))) (setf (qright (1+ lev)) (*$ step (+$ (*$ w0 (+$ (f 8.) (f 16.))) (*$ w1 (+$ (f 9.) (f 15.))) (*$ w2 (+$ (f 10.) (f 14.))) (*$ w3 (+$ (f 11.) (f 13.))) (*$ w4 (f 12.))))) (setq qnow (+$ qleft (qright (1+ lev)))) (setq qdiff (-$ qnow qprev)) (setq area (+$ area qdiff)) (setq esterr (//$ (abs qdiff) 1023.0)) (setq tolerr (*$ (//$ step stone) (max $quanc8_abserr (*$ (abs area) $quanc8_relerr)))) (if (< lev levmin) (go tag-50)) (if (or (> lev levmax) (= lev levmax)) (go tag-62)) (if (> nofun nofin) (go tag-60)) (if (< esterr tolerr) (go tag-70)) tag-50 (setq nim (* 2. nim) lev (1+ lev)) (setq i 1.) do-52 (setf (fsave i lev) (f (+ 8. i))) (setf (xsave i lev) (x (+ 8. i))) (setq i (1+ i)) (if (> i 8.) (go do-52-done)) (go do-52) do-52-done (setq qprev qleft) (setq i 1.) do-55 (setf (f (+ 18. (* -2. i))) (f (+ 9. (* -1. i)))) (setf (x (+ 18. (* -2. i))) (x (+ 9. (* -1. i)))) (setq i (1+ i)) (if (> i 8.) (go tag-30)) (go do-55) tag-60 (setq nofin (* 2. nofin)) (setq levmax levout) (setq $quanc8_flag (+$ $quanc8_flag (//$ (-$ b (x 0.)) (-$ b a)))) (go tag-70) tag-62 (setq $quanc8_flag (+$ $quanc8_flag 1.0)) tag-70 (setq result (+$ result qnow) $quanc8_errest (+$ $quanc8_errest esterr) cor11 (+$ cor11 (//$ qdiff 1023.0))) tag-72 (if (= nim (* 2. (// nim 2.))) (go tag-75)) (setq nim (// nim 2.)) (setq lev (1- lev)) (go tag-72) tag-75 (setq nim (1+ nim)) (if (or (< lev 0.) (= lev 0.)) (go tag-80)) (setq qprev (qright lev)) (setq i 1.) (setf (x 0.) (x 16.)) (setf (f 0.) (f 16.)) do-78 (setf (f (* 2. i)) (fsave i lev)) (setf (x (* 2. i)) (xsave i lev)) (setq i (1+ i)) (if (> i 8.) (go tag-30)) (go do-78) tag-80 (setq result (+$ result cor11)) (if (= $quanc8_errest 0.0) (return result)) tag-82 (setq temp (+$ $quanc8_errest (abs result))) (if (not (= temp (abs result))) (return result)) (setq $quanc8_errest (*$ 2.0 $quanc8_errest)) (go tag-82)))) ;; For whatever reason and with a suitable ;; discrete meaning of convergence... (merror "QUANC8 failed to converge."))))) --- NEW FILE: qq.usg --- The file SHARE1;QQ FASL contains a function QUANC8 which can take either 3 or 4 arguments. The 3 arg version computes the integral of the function specified as the first argument over the interval from lo to hi as in QUANC8('function name,lo,hi). The function name should be quoted. The 4 arg version will compute the integral of the function or expression (first arg) with respect to the variable (second arg) over the interval from lo to hi as in QUANC8(<f(x) or expression in x>,x,lo,hi). The method used is the Newton-Cotes 8th order polynomial quadrature, and the routine is adaptive. It will thus spend time dividing the interval only when necessary to achieve the error conditions specified by the global variables QUANC8_RELERR (default value=1.0e-4) and QUANC8_ABSERR (default value=1.0e-8) which give the relative error test |integral(function)-computed value|< quanc8_relerr*|integral(function)| and the absolute error test |integral(function)-computed value|<quanc8_abserr. The error from each subinterval is estimated and the contribution from a subinterval is accepted only when the integral over the subinterval satisfies the error test over the subinterval. The total estimated error of the integral is contained in the global variable QUANC8_ERREST (default value=0.0). The global variable QUANC8_FLAG (default value=0.0) will contain valuable information if the computation fails to satisfy the error conditions. The integer part will tell you how many subintervals failed to converge and the fractional part will tell you where the singular behavior is, as follows: singular point=lo+(1.-frac part)*(hi-lo). Thus quanc8(tan(x),x,1.57,1.6); gives frac=.97 so trouble is at 1.57+.03*.03= 1.5709 (=half pi). If QUANC8_FLAG is not 0.0, you should be cautious in using the return value, and should try ROMBERG or a Simpson method and see if the result checks. Analysis of possible singular behavior might be advisable. You may get QUANC8_FLAG=<integer>.0 and an error message (such as division by 0) when a singular point is hit in the interval. You will have to find the singularity and eliminate it before QUANC8 will get an answer. Functions which have very large derivatives may throw the error estimate way off and cause the wrong points to be used, and a wrong answer returned. Try romberg(exp(-.002*x^2)*cos(x)^2,x,0.,100.); with the default tolerance, and quanc8(exp(-.002*x^2)*cos(x)^2,x,0.,100.); with quanc8_relerr=1.e-7 and 1.e-8. The last result is consistent with romberg while the previous one is off by a factor of 2! This is due to the bad behavior of the derivatives near x=10.0 which cause the adaptive routine to have trouble. If you use quanc8('f,a,c)+quanc8('f,c,b) where a<c<b, you will do better in such cases. Typing a control-right-bracket (^]) will give a printout of where the computation is at the moment, and how much time has been used. You can do batch("qq demo"); for some comparisons with the ROMBERG numerical integrator (which is not adaptive). Note that ROMBERG usually gives more accurate answers for comparable tolerances, while QUANC8 will get the same answer faster even with a smaller tolerance, because ROMBERG subdivides the whole interval if the total result is not within error tolerance, while QUANC8 improves only where needed, thus saving many function calls. ROMBERG will also fail to converge when oscillatory behavior is overwhelming, while QUANC8 will adapt in the regions as it sees fit. (The global variable ROMBERGMIN is designed to allow you a minimum number of function calls in such cases, so that exp(-x)*sin(12*x) can be integrated from 0 to 4*%pi without erroneously giving 0. from the first few function calls.) To make your macsyma user function callable in the fastest way, you must use MODE_DECLARE and then translate and compile the function. Read TRANSL;TRANSL NEWS for info on this, or ask me for more info. The speed of the computation may be increased by well over an order of magnitude when compilation is used. If you do multiple integrals, it is really necessary to compile the function in order to avoid the time spent on function calls. A sample use of QUANC8 for a double integral is in the batch("qq demo"); and compilation is nearly a hundred times faster in doing the work! Comments, bugs, etc. should be sent to LPH@MIT-MC. |
From: Robert D. <rob...@us...> - 2007-01-06 19:19:37
|
Update of /cvsroot/maxima/maxima/share/numeric In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19120/share/numeric Modified Files: dblint.usg dblint_1.dem Removed Files: qq.dem qq.lisp qq.usg Log Message: Cut out package qq (containing function quanc8) and expunge all mention of the qq package and quanc8. Move qq files (qq.dem, qq.lisp, qq.usg) to archive/share/trash/. quanc8 is superseded by QUADPACK functions. Topic was discussed on the mailing list circa 2007/01/02. Index: dblint.usg =================================================================== RCS file: /cvsroot/maxima/maxima/share/numeric/dblint.usg,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- dblint.usg 8 May 2000 06:09:43 -0000 1.1.1.1 +++ dblint.usg 6 Jan 2007 19:19:31 -0000 1.2 @@ -40,8 +40,7 @@ magnitude speed improvement over interpreted code in many cases! Ask LPH (or GJC) about using these numerical aids. The file SHARE1;DBLINT DEMO can be run in batch or demo mode to illustrate the usage on a -sample problem; the file SHARE1;DBLNT DEMO1 is an extension of the DEMO -which also makes use of other numerical aids, FLOATDEFUNK and QUANC8. +sample problem. Please send all bug notes and questions to LPH@MIT-MC. Note: Simpson's Rule specifies that Index: dblint_1.dem =================================================================== RCS file: /cvsroot/maxima/maxima/share/numeric/dblint_1.dem,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- dblint_1.dem 26 Jan 2005 02:09:44 -0000 1.2 +++ dblint_1.dem 6 Jan 2007 19:19:31 -0000 1.3 @@ -1,13 +1,10 @@ /* a macro for floatdefunk, needed until optimu is used */ load("fltdfnk.mc")$ -/* Example of use of double integrator (DBLINT), part 2, plus -FLOATDEFUNK and QUANC8 */ +/* Example of use of double integrator (DBLINT), part 2 */ /* Get the fasl file for DBLINT */ load('dblint); -/* Get the fasl file for QUANC8 */ -load('qq); /* Use DBLINT to get the double integral of exp(x-y^2) over the region bounded by y=1 and y=2+x^(3/2) and x=0 to x=1 */ @@ -46,24 +43,4 @@ radcan(%); %,nouns; /* Still no luck with closed-form */ -/* The integral over x can't be done in closed-form, so let's use a -one-dimensional integrator to do it numerically. First, we must -define the integrand as a floating point function. FLOATDEFUNK -does this very conveniently on the expression */ - -floatdefunk(fun,[x],xint); - -/* Now translate the function fun */ -translate(fun); - -/* Now call QUANC8 on the translated function (see SHARE1;QQ USAGE for -details) */ - -quanc8_answer:quanc8(fun,0.0,1.0); - -/* Compare the answers from DBLINT and QUANC8 */ - -(dblint_answer-quanc8_answer)/dblint_answer; - -/* It appears to be small enough relative error for most uses */ "end of dblint.dm1"$ --- qq.dem DELETED --- --- qq.lisp DELETED --- --- qq.usg DELETED --- |