From rswarbrick at gmail.com Sun Jan 1 06:00:18 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sun, 01 Jan 2012 12:00:18 +0000 Subject: [Maxima] Bug in limit or integrate References: <009CCEB07A82462383B5FAF431448497@RichsLaptop> <248DBA1BC0D749118FC65FC4DD1D9345@RichsLaptop> Message-ID: "Richard Hennessy" writes: > The indefinite integral of a continuous function which is finite > valued on a region (a,b) is also continuous on the region (a,b). > Check it out. The answer for this indefinite integral is wrong since > it is discontinuous at zero. If I can figure out the right answer I > will post it. > > Rich Yes, but how does that relate to what Barton said? In general, integration makes functions better behaved (more smooth). But the problem here is that the integrand is nasty. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From willisb at unk.edu Sun Jan 1 08:11:03 2012 From: willisb at unk.edu (Barton Willis) Date: Sun, 1 Jan 2012 08:11:03 -0600 Subject: [Maxima] Bug in limit or integrate In-Reply-To: <2D6DEA23C6D94F9EAA3A92F1126B4760@RichsLaptop> References: <2D6DEA23C6D94F9EAA3A92F1126B4760@RichsLaptop>, <009CCEB07A82462383B5FAF431448497@RichsLaptop> <248DBA1BC0D749118FC65FC4DD1D9345@RichsLaptop> Message-ID: ----"Richard Hennessy" wrote: ----- >I should not have used the abs() function. This is a simpler answer and it >does not blow up at zero. >(gamma(1/4)/4-gamma_incomplete(1/4,x^4)/4)*signum(x); OK, this antiderivative is valid on the reals. An antiderivative that is valid on the entire complex plane is x |-> x*hypergeometric([1/4],[5/4],-x^4). But Maxima is unable to compute limits of hypergeometric functions, you are out of luck if you used this antiderivative to try to compute integrate(exp(-x^4),x,minf,inf). Some definite integrals of exp(-x^4) are broken: (%i6) integrate(exp(-t^4),t,0,1); (%o6) (%i*(gamma(1/4)-gamma_incomplete(1/4,1)))/4 --bw From rich.hennessy at verizon.net Sun Jan 1 12:24:12 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 01 Jan 2012 13:24:12 -0500 Subject: [Maxima] Bug in limit or integrate In-Reply-To: References: <009CCEB07A82462383B5FAF431448497@RichsLaptop> <248DBA1BC0D749118FC65FC4DD1D9345@RichsLaptop> Message-ID: <10B9A12B13044ECC8047B2C37D9274A5@RichsLaptop> "Yes, but how does that relate to what Barton said? In general, integration makes functions better behaved (more smooth). But the problem here is that the integrand is nasty." The integrand is not nasty. It is a simple smooth function. exp(-x^4) is not nasty any more than exp(-x^2). I am not sure what you are talking about. This is a simple integrand. So is exp(-x^6), exp(-x^8) etc... There is no reason why the integral should be discontinuous. Rich -----Original Message----- From: Rupert Swarbrick Sent: Sunday, January 01, 2012 7:00 AM To: maxima at math.utexas.edu Subject: Re: [Maxima] Bug in limit or integrate _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Sun Jan 1 12:38:39 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 01 Jan 2012 13:38:39 -0500 Subject: [Maxima] Bug in limit or integrate In-Reply-To: References: <2D6DEA23C6D94F9EAA3A92F1126B4760@RichsLaptop>, <009CCEB07A82462383B5FAF431448497@RichsLaptop> <248DBA1BC0D749118FC65FC4DD1D9345@RichsLaptop> Message-ID: "you are out of luck". Yes, if you choose not to consider this a bug then you are choosing to make up new math laws with no basis for it and I am out of luck. Anyway, I suppose I don?t care that much if pwint gets this one wrong. The help for pw just needs to be modified to say that pwint() works by taking the antidiff() of the integrand and evaluating it at the limits of integration, (or computing the limit in the case of minf, inf.) I cannot try to anticipate random mathematical decisions. Rich -----Original Message----- From: Barton Willis Sent: Sunday, January 01, 2012 9:11 AM To: rich.hennessy at verizon.net Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Bug in limit or integrate ----"Richard Hennessy" wrote: ----- >I should not have used the abs() function. This is a simpler answer and it >does not blow up at zero. >(gamma(1/4)/4-gamma_incomplete(1/4,x^4)/4)*signum(x); OK, this antiderivative is valid on the reals. An antiderivative that is valid on the entire complex plane is x |-> x*hypergeometric([1/4],[5/4],-x^4). But Maxima is unable to compute limits of hypergeometric functions, you are out of luck if you used this antiderivative to try to compute integrate(exp(-x^4),x,minf,inf). Some definite integrals of exp(-x^4) are broken: (%i6) integrate(exp(-t^4),t,0,1); (%o6) (%i*(gamma(1/4)-gamma_incomplete(1/4,1)))/4 --bw From filonenko.mikhail at gmail.com Sun Jan 1 13:54:41 2012 From: filonenko.mikhail at gmail.com (Michael Filonenko) Date: Sun, 1 Jan 2012 21:54:41 +0200 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: References: <8isrs8xle3.ln2@hake.rswarbrick.dnsalias.com> <1qpobuqkthr.fsf@iceland.freeshell.org> <1b11t8xcu2.ln2@hake.rswarbrick.dnsalias.com> Message-ID: I saved all maxima history, and now you can fetch quicklisp branch into your local repository. git remote add fm_github https://filonenko-mikhail at github.com/filonenko-mikhail/maxima.git git fetch --depth 1 origin quicklisp:refs/remotes/quicklisp git checkout -b quicklisp --track origin/quicklisp All changes available here: https://github.com/filonenko-mikhail/maxima/commits/quicklisp 2011/12/31 Michael Filonenko : > Happy New Year! > > I understand risks of patches. > > I made mirror of original maxima repository on github and branch that > has name 'quicklisp': > > https://github.com/filonenko-mikhail/orig-maxima/commit/f0a68af97aa318d7a554c30f32369754244edfd7 > > 1. I removed archive directory. Quicklisp repository does not need > history of project. > 2. I moved maxima.asd to root maxima directory. It is simplier to > setup paths, when project file is in the project root. > 3. I replaced *.in files, which require configure step, with > asdf*.lisp files, which contain path searching mechanism using asdf > api. > 4. I removed setup of output binary files, because asdf2 does not > require this feature. > > This version passed all "non-share" tests. Loading some share maxima > libraries is not working now, because it uses mk-defsystem. > > Additionally to previous changes in quicklisp branch I ask following changes: > > refactor (string= autoconf:win32 "true) to #+-win32; > replace all mk-defsystems with asdf systems. asdf is almost fully > compatible with defsystem. > ?remove setup of output binary files; > ?move setup paths from several functions into one; > ?refactor functions, which work with filenames, to use pathnames > instead of strings; > ?remove embedded f2cl and use it from quicklisp; > ?remove sloop; > > But may be there are no critical mass of people, who want to use quicklisp? > > 2011/12/30 Rupert Swarbrick : >> Leo Butler writes: >>> Rupert Swarbrick writes: >>>> Michael Filonenko writes: >>>>> Goal of fork to provide maxima from quicklisp. Maxima big project and I >>>>> need community opinion about fork. I am ready to merge my changes with >>>>> main repo. Only non-mathematical parts were changed by me. >>>> >>>> Hmm. Well, a public github fork is a pretty awful way to develop >>>> features on changing code unless that code is also in github. How are >>>> you going to incorporate changes to core maxima into your fork without >>>> rewriting history? >>> >>> @Rupert: I am not really certain of your meaning here. Git can >>> accomodate multiple upstream repositories. So long as he has forked >>> things correctly, he can pull in updates from sourceforge, and merge >>> these onto his development branch which is on github. This work can be >>> merged into the sourceforge repository without re-writing anyone's >>> history -- that is the nice thing about rebasing. >> >> Yes, but github forks are public repositories, so if you rebase you >> screw up the repository of anyone trying to follow you... >> >> Rupert >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > > > > -- > With best regards, Michael Filonenko -- With best regards, Michael Filonenko From filonenko.mikhail at gmail.com Sun Jan 1 14:06:49 2012 From: filonenko.mikhail at gmail.com (Michael Filonenko) Date: Sun, 1 Jan 2012 22:06:49 +0200 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: References: <8isrs8xle3.ln2@hake.rswarbrick.dnsalias.com> <1qpobuqkthr.fsf@iceland.freeshell.org> <1b11t8xcu2.ln2@hake.rswarbrick.dnsalias.com> Message-ID: Sorry. Here it is valid commands for fetching quicklisp branch. git remote add fm_github https://filonenko-mikhail at github.com/filonenko-mikhail/maxima.git git fetch --depth 1 fm_github quicklisp:refs/remotes/quicklisp git checkout -b quicklisp --track origin/quicklisp 2012/1/1 Michael Filonenko : > I saved all maxima history, and now you can fetch quicklisp branch > into your local repository. > > ?git remote add fm_github > https://filonenko-mikhail at github.com/filonenko-mikhail/maxima.git > ?git fetch --depth 1 origin quicklisp:refs/remotes/quicklisp > ?git checkout -b quicklisp --track origin/quicklisp > > All changes available here: > > ?https://github.com/filonenko-mikhail/maxima/commits/quicklisp > > > 2011/12/31 Michael Filonenko : >> Happy New Year! >> >> I understand risks of patches. >> >> I made mirror of original maxima repository on github and branch that >> has name 'quicklisp': >> >> https://github.com/filonenko-mikhail/orig-maxima/commit/f0a68af97aa318d7a554c30f32369754244edfd7 >> >> 1. I removed archive directory. Quicklisp repository does not need >> history of project. >> 2. I moved maxima.asd to root maxima directory. It is simplier to >> setup paths, when project file is in the project root. >> 3. I replaced *.in files, which require configure step, with >> asdf*.lisp files, which contain path searching mechanism using asdf >> api. >> 4. I removed setup of output binary files, because asdf2 does not >> require this feature. >> >> This version passed all "non-share" tests. Loading some share maxima >> libraries is not working now, because it uses mk-defsystem. >> >> Additionally to previous changes in quicklisp branch I ask following changes: >> >> refactor (string= autoconf:win32 "true) to #+-win32; >> replace all mk-defsystems with asdf systems. asdf is almost fully >> compatible with defsystem. >> ?remove setup of output binary files; >> ?move setup paths from several functions into one; >> ?refactor functions, which work with filenames, to use pathnames >> instead of strings; >> ?remove embedded f2cl and use it from quicklisp; >> ?remove sloop; >> >> But may be there are no critical mass of people, who want to use quicklisp? >> >> 2011/12/30 Rupert Swarbrick : >>> Leo Butler writes: >>>> Rupert Swarbrick writes: >>>>> Michael Filonenko writes: >>>>>> Goal of fork to provide maxima from quicklisp. Maxima big project and I >>>>>> need community opinion about fork. I am ready to merge my changes with >>>>>> main repo. Only non-mathematical parts were changed by me. >>>>> >>>>> Hmm. Well, a public github fork is a pretty awful way to develop >>>>> features on changing code unless that code is also in github. How are >>>>> you going to incorporate changes to core maxima into your fork without >>>>> rewriting history? >>>> >>>> @Rupert: I am not really certain of your meaning here. Git can >>>> accomodate multiple upstream repositories. So long as he has forked >>>> things correctly, he can pull in updates from sourceforge, and merge >>>> these onto his development branch which is on github. This work can be >>>> merged into the sourceforge repository without re-writing anyone's >>>> history -- that is the nice thing about rebasing. >>> >>> Yes, but github forks are public repositories, so if you rebase you >>> screw up the repository of anyone trying to follow you... >>> >>> Rupert >>> >>> _______________________________________________ >>> Maxima mailing list >>> Maxima at math.utexas.edu >>> http://www.math.utexas.edu/mailman/listinfo/maxima >>> >> >> >> >> -- >> With best regards, Michael Filonenko > > > > -- > With best regards, Michael Filonenko -- With best regards, Michael Filonenko From rich.hennessy at verizon.net Sun Jan 1 16:25:08 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 01 Jan 2012 17:25:08 -0500 Subject: [Maxima] Bug in limit or integrate In-Reply-To: References: <2D6DEA23C6D94F9EAA3A92F1126B4760@RichsLaptop>, <009CCEB07A82462383B5FAF431448497@RichsLaptop> <248DBA1BC0D749118FC65FC4DD1D9345@RichsLaptop> Message-ID: <150A6F92D642498A849444C6BED74C0C@RichsLaptop> "Some definite integrals of exp(-x^4) are broken:" So are some limits. I was trying to use maxima to prove continuity of the function at zero and it blows up limit() with a bind stack overflow. (%i2) kill(all); (%o0) done (%i1) limit((-(gamma_incomplete(1/4,x^4)-gamma(1/4))/-4),x,0,minus); Maxima encountered a Lisp error: Error in $LIMIT [or a callee]: Bind stack overflow. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%i2) Rich -----Original Message----- From: Barton Willis Sent: Sunday, January 01, 2012 9:11 AM To: rich.hennessy at verizon.net Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Bug in limit or integrate ----"Richard Hennessy" wrote: ----- >I should not have used the abs() function. This is a simpler answer and it >does not blow up at zero. >(gamma(1/4)/4-gamma_incomplete(1/4,x^4)/4)*signum(x); OK, this antiderivative is valid on the reals. An antiderivative that is valid on the entire complex plane is x |-> x*hypergeometric([1/4],[5/4],-x^4). But Maxima is unable to compute limits of hypergeometric functions, you are out of luck if you used this antiderivative to try to compute integrate(exp(-x^4),x,minf,inf). Some definite integrals of exp(-x^4) are broken: (%i6) integrate(exp(-t^4),t,0,1); (%o6) (%i*(gamma(1/4)-gamma_incomplete(1/4,1)))/4 --bw From leon.magiera at wp.pl Mon Jan 2 02:14:08 2012 From: leon.magiera at wp.pl (leon.magiera at wp.pl) Date: Mon, 02 Jan 2012 09:14:08 +0100 Subject: [Maxima] problems Message-ID: <4f016750a81f33.02531046@wp.pl> Hi Problem 1 How, using Maxima, to solve in elegant way the equation eq:sqrt(x+3-4*sqrt(x-1))+sqrt(x+8-6*sqrt(x-1))=1; The solution is 5<=x<=10 Problem 2 ex:1/(sqrt((x-b)^2+a^2)*sqrt((x-b)^2/a^2+1)); integrate(ex,x); Is the above integral too hard ? Best L.M. From rswarbrick at gmail.com Mon Jan 2 07:28:57 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Mon, 02 Jan 2012 13:28:57 +0000 Subject: [Maxima] problems References: <4f016750a81f33.02531046@wp.pl> Message-ID: leon.magiera at wp.pl writes: > Problem 2 > > ex:1/(sqrt((x-b)^2+a^2)*sqrt((x-b)^2/a^2+1)); > > integrate(ex,x); > > Is the above integral too hard ? For this, have a look at what your expression is. Firstly, the x-b looks unpleasant so lets ignore that. Note that integrate (f(x - b), x, u, v) = integrate (f(x), x, u-b, v-b) and indeed you're asking for the indefinite integral, so this comes out as something like (integrate (f(x - b), x) at x=v) = (integrate (f(x), x) at x=v-b) Anyway, that lets us get rid of the "-b" for a bit: (%i1) ex:1/(sqrt((x-b)^2+a^2)*sqrt((x-b)^2/a^2+1))$ (%i2) no_b: subst(x, x-b, ex); 1 (%o2) -------------------------- 2 2 2 x sqrt(x + a ) sqrt(-- + 1) 2 a Hmm. Now it looks like there should be some cancelling going on here. I admit I did this on paper, but Maxima can do it too: (%i3) %, ratsimp; abs(a) (%o3) ------- 2 2 x + a And that's easy enough to integrate (unless, like me, you've forgotten the tables of integrals you learnt at A-level. Fortunately Maxima hasn't): (%i4) E_no_b: integrate (%, x); x abs(a) atan(-) a (%o4) -------------- a Ahah! Now remember what I originally said about how b gets involved and do the substitution by hand: (%i5) E: subst(x-b, x, %); x - b abs(a) atan(-----) a (%o5) ------------------ a Of course, abs(a)/a is ?1. If you know the sign of a, you can get even further: (%i6) assume (a>0); (%o6) [a > 0] (%i7) E, ev; x - b (%o7) atan(-----) a Tada! Now suppose you hadn't spotted the x-b thing. Fortunately, Maxima can still cope: you just have to tell it to get rid of the square roots by simplifying the product: (%i8) forget (a>0); (%o8) [a > 0] (%i9) ratsimp(ex); abs(a) (%o9) -------------------- 2 2 2 x - 2 b x + b + a (%i10) integrate(%,x); 2 x - 2 b abs(a) atan(---------) 2 a (%o10) ---------------------- a And you can get rid of the unfortunate factor of 2 with another call to ratsimp if you fancy: (%i11) ratsimp(%); x - b abs(a) atan(-----) a (%o11) ------------------ a Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From leon.magiera at wp.pl Mon Jan 2 09:30:15 2012 From: leon.magiera at wp.pl (leon.magiera at wp.pl) Date: Mon, 02 Jan 2012 16:30:15 +0100 Subject: [Maxima] problems In-Reply-To: <4f016750a81f33.02531046@wp.pl> References: <4f016750a81f33.02531046@wp.pl> Message-ID: <4f01cd8726af76.23504702@wp.pl> Dnia 2-01-2012 o godz. 14:28 Rupert Swarbrick napisa?(a): > leon.magiera at wp.pl writes: > > Problem 2 > > > > ex:1/(sqrt((x-b)^2+a^2)*sqrt((x-b)^2/a^2+1)); > > > > integrate(ex,x); > > > > Is the above integral too hard ? CAS DERIVE returns ATAN((x - b)/ABS(a)) L.M. > > For this, have a look at what your expression is. Firstly, the > x-b looks unpleasant so lets ignore that. Note that > > integrate (f(x - b), x, u, v) = integrate (f(x), x, u-b, v-b) > > and indeed you're asking for the indefinite integral, so this comes out > as something like > > (integrate (f(x - b), x) at x=v) = (integrate (f(x), x) at x=v-b) > > Anyway, that lets us get rid of the "-b" for a bit: > > (%i1) ex:1/(sqrt((x-b)^2+a^2)*sqrt((x-b)^2/a^2+1))$ > > (%i2) no_b: subst(x, x-b, ex); > 1 > (%o2) -------------------------- > 2 > 2 2 x > sqrt(x + a ) sqrt(-- + 1) > 2 > a > > Hmm. Now it looks like there should be some cancelling going on here. I > admit I did this on paper, but Maxima can do it too: > > (%i3) %, ratsimp; > abs(a) > (%o3) ------- > 2 2 > x + a > > And that's easy enough to integrate (unless, like me, you've forgotten > the tables of integrals you learnt at A-level. Fortunately Maxima > hasn't): > > (%i4) E_no_b: integrate (%, x); > x > abs(a) atan(-) > a > (%o4) -------------- > a > > Ahah! Now remember what I originally said about how b gets involved and > do the substitution by hand: > > > (%i5) E: subst(x-b, x, %); > x - b > abs(a) atan(-----) > a > (%o5) ------------------ > a > > Of course, abs(a)/a is ??1. If you know the sign of a, you can get even > further: > > (%i6) assume (a>0); > (%o6) [a > 0] > (%i7) E, ev; > x - b > (%o7) atan(-----) > a > > Tada! Now suppose you hadn't spotted the x-b thing. Fortunately, Maxima > can still cope: you just have to tell it to get rid of the square roots > by simplifying the product: > > (%i8) forget (a>0); > (%o8) [a > 0] > (%i9) ratsimp(ex); > abs(a) > (%o9) -------------------- > 2 2 2 > x - 2 b x + b + a > (%i10) integrate(%,x); > 2 x - 2 b > abs(a) atan(---------) > 2 a > (%o10) ---------------------- > a > > And you can get rid of the unfortunate factor of 2 with another call to > ratsimp if you fancy: > > (%i11) ratsimp(%); > x - b > abs(a) atan(-----) > a > (%o11) ------------------ > a > > > Rupert From rswarbrick at gmail.com Mon Jan 2 10:06:35 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Mon, 02 Jan 2012 16:06:35 +0000 Subject: [Maxima] problems In-Reply-To: <4f01cd8726af76.23504702@wp.pl> (leon magiera's message of "Mon, 02 Jan 2012 16:30:15 +0100") References: <4f016750a81f33.02531046@wp.pl> <4f01cd8726af76.23504702@wp.pl> Message-ID: <87fwfyum0k.fsf@hake.rswarbrick.dnsalias.com> leon.magiera at wp.pl writes: > Dnia 2-01-2012 o godz. 14:28 Rupert Swarbrick napisa?(a): >> leon.magiera at wp.pl writes: >> > Problem 2 >> > >> > ex:1/(sqrt((x-b)^2+a^2)*sqrt((x-b)^2/a^2+1)); >> > >> > integrate(ex,x); >> > >> > Is the above integral too hard ? > > CAS DERIVE returns > ATAN((x - b)/ABS(a)) Well, I'm pretty certain that you've either copied something incorrectly or made another mistake. Look at the bottom of the integrand. It's a product of two terms. One scales as a and the other as 1/a. Therefore the product doesn't have any first-order dependence on a and the derive answer you give above can't possibly be right. Maybe I've misunderstood your original question? Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From aleksasd873 at gmail.com Sun Jan 1 04:27:37 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Sun, 1 Jan 2012 12:27:37 +0200 Subject: [Maxima] wrong integration Message-ID: from http://www.math.utexas.edu/pipermail/maxima/2011/027256.html On Dec. 31, 2011, t t wrote: ---------------------------------------- >*I tried to integrate the following integral and got the negative answer. *>*Surely the answer is wrong.*>*Here:*>*integrate(x*x^0.5/(1+x)^0.5,x,0,1)*>* -2^(3/2)*-------------------------------- As mentioned by Toth and Fateman, using 1/2 instead of 0.5 leads to the correct answer (at least numerically). A convenient way to prepare the integrand is to use radcan (or ratsimp): --------------------------------------------------- (%i1) exf : x*x^(0.5)/(1+x)^(0.5); (%o1) x^1.5/(x+1)^0.5 (%i2) integrate(%,x,0,1); (%o2) -2^(3/2) (%i3) float(%); (%o3) -2.828427124746191 (%i4) exr : radcan(exf); (%o4) x^(3/2)/sqrt(x+1) (%i5) integrate(%,x,0,1); (%o5) (3*log(sqrt(2)+1)-3*log(1-sqrt(2))-2^(3/2))/8+3*log(-1)/8 (%i6) expand(float(%)); (%o6) 0.30747679967138 (%i7) ratsimp(exf); (%o7) x^(3/2)/sqrt(x+1) ----------------------------------- Ted Woollett **************************************************************** (%i1) S:'integrate(x^(3/2)/sqrt(x+1),x,0,1)$ (%i2) changevar(S, y=sqrt(x), y, x); "Is "y" positive, negative, or zero?"p; (%o2) 2*integrate(y^4/sqrt(y^2+1),y,0,1) (%i3) ev(%, nouns); (%o3) (3*asinh(1)-sqrt(2))/4 (%i4) float(%); (%o4) 0.307476799671383 Aleksas D ------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From luigi_marino2 at alice.it Sun Jan 1 08:14:28 2012 From: luigi_marino2 at alice.it (Luigi Marino) Date: Sun, 1 Jan 2012 15:14:28 +0100 Subject: [Maxima] wrong graph Message-ID: <1D5BDDBE0E6D4C3C8909F3FCA1372C28@luigi3b0e34c8e> Maxima for a function with rational exponent plots not real parts. Example in the function: x*sqrt(x)/sqrt(1+x) or x^(3/2)/sqrt(1+x) the left part of the plot is not real ( x>0 for sqrt). Best wishes and Happy New Year Luigi Marino -------------- next part -------------- An HTML attachment was scrubbed... URL: From ted.a.smith at frontier.com Sun Jan 1 13:50:14 2012 From: ted.a.smith at frontier.com (Ted Smith) Date: Sun, 1 Jan 2012 11:50:14 -0800 Subject: [Maxima] A Signum bug in Maxima 5.25.1 Message-ID: <000c01ccc8be$95100be0$bf3023a0$@a.smith@frontier.com> I just installed 5.25.1 and was surprised when some of my code didn?t work anymore.? I narrowed it down to: (%i1) numer:true; (%o1) true (%i2) maybe(signum(1) = signum(7)); (%o2) false (%i3) map(signum, [1, -1, 7, -7]); (%o3) [1,-1,1.0,-1.0] In particular note that signum of integer 1 is integer 1, but signum? of some other positive integers is 1.0 which isn?t = 1 This behavior is different than, say, release 5.22 of Maxima. From aleksasd873 at gmail.com Mon Jan 2 05:04:19 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Mon, 2 Jan 2012 13:04:19 +0200 Subject: [Maxima] problems Message-ID: *leon.magiera at wp.pl* leon.magiera at wp.pl *Mon Jan 2 02:14:08 CST 2012 *write: Hi Problem 1 How, using Maxima, to solve in elegant way the equation eq:sqrt(x+3-4*sqrt(x-1))+sqrt(x+8-6*sqrt(x-1))=1; The solution is 5<=x<=10 Problem 2 ex:1/(sqrt((x-b)^2+a^2)*sqrt((x-b)^2/a^2+1)); integrate(ex,x); Is the above integral too hard ? Best L.M. ******************************************************** Problem 1 (%i1) eq:sqrt(x+3-4*sqrt(x-1))+sqrt(x+8-6*sqrt(x-1))=1; (%o1) sqrt(x-4*sqrt(x-1)+3)+sqrt(x-6*sqrt(x-1)+8)=1 The solution we can see from (%i2) wxplot2d([lhs(eq)], [x,1,15])$ (%t2) << Graphics >> (%i3) assume(t>0); (%o3) [t>0] (%i4) eq1:subst(x=1+t^2,eq); (%o4) sqrt(t^2-4*t+4)+sqrt(t^2-6*t+9)=1 (%i5) eq2:subst([t^2-4*t+4=factor(t^2-4*t+4),t^2-6*t+9=factor(t^2-6*t+9)],eq1); (%o5) abs(t-2)+abs(t-3)=1 Next we analyse equation eq2 in cases: a) t<2 (%i6) forget(t>0);assume(t<2); (%o6) [t>0] (%o7) [t<2] (%i8) ratsimp(eq2); (%o8) 5-2*t=1 (%i9) solve(%); (%o9) [t=2] Set of solutions is empty b) 2<=t<=3 (%i10) forget(t<2)$ assume(t>=2,t<=3); (%o11) [t>=2,t<=3] (%i12) ratsimp(eq2); (%o12) 1=1 Set of solutions is 2<=t<=3 or 5<=x<=10 ( because x=1+t^2) c) t>3 (%i13) forget(t>=2,t<=3); assume(t>3); (%o13) [t>=2,t<=3] (%o14) [t>3] (%i15) ratsimp(eq2); (%o15) 2*t-5=1 (%i16) solve(%,t); (%o16) [t=3] Set of solutions is empty problem 2 (%i17) ex:1/(sqrt((x-b)^2+a^2)*sqrt((x-b)^2/a^2+1)); (%o17) 1/(sqrt((x-b)^2+a^2)*sqrt((x-b)^2/a^2+1)) (%i18) radcan(%); (%o18) abs(a)/(x^2-2*b*x+b^2+a^2) (%i19) integrate(%,x); (%o19) (abs(a)*atan((2*x-2*b)/(2*a)))/a Best, Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Mon Jan 2 13:59:58 2012 From: woollett at charter.net (Edwin Woollett) Date: Mon, 2 Jan 2012 11:59:58 -0800 Subject: [Maxima] Bug in limit or integrate Message-ID: <7892F82731FC468294968DF7A6013D05@edwinc367e16bd> On Jan. 1, 2012, Barton Willis wrote: --------------------------- >Some definite integrals of exp(-x^4) are broken: > > (%i6) integrate(exp(-t^4),t,0,1); > (%o6) (%i*(gamma(1/4)-gamma_incomplete(1/4,1)))/4 ----------------------------------- the definite integral of the real function exp(-x^n) over the real interval (0,1) is broken (spurious imaginary parts, wrong real parts) for n = 3 through 15, and probably forever. ----------------------------------------------------------------- (%i1) exp_test(n) := ( print (n," qags = ", first( quad_qags (exp(-x^n),x,0,1)), " integrate = ", expand(float(rectform(integrate(exp(-x^n),x,0,1))))))$ (%i2) for m thru 15 do exp_test(m)$ 1 qags = 0.63212055882856 integrate = 0.63212055882856 2 qags = 0.74682413281243 integrate = 0.74682413281243 3 qags = 0.80751118213967 integrate = 0.69932519757296*%i-0.40375559106984 4 qags = 0.8448385947571 integrate = 0.8448385947571*%i 5 qags = 0.87007466768589 integrate = 0.82749018236601*%i+0.26886785869008 6 qags = 0.88826369875194 integrate = 0.76925892837871*%i+0.44413184937597 7 qags = 0.90199160301324 integrate = 0.70520543215755*%i+0.56238256584096 8 qags = 0.91271857185875 integrate = 0.64538949147622*%i+0.64538949147622 9 qags = 0.9213308364909 integrate = 0.59222004611848*%i+0.70578036756801 10 qags = 0.92839720283799 integrate = 0.54569818409775*%i+0.7510891146261 11 qags = 0.93429939205577 integrate = 0.5051203870693*%i+0.78598266428894 12 qags = 0.93930307080183 integrate = 0.46965153540091*%i+0.81346032116712 13 qags = 0.94359882032526 integrate = 0.43851223691831*%i+0.83551526125626 14 qags = 0.94732690220079 integrate = 0.41102973849353*%i+0.85351204660935 15 qags = 0.95059283193 integrate = 0.38664093739113*%i+0.86840976367727 ------------------------------------------------ Ted From biomates at telefonica.net Mon Jan 2 14:09:54 2012 From: biomates at telefonica.net (Mario Rodriguez) Date: Mon, 02 Jan 2012 21:09:54 +0100 Subject: [Maxima] wrong graph In-Reply-To: <1D5BDDBE0E6D4C3C8909F3FCA1372C28@luigi3b0e34c8e> References: <1D5BDDBE0E6D4C3C8909F3FCA1372C28@luigi3b0e34c8e> Message-ID: <1325534994.2795.6.camel@pc> El dom, 01-01-2012 a las 15:14 +0100, Luigi Marino escribi?: > Maxima for a function with rational exponent > plots not real parts. > > Example in the function: > > x*sqrt(x)/sqrt(1+x) > or x^(3/2)/sqrt(1+x) > > the left part of the plot > is not real ( x>0 for sqrt). Hello, plot2d plots the function as expected: nothing in interval [-1, 0]. draw2d plots the real part; make use of option draw_realpart=false to avoid plotting in this interval. This option has been added recently and is true by default; I've chosen this default for back compatibility, but probably it'd be better to have the same behavior as in plot2d. -- Mario From renekaelin at gmx.ch Mon Jan 2 14:53:28 2012 From: renekaelin at gmx.ch (rene kaelin) Date: Mon, 2 Jan 2012 21:53:28 +0100 Subject: [Maxima] transform x^(5/2) to sqrt(x^5) Message-ID: <6A6DE2C9-C1BC-4E2C-98AA-E1EC822F20FC@gmx.ch> Dear maxima users I found the following example display2d:false$ logconcoeffp: 'logconfun$ logconfun(m) := featurep(m,integer) or ratnump(m)$ logcontract(1/2*log(x)); which leads to log(sqrt(x)) Is there something similar to transform x^(5/2) to sqrt(x^5)? Reason: To continue processing maxima's output the sqrt-form would be nicer. Thank you. From rich.hennessy at verizon.net Mon Jan 2 16:01:11 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Mon, 02 Jan 2012 17:01:11 -0500 Subject: [Maxima] Bug in limit or integrate In-Reply-To: References: <2D6DEA23C6D94F9EAA3A92F1126B4760@RichsLaptop>, <009CCEB07A82462383B5FAF431448497@RichsLaptop> <248DBA1BC0D749118FC65FC4DD1D9345@RichsLaptop> Message-ID: "OK, this antiderivative is valid on the reals." Here is a general antidiff of the real valued function exp(-x^n) that is valid for all real x, n, (n > about .05 ) (by comparison with quad_qags). I don't know why it fails for 0 < n <=(about .05 ). -(gamma_incomplete(1/n,x^n)/n-gamma(1/n)/n)*signum(x); gammai_test(n, a, b) := ( _z : _z:-(gamma_incomplete(1/n,x^n)/n-gamma(1/n)/n)*signum(x), print(" qags = ", first(quad_qags(exp(-x^n),x,a,b)), " formula = ", float(at(_z,[x=b])-at(_z,[x=a]))))$ display2d:false$ for i : 1 thru 10 do gammai_test(random(10.0)+.5, _h:random(1.0), random(2.0)+_h); qags = 0.70997985233956 formula = 0.70997985233956 qags = 0.64248793774255 formula = 0.64248793774255 qags = 0.39405032292301 formula = 0.39405032292301 qags = 0.12849352798637 formula = 0.12849352798637 qags = 0.2383328942369 formula = 0.2383328942369 qags = 0.14758128797191 formula = 0.14758128797191 qags = 0.14207995833076 formula = 0.14207995833076 qags = 0.54953884342554 formula = 0.54953884342554 qags = 0.14493067138495 formula = 0.14493067138495 qags = 0.25412300011431 formula = 0.25412300011431 done -----Original Message----- From: Barton Willis Sent: Sunday, January 01, 2012 9:11 AM To: rich.hennessy at verizon.net Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Bug in limit or integrate ----"Richard Hennessy" wrote: ----- >I should not have used the abs() function. This is a simpler answer and it >does not blow up at zero. >(gamma(1/4)/4-gamma_incomplete(1/4,x^4)/4)*signum(x); OK, this antiderivative is valid on the reals. An antiderivative that is valid on the entire complex plane is x |-> x*hypergeometric([1/4],[5/4],-x^4). But Maxima is unable to compute limits of hypergeometric functions, you are out of luck if you used this antiderivative to try to compute integrate(exp(-x^4),x,minf,inf). Some definite integrals of exp(-x^4) are broken: (%i6) integrate(exp(-t^4),t,0,1); (%o6) (%i*(gamma(1/4)-gamma_incomplete(1/4,1)))/4 --bw From rswarbrick at gmail.com Mon Jan 2 16:24:25 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Mon, 02 Jan 2012 22:24:25 +0000 Subject: [Maxima] problems In-Reply-To: <4f021e2ab78f37.25110600@wp.pl> (leon magiera's message of "Mon, 02 Jan 2012 22:14:18 +0100") References: <4f016750a81f33.02531046@wp.pl> <4f01cd8726af76.23504702@wp.pl> <87fwfyum0k.fsf@hake.rswarbrick.dnsalias.com> <4f021e2ab78f37.25110600@wp.pl> Message-ID: <874nwdvj3a.fsf@hake.rswarbrick.dnsalias.com> leon.magiera at wp.pl writes: > Dnia 2-01-2012 o godz. 17:06 Rupert Swarbrick napisa??(a): >> leon.magiera at wp.pl writes: >> > Dnia 2-01-2012 o godz. 14:28 Rupert Swarbrick napisa??(a): >> >> leon.magiera at wp.pl writes: >> >> > Problem 2 >> >> > >> >> > ex:1/(sqrt((x-b)^2+a^2)*sqrt((x-b)^2/a^2+1)); >> >> > >> >> > integrate(ex,x); >> >> > >> >> > Is the above integral too hard ? >> > >> > CAS DERIVE returns >> > ATAN((x - b)/ABS(a)) > > Details > ex:=1/(??((x - b)^2 + a^2)????((x - b)^2/a^2 + 1)) > int(ex,x) > ATAN((x - b)/ABS(a)) > We check the obtained result > DIF(ATAN((x - b)/ABS(a)),x)-ex > 0 > >> Well, I'm pretty certain that you've either copied something incorrectly >> or made another mistake. Look at the bottom of the integrand. It's a >> product of two terms. One scales as a and the other as 1/a. Therefore >> the product doesn't have any first-order dependence on a and the derive >> answer you give above can't possibly be right. >> >> Maybe I've misunderstood your original question? >> >> Rupert Erk. It seems I can't read parentheses properly. What you have written agrees with what I said in the first place: I didn't realise that the abs(a) was inside the arc tangent. Rupert PS. Please try to CC the mailing list on conversations like this. If I'm to be humiliated, it may as well be public. PPS. Sentences are also nice. Or any indication that you have read the email to which you are replying. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From rich.hennessy at verizon.net Mon Jan 2 17:02:18 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Mon, 02 Jan 2012 18:02:18 -0500 Subject: [Maxima] Bug in limit or integrate In-Reply-To: References: <2D6DEA23C6D94F9EAA3A92F1126B4760@RichsLaptop>, <009CCEB07A82462383B5FAF431448497@RichsLaptop> <248DBA1BC0D749118FC65FC4DD1D9345@RichsLaptop> Message-ID: <926A618F785242ED8E5AC508E6E76664@RichsLaptop> Quoting myself, "Here is a general antidiff of the real valued function exp(-x^n) that is valid for all real x, n". The limits of integration have to nonnegative, I forgot about that. I should say that it is valid for all positive x, n > .05. For even integer n >= 4 then is works for all x. Rich -----Original Message----- From: Richard Hennessy Sent: Monday, January 02, 2012 5:01 PM To: Barton Willis Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Bug in limit or integrate "OK, this antiderivative is valid on the reals." Here is a general antidiff of the real valued function exp(-x^n) that is valid for all real x, n, (n > about .05 ) (by comparison with quad_qags). I don't know why it fails for 0 < n <=(about .05 ). -(gamma_incomplete(1/n,x^n)/n-gamma(1/n)/n)*signum(x); gammai_test(n, a, b) := ( _z : _z:-(gamma_incomplete(1/n,x^n)/n-gamma(1/n)/n)*signum(x), print(" qags = ", first(quad_qags(exp(-x^n),x,a,b)), " formula = ", float(at(_z,[x=b])-at(_z,[x=a]))))$ display2d:false$ for i : 1 thru 10 do gammai_test(random(10.0)+.5, _h:random(1.0), random(2.0)+_h); qags = 0.70997985233956 formula = 0.70997985233956 qags = 0.64248793774255 formula = 0.64248793774255 qags = 0.39405032292301 formula = 0.39405032292301 qags = 0.12849352798637 formula = 0.12849352798637 qags = 0.2383328942369 formula = 0.2383328942369 qags = 0.14758128797191 formula = 0.14758128797191 qags = 0.14207995833076 formula = 0.14207995833076 qags = 0.54953884342554 formula = 0.54953884342554 qags = 0.14493067138495 formula = 0.14493067138495 qags = 0.25412300011431 formula = 0.25412300011431 done -----Original Message----- From: Barton Willis Sent: Sunday, January 01, 2012 9:11 AM To: rich.hennessy at verizon.net Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Bug in limit or integrate ----"Richard Hennessy" wrote: ----- >I should not have used the abs() function. This is a simpler answer and it >does not blow up at zero. >(gamma(1/4)/4-gamma_incomplete(1/4,x^4)/4)*signum(x); OK, this antiderivative is valid on the reals. An antiderivative that is valid on the entire complex plane is x |-> x*hypergeometric([1/4],[5/4],-x^4). But Maxima is unable to compute limits of hypergeometric functions, you are out of luck if you used this antiderivative to try to compute integrate(exp(-x^4),x,minf,inf). Some definite integrals of exp(-x^4) are broken: (%i6) integrate(exp(-t^4),t,0,1); (%o6) (%i*(gamma(1/4)-gamma_incomplete(1/4,1)))/4 --bw _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Mon Jan 2 17:27:49 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 2 Jan 2012 18:27:49 -0500 Subject: [Maxima] wrong graph In-Reply-To: <1D5BDDBE0E6D4C3C8909F3FCA1372C28@luigi3b0e34c8e> References: <1D5BDDBE0E6D4C3C8909F3FCA1372C28@luigi3b0e34c8e> Message-ID: For x>0 and x< -1, the result is real: makelist(x*sqrt(x)/sqrt(1+x),x,[-1.5,-.5,.5,1.5]); (%o69) [- 2.598076211353316, - 0.5 %i, 0.28867513459481, 1.161895003862225] For x>-1 and x< 0, the result is imaginary, and is not plotted, so there is a gap in the plot. Is that what you are referring to? -s PS For reports like this, please include the version number of Maxima, the exact command you used to generate the result you think is incorrect, and why you think it is incorrect. On Sun, Jan 1, 2012 at 09:14, Luigi Marino wrote: > ** > Maxima for a function with rational exponent > plots not real parts. > > Example in the function: > > x*sqrt(x)/sqrt(1+x) > or x^(3/2)/sqrt(1+x) > > the left part of the plot > is not real ( x>0 for sqrt). > > Best wishes and Happy New Year > Luigi Marino > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Mon Jan 2 20:19:04 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Mon, 02 Jan 2012 21:19:04 -0500 Subject: [Maxima] Bug in limit or integrate In-Reply-To: References: <2D6DEA23C6D94F9EAA3A92F1126B4760@RichsLaptop>, <009CCEB07A82462383B5FAF431448497@RichsLaptop> <248DBA1BC0D749118FC65FC4DD1D9345@RichsLaptop> Message-ID: <9A46DB131695426C972768678216100C@RichsLaptop> I can fix this. I came across this bug coincidentally to the other emails on gamma_incomplete(). The bug was that pwint() returns 0 for pwint(exp(-x^4),x, minf, inf). So I made a change to pw.mac so that pwint() just passes this problem unchanged to integrate. That fixes pw.mac. Rich -----Original Message----- From: Barton Willis Sent: Sunday, January 01, 2012 9:11 AM To: rich.hennessy at verizon.net Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Bug in limit or integrate ----"Richard Hennessy" wrote: ----- >I should not have used the abs() function. This is a simpler answer and it >does not blow up at zero. >(gamma(1/4)/4-gamma_incomplete(1/4,x^4)/4)*signum(x); OK, this antiderivative is valid on the reals. An antiderivative that is valid on the entire complex plane is x |-> x*hypergeometric([1/4],[5/4],-x^4). But Maxima is unable to compute limits of hypergeometric functions, you are out of luck if you used this antiderivative to try to compute integrate(exp(-x^4),x,minf,inf). Some definite integrals of exp(-x^4) are broken: (%i6) integrate(exp(-t^4),t,0,1); (%o6) (%i*(gamma(1/4)-gamma_incomplete(1/4,1)))/4 --bw From rost14 at gmx.de Tue Jan 3 04:45:08 2012 From: rost14 at gmx.de (Roland Stewen) Date: Tue, 03 Jan 2012 11:45:08 +0100 Subject: [Maxima] Maxima tutorial Message-ID: <4F02DC34.1000603@gmx.de> Hi, I am writing a German tutorial for Maxima together with Eike Sch?tze for German pupils at secondary school (gymnasium). html-Version: http://www.rvk-hagen.de/~stewen/maxima_in_beispielen/maxima_in_beispielen.html pdf-Version: http://www.rvk-hagen.de/~stewen/maxima_in_beispielen.pdf The tutorial should be a "cookbook" with short recipes for traditional mathproblems in school for solving them with maxima. The tutorial will be changed from time to time because of feedback from users and their needs. Comments are more than welcome. Roland Stewen From aishen at free.fr Tue Jan 3 08:10:08 2012 From: aishen at free.fr (aishen) Date: Tue, 03 Jan 2012 15:10:08 +0100 Subject: [Maxima] Maxima tutorial In-Reply-To: <4F02DC34.1000603@gmx.de> References: <4F02DC34.1000603@gmx.de> Message-ID: <4F030C40.2070600@free.fr> Le 03/01/2012 11:45, Roland Stewen a ?crit : > Hi, > > I am writing a German tutorial for Maxima > together with Eike Sch?tze for German pupils at > secondary school (gymnasium). > > html-Version: > http://www.rvk-hagen.de/~stewen/maxima_in_beispielen/maxima_in_beispielen.html > > > pdf-Version: > http://www.rvk-hagen.de/~stewen/maxima_in_beispielen.pdf > > The tutorial should be a "cookbook" with > short recipes for traditional mathproblems in school > for solving them with maxima. > > The tutorial will be changed from time to time > because of feedback from users and their needs. > > Comments are more than welcome. > > Roland Stewen > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > Good ideas... I am thinking about making a collection of wxmaxima "google found" because they are so many "golden mines" in multi languages... So I am reading your tutorial even if my german language is not so good nowadays... But examples should be self explaining most of time... regards Happy new year From fateman at eecs.berkeley.edu Tue Jan 3 09:45:01 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 03 Jan 2012 07:45:01 -0800 Subject: [Maxima] taylor series, bfloat, zerop enhancements, something to think about, vs. Macsyma Message-ID: <4F03227D.3040905@eecs.berkeley.edu> taylor(((n - 1/2)*(%e^(1/n) - 1))^n, n, inf, 3); says "an error ..." though in Macsyma, the answer comes out as 1 - (1/(12 * n)) - (11/(288 * n^2)) - (653/(51840 * n^3)) + . . . also, bfloat(1/3,100) gives 100 digits of 1/3. Maxima's bfloat ignores 2nd. argument. Maxima has no zerop() function. I think it could be defined as.. zerop(x):=if bfloatp(x) then ?zerop(?cadr (x)) else if ?numberp(x) then ?zerop(x) else if ratp(x) then ?equal(0, ?cadr (x)) else false RJF From christian.stengg at gmx.at Tue Jan 3 12:21:35 2012 From: christian.stengg at gmx.at (Christian Stengg) Date: Tue, 03 Jan 2012 19:21:35 +0100 Subject: [Maxima] problems In-Reply-To: <4f016750a81f33.02531046@wp.pl> References: <4f016750a81f33.02531046@wp.pl> Message-ID: <4F03472F.60505@gmx.at> Try integrate(radcan(ex),x). Christian From macrakis at alum.mit.edu Tue Jan 3 12:35:41 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 3 Jan 2012 13:35:41 -0500 Subject: [Maxima] wrong graph In-Reply-To: References: <1D5BDDBE0E6D4C3C8909F3FCA1372C28@luigi3b0e34c8e> Message-ID: Luigi, I tried your code, and got the following graph, which looks correct to me -- is that the graph you get? Though of course sqrt(-2) is not real, sqrt(-2)/sqrt(-1) is real. There is no good way to tell Maxima to do strictly real arithmetic, such that (e.g.) sqrt(-1)/sqrt(-1) gives Undefined instead of 1. Is that what you want? -s PS Please keep the Maxima mailing list CC'ed on discussions. [image: image.png] On Tue, Jan 3, 2012 at 02:09, Luigi Marino wrote: > ** > Hi Stravos > Maxima works in complex mode. > Look at my file. > I use the last Maxima release 5.21 > Best. > Luigi > > ----- Original Message ----- > *From:* Stavros Macrakis > *To:* Luigi Marino > *Cc:* maxima at math.utexas.edu > *Sent:* Tuesday, January 03, 2012 12:27 AM > *Subject:* Re: [Maxima] wrong graph > > For x>0 and x< -1, the result is real: > > makelist(x*sqrt(x)/sqrt(1+x),x,[-1.5,-.5,.5,1.5]); > (%o69) [- 2.598076211353316, - 0.5 %i, 0.28867513459481, > 1.161895003862225] > > For x>-1 and x< 0, the result is imaginary, and is not plotted, so there > is a gap in the plot. > > Is that what you are referring to? > > -s > > PS For reports like this, please include the version number of Maxima, the > exact command you used to generate the result you think is incorrect, and > why you think it is incorrect. > > > On Sun, Jan 1, 2012 at 09:14, Luigi Marino wrote: > >> ** >> Maxima for a function with rational exponent >> plots not real parts. >> >> Example in the function: >> >> x*sqrt(x)/sqrt(1+x) >> or x^(3/2)/sqrt(1+x) >> >> the left part of the plot >> is not real ( x>0 for sqrt). >> >> Best wishes and Happy New Year >> Luigi Marino >> >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 10006 bytes Desc: not available URL: From macrakis at alum.mit.edu Tue Jan 3 12:43:22 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 3 Jan 2012 13:43:22 -0500 Subject: [Maxima] wrong graph In-Reply-To: References: <1D5BDDBE0E6D4C3C8909F3FCA1372C28@luigi3b0e34c8e> Message-ID: To elaborate a bit on "There is no good way to tell Maxima to do strictly real arithmetic", you could of course define mysqrt(x):=if x<0 then error() else sqrt(x)$ which would work fine as a *computational* function, but it will not*simplify * correctly in this case: mysqrt(x)/mysqrt(x) => 1 Also, mysqrt of a variable will expand out to a conditional, and your expressions will tend to blow up, e.g. mysqrt(1+mysqrt(x)); => if (if x < 0 then error() else sqrt(x)) + 1 < 0 then error() else sqrt((if x < 0 then error() else sqrt(x)) + 1) Maybe that is OK in your application.... If on the other hand you keep mysqrt as an unevaluated function, you'd have to re-implement all the standard simplifications. -s On Tue, Jan 3, 2012 at 13:35, Stavros Macrakis wrote: > Luigi, > > I tried your code, and got the following graph, which looks correct to me > -- is that the graph you get? > > Though of course sqrt(-2) is not real, sqrt(-2)/sqrt(-1) is real. There > is no good way to tell Maxima to do strictly real arithmetic, such that > (e.g.) sqrt(-1)/sqrt(-1) gives Undefined instead of 1. Is that what you > want? > > -s > > PS Please keep the Maxima mailing list CC'ed on discussions. > [image: image.png] > > On Tue, Jan 3, 2012 at 02:09, Luigi Marino wrote: > >> ** >> Hi Stravos >> Maxima works in complex mode. >> Look at my file. >> I use the last Maxima release 5.21 >> Best. >> Luigi >> >> ----- Original Message ----- >> *From:* Stavros Macrakis >> *To:* Luigi Marino >> *Cc:* maxima at math.utexas.edu >> *Sent:* Tuesday, January 03, 2012 12:27 AM >> *Subject:* Re: [Maxima] wrong graph >> >> For x>0 and x< -1, the result is real: >> >> makelist(x*sqrt(x)/sqrt(1+x),x,[-1.5,-.5,.5,1.5]); >> (%o69) [- 2.598076211353316, - 0.5 %i, 0.28867513459481, >> 1.161895003862225] >> >> For x>-1 and x< 0, the result is imaginary, and is not plotted, so there >> is a gap in the plot. >> >> Is that what you are referring to? >> >> -s >> >> PS For reports like this, please include the version number of Maxima, >> the exact command you used to generate the result you think is incorrect, >> and why you think it is incorrect. >> >> >> On Sun, Jan 1, 2012 at 09:14, Luigi Marino wrote: >> >>> ** >>> Maxima for a function with rational exponent >>> plots not real parts. >>> >>> Example in the function: >>> >>> x*sqrt(x)/sqrt(1+x) >>> or x^(3/2)/sqrt(1+x) >>> >>> the left part of the plot >>> is not real ( x>0 for sqrt). >>> >>> Best wishes and Happy New Year >>> Luigi Marino >>> >>> >>> _______________________________________________ >>> Maxima mailing list >>> Maxima at math.utexas.edu >>> http://www.math.utexas.edu/mailman/listinfo/maxima >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 10006 bytes Desc: not available URL: From amzoti at gmail.com Tue Jan 3 13:12:13 2012 From: amzoti at gmail.com (W F) Date: Tue, 3 Jan 2012 11:12:13 -0800 Subject: [Maxima] Maxima tutorial In-Reply-To: <4F030C40.2070600@free.fr> References: <4F02DC34.1000603@gmx.de> <4F030C40.2070600@free.fr> Message-ID: On 1/3/12, aishen wrote: > Le 03/01/2012 11:45, Roland Stewen a ?crit : >> Hi, >> >> I am writing a German tutorial for Maxima >> together with Eike Sch?tze for German pupils at >> secondary school (gymnasium). >> >> html-Version: >> http://www.rvk-hagen.de/~stewen/maxima_in_beispielen/maxima_in_beispielen.html >> >> >> >> pdf-Version: >> http://www.rvk-hagen.de/~stewen/maxima_in_beispielen.pdf >> >> The tutorial should be a "cookbook" with >> short recipes for traditional mathproblems in school >> for solving them with maxima. >> >> The tutorial will be changed from time to time >> because of feedback from users and their needs. >> >> Comments are more than welcome. >> >> Roland Stewen >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> > Good ideas... I am thinking about making a collection of wxmaxima > "google found" because they are so many "golden mines" in multi > languages... So I am reading your tutorial even if my german language is > not so good nowadays... But examples should be self explaining most of > time... > regards > Happy new year > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > Excellent contributions. I have always wondered if a cohesive manual and examples could somehow be maintained and worked as a cumulative effort to get the greatest coverage and examples. For example, the work by http://www.csulb.edu/~woollett/ This would be akin to the example repository that Wolfram-Mathematica uses. Just a thought to chew on. Thanks! From toy.raymond at gmail.com Tue Jan 3 13:59:22 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 3 Jan 2012 11:59:22 -0800 Subject: [Maxima] A Signum bug in Maxima 5.25.1 In-Reply-To: <4f01f370.c6adec0a.49d2.fffffbf0SMTPIN_ADDED@mx.google.com> References: <4f01f370.c6adec0a.49d2.fffffbf0SMTPIN_ADDED@mx.google.com> Message-ID: On Sun, Jan 1, 2012 at 11:50 AM, Ted Smith wrote: > I just installed 5.25.1 and was surprised when some of my code didn?t work > anymore. I narrowed it down to: > The latest release is 5.26.0. > > (%i1) numer:true; > (%o1) true > (%i2) maybe(signum(1) = signum(7)); > (%o2) false > (%i3) map(signum, [1, -1, 7, -7]); > (%o3) [1,-1,1.0,-1.0] > > In particular note that signum of integer 1 is integer 1, but signum of > some other positive integers is 1.0 which isn?t = 1? > > These seem to be fixed in 5.26.0. maybe(signum(1) = signum(7)) returns true, and map(signum,[1,-1,7,-7]) returns either 1 or -1, but not 1.0. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Jan 3 14:24:08 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 3 Jan 2012 12:24:08 -0800 Subject: [Maxima] problems In-Reply-To: <4f016750a81f33.02531046@wp.pl> References: <4f016750a81f33.02531046@wp.pl> Message-ID: On Mon, Jan 2, 2012 at 12:14 AM, wrote: > Hi > > Problem 1 > How, using Maxima, to solve in elegant way the equation > > eq:sqrt(x+3-4*sqrt(x-1))+sqrt(x+8-6*sqrt(x-1))=1; > > The solution is > > 5<=x<=10 > It looks like to_poly_solver can solve this: (%i54) load(to_poly_solver); (%o54) "/Users/rtoy/src/sourceforge/maxima/share/contrib/to_poly_solver.mac" (%i55) to_poly_solve(eq,x); (%o55) %union(%if(?%and(-%pi/2 < parg(3-%c41),-%pi/2 < parg(%c41-2), -%pi/2 < parg(%c41),parg(3-%c41) <= %pi/2, parg(%c41-2) <= %pi/2,parg(%c41) <= %pi/2), [x = %c41^2+1],%union())) This is kind of hard to read, but basically if the complex number %c41 satisfies the conditions in the %if, then %c41^2+1 is a solution. If we're interested in just real solutions, I think the %if simplifies to 2<= %c41 <= 3, which means 5 <= x <= 10. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From biomates at telefonica.net Tue Jan 3 15:13:40 2012 From: biomates at telefonica.net (Mario Rodriguez) Date: Tue, 03 Jan 2012 22:13:40 +0100 Subject: [Maxima] Maxima tutorial In-Reply-To: <4F02DC34.1000603@gmx.de> References: <4F02DC34.1000603@gmx.de> Message-ID: <1325625220.2729.1.camel@pc> El mar, 03-01-2012 a las 11:45 +0100, Roland Stewen escribi?: > Hi, > > I am writing a German tutorial for Maxima > together with Eike Sch?tze for German pupils at > secondary school (gymnasium). > > html-Version: > http://www.rvk-hagen.de/~stewen/maxima_in_beispielen/maxima_in_beispielen.html > > pdf-Version: > http://www.rvk-hagen.de/~stewen/maxima_in_beispielen.pdf > > The tutorial should be a "cookbook" with > short recipes for traditional mathproblems in school > for solving them with maxima. > > The tutorial will be changed from time to time > because of feedback from users and their needs. > > Comments are more than welcome. > > Roland Stewen This document is now linked from the Maxima web site. Danke! -- Mario From dlakelan at street-artists.org Tue Jan 3 15:25:22 2012 From: dlakelan at street-artists.org (dlakelan) Date: Tue, 03 Jan 2012 13:25:22 -0800 Subject: [Maxima] expintegral_e: series failed In-Reply-To: References: Message-ID: <4F037242.1070403@street-artists.org> On 12/30/2011 12:13 AM, Raymond Toy wrote: > On Thu, Dec 29, 2011 at 2:16 PM, Edwin Woollett wrote: > >> attempted evaluation of bfloat of an expression >> involving gamma_incomplete's leads to an error message: ... > Could you file a bug report on this? I know about some of these issues and > am working on them (slowly). The basic parts work, but the corner cases > need more work (especically since my approach fails in some cases where the > original gave correct answers). I'm sure you've seen this since the simplest google search would bring it up, but it seemed interesting so if you haven't seen it you might want to take a look: http://iopscience.iop.org/0295-5075/71/1/001/pdf/epl_71_1_001.pdf From toy.raymond at gmail.com Tue Jan 3 16:48:01 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 3 Jan 2012 14:48:01 -0800 Subject: [Maxima] expintegral_e: series failed In-Reply-To: <4F037242.1070403@street-artists.org> References: <4F037242.1070403@street-artists.org> Message-ID: On Tue, Jan 3, 2012 at 1:25 PM, dlakelan wrote: > On 12/30/2011 12:13 AM, Raymond Toy wrote: > > On Thu, Dec 29, 2011 at 2:16 PM, Edwin Woollett >wrote: > > > >> attempted evaluation of bfloat of an expression > >> involving gamma_incomplete's leads to an error message: > ... > > > Could you file a bug report on this? I know about some of these issues > and > > am working on them (slowly). The basic parts work, but the corner cases > > need more work (especically since my approach fails in some cases where > the > > original gave correct answers). > > I'm sure you've seen this since the simplest google search would bring > it up, but it seemed interesting so if you haven't seen it you might > want to take a look: > > http://iopscience.iop.org/0295-5075/71/1/001/pdf/epl_71_1_001.pdf > > Thanks for the tip. I had not seen this; I was working from the continued fraction and series representations of the incomplete gamma function. This seems interesting, but it's not immediately clear if "all a and x" means all real a and x or all complex a and x. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlakelan at street-artists.org Tue Jan 3 17:20:30 2012 From: dlakelan at street-artists.org (dlakelan) Date: Tue, 03 Jan 2012 15:20:30 -0800 Subject: [Maxima] expintegral_e: series failed In-Reply-To: References: <4F037242.1070403@street-artists.org> Message-ID: <4F038D3E.8010309@street-artists.org> On 01/03/2012 02:48 PM, Raymond Toy wrote: > On Tue, Jan 3, 2012 at 1:25 PM, dlakelan wrote: > >> On 12/30/2011 12:13 AM, Raymond Toy wrote: >>> Could you file a bug report on this? I know about some of these issues >> and >>> am working on them (slowly). The basic parts work, but the corner cases >>> need more work (especically since my approach fails in some cases where >> the >>> original gave correct answers). >> >> I'm sure you've seen this since the simplest google search would bring >> it up, but it seemed interesting so if you haven't seen it you might >> want to take a look: >> >> http://iopscience.iop.org/0295-5075/71/1/001/pdf/epl_71_1_001.pdf >> >> > Thanks for the tip. I had not seen this; I was working from the continued > fraction and series representations of the incomplete gamma function. > > This seems interesting, but it's not immediately clear if "all a and x" > means all real a and x or all complex a and x. Agreed, and the article seems to treat all the parameters as real, though perhaps the author has worked out whether the method makes sense for complex parameters or requires some modification? In any case, perhaps the real case is the most common, and it could be useful to use this result for evaluation when the parameters are real. From dbmaxima at gmail.com Tue Jan 3 18:57:11 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Wed, 04 Jan 2012 11:57:11 +1100 Subject: [Maxima] expintegral_e: series failed In-Reply-To: <4F037242.1070403@street-artists.org> References: <4F037242.1070403@street-artists.org> Message-ID: <4F03A3E7.7040101@gmail.com> On 4/01/2012 8:25 AM, dlakelan wrote: > > I'm sure you've seen this since the simplest google search would bring > it up, but it seemed interesting so if you haven't seen it you might > want to take a look: > > http://iopscience.iop.org/0295-5075/71/1/001/pdf/epl_71_1_001.pdf This reference is also freely available as http://arxiv.org/abs/math-ph/0501019 Asymptotic and exact series representations for the incomplete Gamma function Authors: Paolo Amore Abstract: Using a variational approach, two new series representations for the incomplete Gamma function are derived: the first is an asymptotic series, which contains and improves over the standard asymptotic expansion; the second is a uniformly convergent series, completely analytical, which can be used to obtain arbitrarily accurate estimates of $\Gamma(a,x)$ for any value of $a$ or $x$. Applications of these formulas are discussed. Journal reference: Europhysics Letters 71, 1-7 (2005) From rich.hennessy at verizon.net Tue Jan 3 19:15:44 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 03 Jan 2012 20:15:44 -0500 Subject: [Maxima] Bug in limit or integrate In-Reply-To: References: <009CCEB07A82462383B5FAF431448497@RichsLaptop> Message-ID: <9483E60A879B4BE293A00D296BF48A6A@RichsLaptop> "Sometime ago, I wrote a bit of code that attempts to determine when an expression is continuous." I came up with this bit of code. It works pretty well. continuousp(__e, __x, __p):=block ( [inflag : true, ratprint:false, _p, _l], _p : errcatch ( if is(equal(_l : limit(__e, __x, __p, 'plus), limit(__e, __x, __p, 'minus))) then if is(equal(_l, at(__e, [__x=__p]))) = true then true else false else false ), if emptyp(_p) then if is(equal(error, ["expt: undefined: 0 to a negative exponent."]))=true then false else [] else first(_p) ); -----Original Message----- From: Barton Willis Sent: Saturday, December 31, 2011 8:57 AM To: rich.hennessy at verizon.net Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Bug in limit or integrate The function x |-> -gamma_incomplete(1/4,x^4)*x/(4*abs(x)) is not continuous at zero. To do the calculation correctly, you need to consider the intervals (-inf,0) and (0, inf) separately. Doing that, the definite integral is correct, I think. Sometime ago, I wrote a bit of code that attempts to determine when an expression is continuous. I know that in general this is algorithmically impossible--I was aiming for a satisficing (good enough) method. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- I get this incorrect result for the following calculations: (%i4) kill(all); (%o0) done (%i1) exp(-x^4); (%o1) %e^-x^4 (%i2) integrate(%o1,x,minf,inf); (%o2) gamma(1/4)/2 (%i3) integrate(%o1,x); (%o3) -gamma_incomplete(1/4,x^4)*x/(4*abs(x)) (%i4) limit(%o3,x,inf)-limit(%o3,x,minf); (%o4) 0 The limit should give the same answer as the more direct definite integral. I can’t take the analysis much further because I know very little about the gamma_incomplete function. It looks like a bug. Rich _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Tue Jan 3 19:31:57 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 03 Jan 2012 20:31:57 -0500 Subject: [Maxima] Bug in limit or integrate In-Reply-To: <9483E60A879B4BE293A00D296BF48A6A@RichsLaptop> References: <009CCEB07A82462383B5FAF431448497@RichsLaptop> <9483E60A879B4BE293A00D296BF48A6A@RichsLaptop> Message-ID: <77F2B44468E242738F00F487FA309E9F@RichsLaptop> (%i10) continuousp(abs(x),x,0); (%o10) true (%i11) continuousp(abs(x)^2,x,0); (%o11) true (%i12) continuousp(1/abs(x-a),x,a); expt: undefined: 0 to a negative exponent. (%o12) false (%i13) continuousp(1/(x-a),x,a); (%o13) false (%i14) continuousp(1/(x-a)^3,x,a); (%o14) false (%i15) continuousp(1/(sqrt(x-a))^3,x,a); Rich -----Original Message----- From: Richard Hennessy Sent: Tuesday, January 03, 2012 8:15 PM To: Barton Willis Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Bug in limit or integrate "Sometime ago, I wrote a bit of code that attempts to determine when an expression is continuous." I came up with this bit of code. It works pretty well. continuousp(__e, __x, __p):=block ( [inflag : true, ratprint:false, _p, _l], _p : errcatch ( if is(equal(_l : limit(__e, __x, __p, 'plus), limit(__e, __x, __p, 'minus))) then if is(equal(_l, at(__e, [__x=__p]))) = true then true else false else false ), if emptyp(_p) then if is(equal(error, ["expt: undefined: 0 to a negative exponent."]))=true then false else [] else first(_p) ); -----Original Message----- From: Barton Willis Sent: Saturday, December 31, 2011 8:57 AM To: rich.hennessy at verizon.net Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Bug in limit or integrate The function x |-> -gamma_incomplete(1/4,x^4)*x/(4*abs(x)) is not continuous at zero. To do the calculation correctly, you need to consider the intervals (-inf,0) and (0, inf) separately. Doing that, the definite integral is correct, I think. Sometime ago, I wrote a bit of code that attempts to determine when an expression is continuous. I know that in general this is algorithmically impossible--I was aiming for a satisficing (good enough) method. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- I get this incorrect result for the following calculations: (%i4) kill(all); (%o0) done (%i1) exp(-x^4); (%o1) %e^-x^4 (%i2) integrate(%o1,x,minf,inf); (%o2) gamma(1/4)/2 (%i3) integrate(%o1,x); (%o3) -gamma_incomplete(1/4,x^4)*x/(4*abs(x)) (%i4) limit(%o3,x,inf)-limit(%o3,x,minf); (%o4) 0 The limit should give the same answer as the more direct definite integral. I can’t take the analysis much further because I know very little about the gamma_incomplete function. It looks like a bug. Rich _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From leon.magiera at wp.pl Wed Jan 4 03:55:53 2012 From: leon.magiera at wp.pl (leon.magiera at wp.pl) Date: Wed, 04 Jan 2012 10:55:53 +0100 Subject: [Maxima] limit Message-ID: <4f042229041738.17309342@wp.pl> Hi, limit(atan(a*x)-atan(-a*x),x,inf); Maxima's result %pi is correct only for a>0 Best Leon P.S. DERIVE returns: SIGN(a)*PI Mathematica: Sqrt[a^2]/a*Pi From volkervannek at googlemail.com Wed Jan 4 05:26:07 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Wed, 4 Jan 2012 12:26:07 +0100 Subject: [Maxima] Maxima tutorial In-Reply-To: <1325625220.2729.1.camel@pc> References: <4F02DC34.1000603@gmx.de> <1325625220.2729.1.camel@pc> Message-ID: Hi Mario, thanks for linking this document. And thanks to Roland and Eike for posting it. I attached remarks to some chapters. I believe three points are worth to mention: - Blocks in user functions terminated by a return statement. I have also seen this Java/C++ habit in e.g. the Galois fields package share/contrib/gf/gf.mac. Leaving out unnecessary returns and replacing 'block([ ],' expressions with no local variables by a simple '(' functions can be written a little bit easier. - Lambda expressions are widely used in this document (addressed to school kids!) where in most cases they can be replaced by a call to an existing function. - For working with vectors in schools the vector_rebuild package might be an alternative approach. It is documented in share/vector/vector_rebuild.usg. Greetings Volker 2012/1/3 Mario Rodriguez > El mar, 03-01-2012 a las 11:45 +0100, Roland Stewen escribi?: > > Hi, > > > > I am writing a German tutorial for Maxima > > together with Eike Sch?tze for German pupils at > > secondary school (gymnasium). > > > > html-Version: > > > http://www.rvk-hagen.de/~stewen/maxima_in_beispielen/maxima_in_beispielen.html > > > > pdf-Version: > > http://www.rvk-hagen.de/~stewen/maxima_in_beispielen.pdf > > > > The tutorial should be a "cookbook" with > > short recipes for traditional mathproblems in school > > for solving them with maxima. > > > > The tutorial will be changed from time to time > > because of feedback from users and their needs. > > > > Comments are more than welcome. > > > > Roland Stewen > > > This document is now linked from the Maxima web site. > > Danke! > > -- > Mario > > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- S. 18: (%i1) f(x) := x^2; 2 (%o1) f(x) := x (%i2) df(x) := diff(f(x), x); (%o2) df(x) := diff(f(x), x) (%i3) df(x); (%o3) 2 x (%i4) df(2); diff: second argument must be a variable; found 2 #0: df(x=2) -- an error. To debug this try: debugmode(true); (%i5) df(x) := ''( diff(f(x), x) ); (%o5) df(x) := 2 x (%i6) df(2); (%o6) 4 (%i7) define(df(x), diff(f(x), x)); (%o7) df(x) := 2 x (%i8) df(2); (%o8) 4 S. 69: (%i1) load (eigen)$ (%i2) a : covect([1,2,3])$ (%i3) b : covect([2,1,2])$ (%i4) basis : orthogonal_complement(a, b); [ 1 ] [ ] (%o4) span([ 4 ]) [ ] [ - 3 ] (%i5) first(basis); [ 1 ] [ ] (%o5) [ 4 ] [ ] [ - 3 ] S. 70: (%i1) load (eigen)$ (%i2) a : covect([1,2,3])$ (%i3) b : covect([1,2,3])$ (%i4) basis : orthogonal_complement(a, b); [ - 2 ] [ 0 ] [ ] [ ] (%o4) span([ 1 ], [ 3 ]) [ ] [ ] [ 0 ] [ - 2 ] (%i5) n1 : first(basis); [ - 2 ] [ ] (%o5) [ 1 ] [ ] [ 0 ] (%i6) n2 : second(basis); [ 0 ] [ ] (%o6) [ 3 ] [ ] [ - 2 ] S. 72: (%i1) load(vector_rebuild)$ (%i2) a : covect([1,2,3])$ (%i3) b : covect([2,1,2])$ (%i4) a~b; [ 1 ] [ ] (%o4) [ 4 ] [ ] [ - 3 ] S. 73: (%i1) load(vector_rebuild)$ (%i2) v([args]):= covect(args)$ (%i3) x : v(1,2,3) + r*v(2,5,1) + s*v(3,-2,1); [ 3 ] [ 2 ] [ 1 ] [ ] [ ] [ ] (%o3) s [ - 2 ] + r [ 5 ] + [ 2 ] [ ] [ ] [ ] [ 1 ] [ 1 ] [ 3 ] (%i4) x, r = 0, s = 0, vector_simp; [ 1 ] [ ] (%o4) [ 2 ] [ ] [ 3 ] (%i5) x, r = 0, s = 2, vector_simp; [ 7 ] [ ] (%o5) [ - 2 ] [ ] [ 5 ] S. 75: (%i1) load(vector_rebuild)$ (%i2) v([args]):= covect(args)$ (%i3) b : v(-25,2,0)$ (%i4) c : v(0, 2,-5)$ (%i5) n : b~c; [ - 10 ] [ ] (%o5) [ - 125 ] [ ] [ - 50 ] (%i6) n : vector_factor(n), vector_factor_minus:true; [ 2 ] [ ] (%o6) - 5 [ 25 ] [ ] [ 10 ] (%i7) en : 1/|n| * n; [ 2 ] 1 [ ] (%o7) (- --) [ 25 ] 27 [ ] [ 10 ] (%i8) |en|; (%o8) 1 S. 76: (%i1) load(vector_rebuild)$ (%i2) v([args]):= covect(args)$ (%i3) a : v(1,2,3)$ (%i4) n : v(2,25,10)$ (%i5) oc : orthogonal_complement(n)$ 0 errors, 0 warnings (%i6) [b, c] : [first(oc), second(oc)]$ (%i7) a + r * b + s * c; [ 0 ] [ - 25 ] [ 1 ] [ ] [ ] [ ] (%o7) s [ 10 ] + r [ 2 ] + [ 2 ] [ ] [ ] [ ] [ - 25 ] [ 0 ] [ 3 ] (%i8) nf : x.n = a.n; [ 2 ] [ 1 ] [ 2 ] [ ] [ ] [ ] (%o8) x . [ 25 ] = [ 2 ] . [ 25 ] [ ] [ ] [ ] [ 10 ] [ 3 ] [ 10 ] (%i9) nf, x=v(x1,x2,x3), vector_simp; (%o9) 10 x3 + 25 x2 + 2 x1 = 82 (%i10) % / |n|; 10 x3 + 25 x2 + 2 x1 82 (%o10) -------------------- = -- 27 27 S. 100: (%i1) len(vec) := block([sum:0], for n in flatten(args(vec)) do sum : sum + n^2, sqrt(sum) )$ (%i2) load (eigen)$ (%i3) a : covect ([3, 4]); [ 3 ] (%o3) [ ] [ 4 ] (%i4) len(a); (%o4) 5 (%i5) len([3, 4]); (%o5) 5 1. Wert eines Blocks ist stets der Wert des letzten Ausdrucks. 2. vec kann hier Spalten- oder Zeilenvektor sein. S. 101: (%i1) mysolve(a, b) := block([lsg, varListe, len], lsg : solve (a, b), varListe : [r, s, t], len : length(%rnum_list), for i thru len do lsg : subst (varListe[i], %rnum_list[i], lsg), lsg )$ (%i2) gl1 : 2*x = y; (%o2) 2 x = y (%i3) gl2 : 2*gl1; (%o3) 4 x = 2 y (%i4) gleichungen : [gl1, gl2]; (%o4) [2 x = y, 4 x = 2 y] (%i5) variablen : [x, y]; (%o5) [x, y] (%i6) mysolve (gleichungen, variablen); solve: dependent equations eliminated: (2) r (%o6) [[x = -, y = r]] 2 (%i7) mysolve(a, b) := block([lsg, varListe, maperror:false], lsg : solve (a, b), varListe : [r, s, t], lsg : subst (map("=", %rnum_list, varListe), lsg), lsg )$ (%i8) mysolve (gleichungen, variablen)$ solve: dependent equations eliminated: (2) map: truncating one or more arguments. (%i9) %; r (%o9) [[x = -, y = r]] 2 1. Wert eines Blocks ist stets der Wert des letzten Ausdrucks. 2. i ist durch 'for i : 1 thru' lokal im Block der for-Schleife. Kein 'block[i], for i : 1 thru' noetig. 3. 'block([],' ist gleichwertig mit '('. 4. 'subst([a=b], expr)' entspricht 'subst(b, a, expr)'. 5. 'maperror:false' verhindert Abbruch(, erzeugt jedoch Meldung ohne Zeilenumbruch). S. 148: (%i1) a : 1$ (%i2) for i thru 10 do print(a : next_prime(a))$ 2 3 5 7 11 13 17 19 23 29 (%i3) prim : primes(0, 50); (%o3) [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47] (%i4) rest(prim, 10 - length(prim)); (%o4) [2, 3, 5, 7, 11, 13, 17, 19, 23, 29] 1. 1 ist nicht prim. 2. 'block([],' ist gleichwertig mit '('. 3. 'for i : 1 while i < 10 do' --> 9 Durchlaeufe S. 149: (%i1) r : ifactors (12); (%o1) [[2, 2], [3, 1]] (%i2) r : ifactors (12), factors_only : true; (%o2) [2, 3] S. 150: (%i1) genauigkeit : 40$ (%i2) fpprec : genauigkeit + 3$ (%i3) z : bfloat (sqrt(2)); (%o3) 1.414213562373095048801688724209698078569672b0 (%i4) l : map(parse_string, charlist(substring(string(z), 3, fpprec))); (%o4) [4, 1, 4, 2, 1, 3, 5, 6, 2, 3, 7, 3, 0, 9, 5, 0, 4, 8, 8, 0, 1, 6, 8, 8, 7, 2, 4, 2, 0, 9, 6, 9, 8, 0, 7, 8, 5, 6, 9, 6] S. 155: (%i1) l : [1, 2, 3, 4]; (%o1) [1, 2, 3, 4] (%i3) (sum:0, for n in l do sum : sum + n, sum); (%o3) 10 1. 'block([],' ist gleichwertig mit '('. 2. Wert eines Blocks ist stets der Wert des letzten Ausdrucks. S. 156: (%i1) l : [1, 2, 3, 4]; (%o1) [1, 2, 3, 4] (%i3) (prod:1, for n in l do prod : prod * n, prod); (%o3) 24 (%i1) l : [Max, Willi, Peter]; (%o1) [Max, Willi, Peter] (%i3) jungen : endcons(Paul, l); (%o3) [Max, Willi, Peter, Paul] (%i4) jungen : cons(Paul, l); (%o4) [Paul, Max, Willi, Peter] S. 158: (%i2) liste2 : [ [3, 5], [1,8], [4, 2] ]; (%o2) [[3, 5], [1, 8], [4, 2]] (%i4) xWerte : map(first, liste2); (%o4) [3, 1, 4] (%i1) l : [1, 2, 3, 4]; (%o1) [1, 2, 3, 4] (%i2) f(x) := 2*x+1; (%o2) f(x) := 2 x + 1 (%i3) map(f, l); (%o3) [3, 5, 7, 9] S. 159: (%i1) liste : [ [1,2], [3,4], [5,6] ]$ (%i2) M : apply(matrix, liste); [ 1 2 ] [ ] (%o2) [ 3 4 ] [ ] [ 5 6 ] S. 160: (%i1) load (eigen)$ (%i2) a : covect ([1, 2, 3])$ (%i3) [x, y, z] : args(map(first, a)); (%o3) [1, 2, 3] (%i1) a : [1, 2, 3]; (%o1) [1, 2, 3] (%i2) b : 2*a; (%o2) [2, 4, 6] (%i3) a + b, listarith : false; (%o3) [2, 4, 6] + [1, 2, 3] (%i4) map("+", a,b); (%o4) [3, 6, 9] Die Auswertung des Ausdrucks Liste + Liste ist abhaengig von listarith (default=true). S. 161: (%i1) a : [1, 2, 3]; (%o1) [1, 2, 3] (%i2) b : 2*a; (%o2) [2, 4, 6] (%i3) map("[", a,b); (%o3) [[1, 2], [2, 4], [3, 6]] From aleksasd873 at gmail.com Tue Jan 3 09:06:13 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Tue, 3 Jan 2012 17:06:13 +0200 Subject: [Maxima] Bug in limit or integrate Message-ID: from http://www.math.utexas.edu/pipermail/maxima/2012/027277.html On Jan. 1, 2012, Barton Willis wrote: --------------------------- >*Some definite integrals of exp(-x^4) are broken:*>**>* (%i6) integrate(exp(-t^4),t,0,1);*>* (%o6) (%i*(gamma(1/4)-gamma_incomplete(1/4,1)))/4*----------------------------------- the definite integral of the real function exp(-x^n) over the real interval (0,1) is broken (spurious imaginary parts, wrong real parts) for n = 3 through 15, and probably forever. ----------------------------------------------------------------- (%i1) exp_test(n) := ( print (n," qags = ", first( quad_qags (exp(-x^n),x,0,1)), " integrate = ", expand(float(rectform(integrate(exp(-x^n),x,0,1))))))$ (%i2) for m thru 15 do exp_test(m)$ 1 qags = 0.63212055882856 integrate = 0.63212055882856 2 qags = 0.74682413281243 integrate = 0.74682413281243 3 qags = 0.80751118213967 integrate = 0.69932519757296*%i-0.40375559106984 4 qags = 0.8448385947571 integrate = 0.8448385947571*%i 5 qags = 0.87007466768589 integrate = 0.82749018236601*%i+0.26886785869008 6 qags = 0.88826369875194 integrate = 0.76925892837871*%i+0.44413184937597 7 qags = 0.90199160301324 integrate = 0.70520543215755*%i+0.56238256584096 8 qags = 0.91271857185875 integrate = 0.64538949147622*%i+0.64538949147622 9 qags = 0.9213308364909 integrate = 0.59222004611848*%i+0.70578036756801 10 qags = 0.92839720283799 integrate = 0.54569818409775*%i+0.7510891146261 11 qags = 0.93429939205577 integrate = 0.5051203870693*%i+0.78598266428894 12 qags = 0.93930307080183 integrate = 0.46965153540091*%i+0.81346032116712 13 qags = 0.94359882032526 integrate = 0.43851223691831*%i+0.83551526125626 14 qags = 0.94732690220079 integrate = 0.41102973849353*%i+0.85351204660935 15 qags = 0.95059283193 integrate = 0.38664093739113*%i+0.86840976367727 ------------------------------------------------ Ted ************************************************************************************************************* Correct results are: (%i1) S(k):='integrate(exp(-x^k),x,0,1)$ (%i2) for k:1 thru 15 do (changevar(S(k),y=-x,y,x),ev(%%,nouns), print((S(k)=%%)=float(%%))); integrate(%e^(-x),x,0,1) =1-%e^(-1) =0.632120558828558 integrate(%e^(-x^2),x,0,1) =(sqrt(%pi)*erf(1))/2 =0.746824132812427 integrate(%e^(-x^3),x,0,1) =(gamma(1/3)-gamma_incomplete(1/3,1))/3 =0.807511182139671 integrate(%e^(-x^4),x,0,1) =(gamma(1/4)-gamma_incomplete(1/4,1))/4 =0.844838594757102 integrate(%e^(-x^5),x,0,1) =(gamma(1/5)-gamma_incomplete(1/5,1))/5 =0.870074667685893 integrate(%e^(-x^6),x,0,1) =(gamma(1/6)-gamma_incomplete(1/6,1))/6 =0.888263698751937 integrate(%e^(-x^7),x,0,1) =(gamma(1/7)-gamma_incomplete(1/7,1))/7 =0.901991603013235 integrate(%e^(-x^8),x,0,1) =(gamma(1/8)-gamma_incomplete(1/8,1))/8 =0.91271857185875 integrate(%e^(-x^9),x,0,1) =(gamma(1/9)-gamma_incomplete(1/9,1))/9 =0.921330836490897 integrate(%e^(-x^10),x,0,1)=(gamma(1/10)-gamma_incomplete(1/10,1))/10=0.928397202837989 integrate(%e^(-x^11),x,0,1)=(gamma(1/11)-gamma_incomplete(1/11,1))/11 =0.934299392055766 integrate(%e^(-x^12),x,0,1)=(gamma(1/12)-gamma_incomplete(1/12,1))/12=0.939303070801829 integrate(%e^(-x^13),x,0,1)=(gamma(1/13)-gamma_incomplete(1/13,1))/13=0.94359882032526 integrate(%e^(-x^14),x,0,1)=(gamma(1/14)-gamma_incomplete(1/14,1))/14=0.947326902200789 integrate(%e^(-x^15),x,0,1)=(gamma(1/15)-gamma_incomplete(1/15,1))/15=0.950592831930002 (%o2) done Questions: 1. How exact compute sum(1/((3*i+1)*i!),i=0..infinity) ? 2. WolframAlpha(http://www.wolframalpha.com/) return sum_(i=0)^infinity1/((3 i+1) i!) = -1/3 (-1)^(2/3) (3 Gamma(4/3)-Gamma(1/3, -1))~~1.3419 How compute this with maxima ? 3. How compute (-1)^(2/3) ? (%i1) (-1)^(2/3); (%o1) 1 or (%i2) polarform(-1)^(2/3); (%o2) (sqrt(3)*%i)/2-1/2 4. Prove, that sum(1/((3*i+1)*i!),i=0..infinity) =integrate(exp(x^3),x,0,1) Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From deburgess at asbury.edu Tue Jan 3 12:07:02 2012 From: deburgess at asbury.edu (Burgess, Don) Date: Tue, 3 Jan 2012 13:07:02 -0500 Subject: [Maxima] simplified vector display output Message-ID: Can Maxima recognize a known vector in a vector expression and give a simplified display output in terms of the Name of the known vector? So, for example, in the Maxima Session represented in the attached image, I would like Maxima to recognize "F.v1" as a scalar multiplied by a known vector " v1" and to display the result as "(2*alpha +1)*v1"" Thank you very much for your help, don burgess -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: EigenVector.png Type: image/x-png Size: 25595 bytes Desc: EigenVector.png URL: From woollett at charter.net Tue Jan 3 16:44:31 2012 From: woollett at charter.net (Edwin Woollett) Date: Tue, 3 Jan 2012 14:44:31 -0800 Subject: [Maxima] expintegral_e: series failed Message-ID: On Jan. 3, 2012, dlakelan wrote: ---------------------------- >I'm sure you've seen this since the simplest google search would bring >it up, but it seemed interesting so if you haven't seen it you might >want to take a look: > >http://iopscience.iop.org/0295-5075/71/1/001/pdf/epl_71_1_001.pdf --------------------------------------- EPL wants $33 for this short article. A Cornell archive search: http://arxiv.org/find/grp_physics/1/au:+amore/0/1/0/all/0/1?per_page=100 finds this paper as item no. 48: 48. arXiv:math-ph/0501019 [pdf, ps, other] Asymptotic and exact series representations for the incomplete Gamma function Paolo Amore Comments: 8 pages, 4 figures Journal-ref: Europhysics Letters 71, 1-7 (2005) Subjects: Mathematical Physics (math-ph) ------------------------- with free access to pdf or ps file. Paolo Amore is a physicist whose home page is http://fejer.ucol.mx/paolo/ I am attaching the pdf file to this message. Ted Woollett -------------- next part -------------- A non-text attachment was scrubbed... Name: p_amore_gamma_incomplete.pdf Type: application/pdf Size: 140264 bytes Desc: not available URL: From aishen at free.fr Wed Jan 4 09:10:49 2012 From: aishen at free.fr (aishen) Date: Wed, 04 Jan 2012 16:10:49 +0100 Subject: [Maxima] Help In-Reply-To: References: Message-ID: <4F046BF9.302@free.fr> Hi, I would like to integrate yin or yang... As I am not an expert, I can't solve the 1/2 circle on the right side ? Is there a way of doing it ? thank you and best wishes for 2012, regards --------------------that's what I have done yet------------------------------ f(x):= sqrt(4-x^2)$g(x):=sqrt(4-x^2)$p(x):=sqrt(1-x^2)$ o(x):= -sqrt(1-x^2)$n(x):= -sqrt(4-x^2)$m(x):=-sqrt(4-x^2)$ wxdraw2d(user_preamble = ["set size ratio 1","set zeroaxis"],xaxis = true, yaxis = true, /*filling*/ fill_color = grey, filled_func =(f(x),x,0,2), filled_func =(g(x),x,-2,0), filled_func =(o(x-1),x,-2,0), color = red,explicit(p(x+1),x,-2,0), color = red,explicit(n(x),x,-2,0), color = red,explicit(m(x),x,0,2), filled_func = false, /*unfilling*/ filled_func = false, /*NE*/ color = black,explicit(f(x),x,0,2), /*NO*/ color = red,explicit(n(x),x,-2,0), /*1/2SE*/color = black,explicit(o(x-1),x,0,2), /*SW */ color = black,explicit(g(x),x,-2,0), /*1/2NO*/color = red,explicit(p(x+1),x,-2,0), /*SE*/ color = red,explicit(m(x),x,0,2))$ From lapeyre.math122a at gmail.com Wed Jan 4 10:42:09 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Wed, 04 Jan 2012 17:42:09 +0100 Subject: [Maxima] taylor series, bfloat, zerop enhancements, something to think about, vs. Macsyma In-Reply-To: <4F03227D.3040905@eecs.berkeley.edu> References: <4F03227D.3040905@eecs.berkeley.edu> Message-ID: <4F048161.5050006@gmail.com> > also, bfloat(1/3,100) gives 100 digits of 1/3. Maxima's bfloat > ignores 2nd. argument. There is something like that in mixima; maybe it could be adapted. It even goes a bit further, but also obscures what's happening. (%i1) [ Head( N(Pi)) , Head( N(Pi,16) ), Head( N(Pi,17) ) ]; (%o1) [Real, Real, Real] (%i2) MiximaHeadStrict : false$ (%i3) [ Head( N(Pi)) , Head( N(Pi,16) ), Head( N(Pi,17) ) ]; (%o3) [Real, Real, BFloat] It might also be nice to display a single number with higher precision without changing the fpprintprec. btw. I don't know if maxima has something like Head() or lisp's type-of. It's useful to have a what_is_this() function. -- John Lapeyre From fateman at eecs.berkeley.edu Wed Jan 4 10:57:30 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 04 Jan 2012 08:57:30 -0800 Subject: [Maxima] taylor series, bfloat, zerop enhancements, something to think about, vs. Macsyma In-Reply-To: <4F048161.5050006@gmail.com> References: <4F03227D.3040905@eecs.berkeley.edu> <4F048161.5050006@gmail.com> Message-ID: <4F0484FA.3010104@eecs.berkeley.edu> On 1/4/2012 8:42 AM, John Lapeyre wrote: >> also, bfloat(1/3,100) gives 100 digits of 1/3. Maxima's bfloat >> ignores 2nd. argument. > There is something like that in mixima; maybe it could be adapted. > It even goes a bit further, but also obscures what's happening. > > (%i1) [ Head( N(Pi)) , Head( N(Pi,16) ), Head( N(Pi,17) ) ]; > (%o1) [Real, Real, Real] > (%i2) MiximaHeadStrict : false$ > > (%i3) [ Head( N(Pi)) , Head( N(Pi,16) ), Head( N(Pi,17) ) ]; > (%o3) [Real, Real, BFloat] > > It might also be nice to display a single number > with higher precision without changing the fpprintprec. maybe this?? print_one_number_prec(x,p):=block([fpprintprec:p], print(x))$ > btw. I don't know if maxima has something like Head() or lisp's > type-of. It's useful to have a what_is_this() function. what_is_this(x):=if ?atom(x) then ?type\-of(x) else ?caar(x) not built in, but could be... > > -- John Lapeyre > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Wed Jan 4 11:38:41 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 4 Jan 2012 12:38:41 -0500 Subject: [Maxima] simplified vector display output In-Reply-To: References: Message-ID: How about something like this: (%i1) ex; (%o1) [x^2-1,x^2-x,x^2-2*x+1,x^4-x^3-x+1] (%i2) vfactor(v):=block([g:lreduce('gcd,v),listarith:false],g*map(lambda([q],factor(q/g)),v))$ (%i3) vfactor(ex); (%o3) (x-1)*[x+1,x,x-1,(x-1)*(x^2+x+1)] Note the listarith trick -- the expression a*[b,c] is simplified with listarith:false, so does not expand to [a*b,a*c] even when it is returned from vfactor. But if that expression is resimplified later, it will expand out. To avoid that, you could use "box" if necessary. -s On Tue, Jan 3, 2012 at 13:07, Burgess, Don wrote: > Can Maxima recognize a known vector in a vector expression and give a > simplified display output in terms of the Name of the known vector? > > So, for example, in the Maxima Session represented in the attached image, > I would like Maxima to recognize "F.v1" as a scalar multiplied by a known > vector " v1" and to display the result as "(2*alpha +1)*v1"" > > Thank you very much for your help, > don burgess > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleksasd873 at gmail.com Wed Jan 4 12:48:23 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Wed, 4 Jan 2012 20:48:23 +0200 Subject: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) Message-ID: About computing integral integrate(exp(-x^k),x,0,1) (%i1) S(k):='integrate(exp(-x^k),x,0,1)$ Note: output from workshet is removed. Plese copy to wxMaxima and execute. (%i2) assume(x>0); Correct results can be obtained in the following ways: a) using formula integrate(f,x,0,1)=integrate(f,x,0,inf)-integrate(f,x,1,inf): (%i3) for k thru 10 do (integrate(exp(-x^k),x,0,inf)-integrate(exp(-x^k),x,1,inf), print(S(k)=%%,"~~",float(%%))); b) using Newton-Leibniz formula integrate(f,x,a,b) = F( b)-F(a) : (%i4) for k thru 10 do (integrate(exp(-x^k),x), subst(x=1,%%)-subst(x=0,%%), float(%%), print(%%)); c) using change of variable y=-x : (%i5) for k thru 10 do (changevar(S(k),y=-x,y,x),ev(%%,nouns), print(S(k)=%%,"~~",float(%%))); d) using change of variable y=1/x : (%i6) for k thru 10 do (changevar(S(k),y=1/x,y,x),ev(%%,nouns), print(S(k)=expand(%%),"~~",float(%%))); e) using change of variable x=y^(2/k) : (%i7) for k thru 10 do (changevar(S(k),x=y^(2/k),y,x),ev(%%,nouns), print(S(k)=expand(%%))); f) using change of variable x=sin(y): (%i8) for k thru 10 do (changevar(S(k),x=sin(y),y,x),ev(%%,nouns), print(S(k)=expand(%%))); g) using change of variable x=cos(y): (%i9) for k thru 10 do (changevar(S(k),x=cos(y),y,x),ev(%%,nouns), print(S(k)=expand(%%))); But, Maxima compute wrong: (%i10) for k thru 10 do (integrate(exp(-x^k),x,0,1), print(S(k)=%%)); I think , that Maxima wrong compute like this: (%i11) for k thru 10 do (a:changevar(S(k),exp(-x^k)=y,y,x), changevar(%%,-log(y)=z,z,y), b:factor(%%), ev(%%,nouns), print(((S(k)=a)=b)=%%)); Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Wed Jan 4 15:30:27 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Wed, 04 Jan 2012 16:30:27 -0500 Subject: [Maxima] Bug in limit or integrate In-Reply-To: <77F2B44468E242738F00F487FA309E9F@RichsLaptop> References: <009CCEB07A82462383B5FAF431448497@RichsLaptop> <9483E60A879B4BE293A00D296BF48A6A@RichsLaptop> <77F2B44468E242738F00F487FA309E9F@RichsLaptop> Message-ID: <02DD9B5C5157425BA19D756FB8395EE9@RichsLaptop> For those interested in correctness of evaluating this integral in pw.mac. There is an easy way to get rid of the discontinuity of the antidiff() using pw.mac functions (at least in this case). You can't use the function continuousp() that I wrote to verify it because limit causes a bind stack overflow in this case. You can plot it and it looks continuous, but that is about the only way to tell that I know of without resorting to another CAS. (%i14) integrate(exp(-x^4),x); (%o14) -gamma_incomplete(1/4,x^4)*x/(4*abs(x)) (%i15) F(x):=''(ratsimp(zerospikes(pw(pwsimp(linearize(abs2signum(%)),x,'list),x,'connect)))); (%o15) F(x):=-((gamma_incomplete(1/4,x^4)-gamma(1/4))*signum(x)-gamma(1/4))/4 Now you can use integrate(exp(-x^4),x,a,b) = F(b)-F(a). Rich -----Original Message----- From: Richard Hennessy Sent: Tuesday, January 03, 2012 8:31 PM To: Barton Willis Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Bug in limit or integrate (%i10) continuousp(abs(x),x,0); (%o10) true (%i11) continuousp(abs(x)^2,x,0); (%o11) true (%i12) continuousp(1/abs(x-a),x,a); expt: undefined: 0 to a negative exponent. (%o12) false (%i13) continuousp(1/(x-a),x,a); (%o13) false (%i14) continuousp(1/(x-a)^3,x,a); (%o14) false (%i15) continuousp(1/(sqrt(x-a))^3,x,a); Rich From toy.raymond at gmail.com Wed Jan 4 15:38:31 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 4 Jan 2012 13:38:31 -0800 Subject: [Maxima] Bug in limit or integrate In-Reply-To: References: Message-ID: On Tue, Jan 3, 2012 at 7:06 AM, Aleksas Domarkas wrote: > from > http://www.math.utexas.edu/pipermail/maxima/2012/027277.html > > On Jan. 1, 2012, Barton Willis wrote: > --------------------------- > >*Some definite integrals of exp(-x^4) are broken:*>**>* (%i6) integrate(exp(-t^4),t,0,1);*>* (%o6) (%i*(gamma(1/4)-gamma_incomplete(1/4,1)))/4* > > I believe Dan Gildea has fixed this issue; get the latest git code to see the new results. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From peterknicol at gmail.com Wed Jan 4 15:44:34 2012 From: peterknicol at gmail.com (Peter Nicol) Date: Wed, 4 Jan 2012 21:44:34 +0000 Subject: [Maxima] Maxima Tutorial In-Reply-To: <1325713039.4106.1.camel@peter-laptop-x31> References: <1325713039.4106.1.camel@peter-laptop-x31> Message-ID: Happy New Year. I had a look at the Maxima Tutorial and was very impressed. Please also have a look at the Formula Handbook at http://ubuntuone.com/p/ZOF It is also linked from the Mathcentre website. http://www.mathcentre.ac.uk/links/ In particular please look at the top of p67 (p69 in the pdf document) http://ubuntuone.com/p/x77 Although the handbook was created for the engineering students at Aberdeen College it is intended that it should be kept alive by being adopted, extended or altered by other people. That is the reason it is on a Creative Commons licence. There are many hyperlinks within the handbook to link to related topics, to the Mathcentre website to promote the use of their videos and worksheets and to Geogebra (mostly interactive) worksheets. There is a lot of work yet to be done in getting the Intro to wxMaxima up to scratch and comments and suggestions would be appreciated. Peter K Nicol Aberdeen College p.nicol at abcol.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Wed Jan 4 16:18:32 2012 From: woollett at charter.net (Edwin Woollett) Date: Wed, 4 Jan 2012 14:18:32 -0800 Subject: [Maxima] Bug in limit or integrate Message-ID: <2BAFCD0991DB463B936C15FE40F00CD4@edwinc367e16bd> On Jan. 2, 2012, I wrote ------------------------ > the definite integral of the real function exp(-x^n) over > the real interval (0,1) is broken (spurious imaginary parts, > wrong real parts) for n = 3 through 15, and probably forever. ------------------------ A corrected version of defint.lisp has been checked into git by Dan Gildea in response to my bug report. The corrected version solves my problem. -------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) load("defint-new.lisp"); (%o1) "c:/work2/defint-new.lisp" (%i2) exp_test(n) := ( print (n," qags = ", first( quad_qags (exp(-x^n),x,0,1)), " integrate = ", expand(float(rectform(integrate(exp(-x^n),x,0,1))))))$ (%i3) for m thru 15 do exp_test(m)$ 1 qags = 0.63212055882856 integrate = 0.63212055882856 2 qags = 0.74682413281243 integrate = 0.74682413281243 3 qags = 0.80751118213967 integrate = 0.80751118213967 4 qags = 0.8448385947571 integrate = 0.8448385947571 5 qags = 0.87007466768589 integrate = 0.87007466768589 6 qags = 0.88826369875194 integrate = 0.88826369875194 7 qags = 0.90199160301324 integrate = 0.90199160301324 8 qags = 0.91271857185875 integrate = 0.91271857185875 9 qags = 0.9213308364909 integrate = 0.9213308364909 10 qags = 0.92839720283799 integrate = 0.92839720283799 11 qags = 0.93429939205577 integrate = 0.93429939205577 12 qags = 0.93930307080183 integrate = 0.93930307080183 13 qags = 0.94359882032526 integrate = 0.94359882032526 14 qags = 0.94732690220079 integrate = 0.94732690220079 15 qags = 0.95059283193 integrate = 0.95059283193 -------------------- Ted Woollett From woollett at charter.net Wed Jan 4 17:09:20 2012 From: woollett at charter.net (Edwin Woollett) Date: Wed, 4 Jan 2012 15:09:20 -0800 Subject: [Maxima] Maxima Tutorial Message-ID: <3986880259AA4DF3BC838BBEFD707ED5@edwinc367e16bd> On Jan. 4, 2012, Peter Nicol wrote: ------------------ >In particular please look at the top of p67 (p69 in the pdf document) >http://ubuntuone.com/p/x77 ------------- This link brings up a 40 page pdf document which is a very nice introduction to wxmaxima with interesting examples worked out. I don't find the advertised "page 69". Also, there is no mention of author(s) or contact email addresses for feedback. The link to the Formula Handbook brings up a nice review of many practical math topics. Ted Woollett From woollett at charter.net Wed Jan 4 17:21:08 2012 From: woollett at charter.net (Edwin Woollett) Date: Wed, 4 Jan 2012 15:21:08 -0800 Subject: [Maxima] Help Message-ID: <686A18A581D24D7E9402268A231E4F3F@edwinc367e16bd> On Jan. 4, 2012, aishen wrote: ------------------ >I would like to integrate yin or yang... >As I am not an expert, I can't solve the 1/2 circle on the right side ? >Is there a way of doing it ? --------------------------- Could you describe in words what you want the image to look like, relating your verbal description to the functions you have defined? Ted Woollett From rich.hennessy at verizon.net Wed Jan 4 21:00:26 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Wed, 04 Jan 2012 22:00:26 -0500 Subject: [Maxima] Bug in limit or integrate In-Reply-To: References: <2D6DEA23C6D94F9EAA3A92F1126B4760@RichsLaptop>, <009CCEB07A82462383B5FAF431448497@RichsLaptop> <248DBA1BC0D749118FC65FC4DD1D9345@RichsLaptop> Message-ID: Okay, maybe you can't use my function for non real limits of integration and say integrate(exp(-x^4),x,a,b) = F(b)-F(a) when b and a are not real. In the case that they are real you can use it. Rich -----Original Message----- From: Barton Willis Sent: Sunday, January 01, 2012 9:11 AM To: rich.hennessy at verizon.net Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Bug in limit or integrate ----"Richard Hennessy" wrote: ----- >I should not have used the abs() function. This is a simpler answer and it >does not blow up at zero. >(gamma(1/4)/4-gamma_incomplete(1/4,x^4)/4)*signum(x); OK, this antiderivative is valid on the reals. An antiderivative that is valid on the entire complex plane is x |-> x*hypergeometric([1/4],[5/4],-x^4). But Maxima is unable to compute limits of hypergeometric functions, you are out of luck if you used this antiderivative to try to compute integrate(exp(-x^4),x,minf,inf). Some definite integrals of exp(-x^4) are broken: (%i6) integrate(exp(-t^4),t,0,1); (%o6) (%i*(gamma(1/4)-gamma_incomplete(1/4,1)))/4 --bw From bhakta.jim at gmail.com Wed Jan 4 21:48:02 2012 From: bhakta.jim at gmail.com (James Nesta) Date: Wed, 4 Jan 2012 19:48:02 -0800 Subject: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) Message-ID: <45C72280-356A-4962-89D8-2D9E6E8B3E18@gmail.com> In fooling with this integral I was able to get what I think is a manageable solution. As follows: Transform the variable x to z by the transformation x = z^(1/k), dx = z^(1/k-1)dz, the integral becomes(1/k)*[gamma(1/k)-incomplete_gamma(1/k, 1)]. I think that Maxima should be able to handle each of these functions. I hope that this helps. Jim From rich.hennessy at verizon.net Wed Jan 4 23:43:56 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 05 Jan 2012 00:43:56 -0500 Subject: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) In-Reply-To: <45C72280-356A-4962-89D8-2D9E6E8B3E18@gmail.com> References: <45C72280-356A-4962-89D8-2D9E6E8B3E18@gmail.com> Message-ID: <8E22D5C3297E4B689516C8C5C486E4C4@RichsLaptop> "integral becomes(1/k)*[gamma(1/k)-incomplete_gamma(1/k, 1)]" I think you made a mistake, it should be the integral becomes (1/k)*[gamma(1/k)-incomplete_gamma(1/k, k)] Rich -----Original Message----- From: James Nesta Sent: Wednesday, January 04, 2012 10:48 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) In fooling with this integral I was able to get what I think is a manageable solution. As follows: Transform the variable x to z by the transformation x = z^(1/k), dx = z^(1/k-1)dz, the integral becomes(1/k)*[gamma(1/k)-incomplete_gamma(1/k, 1)]. I think that Maxima should be able to handle each of these functions. I hope that this helps. Jim _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Wed Jan 4 23:45:37 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 05 Jan 2012 00:45:37 -0500 Subject: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) Message-ID: I meant the integral becomes (1/k)*[gamma(1/k)-incomplete_gamma(1/k, z)]. Typo. Rich -----Original Message----- From: Richard Hennessy Sent: Thursday, January 05, 2012 12:43 AM To: James Nesta ; maxima at math.utexas.edu Subject: Re: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) "integral becomes(1/k)*[gamma(1/k)-incomplete_gamma(1/k, 1)]" I think you made a mistake, it should be the integral becomes (1/k)*[gamma(1/k)-incomplete_gamma(1/k, k)] Rich -----Original Message----- From: James Nesta Sent: Wednesday, January 04, 2012 10:48 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) In fooling with this integral I was able to get what I think is a manageable solution. As follows: Transform the variable x to z by the transformation x = z^(1/k), dx = z^(1/k-1)dz, the integral becomes(1/k)*[gamma(1/k)-incomplete_gamma(1/k, 1)]. I think that Maxima should be able to handle each of these functions. I hope that this helps. Jim _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From aishen at free.fr Thu Jan 5 01:29:12 2012 From: aishen at free.fr (aishen) Date: Thu, 05 Jan 2012 08:29:12 +0100 Subject: [Maxima] Help In-Reply-To: <686A18A581D24D7E9402268A231E4F3F@edwinc367e16bd> References: <686A18A581D24D7E9402268A231E4F3F@edwinc367e16bd> Message-ID: <4F055148.8090703@free.fr> Le 05/01/2012 00:21, Edwin Woollett a ?crit : > On Jan. 4, 2012, aishen wrote: > ------------------ >> I would like to integrate yin or yang... >> As I am not an expert, I can't solve the 1/2 circle on the right side ? >> Is there a way of doing it ? > --------------------------- > Could you describe in words what you want > the image to look like, relating your verbal description to the > functions you have defined? > > Ted Woollett > > > > Yes, sorry :) At hawaii edu there is an aera_between_curves.wxm tutorial, after doing it with few curves, I wanted to try it with taijiwu (yin/yang symbol). But I am unable to hide 1/2 small upper circle as the following included pictures : Yin.png is what I obtained, but i would like to delete the 1/2 circle on the right, like I did with gimp for yang.png, but with a function if possible. Maybe my design is uncomplete or wrong ? After I would like to integrate the grey one, I guess it's pi ? (depending x,y). I hope I explain myself clearly enaugh ? Regards Henri Girard -------------- next part -------------- A non-text attachment was scrubbed... Name: yang.png Type: image/png Size: 7039 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: yin.png Type: image/png Size: 6588 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: taiji.wxm Type: application/wxmaxima Size: 1959 bytes Desc: not available URL: From biomates at telefonica.net Thu Jan 5 04:04:20 2012 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 05 Jan 2012 11:04:20 +0100 Subject: [Maxima] Help In-Reply-To: <4F055148.8090703@free.fr> References: <686A18A581D24D7E9402268A231E4F3F@edwinc367e16bd> <4F055148.8090703@free.fr> Message-ID: <1325757860.1650.1.camel@pc> El jue, 05-01-2012 a las 08:29 +0100, aishen escribi?: > Le 05/01/2012 00:21, Edwin Woollett a ?crit : > > On Jan. 4, 2012, aishen wrote: > > ------------------ > >> I would like to integrate yin or yang... > >> As I am not an expert, I can't solve the 1/2 circle on the right side ? > >> Is there a way of doing it ? > > --------------------------- > > Could you describe in words what you want > > the image to look like, relating your verbal description to the > > functions you have defined? > > > > Ted Woollett > > > > > > > > > Yes, sorry :) > > At hawaii edu there is an aera_between_curves.wxm tutorial, after doing > it with few curves, I wanted to try it with taijiwu (yin/yang symbol). > But I am unable to hide 1/2 small upper circle as the following included > pictures : Yin.png is what I obtained, but i would like to delete the > 1/2 circle on the right, like I did with gimp for yang.png, but with a > function if possible. Maybe my design is uncomplete or wrong ? > After I would like to integrate the grey one, I guess it's pi ? > (depending x,y). > I hope I explain myself clearly enaugh ? > Regards > Henri Girard draw2d( proportional_axes = xy, title = "Ying-Yang", ellipse(0,0,2,2,0,360), fill_color = black, filled_func = -sqrt(4-x^2), explicit(if x < 0 then sqrt(-x^2-2*x) else -sqrt(-x^2+2*x),x,-2,2))$ -- Mario From aishen at free.fr Thu Jan 5 04:27:41 2012 From: aishen at free.fr (aishen) Date: Thu, 05 Jan 2012 11:27:41 +0100 Subject: [Maxima] Help In-Reply-To: <1325757860.1650.1.camel@pc> References: <686A18A581D24D7E9402268A231E4F3F@edwinc367e16bd> <4F055148.8090703@free.fr> <1325757860.1650.1.camel@pc> Message-ID: <4F057B1D.8080304@free.fr> Le 05/01/2012 11:04, Mario Rodriguez a ?crit : > El jue, 05-01-2012 a las 08:29 +0100, aishen escribi?: >> Le 05/01/2012 00:21, Edwin Woollett a ?crit : >>> On Jan. 4, 2012, aishen wrote: >>> ------------------ >>>> I would like to integrate yin or yang... >>>> As I am not an expert, I can't solve the 1/2 circle on the right side ? >>>> Is there a way of doing it ? >>> --------------------------- >>> Could you describe in words what you want >>> the image to look like, relating your verbal description to the >>> functions you have defined? >>> >>> Ted Woollett >>> >>> >>> >>> >> Yes, sorry :) >> >> At hawaii edu there is an aera_between_curves.wxm tutorial, after doing >> it with few curves, I wanted to try it with taijiwu (yin/yang symbol). >> But I am unable to hide 1/2 small upper circle as the following included >> pictures : Yin.png is what I obtained, but i would like to delete the >> 1/2 circle on the right, like I did with gimp for yang.png, but with a >> function if possible. Maybe my design is uncomplete or wrong ? >> After I would like to integrate the grey one, I guess it's pi ? >> (depending x,y). >> I hope I explain myself clearly enaugh ? >> Regards >> Henri Girard > > > draw2d( > proportional_axes = xy, > title = "Ying-Yang", > ellipse(0,0,2,2,0,360), > fill_color = black, > filled_func = -sqrt(4-x^2), > explicit(if x< 0 then sqrt(-x^2-2*x) else -sqrt(-x^2+2*x),x,-2,2))$ > > > -- > Mario Thanks, I am really impressed how compact you can do it ? I found myself so ridiculous I didn't ask help for many years, but as I was in a "wall and a bit fed up" I gave up !!! All wx/maxima doers you make my year sunny ! regards Henri > > From lapeyre.math122a at gmail.com Thu Jan 5 09:14:43 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Thu, 05 Jan 2012 16:14:43 +0100 Subject: [Maxima] taylor series, bfloat, zerop enhancements, something to think about, vs. Macsyma In-Reply-To: <4F0484FA.3010104@eecs.berkeley.edu> References: <4F03227D.3040905@eecs.berkeley.edu> <4F048161.5050006@gmail.com> <4F0484FA.3010104@eecs.berkeley.edu> Message-ID: <4F05BE63.2050106@gmail.com> On 01/04/2012 05:57 PM, Richard Fateman wrote: > On 1/4/2012 8:42 AM, John Lapeyre wrote: >> btw. I don't know if maxima has something like Head() or lisp's >> type-of. It's useful to have a what_is_this() function. > > what_is_this(x):=if ?atom(x) then ?type\-of(x) else ?caar(x) Mathematica would use this as well. (defmfun $complexp (x) ($numberp ($substitute 1 '$%i x))) what_is_this(x):= if complexp(x) then 'complex elseif ?atom(x) then ?type\-of(x) else ?caar(x)$ But it's not clear that would be useful for maxima. Eg, if maxima used native lisp complex numbers it would be natural. > print_one_number_prec(x,p):=block([fpprintprec:p], print(x))$ mixima Np() does this. But the return value, unless suppressed, is also displayed normally. -- John Lapeyre From macrakis at alum.mit.edu Thu Jan 5 09:46:48 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 5 Jan 2012 10:46:48 -0500 Subject: [Maxima] taylor series, bfloat, zerop enhancements, something to think about, vs. Macsyma In-Reply-To: <4F05BE63.2050106@gmail.com> References: <4F03227D.3040905@eecs.berkeley.edu> <4F048161.5050006@gmail.com> <4F0484FA.3010104@eecs.berkeley.edu> <4F05BE63.2050106@gmail.com> Message-ID: On Thu, Jan 5, 2012 at 10:14, John Lapeyre wrote: > > On 01/04/2012 05:57 PM, Richard Fateman wrote: > > On 1/4/2012 8:42 AM, John Lapeyre wrote: > >> btw. I don't know if maxima has something like Head() or lisp's > >> type-of. It's useful to have a what_is_this() function. > > > > what_is_this(x):=if ?atom(x) then ?type\-of(x) else ?caar(x) > Not sure what exactly the goal is here. This will return internal objects like RAT (prints as /) and BIGFLOAT (prints as bfloat) which are confusing: (%i16) what_is_this(1/2); (%o16) / (%i17) is(what_is_this(1/2)="/"); (%o17) false (%i18) is(what_is_this(1/2)='rat); (%o18) false (%i19) is(what_is_this(1/2)='?rat); (%o19) true Also need to think about cases like: what_is_this(f[3](x)) => mqapply (prints as subvar) what_is_this('(lambda([x],x)(3))) => => mqapply (prints as subvar) > (defmfun $complexp (x) ($numberp ($substitute 1 '$%i x))) > Poor definition: complexp(log(-%i)) => false OK complexp(log(%i)) => true ??? complexp(f(2)-f(1)) => false OK complexp(f(%i)-f(1)) => true ??? complexp(%i/(%i+1)) => true well, it does simplify to a complex, but is not in canonical form -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Thu Jan 5 10:53:32 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 05 Jan 2012 08:53:32 -0800 Subject: [Maxima] taylor series, bfloat, zerop enhancements, something to think about, vs. Macsyma In-Reply-To: References: <4F03227D.3040905@eecs.berkeley.edu> <4F048161.5050006@gmail.com> <4F0484FA.3010104@eecs.berkeley.edu> <4F05BE63.2050106@gmail.com> Message-ID: <4F05D58C.2080502@eecs.berkeley.edu> On 1/5/2012 7:46 AM, Stavros Macrakis wrote: > On Thu, Jan 5, 2012 at 10:14, John Lapeyre > wrote: > > On 01/04/2012 05:57 PM, Richard Fateman wrote: > > On 1/4/2012 8:42 AM, John Lapeyre wrote: > >> btw. I don't know if maxima has something like Head() or lisp's > >> type-of. It's useful to have a what_is_this() function. > > > > what_is_this(x):=if ?atom(x) then ?type\-of(x) else ?caar(x) > > Not sure what exactly the goal is here. Not sure either, but it could be used to dispatch to different numerical-style routines for bigfloats flonums fixnums bignums um, other stuff. -------------- next part -------------- An HTML attachment was scrubbed... URL: From peterknicol at gmail.com Thu Jan 5 14:19:25 2012 From: peterknicol at gmail.com (Peter Nicol) Date: Thu, 5 Jan 2012 20:19:25 +0000 Subject: [Maxima] Maxima Tutorial In-Reply-To: <3986880259AA4DF3BC838BBEFD707ED5@edwinc367e16bd> References: <3986880259AA4DF3BC838BBEFD707ED5@edwinc367e16bd> Message-ID: Dear Ted, Sorry, I got my hyperlinks a bit mixed up. (p67 of the handbook has a link to the wxMaxima document). I have remedied the deficiencies. Also, I realised that I had failed to make reference to your excellent Maxima by Example. That is now corrected. Thanks for the comments, All the Best, Peter On 4 January 2012 23:09, Edwin Woollett wrote: > On Jan. 4, 2012, Peter Nicol wrote: > ------------------ > > In particular please look at the top of p67 (p69 in the pdf document) >> http://ubuntuone.com/p/x77 >> > ------------- > This link brings up a 40 page pdf document > which is a very nice introduction to > wxmaxima with interesting examples worked out. > > I don't find the advertised "page 69". > > Also, there is no mention of author(s) or > contact email addresses for feedback. > > The link to the Formula Handbook brings up a nice > review of many practical math topics. > > Ted Woollett > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Thu Jan 5 16:05:16 2012 From: woollett at charter.net (Edwin Woollett) Date: Thu, 5 Jan 2012 14:05:16 -0800 Subject: [Maxima] new defint.lisp and radexpand:false? Message-ID: <919F4FE57FBC49248589F3726F28108F@edwinc367e16bd> In the git notes http://maxima.git.sourceforge.net/git/gitweb.cgi?p=maxima/maxima;a=commit;h=883dc433283808ff53d04477c540489273197ea3 for the new version of defint.lisp, Dan Gildea has the comment: ------------- integrate(exp(sqrt(x^3)),x,0,1) no longer gives correct answer unless we specify radexpand:false -------------------------------------- I find (gcl) that the previous version of defint.lisp gives the correct integral with radexpand : true (default). ------------------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) first(quad_qags(exp(sqrt(x^3)),x,0,1)); (%o1) 1.562394062214541 /* v 5.25.1 defint.lisp and radexpand=true */ (%i2) radexpand; (%o2) true (%i3) integrate(exp(sqrt(x^3)),x,0,1); (%o3) -(sqrt(3)*%i+1)*(gamma(2/3)-gamma_incomplete(2/3,-1))/3 (%i4) expand(float(%)); (%o4) 1.562394062217312-4.4408920985006262E-16*%i /* ok except for roundoff errors */ ---------------------------------------------- When I load in the new version of defint.lisp, and leave radexpand : true I get an answer, albeit a wrong answer. But if I set radexpand to false, I only get a noun form. ------------------------------------------------------ (%i5) load("defint-new.lisp"); (%o5) "c:/work2/defint-new.lisp" (%i6) radexpand; (%o6) true /* with new defint.lisp and radexpand=true */ (%i7) integrate(exp(sqrt(x^3)),x,0,1); (%o7) 2*(gamma(2/3)-gamma_incomplete(2/3,-1))/3 (%i8) expand(float(%)); (%o8) 1.353072948602157*%i-0.78119703110866 /* which is a wrong answer as advertised . */ /* now set radexpand to false */ (%i9) radexpand:false$ (%i10) integrate(exp(sqrt(x^3)),x,0,1); (%o10) 'integrate(%e^sqrt(x^3),x,0,1) /* unexpected noun form */ --------------------------------------------------- Ted Woollett From andre.maute at gmx.de Thu Jan 5 17:42:15 2012 From: andre.maute at gmx.de (andre maute) Date: Fri, 06 Jan 2012 00:42:15 +0100 Subject: [Maxima] colorizing matrix elements Message-ID: <4F063557.10303@gmx.de> Hi list, I would like to ask, if someone thinks it is possible to colorize some matrix elements. I have set display2d : true and would like to colorize the zeros of some binary matrices. Regards Andre From aleksasd873 at gmail.com Wed Jan 4 14:43:45 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Wed, 4 Jan 2012 22:43:45 +0200 Subject: [Maxima] Plot region Message-ID: from http://www.math.utexas.edu/pipermail/maxima/2012/027306.html Hi, I would like to integrate yin or yang... As I am not an expert, I can't solve the 1/2 circle on the right side ? Is there a way of doing it ? thank you and best wishes for 2012, regards --------------------that's what I have done yet------------------------------ f(x):= sqrt(4-x^2)$g(x):=sqrt(4-x^2)$p(x):=sqrt(1-x^2)$ o(x):= -sqrt(1-x^2)$n(x):= -sqrt(4-x^2)$m(x):=-sqrt(4-x^2)$ wxdraw2d(user_preamble = ["set size ratio 1","set zeroaxis"],xaxis = true, yaxis = true, /*filling*/ fill_color = grey, filled_func =(f(x),x,0,2), filled_func =(g(x),x,-2,0), filled_func =(o(x-1),x,-2,0), color = red,explicit(p(x+1),x,-2,0), color = red,explicit(n(x),x,-2,0), color = red,explicit(m(x),x,0,2), filled_func = false, /*unfilling*/ filled_func = false, /*NE*/ color = black,explicit(f(x),x,0,2), /*NO*/ color = red,explicit(n(x),x,-2,0), /*1/2SE*/color = black,explicit(o(x-1),x,0,2), /*SW */ color = black,explicit(g(x),x,-2,0), /*1/2NO*/color = red,explicit(p(x+1),x,-2,0), /*SE*/ color = red,explicit(m(x),x,0,2))$ ******************************************************************* load(draw)$ wxdraw2d( proportional_axes=xy, x_voxel = 30, y_voxel = 30, fill_color = grey, region(y<=sqrt(-2*x-x^2) and x^2+y^2<=4, x,-2,2, y,-2,2), region(y<=-sqrt(2*x-x^2) and x^2+y^2<=4, x,-2,2, y,-2,2), color=black, implicit(x^2+y^2=4,x,-2,2, y,-2,2)); Best, Aleksas D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleksasd873 at gmail.com Thu Jan 5 01:17:27 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Thu, 5 Jan 2012 09:17:27 +0200 Subject: [Maxima] expintegral_e: series failed Message-ID: Double integral of oscilatoring function expintegral_e: series failed A.Domarkas Maxima sin integral funkcion expintegral_si(x)=integrate(sin(t)/t,t,0,x) fail for large x. See http://permalink.gmane.org/gmane.comp.mathematics.maxima.general/36455 This can fix, if we use asymptotic expansion Si(x)~pi/2-sin(x)/x*(1!/x-3!/x^3+5!/x^5-..)-cos(x)/x*(1!-2!/x^2+4!/x^4-..), for x>>1 see http://maji.utsi.edu/courses/06_690_perturbations_2/handout_p6_SpFuncExps.pdf (%i1) si(x):=if x<0 then -si(-x) elseif x>=0 and x<=20 then float(expintegral_si(x)) elseif x>20 and x<10^20 then float(%pi/2-sin(x)/x*(1!/x-3!/x^3+5!/x^5-(7!/x^7)) -cos(x)/x*(1!-2!/x^2+4!/x^4-(6!/x^6))) elseif x>=10^20 then float(%pi/2) else expintegral_si(x)$ Compare with function si() from Mpmath Python library http://code.google.com/p/mpmath/ Examples: (%i2) si(0); (%o2) 0.0 (%i3) si(1); (%o3) 0.946083070367183 (%i4) si(-1); (%o4) -0.946083070367183 (%i5) si(7); (%o5) 1.45459661424809 (%i6) si(10^4); (%o6) 1.570891545385962 (%i7) si(10^22); (%o7) 1.570796326794897 (%i8) si(-10^22); (%o8) -1.570796326794897 (%i9) si(2+3*%i); (%o9) expintegral_si(3*%i+2) (%i10) float(%); (%o10) 1.399196580646055*%i+4.547513889562289 (%i11) si(inf); (%o11) 1.570796326794897 (%i12) si(minf); (%o12) -1.570796326794897 (%i13) log(2); (%o13) log(2) (%i14) float(%), numer; (%o14) 0.693147180559945 Theorem. integrate(integrate(cos(x*y*log(2)),y,1,n),x,1,n)=(si(log(2)*n^2)-2*si(log(2)*n)+si(log(2)))/log(2), where si(x)=integrate(sin(t)/t,t,0,x). (%i15) r:'integrate(integrate(cos(x*y*log(2)),y,1,n),x,1,n); (%o15) integrate(sin(log(2)*n*x)/(log(2)*x)-sin(log(2)*x)/(log(2)*x),x,1,n) (%i16) r1:changevar(r, y=x*log(2), y, x); (%o16) integrate((sin(n*y)-sin(y))/y,y,log(2),log(2)*n)/log(2) (%i17) declare(integrate,linear)$ (%i18) r2:expand(r1); (%o18) integrate(sin(n*y)/y,y,log(2),log(2)*n)/log(2)-integrate(sin(y)/y,y,log(2),log(2)*n)/log(2) (%i19) S:changevar(part(r2,1), x=n*y, x, y)+changevar(part(r2,2), x=y, x, y); (%o19) integrate(sin(x)/x,x,log(2)*n,log(2)*n^2)/log(2)-integrate(sin(x)/x,x,log(2),log(2)*n)/log(2) Note, that si(x) is primitive of sin(x)/x, i.e. diff(si(x),x)=sin(x)/x . Then by Newton-Leibniz formula (%i20) ('si(n^2*log(2))-'si(n*log(2))-('si(n*log(2))-'si(log(2))))/log(2); define(F(n),(%))$ (%o20) (si(log(2)*n^2)-2*si(log(2)*n)+si(log(2)))/log(2) Examples: (%i22) F(10); ev(%, nouns),numer; (%o22) (si(100*log(2))-2*si(10*log(2))+si(log(2)))/log(2) (%o23) -0.959759281504239 (%i24) F(10^2); ev(%, nouns),numer; (%o24) (si(10000*log(2))-2*si(100*log(2))+si(log(2)))/log(2) (%o25) -1.251679029234925 (%i26) F(10^3); ev(%, nouns),numer; (%o26) (si(1000000*log(2))-2*si(1000*log(2))+si(log(2)))/log(2) (%o27) -1.294205651997974 (%i28) F(10^4); ev(%, nouns),numer; (%o28) (si(100000000*log(2))-2*si(10000*log(2))+si(log(2)))/log(2) (%o29) -1.292308315915049 (%i30) F(10^40)$ ev(%, nouns),numer; (%o31) -1.292490307176227 Note that, the standart quadrature functions from Maxima package quadpack , or "quad" from Mpmath Python library in this case return wrong results. Aleksas D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleksasd873 at gmail.com Thu Jan 5 03:01:31 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Thu, 5 Jan 2012 11:01:31 +0200 Subject: [Maxima] Help Message-ID: help to http://www.math.utexas.edu/pipermail/maxima/2012/027306.html A.Domarkas We draw "Yin&yang". See http://en.wikipedia.org/wiki/Yin_and_yang (%i1) load(draw)$ (%i2) wxdraw2d( proportional_axes=xy, x_voxel = 30, y_voxel = 30, fill_color = grey, region(y<=sqrt(-2*x-x^2) and x^2+y^2<=4, x,-2,2, y,-2,2), region(y<=-sqrt(2*x-x^2) and x^2+y^2<=4, x,-2,2, y,-2,2), color=black, implicit(x^2+y^2=4,x,-2,2, y,-2,2)); (%t2) << Graphics >> (%o2) "Yin&yang" : (%i3) wxdraw2d( proportional_axes=xy, x_voxel = 30, y_voxel = 30, fill_color = black, region(x>=-sqrt(-2*y-y^2) and x^2+y^2<=4, x,-2,2, y,-2,2), region(x>=sqrt(2*y-y^2) and x^2+y^2<=4, x,-2,2, y,-2,2), color=black, implicit(x^2+y^2=4,x,-2,2, y,-2,2), point_type =filled_circle, point_size=5, points([[0,1]]), color=white, points([[0,-1]]) ); (%t3) << Graphics >> (%o3) Aleksas D. Aleksas D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From harald at ccbib.org Fri Jan 6 10:48:19 2012 From: harald at ccbib.org (Harald Geyer) Date: Fri, 06 Jan 2012 17:48:19 +0100 Subject: [Maxima] colorizing matrix elements In-Reply-To: <4F063557.10303@gmx.de> References: <4F063557.10303@gmx.de> Message-ID: Hi! > I would like to ask, > if someone thinks it is possible to colorize some matrix elements. > > I have set > > display2d : true > > and would like to colorize the zeros of some binary matrices. not directly unless you hack the display code. But assuming you are on an ANSI capable terminal, you could replace the matrix elements by strings, that represent colorized expressions. Perhaps you can expand on the following idea: bold(expr) := apply(concat, [ascii(27), "[01m", string(expr), ascii(27), "[m"]); bold(x+y); bold(0.0); HTH, Harald From andre.maute at gmx.de Fri Jan 6 10:58:09 2012 From: andre.maute at gmx.de (andre maute) Date: Fri, 06 Jan 2012 17:58:09 +0100 Subject: [Maxima] colorizing matrix elements In-Reply-To: References: <4F063557.10303@gmx.de> Message-ID: <4F072821.107@gmx.de> On 01/06/2012 05:48 PM, Harald Geyer wrote: > Hi! > >> I would like to ask, >> if someone thinks it is possible to colorize some matrix elements. >> >> I have set >> >> display2d : true >> >> and would like to colorize the zeros of some binary matrices. > not directly unless you hack the display code. > > But assuming you are on an ANSI capable terminal, you could replace > the matrix elements by strings, that represent colorized expressions. > > Perhaps you can expand on the following idea: > bold(expr) := apply(concat, [ascii(27), "[01m", string(expr), ascii(27), "[m"]); > bold(x+y); > bold(0.0); > Thanks, I'm going to try the ANSI code, when I have some time. At the moment I use the 'strings' " " for 0 and "X" for 1 Regards Andre > HTH, > Harald > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From woollett at charter.net Fri Jan 6 17:16:09 2012 From: woollett at charter.net (Edwin Woollett) Date: Fri, 6 Jan 2012 15:16:09 -0800 Subject: [Maxima] quad_qagi exponential divergence returns Message-ID: For linear divergence, quad_qagi issues a console warning and some error code number > 2 as a warning. ----------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) quad_qagi(x,x,0,inf); ***MESSAGE FROM ROUTINE DQAGI IN LIBRARY SLATEC. ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED * ABNORMAL RETURN * ERROR NUMBER = 5 * ***END OF MESSAGE (%o1) [0.49999999442512,2.2894791249616908E-5,885,5] ---------------------------------- But for exponential divergence, there is no console warning, and an error code = 0 is returned. The user needs to see the occurrence of #INF in the returned answer to infer the software/machine limit has been reached. ---------------------------------------------- (%i2) quad_qagi(%e^x,x,0,inf); (%o2) [1..#INF00e+000E+2288952,1..#INF00e+000E+2288952,75,0] ------------------------------------------ Ted Woollett From fateman at eecs.berkeley.edu Fri Jan 6 18:24:48 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 06 Jan 2012 16:24:48 -0800 Subject: [Maxima] evaluating products?? Message-ID: <4F0790D0.9070206@eecs.berkeley.edu> say I create this: s: product(f(i),i,0,n) and later I want to evaluate it with n=3, to get f(0)*f(1)*f(2)*f(3). How? subst(3,n,s) doesn't work. ev(s,n=3) doesn't work. I suspect this failure is a new "feature". RJF From vttoth at vttoth.com Fri Jan 6 18:41:15 2012 From: vttoth at vttoth.com (Viktor T. Toth) Date: Fri, 6 Jan 2012 19:41:15 -0500 Subject: [Maxima] evaluating products?? In-Reply-To: <4F0790D0.9070206@eecs.berkeley.edu> References: <4F0790D0.9070206@eecs.berkeley.edu> Message-ID: <01ca01ccccd5$12ec2cf0$38c486d0$@vttoth.com> Try ev(s,n=3,product). It seems to work for me. Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Richard Fateman Sent: Friday, January 06, 2012 7:25 PM To: Maxima - list Subject: [Maxima] evaluating products?? say I create this: s: product(f(i),i,0,n) and later I want to evaluate it with n=3, to get f(0)*f(1)*f(2)*f(3). How? subst(3,n,s) doesn't work. ev(s,n=3) doesn't work. I suspect this failure is a new "feature". RJF _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From toy.raymond at gmail.com Fri Jan 6 18:42:51 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 6 Jan 2012 16:42:51 -0800 Subject: [Maxima] quad_qagi exponential divergence returns In-Reply-To: References: Message-ID: On Fri, Jan 6, 2012 at 3:16 PM, Edwin Woollett wrote: > For linear divergence, quad_qagi issues a console > warning and some error code number > 2 as > a warning. > > [snip] > But for exponential divergence, there is no console warning, and an error > code = 0 is returned. The user needs to see the occurrence of #INF in the > returned answer to infer the software/machine limit has > been reached. > > ------------------------------**---------------- > (%i2) quad_qagi(%e^x,x,0,inf); > > (%o2) [1..#INF00e+000E+2288952,1..#**INF00e+000E+2288952,75,0] > ------------------------------------------ > > This is really an issue with gcl. It looks like gcl doesn't signal an errors on overflow and uses infinities instead. Other lisps (cmucl and ccl) do signal errors which are silently caught and a noun form is returned. I suppose the routines could check that no infinities or NaNs are returned in the result. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Fri Jan 6 18:57:15 2012 From: willisb at unk.edu (Barton Willis) Date: Fri, 6 Jan 2012 18:57:15 -0600 Subject: [Maxima] evaluating products?? In-Reply-To: <4F0790D0.9070206@eecs.berkeley.edu> References: <4F0790D0.9070206@eecs.berkeley.edu> Message-ID: (%i40) s : product(f(i),i,0,n)$ (%i41) [ev(s,n=3,product), ev(s,product, n=3),ev(s,n=3,nouns),ev(s,nouns,n=3)]; (%o41) [f(0)*f(1)*f(2)*f(3),f(0)*f(1)*f(2)*f(3),f(0)*f(1)*f(2)*f(3),f(0)*f(1)*f(2)*f(3)] I'd think most uses would expect subst(n=3, product(f(i),i,0,n)) to be identical to product(f(i),i,0,3) :( --Barton -----maxima-bounces at math.utexas.edu wrote: ----- To: Maxima - list From: Richard Fateman Sent by: maxima-bounces at math.utexas.edu Date: 01/06/2012 06:24PM Subject: [Maxima] evaluating products?? say I create this: ? ?s: ?product(f(i),i,0,n) and later I want to evaluate it with n=3, to get f(0)*f(1)*f(2)*f(3). How? ?subst(3,n,s) ?doesn't work. ? ev(s,n=3) doesn't work. I suspect this failure is a new "feature". RJF _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From fateman at eecs.berkeley.edu Fri Jan 6 19:16:27 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 06 Jan 2012 17:16:27 -0800 Subject: [Maxima] evaluating products?? In-Reply-To: References: <4F0790D0.9070206@eecs.berkeley.edu> Message-ID: <4F079CEB.9070908@eecs.berkeley.edu> On 1/6/2012 4:57 PM, Barton Willis wrote: > (%i40) s : product(f(i),i,0,n)$ > > (%i41) [ev(s,n=3,product), ev(s,product, n=3),ev(s,n=3,nouns),ev(s,nouns,n=3)]; > (%o41) [f(0)*f(1)*f(2)*f(3),f(0)*f(1)*f(2)*f(3),f(0)*f(1)*f(2)*f(3),f(0)*f(1)*f(2)*f(3)] > > I'd think most uses would expect subst(n=3, product(f(i),i,0,n)) to be > identical to product(f(i),i,0,3) :( > > --Barton > > Right. I didn't know it was a product, at first. From bhakta.jim at gmail.com Fri Jan 6 22:02:27 2012 From: bhakta.jim at gmail.com (James Nesta) Date: Fri, 6 Jan 2012 20:02:27 -0800 Subject: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) In-Reply-To: References: Message-ID: Hi everybody, Thanks for checking my math on this Rich. In looking back at what I wrote I noticed that I had omitted a factor of (1/k) in the transform of the differential. The transform should look like dx = (1/k)*z^(1/k - 1)*dz. I'm sorry if this might have caused confusion; I should monitor my typing more carefully! The version of the incomplete gamma function that I used is from Abramowitz & Stegun (6.5.3); this is the version that I was familiar with from other books. Using this definition I still get the answer that I originally got. In the Maxima reference on this function the integral form of this function follows A&S (6.5.3) but it is identified as A&S (6.5.2), an alternative version. The situation is confusing as to what form Maxima really uses. I think that your solution Rich corresponds to the integral form of incomplete gamma from zero to x, vs my form from x to infinity. In doing a numerical test on Maxima's gamma_incomplete(5,0) I get 24 = 4!, which seems to correspond to the integral form that I used. So it seems to me that the formula reference in Maxima's manual has a typo that is highly misleading. I again apologize to the readers for any confusion that might have arisen from any of my statements and extend my thanks to those, including you, who attempted to clarify the problem. Jim On Wed, Jan 4, 2012 at 9:45 PM, Richard Hennessy wrote: > I meant the integral becomes (1/k)*[gamma(1/k)-incomplete_**gamma(1/k, > z)]. Typo. > > Rich > > -----Original Message----- From: Richard Hennessy > Sent: Thursday, January 05, 2012 12:43 AM > To: James Nesta ; maxima at math.utexas.edu > > Subject: Re: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) > > "integral becomes(1/k)*[gamma(1/k)-**incomplete_gamma(1/k, 1)]" > > I think you made a mistake, it should be > > the integral becomes (1/k)*[gamma(1/k)-incomplete_**gamma(1/k, k)] > > Rich > > -----Original Message----- From: James Nesta > Sent: Wednesday, January 04, 2012 10:48 PM > To: maxima at math.utexas.edu > Subject: Re: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) > > In fooling with this integral I was able to get what I think is a > manageable > solution. As follows: > > Transform the variable x to z by the transformation x = z^(1/k), dx = > z^(1/k-1)dz, > > the integral becomes(1/k)*[gamma(1/k)-**incomplete_gamma(1/k, 1)]. I think > that Maxima should be able to handle each of these functions. I hope that > this helps. > > Jim > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikael at jetmik.dk Sat Jan 7 01:20:09 2012 From: mikael at jetmik.dk (=?ISO-8859-1?Q?Mikael_Sams=F8e_S=F8rensen?=) Date: Sat, 7 Jan 2012 08:20:09 +0100 Subject: [Maxima] New Maxima equation solver Message-ID: I have created a package with a new equation solver for solving equations within real numbers. I have attached the package and a readme file in a zip-file. It will also be available via this link for a short while: https://www.sugarsync.com/pf/D012577_0526777_765876 The package has some other nice functions as well, which are described in the readme file. Here is an example of the usage: (%i3) solvereal(a=72*%e^((0.619/0.22*(%e^22-%e^0.22*t ))),t); Assumptions: [a>0] (%o3) [t=(4588*%e^22)/5717-(1009360*log(a/72))/3538823] I made this package as part of a another project, WordMat, which is available here: www.eduap.com Maybe this can go in the contrib directory. Mikael Sams?e S?rensen -------------- next part -------------- A non-text attachment was scrubbed... Name: SolveReal.zip Type: application/zip Size: 13800 bytes Desc: not available URL: From yasuaki.honda at gmail.com Sat Jan 7 03:38:46 2012 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Sat, 7 Jan 2012 18:38:46 +0900 Subject: [Maxima] imaxima mode under mac os X In-Reply-To: References: Message-ID: As soon as I introduced Mac OS X Lion, I experienced the same bug.I fixed it locally, but forgot to push it to the git. (I noticed this mistake by carefully looking at 5.26.0). Today I committed the changes to the git so that next maxima release will come with imaxima with the fix. Thanks and best regards, Yasuaki Honda 2011/11/4 Michel Talon > While i am playing with my new maxima installation, i have seen that > imaxima > doesn't work here on the Mac OS X. > > The solution is simple, one needs to remove the > imaxima-subst-char-in-string > in the computation of the temporary directory, because this chokes with the > way it is formed on the mac. Hence the substitution: > ; (make-directory > ; (setq imaxima-tmp-subdir > ; ;; For some reason TeX doesn't grok underscores in file names > ; (imaxima-subst-char-in-string ?_ ?= > ; (make-temp-name (expand-file-name "imaxima" > imaxima-tmp-dir))))) > (make-directory > (setq imaxima-tmp-subdir > (make-temp-name (expand-file-name "imaxima" imaxima-tmp-dir)))) > > > After that imaxima works OK. At first sight slime is able to coexist. > (Note that TeX has no problem here with the underscore in the name). > > > -- > Michel Talon > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Jan 7 13:13:58 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 7 Jan 2012 12:13:58 -0700 Subject: [Maxima] colorizing matrix elements In-Reply-To: <4F063557.10303@gmx.de> References: <4F063557.10303@gmx.de> Message-ID: On 1/5/12, andre maute wrote: > if someone thinks it is possible to colorize some matrix elements. That's an interesting idea. I see a couple of ways to do it. (1) colorized MathML (XML) output. There is a share package to generate MathML if I recall correctly. Maybe colors can be imposed as attributes or something? (2) colorized wxMaxima output. I think wxMaxima generates HTML or XML for display. Same idea here -- use attributes to set the color. (3) colorized console pretty printer output. I spent a few minutes experimenting with that. It's easy enough to introduce colors via VT100 escape codes. I tried to convert elements to strings, and colorize those, and then punt to the existing display code, but appending color codes makes the strings longer (more characters) and the matrix display then misjudges the display width of the matrix; the matrix is actually narrower. Now that I think about it, I guess a better way to do it is to append the colorization stuff after calculating the size of the element. I would have to go back & dig around in DIM-$MATRIX to figure it out. Anyway perhaps this is interesting in some way. best, Robert Dodier ------------------- begin patch for src/displa.lisp ------------------- $ diff -u /tmp/dim-\$matrix.lisp '/home/robert/maxima/playpen/dim-$matrix-color.lisp' --- /tmp/dim-$matrix.lisp 2012-01-07 11:36:54.000000000 -0700 +++ /home/robert/maxima/playpen/dim-$matrix-color.lisp 2012-01-07 12:10:54.000000000 -0700 @@ -1,7 +1,7 @@ -(displa-def $matrix dim-$matrix) +(displa-def $matrix dim-$matrix-color) -(defun dim-$matrix (form result) - (prog (dmstr rstr cstr consp cols) +(defun dim-$matrix-color (form result) + (prog (dmstr rstr cstr consp cols element-string element-string-display) (setq cols (if ($listp (cadr form)) (length (cadr form)) 0)) (if (or (null (cdr form)) (memalike '((mlist simp)) (cdr form)) @@ -24,7 +24,9 @@ (nc dmstr (cdr nc)) (cs cstr (cdr cs)) (dummy) (h2 0) (d2 0)) ((null c) (setq d1 (+ d1 h1 h2) h1 (1+ d2))) - (setq dummy (dimension (car c) nil 'mparen 'mparen nil 0) + (setq element-string (strgrind (car c))) + (setq element-string-display (concatenate 'string ($vt100 '$red) element-string ($vt100 '$black))) + (setq dummy (dimension element-string-display nil 'mparen 'mparen nil 0) h2 (max h2 height) d2 (max d2 depth)) (cond ((not (checkfit (+ 14. width))) (setq consp t) (return nil)) (t (rplaca nc (cons (list* width height depth dummy) (car nc))) ------------------- end patch for src/displa.lisp ------------------- --------------------- begin vt00.lisp ------------------- ;; vt100.lisp -- change VT100 terminal output foreground color ;; copyright 2012 by Robert Dodier ;; I release this work under terms of the GNU General Public License ;; VT100 foreground colors -- nicked from share/contrib/colorterm.lisp ;;; 30 Black ;;; 31 Red ;;; 32 Green ;;; 33 Yellow ;;; 34 Blue ;;; 35 Magenta ;;; 36 Cyan ;;; 37 White (let ((vt100-colors (make-hash-table))) (setf (gethash '$black vt100-colors) 30.) (setf (gethash '$red vt100-colors) 31.) (setf (gethash '$green vt100-colors) 32.) (setf (gethash '$yellow vt100-colors) 33.) (setf (gethash '$blue vt100-colors) 34.) (setf (gethash '$magenta vt100-colors) 35.) (setf (gethash '$cyan vt100-colors) 36.) (setf (gethash '$white vt100-colors) 37.) (defun $vt100 (color-symbol) (let ((color-code (gethash color-symbol vt100-colors)) (escape-char (code-char 27))) (if color-code (format nil "~a[00;~am" escape-char color-code))))) --------------------- end vt100.lisp ------------------- From robert.dodier at gmail.com Sat Jan 7 13:25:58 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 7 Jan 2012 12:25:58 -0700 Subject: [Maxima] evaluating products?? In-Reply-To: References: <4F0790D0.9070206@eecs.berkeley.edu> Message-ID: On 1/6/12, Barton Willis wrote: > (%i40) s : product(f(i),i,0,n)$ > > (%i41) [ev(s,n=3,product), ev(s,product, > n=3),ev(s,n=3,nouns),ev(s,nouns,n=3)]; > (%o41) > [f(0)*f(1)*f(2)*f(3),f(0)*f(1)*f(2)*f(3),f(0)*f(1)*f(2)*f(3),f(0)*f(1)*f(2)*f(3)] > > I'd think most uses would expect subst(n=3, product(f(i),i,0,n)) to be > identical to product(f(i),i,0,3) :( The observed behavior is consistent with Maxima's general policy for handling nouns vs verbs. In addition, there are simplification flags (simpsum and simpproduct) for sum and product nouns, which simplify to "+" and "*" expressions when (upper minus lower) is an integer. best Robert Dodier From robert.dodier at gmail.com Sat Jan 7 13:25:58 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 7 Jan 2012 12:25:58 -0700 Subject: [Maxima] evaluating products?? In-Reply-To: References: <4F0790D0.9070206@eecs.berkeley.edu> Message-ID: On 1/6/12, Barton Willis wrote: > (%i40) s : product(f(i),i,0,n)$ > > (%i41) [ev(s,n=3,product), ev(s,product, > n=3),ev(s,n=3,nouns),ev(s,nouns,n=3)]; > (%o41) > [f(0)*f(1)*f(2)*f(3),f(0)*f(1)*f(2)*f(3),f(0)*f(1)*f(2)*f(3),f(0)*f(1)*f(2)*f(3)] > > I'd think most uses would expect subst(n=3, product(f(i),i,0,n)) to be > identical to product(f(i),i,0,3) :( The observed behavior is consistent with Maxima's general policy for handling nouns vs verbs. In addition, there are simplification flags (simpsum and simpproduct) for sum and product nouns, which simplify to "+" and "*" expressions when (upper minus lower) is an integer. best Robert Dodier From woollett at charter.net Sat Jan 7 13:51:20 2012 From: woollett at charter.net (Edwin Woollett) Date: Sat, 7 Jan 2012 11:51:20 -0800 Subject: [Maxima] quad_qagi exponential divergence returns Message-ID: On Jan. 6, 2012, Raymond Toy wrote: ------------------------------- >This is really an issue with gcl. It looks like gcl doesn't signal an >errors on overflow and uses infinities instead. Other lisps (cmucl and >ccl) do signal errors which are silently caught and a noun form is >returned. > >I suppose the routines could check that no infinities or NaNs are returned >in the result. ------------------------------- Thanks for the info. I have inserted an additional check in parts of nint.mac, such as ------------------------ rL : apply ('quad_qagi, argL), if (substring(string(rL[1]),1,8) = "1..#INF" ) then (print(" quad_qagi: overflow"), ans : false) etc., ----------------- which is no big deal. If some of the experts would post Windows binaries using other lisps (cmucl, ccl,..) it would make it easier for Windows slaves (like myself) to check code construction problems of this type. Ted From woollett at charter.net Sat Jan 7 14:38:56 2012 From: woollett at charter.net (Edwin Woollett) Date: Sat, 7 Jan 2012 12:38:56 -0800 Subject: [Maxima] New Maxima equation solver Message-ID: <30F7CBCB63B642BBAF4A3C47406ECC4A@edwinc367e16bd> On Jan. 7, 2012, Mikael Sams?e S?rensen wrote: -------------------------- >I have created a package with a new equation solver for solving >equations within real numbers. --------------------------------- This looks very interesting. I have not tried it out yet, but this package might be the basis for a new section of a revised Ch. 4, Solving Equations (Maxima by Example). In the text file description you mention desolvemore but in the mac code file I only find desolvereal. Perhaps you changed the name? Best Wishes, Ted Woollett From fateman at eecs.berkeley.edu Sat Jan 7 14:38:40 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 07 Jan 2012 12:38:40 -0800 Subject: [Maxima] evaluating products?? In-Reply-To: References: <4F0790D0.9070206@eecs.berkeley.edu> Message-ID: <4F08AD50.1000709@eecs.berkeley.edu> On 1/7/2012 11:25 AM, Robert Dodier wrote: > In addition, there are simplification flags (simpsum and simpproduct) > for sum and product nouns,which simplify to "+" and "*" expressions > when (upper minus lower) is an integer. best Robert Dodier simpproduct is undocumented, at least in 5.23.2 From rich.hennessy at verizon.net Sat Jan 7 15:16:02 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sat, 07 Jan 2012 16:16:02 -0500 Subject: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) In-Reply-To: References: Message-ID: ?The situation is confusing as to what form Maxima really uses.? 6.5.3 makes sense to me. As for my email I think I misunderstood what you did. Sorry for your confusion, your answer is correct. Rich From: James Nesta Sent: Friday, January 06, 2012 11:02 PM To: Richard Hennessy Cc: maxima at math.utexas.edu Subject: Re: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) Hi everybody, Thanks for checking my math on this Rich. In looking back at what I wrote I noticed that I had omitted a factor of (1/k) in the transform of the differential. The transform should look like dx = (1/k)*z^(1/k - 1)*dz. I'm sorry if this might have caused confusion; I should monitor my typing more carefully! The version of the incomplete gamma function that I used is from Abramowitz & Stegun (6.5.3); this is the version that I was familiar with from other books. Using this definition I still get the answer that I originally got. In the Maxima reference on this function the integral form of this function follows A&S (6.5.3) but it is identified as A&S (6.5.2), an alternative version. The situation is confusing as to what form Maxima really uses. I think that your solution Rich corresponds to the integral form of incomplete gamma from zero to x, vs my form from x to infinity. In doing a numerical test on Maxima's gamma_incomplete(5,0) I get 24 = 4!, which seems to correspond to the integral form that I used. So it seems to me that the formula reference in Maxima's manual has a typo that is highly misleading. I again apologize to the readers for any confusion that might have arisen from any of my statements and extend my thanks to those, including you, who attempted to clarify the problem. Jim On Wed, Jan 4, 2012 at 9:45 PM, Richard Hennessy wrote: I meant the integral becomes (1/k)*[gamma(1/k)-incomplete_gamma(1/k, z)]. Typo. Rich -----Original Message----- From: Richard Hennessy Sent: Thursday, January 05, 2012 12:43 AM To: James Nesta ; maxima at math.utexas.edu Subject: Re: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) "integral becomes(1/k)*[gamma(1/k)-incomplete_gamma(1/k, 1)]" I think you made a mistake, it should be the integral becomes (1/k)*[gamma(1/k)-incomplete_gamma(1/k, k)] Rich -----Original Message----- From: James Nesta Sent: Wednesday, January 04, 2012 10:48 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) In fooling with this integral I was able to get what I think is a manageable solution. As follows: Transform the variable x to z by the transformation x = z^(1/k), dx = z^(1/k-1)dz, the integral becomes(1/k)*[gamma(1/k)-incomplete_gamma(1/k, 1)]. I think that Maxima should be able to handle each of these functions. I hope that this helps. Jim _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Jan 7 15:16:34 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 7 Jan 2012 14:16:34 -0700 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: References: Message-ID: Hi Michael, About creating multiple concurrent Maxima sessions, take a look at share/contrib/maxima-server.lisp, which implements a conventional Unixish server. Server listens for clients, accepts a client, and forks a child process to handle the client. Since child processes are in separate virtual address spaces, changes to variables in one don't affect another. I suppose the server could be run with chroot to prevent access to the file system. maxima-server.lisp uses SBCL's POSIX interface. About your project to create a Quicklisp-able Maxima, I think that is a valuable goal, and I'm 100% in favor of you (or anyone) creating their own projects based on Maxima. That said, since you have changed the build system a lot, I am hesitant to merge those changes into Maxima. I am no big fan of defsystem, but changing the build system could affect people who are building packages or installations. If you want to try (or not, that's OK too) to convince me & other developers to merge in your changes, perhaps you can describe how the build machinery will work. I can't guarantee that we'll accept it, but I am interested to hear about it. best Robert Dodier From robert.dodier at gmail.com Sat Jan 7 15:35:16 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 7 Jan 2012 14:35:16 -0700 Subject: [Maxima] Read_array Question In-Reply-To: <1325369187.6799.54.camel@asus> References: <1325369187.6799.54.camel@asus> Message-ID: On 12/31/11, Thomas D. Dean wrote: > The data is > Qth 23 41 a+bx > Z9 3 7 41 > > or, > number number > I want to read this file into maxima. Well, there are a couple of functions to read data from a file when the number of rows isn't known ahead of time. read_matrix reads all the lines and creates a matrix with that many rows. read_hashed_array reads the first item on each line and uses that as a hash key for the remaining items on the line. It returns an "undeclared array" (Maxima terminology for a hash table). But a problem is that the various read_* functions treat each token as a separate item. E.g. a + b is read as two items, a and +b. If your data contain some general expressions, you will probably have to read line by line and play some games with the parser. Sorry for the late reply, hope this helps. Robert Dodier From toy.raymond at gmail.com Sat Jan 7 16:23:02 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 07 Jan 2012 14:23:02 -0800 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: References: Message-ID: <4F08C5C6.4070608@gmail.com> On 1/7/12 1:16 PM, Robert Dodier wrote: > About your project to create a Quicklisp-able Maxima, I think that > is a valuable goal, and I'm 100% in favor of you (or anyone) > creating their own projects based on Maxima. That said, since > you have changed the build system a lot, I am hesitant to > merge those changes into Maxima. I am no big fan of defsystem, > but changing the build system could affect people who are > building packages or installations. I haven't tried it, but I think using asdf instead of defsystem to build maxima shouldn't be very hard. Switching the existing defsystems to asdf shouldn't be too hard either since the basic syntax is pretty much compatible. The main issue is if asdf will work with gcl. We still build maxima with gcl, right? That would be a show stopper. > > If you want to try (or not, that's OK too) to convince me & other > developers to merge in your changes, perhaps you can describe > how the build machinery will work. I can't guarantee that we'll accept it, > but I am interested to hear about it. > I don't understand why we would need to change the maxima.asd we already have. That should work to build maxima. Oh, there is one hairy issue. If you notice, make will compile maxima and then reload it all again into a fresh image before saving the image. I think James had to do this long ago because of some issues with compile and load order. We haven't been very good about having things defined before they are used. And there used to be issues with different files defining the same function with slightly different behaviors. Don't know if those exist or not anymore. Ray From filonenko.mikhail at gmail.com Sun Jan 8 02:03:49 2012 From: filonenko.mikhail at gmail.com (Michael Filonenko) Date: Sun, 8 Jan 2012 10:03:49 +0200 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: References: Message-ID: Hi; > Quicklisp-able 2012/1/8 Robert Dodier : > Hi Michael, > > About creating multiple concurrent Maxima sessions, take a look > at share/contrib/maxima-server.lisp, which implements a conventional > Unixish server. Server listens for clients, accepts a client, and forks > a child process to handle the client. Since child processes are in > separate virtual address spaces, changes to variables in one don't > affect another. I suppose the server could be run with chroot to > prevent access to the file system. maxima-server.lisp uses SBCL's > POSIX interface. Thanks, I will try it. > About your project to create a Quicklisp-able Maxima, I think that > is a valuable goal, and I'm 100% in favor of you (or anyone) > creating their own projects based on Maxima. That said, since > you have changed the build system a lot, I am hesitant to > merge those changes into Maxima. I am no big fan of defsystem, > but changing the build system could affect people who are > building packages or installations. Thanks. I would not want to look like a revolutionary, but for now asdf is widespread and quicklisp supports only it. Quicklisp repositories can make maxima developers free to solve some problems like: filenames, socket, interprocess communication, etc. Today state of my fork is: - repository url: http://github.com/filonenko-mikhail/maxima - all previous git history is saved, so, I only did "quicklisp" branch, in which I repair existing maxima asdf system; - merge changes from "master" to "quicklisp" is easy because git is smart and can handle moving of files; - merge changes from "quicklisp" to "master" is not so easy, because I refactor following things: - lapack, quadpack modules are compiled on-fly, now. I use asdf system examples from f2cl/packages repository; - setup of maxima paths depends on environment variables, and if it does not exist, on asd file path; - there are some external dependencies, which are available from quicklisp repositaries. cl-fad, f2cl (embedded is removed now), getopt (embedded is removed now), trivial-features (windows detection by #+windows, instead of (string= "true" autoconf:**win32*)); - I remove archive/ directory, because lightweight packages are better for quicklisp; - I remove binary output path handling, because asdf and quicklisp do it itself; - I also move source files into directories in accordance with maxima.asd, it is mostly cosmetic change; There are all my changes: https://github.com/filonenko-mikhail/maxima/commits/quicklisp > If you want to try ?(or not, that's OK too) to convince me & other > developers to merge in your changes, perhaps you can describe > how the build machinery will work. I can't guarantee that we'll accept it, > but I am interested to hear about it. There is quicklisp request for adding embedded maxima into repositories. I am trying to find how many peoples are interested in this project. Also, as I said, it is easy to merge mathematical parts of "master" branch into "quicklisp" branch and I can maintain it. The main problem is that I broke mk-defsystem, and I can not support this system. Deploying of maxima depends on mk-defsystem and now it is broken too. If there will be many users, I can repair packaging of maxima, but it will be something, like: sbcl (ql:quickload :maxima) (crossplatform:save-lisp-and-die (lambda() (cl-user::run)) ) For windows/macos/linux bat/sh file: fill environment variables with maxima share, doc, etc paths; execute maxima image. From filonenko.mikhail at gmail.com Sun Jan 8 02:17:35 2012 From: filonenko.mikhail at gmail.com (Michael Filonenko) Date: Sun, 8 Jan 2012 10:17:35 +0200 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: <4F08C5C6.4070608@gmail.com> References: <4F08C5C6.4070608@gmail.com> Message-ID: 2012/1/8 Raymond Toy : > On 1/7/12 1:16 PM, Robert Dodier wrote: >> About your project to create a Quicklisp-able Maxima, I think that >> is a valuable goal, and I'm 100% in favor of you (or anyone) >> creating their own projects based on Maxima. That said, since >> you have changed the build system a lot, I am hesitant to >> merge those changes into Maxima. I am no big fan of defsystem, >> but changing the build system could affect people who are >> building packages or installations. > I haven't tried it, but I think using asdf instead of defsystem to build > maxima shouldn't be very hard. ?Switching the existing defsystems to > asdf shouldn't be too hard either since the basic syntax is pretty much > compatible. > > The main issue is if asdf will work with gcl. ? We still build maxima > with gcl, right? ?That would be a show stopper. sbcl supports all major operating systems. >> >> If you want to try ?(or not, that's OK too) to convince me & other >> developers to merge in your changes, perhaps you can describe >> how the build machinery will work. I can't guarantee that we'll accept it, >> but I am interested to hear about it. >> > I don't understand why we would need to change the maxima.asd we already > have. ?That should work to build maxima. > > Oh, there is one hairy issue. ?If you notice, make will compile maxima > and then reload it all again into a fresh image before saving the > image. ?I think James had to do this long ago because of some issues > with compile and load order. ?We haven't been very good about having > things defined before they are used. ?And there used to be issues with > different files defining the same function with slightly different > behaviors. ?Don't know if those exist or not anymore. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- With best regards, Michael Filonenko From mmse89 at gmail.com Sun Jan 8 08:02:37 2012 From: mmse89 at gmail.com (=?ISO-8859-1?Q?Moln=E1r_Emese?=) Date: Sun, 8 Jan 2012 15:02:37 +0100 Subject: [Maxima] perform the operation Message-ID: Hi, All! I have a task : solute a system of differential equations. I thougt it so easy.. I have used the desolve command, it's working, but the result is a function (ilt), inverse laplace, and I can't to get the maxima to perform this operate. Have you any idea for this? Mesi -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Sun Jan 8 10:20:12 2012 From: willisb at unk.edu (Barton Willis) Date: Sun, 8 Jan 2012 10:20:12 -0600 Subject: [Maxima] perform the operation In-Reply-To: References: Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- > I have used the desolve command, it's working, but the result is a function (ilt), inverse laplace, > and I can't ?to get the maxima to perform this operate. If you posted the equations, maybe somebody will find a workaround. To post the equations, please set display2d : false. --Barton From robert.dodier at gmail.com Sun Jan 8 11:24:00 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 8 Jan 2012 10:24:00 -0700 Subject: [Maxima] need Maxima 5.26 for Windows Message-ID: Hi everybody, Can someone build a Windows installer for Maxima 5.26 ? I just looked at the list of files at Sourceforge and I don't see one. I'd like to make a general announcement about 5.26 (sorry for the delay). If nobody builds a Windows installer, I'm not sure what to do. The only thing that comes to mind is to compile Maxima w/ GCL on Windows, dump an image, and package everything as a zip file. Other ideas? best, Robert Dodier From paratribulations at free.fr Sun Jan 8 12:00:34 2012 From: paratribulations at free.fr (TP) Date: Sun, 08 Jan 2012 19:00:34 +0100 Subject: [Maxima] dyadic/vector package by Michael Wirth Message-ID: <1680337.bOQ7bk7Hq4@rama> Hello, I am looking for powerful vector (and possibly dyadic) CAS capabilities, *without introducing components*. Look at the following article: http://www.apmaths.uwo.ca/~djeffrey/Offprints/LJcalculemus.pdf In the interesting state-of-the-art part of this article, the authors mention a Macsyma package, which is the work of Stoutemeyer, described in: [12]. Stoutemyer, D.R., 1979. Symbolic computer vector analysis. Computers & Mathematics with Applications, 5, 1-9. It seems that David Stoutemyer contributes to this newsgroup from time to time. The package mentioned in [12] seems to be vect.mac. Can you confirm? $ head share/vector/vect.mac /*-*-MACSYMA-*-*/ eval_when(batch,ttyoff:true)$ /* Or use the BATCHLOAD command to load this with TTYOFF:TRUE */ /* NOTE: THE CURRENT VERSION OF VECT IS THE ONE DUE TO STOUTEMYER. IT WILL BE REPLACED SOON BY AN EXTENDED VERSION WHICH HANDLES BOTH VECTORS AND DYADICS. MICHAEL C. WIRTH (MCW) 12/18/78 So, this package should have been superseded by the work of Michael Wirth, described in the following article: SIAM J. Comput. 8, pp. 306-319 Symbolic Vector and Dyadic Analysis Michael C. Wirth http://epubs.siam.org/sicomp/resource/1/smjcat/v8/i3/p306_s1?isAuthorized=no By looking in the source code of Macsyma, I find only one mention of Michael Wirth: $ grep -ril "wirth" * share/vector/vect.mac share/vector/vect.usg Has the package of Wirth ever been commited? What happened exactly? Thanks in advance, TP From paratribulations at free.fr Sun Jan 8 11:56:10 2012 From: paratribulations at free.fr (TP) Date: Sun, 08 Jan 2012 18:56:10 +0100 Subject: [Maxima] dyadic/vector package by Michael Wirth Message-ID: Hello, I am looking for powerful vector (and possibly dyadic) CAS capabilities, *without introducing components*. Look at the following article: http://www.apmaths.uwo.ca/~djeffrey/Offprints/LJcalculemus.pdf In the interesting state-of-the-art part of this article, the authors mention a Macsyma package, which is the work of Stoutemeyer, described in: [12]. Stoutemyer, D.R., 1979. Symbolic computer vector analysis. Computers & Mathematics with Applications, 5, 1-9. It seems that David Stoutemyer contributes to this newsgroup from time to time. The package mentioned in [12] seems to be vect.mac. Can you confirm? $ head share/vector/vect.mac /*-*-MACSYMA-*-*/ eval_when(batch,ttyoff:true)$ /* Or use the BATCHLOAD command to load this with TTYOFF:TRUE */ /* NOTE: THE CURRENT VERSION OF VECT IS THE ONE DUE TO STOUTEMYER. IT WILL BE REPLACED SOON BY AN EXTENDED VERSION WHICH HANDLES BOTH VECTORS AND DYADICS. MICHAEL C. WIRTH (MCW) 12/18/78 So, this package should have been superseded by the work of Michael Wirth, described in the following article: SIAM J. Comput. 8, pp. 306-319 Symbolic Vector and Dyadic Analysis Michael C. Wirth http://epubs.siam.org/sicomp/resource/1/smjcat/v8/i3/p306_s1?isAuthorized=no By looking in the source code of Macsyma, I find only one mention of Michael Wirth: $ grep -ril "wirth" * share/vector/vect.mac share/vector/vect.usg Has the package of Wirth ever been commited? What happened exactly? Thanks in advance, TP From jan.mueller at math.uni-dortmund.de Sun Jan 8 13:08:38 2012 From: jan.mueller at math.uni-dortmund.de (=?ISO-8859-15?Q?Jan_Hendrik_M=FCller?=) Date: Sun, 08 Jan 2012 20:08:38 +0100 Subject: [Maxima] bug in is()? Message-ID: <4F09E9B6.8060909@math.uni-dortmund.de> Hi, the commands is() and is(equal()) evaluate differently: expand((x+1)*(x+2)*(x+3)); -> x^3+6*x^2+11*x+6 is(equal(x^3+6*x^2+11*x+6,(x+1)*(x+2)*(x+3))); -> true is(x^3+6*x^2+11*x+6=(x+1)*(x+2)*(x+3)); -> false is this a bug in is()? Jan -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: isequal.wxm URL: From robert.dodier at gmail.com Sun Jan 8 13:17:43 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 8 Jan 2012 12:17:43 -0700 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: <4F08C5C6.4070608@gmail.com> References: <4F08C5C6.4070608@gmail.com> Message-ID: On 1/7/12, Raymond Toy wrote: > I haven't tried it, but I think using asdf instead of defsystem to build > maxima shouldn't be very hard. Switching the existing defsystems to > asdf shouldn't be too hard either since the basic syntax is pretty much > compatible. Well, there exists a maxima.asd and it successfully compiles & loads Maxima. I'll append a quick n dirty patch to get make to build Maxima via asdf instead of defsystem. (Defsystem is also used to generate dependencies and translate Fortran to Lisp, and maybe other stuff, so there is some additional work to do.) > The main issue is if asdf will work with gcl. We still build maxima > with gcl, right? That would be a show stopper. Well, if we can find another Lisp for Windows, we wouldn't need GCL .... > Oh, there is one hairy issue. If you notice, make will compile maxima > and then reload it all again into a fresh image before saving the > image. I think James had to do this long ago because of some issues > with compile and load order. We haven't been very good about having > things defined before they are used. And there used to be issues with > different files defining the same function with slightly different > behaviors. Don't know if those exist or not anymore. Yeah -- I guess that stuff should be cleaned up. That's independent of asdf vs defsystem, right? best Robert Dodier PS. I built Maxima (./configure --enable cmucl && make) after making this change. diff --git a/src/Makefile.am b/src/Makefile.am index f94cf13..5b1d6ba 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,11 +6,10 @@ else bin_SCRIPTS = maxima rmaxima endif -LOADDEFSYSTEM = (load "$(top_srcdir)/lisp-utils/defsystem.lisp") +LOADDEFSYSTEM = (require :asdf) LOADMAKEDEPENDS = (load "$(top_srcdir)/lisp-utils/make-depends.lisp") -DEFSYSTEMCOMPILE = (funcall (intern (symbol-name :operate-on-system) :mk) "maxima" :compile :verbose t) -DEFSYSTEMLOAD = (funcall (intern (symbol-name :operate-on-system) :mk) "maxima" :load :verbose t) -DEFSYSTEMTESTLOAD = (funcall (intern (symbol-name :operate-on-system) :mk) "maxima" :load :verbose t :test t) +DEFSYSTEMCOMPILE = (funcall (intern (symbol-name :operate) :asdf) (intern (symbol-name :compile-op) :asdf) :maxima) +DEFSYSTEMLOAD = (funcall (intern (symbol-name :operate) :asdf) (intern (symbol-name :load-op) :asdf) :maxima) if CLISP EXECUTECLISP = $(CLISP_NAME) -norc -q -x From robert.dodier at gmail.com Sun Jan 8 13:19:59 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 8 Jan 2012 12:19:59 -0700 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: References: <4F08C5C6.4070608@gmail.com> Message-ID: On 1/8/12, Michael Filonenko wrote: > sbcl supports all major operating systems. Last time I tried SBCL on Windows (a couple of years ago) it printed some kind of message about "use at your own risk, the kitten of death awaits" or something like that. Is SBCL for Windows really finished at this point? (I hope so.) best Robert Dodier From macrakis at alum.mit.edu Sun Jan 8 13:22:45 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 8 Jan 2012 14:22:45 -0500 Subject: [Maxima] bug in is()? In-Reply-To: <4F09E9B6.8060909@math.uni-dortmund.de> References: <4F09E9B6.8060909@math.uni-dortmund.de> Message-ID: No, is(equal(A,B)) compares for equality of *value*, while is(A=B) compares for equality of *form*. Some examples: (%i25) apply('matrix,makelist([is(i[1]=i[2]),is(equal(i[1],i[2])), i[1],i[2]], i, [[1,1.0], [.5,1/2], [(x-1)/x,1-1/x], [(x-1)*(x+1),x^2-1], [x,rat(x)], [1+x,taylor(1+x,x,0,3)], [1+x,taylor(1+x,x,1,3)]])); (%o25) matrix([false,true,1,1.0], [false,true,0.5,1/2], [false,true,(x-1)/x,1-1/x], [false,true,(x-1)*(x+1),x^2-1], [true,true,x,x], << rat(x) is first ratdisrep'ed [true,true,x+1,1+x], << taylor(x,...) is first ratdisrep'ed [true,true,x+1,2+(x-1)]) << general simplifier converts 2+(x-1) to x+1 after ratdisrep On Sun, Jan 8, 2012 at 14:08, Jan Hendrik M?ller < jan.mueller at math.uni-dortmund.de> wrote: > Hi, > the commands is() and is(equal()) evaluate differently: > expand((x+1)*(x+2)*(x+3)); > -> x^3+6*x^2+11*x+6 > is(equal(x^3+6*x^2+11*x+6,(x+**1)*(x+2)*(x+3))); > -> true > is(x^3+6*x^2+11*x+6=(x+1)*(x+**2)*(x+3)); > -> false > is this a bug in is()? > Jan > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sun Jan 8 15:39:36 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 08 Jan 2012 13:39:36 -0800 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: References: <4F08C5C6.4070608@gmail.com> Message-ID: On 1/8/12 11:17 AM, Robert Dodier wrote: > On 1/7/12, Raymond Toy wrote: > >> I haven't tried it, but I think using asdf instead of defsystem to build >> maxima shouldn't be very hard. Switching the existing defsystems to >> asdf shouldn't be too hard either since the basic syntax is pretty much >> compatible. > > Well, there exists a maxima.asd and it successfully compiles & > loads Maxima. I'll append a quick n dirty patch to get make to build > Maxima via asdf instead of defsystem. (Defsystem is also used to > generate dependencies and translate Fortran to Lisp, and maybe > other stuff, so there is some additional work to do.) The conversion to asdf for the defsystems that translate Fortran to Lisp will be a bit harder, but I already do a lot of that work with f2cl (so that it could be included with quicklisp), so we can steal most of it from f2cl. > >> The main issue is if asdf will work with gcl. We still build maxima >> with gcl, right? That would be a show stopper. > > Well, if we can find another Lisp for Windows, we wouldn't need GCL .... Sure, but we haven't really done that yet. Ccl seems to work pretty well on Windows and didn't someone already do a windows installer with ccl? Perhaps it's time to drop support for gcl? > >> Oh, there is one hairy issue. If you notice, make will compile maxima >> and then reload it all again into a fresh image before saving the >> image. I think James had to do this long ago because of some issues >> with compile and load order. We haven't been very good about having >> things defined before they are used. And there used to be issues with >> different files defining the same function with slightly different >> behaviors. Don't know if those exist or not anymore. > > Yeah -- I guess that stuff should be cleaned up. That's independent > of asdf vs defsystem, right? Sort of. I don't know if these issues exist anymore, but to be safe, we'd have to arrange it so that asdf:oos will actually build everything and then load everything again. I, for one, have a hard enough time dealing with bug reports from maxima and I don't want to have to deal with a quicklisp version that builds things in the same but slightly different way. Ray From willisb at unk.edu Sun Jan 8 15:58:06 2012 From: willisb at unk.edu (Barton Willis) Date: Sun, 8 Jan 2012 15:58:06 -0600 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: References: <4F08C5C6.4070608@gmail.com> Message-ID: maxima-bounces at math.utexas.edu wrote on 01/08/2012 03:39:36 PM: > Sure, but we haven't really done that yet. Ccl seems to work pretty > well on Windows and didn't someone already do a windows installer with > ccl? Perhaps it's time to drop support for gcl? Yes, Andrej Vodopivec built a Maxima installer for windows + ccl; see, for example: http://www.math.utexas.edu/pipermail/maxima/2011/024381.html Two problems: (1) CCL uses the SSE2 instruction set. This will be a problem for older computers. (2) Last I tried, the 32 bit CCL has a bug that creates one test suite failure. I'd guess the CCL developers would fix (2) if we could isolate the problem. Problem (1) is harder--I've been know to use old computers. --Barton -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sun Jan 8 16:35:53 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 08 Jan 2012 14:35:53 -0800 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: References: <4F08C5C6.4070608@gmail.com> Message-ID: <4F0A1A49.8020705@gmail.com> On 1/8/12 1:58 PM, Barton Willis wrote: > maxima-bounces at math.utexas.edu wrote on 01/08/2012 03:39:36 PM: > > >> Sure, but we haven't really done that yet. Ccl seems to work pretty >> well on Windows and didn't someone already do a windows installer with >> ccl? Perhaps it's time to drop support for gcl? > > Yes, Andrej Vodopivec built a Maxima installer for windows + ccl; see, > for example: > http://www.math.utexas.edu/pipermail/maxima/2011/024381.html > > Two problems: > > (1) CCL uses the /SSE2 instruction set. This will be a problem for > older computers./ > (2) Last I tried, the 32 bit CCL has a bug that creates one test suite > failure. > > I'd guess the CCL developers would fix (2) if we could isolate the > problem. > Problem (1) is harder--I've been know to use old computers. I have some old machines, but only one does not have sse2. And that machine is so old and slow (1.2 GHz I think) that I don't even want to use it anymore. I need to take it to the Great Computer Recycling Center someday. I'll try to isolate the test suite failure since I do sometimes use 32-bit ccl. Ray From toy.raymond at gmail.com Sun Jan 8 16:35:53 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 08 Jan 2012 14:35:53 -0800 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: References: <4F08C5C6.4070608@gmail.com> Message-ID: <4F0A1A49.8020705@gmail.com> On 1/8/12 1:58 PM, Barton Willis wrote: > maxima-bounces at math.utexas.edu wrote on 01/08/2012 03:39:36 PM: > > >> Sure, but we haven't really done that yet. Ccl seems to work pretty >> well on Windows and didn't someone already do a windows installer with >> ccl? Perhaps it's time to drop support for gcl? > > Yes, Andrej Vodopivec built a Maxima installer for windows + ccl; see, > for example: > http://www.math.utexas.edu/pipermail/maxima/2011/024381.html > > Two problems: > > (1) CCL uses the /SSE2 instruction set. This will be a problem for > older computers./ > (2) Last I tried, the 32 bit CCL has a bug that creates one test suite > failure. > > I'd guess the CCL developers would fix (2) if we could isolate the > problem. > Problem (1) is harder--I've been know to use old computers. I have some old machines, but only one does not have sse2. And that machine is so old and slow (1.2 GHz I think) that I don't even want to use it anymore. I need to take it to the Great Computer Recycling Center someday. I'll try to isolate the test suite failure since I do sometimes use 32-bit ccl. Ray From andre.maute at gmx.de Sun Jan 8 17:53:20 2012 From: andre.maute at gmx.de (andre maute) Date: Mon, 09 Jan 2012 00:53:20 +0100 Subject: [Maxima] invert_by_lu does not work as expected Message-ID: <4F0A2C70.2080600@gmx.de> Hi list, I have the following maxima file with output, where a double invocation of invert_by_lu results in an error Regards Andre ----------- matrix_bug.max ---------------- display2d : false; M : matrix([1,0,0],[v[[1,0],[0,0]],1,0],[v[[0,1],[0,0]],v[[0,1],[1,0]],1]); /* works */ Minv : invert(M); Minvinv : invert(invert(M)); /* doesn't work */ Minv : invert_by_lu(M); Minvinv : invert_by_lu(invert_by_lu(M)); ----------- matrix_bug.max ---------------- ----------- matrix_bug.txt ---------------- Maxima 5.24.0 http://maxima.sourceforge.net using Lisp SBCL 1.0.40-1.fc14 Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) batch(matrix_bug.max) read and interpret file: /home/user/matrix_bug.max (%i2) display2d : false (%o2) false (%i3) M:matrix([1,0,0],[v[[1,0],[0,0]],1,0],[v[[0,1],[0,0]],v[[0,1],[1,0]],1]) (%o3) matrix([1,0,0],[v[[1,0],[0,0]],1,0],[v[[0,1],[0,0]],v[[0,1],[1,0]],1]) (%i4) Minv:invert(M) (%o4) matrix([1,0,0],[-v[[1,0],[0,0]],1,0], [v[[0,1],[1,0]]*v[[1,0],[0,0]]-v[[0,1],[0,0]],-v[[0,1],[1,0]],1]) (%i5) Minvinv:invert(invert(M)) (%o5) matrix([1,0,0],[v[[1,0],[0,0]],1,0],[v[[0,1],[0,0]],v[[0,1],[1,0]],1]) (%i6) Minv:invert_by_lu(M) (%o6) matrix([1,0,0],[-v[[1,0],[0,0]],1,0], [v[[0,1],[1,0]]*v[[1,0],[0,0]]-v[[0,1],[0,0]],-v[[0,1],[1,0]],1]) (%i7) Minvinv:invert_by_lu(invert_by_lu(M)) Maxima encountered a Lisp error: The value NIL is not of type CHARACTER. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%o8) "/home/user/matrix_bug.max" ----------- matrix_bug.txt ---------------- -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: matrix_bug.max URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: matrix_bug.txt URL: From rich.hennessy at verizon.net Sun Jan 8 20:35:11 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 08 Jan 2012 21:35:11 -0500 Subject: [Maxima] Difference between area under curve and integrate Message-ID: <4BB43C2CBC7F45F6BC7C2FCC380CF889@RichsLaptop> Hi list, Is there a way to force Maxima to try to find a real solution to an integration problem so that it represents the area under the curve in cases where you get a complex number? Consider, kill(all)$ load(abs_integrate)$ rectform(float(rectform(integrate(exp(-signum(x-1)*x^3),x,-1,2)))); 0.22200130530517 - 1.162123315419017 %i If you plot the integrand it is just a real valued function with a well defined area under it but in this case it gives a complex number for an answer. Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From alserkli at inbox.ru Mon Jan 9 04:53:24 2012 From: alserkli at inbox.ru (Alexander Klimov) Date: Mon, 9 Jan 2012 12:53:24 +0200 Subject: [Maxima] Difference between area under curve and integrate In-Reply-To: <4BB43C2CBC7F45F6BC7C2FCC380CF889@RichsLaptop> References: <4BB43C2CBC7F45F6BC7C2FCC380CF889@RichsLaptop> Message-ID: On Sun, 8 Jan 2012, Richard Hennessy wrote: > Is there a way to force Maxima to try to find a real solution to an > integration problem so that it represents the area under the curve > in cases where you get a complex number? > > Consider, > kill(all)$ > load(abs_integrate)$ > rectform(float(rectform(integrate(exp(-signum(x-1)*x^3),x,-1,2)))); > 0.22200130530517 - 1.162123315419017 %i > > If you plot the integrand it is just a real valued function with a > well defined area under it but in this case it gives a complex > number for an answer. If you want the number there is no point to do symbolic integration: (%i1) quad_qags(exp(-signum(x-1)*x^3),x,-1,2); (%o1) [2.234857932271402, 7.871672202952595e-10, 441, 0] -- Regards, ASK From willisb at unk.edu Mon Jan 9 07:14:56 2012 From: willisb at unk.edu (Barton Willis) Date: Mon, 9 Jan 2012 07:14:56 -0600 Subject: [Maxima] Difference between area under curve and integrate In-Reply-To: <4BB43C2CBC7F45F6BC7C2FCC380CF889@RichsLaptop> References: <4BB43C2CBC7F45F6BC7C2FCC380CF889@RichsLaptop> Message-ID: This is a abs_integrate bug; if you report it, I'll try to fix it. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- To: "Maxima List" From: "Richard Hennessy" Sent by: maxima-bounces at math.utexas.edu Date: 01/08/2012 08:35PM Subject: [Maxima] Difference between area under curve and integrate Hi list, ? Is there a way to force Maxima to try to find a real solution to an integration problem so that it represents the area under the curve in cases where you get a complex number?? ? Consider, kill(all)$ load(abs_integrate)$ rectform(float(rectform(integrate(exp(-signum(x-1)*x^3),x,-1,2)))); 0.22200130530517 - 1.162123315419017 %i ? If you plot the integrand it is just a real valued function with a well defined area under it but in this case it gives a complex number for an answer. ? Rich ? _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From ferriste at gmail.com Mon Jan 9 07:39:09 2012 From: ferriste at gmail.com (Stefano Ferri) Date: Mon, 9 Jan 2012 14:39:09 +0100 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: <4F0A1A49.8020705@gmail.com> References: <4F08C5C6.4070608@gmail.com> <4F0A1A49.8020705@gmail.com> Message-ID: About the problem of ccl and sse2 there was a discussion on the list some time ago, and the solution was to condinue with the distribution of an installer based on gcl (or any lisp with no need for sse2, indeed). This is a problem to think about: users with such old pcs are not so negligible in number (for a statistic, I am one of them with an old Sempron 2800+), moreover I don't see why some users should be excluded if there are other lisps as valid options. Sorry for going OT from the original argument of the discussion. Stefano 2012/1/8 Raymond Toy > On 1/8/12 1:58 PM, Barton Willis wrote: > > maxima-bounces at math.utexas.edu wrote on 01/08/2012 03:39:36 PM: > > > > > >> Sure, but we haven't really done that yet. Ccl seems to work pretty > >> well on Windows and didn't someone already do a windows installer with > >> ccl? Perhaps it's time to drop support for gcl? > > > > Yes, Andrej Vodopivec built a Maxima installer for windows + ccl; see, > > for example: > > http://www.math.utexas.edu/pipermail/maxima/2011/024381.html > > > > Two problems: > > > > (1) CCL uses the /SSE2 instruction set. This will be a problem for > > older computers./ > > (2) Last I tried, the 32 bit CCL has a bug that creates one test suite > > failure. > > > > I'd guess the CCL developers would fix (2) if we could isolate the > > problem. > > Problem (1) is harder--I've been know to use old computers. > > I have some old machines, but only one does not have sse2. And that > machine is so old and slow (1.2 GHz I think) that I don't even want to > use it anymore. I need to take it to the Great Computer Recycling > Center someday. > > I'll try to isolate the test suite failure since I do sometimes use > 32-bit ccl. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From filonenko.mikhail at gmail.com Mon Jan 9 13:58:20 2012 From: filonenko.mikhail at gmail.com (Michael Filonenko) Date: Mon, 9 Jan 2012 21:58:20 +0200 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: References: <4F08C5C6.4070608@gmail.com> Message-ID: Not fully finished, I saw that x86 version is available and supported, and x86_64 is in progress. 2012/1/8 Robert Dodier : > On 1/8/12, Michael Filonenko wrote: > >> sbcl supports all major operating systems. > > Last time I tried SBCL on Windows (a couple of years ago) > it printed some kind of message about "use at your own risk, > the kitten of death awaits" or something like that. > Is SBCL for Windows really finished at this point? (I hope so.) > > best > > Robert Dodier -- With best regards, Michael Filonenko From camm at maguirefamily.org Mon Jan 9 14:02:55 2012 From: camm at maguirefamily.org (Camm Maguire) Date: Mon, 09 Jan 2012 15:02:55 -0500 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: (Raymond Toy's message of "Sun, 08 Jan 2012 13:39:36 -0800") References: <4F08C5C6.4070608@gmail.com> Message-ID: <877h10abkg.fsf@maguirefamily.org> >>> The main issue is if asdf will work with gcl. We still build maxima >>> with gcl, right? That would be a show stopper. >> Greetings! Needless to say, if you need asdf to work on gcl, it will work on gcl. But I'd like to focus my development time on what is being actually used in real applications. Take care, -- Camm Maguire camm at maguirefamily.org ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah From rich.hennessy at verizon.net Mon Jan 9 16:51:02 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Mon, 09 Jan 2012 17:51:02 -0500 Subject: [Maxima] Difference between area under curve and integrate In-Reply-To: References: <4BB43C2CBC7F45F6BC7C2FCC380CF889@RichsLaptop> Message-ID: Done. -----Original Message----- From: Barton Willis Sent: Monday, January 09, 2012 8:14 AM To: rich.hennessy at verizon.net Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Difference between area under curve and integrate This is a abs_integrate bug; if you report it, I'll try to fix it. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- To: "Maxima List" From: "Richard Hennessy" Sent by: maxima-bounces at math.utexas.edu Date: 01/08/2012 08:35PM Subject: [Maxima] Difference between area under curve and integrate Hi list, Is there a way to force Maxima to try to find a real solution to an integration problem so that it represents the area under the curve in cases where you get a complex number? Consider, kill(all)$ load(abs_integrate)$ rectform(float(rectform(integrate(exp(-signum(x-1)*x^3),x,-1,2)))); 0.22200130530517 - 1.162123315419017 %i If you plot the integrand it is just a real valued function with a well defined area under it but in this case it gives a complex number for an answer. Rich _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Mon Jan 9 16:58:18 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Mon, 09 Jan 2012 17:58:18 -0500 Subject: [Maxima] Difference between area under curve and integrate In-Reply-To: References: <4BB43C2CBC7F45F6BC7C2FCC380CF889@RichsLaptop> Message-ID: <06BB8DD3EB0040229C210A31874A4D7F@RichsLaptop> "If you want the number there is no point to do symbolic integration:" Yes, but sometimes you want the solution in exact form. This integral evaluates to gamma_incomplete(1/3,-1)/3-gamma_incomplete(1/3,8)/3 which is an exact form and better than just a number. Except that in this case it is wrong. Rich -----Original Message----- From: Alexander Klimov Sent: Monday, January 09, 2012 5:53 AM To: Richard Hennessy Cc: Maxima List Subject: Re: [Maxima] Difference between area under curve and integrate On Sun, 8 Jan 2012, Richard Hennessy wrote: > Is there a way to force Maxima to try to find a real solution to an > integration problem so that it represents the area under the curve > in cases where you get a complex number? > > Consider, > kill(all)$ > load(abs_integrate)$ > rectform(float(rectform(integrate(exp(-signum(x-1)*x^3),x,-1,2)))); > 0.22200130530517 - 1.162123315419017 %i > > If you plot the integrand it is just a real valued function with a > well defined area under it but in this case it gives a complex > number for an answer. If you want the number there is no point to do symbolic integration: (%i1) quad_qags(exp(-signum(x-1)*x^3),x,-1,2); (%o1) [2.234857932271402, 7.871672202952595e-10, 441, 0] -- Regards, ASK From toy.raymond at gmail.com Mon Jan 9 21:13:06 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 09 Jan 2012 19:13:06 -0800 Subject: [Maxima] Fork of maxima for make it more embeddable. In-Reply-To: <877h10abkg.fsf@maguirefamily.org> References: <4F08C5C6.4070608@gmail.com> <877h10abkg.fsf@maguirefamily.org> Message-ID: <4F0BACC2.6030502@gmail.com> On 1/9/12 12:02 PM, Camm Maguire wrote: >>>> The main issue is if asdf will work with gcl. We still build maxima >>>> with gcl, right? That would be a show stopper. > Greetings! Needless to say, if you need asdf to work on gcl, it will > work on gcl. But I'd like to focus my development time on what is being > actually used in real applications. > Are you saying asdf does not currently work with gcl, but you'll make it work? That would be very nice. I suspect quicklisp does not run with gcl, but we don't really care about that right now as long as gcl can use asdf to build maxima. Ray From willisb at unk.edu Mon Jan 9 22:04:37 2012 From: willisb at unk.edu (Barton Willis) Date: Mon, 9 Jan 2012 22:04:37 -0600 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: <4F0A2C70.2080600@gmx.de> References: <4F0A2C70.2080600@gmx.de> Message-ID: It seems to work for me: (%i10) Minvinv:invert_by_lu(invert_by_lu(M)); (%o10) matrix([1,0,0],[v[[1,0],[0,0]],1,0],[v[[0,1],[0,0]],v[[0,1],[1,0]],1]) (%i11) build_info(); Maxima version: 5.25.0 Maxima build date: 16:14 8/15/2011 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 (%o11) --Barton -----maxima-bounces at math.utexas.edu wrote: ----- To: maxima at math.utexas.edu From: andre maute Sent by: maxima-bounces at math.utexas.edu Date: 01/08/2012 06:00PM Subject: [Maxima] invert_by_lu does not work as expected Hi list, I have the following maxima file with output, where a double invocation of invert_by_lu results in an error Regards Andre ----------- matrix_bug.max ---------------- display2d : false; M : matrix([1,0,0],[v[[1,0],[0,0]],1,0],[v[[0,1],[0,0]],v[[0,1],[1,0]],1]); /* works */ Minv : invert(M); Minvinv : invert(invert(M)); /* doesn't work */ Minv : invert_by_lu(M); Minvinv : invert_by_lu(invert_by_lu(M)); ----------- matrix_bug.max ---------------- ----------- matrix_bug.txt ---------------- Maxima 5.24.0 http://maxima.sourceforge.net using Lisp SBCL 1.0.40-1.fc14 Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) ? ? ? ? ? ? ? ? ? ? ? ?batch(matrix_bug.max) read and interpret file: /home/user/matrix_bug.max (%i2) ? ? ? ? ? ? ? ? ? ? ? ? ?display2d : false (%o2) false (%i3) M:matrix([1,0,0],[v[[1,0],[0,0]],1,0],[v[[0,1],[0,0]],v[[0,1],[1,0]],1]) (%o3) matrix([1,0,0],[v[[1,0],[0,0]],1,0],[v[[0,1],[0,0]],v[[0,1],[1,0]],1]) (%i4) Minv:invert(M) (%o4) matrix([1,0,0],[-v[[1,0],[0,0]],1,0], ?? ? ? ? ? ? ? [v[[0,1],[1,0]]*v[[1,0],[0,0]]-v[[0,1],[0,0]],-v[[0,1],[1,0]],1]) (%i5) Minvinv:invert(invert(M)) (%o5) matrix([1,0,0],[v[[1,0],[0,0]],1,0],[v[[0,1],[0,0]],v[[0,1],[1,0]],1]) (%i6) Minv:invert_by_lu(M) (%o6) matrix([1,0,0],[-v[[1,0],[0,0]],1,0], ?? ? ? ? ? ? ? [v[[0,1],[1,0]]*v[[1,0],[0,0]]-v[[0,1],[0,0]],-v[[0,1],[1,0]],1]) (%i7) Minvinv:invert_by_lu(invert_by_lu(M)) Maxima encountered a Lisp error: ??The value NIL is not of type CHARACTER. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%o8) "/home/user/matrix_bug.max" ----------- matrix_bug.txt ---------------- _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima [attachment "matrix_bug.max" removed by Barton Willis/MATH/UNK/UNEBR] [attachment "matrix_bug.txt" removed by Barton Willis/MATH/UNK/UNEBR] From robert.dodier at gmail.com Tue Jan 10 00:56:16 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 9 Jan 2012 23:56:16 -0700 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: <4F0A2C70.2080600@gmx.de> References: <4F0A2C70.2080600@gmx.de> Message-ID: On 1/8/12, andre maute wrote: > M:matrix([1,0,0],[v[[1,0],[0,0]],1,0],[v[[0,1],[0,0]],v[[0,1],[1,0]],1]) > (%i7) Minvinv:invert_by_lu(invert_by_lu(M)) > Maxima encountered a Lisp error: > > The value NIL is not of type CHARACTER. >From what I can tell, the error is not in invert_by_lu but somewhere downstream from GENSYM-READABLE, which calls AFORMAT and eventually OUTPUT-TEXT*, where it barfs. Unfortunately I can't tell what's going on in the source code (src/mformt.lisp); too much macrology for my tiny brain to comprehend. Oh well. I find that :lisp (defun gensym-readable (x) (gensym)) makes the error go away. Does that work for you? Sorry I can't be more helpful -- Robert Dodier From robert.dodier at gmail.com Tue Jan 10 00:58:07 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 9 Jan 2012 23:58:07 -0700 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: References: <4F0A2C70.2080600@gmx.de> Message-ID: On 1/9/12, Barton Willis wrote: > It seems to work for me: > Lisp implementation type: GNU Common Lisp (GCL) GCL doesn't detect some errors, such as null arguments that aren't supposed to be null. I think that's what's going on here. Maybe that's a consequence of compiling with safety = 0, I don't know. best, Robert Dodier From andre.maute at gmx.de Tue Jan 10 03:08:37 2012 From: andre.maute at gmx.de (andre maute) Date: Tue, 10 Jan 2012 10:08:37 +0100 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: References: <4F0A2C70.2080600@gmx.de> Message-ID: <4F0C0015.2070209@gmx.de> On 01/10/2012 07:56 AM, Robert Dodier wrote: > On 1/8/12, andre maute wrote: > >> M:matrix([1,0,0],[v[[1,0],[0,0]],1,0],[v[[0,1],[0,0]],v[[0,1],[1,0]],1]) >> (%i7) Minvinv:invert_by_lu(invert_by_lu(M)) >> Maxima encountered a Lisp error: >> >> The value NIL is not of type CHARACTER. > > From what I can tell, the error is not in invert_by_lu > but somewhere downstream from GENSYM-READABLE, > which calls AFORMAT and eventually OUTPUT-TEXT*, > where it barfs. Unfortunately I can't tell what's going on > in the source code (src/mformt.lisp); too much macrology > for my tiny brain to comprehend. Oh well. > > I find that > :lisp (defun gensym-readable (x) (gensym)) > makes the error go away. Does that work for you? Yes, thanks for the workaround. Here two slightly smaller test cases, which give the error too. --------------------------------- display2d : false; Minv : matrix([1,0,0],[-v[[1,0],[0,0]],1,0], [v[[0,1],[1,0]]*v[[1,0],[0,0]]-v[[0,1],[0,0]],-v[[0,1],[1,0]],1]); invert_by_lu(Minv); --------------------------------- display2d : false; Minv : matrix([1,0,0],[-v[1,0,0,0],1,0], [v[0,1,1,0]*v[1,0,0,0]-v[0,1,0,0],-v[0,1,1,0],1]); invert_by_lu(Minv); --------------------------------- whereas the following works --------------------------------- display2d : false; Minv : matrix([1,0,0],[-v_1_0_0_0,1,0], [v_0_1_1_0*v_1_0_0_0-v_0_1_0_0,-v_0_1_1_0,1]); invert_by_lu(Minv); --------------------------------- Regards Andre From hawe at chefmail.de Sat Jan 7 07:29:41 2012 From: hawe at chefmail.de (Hans W. Hofmann) Date: Sat, 7 Jan 2012 13:29:41 +0000 (UTC) Subject: [Maxima] find integer Message-ID: Hi, I want to find values x to make [p1=-(4*x-300)/11,p2=-(35*x-1800)/44] p1 and p2 integer. How to do this in maxima? Gr??e HW From aleksasd873 at gmail.com Sat Jan 7 07:45:05 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Sat, 7 Jan 2012 15:45:05 +0200 Subject: [Maxima] evaluating products?? Message-ID: This work fine (%i1) s(n):=prod(f(k),k,1,n)$ (%i2) s(3); (%o2) f(1)*f(2)*f(3) (%i3) build_info()$ Maxima version: 5.25.1 Maxima build date: 9:23 9/6/2011 Host type: i686-pc-mingw32 Lisp implementation type: Clozure Common Lisp Lisp implementation version: Version 1.7-r14925M (WindowsX8632) Aleksas D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From paratribulations at free.fr Sun Jan 8 03:24:49 2012 From: paratribulations at free.fr (TP) Date: Sun, 08 Jan 2012 10:24:49 +0100 Subject: [Maxima] dyadic/vector package by Michael Wirth Message-ID: <104ot8-9ss.ln1@rama.fbx.proxad.net> Hello, I am looking for powerful vector (and possibly dyadic) CAS capabilities, *without introducing components*. Look at the following article: http://www.apmaths.uwo.ca/~djeffrey/Offprints/LJcalculemus.pdf In the interesting state-of-the-art part of this article, the authors mention a Macsyma package, which is the work of Stoutemeyer, described in: [12]. Stoutemyer, D.R., 1979. Symbolic computer vector analysis. Computers & Mathematics with Applications, 5, 1-9. It seems that David Stoutemyer contributes to this newsgroup from time to time. The package mentioned in [12] seems to be vect.mac. Can you confirm? $ head share/vector/vect.mac /*-*-MACSYMA-*-*/ eval_when(batch,ttyoff:true)$ /* Or use the BATCHLOAD command to load this with TTYOFF:TRUE */ /* NOTE: THE CURRENT VERSION OF VECT IS THE ONE DUE TO STOUTEMYER. IT WILL BE REPLACED SOON BY AN EXTENDED VERSION WHICH HANDLES BOTH VECTORS AND DYADICS. MICHAEL C. WIRTH (MCW) 12/18/78 So, this package should have been superseded by the work of Michael Wirth, described in the following article: SIAM J. Comput. 8, pp. 306-319 Symbolic Vector and Dyadic Analysis Michael C. Wirth http://epubs.siam.org/sicomp/resource/1/smjcat/v8/i3/p306_s1?isAuthorized=no By looking in the source code of Macsyma, I find only one mention of Michael Wirth: $ grep -ril "wirth" * share/vector/vect.mac share/vector/vect.usg Has the package of Wirth ever been commited? What happened exactly? Thanks in advance, TP From aleksasd873 at gmail.com Sun Jan 8 04:38:17 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Sun, 8 Jan 2012 12:38:17 +0200 Subject: [Maxima] The definite integral Message-ID: The definite integral A.Domarkas Example (%i1) S:'integrate(exp(x^4),x,0,1); (%o1) integrate(%e^x^4,x,0,1) (%i2) changevar(S, x=y^(1/4), y, x); "Is "x" positive, negative, or zero?"p; (%o2) integrate(%e^y/y^(3/4),y,0,1)/4 Symbolic solution: (%i3) s_sol:ev(%, nouns),factor; (%o3) ((-1)^(3/4)*(gamma_incomplete(1/4,-1)-gamma(1/4)))/4 Numeric solution: (%i4) float(s_sol),expand; (%o4) -.8989357327127359*(-1)^(3/4)*%i-.8989357327127361*(-1)^(3/4) (%i5) rectform(%); (%o5) 1.797871465425472/sqrt(2)-(2.220446049250313*10^-16*%i)/sqrt(2) (%i6) n_sol:float(realpart(%)); (%o6) 1.271287104904147 Test of solution with quad_qags: (%i7) first(quad_qags(exp(x^4), x, 0, 1)); (%o7) 1.271287104904147 (%i8) %-n_sol; (%o8) 2.220446049250313*10^-16 Direct short solution wrong: (%i9) integrate(exp(x^4),x,0,1); (%o9) (%i*((-1)^(3/4)*gamma_incomplete(1/4,-1)-(-1)^(3/4)*gamma(1/4)))/4 (%i10) float(%),expand; (%o10) .8989357327127359*(-1)^(3/4)-.8989357327127361*(-1)^(3/4)*%i (%i11) rectform(%); (%o11) (1.797871465425472*%i)/sqrt(2)+(2.220446049250313*10^-16)/sqrt(2) (%i12) float(realpart(%)); (%o12) 1.570092458683775*10^-16 In a similar way you can find other integrals integrate(exp(x^k),x,0,1), integrate(exp(-x^k),x,0,1). (%i13) build_info()$ Maxima version: 5.26.0 Maxima build date: 18:42 12/19/2011 Host type: i686-pc-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.50.0.debian Conclusion: Full solution of the problem must include: a) show steps (perhaps by hand) b) test of solution(numeric, other solving way, other CAS) Direct short solution of the problem is bad for the following reasons: a) pedagogically incorrect b) may be wrong c) may be fail Aleksas D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From asau at inbox.ru Sun Jan 8 14:00:20 2012 From: asau at inbox.ru (Aleksej Saushev) Date: Mon, 09 Jan 2012 00:00:20 +0400 Subject: [Maxima] Fork of maxima for make it more embeddable. References: <4F08C5C6.4070608@gmail.com> Message-ID: <87r4zax8vf.fsf@inbox.ru> Michael Filonenko writes: > 2012/1/8 Raymond Toy : >> On 1/7/12 1:16 PM, Robert Dodier wrote: >>> About your project to create a Quicklisp-able Maxima, I think that >>> is a valuable goal, and I'm 100% in favor of you (or anyone) >>> creating their own projects based on Maxima. That said, since >>> you have changed the build system a lot, I am hesitant to >>> merge those changes into Maxima. I am no big fan of defsystem, >>> but changing the build system could affect people who are >>> building packages or installations. >> I haven't tried it, but I think using asdf instead of defsystem to build >> maxima shouldn't be very hard. ?Switching the existing defsystems to >> asdf shouldn't be too hard either since the basic syntax is pretty much >> compatible. >> >> The main issue is if asdf will work with gcl. ? We still build maxima >> with gcl, right? ?That would be a show stopper. > > sbcl supports all major operating systems. Except that it doesn't support some of them well enough. (That GCL is even worse in this respect is another issue.) -- HE CE3OH... From fatmarauder at gmail.com Sun Jan 8 15:39:04 2012 From: fatmarauder at gmail.com (Steve Stevenson) Date: Sun, 8 Jan 2012 16:39:04 -0500 Subject: [Maxima] Is there a Chrome app interfacing to Maxima? Message-ID: I'm teaching a software development class this semester. One of the things I thought would make a good project was to make an app for Chrome to interface with Maxima. Has this been done? If it has, I'll find another project. -- D. E. (Steve) Stevenson, Associate Professor Director, Institute for Modeling and Simulation Applications. Clemson University steve at clemson dot edu Anyone who has ever looked into the glazed eyes of a soldier dying on the battlefield will think hard before starting a war. -Otto von Bismarck, statesman (1815-1898) -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleksasd873 at gmail.com Mon Jan 9 03:17:34 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Mon, 9 Jan 2012 11:17:34 +0200 Subject: [Maxima] (no subject) Message-ID: from http://www.math.utexas.edu/pipermail/maxima/2012/027370.html Problem. Compute inntegrate(f,x,-1,2), where (%i1) f:exp(-signum(x-1)*x^3); (%o1) %e^(-x^3*signum(x-1)) Solving with step by step and test: (%i2) wxplot2d([f], [x,-1,2])$ (%t2) << Graphics >> Let integrate(f,x,-1,2)= integrate(f,x,-1,0)+integrate(f,x,0,1)+integrate(f,x,1,2)= S1+S2+S3 (%i3) S1:'integrate(exp(x^3),x,-1,0); (%o3) integrate(%e^x^3,x,-1,0) (%i4) ev(%, nouns); (%o4) (gamma(1/3)-gamma_incomplete(1/3,1))/3 (%i5) sol1:float(%); (%o5) 0.807511182139671 (%i6) /* test*/ first(quad_qags(exp(x^3),x,-1,0)); (%o6) 0.807511182139671 (%i7) S2:'integrate(exp(x^3),x,0,1); (%o7) integrate(%e^x^3,x,0,1) (%i8) changevar(S2, y=x^3, y, x); (%o8) ((sqrt(3)*%i-1)*integrate(%e^y/y^(2/3),y,0,1))/6 (%i9) ev(%, nouns); (%o9) ((sqrt(3)*%i-1)*(gamma_incomplete(1/3,-1)-gamma(1/3)))/6 (%i10) expand(float(%)); (%o10) 1.34190441797742-1.4802973661668753*10^-16*%i (%i11) sol2:realpart(%); (%o11) 1.34190441797742 (%i12) /* test*/ first(quad_qags(exp(x^3),x,0,1)); (%o12) 1.34190441797742 Note that integral S2 direct Maxima compute wrong. The correct formula is integrate(exp(x^k),x,0,1)= (gamma(1/k)-gamma_incomplete(1/k,-1))*%e^(-(%i*%pi)/k))/k, where k is natural number. Proof. (%i13) S:'integrate(exp(x^k),x,0,1); (%o13) integrate(%e^x^k,x,0,1) (%i14) assume(k>0)$ declare(k,integer)$ (%i16) changevar(S, y=x^k, y, x); (%o16) integrate(%e^y/y^((k-1)/k),y,0,1)/k (%i17) ev(%, nouns),factor; (%o17) -(gamma_incomplete(1/k,-1)-gamma(1/k))/(k*(-1)^(1/k)) (%i18) subst(-1=polarform(-1),%),ratsimp; (%o18) -((gamma_incomplete(1/k,-1)-gamma(1/k))*%e^(-(%i*%pi)/k))/k q. e. d. (%i19) define(F(k),%); (%o19) F(k):=-((gamma_incomplete(1/k,-1)-gamma(1/k))*%e^(-(%i*%pi)/k))/k Next we compute S2 using this formula: (%i20) F(3); (%o20) -((1/2-(sqrt(3)*%i)/2)*(gamma_incomplete(1/3,-1)-gamma(1/3)))/3 (%i21) float(%),expand; realpart(%); (%o21) 1.34190441797742-3.33066907387547*10^-16*%i (%o22) 1.34190441797742 (%i23) S3:'integrate(exp(-x^3),x,1,2); (%o23) integrate(%e^(-x^3),x,1,2) (%i24) ev(%, nouns); (%o24) (gamma_incomplete(1/3,1)-gamma_incomplete(1/3,8))/3 (%i25) sol3:float(%), numer; (%o25) 0.085442332154205 (%i26) /* test*/ first(quad_qags(exp(-x^3),x,1,2)); (%o26) 0.0854423321542049 Answer: (%i27) ans:sol1+sol2+sol3; (%o27) 2.234857932271296 (%i28) /* test again*/ first(quad_qags(f,x,-1,2)); (%o28) 2.234857932271401 (%i29) build_info()$ Maxima version: 5.25.1 Maxima build date: 9:23 9/6/2011 Host type: i686-pc-mingw32 Lisp implementation type: Clozure Common Lisp Lisp implementation version: Version 1.7-r14925M (WindowsX8632) Aleksas Domarkas -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleksasd873 at gmail.com Mon Jan 9 04:10:18 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Mon, 9 Jan 2012 12:10:18 +0200 Subject: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) Message-ID: About computing integral integrate(exp(-x^k),x,0,1) A.Domarkas The correct formula is integrate(exp(x^k),x,0,1)=(gamma(1/k)-gamma_incomplete(1/k,-1))*%e^(-(%i*%pi)/k))/k, where k is natural number. Proof. (%i13) S:'integrate(exp(x^k),x,0,1); (%o13) integrate(%e^x^k,x,0,1) (%i14) assume(k>0)$ declare(k,integer)$ (%i16) changevar(S, y=x^k, y, x); (%o16) integrate(%e^y/y^((k-1)/k),y,0,1)/k (%i17) ev(%, nouns),factor; (%o17) -(gamma_incomplete(1/k,-1)-gamma(1/k))/(k*(-1)^(1/k)) (%i18) subst(-1=polarform(-1),%),ratsimp; (%o18) -((gamma_incomplete(1/k,-1)-gamma(1/k))*%e^(-(%i*%pi)/k))/k q. e. d. (%i19) define(F(k),%); (%o19) F(k):=-((gamma_incomplete(1/k,-1)-gamma(1/k))*%e^(-(%i*%pi)/k))/k For example, we compute 'integrate(exp(x^3),x,0,1) using this formula: (%i20) F(3); (%o20) -((1/2-(sqrt(3)*%i)/2)*(gamma_incomplete(1/3,-1)-gamma(1/3)))/3 (%i21) float(%),expand; realpart(%); (%o21) 1.34190441797742-3.33066907387547*10^-16*%i (%o22) 1.34190441797742 (%i22) /* test*/ first(quad_qags(exp(x^3),x,0,1)); (%o23) 1.34190441797742 Aleksas D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleksasd873 at gmail.com Mon Jan 9 04:49:47 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Mon, 9 Jan 2012 12:49:47 +0200 Subject: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) Message-ID: Sorry, in previous message was formula for integrate(exp(x^k),x,0,1) For integrate(exp(-x^k),x,0,1) formula is more simpler: integrate(exp(-x^k),x,0,1)=(gamma(1/k)-gamma_incomplete(1/k,1))/k, where k is natural number. Proof. (%i1) S:'integrate(exp(-x^k),x,0,1); (%o1) integrate(%e^(-x^k),x,0,1) (%i2) assume(k>0)$ declare(k,integer)$ (%i4) changevar(S, y=x^k, y, x); (%o4) integrate(%e^(-y)/y^((k-1)/k),y,0,1)/k (%i5) ev(%, nouns),factor; (%o5) -(gamma_incomplete(1/k,1)-gamma(1/k))/k (%i6) subst(-1=polarform(-1),%),ratsimp; (%o6) -(gamma_incomplete(1/k,1)-gamma(1/k))/k q. e. d. (%i7) define(F(k),%); (%o7) F(k):=-(gamma_incomplete(1/k,1)-gamma(1/k))/k For example, we compute integral, if k=3 or k=4. (%i8) F(3); (%o8) -(gamma_incomplete(1/3,1)-gamma(1/3))/3 (%i9) float(%), numer; (%o9) 0.807511182139671 (%i10) /* test*/ first(quad_qags(exp(-x^3),x,0,1)); (%o10) 0.807511182139671 (%i11) F(4); (%o11) -(gamma_incomplete(1/4,1)-gamma(1/4))/4 (%i12) float(%), numer; (%o12) 0.844838594757102 (%i13) /* test*/ first(quad_qags(exp(-x^4),x,0,1)); (%o13) 0.844838594757102 Aleksas D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleksasd873 at gmail.com Mon Jan 9 13:28:47 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Mon, 9 Jan 2012 21:28:47 +0200 Subject: [Maxima] Difference between area under curve and integrate Message-ID: from http://www.math.utexas.edu/pipermail/maxima/2012/027370.html Problem. Compute inntegrate(f,x,-1,2), where (%i1) f:exp(-signum(x-1)*x^3); (%o1) %e^(-x^3*signum(x-1)) More shorter solution: (%i2) wxplot2d([f], [x,-1,2])$ (%t2) << Graphics >> Let integrate(f,x,-1,2)= integrate(f,x,-1,0)+integrate(f,x,0,1)+integrate(f,x,1,2) (%i3) integrate(f,x,-1,0)+integrate(f,x,0,1)+integrate(f,x,1,2)$ (%i4) float(%),expand; (%o4) 2.234857932271296-3.33066907387547*10^-16*%i Solution: (%i5) sol:realpart(%); (%o5) 2.234857932271296 (%i6) /* test */ first(quad_qags(f,x,-1,2)); (%o6) 2.234857932271401 Sorry, integrate(exp(x^3),x,0,1) Maxima compute correct. But wrong (%i7) integrate(exp(x^4),x,0,1); (%o7) (%i*((-1)^(3/4)*gamma_incomplete(1/4,-1)-(-1)^(3/4)*gamma(1/4)))/4 (%i8) float(%),expand; (%o8) 0.898935732712736*(-1)^(3/4)-0.898935732712736*(-1)^(3/4)*%i (%i9) float(rectform(%)); (%o9) 1.271287104904147*%i+7.850462293418875*10^-17 (%i10) /* test */ first(quad_qags(exp(x^4),x,0,1)); (%o10) 1.271287104904147 Aleksas D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cfrangos123 at gmail.com Tue Jan 10 06:41:53 2012 From: cfrangos123 at gmail.com (Constantine Frangos) Date: Tue, 10 Jan 2012 14:41:53 +0200 Subject: [Maxima] Double integration. Message-ID: Dear List, Any assistance with using the Maxima function quad_qags() in the following application would be appreciated: (1) I am trying to compute the area of regions in the (X,Y)-plane bounded by lines/curves and am using two nested calls to quad_qags() with the integrand being an indicator-type function ind() defined below. It is not clear where the error is ? (2) I dont know whether it is possible to define an indicator-type function where the constraints specifying the region in the (X,Y)-plane are included in a boolean expression passed to the function, for example, ind2( is(x2>= abs(x1)) and is(x2 <= 3) and ....). Thanks very much. Constantine. (%i136) I:quad_qags(quad_qags(ind(x1,x2),x1,-1,1)[1],x2,-1,1); COERCE-FLOAT-FUN: no such Lisp or Maxima function: s -- an error. To debug this try: debugmode(true); (%i137) ind(x,y) := block( [s], if is(x*x + y*y <= 1) then (s : 1) else (s : 0), return(s) ); From mxue at vroomlab.com Tue Jan 10 09:56:59 2012 From: mxue at vroomlab.com (Michael Xue) Date: Tue, 10 Jan 2012 15:56:59 +0000 (UTC) Subject: [Maxima] Is there a Chrome app interfacing to Maxima? References: Message-ID: Steve Stevenson gmail.com> writes: > > > I'm teaching a software development class this semester. One of the things I thought would make a good project was to make an app for Chrome to interface with Maxima. Has this been done? If it has, I'll find another project. > -- D. E. (Steve) Stevenson, Associate ProfessorDirector, Institute for Modeling and Simulation Applications.Clemson Universitysteve at clemson dot eduAnyone who has ever looked into the glazed eyes of a soldier dying on the battlefield will think hard before starting a war. -Otto von Bismarck, statesman (1815-1898) > > > _______________________________________________ > Maxima mailing list > Maxima math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > do you mean something like: http://www.vroomlab.com click on the calculator-like image. From wilsonjp at gmail.com Tue Jan 10 10:09:59 2012 From: wilsonjp at gmail.com (John Wilson) Date: Tue, 10 Jan 2012 11:09:59 -0500 Subject: [Maxima] Unable to unsubscribe Message-ID: Dear Maxima mailing list administrators, Twice now I've been unsuccessful in unsubscribing; is there a bug in the mailing list as well? My apologies to bother everyone. Sincerely, John -- Dr. John P. Wilson Postdoctoral Researcher Pappin Laboratory of Protein Analysis and Mass Spectrometry Cold Spring Harbor Laboratory ---------- Forwarded message ---------- From: Date: Tue, Jan 10, 2012 at 10:52 AM Subject: You have been unsubscribed from the Maxima mailing list To: wilsonjp at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Jan 10 11:00:37 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 10 Jan 2012 09:00:37 -0800 Subject: [Maxima] find integer In-Reply-To: References: Message-ID: On Sat, Jan 7, 2012 at 5:29 AM, Hans W. Hofmann wrote: > Hi, > > I want to find values x to make > > [p1=-(4*x-300)/11,p2=-(35*x-1800)/44] > > p1 and p2 integer. How to do this in maxima? > > Not sure if this is the best approach, but here is one way. solve(p1=(4*x-300)/11,x) solve(p2=(35*x-1800)/44,x); This gives two equations for x. Make them equal so we get an equation in p1 and p2, where p1 and p2 are integers. This is a Diophantine equation. A Google search shows that someone posted a Diophantine equation solver, but I can't find the code right now. If I do it by hand, I get x = 44*r+64, where r is any integer. This gives p1 = 16*r+4 and p2 = 35*r+10. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From alserkli at inbox.ru Tue Jan 10 11:03:00 2012 From: alserkli at inbox.ru (Alexander Klimov) Date: Tue, 10 Jan 2012 19:03:00 +0200 Subject: [Maxima] Double integration. In-Reply-To: References: Message-ID: On Tue, 10 Jan 2012, Constantine Frangos wrote: > Any assistance with using the Maxima function quad_qags() in the > following application would be appreciated: > > (1) I am trying to compute the area of regions in the (X,Y)-plane > bounded by lines/curves and am using two nested calls to quad_qags() > with the integrand being an indicator-type function ind() > defined below. It is not clear where the error is ? The error is due to your definition of ind. You can do it as follows: (%i1) ind(x,y) := if x*x + y*y <= 1 then 1 else 0$ (%i2) I:quad_qags(quad_qags(ind(x1,x2),x1,-1,1,'epsrel=0.1)[1],x2,-1,1,'epsrel=0.1); (%o2) [3.147364455231505, .06760267083066201, 147, 0] Note that this approch is very roundabout (and takes forever with default epsrel). Instead you can solve(x*x+y*y=1,x); and use a simple integral: (%i4) quad_qags(2*sqrt(1-y^2),y,-1,1); (%o4) [3.141592653589797, 2.000470900043183e-9, 399, 0] -- Regards, ASK From mikael at jetmik.dk Tue Jan 10 15:06:32 2012 From: mikael at jetmik.dk (=?ISO-8859-1?Q?Mikael_Sams=F8e_S=F8rensen?=) Date: Tue, 10 Jan 2012 22:06:32 +0100 Subject: [Maxima] New Maxima equation solver In-Reply-To: <30F7CBCB63B642BBAF4A3C47406ECC4A@edwinc367e16bd> References: <30F7CBCB63B642BBAF4A3C47406ECC4A@edwinc367e16bd> Message-ID: You are right. I just changed the name but not in both places. I would like to help write a new section. What is the format for the help file? best regards Mikael Sams?e S?rensen 2012/1/7 Edwin Woollett : > On Jan. 7, 2012, Mikael Sams?e S?rensen wrote: > -------------------------- > >> I have created a package with a new equation solver for solving >> equations within real numbers. > > --------------------------------- > This looks very interesting. I have not tried it out yet, but > this package might be the basis for a new section of a > revised Ch. 4, Solving Equations (Maxima by Example). > > In the text file description you mention > ?desolvemore > but in the mac code file I only find > ?desolvereal. > Perhaps you changed the name? > > Best Wishes, > > Ted Woollett > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Tue Jan 10 15:55:44 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 10 Jan 2012 16:55:44 -0500 Subject: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) In-Reply-To: References: Message-ID: <608D5B6B8F3F4EF2A6308798453D9193@RichsLaptop> I am aware that this problem can be done by breaking the problem into pieces and doing it that way. The amazing thing is that abs_integrate.mac and pw.mac can usually do it without all of this extra work. You generally only have to call integrate once. Except that in this case both packages get the wrong answer. I think the reason is that the gamma_incomplete() function is evaluated with a negative argument in some place where it does not cancel out (but I am not sure of that.) BTW I am using the new defint.lisp from git, not the one that ships with Maxima 5.25.1. I should have mentioned that. It does not matter in this case which defint.lisp you use. Rich From: Aleksas Domarkas Sent: Monday, January 09, 2012 5:49 AM To: maxima Subject: [Maxima] About computing integral integrate(exp(-x^k),x,0,1) Sorry, in previous message was formula for integrate(exp(x^k),x,0,1) For integrate(exp(-x^k),x,0,1) formula is more simpler: integrate(exp(-x^k),x,0,1)=(gamma(1/k)-gamma_incomplete(1/k,1))/k, where k is natural number. Proof. (%i1) S:'integrate(exp(-x^k),x,0,1); (%o1) integrate(%e^(-x^k),x,0,1) (%i2) assume(k>0)$ declare(k,integer)$ (%i4) changevar(S, y=x^k, y, x); (%o4) integrate(%e^(-y)/y^((k-1)/k),y,0,1)/k (%i5) ev(%, nouns),factor; (%o5) -(gamma_incomplete(1/k,1)-gamma(1/k))/k (%i6) subst(-1=polarform(-1),%),ratsimp; (%o6) -(gamma_incomplete(1/k,1)-gamma(1/k))/k q. e. d. (%i7) define(F(k),%); (%o7) F(k):=-(gamma_incomplete(1/k,1)-gamma(1/k))/k For example, we compute integral, if k=3 or k=4. (%i8) F(3); (%o8) -(gamma_incomplete(1/3,1)-gamma(1/3))/3 (%i9) float(%), numer; (%o9) 0.807511182139671 (%i10) /* test*/ first(quad_qags(exp(-x^3),x,0,1)); (%o10) 0.807511182139671 (%i11) F(4); (%o11) -(gamma_incomplete(1/4,1)-gamma(1/4))/4 (%i12) float(%), numer; (%o12) 0.844838594757102 (%i13) /* test*/ first(quad_qags(exp(-x^4),x,0,1)); (%o13) 0.844838594757102 Aleksas D. -------------------------------------------------------------------------------- _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Tue Jan 10 17:33:08 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 10 Jan 2012 16:33:08 -0700 Subject: [Maxima] New Maxima equation solver In-Reply-To: References: <30F7CBCB63B642BBAF4A3C47406ECC4A@edwinc367e16bd> Message-ID: Maxima documentation files for the built-in reference manual (what's returned by ? at the input prompt) are written in Texinfo. share/template.texi and share/template-standalone.texi are templates you can use. Texinfo is kind of clumsy but it works OK. best Robert Dodier On 1/10/12, Mikael Sams?e S?rensen wrote: > You are right. I just changed the name but not in both places. > I would like to help write a new section. What is the format for the help > file? > > best regards > Mikael Sams?e S?rensen > > 2012/1/7 Edwin Woollett : >> On Jan. 7, 2012, Mikael Sams?e S?rensen wrote: >> -------------------------- >> >>> I have created a package with a new equation solver for solving >>> equations within real numbers. >> >> --------------------------------- >> This looks very interesting. I have not tried it out yet, but >> this package might be the basis for a new section of a >> revised Ch. 4, Solving Equations (Maxima by Example). >> >> In the text file description you mention >> ?desolvemore >> but in the mac code file I only find >> ?desolvereal. >> Perhaps you changed the name? >> >> Best Wishes, >> >> Ted Woollett >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From robert.dodier at gmail.com Tue Jan 10 18:34:49 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 10 Jan 2012 17:34:49 -0700 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: <4F0C0015.2070209@gmx.de> References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> Message-ID: OK, here is an even smaller example which triggers the bug: invert_by_lu (matrix ([v [0]])); The error is caused by a name collision: there is a special variable LB in src/grind.lisp (left bracket for arrays) and apparently the symbol LB in share/linearalgebra/lu.lisp refers to that same variable and clobbers it. Renaming LB in lu.lisp to FOO-LB avoids the error. I would have expected LB in lu.lisp to be a lexical variable; why not? best, Robert Dodier On 1/10/12, andre maute wrote: > On 01/10/2012 07:56 AM, Robert Dodier wrote: >> On 1/8/12, andre maute wrote: >> >>> M:matrix([1,0,0],[v[[1,0],[0,0]],1,0],[v[[0,1],[0,0]],v[[0,1],[1,0]],1]) >>> (%i7) Minvinv:invert_by_lu(invert_by_lu(M)) >>> Maxima encountered a Lisp error: >>> >>> The value NIL is not of type CHARACTER. >> > From what I can tell, the error is not in invert_by_lu >> but somewhere downstream from GENSYM-READABLE, >> which calls AFORMAT and eventually OUTPUT-TEXT*, >> where it barfs. Unfortunately I can't tell what's going on >> in the source code (src/mformt.lisp); too much macrology >> for my tiny brain to comprehend. Oh well. >> >> I find that >> :lisp (defun gensym-readable (x) (gensym)) >> makes the error go away. Does that work for you? > > Yes, thanks for the workaround. > Here two slightly smaller test cases, which give the error too. > --------------------------------- > display2d : false; > Minv : matrix([1,0,0],[-v[[1,0],[0,0]],1,0], > [v[[0,1],[1,0]]*v[[1,0],[0,0]]-v[[0,1],[0,0]],-v[[0,1],[1,0]],1]); > invert_by_lu(Minv); > --------------------------------- > display2d : false; > Minv : matrix([1,0,0],[-v[1,0,0,0],1,0], > [v[0,1,1,0]*v[1,0,0,0]-v[0,1,0,0],-v[0,1,1,0],1]); > invert_by_lu(Minv); > --------------------------------- > > whereas the following works > --------------------------------- > display2d : false; > Minv : matrix([1,0,0],[-v_1_0_0_0,1,0], > [v_0_1_1_0*v_1_0_0_0-v_0_1_0_0,-v_0_1_1_0,1]); > invert_by_lu(Minv); > --------------------------------- > > Regards > Andre > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From rich.hennessy at verizon.net Tue Jan 10 19:25:13 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 10 Jan 2012 20:25:13 -0500 Subject: [Maxima] new defint.lisp and radexpand:false? In-Reply-To: <919F4FE57FBC49248589F3726F28108F@edwinc367e16bd> References: <919F4FE57FBC49248589F3726F28108F@edwinc367e16bd> Message-ID: <592EDD42328D4C55869E9967D8C97CD2@RichsLaptop> integrate(exp(x^n),x,1,2) for odd n gives wrong result too. integrate(exp(x^n),x,-2,-1) for odd n seems okay. integrate(exp(x^n),x,a,b) works for odd n and negative a and b. This might be related to abs_integrate.mac bug. https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3471545&group_id=4933 Rich -----Original Message----- From: Edwin Woollett Sent: Thursday, January 05, 2012 5:05 PM To: maxima mailing list Subject: [Maxima] new defint.lisp and radexpand:false? In the git notes http://maxima.git.sourceforge.net/git/gitweb.cgi?p=maxima/maxima;a=commit;h=883dc433283808ff53d04477c540489273197ea3 for the new version of defint.lisp, Dan Gildea has the comment: ------------- integrate(exp(sqrt(x^3)),x,0,1) no longer gives correct answer unless we specify radexpand:false -------------------------------------- I find (gcl) that the previous version of defint.lisp gives the correct integral with radexpand : true (default). ------------------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) first(quad_qags(exp(sqrt(x^3)),x,0,1)); (%o1) 1.562394062214541 /* v 5.25.1 defint.lisp and radexpand=true */ (%i2) radexpand; (%o2) true (%i3) integrate(exp(sqrt(x^3)),x,0,1); (%o3) -(sqrt(3)*%i+1)*(gamma(2/3)-gamma_incomplete(2/3,-1))/3 (%i4) expand(float(%)); (%o4) 1.562394062217312-4.4408920985006262E-16*%i /* ok except for roundoff errors */ ---------------------------------------------- When I load in the new version of defint.lisp, and leave radexpand : true I get an answer, albeit a wrong answer. But if I set radexpand to false, I only get a noun form. ------------------------------------------------------ (%i5) load("defint-new.lisp"); (%o5) "c:/work2/defint-new.lisp" (%i6) radexpand; (%o6) true /* with new defint.lisp and radexpand=true */ (%i7) integrate(exp(sqrt(x^3)),x,0,1); (%o7) 2*(gamma(2/3)-gamma_incomplete(2/3,-1))/3 (%i8) expand(float(%)); (%o8) 1.353072948602157*%i-0.78119703110866 /* which is a wrong answer as advertised . */ /* now set radexpand to false */ (%i9) radexpand:false$ (%i10) integrate(exp(sqrt(x^3)),x,0,1); (%o10) 'integrate(%e^sqrt(x^3),x,0,1) /* unexpected noun form */ --------------------------------------------------- Ted Woollett _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Tue Jan 10 20:20:53 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 10 Jan 2012 21:20:53 -0500 Subject: [Maxima] new defint.lisp and radexpand:false? In-Reply-To: <592EDD42328D4C55869E9967D8C97CD2@RichsLaptop> References: <919F4FE57FBC49248589F3726F28108F@edwinc367e16bd> <592EDD42328D4C55869E9967D8C97CD2@RichsLaptop> Message-ID: I guess I should show my reasons for my claim. (%i14) kill(all); (%o0) done (%i1) load(defint); (%o1) "C:/Maxima-5.25.1/share/maxima/5.25.1/src/defint.lisp" new defint.lisp (%i2) display2d:false; (%o2) false (%i3) integrate(exp(x^n),x,a,b),a=1,b=2,n=5; (%o3) (gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1))/5 (%i4) rectform(float(%)); (%o4) -6.213553389862085E+11*%i-8.5522225476885498E+11 (%i5) quad_qags(exp(x^n),x,a,b),a=1,b=2,n=5; (%o5) [1.0132394896940184E+12,0.66155076101722,147,0] (%i6) integrate(exp(x^n),x,a,b),a=-1,b=-2,n=5; (%o6) -(gamma_incomplete(1/5,1)-gamma_incomplete(1/5,32))/5 (%i7) rectform(float(%)); (%o7) -0.048094074713868 (%i8) quad_qags(exp(x^n),x,a,b),a=-1,b=-2,n=5; (%o8) [-0.048094074713868,9.9292941840488248E-16,63,0] (%i9) radexpand; (%o9) true (%i10) radexpand:false; (%o10) false (%i11) integrate(exp(x^n),x,a,b),a=1,b=2,n=5; (%o11) (gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1))/5 (%i12) rectform(float(%)); (out12) -6.213553389862085E+11*%i-8.5522225476885498E+11 (%i13) I think the answer should be real in all cases. The integrand is real valued everywhere. Rich -----Original Message----- From: Richard Hennessy Sent: Tuesday, January 10, 2012 8:25 PM To: Edwin Woollett ; maxima mailing list Subject: Re: [Maxima] new defint.lisp and radexpand:false? integrate(exp(x^n),x,1,2) for odd n gives wrong result too. integrate(exp(x^n),x,-2,-1) for odd n seems okay. integrate(exp(x^n),x,a,b) works for odd n and negative a and b. This might be related to abs_integrate.mac bug. https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3471545&group_id=4933 Rich -----Original Message----- From: Edwin Woollett Sent: Thursday, January 05, 2012 5:05 PM To: maxima mailing list Subject: [Maxima] new defint.lisp and radexpand:false? In the git notes http://maxima.git.sourceforge.net/git/gitweb.cgi?p=maxima/maxima;a=commit;h=883dc433283808ff53d04477c540489273197ea3 for the new version of defint.lisp, Dan Gildea has the comment: ------------- integrate(exp(sqrt(x^3)),x,0,1) no longer gives correct answer unless we specify radexpand:false -------------------------------------- I find (gcl) that the previous version of defint.lisp gives the correct integral with radexpand : true (default). ------------------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) first(quad_qags(exp(sqrt(x^3)),x,0,1)); (%o1) 1.562394062214541 /* v 5.25.1 defint.lisp and radexpand=true */ (%i2) radexpand; (%o2) true (%i3) integrate(exp(sqrt(x^3)),x,0,1); (%o3) -(sqrt(3)*%i+1)*(gamma(2/3)-gamma_incomplete(2/3,-1))/3 (%i4) expand(float(%)); (%o4) 1.562394062217312-4.4408920985006262E-16*%i /* ok except for roundoff errors */ ---------------------------------------------- When I load in the new version of defint.lisp, and leave radexpand : true I get an answer, albeit a wrong answer. But if I set radexpand to false, I only get a noun form. ------------------------------------------------------ (%i5) load("defint-new.lisp"); (%o5) "c:/work2/defint-new.lisp" (%i6) radexpand; (%o6) true /* with new defint.lisp and radexpand=true */ (%i7) integrate(exp(sqrt(x^3)),x,0,1); (%o7) 2*(gamma(2/3)-gamma_incomplete(2/3,-1))/3 (%i8) expand(float(%)); (%o8) 1.353072948602157*%i-0.78119703110866 /* which is a wrong answer as advertised . */ /* now set radexpand to false */ (%i9) radexpand:false$ (%i10) integrate(exp(sqrt(x^3)),x,0,1); (%o10) 'integrate(%e^sqrt(x^3),x,0,1) /* unexpected noun form */ --------------------------------------------------- Ted Woollett _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From andrej.vodopivec at gmail.com Wed Jan 11 03:31:29 2012 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Wed, 11 Jan 2012 10:31:29 +0100 Subject: [Maxima] find integer In-Reply-To: References: Message-ID: On Tue, Jan 10, 2012 at 6:00 PM, Raymond Toy wrote: > > > On Sat, Jan 7, 2012 at 5:29 AM, Hans W. Hofmann wrote: >> >> Hi, >> >> I want to find values x to make >> >> [p1=-(4*x-300)/11,p2=-(35*x-1800)/44] >> >> p1 and p2 integer. How to do this in maxima? >> > > Not sure if this is the best approach, but here is one way. > > solve(p1=(4*x-300)/11,x) > solve(p2=(35*x-1800)/44,x); > > This gives two equations for x.? Make them equal so we get an equation in p1 > and p2, where p1 and p2 are integers.? This is a Diophantine equation.? A > Google search shows that someone posted a Diophantine equation solver, but I > can't find the code right now.? If I do it by hand, I get x = 44*r+64, where > r is any integer.? This gives p1 = 16*r+4 and p2 = 35*r+10. > > Ray There is a solve_lde function in the discrete package (https://github.com/andrejv/discrete.mac): (%i2) eliminate([p1=-(4*x-300)/11,p2=-(35*x-1800)/44], [x]); (%o2) [-11*(-16*p2+35*p1-300)] (%i3) solve_lde(%[1]); (%o3) [p1=16*%k1-12,p2=35*%k1-45] (%i4) subst(%, [p1=-(4*x-300)/11,p2=-(35*x-1800)/44]); (%o4) [16*%k1-12=(300-4*x)/11,35*%k1-45=(1800-35*x)/44] (%i5) solve(%[1], x); (%o5) [x=108-44*%k1] (of course %k1 is an integer) Andrej From rswarbrick at gmail.com Wed Jan 11 04:04:41 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Wed, 11 Jan 2012 10:04:41 +0000 Subject: [Maxima] invert_by_lu does not work as expected References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> Message-ID: Robert Dodier writes: > OK, here is an even smaller example which triggers the bug: > invert_by_lu (matrix ([v [0]])); > > The error is caused by a name collision: there is a special > variable LB in src/grind.lisp (left bracket for arrays) > and apparently the symbol LB in share/linearalgebra/lu.lisp > refers to that same variable and clobbers it. > Renaming LB in lu.lisp to FOO-LB avoids the error. > I would have expected LB in lu.lisp to be a lexical variable; why not? > best, Robert Dodier Grepping shows it declared special in src/fortra.lisp. I haven't looked further into why. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From dbmaxima at gmail.com Wed Jan 11 04:50:45 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Wed, 11 Jan 2012 21:50:45 +1100 Subject: [Maxima] need Maxima 5.26 for Windows In-Reply-To: References: Message-ID: <4F0D6985.4000404@gmail.com> On 9/01/2012 4:24 AM, Robert Dodier wrote: > Hi everybody, > > Can someone build a Windows installer for Maxima 5.26 ? > I just looked at the list of files at Sourceforge and I don't see one. > I'd like to make a general announcement about 5.26 (sorry for the delay). I have one that seems OK at http://billinghurst.customer.netspace.net.au/maxima-5.26.0.exe How do I upload it? My sourceforge username is billingd From aleksasd873 at gmail.com Wed Jan 11 02:02:07 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Wed, 11 Jan 2012 10:02:07 +0200 Subject: [Maxima] new defint.lisp and radexpand:false? Message-ID: About integrate(exp(x^n),x,a,b). A.Domarkas We discuss problems from http://www.math.utexas.edu/pipermail/maxima/2012/027403.html Theorem. For any real n>0, a>=0, b>0 integrate(exp(x^n),x,a,b)=((gamma_incomplete(1/n,-a^n)-gamma_incomplete(1/n,-b^n))*%e^(-(%i*%pi)/n))/n Proof. (%i1) S:'integrate(exp(x^n),x)$ (%i2) assume(x>0,y>0,n>0)$ (%i3) changevar(S, x=y^(1/n), y, x); (%o3) integrate(%e^y/y^((n-1)/n),y)/n (%i4) ev(%, nouns); (%o4) -gamma_incomplete(1/n,-y)/(n*(-1)^(1/n)) By Newton-Leibniz formula S is equal (%i5) ev(%,y=b^n)-ev(%,y=a^n)$ (%i6) subst(-1=polarform(-1),%)$ (%i7) define(F(n,a,b),factor(%)); (%o7) F(n,a,b):=-((gamma_incomplete(1/n,-b^n)-gamma_incomplete(1/n,-a^n))*%e^(-(%i*%pi)/n))/n q.e.d. Example 1 We compute integrate(exp(x^5),x,1,2). Exact form of solution is (%i8) F(5,1,2); (%o8) -(%e^(-(%i*%pi)/5)*(gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1)))/5 (%i9) float(rectform(float(%))); (%o9) 1.057112842764948*10^12-9.765625*10^-5*%i (%i10) realpart(%); (%o10) 1.057112842764948*10^12 (%i11) /* test*/ first(quad_qags(exp(x^5),x,1,2)); (%o11) 1.013239489694018*10^12 Maxima float value (%i12) float(gamma_incomplete(1/5,-32)); (%o12) -3.106776694934643*10^12*%i-4.276111273844638*10^12 is is not sufficiently accurate, because from WolframAlpha or Python mpmath module ( http://code.google.com/p/mpmath/ ) Gamma(1/5,-32) ~~ -4.098639833*10^12 - 2.977836145*10^12 I Example 2 We compute integrate(exp(x^5),x,-1,-2): (%i13) S:'integrate(exp(x^5),x,-1,-2)$ (%i14) changevar(%, y=-x, y, x); (%o14) -integrate(%e^(-y^5),y,1,2) (%i15) ev(%, nouns); (%o15) -(gamma_incomplete(1/5,1)-gamma_incomplete(1/5,32))/5 (%i16) float(%), numer; (%o16) -0.0480940747138679 (%i17) /* test*/ first(quad_qags(exp(x^5),x,-1,-2)); (%o17) -0.0480940747138678 Example 3 integrate(exp(x^3),x,0,1); (%i18) F(3,0,1); (%o18) -((1/2-(sqrt(3)*%i)/2)*(gamma_incomplete(1/3,-1)-gamma(1/3)))/3 (%i19) float(%), numer,expand; (%o19) 1.34190441797742-1.4802973661668753*10^-16*%i (%i20) /* test*/ first(quad_qags(exp(x^3),x,0,1)); (%o20) 1.34190441797742 Example 4 integrate(exp(x^(3.5)),x,0,1); (%i21) F(3.5,0,1); (%o21) -0.285714285714286*(-3.564215493727561*%i-2.84236700849009)*%e^(-0.285714285714286*%i*%pi) (%i22) float(%), numer,expand; (%o22) 1.302515064637093-1.2688263138573217*10^-16*%i (%i23) F(7/2,0,1); (%o23) -(2*%e^(-(2*%i*%pi)/7)*(gamma_incomplete(2/7,-1)-gamma(2/7)))/7 (%i24) float(%), numer,expand; (%o24) 1.302515064637093-1.2688263138573217*10^-16*%i (%i25) /* test*/ first(quad_qags(exp(x^(7/2)),x,0,1)); (%o25) 1.302515064637389 Example 5 integrate(exp(x^4,x,0,1); (%i26) F(4,0,1); (%o26) -((1/sqrt(2)-%i/sqrt(2))*(gamma_incomplete(1/4,-1)-gamma(1/4)))/4 (%i27) float(%), numer,expand; (%o27) 1.271287104904147 (%i28) /* test*/ first(quad_qags(exp(x^4),x,0,1)); (%o28) 1.271287104904147 (%i29) build_info()$ Maxima version: 5.25.1 Maxima build date: 9:23 9/6/2011 Host type: i686-pc-mingw32 Lisp implementation type: Clozure Common Lisp Lisp implementation version: Version 1.7-r14925M (WindowsX8632) Aleksas D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Wed Jan 11 05:13:47 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Wed, 11 Jan 2012 11:13:47 +0000 Subject: [Maxima] invert_by_lu does not work as expected References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> Message-ID: Rupert Swarbrick writes: >> OK, here is an even smaller example which triggers the bug: >> invert_by_lu (matrix ([v [0]])); >> >> The error is caused by a name collision: there is a special >> variable LB in src/grind.lisp (left bracket for arrays) >> and apparently the symbol LB in share/linearalgebra/lu.lisp >> refers to that same variable and clobbers it. >> Renaming LB in lu.lisp to FOO-LB avoids the error. >> I would have expected LB in lu.lisp to be a lexical variable; why not? >> best, Robert Dodier > > Grepping shows it declared special in src/fortra.lisp. I haven't looked > further into why. > > Rupert The attached patch fixes this problem. Indeed, grepping further showed that there were name collisions in quite a few places (lb stands for "left bracket", "limit B" and "lower bound" it seems). Note that the patch updates share/numeric/cfortr.lisp to follow the new names, but that file is not going to load on any modern lisp implementation without some serious changes. I would include a new testsuite test, but I don't think I can work out how because grind() works by printing a string (and returns false!). Comments? Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Rename-lb-and-rb-special-variables-in-src-grind.lisp.patch Type: text/x-diff Size: 12058 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From dbmaxima at gmail.com Wed Jan 11 05:42:06 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Wed, 11 Jan 2012 22:42:06 +1100 Subject: [Maxima] need Maxima 5.26 for Windows In-Reply-To: <4F0D6985.4000404@gmail.com> References: <4F0D6985.4000404@gmail.com> Message-ID: <4F0D758E.9020002@gmail.com> On 11/01/2012 9:50 PM, David Billinghurst wrote: > On 9/01/2012 4:24 AM, Robert Dodier wrote: >> Hi everybody, >> >> Can someone build a Windows installer for Maxima 5.26 ? >> I just looked at the list of files at Sourceforge and I don't see one. >> I'd like to make a general announcement about 5.26 (sorry for the >> delay). > > I have one that seems OK at > http://billinghurst.customer.netspace.net.au/maxima-5.26.0.exe > > How do I upload it? My sourceforge username is billingd This is broken. The describe command doesn't work. I will investigate as time allows. From robert.dodier at gmail.com Wed Jan 11 10:39:32 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 11 Jan 2012 09:39:32 -0700 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> Message-ID: On 1/11/12, Rupert Swarbrick wrote: > Grepping shows it declared special in src/fortra.lisp. I haven't looked > further into why. Well, the Fortran code changes the usual [ ] for array subscripts to ( ), that's why LB and RB are special. Thanks for sending the patch, but I've taken the simpler approach of just changing LB and RB to *LB* and *RB*, respectively; to the extent that other stuff changes, it makes it harder to see what is the purpose of the patch. What puzzles me about this problem is that LB is used in a lexical binding in share/linearalgebra/lu.lisp, but it affects the special variable by the same name -- I thought a declaration would be required in lu.lisp to cause that. What's going on there? best, Robert Dodier From rswarbrick at gmail.com Wed Jan 11 11:38:25 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Wed, 11 Jan 2012 17:38:25 +0000 Subject: [Maxima] invert_by_lu does not work as expected References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> Message-ID: Robert Dodier writes: > On 1/11/12, Rupert Swarbrick wrote: > >> Grepping shows it declared special in src/fortra.lisp. I haven't looked >> further into why. > > Well, the Fortran code changes the usual [ ] for array subscripts > to ( ), that's why LB and RB are special. > > Thanks for sending the patch, but I've taken the simpler approach > of just changing LB and RB to *LB* and *RB*, respectively; > to the extent that other stuff changes, it makes it harder to see > what is the purpose of the patch. > > What puzzles me about this problem is that LB is used in a > lexical binding in share/linearalgebra/lu.lisp, but it affects the > special variable by the same name -- I thought a declaration > would be required in lu.lisp to cause that. What's going on there? No, I don't think so. Consider the following: (defun print-to-stdout (x) (princ x *standard-output*)) (with-output-to-string (*standard-output*) (print-to-stdout "Hello world") (values)) More convoluted and more similar to the original: (with-output-to-string (strm) (let ((*standard-output* strm)) (print-to-stdout "Hello world") (values))) has the same effect. I've just been staring at CLHS and can't find the relevant passage unfortunately. I think I want to say something like "LET binds a variable X to a new lexical binding, unless it already had a dynamic binding in which case it binds it dynamically", but I'm not sure where to look. Re the patch, part of the reason I renamed the variables was to make the names more unambiguous. Maybe at least a docstring on the two defvars would be nice? Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From rswarbrick at gmail.com Wed Jan 11 11:44:24 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Wed, 11 Jan 2012 17:44:24 +0000 Subject: [Maxima] invert_by_lu does not work as expected References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> Message-ID: Rupert Swarbrick writes: > (defun print-to-stdout (x) (princ x *standard-output*)) > > (with-output-to-string (*standard-output*) > (print-to-stdout "Hello world") > (values)) > > More convoluted and more similar to the original: > > (with-output-to-string (strm) > (let ((*standard-output* strm)) > (print-to-stdout "Hello world") > (values))) > > has the same effect. I've just been staring at CLHS and can't find the > relevant passage unfortunately. I think I want to say something like > "LET binds a variable X to a new lexical binding, unless it already had > a dynamic binding in which case it binds it dynamically", but I'm not > sure where to look. Of course, I found the passage I was looking for just after sending the email. In the documentation for DECLARE: When used in a proclamation, a special declaration specifier applies to all bindings as well as to all references of the mentioned variables. For example, after (declaim (special x)) then in a function definition such as (defun example (x) ...) the parameter x is bound as a dynamic variable rather than as a lexical variable. Ta-Da! Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From woollett at charter.net Wed Jan 11 12:21:25 2012 From: woollett at charter.net (Edwin Woollett) Date: Wed, 11 Jan 2012 10:21:25 -0800 Subject: [Maxima] new defint.lisp bug - was: new defint.lisp and radexpand:false? Message-ID: <1E2DD2D53F7844A9912495644840333E@edwinc367e16bd> On Jan. 10, 2012, Richard Hennessy wrote: ------------------------- >integrate(exp(x^n),x,1,2) for odd n gives wrong result too. ----------------------------------------------------- Here is an example which starts with the current 5.25.1 defint.lisp, resulting in a wrong answer, then we load in the new improved defint.lisp, which results in the same wrong answer (as is obvious since the symbolic definite integral is the same expression as a function of gamma_incomplete). --------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) radexpand; (%o1) true (%i2) quad_qags(exp(x^5),x,1,2); (%o2) [1.0132394896940184E+12,0.66155076101722,147,0] (%i3) integrate(exp(x^5),x,1,2); (%o3) (gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1))/5 (%i4) expand(float(%)); (%o4) -6.213553389862085E+11*%i-8.5522225476885498E+11 (%i5) load("defint-new.lisp"); (%o5) "c:/work2/defint-new.lisp" (%i6) integrate(exp(x^5),x,1,2); (%o6) (gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1))/5 (%i7) expand(float(%)); (%o7) -6.213553389862085E+11*%i-8.5522225476885498E+11 --------------------------------- Ted From woollett at charter.net Wed Jan 11 12:36:21 2012 From: woollett at charter.net (Edwin Woollett) Date: Wed, 11 Jan 2012 10:36:21 -0800 Subject: [Maxima] new defint.lisp bug - was: new defint.lisp and radexpand:false? Message-ID: On Jan. 11, 2012, I wrote: -------------------------- >Here is an example which starts with the current >5.25.1 defint.lisp, resulting in a wrong answer, ------------------------- To demonstrate that the wrong answer is not due to insufficient precision in the numerical work, I use mfloat(expr, ndigits), previously discussed on the list, which goes for an answer accurate to ndigits using bfloat methods. -------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) mfloat1(ex,ndigits) := block([fpprec:16,old,new,kk,small,goodans:false], small:bfloat(10^(-(ndigits+1))), old : expand(bfloat(ex)), for kk:2 thru 10 do (new:realpart(block([fpprec:kk*10],expand(bfloat(ex)))), if abs(new-old) < small then (goodans:true,return()), old:new), if not goodans then false else if not numberp(new) then false else float(new))$ (%i2) mfloat(expr,mdigits):= block([er,ei,err], er : realpart(expr), err : mfloat1(er,mdigits), if not complex_number_p(err) then (print(" realpart not evaluated"), return(false)), if expand(expr - er) = 0 then err else (ei : imagpart(expr), ei : mfloat1(ei,mdigits), if not complex_number_p(ei) then (print(" imagpart not evaluated"), return(false)), err + %i*ei))$ (%i3) quad_qags(exp(x^5),x,1,2); (%o3) [1.0132394896940184E+12,0.66155076101722,147,0] (%i4) i1: integrate(exp(x^5),x,1,2); (%o4) (gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1))/5 (%i5) mfloat(i1,15); (%o5) -5.9556722908249524E+11*%i-8.1972796653426025E+11 ---------------------------- Ted From fateman at eecs.berkeley.edu Wed Jan 11 12:47:27 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 11 Jan 2012 10:47:27 -0800 Subject: [Maxima] new defint.lisp bug - was: new defint.lisp and radexpand:false? In-Reply-To: <1E2DD2D53F7844A9912495644840333E@edwinc367e16bd> References: <1E2DD2D53F7844A9912495644840333E@edwinc367e16bd> Message-ID: <4F0DD93F.4010405@eecs.berkeley.edu> I've been ignoring this, so far. But... On 1/11/2012 10:21 AM, Edwin Woollett wrote:... ... > (%i3) integrate(exp(x^5),x,1,2); > (%o3) (gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1))/5 for what it is worth, Mathematica 7 returns 1/5 (-1)^(4/5) (Gamma[1/5, -32] - Gamma[1/5, -1])} Notice the factor of (-1)^(4/5). From tomdean at speakeasy.org Wed Jan 11 13:36:25 2012 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Wed, 11 Jan 2012 11:36:25 -0800 Subject: [Maxima] new defint.lisp bug - was: new defint.lisp and radexpand:false? In-Reply-To: <4F0DD93F.4010405@eecs.berkeley.edu> References: <1E2DD2D53F7844A9912495644840333E@edwinc367e16bd> <4F0DD93F.4010405@eecs.berkeley.edu> Message-ID: <1326310585.15514.8.camel@asus> On Wed, 2012-01-11 at 10:47 -0800, Richard Fateman wrote: > integrate(exp(x^5),x,1,2); Maple returns -1/5*(-1)^(4/5)*( (x*(-1)^(1/5)*Pi*csc(Pi/5))/(gamma(4/5)*(-x^5)^(1/5)) - (x*(-1)^(1/5)*gamma(1/5,-x^5))/((-x^5)^(1/5)) ); gamma(m,n) is the incomplete gamma function Tom Dean From william.wood3 at comcast.net Wed Jan 11 14:55:01 2012 From: william.wood3 at comcast.net (Bill Wood) Date: Wed, 11 Jan 2012 14:55:01 -0600 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> Message-ID: <1326315301.1548.19.camel@ubuntu> On Wed, 2012-01-11 at 17:38 +0000, Rupert Swarbrick wrote: . . . > has the same effect. I've just been staring at CLHS and can't find the > relevant passage unfortunately. I think I want to say something like > "LET binds a variable X to a new lexical binding, unless it already had > a dynamic binding in which case it binds it dynamically", but I'm not > sure where to look. This from the CLHS entry for "Declaration Special" may be relevant (the part after my elipsis is to the point): A special declaration does not affect inner bindings of a var; the inner bindings implicitly shadow a special declaration and must be explicitly re-declared to be special. special declarations never apply to function bindings. . . . When used in a proclamation, a special declaration specifier applies to all bindings as well as to all references of the mentioned variables. For example, after (declaim (special x)) then in a function definition such as (defun example (x) ...) the parameter x is bound as a dynamic variable rather than as a lexical variable. ============================================================== Section 5.2.2, "Lambda Expressions", pg. 77 of CLtL2 has this to say about binding of required parameters of the lambda list of a lambda expression when it is applied to arguments: Here, and in general, the parameter is bound as a lexical variable unless a declaration has been made that it should be a special binding. See defvar, proclaim, and declare. ============================================================== It would seem that some but not all special declarations can override the default bindings of a variable as lexical. -- Bill Wood From rich.hennessy at verizon.net Wed Jan 11 16:24:04 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Wed, 11 Jan 2012 17:24:04 -0500 Subject: [Maxima] new defint.lisp bug - was: new defint.lisp and radexpand:false? In-Reply-To: <1326310585.15514.8.camel@asus> References: <1E2DD2D53F7844A9912495644840333E@edwinc367e16bd> <4F0DD93F.4010405@eecs.berkeley.edu> <1326310585.15514.8.camel@asus> Message-ID: <9FD0E94CB3A046328098A4DEF1D03034@RichsLaptop> "Theorem. For any real n>0, a>=0, b>0 integrate(exp(x^n),x,a,b)=((gamma_incomplete(1/n,-a^n)-gamma_incomplete(1/n,-b^n))*%e^(-(%i*%pi)/n))/n" I think this may be right but it is not what the new defint.lisp gives. (%i5) kill(all); (%o0) done (%i1) assume(a>0,b>0,b>a,n>0); (%o1) [a > 0,b > 0,b > a,n > 0] (%i2) load(defint); (%o2) "C:/Maxima-5.25.1/share/maxima/5.25.1/src/defint.lisp" (%i3) integrate(exp(x^5),x,a,b); (%o3) (gamma_incomplete(1/5,-b^5)-gamma_incomplete(1/5,-a^5))/5 (%i4) F(n,a,b):=((gamma_incomplete(1/n,-a^n)-gamma_incomplete(1/n,-b^n))*%e^(-(%i*%pi)/n))/n$ (%i5) F(5,a,b); (%o5) %e^-(%i*%pi/5)*(gamma_incomplete(1/5,-a^5)-gamma_incomplete(1/5,-b^5))/5 Which is a new defint.lisp bug if your formula is right. But the calculation is not accurate to enough precision also. (%i8) float(rectform(float(F(5,1,2)))); (%o8) 1.0571128427649482E+12 - 9.7656250000000005E-5 * %i (%i9) taylor(exp(x^5),x,0,1700)$ (%i10) integrate(%,x)$ (%i11) float(at(%,[x=2])-at(%,[x=1])); ($o11) 1.0132394896940182E+12 (%i12) taylor(exp(x^5),x,0,2700)$ (%i13) integrate(%,x)$ (%i14) float(at(%,[x=2])-at(%,[x=1])); (%o14) 1.0132394896940182E+12 Maybe this is a little of both, a lack of precision and a defint.lisp error. FWIW, Rich -----Original Message----- From: Thomas D. Dean Sent: Wednesday, January 11, 2012 2:36 PM To: Richard Fateman Cc: Edwin Woollett ; Maxima - list Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp and radexpand:false? On Wed, 2012-01-11 at 10:47 -0800, Richard Fateman wrote: > integrate(exp(x^5),x,1,2); Maple returns -1/5*(-1)^(4/5)*( (x*(-1)^(1/5)*Pi*csc(Pi/5))/(gamma(4/5)*(-x^5)^(1/5)) - (x*(-1)^(1/5)*gamma(1/5,-x^5))/((-x^5)^(1/5)) ); gamma(m,n) is the incomplete gamma function Tom Dean _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From tomdean at speakeasy.org Wed Jan 11 20:27:37 2012 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Wed, 11 Jan 2012 18:27:37 -0800 Subject: [Maxima] [Maxima} New defint.lisp bug Message-ID: <87ehv5bqp2.fsf@P9X79.tddhome> I tried this integral in Maple 15. > restart;assume(n>0, a>0, b>a); integrate(exp(x^n),x=a..b); b~ / | n~ | exp(x ) dx | / a~ evalc(%); b~ / | | exp(exp(n~ ln(| x |)) cos(n~ (1/2 - 1/2 signum(x)) Pi)) | / a~ cos(exp(n~ ln(| x |)) sin(n~ (1/2 - 1/2 signum(x)) Pi)) dx expand(%); n~ n~ -a~ exp(a~ ) + exp(b~ ) b~ about({a,b,n}); {a, b, n}: is used in the following assumed objects [a] assumed RealRange(Open(0),infinity) [b] assumed real [n] assumed RealRange(Open(0),infinity) [-b+a] assumed RealRange(-infinity,Open(0)) Tom Dean From smh at franz.com Wed Jan 11 22:23:22 2012 From: smh at franz.com (Steve Haflich) Date: Wed, 11 Jan 2012 20:23:22 -0800 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: <1326315301.1548.19.camel@ubuntu> References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> <1326315301.1548.19.camel@ubuntu> Message-ID: <23737.1326342202@gemini.franz.com> Bill Wood wrote: It would seem that some but not all special declarations can overridending is if it ao the default bindings of a variable as lexical. Bill, this imprecise conclusion leaves binding semantics floating in midair. The ANS (often surrogated to the CLHS) wasnd';t intended as expository; it was intended as a specification. (Translation: It isn't easy to understand unless one has studied it in its entirety.) To understand declarations as anything other than magic formulae, you need to read the _entire_ ANS, including the glossary. The thing you are missing is the definition of "declaration", which is: declaration: n. a global declaration or local declaration. These two terms are defined: global declaration: n. a form that makes certain kinds of information about code globally available; that is, a proclaim form or a declaim form. local declaration: n. an expression which may appear only in specially designated positions of certain forms, and which provides information about the code contained within the containing form; that is, a declare expression. It should follow from this (coupled with the specifications for defvar, defparameter, snd defconstant, and the sections on the scoping of declarations) that the only way a declare special declaration can affect the special/lexical nature of a _binding_ form is if that declaration appears at the head of the form that establishes the binding. Proclamations (aka declamations) such as are estabished by the macroexpansions if DEFVAR etc. affect all subsequently-compiled or executed bindings and references. It's a simple as simple as that. See the macroexpansion of a defvar form on your favorite implementation. From cfrangos123 at gmail.com Thu Jan 12 01:33:44 2012 From: cfrangos123 at gmail.com (Constantine Frangos) Date: Thu, 12 Jan 2012 09:33:44 +0200 Subject: [Maxima] Double integration. In-Reply-To: References: Message-ID: Hi Alexander, Thanks for the fast response. Any assistance with the following would be appreciated: (1) Its not clear why the function definition I am using does not work. According to the Maxima 5.24 manual, paragraph 20.4, the integrand can be the name of a Maxima function, presumably defined by the user in a file, for example, integrand.mac (2) Are there perhaps other Maxima numerical integration functions that may perform better ? Thanks very much. Regards, Constantine. On 1/10/12, Alexander Klimov wrote: > On Tue, 10 Jan 2012, Constantine Frangos wrote: >> Any assistance with using the Maxima function quad_qags() in the >> following application would be appreciated: >> >> (1) I am trying to compute the area of regions in the (X,Y)-plane >> bounded by lines/curves and am using two nested calls to quad_qags() >> with the integrand being an indicator-type function ind() >> defined below. It is not clear where the error is ? > > The error is due to your definition of ind. You can do it as follows: > > (%i1) ind(x,y) := if x*x + y*y <= 1 then 1 else 0$ > (%i2) > I:quad_qags(quad_qags(ind(x1,x2),x1,-1,1,'epsrel=0.1)[1],x2,-1,1,'epsrel=0.1); > (%o2) [3.147364455231505, .06760267083066201, 147, 0] > > Note that this approch is very roundabout (and takes forever with > default epsrel). Instead you can > > solve(x*x+y*y=1,x); > > and use a simple integral: > > (%i4) quad_qags(2*sqrt(1-y^2),y,-1,1); > (%o4) [3.141592653589797, 2.000470900043183e-9, 399, 0] > > -- > Regards, > ASK > From hawe at chefmail.de Thu Jan 12 02:53:15 2012 From: hawe at chefmail.de (Hans W. Hofmann) Date: Thu, 12 Jan 2012 08:53:15 +0000 (UTC) Subject: [Maxima] find integer References: Message-ID: Andrej Vodopivec gmail.com> writes: Great, Thanks for the code... I coded simple loop to get a result find_Integers4x(_L_,_von_,_bis_):=block( makelist(ev(_L_,x=i),i, flatten(makelist(( if map(denom,ev(_L_,x=i))=makelist(1,i,1,length(_L_)) then i else []) ,i,_von_,_bis_)) ))$ (%i5) find_Integers4x([(300-4*x)/11,(1800-35*x)/44],0,150); (%o5) [[20,25],[4,-10],[-12,-45]] Gru? HW From alserkli at inbox.ru Thu Jan 12 04:38:08 2012 From: alserkli at inbox.ru (Alexander Klimov) Date: Thu, 12 Jan 2012 12:38:08 +0200 Subject: [Maxima] Double integration. In-Reply-To: References: Message-ID: Hi. On Thu, 12 Jan 2012, Constantine Frangos wrote: > (1) Its not clear why the function definition I am using does not > work. According to the Maxima 5.24 manual, paragraph 20.4, the > integrand can be the name of a Maxima function, presumably defined by > the user in a file, for example, integrand.mac Your function does not always return a number. Consider your original definition: (%i1) ind(x,y) := block([s],if is(x*x + y*y <= 1) then (s : 1) else (s : 0),return(s))$ Let us see how it works (%i2) trace(ind); (%o2) [ind] If one gives numerical arguments, then your function returns the number which is assigned to "s" (%i3) ind(0,1); 1 Enter ind [0, 1] 1 Exit ind 1 (%o3) 1 but with symbols as arguments nothing is assigned to "s" and thus the function returns just a symbol "s" (%i4) ind(x1,x2); 1 Enter ind [x1, x2] 1 Exit ind s (%o4) s and this is exactly what happens when you use it in integration (%i5) I:quad_qags(quad_qags(ind(x1,x2),x1,-1,1)[1],x2,-1,1); 1 Enter ind [x1, x2] 1 Exit ind s COERCE-FLOAT-FUN: no such Lisp or Maxima function: s -- an error. To debug this try: debugmode(true); > (2) Are there perhaps other Maxima numerical integration functions > that may perform better ? As I said, it is better to > > use a simple integral: > > > > (%i4) quad_qags(2*sqrt(1-y^2),y,-1,1); > > (%o4) [3.141592653589797, 2.000470900043183e-9, 399, 0] the problem with indicators is that while they may be suitable for symbolic manipulations, they are bad functions for Gaussian quadrature rule which is only good if the function is similar to a polynomial. -- Regards, ASK From rswarbrick at gmail.com Thu Jan 12 06:14:08 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Thu, 12 Jan 2012 12:14:08 +0000 Subject: [Maxima] Bug 690510 (problem with display of Taylor series) Message-ID: <87fwflw227.fsf@hake.rswarbrick.dnsalias.com> Hi, I dug in to the cause of bug 690510[1] and attach a patch that fixes it. There's a detailed explanation of what was going wrong at the top of the patch. Is this the right place to send such messages? I would add it to the bug tracker, but Sourceforge doesn't seem to allow me to attach a patch to the bug report (!!!). Rupert Footnotes: [1] https://sourceforge.net/tracker/?func=detail&aid=690510&group_id=4933&atid=104933 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Ignore-factors-of-1-when-displaying-products.patch Type: text/x-diff Size: 1179 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From macrakis at alum.mit.edu Thu Jan 12 10:04:48 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 12 Jan 2012 11:04:48 -0500 Subject: [Maxima] Double integration. In-Reply-To: References: Message-ID: As Alexander says, you don't need the temporary variable etc. Also, if you explicitly quote everything, you are less likely to have bad surprises. Something like this: (%i27) (cnt:0,quad_qags('(quad_qags('(cnt:cnt+1,if x>y then 1 else 0),x,0,1)[1]),y,0,1)); (%o27) [0.49999763949292, 3.4177098928722671E-9, 735, 0] (%i28) cnt; (%o28) 621243 Note the number of function evaluations for a very simple case! Note also that the result is not very accurate, and that the error estimate is way off. I imagine there are better routines for this kind of integration. Obviously in this case it is easy to transform to a single integral (even analytical), but presumably you want to handle more complicated integrands. -s On Thu, Jan 12, 2012 at 05:38, Alexander Klimov wrote: > Hi. > > On Thu, 12 Jan 2012, Constantine Frangos wrote: > > (1) Its not clear why the function definition I am using does not > > work. According to the Maxima 5.24 manual, paragraph 20.4, the > > integrand can be the name of a Maxima function, presumably defined by > > the user in a file, for example, integrand.mac > > Your function does not always return a number. Consider your original > definition: > > (%i1) ind(x,y) := block([s],if is(x*x + y*y <= 1) then (s : 1) else (s : > 0),return(s))$ > > Let us see how it works > > (%i2) trace(ind); > (%o2) [ind] > > If one gives numerical arguments, then your function returns the > number which is assigned to "s" > > (%i3) ind(0,1); > 1 Enter ind [0, 1] > 1 Exit ind 1 > (%o3) 1 > > but with symbols as arguments nothing is assigned to "s" and thus the > function returns just a symbol "s" > > (%i4) ind(x1,x2); > 1 Enter ind [x1, x2] > 1 Exit ind s > (%o4) s > > and this is exactly what happens when you use it in integration > > (%i5) I:quad_qags(quad_qags(ind(x1,x2),x1,-1,1)[1],x2,-1,1); > 1 Enter ind [x1, x2] > 1 Exit ind s > COERCE-FLOAT-FUN: no such Lisp or Maxima function: s > -- an error. To debug this try: debugmode(true); > > > (2) Are there perhaps other Maxima numerical integration functions > > that may perform better ? > > As I said, it is better to > > > > use a simple integral: > > > > > > (%i4) quad_qags(2*sqrt(1-y^2),y,-1,1); > > > (%o4) [3.141592653589797, 2.000470900043183e-9, 399, 0] > > the problem with indicators is that while they may be suitable for > symbolic manipulations, they are bad functions for Gaussian quadrature > rule which is only good if the function is similar to a polynomial. > > -- > Regards, > ASK > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Thu Jan 12 14:28:44 2012 From: woollett at charter.net (Edwin Woollett) Date: Thu, 12 Jan 2012 12:28:44 -0800 Subject: [Maxima] new defint.lisp bug - was: new defint.lisp and radexpand:false? Message-ID: On Jan. 11, 2012, Richard Fateman wrote: ---------------------------------- >> (%i3) integrate(exp(x^5),x,1,2); >> (%o3) (gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1))/5 > >for what it is worth, Mathematica 7 returns > >1/5 (-1)^(4/5) (Gamma[1/5, -32] - Gamma[1/5, -1])} > > >Notice the factor of (-1)^(4/5). ------------------------------------------- This is a very important observation, and explains a difference between Maxima and Mathematica results for these type of integrals. Maxima evaluates the factor (-1)^(4/5) numerically to 1.0, which differs from Mathematica's evaluation (see below). Here I consider a different (but related via a simple change of variables) integral, and compare in detail the results from Maxima and Mathematica (using the Wolfram alpha site). ----------------------------------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) integrate(exp(y)/y^(4/5),y,1,2); (%o1) gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1) /* MMa NIntegrate[Exp[y]/y^(4/5),{y,1,2}] yields (-1)^(4/5)*(Gamma[1/5,-2] - Gamma[1/5,-1]) does not agree with Maxima, since in Mathematica (-1)^(4/5) float value is not 1.0, whereas is does have value 1.0 in Maxima. */ (%i2) expand(float(%o1)); (%o2) -1.951024982232477*%i-2.685355511932373 /* this Maxima float value agrees with the first 14 digits of Mma's N[Gamma[1/5,-2] - Gamma[1/5,-1]] which gives -2.685355511932382... -1.951024982232483... i which translates into -2.685355511932382 - 1.951024982232483*%i */ /* the approximate (real) value of the integral is given by quad_qags */ (%i3) quad_qags(exp(y)/y^(4/5),y,1,2); (%o3) [3.319281956502171,3.6851432533315483E-14,21,0] /* Maxima gives value 1.0 to (-1)^(4/5) */ (%i4) expand(float(-1)^(4/5)); (%o4) 1.0 /* whereas Mathematica gives N[(-1)^(4/5)] ---> -0.8090169943749474... + 0.5877852522924731... i which translates into -0.8090169943749474 + 0.5877852522924731*%i If we multiply this factor by %o2 and expand we get the correct numerical answer to within floating point roundoff errors: */ (%i5) expand((-0.8090169943749474 + 0.5877852522924731*%i)*%o2); (%o5) 4.4408920985006262E-16*%i+3.319281956502161 /* the above was with 5.25.1 defint.lisp. The updated version makes no difference here */ (%i6) load("defint-new.lisp"); (%o6) "c:/work2/defint-new.lisp" (%i7) integrate(exp(y)/y^(4/5),y,1,2); (%o7) gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1) (%i8) expand(float(%)); (%o8) -1.951024982232477*%i-2.685355511932373 -------------------------------------- Ted From rich.hennessy at verizon.net Thu Jan 12 17:04:35 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 12 Jan 2012 18:04:35 -0500 Subject: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? In-Reply-To: References: Message-ID: <15157AEB5DDE4A3393803DDC42AF0988@RichsLaptop> Since maxima does simplify this factor to 1.0 then we could fix that by using the value of polarform(-1) in the answer as suggested by Aleksas. integrate(exp(x^7),x); should give -%e^-(%i*%pi/7)*gamma_incomplete(1/7,-x^7)/7 and integrate(exp(x^5),x); should give -%e^-(%i*%pi/5)*gamma_incomplete(1/5,-x^5)/5 etc . . . That would fix the problem, since Maxima's simplifier does not simplify away the exponential term. Aleksas has already shown the proof but his method will not work in integrate(exp(x^n),x) when n is a known integer. The reason is that Maxima has already converted the (-1) expression to 1. Rich -----Original Message----- From: Edwin Woollett Sent: Thursday, January 12, 2012 3:28 PM To: Richard Fateman Cc: maxima mailing list Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? On Jan. 11, 2012, Richard Fateman wrote: ---------------------------------- >> (%i3) integrate(exp(x^5),x,1,2); >> (%o3) (gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1))/5 > >for what it is worth, Mathematica 7 returns > >1/5 (-1)^(4/5) (Gamma[1/5, -32] - Gamma[1/5, -1])} > > >Notice the factor of (-1)^(4/5). ------------------------------------------- This is a very important observation, and explains a difference between Maxima and Mathematica results for these type of integrals. Maxima evaluates the factor (-1)^(4/5) numerically to 1.0, which differs from Mathematica's evaluation (see below). Here I consider a different (but related via a simple change of variables) integral, and compare in detail the results from Maxima and Mathematica (using the Wolfram alpha site). ----------------------------------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) integrate(exp(y)/y^(4/5),y,1,2); (%o1) gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1) /* MMa NIntegrate[Exp[y]/y^(4/5),{y,1,2}] yields (-1)^(4/5)*(Gamma[1/5,-2] - Gamma[1/5,-1]) does not agree with Maxima, since in Mathematica (-1)^(4/5) float value is not 1.0, whereas is does have value 1.0 in Maxima. */ (%i2) expand(float(%o1)); (%o2) -1.951024982232477*%i-2.685355511932373 /* this Maxima float value agrees with the first 14 digits of Mma's N[Gamma[1/5,-2] - Gamma[1/5,-1]] which gives -2.685355511932382... -1.951024982232483... i which translates into -2.685355511932382 - 1.951024982232483*%i */ /* the approximate (real) value of the integral is given by quad_qags */ (%i3) quad_qags(exp(y)/y^(4/5),y,1,2); (%o3) [3.319281956502171,3.6851432533315483E-14,21,0] /* Maxima gives value 1.0 to (-1)^(4/5) */ (%i4) expand(float(-1)^(4/5)); (%o4) 1.0 /* whereas Mathematica gives N[(-1)^(4/5)] ---> -0.8090169943749474... + 0.5877852522924731... i which translates into -0.8090169943749474 + 0.5877852522924731*%i If we multiply this factor by %o2 and expand we get the correct numerical answer to within floating point roundoff errors: */ (%i5) expand((-0.8090169943749474 + 0.5877852522924731*%i)*%o2); (%o5) 4.4408920985006262E-16*%i+3.319281956502161 /* the above was with 5.25.1 defint.lisp. The updated version makes no difference here */ (%i6) load("defint-new.lisp"); (%o6) "c:/work2/defint-new.lisp" (%i7) integrate(exp(y)/y^(4/5),y,1,2); (%o7) gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1) (%i8) expand(float(%)); (%o8) -1.951024982232477*%i-2.685355511932373 -------------------------------------- Ted _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Thu Jan 12 17:28:45 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 12 Jan 2012 18:28:45 -0500 Subject: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? In-Reply-To: <15157AEB5DDE4A3393803DDC42AF0988@RichsLaptop> References: <15157AEB5DDE4A3393803DDC42AF0988@RichsLaptop> Message-ID: <82C33953E03549ED812A8FE2AE754CB2@RichsLaptop> Actually a more general answer that works for positive and negative x is integrate(exp(x^7),x); (-%e^-(%i*%pi/7)*gamma_incomplete(1/7,-x^7)/7+%e^-(%i*%pi/7)*gamma(1/7)/7+gamma(1/7)/7)*(signum(x)+1)/2 +gamma_incomplete(1/7,-x^7)*(1-signum(x))/14 which is very complicated but more correct. Maybe someone can suggest a better form or we have to fix the -1 problem. Maybe if assume(x>0) should affect the answer. Then integrate would have to check for that. Rich -----Original Message----- From: Richard Hennessy Sent: Thursday, January 12, 2012 6:04 PM To: Edwin Woollett ; Richard Fateman Cc: maxima mailing list ; Aleksas Domarkas Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? Since maxima does simplify this factor to 1.0 then we could fix that by using the value of polarform(-1) in the answer as suggested by Aleksas. integrate(exp(x^7),x); should give -%e^-(%i*%pi/7)*gamma_incomplete(1/7,-x^7)/7 and integrate(exp(x^5),x); should give -%e^-(%i*%pi/5)*gamma_incomplete(1/5,-x^5)/5 etc . . . That would fix the problem, since Maxima's simplifier does not simplify away the exponential term. Aleksas has already shown the proof but his method will not work in integrate(exp(x^n),x) when n is a known integer. The reason is that Maxima has already converted the (-1) expression to 1. Rich -----Original Message----- From: Edwin Woollett Sent: Thursday, January 12, 2012 3:28 PM To: Richard Fateman Cc: maxima mailing list Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? On Jan. 11, 2012, Richard Fateman wrote: ---------------------------------- >> (%i3) integrate(exp(x^5),x,1,2); >> (%o3) (gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1))/5 > >for what it is worth, Mathematica 7 returns > >1/5 (-1)^(4/5) (Gamma[1/5, -32] - Gamma[1/5, -1])} > > >Notice the factor of (-1)^(4/5). ------------------------------------------- This is a very important observation, and explains a difference between Maxima and Mathematica results for these type of integrals. Maxima evaluates the factor (-1)^(4/5) numerically to 1.0, which differs from Mathematica's evaluation (see below). Here I consider a different (but related via a simple change of variables) integral, and compare in detail the results from Maxima and Mathematica (using the Wolfram alpha site). ----------------------------------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) integrate(exp(y)/y^(4/5),y,1,2); (%o1) gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1) /* MMa NIntegrate[Exp[y]/y^(4/5),{y,1,2}] yields (-1)^(4/5)*(Gamma[1/5,-2] - Gamma[1/5,-1]) does not agree with Maxima, since in Mathematica (-1)^(4/5) float value is not 1.0, whereas is does have value 1.0 in Maxima. */ (%i2) expand(float(%o1)); (%o2) -1.951024982232477*%i-2.685355511932373 /* this Maxima float value agrees with the first 14 digits of Mma's N[Gamma[1/5,-2] - Gamma[1/5,-1]] which gives -2.685355511932382... -1.951024982232483... i which translates into -2.685355511932382 - 1.951024982232483*%i */ /* the approximate (real) value of the integral is given by quad_qags */ (%i3) quad_qags(exp(y)/y^(4/5),y,1,2); (%o3) [3.319281956502171,3.6851432533315483E-14,21,0] /* Maxima gives value 1.0 to (-1)^(4/5) */ (%i4) expand(float(-1)^(4/5)); (%o4) 1.0 /* whereas Mathematica gives N[(-1)^(4/5)] ---> -0.8090169943749474... + 0.5877852522924731... i which translates into -0.8090169943749474 + 0.5877852522924731*%i If we multiply this factor by %o2 and expand we get the correct numerical answer to within floating point roundoff errors: */ (%i5) expand((-0.8090169943749474 + 0.5877852522924731*%i)*%o2); (%o5) 4.4408920985006262E-16*%i+3.319281956502161 /* the above was with 5.25.1 defint.lisp. The updated version makes no difference here */ (%i6) load("defint-new.lisp"); (%o6) "c:/work2/defint-new.lisp" (%i7) integrate(exp(y)/y^(4/5),y,1,2); (%o7) gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1) (%i8) expand(float(%)); (%o8) -1.951024982232477*%i-2.685355511932373 -------------------------------------- Ted _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Thu Jan 12 17:36:20 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 12 Jan 2012 18:36:20 -0500 Subject: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? Message-ID: <92B4901587C24839AF27E5062EDEFB17@RichsLaptop> Sorry about the multiple posts but here is my last one. integrate(exp(x^7),x); gamma_incomplete(1/7,-x^7)*(1-signum(x))/14-%e^-(%i*%pi/7)*gamma_incomplete(1/7,-x^7)*(signum(x)+1)/14; This is simpler but it is discontinuous at 0. I can live with that. Rich -----Original Message----- From: Richard Hennessy Sent: Thursday, January 12, 2012 6:28 PM To: Edwin Woollett ; Richard Fateman Cc: maxima mailing list ; Aleksas Domarkas Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? Actually a more general answer that works for positive and negative x is integrate(exp(x^7),x); (-%e^-(%i*%pi/7)*gamma_incomplete(1/7,-x^7)/7+%e^-(%i*%pi/7)*gamma(1/7)/7+gamma(1/7)/7)*(signum(x)+1)/2 +gamma_incomplete(1/7,-x^7)*(1-signum(x))/14 which is very complicated but more correct. Maybe someone can suggest a better form or we have to fix the -1 problem. Maybe if assume(x>0) should affect the answer. Then integrate would have to check for that. Rich -----Original Message----- From: Richard Hennessy Sent: Thursday, January 12, 2012 6:04 PM To: Edwin Woollett ; Richard Fateman Cc: maxima mailing list ; Aleksas Domarkas Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? Since maxima does simplify this factor to 1.0 then we could fix that by using the value of polarform(-1) in the answer as suggested by Aleksas. integrate(exp(x^7),x); should give -%e^-(%i*%pi/7)*gamma_incomplete(1/7,-x^7)/7 and integrate(exp(x^5),x); should give -%e^-(%i*%pi/5)*gamma_incomplete(1/5,-x^5)/5 etc . . . That would fix the problem, since Maxima's simplifier does not simplify away the exponential term. Aleksas has already shown the proof but his method will not work in integrate(exp(x^n),x) when n is a known integer. The reason is that Maxima has already converted the (-1) expression to 1. Rich -----Original Message----- From: Edwin Woollett Sent: Thursday, January 12, 2012 3:28 PM To: Richard Fateman Cc: maxima mailing list Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? On Jan. 11, 2012, Richard Fateman wrote: ---------------------------------- >> (%i3) integrate(exp(x^5),x,1,2); >> (%o3) (gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1))/5 > >for what it is worth, Mathematica 7 returns > >1/5 (-1)^(4/5) (Gamma[1/5, -32] - Gamma[1/5, -1])} > > >Notice the factor of (-1)^(4/5). ------------------------------------------- This is a very important observation, and explains a difference between Maxima and Mathematica results for these type of integrals. Maxima evaluates the factor (-1)^(4/5) numerically to 1.0, which differs from Mathematica's evaluation (see below). Here I consider a different (but related via a simple change of variables) integral, and compare in detail the results from Maxima and Mathematica (using the Wolfram alpha site). ----------------------------------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) integrate(exp(y)/y^(4/5),y,1,2); (%o1) gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1) /* MMa NIntegrate[Exp[y]/y^(4/5),{y,1,2}] yields (-1)^(4/5)*(Gamma[1/5,-2] - Gamma[1/5,-1]) does not agree with Maxima, since in Mathematica (-1)^(4/5) float value is not 1.0, whereas is does have value 1.0 in Maxima. */ (%i2) expand(float(%o1)); (%o2) -1.951024982232477*%i-2.685355511932373 /* this Maxima float value agrees with the first 14 digits of Mma's N[Gamma[1/5,-2] - Gamma[1/5,-1]] which gives -2.685355511932382... -1.951024982232483... i which translates into -2.685355511932382 - 1.951024982232483*%i */ /* the approximate (real) value of the integral is given by quad_qags */ (%i3) quad_qags(exp(y)/y^(4/5),y,1,2); (%o3) [3.319281956502171,3.6851432533315483E-14,21,0] /* Maxima gives value 1.0 to (-1)^(4/5) */ (%i4) expand(float(-1)^(4/5)); (%o4) 1.0 /* whereas Mathematica gives N[(-1)^(4/5)] ---> -0.8090169943749474... + 0.5877852522924731... i which translates into -0.8090169943749474 + 0.5877852522924731*%i If we multiply this factor by %o2 and expand we get the correct numerical answer to within floating point roundoff errors: */ (%i5) expand((-0.8090169943749474 + 0.5877852522924731*%i)*%o2); (%o5) 4.4408920985006262E-16*%i+3.319281956502161 /* the above was with 5.25.1 defint.lisp. The updated version makes no difference here */ (%i6) load("defint-new.lisp"); (%o6) "c:/work2/defint-new.lisp" (%i7) integrate(exp(y)/y^(4/5),y,1,2); (%o7) gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1) (%i8) expand(float(%)); (%o8) -1.951024982232477*%i-2.685355511932373 -------------------------------------- Ted _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Thu Jan 12 19:52:16 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 12 Jan 2012 20:52:16 -0500 Subject: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? In-Reply-To: <92B4901587C24839AF27E5062EDEFB17@RichsLaptop> References: <92B4901587C24839AF27E5062EDEFB17@RichsLaptop> Message-ID: <5280E133A3E341B5B80CB72AED81A8A0@RichsLaptop> Sorry, but my last post below is not valid. Theorem, For odd integer n>0, integrate(exp(x^n),x) = F(x,n), F(x,n) is real valued and continuous and F(x,n)= (-gamma_incomplete(1/n,-x^n)*%e^-(%i*%pi/n)/n+gamma(1/n)*%e^-(%i*%pi/n)/n+gamma(1/n)/n)*(signum(x)+1)/2 +gamma_incomplete(1/n,-x^n)*(1-signum(x))/(2*n) for all real x. FWIW, Rich PS It seems to work for negative odd n too, I think. -----Original Message----- From: Richard Hennessy Sent: Thursday, January 12, 2012 6:36 PM To: Edwin Woollett ; Richard Fateman Cc: maxima mailing list ; Aleksas Domarkas Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? Sorry about the multiple posts but here is my last one. integrate(exp(x^7),x); gamma_incomplete(1/7,-x^7)*(1-signum(x))/14-%e^-(%i*%pi/7)*gamma_incomplete(1/7,-x^7)*(signum(x)+1)/14; This is simpler but it is discontinuous at 0. I can live with that. Rich -----Original Message----- From: Richard Hennessy Sent: Thursday, January 12, 2012 6:28 PM To: Edwin Woollett ; Richard Fateman Cc: maxima mailing list ; Aleksas Domarkas Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? Actually a more general answer that works for positive and negative x is integrate(exp(x^7),x); (-%e^-(%i*%pi/7)*gamma_incomplete(1/7,-x^7)/7+%e^-(%i*%pi/7)*gamma(1/7)/7+gamma(1/7)/7)*(signum(x)+1)/2 +gamma_incomplete(1/7,-x^7)*(1-signum(x))/14 which is very complicated but more correct. Maybe someone can suggest a better form or we have to fix the -1 problem. Maybe if assume(x>0) should affect the answer. Then integrate would have to check for that. Rich -----Original Message----- From: Richard Hennessy Sent: Thursday, January 12, 2012 6:04 PM To: Edwin Woollett ; Richard Fateman Cc: maxima mailing list ; Aleksas Domarkas Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? Since maxima does simplify this factor to 1.0 then we could fix that by using the value of polarform(-1) in the answer as suggested by Aleksas. integrate(exp(x^7),x); should give -%e^-(%i*%pi/7)*gamma_incomplete(1/7,-x^7)/7 and integrate(exp(x^5),x); should give -%e^-(%i*%pi/5)*gamma_incomplete(1/5,-x^5)/5 etc . . . That would fix the problem, since Maxima's simplifier does not simplify away the exponential term. Aleksas has already shown the proof but his method will not work in integrate(exp(x^n),x) when n is a known integer. The reason is that Maxima has already converted the (-1) expression to 1. Rich -----Original Message----- From: Edwin Woollett Sent: Thursday, January 12, 2012 3:28 PM To: Richard Fateman Cc: maxima mailing list Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? On Jan. 11, 2012, Richard Fateman wrote: ---------------------------------- >> (%i3) integrate(exp(x^5),x,1,2); >> (%o3) (gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1))/5 > >for what it is worth, Mathematica 7 returns > >1/5 (-1)^(4/5) (Gamma[1/5, -32] - Gamma[1/5, -1])} > > >Notice the factor of (-1)^(4/5). ------------------------------------------- This is a very important observation, and explains a difference between Maxima and Mathematica results for these type of integrals. Maxima evaluates the factor (-1)^(4/5) numerically to 1.0, which differs from Mathematica's evaluation (see below). Here I consider a different (but related via a simple change of variables) integral, and compare in detail the results from Maxima and Mathematica (using the Wolfram alpha site). ----------------------------------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) integrate(exp(y)/y^(4/5),y,1,2); (%o1) gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1) /* MMa NIntegrate[Exp[y]/y^(4/5),{y,1,2}] yields (-1)^(4/5)*(Gamma[1/5,-2] - Gamma[1/5,-1]) does not agree with Maxima, since in Mathematica (-1)^(4/5) float value is not 1.0, whereas is does have value 1.0 in Maxima. */ (%i2) expand(float(%o1)); (%o2) -1.951024982232477*%i-2.685355511932373 /* this Maxima float value agrees with the first 14 digits of Mma's N[Gamma[1/5,-2] - Gamma[1/5,-1]] which gives -2.685355511932382... -1.951024982232483... i which translates into -2.685355511932382 - 1.951024982232483*%i */ /* the approximate (real) value of the integral is given by quad_qags */ (%i3) quad_qags(exp(y)/y^(4/5),y,1,2); (%o3) [3.319281956502171,3.6851432533315483E-14,21,0] /* Maxima gives value 1.0 to (-1)^(4/5) */ (%i4) expand(float(-1)^(4/5)); (%o4) 1.0 /* whereas Mathematica gives N[(-1)^(4/5)] ---> -0.8090169943749474... + 0.5877852522924731... i which translates into -0.8090169943749474 + 0.5877852522924731*%i If we multiply this factor by %o2 and expand we get the correct numerical answer to within floating point roundoff errors: */ (%i5) expand((-0.8090169943749474 + 0.5877852522924731*%i)*%o2); (%o5) 4.4408920985006262E-16*%i+3.319281956502161 /* the above was with 5.25.1 defint.lisp. The updated version makes no difference here */ (%i6) load("defint-new.lisp"); (%o6) "c:/work2/defint-new.lisp" (%i7) integrate(exp(y)/y^(4/5),y,1,2); (%o7) gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1) (%i8) expand(float(%)); (%o8) -1.951024982232477*%i-2.685355511932373 -------------------------------------- Ted _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Thu Jan 12 19:58:41 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 12 Jan 2012 20:58:41 -0500 Subject: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? Message-ID: This whole effort is probably not worth the time I spent. The general real valued formula is probably too complicated to be useful. Rich -----Original Message----- From: Richard Hennessy Sent: Thursday, January 12, 2012 8:52 PM To: Edwin Woollett ; Richard Fateman Cc: maxima mailing list ; Aleksas Domarkas Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? Sorry, but my last post below is not valid. Theorem, For odd integer n>0, integrate(exp(x^n),x) = F(x,n), F(x,n) is real valued and continuous and F(x,n)= (-gamma_incomplete(1/n,-x^n)*%e^-(%i*%pi/n)/n+gamma(1/n)*%e^-(%i*%pi/n)/n+gamma(1/n)/n)*(signum(x)+1)/2 +gamma_incomplete(1/n,-x^n)*(1-signum(x))/(2*n) for all real x. FWIW, Rich PS It seems to work for negative odd n too, I think. -----Original Message----- From: Richard Hennessy Sent: Thursday, January 12, 2012 6:36 PM To: Edwin Woollett ; Richard Fateman Cc: maxima mailing list ; Aleksas Domarkas Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? Sorry about the multiple posts but here is my last one. integrate(exp(x^7),x); gamma_incomplete(1/7,-x^7)*(1-signum(x))/14-%e^-(%i*%pi/7)*gamma_incomplete(1/7,-x^7)*(signum(x)+1)/14; This is simpler but it is discontinuous at 0. I can live with that. Rich -----Original Message----- From: Richard Hennessy Sent: Thursday, January 12, 2012 6:28 PM To: Edwin Woollett ; Richard Fateman Cc: maxima mailing list ; Aleksas Domarkas Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? Actually a more general answer that works for positive and negative x is integrate(exp(x^7),x); (-%e^-(%i*%pi/7)*gamma_incomplete(1/7,-x^7)/7+%e^-(%i*%pi/7)*gamma(1/7)/7+gamma(1/7)/7)*(signum(x)+1)/2 +gamma_incomplete(1/7,-x^7)*(1-signum(x))/14 which is very complicated but more correct. Maybe someone can suggest a better form or we have to fix the -1 problem. Maybe if assume(x>0) should affect the answer. Then integrate would have to check for that. Rich -----Original Message----- From: Richard Hennessy Sent: Thursday, January 12, 2012 6:04 PM To: Edwin Woollett ; Richard Fateman Cc: maxima mailing list ; Aleksas Domarkas Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? Since maxima does simplify this factor to 1.0 then we could fix that by using the value of polarform(-1) in the answer as suggested by Aleksas. integrate(exp(x^7),x); should give -%e^-(%i*%pi/7)*gamma_incomplete(1/7,-x^7)/7 and integrate(exp(x^5),x); should give -%e^-(%i*%pi/5)*gamma_incomplete(1/5,-x^5)/5 etc . . . That would fix the problem, since Maxima's simplifier does not simplify away the exponential term. Aleksas has already shown the proof but his method will not work in integrate(exp(x^n),x) when n is a known integer. The reason is that Maxima has already converted the (-1) expression to 1. Rich -----Original Message----- From: Edwin Woollett Sent: Thursday, January 12, 2012 3:28 PM To: Richard Fateman Cc: maxima mailing list Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? On Jan. 11, 2012, Richard Fateman wrote: ---------------------------------- >> (%i3) integrate(exp(x^5),x,1,2); >> (%o3) (gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1))/5 > >for what it is worth, Mathematica 7 returns > >1/5 (-1)^(4/5) (Gamma[1/5, -32] - Gamma[1/5, -1])} > > >Notice the factor of (-1)^(4/5). ------------------------------------------- This is a very important observation, and explains a difference between Maxima and Mathematica results for these type of integrals. Maxima evaluates the factor (-1)^(4/5) numerically to 1.0, which differs from Mathematica's evaluation (see below). Here I consider a different (but related via a simple change of variables) integral, and compare in detail the results from Maxima and Mathematica (using the Wolfram alpha site). ----------------------------------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) integrate(exp(y)/y^(4/5),y,1,2); (%o1) gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1) /* MMa NIntegrate[Exp[y]/y^(4/5),{y,1,2}] yields (-1)^(4/5)*(Gamma[1/5,-2] - Gamma[1/5,-1]) does not agree with Maxima, since in Mathematica (-1)^(4/5) float value is not 1.0, whereas is does have value 1.0 in Maxima. */ (%i2) expand(float(%o1)); (%o2) -1.951024982232477*%i-2.685355511932373 /* this Maxima float value agrees with the first 14 digits of Mma's N[Gamma[1/5,-2] - Gamma[1/5,-1]] which gives -2.685355511932382... -1.951024982232483... i which translates into -2.685355511932382 - 1.951024982232483*%i */ /* the approximate (real) value of the integral is given by quad_qags */ (%i3) quad_qags(exp(y)/y^(4/5),y,1,2); (%o3) [3.319281956502171,3.6851432533315483E-14,21,0] /* Maxima gives value 1.0 to (-1)^(4/5) */ (%i4) expand(float(-1)^(4/5)); (%o4) 1.0 /* whereas Mathematica gives N[(-1)^(4/5)] ---> -0.8090169943749474... + 0.5877852522924731... i which translates into -0.8090169943749474 + 0.5877852522924731*%i If we multiply this factor by %o2 and expand we get the correct numerical answer to within floating point roundoff errors: */ (%i5) expand((-0.8090169943749474 + 0.5877852522924731*%i)*%o2); (%o5) 4.4408920985006262E-16*%i+3.319281956502161 /* the above was with 5.25.1 defint.lisp. The updated version makes no difference here */ (%i6) load("defint-new.lisp"); (%o6) "c:/work2/defint-new.lisp" (%i7) integrate(exp(y)/y^(4/5),y,1,2); (%o7) gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1) (%i8) expand(float(%)); (%o8) -1.951024982232477*%i-2.685355511932373 -------------------------------------- Ted _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rswarbrick at gmail.com Thu Jan 12 18:45:47 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 13 Jan 2012 00:45:47 +0000 Subject: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? References: <92B4901587C24839AF27E5062EDEFB17@RichsLaptop> Message-ID: "Richard Hennessy" writes: > Sorry about the multiple posts but here is my last one. > > integrate(exp(x^7),x); > gamma_incomplete(1/7,-x^7)*(1-signum(x))/14-%e^-(%i*%pi/7)*gamma_incomplete(1/7,-x^7)*(signum(x)+1)/14; > > This is simpler but it is discontinuous at 0. I can live with that. > > Rich I confess I've been pretty much ignoring this discussion but: Are you claiming that you have a function that is not continuous but is an antiderivative of exp(x^7)? I presume that you have some understanding of how continuity is affected by integration and differentation. Also, x |-> exp(x^7) is smooth. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From oldenbur at math.uni-frankfurt.de Fri Jan 13 02:45:37 2012 From: oldenbur at math.uni-frankfurt.de (Reinhard Oldenburg) Date: Fri, 13 Jan 2012 09:45:37 +0100 Subject: [Maxima] Summation problem Message-ID: <4F0FEF31.70909@math.uni-frankfurt.de> Hi all. The following rather simple sum is not reported properly by nusum: nusum(k*(5/6)^(k-1),k,1,inf) Is it a good idea to fix the problem in the following way: mySum(expr,var,a,b):= block([k],limit(subst(k,inf,nusum(expr,var,a,b)),k,inf)); Reinhard Oldenburg From aleksasd873 at gmail.com Fri Jan 13 02:53:26 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Fri, 13 Jan 2012 10:53:26 +0200 Subject: [Maxima] defint.lisp bug - was: new defint.lisp andradexpand:false? Message-ID: About integrate(exp(x)*x^k,x,a,b) We discus problems from http://www.math.utexas.edu/pipermail/maxima/2012/027431.html A.Domarkas From Oiler's formula exp(i*x)=cos(x)+i*sin(x). Then exp(i*pi)=-1. Maxima wrong compute (%i1) (-1)^(4/5); (%o1) 1 Should be (%i2) polarform(-1)^(4/5); (%o2) %e^((4*%i*%pi)/5) (%i3) float(%), numer; (%o3) 0.587785252292473*%i-0.809016994374947 This is same as Mathematica gives. Theorem. For any real k, a, b integrate(exp(x)*x^k,x,a,b)=%e^(-%i*%pi*k)*(gamma_incomplete(k+1,-b)-gamma_incomplete(k+1,-a)) Proof. (%i4) S:'integrate(exp(x)*x^k,x); (%o4) integrate(x^k*%e^x,x) (%i5) S1:ev(S, nouns); (%o5) -gamma_incomplete(k+1,-x)*(-x)^(-k-1)*x^(k+1) (%i6) subst(-x=exp(%i*pi)*x,S1); (%o6) -gamma_incomplete(k+1,%e^(%i*pi)*x)*x^(k+1)*(%e^(%i*pi)*x)^(-k-1) Froom Newton-Leibnitz formula S is equal (%i7) subst(x=b,%)-subst(x=a,%); (%o7) a^(k+1)*gamma_incomplete(k+1,a*%e^(%i*pi))*(a*%e^(%i*pi))^(-k-1)-b^(k+1)*gamma_incomplete(k+1,b*%e^(%i*pi))*(b*%e^(%i*pi))^(-k-1) (%i8) radcan(%); (%o8) -(gamma_incomplete(k+1,b*%e^(%i*pi))-gamma_incomplete(k+1,a*%e^(%i*pi)))*%e^(-(%i*k+%i)*pi) (%i9) subst(pi=%pi,%); (%o9) %e^(-%i*%pi*k)*(gamma_incomplete(k+1,-b)-gamma_incomplete(k+1,-a)) (%i10) define(F(k,a,b),%); (%o10) F(k,a,b):=%e^(-%i*%pi*k)*(gamma_incomplete(k+1,-b)-gamma_incomplete(k+1,-a)) q.e.d. --> Example 1. integrate(exp(y)/y^(4/5),y,1,2); (%i11) F(-4/5,1,2); (%o11) %e^((4*%i*%pi)/5)*(gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1)) (%i12) expand(float(rectform(%))); (%o12) 3.319281956502161-4.440892098500626*10^-16*%i (%i13) realpart(%); (%o13) 3.319281956502161 (%i14) /*test*/ first(quad_qags(exp(y)/y^(4/5),y,1,2)); (%o14) 3.319281956502171 Example 2. integrate(exp(x)*x^(1/2),x,0,2); (%i15) F(1/2,0,2); (%o15) -%i*(gamma_incomplete(3/2,-2)-sqrt(%pi)/2) (%i16) expand(float(rectform(%))); (%o16) 7.105860585432373-1.4432899320127035*10^-15*%i (%i17) realpart(%); (%o17) 7.105860585432373 (%i18) /*test*/ first(quad_qags(exp(x)*x^(1/2),x,0,2)); (%o18) 7.105860585432362 Example 3. integrate(exp(x)*x^(1/2),x,1,4); (%i19) F(1/2,1,4); (%o19) -%i*(gamma_incomplete(3/2,-4)-gamma_incomplete(3/2,-1)) (%i20) expand(float(rectform(%))); (%o20) 91.48804221822935-1.6764367671839864*10^-14*%i (%i21) realpart(%); (%o21) 91.48804221822935 (%i22) /*test*/ first(quad_qags(exp(x)*x^(1/2),x,1,4)); (%o22) 91.4880422182294 Example 3. integrate(exp(x)*x^3,x,1,4); (%i23) F(3,1,4); (%o23) gamma_incomplete(4,-1)-gamma_incomplete(4,-4) (%i24) expand(float(rectform(%))); (%o24) 1861.773664783822-9.119759437093765*10^-13*%i (%i25) realpart(%); (%o25) 1861.773664783822 (%i26) /*test*/ first(quad_qags(exp(x)*x^3,x,1,4)); (%o26) 1861.773664783822 Example 4. integrate(exp(x)*x^3,x,-1,1); (%i27) F(3,-1,1); (%o27) gamma_incomplete(4,1)-gamma_incomplete(4,-1) (%i28) expand(float(rectform(%))); (%o28) 0.449507401824987-2.759950902850205*10^-16*%i (%i29) realpart(%); (%o29) 0.449507401824987 (%i30) /*test*/ first(quad_qags(exp(x)*x^3,x,-1,1)); (%o30) 0.449507401824987 Example 5. integrate(exp(x)*x^4,x,-1,1); (%i31) F(4,-1,1); (%o31) gamma_incomplete(5,-1)-gamma_incomplete(5,1) (%i32) expand(float(rectform(%))); (%o32) 0.552372779987653-2.844371478803256*10^-16*%i (%i33) realpart(%); (%o33) 0.552372779987653 (%i34) /*test*/ first(quad_qags(exp(x)*x^4,x,-1,1)); (%o34) 0.552372779987656 Example 6. integrate(exp(x)*x^sqrt(2),x,0,1); (%i35) F(sqrt(2),0,1); (%o35) %e^(-sqrt(2)*%i*%pi)*(gamma_incomplete(sqrt(2)+1,-1)-gamma(sqrt(2)+1)) (%i36) expand(float(rectform(%))); (%o36) 0.858969157722264-5.551115123125783*10^-17*%i (%i37) realpart(%); (%o37) 0.858969157722264 (%i38) /*test*/ first(quad_qags(exp(x)*x^sqrt(2),x,0,1)); (%o38) 0.85896915771574 Example 7. integrate(exp(x)*x^4,x,-2,-1); (%i39) F(4,-2,-1); (%o39) gamma_incomplete(5,1)-gamma_incomplete(5,2) (%i40) expand(float(rectform(%))); (%o40) 1.175836092392821 (%i41) /*test*/ first(quad_qags(exp(x)*x^4,x,-2,-1)); (%o41) 1.175836092392819 Example 8. integrate(exp(x)*x^3,x,-2,-1); (%i42) F(3,-2,-1); (%o42) gamma_incomplete(4,2)-gamma_incomplete(4,1) (%i43) expand(float(rectform(%))); (%o43) -0.743330295751795 (%i44) /*test*/ first(quad_qags(exp(x)*x^3,x,-2,-1)); (%o44) -0.743330295751795 (%i45) build_info()$ Maxima version: 5.25.1 Maxima build date: 9:23 9/6/2011 Host type: i686-pc-mingw32 Lisp implementation type: Clozure Common Lisp Lisp implementation version: Version 1.7-r14925M (WindowsX8632) Aleksas D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gandrusz at gmail.com Fri Jan 13 10:09:39 2012 From: gandrusz at gmail.com (=?ISO-8859-2?Q?Grze=B6_Andruszkiewicz?=) Date: Fri, 13 Jan 2012 16:09:39 +0000 Subject: [Maxima] Differentiating sums Message-ID: Hi, I have the following sum: sum((R[i]-(a*X[i]+b)*t + 1/2*(c*X[i]+d)^2*t)^2/((c*X[i]+d)^2*t), i, 1, N); which I want to differenciate wrt. a: diff(%, a); but Maxima (wxMaxima to be precise) just prints d/da . Can I make it actually differentiate the sum (so because N is finite is should differentiate every element in the sum separately)? If I set N to some constant, e.g.: sum((R[i]-(a*X[i]+b)*t + 1/2*(c*X[i]+d)^2*t)^2/((c*X[i]+d)^2*t), i, 1, 100); then I get explicit sum of 100 elements (takes about 2 pages), and then differentiation works (but again I get 2 pages instead of a small sum). Cheers, Grzegorz From robert.dodier at gmail.com Fri Jan 13 10:32:07 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 13 Jan 2012 09:32:07 -0700 Subject: [Maxima] Summation problem In-Reply-To: <4F0FEF31.70909@math.uni-frankfurt.de> References: <4F0FEF31.70909@math.uni-frankfurt.de> Message-ID: On 1/13/12, Reinhard Oldenburg wrote: > The following rather simple sum is not reported properly by nusum: > nusum(k*(5/6)^(k-1),k,1,inf) Well, if I remember correctly, nusum expects the upper limit to be a variable e.g. n instead of inf. Try simplify_sum, which applies nusum and several other algorithms. load (simplify_sum); simplify_sum (sum (k*(5/6)^(k - 1), k, 1, inf)); => 36 Hope this helps Robert Dodier From robert.dodier at gmail.com Fri Jan 13 10:44:21 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 13 Jan 2012 09:44:21 -0700 Subject: [Maxima] Differentiating sums In-Reply-To: References: Message-ID: On 1/13/12, Grze? Andruszkiewicz wrote: > I have the following sum: > sum((R[i]-(a*X[i]+b)*t + 1/2*(c*X[i]+d)^2*t)^2/((c*X[i]+d)^2*t), i, 1, N); > > which I want to differenciate wrt. a: > > diff(%, a); > > but Maxima (wxMaxima to be precise) just prints d/da . Can I > make it actually differentiate the sum (so because N is finite is > should differentiate every element in the sum separately)? Well, there isn't a built-in function to carry out that operation, but I think it can be implemented via simplification rules (tellsimp, defrule, etc). I think this has come up before -- take a look at the mailing list archive. See: http://maxima.sourceforge.net/maximalist.html best Robert Dodier From gandrusz at gmail.com Fri Jan 13 11:13:17 2012 From: gandrusz at gmail.com (=?ISO-8859-2?Q?Grze=B6_Andruszkiewicz?=) Date: Fri, 13 Jan 2012 17:13:17 +0000 Subject: [Maxima] Differentiating sums In-Reply-To: References: Message-ID: Hi, Thanks for a prompt reply. I actually managed to get it working by setting simplify_sum:true. But now I am trying to solve for first order conditions: 2*sum((X[i]*(((c*X[i]+d)^2*t)/2-(a*X[i]+b)*t+R[i]))/(c*X[i]+d)^2,i,1,M)=0 solve(%, a) which gives: [sum(((c^2*X[i]^3+(2*c*d-2*a)*X[i]^2+(d^2-2*b)*X[i])*t+2*R[i]*X[i])/(2*c^2*X[i]^2+4*c*d*X[i]+2*d^2),i,1,M)=0] instead of splitting the sum into 2 sums (1 dependent on a and the other not) and dividing accordingly. Any ideas how to achieve this? Cheers, Grzegorz 2012/1/13 Robert Dodier : > On 1/13/12, Grze? Andruszkiewicz wrote: > >> I have the following sum: >> sum((R[i]-(a*X[i]+b)*t + 1/2*(c*X[i]+d)^2*t)^2/((c*X[i]+d)^2*t), i, 1, N); >> >> which I want to differenciate wrt. a: >> >> diff(%, a); >> >> but Maxima (wxMaxima to be precise) just prints d/da . Can I >> make it actually differentiate the sum (so because N is finite is >> should differentiate every element in the sum separately)? > > Well, there isn't a built-in function to carry out that operation, > but I think it can be implemented via simplification rules > (tellsimp, defrule, etc). I think this has come up before -- take > a look at the mailing list archive. > See: http://maxima.sourceforge.net/maximalist.html > > best > > Robert Dodier From rich.hennessy at verizon.net Fri Jan 13 11:19:54 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Fri, 13 Jan 2012 12:19:54 -0500 Subject: [Maxima] new defint.lisp bug - was: new defint.lispandradexpand:false? In-Reply-To: References: <92B4901587C24839AF27E5062EDEFB17@RichsLaptop> Message-ID: <1D09626EF80B4908AFD8A4AF6E97D13C@RichsLaptop> "I confess I've been pretty much ignoring this discussion but: Are you claiming that you have a function that is not continuous but is an antiderivative of exp(x^7)? I presume that you have some understanding of how continuity is affected by integration and differentation. Also, x |-> exp(x^7) is smooth." My mistake. No, I not claiming anything now, I took back that post. I was trying to find a general anti-derivative. Aleksas has done it correctly, mine was wrong. Sorry for the confusion. Just feel free to ignore my posts as you were doing. Sorry about that. Thank you Aleksas for posting the answer and it's proof. Rich -----Original Message----- From: Rupert Swarbrick Sent: Thursday, January 12, 2012 7:45 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lispandradexpand:false? _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Fri Jan 13 11:21:51 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Fri, 13 Jan 2012 12:21:51 -0500 Subject: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? In-Reply-To: References: Message-ID: <075ACF5857B746AF96519B898945871D@RichsLaptop> Thank you Aleksas for posting the answer and it's proof. Rich From: Aleksas Domarkas Sent: Friday, January 13, 2012 4:02 AM To: Richard Hennessy Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? About integrate(exp(x)*x^k,x,a,b) We discus problems from http://www.math.utexas.edu/pipermail/maxima/2012/027431.html A.Domarkas >From Oiler's formula exp(i*x)=cos(x)+i*sin(x). Then exp(i*pi)=-1. Maxima wrong compute (%i1) (-1)^(4/5); (%o1) 1 Should be (%i2) polarform(-1)^(4/5); (%o2) %e^((4*%i*%pi)/5) (%i3) float(%), numer; (%o3) 0.587785252292473*%i-0.809016994374947 This is same as Mathematica gives. Theorem. For any real k, a, b integrate(exp(x)*x^k,x,a,b)=%e^(-%i*%pi*k)*(gamma_incomplete(k+1,-b)-gamma_incomplete(k+1,-a)) Proof. (%i4) S:'integrate(exp(x)*x^k,x); (%o4) integrate(x^k*%e^x,x) (%i5) S1:ev(S, nouns); (%o5) -gamma_incomplete(k+1,-x)*(-x)^(-k-1)*x^(k+1) (%i6) subst(-x=exp(%i*pi)*x,S1); (%o6) -gamma_incomplete(k+1,%e^(%i*pi)*x)*x^(k+1)*(%e^(%i*pi)*x)^(-k-1) Froom Newton-Leibnitz formula S is equal (%i7) subst(x=b,%)-subst(x=a,%); (%o7) a^(k+1)*gamma_incomplete(k+1,a*%e^(%i*pi))*(a*%e^(%i*pi))^(-k-1)-b^(k+1)*gamma_incomplete(k+1,b*%e^(%i*pi))*(b*%e^(%i*pi))^(-k-1) (%i8) radcan(%); (%o8) -(gamma_incomplete(k+1,b*%e^(%i*pi))-gamma_incomplete(k+1,a*%e^(%i*pi)))*%e^(-(%i*k+%i)*pi) (%i9) subst(pi=%pi,%); (%o9) %e^(-%i*%pi*k)*(gamma_incomplete(k+1,-b)-gamma_incomplete(k+1,-a)) (%i10) define(F(k,a,b),%); (%o10) F(k,a,b):=%e^(-%i*%pi*k)*(gamma_incomplete(k+1,-b)-gamma_incomplete(k+1,-a)) q.e.d. --> Example 1. integrate(exp(y)/y^(4/5),y,1,2); (%i11) F(-4/5,1,2); (%o11) %e^((4*%i*%pi)/5)*(gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1)) (%i12) expand(float(rectform(%))); (%o12) 3.319281956502161-4.440892098500626*10^-16*%i (%i13) realpart(%); (%o13) 3.319281956502161 (%i14) /*test*/ first(quad_qags(exp(y)/y^(4/5),y,1,2)); (%o14) 3.319281956502171 Example 2. integrate(exp(x)*x^(1/2),x,0,2); (%i15) F(1/2,0,2); (%o15) -%i*(gamma_incomplete(3/2,-2)-sqrt(%pi)/2) (%i16) expand(float(rectform(%))); (%o16) 7.105860585432373-1.4432899320127035*10^-15*%i (%i17) realpart(%); (%o17) 7.105860585432373 (%i18) /*test*/ first(quad_qags(exp(x)*x^(1/2),x,0,2)); (%o18) 7.105860585432362 Example 3. integrate(exp(x)*x^(1/2),x,1,4); (%i19) F(1/2,1,4); (%o19) -%i*(gamma_incomplete(3/2,-4)-gamma_incomplete(3/2,-1)) (%i20) expand(float(rectform(%))); (%o20) 91.48804221822935-1.6764367671839864*10^-14*%i (%i21) realpart(%); (%o21) 91.48804221822935 (%i22) /*test*/ first(quad_qags(exp(x)*x^(1/2),x,1,4)); (%o22) 91.4880422182294 Example 3. integrate(exp(x)*x^3,x,1,4); (%i23) F(3,1,4); (%o23) gamma_incomplete(4,-1)-gamma_incomplete(4,-4) (%i24) expand(float(rectform(%))); (%o24) 1861.773664783822-9.119759437093765*10^-13*%i (%i25) realpart(%); (%o25) 1861.773664783822 (%i26) /*test*/ first(quad_qags(exp(x)*x^3,x,1,4)); (%o26) 1861.773664783822 Example 4. integrate(exp(x)*x^3,x,-1,1); (%i27) F(3,-1,1); (%o27) gamma_incomplete(4,1)-gamma_incomplete(4,-1) (%i28) expand(float(rectform(%))); (%o28) 0.449507401824987-2.759950902850205*10^-16*%i (%i29) realpart(%); (%o29) 0.449507401824987 (%i30) /*test*/ first(quad_qags(exp(x)*x^3,x,-1,1)); (%o30) 0.449507401824987 Example 5. integrate(exp(x)*x^4,x,-1,1); (%i31) F(4,-1,1); (%o31) gamma_incomplete(5,-1)-gamma_incomplete(5,1) (%i32) expand(float(rectform(%))); (%o32) 0.552372779987653-2.844371478803256*10^-16*%i (%i33) realpart(%); (%o33) 0.552372779987653 (%i34) /*test*/ first(quad_qags(exp(x)*x^4,x,-1,1)); (%o34) 0.552372779987656 Example 6. integrate(exp(x)*x^sqrt(2),x,0,1); (%i35) F(sqrt(2),0,1); (%o35) %e^(-sqrt(2)*%i*%pi)*(gamma_incomplete(sqrt(2)+1,-1)-gamma(sqrt(2)+1)) (%i36) expand(float(rectform(%))); (%o36) 0.858969157722264-5.551115123125783*10^-17*%i (%i37) realpart(%); (%o37) 0.858969157722264 (%i38) /*test*/ first(quad_qags(exp(x)*x^sqrt(2),x,0,1)); (%o38) 0.85896915771574 Example 7. integrate(exp(x)*x^4,x,-2,-1); (%i39) F(4,-2,-1); (%o39) gamma_incomplete(5,1)-gamma_incomplete(5,2) (%i40) expand(float(rectform(%))); (%o40) 1.175836092392821 (%i41) /*test*/ first(quad_qags(exp(x)*x^4,x,-2,-1)); (%o41) 1.175836092392819 Example 8. integrate(exp(x)*x^3,x,-2,-1); (%i42) F(3,-2,-1); (%o42) gamma_incomplete(4,2)-gamma_incomplete(4,1) (%i43) expand(float(rectform(%))); (%o43) -0.743330295751795 (%i44) /*test*/ first(quad_qags(exp(x)*x^3,x,-2,-1)); (%o44) -0.743330295751795 (%i45) build_info()$ Maxima version: 5.25.1 Maxima build date: 9:23 9/6/2011 Host type: i686-pc-mingw32 Lisp implementation type: Clozure Common Lisp Lisp implementation version: Version 1.7-r14925M (WindowsX8632) Aleksas D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Fri Jan 13 11:36:51 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Fri, 13 Jan 2012 12:36:51 -0500 Subject: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? In-Reply-To: <075ACF5857B746AF96519B898945871D@RichsLaptop> References: <075ACF5857B746AF96519B898945871D@RichsLaptop> Message-ID: Thank you again. I am weak with complex numbers, I am a little embarrassed that I did not understand how to work around the (-1) problem. At least there is a way if you know what you are doing, obviously I don?t. The proof of that is obvious, just read my posts. Rich From: Richard Hennessy Sent: Friday, January 13, 2012 12:21 PM To: Aleksas Domarkas Cc: Maxima List Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? Thank you Aleksas for posting the answer and it's proof. Rich From: Aleksas Domarkas Sent: Friday, January 13, 2012 4:02 AM To: Richard Hennessy Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lisp andradexpand:false? About integrate(exp(x)*x^k,x,a,b) We discus problems from http://www.math.utexas.edu/pipermail/maxima/2012/027431.html A.Domarkas >From Oiler's formula exp(i*x)=cos(x)+i*sin(x). Then exp(i*pi)=-1. Maxima wrong compute (%i1) (-1)^(4/5); (%o1) 1 Should be (%i2) polarform(-1)^(4/5); (%o2) %e^((4*%i*%pi)/5) (%i3) float(%), numer; (%o3) 0.587785252292473*%i-0.809016994374947 This is same as Mathematica gives. Theorem. For any real k, a, b integrate(exp(x)*x^k,x,a,b)=%e^(-%i*%pi*k)*(gamma_incomplete(k+1,-b)-gamma_incomplete(k+1,-a)) Proof. (%i4) S:'integrate(exp(x)*x^k,x); (%o4) integrate(x^k*%e^x,x) (%i5) S1:ev(S, nouns); (%o5) -gamma_incomplete(k+1,-x)*(-x)^(-k-1)*x^(k+1) (%i6) subst(-x=exp(%i*pi)*x,S1); (%o6) -gamma_incomplete(k+1,%e^(%i*pi)*x)*x^(k+1)*(%e^(%i*pi)*x)^(-k-1) Froom Newton-Leibnitz formula S is equal (%i7) subst(x=b,%)-subst(x=a,%); (%o7) a^(k+1)*gamma_incomplete(k+1,a*%e^(%i*pi))*(a*%e^(%i*pi))^(-k-1)-b^(k+1)*gamma_incomplete(k+1,b*%e^(%i*pi))*(b*%e^(%i*pi))^(-k-1) (%i8) radcan(%); (%o8) -(gamma_incomplete(k+1,b*%e^(%i*pi))-gamma_incomplete(k+1,a*%e^(%i*pi)))*%e^(-(%i*k+%i)*pi) (%i9) subst(pi=%pi,%); (%o9) %e^(-%i*%pi*k)*(gamma_incomplete(k+1,-b)-gamma_incomplete(k+1,-a)) (%i10) define(F(k,a,b),%); (%o10) F(k,a,b):=%e^(-%i*%pi*k)*(gamma_incomplete(k+1,-b)-gamma_incomplete(k+1,-a)) q.e.d. --> Example 1. integrate(exp(y)/y^(4/5),y,1,2); (%i11) F(-4/5,1,2); (%o11) %e^((4*%i*%pi)/5)*(gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1)) (%i12) expand(float(rectform(%))); (%o12) 3.319281956502161-4.440892098500626*10^-16*%i (%i13) realpart(%); (%o13) 3.319281956502161 (%i14) /*test*/ first(quad_qags(exp(y)/y^(4/5),y,1,2)); (%o14) 3.319281956502171 Example 2. integrate(exp(x)*x^(1/2),x,0,2); (%i15) F(1/2,0,2); (%o15) -%i*(gamma_incomplete(3/2,-2)-sqrt(%pi)/2) (%i16) expand(float(rectform(%))); (%o16) 7.105860585432373-1.4432899320127035*10^-15*%i (%i17) realpart(%); (%o17) 7.105860585432373 (%i18) /*test*/ first(quad_qags(exp(x)*x^(1/2),x,0,2)); (%o18) 7.105860585432362 Example 3. integrate(exp(x)*x^(1/2),x,1,4); (%i19) F(1/2,1,4); (%o19) -%i*(gamma_incomplete(3/2,-4)-gamma_incomplete(3/2,-1)) (%i20) expand(float(rectform(%))); (%o20) 91.48804221822935-1.6764367671839864*10^-14*%i (%i21) realpart(%); (%o21) 91.48804221822935 (%i22) /*test*/ first(quad_qags(exp(x)*x^(1/2),x,1,4)); (%o22) 91.4880422182294 Example 3. integrate(exp(x)*x^3,x,1,4); (%i23) F(3,1,4); (%o23) gamma_incomplete(4,-1)-gamma_incomplete(4,-4) (%i24) expand(float(rectform(%))); (%o24) 1861.773664783822-9.119759437093765*10^-13*%i (%i25) realpart(%); (%o25) 1861.773664783822 (%i26) /*test*/ first(quad_qags(exp(x)*x^3,x,1,4)); (%o26) 1861.773664783822 Example 4. integrate(exp(x)*x^3,x,-1,1); (%i27) F(3,-1,1); (%o27) gamma_incomplete(4,1)-gamma_incomplete(4,-1) (%i28) expand(float(rectform(%))); (%o28) 0.449507401824987-2.759950902850205*10^-16*%i (%i29) realpart(%); (%o29) 0.449507401824987 (%i30) /*test*/ first(quad_qags(exp(x)*x^3,x,-1,1)); (%o30) 0.449507401824987 Example 5. integrate(exp(x)*x^4,x,-1,1); (%i31) F(4,-1,1); (%o31) gamma_incomplete(5,-1)-gamma_incomplete(5,1) (%i32) expand(float(rectform(%))); (%o32) 0.552372779987653-2.844371478803256*10^-16*%i (%i33) realpart(%); (%o33) 0.552372779987653 (%i34) /*test*/ first(quad_qags(exp(x)*x^4,x,-1,1)); (%o34) 0.552372779987656 Example 6. integrate(exp(x)*x^sqrt(2),x,0,1); (%i35) F(sqrt(2),0,1); (%o35) %e^(-sqrt(2)*%i*%pi)*(gamma_incomplete(sqrt(2)+1,-1)-gamma(sqrt(2)+1)) (%i36) expand(float(rectform(%))); (%o36) 0.858969157722264-5.551115123125783*10^-17*%i (%i37) realpart(%); (%o37) 0.858969157722264 (%i38) /*test*/ first(quad_qags(exp(x)*x^sqrt(2),x,0,1)); (%o38) 0.85896915771574 Example 7. integrate(exp(x)*x^4,x,-2,-1); (%i39) F(4,-2,-1); (%o39) gamma_incomplete(5,1)-gamma_incomplete(5,2) (%i40) expand(float(rectform(%))); (%o40) 1.175836092392821 (%i41) /*test*/ first(quad_qags(exp(x)*x^4,x,-2,-1)); (%o41) 1.175836092392819 Example 8. integrate(exp(x)*x^3,x,-2,-1); (%i42) F(3,-2,-1); (%o42) gamma_incomplete(4,2)-gamma_incomplete(4,1) (%i43) expand(float(rectform(%))); (%o43) -0.743330295751795 (%i44) /*test*/ first(quad_qags(exp(x)*x^3,x,-2,-1)); (%o44) -0.743330295751795 (%i45) build_info()$ Maxima version: 5.25.1 Maxima build date: 9:23 9/6/2011 Host type: i686-pc-mingw32 Lisp implementation type: Clozure Common Lisp Lisp implementation version: Version 1.7-r14925M (WindowsX8632) Aleksas D. -------------------------------------------------------------------------------- _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From ephemeris at grayswandir.com Fri Jan 13 13:07:14 2012 From: ephemeris at grayswandir.com (Norman Beam) Date: Fri, 13 Jan 2012 14:07:14 -0500 Subject: [Maxima] Evaluating gamma_incomplete() for large values Message-ID: <4F1080E2.3060602@grayswandir.com> What I'm doing is somewhat silly but I ran into a limitation I can't seem to work around although I had assumed I could. I can't seem to get numerical results from gamma_incomplete (and thus cdf_poisson()) for values above about 450000. bfloat(cdf_poisson(460000,460000)); gamma_incomplete: series expansion failed for gamma_incomplete(4.60001b5, 4.6b5). Are there setting that would allow me to do this or am I bumping into some fundamental numerical limit? Regards, Norman From toy.raymond at gmail.com Fri Jan 13 13:55:19 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 13 Jan 2012 11:55:19 -0800 Subject: [Maxima] Evaluating gamma_incomplete() for large values In-Reply-To: <4F1080E2.3060602@grayswandir.com> References: <4F1080E2.3060602@grayswandir.com> Message-ID: On Fri, Jan 13, 2012 at 11:07 AM, Norman Beam wrote: > What I'm doing is somewhat silly but I ran into a limitation I can't seem > to work around although I had assumed I could. > > I can't seem to get numerical results from gamma_incomplete (and thus > cdf_poisson()) for values above about 450000. > > bfloat(cdf_poisson(460000,**460000)); > gamma_incomplete: series expansion failed for > gamma_incomplete(4.60001b5, 4.6b5). > > Are there setting that would allow me to do this or am I bumping into some > fundamental numerical limit? > > This is a known bug in gamma_incomplete. I am sort of working on it. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Fri Jan 13 14:10:45 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Fri, 13 Jan 2012 15:10:45 -0500 Subject: [Maxima] new defint.lisp bug - was: new defint.lispandradexpand:false? In-Reply-To: References: <92B4901587C24839AF27E5062EDEFB17@RichsLaptop> Message-ID: "Are you claiming that you have a function that is not continuous but is an antiderivative of exp(x^7)?" No, I am claiming that this function below is piecewise defined but continuous anyway and is real valued and is an antiderivative of exp(x^n) when n > 0, n is real and x is real. When n is an odd integer > 0 then it also is real valued antiderivative for all real x both positive and negative. I used Aleksas Domarkas' answer for the positive piece, I just spliced the negative and positive answers into one function, which could also be done with "if then else" if you like that better. My goal was to get one expression for the antiderivative which was true and real valued for all x and integer n>2. I succeeded. integrate(exp(x^n),x); (-gamma_incomplete(1/n,-x^n)*%e^-(%i*%pi/n)/n+gamma(1/n)*%e^-(%i*%pi/n)/n+gamma(1/n)/n)*(signum(x)+1)/2 +gamma_incomplete(1/n,-x^n)*(1-signum(x))/(2*n) Rich -----Original Message----- From: Rupert Swarbrick Sent: Thursday, January 12, 2012 7:45 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lispandradexpand:false? _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Fri Jan 13 14:32:09 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Fri, 13 Jan 2012 15:32:09 -0500 Subject: [Maxima] new defint.lisp bug - was: new defint.lispandradexpand:false? Message-ID: I succeeded (partially), when x is negative and n is an even integer then this is not real valued. I hope this clarifies everything. I want to add one last thing. It was not worth the time. As Edwin Woollett pointed out (-1)^(4/5) is not numerically equal to 1 but Maxima evaluated it to one anyway, which is a bug I guess and I don?t know if anyone is planning on fixing it. Does everyone have no problem with this? Rich -----Original Message----- From: Richard Hennessy Sent: Friday, January 13, 2012 3:10 PM To: Rupert Swarbrick Cc: Maxima List Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lispandradexpand:false? "Are you claiming that you have a function that is not continuous but is an antiderivative of exp(x^7)?" No, I am claiming that this function below is piecewise defined but continuous anyway and is real valued and is an antiderivative of exp(x^n) when n > 0, n is real and x is real. When n is an odd integer > 0 then it also is real valued antiderivative for all real x both positive and negative. I used Aleksas Domarkas' answer for the positive piece, I just spliced the negative and positive answers into one function, which could also be done with "if then else" if you like that better. My goal was to get one expression for the antiderivative which was true and real valued for all x and integer n>2. I succeeded. integrate(exp(x^n),x); (-gamma_incomplete(1/n,-x^n)*%e^-(%i*%pi/n)/n+gamma(1/n)*%e^-(%i*%pi/n)/n+gamma(1/n)/n)*(signum(x)+1)/2 +gamma_incomplete(1/n,-x^n)*(1-signum(x))/(2*n) Rich -----Original Message----- From: Rupert Swarbrick Sent: Thursday, January 12, 2012 7:45 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] new defint.lisp bug - was: new defint.lispandradexpand:false? _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From cloos at jhcloos.com Fri Jan 13 15:21:41 2012 From: cloos at jhcloos.com (James Cloos) Date: Fri, 13 Jan 2012 16:21:41 -0500 Subject: [Maxima] Differentiating sums In-Reply-To: (=?utf-8?Q?=22Grze=C5=9B?= Andruszkiewicz"'s message of "Fri, 13 Jan 2012 16:09:39 +0000") References: Message-ID: >>>>> "GA" == Grze? Andruszkiewicz writes: GA> sum((R[i]-(a*X[i]+b)*t + 1/2*(c*X[i]+d)^2*t)^2/((c*X[i]+d)^2*t), i, 1, N); GA> diff(%, a); I get: :; rmaxima Maxima 5.26.0 http://maxima.sourceforge.net using Lisp SBCL 1.0.54 Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) display2d:false; (%o1) false (%i2) sum((R[i]-(a*X[i]+b)*t + 1/2*(c*X[i]+d)^2*t)^2/((c*X[i]+d)^2*t), i, 1, N); (%o2) ('sum(((c*X[i]+d)^2*t/2-(a*X[i]+b)*t+R[i])^2/(c*X[i]+d)^2,i,1,N))/t (%i3) diff(%, a); (%o3) -2*'sum(X[i]*((c*X[i]+d)^2*t/2-(a*X[i]+b)*t+R[i])/(c*X[i]+d)^2,i,1,N) (%i4) -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From l.couraud at gmail.com Fri Jan 13 15:56:59 2012 From: l.couraud at gmail.com (laurent couraud) Date: Fri, 13 Jan 2012 22:56:59 +0100 Subject: [Maxima] RE : Differentiating sums In-Reply-To: Message-ID: <58187D85405E4A79BC2E886CA4D717B1@PASSERELLE> > -----Message d'origine----- > De?: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] De la part de > Grze? Andruszkiewicz > Envoy??: vendredi 13 janvier 2012 18:13 > ??: Robert Dodier > Cc?: maxima at math.utexas.edu > Objet?: Re: [Maxima] Differentiating sums > > Hi, > > Thanks for a prompt reply. I actually managed to get it working by > setting simplify_sum:true. But now I am trying to solve for first > order conditions: > 2*sum((X[i]*(((c*X[i]+d)^2*t)/2-(a*X[i]+b)*t+R[i]))/(c*X[i]+d)^2,i,1,M)=0 > solve(%, a) > > which gives: > [sum(((c^2*X[i]^3+(2*c*d-2*a)*X[i]^2+(d^2- > 2*b)*X[i])*t+2*R[i]*X[i])/(2*c^2*X[i]^2+4*c*d*X[i]+2*d^2),i,1,M)=0] > > instead of splitting the sum into 2 sums (1 dependent on a and the > other not) and dividing accordingly. Any ideas how to achieve this? > > Cheers, > Grzegorz > Hi, You have to declare sum to be linear. (%i9) display2d:false; (%o9) false (%i10) declare(sum,linear); (%o10) done (%i11) eq:2*sum((X[i]*(((c*X[i]+d)^2*t)/2-(a*X[i]+b)*t+R[i]))/(c*X[i]+d)^2,i,1,M)=0; (%o11) 2*'sum(X[i]*((c*X[i]+d)^2*t/2-(a*X[i]+b)*t+R[i])/(c*X[i]+d)^2,i,1,M) = 0 (%i12) solve(eq,a); (%o12) [a = -((2*b*'sum(X[i]/(c*X[i]+d)^2,i,1,M)-'sum(X[i],i,1,M))*t-2*'sum(R[i]*X[i]/(c*X[i]+d)^2,i,1,M))/ (2*('sum(X[i]^2/(c*X[i]+d)^2,i,1,M))*t)] From woollett at charter.net Fri Jan 13 16:27:01 2012 From: woollett at charter.net (Edwin Woollett) Date: Fri, 13 Jan 2012 14:27:01 -0800 Subject: [Maxima] defint.lisp and limit.lisp ver. 1-12-2012: gcl bug? Message-ID: On Jan. 12, 2012, Dan Gildea wrote, in fixing and closing bug # 3470385 - integrate (exp (sqrt) ) gcl bug the following: ------------------------------ >Fixed in limit.lisp and defint.lisp. >We still need domain:complex to prevent (-1)^(2/3) => -1. > >(%i4) domain:complex; >(%o4) complex >(%i5) integrate(exp(sqrt(x^3)),x,0,1); >(%o5) 2*((-1)^(1/3)*gamma_incomplete(2/3,-1)-(-1)^(1/3)*gamma(2/3))/3 -------------------------------------------- I have downloaded the new limit.lisp and new defint.lisp from git, and ** gcl ** does not get the same results. Effectively a meaningless result is returned, so I can not check the above. ---------------------------------------------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) load("defint-new.lisp"); (%o1) "c:/work2/defint-new.lisp" (%i2) load("limit-new.lisp"); (%o2) "c:/work2/limit-new.lisp" (%i3) domain:complex; (%o3) complex (%i4) integrate(exp(sqrt(x^3)),x,0,1); (%o4) %e^sqrt(x^3) ------------------------------- Just to explore other options in gcl: try domain = real and try radexpand=false first domain = real (%i5) domain:real; (%o5) real (%i6) integrate(exp(sqrt(x^3)),x,0,1); (%o6) %e^x^(3/2) (%i7) radexpand; (%o7) true next domain = real, radexpand=false (%i8) radexpand:false; (%o8) false (%i9) domain; (%o9) real (%i10) integrate(exp(sqrt(x^3)),x,0,1); (%o10) %e^sqrt(x^3) finally domain=complex, radexpand=false (%i13) domain:complex; (%o13) complex (%i14) integrate(exp(sqrt(x^3)),x,0,1); (%o14) %e^sqrt(x^3) ------------------------------------ On Jan 12 I wrote >Here I consider a different (but related via a simple >change of variables) integral, and compare in detail >the results from Maxima and Mathematica (using the >Wolfram alpha site). >(%i1) integrate(exp(y)/y^(4/5),y,1,2); >(%o1) gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1) >/* MMa NIntegrate[Exp[y]/y^(4/5),{y,1,2}] yields > > (-1)^(4/5)*(Gamma[1/5,-2] - Gamma[1/5,-1]) > > does not agree with Maxima, since in Mathematica > (-1)^(4/5) float value is not 1.0, whereas > is does have value 1.0 in Maxima. */ > > >(%i1) integrate(exp(y)/y^(4/5),y,1,2); >(%o1) gamma_incomplete(1/5,-2)-gamma_incomplete(1/5,-1) > etc. ----------------------------- Here I try that same integral using the defint-new.lisp and limit-new.lisp (versions posted 1-12-2012) (%i15) radexpand:true; (%o15) true (%i16) [radexpand,domain]; (%o16) [true,complex] (%i17) integrate(exp(y)/y^(4/5),y,1,2); (%o17) %e^y/y^(4/5) -------------------------------------- The new defint.lisp (1-12-2012) does change the evaluation of (-1)^(4/5) if domain=complex: ----------------------------------- (%i18) (-1)^(4/5); (%o18) (-1)^(4/5) (%i19) float(%); (%o19) 1.0*(-1)^(4/5) (%i20) expand(float(rectform( (-1)^(4/5)))); (%o20) 0.58778525229247*%i-0.80901699437495 (%i21) domain; (%o21) complex (%i22) domain:real; (%o22) real (%i23) expand(float(rectform( (-1)^(4/5)))); (%o23) 1.0 --------------------------------------------- Ted Woollett From tomdean at speakeasy.org Fri Jan 13 16:53:53 2012 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Fri, 13 Jan 2012 14:53:53 -0800 Subject: [Maxima] Factor the following number Message-ID: <87lipbqkn2.fsf@P9X79.tddhome> I factored the two 135-digit numbers, n and n+1 using cado-nfs-1.1 on an Intel i7-3930K overclocked to 4.2GHz with 18GiB RAM, running up to 10 threads. Factoring the numbers, n and n+1 took 10 days each, a total of 20 days. n has 5 factors and n+1 has two factors. n:= [2, 5, 2122943609450249057621, 405620061201508643988375124643817406843652803, 34444340671702467488860342883734479061576134487870291451728421045657]; mn+1:= [17222170335851233744430171441867239530788067265164581820366701099039, 17222170335851233744430577061928441039432055599953297058218812657049]; The sum of the factors is 34444340671702467488860748503795680570220122865117878878585513756088 So, this is a Ruth-Aaron pair. Tom Dean From robert.dodier at gmail.com Sat Jan 14 13:40:28 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 14 Jan 2012 12:40:28 -0700 Subject: [Maxima] still need Maxima 5.26 for Windows Message-ID: On 1/11/12, David Billinghurst wrote: > On 11/01/2012 9:50 PM, David Billinghurst wrote: >> I have one that seems OK at >> http://billinghurst.customer.netspace.net.au/maxima-5.26.0.exe >> >> How do I upload it? My sourceforge username is billingd > > This is broken. The describe command doesn't work. I will investigate > as time allows. David, thanks for taking the time to work on it. Can someone figure out how to construct a Windows package? I think it's fine if it's just a zip archive and not an executable installer. best, Robert Dodier From dbmaxima at gmail.com Sun Jan 15 07:57:17 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Mon, 16 Jan 2012 00:57:17 +1100 Subject: [Maxima] need Maxima 5.26 for Windows In-Reply-To: <4F0D758E.9020002@gmail.com> References: <4F0D6985.4000404@gmail.com> <4F0D758E.9020002@gmail.com> Message-ID: <4F12DB3D.5090708@gmail.com> On 11/01/2012 10:42 PM, David Billinghurst wrote: > On 11/01/2012 9:50 PM, David Billinghurst wrote: >> On 9/01/2012 4:24 AM, Robert Dodier wrote: >>> Hi everybody, >>> >>> Can someone build a Windows installer for Maxima 5.26 ? >>> I just looked at the list of files at Sourceforge and I don't see one. >>> I'd like to make a general announcement about 5.26 (sorry for the >>> delay). >> >> I have one that seems OK at >> http://billinghurst.customer.netspace.net.au/maxima-5.26.0.exe >> >> How do I upload it? My sourceforge username is billingd > > This is broken. The describe command doesn't work. I will > investigate as time allows. I have uploaded a new version to the same spot http://billinghurst.customer.netspace.net.au/maxima-5.26.0.exe - current version of wxMaxima - thanks Andrej - working info files, copied from a cygwin/clisp build The problem with describe is that the version of makeinfo was too old, and I wasn't able to update it in the ancient version of mingw/msys needed for gcl. From woollett at charter.net Sun Jan 15 13:12:18 2012 From: woollett at charter.net (Edwin Woollett) Date: Sun, 15 Jan 2012 11:12:18 -0800 Subject: [Maxima] defint.lisp and limit.lisp ver. 1-12-2012: gcl bug? Message-ID: I consider this apparent bug as fixed, based on Dan Gildea's latest files on git and his test of gcl using the current git. Those (like me, at present) who do not maintain a clone of the current git and hence do not check the compiled behavior, should see correct behavior with ver. 5.26.1. Another issue, however, is the requirement of setting domain:complex to get correct results from integrate in some cases (such as here). How is the novice etc user to know when and when not to set domain=complex? We always want a user to get a correct answer to a symbolic integral (for its float value) if possible. Is there any reason why domain=complex should not be the default? Or, perhaps integrate (or defint) should set domain:false locally? Ted Woollett From willisb at unk.edu Sun Jan 15 14:09:32 2012 From: willisb at unk.edu (Barton Willis) Date: Sun, 15 Jan 2012 14:09:32 -0600 Subject: [Maxima] building under windows + file permissions In-Reply-To: References: Message-ID: I haven't tried "make install" under windows for years--I thought I'd try again using (fairly current) cgywin + ccl 1.7. I think "make" finished OK. After working for some time, make install gives ++ pwd + d=/cygdrive/c/maximagit/maxima/doc/info + cd /tmp/maxima-texinfo-categories-1XKXN8 + for f in '*.texi' $ + sed 's/^@def\(fn\|vr\) *{[^}]*} *\([^[:blank:]]*\).*/@anchor{Item: \2}\ \0/; s/^@node *\([^,]*\).*/@anchor{Item: \1}\ \0/' Affine.texi sed: can't read Affine.texi: Permission denied + mv tmp.texi Affine.texi mv: try to overwrite `Affine.texi', overriding mode 0000 (---------)? make[4]: * Switching to tmp/maxima-texinfo-categories-1XKXN8, I discover: Barton at Barton-PC /tmp/maxima-texinfo-categories-1XKXN8 $ ls affine.texi -l ---------- 1 Barton None 8018 Jan 15 13:49 affine.texi Barton at Barton-PC /tmp/maxima-texinfo-categories-1XKXN8 $ cat affine.texi cat: affine.texi: Permission denied I tried something like chmod -R a+rw tmp. Didn't work. --Barton From hawe at chefmail.de Fri Jan 13 14:36:51 2012 From: hawe at chefmail.de (Hans W. Hofmann) Date: Fri, 13 Jan 2012 20:36:51 +0000 (UTC) Subject: [Maxima] define bug? Message-ID: (%i2) f(x):=-k*x^3+3*k^2*x^2; 3 2 2 (%o2) f(x) := (- k) x + 3 k x (%i3) df(x):=diff(f(x),x)$ df(x); 2 2 (%o3) 6 k x - 3 k x (%i4) df(k)=3; 3 (%o4) 8 k = 3 whats this? should have (%i5) 6*k^2*x-3*k*x^2 = 3, x=k; (%o5) 3*k^3 = 3 using define all works fine.... Gru? HW From gandrusz at gmail.com Fri Jan 13 15:36:56 2012 From: gandrusz at gmail.com (=?ISO-8859-2?Q?Grze=B6_Andruszkiewicz?=) Date: Fri, 13 Jan 2012 21:36:56 +0000 Subject: [Maxima] Differentiating sums In-Reply-To: References: Message-ID: Hi James, I think you have the setting simplify_sum:true. After I tried setting it to true (it was false by default on my machine), then I got it working as well. But now I am trying to solve for first order conditions: 2*sum((X[i]*(((c*X[i]+d)^2*t)/2-(a*X[i]+b)*t+R[i]))/(c*X[i]+d)^2,i,1,M)=0 solve(%, a) which gives: [sum(((c^2*X[i]^3+(2*c*d-2*a)*X[i]^2+(d^2-2*b)*X[i])*t+2*R[i]*X[i])/(2*c^2*X[i]^2+4*c*d*X[i]+2*d^2),i,1,M)=0] instead of splitting the sum into 2 sums (1 dependent on a and the other not) and dividing accordingly. Any ideas how to achieve this? Cheers, Grzegorz 2012/1/13 James Cloos : >>>>>> "GA" == Grze? Andruszkiewicz writes: > > GA> sum((R[i]-(a*X[i]+b)*t + 1/2*(c*X[i]+d)^2*t)^2/((c*X[i]+d)^2*t), i, 1, N); > GA> diff(%, a); > > I get: > > :; rmaxima > Maxima 5.26.0 http://maxima.sourceforge.net > using Lisp SBCL 1.0.54 > Distributed under the GNU Public License. See the file COPYING. > Dedicated to the memory of William Schelter. > The function bug_report() provides bug reporting information. > (%i1) display2d:false; > > (%o1) false > (%i2) sum((R[i]-(a*X[i]+b)*t + 1/2*(c*X[i]+d)^2*t)^2/((c*X[i]+d)^2*t), i, 1, N); > > (%o2) ('sum(((c*X[i]+d)^2*t/2-(a*X[i]+b)*t+R[i])^2/(c*X[i]+d)^2,i,1,N))/t > (%i3) diff(%, a); > > (%o3) -2*'sum(X[i]*((c*X[i]+d)^2*t/2-(a*X[i]+b)*t+R[i])/(c*X[i]+d)^2,i,1,N) > (%i4) > > -JimC > -- > James Cloos ? ? ? ? OpenPGP: 1024D/ED7DAEA6 From gandrusz at gmail.com Sat Jan 14 03:48:32 2012 From: gandrusz at gmail.com (=?ISO-8859-2?Q?Grze=B6_Andruszkiewicz?=) Date: Sat, 14 Jan 2012 09:48:32 +0000 Subject: [Maxima] RE : Differentiating sums In-Reply-To: <58187D85405E4A79BC2E886CA4D717B1@PASSERELLE> References: <58187D85405E4A79BC2E886CA4D717B1@PASSERELLE> Message-ID: Hi, It works, thanks! but it doesn't return any results. > (%i9) display2d:false; > (%o9) false > (%i10) declare(sum,linear); > (%o10) done > (%i11) eq:2*sum((X[i]*(((c*X[i]+d)^2*t)/2-(a*X[i]+b)*t+R[i]))/(c*X[i]+d)^2,i,1,M)=0; > (%o11) 2*'sum(X[i]*((c*X[i]+d)^2*t/2-(a*X[i]+b)*t+R[i])/(c*X[i]+d)^2,i,1,M) = 0 > (%i12) solve(eq,a); > (%o12) [a = > -((2*b*'sum(X[i]/(c*X[i]+d)^2,i,1,M)-'sum(X[i],i,1,M))*t-2*'sum(R[i]*X[i]/(c*X[i]+d)^2,i,1,M))/ > (2*('sum(X[i]^2/(c*X[i]+d)^2,i,1,M))*t)] > The next thing I wanted is to do is: solve([diff(L, a), diff(L,b)], [a,b]); but it doesn't return any results. I managed to work around it by doing: solve([solve(diff(L, a), a)[1], solve(diff(L,b),b)[1]], [a,b]); but probably I am doing something wrong again... Regards, Grzegorz And how can I plug these values back into the original equation L (or some other equation that contains a and b)? From aleksasd873 at gmail.com Sun Jan 15 02:47:45 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Sun, 15 Jan 2012 10:47:45 +0200 Subject: [Maxima] Functions with any number of arguments Message-ID: Functions with any number of arguments. How in Maxima define functions with any number of arguments ? For example, i need function MIN(arg1,arg2, ...) MIN(2) => 2 MIN(3,4) =>3 MIN(2/3,1/2,sqrt(2)/2) => 1/2 Other example. How define G with following properties: G(n) => gamma(n) G(5) => 24 G(a, x) => gamma_incomplete (a, x) G(a, z1, z2) => gamma_incomplete_generalized (a, z1, z2) (%i1) gamma(5); (%o1) 24 Aleksas D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From extranjero27 at yahoo.com Sun Jan 15 07:37:47 2012 From: extranjero27 at yahoo.com (Brian) Date: Sun, 15 Jan 2012 13:37:47 +0000 (UTC) Subject: [Maxima] =?utf-8?q?_unit=5Fstep=28=29_and_integrate=28=29?= Message-ID: Hello, I am using a very old computer to run Maxima 5.21.1 so all of my work is performed using a maxima file and command line. My issue is with "unit_step()" and "integrate()". f1a(x):= +2 * unit_step( x )$ f1b(x):= -2 * unit_step( x - 2 )$ f1(x):= f1a(x) + f1b(x)$ f2a(x):= integrate( f1a(x), x ); f2b(x):= integrate( f1b(x), x ); f2(x):= integrate( f1(x), x ); f3(x):= f2a(x) + f2b(x); I expect f1(x) to be a squarewave with the value of 2 from x=0 to x=2 and zero everywhere else. I expect f2(x) to be a "ramp" with a slope of 2...starting at x=0 to x=2 (where f2(2)=4). f2(x) is zero everywhere else. I expect f3(x) to equal f2(x). My maxima script-> http://pastebin.com/hhnbckqy When I run my script, a plot is generated of f1(x), f2(x), and f3(x). f1(x) plots as I expected. I see that f2(x) and f3(x) have the correct shape. But f2(x) is shifted down by 2. f3(x) is the result I expect. Is my understanding of elementary functions incorrect (unit step, unit ramp, impulse)? Am I missing a something? I am reviewing some classes I had years ago (Signals & Systems). Tools like Maxima and Octave have been wonderful. Thanks! From macrakis at alum.mit.edu Sun Jan 15 16:15:03 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 15 Jan 2012 17:15:03 -0500 Subject: [Maxima] Functions with any number of arguments In-Reply-To: References: Message-ID: (%i1) xxx([l]):=length(l)$ (%i2) xxx(3,4,5); (%o2) 3 On Sun, Jan 15, 2012 at 03:47, Aleksas Domarkas wrote: > Functions with any number of arguments. > > How in Maxima define functions with any number of arguments ? > > For example, i need function MIN(arg1,arg2, ...) > MIN(2) => 2 > MIN(3,4) =>3 > MIN(2/3,1/2,sqrt(2)/2) => 1/2 > > Other example. How define G with following properties: > G(n) => gamma(n) > G(5) => 24 > G(a, x) => gamma_incomplete (a, x) > G(a, z1, z2) => gamma_incomplete_generalized (a, z1, z2) > > (%i1) gamma(5); > (%o1) 24 > > Aleksas D. > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun Jan 15 16:20:26 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 15 Jan 2012 17:20:26 -0500 Subject: [Maxima] define bug? In-Reply-To: References: Message-ID: The key to the answer is "define works fine". The ":=" operator -- like function definition in all ordinary programming languages -- defers the evaluation of its arguments until the function is called. The "define" function evaluates the right-hand side (also the left) *at the time of definition*. For example: (%i1) f(x):=print(x); (%o1) f(x) := print(x) <<< function definition includes "print" <<< no printing (%i2) f(4); 4 <<< print when *evaluating* f (%o2) 4 (%i3) define('(g(x)),print(x)); x <<< print when *defining* g (%o3) g(x) := x <<< function definition does not include "print" (%i4) g(4); (%o4) 4 Doing something like h(x) := diff(f(x),x) will then try to evaluate diff(f(4),4), which is of course nonsensical. -s On Fri, Jan 13, 2012 at 15:36, Hans W. Hofmann wrote: > (%i2) f(x):=-k*x^3+3*k^2*x^2; > 3 2 2 > (%o2) f(x) := (- k) x + 3 k x > > (%i3) df(x):=diff(f(x),x)$ df(x); > 2 2 > (%o3) 6 k x - 3 k x > > (%i4) df(k)=3; > 3 > (%o4) 8 k = 3 > > whats this? should have > > (%i5) 6*k^2*x-3*k*x^2 = 3, x=k; > (%o5) 3*k^3 = 3 > > using define all works fine.... > > Gru? HW > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sun Jan 15 17:02:22 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 15 Jan 2012 15:02:22 -0800 Subject: [Maxima] define bug? In-Reply-To: References: Message-ID: <4F135AFE.8000106@eecs.berkeley.edu> On 1/13/2012 12:36 PM, Hans W. Hofmann wrote: > (%i2) f(x):=-k*x^3+3*k^2*x^2; > 3 2 2 > (%o2) f(x) := (- k) x + 3 k x > > (%i3) df(x):=diff(f(x),x)$ df(x); > 2 2 > (%o3) 6 k x - 3 k x > > (%i4) df(k)=3; > 3 > (%o4) 8 k = 3 > > whats this? should have > > (%i5) 6*k^2*x-3*k*x^2 = 3, x=k; > (%o5) 3*k^3 = 3 > > using define all works fine.... > > Gru? HW > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima no, f(k) is -k*k^3+3*k^2*k^2 or 2*k^4. compute its derivative with respect to k, and one gets 8*k^3. RJF From fateman at eecs.berkeley.edu Sun Jan 15 17:04:40 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 15 Jan 2012 15:04:40 -0800 Subject: [Maxima] Functions with any number of arguments In-Reply-To: References: Message-ID: <4F135B88.2080201@eecs.berkeley.edu> On 1/15/2012 12:47 AM, Aleksas Domarkas wrote: > Functions with any number of arguments. > > How in Maxima define functions with any number of arguments ? > > For example, i need function MIN(arg1,arg2, ...) try MIN([args]):= args to see how it works. Then write the function for real.. From rich.hennessy at verizon.net Sun Jan 15 19:16:14 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 15 Jan 2012 20:16:14 -0500 Subject: [Maxima] unit_step() and integrate() In-Reply-To: References: Message-ID: <809D5FF9FD58468A82205446D5551555@RichsLaptop> Brian: You are probably forgetting that the indefinite integral has an arbitrary constant which may result in the answer from integrate to be different by a constant amount than from what you expect. To get the results you want you have to add the appropriate constant yourself. Rich -----Original Message----- From: Brian Sent: Sunday, January 15, 2012 8:37 AM To: maxima at math.utexas.edu Subject: [Maxima] unit_step() and integrate() Hello, I am using a very old computer to run Maxima 5.21.1 so all of my work is performed using a maxima file and command line. My issue is with "unit_step()" and "integrate()". f1a(x):= +2 * unit_step( x )$ f1b(x):= -2 * unit_step( x - 2 )$ f1(x):= f1a(x) + f1b(x)$ f2a(x):= integrate( f1a(x), x ); f2b(x):= integrate( f1b(x), x ); f2(x):= integrate( f1(x), x ); f3(x):= f2a(x) + f2b(x); I expect f1(x) to be a squarewave with the value of 2 from x=0 to x=2 and zero everywhere else. I expect f2(x) to be a "ramp" with a slope of 2...starting at x=0 to x=2 (where f2(2)=4). f2(x) is zero everywhere else. I expect f3(x) to equal f2(x). My maxima script-> http://pastebin.com/hhnbckqy When I run my script, a plot is generated of f1(x), f2(x), and f3(x). f1(x) plots as I expected. I see that f2(x) and f3(x) have the correct shape. But f2(x) is shifted down by 2. f3(x) is the result I expect. Is my understanding of elementary functions incorrect (unit step, unit ramp, impulse)? Am I missing a something? I am reviewing some classes I had years ago (Signals & Systems). Tools like Maxima and Octave have been wonderful. Thanks! _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Sun Jan 15 19:32:26 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 15 Jan 2012 20:32:26 -0500 Subject: [Maxima] unit_step() and integrate() In-Reply-To: <809D5FF9FD58468A82205446D5551555@RichsLaptop> References: <809D5FF9FD58468A82205446D5551555@RichsLaptop> Message-ID: "I expect f2(x) to be a "ramp" with a slope of 2...starting at vx=0 to x=2 (where f2(2)=4). f2(x) is zero everywhere else." You said "f2(x) is zero everywhere else". That is wrong. The indefinite integral of the unit_step function is continuous everywhere. If it dropped down to zero at the point x=2 that would be a discontinuity which would be an error. The answer from integrate is correct. Rich -----Original Message----- From: Richard Hennessy Sent: Sunday, January 15, 2012 8:16 PM To: Brian ; maxima at math.utexas.edu Subject: Re: [Maxima] unit_step() and integrate() Brian: You are probably forgetting that the indefinite integral has an arbitrary constant which may result in the answer from integrate to be different by a constant amount than from what you expect. To get the results you want you have to add the appropriate constant yourself. Rich -----Original Message----- From: Brian Sent: Sunday, January 15, 2012 8:37 AM To: maxima at math.utexas.edu Subject: [Maxima] unit_step() and integrate() Hello, I am using a very old computer to run Maxima 5.21.1 so all of my work is performed using a maxima file and command line. My issue is with "unit_step()" and "integrate()". f1a(x):= +2 * unit_step( x )$ f1b(x):= -2 * unit_step( x - 2 )$ f1(x):= f1a(x) + f1b(x)$ f2a(x):= integrate( f1a(x), x ); f2b(x):= integrate( f1b(x), x ); f2(x):= integrate( f1(x), x ); f3(x):= f2a(x) + f2b(x); I expect f1(x) to be a squarewave with the value of 2 from x=0 to x=2 and zero everywhere else. I expect f2(x) to be a "ramp" with a slope of 2...starting at x=0 to x=2 (where f2(2)=4). f2(x) is zero everywhere else. I expect f3(x) to equal f2(x). My maxima script-> http://pastebin.com/hhnbckqy When I run my script, a plot is generated of f1(x), f2(x), and f3(x). f1(x) plots as I expected. I see that f2(x) and f3(x) have the correct shape. But f2(x) is shifted down by 2. f3(x) is the result I expect. Is my understanding of elementary functions incorrect (unit step, unit ramp, impulse)? Am I missing a something? I am reviewing some classes I had years ago (Signals & Systems). Tools like Maxima and Octave have been wonderful. Thanks! _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Sun Jan 15 19:41:54 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 15 Jan 2012 20:41:54 -0500 Subject: [Maxima] unit_step() and integrate() In-Reply-To: References: <809D5FF9FD58468A82205446D5551555@RichsLaptop> Message-ID: I meant the indefinite integral of the square wave function is continuous everywhere. Sorry. In general if a function involves step functions the integral in usually continuous, even though the original function is not. Rich -----Original Message----- From: Richard Hennessy Sent: Sunday, January 15, 2012 8:32 PM To: Brian ; maxima at math.utexas.edu Subject: Re: [Maxima] unit_step() and integrate() "I expect f2(x) to be a "ramp" with a slope of 2...starting at vx=0 to x=2 (where f2(2)=4). f2(x) is zero everywhere else." You said "f2(x) is zero everywhere else". That is wrong. The indefinite integral of the unit_step function is continuous everywhere. If it dropped down to zero at the point x=2 that would be a discontinuity which would be an error. The answer from integrate is correct. Rich -----Original Message----- From: Richard Hennessy Sent: Sunday, January 15, 2012 8:16 PM To: Brian ; maxima at math.utexas.edu Subject: Re: [Maxima] unit_step() and integrate() Brian: You are probably forgetting that the indefinite integral has an arbitrary constant which may result in the answer from integrate to be different by a constant amount than from what you expect. To get the results you want you have to add the appropriate constant yourself. Rich -----Original Message----- From: Brian Sent: Sunday, January 15, 2012 8:37 AM To: maxima at math.utexas.edu Subject: [Maxima] unit_step() and integrate() Hello, I am using a very old computer to run Maxima 5.21.1 so all of my work is performed using a maxima file and command line. My issue is with "unit_step()" and "integrate()". f1a(x):= +2 * unit_step( x )$ f1b(x):= -2 * unit_step( x - 2 )$ f1(x):= f1a(x) + f1b(x)$ f2a(x):= integrate( f1a(x), x ); f2b(x):= integrate( f1b(x), x ); f2(x):= integrate( f1(x), x ); f3(x):= f2a(x) + f2b(x); I expect f1(x) to be a squarewave with the value of 2 from x=0 to x=2 and zero everywhere else. I expect f2(x) to be a "ramp" with a slope of 2...starting at x=0 to x=2 (where f2(2)=4). f2(x) is zero everywhere else. I expect f3(x) to equal f2(x). My maxima script-> http://pastebin.com/hhnbckqy When I run my script, a plot is generated of f1(x), f2(x), and f3(x). f1(x) plots as I expected. I see that f2(x) and f3(x) have the correct shape. But f2(x) is shifted down by 2. f3(x) is the result I expect. Is my understanding of elementary functions incorrect (unit step, unit ramp, impulse)? Am I missing a something? I am reviewing some classes I had years ago (Signals & Systems). Tools like Maxima and Octave have been wonderful. Thanks! _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From gwpublic at wp.pl Sun Jan 15 19:43:27 2012 From: gwpublic at wp.pl (gwpublic at wp.pl) Date: Mon, 16 Jan 2012 02:43:27 +0100 Subject: [Maxima] lsquares fitting and constrains for parameters (looking for positive values of parameters) In-Reply-To: References: Message-ID: Hello, I use least squares method to fit functions to data : load(lsquares)$ DataM: matrix( [1,1], [4,4], [10,9] ); lsquares_estimates (DataM, [x,y], y = a2*x**2 + a1*x + a0, [a2,a1,a0], iprint=[-1,0]); Maxima finds negative solutions: (%i) grind(%); (%o) [[a2 = -1/54,a1 = 59/54,a0 = -2/27]]$ What should I do to constrain parameters ? To be more specific : * I must ensure all are positive : a2>=0 a1>=0 a0>=0 * would be nice to specify upper limits as well : a2 References: Message-ID: <4F1389B0.4040309@gmail.com> On 1/15/12 5:43 PM, gwpublic at wp.pl wrote: > Hello, > > I use least squares method to fit functions to data : > > load(lsquares)$ > DataM: matrix( [1,1], [4,4], [10,9] ); > lsquares_estimates (DataM, [x,y], y = a2*x**2 + a1*x + a0, [a2,a1,a0], > iprint=[-1,0]); > > Maxima finds negative solutions: > > (%i) grind(%); > (%o) [[a2 = -1/54,a1 = 59/54,a0 = -2/27]]$ > > What should I do to constrain parameters ? > To be more specific : > > * I must ensure all are positive : a2>=0 a1>=0 a0>=0 > * would be nice to specify upper limits as well : a2 * Maybe other constrains if solution can handle any predicate. > > But only "must" is to make them positive. > > I've tried : "assume()", but with no success. > If you do not need a symbolic solution, you might be interested in fmin_cobyla, which will produce the minimum of a function subject to equality or inequality constraints. Use "? fmin_cobyla" for more information. Ray From rswarbrick at gmail.com Mon Jan 16 04:10:11 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Mon, 16 Jan 2012 10:10:11 +0000 Subject: [Maxima] unit_step() and integrate() References: <809D5FF9FD58468A82205446D5551555@RichsLaptop> Message-ID: <4l9du8xl4s.ln2@hake.rswarbrick.dnsalias.com> "Richard Hennessy" writes: > I meant the indefinite integral of the square wave function is > continuous everywhere. Sorry. In general if a function involves step > functions the integral in usually continuous, even though the original > function is not. > > Rich *sigh* If f is a function from the real line to itself and you define a new function F by F(x) = integrate (f(y), y, a, x) for any choice of a, then F is called the "indefinite integral" of f. A theorem, which is sort of trivial once you've set up all the machinery for Riemann integration, says that F is always continuous (unit steps or no!) Occasionally, people talk of "functions" like the Dirac delta function ?(x). This isn't, strictly speaking, a function R?R because it doesn't evaluate to a number at x=0. Rather it is defined by integrate (?(x), x, a, b) = 1 if a<0 From robert.dodier at gmail.com Mon Jan 16 10:15:12 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 16 Jan 2012 09:15:12 -0700 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: <23737.1326342202@gemini.franz.com> References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> <1326315301.1548.19.camel@ubuntu> <23737.1326342202@gemini.franz.com> Message-ID: On 1/11/12, Steve Haflich wrote: > Proclamations (aka declamations) such as are estabished by the > macroexpansions if DEFVAR etc. affect all subsequently-compiled or > executed bindings and references. That's unfortunate, isn't it? since it means, in effect, that there is in fact no lexical scope in Common Lisp, because the behavior of a given snippet of code can only be understood by considering the entire program. Robert Dodier From macrakis at alum.mit.edu Mon Jan 16 10:23:12 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 16 Jan 2012 11:23:12 -0500 Subject: [Maxima] Double integration. In-Reply-To: References: Message-ID: Costa, There are two difficulties in the double numerical integration: 1) The issues around correct quoting etc. of functions. 2) Numerical properties of these integrals when there is an indicator function. Issue (1) is easily taken care of with something like what you propose. It is also taken care of by careful quoting. But issue (2) is not. As Alexander says, standard numerical integration techniques are designed for smooth functions -- the step created by an indicator function "confuses" them. Also, doing a double integration as the composition of two single integrations is generally going to be far from optimal both in speed and in accuracy. I suspect that there are numerical packages (perhaps even in Maxima) designed specifically for cases like this, but that is beyond my competence. -s On Mon, Jan 16, 2012 at 03:08, Constantine Frangos wrote: > Hi Stavro, > > Thanks for the detailed response. I was wondering whether the > difficutlies you mention > can be overcome in the following manner. > > A new Maxima integration function, num_integration, internally calls a > user defined Maxima function, say integrandf, and passes the values of > the integration variables, x1, x2, together with the values of other > parameters, p1,p2,..., needed to compute the integrand, as follows, > > ........ > I1 : apply(integrandf,[x1,x2,p1,p2,...]); > ......... > > The user would call num_integration with something like, > > I : num_integration(integrandf,list_of_limits,p1,p2,....); > > Any suggestions would be appreciated. > > Regards, > Constantine. > > On 1/12/12, Stavros Macrakis wrote: > > As Alexander says, you don't need the temporary variable etc. > > > > Also, if you explicitly quote everything, you are less likely to have bad > > surprises. Something like this: > > > > (%i27) (cnt:0,quad_qags('(quad_qags('(cnt:cnt+1,if x>y then 1 else > > 0),x,0,1)[1]),y,0,1)); > > (%o27) [0.49999763949292, 3.4177098928722671E-9, 735, 0] > > (%i28) cnt; > > (%o28) 621243 > > > > Note the number of function evaluations for a very simple case! Note > also > > that the result is not very accurate, and that the error estimate is way > > off. I imagine there are better routines for this kind of integration. > > Obviously in this case it is easy to transform to a single integral > (even > > analytical), but presumably you want to handle more complicated > integrands. > > > > -s > > > > On Thu, Jan 12, 2012 at 05:38, Alexander Klimov > wrote: > > > >> Hi. > >> > >> On Thu, 12 Jan 2012, Constantine Frangos wrote: > >> > (1) Its not clear why the function definition I am using does not > >> > work. According to the Maxima 5.24 manual, paragraph 20.4, the > >> > integrand can be the name of a Maxima function, presumably defined by > >> > the user in a file, for example, integrand.mac > >> > >> Your function does not always return a number. Consider your original > >> definition: > >> > >> (%i1) ind(x,y) := block([s],if is(x*x + y*y <= 1) then (s : 1) else (s : > >> 0),return(s))$ > >> > >> Let us see how it works > >> > >> (%i2) trace(ind); > >> (%o2) [ind] > >> > >> If one gives numerical arguments, then your function returns the > >> number which is assigned to "s" > >> > >> (%i3) ind(0,1); > >> 1 Enter ind [0, 1] > >> 1 Exit ind 1 > >> (%o3) 1 > >> > >> but with symbols as arguments nothing is assigned to "s" and thus the > >> function returns just a symbol "s" > >> > >> (%i4) ind(x1,x2); > >> 1 Enter ind [x1, x2] > >> 1 Exit ind s > >> (%o4) s > >> > >> and this is exactly what happens when you use it in integration > >> > >> (%i5) I:quad_qags(quad_qags(ind(x1,x2),x1,-1,1)[1],x2,-1,1); > >> 1 Enter ind [x1, x2] > >> 1 Exit ind s > >> COERCE-FLOAT-FUN: no such Lisp or Maxima function: s > >> -- an error. To debug this try: debugmode(true); > >> > >> > (2) Are there perhaps other Maxima numerical integration functions > >> > that may perform better ? > >> > >> As I said, it is better to > >> > >> > > use a simple integral: > >> > > > >> > > (%i4) quad_qags(2*sqrt(1-y^2),y,-1,1); > >> > > (%o4) [3.141592653589797, 2.000470900043183e-9, 399, 0] > >> > >> the problem with indicators is that while they may be suitable for > >> symbolic manipulations, they are bad functions for Gaussian quadrature > >> rule which is only good if the function is similar to a polynomial. > >> > >> -- > >> Regards, > >> ASK > >> _______________________________________________ > >> Maxima mailing list > >> Maxima at math.utexas.edu > >> http://www.math.utexas.edu/mailman/listinfo/maxima > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gwpublic at wp.pl Mon Jan 16 11:19:44 2012 From: gwpublic at wp.pl (gwpublic at wp.pl) Date: Mon, 16 Jan 2012 18:19:44 +0100 Subject: [Maxima] lsquares fitting and constrains for parameters (looking for positive values of parameters) In-Reply-To: <4F1389B0.4040309@gmail.com> References: <4F1389B0.4040309@gmail.com> Message-ID: > If you do not need a symbolic solution, You're right. I need concrete values. (I've forgot to say it in problem statement). > you might be interested in > fmin_cobyla, which will produce the minimum of a function subject to > equality or inequality constraints. fmin_cobyla, I haven't knew about it. (btw. I see it's implemented in Scipy as well.) I try to figure out how to make it to obey constraints, with no success. Results are not positive, and even worse than lsquares_estimate. As I doing sth wrong ? Or sum equations are not fmin_cobyla's purpose, are they ? To show clearly what is my problem, I've prepared this toy example , benchmarking lsquares with fmin_cobyla: ____________________________ display2d:false$ load(lsquares)$ load(fmin_cobyla)$ DataM: matrix( [1,2], [2,4], [3,6], [4,8] )$ D_vars: [x,y]$ pattern: y = a3*x**3 + a2*x**2 + a1*x + a0$ parameters: [a3,a2,a1,a0]$ mse : lsquares_mse (DataM, D_vars, pattern); lsq_val: lsquares_estimates (DataM, D_vars, pattern, parameters); cob_val: fmin_cobyla(mse, parameters, [1,1,1,1], constraints = [a3>=0, a2>=0, a1>=0, a0>=0], iprint=1); lsq_expr: ev(pattern,lsq_val); cob_expr: ev(pattern,cob_val[1]); quality_of_lsq: ev(mse,lsq_val),nouns; quality_of_cob: ev(mse,cob_val[1]),nouns; ____________________________ Here is how it works: ____________________________ $ maxima -b /tmp/t.mac 2>/dev/null Maxima 5.24.0 http://maxima.sourceforge.net using Lisp SBCL 1.0.51 Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) batch(/tmp/t.mac) (%i2) display2d : false (%i3) load(lsquares) (%i4) load(fmin_cobyla) (%i5) DataM:matrix([1,2],[2,4],[3,6],[4,8]) (%i6) D_vars:[x,y] (%i7) pattern:y = a0+a1*x+a2*x^2+a3*x^3 (%i8) parameters:[a3,a2,a1,a0] (%i9) mse:lsquares_mse(DataM,D_vars,pattern) (%o9) ('sum(('DataM[i,2]-a3*'DataM[i,1]^3-a2*'DataM[i,1]^2-a1*'DataM[i,1]-a0) ^2,i,1,4)) /4 (%i10) lsq_val:lsquares_estimates(DataM,D_vars,pattern,parameters) (%o10) [[a3 = 0,a2 = 0,a1 = 2,a0 = 0]] (%i11) cob_val:fmin_cobyla(mse,parameters,[1,1,1,1], constraints = [a3 >= 0,a2 >= 0,a1 >= 0,a0 >= 0], iprint = 1) Return from subroutine COBYLA because the MAXFUN limit has been reached. NFVALS = 1000 F = 3.415514E-02 MAXCV = 5.648753E-20 X =-5.648753E-20 1.754386E-01 1.073534E+00 1.018859E+00 (%o11) [[a3 = -5.648753124436182e-20,a2 = .1754386264111758, a1 = 1.073533597507375,a0 = 1.018858888779015],0.0341551363982473, 1000,1] (%i12) lsq_expr:ev(pattern,lsq_val) (%o12) y = 2*x (%i13) cob_expr:ev(pattern,cob_val[1]) (%o13) y = -5.648753124436182e-20*x^3+.1754386264111758*x^2 +1.073533597507375*x+1.018858888779015 (%i14) ev(quality_of_lsq:ev(mse,lsq_val),nouns) (%o14) 0 (%i15) ev(quality_of_cob:ev(mse,cob_val[1]),nouns) (%o15) 0.0341551363982473 ____________________________ Greg From toy.raymond at gmail.com Mon Jan 16 12:27:49 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 16 Jan 2012 10:27:49 -0800 Subject: [Maxima] lsquares fitting and constrains for parameters (looking for positive values of parameters) In-Reply-To: References: <4F1389B0.4040309@gmail.com> Message-ID: On Mon, Jan 16, 2012 at 9:19 AM, wrote: > > If you do not need a symbolic solution, > > You're right. I need concrete values. (I've forgot to say it in > problem statement). > > > you might be interested in > > fmin_cobyla, which will produce the minimum of a function subject to > > equality or inequality constraints. > > fmin_cobyla, I haven't knew about it. (btw. I see it's implemented in > Scipy as well.) > > I try to figure out how to make it to obey constraints, with no > success. Results are not positive, and even worse than > lsquares_estimate. > > As I doing sth wrong ? > Or sum equations are not fmin_cobyla's purpose, are they ? > > >From what I can see, you're doing everything correctly. I have noticed that fmin_cobyla is sensitive to the initial guess. With your example, fmin_cobyla does return positive values for the parameters, except a3, which is very small and slightly negative. It's also possible that by giving a too-complicated expression makes cobyla less efficient. Just from looking at the data matrix, it's clear that the relationship is linear (difference each y value is a constant). Perhaps a better example would be a real cubic with some noise added to the y values. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From gwpublic at wp.pl Mon Jan 16 14:12:04 2012 From: gwpublic at wp.pl (gwpublic at wp.pl) Date: Mon, 16 Jan 2012 21:12:04 +0100 Subject: [Maxima] lsquares fitting and constrains for parameters (looking for positive values of parameters) In-Reply-To: References: <4F1389B0.4040309@gmail.com> Message-ID: >> > If you do not need a symbolic solution, >> >> You're right. I need concrete values. (I've forgot to say it in >> problem statement). >> >> > you might be interested in >> > fmin_cobyla, which will produce the minimum of a function subject to >> > equality or inequality constraints. >> >> fmin_cobyla, I haven't knew about it. (btw. I see it's implemented in >> Scipy as well.) >> >> I try to figure out how to make it to obey constraints, with no >> success. Results are not positive, and even worse than >> lsquares_estimate. >> >> As I doing sth wrong ? >> Or sum equations are not fmin_cobyla's purpose, are they ? >> > > From what I can see, you're doing everything correctly.? I have noticed that > fmin_cobyla is sensitive to the initial guess.?? With your example, > fmin_cobyla does return positive values for the parameters, except a3, which > is very small and slightly negative. > > It's also possible that by giving a too-complicated expression makes cobyla > less efficient.? Just from looking at the data matrix, it's clear that the > relationship is linear (difference each y value is a constant). > > Perhaps a better example would be a real cubic with some noise added to the > y values. > > Ray Thanks for ensuring me I am doing everything fine. Now I know, it's question of "workarounds" and "tuning" to make all this stuff work as expected :). All Best, Greg From smh at franz.com Mon Jan 16 19:53:45 2012 From: smh at franz.com (Steve Haflich) Date: Mon, 16 Jan 2012 17:53:45 -0800 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> <1326315301.1548.19.camel@ubuntu> <23737.1326342202@gemini.franz.com> Message-ID: <27714.1326765225@gemini.franz.com> Robert Dodier wrote: On 1/11/12, Steve Haflich wrote: > Proclamations (aka declamations) such as are estabished by the > macroexpansions if DEFVAR etc. affect all subsequently-compiled or > executed bindings and references. That's unfortunate, isn't it? since it means, in effect, that there is in fact no lexical scope in Common Lisp, because the behavior of a given snippet of code can only be understood by considering the entire program. I understand your argument, but it is either incorrect in a strict language-lawyer sense, or irrelevant in that the issue almost never causes problems in real code. Since I'm a language lawyer (:-) I'll make that response first. It is true that when one writes code that lambda binds a variable such as cl-user::foo one cannot be absolutely certain that some remote, even irrelevant, module has sneakily declaimed foo to be globally special. (The package system is designed to reduce the possibility of inadvertent name collisions, but the package system remains in Chapter 11 (U.S. bankruptcy law) as X3J13 nonbindingly instructed the ANS editor.) If some body of code were either so pernicious or so disorganized, one would be wise not to use it. Nonetheless, writing as language lawyer, it is indeed possible to guarantee that a variable is bound lexically: (defun foo (x) (let ((#1=#:y (1+ x))) (bar #1#))) It is guaranteed that the gensym #:y will bound lexically, since that variable name is visible nowhere else than this defun form when it is read by the reader. (Of course, no one _ever_ does this, even though macrology could do it automatically. But I digress.) A related issue (actually the same issue) would be a promiscuous declamation like (declaim (type (mod 256) foo)) which (when not obeyed) could cause the compiler to miscompile references to the special variable "foo". (It would, fortunately, not affect any lexical binding.) There is nothing special [sic] about a special declaration. The above comments, other than being a virtuoso exercise of language lawyering, are otherwise both uninteresting and irrelevant. My serious comment follows: Common Lisp binding and scoping semantics are about 20 years old. They are in practice, and in most details, somewhat older, but they are based on years of post-MACLISP practice, are consistent, and when reasonable conventions are used generally don't cause practical programming problems. Maxima binding semantics date from MACLISP, about 50 years ago, before the distinction between "special" and "lexical" bindings had been clearly delineated in practice. The issue you suggest about a pernicious promiscuous special proclamation is a real issue, but it is almost never an actual issue, assuming accepted reasonable coding practices. That is why CL programmers always name special variables with leading and trailing *stars*. (Sometimes low-level constants are decorated differently, e.g. .data-offset. or %data-offset%.) These conventions both reduce the possibility of collisions and improve readability of code. I've previously proposed, perhaps mischievously, that the code in both Maxima implementation and Maxima user applications would be improved if the language were changed to mimic CL bding and scoping semantics. This is an honest and sincerely-considered opinion; it is mischievous only because that would be an impractically-high back compatibility hill to traverse. (I'd apologize here if this message is unbearably tedious, but certainly no reader will have gotten far enough to read the apology.) From dbmaxima at gmail.com Mon Jan 16 21:13:24 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Tue, 17 Jan 2012 14:13:24 +1100 Subject: [Maxima] maxima for windows with modern gcc/gcl Message-ID: <4F14E754.2070100@gmail.com> A couple of days ago I posted a windows installer for maxima-5.26.0 at http://billinghurst.customer.netspace.net.au/maxima-5.26.0.exe See http://www.math.utexas.edu/pipermail/maxima/2012/027451.html Having set up the build system, I decided to try it on a current mingw/msys installation. As some of you know, it is a tricky build as gcl on windows is touchy. The last version of gcc that could be used to build gcl was gcc-3.3.1 from August 2003, and you need to have an ancient mingw/msys install. See the INSTALL.win32 file in maxima cvs for the details. There has been some progress with gcl. One can now build gcl with the latest mingw32/msys using gcc-4.6.2 and successfully build a working maxima. While the build works on 32-bit WinXP, I haven't managed to reproduce it (yet) on a 64-bit Windows 7 machine. Anyway, I have uploaded a test installer of maxima cvs 2012-01-16 using gcc-4.6.2 to http://billinghurst.customer.netspace.net.au/maxima-5.26.0-test.exe This is still work in progress, and some documentation is required, but I'd welcome feedback. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From ferriste at gmail.com Tue Jan 17 02:21:45 2012 From: ferriste at gmail.com (Stefano Ferri) Date: Tue, 17 Jan 2012 09:21:45 +0100 Subject: [Maxima] maxima for windows with modern gcc/gcl In-Reply-To: <4F14E754.2070100@gmail.com> References: <4F14E754.2070100@gmail.com> Message-ID: I was also trying to build a Maxima installer when Robert asked for that, but I was stuck with the compilation of gcl. I've read the install.win32 but I've installed the latest version of Minsys/Mingw to see if they worked. First, the ./confgure was extremely slow (I have a slow pc, but while on a Linux box it takes 1-2 minutes to complete, on windows it takes about 20 minutes), but maybe this is a Mingw/Minsys-related issue. The problem is that configure complains about a missing xdr_double and stops with an error. I've not found a solution for that, how have you set up the build environment? I've made a complete installation via installer, and not manually downloaded and installed files and suggested in install.win32. Do I need some other package? Thanks Stefano 2012/1/17 David Billinghurst > ** > A couple of days ago I posted a windows installer for maxima-5.26.0 at > > http://billinghurst.customer.netspace.net.au/maxima-5.26.0.exeSee http://www.math.utexas.edu/pipermail/maxima/2012/027451.html > > > Having set up the build system, I decided to try it on a current > mingw/msys installation. As some of you know, it is a tricky build as gcl > on windows is touchy. The last version of gcc that could be used to build > gcl was gcc-3.3.1 from August 2003, and you need to have an ancient > mingw/msys install. See the INSTALL.win32 file in maxima cvs for the > details. There has been some progress with gcl. One can now build gcl > with the latest mingw32/msys using gcc-4.6.2 and successfully build a > working maxima. While the build works on 32-bit WinXP, I haven't managed > to reproduce it (yet) on a 64-bit Windows 7 machine. > > Anyway, I have uploaded a test installer of maxima cvs 2012-01-16 using > gcc-4.6.2 to > > http://billinghurst.customer.netspace.net.au/maxima-5.26.0-test.exe > > This is still work in progress, and some documentation is required, but I'd welcome feedback. > > David > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dbmaxima at gmail.com Tue Jan 17 04:46:11 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Tue, 17 Jan 2012 21:46:11 +1100 Subject: [Maxima] maxima for windows with modern gcc/gcl In-Reply-To: References: <4F14E754.2070100@gmail.com> Message-ID: <4F155173.5070607@gmail.com> On 17/01/2012 7:21 PM, Stefano Ferri wrote: > I was also trying to build a Maxima installer when Robert asked for > that, but I was stuck with the compilation of gcl. I've read the > install.win32 but I've installed the latest version of Minsys/Mingw to > see if they worked. > > First, the ./confgure was extremely slow (I have a slow pc, but while > on a Linux box it takes 1-2 minutes to complete, on windows it takes > about 20 minutes), but maybe this is a Mingw/Minsys-related issue. > > The problem is that configure complains about a missing xdr_double and > stops with an error. I've not found a solution for that, how have you > set up the build environment? I've made a complete installation via > installer, and not manually downloaded and installed files and > suggested in install.win32. Do I need some other package? > > Thanks > Stefano > Here are some rough notes. Happy to explain further as required. I may have missed a step or two. This works for me in WinXP 32-bit but not on Window 7 64-bit, where gcl configure chokes. If you are getting the xdr error then you are past the tests that fail for me. It is slow, and anti-virus software will make it even worse To compile gcl * latest mingw installation with gcc-4.6.2. Not sure exactly which packages are installed, but I just added them using mingw-get as required. I don't recall any problems here. * gcl-2.6.8pre from CVS * xdr isn't needed for maxima. I couldn't disable it in configure, and the test seems broken, so I just removed the tests using the patch below. * /configure --enable-ansi --enable-dynsysgmp; make; make install It would be better to provide xdr or fix gcl configure so that --disable-xdr or enable-xdr=no works. To compile maxima * ActiveState perl and python (32-bit) with wrapper scripts for perl and python in /usr/local/bin. Can also do this with PATH but wrappers work better for me. * some other tools as given in INSTALL.win32, but using latest versions I could find. You don't need many of them until you build an installer * sh bootstrap; configure; make; make check * if you are building an installer then you need the configure line as given in INSTALL.win32 To install maxima and make installer * wxMaxima binary from Andrej (as I haven't tried to build it from source yet). Just copy the whole folder from latest installer, and put it where "make iss" can find it - see interfaces/xmaxima/win32/Makefile * ActiveState tcl * Other tools as given in INSTALL.win32, but using latest versions I could find. * Changes to interfaces/xmaxima/win32/Makefile (attached) after running configure. o use tcl header, library and dll from c:/tcl o install parts of gcc needed to compile maxima using gcl * make install; make iss * run the maxima.iss file through InnoSetup $ diff -u configure.orig configure --- configure.orig 2012-01-16 21:59:22 +1100 +++ configure 2012-01-17 21:12:25 +1100 @@ -2546,11 +2546,11 @@ # Check whether --enable-xdr was given. -if test "${enable_xdr+set}" = set; then : - enableval=$enable_xdr; try_xdr=$enableval -else +#if test "${enable_xdr+set}" = set; then : +# enableval=$enable_xdr; try_xdr=$enableval +#else try_xdr="no" -fi +#fi # Check whether --enable-xgcl was given. @@ @@ -5691,56 +5691,6 @@ fi -ac_fn_c_check_func "$LINENO" "xdr_double" "ac_cv_func_xdr_double" -if test "x$ac_cv_func_xdr_double" = xyes; then : - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xdr_double in -ltirpc" >&5 -$as_echo_n "checking for xdr_double in -ltirpc... " >&6; } -if ${ac_cv_lib_tirpc_xdr_double+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ltirpc $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char xdr_double (); -int -main () -{ -return xdr_double (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_tirpc_xdr_double=yes -else - ac_cv_lib_tirpc_xdr_double=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tirpc_xdr_double" >&5 -$as_echo "$ac_cv_lib_tirpc_xdr_double" >&6; } -if test "x$ac_cv_lib_tirpc_xdr_double" = xyes; then : - TLIBS="$TLIBS -ltirpc" -else - as_fn_error $? "Need xdr_double" "$LINENO" 5 -fi - -fi - - - -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Makefile URL: From camm at maguirefamily.org Tue Jan 17 11:02:57 2012 From: camm at maguirefamily.org (Camm Maguire) Date: Tue, 17 Jan 2012 12:02:57 -0500 Subject: [Maxima] Debian bugs In-Reply-To: (Robert Dodier's message of "Mon, 16 Jan 2012 09:15:12 -0700") References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> <1326315301.1548.19.camel@ubuntu> <23737.1326342202@gemini.franz.com> Message-ID: <87pqeiw9by.fsf_-_@maguirefamily.org> Greetings! The Debian BTS has a tagging mechanism supporting bug forwarding, and uses an email address for the forwarding. In the past, I've forwarded to this list. I imagine the developers would prefer entries at sourceforge, but then we'd drop the connection in the BTS. I have a few piled up now, and would like to forward. Suggestions? -- Camm Maguire camm at maguirefamily.org ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah From camm at maguirefamily.org Tue Jan 17 11:23:48 2012 From: camm at maguirefamily.org (Camm Maguire) Date: Tue, 17 Jan 2012 12:23:48 -0500 Subject: [Maxima] maxima for windows with modern gcc/gcl In-Reply-To: <4F14E754.2070100@gmail.com> (David Billinghurst's message of "Tue, 17 Jan 2012 14:13:24 +1100") References: <4F14E754.2070100@gmail.com> Message-ID: <87lip6w8d7.fsf@maguirefamily.org> Greetings! Great to hear of your progress. BTW, I build frequently under latest wine/mingw packages in Debian, together with maxima/acl2/axiom, without issue. Had a native windows box too recently and got things working. axiom needs xdr. Latest glibc moves the functions, and my configure fix was too stringent. How about this: --- configure.in 16 Jan 2012 20:08:03 -0000 1.112.4.1.2.2.2.47.2.3.2.1.4.2.4.2.4.70 +++ configure.in 17 Jan 2012 17:21:56 -0000 @@ -66,7 +66,7 @@ [try_japi=$enableval],[try_japi="no"]) AC_ARG_ENABLE(xdr,[ --enable-xdr=yes will compile in support for XDR], -[try_xdr=$enableval],[try_xdr="no"]) +[enable_xdr=$enableval],[enable_xdr="yes"]) AC_ARG_ENABLE(xgcl,[ --enable-xgcl=yes will compile in support for XGCL], [enable_xgcl=$enableval],[enable_xgcl="yes"]) @@ -1046,8 +1046,12 @@ fi -AC_CHECK_FUNC(xdr_double,, - AC_CHECK_LIB(tirpc,xdr_double,TLIBS="$TLIBS -ltirpc",AC_MSG_ERROR([Need xdr_double]))) +if test "$enable_xdr" = "yes" ; then + AC_CHECK_FUNC(xdr_double,AC_DEFINE(HAVE_XDR), + AC_CHECK_LIB(tirpc,xdr_double,AC_DEFINE(HAVE_XDR) TLIBS="$TLIBS -ltirpc", + AC_CHECK_LIB(rpc,xdr_double,AC_DEFINE(HAVE_XDR) TLIBS="$TLIBS -lrpc", + AC_CHECK_LIB(oncrpc,xdr_double,AC_DEFINE(HAVE_XDR) TLIBS="$TLIBS -loncrpc")))) +fi AC_MSG_CHECKING(__builtin___clear_cache) AC_TRY_COMPILE([], @@ -1373,17 +1377,17 @@ EXTRA_LOBJS="${EXTRA_LOBJS} gcl_japi.o" LIBS="${LIBS} -ljapi -lwsock32"] ) fi -if test "$use" = "mingw" ; then - if test "$try_xdr" = "yes" ; then - AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) - LIBS="${LIBS} -loncrpc"] ) - fi -else - if test "$try_xdr" = "yes" ; then - AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) - LIBS="${LIBS} -lrpc"] ) - fi -fi +dnl if test "$use" = "mingw" ; then +dnl if test "$try_xdr" = "yes" ; then +dnl AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) +dnl LIBS="${LIBS} -loncrpc"] ) +dnl fi +dnl else +dnl if test "$try_xdr" = "yes" ; then +dnl AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) +dnl LIBS="${LIBS} -lrpc"] ) +dnl fi +dnl fi # Should really find a way to check for prototypes, but this # basically works for now. CM David Billinghurst writes: > A couple of days ago I posted a windows installer for maxima-5.26.0 at > > http://billinghurst.customer.netspace.net.au/maxima-5.26.0.exe > > See http://www.math.utexas.edu/pipermail/maxima/2012/027451.html > > Having set up the build system, I decided to try it on a current mingw/msys installation. As some of you know, it is a tricky build as gcl on > windows is touchy. The last version of gcc that could be used to build gcl was gcc-3.3.1 from August 2003, and you need to have an ancient mingw/ > msys install. See the INSTALL.win32 file in maxima cvs for the details. There has been some progress with gcl. One can now build gcl with the > latest mingw32/msys using gcc-4.6.2 and successfully build a working maxima. While the build works on 32-bit WinXP, I haven't managed to reproduce > it (yet) on a 64-bit Windows 7 machine. > > Anyway, I have uploaded a test installer of maxima cvs 2012-01-16 using gcc-4.6.2 to > > http://billinghurst.customer.netspace.net.au/maxima-5.26.0-test.exe > > This is still work in progress, and some documentation is required, but I'd welcome feedback. > > David > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- Camm Maguire camm at maguirefamily.org ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah From robert.dodier at gmail.com Tue Jan 17 15:13:03 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 17 Jan 2012 14:13:03 -0700 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: <27714.1326765225@gemini.franz.com> References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> <1326315301.1548.19.camel@ubuntu> <23737.1326342202@gemini.franz.com> <27714.1326765225@gemini.franz.com> Message-ID: Steve, I'm glad to hear that lexical scope is indeed achievable, although I'm dismayed to find it's rather clumsy. About macrology, a LET-like macro which guaranteed lexical binding seems useful. The stuff about programming conventions is beside the point; either the programming language guarantees lexical binding or it doesn't. You will recall we arrived here because reasonable people made different assumptions about symbol LB. I'm in favor of implementing lexical scope in Maxima, although there's no need to replicate CL's craziness. I suspect most user programs would work the same if function and block variables obeyed lexical binding, so, while it would be a substantial change, the trouble it causes for users would be tractable; no need to dismiss lexical binding out of hand. best Robert Dodier From toy.raymond at gmail.com Tue Jan 17 15:20:13 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 17 Jan 2012 13:20:13 -0800 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> <1326315301.1548.19.camel@ubuntu> <23737.1326342202@gemini.franz.com> <27714.1326765225@gemini.franz.com> Message-ID: On Tue, Jan 17, 2012 at 1:13 PM, Robert Dodier wrote: > Steve, I'm glad to hear that lexical scope is indeed achievable, > although I'm dismayed to find it's rather clumsy. > About macrology, a LET-like macro which guaranteed lexical > binding seems useful. > Like emacs' lexical-let? > > The stuff about programming conventions is beside the point; > either the programming language guarantees lexical binding > or it doesn't. You will recall we arrived here because > reasonable people made different assumptions about symbol LB. > Recall that maxima has the declare unspecial feature that makes symbols that were special no longer special. I think all the lisps we build with have this ability. But I'd rather make all special symbols follow the *convention*. Unfortunately, I don't think we can do this without a lot of manual work because we need to be able to tell if the variable is really the same as some other special variable in some other file. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Jan 17 15:29:09 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 17 Jan 2012 16:29:09 -0500 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> <1326315301.1548.19.camel@ubuntu> <23737.1326342202@gemini.franz.com> <27714.1326765225@gemini.franz.com> Message-ID: Not sure what lexical scope in the Maxima language (call it MaximaL) has to do with lexical scope in the implementation Lisp, call it MaxLisp (which was the original issue). Both MaximaL and MaxLisp use a variety of global variables to control the behavior of various functions. Things like $simp, $algebraic, $gcd, $fpprec, $ratvars, etc. It is a common idiom to write block([algebraic:false], ...) or its equivalent in Lisp. This is ugly and error-prone, but very convenient, and pretty common. Of course, you could always have some way of exempting some variables (declare them "dynamic") but then you're back to the original problem of lack of referential transparency. This is without addressing the question of the interpretation of symbolic variables. For example, what is the value of block([x],x)-x? Is it 0? Or is the inner x a different symbolic variable? -s On Tue, Jan 17, 2012 at 16:13, Robert Dodier wrote: > Steve, I'm glad to hear that lexical scope is indeed achievable, > although I'm dismayed to find it's rather clumsy. > About macrology, a LET-like macro which guaranteed lexical > binding seems useful. > > The stuff about programming conventions is beside the point; > either the programming language guarantees lexical binding > or it doesn't. You will recall we arrived here because > reasonable people made different assumptions about symbol LB. > > I'm in favor of implementing lexical scope in Maxima, > although there's no need to replicate CL's craziness. > I suspect most user programs would work the same if function and block > variables > obeyed lexical binding, so, while it would be a substantial change, > the trouble it causes for users would be tractable; no need to dismiss > lexical binding out of hand. > > best > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Tue Jan 17 16:31:32 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Tue, 17 Jan 2012 22:31:32 +0000 Subject: [Maxima] invert_by_lu does not work as expected References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> <1326315301.1548.19.camel@ubuntu> <23737.1326342202@gemini.franz.com> <27714.1326765225@gemini.franz.com> Message-ID: <4f9hu8xhff.ln2@hake.rswarbrick.dnsalias.com> Raymond Toy writes: >> The stuff about programming conventions is beside the point; >> either the programming language guarantees lexical binding >> or it doesn't. You will recall we arrived here because >> reasonable people made different assumptions about symbol LB. >> > > Recall that maxima has the declare unspecial feature that makes symbols > that were special no longer special. I think all the lisps we build with > have this ability. But I'd rather make all special symbols follow the > *convention*. Unfortunately, I don't think we can do this without a lot of > manual work because we need to be able to tell if the variable is really > the same as some other special variable in some other file. I agree about it being nice to add earmuffs, but are there backwards compatibility issues to worry about? About deciding on possible naming conflicts, I wouldn't think it's too difficult. Something as short as LB was pretty obvious to work out who was doing what. Presumably most variables would be considerably easier. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From willisb at unk.edu Tue Jan 17 17:14:25 2012 From: willisb at unk.edu (Barton Willis) Date: Tue, 17 Jan 2012 17:14:25 -0600 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: References: , <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> <1326315301.1548.19.camel@ubuntu> <23737.1326342202@gemini.franz.com> <27714.1326765225@gemini.franz.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- > Not sure what lexical scope in the Maxima language (call it MaximaL) has to do with lexical scope in the implementation Lisp, Maybe would be possible to modify the Maxima to CL translator to remove most of the special declarations, and to insert a few lines of code in the read-eval-print loop that translates all inputs. That might be a quick way to experiment with MaximaL? Likely, I don't know what I'm talking about. --bw From toy.raymond at gmail.com Tue Jan 17 17:19:15 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 17 Jan 2012 15:19:15 -0800 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: <4f9hu8xhff.ln2@hake.rswarbrick.dnsalias.com> References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> <1326315301.1548.19.camel@ubuntu> <23737.1326342202@gemini.franz.com> <27714.1326765225@gemini.franz.com> <4f9hu8xhff.ln2@hake.rswarbrick.dnsalias.com> Message-ID: On Tue, Jan 17, 2012 at 2:31 PM, Rupert Swarbrick wrote: > Raymond Toy writes: > >> The stuff about programming conventions is beside the point; > >> either the programming language guarantees lexical binding > >> or it doesn't. You will recall we arrived here because > >> reasonable people made different assumptions about symbol LB. > >> > > > > Recall that maxima has the declare unspecial feature that makes symbols > > that were special no longer special. I think all the lisps we build with > > have this ability. But I'd rather make all special symbols follow the > > *convention*. Unfortunately, I don't think we can do this without a lot > of > > manual work because we need to be able to tell if the variable is really > > the same as some other special variable in some other file. > > I agree about it being nice to add earmuffs, but are there backwards > compatibility issues to worry about? About deciding on possible naming > Why would there be backward compatibility issues? Do you mean on some third-party code that uses these renamed variables? Yes, that would be a problem, but should be pretty obvious. > conflicts, I wouldn't think it's too difficult. Something as short as LB > was pretty obvious to work out who was doing what. Presumably most > variables would be considerably easier. > I think LB was easy because the number of places where it was used was fairly small and the code using it was pretty readable. That's not true for a lot of the code. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From gwpublic at wp.pl Tue Jan 17 18:12:07 2012 From: gwpublic at wp.pl (gwpublic at wp.pl) Date: Wed, 18 Jan 2012 01:12:07 +0100 Subject: [Maxima] lsquares fitting and constrains for parameters (looking for positive values of parameters) In-Reply-To: References: <4F1389B0.4040309@gmail.com> Message-ID: On Mon, Jan 16, 2012 at 9:12 PM, wrote: >>> > If you do not need a symbolic solution, >>> >>> You're right. I need concrete values. (I've forgot to say it in >>> problem statement). >>> >>> > you might be interested in >>> > fmin_cobyla, which will produce the minimum of a function subject to >>> > equality or inequality constraints. >>> >>> fmin_cobyla, I haven't knew about it. (btw. I see it's implemented in >>> Scipy as well.) >>> >>> I try to figure out how to make it to obey constraints, with no >>> success. Results are not positive, and even worse than >>> lsquares_estimate. >>> >>> As I doing sth wrong ? >>> Or sum equations are not fmin_cobyla's purpose, are they ? >>> >> >> From what I can see, you're doing everything correctly.? I have noticed that >> fmin_cobyla is sensitive to the initial guess.?? With your example, >> fmin_cobyla does return positive values for the parameters, except a3, which >> is very small and slightly negative. >> >> It's also possible that by giving a too-complicated expression makes cobyla >> less efficient.? Just from looking at the data matrix, it's clear that the >> relationship is linear (difference each y value is a constant). >> >> Perhaps a better example would be a real cubic with some noise added to the >> y values. >> >> Ray > > Thanks for ensuring me I am doing everything fine. > > Now I know, it's question of "workarounds" and "tuning" to make all > this stuff work as expected :). > > All Best, > Greg Hi ! I've found solution for main part of my problem and I'd like to share :). As a reminder: "How to fit parametrized function to data, to achieve grater than zero parameters?" I've started by asking about lsquare_estimate, Raymond Toy pointed fmin_cobyla. I've found it can be done, not by constraining, but with "trick". I think it's universal and works for many many problems, when numerical or symbolic method does not provide way of "feeding" with constraints: abs ! Yes, that was that simple. So instead of fitting with lsquares_estimate expression like this: a*x^4 + b*x^3 + d*x + e I fit expression with all parameters after "abs" : abs(a)*x^4 + abs(b)*x^3 + abs(d)*x + abs(e) :) Again - Thanks Raymond Toy for showing fmin_cobyla, I've missed it when going thought manual :). Cheers, Greg From robert.dodier at gmail.com Wed Jan 18 01:05:39 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 18 Jan 2012 00:05:39 -0700 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> <1326315301.1548.19.camel@ubuntu> <23737.1326342202@gemini.franz.com> <27714.1326765225@gemini.franz.com> Message-ID: On 1/17/12, Raymond Toy wrote: > Like emacs' lexical-let? Maybe, I don't know anything about Emacs Lisp. > Recall that maxima has the declare unspecial feature that makes symbols > that were special no longer special. I think all the lisps we build with > have this ability. Nope. The default implementation of the unspecial stuff attempts to remove the SPECIAL property from a symbol. Needless to say that's nonportable, and more to the point, generally has no effect. There are a couple of per-implementation versions of unspecial; the GCL version reaches into generated C code to fiddle with some bits. Yikes. I'm inclined to nuke all the unspecial declarations. They can't be necessary, since Maxima apparently works OK with implementations for which unspecial is a no-op. > But I'd rather make all special symbols follow the > *convention*. Unfortunately, I don't think we can do this without a lot of > manual work because we need to be able to tell if the variable is really > the same as some other special variable in some other file. I think it's worth the effort to paste the earmuffs onto all special variables (except for Maxima global variables). It makes the code clearer, reduces bugs, it's not too difficult, and it's the kind of project that can be carried out a little bit at a time. best Robert Dodier From robert.dodier at gmail.com Wed Jan 18 01:16:21 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 18 Jan 2012 00:16:21 -0700 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> <1326315301.1548.19.camel@ubuntu> <23737.1326342202@gemini.franz.com> <27714.1326765225@gemini.franz.com> Message-ID: On 1/17/12, Stavros Macrakis wrote: > Not sure what lexical scope in the Maxima language (call it MaximaL) has to > do with lexical scope in the implementation Lisp, call it MaxLisp (which > was the original issue). Well, of course there is no necessary connection. But the one topic seems to lead to the other. > Both MaximaL and MaxLisp use a variety of global variables to control the > behavior of various functions. Things like $simp, $algebraic, $gcd, > $fpprec, $ratvars, etc. It is a common idiom to write > block([algebraic:false], ...) or its equivalent in Lisp. This is ugly and > error-prone, but very convenient, and pretty common. Yup. > Of course, you could always have some way of exempting > some variables (declare them "dynamic") > but then you're back to the original problem of lack of referential > transparency. Well, would it be OK if such "unlexical" declarations were local in effect? The bug we ran into with LB stems from the unbounded scope of PROCLAIM .... > This is without addressing the question of the interpretation of symbolic > variables. For example, what is the value of block([x],x)-x? Is it 0? Or > is the inner x a different symbolic variable? Well, to be consistent, wouldn't we have to say that the inner x is a different symbol, and therefore the result will look like x - x ? I agree that would be puzzling to users, but consistency is less puzzling in the long run, I hope. best Robert Dodier From lapeyre.math122a at gmail.com Wed Jan 18 08:41:23 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Wed, 18 Jan 2012 15:41:23 +0100 Subject: [Maxima] make-array with initial-contents in gcl is slow Message-ID: <4F16DA13.70209@gmail.com> In gcl make-array with :initial-contents from a list is poorly implemented in that the copying is O(n^2). A test on one machine shows that initializing a list of length of 5 10^4 takes 1 minute in gcl and a few ms in sbcl. This potentially affects some code in the share directory. The relevant part of the gcl code in make-array is: ((= (length dimensions) 1) (let ((x (si:make-vector element-type (car dimensions) adjustable fill-pointer displaced-to displaced-index-offset static initial-element))) (when initial-contents-supplied-p (do ((n (car dimensions)) (i 0 (1+ i))) ((>= i n)) (declare (fixnum n i)) (si:aset x i (elt initial-contents i)))) x)) The following passed a quick test: ((= (length dimensions) 1) (let ((x (si:make-vector element-type (car dimensions) adjustable fill-pointer displaced-to displaced-index-offset static initial-element))) (when initial-contents-supplied-p (if (listp initial-contents) (do ( (e initial-contents (cdr e)) (i 0 (1+ i))) ((null e)) (declare (fixnum i)) (si:aset x i (car e))) (do ((n (car dimensions)) (i 0 (1+ i))) ((>= i n)) (declare (fixnum n i)) (si:aset x i (elt initial-contents i))))) x)) -- John Lapeyre From rswarbrick at gmail.com Wed Jan 18 08:47:52 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Wed, 18 Jan 2012 14:47:52 +0000 Subject: [Maxima] make-array with initial-contents in gcl is slow References: <4F16DA13.70209@gmail.com> Message-ID: John Lapeyre writes: > In gcl make-array with :initial-contents from a list > is poorly implemented in that the copying is O(n^2). > A test on one machine shows that initializing a > list of length of 5 10^4 takes 1 minute in gcl and a few ms in sbcl. Have you reported this to the GCL project? It would be bizarre, to say the least, for Maxima to ship with fixes to various lisp implementations' basic algorithms. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From cfrangos123 at gmail.com Mon Jan 16 02:08:59 2012 From: cfrangos123 at gmail.com (Constantine Frangos) Date: Mon, 16 Jan 2012 10:08:59 +0200 Subject: [Maxima] Double integration. In-Reply-To: References: Message-ID: Hi Stavro, Thanks for the detailed response. I was wondering whether the difficutlies you mention can be overcome in the following manner. A new Maxima integration function, num_integration, internally calls a user defined Maxima function, say integrandf, and passes the values of the integration variables, x1, x2, together with the values of other parameters, p1,p2,..., needed to compute the integrand, as follows, ........ I1 : apply(integrandf,[x1,x2,p1,p2,...]); ......... The user would call num_integration with something like, I : num_integration(integrandf,list_of_limits,p1,p2,....); Any suggestions would be appreciated. Regards, Constantine. On 1/12/12, Stavros Macrakis wrote: > As Alexander says, you don't need the temporary variable etc. > > Also, if you explicitly quote everything, you are less likely to have bad > surprises. Something like this: > > (%i27) (cnt:0,quad_qags('(quad_qags('(cnt:cnt+1,if x>y then 1 else > 0),x,0,1)[1]),y,0,1)); > (%o27) [0.49999763949292, 3.4177098928722671E-9, 735, 0] > (%i28) cnt; > (%o28) 621243 > > Note the number of function evaluations for a very simple case! Note also > that the result is not very accurate, and that the error estimate is way > off. I imagine there are better routines for this kind of integration. > Obviously in this case it is easy to transform to a single integral (even > analytical), but presumably you want to handle more complicated integrands. > > -s > > On Thu, Jan 12, 2012 at 05:38, Alexander Klimov wrote: > >> Hi. >> >> On Thu, 12 Jan 2012, Constantine Frangos wrote: >> > (1) Its not clear why the function definition I am using does not >> > work. According to the Maxima 5.24 manual, paragraph 20.4, the >> > integrand can be the name of a Maxima function, presumably defined by >> > the user in a file, for example, integrand.mac >> >> Your function does not always return a number. Consider your original >> definition: >> >> (%i1) ind(x,y) := block([s],if is(x*x + y*y <= 1) then (s : 1) else (s : >> 0),return(s))$ >> >> Let us see how it works >> >> (%i2) trace(ind); >> (%o2) [ind] >> >> If one gives numerical arguments, then your function returns the >> number which is assigned to "s" >> >> (%i3) ind(0,1); >> 1 Enter ind [0, 1] >> 1 Exit ind 1 >> (%o3) 1 >> >> but with symbols as arguments nothing is assigned to "s" and thus the >> function returns just a symbol "s" >> >> (%i4) ind(x1,x2); >> 1 Enter ind [x1, x2] >> 1 Exit ind s >> (%o4) s >> >> and this is exactly what happens when you use it in integration >> >> (%i5) I:quad_qags(quad_qags(ind(x1,x2),x1,-1,1)[1],x2,-1,1); >> 1 Enter ind [x1, x2] >> 1 Exit ind s >> COERCE-FLOAT-FUN: no such Lisp or Maxima function: s >> -- an error. To debug this try: debugmode(true); >> >> > (2) Are there perhaps other Maxima numerical integration functions >> > that may perform better ? >> >> As I said, it is better to >> >> > > use a simple integral: >> > > >> > > (%i4) quad_qags(2*sqrt(1-y^2),y,-1,1); >> > > (%o4) [3.141592653589797, 2.000470900043183e-9, 399, 0] >> >> the problem with indicators is that while they may be suitable for >> symbolic manipulations, they are bad functions for Gaussian quadrature >> rule which is only good if the function is similar to a polynomial. >> >> -- >> Regards, >> ASK >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > From camm at maguirefamily.org Wed Jan 18 12:00:27 2012 From: camm at maguirefamily.org (Camm Maguire) Date: Wed, 18 Jan 2012 13:00:27 -0500 Subject: [Maxima] make-array with initial-contents in gcl is slow In-Reply-To: <4F16DA13.70209@gmail.com> (John Lapeyre's message of "Wed, 18 Jan 2012 15:41:23 +0100") References: <4F16DA13.70209@gmail.com> Message-ID: <87fwfcevr8.fsf@maguirefamily.org> Greetings! And thanks for your report! If you would cae to try out the pach below, I'd be most appreciative! ============================================================================= Index: lsp/gcl_arraylib.lsp =================================================================== RCS file: /sources/gcl/gcl/lsp/gcl_arraylib.lsp,v retrieving revision 1.1.2.1 diff -u -u -r1.1.2.1 gcl_arraylib.lsp --- lsp/gcl_arraylib.lsp 14 Sep 2003 02:30:35 -0000 1.1.2.1 +++ lsp/gcl_arraylib.lsp 18 Jan 2012 17:58:46 -0000 @@ -74,47 +74,73 @@ (defun make-array (dimensions &key (element-type t) - (initial-element nil) + initial-element (initial-contents nil initial-contents-supplied-p) adjustable fill-pointer displaced-to (displaced-index-offset 0) static) (when (integerp dimensions) (setq dimensions (list dimensions))) - (setq element-type (best-array-element-type element-type)) - (cond ((= (length dimensions) 1) - (let ((x (si:make-vector element-type (car dimensions) - adjustable fill-pointer - displaced-to displaced-index-offset - static initial-element))) - (when initial-contents-supplied-p - (do ((n (car dimensions)) - (i 0 (1+ i))) - ((>= i n)) - (declare (fixnum n i)) - (si:aset x i (elt initial-contents i)))) - x)) - (t - (let ((x - (make-array1 - (the fixnum(get-aelttype element-type)) - static initial-element - displaced-to (the fixnum displaced-index-offset) - dimensions))) - (if fill-pointer (error "fill pointer for 1 dimensional arrays only")) - (unless (member 0 dimensions) - (when initial-contents-supplied-p - (do ((cursor - (make-list (length dimensions) - :initial-element 0))) - (nil) - (declare (:dynamic-extent cursor)) - (aset-by-cursor x - (sequence-cursor initial-contents - cursor) - cursor) - (when (increment-cursor cursor dimensions) - (return nil))))) - x)))) + (setq element-type (or (upgraded-array-element-type element-type) 'character)) + (if (= (length dimensions) 1) + (let ((x (si:make-vector element-type (car dimensions) adjustable (when fill-pointer (car dimensions)) + displaced-to displaced-index-offset static initial-element))) + (when initial-contents-supplied-p + (replace x initial-contents)) + (when (and fill-pointer (not (eq t fill-pointer))) (setf (fill-pointer x) fill-pointer)) + x) + (let ((x (make-array1 (get-aelttype element-type) static initial-element displaced-to displaced-index-offset dimensions))) + (if fill-pointer (error "fill pointer for 1 dimensional arrays only")) + (unless (member 0 dimensions) + (when initial-contents-supplied-p + (do ((j nil t)(cursor (make-list (length dimensions) :initial-element 0))) + ((when j (increment-cursor cursor dimensions))) + (declare (:dynamic-extent cursor)) + (aset-by-cursor x (sequence-cursor initial-contents cursor) cursor)))) + x))) + +;; (defun make-array (dimensions +;; &key (element-type t) +;; (initial-element nil) +;; (initial-contents nil initial-contents-supplied-p) +;; adjustable fill-pointer +;; displaced-to (displaced-index-offset 0) +;; static) +;; (when (integerp dimensions) (setq dimensions (list dimensions))) +;; (setq element-type (best-array-element-type element-type)) +;; (cond ((= (length dimensions) 1) +;; (let ((x (si:make-vector element-type (car dimensions) +;; adjustable fill-pointer +;; displaced-to displaced-index-offset +;; static initial-element))) +;; (when initial-contents-supplied-p +;; (do ((n (car dimensions)) +;; (i 0 (1+ i))) +;; ((>= i n)) +;; (declare (fixnum n i)) +;; (si:aset x i (elt initial-contents i)))) +;; x)) +;; (t +;; (let ((x +;; (make-array1 +;; (the fixnum(get-aelttype element-type)) +;; static initial-element +;; displaced-to (the fixnum displaced-index-offset) +;; dimensions))) +;; (if fill-pointer (error "fill pointer for 1 dimensional arrays only")) +;; (unless (member 0 dimensions) +;; (when initial-contents-supplied-p +;; (do ((cursor +;; (make-list (length dimensions) +;; :initial-element 0))) +;; (nil) +;; (declare (:dynamic-extent cursor)) +;; (aset-by-cursor x +;; (sequence-cursor initial-contents +;; cursor) +;; cursor) +;; (when (increment-cursor cursor dimensions) +;; (return nil))))) +;; x)))) (defun increment-cursor (cursor dimensions) Index: lsp/gcl_seqlib.lsp =================================================================== RCS file: /sources/gcl/gcl/lsp/gcl_seqlib.lsp,v retrieving revision 1.1.2.2 diff -u -u -r1.1.2.2 gcl_seqlib.lsp --- lsp/gcl_seqlib.lsp 20 Mar 2004 02:00:01 -0000 1.1.2.2 +++ lsp/gcl_seqlib.lsp 18 Jan 2012 17:58:46 -0000 @@ -149,33 +149,53 @@ (setf (elt sequence i) item)))) -(defun replace (sequence1 sequence2 - &key start1 end1 - start2 end2 ) - (with-start-end start1 end1 sequence1 - (with-start-end start2 end2 sequence2 - (if (and (eq sequence1 sequence2) - (> start1 start2)) - (do* ((i 0 (f+ 1 i)) - (l (if (< (f- end1 start1) - (f- end2 start2)) - (f- end1 start1) - (f- end2 start2))) - (s1 (f+ start1 (f+ -1 l)) (f+ -1 s1)) - (s2 (f+ start2 (f+ -1 l)) (f+ -1 s2))) - ((>= i l) sequence1) - (declare (fixnum i l s1 s2)) - (setf (elt sequence1 s1) (elt sequence2 s2))) - (do ((i 0 (f+ 1 i)) - (l (if (< (f- end1 start1) - (f- end2 start2)) - (f- end1 start1) - (f- end2 start2))) - (s1 start1 (f+ 1 s1)) - (s2 start2 (f+ 1 s2))) - ((>= i l) sequence1) - (declare (fixnum i l s1 s2)) - (setf (elt sequence1 s1) (elt sequence2 s2))))))) +(defun replace (s1 s2 &key (start1 0) end1 (start2 0) end2 &aux (os1 s1) s3) + (declare (optimize (safety 1))(notinline make-list)(dynamic-extent s3)) + (check-type s1 sequence) + (check-type s2 sequence) + (check-type start1 seqind) + (check-type start2 seqind) + (check-type end1 (or null seqind)) + (check-type end2 (or null seqind)) + (when (and (eq s1 s2) (> start1 start2)) + (setq s3 (make-list (length s2)) s2 (replace s3 s2))) + (let* ((lp1 (listp s1)) (lp2 (listp s2)) + (e1 (or end1 (if lp1 array-dimension-limit (length s1)))) + (e2 (or end2 (if lp2 array-dimension-limit (length s2))))) + (do ((i1 start1 (1+ i1))(i2 start2 (1+ i2)) + (s1 (if lp1 (nthcdr start1 s1) s1) (if lp1 (cdr s1) s1)) + (s2 (if lp2 (nthcdr start2 s2) s2) (if lp2 (cdr s2) s2))) + ((or (not s1) (>= i1 e1) (not s2) (>= i2 e2)) os1) + (let ((e2 (if lp2 (car s2) (aref s2 i2)))) + (if lp1 (setf (car s1) e2) (setf (aref s1 i1) e2)))))) + +;; (defun replace (sequence1 sequence2 +;; &key start1 end1 +;; start2 end2 ) +;; (with-start-end start1 end1 sequence1 +;; (with-start-end start2 end2 sequence2 +;; (if (and (eq sequence1 sequence2) +;; (> start1 start2)) +;; (do* ((i 0 (f+ 1 i)) +;; (l (if (< (f- end1 start1) +;; (f- end2 start2)) +;; (f- end1 start1) +;; (f- end2 start2))) +;; (s1 (f+ start1 (f+ -1 l)) (f+ -1 s1)) +;; (s2 (f+ start2 (f+ -1 l)) (f+ -1 s2))) +;; ((>= i l) sequence1) +;; (declare (fixnum i l s1 s2)) +;; (setf (elt sequence1 s1) (elt sequence2 s2))) +;; (do ((i 0 (f+ 1 i)) +;; (l (if (< (f- end1 start1) +;; (f- end2 start2)) +;; (f- end1 start1) +;; (f- end2 start2))) +;; (s1 start1 (f+ 1 s1)) +;; (s2 start2 (f+ 1 s2))) +;; ((>= i l) sequence1) +;; (declare (fixnum i l s1 s2)) +;; (setf (elt sequence1 s1) (elt sequence2 s2))))))) ;;; DEFSEQ macro. ============================================================================= John Lapeyre writes: > In gcl make-array with :initial-contents from a list > is poorly implemented in that the copying is O(n^2). > A test on one machine shows that initializing a > list of length of 5 10^4 takes 1 minute in gcl and a few ms in sbcl. > > This potentially affects some code in the share directory. > > The relevant part of the gcl code in make-array is: > > ((= (length dimensions) 1) > (let ((x (si:make-vector element-type (car dimensions) > adjustable fill-pointer > displaced-to displaced-index-offset > static initial-element))) > (when initial-contents-supplied-p > (do ((n (car dimensions)) > (i 0 (1+ i))) > ((>= i n)) > (declare (fixnum n i)) > (si:aset x i (elt initial-contents i)))) > x)) > > The following passed a quick test: > > ((= (length dimensions) 1) > (let ((x (si:make-vector element-type (car dimensions) > adjustable fill-pointer > displaced-to displaced-index-offset > static initial-element))) > (when initial-contents-supplied-p > (if (listp initial-contents) > (do ( (e initial-contents (cdr e)) > (i 0 (1+ i))) > ((null e)) > (declare (fixnum i)) > (si:aset x i (car e))) > (do ((n (car dimensions)) > (i 0 (1+ i))) > ((>= i n)) > (declare (fixnum n i)) > (si:aset x i (elt initial-contents i))))) > x)) > > -- John Lapeyre > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > > > -- Camm Maguire camm at maguirefamily.org ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah From camm at maguirefamily.org Wed Jan 18 12:09:39 2012 From: camm at maguirefamily.org (Camm Maguire) Date: Wed, 18 Jan 2012 13:09:39 -0500 Subject: [Maxima] make-array with initial-contents in gcl is slow In-Reply-To: <4F16DA13.70209@gmail.com> (John Lapeyre's message of "Wed, 18 Jan 2012 15:41:23 +0100") References: <4F16DA13.70209@gmail.com> Message-ID: <87k44o7uho.fsf@maguirefamily.org> Greetings! P.S. you need this ahead of the defun replace in 2.6.8pre: (deftype seqind nil `(integer 0 ,array-dimension-limit)) Take care, John Lapeyre writes: > In gcl make-array with :initial-contents from a list > is poorly implemented in that the copying is O(n^2). > A test on one machine shows that initializing a > list of length of 5 10^4 takes 1 minute in gcl and a few ms in sbcl. > > This potentially affects some code in the share directory. > > The relevant part of the gcl code in make-array is: > > ((= (length dimensions) 1) > (let ((x (si:make-vector element-type (car dimensions) > adjustable fill-pointer > displaced-to displaced-index-offset > static initial-element))) > (when initial-contents-supplied-p > (do ((n (car dimensions)) > (i 0 (1+ i))) > ((>= i n)) > (declare (fixnum n i)) > (si:aset x i (elt initial-contents i)))) > x)) > > The following passed a quick test: > > ((= (length dimensions) 1) > (let ((x (si:make-vector element-type (car dimensions) > adjustable fill-pointer > displaced-to displaced-index-offset > static initial-element))) > (when initial-contents-supplied-p > (if (listp initial-contents) > (do ( (e initial-contents (cdr e)) > (i 0 (1+ i))) > ((null e)) > (declare (fixnum i)) > (si:aset x i (car e))) > (do ((n (car dimensions)) > (i 0 (1+ i))) > ((>= i n)) > (declare (fixnum n i)) > (si:aset x i (elt initial-contents i))))) > x)) > > -- John Lapeyre > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > > > -- Camm Maguire camm at maguirefamily.org ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah From dlakelan at street-artists.org Wed Jan 18 13:39:01 2012 From: dlakelan at street-artists.org (dlakelan) Date: Wed, 18 Jan 2012 11:39:01 -0800 Subject: [Maxima] draw package, multiple plots with different sizes? Message-ID: <4F171FD5.20108@street-artists.org> Using draw, is it possible to do something like put one plot above the other, with the upper plot being say a square and the lower plot being a thin rectangle. To explain here is some sort of ascii art showing the relative aspect ratios I want to achieve. ------------- | | | | | | | | | | ------------- | | ------------- All I see is the option to specify more than one plot, the number of columns, and the overall size of the plot (the bounding box using "dimensions"). I want to do this with the pdfcairo terminal. Any suggestions, other than to make them separate plots and glue them together by hand? From maxima at mm.pl Wed Jan 18 13:53:56 2012 From: maxima at mm.pl (Piotr) Date: Wed, 18 Jan 2012 20:53:56 +0100 Subject: [Maxima] solution of system odes Message-ID: <4F172354.40809@mm.pl> Dear Users of the Forum, I have a problem with a program which I would like to solve system of odes, originating form method of lines. There is my program: kill(all); N:2;h:1/N; zz:2; fun(x):=1; for i:1 while i References: <4F14E754.2070100@gmail.com> <87lip6w8d7.fsf@maguirefamily.org> Message-ID: Thanks David and Camm. I've succesfully built gcl with the latest Mingw/Msys without pain. A simple checkout and a configure worked fine. Yes, I've noticed too that the option to disable xdr was broken, I didn't mention this fact in my previous email. Now I will try to finish the build process and the creation of the installer (just to learn how to do it). I think we should update the information given by install.win32, they are obsolete in some points and now the procedure is easier, at least for the gcl-related part. Stefano 2012/1/17 Camm Maguire > Greetings! Great to hear of your progress. BTW, I build frequently > under latest wine/mingw packages in Debian, together with > maxima/acl2/axiom, without issue. Had a native windows box too recently > and got things working. > > axiom needs xdr. Latest glibc moves the functions, and my configure fix > was too stringent. How about this: > > --- configure.in 16 Jan 2012 20:08:03 -0000 > 1.112.4.1.2.2.2.47.2.3.2.1.4.2.4.2.4.70 > +++ configure.in 17 Jan 2012 17:21:56 -0000 > @@ -66,7 +66,7 @@ > [try_japi=$enableval],[try_japi="no"]) > > AC_ARG_ENABLE(xdr,[ --enable-xdr=yes will compile in support for XDR], > -[try_xdr=$enableval],[try_xdr="no"]) > +[enable_xdr=$enableval],[enable_xdr="yes"]) > > AC_ARG_ENABLE(xgcl,[ --enable-xgcl=yes will compile in support for XGCL], > [enable_xgcl=$enableval],[enable_xgcl="yes"]) > @@ -1046,8 +1046,12 @@ > fi > > > -AC_CHECK_FUNC(xdr_double,, > - AC_CHECK_LIB(tirpc,xdr_double,TLIBS="$TLIBS > -ltirpc",AC_MSG_ERROR([Need xdr_double]))) > +if test "$enable_xdr" = "yes" ; then > + AC_CHECK_FUNC(xdr_double,AC_DEFINE(HAVE_XDR), > + AC_CHECK_LIB(tirpc,xdr_double,AC_DEFINE(HAVE_XDR) TLIBS="$TLIBS > -ltirpc", > + AC_CHECK_LIB(rpc,xdr_double,AC_DEFINE(HAVE_XDR) TLIBS="$TLIBS > -lrpc", > + AC_CHECK_LIB(oncrpc,xdr_double,AC_DEFINE(HAVE_XDR) > TLIBS="$TLIBS -loncrpc")))) > +fi > > AC_MSG_CHECKING(__builtin___clear_cache) > AC_TRY_COMPILE([], > @@ -1373,17 +1377,17 @@ > EXTRA_LOBJS="${EXTRA_LOBJS} gcl_japi.o" > LIBS="${LIBS} -ljapi -lwsock32"] ) > fi > -if test "$use" = "mingw" ; then > - if test "$try_xdr" = "yes" ; then > - AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) > - LIBS="${LIBS} -loncrpc"] ) > - fi > -else > - if test "$try_xdr" = "yes" ; then > - AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) > - LIBS="${LIBS} -lrpc"] ) > - fi > -fi > +dnl if test "$use" = "mingw" ; then > +dnl if test "$try_xdr" = "yes" ; then > +dnl AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) > +dnl LIBS="${LIBS} -loncrpc"] ) > +dnl fi > +dnl else > +dnl if test "$try_xdr" = "yes" ; then > +dnl AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) > +dnl LIBS="${LIBS} -lrpc"] ) > +dnl fi > +dnl fi > > # Should really find a way to check for prototypes, but this > # basically works for now. CM > > David Billinghurst writes: > > > A couple of days ago I posted a windows installer for maxima-5.26.0 at > > > > http://billinghurst.customer.netspace.net.au/maxima-5.26.0.exe > > > > See http://www.math.utexas.edu/pipermail/maxima/2012/027451.html > > > > Having set up the build system, I decided to try it on a current > mingw/msys installation. As some of you know, it is a tricky build as gcl on > > windows is touchy. The last version of gcc that could be used to build > gcl was gcc-3.3.1 from August 2003, and you need to have an ancient mingw/ > > msys install. See the INSTALL.win32 file in maxima cvs for the details. > There has been some progress with gcl. One can now build gcl with the > > latest mingw32/msys using gcc-4.6.2 and successfully build a working > maxima. While the build works on 32-bit WinXP, I haven't managed to > reproduce > > it (yet) on a 64-bit Windows 7 machine. > > > > Anyway, I have uploaded a test installer of maxima cvs 2012-01-16 using > gcc-4.6.2 to > > > > http://billinghurst.customer.netspace.net.au/maxima-5.26.0-test.exe > > > > This is still work in progress, and some documentation is required, but > I'd welcome feedback. > > > > David > > > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > -- > Camm Maguire camm at maguirefamily.org > ========================================================================== > "The earth is but one country, and mankind its citizens." -- Baha'u'llah > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From caecos at hotmail.ca Thu Jan 19 07:47:35 2012 From: caecos at hotmail.ca (Marc Demers) Date: Thu, 19 Jan 2012 08:47:35 -0500 Subject: [Maxima] No file at SourceForge Message-ID: There is no file to download under the folder 5.26.0 at SourceForge. Regards, Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From biomates at telefonica.net Thu Jan 19 08:41:54 2012 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 19 Jan 2012 15:41:54 +0100 Subject: [Maxima] draw package, multiple plots with different sizes? In-Reply-To: <4F171FD5.20108@street-artists.org> References: <4F171FD5.20108@street-artists.org> Message-ID: <1326984114.1569.17.camel@pc> El mi?, 18-01-2012 a las 11:39 -0800, dlakelan escribi?: > Using draw, is it possible to do something like put one plot above the > other, with the upper plot being say a square and the lower plot being a > thin rectangle. To explain here is some sort of ascii art showing the > relative aspect ratios I want to achieve. > > ------------- > | | > | | > | | > | | > | | > ------------- > | | > ------------- > > All I see is the option to specify more than one plot, the number of > columns, and the overall size of the plot (the bounding box using > "dimensions"). I want to do this with the pdfcairo terminal. > > Any suggestions, other than to make them separate plots and glue them > together by hand? Hello, There is not any special draw options to declare the internal dimensions of the scenes, but you can make use of user_preamble to add some gnuplot code to maxout.gnuplot. Here is a workaround: draw( dimensions = 100*[21,29.7], terminal = pdfcairo, gr2d( explicit(x^2,x,-1,1), user_preamble=["set size 1.0, 0.75","set origin 0.0, 0.25"]), gr3d( explicit(x^2+y^2,x,-1,1,y,-1,1), user_preamble=["set size 1.0, 0.25","set origin 0.0, 0.0"]))$ With variable 'origin', you tell Gnuplot where to start drawing the scene (lower-left corner). Since you are allocating the scenes by hand, you don't need to use option 'columns'. With variable 'size', you declare the dimensions, in relative units, of a particular scene. For example, with "set size 1.0, 0.75", the 2D scene will use 100% and 75% of the available width and height, respectively. Finally, with the values given to option 'dimensions' you'll get a pdf document of size A4. I hope this fits your needs. -- Mario From alserkli at inbox.ru Thu Jan 19 10:17:00 2012 From: alserkli at inbox.ru (Alexander Klimov) Date: Thu, 19 Jan 2012 18:17:00 +0200 Subject: [Maxima] Extending assignment Was: Functions with any number of arguments In-Reply-To: References: Message-ID: On Sun, 15 Jan 2012, Aleksas Domarkas wrote: > How in Maxima define functions with any number of arguments ? > > For example, i need function MIN(arg1,arg2, ...) > MIN(2) => 2 > MIN(3,4) =>3 > MIN(2/3,1/2,sqrt(2)/2) => 1/2 MIN([args]) := block([m:first(args)], for i in rest(args) do m:min(m,i), m); > Other example. How define G with following properties: > G(n) => gamma(n) > G(5) => 24 > G(a, x) => gamma_incomplete (a, x) > G(a, z1, z2) => gamma_incomplete_generalized (a, z1, z2) Use "length(args)" and "if then elseif ..." What I wonder, is whether there is a more efficient way to check that a list has empty tail than evaluate its length: I guess "empty" should be a built-in function: empty(l) := block([simp:false], ?null(?cdr(l))); list_min(l) := block([f:first(l),r:rest(l)], if empty(r) then f else min(f, list_min(r))); MIN([args]) := list_min(args); It would also be nice if "[a,b]:[1]" were not an error but instead assigns false (NIL) to b. This would allow to do [a,b,c]:args; if c then /* 3 args */ elseif b then /* 2 args */ else ... -- Regards, ASK From william.wood3 at comcast.net Thu Jan 19 11:04:15 2012 From: william.wood3 at comcast.net (Bill Wood) Date: Thu, 19 Jan 2012 11:04:15 -0600 Subject: [Maxima] Extending assignment Was: Functions with any number of arguments In-Reply-To: References: Message-ID: <1326992655.9363.4.camel@ubuntu> On Thu, 2012-01-19 at 18:17 +0200, Alexander Klimov wrote: . . . > What I wonder, is whether there is a more efficient way to check that > a list has empty tail than evaluate its length: I guess "empty" should > be a built-in function: > > empty(l) := block([simp:false], ?null(?cdr(l))); > list_min(l) := block([f:first(l),r:rest(l)], > if empty(r) then f else min(f, list_min(r))); > MIN([args]) := list_min(args); Apparently the set predicate "emptyp" works: (%i7) emptyp([]); (%o7) true (%i8) emptyp([1]); (%o8) false (%i9) In my release (a little out of date) it is documented with sets, where it is said to work for either sets or lists. If it is not cross-documented under lists it probably should be. I have no idea of the efficiency of its implementation. -- Bill Wood From macrakis at alum.mit.edu Thu Jan 19 11:13:59 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 19 Jan 2012 12:13:59 -0500 Subject: [Maxima] Extending assignment Was: Functions with any number of arguments In-Reply-To: References: Message-ID: Lisp not needed: if l = [] then ... On Jan 19, 2012 8:17 AM, "Alexander Klimov" wrote: > On Sun, 15 Jan 2012, Aleksas Domarkas wrote: > > How in Maxima define functions with any number of arguments ? > > > > For example, i need function MIN(arg1,arg2, ...) > > MIN(2) => 2 > > MIN(3,4) =>3 > > MIN(2/3,1/2,sqrt(2)/2) => 1/2 > > MIN([args]) := block([m:first(args)], > for i in rest(args) do m:min(m,i), > m); > > > Other example. How define G with following properties: > > G(n) => gamma(n) > > G(5) => 24 > > G(a, x) => gamma_incomplete (a, x) > > G(a, z1, z2) => gamma_incomplete_generalized (a, z1, z2) > > Use "length(args)" and "if then elseif ..." > > > What I wonder, is whether there is a more efficient way to check that > a list has empty tail than evaluate its length: I guess "empty" should > be a built-in function: > > empty(l) := block([simp:false], ?null(?cdr(l))); > list_min(l) := block([f:first(l),r:rest(l)], > if empty(r) then f else min(f, list_min(r))); > MIN([args]) := list_min(args); > > It would also be nice if "[a,b]:[1]" were not an error but instead > assigns false (NIL) to b. This would allow to do > > [a,b,c]:args; > if c then /* 3 args */ > elseif b then /* 2 args */ > else ... > > -- > Regards, > ASK > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From biomates at telefonica.net Thu Jan 19 12:31:33 2012 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 19 Jan 2012 19:31:33 +0100 Subject: [Maxima] draw package, multiple plots with different sizes? In-Reply-To: <1326984114.1569.17.camel@pc> References: <4F171FD5.20108@street-artists.org> <1326984114.1569.17.camel@pc> Message-ID: <1326997893.1684.18.camel@pc> El jue, 19-01-2012 a las 15:41 +0100, Mario Rodriguez escribi?: > El mi?, 18-01-2012 a las 11:39 -0800, dlakelan escribi?: > > Using draw, is it possible to do something like put one plot above the > > other, with the upper plot being say a square and the lower plot being a > > thin rectangle. To explain here is some sort of ascii art showing the > > relative aspect ratios I want to achieve. > > > > ------------- > > | | > > | | > > | | > > | | > > | | > > ------------- > > | | > > ------------- > > > > All I see is the option to specify more than one plot, the number of > > columns, and the overall size of the plot (the bounding box using > > "dimensions"). I want to do this with the pdfcairo terminal. > > > > Any suggestions, other than to make them separate plots and glue them > > together by hand? > > Hello, > > There is not any special draw options to declare the internal dimensions > of the scenes, but you can make use of user_preamble to add some gnuplot > code to maxout.gnuplot. > > Here is a workaround: > > > draw( > dimensions = 100*[21,29.7], > terminal = pdfcairo, > > gr2d( > explicit(x^2,x,-1,1), > user_preamble=["set size 1.0, 0.75","set origin 0.0, 0.25"]), > > gr3d( > explicit(x^2+y^2,x,-1,1,y,-1,1), > user_preamble=["set size 1.0, 0.25","set origin 0.0, 0.0"]))$ > > > With variable 'origin', you tell Gnuplot where to start drawing the > scene (lower-left corner). Since you are allocating the scenes by hand, > you don't need to use option 'columns'. > > With variable 'size', you declare the dimensions, in relative units, of > a particular scene. For example, with "set size 1.0, 0.75", the 2D scene > will use 100% and 75% of the available width and height, respectively. > > Finally, with the values given to option 'dimensions' you'll get a pdf > document of size A4. > > I hope this fits your needs. > > -- > Mario > Another interesting example: draw( dimensions = [500,500], gr2d( explicit(x^3,x,-1,1), grid = true, user_preamble=["set size 0.5, 0.5","set origin 0.25, 0.25"]), gr2d( explicit(x^2,x,-1,1), user_preamble=["set size 1.0, 1.0","set origin 0.0, 0.0"])) $ -- Mario From dlakelan at street-artists.org Thu Jan 19 13:55:54 2012 From: dlakelan at street-artists.org (dlakelan) Date: Thu, 19 Jan 2012 11:55:54 -0800 Subject: [Maxima] draw package, multiple plots with different sizes? In-Reply-To: <1326997893.1684.18.camel@pc> References: <4F171FD5.20108@street-artists.org> <1326984114.1569.17.camel@pc> <1326997893.1684.18.camel@pc> Message-ID: <4F18754A.20309@street-artists.org> On 01/19/2012 10:31 AM, Mario Rodriguez wrote: > draw( > dimensions = [500,500], > gr2d( > explicit(x3,x,-1,1), > grid = true, > user_preamble=["set size 0.5, 0.5","set origin 0.25, 0.25"]), > gr2d( > explicit(x2,x,-1,1), > user_preamble=["set size 1.0, 1.0","set origin 0.0, 0.0"])) $ > Thank you very much for the helpful examples! If you are considering additional features to add to draw, you might consider a standardized (non preamble based) way to do this. It is often nice to do multi-plots where some plots are more prominent or have different aspect ratios than others, and inset-plots are also quite nice. Thanks for your work on the draw package! From woollett at charter.net Thu Jan 19 14:24:32 2012 From: woollett at charter.net (Edwin Woollett) Date: Thu, 19 Jan 2012 12:24:32 -0800 Subject: [Maxima] Revised Ch. 2, Maxima by Example, Plots, Files, Read, Write, and Fit Message-ID: <3EC92BAB5CAA43C8B74F8DDBE0DE91CF@edwinc367e16bd> A revised version of Maxima by Example, Chap. 2, Plots, Files, Read, Write, and Fit, has been uploaded. The Jan. 19, 2012 updates reflect the necessity of using the complete file path (in ver. 5.26.0) for all of the "file name slots" in the file manipulation functions defined in mfiles.mac. To save typing, one can define (in your maxima-init.mac file) a function mkp (make path) which makes use of a global parameter bpath which is a string which provides the base of the path to your work folder. One can then use mkp("myfile1.txt") instead of "c:/work2/myfile1.txt" as an argument to a file name slot. This is discussed at length in the introduction to the File section of chapter two. Updated files are: --mbe2plotfit.pdf : Jan. 19, 2012, Maxima 5.26.0, 44 pages --mbe2code.txt : Code file: Jan. 19, 2012, Maxima 5.26.0 --mfiles.mac : Maxima code for file work, Jan. 19, 2012, Maxima 5.26.0 Ted Woollett http://www.csulb.edu/~woollett/ From robert.dodier at gmail.com Thu Jan 19 17:38:28 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 19 Jan 2012 16:38:28 -0700 Subject: [Maxima] No file at SourceForge In-Reply-To: References: Message-ID: Thanks for the info. I don't know what's going on there. I can see the file in the upload area via sftp. Does anybody have any ideas? On 1/19/12, Marc Demers wrote: > > There is no file to download under the folder 5.26.0 at SourceForge. > > Regards, > > Marc > From lapeyre.math122a at gmail.com Thu Jan 19 17:51:57 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Fri, 20 Jan 2012 00:51:57 +0100 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: References: Message-ID: <4F18AC9D.3030409@gmail.com> Trying Barton's suggestion for lexical variables works somewhat. I have no idea what it breaks; it's certainly not a real solution, but it's kind of interesting. 1) copy (defun make-declares .. from transl.lisp to a file and edit the second to last line to read (unless $no_default_special (if specs (pushnew `(special . ,specs) dl :test #'eq))) 2) load the new definition. then put this in tfun.mac : ----------- g(x) := x+y; f(x) := block([y:3], g(x)+y); ---------- (%i1) load("./make-declares.lisp")$ (%i2) no_default_special : false$ (%i3) compile_file("./tfun.mac"); (%i4) f(z); (%o4) z + 6 (%i5) no_default_special : true; (%o5) true (%i6) compile_file("./tfun.mac"); (%i7) f(z); (%o7) z + y + 3 This only seems to work when the code is compiled. --- John Lapeyre From dbmaxima at gmail.com Thu Jan 19 21:37:48 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Fri, 20 Jan 2012 14:37:48 +1100 Subject: [Maxima] maxima for windows with modern gcc/gcl In-Reply-To: <87lip6w8d7.fsf@maguirefamily.org> References: <4F14E754.2070100@gmail.com> <87lip6w8d7.fsf@maguirefamily.org> Message-ID: <4F18E18C.4010108@gmail.com> On 18/01/2012 4:23 AM, Camm Maguire wrote: > Greetings! Great to hear of your progress. BTW, I build frequently > under latest wine/mingw packages in Debian, together with > maxima/acl2/axiom, without issue. Had a native windows box too recently > and got things working. > > axiom needs xdr. Latest glibc moves the functions, and my configure fix > was too stringent. How about this: Thanks. That works for me on windows XP with latest mingw/msys. What XDR package do you use? I have "successfully" built gcl using portablexdr-4.9.1 from http://people.redhat.com/~rjones/portablexdr/. success == gcl configures (with a trivial patch below) and builds. $ cvs diff -u configure.in Index: configure.in =================================================================== RCS file: /sources/gcl/gcl/configure.in,v retrieving revision 1.112.4.1.2.2.2.47.2.3.2.1.4.2.4.2.4.72 diff -u -r1.112.4.1.2.2.2.47.2.3.2.1.4.2.4.2.4.72 configure.in --- configure.in 18 Jan 2012 14:52:07 -0000 1.112.4.1.2.2.2.47.2.3.2.1.4.2.4.2.4.72 +++ configure.in 20 Jan 2012 03:36:48 -0000 @@ -1050,7 +1050,8 @@ AC_CHECK_FUNC(xdr_double,AC_DEFINE(HAVE_XDR), AC_CHECK_LIB(tirpc,xdr_double,AC_DEFINE(HAVE_XDR) TLIBS="$TLIBS -ltirpc", AC_CHECK_LIB(rpc,xdr_double,AC_DEFINE(HAVE_XDR) TLIBS="$TLIBS -lrpc", - AC_CHECK_LIB(oncrpc,xdr_double,AC_DEFINE(HAVE_XDR) TLIBS="$TLIBS -loncrpc")))) + AC_CHECK_LIB(oncrpc,xdr_double,AC_DEFINE(HAVE_XDR) TLIBS="$TLIBS -loncrpc", + AC_CHECK_LIB(portablexdr,xdr_double,AC_DEFINE(HAVE_XDR) TLIBS="$TLIBS -lportablexdr"))))) fi case $use in I still have problems under windows 7 on both a 32-bit and 64-bit system. The simplest of configure tests fail, so it probably isn't a gcl issue. From robert.dodier at gmail.com Thu Jan 19 21:46:47 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 19 Jan 2012 19:46:47 -0800 Subject: [Maxima] Debian bugs In-Reply-To: <87pqeiw9by.fsf_-_@maguirefamily.org> References: <4F0A2C70.2080600@gmx.de> <4F0C0015.2070209@gmx.de> <1326315301.1548.19.camel@ubuntu> <23737.1326342202@gemini.franz.com> <87pqeiw9by.fsf_-_@maguirefamily.org> Message-ID: On 1/17/12, Camm Maguire wrote: > Greetings! The Debian BTS has a tagging mechanism supporting bug > forwarding, and uses an email address for the forwarding. In the past, > I've forwarded to this list. I imagine the developers would prefer > entries at sourceforge, but then we'd drop the connection in the BTS. I > have a few piled up now, and would like to forward. Suggestions? Hi Camm, it makes sense to me to keep the items in the Debian bug tracker and forward them to the mailing list. Thanks for your help, Robert Dodier From robert.dodier at gmail.com Thu Jan 19 21:49:40 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 19 Jan 2012 19:49:40 -0800 Subject: [Maxima] maxima for windows with modern gcc/gcl In-Reply-To: References: <4F14E754.2070100@gmail.com> <87lip6w8d7.fsf@maguirefamily.org> Message-ID: On 1/19/12, Stefano Ferri wrote: > I think we should update the information given by install.win32, they are > obsolete in some points and now the procedure is easier, at least for the > gcl-related part. If you want to post an updated version of install.win32, or or a patch or whatever, I will be happy to commit it. best Robert Dodier From caecos at hotmail.ca Fri Jan 20 09:14:55 2012 From: caecos at hotmail.ca (Marc Demers) Date: Fri, 20 Jan 2012 10:14:55 -0500 Subject: [Maxima] Still no files! Message-ID: Hi guys, Still no 5.26.0.exe files to download from SourceForge... Regards, Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From lapeyre.math122a at gmail.com Fri Jan 20 11:13:53 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Fri, 20 Jan 2012 18:13:53 +0100 Subject: [Maxima] invert_by_lu does not work as expected In-Reply-To: References: Message-ID: <4F19A0D1.4040207@gmail.com> I should have said that modifying make-declares works when the code is translated (or compiled). make-declares is only called by tr-lambda. You could: 1) add paramter declare-specials-p to tr-lambda and make-declares and all existing code calls them with flag set to true. 2) Make a copy of mprog (ie $block) called $module.. 3) Make copy of (def%tr mprog ... call (def%tr $module that calls tr-lambda with declare-specials-p set to false. You could do the same with maxima lambda, call it lambda_module or something. 3) I tried copying (defmspec $define ... to $define_trans and changing the call to meval to call translate-and-eval-macsyma-expression. This seemed to work, ie (%i13) define_trans(h(x),x); Translating: h h Then define_trans(f(x),module([y:3], ...)) should define a function f with lexically scoped y. I didn't put all the pieces together. bw wrote: > Maybe would be possible to modify the Maxima to CL > translator to remove most of the special declarations, and > to insert a few lines of code in the read-eval-print loop > that translates all inputs. That might be a quick way to > experiment with MaximaL? Likely, I don't know what I'm > talking about. -- John Lapeyre From toy.raymond at gmail.com Fri Jan 20 12:22:56 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 20 Jan 2012 10:22:56 -0800 Subject: [Maxima] No file at SourceForge In-Reply-To: References: Message-ID: On Thu, Jan 19, 2012 at 3:38 PM, Robert Dodier wrote: > Thanks for the info. I don't know what's going on there. > I can see the file in the upload area via sftp. > Does anybody have any ideas? > > I see a bunch of files at http://sourceforge.net/projects/maxima/files/Maxima-Linux/5.26.0-Linux/. But nothing for windows, though. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Fri Jan 20 13:15:10 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 20 Jan 2012 11:15:10 -0800 Subject: [Maxima] No file at SourceForge In-Reply-To: References: Message-ID: On 1/20/12, Raymond Toy wrote: > I see a bunch of files at > http://sourceforge.net/projects/maxima/files/Maxima-Linux/5.26.0-Linux/. > > But nothing for windows, though. Well, I uploaded a file to /home/frs/project/m/ma/maxima/Maxima-Windows/5.26.0-Windows (path approximate -- working from memory here) and I can see the file in sftp. From what I can tell it is just like the Linux files so it seems like it should be visible. Does someone want to try uploading another file (anything) just to see if there is something peculiar about maxima-5.26.0.exe ? I've run out of ideas at this point. best Robert Dodier From robert.dodier at gmail.com Fri Jan 20 13:20:27 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 20 Jan 2012 11:20:27 -0800 Subject: [Maxima] lsquares fitting and constrains for parameters (looking for positive values of parameters) In-Reply-To: References: <4F1389B0.4040309@gmail.com> Message-ID: On 1/17/12, gwpublic at wp.pl wrote: > So instead of fitting with lsquares_estimate expression like this: > a*x^4 + b*x^3 + d*x + e > I fit expression with all parameters after "abs" : > abs(a)*x^4 + abs(b)*x^3 + abs(d)*x + abs(e) Since abs is not differentiable at 0, that could cause some trouble, because lsquares_estimate eventually calls a function (lbfgs) which works only for differentiable functions. (I don't remember how many continuous derivatives lbfgs requires. I'll guess it's 2 but I'd have to look it up.) Anyway instead of abs(a)*x you could try a^2*x instead. best Robert Dodier From phowep at yahoo.com Sat Jan 21 09:44:50 2012 From: phowep at yahoo.com (phowep at yahoo.com) Date: Sat, 21 Jan 2012 16:44:50 +0100 Subject: [Maxima] Mailing list Message-ID: <50pxjewv3abcoyi99kllqtj3.1327160690250@email.android.com> This is my email address phowep at yahoo.com From adammaj1 at o2.pl Sat Jan 21 14:51:17 2012 From: adammaj1 at o2.pl (Adam Majewski) Date: Sat, 21 Jan 2012 21:51:17 +0100 Subject: [Maxima] string to identifier Message-ID: How can I convert string to identifier ? I would like to make a few list for draw package : list1, list2 ... for Denominator:1 thru DenominatorMax step 1 do ( name:concat("list",string(Denominator)), /* here I should convert string name to identier */ name:Givelist /* my function */ ); TIA Adam From fateman at eecs.berkeley.edu Sat Jan 21 15:01:47 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 21 Jan 2012 13:01:47 -0800 Subject: [Maxima] string to identifier In-Reply-To: References: Message-ID: <4F1B27BB.2070800@eecs.berkeley.edu> On 1/21/2012 12:51 PM, Adam Majewski wrote: > How can I convert string to identifier ? > > I would like to make a few list for draw package : > list1, list2 ... > > for Denominator:1 thru DenominatorMax step 1 do > ( > name:concat("list",string(Denominator)), > /* here I should convert string name to identier */ > name:Givelist /* my function */ > ); > try ?intern(concat("list", 123)); From woollett at charter.net Sat Jan 21 16:12:45 2012 From: woollett at charter.net (Edwin Woollett) Date: Sat, 21 Jan 2012 14:12:45 -0800 Subject: [Maxima] quad_qagp behavior Message-ID: <198A83C19B7F4ACB9E95893B9ABD56EC@edwinc367e16bd> testing the new quadpack utility, quad_qagp, weird result not understood: e = realpart(1/e1) gives correct result e = 1/realpart(e1) gives really bad answer ----------------------------------------------------------------------- Maxima 5.26.0 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) ok: (%i1) quad_qagp (realpart (1/sqrt (sin(x))), x, 1, 5, [%pi]); (%o1) [3.209309789377543,6.1241798299249695E-9,294,0] not ok: (%i2) quad_qagp (1/realpart (sqrt (sin(x))), x, 1, 5, [%pi]); (%o2) [4.7552920825719432E+16,7.0149712E+7,294,0] (%i3) realpart(1/sqrt(sin(x))); (%o3) cos(atan2(0,sin(x))/2)/sqrt(abs(sin(x))) (%i4) 1/realpart(sqrt(sin(x))); (%o4) 1/(cos(atan2(0,sin(x))/2)*sqrt(abs(sin(x)))) compare the two resulting expressions numerically: (%i5) r1(x):= realpart(1/sqrt(sin(x)))$ (%i6) r2(x) := 1/realpart(sqrt(sin(x)))$ (%i7) for y in [1,2,3] do print(y,r1(y),r2(y))$ 1 1/sqrt(sin(1)) 1/sqrt(sin(1)) 2 1/sqrt(sin(2)) 1/sqrt(sin(2)) 3 1/sqrt(sin(3)) 1/sqrt(sin(3)) (%i8) for y in [1,2,3] do print(y,float(r1(y)),float(r2(y)))$ 1 1.090135361218102 1.090135361218102 2 1.048689739767972 1.048689739767972 3 2.661985611481998 2.661985611481998 ------------------------------------------- Ted Woollett From adammaj1 at o2.pl Sat Jan 21 16:35:47 2012 From: adammaj1 at o2.pl (Adam Majewski) Date: Sat, 21 Jan 2012 23:35:47 +0100 Subject: [Maxima] string to identifier In-Reply-To: <4F1B27BB.2070800@eecs.berkeley.edu> References: <4F1B27BB.2070800@eecs.berkeley.edu> Message-ID: On 21.01.2012 22:01, Richard Fateman wrote: > ?intern(concat("list", 123));\ Thanks for the answer. It gives a symbol : (%i7) ?intern(concat("list", 123)); (%o7) LIST123 but I can't use it as a name : (%i6) ?intern(concat("list", 123)):32; assignment: cannot assign to intern(concat("list",123)) -- an error. To debug this try: debugmode(true); Adam From fateman at eecs.berkeley.edu Sat Jan 21 17:07:28 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 21 Jan 2012 15:07:28 -0800 Subject: [Maxima] string to identifier In-Reply-To: References: <4F1B27BB.2070800@eecs.berkeley.edu> Message-ID: <4F1B4530.50402@eecs.berkeley.edu> Try ?intern(concat("list",123)) :: 32 which assigns 32 to a symbol that you can type in to Maxima as ?LIST123. There is a peculiarity of switching upper and lower case for convoluted reasons. Note that is "::" not ":" RJF From adammaj1 at o2.pl Sat Jan 21 18:08:11 2012 From: adammaj1 at o2.pl (Adam Majewski) Date: Sun, 22 Jan 2012 01:08:11 +0100 Subject: [Maxima] string to identifier In-Reply-To: <4F1B4530.50402@eecs.berkeley.edu> References: <4F1B27BB.2070800@eecs.berkeley.edu> <4F1B4530.50402@eecs.berkeley.edu> Message-ID: On 22.01.2012 00:07, Richard Fateman wrote: > > > Try > ?intern(concat("list",123)) :: 32 > > which assigns 32 to a symbol that you can type in to Maxima as ?LIST123. > > > There is a peculiarity of switching upper and lower case for > convoluted reasons. > > Note that is "::" not ":" > > RJF It works now. Thanks. Below is code in which I have used it in main and draw sections. It draws 5 images on the screen. Adam ============== kill(all); /* ---------- functions ---------------------- */ /* conformal map from circle to cardioid ( boundary of period 1 component of Mandelbrot set */ F(w):=w/2-w*w/4; /* circle D={w:abs(w)=1 } where w=l(t,r) t is angle in turns ; 1 turn = 360 degree = 2*Pi radians r is a radius */ ToCircle(t,r):=r*%e^(%i*t*2*%pi); /* http://en.wikipedia.org/wiki/Complex_quadratic_polynomial */ f(z,c):=z*z+c $ GiveCriticalOrbit(c,iMax):= /* computes (without escape test) critical orbit (forward orbit of critical point ) and saves it to the list for draw package */ block( [z,orbit,temp], z:0, /* first point = critical point z:0+0*%i */ orbit:[[realpart(z),imagpart(z)]], for i:1 thru iMax step 1 do ( z:expand(f(z,c)), orbit:endcons([realpart(z),imagpart(z)],orbit)), return(orbit) )$ /* find fixed point alfa , returns a list */ GiveFixed(c):= ( [z], z:float(rectform((1-sqrt(1-4*c))/2)), [[realpart(z),imagpart(z)]] )$ GiveC(angle,radius):= ( [w], /* point of unit circle w:l(internalAngle,internalRadius); */ w:ToCircle(angle,radius), /* point of circle */ float(rectform(F(w))) /* point on boundary of period 1 component of Mandelbrot set */ )$ compile(all)$ /* ---------- constant ---------------------------*/ Numerator :1; DenominatorMax :5; InternalRadius:1; iMax:500; /* -------------- main ----------------- */ for Denominator:1 thru DenominatorMax step 1 do ( InternalAngle: Numerator/Denominator, c: GiveC(InternalAngle,InternalRadius), /* */ ?intern(concat("z",string(Denominator)))::GiveFixed(c), /* */ ?intern(concat("orbit",string(Denominator)))::GiveCriticalOrbit(c,iMax) ); /*------------------draw -------------------------------------*/ load(draw); /* ( interface to gnuplot ) by Mario Rodriguez Riotorto http://www.telefonica.net/web2/biomates */ draw( terminal = screen, columns =5, gr2d( title= "1/1 ", user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* */ color =red, key = "critical orbit", points(?ORBIT1), /* */ color =black, point_size = 1.4, key = "parabolic fixed point", points(?Z1), /* */ color =blue, key = "criitical point", points([0],[0]) ), gr2d( title= " 1/2 ", user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* */ color =red, key = "critical orbit", points(?ORBIT2), /* */ color =black, point_size = 1.4, key = "parabolic fixed point", points(?Z2), /* */ color =blue, key = "criitical point", points([0],[0]) ), gr2d( title= " 1/3 ", user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* */ color =red, key = "critical orbit", points(?ORBIT3), /* */ color =black, point_size = 1.4, key = "parabolic fixed point", points(?Z3), /* */ color =blue, key = "criitical point", points([0],[0]) ), gr2d( title= " 1/4 ", user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* */ color =red, key = "critical orbit", points(?ORBIT4), /* */ color =black, point_size = 1.4, key = "parabolic fixed point", points(?Z4), /* */ color =blue, key = "criitical point", points([0],[0]) ), gr2d( title= " 1/5 ", user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* */ color =red, key = "critical orbit", points(?ORBIT5), /* */ color =black, point_size = 1.4, key = "parabolic fixed point", points(?Z5), /* */ color =blue, key = "criitical point", points([0],[0]) ) ); From l.couraud at gmail.com Sat Jan 21 18:39:50 2012 From: l.couraud at gmail.com (laurent couraud) Date: Sun, 22 Jan 2012 01:39:50 +0100 Subject: [Maxima] RE : string to identifier In-Reply-To: Message-ID: <4D0C218C381046D9A51EAB30B6AA95BA@PASSERELLE> You can also use eval_string from the package stringproc. Laurent. > -----Message d'origine----- > De?: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] De la part de > Adam Majewski > Envoy??: dimanche 22 janvier 2012 01:08 > ??: maxima at math.utexas.edu > Objet?: Re: [Maxima] string to identifier > > On 22.01.2012 00:07, Richard Fateman wrote: > > > > > > Try > > ?intern(concat("list",123)) :: 32 > > > > which assigns 32 to a symbol that you can type in to Maxima as ?LIST123. > > > > > > There is a peculiarity of switching upper and lower case for > > convoluted reasons. > > > > Note that is "::" not ":" > > > > RJF > It works now. Thanks. > > Below is code in which I have used it in main and draw sections. > It draws 5 images on the screen. > > > Adam > > ============== > kill(all); > > > > /* ---------- functions ---------------------- */ > > /* conformal map from circle to cardioid ( boundary > of period 1 component of Mandelbrot set */ > F(w):=w/2-w*w/4; > > > /* > circle D={w:abs(w)=1 } where w=l(t,r) > t is angle in turns ; 1 turn = 360 degree = 2*Pi radians > r is a radius > */ > ToCircle(t,r):=r*%e^(%i*t*2*%pi); > > > > > /* > > http://en.wikipedia.org/wiki/Complex_quadratic_polynomial > */ > f(z,c):=z*z+c $ > > GiveCriticalOrbit(c,iMax):= > /* > computes (without escape test) > critical orbit (forward orbit of critical point ) > and saves it to the list for draw package */ > block( > [z,orbit,temp], > z:0, /* first point = critical point z:0+0*%i */ > orbit:[[realpart(z),imagpart(z)]], > for i:1 thru iMax step 1 do > ( z:expand(f(z,c)), > orbit:endcons([realpart(z),imagpart(z)],orbit)), > > return(orbit) > )$ > > > /* find fixed point alfa , returns a list */ > GiveFixed(c):= > ( > [z], > z:float(rectform((1-sqrt(1-4*c))/2)), > [[realpart(z),imagpart(z)]] > )$ > > > > GiveC(angle,radius):= > ( > [w], > /* point of unit circle w:l(internalAngle,internalRadius); */ > w:ToCircle(angle,radius), /* point of circle */ > float(rectform(F(w))) /* point on boundary of period 1 component of > Mandelbrot set */ > )$ > > > > compile(all)$ > > > > /* ---------- constant ---------------------------*/ > Numerator :1; > DenominatorMax :5; > InternalRadius:1; > iMax:500; > > > /* -------------- main ----------------- */ > > > > for Denominator:1 thru DenominatorMax step 1 do > ( > InternalAngle: Numerator/Denominator, > c: GiveC(InternalAngle,InternalRadius), > /* */ > ?intern(concat("z",string(Denominator)))::GiveFixed(c), > /* */ > ?intern(concat("orbit",string(Denominator)))::GiveCriticalOrbit(c,iMax) > ); > > > > > /*------------------draw -------------------------------------*/ > load(draw); /* ( interface to gnuplot ) by Mario Rodriguez Riotorto > http://www.telefonica.net/web2/biomates */ > > draw( > > terminal = screen, > columns =5, > gr2d( > title= "1/1 ", > user_preamble = "set border 0;set nokey;set size square;set noxtics > ;set noytics;", > > point_type = filled_circle, > points_joined = false, > point_size = 0.7, > /* */ > color =red, > key = "critical orbit", > points(?ORBIT1), > /* */ > color =black, > point_size = 1.4, > key = "parabolic fixed point", > points(?Z1), > /* */ > color =blue, > key = "criitical point", > points([0],[0]) > ), > > gr2d( > title= " 1/2 ", > user_preamble = "set border 0;set nokey;set size square;set noxtics > ;set noytics;", > > point_type = filled_circle, > points_joined = false, > point_size = 0.7, > /* */ > color =red, > key = "critical orbit", > points(?ORBIT2), > /* */ > color =black, > point_size = 1.4, > key = "parabolic fixed point", > points(?Z2), > /* */ > color =blue, > key = "criitical point", > points([0],[0]) > ), > > gr2d( > title= " 1/3 ", > user_preamble = "set border 0;set nokey;set size square;set noxtics > ;set noytics;;", > point_type = filled_circle, > points_joined = false, > point_size = 0.7, > /* */ > color =red, > key = "critical orbit", > points(?ORBIT3), > /* */ > color =black, > point_size = 1.4, > key = "parabolic fixed point", > points(?Z3), > /* */ > color =blue, > key = "criitical point", > points([0],[0]) > ), > > gr2d( > title= " 1/4 ", > user_preamble = "set border 0;set nokey;set size square;set noxtics > ;set noytics;;", > point_type = filled_circle, > points_joined = false, > point_size = 0.7, > /* */ > color =red, > key = "critical orbit", > points(?ORBIT4), > /* */ > color =black, > point_size = 1.4, > key = "parabolic fixed point", > points(?Z4), > /* */ > color =blue, > key = "criitical point", > points([0],[0]) > ), > gr2d( > title= " 1/5 ", > user_preamble = "set border 0;set nokey;set size square;set noxtics > ;set noytics;;", > point_type = filled_circle, > points_joined = false, > point_size = 0.7, > /* */ > color =red, > key = "critical orbit", > points(?ORBIT5), > /* */ > color =black, > point_size = 1.4, > key = "parabolic fixed point", > points(?Z5), > /* */ > color =blue, > key = "criitical point", > points([0],[0]) > ) > > > > ); > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From toy.raymond at gmail.com Sat Jan 21 22:11:34 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 21 Jan 2012 20:11:34 -0800 Subject: [Maxima] quad_qagp behavior In-Reply-To: <198A83C19B7F4ACB9E95893B9ABD56EC@edwinc367e16bd> References: <198A83C19B7F4ACB9E95893B9ABD56EC@edwinc367e16bd> Message-ID: On 1/21/12 2:12 PM, Edwin Woollett wrote: > > testing the new quadpack utility, quad_qagp, weird result not understood: > > e = realpart(1/e1) gives correct result > > e = 1/realpart(e1) gives really bad answer > ----------------------------------------------------------------------- > Maxima 5.26.0 http://maxima.sourceforge.net > using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) > > ok: > (%i1) quad_qagp (realpart (1/sqrt (sin(x))), x, 1, 5, [%pi]); > > (%o1) [3.209309789377543,6.1241798299249695E-9,294,0] > > not ok: > (%i2) quad_qagp (1/realpart (sqrt (sin(x))), x, 1, 5, [%pi]); > > (%o2) [4.7552920825719432E+16,7.0149712E+7,294,0] > > > (%i3) realpart(1/sqrt(sin(x))); > > (%o3) cos(atan2(0,sin(x))/2)/sqrt(abs(sin(x))) > > (%i4) 1/realpart(sqrt(sin(x))); > > (%o4) 1/(cos(atan2(0,sin(x))/2)*sqrt(abs(sin(x)))) > > compare the two resulting expressions numerically: > > (%i5) r1(x):= realpart(1/sqrt(sin(x)))$ > > (%i6) r2(x) := 1/realpart(sqrt(sin(x)))$ > > (%i7) for y in [1,2,3] do > print(y,r1(y),r2(y))$ > > 1 1/sqrt(sin(1)) 1/sqrt(sin(1)) 2 1/sqrt(sin(2)) 1/sqrt(sin(2)) 3 > 1/sqrt(sin(3)) 1/sqrt(sin(3)) You didn't take enough samples. I plotted r1(x) - r2(x) for x from %pi to 5. and the plot is not zero. It is zero for x from 1 to %pi. So I guess realpart is buggy in this case, although ratsimp(r1(x)-r2(x)) is zero. Ray From adammaj1 at o2.pl Sun Jan 22 03:14:37 2012 From: adammaj1 at o2.pl (Adam Majewski) Date: Sun, 22 Jan 2012 10:14:37 +0100 Subject: [Maxima] RE : string to identifier In-Reply-To: <4D0C218C381046D9A51EAB30B6AA95BA@PASSERELLE> References: <4D0C218C381046D9A51EAB30B6AA95BA@PASSERELLE> Message-ID: On 22.01.2012 01:39, laurent couraud wrote: > You can also use eval_string from the package stringproc. > > Laurent. Thx. It : * removes upper/lower case switching * removes one language from code ( older code have used 3 languages : Maxima, Lisp and gnuplot. New code uses 2 languages : Maxima and gnuplot. ) Below is new code. I think about making scene ( scene1, scene2 ....) in similar way to make code shorter ( I hope not obfuscated) and then use : draw(scene1, scene2) Old code and image is here : http://commons.wikimedia.org/wiki/File:Parabolic_critical_orbits.png more description : http://en.wikibooks.org/wiki/Fractals/Iterations_in_the_complex_plane/parabolic Please look also at : Category:Images with Maxima CAS source code http://commons.wikimedia.org/wiki/Category:Images_with_Maxima_CAS_source_code Category:Created with Maxima (software) http://commons.wikimedia.org/wiki/Category:Created_with_Maxima_%28software%29 Thx Adam ============== newest code ============== kill(all); /* ---------- functions ---------------------- */ /* conformal map from circle to cardioid ( boundary of period 1 component of Mandelbrot set */ F(w):=w/2-w*w/4; /* circle D={w:abs(w)=1 } where w=ToCircle(t,r) t is angle in turns ; 1 turn = 360 degree = 2*Pi radians r is a radius */ ToCircle(t,r):=r*%e^(%i*t*2*%pi); /* http://en.wikipedia.org/wiki/Complex_quadratic_polynomial */ f(z,c):=z*z+c $ GiveCriticalOrbit(c,iMax):= /* computes (without escape test) critical orbit (forward orbit of critical point ) and saves it to the list for draw package */ block( [z,orbit,temp], z:0, /* first point = critical point z:0+0*%i */ orbit:[[realpart(z),imagpart(z)]], for i:1 thru iMax step 1 do ( z:expand(f(z,c)), orbit:endcons([realpart(z),imagpart(z)],orbit)), return(orbit) )$ /* find fixed point alfa , returns a list */ GiveFixed(c):= ( [z], z:float(rectform((1-sqrt(1-4*c))/2)), [[realpart(z),imagpart(z)]] )$ GiveC(angle,radius):= ( [w], /* point of unit circle w:l(internalAngle,internalRadius); */ w:ToCircle(angle,radius), /* point of circle */ float(rectform(F(w))) /* point on boundary of period 1 component of Mandelbrot set */ )$ compile(all)$ /* ---------- constant ---------------------------*/ Numerator :1; DenominatorMax :10; InternalRadius:1; iMax:500; /* -------------- main ----------------- */ for Denominator:1 thru DenominatorMax step 1 do ( InternalAngle: Numerator/Denominator, c: GiveC(InternalAngle,InternalRadius), /* */ eval_string(concat("z",string(Denominator)))::GiveFixed(c), /* */ eval_string(concat("orbit",string(Denominator)))::GiveCriticalOrbit(c,iMax) ); /*-----------------------------------------------------------------------*/ load(draw); /* ( interface to gnuplot ) by Mario Rodriguez Riotorto http://www.telefonica.net/web2/biomates */ draw( terminal = screen, columns =5, file_name = "b", pic_width = 1000, /* Since Maxima 5.23, pic_width and pic_height are deprecated. */ pic_height = 500, /* See option dimensions. To get the same effect, write dimensions=[800,600] */ gr2d( title= "1/1 ", user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* critical orbit */ color =red, points(orbit1), /* parabolic fixed point */ color =black, point_size = 1.4, points(z1), /* criitical point */ color =blue, points([0],[0]) ), gr2d( title= " 1/2 ", user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* criitical orbit */ color =red, points(orbit2), /* parabolic fixed point */ color =black, point_size = 1.4, points(z2), /* criitical point */ color =blue, points([0],[0]) ), gr2d( title= " 1/3 ", user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* critical orbit */ color =red, points(orbit3), /* parabolic fixed point */ color =black, point_size = 1.4, points(z3), /* criitical point */ color =blue, points([0],[0]) ), gr2d( title= " 1/4 ", user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* critical orbit */ color =red, points(orbit4), /* parabolic fixed point */ color =black, point_size = 1.4, points(z4), /* criitical point */ color =blue, points([0],[0]) ), gr2d( title= " 1/5 ", user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* critical orbit */ color =red, points(orbit5), /* parabolic fixed point */ color =black, point_size = 1.4, points(z5), /* criitical point */ color =blue, points([0],[0]) ), gr2d( title= "1/6 ", user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* critical orbit */ color =red, points(orbit6), /* parabolic fixed point */ color =black, point_size = 1.4, points(z6), /* criitical point */ color =blue, points([0],[0]) ), gr2d( title= " 1/7 ", user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* criitical orbit */ color =red, points(orbit7), /* parabolic fixed point */ color =black, point_size = 1.4, points(z7), /* criitical point */ color =blue, points([0],[0]) ), gr2d( title= " 1/8 ", user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* critical orbit */ color =red, points(orbit8), /* parabolic fixed point */ color =black, point_size = 1.4, points(z8), /* criitical point */ color =blue, points([0],[0]) ), gr2d( title= " 1/9 ", user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* critical orbit */ color =red, points(orbit9), /* parabolic fixed point */ color =black, point_size = 1.4, points(z9), /* criitical point */ color =blue, points([0],[0]) ), gr2d( title= " 1/10 ", user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* critical orbit */ color =red, points(orbit10), /* parabolic fixed point */ color =black, point_size = 1.4, points(z10), /* criitical point */ color =blue, points([0],[0]) ) ); From korte at lite.msu.edu Sun Jan 22 07:59:45 2012 From: korte at lite.msu.edu (Gerd Kortemeyer) Date: Sun, 22 Jan 2012 08:59:45 -0500 Subject: [Maxima] Declarations Message-ID: <515989B4-0A9B-455B-8BCB-9CBF00CDB91C@lite.msu.edu> Hi, We have been using MAXIMA successfully inside of LON-CAPA for homework problems for several years now - it's a great tool, thanks everybody!!! While authoring a new kind of homework, I am struggling with "declare" - why does the following (sample) code not give the expected results? (%i4) declare(x,real); (%o4) done (%i5) solve(x^3=125,x); 5 sqrt(3) %i - 5 5 sqrt(3) %i + 5 (%o5) [x = ----------------, x = - ----------------, x = 5] 2 2 (%i6) facts(); (%o6) [kind(x, real)] Is there another way to tell "solve" to stay in the real realm? Thanks! - Gerd. From alserkli at inbox.ru Sun Jan 22 08:08:28 2012 From: alserkli at inbox.ru (Alexander Klimov) Date: Sun, 22 Jan 2012 16:08:28 +0200 Subject: [Maxima] [patch] 3D curve parametric plot Message-ID: Hi. It used to be possible to do 3D parametric curve plots with plot3d([sin(t), cos(t), t], [t,-5,5], [y,-5,5], [grid,100,2], [gnuplot_pm3d,false])$ but in the current version it gives plot3d: wrong number of variables: [t]. There should be two The problem can be fixed with the attached patch. It would be nice if it were committed to the mainline. It is also a good idea to document the grid trick in plot3d documentation. -- Regards, ASK -------------- next part -------------- From 2a7852b79c0185a8e4df325b68dd22548667e599 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Sun, 22 Jan 2012 15:49:23 +0200 Subject: [PATCH] Allow 3D parametric plots --- src/plot.lisp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plot.lisp b/src/plot.lisp index e275758..6219bee 100644 --- a/src/plot.lisp +++ b/src/plot.lisp @@ -1901,7 +1901,7 @@ Several functions depending on the two variables v1 and v2: (coerce-float-fun (fourth exprn) lvars) (second lvars) (third lvars)))) (setq lvars ($listofvars `((mlist) ,vars1 ,vars2 ,vars3))) - (if (= 2 ($length lvars)) + (if (<= ($length lvars) 2) ;; we do have a valid parametric set. Push it into ;; the functions stack, along with their domain (progn @@ -1915,7 +1915,7 @@ Several functions depending on the two variables v1 and v2: (setf (getf features :const-expr) ($float (meval (fourth exprn)))))) (merror - (intl:gettext "plot3d: there must be two variables; found: ~M") + (intl:gettext "plot3d: there must be at most two variables; found: ~M") lvars)))) (3 -- 1.7.2.5 From fateman at eecs.berkeley.edu Sun Jan 22 09:22:09 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 22 Jan 2012 07:22:09 -0800 Subject: [Maxima] Declarations In-Reply-To: <515989B4-0A9B-455B-8BCB-9CBF00CDB91C@lite.msu.edu> References: <515989B4-0A9B-455B-8BCB-9CBF00CDB91C@lite.msu.edu> Message-ID: <4F1C29A1.7070400@eecs.berkeley.edu> Solve generally ignores declarations, except insofar as it might call some other program like simplification, that uses them. You will have to filter out the real solutions some other way. Designing another version of solve that considers assumptions and declaration might be worthwhile. RJF On 1/22/2012 5:59 AM, Gerd Kortemeyer wrote: > Hi, > > We have been using MAXIMA successfully inside of LON-CAPA for homework problems for several years now - it's a great tool, thanks everybody!!! > > While authoring a new kind of homework, I am struggling with "declare" - why does the following (sample) code not give the expected results? > > (%i4) declare(x,real); > (%o4) done > (%i5) solve(x^3=125,x); > 5 sqrt(3) %i - 5 5 sqrt(3) %i + 5 > (%o5) [x = ----------------, x = - ----------------, x = 5] > 2 2 > (%i6) facts(); > (%o6) [kind(x, real)] > > Is there another way to tell "solve" to stay in the real realm? > > Thanks! > > - Gerd. > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From hbaker1 at pipeline.com Sun Jan 22 09:59:15 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Sun, 22 Jan 2012 07:59:15 -0800 Subject: [Maxima] Declarations In-Reply-To: <4F1C29A1.7070400@eecs.berkeley.edu> References: <515989B4-0A9B-455B-8BCB-9CBF00CDB91C@lite.msu.edu> <4F1C29A1.7070400@eecs.berkeley.edu> Message-ID: In the case of quadratics, cubics & quartics, it may be impossible to determine without additional information about the actual values of variables which of the solutions is real and which are not. I still think that this is a worthwhile goal, but it would require a substantial amount of work to produce what Gerd wants. At 07:22 AM 1/22/2012, Richard Fateman wrote: >Solve generally ignores declarations, except insofar as it might call some other program like simplification, that uses them. > >You will have to filter out the real solutions some other way. > >Designing another version of solve that considers assumptions and declaration might be worthwhile. > >RJF > >On 1/22/2012 5:59 AM, Gerd Kortemeyer wrote: >>Hi, >> >>We have been using MAXIMA successfully inside of LON-CAPA for homework problems for several years now - it's a great tool, thanks everybody!!! >> >>While authoring a new kind of homework, I am struggling with "declare" - why does the following (sample) code not give the expected results? >> >>(%i4) declare(x,real); >>(%o4) done >>(%i5) solve(x^3=125,x); >> 5 sqrt(3) %i - 5 5 sqrt(3) %i + 5 >>(%o5) [x = ----------------, x = - ----------------, x = 5] >> 2 2 >>(%i6) facts(); >>(%o6) [kind(x, real)] >> >>Is there another way to tell "solve" to stay in the real realm? >> >>Thanks! >> >>- Gerd. From caecos at hotmail.ca Sun Jan 22 10:29:33 2012 From: caecos at hotmail.ca (Marc Demers) Date: Sun, 22 Jan 2012 11:29:33 -0500 Subject: [Maxima] Windows binary? Message-ID: Hi, Is there a possibility to download the Windows binary 5.26.0.exe soon? Regards, Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From coolens at kahosl.be Sun Jan 22 10:58:06 2012 From: coolens at kahosl.be (Hugo Coolens) Date: Sun, 22 Jan 2012 17:58:06 +0100 Subject: [Maxima] problem plotting function In-Reply-To: References: Message-ID: I'm facing a problem when plotting the soluation of the following differential equation: q1:2*6/6.6e-3; tau=33e-6; eq:'diff(y,x)+y/tau=q1; ode2(eq,y,x); sol:ic1(%,x=0,y=-60e-3); plot2d(rhs(sol),[x,0,3.3e-3],[y,-100e-3,100e-3]); plot2d: expression evaluates to non-numeric value somewhere in plotting range. I also noticed that using u_O in stead of y gives trouble with the plot2d command, is it possible to use another variable name? thanks in advance hugo From toy.raymond at gmail.com Sun Jan 22 11:20:51 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 22 Jan 2012 09:20:51 -0800 Subject: [Maxima] problem plotting function In-Reply-To: References: Message-ID: On 1/22/12 8:58 AM, Hugo Coolens wrote: > I'm facing a problem when plotting the soluation of the following > differential equation: > q1:2*6/6.6e-3; > tau=33e-6; Perhaps you meant to say tau:33e-6? > eq:'diff(y,x)+y/tau=q1; > ode2(eq,y,x); > sol:ic1(%,x=0,y=-60e-3); > plot2d(rhs(sol),[x,0,3.3e-3],[y,-100e-3,100e-3]); > plot2d: expression evaluates to non-numeric value somewhere in plotting Not surprising because rhs(sol) is an expression containing a symbolic tau. That's kind of hard to plot. Ray From coolens at kahosl.be Sun Jan 22 11:38:06 2012 From: coolens at kahosl.be (Hugo Coolens) Date: Sun, 22 Jan 2012 18:38:06 +0100 Subject: [Maxima] problem plotting function In-Reply-To: References: Message-ID: Of course, you are right Raymond, I overlooked the equation-sign sorry hugo On Sun, 22 Jan 2012, Raymond Toy wrote: > On 1/22/12 8:58 AM, Hugo Coolens wrote: >> I'm facing a problem when plotting the soluation of the following >> differential equation: >> q1:2*6/6.6e-3; >> tau=33e-6; > Perhaps you meant to say tau:33e-6? > >> eq:'diff(y,x)+y/tau=q1; >> ode2(eq,y,x); >> sol:ic1(%,x=0,y=-60e-3); >> plot2d(rhs(sol),[x,0,3.3e-3],[y,-100e-3,100e-3]); >> plot2d: expression evaluates to non-numeric value somewhere in plotting > > Not surprising because rhs(sol) is an expression containing a symbolic > tau. That's kind of hard to plot. > > Ray > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From dwiniecki at boisestate.edu Thu Jan 19 11:28:08 2012 From: dwiniecki at boisestate.edu (Donald Winiecki) Date: Thu, 19 Jan 2012 10:28:08 -0700 Subject: [Maxima] [A/V WARNING: MESSAGE UNSCANNABLE] Re: [Gcl-devel] maxima for windows with modern gcc/gcl In-Reply-To: References: <4F14E754.2070100@gmail.com> <87lip6w8d7.fsf@maguirefamily.org> Message-ID: Stefano (or anyone!), The attached 7zip file contains documentation and other files to guide the creation of a Win32 installer for GCL. The scripts work in `Inno Setup', available from http://www.jrsoftware.org/isinfo.php Let me know if you run into any bumps. Best, _don On Thu, Jan 19, 2012 at 2:13 AM, Stefano Ferri wrote: > Thanks David and Camm. I've succesfully built gcl with the latest > Mingw/Msys without pain. A simple checkout and a configure worked fine. > Yes, I've noticed too that the option to disable xdr was broken, I didn't > mention this fact in my previous email. > Now I will try to finish the build process and the creation of the > installer (just to learn how to do it). > > I think we should update the information given by install.win32, they are > obsolete in some points and now the procedure is easier, at least for the > gcl-related part. > > Stefano > > > > > 2012/1/17 Camm Maguire > >> Greetings! Great to hear of your progress. BTW, I build frequently >> under latest wine/mingw packages in Debian, together with >> maxima/acl2/axiom, without issue. Had a native windows box too recently >> and got things working. >> >> axiom needs xdr. Latest glibc moves the functions, and my configure fix >> was too stringent. How about this: >> >> --- configure.in 16 Jan 2012 20:08:03 -0000 >> 1.112.4.1.2.2.2.47.2.3.2.1.4.2.4.2.4.70 >> +++ configure.in 17 Jan 2012 17:21:56 -0000 >> @@ -66,7 +66,7 @@ >> [try_japi=$enableval],[try_japi="no"]) >> >> AC_ARG_ENABLE(xdr,[ --enable-xdr=yes will compile in support for XDR], >> -[try_xdr=$enableval],[try_xdr="no"]) >> +[enable_xdr=$enableval],[enable_xdr="yes"]) >> >> AC_ARG_ENABLE(xgcl,[ --enable-xgcl=yes will compile in support for XGCL], >> [enable_xgcl=$enableval],[enable_xgcl="yes"]) >> @@ -1046,8 +1046,12 @@ >> fi >> >> >> -AC_CHECK_FUNC(xdr_double,, >> - AC_CHECK_LIB(tirpc,xdr_double,TLIBS="$TLIBS >> -ltirpc",AC_MSG_ERROR([Need xdr_double]))) >> +if test "$enable_xdr" = "yes" ; then >> + AC_CHECK_FUNC(xdr_double,AC_DEFINE(HAVE_XDR), >> + AC_CHECK_LIB(tirpc,xdr_double,AC_DEFINE(HAVE_XDR) >> TLIBS="$TLIBS -ltirpc", >> + AC_CHECK_LIB(rpc,xdr_double,AC_DEFINE(HAVE_XDR) TLIBS="$TLIBS >> -lrpc", >> + AC_CHECK_LIB(oncrpc,xdr_double,AC_DEFINE(HAVE_XDR) >> TLIBS="$TLIBS -loncrpc")))) >> +fi >> >> AC_MSG_CHECKING(__builtin___clear_cache) >> AC_TRY_COMPILE([], >> @@ -1373,17 +1377,17 @@ >> EXTRA_LOBJS="${EXTRA_LOBJS} gcl_japi.o" >> LIBS="${LIBS} -ljapi -lwsock32"] ) >> fi >> -if test "$use" = "mingw" ; then >> - if test "$try_xdr" = "yes" ; then >> - AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) >> - LIBS="${LIBS} -loncrpc"] ) >> - fi >> -else >> - if test "$try_xdr" = "yes" ; then >> - AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) >> - LIBS="${LIBS} -lrpc"] ) >> - fi >> -fi >> +dnl if test "$use" = "mingw" ; then >> +dnl if test "$try_xdr" = "yes" ; then >> +dnl AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) >> +dnl LIBS="${LIBS} -loncrpc"] ) >> +dnl fi >> +dnl else >> +dnl if test "$try_xdr" = "yes" ; then >> +dnl AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) >> +dnl LIBS="${LIBS} -lrpc"] ) >> +dnl fi >> +dnl fi >> >> # Should really find a way to check for prototypes, but this >> # basically works for now. CM >> >> David Billinghurst writes: >> >> > A couple of days ago I posted a windows installer for maxima-5.26.0 at >> > >> > http://billinghurst.customer.netspace.net.au/maxima-5.26.0.exe >> > >> > See http://www.math.utexas.edu/pipermail/maxima/2012/027451.html >> > >> > Having set up the build system, I decided to try it on a current >> mingw/msys installation. As some of you know, it is a tricky build as gcl on >> > windows is touchy. The last version of gcc that could be used to build >> gcl was gcc-3.3.1 from August 2003, and you need to have an ancient mingw/ >> > msys install. See the INSTALL.win32 file in maxima cvs for the >> details. There has been some progress with gcl. One can now build gcl >> with the >> > latest mingw32/msys using gcc-4.6.2 and successfully build a working >> maxima. While the build works on 32-bit WinXP, I haven't managed to >> reproduce >> > it (yet) on a 64-bit Windows 7 machine. >> > >> > Anyway, I have uploaded a test installer of maxima cvs 2012-01-16 using >> gcc-4.6.2 to >> > >> > http://billinghurst.customer.netspace.net.au/maxima-5.26.0-test.exe >> > >> > This is still work in progress, and some documentation is required, but >> I'd welcome feedback. >> > >> > David >> > >> > _______________________________________________ >> > Maxima mailing list >> > Maxima at math.utexas.edu >> > http://www.math.utexas.edu/mailman/listinfo/maxima >> >> -- >> Camm Maguire >> camm at maguirefamily.org >> ========================================================================== >> "The earth is but one country, and mankind its citizens." -- Baha'u'llah >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > > > _______________________________________________ > Gcl-devel mailing list > Gcl-devel at gnu.org > https://lists.gnu.org/mailman/listinfo/gcl-devel > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Building Win32 installer.7z Type: application/octet-stream Size: 3439322 bytes Desc: not available URL: From zaleksf at umich.edu Sat Jan 21 03:54:04 2012 From: zaleksf at umich.edu (Steve Zalek) Date: Sat, 21 Jan 2012 09:54:04 +0000 (UTC) Subject: [Maxima] No file at SourceForge References: Message-ID: Robert Dodier gmail.com> writes: > Well, I uploaded a file to > /home/frs/project/m/ma/maxima/Maxima-Windows/5.26.0-Windows > (path approximate -- working from memory here) > and I can see the file in sftp. From what I can tell it is just > like the Linux files so it seems like it should be visible. > > Does someone want to try uploading another file (anything) > just to see if there is something peculiar about maxima-5.26.0.exe ? > I've run out of ideas at this point. > > best > > Robert Dodier > Yep - still no files in the 5.26.0-Windows folder when viewed through a web browser. The folder indicates that there is a single item in it with a size of 30.4MB, but no file is visible. Thanks. From korte at lite.msu.edu Sun Jan 22 13:22:08 2012 From: korte at lite.msu.edu (Gerd Kortemeyer) Date: Sun, 22 Jan 2012 14:22:08 -0500 Subject: [Maxima] Declarations - how to compare two equations? In-Reply-To: References: <515989B4-0A9B-455B-8BCB-9CBF00CDB91C@lite.msu.edu> <4F1C29A1.7070400@eecs.berkeley.edu> Message-ID: Hi, Thanks for the very quick replies! On Jan 22, 2012, at 10:59 AM, Henry Baker wrote: > > I still think that this is a worthwhile goal, but it would require a substantial amount of work to produce what Gerd wants. > > At 07:22 AM 1/22/2012, Richard Fateman wrote: >> Solve generally ignores declarations, except insofar as it might call some other program like simplification, that uses them. >> >> You will have to filter out the real solutions some other way. Please excuse my ignorance of advanced MAXIMA syntax. Here's what I really need to achieve: see if an equation that a student inputs is equivalent to an equation given by the instructor. Here's a snippet of internal LON-CAPA code; LON-CAPA is mostly written in Perl, the &cas()-subroutine passes expressions to MAXIMA for evaluation. sub compareequations { my ($var,$value,$equation)=@_; # var is the variable given # value is the expected value of $var, $var=$value # equation is the equation to be tested $expressiona='trigsimp(trigreduce(['.$var.'='.$value.']))'; $expressionb='trigsimp(trigreduce(solve('.$equation.','.$var.')))'; $reply=&cas('maxima','is(equal('.$expressiona.','.$expressionb.'))'); if ($reply=~/^Error\:/) { return $reply; } if ($reply=~/true/) { return 'true'; } return 'false'; } So, my current algorithm is: * instructor gives a single variable on the lefthand side and the expected righthand side (e.g., "x" and "2*y+b" for "x=2*y+b") * the student answer (e.g., "y=(x-b)/2") is solved for that variable (in this example, "x"), simplified, and compared to the simplified instructor answer The above problem occurs in a (minimal) example when the instructor answer is x=5, and the student inputs x^3=125 - in the real realm, that would be awkward but correct. Is there any better way to compare two equations (that LON-CAPA does not "know" the first thing about) inside MAXIMA, and if not, how could I begin to address the issue? Thanks! - Gerd. From fateman at eecs.berkeley.edu Sun Jan 22 13:56:54 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 22 Jan 2012 11:56:54 -0800 Subject: [Maxima] Declarations - how to compare two equations? In-Reply-To: References: <515989B4-0A9B-455B-8BCB-9CBF00CDB91C@lite.msu.edu> <4F1C29A1.7070400@eecs.berkeley.edu> Message-ID: <4F1C6A06.50705@eecs.berkeley.edu> On 1/22/2012 11:22 AM, Gerd Kortemeyer wrote: .... > . Is there any better way to compare two equations (that LON-CAPA does > not "know" the first thing about) inside MAXIMA, and if not, how could > I begin to address the issue? Thanks! - Gerd. say that you want to tell if A=B and C=D express the same truth. let e1 = A-B and e2= C-D. let X=[x1,x2,...,xn] be the set of variables that occur in e1 and e2. Choose n random floating point numbers for x1, ..., xn, and evaluate e1 and e2. If the results are the same, approximately, then you say "yes". This can also be done with values chosen from a finite field, followed by evaluation using modular arithmetic. This is called hash-coding of expressions. The results would be identical. Details to consider: how many times to repeat the test. what to do with overflow, underflow, divide by zero. how close is equal. These ideas are not original with me, but (especially) the floating point evaluation has been proposed and maybe used in student test grading. From woollett at charter.net Sun Jan 22 14:44:57 2012 From: woollett at charter.net (Edwin Woollett) Date: Sun, 22 Jan 2012 12:44:57 -0800 Subject: [Maxima] quad_qagp behavior Message-ID: <1E77B74B786D4EE99ABC057CF47E1F4A@edwinc367e16bd> On Jan. 21, 2012, Raymond Toy wrote --------------------------- >You didn't take enough samples. I plotted r1(x) - r2(x) for x from %pi >to 5. and the plot is not zero. It is zero for x from 1 to %pi. --------------------------------------------------------------- You are right, I did not sample far enough. The two expressions agree up to %pi, and r2(x) is undefined for x > %pi (while r1(x) = 0 for x > %pi). ----------------------------------------------------------- (%i1) r1(x):= realpart(1/sqrt(sin(x)))$ (%i2) r2(x) := 1/realpart(sqrt(sin(x)))$ (%i3) r1(5); (%o3) 0 (%i4) r2(5); expt: undefined: 0 to a negative exponent. #0: r2(x=5) -- an error. To debug this try: debugmode(true); (%i5) r1(u); (%o5) cos(atan2(0,sin(u))/2)/sqrt(abs(sin(u))) (%i6) r2(u); (%o6) 1/(cos(atan2(0,sin(u))/2)*sqrt(abs(sin(u)))) (%i7) r1(3); (%o7) 1/sqrt(sin(3)) (%i8) r2(3); (%o8) 1/sqrt(sin(3)) ------------------------- >So I guess realpart is buggy in this case, although ratsimp(r1(x)-r2(x)) >is zero. ---------------------------------- realpart looks unreliable here, but how do you get ratsimp to give zero? ------------------------------------------------ (%i9) ratsimp(r1(u) - r2(u)); (%o9) (cos(atan2(0,sin(u))/2)^2-1)/(cos(atan2(0,sin(u))/2)*sqrt(abs(sin(u)))) ------------------------------------------ Ted From vi5u0-maxima at yahoo.co.uk Sun Jan 22 15:13:33 2012 From: vi5u0-maxima at yahoo.co.uk (Dan) Date: Sun, 22 Jan 2012 21:13:33 +0000 (GMT) Subject: [Maxima] Integrating a Gaussian wrt its width Message-ID: Dear All, I'm interested in integrals of the form: declare(N,integer) ; assume(N > 0) ; assume(N > 1) ; marginal : 'integrate((1/t-C)^(N-1)*exp(A-B/t^2),t,0,1/C) ; Inspired by Jeffreys (1961, _Theory of Probability_, Oxford University Press, p. 139), I thought a nice way forward would be to reduce this to a finite series of incomplete Gamma functions, using the substitution changevar(marginal,u+B/t^2,u,t) ; but all I get when I issue this changevar command is the error sign: sign of infinity is undefined. -- an error. To debug this try: debugmode(true); Any ideas, please? -- Thanks, Dan From willisb at unk.edu Sun Jan 22 16:11:19 2012 From: willisb at unk.edu (Barton Willis) Date: Sun, 22 Jan 2012 16:11:19 -0600 Subject: [Maxima] Integrating a Gaussian wrt its width In-Reply-To: References: Message-ID: Your change of variable converts the lower limit of integration to either -infinity for infinity (depending on the sign of B). The function changevar doesn't handle such things correctly, I think. You could try changing the lower limit to a new symbol---I wasn't able to push this any further. For integer N, one thing that might work: (%i1) assume(C>0, B>0); (%o1) [C>0,B>0] (%i2) marginal : integrate((1/t-C)^(N-1)*exp(A-B/t^2),t,0,1/C); (%o2) integrate(%e^(A-B/t^2)*(1/t-C)^(N-1),t,0,1/C) (%i3) makelist(ev(marginal, N : k, integrate),k,1,3); (%o3) [(gamma_incomplete(-1/2,B*C^2)*%e^A*sqrt(B))/2,-(gamma_incomplete(-1/2,B*C^2)*%e^A*sqrt(B)*C-gamma_incomplete(0,B*C^2)*%e^A)/2,-(-gamma_incomplete(-1/2,B*C^2)*%e^A*B*C^2+2*gamma_incomplete(0,B*C^2)*%e^A*sqrt(B)*C-gamma_incomplete(1/2,B*C^2)*%e^A)/(2*sqrt(B))] --Barton -----maxima-bounces at math.utexas.edu wrote: ----- To: Maxima mailing list From: Dan Sent by: maxima-bounces at math.utexas.edu Date: 01/22/2012 03:08PM Subject: [Maxima] Integrating a Gaussian wrt its width Dear All, I'm interested in integrals of the form: declare(N,integer) ; assume(N > 0) ; assume(N > 1) ; marginal : 'integrate((1/t-C)^(N-1)*exp(A-B/t^2),t,0,1/C) ; Inspired by Jeffreys (1961, _Theory of Probability_, Oxford University Press, p. 139), I thought a nice way forward would be to reduce this to a finite series of incomplete Gamma functions, using the substitution changevar(marginal,u+B/t^2,u,t) ; but all I get when I issue this changevar command is the error sign: sign of infinity is undefined. ??-- an error. To debug this try: debugmode(true); Any ideas, please? -- Thanks, Dan _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From ferriste at gmail.com Mon Jan 23 03:00:15 2012 From: ferriste at gmail.com (Stefano Ferri) Date: Mon, 23 Jan 2012 10:00:15 +0100 Subject: [Maxima] [Gcl-devel] maxima for windows with modern gcc/gcl In-Reply-To: References: <4F14E754.2070100@gmail.com> <87lip6w8d7.fsf@maguirefamily.org> Message-ID: 2012/1/19 Donald Winiecki > Stefano (or anyone!), > > The attached 7zip file contains documentation and other files to guide the > creation of a Win32 installer for GCL. The scripts work in `Inno Setup', > available from http://www.jrsoftware.org/isinfo.php > > Let me know if you run into any bumps. > > Best, > > _don > > Thank you for that, I will try to follow your suggestions as soon as I can (now I have no access to a win32 machine). Same thing for a new install.win32, as soon as I have time I will write what I have learned. Stefano > > On Thu, Jan 19, 2012 at 2:13 AM, Stefano Ferri wrote: > >> Thanks David and Camm. I've succesfully built gcl with the latest >> Mingw/Msys without pain. A simple checkout and a configure worked fine. >> Yes, I've noticed too that the option to disable xdr was broken, I didn't >> mention this fact in my previous email. >> Now I will try to finish the build process and the creation of the >> installer (just to learn how to do it). >> >> I think we should update the information given by install.win32, they are >> obsolete in some points and now the procedure is easier, at least for the >> gcl-related part. >> >> Stefano >> >> >> >> >> 2012/1/17 Camm Maguire >> >>> Greetings! Great to hear of your progress. BTW, I build frequently >>> under latest wine/mingw packages in Debian, together with >>> maxima/acl2/axiom, without issue. Had a native windows box too recently >>> and got things working. >>> >>> axiom needs xdr. Latest glibc moves the functions, and my configure fix >>> was too stringent. How about this: >>> >>> --- configure.in 16 Jan 2012 20:08:03 -0000 >>> 1.112.4.1.2.2.2.47.2.3.2.1.4.2.4.2.4.70 >>> +++ configure.in 17 Jan 2012 17:21:56 -0000 >>> @@ -66,7 +66,7 @@ >>> [try_japi=$enableval],[try_japi="no"]) >>> >>> AC_ARG_ENABLE(xdr,[ --enable-xdr=yes will compile in support for XDR], >>> -[try_xdr=$enableval],[try_xdr="no"]) >>> +[enable_xdr=$enableval],[enable_xdr="yes"]) >>> >>> AC_ARG_ENABLE(xgcl,[ --enable-xgcl=yes will compile in support for >>> XGCL], >>> [enable_xgcl=$enableval],[enable_xgcl="yes"]) >>> @@ -1046,8 +1046,12 @@ >>> fi >>> >>> >>> -AC_CHECK_FUNC(xdr_double,, >>> - AC_CHECK_LIB(tirpc,xdr_double,TLIBS="$TLIBS >>> -ltirpc",AC_MSG_ERROR([Need xdr_double]))) >>> +if test "$enable_xdr" = "yes" ; then >>> + AC_CHECK_FUNC(xdr_double,AC_DEFINE(HAVE_XDR), >>> + AC_CHECK_LIB(tirpc,xdr_double,AC_DEFINE(HAVE_XDR) >>> TLIBS="$TLIBS -ltirpc", >>> + AC_CHECK_LIB(rpc,xdr_double,AC_DEFINE(HAVE_XDR) TLIBS="$TLIBS >>> -lrpc", >>> + AC_CHECK_LIB(oncrpc,xdr_double,AC_DEFINE(HAVE_XDR) >>> TLIBS="$TLIBS -loncrpc")))) >>> +fi >>> >>> AC_MSG_CHECKING(__builtin___clear_cache) >>> AC_TRY_COMPILE([], >>> @@ -1373,17 +1377,17 @@ >>> EXTRA_LOBJS="${EXTRA_LOBJS} gcl_japi.o" >>> LIBS="${LIBS} -ljapi -lwsock32"] ) >>> fi >>> -if test "$use" = "mingw" ; then >>> - if test "$try_xdr" = "yes" ; then >>> - AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) >>> - LIBS="${LIBS} -loncrpc"] ) >>> - fi >>> -else >>> - if test "$try_xdr" = "yes" ; then >>> - AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) >>> - LIBS="${LIBS} -lrpc"] ) >>> - fi >>> -fi >>> +dnl if test "$use" = "mingw" ; then >>> +dnl if test "$try_xdr" = "yes" ; then >>> +dnl AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) >>> +dnl LIBS="${LIBS} -loncrpc"] ) >>> +dnl fi >>> +dnl else >>> +dnl if test "$try_xdr" = "yes" ; then >>> +dnl AC_CHECK_HEADERS(rpc/rpc.h,[AC_DEFINE(HAVE_XDR) >>> +dnl LIBS="${LIBS} -lrpc"] ) >>> +dnl fi >>> +dnl fi >>> >>> # Should really find a way to check for prototypes, but this >>> # basically works for now. CM >>> >>> David Billinghurst writes: >>> >>> > A couple of days ago I posted a windows installer for maxima-5.26.0 at >>> > >>> > http://billinghurst.customer.netspace.net.au/maxima-5.26.0.exe >>> > >>> > See http://www.math.utexas.edu/pipermail/maxima/2012/027451.html >>> > >>> > Having set up the build system, I decided to try it on a current >>> mingw/msys installation. As some of you know, it is a tricky build as gcl on >>> > windows is touchy. The last version of gcc that could be used to >>> build gcl was gcc-3.3.1 from August 2003, and you need to have an ancient >>> mingw/ >>> > msys install. See the INSTALL.win32 file in maxima cvs for the >>> details. There has been some progress with gcl. One can now build gcl >>> with the >>> > latest mingw32/msys using gcc-4.6.2 and successfully build a working >>> maxima. While the build works on 32-bit WinXP, I haven't managed to >>> reproduce >>> > it (yet) on a 64-bit Windows 7 machine. >>> > >>> > Anyway, I have uploaded a test installer of maxima cvs 2012-01-16 >>> using gcc-4.6.2 to >>> > >>> > http://billinghurst.customer.netspace.net.au/maxima-5.26.0-test.exe >>> > >>> > This is still work in progress, and some documentation is required, >>> but I'd welcome feedback. >>> > >>> > David >>> > >>> > _______________________________________________ >>> > Maxima mailing list >>> > Maxima at math.utexas.edu >>> > http://www.math.utexas.edu/mailman/listinfo/maxima >>> >>> -- >>> Camm Maguire >>> camm at maguirefamily.org >>> >>> ========================================================================== >>> "The earth is but one country, and mankind its citizens." -- >>> Baha'u'llah >>> _______________________________________________ >>> Maxima mailing list >>> Maxima at math.utexas.edu >>> http://www.math.utexas.edu/mailman/listinfo/maxima >>> >> >> >> _______________________________________________ >> Gcl-devel mailing list >> Gcl-devel at gnu.org >> https://lists.gnu.org/mailman/listinfo/gcl-devel >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleksasd873 at gmail.com Sun Jan 22 13:08:48 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Sun, 22 Jan 2012 21:08:48 +0200 Subject: [Maxima] Declarations Message-ID: from http://www.math.utexas.edu/pipermail/maxima/2012/027525.html *Gerd Kortemeyer: * Hi, We have been using MAXIMA successfully inside of LON-CAPA for homework problems for several years now - it's a great tool, thanks everybody!!! While authoring a new kind of homework, I am struggling with "declare" - why does the following (sample) code not give the expected results? (%i4) declare(x,real); (%o4) done (%i5) solve(x^3=125,x); 5 sqrt(3) %i - 5 5 sqrt(3) %i + 5 (%o5) [x = ----------------, x = - ----------------, x = 5] 2 2 (%i6) facts(); (%o6) [kind(x, real)] Is there another way to tell "solve" to stay in the real realm? Thanks! - Gerd. *********************************************************************************** How to get only real solutions of polynomial equation? I know these methods: a) (%i1) sol:solve(x^3=125,x); (%o1) [x=(5*sqrt(3)*%i-5)/2,x=-(5*sqrt(3)*%i+5)/2,x=5] (%i2) sublist(sol,lambda([e],freeof(%i,e))); (%o2) [x=5] b) (%i3) realonly:true$ realroots(x^3=125); (%o4) [x=5] c) (%i5) realonly:true$ algsys([x^3=125],[x]); (%o6) [[x=5]] d) (%i7) realonly:true$ to_poly_solve([x^3=125], [x]); Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $ (%o8) %union([x=5]) (%i9) first(%); (%o9) [x=5] Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Mon Jan 23 11:14:03 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 23 Jan 2012 09:14:03 -0800 Subject: [Maxima] quad_qagp behavior In-Reply-To: <1E77B74B786D4EE99ABC057CF47E1F4A@edwinc367e16bd> References: <1E77B74B786D4EE99ABC057CF47E1F4A@edwinc367e16bd> Message-ID: On Sun, Jan 22, 2012 at 12:44 PM, Edwin Woollett wrote: > On Jan. 21, 2012, Raymond Toy wrote > --------------------------- > > You didn't take enough samples. I plotted r1(x) - r2(x) for x from %pi >> to 5. and the plot is not zero. It is zero for x from 1 to %pi. >> > ------------------------------**------------------------------**--- > You are right, I did not sample far enough. The two > expressions agree up to %pi, and r2(x) is undefined > for x > %pi (while r1(x) = 0 for x > %pi). > ------------------------------**----------------------------- > (%i1) r1(x):= realpart(1/sqrt(sin(x)))$ > (%i2) r2(x) := 1/realpart(sqrt(sin(x)))$ > > (%i3) r1(5); > (%o3) 0 > > (%i4) r2(5); > expt: undefined: 0 to a negative exponent. > #0: r2(x=5) > -- an error. To debug this try: debugmode(true); > > (%i5) r1(u); > (%o5) cos(atan2(0,sin(u))/2)/sqrt(**abs(sin(u))) > > (%i6) r2(u); > (%o6) 1/(cos(atan2(0,sin(u))/2)***sqrt(abs(sin(u)))) > > (%i7) r1(3); > (%o7) 1/sqrt(sin(3)) > > (%i8) r2(3); > (%o8) 1/sqrt(sin(3)) > ------------------------- > > So I guess realpart is buggy in this case, although ratsimp(r1(x)-r2(x)) >> is zero. >> > ------------------------------**---- > realpart looks unreliable here, but how do you get ratsimp to > give zero? > Sorry, I clearly made a mistake. Unfortunately, I don't know what because that session is gone. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Jan 23 11:41:47 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 23 Jan 2012 12:41:47 -0500 Subject: [Maxima] Declarations - how to compare two equations? In-Reply-To: <4F1C6A06.50705@eecs.berkeley.edu> References: <515989B4-0A9B-455B-8BCB-9CBF00CDB91C@lite.msu.edu> <4F1C29A1.7070400@eecs.berkeley.edu> <4F1C6A06.50705@eecs.berkeley.edu> Message-ID: Though this is a good approach for equivalence of *expressions*, I don't think it works well for equations, even for simple cases. The equations* a*= 1, 200* *a *= 200, *a* + 37 = 38, and (a-1)^201 = 0 all have the same solution set, but LHS-RHS and LHS/RHS are different for all *a* <> 1. Even if you happen to test the a=1 case, you still don't know that the solution sets are the same. Of course, it is much worse in the multivariate case. -s On Sun, Jan 22, 2012 at 14:56, Richard Fateman wrote: > On 1/22/2012 11:22 AM, Gerd Kortemeyer wrote: > .... > >> . Is there any better way to compare two equations (that LON-CAPA does >> not "know" the first thing about) inside MAXIMA, and if not, how could I >> begin to address the issue? Thanks! - Gerd. >> > > say that you want to tell if A=B and C=D express the same truth. > > let e1 = A-B and e2= C-D. > let X=[x1,x2,...,xn] be the set of variables that occur in e1 and e2. > > Choose n random floating point numbers for x1, ..., xn, and evaluate e1 > and e2. > > If the results are the same, approximately, then you say "yes". > > This can also be done with values chosen from a finite field, followed by > evaluation using modular arithmetic. This is called hash-coding of > expressions. > The results would be identical. > > Details to consider: > how many times to repeat the test. > what to do with overflow, underflow, divide by zero. > how close is equal. > > These ideas are not original with me, but (especially) the floating point > evaluation > has been proposed and maybe used in student test grading. > > > > > > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulumbelu at googlemail.com Mon Jan 23 13:27:03 2012 From: ulumbelu at googlemail.com (Ralf Jung) Date: Mon, 23 Jan 2012 20:27:03 +0100 Subject: [Maxima] How to prevent the immediaetly evaluation after substitute a variable Message-ID: Dear maxima list members, here a example what's happend (%i1) x : 2*sqrt(h) (%o1) 2sqrt(h) (%i2) subst([h=0.3], x) (%o2) 1.095445115010332 But I want this outcome (%o2) 2sqrt(0.3) is it possible to stop the immediaetly evaluation after subst, so I can see first my expression with all the variables changed? ralf From lorenzo.isella at gmail.com Mon Jan 23 13:57:20 2012 From: lorenzo.isella at gmail.com (Lorenzo Isella) Date: Mon, 23 Jan 2012 20:57:20 +0100 Subject: [Maxima] Constructing a Function with a given Singularity Message-ID: <4F1DBBA0.5000809@gmail.com> Dear All, I hope this is not too off topic. I do not know if maxima can help me at all, but I would like to give it a try. I need to build a function of a power-law of x with the following asymptotic behavior for large x f(x^alpha)--> 0, if alpha=1, f(x^alpha)--> constant, if alpha in (1,1/3] Does anybody have any idea about how to do this in maxima? I repeat that I need a function of x^alpha; I cannot e.g. express f(x^alpha)=alpha*g(x^alpha), as alpha can appear only in the expression x^alpha. Does anybody have any idea about how to achieve that? Many thanks Lorenzo From willisb at unk.edu Mon Jan 23 14:27:58 2012 From: willisb at unk.edu (Barton Willis) Date: Mon, 23 Jan 2012 14:27:58 -0600 Subject: [Maxima] How to prevent the immediaetly evaluation after substitute a variable In-Reply-To: References: Message-ID: Try using box: (%i67) 2 * sqrt(box(h)); (%o67) 2*sqrt(h) (%i68) subst(h=0.3,%); (%o68) 2*sqrt(0.3) (%i69) rembox(%); (%o69) 1.095445115010332 To read the documentation for box, input ? box. There might be limitations on this method that I have not thought about.It might be possible to extend rembox to remove boxes bottom up one layer at a time. --Barton maxima-bounces at math.utexas.edu wrote on 01/23/2012 01:27:03 PM: > From: Ralf Jung > To: Maxima at math.utexas.edu > Date: 01/23/2012 01:26 PM > Subject: [Maxima] How to prevent the immediaetly evaluation after > substitute a variable > Sent by: maxima-bounces at math.utexas.edu > > Dear maxima list members, > > here a example what's happend > > (%i1) x : 2*sqrt(h) > > (%o1) 2sqrt(h) > > (%i2) subst([h=0.3], x) > > (%o2) 1.095445115010332 > > But I want this outcome > > (%o2) 2sqrt(0.3) > > is it possible to stop the immediaetly evaluation after subst, so I > can see first my expression with all the variables changed? > > ralf > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Jan 23 15:36:17 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 23 Jan 2012 16:36:17 -0500 Subject: [Maxima] How to prevent the immediaetly evaluation after substitute a variable In-Reply-To: References: Message-ID: Ralf, Let me just add to Barton's suggestion that the issue here isn't (in Maxima terminology) "evaluation" (i.e. the substitution of variable values and functions) but "simplification". The expression (2+3) is *simplified* to 5, just as (2*x+3*x) is *simplified* to 5*x. -s On Mon, Jan 23, 2012 at 15:27, Barton Willis wrote: > Try using box: > > (%i67) 2 * sqrt(box(h)); > (%o67) 2*sqrt(h) > > (%i68) subst(h=0.3,%); > (%o68) 2*sqrt(0.3) > > (%i69) rembox(%); > (%o69) 1.095445115010332 > > To read the documentation for box, input ? box. There might be limitations > on > this method that I have not thought about.It might be possible to extend > rembox > to remove boxes bottom up one layer at a time. > > --Barton > > maxima-bounces at math.utexas.edu wrote on 01/23/2012 01:27:03 PM: > > > From: Ralf Jung > > To: Maxima at math.utexas.edu > > Date: 01/23/2012 01:26 PM > > Subject: [Maxima] How to prevent the immediaetly evaluation after > > substitute a variable > > Sent by: maxima-bounces at math.utexas.edu > > > > Dear maxima list members, > > > > here a example what's happend > > > > (%i1) x : 2*sqrt(h) > > > > (%o1) 2sqrt(h) > > > > (%i2) subst([h=0.3], x) > > > > (%o2) 1.095445115010332 > > > > But I want this outcome > > > > (%o2) 2sqrt(0.3) > > > > is it possible to stop the immediaetly evaluation after subst, so I > > can see first my expression with all the variables changed? > > > > ralf > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jrredford at yahoo.com Mon Jan 23 20:21:34 2012 From: jrredford at yahoo.com (James Redford) Date: Mon, 23 Jan 2012 18:21:34 -0800 (PST) Subject: [Maxima] Errors in Windows Maxima 5.26.0 run_testsuite Message-ID: <1327371694.82933.YahooMailClassic@web121806.mail.ne1.yahoo.com> I downloaded the following binary: http://iweb.dl.sourceforge.net/project/maxima/Maxima-Windows/5.26.0-Windows/maxima-5.26.0.exe 30,364,448 bytes MD5: 2b9342ec1130ab56189dd08c71f1be26 After running the command "run_testsuite(display_all=true, display_known_bugs=true);", the following is the result: Error summary: Errors found in C:/program1/maxima/share/maxima/5.26.0/tests/rtest16.mac, problems: (185 186) 2 tests failed out of 9,121 total tests. real time : 425.570 secs run-gbc time : 393.620 secs child run time : 0.000 secs gbc time : 31.950 secs (%o0) done (%i1) Below is the build information: Maxima version: 5.26.0 Maxima build date: 22:48 1/15/2012 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 ---------- I also submitted the above as a bug-report at http://sourceforge.net/tracker/?group_id=4933&atid=104933 . From dbmaxima at gmail.com Mon Jan 23 20:54:33 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Tue, 24 Jan 2012 13:54:33 +1100 Subject: [Maxima] Errors in Windows Maxima 5.26.0 run_testsuite In-Reply-To: <1327371694.82933.YahooMailClassic@web121806.mail.ne1.yahoo.com> References: <1327371694.82933.YahooMailClassic@web121806.mail.ne1.yahoo.com> Message-ID: <4F1E1D69.7090008@gmail.com> On 24/01/2012 1:21 PM, James Redford wrote: > I downloaded the following binary: > > http://iweb.dl.sourceforge.net/project/maxima/Maxima-Windows/5.26.0-Windows/maxima-5.26.0.exe > > 30,364,448 bytes > MD5: 2b9342ec1130ab56189dd08c71f1be26 > > > After running the command "run_testsuite(display_all=true, display_known_bugs=true);", the following is the result: > > > Error summary: > Errors found in C:/program1/maxima/share/maxima/5.26.0/tests/rtest16.mac, problems: > (185 186) > 2 tests failed out of 9,121 total tests. > real time : 425.570 secs > run-gbc time : 393.620 secs > child run time : 0.000 secs > gbc time : 31.950 secs > (%o0) done > (%i1) > > > Below is the build information: > > > Maxima version: 5.26.0 > Maxima build date: 22:48 1/15/2012 > Host type: i686-pc-mingw32 > Lisp implementation type: GNU Common Lisp (GCL) > Lisp implementation version: GCL 2.6.8 > > > ---------- > > > I also submitted the above as a bug-report at http://sourceforge.net/tracker/?group_id=4933&atid=104933 . > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Thnaks for the report. That would be these tests below. They are a known problem with gcl under windows. Unfortunately the testsuite doesn't allow us to make known errors conditional on platform and lisp. Interestingly, I don't see them with my experimental windows build of CVS maxima using gcl/gcc-4.6.2. (http://www.math.utexas.edu/pipermail/maxima/2012/027475.html) Another reason to test this new build. Running tests in rtest16: ********************** Problem 185 *************** Input: 60 2 - 1 float(-------) - 1 60 2 Result: - 1.1102230246251565E-16 This differed from the expected result: 0.0 ********************** Problem 186 *************** Input: 1000 2 - 1 float(---------) - 1 1000 2 Result: - 1.1102230246251565E-16 This differed from the expected result: 0.0 From pbowyer at olynet.com Tue Jan 24 14:41:52 2012 From: pbowyer at olynet.com (Paul Bowyer) Date: Tue, 24 Jan 2012 12:41:52 -0800 Subject: [Maxima] Make check failures Message-ID: <4F1F1790.5040603@olynet.com> I downloaded the maxima source yesterday using: git clone git://maxima.git.sourceforge.net/gitroot/maxima/maxima I used the following configuration incantation today to build maxima: export GCL_ANSI=y CFLAGS="-O2 -g -march=i386 -mcpu=i686 -fno-fast-math" CXXFLAGS="-O2 -g -march=i386 -mcpu=i686 -fno-fast-math" && ./configure --prefix=$HOME/MaximaTest --enable-sbcl --enable-cmucl --enable-ccl --enable-gcl --with-sbcl=/usr/local/bin/sbcl --with-cmucl=/opt/cmucl-20c/bin/lisp --with-ccl=/usr/local/bin/ccl --with-gcl=/usr/bin/gcl followed by: make make check make install build_info (); Maxima version: 5.26.0_22_g91b6c40 Maxima build date: 10:20 1/24/2012 Host type: i686-pc-linux-gnu Lisp implementation type: CMU Common Lisp Lisp implementation version: Snapshot 2011-02 (20B Unicode) make check completed without unknown failures. build_info (); Maxima version: 5.26.0_22_g91b6c40 Maxima build date: 10:28 1/24/2012 Host type: i686-pc-linux-gnu Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 make check completed without unknown failures. build_info (); Maxima version: 5.26.0_22_g91b6c40 Maxima build date: 10:22 1/24/2012 Host type: i686-pc-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.53 make check failures are tests (393, 394) build_info (); Maxima version: 5.26.0_22_g91b6c40 Maxima build date: 10:30 1/24/2012 Host type: i686-pc-linux-gnu Lisp implementation type: Clozure Common Lisp Lisp implementation version: Version 1.6-r14468M (LinuxX8632) make check failures are tests (37, 193, 197) I ran the test suite from within xmaxima for sbcl and ccl and sbcl fails on rtest16 ********************** Problem 393 *************** Input: closeto(zeta(%i + 3) - (1.10721440843141 - .1482908671781754 %i), 1.e-15) Result: 3.3157171161039706e-9 This differed from the expected result: true ********************** Problem 394 *************** Input: ! 1 ! closeto(!zeta(0.5 %i + -)! - 1.06534921249378, 1.e-14) ! 2 ! Result: 3.1194385963217997e-8 This differed from the expected result: true ccl fails on rtest15 ********************** Problem 37 *************** Input: 2 2 - %pi sin (3 a) sin (----- + a + b) 3 (----------------------------- 2 %pi sin (a - ---) 3 - %pi 2 sin(a) sin(3 a) cos(b) sin(----- + a + b) sin(3 a + 3 b) 3 - ---------------------------------------------------------- %pi sin(a - ---) sin(a + b) 3 2 2 sin (a) sin (3 a + 3 b) + -----------------------, result : trigrat(%%), 2 sin (a + b) expected : (- (- 9 + 10 cos(2 a) - 2 sqrt(3) sin(2 a) - cos(4 a) + sqrt(3) sin(4 a) + 10 cos(2 b) - 2 sqrt(3) sin(2 b) - cos(4 b) + sqrt(3) sin(4 b) - 4 cos(2 b - 2 a) - 8 cos(2 a + 2 b) + 4 sqrt(3) sin(2 a + 2 b) + 2 cos(4 a + 2 b) - 2 sqrt(3) sin(4 a + 2 b) + 2 cos(2 a + 4 b) - 2 sqrt(3) sin(2 a + 4 b) - cos(4 a + 4 b) + sqrt(3) sin(4 a + 4 b)))/4, ratsimp(result - expected)) Result: Polynomial quotient is not exact error-catch This differed from the expected result: 0 ********************** Problem 193 *************** Input: 2 t log(t) integrate(-----------------, t, 0, 1) 2 4 (t - 1) (1 + t ) Result: 2 (sqrt(2) - 2) %pi - ------------------ 32 This differed from the expected result: 2 (sqrt(2) - 1) %pi ------------------ 9/2 2 ********************** Problem 196 *************** Input: 1 factor(expand(sqrtdenest(integrate(------------, x, 0, 1)))) 1 4 - + (x - 3) 2 3/4 9/4 73 + sqrt(2) + 2 - 3 2 - factor((- (- log(----------------------------) 33 3/4 9/4 3/4 5/2 13/4 73 + sqrt(2) - 2 + 3 2 - 2 + 2 - 2 + log(----------------------------) + 2 atan(---------------------) 33 3/4 13/4 98 + 2 - 2 3/4 5/2 13/4 2 + 2 + 2 7/4 + 2 atan(-------------------)))/2 ) 3/4 13/4 - 98 + 2 - 2 Result: 13/4 5/2 3/4 13/4 5/2 3/4 2 + 2 + 2 - 2 + 2 - 2 (2 atan(-------------------) + 2 atan(---------------------) 13/4 3/4 13/4 3/4 - 2 + 2 - 98 - 2 + 2 + 98 9/4 3/4 9/4 3/4 3 2 - 2 + sqrt(2) + 73 - 3 2 + 2 + sqrt(2) + 73 + log(----------------------------) - log(------------------------------)) 33 33 9/4 3/4 7/4 3 2 - 2 + sqrt(2) + 73 /2 - (log(----------------------------) 33 9/4 3/4 - 3 2 + 2 + sqrt(2) + 73 - log(------------------------------) - 2 33 3/4 1/4 79 2 + 365 sqrt(2) + 877 2 + 5 atan(------------------------------------) 10657 3/4 1/4 - 79 2 + 365 sqrt(2) - 877 2 + 5 7/4 + 2 atan(--------------------------------------))/2 10657 This differed from the expected result: 0 My copies of cmucl, sbcl, and ccl may not be the latest available if that makes any difference to the test suite. I hope this information is useful in making maxima better, Paul Bowyer From toy.raymond at gmail.com Tue Jan 24 15:03:30 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 24 Jan 2012 13:03:30 -0800 Subject: [Maxima] Make check failures In-Reply-To: <4F1F1790.5040603@olynet.com> References: <4F1F1790.5040603@olynet.com> Message-ID: On Tue, Jan 24, 2012 at 12:41 PM, Paul Bowyer wrote: > > I ran the test suite from within xmaxima for sbcl and ccl and > sbcl fails on rtest16 > ********************** Problem 393 *************** > Input: > closeto(zeta(%i + 3) - (1.10721440843141 - .1482908671781754 %i), 1.e-15) > > > Result: > 3.3157171161039706e-9 > > This differed from the expected result: > true > > ********************** Problem 394 *************** > Input: > ! 1 ! > closeto(!zeta(0.5 %i + -)! - 1.06534921249378, 1.e-14) > ! 2 ! > > > Result: > 3.1194385963217997e-8 > I'm pretty sure this is the known issue with sbcl about how it computes (cl:expt ). A bug has been filed, I think, and I have verbal confirmation that it will be fixed someday. (Ccl used to have the same problem, but it was fixed a while ago.) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Tue Jan 24 15:16:15 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 24 Jan 2012 14:16:15 -0700 Subject: [Maxima] Errors in Windows Maxima 5.26.0 run_testsuite In-Reply-To: <1327371694.82933.YahooMailClassic@web121806.mail.ne1.yahoo.com> References: <1327371694.82933.YahooMailClassic@web121806.mail.ne1.yahoo.com> Message-ID: On 1/23/12, James Redford wrote: > I downloaded the following binary: > > http://iweb.dl.sourceforge.net/project/maxima/Maxima-Windows/5.26.0-Windows/maxima-5.26.0.exe Well, this is really crazy. The link above works (I tried it) but the file browser (http://sourceforge.net/projects/maxima/files/Maxima-Windows/5.26.0-Windows) shows nothing (but it still reports "1 item, 30.4 MB"). If anybody has some idea of what to do now, I'm all ears. best Robert Dodier From pbowyer at olynet.com Tue Jan 24 16:54:51 2012 From: pbowyer at olynet.com (Paul Bowyer) Date: Tue, 24 Jan 2012 14:54:51 -0800 Subject: [Maxima] Errors in Windows Maxima 5.26.0 run_testsuite In-Reply-To: References: <1327371694.82933.YahooMailClassic@web121806.mail.ne1.yahoo.com> Message-ID: <4F1F36BB.7000005@olynet.com> On 01/24/2012 01:16 PM, Robert Dodier wrote: > On 1/23/12, James Redford wrote: > >> I downloaded the following binary: >> >> http://iweb.dl.sourceforge.net/project/maxima/Maxima-Windows/5.26.0-Windows/maxima-5.26.0.exe > Well, this is really crazy. The link above works (I tried it) but the > file browser > (http://sourceforge.net/projects/maxima/files/Maxima-Windows/5.26.0-Windows) > shows nothing (but it still reports "1 item, 30.4 MB"). > > If anybody has some idea of what to do now, I'm all ears. > > best > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > You might try renaming the file with a ".ex1" extension to see if that shows properly. Downloaders would have to rename it to run it. Or wrap it in a zip archive possibly. From robert.dodier at gmail.com Tue Jan 24 17:07:02 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 24 Jan 2012 16:07:02 -0700 Subject: [Maxima] Make check failures In-Reply-To: <4F1F1790.5040603@olynet.com> References: <4F1F1790.5040603@olynet.com> Message-ID: Paul, thanks for taking the time to build & test Maxima. If you are interested, please consider trying to figure out why the results differ, and, if you can, supply a patch. You can post patches to the mailing list, or better still, I can enable svn write permission for you so you can commit patches directly. Thanks for your interest in Maxima, Robert Dodier From pbowyer at olynet.com Tue Jan 24 17:26:07 2012 From: pbowyer at olynet.com (Paul Bowyer) Date: Tue, 24 Jan 2012 15:26:07 -0800 Subject: [Maxima] Make check failures In-Reply-To: References: <4F1F1790.5040603@olynet.com> Message-ID: <4F1F3E0F.2040002@olynet.com> On 01/24/2012 03:07 PM, Robert Dodier wrote: > Paul, > > thanks for taking the time to build& test Maxima. > If you are interested, please consider trying to figure out > why the results differ, and, if you can, supply a patch. > You can post patches to the mailing list, or better still, > I can enable svn write permission for you so you can > commit patches directly. > > Thanks for your interest in Maxima, > > Robert Dodier > I doubt my math skills and my grasp of lisp are sufficient to track down errors in maxima, but it would be interesting and possibly educational to try. So far my lisp programming is to the point where I can write simple programs around CLX, but I haven't tried anything as advanced as maxima. I think it would be well beyond my abilities. If I discover anything in my stumblings with maxima, I'll post them, but don't hold your breath waiting... Paul Bowyer From korte at lite.msu.edu Tue Jan 24 20:33:16 2012 From: korte at lite.msu.edu (Gerd Kortemeyer) Date: Tue, 24 Jan 2012 21:33:16 -0500 Subject: [Maxima] Declarations In-Reply-To: References: Message-ID: <1BD52C74-0EB2-4103-BDD7-3647FE493AAD@lite.msu.edu> Hi, I just wanted to thank the folks on this list for their help and input. It turned out that loading additional packages took too long, which ruled out the otherwise perfect package "solvereal" by Mikael S?rensen, and also solution (d) below - LON-CAPA gets hit very hard during homework crunch time. Since we need to do a kill(all) between transactions, we would have needed to reload packages every time. I ended up coding something along the lines of solution (a) below, only that the loop was implemented on the Perl-side. A sample problem is at http://source.lon-capa.org/cgi-bin/cvsweb.cgi/loncom/homework/templates/custom_equation.problem?rev=1.1;content-type=text%2Fplain for anybody who might be interested. Eventually, we might turn this into a real homework type, like http://www.lon-capa.org/cas.html Thanks again, and thanks for Maxima, - Gerd. On Jan 22, 2012, at 2:08 PM, Aleksas Domarkas wrote: > from http://www.math.utexas.edu/pipermail/maxima/2012/027525.html > Gerd Kortemeyer: > Hi, > > We have been using MAXIMA successfully inside of LON-CAPA for homework problems for several years now - it's a great tool, thanks everybody!!! > > While authoring a new kind of homework, I am struggling with "declare" - why does the following (sample) code not give the expected results? > > (%i4) declare(x,real); > (%o4) done > (%i5) solve(x^3=125,x); > 5 sqrt(3) %i - 5 5 sqrt(3) %i + 5 > (%o5) [x = ----------------, x = - ----------------, x = 5] > 2 2 > (%i6) facts(); > (%o6) [kind(x, real)] > > Is there another way to tell "solve" to stay in the real realm? > > Thanks! > > - Gerd. > > *********************************************************************************** > > How to get only real solutions of polynomial equation? > I know these methods: > a) > (%i1) sol:solve(x^3=125,x); > > (%o1) [x=(5*sqrt(3)*%i-5)/2,x=-(5*sqrt(3)*%i+5)/2,x=5] > > (%i2) sublist(sol,lambda([e],freeof(%i,e))); > (%o2) [x=5] > > b) > (%i3) realonly:true$ > realroots(x^3=125); > (%o4) [x=5] > > c) > (%i5) realonly:true$ > > algsys([x^3=125],[x]); > > (%o6) [[x=5]] > > d) > (%i7) realonly:true$ > to_poly_solve([x^3=125], [x]); > Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $ > (%o8) %union([x=5]) > (%i9) first(%); > > (%o9) [x=5] > > > Aleksas D > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Tue Jan 24 22:23:15 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 24 Jan 2012 21:23:15 -0700 Subject: [Maxima] Declarations In-Reply-To: <1BD52C74-0EB2-4103-BDD7-3647FE493AAD@lite.msu.edu> References: <1BD52C74-0EB2-4103-BDD7-3647FE493AAD@lite.msu.edu> Message-ID: On 1/24/12, Gerd Kortemeyer wrote: > It turned out that loading additional packages took too long, which ruled > out the otherwise perfect package "solvereal" by Mikael S?rensen, and also > solution (d) below - LON-CAPA gets hit very hard during homework crunch > time. Since we need to do a kill(all) between transactions, we would have > needed to reload packages every time. Gerd, I know you have a working system so maybe you're not interested in reworking stuff, but for the record: (1) to obviate the need to reload packages, you can load them once into a clean Maxima session and then dump an image (using a Lisp function -- it varies from one Lisp to another). Then all the stuff that's in that image is preserved. (2) another idea -- use share/contrib/maxima-server.lisp (works only w/ SBCL, sorry) to implement an ordinary *nixish server, in which clients connect via sockets and the server forks so each client has a clean session. Anything loaded before forking is available to all clients. Thanks for your interest in Maxima, Robert Dodier From dbmaxima at gmail.com Wed Jan 25 00:00:08 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Wed, 25 Jan 2012 17:00:08 +1100 Subject: [Maxima] Errors in Windows Maxima 5.26.0 run_testsuite In-Reply-To: <4F1E1D69.7090008@gmail.com> References: <1327371694.82933.YahooMailClassic@web121806.mail.ne1.yahoo.com> <4F1E1D69.7090008@gmail.com> Message-ID: <4F1F9A68.10707@gmail.com> On 24/01/2012 1:54 PM, David Billinghurst wrote: > On 24/01/2012 1:21 PM, James Redford wrote: >> I downloaded the following binary: >> >> http://iweb.dl.sourceforge.net/project/maxima/Maxima-Windows/5.26.0-Windows/maxima-5.26.0.exe >> >> >> 30,364,448 bytes >> MD5: 2b9342ec1130ab56189dd08c71f1be26 >> >> After running the command "run_testsuite(display_all=true, >> display_known_bugs=true);", the following is the result: >> >> Error summary: >> Errors found in >> C:/program1/maxima/share/maxima/5.26.0/tests/rtest16.mac, problems: >> (185 186) >> >> >> > Thanks for the report. That would be these tests below. They are a > known problem > with gcl under windows. Unfortunately the testsuite doesn't allow us > to make > known errors conditional on platform and lisp. > > Interestingly, I don't see them with my experimental windows build of > CVS maxima > using gcl/gcc-4.6.2. > (http://www.math.utexas.edu/pipermail/maxima/2012/027475.html) > Another reason to test this new build. > I have confirmed that these failures do not occur in a maxima-5.26.0 built with gcl/gcc-4.6.2 From aleksasd873 at gmail.com Tue Jan 24 01:39:29 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Tue, 24 Jan 2012 09:39:29 +0200 Subject: [Maxima] How to prevent the immediaetly evaluation after substitute a variable Message-ID: from http://www.math.utexas.edu/pipermail/maxima/2012/027547.html Ralf, Let me just add to Barton's suggestion that the issue here isn't (in Maxima terminology) "evaluation" (i.e. the substitution of variable values and functions) but "simplification". The expression (2+3) is *simplified* to 5, just as (2*x+3*x) is *simplified* to 5*x. -s On Mon, Jan 23, 2012 at 15:27, Barton Willis > wrote: >* Try using box:*>**>* (%i67) 2 * sqrt(box(h));*>* (%o67) 2*sqrt(h)*>**>* (%i68) subst(h=0.3,%);*>* (%o68) 2*sqrt(0.3)*>**>* (%i69) rembox(%);*>* (%o69) 1.095445115010332*>**>* To read the documentation for box, input ? box. There might be limitations*>* on*>* this method that I have not thought about.It might be possible to extend*>* rembox*>* to remove boxes bottom up one layer at a time.*>**>* --Barton*>**>* maxima-bounces at math.utexas.edu wrote on 01/23/2012 01:27:03 PM:*>**>* > From: Ralf Jung >*>* > To: Maxima at math.utexas.edu *>* > Date: 01/23/2012 01:26 PM*>* > Subject: [Maxima] How to prevent the immediaetly evaluation after*>* > substitute a variable*>* > Sent by: maxima-bounces at math.utexas.edu *>* >*>* > Dear maxima list members,*>* >*>* > here a example what's happend*>* >*>* > (%i1) x : 2*sqrt(h)*>* >*>* > (%o1) 2sqrt(h)*>* >*>* > (%i2) subst([h=0.3], x)*>* >*>* > (%o2) 1.095445115010332*>* >*>* > But I want this outcome*>* >*>* > (%o2) 2sqrt(0.3)*>* >*>* > is it possible to stop the immediaetly evaluation after subst, so I*>* > can see first my expression with all the variables changed?*>* >*>* > ralf*>* > ____________________* *************************************************************** (%i1) "2*sqrt(0.3)"; (%o1) "2*sqrt(0.3)" (%i2) eval_string(%); (%o2) 1.095445115010332 Other method: (%i3) simp:false$ (%i4) 2*sqrt(0.3); (%o4) 2*sqrt(0.3) (%i5) %,simp=true; (%o5) 1.095445115010332 (%i6) 3+2; (%o6) 3+2 (%i7) simp:true$ (%i8) 3+2; (%o8) 5 yet another method: (%i9) define(Sqrt(x),sqrt(x))$ (%i10) define(f(x),2*'Sqrt(x))$ (%i11) f(0.3); (%o11) 2*Sqrt(0.3) (%i12) ev(%,nouns); (%o12) 1.095445115010332 Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.frigerio at iit.it Tue Jan 24 04:00:06 2012 From: marco.frigerio at iit.it (Marco Frigerio) Date: Tue, 24 Jan 2012 11:00:06 +0100 Subject: [Maxima] common factor reduction Message-ID: <4F1E8126.8030707@iit.it> Hi all, consider this (%i..) trigreduce( -A*cos(q1)*sin(q2) + A*sin(q1)*cos(q2) ); (%o..) - sin(q2 - q1) A Why I cannot do the same thing if instead of a variable like 'A' I have a numerical constant? (%i..) trigreduce( -4*cos(q1)*sin(q2) + 4*sin(q1)*cos(q2) ); sin(q2 + q1) sin(q2 - q1) sin(q2 + q1) sin(q2 - q1) (%o..) 4 (------------ - ------------) - 4 (------------ + ------------) 2 2 2 2 I would really like to see - sin(q2 - q1) 4 How can I achieve this? Thanks a lot Regards, MF From alserkli at inbox.ru Wed Jan 25 04:46:47 2012 From: alserkli at inbox.ru (Alexander Klimov) Date: Wed, 25 Jan 2012 12:46:47 +0200 Subject: [Maxima] common factor reduction In-Reply-To: <4F1E8126.8030707@iit.it> References: <4F1E8126.8030707@iit.it> Message-ID: On Tue, 24 Jan 2012, Marco Frigerio wrote: > (%i..) trigreduce( -4*cos(q1)*sin(q2) + 4*sin(q1)*cos(q2) ); > > sin(q2 + q1) sin(q2 - q1) sin(q2 + q1) sin(q2 - q1) > (%o..) 4 (------------ - ------------) - 4 (------------ + ------------) > 2 2 2 2 > > I would really like to see > - sin(q2 - q1) 4 > > How can I achieve this? %,ratsimp; -- Regards, ASK From vi5u0-maxima at yahoo.co.uk Wed Jan 25 05:00:13 2012 From: vi5u0-maxima at yahoo.co.uk (Dan) Date: Wed, 25 Jan 2012 11:00:13 +0000 (GMT) Subject: [Maxima] Integrating a Gaussian wrt its width In-Reply-To: References: Message-ID: On Sun, 22 Jan 2012, Barton Willis wrote: > Your change of variable converts the lower limit of integration to > either -infinity for infinity (depending on the sign of B). The > function changevar doesn't handle such things correctly, I think. > You could try changing the lower limit to a new symbol---I wasn't > able to push this any further. > For integer N, one thing that might work: > (%i1) assume(C>0, B>0); > (%o1) [C>0,B>0] > (%i2) marginal : integrate((1/t-C)^(N-1)*exp(A-B/t^2),t,0,1/C); > (%o2) integrate(%e^(A-B/t^2)*(1/t-C)^(N-1),t,0,1/C) > (%i3) makelist(ev(marginal, N : k, integrate),k,1,3); > (%o3) [(gamma_incomplete(-1/2,B*C^2)*%e^A*sqrt(B))/2,-(gamma_incomplete(-1/2,B*C^2)*%e^A*sqrt(B)*C-gamma_incomplete(0,B*C^2)*%e^A)/2,-(-gamma_incomplete(-1/2,B*C^2)*%e^A*B*C^2+2*gamma_incomplete(0,B*C^2)*%e^A*sqrt(B)*C-gamma_incomplete(1/2,B*C^2)*%e^A)/(2*sqrt(B))] Thanks Barton. In the end, I did the binomial expansion by hand, and the substitution piecemeal, like this: declare(N,integer) ; assume(N > 0) ; assume(N > 1) ; assume(B > 0) ; marginalshouldbe : 'integrate((1/t-C)^(N-1)*exp(A-B/t^2),t,0,1/C) ; theintegrand : (1/t-C)^(N-1)*exp(A-B/t^2) ; theintegrandexpanded : (1/t)^(N-1)*sum(gamma(N)*(-C)^j/(gamma(j+1)*gamma(N-j)*t^(N-j-1)),j,0,N-1)*exp(A-B/t^2) ; theintegrandtermj : (1/t)^(N-1)*gamma(N)*(-C)^j/(gamma(j+1)*gamma(N-j)*t^(N-j-1))*exp(A-B/t^2) ; subst(t = B^(1/2)/u^(1/2), theintegrandtermj) ; %*diff(B^(1/2)/u^(1/2),u) ; integrate(%,u,inf,B*C^2) ; marginal : sum(%,j,0,N-1) ; -- Dan From macrakis at alum.mit.edu Wed Jan 25 06:27:12 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 25 Jan 2012 07:27:12 -0500 Subject: [Maxima] common factor reduction In-Reply-To: <4F1E8126.8030707@iit.it> References: <4F1E8126.8030707@iit.it> Message-ID: ratsimp(trigreduce(...)) On Tue, Jan 24, 2012 at 05:00, Marco Frigerio wrote: > Hi all, > > consider this > > (%i..) trigreduce( -A*cos(q1)*sin(q2) + A*sin(q1)*cos(q2) ); > (%o..) - sin(q2 - q1) A > > Why I cannot do the same thing if instead of a variable like 'A' I have a > numerical constant? > > (%i..) trigreduce( -4*cos(q1)*sin(q2) + 4*sin(q1)*cos(q2) ); > > sin(q2 + q1) sin(q2 - q1) sin(q2 + q1) sin(q2 - q1) > (%o..) 4 (------------ - ------------) - 4 (------------ + ------------) > 2 2 2 2 > > I would really like to see > - sin(q2 - q1) 4 > > How can I achieve this? > > Thanks a lot > Regards, > MF > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.frigerio at iit.it Wed Jan 25 09:36:05 2012 From: marco.frigerio at iit.it (Marco Frigerio) Date: Wed, 25 Jan 2012 16:36:05 +0100 Subject: [Maxima] common factor reduction In-Reply-To: References: <4F1E8126.8030707@iit.it> Message-ID: <4F202165.50601@iit.it> Thank you. But look at this: (%i92) foo; (%o92) 0.35 sin(q1) cos(q2) - 0.35 cos(q1) sin(q2) (%i93) ratsimp(trigreduce(foo)); rat: replaced 0.35 by 7/20 = 0.35 rat: replaced -0.35 by -7/20 = -0.35 7 sin(q2 - q1) (%o93) - -------------- 20 There is still an awful denominator there (yes I know I could use float to get rid of it. But sometimes I would also need an additional 'expand') The point is why I cannot simply have the common factor to be written once (sorry I'm not sure how to say this in english..) 0.35 ( sin(q1) cos(q2) - cos(q1) sin(q2)) which is really independent of the fact that I have trigonometric functions. 'factor' somehow does that, but it introduces denominators as well: (%i125) factor(foo); rat: replaced 0.35 by 7/20 = 0.35 rat: replaced -0.35 by -7/20 = -0.35 7 (cos(q1) sin(q2) - sin(q1) cos(q2)) (%o125) - ------------------------------------- 20 Can I maybe avoid that 'rat' replaces 0.35? thanks again M On 01/25/2012 11:46 AM, Alexander Klimov wrote: > On Tue, 24 Jan 2012, Marco Frigerio wrote: >> (%i..) trigreduce( -4*cos(q1)*sin(q2) + 4*sin(q1)*cos(q2) ); >> >> sin(q2 + q1) sin(q2 - q1) sin(q2 + q1) sin(q2 - q1) >> (%o..) 4 (------------ - ------------) - 4 (------------ + ------------) >> 2 2 2 2 >> >> I would really like to see >> - sin(q2 - q1) 4 >> >> How can I achieve this? > > %,ratsimp; > From fateman at eecs.berkeley.edu Wed Jan 25 11:34:31 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 25 Jan 2012 09:34:31 -0800 Subject: [Maxima] common factor reduction In-Reply-To: <4F202165.50601@iit.it> References: <4F1E8126.8030707@iit.it> <4F202165.50601@iit.it> Message-ID: <4F203D27.9070201@eecs.berkeley.edu> On 1/25/2012 7:36 AM, Marco Frigerio wrote: You could start by not using 0.35, but some symbol like A35. Or you could do this: keepfloat:true. From sangwinc at for.mat.bham.ac.uk Wed Jan 25 13:02:02 2012 From: sangwinc at for.mat.bham.ac.uk (Chris Sangwin) Date: Wed, 25 Jan 2012 19:02:02 +0000 (GMT) Subject: [Maxima] gcd and simp:false; In-Reply-To: References: <4D8E0A85.4090602@uni-bonn.de> <4D8E8DBD.2080708@uni-bonn.de> Message-ID: I'm confused why the gcd function does not respect simp:false. (%i1) simp:false$ (%i2) gcd(x,y); (%o2) 1 Any suggestions? Chris From fateman at eecs.berkeley.edu Wed Jan 25 12:55:05 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 25 Jan 2012 10:55:05 -0800 Subject: [Maxima] gcd and simp:false; In-Reply-To: References: <4D8E0A85.4090602@uni-bonn.de> <4D8E8DBD.2080708@uni-bonn.de> Message-ID: <4F205009.702@eecs.berkeley.edu> On 1/25/2012 11:02 AM, Chris Sangwin wrote: > > I'm confused why the gcd function does not respect simp:false. > > (%i1) simp:false$ > (%i2) gcd(x,y); > (%o2) 1 > > Any suggestions? > Chris > The gcd function is being evaluated, not simplified. If you turn off evaluation also, you have converted your maxima system into a brick. In particular you could never turn evaluation back on without evaluating something. I think we've discussed this before, but simp:false is almost always a bad idea. If you don't want simplification, maybe you should be using a different program. RJF From dlakelan at street-artists.org Wed Jan 25 13:48:43 2012 From: dlakelan at street-artists.org (dlakelan) Date: Wed, 25 Jan 2012 11:48:43 -0800 Subject: [Maxima] defrule for altering sum expressions? Message-ID: <4F205C9B.7090609@street-artists.org> I'd like to define the following rule and have it convert a sum into a "nearest neighbor sum" so that the sum is from i-1 to i+1 no matter what the original bounds are. Any ideas why it doesn't work? numorsym(a) := numberp(a) or symbolp(a); defmatch(A,true, [low,high],numorsym); defrule(nearestneighborsum,sum(A,j,low,high),sum(A,j,i-1,i+1)); but it doesn't work: (%i71) numorsym(x) := numberp(x) or symbolp(x); (%o71) numorsym(x) := numberp(x) or symbolp(x) (%i72) matchdeclare(A,true,[low,high],numorsym); (%o72) done (%i73) defrule(nearestneighborsum,sum(A,j,low,high),sum(A,j,i-1,i+1)); (%o73) nearestneighborsum : sum(A, j, low, high) -> sum(A, j, i - 1, i + 1) (%i74) nearestneighborsum(sum(foobar[j],j,1,N)); (%o74) false From willisb at unk.edu Wed Jan 25 14:40:09 2012 From: willisb at unk.edu (Barton Willis) Date: Wed, 25 Jan 2012 14:40:09 -0600 Subject: [Maxima] defrule for altering sum expressions? In-Reply-To: <4F205C9B.7090609@street-artists.org> References: <4F205C9B.7090609@street-artists.org> Message-ID: Maybe this is a sum noun / verb thing? My favorite way to do such transformations is to substitute a lambda form for the function (notice the nounify('sum)). (%i156) change_sum_limits(e,lo,hi) := subst(nounify('sum) = lambda([q,k,a,b], sum(q,k,lo,hi)),e)$ (%i157) change_sum_limits(42 + sum(f(k),k,a,b),i-1,i+1); (%o157) f(i+1)+f(i)+f(i-1)+42 --Barton maxima-bounces at math.utexas.edu wrote on 01/25/2012 01:48:43 PM: > From: dlakelan > To: Maxima Mailing List > Date: 01/25/2012 01:47 PM > Subject: [Maxima] defrule for altering sum expressions? > Sent by: maxima-bounces at math.utexas.edu > > I'd like to define the following rule and have it convert a sum into a > "nearest neighbor sum" so that the sum is from i-1 to i+1 no matter what > the original bounds are. Any ideas why it doesn't work? > > numorsym(a) := numberp(a) or symbolp(a); > > defmatch(A,true, [low,high],numorsym); > > defrule(nearestneighborsum,sum(A,j,low,high),sum(A,j,i-1,i+1)); > > but it doesn't work: > > (%i71) numorsym(x) := numberp(x) or symbolp(x); > (%o71) numorsym(x) := numberp(x) or symbolp(x) > (%i72) matchdeclare(A,true,[low,high],numorsym); > (%o72) done > (%i73) defrule(nearestneighborsum,sum(A,j,low,high),sum(A,j,i-1,i+1)); > (%o73) nearestneighborsum : sum(A, j, low, high) -> sum(A, j, i - 1, i + 1) > (%i74) nearestneighborsum(sum(foobar[j],j,1,N)); > (%o74) false > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlakelan at street-artists.org Wed Jan 25 16:02:11 2012 From: dlakelan at street-artists.org (dlakelan) Date: Wed, 25 Jan 2012 14:02:11 -0800 Subject: [Maxima] defrule for altering sum expressions? In-Reply-To: References: <4F205C9B.7090609@street-artists.org> Message-ID: <4F207BE3.9000608@street-artists.org> On 01/25/2012 12:40 PM, Barton Willis wrote: > Maybe this is a sum noun / verb thing? > > My favorite way to do such transformations is to substitute a lambda form > for the function (notice the nounify('sum)). > > (%i156) change_sum_limits(e,lo,hi) := subst(nounify('sum) = > lambda([q,k,a,b], sum(q,k,lo,hi)),e)$ > > (%i157) change_sum_limits(42 + sum(f(k),k,a,b),i-1,i+1); > (%o157) f(i+1)+f(i)+f(i-1)+42 > > --Barton yes, this is the solution I recently came upon myself. Actually I named the function I was using, but a lambda form would make sense too. From macrakis at alum.mit.edu Wed Jan 25 17:30:24 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 25 Jan 2012 18:30:24 -0500 Subject: [Maxima] gcd and simp:false; In-Reply-To: References: <4D8E0A85.4090602@uni-bonn.de> <4D8E8DBD.2080708@uni-bonn.de> Message-ID: Maxima has two kinds of functions which share the same syntax: routines (evaluated or programming functions) and simplifying (mathematical) functions. gcd(...) is a routine which returns a value, not a mathematical function. In particular, gcd(...) is the *polynomial GCD* of its arguments* .* Turning simp off does not affect routines, only simplifications. It sounds as though you'd like a simplifying rational gcd (as opposed to polynomial gcd), which is a reasonable idea, but one that (as far as I know) has not been implemented in Maxima. Presumably you'd want any simplifications to be true for all values of all variables. You might think, for example, that while gcd(x,y)=gcd(y,x) and gcd(x,x+2)=gcd(x+3,x+1) can't be simplified, you'd still have gcd(x,x^2) = x. But this is not true: gcd(1/2,1/4) = 1/4 -- at least by the definition Maxima uses. If you can come up with a consistent, useful definition of a simplifying gcd, it shouldn't be that difficult to program -- just don't call it "gcd"! -s On Wed, Jan 25, 2012 at 14:02, Chris Sangwin wrote: > > I'm confused why the gcd function does not respect simp:false. > > (%i1) simp:false$ > (%i2) gcd(x,y); > (%o2) 1 > > Any suggestions? > Chris > > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jrredford at yahoo.com Wed Jan 25 20:47:09 2012 From: jrredford at yahoo.com (James Redford) Date: Wed, 25 Jan 2012 18:47:09 -0800 (PST) Subject: [Maxima] Errors in Windows Maxima 5.26.0 run_testsuite Message-ID: <1327546029.87394.YahooMailClassic@web121806.mail.ne1.yahoo.com> Hi, Mr. Billinghurst. When you said "I have confirmed that these failures do not occur in a maxima-5.26.0 built with gcl/gcc-4.6.2", I assume you mean built from the standard Maxima 5.26.0 source code release, as opposed to a CVS snapshot. If that is correct, then I figure this is how the official Windows Maxima 5.26.0 binary ought to be built. Again, if that assumption is correct, then will you please post a download link to this Windows binary built from the official Maxima 5.26.0 source code release? I tested the below binary, which you stated is built from "maxima cvs 2012-01-16 using gcc-4.6.2" ( http://www.math.utexas.edu/pipermail/maxima/2012/027475.html ): http://billinghurst.customer.netspace.net.au/maxima-5.26.0-test.exe 33,114,409 bytes MD5: 598835f2e8210664f192dd58d3a1fc84 Below is the build information: Maxima version: 5.26.0 Maxima build date: 10:0 1/17/2012 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 Below is the result I obtained from running the command run_testsuite(); : No unexpected errors found out of 9,128 tests. real time : 338.510 secs run-gbc time : 309.220 secs child run time : 0.000 secs gbc time : 29.290 secs (%o0) done (%i1) ######################################## [Maxima] Errors in Windows Maxima 5.26.0 run_testsuite David Billinghurst dbmaxima at gmail.com Wed Jan 25 00:00:08 CST 2012 On 24/01/2012 1:54 PM, David Billinghurst wrote: > On 24/01/2012 1:21 PM, James Redford wrote: >> I downloaded the following binary: >> >> http://iweb.dl.sourceforge.net/project/maxima/Maxima-Windows/5.26.0-Windows/maxima-5.26.0.exe >> >> >> 30,364,448 bytes >> MD5: 2b9342ec1130ab56189dd08c71f1be26 >> >> After running the command "run_testsuite(display_all=true, >> display_known_bugs=true);", the following is the result: >> >> Error summary: >> Errors found in >> C:/program1/maxima/share/maxima/5.26.0/tests/rtest16.mac, problems: >> (185 186) >> >> >> > Thanks for the report. That would be these tests below. They are a > known problem > with gcl under windows. Unfortunately the testsuite doesn't allow us > to make > known errors conditional on platform and lisp. > > Interestingly, I don't see them with my experimental windows build of > CVS maxima > using gcl/gcc-4.6.2. > (http://www.math.utexas.edu/pipermail/maxima/2012/027475.html) > Another reason to test this new build. > I have confirmed that these failures do not occur in a maxima-5.26.0 built with gcl/gcc-4.6.2 From c.j.sangwin at bham.ac.uk Wed Jan 25 13:05:59 2012 From: c.j.sangwin at bham.ac.uk (Christopher Sangwin) Date: Wed, 25 Jan 2012 19:05:59 +0000 Subject: [Maxima] gcd and simp:false; In-Reply-To: <4F205009.702@eecs.berkeley.edu> References: <4D8E0A85.4090602@uni-bonn.de> <4D8E8DBD.2080708@uni-bonn.de> , <4F205009.702@eecs.berkeley.edu> Message-ID: <4CBBDBC075F4FA42A00426E1246A1D8330F8F8E91D@EPSEXC1.adf.bham.ac.uk> Richard, Yes, we have talked about this, and despite my best efforts I still struggle to understand when something is "evaluated" and when something else is "simplified" in Maxima. (%i1) simp:false$ (%i2) gcd(x,y); (%o2) 1 (%i3) 1+1; (%o3) 1+1 Of course everything has to be evaluated! It just isn't clear to me when the simplifier is used and when it isn't. I know the view "if you want simp:false then use something else" has been expressed before. I can't argue with this. But, we could replace this with "for all , if you want then use something else" which would also be true, but I'm not usually that nihilistic! :-) C ________________________________________ From: Richard Fateman [fateman at eecs.berkeley.edu] Sent: 25 January 2012 18:55 To: Chris Sangwin Cc: maxima at math.utexas.edu Subject: Re: [Maxima] gcd and simp:false; On 1/25/2012 11:02 AM, Chris Sangwin wrote: > > I'm confused why the gcd function does not respect simp:false. > > (%i1) simp:false$ > (%i2) gcd(x,y); > (%o2) 1 > > Any suggestions? > Chris > The gcd function is being evaluated, not simplified. If you turn off evaluation also, you have converted your maxima system into a brick. In particular you could never turn evaluation back on without evaluating something. I think we've discussed this before, but simp:false is almost always a bad idea. If you don't want simplification, maybe you should be using a different program. RJF From wilhelm.haager at htlstp.ac.at Thu Jan 26 02:38:10 2012 From: wilhelm.haager at htlstp.ac.at (Wilhelm Haager) Date: Thu, 26 Jan 2012 09:38:10 +0100 Subject: [Maxima] Function returning the version number Message-ID: Hi, is the a possibility to get the version of Maxima within a Maxima session, i.e. a function which returns the version number (NOT within the command line like "maxima --version")? I have not found any possibility yet. That would be very useful for conditionals like "if version < 5.25 then ... else...;" Thanks in advance Wilhelm Haager From filonenko.mikhail at gmail.com Thu Jan 26 02:45:14 2012 From: filonenko.mikhail at gmail.com (Michael Filonenko) Date: Thu, 26 Jan 2012 10:45:14 +0200 Subject: [Maxima] Function returning the version number In-Reply-To: References: Message-ID: You can get value of common lisp variable *maxima-version* in maxima environment: ?\*maxima\-version\* 2012/1/26 Wilhelm Haager : > Hi, > > is the a possibility to get the version of Maxima within a Maxima session, > i.e. a function which returns the version number (NOT within the command > line > like "maxima --version")? > > I have not found any possibility yet. > > That would be very useful for conditionals like > "if version < 5.25 then ... else...;" > > Thanks in advance > Wilhelm Haager > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- With best regards, Michael Filonenko From dbmaxima at gmail.com Thu Jan 26 03:28:48 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Thu, 26 Jan 2012 20:28:48 +1100 Subject: [Maxima] Errors in Windows Maxima 5.26.0 run_testsuite In-Reply-To: <1327546029.87394.YahooMailClassic@web121806.mail.ne1.yahoo.com> References: <1327546029.87394.YahooMailClassic@web121806.mail.ne1.yahoo.com> Message-ID: <4F211CD0.7080007@gmail.com> On 26/01/2012 1:47 PM, James Redford wrote: > Hi, Mr. Billinghurst. When you said "I have confirmed that these failures do not occur in a maxima-5.26.0 built with gcl/gcc-4.6.2", I assume you mean built from the standard Maxima 5.26.0 source code release, as opposed to a CVS snapshot. If that is correct, then I figure this is how the official Windows Maxima 5.26.0 binary ought to be built. Again, if that assumption is correct, then will you please post a download link to this Windows binary built from the official Maxima 5.26.0 source code release? > > I tested the below binary, which you stated is built from "maxima cvs 2012-01-16 using gcc-4.6.2" ( http://www.math.utexas.edu/pipermail/maxima/2012/027475.html ): > > http://billinghurst.customer.netspace.net.au/maxima-5.26.0-test.exe James, Thanks for the feedback. You are correct. I built the maxima from the 5.26.0 release tarball and ran the testsuite without error. It is a bit more work to generate a release but I will give it a go over the weekend. I'd like to see some more testing before we make the change, as I can't build gcl or maxima under windows 7 - only winXP. It seems to work OK, but I haven't tested much. David From rswarbrick at gmail.com Thu Jan 26 03:54:51 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Thu, 26 Jan 2012 09:54:51 +0000 Subject: [Maxima] gcd and simp:false; References: <4D8E0A85.4090602@uni-bonn.de> <4D8E8DBD.2080708@uni-bonn.de> <4F205009.702@eecs.berkeley.edu> <4CBBDBC075F4FA42A00426E1246A1D8330F8F8E91D@EPSEXC1.adf.bham.ac.uk> Message-ID: Christopher Sangwin writes: > Richard, > > Yes, we have talked about this, and despite my best efforts I still > struggle to understand when something is "evaluated" and when > something else is "simplified" in Maxima. > > (%i1) simp:false$ > (%i2) gcd(x,y); > (%o2) 1 > > (%i3) 1+1; > (%o3) 1+1 > > Of course everything has to be evaluated! It just isn't clear to me > when the simplifier is used and when it isn't. I know the view "if One way to think of it is as a (very important!) implementation detail. In Maxima, something like "gcd(x,y)" is represented as applying the operator GCD to two arguments, X and Y. Similarly, "x+y" is applying the operator + to the two arguments X and Y. Now, there are three things that can happen (1) Maybe there's a function called gcd. In which case, it will be run with the given arguments and its result will replace what you started with. This is what's happening here. (2) If no change, maybe there's a rule for how to simplify gcd(x,y) An example is something like sin(x^2)+cos(x^2). The toplevel operator of the expression is "+", and spotting that this is 1 isn't really to do with "+" per se. Rules that spot this sort of thing are called simplification rules. Classes of these rules can be turned on and off using variables like trigsign, algebraic and many many others. More dramatically, you can turn them all off with simp: false. (3) Finally, if Maxima has no idea what to do with an expression, it just returns it, in the hope that some day in the future you can tell it something else helpful. I hope this makes the simplification/function distinction make a bit more sense. I've ignored some details like simplification of arguments and simplifying the result of simplifications and and and, but what I've wrote is sort of true. Rupert PS. Before anyone points it out, yes I do know about the lisp/Maxima $naming scheme. But that's irrelevant to the question above. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From rswarbrick at gmail.com Thu Jan 26 05:25:55 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Thu, 26 Jan 2012 11:25:55 +0000 Subject: [Maxima] defrule bug 1204711 Message-ID: <87fwf2ln7g.fsf@hake.rswarbrick.dnsalias.com> Hi, I noticed this bug[1] the other day and spent a while thinking about it. The way that simplification rules for operators currently works is a property on the symbol called (confusingly) 'operators. To declare a simplification rule, you define a function and set (get 'myoperator 'operators) to that function. To chain rules in tellsimp and tellsimpafter, there is a complicated system, where the new rules call previously defined rules in the start/end of their function bodies. This is rather brittle and, since the interiors of the functions can't be changed after the fact, causes bugs like this one. I wrote a different implementation, where 'operators is kept (for backwards compatibility), but just holds one rule, with no chaining. tellsimp and tellsimpafter push functions onto a list stored at a different property, which get called in order. Current status: It works, but I haven't implemented some of the tidying up that removerule did, so there's a bit of work to do yet. I was worried about the performance: surely such a brittle system as the old one had to be done for performance reasons! So I ran the testsuite for timing, and it actually came in faster (30 seconds faster on about 10 minutes total), but this might have been down to noise. There are no new failed tests. My question is the following: Should I spend a few more hours making a tidied up patchset and testing it as thoroughly as possible? Would such a change be merged? I don't particularly fancy spending hours on something that will be rejected out of hand just because it touches src/simp.lisp... Rupert Footnotes: [1] http://sourceforge.net/tracker/?func=detail&aid=1204711&group_id=4933&atid=104933 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From laoluomoks at gmail.com Thu Jan 26 07:45:38 2012 From: laoluomoks at gmail.com (Olaoluwa Omokanwaiye) Date: Thu, 26 Jan 2012 14:45:38 +0100 Subject: [Maxima] Maxima on Mac OS X Message-ID: Hi there, Hope this mail meets all well. I have wxMaxima (Maxima 5.25.1) installed on my Mac OS X (version 10.6.8) I have not found a manual to help guide through, is there anyone with a complete and easy guide to use and maximize this powerful tool? Is there anyone that uses something similar on a Mac system. Kind regards Ola From alexanderk.hansen at gmail.com Thu Jan 26 07:55:58 2012 From: alexanderk.hansen at gmail.com (Alexander Hansen) Date: Thu, 26 Jan 2012 08:55:58 -0500 Subject: [Maxima] Maxima on Mac OS X In-Reply-To: References: Message-ID: <4F215B6E.3@gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 1/26/12 8:45 AM, Olaoluwa Omokanwaiye wrote: > Hi there, > > Hope this mail meets all well. I have wxMaxima (Maxima 5.25.1) > installed on my Mac OS X (version 10.6.8) I have not found a > manual to help guide through, is there anyone with a complete and > easy guide to use and maximize this powerful tool? Is there anyone > that uses something similar on a Mac system. > > Kind regards Ola I would be surprised if your Maxima installation didn't include its extensive manual. If you select Help -> Maxima Help from the wxMaxima applications menu, does that manual not show up? - -- Alexander Hansen, Ph.D. Fink User Liaison http://finkakh.wordpress.com/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8hW24ACgkQB8UpO3rKjQ+QOQCfTrUvosae/h3nkUAFB61/ZskJ 8EkAoJkOF2E5EZiwlm/nVx8RBHWBAXqT =fSfr -----END PGP SIGNATURE----- From laoluomoks at gmail.com Thu Jan 26 08:17:22 2012 From: laoluomoks at gmail.com (Olaoluwa Omokanwaiye) Date: Thu, 26 Jan 2012 15:17:22 +0100 Subject: [Maxima] Maxima on Mac OS X In-Reply-To: <4F215B6E.3@gmail.com> References: <4F215B6E.3@gmail.com> Message-ID: Thanks kind sir, I see a blue question mark icon meaning "show maxima help" kind regards Ola On 1/26/12, Alexander Hansen wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 1/26/12 8:45 AM, Olaoluwa Omokanwaiye wrote: >> Hi there, >> >> Hope this mail meets all well. I have wxMaxima (Maxima 5.25.1) >> installed on my Mac OS X (version 10.6.8) I have not found a >> manual to help guide through, is there anyone with a complete and >> easy guide to use and maximize this powerful tool? Is there anyone >> that uses something similar on a Mac system. >> >> Kind regards Ola > > I would be surprised if your Maxima installation didn't include its > extensive manual. > > If you select Help -> Maxima Help from the wxMaxima applications menu, > does that manual not show up? > > - -- > Alexander Hansen, Ph.D. > Fink User Liaison > http://finkakh.wordpress.com/ > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.11 (Darwin) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk8hW24ACgkQB8UpO3rKjQ+QOQCfTrUvosae/h3nkUAFB61/ZskJ > 8EkAoJkOF2E5EZiwlm/nVx8RBHWBAXqT > =fSfr > -----END PGP SIGNATURE----- > -- laolu omokanwaiye From dbmaxima at gmail.com Thu Jan 26 08:40:55 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Fri, 27 Jan 2012 01:40:55 +1100 Subject: [Maxima] Errors in Windows Maxima 5.26.0 run_testsuite In-Reply-To: <4F211CD0.7080007@gmail.com> References: <1327546029.87394.YahooMailClassic@web121806.mail.ne1.yahoo.com> <4F211CD0.7080007@gmail.com> Message-ID: <4F2165F7.6080508@gmail.com> On 26/01/2012 8:28 PM, David Billinghurst wrote: > On 26/01/2012 1:47 PM, James Redford wrote: >> Hi, Mr. Billinghurst. When you said "I have confirmed that these >> failures do not occur in a maxima-5.26.0 built with gcl/gcc-4.6.2", I >> assume you mean built from the standard Maxima 5.26.0 source code >> release, as opposed to a CVS snapshot. If that is correct, then I >> figure this is how the official Windows Maxima 5.26.0 binary ought to >> be built. Again, if that assumption is correct, then will you please >> post a download link to this Windows binary built from the official >> Maxima 5.26.0 source code release? >> >> I tested the below binary, which you stated is built from "maxima cvs >> 2012-01-16 using gcc-4.6.2" ( >> http://www.math.utexas.edu/pipermail/maxima/2012/027475.html ): >> >> http://billinghurst.customer.netspace.net.au/maxima-5.26.0-test.exe > James, > > Thanks for the feedback. You are correct. I built the maxima from the > 5.26.0 release tarball and ran the testsuite without error. It is a > bit more work to generate a release but I will give it a go over the > weekend. > > I'd like to see some more testing before we make the change, as I > can't build gcl or maxima under windows 7 - only winXP. It seems to > work OK, but I haven't tested much. > > David See if you can break http://billinghurst.customer.netspace.net.au/maxima-5.26.0_gcl_gcc-4.6.2.exe From alexanderk.hansen at gmail.com Thu Jan 26 08:55:17 2012 From: alexanderk.hansen at gmail.com (Alexander Hansen) Date: Thu, 26 Jan 2012 09:55:17 -0500 Subject: [Maxima] Maxima on Mac OS X In-Reply-To: References: <4F215B6E.3@gmail.com> Message-ID: <4F216955.3090705@gmail.com> On 1/26/12 9:17 AM, Olaoluwa Omokanwaiye wrote: > Thanks kind sir, I see a blue question mark icon meaning "show maxima help" > > kind regards > Ola > > I have that on my own wxMaxima. When I push it, I get a window that displays the manual. From robert.dodier at gmail.com Thu Jan 26 15:22:14 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 26 Jan 2012 14:22:14 -0700 Subject: [Maxima] 5.26 installer for Windows now apparently visible in file manager Message-ID: Hi, I uploaded maxima-5.26.0.exe to the SF file manager again and now it seems to be visible. Can someone confirm? See if you can find it this way: go to http://sourceforge.net/projects/maxima and then follow Files >> Maxima-Windows >> 5.26.0-Windows best Robert Dodier From macrakis at alum.mit.edu Thu Jan 26 15:29:12 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 26 Jan 2012 16:29:12 -0500 Subject: [Maxima] cf documentation Message-ID: The 'cf' (continued fraction) documentation should mention that cf expansions are exact for rational numbers, but are cut off at ratepsilon (for floats) and 10^-fpprec (for bigfloats). -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From erich.neuwirth at univie.ac.at Thu Jan 26 15:45:10 2012 From: erich.neuwirth at univie.ac.at (Erich Neuwirth) Date: Thu, 26 Jan 2012 22:45:10 +0100 Subject: [Maxima] 5.26 installer for Windows now apparently visible in file manager In-Reply-To: References: Message-ID: <4F21C966.4020700@univie.ac.at> It is visible here, http://sourceforge.net/projects/maxima/files/Maxima-Windows/5.26.0-Windows/ But the download button on http://sourceforge.net/projects/maxima/ still says maxix-5.25.1-gcl.exe On 1/26/2012 10:22 PM, Robert Dodier wrote: > Hi, > > I uploaded maxima-5.26.0.exe to the SF file manager again > and now it seems to be visible. Can someone confirm? > See if you can find it this way: go to http://sourceforge.net/projects/maxima > and then follow Files >> Maxima-Windows >> 5.26.0-Windows > > best > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From ferriste at gmail.com Thu Jan 26 15:59:12 2012 From: ferriste at gmail.com (Stefano Ferri) Date: Thu, 26 Jan 2012 22:59:12 +0100 Subject: [Maxima] 5.26 installer for Windows now apparently visible in file manager In-Reply-To: <4F21C966.4020700@univie.ac.at> References: <4F21C966.4020700@univie.ac.at> Message-ID: It is working now. Anyway, I'm pretty sure this was a syncronization problem of sourceforge servers, it takes some hours to complete. I already noticed that some months ago when the executable built with ccl was substituted by the gcl build. Stefano 2012/1/26 Erich Neuwirth > It is visible here, > > http://sourceforge.net/projects/fofor mer > memaxima/files/Maxima-Windows/5.26.0-Windows/ > > But the download button on > http://sourceforge.net/projects/maxima/ > still says maxix-5.25.1-gcl.exe > > On 1/26/2012 10:22 PM, Robert Dodier wrote: > > Hi, > > > > I uploaded maxima-5.26.0.exe to the SF file manager again > > and now it seems to be visible. Can someone confirm? > > See if you can find it this way: go to > http://sourceforge.net/projects/maxima > > and then follow Files >> Maxima-Windows >> 5.26.0-Windows > > > > best > > > > Robert Dodier > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Fri Jan 27 00:07:22 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 26 Jan 2012 23:07:22 -0700 Subject: [Maxima] announcement: Maxima 5.26 Message-ID: Please distribute this message as you see fit. Announcing Maxima 5.26 Maxima is a GPL'd branch of Macsyma, the venerable symbolic computation system. Maxima 5.26 is a bug fix and feature enhancement release. The current version is 5.26.0. Maxima has functions to work with polynomials, matrices, finite sets, integrals, derivatives and differential equations, linear algebra, plotting, floating point and arbitrary-precision arithmetic, etc. Maxima can run on MS Windows and various flavors of Unix, including MacOS X. There is a precompiled executable installer for Windows, RPM's for Linux, and source code tar.gz. Maxima is implemented in Common Lisp; several Lisps can compile and run Maxima, including CMUCL, SBCL, Clisp, GCL, and ECL. The Maxima project welcomes new participants. You can contribute in several ways: reporting bugs, fixing bugs, writing new add-on packages, revising core functions, user interfaces, documentation, etc. Why not see what's happening on the mailing list and consider how you might contribute to the project. Thanks to everyone who contributed to the 5.26 release. Regards, Robert Dodier Maxima developer and 5.26 release manager Project page: http://sourceforge.net/projects/maxima Documentation: http://maxima.sourceforge.net/documentation.html Bug reports. You must create a Sourceforge login before filing a bug report (anonymous reports no longer allowed). http://sourceforge.net/tracker/?group_id=4933&atid=104933 Mailing list. Please sign up before posting a message. http://maxima.sourceforge.net/maximalist.html Download page: http://sourceforge.net/projects/maxima/files Ports page: http://apps.sourceforge.net/mediawiki/maxima/index.php?title=Maxima_ports Project home page: http://maxima.sourceforge.net Change log: New items in core: * quadpack function quad_qagp (QAGP algorithm) * quadpack function quad_control (control error messages) New items in share: * package draw: option draw_realpart, object wired_surface * package lapack: function zgeev Other changes: * reference manual: reorganization, editing, translations * package ezunits: bug fixes, minor extensions, more tests Bug fixes: 3439895 makeset can't deal with sets of sets 3437268 expand doesn't fully expand 3426847 float hypergeometric error | fix 3410704 limit gives the wrong answer 3404854 default for logexapand 3398066 radcan generates floats? 3398047 trigrat() causes an error 3396631 equal terms produce different results 3390551 Error break in rtest2 with display_all=true 3389830 Error break in rtest15 with linear display 3388801 integrate error 3377347 log(1/(1+%i)) gives error 3376603 sign of declared imaginary 3358420 nfloat bug 3354672 Maxima hangs when assigning modulus:-3 3276461 Inaccurate Limit Evaluation 3213380 "-"(a,b) with simp:false prints incorrectly 3207833 Option variable lognumer has no effect 3185855 radcan warns about float-convert 3151302 Wrong plotting of functions based on spherical harmonics 2995695 Documentation for resultant is confusing unnumbered: bessel_y integrals (mailing list circa 2011-10-22) unnumbered: f90 output format (mailing list circa 2011-09-22) unnumbered: Problem with save (mailing list 2011-09-10) unnumbered: error function lsquares (mailing list 2011-08-25) From robert.dodier at gmail.com Fri Jan 27 00:29:03 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 26 Jan 2012 23:29:03 -0700 Subject: [Maxima] defrule bug 1204711 In-Reply-To: <87fwf2ln7g.fsf@hake.rswarbrick.dnsalias.com> References: <87fwf2ln7g.fsf@hake.rswarbrick.dnsalias.com> Message-ID: On 1/26/12, Rupert Swarbrick wrote: > http://sourceforge.net/tracker/?func=detail&aid=1204711&group_id=4933&atid=104933 Well, I suspect it would require fewer changes to preserve the existing chaining scheme, but if so, then we'll have to work out a way to fix up the chain when one rule is removed. I can't think of a way right now. Maybe you ought to go ahead and work on this other approach. best, Robert Dodier From tomdean at speakeasy.org Fri Jan 27 00:34:14 2012 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Thu, 26 Jan 2012 22:34:14 -0800 Subject: [Maxima] maxima 5.26.0 Build Failure on FreeBSD Message-ID: <4F224566.5020908@speakeasy.org> uname -a FreeBSD P9X79.tddhome 9.0-STABLE FreeBSD 9.0-STABLE #0: Wed Jan 4 14:16:41 PST 2012 tomdean at P9X79.tddhome:/usr/src/sys/GENERIC amd64 # ./configure --with-clisp ... # make ... Making all in info pattern=`printf "\r$"` ; bad_files=`find . -name '*.texi' -print | xargs /usr/bin/grep -E -l -e "$pattern"` ; [ -z "$bad_files" ] || ( echo "WARNING: The following files have DOS-style EOLs: $bad_files" ; echo "Run /doc/info/fix_crlf to fix the problem." ) *** Error code 1 Stop in /usr/home/tomdean/Math/Maxima/maxima-5.26.0/doc/info. *** Error code 1 Stop in /usr/home/tomdean/Math/Maxima/maxima-5.26.0/doc/info. *** Error code 1 Stop in /usr/home/tomdean/Math/Maxima/maxima-5.26.0/doc. *** Error code 1 Stop in /usr/home/tomdean/Math/Maxima/maxima-5.26.0. Tom Dean From fateman at eecs.berkeley.edu Fri Jan 27 00:36:01 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 26 Jan 2012 22:36:01 -0800 Subject: [Maxima] defrule bug 1204711 In-Reply-To: References: <87fwf2ln7g.fsf@hake.rswarbrick.dnsalias.com> Message-ID: <4F2245D1.9090405@eecs.berkeley.edu> On 1/26/2012 10:29 PM, Robert Dodier wrote: > On 1/26/12, Rupert Swarbrick wrote: > >> http://sourceforge.net/tracker/?func=detail&aid=1204711&group_id=4933&atid=104933 > Well, I suspect it would require fewer changes to preserve > the existing chaining scheme, but if so, then we'll have to > work out a way to fix up the chain when one rule is removed. > I can't think of a way right now. Maybe you ought to go ahead > and work on this other approach. > > best, > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima If you want to retract a particular simp rule among a whole bunch, I suggest you keep a list of your rules and assert via tellsimp, etc. when you want them to operate. When you want to remove one, kill them all. Then edit the list of rules, and re-assert them. That way you don't have to change any of the system code. It is unlikely that you are going to be faster than the current method, though you might be insignificantly slower. At least if your computation is in fact the same one. Which it might not be. RJF From piminusmeson at bk.ru Fri Jan 27 00:42:54 2012 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Fri, 27 Jan 2012 10:42:54 +0400 Subject: [Maxima] integrate(sin(x)^2/x,x,minf,inf); In-Reply-To: References: <87fwf2ln7g.fsf@hake.rswarbrick.dnsalias.com> Message-ID: <4F22476E.4030602@bk.ru> (%i1) integrate(sin(x)^2/x,x,minf,inf); Principal Value log(- 1) (%o1) - -------- 2 (%i2) integrate(sin(x)^2/x,x,10000000000,10000000000); (%o2) 0 (%i3) Function sin(x)^2/x is odd function, so it seems that integrate(sin(x)^2/x,x,minf,inf) must return 0. Am i wrong? From robert.dodier at gmail.com Fri Jan 27 00:59:28 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 26 Jan 2012 23:59:28 -0700 Subject: [Maxima] maxima 5.26.0 Build Failure on FreeBSD In-Reply-To: <4F224566.5020908@speakeasy.org> References: <4F224566.5020908@speakeasy.org> Message-ID: On 1/26/12, Thomas D. Dean wrote: > pattern=`printf "\r$"` ; bad_files=`find . -name '*.texi' -print | > xargs /usr/bin/grep -E -l -e "$pattern"` ; [ -z "$bad_files" ] || ( > echo "WARNING: The following files have DOS-style EOLs: $bad_files" ; > echo "Run /doc/info/fix_crlf to fix the problem." ) > *** Error code 1 I guess this means the shell interpreter didn't like that command. Is grep not in /usr/bin? does it not take -E -l -e as arguments? or the conditional expression is not recognized? Just guessing. best Robert Dodier From tomdean at speakeasy.org Fri Jan 27 01:22:36 2012 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Thu, 26 Jan 2012 23:22:36 -0800 Subject: [Maxima] maxima 5.26.0 Build Failure on FreeBSD In-Reply-To: References: <4F224566.5020908@speakeasy.org> Message-ID: <4F2250BC.1000504@speakeasy.org> On 01/26/12 22:59, Robert Dodier wrote: > On 1/26/12, Thomas D. Dean wrote: > >> pattern=`printf "\r$"` ; bad_files=`find . -name '*.texi' -print | >> xargs /usr/bin/grep -E -l -e "$pattern"` ; [ -z "$bad_files" ] || ( >> echo "WARNING: The following files have DOS-style EOLs: $bad_files" ; >> echo "Run /doc/info/fix_crlf to fix the problem." ) >> *** Error code 1 > > I guess this means the shell interpreter didn't like that command. > Is grep not in /usr/bin? does it not take -E -l -e as arguments? > or the conditional expression is not recognized? Just guessing. > I used sh # cd doc/info # pattern=`printf "\r$"` # bad_files=`find . -name '*.texi' -print | xargs /usr/bin/grep -E -l -e "$pattern"` # echo $bad_files bad_files is empty # which grep /usr/bin/grep # grep --version grep (GNU grep) 2.5.1-FreeBSD Which allows -E -l -e I started fresh. No problem. Maybe something strange in unpacking/configure/code-rot? make check passed, with the exception of known errors. Thanks, Tom Dean From tomdean at speakeasy.org Fri Jan 27 01:51:59 2012 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Thu, 26 Jan 2012 23:51:59 -0800 Subject: [Maxima] integrate(sin(x)^2/x,x,minf,inf); In-Reply-To: <4F22476E.4030602@bk.ru> References: <87fwf2ln7g.fsf@hake.rswarbrick.dnsalias.com> <4F22476E.4030602@bk.ru> Message-ID: <4F22579F.9010103@speakeasy.org> On 01/26/12 22:42, Dmitry Shkirmanov wrote: > (%i1) integrate(sin(x)^2/x,x,minf,inf); > Principal Value > log(- 1) > (%o1) - -------- > 2 > (%i2) integrate(sin(x)^2/x,x,10000000000,10000000000); > (%o2) 0 > (%i3) > Maple 15 can be torqued to returning 0.*I. > integrate(sin(x)^2/x,x=-inf..inf); -1/2 ln(-inf) + 1/2 Ci(-2 inf) + 1/2 ln(inf) - 1/2 Ci(2 inf) > evalc(%); (-1/2 (1/2 + 1/2 signum(inf)) Pi + 1/4 Pi (1 + signum(inf)) + 1/2 (1/2 - 1/2 signum(inf)) Pi - 1/4 Pi (1 - signum(inf))) I > evalf(%); 0. I From talon at lpthe.jussieu.fr Fri Jan 27 03:47:32 2012 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 27 Jan 2012 09:47:32 +0000 (UTC) Subject: [Maxima] maxima 5.26.0 Build Failure on FreeBSD References: <4F224566.5020908@speakeasy.org> Message-ID: Thomas D. Dean wrote: > uname -a > FreeBSD P9X79.tddhome 9.0-STABLE FreeBSD 9.0-STABLE #0: Wed Jan 4 > 14:16:41 PST 2012 tomdean at P9X79.tddhome:/usr/src/sys/GENERIC amd64 > > # ./configure --with-clisp > ... > > # make > ... > Making all in info > pattern=`printf "\r$"` ; bad_files=`find . -name '*.texi' -print | > xargs /usr/bin/grep -E -l -e "$pattern"` ; [ -z "$bad_files" ] || ( > echo "WARNING: The following files have DOS-style EOLs: $bad_files" ; > echo "Run /doc/info/fix_crlf to fix the problem." ) > *** Error code 1 > > Stop in /usr/home/tomdean/Math/Maxima/maxima-5.26.0/doc/info. > *** Error code 1 > > Stop in /usr/home/tomdean/Math/Maxima/maxima-5.26.0/doc/info. > *** Error code 1 > > Stop in /usr/home/tomdean/Math/Maxima/maxima-5.26.0/doc. > *** Error code 1 > > Stop in /usr/home/tomdean/Math/Maxima/maxima-5.26.0. > > Tom Dean This is a well-known error which has been present since ages and is basically harmless. You can do make -i install and you will get a working system. Perhaps some slight problems in the documentation. The main cause of the problem is that the scripts which build the documentation have been tuned for gnu sed, and don't work with freebsd sed. I have mailed about that the FreeBSD maintainer (who provided a working patch for the sed rules) and Robert Dodier. I don't remember having seen an answer from RD, i thought the problem was solved. If necessary i can try to recover the patch and post it here. -- Michel Talon From macrakis at alum.mit.edu Fri Jan 27 08:50:21 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 27 Jan 2012 09:50:21 -0500 Subject: [Maxima] integrate(sin(x)^2/x,x,minf,inf); In-Reply-To: <4F22476E.4030602@bk.ru> References: <87fwf2ln7g.fsf@hake.rswarbrick.dnsalias.com> <4F22476E.4030602@bk.ru> Message-ID: What version of Maxima are you running? In Maxima 5.25.1 GCL 2.6.8, I get: (%i1) integrate(sin(x)^2/x,x,minf,inf); Principal Value (%o1) 0 On Fri, Jan 27, 2012 at 01:42, Dmitry Shkirmanov wrote: > (%i1) integrate(sin(x)^2/x,x,minf,**inf); > Principal Value > log(- 1) > (%o1) - -------- > 2 > (%i2) integrate(sin(x)^2/x,x,**10000000000,10000000000); > (%o2) 0 > (%i3) > > Function sin(x)^2/x is odd function, so it seems that > integrate(sin(x)^2/x,x,minf,**inf) must return 0. Am i wrong? > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From piminusmeson at bk.ru Fri Jan 27 09:15:06 2012 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Fri, 27 Jan 2012 19:15:06 +0400 Subject: [Maxima] integrate(sin(x)^2/x,x,minf,inf); In-Reply-To: References: <87fwf2ln7g.fsf@hake.rswarbrick.dnsalias.com> <4F22476E.4030602@bk.ru> Message-ID: <4F22BF7A.2030905@bk.ru> > What version of Maxima are you running? ya at debian:~$ maxima --version Maxima 5.26.0 > > (%i1) integrate(sin(x)^2/x,x,minf,inf); > Principal Value > (%o1) 0 > > > On Fri, Jan 27, 2012 at 01:42, Dmitry Shkirmanov > wrote: > > (%i1) integrate(sin(x)^2/x,x,minf,inf); > Principal Value > log(- 1) > (%o1) - -------- > 2 > (%i2) integrate(sin(x)^2/x,x,10000000000,10000000000); > (%o2) 0 > (%i3) > > Function sin(x)^2/x is odd function, so it seems that > integrate(sin(x)^2/x,x,minf,inf) must return 0. Am i wrong? > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Fri Jan 27 10:16:55 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 27 Jan 2012 16:16:55 +0000 Subject: [Maxima] defrule bug 1204711 In-Reply-To: <4F2245D1.9090405@eecs.berkeley.edu> (Richard Fateman's message of "Thu, 26 Jan 2012 22:36:01 -0800") References: <87fwf2ln7g.fsf@hake.rswarbrick.dnsalias.com> <4F2245D1.9090405@eecs.berkeley.edu> Message-ID: <87boppqfwo.fsf@hake.rswarbrick.dnsalias.com> Richard Fateman writes: > On 1/26/2012 10:29 PM, Robert Dodier wrote: >> On 1/26/12, Rupert Swarbrick wrote: >> >>> http://sourceforge.net/tracker/?func=detail&aid=1204711&group_id=4933&atid=104933 > > If you want to retract a particular simp rule among a whole bunch, I > suggest you keep a list of your rules and assert via tellsimp, > etc. when you want them to operate. When you want to remove one, kill > them all. Then edit the list of rules, and re-assert them. > > That way you don't have to change any of the system code. > It is unlikely that you are going to be faster than the current > method, though you might be insignificantly slower. At least > if your computation is in fact the same one. Which it might not > be. > > RJF Right. I'm not sure if you've actually read my message? Or maybe I wasn't clear. At the moment, tellsimp/tellsimpafter and remrule interact weirdly. The reason for this is (I presume) a performance hack. My first try to fix this works by removing the hacky method and replacing it with something sane. It appears to work at least as fast, or faster. I'm aware that I can work around bugs, but that's an... unusual approach. Are you saying that I should not expect Maxima to have sane semantics with defrule and friends? Or do you think that I was trying to write this to improve performance? Or have I misunderstood you? Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From rswarbrick at gmail.com Fri Jan 27 10:17:32 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 27 Jan 2012 16:17:32 +0000 Subject: [Maxima] defrule bug 1204711 In-Reply-To: (Robert Dodier's message of "Thu, 26 Jan 2012 23:29:03 -0700") References: <87fwf2ln7g.fsf@hake.rswarbrick.dnsalias.com> Message-ID: <877h0dqfvn.fsf@hake.rswarbrick.dnsalias.com> Robert Dodier writes: > On 1/26/12, Rupert Swarbrick wrote: > >> http://sourceforge.net/tracker/?func=detail&aid=1204711&group_id=4933&atid=104933 > > Well, I suspect it would require fewer changes to preserve > the existing chaining scheme, but if so, then we'll have to > work out a way to fix up the chain when one rule is removed. > I can't think of a way right now. Maybe you ought to go ahead > and work on this other approach. Cool. I'll sort out a clean patch and should be able to post it sometime next week. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From robert.dodier at gmail.com Fri Jan 27 10:21:16 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 27 Jan 2012 09:21:16 -0700 Subject: [Maxima] Fwd: Problems with the maxima documentation In-Reply-To: <4857E09C-5837-46F6-826C-F03AD4747D5C@lpthe.jussieu.fr> References: <4857E09C-5837-46F6-826C-F03AD4747D5C@lpthe.jussieu.fr> Message-ID: Michel, I found the patch you sent. I've applied it & committed it & pushed the commit. I didn't try to run make yet. I mean this in the best way possible -- please don't send patches to me personally, please post them on the mailing list or bug tracker or some other public communication. It is not guaranteed that they will get applied, but it does increase the chances of it. best, Robert Dodier ---------- Forwarded message ---------- From: Michel Talon Date: Sun, 18 Dec 2011 15:20:20 +0100 Subject: Problems with the maxima documentation To: Robert Dodier Hello some time ago i mentioned there are problems building the maxima documentation on BSD and Mac OS X and it turned out that using gnu sed was able to fix most or all of the problems. I mentioned this problem on FreeBSD mailing list, and a developer, Brendan Fabeny, looked at the sed differenced between gnu sed and bsd sed, and came with a patch which indeeds solves most of the errors and also sent me explanations on the patch. The culprits are extract_categories.sh and extract_categories1.sed in doc/info, and here are the patches: niobe% cat patch-doc__info__extract_categories.sh --- doc/info/extract_categories.sh.orig 2011-08-01 00:39:51.000000000 -0400 +++ doc/info/extract_categories.sh 2011-12-16 09:05:05.000000000 -0500 @@ -17,9 +17,10 @@ if [ $f = "maxima.texi" ] then echo SKIP OVER $f else - sed 's/^@def\(fn\|vr\) *{[^}]*} *\([^[:blank:]]*\).*/@anchor{Item: \2}\ -\0/; s/^@node *\([^,]*\).*/@anchor{Item: \1}\ -\0/' "$f" > tmp.texi + sed 's/^@deffn *{[^}]*} *\([^[:blank:]]*\).*/@anchor{Item: \1}\ +&/; s/^@defvr *{[^}]*} *\([^[:blank:]]*\).*/@anchor{Item: \1}\ +&/; s/^@node *\([^,]*\).*/@anchor{Item: \1}\ +&/' "$f" > tmp.texi mv tmp.texi "$f" fi done niobe% cat patch-doc__info__extract_categories1.sed --- doc/info/extract_categories1.sed.orig 2011-08-01 00:39:51.000000000 -0400 +++ doc/info/extract_categories1.sed 2011-12-16 08:12:32.000000000 -0500 @@ -1,6 +1,9 @@ -s/^@def\(fn\|vr\) *{[^}]*} *\([^[:blank:]]*\).*/items = ["\2"]/ -s/^@def\(fn\|vr\)x *{[^}]*} *\([^[:blank:]]*\).*/if not "\2" in items: items.append ("\2")/ -s/^@end def\(fn\|vr\)/items = []/ +s/^@deffn *{[^}]*} *\([^[:blank:]]*\).*/items = ["\1"]/ +s/^@defvr *{[^}]*} *\([^[:blank:]]*\).*/items = ["\1"]/ +s/^@deffnx *{[^}]*} *\([^[:blank:]]*\).*/if not "\1" in items: items.append ("\1")/ +s/^@defvrx *{[^}]*} *\([^[:blank:]]*\).*/if not "\1" in items: items.append ("\1")/ +s/^@end deffn/items = []/ +s/^@end defvr/items = []/ s/^@node *\([^,]*\).*/items = ["\1"] # extracted from node/ s/@opencatbox// s/@closecatbox// and here are the explanations: The explanations for the changes in my patch are: -- In conformance with the Open Group specs, "|" is only a special character indicating alternation when extended regular expressions (EREs) are used, and FreeBSD sed(1) only uses EREs when invoked with the "-E" or "-r" options. -- a "\0" backreference, as nearly as I can tell from a few tests, is a non-standard GNU extension that seems to be equivalent to "&". In accordance with the Open Group specs, FreeBSD sed(1) interprets "\0" as "0". As far as i can see there is also replacement of \2 by \1, which i don't know the rationale for. Anyways, after applying these patches i still have some smaller problems, as i mention in a mail to B.F. that i also CC to you. -- Michel Talon talon at lpthe.jussieu.fr From toy.raymond at gmail.com Fri Jan 27 10:40:22 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 27 Jan 2012 08:40:22 -0800 Subject: [Maxima] Function returning the version number In-Reply-To: References: Message-ID: On Thu, Jan 26, 2012 at 12:45 AM, Michael Filonenko < filonenko.mikhail at gmail.com> wrote: > You can get value of common lisp variable *maxima-version* in maxima > environment: > > ?\*maxima\-version\* > > Does that actually work for you? That variable doesn't exist for me. Instead, I use ?\*autoconf\-version\* which currently returns 5.26.0_22_g91b6c40_dirty in my current tree. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From filonenko.mikhail at gmail.com Fri Jan 27 10:49:05 2012 From: filonenko.mikhail at gmail.com (Michael Filonenko) Date: Fri, 27 Jan 2012 18:49:05 +0200 Subject: [Maxima] Function returning the version number In-Reply-To: References: Message-ID: I was wrong. When I worked with my branch of maxima sources I renamed some variables, and forgot that it is only in my sources. 2012/1/27 Raymond Toy : > > > On Thu, Jan 26, 2012 at 12:45 AM, Michael Filonenko > wrote: >> >> You can get value of common lisp variable *maxima-version* in maxima >> environment: >> >> ?\*maxima\-version\* >> > > Does that actually work for you? That variable doesn't exist for me. > > Instead, I use > > ?\*autoconf\-version\* > > which currently returns 5.26.0_22_g91b6c40_dirty in my current tree. > > Ray > -- With best regards, Michael Filonenko From fateman at eecs.berkeley.edu Fri Jan 27 11:07:53 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 27 Jan 2012 09:07:53 -0800 Subject: [Maxima] defrule bug 1204711 In-Reply-To: <87boppqfwo.fsf@hake.rswarbrick.dnsalias.com> References: <87fwf2ln7g.fsf@hake.rswarbrick.dnsalias.com> <4F2245D1.9090405@eecs.berkeley.edu> <87boppqfwo.fsf@hake.rswarbrick.dnsalias.com> Message-ID: <4F22D9E9.5020700@eecs.berkeley.edu> On 1/27/2012 8:16 AM, Rupert Swarbrick wrote: > > Right. I'm not sure if you've actually read my message? Or maybe I > wasn't clear. I didn't read your earlier bug report previously, but I just read it. It seems to me that remrule doesn't do what the documentation says. I haven't tested it much, but I suspect that it either works if you remove ALL the rules, or if you remove the most recently defined rule. In fact, it is kind of unlikely that the author of this code (initially me, in about 1969), tried it in the circumstance that you have come up with. That is, defining rules with the simplifier OFF does not usually make sense. After all, if you are defining a rule F(A) --> B, and then try to define another rule F(A) --> C, the simplifier will change that latter rule to B-->C. If you didn't mean that, then what did you mean? The only time turning the simplifier off makes sense is if you are trying to over-ride a built in simplification. e.g. if you would like to do tellsimp(0^0,undefined). I suspect that one fix would be to change the documentation to say that remrule will only remove (a) all the rules on an operator or (b) the last rule on an operator. I am sure that there are lots of anomalies that could be uncovered in Maxima by turning off the simplifier and expecting Maxima to do whatever a user imagines that it should do in such a circumstance. > > At the moment, tellsimp/tellsimpafter and remrule interact weirdly. The > reason for this is (I presume) a performance hack. My first try to fix > this works by removing the hacky method and replacing it with something > sane. It appears to work at least as fast, or faster. > > I'm aware that I can work around bugs, but that's an... unusual > approach. Well, it depends on the circumstance. I agree that remrule doesn't do what the documentation seems to indicate it should do, but don't you think you are doing something pretty odd? After all, you are saying that the system should simplify the same exact expression, foo(1) into two different results, and doing so by temporarily disabling the simplifier. Can you think of no other way to accomplish your goal? I think that tellsimpafter(foo(1),a) tellsimpafer(foo(1),b) is a user error, and if you hadn't turned off the simplifier, you would have gotten an error message. if you had said tellsimpafter(foo(1),bar(1)); tellsimpafter(foo(1), b); you would have been informed that the second rule was placed on bar, not on foo. While I don't want to exactly correlate it with your situation, I would dispute that your statement about working around bugs is unusual. It is probably the most frequent approach. It happens like this: a bug is reported. The person in charge of resolving bugs decides that it is not a bug, but a "user error" or PICNIC. "Problem in Chair, Not in Computer". The advice is to change the user program. User does so and continues until the next bug... From the user perspective it appears he/she is being told how to work around a bug. Statistically speaking, user error constitute a vast majority of reported bugs in programs. > Are you saying that I should not expect Maxima to have sane > semantics with defrule and friends? If the documentation of remrule is changed, does that make it sane? Maybe one should also add that any bugs that occur only when simp:false, are user errors. > Or do you think that I was trying to > write this to improve performance? Nope. The difference in performance for tellsimp/tellsimpafter should be negligible. The initial implementation was complicated by the notion that after a bunch of tellsimps etc one would end up with a single subroutine that could be compiled into machine code. This would be harder to do with a separable list of rules. In practice, no one compiles the subroutine. RJF > Or have I misunderstood you? > > Rupert From tomdean at speakeasy.org Fri Jan 27 11:51:15 2012 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Fri, 27 Jan 2012 09:51:15 -0800 Subject: [Maxima] maxima 5.26.0 Build Failure on FreeBSD In-Reply-To: References: <4F224566.5020908@speakeasy.org> Message-ID: <4F22E413.7060705@speakeasy.org> On 01/27/12 01:47, Michel Talon wrote: > Thomas D. Dean wrote: > The main cause of the problem is that the scripts which build the > documentation have been tuned for gnu sed, and don't work with freebsd > sed. I have mailed about that the FreeBSD maintainer (who provided a > working patch for the sed rules) and Robert Dodier. I don't remember > having seen an answer from RD, i thought the problem was solved. If necessary > i can try to recover the patch and post it here. > > I zapped the build directory, started fresh, using gnu make and it completed successfully. Even with the original error, as you said, make check was successful. Thanks, Tom Dean From tomdean at speakeasy.org Fri Jan 27 11:55:47 2012 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Fri, 27 Jan 2012 09:55:47 -0800 Subject: [Maxima] integrate(sin(x)^2/x,x,minf,inf); In-Reply-To: References: <87fwf2ln7g.fsf@hake.rswarbrick.dnsalias.com> <4F22476E.4030602@bk.ru> Message-ID: <4F22E523.4000504@speakeasy.org> On 01/27/12 06:50, Stavros Macrakis wrote: > What version of Maxima are you running? In Maxima 5.25.1 GCL 2.6.8, I get: > # maxima Maxima 5.26.0 http://maxima.sourceforge.net using Lisp CLISP 2.49 (2010-07-07) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) integrate(sin(x)^2/x,x,minf,inf); Principal Value log(- 1) (%o1) - -------- 2 Tom Dean From rswarbrick at gmail.com Fri Jan 27 11:51:00 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 27 Jan 2012 17:51:00 +0000 Subject: [Maxima] defrule bug 1204711 References: <87fwf2ln7g.fsf@hake.rswarbrick.dnsalias.com> <4F2245D1.9090405@eecs.berkeley.edu> <87boppqfwo.fsf@hake.rswarbrick.dnsalias.com> <4F22D9E9.5020700@eecs.berkeley.edu> Message-ID: <8p4bv8xavk.ln2@hake.rswarbrick.dnsalias.com> Richard Fateman writes: > The only time turning the simplifier off makes sense is if you are > trying to over-ride a built in simplification. e.g. if you would like > to do tellsimp(0^0,undefined). > > I suspect that one fix would be to change the documentation to say > that remrule will only remove (a) all the rules on an operator or (b) > the last rule on an operator. > > I am sure that there are lots of anomalies that could be uncovered in > Maxima by turning off the simplifier and expecting Maxima to do > whatever a user imagines that it should do in such a circumstance. Hmm. It hadn't occurred to me that it might be impossible to trigger this without the simplifier temporarily turned off. That's a good point. > While I don't want to exactly correlate it with your situation, I > would dispute that your statement about working around bugs is > unusual. It is probably the most frequent approach. > > It happens like this: a bug is reported. The person in charge of > resolving bugs decides that it is not a bug, but a "user error" or > PICNIC. "Problem in Chair, Not in Computer". The advice is to change > the user program. User does so and continues until the next bug... > > From the user perspective it appears he/she is being told how to work > around a bug. Another possibility is that, from a user perspective, the program author appears arrogant and unpleasant. I'm not convinced that it's ever a great idea to reply with PICNIC, RTFM or other acronyms that show how terribly clever the author is. > Statistically speaking, user error constitute a vast majority of > reported bugs in programs. In some cases, programs can be designed to make it obvious to the user that they're doing something weird. HAL's new line: "I'm sorry, Dave. I'm afraid I can't do that. And why on Earth do you want me to?" Maybe this is more difficult with something like Maxima, where there is a whole programming language with which a user can shoot themselves in the foot. >> Are you saying that I should not expect Maxima to have sane >> semantics with defrule and friends? > If the documentation of remrule is changed, does that make it sane? > Maybe one should also add that any bugs that occur only when > simp:false, are user errors. Maybe. But arguing that "Maxima's behaviour when you set simp:false is undefined" implies that simp shouldn't be a variable a user can get to without diving into lisp... >> Or do you think that I was trying to write this to improve >> performance? > Nope. The difference in performance for tellsimp/tellsimpafter should > be negligible. The initial implementation was complicated by the > notion that after a bunch of tellsimps etc one would end up with a > single subroutine that could be compiled into machine code. This > would be harder to do with a separable list of rules. In practice, no > one compiles the subroutine. If I've understood this paragraph correctly, it doesn't quite describe how the current code works. Each simplifying subroutine may recurse to a previously defined one if one exists. As such, each would be compiled into separate functions. I would expect to get identical performance with one function calling each simplifying routine in turn (and not descend so far into the stack!). With implementations like SBCL, of course, everything gets compiled, so the compile/don't compile thing is sort of moot. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From fateman at eecs.berkeley.edu Fri Jan 27 13:42:32 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 27 Jan 2012 11:42:32 -0800 Subject: [Maxima] defrule bug 1204711 In-Reply-To: <8p4bv8xavk.ln2@hake.rswarbrick.dnsalias.com> References: <87fwf2ln7g.fsf@hake.rswarbrick.dnsalias.com> <4F2245D1.9090405@eecs.berkeley.edu> <87boppqfwo.fsf@hake.rswarbrick.dnsalias.com> <4F22D9E9.5020700@eecs.berkeley.edu> <8p4bv8xavk.ln2@hake.rswarbrick.dnsalias.com> Message-ID: <4F22FE28.7060905@eecs.berkeley.edu> On 1/27/2012 9:51 AM, Rupert Swarbrick wrote: > > Another possibility is that, from a user perspective, the program author > appears arrogant and unpleasant. Having sat on both sides of this perspective, I entirely agree. > I'm not convinced that it's ever a > great idea to reply with PICNIC, RTFM or other acronyms that show how > terribly clever the author is. look up "user error" on wikipedia.. >> Statistically speaking, user error constitute a vast majority of >> reported bugs in programs. > In some cases, programs can be designed to make it obvious to the user > that they're doing something weird. HAL's new line: "I'm sorry, > Dave. I'm afraid I can't do that. And why on Earth do you want me to?" > > Maybe this is more difficult with something like Maxima, where there is > a whole programming language with which a user can shoot themselves in > the foot. and the goal is to do "all of mathematics"... > >>> Are you saying that I should not expect Maxima to have sane >>> semantics with defrule and friends? >> If the documentation of remrule is changed, does that make it sane? >> Maybe one should also add that any bugs that occur only when >> simp:false, are user errors. > Maybe. But arguing that "Maxima's behaviour when you set simp:false is > undefined" implies that simp shouldn't be a variable a user can get to > without diving into lisp... That's pretty much my view. But in Maxima you can set any variable in lisp by doing something like ?secret_name: 1234, also. So we cannot really make a water-tight system without other changes. > >>> Or do you think that I was trying to write this to improve >>> performance? >> Nope. The difference in performance for tellsimp/tellsimpafter should >> be negligible. The initial implementation was complicated by the >> notion that after a bunch of tellsimps etc one would end up with a >> single subroutine that could be compiled into machine code. This >> would be harder to do with a separable list of rules. In practice, no >> one compiles the subroutine. > If I've understood this paragraph correctly, it doesn't quite describe > how the current code works. Each simplifying subroutine may recurse to > a previously defined one if one exists. Yes, it calls that function. Alternatively it could get the function name from a list and then call it. I don't know if the difference in execution time could be measured. > As such, each would be compiled > into separate functions. Yes > I would expect to get identical performance > with one function calling each simplifying routine in turn (and not > descend so far into the stack!). With implementations like SBCL, of > course, everything gets compiled, so the compile/don't compile thing is > sort of moot. I don't know what is compiled. If just "defun" forms are compiled, or if the forms produced by the pattern match compiler (used by tellsimp etc) also get compiled. Still, looking up functions in a list vs directly calling them would distinguish your suggestion from what is done now, right? RJF From tomdean at speakeasy.org Sat Jan 28 02:35:15 2012 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Sat, 28 Jan 2012 00:35:15 -0800 Subject: [Maxima] Working with Inequalities Message-ID: <4F23B343.4090408@speakeasy.org> How do I solve this? x^2 + 2*x=3 and 7*x+2<-x-3 I found solve_rat_ineq. That handles the inequality OK. (%i1) solve(x^2 + 2*x=3,x); (%o1) [x = - 3, x = 1] (%i2) solve_rat_ineq(7*x+2<-x-3); 5 (%o2) [[x < - -]] 8 The solution is x = -3 Tom Dean From willisb at unk.edu Sat Jan 28 08:12:22 2012 From: willisb at unk.edu (Barton Willis) Date: Sat, 28 Jan 2012 08:12:22 -0600 Subject: [Maxima] Working with Inequalities In-Reply-To: <4F23B343.4090408@speakeasy.org> References: <4F23B343.4090408@speakeasy.org> Message-ID: The optional package 'to_poly_solver' has a (very) limited ability to solve inequations. When to_poly_solver is able to transform the inequations into a linear system, the solver applies the Fourier elimination method. (%i2) load(to_poly_solver)$ Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $ (%i3) %solve([x^2 + 2*x=3, 7*x+2<-x-3],[x]); (%o3) %union([x=-3]) To attempt conversion to a linear form, %solve doesn't introduce radicals: (%i6) %solve([x^2 + 9*x=3, 7*x+2<-x-3],[x]); (%o6) %union([x<-5/8,x^2+9*x-3=0]) So %solve handles x^2 + 2*x=3, 7*x+2<-x-3 OK, but don't expect great things from %solve. --Barton (author of to_poly_solver). -----maxima-bounces at math.utexas.edu wrote: ----- To: maxima at math.utexas.edu From: "Thomas D. Dean" Sent by: maxima-bounces at math.utexas.edu Date: 01/28/2012 02:35AM Subject: [Maxima] Working with Inequalities How do I solve this? ?? x^2 + 2*x=3 and 7*x+2<-x-3 I found solve_rat_ineq. ?That handles the inequality OK. (%i1) solve(x^2 + 2*x=3,x); (%o1) [x = - 3, x = 1] (%i2) solve_rat_ineq(7*x+2<-x-3); ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?5 (%o2) ? ? ? ? ? ? ? ? ? ? ? ? ? ?[[x < - -]] ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?8 The solution is x = -3 Tom Dean _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From adammaj1 at o2.pl Sat Jan 28 03:30:10 2012 From: adammaj1 at o2.pl (Adam Majewski) Date: Sat, 28 Jan 2012 10:30:10 +0100 Subject: [Maxima] RE : string to identifier In-Reply-To: References: <4D0C218C381046D9A51EAB30B6AA95BA@PASSERELLE> Message-ID: On 22.01.2012 10:14, Adam Majewski wrote: > On 22.01.2012 01:39, laurent couraud wrote: >> You can also use eval_string from the package stringproc. >> >> Laurent. > > > Thx. It : > * removes upper/lower case switching > * removes one language from code ( older code have used 3 languages : > Maxima, Lisp and gnuplot. New code uses 2 languages : Maxima and gnuplot. ) > Below is new code. > > I think about making scene ( scene1, scene2 ....) in similar way to make > code shorter ( I hope not obfuscated) and then use : > draw(scene1, scene2) > > Old code and image is here : > http://commons.wikimedia.org/wiki/File:Parabolic_critical_orbits.png > more description : > http://en.wikibooks.org/wiki/Fractals/Iterations_in_the_complex_plane/parabolic > > > Please look also at : > > Category:Images with Maxima CAS source code > http://commons.wikimedia.org/wiki/Category:Images_with_Maxima_CAS_source_code > > > Category:Created with Maxima (software) > http://commons.wikimedia.org/wiki/Category:Created_with_Maxima_%28software%29 > > > Thx > > Adam > > > > > ============== newest code ============== > > kill(all); > > > > /* ---------- functions ---------------------- */ > > /* conformal map from circle to cardioid ( boundary > of period 1 component of Mandelbrot set */ > F(w):=w/2-w*w/4; > > > /* > circle D={w:abs(w)=1 } where w=ToCircle(t,r) > t is angle in turns ; 1 turn = 360 degree = 2*Pi radians > r is a radius > */ > ToCircle(t,r):=r*%e^(%i*t*2*%pi); > > > > > /* > > http://en.wikipedia.org/wiki/Complex_quadratic_polynomial > */ > f(z,c):=z*z+c $ > > GiveCriticalOrbit(c,iMax):= > /* > computes (without escape test) > critical orbit (forward orbit of critical point ) > and saves it to the list for draw package */ > block( > [z,orbit,temp], > z:0, /* first point = critical point z:0+0*%i */ > orbit:[[realpart(z),imagpart(z)]], > for i:1 thru iMax step 1 do > ( z:expand(f(z,c)), > orbit:endcons([realpart(z),imagpart(z)],orbit)), > > return(orbit) > )$ > > > /* find fixed point alfa , returns a list */ > GiveFixed(c):= > ( > [z], > z:float(rectform((1-sqrt(1-4*c))/2)), > [[realpart(z),imagpart(z)]] > )$ > > > > GiveC(angle,radius):= > ( > [w], > /* point of unit circle w:l(internalAngle,internalRadius); */ > w:ToCircle(angle,radius), /* point of circle */ > float(rectform(F(w))) /* point on boundary of period 1 component of > Mandelbrot set */ > )$ > > > > compile(all)$ > > > > /* ---------- constant ---------------------------*/ > Numerator :1; > DenominatorMax :10; > InternalRadius:1; > iMax:500; > > > /* -------------- main ----------------- */ > > > > for Denominator:1 thru DenominatorMax step 1 do > ( > InternalAngle: Numerator/Denominator, > c: GiveC(InternalAngle,InternalRadius), > /* */ > eval_string(concat("z",string(Denominator)))::GiveFixed(c), > /* */ > > eval_string(concat("orbit",string(Denominator)))::GiveCriticalOrbit(c,iMax) > ); > > > > > /*-----------------------------------------------------------------------*/ > load(draw); /* ( interface to gnuplot ) by Mario Rodriguez Riotorto > http://www.telefonica.net/web2/biomates */ > > draw( > > terminal = screen, > columns =5, > file_name = "b", > pic_width = 1000, /* Since Maxima 5.23, pic_width and pic_height are > deprecated. */ > pic_height = 500, /* See option dimensions. To get the same effect, > write dimensions=[800,600] */ > > gr2d( > title= "1/1 ", > user_preamble = "set border 0;set nokey;set size square;set noxtics ;set > noytics;", > > point_type = filled_circle, > points_joined = false, > point_size = 0.7, > /* critical orbit */ > color =red, > points(orbit1), > /* parabolic fixed point */ > color =black, > point_size = 1.4, > points(z1), > /* criitical point */ > color =blue, > points([0],[0]) > ), > > gr2d( > title= " 1/2 ", > user_preamble = "set border 0;set nokey;set size square;set noxtics ;set > noytics;", > > point_type = filled_circle, > points_joined = false, > point_size = 0.7, > /* criitical orbit */ > color =red, > points(orbit2), > /* parabolic fixed point */ > color =black, > point_size = 1.4, > points(z2), > /* criitical point */ > color =blue, > points([0],[0]) > ), > > gr2d( > title= " 1/3 ", > user_preamble = "set border 0;set nokey;set size square;set noxtics ;set > noytics;", > point_type = filled_circle, > points_joined = false, > point_size = 0.7, > /* critical orbit */ > color =red, > points(orbit3), > /* parabolic fixed point */ > color =black, > point_size = 1.4, > points(z3), > /* criitical point */ > color =blue, > points([0],[0]) > ), > > gr2d( > title= " 1/4 ", > user_preamble = "set border 0;set nokey;set size square;set noxtics ;set > noytics;", > point_type = filled_circle, > points_joined = false, > point_size = 0.7, > /* critical orbit */ > color =red, > points(orbit4), > /* parabolic fixed point */ > color =black, > point_size = 1.4, > points(z4), > /* criitical point */ > color =blue, > points([0],[0]) > ), > gr2d( > title= " 1/5 ", > user_preamble = "set border 0;set nokey;set size square;set noxtics ;set > noytics;", > point_type = filled_circle, > points_joined = false, > point_size = 0.7, > /* critical orbit */ > color =red, > points(orbit5), > /* parabolic fixed point */ > color =black, > point_size = 1.4, > points(z5), > /* criitical point */ > color =blue, > points([0],[0]) > ), > > gr2d( > title= "1/6 ", > user_preamble = "set border 0;set nokey;set size square;set noxtics ;set > noytics;", > > point_type = filled_circle, > points_joined = false, > point_size = 0.7, > /* critical orbit */ > color =red, > points(orbit6), > /* parabolic fixed point */ > color =black, > point_size = 1.4, > points(z6), > /* criitical point */ > color =blue, > points([0],[0]) > ), > > gr2d( > title= " 1/7 ", > user_preamble = "set border 0;set nokey;set size square;set noxtics ;set > noytics;", > > point_type = filled_circle, > points_joined = false, > point_size = 0.7, > /* criitical orbit */ > color =red, > points(orbit7), > /* parabolic fixed point */ > color =black, > point_size = 1.4, > points(z7), > /* criitical point */ > color =blue, > points([0],[0]) > ), > > gr2d( > title= " 1/8 ", > user_preamble = "set border 0;set nokey;set size square;set noxtics ;set > noytics;", > point_type = filled_circle, > points_joined = false, > point_size = 0.7, > /* critical orbit */ > color =red, > points(orbit8), > /* parabolic fixed point */ > color =black, > point_size = 1.4, > points(z8), > /* criitical point */ > color =blue, > points([0],[0]) > ), > > gr2d( > title= " 1/9 ", > user_preamble = "set border 0;set nokey;set size square;set noxtics ;set > noytics;", > point_type = filled_circle, > points_joined = false, > point_size = 0.7, > /* critical orbit */ > color =red, > points(orbit9), > /* parabolic fixed point */ > color =black, > point_size = 1.4, > points(z9), > /* criitical point */ > color =blue, > points([0],[0]) > ), > gr2d( > title= " 1/10 ", > user_preamble = "set border 0;set nokey;set size square;set noxtics ;set > noytics;", > point_type = filled_circle, > points_joined = false, > point_size = 0.7, > /* critical orbit */ > color =red, > points(orbit10), > /* parabolic fixed point */ > color =black, > point_size = 1.4, > points(z10), > /* criitical point */ > color =blue, > points([0],[0]) > ) > > > > ); With help of Mario Rodriguez Riotorto I have change the program. It does not uses strings but lists of scenes and is much shorter. Thx Adam ===========code========== kill(all); /* ---------- functions ---------------------- */ /* conformal map from circle to cardioid ( boundary of period 1 component of Mandelbrot set */ F(w):=w/2-w*w/4; /* circle D={w:abs(w)=1 } where w=l(t,r) t is angle in turns ; 1 turn = 360 degree = 2*Pi radians r is a radius */ ToCircle(t,r):=r*%e^(%i*t*2*%pi); /* http://en.wikipedia.org/wiki/Complex_quadratic_polynomial */ f(z,c):=z*z+c $ GiveCriticalOrbit(c,iMax):= /* computes (without escape test) critical orbit (forward orbit of critical point ) and saves it to the list for draw package */ block( [z,orbit,temp], z:0, /* first point = critical point z:0+0*%i */ orbit:[[realpart(z),imagpart(z)]], for i:1 thru iMax step 1 do ( z:expand(f(z,c)), orbit:endcons([realpart(z),imagpart(z)],orbit)), return(orbit) )$ /* find fixed point alfa , returns a list */ GiveFixed(c):= ( [z], z:float(rectform((1-sqrt(1-4*c))/2)), [[realpart(z),imagpart(z)]] )$ GiveC(angle,radius):= ( [w], /* point of unit circle w:l(internalAngle,internalRadius); */ w:ToCircle(angle,radius), /* point of circle */ float(rectform(F(w))) /* point on boundary of period 1 component of Mandelbrot set */ )$ GiveScene(sTitle, zn, orbitn):= gr2d(title= sTitle, user_preamble = "set border 0;set nokey;set size square;set noxtics ;set noytics;", point_type = filled_circle, points_joined = false, point_size = 0.7, /* critical orbit */ color =red, points(orbitn), /* parabolic fixed point */ color =black, point_size = 1.4, points(zn), /* criitical point */ color =blue, points([0],[0]) )$ compile(all)$ /* ---------- constant ---------------------------*/ Numerator :1; DenominatorMax :10; InternalRadius:1; iMax:500; /* -------------- main ----------------- */ scenes:[]; for Denominator:1 thru DenominatorMax step 1 do ( InternalAngle: Numerator/Denominator, c: GiveC(InternalAngle,InternalRadius), scene:GiveScene(string(InternalAngle), GiveFixed(c), GiveCriticalOrbit(c,iMax)), scenes:cons(scene,scenes))$ /*-----------------------------------------------------------------------*/ load(draw); /* ( interface to gnuplot ) by Mario Rodriguez Riotorto http://www.telefonica.net/web2/biomates */ draw( terminal = screen, columns =5, file_name = "b", pic_width = 1000, /* Since Maxima 5.23, pic_width and pic_height are deprecated. */ pic_height = 500, /* See option dimensions. To get the same effect, write dimensions=[800,600] */ scenes ); From macrakis at alum.mit.edu Sat Jan 28 13:32:43 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 28 Jan 2012 14:32:43 -0500 Subject: [Maxima] string to identifier In-Reply-To: <4F1B27BB.2070800@eecs.berkeley.edu> References: <4F1B27BB.2070800@eecs.berkeley.edu> Message-ID: Actually, concat with a Maxima symbol returns a Maxima symbol (interned): concat('list,123) => list123 But usually when users as for functionality like this, they would be better off using named arrays or simply lists. -s On Sat, Jan 21, 2012 at 16:01, Richard Fateman wrote: > On 1/21/2012 12:51 PM, Adam Majewski wrote: > >> How can I convert string to identifier ? >> >> I would like to make a few list for draw package : >> list1, list2 ... >> >> for Denominator:1 thru DenominatorMax step 1 do >> ( >> name:concat("list",string(**Denominator)), >> /* here I should convert string name to identier */ >> name:Givelist /* my function */ >> ); >> >> try > ?intern(concat("list", 123)); > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Jan 28 14:05:01 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 28 Jan 2012 13:05:01 -0700 Subject: [Maxima] Function returning the version number In-Reply-To: References: Message-ID: I think that making a program dependent on the Maxima version number generally indicates that something has gone wrong; I would avoid it if possible. That said, I have a patch laying around to rework build_info so that it returns a Maxima structure (as defined by defstruct) which makes it easy to extract the bits of the build info. With this patch I get: (%i2) x : build_info (); (%o2) Maxima version: 5.26.0_16_gb72c64c_dirty Maxima build date: 2012-01-11 00:01:25 Host type: i686-pc-linux-gnu Lisp implementation type: CMU Common Lisp Lisp implementation version: CVS release-19a 19a-release-20040728 + minimal debian patches (%i3) x at version; (%o3) 5.26.0_16_gb72c64c_dirty (%i4) x at timestamp; (%o4) 2012-01-11 00:01:25 (%i5) x at host; (%o5) i686-pc-linux-gnu (%i6) x at lisp_name; (%o6) CMU Common Lisp (%i7) x at lisp_version; (%o7) CVS release-19a 19a-release-20040728 + minimal debian patches Note that the patch includes a display function so that the return value of build_info is displayed just as build_info now displays the build info. I'll commit this unless someone thinks it's a bad idea. best Robert Dodier From robert.dodier at gmail.com Sat Jan 28 14:08:12 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 28 Jan 2012 13:08:12 -0700 Subject: [Maxima] Function returning the version number In-Reply-To: References: Message-ID: Oh, sorry -- I forgot to include the patch. Here it is. best Robert Dodier PS. Index: src/macsys.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/src/macsys.lisp,v retrieving revision 1.83 diff -u -r1.83 macsys.lisp --- src/macsys.lisp 6 Sep 2010 22:18:16 -0000 1.83 +++ src/macsys.lisp 20 Mar 2011 20:10:05 -0000 @@ -359,23 +359,57 @@ (format t (intl:gettext "Submit bug reports by following the 'Add new' link on that page.~%")) (format t (intl:gettext "Please include the following information with your bug report:~%")) (format t "-------------------------------------------------------------~%") - ($build_info) + (displa ($build_info)) (format t "-------------------------------------------------------------~%") (format t (intl:gettext "The above information is also reported by the function 'build_info'.~%~%")) "") +(defstruct1 '((%build_info) $version $timestamp $host $lisp_name $lisp_version)) + +(defvar *maxima-build-info* nil) + (defmfun $build_info () - (format t (intl:gettext "~%Maxima version: ~a~%") *autoconf-version*) - (format t (intl:gettext "Maxima build date: ~a:~a ~a/~a/~a~%") - (third cl-user:*maxima-build-time*) - (second cl-user:*maxima-build-time*) - (fifth cl-user:*maxima-build-time*) - (fourth cl-user:*maxima-build-time*) - (sixth cl-user:*maxima-build-time*)) - (format t (intl:gettext "Host type: ~a~%") *autoconf-host*) - (format t (intl:gettext "Lisp implementation type: ~a~%") (lisp-implementation-type)) - (format t (intl:gettext "Lisp implementation version: ~a~%~%") (lisp-implementation-version)) - "") + (or + *maxima-build-info* + (setq + *maxima-build-info* + (let + ((year (sixth cl-user:*maxima-build-time*)) + (month (fifth cl-user:*maxima-build-time*)) + (day (fourth cl-user:*maxima-build-time*)) + (hour (third cl-user:*maxima-build-time*)) + (minute (second cl-user:*maxima-build-time*)) + (seconds (first cl-user:*maxima-build-time*))) + (mfuncall + '$new + `((%build_info) + ,*autoconf-version* + ,(format nil "~4,'0d-~2,'0d-~2,'0d ~2,'0d:~2,'0d:~2,'0d" year month day hour minute seconds) + ,*autoconf-host* + ,(lisp-implementation-type) + ,(lisp-implementation-version))))))) + +(defun dimension-build-info (form result) + (declare (special bkptht bkptdp lines break)) + (let + ((version-string (format nil (intl:gettext "Maxima version: ~a") (mfuncall '$@ form '$version))) + (timestamp-string (format nil (intl:gettext "Maxima build date: ~a") (mfuncall '$@ form '$timestamp))) + (host-string (format nil (intl:gettext "Host type: ~a") (mfuncall '$@ form '$host))) + (lisp-name-string (format nil (intl:gettext "Lisp implementation type: ~a") (mfuncall '$@ form '$lisp_name))) + (lisp-version-string (format nil (intl:gettext "Lisp implementation version: ~a") (mfuncall '$@ form '$lisp_version))) + (bkptht 1) + (bkptdp 1) + (lines 0) + (break 0)) + (forcebreak result 0) + (forcebreak (reverse (coerce version-string 'list)) 0) + (forcebreak (reverse (coerce timestamp-string 'list)) 0) + (forcebreak (reverse (coerce host-string 'list)) 0) + (forcebreak (reverse (coerce lisp-name-string 'list)) 0) + (forcebreak (reverse (coerce lisp-version-string 'list)) 0)) + nil) + +(setf (get '%build_info 'dimension) 'dimension-build-info) (defvar *maxima-started* nil) From fateman at eecs.berkeley.edu Sat Jan 28 16:29:44 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 28 Jan 2012 14:29:44 -0800 Subject: [Maxima] putting defstruct into the Maxima manual In-Reply-To: <4ACCA6E6.90100@cs.berkeley.edu> References: <4ACCA6E6.90100@cs.berkeley.edu> Message-ID: <4F2476D8.3040408@eecs.berkeley.edu> A few years later.... Since build_info uses it .... how about .... On 10/7/2009 7:34 AM, Richard Fateman wrote: Could someone find a place for this and put it into the manual and online info? Thanks. RJF .................. Maxima includes a technique to establish records or structures with named fields. It uses the following functions: defstruct and new. It uses the operator @ . Here's an example. defstruct(f(x,y,z)); /* declare f to be a record with 3 fields, x,y,z */ myrecord: new(f); /* myrecord is an instance of f */ myrecord at y:45; /* change myrecord as seen below. */ myrecord; ==> f(x,45,z) accessing is done this way... myrecord at y ==> 45. Initializers also possible defstruct(f(x,y=3.14159, z)); ff:new(f) ==> f(x,3.14159,z) ff at y:2.71828 ==> ff is f(x,2.71828,z). It is generally better to use more descriptive field names, ones that are not likely to be assigned values. If you use x as field name there is a danger that you would assign it a value, like x:10. But then ff at x means ff at 10. From robert.dodier at gmail.com Sun Jan 29 01:49:04 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 29 Jan 2012 00:49:04 -0700 Subject: [Maxima] putting defstruct into the Maxima manual In-Reply-To: <4F2476D8.3040408@eecs.berkeley.edu> References: <4ACCA6E6.90100@cs.berkeley.edu> <4F2476D8.3040408@eecs.berkeley.edu> Message-ID: On 1/28/12, Richard Fateman wrote: > A few years later.... Oh, documentation for defstruct & friends was added to ref manual a few releases ago. Better late than never, slow & steady wins the race, etc. best Robert Dodier From sen1 at math.msu.edu Sun Jan 29 10:06:57 2012 From: sen1 at math.msu.edu (Sheldon Newhouse) Date: Sun, 29 Jan 2012 16:06:57 +0000 Subject: [Maxima] problem with draw and windows 7 Message-ID: Hello all, I have a student who has windows 7 Home Premium on her laptop. She has tried both Maxima-5.25.0 and 5.26.0 and can't see the plot with draw2d. Other students with the same OS (I think) have no difficulty with draw and I don't in my Win 7 Professional laptop. She has no trouble with plot2d. The gnuplot window opens up just fine. With draw2d, (in either Xmaxima or WxMaxima), she gets a graphics output like [gr2d(explicit)]at that looks as if the gnuplot window should open, but it doesn't. I looked everywhere on the destop and it is not there. any ideas? -TIA. ------------------------------------------------------------------------------------------- Sheldon E. Newhouse | e-mail: sen1 at math.msu.edu | Mathematics Department | Michigan State University | telephone: 517-355-9684 | E. Lansing, MI 48824-1027 USA | FAX: 517-432-1562 | ------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sun Jan 29 10:29:33 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 29 Jan 2012 08:29:33 -0800 Subject: [Maxima] bigfloat eigenvalues Message-ID: <4F2573ED.8080601@eecs.berkeley.edu> I re-worked the program from lapack/ eispack "bisect" which computes eigenvalues of a symmetric tridiagonal matrix (STM) so that it runs in bigfloat arithmetic. it is in http://www.cs.berkeley.edu/~fateman/lisp/bfbisect.lisp and appears to be happy in GCL. testing it in your favorite version of maxima would require loading that file (optionally compiling), and running ?test(); Bisect is possibly the program of choice for STM if you need only a set number n of eigenvalues in an interval, rather than all of them. Thanks to f2cl for producing a first cut. I also have a version that runs using MPFR (a c-coded bigfloat library). I loaded MPFR into Allegro Common Lisp for this version; loading MPFR into other lisps requires special attention and knowledge that I don't have. (I gather that GCL is particularly deficient in loading foreign function libraries). Comments, improvements, welcome. RJF From mohamedabouzied at yahoo.co.uk Sat Jan 28 04:07:53 2012 From: mohamedabouzied at yahoo.co.uk (MOHAMMED ABOU ZIED) Date: Sat, 28 Jan 2012 10:07:53 +0000 (GMT) Subject: [Maxima] bug report Message-ID: <1327745273.46551.YahooMailNeo@web26503.mail.ukl.yahoo.com> Dear All, I want to report two bugs, when I use algsys() function, the output list is recognized as a 1 element list (which is worng). This don't happen for the linsolve() function as the attachments reveal. Another bug, after I took the outputs of linsolve() function "i don't know if this also at algsysy() or not", i used denom() function, but it returned 1 and when i take num() function, it return both numerator divided by the denominator. Yours, Mohamed Abouzied -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: bug.png Type: image/png Size: 171275 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: no_bug.png Type: image/png Size: 167164 bytes Desc: not available URL: From aleksasd873 at gmail.com Sat Jan 28 07:22:53 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Sat, 28 Jan 2012 15:22:53 +0200 Subject: [Maxima] Working with Inequalities Message-ID: *Thomas D. Dean* tomdean at speakeasy.org *Sat Jan 28 02:35:15 CST 2012 *wrote: How do I solve this? x^2 + 2*x=3 and 7*x+2<-x-3 I found solve_rat_ineq. That handles the inequality OK. (%i1) solve(x^2 + 2*x=3,x); (%o1) [x = - 3, x = 1] (%i2) solve_rat_ineq(7*x+2<-x-3); 5 (%o2) [[x < - -]] 8 The solution is x = -3 Tom Dean ******************************************* first method: (%i1) eq:x^2 + 2*x=3$ (%i2) ineq:7*x+2<-x-3$ (%i3) sol:solve(eq); (%o3) [x=-3,x=1] (%i4) sublist(sol,lambda([e],ev(ineq,e))); (%o4) [x=-3] second method: (%i5) to_poly_solve([eq,ineq], [x]); Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $ (%o5) %union([x=-3]) (%i6) first(%); (%o6) [x=-3] Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From sigoldberg1 at gmail.com Sat Jan 28 16:50:45 2012 From: sigoldberg1 at gmail.com (Seth Goldberg) Date: Sat, 28 Jan 2012 17:50:45 -0500 Subject: [Maxima] porting Maxima 5.26.0 to mac issue? My error? Message-ID: porting issue/?bug/?my error > I downloaded Maxima 5.26.0, opened the dmg, dragged the Maxina icon to to the applications folder, then opened the applications folder and doubleclicked the Maxima icon. A vare window opens and I get see: "Last login: Fri Jan 27 22:27:07 on ttys000 exec '/Applications/Maxima.app/Contents/Resourc/maxima.sh' seth-goldbergs-computer:~ sigoldberg1$ exec '/Applications/Maxima.app/ Contents/Resources/maxima.sh' /Applications/Maxima.app/Contents/Resources/maxima//bin/maxima: line 178: /Applications/Maxima.app/Contents/Resources/maxima//bin/sbcl: Bad CPU type in executable /Applications/Maxima.app/Contents/Resources/maxima//bin/maxima: line 178: /Applications/Maxima.app/Contents/Resources/maxima//bin/sbcl: Unknown error: 0 [Process completed]" > Ideas? Please forward to porting people. > > Thanks, > Seth Goldberg > > > > My system - Mac OS X Vers. 10.6.5 > Hardware and software Overview: all plain vanilla - off the shelf > > Model Name: MacBook Pro > Model Identifier: MacBookPro1,1 > Processor Name: Intel Core Duo > Processor Speed: 2 GHz > Number Of Processors: 1 > Total Number Of Cores: 2 > L2 Cache: 2 MB > Memory: 2 GB > Bus Speed: 667 MHz > Boot ROM Version: MBP11.0055.B08 > SMC Version (system): 1.2f10 > Serial Number (system): W86240QUWBH > Hardware UUID: 00000000-0000-1000-8000- 0016CB8F7F83 > Sudden Motion Sensor: > State: Enabled > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andre.maute at gmx.de Sun Jan 29 11:14:06 2012 From: andre.maute at gmx.de (andre maute) Date: Sun, 29 Jan 2012 18:14:06 +0100 Subject: [Maxima] bug report In-Reply-To: <1327745273.46551.YahooMailNeo@web26503.mail.ukl.yahoo.com> References: <1327745273.46551.YahooMailNeo@web26503.mail.ukl.yahoo.com> Message-ID: <4F257E5E.30909@gmx.de> On 01/28/2012 11:07 AM, MOHAMMED ABOU ZIED wrote: > Dear All, > I want to report two bugs, > when I use algsys() function, the output list is recognized as a 1 element list (which is worng). > This don't happen for the linsolve() function as the attachments reveal. But there are algebraic equations with more than one solution! See the documentation, this is documented behavior. Andre From rswarbrick at gmail.com Sun Jan 29 11:28:24 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sun, 29 Jan 2012 17:28:24 +0000 Subject: [Maxima] bug report References: <1327745273.46551.YahooMailNeo@web26503.mail.ukl.yahoo.com> Message-ID: MOHAMMED ABOU ZIED writes: > Dear All, > I want to report two bugs, > when I use algsys() function, the output list is recognized as a 1 element list (which is worng). > This don't happen for the linsolve() function as the attachments reveal. Solve returns a list of the solutions. Here it has found one solution (thus the list has length one). This solution has two variables, i and I (so the only element in the top-level list has two elements). > Another bug, after I took the outputs of linsolve() function "i don't > know if this also at algsysy() or not", i used denom() function, but > it returned 1 and when i take num() function, it return both numerator > divided by the denominator. Can you include a transcript? Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From glneolistmail at gmail.com Sun Jan 29 11:34:44 2012 From: glneolistmail at gmail.com (Andrew Davis) Date: Sun, 29 Jan 2012 12:34:44 -0500 Subject: [Maxima] Floating point problems Message-ID: Hello all, While doing some homework, maxima return some incorrect limits. I traced the problem back to the number -8.14. It is evaluated to -8.140000000001, you can test this yourself by taking the limit of (-8.14+1) as x approaches any number, or just evaluate 1-8.14. This happens on all clisp's and even on http://calc.matthen.com/ , (evaluate -8.14). At first I thought it was just rounding error on display and not internal stored like that, but take a limit that uses -8.14 and you will have undefined results where it should have a real limit ( because -8.14 can be factored in my problem but -8.14000001 could not ). This is the only number I found that does that, but I suspect more. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sun Jan 29 11:47:10 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 29 Jan 2012 09:47:10 -0800 Subject: [Maxima] Floating point problems In-Reply-To: References: Message-ID: <4F25861E.40602@gmail.com> On 1/29/12 9:34 AM, Andrew Davis wrote: > Hello all, > > While doing some homework, maxima return some incorrect limits. I traced > the problem back to the number -8.14. It is evaluated to > -8.140000000001, you can test this yourself by taking the limit of > (-8.14+1) as x approaches any number, or just evaluate 1-8.14. This > happens on all clisp's and even on http://calc.matthen.com/ , (evaluate > -8.14). At first I thought it was just rounding error on display and > not internal stored like that, but take a limit that uses -8.14 and you > will have undefined results where it should have a real limit > ( because -8.14 can be factored in my problem but -8.14000001 could not > ). This is the only number I found that does that, but I suspect more. This, and questions like it, are becoming a FAQ. If you want exact numbers, use exact numbers instead of floating-point. So use 814/100 instead. 8.14 cannot be represented exactly as (binary) floating-point number. In fact 8.14 differs from 814/100 by 1/1759218604441600. Also read "What Every Computer Scientist Should Know About Floating-Point Arithmetic", by David Goldberg. Google will find suitable versions. Ray From toy.raymond at gmail.com Sun Jan 29 11:47:10 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 29 Jan 2012 09:47:10 -0800 Subject: [Maxima] Floating point problems In-Reply-To: References: Message-ID: <4F25861E.40602@gmail.com> On 1/29/12 9:34 AM, Andrew Davis wrote: > Hello all, > > While doing some homework, maxima return some incorrect limits. I traced > the problem back to the number -8.14. It is evaluated to > -8.140000000001, you can test this yourself by taking the limit of > (-8.14+1) as x approaches any number, or just evaluate 1-8.14. This > happens on all clisp's and even on http://calc.matthen.com/ , (evaluate > -8.14). At first I thought it was just rounding error on display and > not internal stored like that, but take a limit that uses -8.14 and you > will have undefined results where it should have a real limit > ( because -8.14 can be factored in my problem but -8.14000001 could not > ). This is the only number I found that does that, but I suspect more. This, and questions like it, are becoming a FAQ. If you want exact numbers, use exact numbers instead of floating-point. So use 814/100 instead. 8.14 cannot be represented exactly as (binary) floating-point number. In fact 8.14 differs from 814/100 by 1/1759218604441600. Also read "What Every Computer Scientist Should Know About Floating-Point Arithmetic", by David Goldberg. Google will find suitable versions. Ray From fateman at eecs.berkeley.edu Sun Jan 29 12:51:34 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 29 Jan 2012 10:51:34 -0800 Subject: [Maxima] bug report In-Reply-To: References: <1327745273.46551.YahooMailNeo@web26503.mail.ukl.yahoo.com> Message-ID: <4F259536.10705@eecs.berkeley.edu> On 1/29/2012 9:28 AM, Rupert Swarbrick wrote: > MOHAMMED ABOU ZIED writes: >> Dear All, >> I want to report two bugs, I suspect that the previous two responses may not be specific enough for you. These are not bugs. It would also be helpful in the future if you had a more informative subject line, and did not attach images, but text. Also, you should simplify your report to the simplest example that demonstrates the phenomenon. (Also, there is another place to send bugs, should you find them in the future.) The Maxima bug database is available at http://sourceforge.net/tracker/?atid=104933&group_id=4933&func=browse Submit bug reports by following the 'Add new' link on that page. Good luck, and enjoy Maxima! RJF From andrej.vodopivec at gmail.com Sun Jan 29 13:31:33 2012 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Sun, 29 Jan 2012 20:31:33 +0100 Subject: [Maxima] porting Maxima 5.26.0 to mac issue? My error? In-Reply-To: References: Message-ID: Unfortunately the binary only supports 64 bit macs. Core Duo is 32 bit. Andrej On Sat, Jan 28, 2012 at 11:50 PM, Seth Goldberg wrote: > porting issue/?bug/?my error > >> I downloaded Maxima 5.26.0, opened the dmg, dragged the Maxina icon to to >> the applications folder, then opened the applications folder and >> doubleclicked the Maxima icon.? A vare window opens and I get see: > > ? "Last login: Fri Jan 27 22:27:07 on ttys000 > ? exec '/Applications/Maxima.app/Contents/Resourc/maxima.sh' > ? seth-goldbergs-computer:~ sigoldberg1$ exec '/Applications/Maxima.app/ > ? Contents/Resources/maxima.sh' > ? /Applications/Maxima.app/Contents/Resources/maxima//bin/maxima: line > ? 178: /Applications/Maxima.app/Contents/Resources/maxima//bin/sbcl: Bad > ? CPU type in executable > ? /Applications/Maxima.app/Contents/Resources/maxima//bin/maxima: line > ? 178: /Applications/Maxima.app/Contents/Resources/maxima//bin/sbcl: > ? Unknown error: 0 > > ? [Process completed]" > >> Ideas? ?Please forward to porting people. >> >> Thanks, >> Seth Goldberg >> >> > >> >> My system - Mac OS X ?Vers. 10.6.5 >> Hardware and software Overview: all plain vanilla -? off the shelf >> >> ? Model Name: MacBook Pro >> ? Model Identifier: ? MacBookPro1,1 >> ? Processor Name: ? ? Intel Core Duo >> ? Processor Speed: ? ?2 GHz >> ? Number Of Processors: ? ? ? 1 >> ? Total Number Of Cores: ? ? ?2 >> ? L2 Cache: ? 2 MB >> ? Memory: ? ? 2 GB >> ? Bus Speed: ?667 MHz >> ? Boot ROM Version: ? MBP11.0055.B08 >> ? SMC Version (system): ? ? ? 1.2f10 >> ? Serial Number (system): ? ? W86240QUWBH >> ? Hardware UUID: ? ? ?00000000-0000-1000-8000- > 0016CB8F7F83 >> ? Sudden Motion Sensor: >> ? State: ? ? ?Enabled >> > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From pbowyer at olynet.com Sun Jan 29 14:11:39 2012 From: pbowyer at olynet.com (Paul Bowyer) Date: Sun, 29 Jan 2012 12:11:39 -0800 Subject: [Maxima] Make check failures In-Reply-To: References: <4F1F1790.5040603@olynet.com> Message-ID: <4F25A7FB.6050302@olynet.com> On 01/24/2012 01:03 PM, Raymond Toy wrote: > > > On Tue, Jan 24, 2012 at 12:41 PM, Paul Bowyer > wrote: > > > I ran the test suite from within xmaxima for sbcl and ccl and > sbcl fails on rtest16 > ********************** Problem 393 *************** > Input: > closeto(zeta(%i + 3) - (1.10721440843141 - .1482908671781754 %i), > 1.e-15) > > > Result: > 3.3157171161039706e-9 > > This differed from the expected result: > true > > ********************** Problem 394 *************** > Input: > ! 1 ! > closeto(!zeta(0.5 %i + -)! - 1.06534921249378, 1.e-14) > ! 2 ! > > > Result: > 3.1194385963217997e-8 > > > I'm pretty sure this is the known issue with sbcl about how it > computes (cl:expt ). A bug has been filed, I > think, and I have verbal confirmation that it will be fixed someday. > (Ccl used to have the same problem, but it was fixed a while ago.) > > Ray > Ray: I installed sbcl 1.0.55 and rebuilt maxima from source using a fresh download yesterday and now the testsuite using the sbcl runtime completes without unknown errors. Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sun Jan 29 14:44:06 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 29 Jan 2012 12:44:06 -0800 Subject: [Maxima] Floating point problems In-Reply-To: References: <4F25861E.40602@gmail.com> Message-ID: <4F25AF96.1010409@gmail.com> On 1/29/12 11:50 AM, Andrew Davis wrote: > I understand all that it is not exact > > At first I thought it was just rounding error on display > > but why is it not held in memory symbolically so that it can be > factored and manipulated correctly. > +maxima-list Because you told maxima you wanted a floating-point number by writing 8.14. And it is being manipulated correctly (barring bugs) according to floating-point arithmetic rules. Ray From macrakis at alum.mit.edu Sun Jan 29 14:44:31 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 29 Jan 2012 15:44:31 -0500 Subject: [Maxima] bug report In-Reply-To: <1327745273.46551.YahooMailNeo@web26503.mail.ukl.yahoo.com> References: <1327745273.46551.YahooMailNeo@web26503.mail.ukl.yahoo.com> Message-ID: Please send compact, reproducible bug reports. From what you've said, I see no evidence of a bug. Have you tried ? algsys and ? linsolve to see what these functions are *supposed* to do? In particular: ...`algsys' returns a *list* of solutions... The easiest way to show us what you did in a reproducible way is to turn display2d:true and then cut and paste the input/output stream, as below. Be sure to include all inputs. I've included some guesses about what confused you: (%i1) display2d:false; (%o1) false (%i2) algsys([x^2+1=y,x=y],[x,y]); (%o2) [[x = -(sqrt(3)*%i-1)/2,y = -(sqrt(3)*%i-1)/2], << note that this is a LIST of solutions [x = (sqrt(3)*%i+1)/2,y = (sqrt(3)*%i+1)/2]] << in general, non-linear equations have multiple solutions (%i3) part(%o2,1); (%o3) [x = -(sqrt(3)*%i-1)/2,y = -(sqrt(3)*%i-1)/2] (%i4) part(%,1); (%o4) x = -(sqrt(3)*%i-1)/2 (%i5) part(%,2); (%o5) -(sqrt(3)*%i-1)/2 (%i6) denom(%o5); (%o6) 2 << this is probably what you were looking for (%i7) num(%o5); (%o7) 1-sqrt(3)*%i (%i8) denom(%o4); << %o4 is an EQUATION, not an EXPRESSION (%o8) 1 << equations don't have denominators (arguably this could give an error message) -s On Sat, Jan 28, 2012 at 05:07, MOHAMMED ABOU ZIED < mohamedabouzied at yahoo.co.uk> wrote: > Dear All, > I want to report two bugs, > when I use algsys() function, the output list is recognized as a 1 element > list (which is worng). > This don't happen for the linsolve() function as the attachments reveal. > Another bug, after I took the outputs of linsolve() function "i don't know > if this also at algsysy() or not", i used denom() function, but it returned > 1 and when i take num() function, it return both numerator divided by the > denominator. > Yours, > Mohamed Abouzied > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun Jan 29 14:48:18 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 29 Jan 2012 15:48:18 -0500 Subject: [Maxima] Floating point problems In-Reply-To: References: Message-ID: I doubt this has anything to do with limits. Please try harder to produce *minimal reproducible* problem reports. As for factoring, it doesn't make sense to factor approximate numbers like 8.14, which cannot be represented exactly in binary floating-point. But if you insist, the factorization is: factor(rationalize(8.14)) => 5*6113*18740440949/2^46 -s On Sun, Jan 29, 2012 at 12:34, Andrew Davis wrote: > Hello all, > > While doing some homework, maxima return some incorrect limits. I traced > the problem back to the number -8.14. It is evaluated to -8.140000000001, > you can test this yourself by taking the limit of (-8.14+1) as x approaches > any number, or just evaluate 1-8.14. This happens on all clisp's and even > on http://calc.matthen.com/ , (evaluate -8.14). At first I thought it was > just rounding error on display and not internal stored like that, but take > a limit that uses -8.14 and you will have undefined results where it should > have a real limit ( because -8.14 can be factored in my problem but > -8.14000001 could not ). This is the only number I found that does that, > but I suspect more. > > Thank you. > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sun Jan 29 15:34:56 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 29 Jan 2012 14:34:56 -0700 Subject: [Maxima] [patch] 3D curve parametric plot In-Reply-To: References: Message-ID: I have committed & pushed this patch. Alexander, thanks for your help. Robert Dodier On 1/22/12, Alexander Klimov wrote: > Hi. > > It used to be possible to do 3D parametric curve plots with > > plot3d([sin(t), cos(t), t], [t,-5,5], [y,-5,5], [grid,100,2], > [gnuplot_pm3d,false])$ > > but in the current version it gives > > plot3d: wrong number of variables: [t]. There should be two > > The problem can be fixed with the attached patch. It would be nice if > it were committed to the mainline. It is also a good idea to document > the grid trick in plot3d documentation. > > -- > Regards, > ASK From robert.dodier at gmail.com Sun Jan 29 16:05:04 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 29 Jan 2012 15:05:04 -0700 Subject: [Maxima] cf documentation In-Reply-To: References: Message-ID: On 1/26/12, Stavros Macrakis wrote: > The 'cf' (continued fraction) documentation should mention that cf > expansions are exact for rational numbers, but are cut off at ratepsilon > (for floats) and 10^-fpprec (for bigfloats). I;ve revised the cf documentation to take that into account. What do you think? best Robert Dodier PS. -- Function: cf () Computes a continued fraction approximation. is an expression comprising continued fractions, square roots of integers, and literal real numbers (integers, rational numbers, ordinary floats, and bigfloats). `cf' computes exact expansions for rational numbers, but expansions are truncated at `ratepsilon' for ordinary floats and `10^(-fpprec)' for bigfloats. etc etc. (same as before) From glneolistmail at gmail.com Sun Jan 29 13:51:21 2012 From: glneolistmail at gmail.com (Andrew Davis) Date: Sun, 29 Jan 2012 14:51:21 -0500 Subject: [Maxima] Floating point problems In-Reply-To: <4F25861E.40602@gmail.com> References: <4F25861E.40602@gmail.com> Message-ID: I understand all that it is not exact > At first I thought it was just rounding error on display but why is it not held in memory symbolically so that it can be factored and manipulated correctly. Thank you. On Sun, Jan 29, 2012 at 12:47 PM, Raymond Toy wrote: > On 1/29/12 9:34 AM, Andrew Davis wrote: > > Hello all, > > > > While doing some homework, maxima return some incorrect limits. I traced > > the problem back to the number -8.14. It is evaluated to > > -8.140000000001, you can test this yourself by taking the limit of > > (-8.14+1) as x approaches any number, or just evaluate 1-8.14. This > > happens on all clisp's and even on http://calc.matthen.com/ , (evaluate > > -8.14). At first I thought it was just rounding error on display and > > not internal stored like that, but take a limit that uses -8.14 and you > > will have undefined results where it should have a real limit > > ( because -8.14 can be factored in my problem but -8.14000001 could not > > ). This is the only number I found that does that, but I suspect more. > > This, and questions like it, are becoming a FAQ. If you want exact > numbers, use exact numbers instead of floating-point. So use 814/100 > instead. 8.14 cannot be represented exactly as (binary) floating-point > number. In fact 8.14 differs from 814/100 by 1/1759218604441600. > > Also read "What Every Computer Scientist Should Know About > Floating-Point Arithmetic", by David Goldberg. Google will find > suitable versions. > > Ray > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun Jan 29 16:22:30 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 29 Jan 2012 17:22:30 -0500 Subject: [Maxima] cf documentation In-Reply-To: References: Message-ID: Revisions look good, thanks. -s On Sun, Jan 29, 2012 at 17:05, Robert Dodier wrote: > On 1/26/12, Stavros Macrakis wrote: > > > The 'cf' (continued fraction) documentation should mention that cf > > expansions are exact for rational numbers, but are cut off at ratepsilon > > (for floats) and 10^-fpprec (for bigfloats). > > I;ve revised the cf documentation to take that into account. > What do you think? > > best > > Robert Dodier > > PS. > > -- Function: cf () > Computes a continued fraction approximation. is an > expression comprising continued fractions, square roots of > integers, and literal real numbers (integers, rational numbers, > ordinary floats, and bigfloats). `cf' computes exact expansions > for rational numbers, but expansions are truncated at `ratepsilon' > for ordinary floats and `10^(-fpprec)' for bigfloats. > > etc etc. (same as before) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun Jan 29 16:26:54 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 29 Jan 2012 17:26:54 -0500 Subject: [Maxima] Floating point problems In-Reply-To: References: <4F25861E.40602@gmail.com> Message-ID: The Maxima convention (which is followed by most systems I know) is that numbers expressed with a decimal point are interpreted as floating-point numbers. It would of course be possible to change that decision, but the next question then would be what the output form of such objects is: if 0.8 is interpreted as 8/10 (= 4/5), should it be output as 0.8? 8/10? or 4/5? What is the output form of 0.8 + 1/10? How about 0.8 + 1/3? And how about 0.8 + 1/3 - 11/15? -s On Sun, Jan 29, 2012 at 14:51, Andrew Davis wrote: > I understand all that it is not exact > > At first I thought it was just rounding error on display > > but why is it not held in memory symbolically so that it can be > factored and manipulated correctly. > > Thank you. > > On Sun, Jan 29, 2012 at 12:47 PM, Raymond Toy wrote: > >> On 1/29/12 9:34 AM, Andrew Davis wrote: >> > Hello all, >> > >> > While doing some homework, maxima return some incorrect limits. I traced >> > the problem back to the number -8.14. It is evaluated to >> > -8.140000000001, you can test this yourself by taking the limit of >> > (-8.14+1) as x approaches any number, or just evaluate 1-8.14. This >> > happens on all clisp's and even on http://calc.matthen.com/ , (evaluate >> > -8.14). At first I thought it was just rounding error on display and >> > not internal stored like that, but take a limit that uses -8.14 and you >> > will have undefined results where it should have a real limit >> > ( because -8.14 can be factored in my problem but -8.14000001 could not >> > ). This is the only number I found that does that, but I suspect more. >> >> This, and questions like it, are becoming a FAQ. If you want exact >> numbers, use exact numbers instead of floating-point. So use 814/100 >> instead. 8.14 cannot be represented exactly as (binary) floating-point >> number. In fact 8.14 differs from 814/100 by 1/1759218604441600. >> >> Also read "What Every Computer Scientist Should Know About >> Floating-Point Arithmetic", by David Goldberg. Google will find >> suitable versions. >> >> Ray >> >> > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sun Jan 29 16:46:52 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 29 Jan 2012 14:46:52 -0800 Subject: [Maxima] Floating point problems In-Reply-To: References: <4F25861E.40602@gmail.com> Message-ID: <4F25CC5C.9000407@eecs.berkeley.edu> The simplest (but somewhat rude) answer to your question is that your idea of what is correct and what can be factored does not correspond to the generally accepted and more useful notions of what is correct and what can be factored. Factorization requires a unique factorization domain. Floating point numbers are not a UFD. Conventionally, typing 8.14 means you wish to use the internal (binary) floating-point representation. It is not possible to represent exactly 814/100 in binary. The number that is represented is exactly 572801577606185/70368744177664 which is what Stavros got from rationalize(8.14); and this can be interpreted as an element in a UFD and admits of factoring into (5*6113*18740440949)/2^46 exactly. I also recommend you read Goldberg's paper. Good luck. RJF On 1/29/2012 2:26 PM, Stavros Macrakis wrote: > The Maxima convention (which is followed by most systems I know) is > that numbers expressed with a decimal point are interpreted as > floating-point numbers. It would of course be possible to change that > decision, but the next question then would be what the output form of > such objects is: if 0.8 is interpreted as 8/10 (= 4/5), should it be > output as 0.8? 8/10? or 4/5? What is the output form of 0.8 + 1/10? > How about 0.8 + 1/3? And how about 0.8 + 1/3 - 11/15? > > -s > > > On Sun, Jan 29, 2012 at 14:51, Andrew Davis > wrote: > > I understand all that it is not exact > > At first I thought it was just rounding error on display > > but why is it not held in memory symbolically so that it can be > factored and manipulated correctly. > > Thank you. > > On Sun, Jan 29, 2012 at 12:47 PM, Raymond Toy > > wrote: > > On 1/29/12 9:34 AM, Andrew Davis wrote: > > Hello all, > > > > While doing some homework, maxima return some incorrect > limits. I traced > > the problem back to the number -8.14. It is evaluated to > > -8.140000000001, you can test this yourself by taking the > limit of > > (-8.14+1) as x approaches any number, or just evaluate > 1-8.14. This > > happens on all clisp's and even on http://calc.matthen.com/ > , (evaluate > > -8.14). At first I thought it was just rounding error on > display and > > not internal stored like that, but take a limit that uses > -8.14 and you > > will have undefined results where it should have a real limit > > ( because -8.14 can be factored in my problem but > -8.14000001 could not > > ). This is the only number I found that does that, but I > suspect more. > > This, and questions like it, are becoming a FAQ. If you want > exact > numbers, use exact numbers instead of floating-point. So use > 814/100 > instead. 8.14 cannot be represented exactly as (binary) > floating-point > number. In fact 8.14 differs from 814/100 by 1/1759218604441600. > > Also read "What Every Computer Scientist Should Know About > Floating-Point Arithmetic", by David Goldberg. Google will find > suitable versions. > > Ray > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From pbowyer at olynet.com Sun Jan 29 19:19:20 2012 From: pbowyer at olynet.com (Paul Bowyer) Date: Sun, 29 Jan 2012 17:19:20 -0800 Subject: [Maxima] Make check failures In-Reply-To: References: <4F1F1790.5040603@olynet.com> <4F1F3E0F.2040002@olynet.com> Message-ID: <4F25F018.8030903@olynet.com> On 01/24/2012 05:17 PM, Robert Dodier wrote: > On 1/24/12, Paul Bowyer wrote: > >> So far my lisp programming is to the point where I can write simple >> programs around CLX, but I haven't tried anything as advanced as maxima. >> I think it would be well beyond my abilities. >> >> If I discover anything in my stumblings with maxima, I'll post them, but >> don't hold your breath waiting... > OK, well, Maxima is a big, messy program but in some ways it is not > too terribly sophisticated. I think it's likely that you can readily > learn enough about Lisp& Maxima to make useful contributions. > > best, > > Robert Dodier > Robert: I tried updating CCL and rebuilding maxima, but it made no difference with the testsuite errors. The CCL maxima runtime still fails rtest15, problems 37, 193, and 196. build_info (); Maxima version: 5.26.0_26_gc4216e7 Maxima build date: 18:32 1/28/2012 Host type: i686-pc-linux-gnu Lisp implementation type: Clozure Common Lisp Lisp implementation version: Version 1.7-r15188M (LinuxX8632) (%i2) run_testsuite (display_all = true, tests=[rtest15]); ********************** Problem 37 *************** Input: 2 2 - %pi sin (3 a) sin (----- + a + b) 3 (----------------------------- 2 %pi sin (a - ---) 3 - %pi 2 sin(a) sin(3 a) cos(b) sin(----- + a + b) sin(3 a + 3 b) 3 - ---------------------------------------------------------- %pi sin(a - ---) sin(a + b) 3 2 2 sin (a) sin (3 a + 3 b) + -----------------------, result : trigrat(%%), 2 sin (a + b) expected : (- (- 9 + 10 cos(2 a) - 2 sqrt(3) sin(2 a) - cos(4 a) + sqrt(3) sin(4 a) + 10 cos(2 b) - 2 sqrt(3) sin(2 b) - cos(4 b) + sqrt(3) sin(4 b) - 4 cos(2 b - 2 a) - 8 cos(2 a + 2 b) + 4 sqrt(3) sin(2 a + 2 b) + 2 cos(4 a + 2 b) - 2 sqrt(3) sin(4 a + 2 b) + 2 cos(2 a + 4 b) - 2 sqrt(3) sin(2 a + 4 b) - cos(4 a + 4 b) + sqrt(3) sin(4 a + 4 b)))/4, ratsimp(result - expected)) Result: Polynomial quotient is not exact error-catch This differed from the expected result: 0 ********************** Problem 193 *************** Input: 2 t log(t) integrate(-----------------, t, 0, 1) 2 4 (t - 1) (1 + t ) Result: 2 (sqrt(2) - 2) %pi - ------------------ 32 This differed from the expected result: 2 (sqrt(2) - 1) %pi ------------------ 9/2 2 ********************** Problem 196 *************** Input: 1 factor(expand(sqrtdenest(integrate(------------, x, 0, 1)))) 1 4 - + (x - 3) 2 3/4 9/4 73 + sqrt(2) + 2 - 3 2 - factor((- (- log(----------------------------) 33 3/4 9/4 3/4 5/2 13/4 73 + sqrt(2) - 2 + 3 2 - 2 + 2 - 2 + log(----------------------------) + 2 atan(---------------------) 33 3/4 13/4 98 + 2 - 2 3/4 5/2 13/4 2 + 2 + 2 7/4 + 2 atan(-------------------)))/2 ) 3/4 13/4 - 98 + 2 - 2 Result: 13/4 5/2 3/4 13/4 5/2 3/4 2 + 2 + 2 - 2 + 2 - 2 (2 atan(-------------------) + 2 atan(---------------------) 13/4 3/4 13/4 3/4 - 2 + 2 - 98 - 2 + 2 + 98 9/4 3/4 9/4 3/4 3 2 - 2 + sqrt(2) + 73 - 3 2 + 2 + sqrt(2) + 73 + log(----------------------------) - log(------------------------------)) 33 33 9/4 3/4 7/4 3 2 - 2 + sqrt(2) + 73 /2 - (log(----------------------------) 33 9/4 3/4 - 3 2 + 2 + sqrt(2) + 73 - log(------------------------------) - 2 33 3/4 1/4 79 2 + 365 sqrt(2) + 877 2 + 5 atan(------------------------------------) 10657 3/4 1/4 - 79 2 + 365 sqrt(2) - 877 2 + 5 7/4 + 2 atan(--------------------------------------))/2 10657 This differed from the expected result: 0 I manually fed parts of problem 37 into xmaxima to see what happens: %i1) sin(a)^2*sin(3*b+3*a)^2/sin(b+a)^2 -2*sin(a)*sin(3*a)*cos(b)*sin(b+a-%pi/3)*sin(3*b+3*a) /(sin(a-%pi/3)*sin(b+a)) +sin(3*a)^2*sin(b+a-%pi/3)^2/sin(a-%pi/3)^2; and I got the following output: 2 2 sin (a) sin (3 b + 3 a) (%o1) ----------------------- 2 sin (b + a) %pi 2 sin(a) sin(3 a) cos(b) sin(b + a - ---) sin(3 b + 3 a) 3 - -------------------------------------------------------- %pi sin(a - ---) sin(b + a) 3 2 2 %pi sin (3 a) sin (b + a - ---) 3 + --------------------------- 2 %pi sin (a - ---) 3 (%i2) trace(ratexpand); (%o2) [ratexpand] (%i3) trigrat(%o1); 1 Enter ratexpand [%i b] 1 Exit ratexpand %i b 1 1 Enter ratexpand [-] 2 1 1 Exit ratexpand - 2 1 Enter ratexpand [%i a] 1 Exit ratexpand %i a <-- falls apart here Polynomial quotient is not exact I did the same for the cmucl runtime with xmaxima and it completed successfully: 1 Enter ratexpand [%i b] 1 Exit ratexpand %i b 1 1 Enter ratexpand [-] 2 1 1 Exit ratexpand - 2 1 Enter ratexpand [%i a] 1 Exit ratexpand %i a <-- completes successfully %i a 8 more output follows... I didn't go any further because I have difficulty following the lisp code in maxima. Maybe that will change as I spend more time trying to understand it. Paul Bowyer From toy.raymond at gmail.com Sun Jan 29 19:44:10 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 29 Jan 2012 17:44:10 -0800 Subject: [Maxima] Make check failures In-Reply-To: <4F25F018.8030903@olynet.com> References: <4F1F1790.5040603@olynet.com> <4F1F3E0F.2040002@olynet.com> <4F25F018.8030903@olynet.com> Message-ID: <4F25F5EA.6070304@gmail.com> On 1/29/12 5:19 PM, Paul Bowyer wrote: > On 01/24/2012 05:17 PM, Robert Dodier wrote: >> On 1/24/12, Paul Bowyer wrote: >> >>> So far my lisp programming is to the point where I can write simple >>> programs around CLX, but I haven't tried anything as advanced as maxima. >>> I think it would be well beyond my abilities. >>> >>> If I discover anything in my stumblings with maxima, I'll post them, but >>> don't hold your breath waiting... >> OK, well, Maxima is a big, messy program but in some ways it is not >> too terribly sophisticated. I think it's likely that you can readily >> learn enough about Lisp& Maxima to make useful contributions. >> >> best, >> >> Robert Dodier >> > Robert: > > I tried updating CCL and rebuilding maxima, but it made no difference > with the testsuite errors. The CCL maxima runtime still fails rtest15, > problems 37, 193, and 196. > > build_info (); > Maxima version: 5.26.0_26_gc4216e7 > Maxima build date: 18:32 1/28/2012 > Host type: i686-pc-linux-gnu > Lisp implementation type: Clozure Common Lisp > Lisp implementation version: Version 1.7-r15188M (LinuxX8632) I think Barton mentioned a little while ago that the errors only occur with the 32-bit version of CCL. Everything works fine with the 64-bit version. > > > Result: > Polynomial quotient is not exact Ugh. Of all the bugs to start with, this is probably one of the most difficult but also one with far reaching consequences. No one has found a case that was simple enough to debug and no one has figured out exactly how it all works. (I think.) If you're new, maybe this is not the place to begin. On the other hand, maybe a newbie can learn enough and has the right point of view to figure it all out. :-) That would be fantastic! Ray From toy.raymond at gmail.com Sun Jan 29 19:44:10 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 29 Jan 2012 17:44:10 -0800 Subject: [Maxima] Make check failures In-Reply-To: <4F25F018.8030903@olynet.com> References: <4F1F1790.5040603@olynet.com> <4F1F3E0F.2040002@olynet.com> <4F25F018.8030903@olynet.com> Message-ID: <4F25F5EA.6070304@gmail.com> On 1/29/12 5:19 PM, Paul Bowyer wrote: > On 01/24/2012 05:17 PM, Robert Dodier wrote: >> On 1/24/12, Paul Bowyer wrote: >> >>> So far my lisp programming is to the point where I can write simple >>> programs around CLX, but I haven't tried anything as advanced as maxima. >>> I think it would be well beyond my abilities. >>> >>> If I discover anything in my stumblings with maxima, I'll post them, but >>> don't hold your breath waiting... >> OK, well, Maxima is a big, messy program but in some ways it is not >> too terribly sophisticated. I think it's likely that you can readily >> learn enough about Lisp& Maxima to make useful contributions. >> >> best, >> >> Robert Dodier >> > Robert: > > I tried updating CCL and rebuilding maxima, but it made no difference > with the testsuite errors. The CCL maxima runtime still fails rtest15, > problems 37, 193, and 196. > > build_info (); > Maxima version: 5.26.0_26_gc4216e7 > Maxima build date: 18:32 1/28/2012 > Host type: i686-pc-linux-gnu > Lisp implementation type: Clozure Common Lisp > Lisp implementation version: Version 1.7-r15188M (LinuxX8632) I think Barton mentioned a little while ago that the errors only occur with the 32-bit version of CCL. Everything works fine with the 64-bit version. > > > Result: > Polynomial quotient is not exact Ugh. Of all the bugs to start with, this is probably one of the most difficult but also one with far reaching consequences. No one has found a case that was simple enough to debug and no one has figured out exactly how it all works. (I think.) If you're new, maybe this is not the place to begin. On the other hand, maybe a newbie can learn enough and has the right point of view to figure it all out. :-) That would be fantastic! Ray From macrakis at alum.mit.edu Sun Jan 29 20:19:07 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 29 Jan 2012 21:19:07 -0500 Subject: [Maxima] Floating point problems In-Reply-To: References: <4F25861E.40602@gmail.com> Message-ID: Just to continue on this theme, if you treat 0.8 as the exact number 4/5, then sin(0.8) can't be simplified or evaluated to an approximate result (0.717...), which seems to be what most users want.... -s On Sun, Jan 29, 2012 at 17:26, Stavros Macrakis wrote: > The Maxima convention (which is followed by most systems I know) is that > numbers expressed with a decimal point are interpreted as floating-point > numbers. It would of course be possible to change that decision, but the > next question then would be what the output form of such objects is: if 0.8 > is interpreted as 8/10 (= 4/5), should it be output as 0.8? 8/10? or 4/5? > What is the output form of 0.8 + 1/10? How about 0.8 + 1/3? And how > about 0.8 + 1/3 - 11/15? > > -s > > > On Sun, Jan 29, 2012 at 14:51, Andrew Davis wrote: > >> I understand all that it is not exact >> > At first I thought it was just rounding error on display >> >> but why is it not held in memory symbolically so that it can be >> factored and manipulated correctly. >> >> Thank you. >> >> On Sun, Jan 29, 2012 at 12:47 PM, Raymond Toy wrote: >> >>> On 1/29/12 9:34 AM, Andrew Davis wrote: >>> > Hello all, >>> > >>> > While doing some homework, maxima return some incorrect limits. I >>> traced >>> > the problem back to the number -8.14. It is evaluated to >>> > -8.140000000001, you can test this yourself by taking the limit of >>> > (-8.14+1) as x approaches any number, or just evaluate 1-8.14. This >>> > happens on all clisp's and even on http://calc.matthen.com/ , >>> (evaluate >>> > -8.14). At first I thought it was just rounding error on display and >>> > not internal stored like that, but take a limit that uses -8.14 and you >>> > will have undefined results where it should have a real limit >>> > ( because -8.14 can be factored in my problem but -8.14000001 could not >>> > ). This is the only number I found that does that, but I suspect more. >>> >>> This, and questions like it, are becoming a FAQ. If you want exact >>> numbers, use exact numbers instead of floating-point. So use 814/100 >>> instead. 8.14 cannot be represented exactly as (binary) floating-point >>> number. In fact 8.14 differs from 814/100 by 1/1759218604441600. >>> >>> Also read "What Every Computer Scientist Should Know About >>> Floating-Point Arithmetic", by David Goldberg. Google will find >>> suitable versions. >>> >>> Ray >>> >>> >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun Jan 29 21:02:31 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 29 Jan 2012 22:02:31 -0500 Subject: [Maxima] Floating point problems In-Reply-To: References: <4F25861E.40602@gmail.com> Message-ID: float(4/5) => .8 rat(.8) => 4/5 (within ratepsilon accuracy -- ratepsilon should be something like 2e-15) rationalize(.8) => 3602879701896397/4503599627370496 (2^n fraction) On Sun, Jan 29, 2012 at 21:45, Andrew Davis wrote: > Is there a standard way to convert between the two forms in memory then? > .8 <-> 4/5 , -8.14 <-> -814/100? > > > On Sun, Jan 29, 2012 at 9:19 PM, Stavros Macrakis wrote: > >> Just to continue on this theme, if you treat 0.8 as the exact number 4/5, >> then sin(0.8) can't be simplified or evaluated to an approximate result >> (0.717...), which seems to be what most users want.... >> >> -s >> >> On Sun, Jan 29, 2012 at 17:26, Stavros Macrakis wrote: >> >>> The Maxima convention (which is followed by most systems I know) is that >>> numbers expressed with a decimal point are interpreted as floating-point >>> numbers. It would of course be possible to change that decision, but the >>> next question then would be what the output form of such objects is: if 0.8 >>> is interpreted as 8/10 (= 4/5), should it be output as 0.8? 8/10? or 4/5? >>> What is the output form of 0.8 + 1/10? How about 0.8 + 1/3? And how >>> about 0.8 + 1/3 - 11/15? >>> >>> -s >>> >>> >>> On Sun, Jan 29, 2012 at 14:51, Andrew Davis wrote: >>> >>>> I understand all that it is not exact >>>> > At first I thought it was just rounding error on display >>>> >>>> but why is it not held in memory symbolically so that it can be >>>> factored and manipulated correctly. >>>> >>>> Thank you. >>>> >>>> On Sun, Jan 29, 2012 at 12:47 PM, Raymond Toy wrote: >>>> >>>>> On 1/29/12 9:34 AM, Andrew Davis wrote: >>>>> > Hello all, >>>>> > >>>>> > While doing some homework, maxima return some incorrect limits. I >>>>> traced >>>>> > the problem back to the number -8.14. It is evaluated to >>>>> > -8.140000000001, you can test this yourself by taking the limit of >>>>> > (-8.14+1) as x approaches any number, or just evaluate 1-8.14. This >>>>> > happens on all clisp's and even on http://calc.matthen.com/ , >>>>> (evaluate >>>>> > -8.14). At first I thought it was just rounding error on display and >>>>> > not internal stored like that, but take a limit that uses -8.14 and >>>>> you >>>>> > will have undefined results where it should have a real limit >>>>> > ( because -8.14 can be factored in my problem but -8.14000001 could >>>>> not >>>>> > ). This is the only number I found that does that, but I suspect >>>>> more. >>>>> >>>>> This, and questions like it, are becoming a FAQ. If you want exact >>>>> numbers, use exact numbers instead of floating-point. So use 814/100 >>>>> instead. 8.14 cannot be represented exactly as (binary) floating-point >>>>> number. In fact 8.14 differs from 814/100 by 1/1759218604441600. >>>>> >>>>> Also read "What Every Computer Scientist Should Know About >>>>> Floating-Point Arithmetic", by David Goldberg. Google will find >>>>> suitable versions. >>>>> >>>>> Ray >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Maxima mailing list >>>> Maxima at math.utexas.edu >>>> http://www.math.utexas.edu/mailman/listinfo/maxima >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From subiono2008 at matematika.its.ac.id Sun Jan 29 20:33:08 2012 From: subiono2008 at matematika.its.ac.id (subiono2008 at matematika.its.ac.id) Date: Mon, 30 Jan 2012 09:33:08 +0700 (WIT) Subject: [Maxima] How to calculate of a matrix p(A) In-Reply-To: References: Message-ID: <1664.10.112.250.187.1327890788.squirrel@webmail.its.ac.id> Dear all, I have a problem to calcute a matrix p(A) with p(x) is a polynomial of degree n with real koefficient and A is a matrix of size n time n. For an example: p(x)=x^2 +3x + 2 and then p(A)=A^2+3A+2I, with I is identity matrix of size 2 time 2. Thank you in advanced Subiono -- http://www.its.ac.id From willisb at unk.edu Sun Jan 29 21:46:12 2012 From: willisb at unk.edu (Barton Willis) Date: Sun, 29 Jan 2012 21:46:12 -0600 Subject: [Maxima] Make check failures In-Reply-To: <4F25F5EA.6070304@gmail.com> References: <4F25F5EA.6070304@gmail.com>, <4F1F1790.5040603@olynet.com> <4F1F3E0F.2040002@olynet.com> <4F25F018.8030903@olynet.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I think Barton mentioned a little while ago that the errors only occur >with the 32-bit version of CCL. ?Everything works fine with the 64-bit >version. Yes, I just re-checked this: no errors with 64 bit CCL (Version 1.7-r14925M), and with 32 bit CCL, rtest15.mac, problems (37 193 196) fail. And #37 is the pesky Polynomial quotient is not exact error. --Barton From willisb at unk.edu Sun Jan 29 21:52:37 2012 From: willisb at unk.edu (Barton Willis) Date: Sun, 29 Jan 2012 21:52:37 -0600 Subject: [Maxima] How to calculate of a matrix p(A) In-Reply-To: <1664.10.112.250.187.1327890788.squirrel@webmail.its.ac.id> References: <1664.10.112.250.187.1327890788.squirrel@webmail.its.ac.id>, Message-ID: Method I: (%i1) load(linearalgebra)$ (%i2) M : matrix([1,2],[3,4])$ (%i3) matrixfun(lambda([x], x^2+3*x+2),M); (%o3) matrix([12,16],[24,36]) Method II: (%i4) M.M+3*M+2*ident(2); (%o4) matrix([12,16],[24,36]) --Barton -----maxima-bounces at math.utexas.edu wrote: ----- To: maxima at math.utexas.edu From: subiono2008 at matematika.its.ac.id Sent by: maxima-bounces at math.utexas.edu Date: 01/29/2012 09:15PM Subject: [Maxima] How to calculate of a matrix p(A) Dear all, I have a problem to calcute a matrix p(A) with p(x) is a polynomial of degree n with real koefficient and A is a matrix of size n time n. For ?an example: p(x)=x^2 +3x + 2 and then p(A)=A^2+3A+2I, with I is identity matrix of size 2 time 2. Thank you in advanced Subiono -- http://www.its.ac.id? _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From willisb at unk.edu Sun Jan 29 22:18:26 2012 From: willisb at unk.edu (Barton Willis) Date: Sun, 29 Jan 2012 22:18:26 -0600 Subject: [Maxima] Make check failures In-Reply-To: References: , <4F25F5EA.6070304@gmail.com>, <4F1F1790.5040603@olynet.com> <4F1F3E0F.2040002@olynet.com> <4F25F018.8030903@olynet.com> Message-ID: The trigrat function locally sets gcd to subres. Changing to spmod at least eliminates the "polynomial not...." error in 32 bit CCL. --bw ----maxima-bounces at math.utexas.edu wrote: ----- From toy.raymond at gmail.com Sun Jan 29 23:19:18 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 29 Jan 2012 21:19:18 -0800 Subject: [Maxima] bigfloat eigenvalues In-Reply-To: <4F2573ED.8080601@eecs.berkeley.edu> References: <4F2573ED.8080601@eecs.berkeley.edu> Message-ID: <4F262856.70004@gmail.com> On 1/29/12 8:29 AM, Richard Fateman wrote: > I re-worked the program from lapack/ eispack "bisect" which > computes eigenvalues of a symmetric tridiagonal matrix (STM) so that > it runs in bigfloat arithmetic. it is in > http://www.cs.berkeley.edu/~fateman/lisp/bfbisect.lisp > and appears to be happy in GCL. testing it in your favorite version of > maxima > would require loading that file (optionally compiling), and running > ?test(); Here is another version using maxima bigfloat class. Probably slower than what Richard has done, but it's a bit simpler, and also closer to the original f2cl version. Needs some work to be nice with maxima, but the simple test appears to work. Just load (or compile and load) this into maxima. Ray -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: bisect.lisp URL: From toy.raymond at gmail.com Sun Jan 29 23:19:18 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 29 Jan 2012 21:19:18 -0800 Subject: [Maxima] bigfloat eigenvalues In-Reply-To: <4F2573ED.8080601@eecs.berkeley.edu> References: <4F2573ED.8080601@eecs.berkeley.edu> Message-ID: <4F262856.70004@gmail.com> On 1/29/12 8:29 AM, Richard Fateman wrote: > I re-worked the program from lapack/ eispack "bisect" which > computes eigenvalues of a symmetric tridiagonal matrix (STM) so that > it runs in bigfloat arithmetic. it is in > http://www.cs.berkeley.edu/~fateman/lisp/bfbisect.lisp > and appears to be happy in GCL. testing it in your favorite version of > maxima > would require loading that file (optionally compiling), and running > ?test(); Here is another version using maxima bigfloat class. Probably slower than what Richard has done, but it's a bit simpler, and also closer to the original f2cl version. Needs some work to be nice with maxima, but the simple test appears to work. Just load (or compile and load) this into maxima. Ray -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: bisect.lisp URL: From villate at fe.up.pt Mon Jan 30 04:02:09 2012 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 30 Jan 2012 10:02:09 +0000 Subject: [Maxima] How to calculate of a matrix p(A) In-Reply-To: <1664.10.112.250.187.1327890788.squirrel@webmail.its.ac.id> References: <1664.10.112.250.187.1327890788.squirrel@webmail.its.ac.id> Message-ID: <4F266AA1.8020402@fe.up.pt> On 01/30/2012 02:33 AM, subiono2008 at matematika.its.ac.id wrote: > I have a problem to calcute a matrix p(A) with > p(x) is a polynomial of degree n with real koefficient > and A is a matrix of size n time n. For an example: > p(x)=x^2 +3x + 2 and then > p(A)=A^2+3A+2I, with I is identity matrix of size 2 time 2. 3A should be written as 3*A and for matrices A? must be written as A^^2 Regards, Jaime -------------- next part -------------- An HTML attachment was scrubbed... URL: From glneolistmail at gmail.com Sun Jan 29 20:45:29 2012 From: glneolistmail at gmail.com (Andrew Davis) Date: Sun, 29 Jan 2012 21:45:29 -0500 Subject: [Maxima] Floating point problems In-Reply-To: References: <4F25861E.40602@gmail.com> Message-ID: Is there a standard way to convert between the two forms in memory then? .8 <-> 4/5 , -8.14 <-> -814/100? On Sun, Jan 29, 2012 at 9:19 PM, Stavros Macrakis wrote: > Just to continue on this theme, if you treat 0.8 as the exact number 4/5, > then sin(0.8) can't be simplified or evaluated to an approximate result > (0.717...), which seems to be what most users want.... > > -s > > On Sun, Jan 29, 2012 at 17:26, Stavros Macrakis wrote: > >> The Maxima convention (which is followed by most systems I know) is that >> numbers expressed with a decimal point are interpreted as floating-point >> numbers. It would of course be possible to change that decision, but the >> next question then would be what the output form of such objects is: if 0.8 >> is interpreted as 8/10 (= 4/5), should it be output as 0.8? 8/10? or 4/5? >> What is the output form of 0.8 + 1/10? How about 0.8 + 1/3? And how >> about 0.8 + 1/3 - 11/15? >> >> -s >> >> >> On Sun, Jan 29, 2012 at 14:51, Andrew Davis wrote: >> >>> I understand all that it is not exact >>> > At first I thought it was just rounding error on display >>> >>> but why is it not held in memory symbolically so that it can be >>> factored and manipulated correctly. >>> >>> Thank you. >>> >>> On Sun, Jan 29, 2012 at 12:47 PM, Raymond Toy wrote: >>> >>>> On 1/29/12 9:34 AM, Andrew Davis wrote: >>>> > Hello all, >>>> > >>>> > While doing some homework, maxima return some incorrect limits. I >>>> traced >>>> > the problem back to the number -8.14. It is evaluated to >>>> > -8.140000000001, you can test this yourself by taking the limit of >>>> > (-8.14+1) as x approaches any number, or just evaluate 1-8.14. This >>>> > happens on all clisp's and even on http://calc.matthen.com/ , >>>> (evaluate >>>> > -8.14). At first I thought it was just rounding error on display and >>>> > not internal stored like that, but take a limit that uses -8.14 and >>>> you >>>> > will have undefined results where it should have a real limit >>>> > ( because -8.14 can be factored in my problem but -8.14000001 could >>>> not >>>> > ). This is the only number I found that does that, but I suspect more. >>>> >>>> This, and questions like it, are becoming a FAQ. If you want exact >>>> numbers, use exact numbers instead of floating-point. So use 814/100 >>>> instead. 8.14 cannot be represented exactly as (binary) floating-point >>>> number. In fact 8.14 differs from 814/100 by 1/1759218604441600. >>>> >>>> Also read "What Every Computer Scientist Should Know About >>>> Floating-Point Arithmetic", by David Goldberg. Google will find >>>> suitable versions. >>>> >>>> Ray >>>> >>>> >>> >>> _______________________________________________ >>> Maxima mailing list >>> Maxima at math.utexas.edu >>> http://www.math.utexas.edu/mailman/listinfo/maxima >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From duke at eml.cc Mon Jan 30 08:22:47 2012 From: duke at eml.cc (marmaduke) Date: Mon, 30 Jan 2012 15:22:47 +0100 Subject: [Maxima] integration limit swap? Message-ID: <1327933367.19342.140661029779825@webmail.messagingengine.com> Hi I was trying to compute the integral integrate(f, x, a, b) where a is greater than b, and the result was wrong until I manually switch the limits and changed the change of the integral, so my question is, does Maxima automatically swap the limits of integration if the lower limit is greater than the positive limit? details of the integral: f: w*cos(p)/2 - 1; integrate(1/f, p, %pi, phi); Thanks, Marmaduke From fateman at eecs.berkeley.edu Mon Jan 30 09:08:15 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 30 Jan 2012 07:08:15 -0800 Subject: [Maxima] Floating point problems In-Reply-To: References: <4F25861E.40602@gmail.com> Message-ID: <4F26B25F.2010005@eecs.berkeley.edu> On 1/29/2012 6:45 PM, Andrew Davis wrote: > Is there a standard way to convert between the two forms in memory > then? .8 <-> 4/5 , -8.14 <-> -814/100? rationalize(x) gets the EXACT rational equivalent. ratdisrep(rat(x)) gets an approximation, depending on ratepsilon. Read the manual. From wilhelm.haager at htlstp.ac.at Mon Jan 30 09:55:15 2012 From: wilhelm.haager at htlstp.ac.at (Wilhelm Haager) Date: Mon, 30 Jan 2012 16:55:15 +0100 Subject: [Maxima] Function returning the version number In-Reply-To: References: Message-ID: <775d3aa288cec7e6741d67094362584d@localhost> On Sat, 28 Jan 2012 13:05:01 -0700, Robert Dodier wrote: > I think that making a program dependent on the Maxima version > number generally indicates that something has gone wrong; > I would avoid it if possible. > > That said, I have a patch laying around to rework build_info > so that it returns a Maxima structure (as defined by defstruct) > which makes it easy to extract the bits of the build info. > > With this patch I get: > > (%i2) x : build_info (); > (%o2) > Maxima version: 5.26.0_16_gb72c64c_dirty > Maxima build date: 2012-01-11 00:01:25 > Host type: i686-pc-linux-gnu > Lisp implementation type: CMU Common Lisp > Lisp implementation version: CVS release-19a 19a-release-20040728 + > minimal debian patches > (%i3) x at version; > (%o3) 5.26.0_16_gb72c64c_dirty > (%i4) x at timestamp; > (%o4) 2012-01-11 00:01:25 > (%i5) x at host; > (%o5) i686-pc-linux-gnu > (%i6) x at lisp_name; > (%o6) CMU Common Lisp > (%i7) x at lisp_version; > (%o7) CVS release-19a 19a-release-20040728 + minimal debian patches > > > Note that the patch includes a display function so that the > return value of build_info is displayed just as build_info now > displays the build info. > > I'll commit this unless someone thinks it's a bad idea. > > best > > Robert Dodier Thank you very much for your answer. On principle, it is favourable to avoid version-dependencies in programs. But some optional parameters of the package "draw" have changed recently (I think from the Maxima version 5.22 to 5.23), eg. the options "pic_width" and "pic_height" have changed to "dimensions". When a package makes use of those options (as the control engineering package COMA does), the version dependent treatment seems useful. The actual Maxima version included in Ubuntu is still version 5.20, in Windows we have 5.25; it's convenient to maintain only one package for all versions. Best regards Wilhelm Haager From biomates at telefonica.net Mon Jan 30 11:08:49 2012 From: biomates at telefonica.net (Mario Rodriguez) Date: Mon, 30 Jan 2012 18:08:49 +0100 Subject: [Maxima] Function returning the version number In-Reply-To: <775d3aa288cec7e6741d67094362584d@localhost> References: <775d3aa288cec7e6741d67094362584d@localhost> Message-ID: <1327943329.1897.10.camel@pc> > But some optional parameters of the package "draw" have changed > recently (I think from the > Maxima version 5.22 to 5.23), eg. the options "pic_width" and > "pic_height" have changed to "dimensions". > When a package makes use of those options (as the control engineering > package COMA does), > the version dependent treatment seems useful. When these changes were made, the version number of draw changed to '2'. (%i1) load(draw)$ (%i2) get(draw, version); (%o2) 2 With older Maxima versions, 'get' gives 1. Perhaps you can make use of this fact. -- Mario From toy.raymond at gmail.com Mon Jan 30 11:24:26 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 30 Jan 2012 09:24:26 -0800 Subject: [Maxima] integration limit swap? In-Reply-To: <1327933367.19342.140661029779825@webmail.messagingengine.com> References: <1327933367.19342.140661029779825@webmail.messagingengine.com> Message-ID: On Mon, Jan 30, 2012 at 6:22 AM, marmaduke wrote: > Hi > > I was trying to compute the integral > > integrate(f, x, a, b) > > where a is greater than b, and the result was wrong until I manually > switch the limits and changed the change of the integral, so my question > is, does Maxima automatically swap the limits of integration if the lower > limit is greater than the positive limit? > No, maxima doesn't swap limits: integrate(1,x,5,0) -> -5 > > details of the integral: > > f: w*cos(p)/2 - 1; > integrate(1/f, p, %pi, phi); > > > Maxima asks me a few questions. How did you answer them? What result did you get and what were you expecting? Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Mon Jan 30 14:12:43 2012 From: woollett at charter.net (Edwin Woollett) Date: Mon, 30 Jan 2012 12:12:43 -0800 Subject: [Maxima] applying a set of conditions for first order ord. diff. eqn. References: <4F240F1A.8090105@orange.fr> Message-ID: <22424BE52EE9480F92047C215433C652@edwinc367e16bd> Hi Jerome, Thanks for the kind comments. I don't think you can use ic2 for this type of first order ordinary differential equation, as you suggest in your pdf file description of this problem. Instead you can use ic1 to evaluate something unknown in your equation, and then use solve to satisfy the rest of the conditions. =================== Your differential equation can be written as du/dz - a u + b = 0, where the three conditions are: u = 0 when z = +/- 1, and integrate(u,z,-1,1) = 2, (a global condition rather than local) and a and b are constants. We can simplify this differential equation by dividing by a and letting r = b/a and x = a z, so u = 0 when x = +/- a. (I use r rather than c because ic1 uses %c as a constant of integration, and one can get confused.) We then have to solve du/dx - u + r = 0, subject first to u = 0 at x = +/- a. After applying these two conditions, to find a and r, we can replace x --> a z and apply the integral condition as written above. -------------------------------- Maxima 5.26.0 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) display2d:false$ (%i2) de : 'diff (u,x) - u + r = 0; (%o2) 'diff (u,x,1) - u + r = 0 (%i3) gsoln : ode2 (de, u, x); (%o3) u = (r*%e^-x+%c)*%e^x (%i4) psoln : ic1(gsoln, x = -a, u = 0); (%o4) u = r - r*%e^(x + a) (%i5) us : rhs (psoln); (%o5) r - r*%e^(x + a) (%i6) solve (subst (x = a, us), a); (%o6) [a = log (-1), a = 0] /* We don't want a = 0, so I looked at the float of log(-1) to guess what it can be replaced by */ (%i7) map ('float, [log (-1), %i*%pi]); (%o7) [3.141592653589793*%i, 3.141592653589793*%i] (%i8) us : subst (a = %i*%pi, us); (%o8) r*%e^x + r (%i9) us : subst (x = %i*%pi*z, us); (%o9) r*%e^(%i*%pi*z) + r (%i10) solve (integrate (us, z, -1, 1) = 2, r); (%o10) [r = 1] (%i11) us : subst (r = 1, us); (%o11) %e^(%i*%pi*z) + 1 ------------------------------ Hope this approach is helpful as a start. Ted Woollett ====================== ----- Original Message ----- From: Laboratoire.Vulcain To: woollett at charter.net Sent: Saturday, January 28, 2012 7:07 AM Subject: maxima feedback from Mr Jerome Huck Dear Professor, this email to thank you for your Maxima by Example. I am a seniro aerospace engineer and scientist. I used more supercomputers to make calculations in the CFD area. I am reading one old book on MHD and I tried to use Maxima to find analytical solutions. I read the documentation and your Maxima by Example. I have some troubles with hyperbolic functions or the simplification of those functions. I attached my example. I will enjoy to have your point of view on my questions. Thanks in advance. Best regards. Jerome Huck. From woollett at charter.net Mon Jan 30 14:28:27 2012 From: woollett at charter.net (Edwin Woollett) Date: Mon, 30 Jan 2012 12:28:27 -0800 Subject: [Maxima] applying a set of conditions for first order ord. diff. eqn. Message-ID: <58C0DD26253B4340B3A4B652A8238CE2@edwinc367e16bd> On Jan. 30, 2012, I wrote: ------------------- >After applying these two conditions, to >find a and r, we can >replace x --> a z and apply the integral >condition as written above. ------------------------------ should have been : " to find two of the three constants, a, r, and %c returned by ic1, we can replace...." Ted From robert.dodier at gmail.com Tue Jan 31 10:17:48 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 31 Jan 2012 09:17:48 -0700 Subject: [Maxima] Extending assignment Was: Functions with any number of arguments In-Reply-To: References: Message-ID: On 1/19/12, Alexander Klimov wrote: > On Sun, 15 Jan 2012, Aleksas Domarkas wrote: >> How in Maxima define functions with any number of arguments ? >> >> For example, i need function MIN(arg1,arg2, ...) >> MIN(2) => 2 >> MIN(3,4) =>3 >> MIN(2/3,1/2,sqrt(2)/2) => 1/2 > > MIN([args]) := block([m:first(args)], > for i in rest(args) do m:min(m,i), > m); >> Other example. How define G with following properties: >> G(n) => gamma(n) >> G(5) => 24 >> G(a, x) => gamma_incomplete (a, x) >> G(a, z1, z2) => gamma_incomplete_generalized (a, z1, z2) > > Use "length(args)" and "if then elseif ..." Another approach is to use the simplification system. A rule is defined for each case of interest. Creating new rules doesn't require touching existing ones. e.g. matchdeclare ([aa, xx, yy], all); tellsimp (G (xx), gamma (xx)); tellsimp (G (aa, xx), gamma_incomplete (aa, xx)); tellsimp (G (aa, xx, yy), gamma_incomplete_generalized (aa, xx, yy)); G (5); => 24 G (u, 5); => gamma_incomplete(u, 5) G (u, %e, %pi + 1); => gamma_incomplete_generalized(u, %e, %pi + 1) For better or worse that approach doesn't really work for functions with arbitrary numbers of arguments. User-defined rules can only be applied to functions with a stated number of arguments (except for "+" and "*"). So you would have to make up rules for MIN(xx), MIN(xx, yy), MIN(xx, yy, zz), etc etc. I have often thought about extending the rule system to handle general n-ary functions but never got around to it. One of these days! best Robert Dodier From renzodelfabbro at alice.it Tue Jan 31 10:56:40 2012 From: renzodelfabbro at alice.it (Renzo Del Fabbro) Date: Tue, 31 Jan 2012 16:56:40 +0000 (UTC) Subject: [Maxima] wxplot2d Message-ID: I'm trying to plot a function from t=0 to 8 microsecond wxplot2d([rhs(s[1])],[t,0,8e-6],[legend,"v(t)","i(t)"], [gnuplot_preamble,"set grid"],[xlabel,"t / us"]); How can I plot a microsecond x scale to avoid x.-e006 exponential format? Thanks Renzo From villate at fe.up.pt Tue Jan 31 11:15:07 2012 From: villate at fe.up.pt (Jaime Villate) Date: Tue, 31 Jan 2012 17:15:07 +0000 Subject: [Maxima] wxplot2d In-Reply-To: References: Message-ID: <4F28219B.6020302@fe.up.pt> On 01/31/2012 04:56 PM, Renzo Del Fabbro wrote: > wxplot2d([rhs(s[1])],[t,0,8e-6],[legend,"v(t)","i(t)"], > [gnuplot_preamble,"set grid"],[xlabel,"t / us"]); > > How can I plot a microsecond x scale to avoid x.-e006 exponential format? Hi, without knowing how s[1] was defined it's hard to answer, but I'd guess you should replace any ocurrences of t by t*1e-6 and then use the interval [t, 0, 8] instead of [t, 0, 8e-6]. Regards, Jaime From renzodelfabbro at alice.it Tue Jan 31 11:46:52 2012 From: renzodelfabbro at alice.it (Renzo Del Fabbro) Date: Tue, 31 Jan 2012 17:46:52 +0000 (UTC) Subject: [Maxima] wxplot2d References: <4F28219B.6020302@fe.up.pt> Message-ID: Jaime Villate fe.up.pt> writes: > without knowing how s[1] was defined it's hard to answer, but I'd guess > you should replace any ocurrences of t by t*1e-6 and then use the interval > [t, 0, 8] instead of [t, 0, 8e-6]. Thanks Jaime, my inputs are -------------------------------------- eq_1:'diff(v(t),t)=-i(t)/C-v(t)/(R*C)$ eq_2:'diff(i(t),t)=-i(t)*R/L+v(t)/L$ [R,L,C,v0,i0]:[2,1e-6,1e-6,20,10] $ atvalue(v(t),t=0,v0) $ atvalue(i(t),t=0,i0) $ s:desolve([eq_1,eq_2],[v(t),i(t)]),expand,numer; wxplot2d([rhs(s[1])],[t,0,8e-6],[legend,"v(t)","i(t)"], [gnuplot_preamble,"set grid"],[xlabel,"t / us"]); -------------------------------------- and I'd like to know if there was a way to modify just wxplot2d parameters. Regards Renzo From villate at fe.up.pt Tue Jan 31 13:58:43 2012 From: villate at fe.up.pt (Jaime Villate) Date: Tue, 31 Jan 2012 19:58:43 +0000 Subject: [Maxima] wxplot2d In-Reply-To: References: <4F28219B.6020302@fe.up.pt> Message-ID: <4F2847F3.9070304@fe.up.pt> On 01/31/2012 05:46 PM, Renzo Del Fabbro wrote: > my inputs are > -------------------------------------- > > eq_1:'diff(v(t),t)=-i(t)/C-v(t)/(R*C)$ > eq_2:'diff(i(t),t)=-i(t)*R/L+v(t)/L$ > [R,L,C,v0,i0]:[2,1e-6,1e-6,20,10] $ > atvalue(v(t),t=0,v0) $ > atvalue(i(t),t=0,i0) $ > s:desolve([eq_1,eq_2],[v(t),i(t)]),expand,numer; > > wxplot2d([rhs(s[1])],[t,0,8e-6],[legend,"v(t)","i(t)"], > [gnuplot_preamble,"set grid"],[xlabel,"t / us"]); > > -------------------------------------- > > and I'd like to know if there was a way to modify just wxplot2d parameters. OK, I do not how to make gnuplot change the values displayed in the axes but I still think that it is a more elegant solution to work with ?s from the begining: eq_1:'diff(v(t),t)=-i(t)/C-v(t)/(R*C)$ eq_2:'diff(i(t),t)=-i(t)*R/L+v(t)/L$ [R,L,C, v0,i0]:[2,1,1,20,10] $ atvalue(v(t),t=0,v0) $ atvalue(i(t),t=0,i0) $ s:desolve([eq_1,eq_2],[v(t),i(t)]),expand,numer; plot2d([rhs(s[1])],[t,0,8],[legend,"v(t)","i(t)"], [gnuplot_preamble,"set grid"],[xlabel,"t / us"]); Since RC and L/R both have units of time, if you measure capacitance in ?F, inductances in ?H and resistances in Ohms, the unit that will be implicitly used for time is ?s. Regards, Jaime From gwpublic at wp.pl Tue Jan 31 15:58:49 2012 From: gwpublic at wp.pl (gwpublic at wp.pl) Date: Tue, 31 Jan 2012 22:58:49 +0100 Subject: [Maxima] references to methods, algorithms behind lsquares Message-ID: Hello, I'd like to reference to works related with : * lsquares * fmin_cobyla while in Manual fmin_cobyla is well referenced: http://maxima.sourceforge.net/docs/manual/de/maxima_37.html For lsquares there are no such nice references: http://maxima.sourceforge.net/docs/manual/en/maxima_65.html#SEC304 I'd like to cite in my thesis to works behind lsquares, as I use it (to be more specific: lsquares_estimates , lsquares_mse ). One more issue : What's are best terms for lsquares ? I'd like to call it somehow, I am curious about recommendations for "terms" describing lqaures, like : Optimization Search Routine ? Optimisation in Symbolic Mathematics ? Data fitting of parametrised symbolic mathematics ? Best regards, Grzegorz Wierzowiecki From renzodelfabbro at alice.it Tue Jan 31 16:19:03 2012 From: renzodelfabbro at alice.it (Renzo Del Fabbro) Date: Tue, 31 Jan 2012 22:19:03 +0000 (UTC) Subject: [Maxima] wxplot2d References: <4F28219B.6020302@fe.up.pt> <4F2847F3.9070304@fe.up.pt> Message-ID: Jaime Villate fe.up.pt> writes: > Since RC and L/R both have units of time, if you measure capacitance in > ?F, inductances > in ?H and resistances in Ohms, the unit that will be implicitly used for > time is ?s. > Thank you very much Jaime. Ciao from Italy Renzo From willisb at unk.edu Tue Jan 31 19:12:08 2012 From: willisb at unk.edu (Barton Willis) Date: Tue, 31 Jan 2012 19:12:08 -0600 Subject: [Maxima] sqrt(1-x^2)/(2-2*x^2) --/--> 1/(2*sqrt(1-x^2)) In-Reply-To: References: , <4F28219B.6020302@fe.up.pt> <4F2847F3.9070304@fe.up.pt> Message-ID: The general simplifier does sqrt(1-x^2)/(1-x^2) --> 1/sqrt(1-x^2), but it doesn't simplify sqrt(1-x^2)/(2-2*x^2) to 1/(2*sqrt(1-x^2)). Ratsimp, radcan, and rootscontract don't do this simplification either. --Barton From macrakis at alum.mit.edu Tue Jan 31 19:37:56 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 31 Jan 2012 20:37:56 -0500 Subject: [Maxima] sqrt(1-x^2)/(2-2*x^2) --/--> 1/(2*sqrt(1-x^2)) In-Reply-To: References: <4F28219B.6020302@fe.up.pt> <4F2847F3.9070304@fe.up.pt> Message-ID: That's annoying. A workaround (not a solution) is 1/gfactor(1/expr). On Tue, Jan 31, 2012 at 20:12, Barton Willis wrote: > sqrt(1-x^2)/(2-2*x^2) -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Jan 31 21:09:52 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 31 Jan 2012 22:09:52 -0500 Subject: [Maxima] sqrt(1-x^2)/(2-2*x^2) --/--> 1/(2*sqrt(1-x^2)) In-Reply-To: References: <4F28219B.6020302@fe.up.pt> <4F2847F3.9070304@fe.up.pt> Message-ID: An even simpler related problem: How do I get sqrt(1-x^2) to be expressed as sqrt(1-x)*sqrt(x+1) or even %i*sqrt(x-1)*sqrt(x+1)? All three are simplified according to the general simplifier, but I can't seem to find some combination of factor, gfactor, scanmap, etc. that will get me from the first version to the others.... -s On Tue, Jan 31, 2012 at 20:37, Stavros Macrakis wrote: > That's annoying. A workaround (not a solution) is 1/gfactor(1/expr). > > On Tue, Jan 31, 2012 at 20:12, Barton Willis wrote: > >> sqrt(1-x^2)/(2-2*x^2) > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Wed Feb 1 00:54:50 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 31 Jan 2012 23:54:50 -0700 Subject: [Maxima] references to methods, algorithms behind lsquares In-Reply-To: References: Message-ID: On 1/31/12, gwpublic at wp.pl wrote: > For lsquares there are no such nice references: > http://maxima.sourceforge.net/docs/manual/en/maxima_65.html#SEC304 > > I'd like to cite in my thesis to works behind lsquares, as I use it > (to be more specific: lsquares_estimates , lsquares_mse ). Well, lsquares_estimates tries to find an exact minimum of the mean square error, via the Maxima function "solve". If solve cannot find a solution, then lsquares_estimates tries to find an approximate minimum, via the function "lbfgs", which is an implementation of the LBFGS algorithm, which is a limited-memory BFGS (quasi-Newton) algorithm. "?? lbfgs" finds some info in the reference manual. > One more issue : What's are best terms for lsquares ? > > I'd like to call it somehow, I am curious about recommendations for > "terms" describing lqaures, like : > Optimization Search Routine ? > Optimisation in Symbolic Mathematics ? > Data fitting of parametrised symbolic mathematics ? I think it's what's commonly called "estimation" or more specifically "least squares estimation". best, Robert Dodier From aleksasd873 at gmail.com Wed Feb 1 02:36:29 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Wed, 1 Feb 2012 10:36:29 +0200 Subject: [Maxima] sqrt(1-x^2)/(2-2*x^2) --/--> 1/(2*sqrt(1-x^2)) Message-ID: Barton Willis willisb at unk.edu Tue Jan 31 19:12:08 CST 2012 The general simplifier does sqrt(1-x^2)/(1-x^2) --> 1/sqrt(1-x^2), but it doesn't simplify sqrt(1-x^2)/(2-2*x^2) to 1/(2*sqrt(1-x^2)). Ratsimp, radcan, and rootscontract don't do this simplification either. --Barton ***************************************************************************************** (%i1) S:sqrt(1-x^2)/(2-2*x^2)$ (%i2) subst(2-2*x^2=2*(1-x^2),S); (%o2) 1/(2*sqrt(1-x^2)) Aleksas -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Wed Feb 1 04:40:28 2012 From: willisb at unk.edu (Barton Willis) Date: Wed, 1 Feb 2012 04:40:28 -0600 Subject: [Maxima] sqrt(1-x^2)/(2-2*x^2) --/--> 1/(2*sqrt(1-x^2)) In-Reply-To: References: , <4F28219B.6020302@fe.up.pt> <4F2847F3.9070304@fe.up.pt> Message-ID: Maxima calls inte to do integrate((sqrt(1-x^2)*(x^2+1))/(2-2*x^2),x,0,1). If I recall, inte is one of the last functions integrate tries. Some other method (not sure which one) handles integrate((x^2+1)/(2*sqrt(1-x^2)),x,0,1). integrate((sqrt(1-x^2)*(x^2+1))/(2-2*x^2),x,0,1) is in the testsuite. --Barton From aleksasd873 at gmail.com Wed Feb 1 06:04:33 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Wed, 1 Feb 2012 14:04:33 +0200 Subject: [Maxima] integrate bug Message-ID: Integrate bug: (%i1) integrate(acos((x-1/2)/sqrt(1-x^2)), x, 0, 1/2); (%o1) -%pi/4 (%i2) float(%), numer; (%o2) -0.78539816339745 (%i3) quad_qags(acos((x-1/2)/sqrt(1-x^2)), x, 0, 1/2); (%o3) [0.9161228399914,1.0171006703434392*10^-14,21,0] Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Wed Feb 1 06:48:48 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Wed, 01 Feb 2012 12:48:48 +0000 Subject: [Maxima] Please sign up to the mailing list References: Message-ID: Dear Aleksas, I sent a private message to you a month or so ago. At the moment, your emails are getting held in the moderation queue until someone approves them. I'm sure you'd like your emails to get through in a timely fashion. I'm also sure that I'd rather not approve them quite so often. The solution to both problems is to sign up to the mailing list. If you don't want mail delivery (because you use GMane or the like), you can turn it off. Also, words and sentences in emails are always nice. But that's a different problem. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From villate at fe.up.pt Wed Feb 1 07:05:49 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 01 Feb 2012 13:05:49 +0000 Subject: [Maxima] integrate bug In-Reply-To: References: Message-ID: <4F2938AD.8040504@fe.up.pt> On 02/01/2012 12:04 PM, Aleksas Domarkas wrote: > Integrate bug: > > (%i1) integrate(acos((x-1/2)/sqrt(1-x^2)), x, 0, 1/2); > (%o1) -%pi/4 > (%i2) float(%), numer; > (%o2) -0.78539816339745 > > (%i3) quad_qags(acos((x-1/2)/sqrt(1-x^2)), x, 0, 1/2); > (%o3) [0.9161228399914,1.0171006703434392*10^-14,21,0] And: (%i2) integrate (acos ((x-1/2)/sqrt (1-x^2)), x); (%o2) -%pi*x/2 which is obviously wrong. Jaime From renekaelin at gmx.ch Wed Feb 1 07:14:14 2012 From: renekaelin at gmx.ch (rene kaelin) Date: Wed, 1 Feb 2012 14:14:14 +0100 Subject: [Maxima] simplification problem Message-ID: <11F35F17-2CB6-4645-ABD5-0734B1BC4D84@gmx.ch> Dear Maxima users 3^0.5/(2-3^0.5) - (2*3^0.5+3)/(4-3) is simplified to -2.664535259100376e-15 How can I simplify it to 0? From dbmaxima at gmail.com Wed Feb 1 07:29:40 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Thu, 02 Feb 2012 00:29:40 +1100 Subject: [Maxima] simplification problem In-Reply-To: <11F35F17-2CB6-4645-ABD5-0734B1BC4D84@gmx.ch> References: <11F35F17-2CB6-4645-ABD5-0734B1BC4D84@gmx.ch> Message-ID: <4F293E44.70900@gmail.com> On 2/02/2012 12:14 AM, rene kaelin wrote: > Dear Maxima users > > 3^0.5/(2-3^0.5) - (2*3^0.5+3)/(4-3) > > is simplified to > > -2.664535259100376e-15 > > How can I simplify it to 0? Use rational numbers, rather than floating point numbers: (%i1) 3^(1/2)/(2-3^(1/2))-(2*3^(1/2)+3)/(4-3); (%o1) sqrt(3)/(2-sqrt(3))-2*sqrt(3)-3 (%i2) radcan(%); (%o2) 0 From macrakis at alum.mit.edu Wed Feb 1 07:29:59 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 1 Feb 2012 08:29:59 -0500 Subject: [Maxima] simplification problem In-Reply-To: <11F35F17-2CB6-4645-ABD5-0734B1BC4D84@gmx.ch> References: <11F35F17-2CB6-4645-ABD5-0734B1BC4D84@gmx.ch> Message-ID: In Maxima, using a decimal point in a number indicates you want to calculate with floating-point (approximate) numbers, so the result will often not be exact. For exact calculations, use fractions, e.g. 3^(1/2)/(2-3^(1/2)) - (2*3^(1/2)+3)/(4-3) or sqrt(3)/(2-sqrt(3)) - (2*sqrt(3)+3)/(4-3) Then you can use any one of Maxima's functions to reorganize/simplify the expression. In this case, ratsimp gives 0; in other cases, you may want to try radcan, expand, factor, etc. -s On Wed, Feb 1, 2012 at 08:14, rene kaelin wrote: > Dear Maxima users > > 3^0.5/(2-3^0.5) - (2*3^0.5+3)/(4-3) > > is simplified to > > -2.664535259100376e-15 > > How can I simplify it to 0? > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Wed Feb 1 08:23:16 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 01 Feb 2012 14:23:16 +0000 Subject: [Maxima] simplification problem In-Reply-To: <11F35F17-2CB6-4645-ABD5-0734B1BC4D84@gmx.ch> References: <11F35F17-2CB6-4645-ABD5-0734B1BC4D84@gmx.ch> Message-ID: <4F294AD4.6020808@fe.up.pt> On 02/01/2012 01:14 PM, rene kaelin wrote: > 3^0.5/(2-3^0.5) - (2*3^0.5+3)/(4-3) ratsimp (3^(1/2)/(2-3^(1/2)) - (2*3^(1/2)+3)/(4-3)) -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.mueller at math.uni-dortmund.de Wed Feb 1 11:34:32 2012 From: jan.mueller at math.uni-dortmund.de (=?ISO-8859-15?Q?Jan_Hendrik_M=FCller?=) Date: Wed, 01 Feb 2012 18:34:32 +0100 Subject: [Maxima] plot of plsquares polynom Message-ID: <4F2977A8.9020806@math.uni-dortmund.de> Hi all, two questions: - how can z be plotted? plsquares works fine but the plot doesn't work load("plsquares")$ plsquares(matrix([1,2,0],[3,5,4],[4,7,9],[5,8,10],[1,3,4],[2,5,7],[1,6,9],[3,1,4],[1,1,1],[4,3,6],[6,7,8]),[x,y,z],z,3,3)$ plot3d(z, [x,0,9], [y,0,9]); - the rows of the matrix (only as an example) have to be substituted by the lines of the .txt file attached. Any idea how to realise that is welcome Jan -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Transportkosten3.txt URL: From aleksasd873 at gmail.com Wed Feb 1 11:49:10 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Wed, 1 Feb 2012 19:49:10 +0200 Subject: [Maxima] integrate bug Message-ID: On 02/01/2012 12:04 PM, Aleksas Domarkas wrote: > Integrate bug: > > (%i1) integrate(acos((x-1/2)/sqrt(1-x^2)), x, 0, 1/2); > (%o1) -%pi/4 > (%i2) float(%), numer; > (%o2) -0.78539816339745 > > (%i3) quad_qags(acos((x-1/2)/sqrt(1-x^2)), x, 0, 1/2); > (%o3) [0.9161228399914,1.0171006703434392*10^-14,21,0] And: (%i2) integrate (acos ((x-1/2)/sqrt (1-x^2)), x); (%o2) -%pi*x/2 which is obviously wrong. Jaime ***************************************************************************************************************** Let (%i1) f:acos((x-1/2)/sqrt(1-x^2))$ We prove that (%i2) 'integrate(f,x,0,1/2)=asin(1/sqrt(7))/sqrt(2)-asin((752*sqrt(3))/2401)/4+%pi/4; (%o2) integrate(acos((x-1/2)/sqrt(1-x^2)),x,0,1/2)=asin(1/sqrt(7))/sqrt(2)-asin((752*sqrt(3))/2401)/4+%pi/4 proof: (%i3) load(bypart)$ (%i4) assume(abs(x)<1)$ (%i5) byparts(f,x,f,1),factor$ (%i6) F:ev(%, nouns),factor; (%o6) (2^(3/2)*x*acos((2*x-1)/(2*sqrt(1-x^2)))-sqrt(2)*asin((10*x+1)/(2*sqrt(7)*(x+1)))-sqrt(2)*asin((6*x-5)/(2*sqrt(7)*(x-1)))+asin((4*x-1)/sqrt(7)))/2^(3/2) Solution: (%i7) sol:ev(F,x=1/2)-ev(F,x=0),expand; (%o7) asin(5/(2*sqrt(7)))/2-asin(2/sqrt(7))+asin(1/sqrt(7))/sqrt(2)+asin(1/(2*sqrt(7)))/2+%pi/4 Next we simplify (%i8) ratsimp(sol*sqrt(2))/sqrt(2); (%o8) (2*asin(5/(2*sqrt(7)))-4*asin(2/sqrt(7))+2^(3/2)*asin(1/sqrt(7))+2*asin(1/(2*sqrt(7)))+%pi)/4 We contract terms (%i9) f1:2*asin(5/(2*sqrt(7)))-4*asin(2/sqrt(7))+2*asin(1/(2*sqrt(7)))$ (%i10) sin(f1)$ (%i11) trigexpand(%)$ (%i12) trigexpand(%)$ (%i13) radcan(%); (%o13) -(752*sqrt(3))/2401 Therefore, it is true equality (%i14) T:f1=asin(%); (%o14) 2*asin(5/(2*sqrt(7)))-4*asin(2/sqrt(7))+2*asin(1/(2*sqrt(7)))=-asin((752*sqrt(3))/2401) (%i15) ratsubst(rhs(T),lhs(T),sol); (%o15) (4*asin(1/sqrt(7))-sqrt(2)*asin((752*sqrt(3))/2401)+sqrt(2)*%pi)/2^(5/2) (%i16) solution:expand(%); (%o16) asin(1/sqrt(7))/sqrt(2)-asin((752*sqrt(3))/2401)/4+%pi/4 q.e.d. Test: (%i17) float(solution), numer; (%o17) 0.9161228399914 (%i18) quad_qags(f, x, 0, 1/2); (%o18) [0.9161228399914,1.0171006703434392*10^-14,21,0] Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Wed Feb 1 12:50:52 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 1 Feb 2012 10:50:52 -0800 Subject: [Maxima] plot of plsquares polynom In-Reply-To: <4F2977A8.9020806@math.uni-dortmund.de> References: <4F2977A8.9020806@math.uni-dortmund.de> Message-ID: Looks like the return value of plsquares is an equation z = .... Try something like foo : plsquares (...); plot3d (rhs (foo), [x, ...], [y, ...]); HTH Robert Dodier On 2/1/12, Jan Hendrik M?ller wrote: > Hi all, > two questions: > - how can z be plotted? plsquares works fine but the plot doesn't work > load("plsquares")$ > > plsquares(matrix([1,2,0],[3,5,4],[4,7,9],[5,8,10],[1,3,4],[2,5,7],[1,6,9],[3,1,4],[1,1,1],[4,3,6],[6,7,8]),[x,y,z],z,3,3)$ > plot3d(z, [x,0,9], [y,0,9]); > - the rows of the matrix (only as an example) have to be substituted by > the lines of the .txt file attached. Any idea how to realise that is welcome > Jan > From woollett at charter.net Wed Feb 1 14:14:10 2012 From: woollett at charter.net (Edwin Woollett) Date: Wed, 1 Feb 2012 12:14:10 -0800 Subject: [Maxima] ver. 5.26.0 display bug Message-ID: version 5.26.0 (windows gcl) inserts (false) in front of the usual display command output. (only checked console mode and xmaxima interfaces) ------------------------------------- Maxima 5.26.0 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) a; (%o1) a (%i2) display(a)$ (false) a = a (%i3) a:3$ (%i4) display(a)$ (false) a = 3 (%i5) build_info()$ Maxima version: 5.26.0 Maxima build date: 22:48 1/15/2012 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 ----------------------------- This behavior does not occur in 5.25.1 Ted Woollett From woollett at charter.net Wed Feb 1 14:26:43 2012 From: woollett at charter.net (Edwin Woollett) Date: Wed, 1 Feb 2012 12:26:43 -0800 Subject: [Maxima] ver. 5.26.0 display bug Message-ID: On Feb. 1, 2012, I wrote: ------------------ >version 5.26.0 (windows gcl) inserts >(false) in front of the usual display >command output. ------------------------- I should have mentioned that the display mode was display2d = false. If I set desplay2d to true, the (false) goes away: ----------------------------- (%i6) display2d:true$ (%i7) display(a); a = 3 (%o7) done (%i8) display2d:false$ (%i9) display(a); (false) a = 3 (%o9) done ----------------------------- Ted Woollett From tomdean at speakeasy.org Wed Feb 1 14:57:33 2012 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Wed, 01 Feb 2012 12:57:33 -0800 Subject: [Maxima] ver. 5.26.0 display bug In-Reply-To: References: Message-ID: <4F29A73D.9090101@speakeasy.org> On 02/01/12 12:26, Edwin Woollett wrote: > display2d = false. > maxima Maxima 5.26.0 http://maxima.sourceforge.net using Lisp CLISP 2.49 (2010-07-07) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i9) display2d:false$ (%i10) display(a)$ (false) a = 3 (%i11) display2d:true$ (%i12) display(a)$ a = 3 Tom Dean From macrakis at alum.mit.edu Wed Feb 1 17:23:04 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 1 Feb 2012 18:23:04 -0500 Subject: [Maxima] sqrt(1-x^2)/(2-2*x^2) --/--> 1/(2*sqrt(1-x^2)) In-Reply-To: References: <4F28219B.6020302@fe.up.pt> <4F2847F3.9070304@fe.up.pt> Message-ID: Hmm... I'd forgotten about radexpand. expr: sqrt(1-x^2)/(2-2*x^2) $ scanmap(factor,expr),radexpand:all; gets you -%i/(2*sqrt(x-1)*sqrt(x+1)) The %i might be a bit inconvenient, but is nonetheless correct.... I wonder if we have any code that will "notice" that the result is real iff -1 wrote: > Maxima calls inte to do integrate((sqrt(1-x^2)*(x^2+1))/(2-2*x^2),x,0,1). > If I recall, > inte is one of the last functions integrate tries. Some other method (not > sure which one) > handles integrate((x^2+1)/(2*sqrt(1-x^2)),x,0,1). > > integrate((sqrt(1-x^2)*(x^2+1))/(2-2*x^2),x,0,1) is in the testsuite. > > --Barton > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From subiono2008 at matematika.its.ac.id Wed Feb 1 22:33:12 2012 From: subiono2008 at matematika.its.ac.id (subiono2008 at matematika.its.ac.id) Date: Thu, 2 Feb 2012 11:33:12 +0700 (WIT) Subject: [Maxima] Inverse z-transform and ploting In-Reply-To: References: Message-ID: <3289.10.112.250.187.1328157192.squirrel@webmail.its.ac.id> Dear all, Let be X(z) a z-transform of a sequence x[n] How do we calculate invers z-transform of X(z) and plot x[n]. Subiono -- http://www.its.ac.id From villate at fe.up.pt Thu Feb 2 03:24:09 2012 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 02 Feb 2012 09:24:09 +0000 Subject: [Maxima] Inverse z-transform and ploting In-Reply-To: <3289.10.112.250.187.1328157192.squirrel@webmail.its.ac.id> References: <3289.10.112.250.187.1328157192.squirrel@webmail.its.ac.id> Message-ID: <4F2A5639.5070709@fe.up.pt> On 02/02/2012 04:33 AM, subiono2008 at matematika.its.ac.id wrote: > Let be X(z) a z-transform of a sequence x[n] > How do we calculate invers z-transform of X(z) and > plot x[n]. > Here is an example: (%i2) X: z/(z-2)$ (%i3) f[0]: ratsimp (ev(X, z=1/y))$ (%i4) f[n] := ratsimp (diff (f[n-1], y)/n)$ (%i5) f[5]; (%o5) 32/(64*y^6-192*y^5+240*y^4-160*y^3+60*y^2-12*y+1) (%i6) x[5]: ev (f[5], y=0); (%o6) 32 (%i7) plot2d ( [discrete, makelist(i,i,0,5), makelist(ev(f[i],y=0), i, 0, 5)], [style, points]); In this example you can easily see that x[n] can be written as 2^n, but in a general case it might not be possible to write x[n] as a function of n. Also, notice that (%i5) was necessary in order to calculte al functions f[1]...f[5], before ev(f[i], y=0) can be used. Otherwise, if you attempt to use ev on a function f[n] which has not been computed yet, you will get an error because the substitution y=0 will be done before the derivative. The use of ratsimp is also necessary to avoid terms with 1/y which would lead to a division by zero error. I hope this helps you. Regards, Jaime From gwpublic at wp.pl Thu Feb 2 05:16:48 2012 From: gwpublic at wp.pl (gwpublic at wp.pl) Date: Thu, 2 Feb 2012 12:16:48 +0100 Subject: [Maxima] References to papers about Maxima Message-ID: Hello, I'd like to use Maxima in my Thesis. (To be more specific: lquares method). Could you recommend some references (papers, books) I might like reference to? Best, Greg (gwpl) From villate at fe.up.pt Thu Feb 2 05:24:46 2012 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 02 Feb 2012 11:24:46 +0000 Subject: [Maxima] References to papers about Maxima In-Reply-To: References: Message-ID: <4F2A727E.1020107@fe.up.pt> On 02/02/2012 11:16 AM, gwpublic at wp.pl wrote: > Hello, > > I'd like to use Maxima in my Thesis. (To be more specific: lquares method). > > Could you recommend some references (papers, books) I might like reference to? > > Best, > Greg (gwpl) > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima The answer is in the Maxima FAQ: http://maxima-project.org/wiki/index.php?title=Maxima_FAQ#What_is_the_appropriate_way_to_cite_maxima_in_an_academic_context.3F Regards, Jaime From toy.raymond at gmail.com Thu Feb 2 11:19:18 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 2 Feb 2012 09:19:18 -0800 Subject: [Maxima] Inverse z-transform and ploting In-Reply-To: <3289.10.112.250.187.1328157192.squirrel@webmail.its.ac.id> References: <3289.10.112.250.187.1328157192.squirrel@webmail.its.ac.id> Message-ID: On Wed, Feb 1, 2012 at 8:33 PM, wrote: > Dear all, > > Let be X(z) a z-transform of a sequence x[n] > How do we calculate invers z-transform of X(z) and > plot x[n]. > > > Jaime has given one technique. Another technique is to use the inversion formula x(n) = 1/(2*%pi*%i)*contour(X(z)*z^(n-1),z) where contour is the the contour integral over any closed curve containing all of the poles of X(z). Using complex number theory, this can be reduced to x(n) = sum(residue(X(z)*z^(n-1),z, p)) where the sum is over all of the poles, p, of X(z). As an example, let X(z) = z/(z-1/2). X(z) has one pole at z=1/2 so, using maxima: (%o1) xn : residue(z/(z-1/2)*z^(n-1),z,1/2); (%i1) 1/2^n (%o2) plot2d([discrete, makelist(k,k,0,10),makelist(subst(n=k,xn),k,0,10)],[style, points]); Another way is to note that to find the inverse transform, we want to express X(z) in a Laurent series. Maxima can do that to: (%o1) powerseries(z/(z-1/2), z, inf); (%i1) 2*sum(2^(-i1-1)/z^(i1), i1, 0, inf) I leave it as an exercise for the reader to figure out how to extract the coefficient of each power of z^(-n) to get x(n). :-) A google search will give you several other techniques that can be used to find the inverse transform. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From gwpublic at wp.pl Thu Feb 2 11:39:15 2012 From: gwpublic at wp.pl (gwpublic at wp.pl) Date: Thu, 2 Feb 2012 18:39:15 +0100 Subject: [Maxima] references to methods, algorithms behind lsquares In-Reply-To: References: Message-ID: On Wed, Feb 1, 2012 at 7:54 AM, Robert Dodier wrote: > On 1/31/12, gwpublic at wp.pl wrote: > >> For lsquares there are no such nice references: >> http://maxima.sourceforge.net/docs/manual/en/maxima_65.html#SEC304 >> >> I'd like to cite in my thesis to works behind lsquares, as I use it >> (to be more specific: lsquares_estimates , lsquares_mse ). > > Well, lsquares_estimates tries to find an exact minimum of the > mean square error, via the Maxima function "solve". > If solve cannot find a solution, then lsquares_estimates tries > to find an approximate minimum, via the function "lbfgs", > which is an implementation of the LBFGS algorithm, which > is a limited-memory BFGS (quasi-Newton) algorithm. > "?? lbfgs" finds some info in the reference manual. Great Thanks Robert Dodier, this explanation about lsquare_estimates internals and references ("?? lbfgs") are exactly what I needed :). Best Grzegorz Wierzowiecki From gwpublic at wp.pl Thu Feb 2 11:53:41 2012 From: gwpublic at wp.pl (gwpublic at wp.pl) Date: Thu, 2 Feb 2012 18:53:41 +0100 Subject: [Maxima] References to papers about Maxima In-Reply-To: <4F2A727E.1020107@fe.up.pt> References: <4F2A727E.1020107@fe.up.pt> Message-ID: > The answer is in the Maxima FAQ: > http://maxima-project.org/wiki/index.php?title=Maxima_FAQ#What_is_the_appropriate_way_to_cite_maxima_in_an_academic_context.3F Thankas Jaime Villate, I've overlooked it, Some projects have theirs "Research Papers", "Papers" or even "Books" page, I haven't found about checking FAQ. All Best Greg From woollett at charter.net Thu Feb 2 15:02:27 2012 From: woollett at charter.net (Edwin Woollett) Date: Thu, 2 Feb 2012 13:02:27 -0800 Subject: [Maxima] get name of variable as string in function? Message-ID: I would like to define mprint(var) such that mprint(a) would give a = (value of a) so far I have tried: -------------------------------- (%i1) a:2; (%o1) 2 (%i2) mprint(zz) := print(sconcat(string(zz)," = "),zz)$ (%i3) mprint(a); 2 = 2 (%o3) 2 (%i4) mprint(zz) := print(sconcat(string('zz)," = "),zz)$ (%i5) mprint(a); zz = 2 (%o5) 2 ------------------- Ted Woollett From macrakis at alum.mit.edu Thu Feb 2 15:08:00 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 2 Feb 2012 16:08:00 -0500 Subject: [Maxima] get name of variable as string in function? In-Reply-To: References: Message-ID: mprint(zz) := print(sconcat(zz," = ",ev(zz)))$ and then mprint('a). You could also define mprint as a macro (using ::=), but why complicate things? Note that mprint('zz) will not work properly (because of the "ev"), so you should probably use a more obscure name mprint(zz234) := print(sconcat(zz234," = ",ev(zz234)))$ -s On Thu, Feb 2, 2012 at 16:02, Edwin Woollett wrote: > I would like to define mprint(var) such that > mprint(a) would give > a = (value of a) > so far I have tried: > ------------------------------**-- > > (%i1) a:2; > (%o1) 2 > > (%i2) mprint(zz) := print(sconcat(string(zz)," = "),zz)$ > > (%i3) mprint(a); > 2 = 2 (%o3) 2 > > (%i4) mprint(zz) := print(sconcat(string('zz)," = "),zz)$ > > (%i5) mprint(a); > zz = 2 (%o5) 2 > ------------------- > > Ted Woollett > > > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Thu Feb 2 15:36:02 2012 From: woollett at charter.net (Edwin Woollett) Date: Thu, 2 Feb 2012 13:36:02 -0800 Subject: [Maxima] get name of variable as string in function? References: Message-ID: On Feb. 2, 2012, Stavros Macrakis wrote: --------------------- > mprint(zz) := print(sconcat(zz," = ",ev(zz)))$ > and then mprint('a). ------------------------ This works. Now I want to define mdisplay(a) or mdisplay(a,b), etc to apply this def. to each arg in succession. But my tries so far fail: --------------------------------------------------- (%i1) [a,b] : [2,3]; (%o1) [2,3] (%i2) mprint(zz234) := print(sconcat(" ",zz234," = "),ev(zz234))$ (%i3) mprint('a); a = 2 (%o3) 2 (%i4) map('mprint,'[a,b]); a = 2 b = 3 (%o4) [2,3] (%i5) mdisplay([vv]) := map('mprint,'vv)$ (%i6) mdisplay(a,b); map: improper argument: vv #0: mdisplay(vv=[2,3]) -- an error. To debug this try: debugmode(true); (%i7) mdisplay([vv]) := (print(vv),map('mprint,'vv))$ (%i8) mdisplay(a,b); [2,3] map: improper argument: vv #0: mdisplay(vv=[2,3]) -- an error. To debug this try: debugmode(true); ----------------------------------- Ted From macrakis at alum.mit.edu Thu Feb 2 16:13:43 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 2 Feb 2012 17:13:43 -0500 Subject: [Maxima] get name of variable as string in function? In-Reply-To: References: Message-ID: I suggest you keep things simple and modular: /* The worker function */ mprintx(name,val) := print(sconcat(" ",name," = "),val)$ mprint('a,a)$ /* Print 1 variable */ mprint(zz23) := mprintx(zz23,ev(zz23))$ mprint('a)$ /* Print many variables in a list */ mprintl(ll23) := map(mprintx,ll23,map(ev,ll23))$ mprintl('[a,b])$ /* Print many variables as multiple arguments */ mprintll([mm23]) ::= subst(mm23,'mm23,'(mprintl('mm23)))$ mprintll(a,b)$ -s mprintll(a,b); On Thu, Feb 2, 2012 at 16:36, Edwin Woollett wrote: > > On Feb. 2, 2012, Stavros Macrakis wrote: > --------------------- > > mprint(zz) := print(sconcat(zz," = ",ev(zz)))$ and then mprint('a). >> > ------------------------ > This works. Now I want to define mdisplay(a) > or mdisplay(a,b), etc to apply this def. to each > arg in succession. But my tries so far fail: > ------------------------------**--------------------- > (%i1) [a,b] : [2,3]; > (%o1) [2,3] > > (%i2) mprint(zz234) := print(sconcat(" ",zz234," = "),ev(zz234))$ > > (%i3) mprint('a); > > a = 2 (%o3) 2 > > (%i4) map('mprint,'[a,b]); > a = 2 b = 3 (%o4) [2,3] > > (%i5) mdisplay([vv]) := map('mprint,'vv)$ > > (%i6) mdisplay(a,b); > map: improper argument: vv > #0: mdisplay(vv=[2,3]) > -- an error. To debug this try: debugmode(true); > > (%i7) mdisplay([vv]) := (print(vv),map('mprint,'vv))$ > > (%i8) mdisplay(a,b); > [2,3] map: improper argument: vv > #0: mdisplay(vv=[2,3]) > -- an error. To debug this try: debugmode(true); > > ------------------------------**----- > Ted > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Thu Feb 2 16:58:05 2012 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 02 Feb 2012 22:58:05 +0000 Subject: [Maxima] get name of variable as string in function? In-Reply-To: References: Message-ID: <4F2B14FD.3030505@fe.up.pt> or you could also use something like this: (%i1) mprint(z) := if listp(z) then map(mprint, z) else printf(true, "~a = ~a~%", z, ev(z))$ (%i2) a: 2$ (%i3) [b,c]: [%pi, 2/5]$ (%4) mprint('a); a = 2 (%o4) false (%i5) mprint(['a,'b,'c]); a = 2 b = %pi c = 2/5 (%o5) [false, false, false] On 02/02/2012 10:13 PM, Stavros Macrakis wrote: > I suggest you keep things simple and modular: > > /* The worker function */ > mprintx(name,val) := print(sconcat(" ",name," = "),val)$ > > mprint('a,a)$ > > /* Print 1 variable */ > mprint(zz23) := mprintx(zz23,ev(zz23))$ > > mprint('a)$ > > /* Print many variables in a list */ > mprintl(ll23) := map(mprintx,ll23,map(ev,ll23))$ > > mprintl('[a,b])$ > > /* Print many variables as multiple arguments */ > mprintll([mm23]) ::= subst(mm23,'mm23,'(mprintl('mm23)))$ > > mprintll(a,b)$ > > -s > > mprintll(a,b); > > > On Thu, Feb 2, 2012 at 16:36, Edwin Woollett > wrote: > > > On Feb. 2, 2012, Stavros Macrakis wrote: > --------------------- > > mprint(zz) := print(sconcat(zz," = ",ev(zz)))$ and then > mprint('a). > > ------------------------ > This works. Now I want to define mdisplay(a) > or mdisplay(a,b), etc to apply this def. to each > arg in succession. But my tries so far fail: > --------------------------------------------------- > (%i1) [a,b] : [2,3]; > (%o1) [2,3] > > (%i2) mprint(zz234) := print(sconcat(" ",zz234," = "),ev(zz234))$ > > (%i3) mprint('a); > > a = 2 (%o3) 2 > > (%i4) map('mprint,'[a,b]); > a = 2 b = 3 (%o4) [2,3] > > (%i5) mdisplay([vv]) := map('mprint,'vv)$ > > (%i6) mdisplay(a,b); > map: improper argument: vv > #0: mdisplay(vv=[2,3]) > -- an error. To debug this try: debugmode(true); > > (%i7) mdisplay([vv]) := (print(vv),map('mprint,'vv))$ > > (%i8) mdisplay(a,b); > [2,3] map: improper argument: vv > #0: mdisplay(vv=[2,3]) > -- an error. To debug this try: debugmode(true); > > ----------------------------------- > Ted > > > > > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From pier_carla at yahoo.it Fri Feb 3 05:47:44 2012 From: pier_carla at yahoo.it (Pierpaolo Garofalo) Date: Fri, 3 Feb 2012 11:47:44 +0000 (GMT) Subject: [Maxima] plot array of functions Message-ID: <1328269664.98345.YahooMailNeo@web26208.mail.ukl.yahoo.com> Hi everybody in the list, I am a new maxima user so if my question has been already answered elsewhere, please bear with me. I would be grateful if someone could provide a link to some explanation...? I googled around for hours before posting here. I am trying to plot a star of lines and for this purpose I am trying to rely on a vector of functions. So far I have made my way to this point: array(Y,9); for i:0 thru 9 do block(Y[i](x):=i*x, display(Y[i])); plot2d([Y(x)],[x,-5,5]); plot2d: expression evaluates to non-numeric value everywhere in plotting range. plot2d: nothing to plot. (%o103) false I have tried to alter in quite a few different way the Y expression in the plot2d string but with no success. Any hint would be greatly appreciated, Pier From eric.reyssat at unicaen.fr Fri Feb 3 06:08:41 2012 From: eric.reyssat at unicaen.fr (Eric Reyssat) Date: Fri, 03 Feb 2012 13:08:41 +0100 Subject: [Maxima] plot array of functions In-Reply-To: <1328269664.98345.YahooMailNeo@web26208.mail.ukl.yahoo.com> References: <1328269664.98345.YahooMailNeo@web26208.mail.ukl.yahoo.com> Message-ID: <4F2BCE49.8090309@unicaen.fr> Hi Pierpaolo, Maybe you could adapt this to your needs : Y:makelist(i*x,i,0,9); plot2d(Y,[x,-5,5]); Here Y[i] is not a function but an expression. Eric Le 03/02/2012 12:47, Pierpaolo Garofalo a ?crit : > array(Y,9); > > for i:0 thru 9 do block(Y[i](x):=i*x, display(Y[i])); > > plot2d([Y(x)],[x,-5,5]); From pier at unirc.eu Fri Feb 3 06:51:35 2012 From: pier at unirc.eu (Pier) Date: Fri, 3 Feb 2012 13:51:35 +0100 Subject: [Maxima] plot array of functions In-Reply-To: <4F2BCE49.8090309@unicaen.fr> References: <1328269664.98345.YahooMailNeo@web26208.mail.ukl.yahoo.com> <4F2BCE49.8090309@unicaen.fr> Message-ID: <20120203124858.M90907@unirc.eu> Eric, thank you very much! That's what I was looking for! Greetings, Pier On Fri, 03 Feb 2012 13:08:41 +0100, Eric Reyssat wrote > Hi Pierpaolo, > > Maybe you could adapt this to your needs : > > Y:makelist(i*x,i,0,9); plot2d(Y,[x,-5,5]); > > Here Y[i] is not a function but an expression. > > Eric > > Le 03/02/2012 12:47, Pierpaolo Garofalo a ?crit : > > array(Y,9); > > > > for i:0 thru 9 do block(Y[i](x):=i*x, display(Y[i])); > > > > plot2d([Y(x)],[x,-5,5]); > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima --------------------------------------------------------------------------------------------------------------------------------------------- ....../\ /\ ......0 0 .....=O= < Pierp > --------------------------------------------------------------------------------------------------------------------------------------------- Linux Gentoo Ker. 2.6.37/Ker. 2.6.19.2 RTAI Vulcano Web: http://pier.unirc.eu skype: pier_carla irc: irc.unirc.eu #linux icq: 325474062 -------------------- From villate at fe.up.pt Fri Feb 3 09:55:48 2012 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 03 Feb 2012 15:55:48 +0000 Subject: [Maxima] plot array of functions In-Reply-To: <1328269664.98345.YahooMailNeo@web26208.mail.ukl.yahoo.com> References: <1328269664.98345.YahooMailNeo@web26208.mail.ukl.yahoo.com> Message-ID: <4F2C0384.7000106@fe.up.pt> On 02/03/2012 11:47 AM, Pierpaolo Garofalo wrote: > I am a new maxima user so if my question has been already answered elsewhere, please bear with me. I would be grateful if someone could provide > > a link to some explanation... I googled around for hours before posting here. > > > I am trying to plot a star of lines and for this purpose I am trying to rely on a vector of functions. So far I have made my way to this point: > > array(Y,9); > > for i:0 thru 9 do block(Y[i](x):=i*x, display(Y[i])); > > plot2d([Y(x)],[x,-5,5]); > > plot2d: expression evaluates to non-numeric value everywhere in plotting range. > plot2d: nothing to plot. > (%o103) false Hi, welcome to this group. Feel free to ask whenever you get stuck. Eric has already told you the answer, but since you are new user I'd like to point out why your attempt failed. First of all, you should avoid using arrays, at least until you're more familiar with Maxima. You could have created a list rather than an array by simply writing the "for" command right away: for i:0 thru 9 do (Y[i](x) := i*x, display (Y[i])); notice also that you do not need block in this case, since you are not defining any local variables. After you have defined those 10 functions, Y(x) will not refer to the list of those 10 functions but rather to another different function which you have not defined yet. That's why plot2d complaints that Y(x) evaluates to a non-numeric value, because in fact it cannot be evaluated since it has not been defined. To get a list with the ten functions you defined, you would have to write: [Y[0](x), Y[1](x), Y[2](x), Y[3](x), Y[4](x), Y[5](x), Y[6](x), Y[7](x), Y[8](x), Y[9](x)] or simply, makelist (Y[i](x), i, 0, 9) which will give you the same result. But in Maxima it makes life easier to represent mathematical functions by expressions rather than defining procedures with an input variable. Namely, get used to: f: x^2 + 2; at (f, x=5); instead of: f(x) := x^2 + 2; f(5); Regards, Jaime From villate at fe.up.pt Fri Feb 3 11:14:44 2012 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 03 Feb 2012 17:14:44 +0000 Subject: [Maxima] plot array of functions In-Reply-To: <4F2C0384.7000106@fe.up.pt> References: <1328269664.98345.YahooMailNeo@web26208.mail.ukl.yahoo.com> <4F2C0384.7000106@fe.up.pt> Message-ID: <4F2C1604.3000109@fe.up.pt> On 02/03/2012 03:55 PM, Jaime Villate wrote: > You could have created a list rather than an array by simply writing > the "for" command > right away: > for i:0 thru 9 do (Y[i](x) := i*x, display (Y[i])); > > After you have defined those 10 functions,... Let me correct myself. The above command did not just define 10 functions 0, x, 2*x, ..., 9*x, but it really defined a function of two variables, Y[y](x) ---> y*x Thus, the above command would be equivalent to: for i:0 thru 9 do (Y[y](x) := y*x, display (Y[i])); which shows that the function Y[y](x) is being superfluously defined 10 times and an even simpler form of the above command would be: Y[y](x) := y*x; for i:0 thru 9 do display (Y[i]); If one really wants to define just an array of 10 functions, one should use define() instead of := for i:0 thru 9 do (define (Y[i](x), i*x), display(Y[i](x))); This is one more good reason to advise users not to use "Maxima functions" to represent the kind of functions they are used to in mathematics. Cheers, Jaime From pier at unirc.eu Fri Feb 3 12:39:13 2012 From: pier at unirc.eu (Pier) Date: Fri, 3 Feb 2012 19:39:13 +0100 Subject: [Maxima] plot array of functions In-Reply-To: <4F2C1604.3000109@fe.up.pt> References: <1328269664.98345.YahooMailNeo@web26208.mail.ukl.yahoo.com> <4F2C0384.7000106@fe.up.pt> <4F2C1604.3000109@fe.up.pt> Message-ID: <20120203183642.M4125@unirc.eu> Jamie, thank you very much for the explanation. I'll study what you wrote carefully. Pier On Fri, 03 Feb 2012 17:14:44 +0000, Jaime Villate wrote > On 02/03/2012 03:55 PM, Jaime Villate wrote: > > You could have created a list rather than an array by simply writing > > the "for" command > > right away: > > for i:0 thru 9 do (Y[i](x) := i*x, display (Y[i])); > > > > After you have defined those 10 functions,... > > Let me correct myself. The above command did not just define 10 functions > 0, x, 2*x, ..., 9*x, but it really defined a function of two > variables, Y[y](x) ---> y*x Thus, the above command would be > equivalent to: for i:0 thru 9 do (Y[y](x) := y*x, display (Y[i])); > > which shows that the function Y[y](x) is being superfluously defined > 10 times and an even simpler form of the above command would be: > Y[y](x) := y*x; for i:0 thru 9 do display (Y[i]); > > If one really wants to define just an array of 10 functions, one > should use define() instead of := for i:0 thru 9 do (define > (Y[i](x), i*x), display(Y[i](x))); > > This is one more good reason to advise users not to use "Maxima > functions" to > represent the kind of functions they are used to in mathematics. > > Cheers, > Jaime > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From pier at unirc.eu Fri Feb 3 14:48:06 2012 From: pier at unirc.eu (Pier) Date: Fri, 3 Feb 2012 21:48:06 +0100 Subject: [Maxima] plot array of functions In-Reply-To: <4F2C1604.3000109@fe.up.pt> References: <1328269664.98345.YahooMailNeo@web26208.mail.ukl.yahoo.com> <4F2C0384.7000106@fe.up.pt> <4F2C1604.3000109@fe.up.pt> Message-ID: <20120203204625.M29639@unirc.eu> Thanks everybody for the useful prompt replies. Just to point out what I was aiming at, here follows the list of instructions I intended to suggest to my pupils in order to show them the influence of the parameter K when linearly combining two lines r and s into a star (ex:r+K*s). Namely, varying K from 0 to a possibly high value, the expression ex approaches nearer and nearer the line s. (%i6) a:1; (%i7) b:1; (%i8) c:1; (%i9) e:1; (%i10) f:0.5; (%i11) g:1; (%i12) r:a*x+b*y+c; (%i13) s:e*x+f*y+g; (%i14) P:linsolve([r,s],[x,y]); centre point of the star (%i15) ex:r+K*s; (%i16) solve(ex,y); copy and paste the rhs of the output as rhs of %i17 (%i17) Z(x,K):=-((2*x+2)*K+2*x+2)/(K+2); (%i18) F:makelist(Z(x,K),K,0,10); (%i19) plot2d(F,[x,-5,5]); One thing I haven't been able to do is to avoiding copying-pasting the rhs output of %i16 y=-((2*x+2)*K+2*x+2)/(K+2) as the rhs in %i17. I tried with: Z(ex,K):=solve(ex,y); but that didn't work. Thanks, Pier From toy.raymond at gmail.com Fri Feb 3 14:56:19 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 3 Feb 2012 12:56:19 -0800 Subject: [Maxima] plot array of functions In-Reply-To: <20120203204625.M29639@unirc.eu> References: <1328269664.98345.YahooMailNeo@web26208.mail.ukl.yahoo.com> <4F2C0384.7000106@fe.up.pt> <4F2C1604.3000109@fe.up.pt> <20120203204625.M29639@unirc.eu> Message-ID: On Fri, Feb 3, 2012 at 12:48 PM, Pier wrote: > Thanks everybody for the useful prompt replies. > > Just to point out what I was aiming at, here follows the list of > instructions > I intended to suggest to my pupils in order to show them the influence of > the > parameter K when linearly combining two lines r and s into a star > (ex:r+K*s). > Namely, varying K from 0 to a possibly high value, the expression ex > approaches nearer and nearer the line s. > > (%i6) a:1; > (%i7) b:1; > (%i8) c:1; > (%i9) e:1; > (%i10) f:0.5; > (%i11) g:1; > (%i12) r:a*x+b*y+c; > (%i13) s:e*x+f*y+g; > (%i14) P:linsolve([r,s],[x,y]); centre point of the star > (%i15) ex:r+K*s; > (%i16) solve(ex,y); copy and paste the rhs of the output as rhs of %i17 > (%i17) Z(x,K):=-((2*x+2)*K+2*x+2)/(K+2); > (%i18) F:makelist(Z(x,K),K,0,10); > (%i19) plot2d(F,[x,-5,5]); > > One thing I haven't been able to do is to avoiding copying-pasting the rhs > output of %i16 > > y=-((2*x+2)*K+2*x+2)/(K+2) > > If you want the rhs of something, use the rhs function rhs(%o16). But the output of solve is a list, so you probably want to do rhs(%o16[1]) instead. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Sat Feb 4 07:34:17 2012 From: villate at fe.up.pt (Jaime Villate) Date: Sat, 04 Feb 2012 13:34:17 +0000 Subject: [Maxima] plot array of functions In-Reply-To: <20120203204625.M29639@unirc.eu> References: <1328269664.98345.YahooMailNeo@web26208.mail.ukl.yahoo.com> <4F2C0384.7000106@fe.up.pt> <4F2C1604.3000109@fe.up.pt> <20120203204625.M29639@unirc.eu> Message-ID: <4F2D33D9.6080706@fe.up.pt> On 02/03/2012 08:48 PM, Pier wrote: > (%i6) a:1; > (%i7) b:1; > (%i8) c:1; > (%i9) e:1; > (%i10) f:0.5; > (%i11) g:1; > (%i12) r:a*x+b*y+c; > (%i13) s:e*x+f*y+g; > (%i14) P:linsolve([r,s],[x,y]); centre point of the star > (%i15) ex:r+K*s; > (%i16) solve(ex,y); copy and paste the rhs of the output as rhs of %i17 > (%i17) Z(x,K):=-((2*x+2)*K+2*x+2)/(K+2); > (%i18) F:makelist(Z(x,K),K,0,10); > (%i19) plot2d(F,[x,-5,5]); > > One thing I haven't been able to do is to avoiding copying-pasting the rhs > output of %i16 > > y=-((2*x+2)*K+2*x+2)/(K+2) > > as the rhs in %i17. I tried with: > > Z(ex,K):=solve(ex,y); > > but that didn't work. I guess you meant "Z(x,K) := solve(ex,y)", but that will fail by two reasons. The first reason, already pointed out by Ray, is that solve will give you a list of equations, even if there is only one solution. You want just the right hand side of the first equation in the list returned by solve: rhs(first(solve(ex, y))) (or use [1] instead of first). The second reason is that := will not evaluate its arguments. That means that in the command "Z(x,K) := rhs (first (solve (ex, y)))" ex will not be solved to find y, but that step will be delayed until you try to evaluate Z(x,k) at some later time; that might work but it might also give you unintended results; for instance: (%i15) Z(x,K) := rhs ( first(solve(ex,y))); (%o15) Z(x, K) := rhs(first(solve(ex, y))) (%i16) y:3; (%o16) 3 (%i17) Z(2,4); solve: all variables must not be numbers. #0: Z(x=2,k=4) -- an error. To debug this try: debugmode(true) by the time Z tried to use solve, y was no longer an undefined variable so it failed. As I pointed out in my previous message you should better use expressions: Z: rhs ( first(solve(ex,y))); but if you insist on using functions, then use define() instead of := define (Z(x,K), rhs ( first(solve(ex,y)))); the difference between f(x):=exp and define(f(x),exp) is that define will first evaluate its arguments before defining the function. In the case above, solve, first and rhs will be executed before Z(x,K) is defined. I also use Maxima extensively in my Physics lectures; I'm interested to know what courses you are teaching. Cheers, Jaime From zhaxiaolei at gmail.com Sat Feb 4 09:41:11 2012 From: zhaxiaolei at gmail.com (zxl) Date: Sat, 4 Feb 2012 23:41:11 +0800 Subject: [Maxima] How can I convert 5^(3/2) to 5* 5^(1/2) Message-ID: hello: I hope expand (a+b sqrt(5))^n to the form A+B sqrt(5), but expand ((1+sqrt(5))) give me 5^(3/2)+ 3 sqrt(5) + 16. How can I convert 5^(3/2) to 5 5^(1/2) ? thanks z.x.l -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.reyssat at unicaen.fr Sat Feb 4 10:21:10 2012 From: eric.reyssat at unicaen.fr (Eric Reyssat) Date: Sat, 04 Feb 2012 17:21:10 +0100 Subject: [Maxima] How can I convert 5^(3/2) to 5* 5^(1/2) In-Reply-To: References: Message-ID: <4F2D5AF6.1090602@unicaen.fr> Hello z.x.l, radcan (expression); is usually a good way to simplify radicals. Eric Le 04/02/2012 16:41, zxl a ?crit : > hello: > > I hope expand (a+b sqrt(5))^n to the form A+B sqrt(5), but expand > ((1+sqrt(5))) give me 5^(3/2)+ 3 sqrt(5) + 16. How can I convert > 5^(3/2) to 5 5^(1/2) ? > > thanks > > z.x.l > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Feb 4 13:55:11 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 4 Feb 2012 11:55:11 -0800 Subject: [Maxima] get name of variable as string in function? In-Reply-To: References: Message-ID: On 2/2/12, Edwin Woollett wrote: > I would like to define mprint(var) such that > mprint(a) would give > a = (value of a) Isn't that exactly what display(a) does? best, Robert Dodier From pier at unirc.eu Sat Feb 4 14:04:08 2012 From: pier at unirc.eu (Pier) Date: Sat, 4 Feb 2012 21:04:08 +0100 Subject: [Maxima] plot array of functions In-Reply-To: <4F2D33D9.6080706@fe.up.pt> References: <1328269664.98345.YahooMailNeo@web26208.mail.ukl.yahoo.com> <4F2C0384.7000106@fe.up.pt> <4F2C1604.3000109@fe.up.pt> <20120203204625.M29639@unirc.eu> <4F2D33D9.6080706@fe.up.pt> Message-ID: <20120204194642.M83461@unirc.eu> Jaime, thank you very much for your hints. At last I got what I wanted. Here are the working lines: (%i1) a:1; (%i2) b:1; (%i3) c:1; (%i4) e:1; (%i5) f:0.5; (%i6) g:1; (%i7) r:a*x+b*y+c; (%i8) s:e*x+f*y+g; (%i9) P:linsolve([r,s],[x,y]); (%i10) ex:r+K*s; (%i20) define (Z(x,K), rhs ( (solve(ex,y)[1]))); (%i21) F:makelist(Z(x,K),K,0,10); (%i22) plot2d(F,[x,-5,5]); It is not that I insist on using functions... I tried both: Z: rhs ( first(solve(ex,y))); and define (Z(x,K), rhs ( (solve(ex,y)[1]))); but only the latter worked. For sure I must get hold of a good book on Maxima. Pier On Sat, 04 Feb 2012 13:34:17 +0000, Jaime Villate wrote > On 02/03/2012 08:48 PM, Pier wrote: > > (%i6) a:1; > > (%i7) b:1; > > (%i8) c:1; > > (%i9) e:1; > > (%i10) f:0.5; > > (%i11) g:1; > > (%i12) r:a*x+b*y+c; > > (%i13) s:e*x+f*y+g; > > (%i14) P:linsolve([r,s],[x,y]); centre point of the star > > (%i15) ex:r+K*s; > > (%i16) solve(ex,y); copy and paste the rhs of the output as rhs of %i17 > > (%i17) Z(x,K):=-((2*x+2)*K+2*x+2)/(K+2); > > (%i18) F:makelist(Z(x,K),K,0,10); > > (%i19) plot2d(F,[x,-5,5]); > > > > One thing I haven't been able to do is to avoiding copying-pasting the rhs > > output of %i16 > > > > y=-((2*x+2)*K+2*x+2)/(K+2) > > > > as the rhs in %i17. I tried with: > > > > Z(ex,K):=solve(ex,y); > > > > but that didn't work. > I guess you meant "Z(x,K) := solve(ex,y)", but that will fail by two > reasons. The first reason, > already pointed out by Ray, is that solve will give you a list of > equations, even if there is > only one solution. You want just the right hand side of the first > equation in the list returned > by solve: rhs(first(solve(ex, y))) > (or use [1] instead of first). > > The second reason is that := will not evaluate its arguments. That > means that in the command "Z(x,K) := rhs (first (solve (ex, y)))" ex > will not be solved to find y, but that step will be delayed until > you try to evaluate Z(x,k) at some later time; that might work but > it might also give you unintended results; for instance: > > (%i15) Z(x,K) := rhs ( first(solve(ex,y))); > (%o15) Z(x, K) := rhs(first(solve(ex, y))) > (%i16) y:3; > (%o16) 3 > (%i17) Z(2,4); > > solve: all variables must not be numbers. > #0: Z(x=2,k=4) > -- an error. To debug this try: debugmode(true) > > by the time Z tried to use solve, y was no longer an undefined > variable so it failed. > > As I pointed out in my previous message you should better use expressions: > > Z: rhs ( first(solve(ex,y))); > > but if you insist on using functions, then use define() instead of := > > define (Z(x,K), rhs ( first(solve(ex,y)))); > > the difference between f(x):=exp and define(f(x),exp) is that define > will first evaluate its arguments > before defining the function. In the case above, solve, first and > rhs will be executed before Z(x,K) is defined. > > I also use Maxima extensively in my Physics lectures; I'm interested > to know what courses you are teaching. > > Cheers, > Jaime > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima --------------------------------------------------------------------------------------------------------------------------------------------- ....../\ /\ ......0 0 .....=O= < Pierp > --------------------------------------------------------------------------------------------------------------------------------------------- Linux Gentoo Ker. 2.6.37/Ker. 2.6.19.2 RTAI Vulcano Web: http://pier.unirc.eu skype: pier_carla irc: irc.unirc.eu #linux icq: 325474062 -------------------- From amca01 at gmail.com Sat Feb 4 22:08:58 2012 From: amca01 at gmail.com (Alasdair McAndrew) Date: Sun, 5 Feb 2012 15:08:58 +1100 Subject: [Maxima] A series question Message-ID: What is the canonical Maxima way of obtaining the series form f(x) + hf'(x) + h^2f''(x)/2 + h^3f'''(x)/6 + ... for f(x+h)? Thanks, Alasdair -- Blog: http://amca01.wordpress.com Web: http://sites.google.com/site/amca01/ Facebook: http://www.facebook.com/alasdair.mcandrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.reyssat at unicaen.fr Sun Feb 5 01:01:18 2012 From: eric.reyssat at unicaen.fr (Eric Reyssat) Date: Sun, 05 Feb 2012 08:01:18 +0100 Subject: [Maxima] A series question In-Reply-To: References: Message-ID: <4F2E293E.6040407@unicaen.fr> Hello Alasdair, I'm not expert in canonical Maxima but (%i13) subst(u-x=h,taylor(f(u),u,x,3)); (%o13) f(x)+h^3*('at('diff(f(u),u,3),u = x))/6 +h^2*('at('diff(f(u),u,2),u = x))/2+h*('at('diff(f(u),u,1),u = x)) (%i14) subst(u-x=h,taylor(sin(u),u,x,3)); (%o14) -h^2*sin(x)/2+sin(x)-h^3*cos(x)/6+h*cos(x) is quite simple, and gives reasonable results for explicit as well as litteral functions. I don't know if maxima knows of a simpler way of writing f^(5)(x) (fifth derivative at x) than ('at('diff(f(u),u,5),u = x)) Eric Le 05/02/2012 05:08, Alasdair McAndrew a ?crit : > What is the canonical Maxima way of obtaining the series form > > f(x) + hf'(x) + h^2f''(x)/2 + h^3f'''(x)/6 + ... > > for f(x+h)? > > Thanks, > Alasdair > -- > Blog: http://amca01.wordpress.com > Web: http://sites.google.com/site/amca01/ > Facebook: http://www.facebook.com/alasdair.mcandrew > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From biomates at telefonica.net Sun Feb 5 05:06:30 2012 From: biomates at telefonica.net (Mario Rodriguez) Date: Sun, 05 Feb 2012 12:06:30 +0100 Subject: [Maxima] draw package, multiple plots with different sizes? In-Reply-To: <4F18754A.20309@street-artists.org> References: <4F171FD5.20108@street-artists.org> <1326984114.1569.17.camel@pc> <1326997893.1684.18.camel@pc> <4F18754A.20309@street-artists.org> Message-ID: <1328439990.1531.8.camel@pc> El jue, 19-01-2012 a las 11:55 -0800, dlakelan escribi?: > > Thank you very much for the helpful examples! If you are considering > additional features to add to draw, you might consider a standardized > (non preamble based) way to do this. It is often nice to do multi-plots > where some plots are more prominent or have different aspect ratios than > others, and inset-plots are also quite nice. Hello, I have commited to the git repository some changes in the draw package (files draw.lisp, grcommon.lisp and vtk.lisp) on multiplots (both Gnuplot and VTK). Info on new option 'allocation': With option @code{allocation} it is possible to place a scene in the output window at will; this is of interest in multiplots. When @code{false}, the scene is placed automatically, depending on the value assigned to option @code{columns}. In any other case, @code{allocation} must be set to a list of two pairs of numbers; the first corresponds to the position of the lower left corner of the scene, and the second pair gives the width and height of the plot. All quantities must be given in relative coordinates, between 0 and 1. Gnuplot examples: http://riotorto.users.sourceforge.net/gnuplot/multiplots/index.html#allocation VTK examples: http://riotorto.users.sourceforge.net/vtk/multiplot -- Mario From lapeyre.math122a at gmail.com Sun Feb 5 11:28:14 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Sun, 05 Feb 2012 18:28:14 +0100 Subject: [Maxima] experiments with maxima Message-ID: <4F2EBC2E.1020605@gmail.com> Greetings, Here are some experiments that may be interesting. The code is at: https://sourceforge.net/projects/ribot/files/ These are the same thing: maxima-expt.zip maxima-expt.tar.gz This is a 3.2MB data file for one function prime_pi_tables.lisp 1) Documentation: Modified the command-line interface to the maxima manual to allow other documents to be displayed with ? and ?? and to allow other systems to make queries. The documentation system is divided into three parts: a) databases. b) querying and organizing component. c) front ends. Databases are registered with the querying component by sending a struct. The original describe command line interface calls the querying component. Not much was done here, just separating the code. There are four examples of databases: a) the maxima info database. b) simple-doc. This is available immediately. (I later saw this is similar to L. Butler's code.) (%i3) simple_doc_add("new_function", "The new description."); (%o3) "new_function" (%i4) ? new_function The new description. (%o4) true c) max-doc, a more capable documentation database than simple-doc, but not coherent. It would be nice if there were a lisp parser of gnu texinfo code. The idea is to make it easy to convert to normal maxima doc. d) developer or internal documentation. Eg, there is a macro ddefun that expands to defun but also captures the doc string to a database along with the name of the source file, and lambda list. This is then also available via ? and ??. There is a variable controlling sending the output to a pager, as well, that only works with some lisp/platfrom combinations. 2) Options or keyword arguments to maxima functions: One could use a new infix notation, or just pass a form: func(x, a -> b) or func(x, opt(a=b)) I am using the former. 3) defmfun1 macro for writing maxima functions: (no support now for writing directly in maxima language). The syntax tries to follow defun as much as possible with &optional, &aux, &rest, with some additions. a) There is a new parameter type &opt rather than &key for the keyword args, mentioned above. b) Directives for argument checking and preprocessing of args. c) Automatic entry in the max-doc database. Actually, we require a directive :doc to create a documentation entry. An example: (defmfun1 $f (x) x). Another example (that still does not use &opt) (defmfun1 ($f4 :doc) ( (x :string) (y :non-neg-int) &optional (z :string "dog") ) "f4 ignores the string and integer arguments and returns 'dog' by default." z) then .... (%i2) ? f4 -- Function: f4: f4(, :optional ) Section: Example functions f4 ignores the string and integer arguments and returns 'dog' by default. f4 requires either two or three arguments. The first argument must be a string. The second argument must be a non-negative integer. The third argument must be a string. (%i3) f4(); f4: f4 called with no arguments; either two or three arguments are expected. (%i4) f4(1); f4: Argument '1' is not a string in f4(1). (%i5) f4("cat",1); (%o5) "dog" Some other examples of definitions: (defmfun1 $f8 (x &rest (m :list) ) ...) ; Each of the &rest arguments must be a maxima list. (defmfun1 $f9 ( (x (:int-range 1 10) )) ...) ; eg f9(5) (defmfun1 $f10 ( x &opt ($y (:int-range 1 3))) ; eg f10(1, y->2) 4) array representation of expressions. Instead of a list, represent an expression by a struct with a list for the op and a lisp array for the arguments. This allows more efficient random access of elements in the expression. These cannot be used universally, of course. Some of the functions to manipulate them are. a) aex(e), lex(e) shallow conversion between array and list representation. b) faex(e), flex(e), raex(e,i,j...) convert at all levels or levels given by a specification. c) e falls through aex(e) if e is a symbol, number, bigfloat, string, etc. d) ipart(e,...). Like inpart but expression can be mixed list and array representation at different levels. ipart_set(e,v,....) destructive assignment. Some other modifications are done, eg. the alike function understands array expressions. In general, the idea is to allow algorithms that are not efficient for singly-linked lists. What output representation to choose if none is specificied is problematic. Display of aex is badly hacked via msize at the moment. It looks slightly better in 5.25.1 than 5.26.0 I don't understand the maxima display code. Many functions take the option ot. ot->ar means output array representation ot->ml means output lisp list representation. 5) A number of functions, mostly using the above. Eg. a) lrange (called lrange because 'range' is already taken) lrange(3) => [1,2,3] lrange(3,ot->ar) => ~[1,2,3] (ask for array representation output, marked by '~') lrange(x,x+4,2) => [x,x+2,x+4] For generating a single list large enough to measure the time, lrange is a few hundred times faster than the more general 'makelist', and about 3 times faster than Z. Lenaric's, also more general, table. Here is an example. defmfun-ae is a macro that writes some array expression options into the lambda list. This example could also be done simply by copying to a lisp array. (defmfun-ae $ae_random_permutation (a) "Return expression a with random permutation of arguments." (let* ( (a1 ($aex_cp a)) ; shallow copy to array expression from list or array expression (n ($length a1)) ) (dotimes (i n) (let ( (j (+ i ($random (- n i)))) (tmp ($aex_get a1 i)) ) (declare (fixnum j)) ($aex_set a1 i ($aex_get a1 j)) ;; these are pretty fast ($aex_set a1 j tmp))) (defmfun-final-to-ae a1))) ;; convert to the representation specified in the call. ae_random_permutation([1,2,3]); => ~[3,1,2] (list input , array output) ae_random_permutation( aex( [1,2,3]) ); => ~[3,1,2] (array input and output) ae_random_permutation( aex( [1,2,3] ), ot->ml ); [1,2,3] (array input, list output) The following (compiled) is almost as fast on large lists of numbers (10^5 or 10^6) rand_perm(a) := block([a1,n,j,tmp], modedeclare([j,n],fixnum), a1 : aex_cp(a), n : length(a1), for i from 0 thru n-1 do ( j : i + random(n-i), tmp : aex_get(a1,i), aex_set(a1,i,aex_get(a1,j)), aex_set(a1,j,tmp)), a1); 6) cffi example: prime_pi prime counting function. The table is big so it is packaged separately. This may not be easily buildable on some systems. I made an interface to a fast c++ prime sieve implementation (Walisch) and some tables (Oliveira). The library is multithreaded. This works with sbcl and ccl on linux. The trial allegro system would not link the 64 bit library. It is probably not difficult to get it work with MS Win, but I stopped when I got linking errors because mingw does not have openmp. Also, poking around the web and the gcl source I could not find how to do ffi for gcl. Example: The spacing of entries in the table for 10^12 is greater than 10^8 (Denser tables are available). So 10^8 values must be sieved: (%i28) prime_pi(10^12 + 10^8, threads->2); Evaluation took 0.0940 seconds (0.0940 elapsed) using 0 bytes. (%o28) 37611530300 Here, 10^9 values sieved. Note real time is half the total processor time. (%i29) prime_pi(10^15 + 10^9, threads->2); Evaluation took 1.6610 seconds (0.8610 elapsed) using 0 bytes. (%o29) 29844599369090 From macrakis at alum.mit.edu Sun Feb 5 13:07:53 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 5 Feb 2012 14:07:53 -0500 Subject: [Maxima] How can I convert 5^(3/2) to 5* 5^(1/2) In-Reply-To: References: Message-ID: 5^(3/2) is Maxima's standard way of expressing sqrt(5)^3 = 5*sqrt(5). It is important in Maxima to have standard ways of expressing such things, otherwise it risks not simplifying e.g. 5*sqrt(5) - 5^(3/2). Since Maxima is programmable, you can of course generate whatever form you want -- though you shouldn't use the standard sqrt function, since Maxima "knows" about it and will simplify it. Here is one simple trick: (%i1) display2d:false$ (%i2) 5^(3/2); (%o2) 5^(3/2) (%i3) ratsubst(sqr(5),sqrt(5),%o2); (%o3) sqr(5)^3 (%i4) ratsubst(5,sqr(5)^2,%o3); (%o4) 5*sqr(5) Of course, subsequent calculations won't know that sqr(5)^2 = 5. You could also do something like this: separate_roots(ex):= if mapatom(ex) then ex elseif inpart(ex,0)="^" then block([b:inpart(ex,1),e:inpart(ex,2)], if numberp(b) and numberp(e) then b^truncate(e)*box(b^(e-truncate(e))) <<< box "protects" from simplification else ex) else ex$ This produces ugly results (with box), especially for negative powers, but you should be able to customize this to something more of your liking. -s On Sat, Feb 4, 2012 at 10:41, zxl wrote: > hello: > > I hope expand (a+b sqrt(5))^n to the form A+B sqrt(5), but expand > ((1+sqrt(5))) give me 5^(3/2)+ 3 sqrt(5) + 16. How can I convert 5^(3/2) to > 5 5^(1/2) ? > > thanks > > z.x.l > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun Feb 5 13:09:03 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 5 Feb 2012 14:09:03 -0500 Subject: [Maxima] How can I convert 5^(3/2) to 5* 5^(1/2) In-Reply-To: References: Message-ID: PS And if you want to recurse down the whole expression, you can either use scanmap(separate_roots, ...) or separate_roots(ex):= if mapatom(ex) then ex elseif inpart(ex,0)="^" then block([b:inpart(ex,1),e:inpart(ex,2)], if numberp(b) and numberp(e) then b^truncate(e)*box(b^(e-truncate(e))) else map('separate_roots,ex)) else map('separate_roots,ex)$ -s On Sun, Feb 5, 2012 at 14:07, Stavros Macrakis wrote: > 5^(3/2) is Maxima's standard way of expressing sqrt(5)^3 = 5*sqrt(5). It > is important in Maxima to have standard ways of expressing such things, > otherwise it risks not simplifying e.g. 5*sqrt(5) - 5^(3/2). > > Since Maxima is programmable, you can of course generate whatever form you > want -- though you shouldn't use the standard sqrt function, since Maxima > "knows" about it and will simplify it. > > Here is one simple trick: > > (%i1) display2d:false$ > (%i2) 5^(3/2); > (%o2) 5^(3/2) > (%i3) ratsubst(sqr(5),sqrt(5),%o2); > (%o3) sqr(5)^3 > (%i4) ratsubst(5,sqr(5)^2,%o3); > (%o4) 5*sqr(5) > > Of course, subsequent calculations won't know that sqr(5)^2 = 5. > > You could also do something like this: > > separate_roots(ex):= > if mapatom(ex) > then ex > elseif inpart(ex,0)="^" > then block([b:inpart(ex,1),e:inpart(ex,2)], > if numberp(b) and numberp(e) > then b^truncate(e)*box(b^(e-truncate(e))) <<< box "protects" from > simplification > else ex) > else ex$ > > This produces ugly results (with box), especially for negative powers, but > you should be able to customize this to something more of your liking. > > -s > > On Sat, Feb 4, 2012 at 10:41, zxl wrote: > >> hello: >> >> I hope expand (a+b sqrt(5))^n to the form A+B sqrt(5), but expand >> ((1+sqrt(5))) give me 5^(3/2)+ 3 sqrt(5) + 16. How can I convert 5^(3/2) to >> 5 5^(1/2) ? >> >> thanks >> >> z.x.l >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Sun Feb 5 13:33:12 2012 From: woollett at charter.net (Edwin Woollett) Date: Sun, 5 Feb 2012 11:33:12 -0800 Subject: [Maxima] get name of variable as string in function? Message-ID: On Feb. 4, 2012, Robert Dodier wrote: ---------------------------------- >> I would like to define mprint(var) such that >> mprint(a) would give >> a = (value of a) >> >Isn't that exactly what display(a) does? --------------------------------------------- See bug item #3484414 and recent mailing list about display. You are correct that this is what display used to do, but with ver. 5.26.0, (false) precedes the display output if display2d is set to false. Thanks for your interest, Ted From zhaxiaolei at gmail.com Mon Feb 6 09:42:58 2012 From: zhaxiaolei at gmail.com (zxl) Date: Mon, 6 Feb 2012 23:42:58 +0800 Subject: [Maxima] How can I convert 5^(3/2) to 5* 5^(1/2) In-Reply-To: References: Message-ID: thanks ?Eric Reyssat and?Stavros Macrakis. Now I know that 1?5^(3/2) is somewhat "atom" in maxima; 2?radcan can expand (a+b sqrt(5))^n to A+B (5)^(1/2) or A+B (5)^(3/2). thanks On Sat, Feb 4, 2012 at 11:41 PM, zxl wrote: > > hello: > > I hope expand (a+b sqrt(5))^n ?to the form ?A+B sqrt(5), but expand ((1+sqrt(5))) give me 5^(3/2)+ 3 sqrt(5) + 16. How can I convert 5^(3/2) to 5 5^(1/2) ? > > thanks > > z.x.l From zhaxiaolei at gmail.com Mon Feb 6 09:59:46 2012 From: zhaxiaolei at gmail.com (zxl) Date: Mon, 6 Feb 2012 23:59:46 +0800 Subject: [Maxima] How can I convert 5^(3/2) to 5* 5^(1/2) In-Reply-To: References: Message-ID: some fix. 1?if B=5^k C, where 5 not divide C, then B 5^(1/2) will be represented as C 5^(k+1/2); 2?radcan can expand (a+b sqrt(5))^n to A+B 5^m where 5 not divide B. On Mon, Feb 6, 2012 at 11:42 PM, zxl wrote: > thanks ?Eric Reyssat and?Stavros Macrakis. Now I know that > > 1?5^(3/2) is somewhat "atom" in maxima; > > 2?radcan can expand (a+b sqrt(5))^n to A+B (5)^(1/2) ?or A+B (5)^(3/2). > > thanks > > On Sat, Feb 4, 2012 at 11:41 PM, zxl wrote: >> >> hello: >> >> I hope expand (a+b sqrt(5))^n ?to the form ?A+B sqrt(5), but expand ((1+sqrt(5))) give me 5^(3/2)+ 3 sqrt(5) + 16. How can I convert 5^(3/2) to 5 5^(1/2) ? >> >> thanks >> >> z.x.l From macrakis at alum.mit.edu Mon Feb 6 10:36:09 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 6 Feb 2012 11:36:09 -0500 Subject: [Maxima] How can I convert 5^(3/2) to 5* 5^(1/2) In-Reply-To: References: Message-ID: Just to be clear, none of this is specific to radcan. You'll get the same results with ratsimp or expand. -s On Mon, Feb 6, 2012 at 10:59, zxl wrote: > some fix. > > 1?if B=5^k C, where 5 not divide C, then B 5^(1/2) will be represented > as C 5^(k+1/2); > > 2?radcan can expand (a+b sqrt(5))^n to A+B 5^m where 5 not divide B. > > On Mon, Feb 6, 2012 at 11:42 PM, zxl wrote: > > thanks Eric Reyssat and Stavros Macrakis. Now I know that > > > > 1?5^(3/2) is somewhat "atom" in maxima; > > > > 2?radcan can expand (a+b sqrt(5))^n to A+B (5)^(1/2) or A+B (5)^(3/2). > > > > thanks > > > > On Sat, Feb 4, 2012 at 11:41 PM, zxl wrote: > >> > >> hello: > >> > >> I hope expand (a+b sqrt(5))^n to the form A+B sqrt(5), but expand > ((1+sqrt(5))) give me 5^(3/2)+ 3 sqrt(5) + 16. How can I convert 5^(3/2) to > 5 5^(1/2) ? > >> > >> thanks > >> > >> z.x.l > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Mon Feb 6 14:17:15 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 6 Feb 2012 12:17:15 -0800 Subject: [Maxima] display patch, was: get name of variable as string in function? Message-ID: On 2/5/12, Edwin Woollett wrote: > On Feb. 4, 2012, Robert Dodier wrote: > ---------------------------------- >>> I would like to define mprint(var) such that >>> mprint(a) would give >>> a = (value of a) >>> >>Isn't that exactly what display(a) does? > --------------------------------------------- > See bug item #3484414 and recent mailing list about display. > You are correct that this is what display used to do, but > with ver. 5.26.0, (false) precedes the display output > if display2d is set to false. Well, OK. No need to invent a work-around, it's easier to fix the bug. Here is a patch. Can someone commit this? My git sandbox is messed up (OH WONDERS OF GIT WILL YOU NEVER CEASE) and I can't take the time to straighten it out right now. best Robert Dodier PS. diff --git a/src/comm.lisp b/src/comm.lisp index 1282784..94c3823 100644 --- a/src/comm.lisp +++ b/src/comm.lisp @@ -753,7 +753,9 @@ (setq ans (list '(mequal simp) (disp2 l) ans))) (if lablist (nconc lablist (cons (elabel ans) nil))) (setq tim (get-internal-run-time)) - (displa (list '(mlable) (if lablist linelable) ans)) + (let ((*display-labels-p* nil)) + (declare (special *display-labels-p*)) + (displa (list '(mlable) (if lablist linelable) ans))) (mterpri) (timeorg tim))) From not0read0765 at yopmail.com Tue Feb 7 02:17:06 2012 From: not0read0765 at yopmail.com (Olive) Date: Tue, 7 Feb 2012 09:17:06 +0100 Subject: [Maxima] numeric approximation Message-ID: <20120207091706.0f12eeef@yopmail.com> My experiment: (%i1) f(t):=''(integrate(1/(sin(x)^2+log(x)),x,1,t)); t / [ 1 (%o1) f(t) := I ---------------- dx ] 2 / sin (x) + log(x) 1 (%i2) f(5), numer; 5 / [ 1 (%o2) I ---------------- dx ] 2 / sin (x) + log(x) 1 It seems that (%i1) correctly define a function f(t) and maxima is indeed able to derive it. Why (%o2) does not give a numeric approximation of f(5)? What I have to do to get it? How can I plot f? Olive From not0read0765 at yopmail.com Tue Feb 7 02:32:13 2012 From: not0read0765 at yopmail.com (Olive) Date: Tue, 7 Feb 2012 09:32:13 +0100 Subject: [Maxima] numeric approximation References: <20120207091706.0f12eeef@yopmail.com> Message-ID: <20120207093213.4380d923@yopmail.com> On Tue, 7 Feb 2012 09:17:06 +0100 Olive wrote: > My experiment: > > (%i1) f(t):=''(integrate(1/(sin(x)^2+log(x)),x,1,t)); > t > / > [ 1 > (%o1) f(t) := I ---------------- dx > ] 2 > / sin (x) + log(x) > 1 > (%i2) f(5), numer; > 5 > / > [ 1 > (%o2) I ---------------- dx > ] 2 > / sin (x) + log(x) > 1 > It seems that (%i1) correctly define a function f(t) and maxima is > indeed able to derive it. Why (%o2) does not give a numeric > approximation of f(5)? What I have to do to get it? How can I plot f? By reading the documentation, I can define: f_numer(t):=quad_qag(1/(sin(x)^2+log(x)),x,1,t,1)[1]; and f_numer give a numeric approximation of f. But is it possible to connect f(t) and f_numer(t)? Both represent intrinsically the same function (f(t) is the symbolic representation of f_numer(t)). Olive From dbmaxima at gmail.com Tue Feb 7 04:56:16 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Tue, 07 Feb 2012 21:56:16 +1100 Subject: [Maxima] display patch, was: get name of variable as string in function? In-Reply-To: References: Message-ID: <4F310350.5070503@gmail.com> On 7/02/2012 7:17 AM, Robert Dodier wrote: > On 2/5/12, Edwin Woollett wrote: >> On Feb. 4, 2012, Robert Dodier wrote: >> ---------------------------------- >>>> I would like to define mprint(var) such that >>>> mprint(a) would give >>>> a = (value of a) >>>> >>> Isn't that exactly what display(a) does? >> --------------------------------------------- >> See bug item #3484414 and recent mailing list about display. >> You are correct that this is what display used to do, but >> with ver. 5.26.0, (false) precedes the display output >> if display2d is set to false. > Well, OK. No need to invent a work-around, it's easier to fix the bug. > Here is a patch. Can someone commit this? My git sandbox > is messed up (OH WONDERS OF GIT WILL YOU NEVER CEASE) > and I can't take the time to straighten it out right now. > > best > > Robert Dodier Done. From rswarbrick at gmail.com Tue Feb 7 05:07:13 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Tue, 07 Feb 2012 11:07:13 +0000 Subject: [Maxima] numeric approximation References: <20120207091706.0f12eeef@yopmail.com> <20120207093213.4380d923@yopmail.com> Message-ID: <28d709xlah.ln2@hake.rswarbrick.dnsalias.com> Olive writes: >> >> (%i1) f(t):=''(integrate(1/(sin(x)^2+log(x)),x,1,t)); > > By reading the documentation, I can define: > > f_numer(t):=quad_qag(1/(sin(x)^2+log(x)),x,1,t,1)[1]; > > and f_numer give a numeric approximation of f. But is it possible to > connect f(t) and f_numer(t)? Both represent intrinsically the same > function (f(t) is the symbolic representation of f_numer(t)). > > Olive I don't know what the answer *should* be, but what's going on is that maxima doesn't know of a relationship between "integrate" and "quad_qag". So g(x) := 1/(sin(x)^2+log(x)); f(t) := integrate (g(x), x, 1, t); f_numer(t) := quad_qag(g(x),x,1,t,1)[1]; is reasonable enough (not tested!), but maxima doesn't have a way to say f(t), gimme_a_number; Notice that there are several numerical integration routines and that (as far as I know) clever numerical analyst types haven't found a way to automatically determine which one is most appropriate, so it's not clear how one would implement the "gimme_a_number" flag. Also, numerical routines also return a guess at their error, which you're throwing away in your code above. How should that be treated by the "gimme_a_number" flag? Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From jan.mueller at math.uni-dortmund.de Tue Feb 7 09:23:07 2012 From: jan.mueller at math.uni-dortmund.de (=?ISO-8859-1?Q?Jan_Hendrik_M=FCller?=) Date: Tue, 07 Feb 2012 16:23:07 +0100 Subject: [Maxima] plot of plsquares polynom In-Reply-To: References: <4F2977A8.9020806@math.uni-dortmund.de> Message-ID: <4F3141DB.7070403@math.uni-dortmund.de> To whom may be interested, this works fine: load(numericalio)$ M:read_matrix("...root.../Transportkosten3.txt")$ load("plsquares")$ gl:plsquares(M,[x,y,z],z,2)$ fpprintprec:4$ float(gl); load("draw")$ draw3d( title = "kleinste Quadrate Fl?che", xlabel = "Entfernung", ylabel = "Gewicht", zlabel = "Transportkosten", point_size=2, color=black, points(M), grid=true, explicit(rhs(gl), x,0,350, y,0,100)); Thanks to Robert and Mario (por los informationes sobre draw3d) Jan Robert Dodier schrieb: > Looks like the return value of plsquares is an equation z = .... > Try something like > > foo : plsquares (...); > plot3d (rhs (foo), [x, ...], [y, ...]); > > HTH > > Robert Dodier > > > On 2/1/12, Jan Hendrik M?ller wrote: >> Hi all, >> two questions: >> - how can z be plotted? plsquares works fine but the plot doesn't work >> load("plsquares")$ >> >> plsquares(matrix([1,2,0],[3,5,4],[4,7,9],[5,8,10],[1,3,4],[2,5,7],[1,6,9],[3,1,4],[1,1,1],[4,3,6],[6,7,8]),[x,y,z],z,3,3)$ >> plot3d(z, [x,0,9], [y,0,9]); >> - the rows of the matrix (only as an example) have to be substituted by >> the lines of the .txt file attached. Any idea how to realise that is welcome >> Jan >> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Transportkosten3.txt URL: From vext01 at gmail.com Tue Feb 7 10:25:58 2012 From: vext01 at gmail.com (Edd Barrett) Date: Tue, 7 Feb 2012 16:25:58 +0000 Subject: [Maxima] Checking equivilence of equalities Message-ID: <20120207162558.GF22183@edd-i386.kent.ac.uk> Hi, First of all, I am new on this list -- thanks for your CAS system, I use it a lot for my studies. I have a couple of questions regarding maxima that I will ask in separate threads to avoid confusion. Is there a way of checking equivalence of two equalities in maxima. Eg: a = 1 and a - 1 = 0 are equivalent. Looking at the manual, equal() looks like a goo bet, however: `is(equal(a=1, a-1=0)` is false. It looks like equal() deals only with expressions and not equalities? I could make the equalities of the form `0 = ` and then perform `equal(rhs(e), rhs(e2))` ? Cheers -- Best Regards Edd Barrett http://www.theunixzoo.co.uk From vext01 at gmail.com Tue Feb 7 10:38:05 2012 From: vext01 at gmail.com (Edd Barrett) Date: Tue, 7 Feb 2012 16:38:05 +0000 Subject: [Maxima] "guarded" fetch from hashed array Message-ID: <20120207163805.GG22183@edd-i386.kent.ac.uk> Hi again, I wish to use a hash table to store a mapping from a variable name to a list of coefficients. This is accomplished easily enough in maxima, however, is there a way of throwing an error if the key accessed is not a key in the hash table? Why? Because if the key does not exist, the expression is interpreted as a symbolic expression, eg: hash[a] : "aaa"$ So, `hash[a]` would return "aaa", but `hash[b]` is a non-existing key and thus the expression evaluates symbolically to "hash_{b}" (subscript b). The question arises, "Did the hash[b] map to hash_{b} or was the key non-existent"? My current solution is silly: pget(x, hash) := ( info : arrayinfo(hash), /* strip non-keys */ for i:1 thru 2 do ( info : delete(first(info), info, 1) ), if member(x, info) then hash[x] else ( error("ERROR: Unknown variable", x), false ) )$ This makes my hash table lookup linear :\ What is the correct way? -- Best Regards Edd Barrett http://www.theunixzoo.co.uk From villate at fe.up.pt Tue Feb 7 11:52:49 2012 From: villate at fe.up.pt (Jaime Villate) Date: Tue, 07 Feb 2012 17:52:49 +0000 Subject: [Maxima] "guarded" fetch from hashed array In-Reply-To: <20120207163805.GG22183@edd-i386.kent.ac.uk> References: <20120207163805.GG22183@edd-i386.kent.ac.uk> Message-ID: <4F3164F1.5010808@fe.up.pt> On 02/07/2012 04:38 PM, Edd Barrett wrote: > I wish to use a hash table to store a mapping from a variable name to a > list of coefficients. This is accomplished easily enough in maxima, > however, is there a way of throwing an error if the key accessed is not > a key in the hash table? Have you tried with atom? (%i2) hash[a]: "aaa"$ (%i3) atom(hash[a]); (%o3) true (%i4) atom(hash[b]); (%o4) false Regards, Jaime From vext01 at gmail.com Tue Feb 7 12:29:32 2012 From: vext01 at gmail.com (Edd Barrett) Date: Tue, 7 Feb 2012 18:29:32 +0000 Subject: [Maxima] "guarded" fetch from hashed array In-Reply-To: <4F3164F1.5010808@fe.up.pt> References: <20120207163805.GG22183@edd-i386.kent.ac.uk> <4F3164F1.5010808@fe.up.pt> Message-ID: <20120207182932.GK22183@edd-i386.kent.ac.uk> On Tue, Feb 07, 2012 at 05:52:49PM +0000, Jaime Villate wrote: > On 02/07/2012 04:38 PM, Edd Barrett wrote: > >I wish to use a hash table to store a mapping from a variable name to a > >list of coefficients. This is accomplished easily enough in maxima, > >however, is there a way of throwing an error if the key accessed is not > >a key in the hash table? > Have you tried with atom? > > (%i2) hash[a]: "aaa"$ > (%i3) atom(hash[a]); > (%o3) true > (%i4) atom(hash[b]); > (%o4) false Great. Actually, my hash contains lists, so I can use listp() similarly. I bet there is a better way still... -- Best Regards Edd Barrett http://www.theunixzoo.co.uk From woollett at charter.net Tue Feb 7 12:55:11 2012 From: woollett at charter.net (Edwin Woollett) Date: Tue, 07 Feb 2012 18:55:11 -0000 Subject: [Maxima] numeric approximation Message-ID: <9A6E6641BF664E3EA8831C1ECBB61945@edwinc367e16bd> On Feb. 7, 2012, Rupert Swarbrick wrote: ----------------------------- >Notice that there are several numerical integration routines and that >(as far as I know) clever numerical analyst types haven't found a way to >automatically determine which one is most appropriate, so it's not clear >how one would implement the "gimme_a_number" flag. Also, numerical >routines also return a guess at their error, which you're throwing away >in your code above. How should that be treated by the "gimme_a_number" >flag? ----------------------------------- A "wrapper" for the quadpack routines is something I have been diligently working on, as part of a software package for an updated version of Ch. 8, Numerical Integration, (Maxima by Example). The one-dimensional quadrature code is basically done, and I am now trying to integrate two dimensional code into the package. This code first tries integrate to get an exact symbolic answer (if possible). Due to some bugs in the special functions area, there are automatic filters to bypass integrate and go directly to quadpack (this also includes multiple valued functions case). The code then chooses between the quadpack routines using a variety of methods and option flags. If quadpack returns a serious error code, the function nint will return 'false' together with a plain English error message. The one and two dimensional versions of nint are tested with all the demonstration numerical integrals posted by Mathematica, together with a variety of integrals that need to be checked because of various Maxima peculiarities. The particular example Olive has submitted can then be handled as follows: ----------------------------------------------------- Maxima 5.26.0 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) load(nint); (%o1) "c:/work2/nint.mac" (%i2) g : 1/(sin(x)^2 + log(x))$ (%i3) f(t) := nint(g,x,1,t)$ (%i4) f(5); (%o4) 2.729767710374242 (%i5) goutL; (%o5) [[qag,2.729767710374242,3.3769724748722686E-12,93,0]] -------------------------------------- Ted Woollett http://www.csulb.edu/~woollett/ From willisb at unk.edu Tue Feb 7 13:35:10 2012 From: willisb at unk.edu (Barton Willis) Date: Tue, 7 Feb 2012 13:35:10 -0600 Subject: [Maxima] "guarded" fetch from hashed array In-Reply-To: <20120207182932.GK22183@edd-i386.kent.ac.uk> References: <20120207163805.GG22183@edd-i386.kent.ac.uk> <4F3164F1.5010808@fe.up.pt> <20120207182932.GK22183@edd-i386.kent.ac.uk> Message-ID: Also, The assoc function (enter ? assoc) might be useful. --Barton maxima-bounces at math.utexas.edu wrote on 02/07/2012 12:29:32 PM: > From: Edd Barrett > To: Jaime Villate > Cc: maxima at math.utexas.edu > Date: 02/07/2012 12:25 PM > Subject: Re: [Maxima] "guarded" fetch from hashed array > Sent by: maxima-bounces at math.utexas.edu > > On Tue, Feb 07, 2012 at 05:52:49PM +0000, Jaime Villate wrote: > > On 02/07/2012 04:38 PM, Edd Barrett wrote: > > >I wish to use a hash table to store a mapping from a variable name to a > > >list of coefficients. This is accomplished easily enough in maxima, > > >however, is there a way of throwing an error if the key accessed is not > > >a key in the hash table? > > Have you tried with atom? > > > > (%i2) hash[a]: "aaa"$ > > (%i3) atom(hash[a]); > > (%o3) true > > (%i4) atom(hash[b]); > > (%o4) false > > Great. > > Actually, my hash contains lists, so I can use listp() similarly. > > I bet there is a better way still... > > -- > Best Regards > Edd Barrett > > http://www.theunixzoo.co.uk > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Tue Feb 7 13:50:00 2012 From: woollett at charter.net (Edwin Woollett) Date: Tue, 07 Feb 2012 19:50:00 -0000 Subject: [Maxima] numeric approximation Message-ID: <735ED2F1E5624EB9BF9AC7F66AA49A1C@edwinc367e16bd> On Feb. 7, 2012, I wrote: ------------------------------------ (%i1) load(nint); (%o1) "c:/work2/nint.mac" (%i2) g : 1/(sin(x)^2 + log(x))$ (%i3) f(t) := nint(g,x,1,t)$ (%i4) f(5); (%o4) 2.729767710374242 (%i5) goutL; (%o5) [[qag,2.729767710374242,3.3769724748722686E-12,93,0]] -------------------------------- then one can make a table, for example: (%i6) ntable (func, x0, dx, xf):= block([nL, fL, nfL, jj, ii], nL : makelist (zz, zz, x0, xf, dx), fL : map ('func, nL), nfL : makelist ( [" ", nL[jj], " ", fL[jj] ], jj, length(nL)), for ii thru length (nfL) do apply ('print, nfL[ii]))$ (%i7) ntable ( 'f, 2, 2, 10)$ 2 0.80395247146645 4 2.307860373006648 6 3.188145387618254 8 4.049252091167718 10 4.843537149824256 (%i8) time(%); (%o8) [1.64] ---------------------------- Ted Woollett From macrakis at alum.mit.edu Tue Feb 7 15:00:23 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 7 Feb 2012 16:00:23 -0500 Subject: [Maxima] Checking equivilence of equalities In-Reply-To: <20120207162558.GF22183@edd-i386.kent.ac.uk> References: <20120207162558.GF22183@edd-i386.kent.ac.uk> Message-ID: You could certainly do something like is ( equal( lhs(eq1)-rhs(eq1) , lhs(eq2)-rhs(eq2) ) ) as you suggest, but that does NOT test that the truth-values of the equations are the same. After all, 2*x=0 and x=0 are equivalent equations, but 2*x is not equal to x. Logically, what you want is something like is ( equal( zerop(lhs(eq1)-rhs(eq1)) , zerop( lhs(eq2)-rhs(eq2) ) ) ) but Maxima doesn't support any such zerop function. You could define zerop(q) := signum(q)^2 , which is perfectly correct, but the system won't be able to do anything useful with that. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Tue Feb 7 15:34:58 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 07 Feb 2012 13:34:58 -0800 Subject: [Maxima] "guarded" fetch from hashed array In-Reply-To: <20120207163805.GG22183@edd-i386.kent.ac.uk> References: <20120207163805.GG22183@edd-i386.kent.ac.uk> Message-ID: <4F319902.3040202@eecs.berkeley.edu> Here is how you make all non-entries produce an error. hash[x]:= error("ERROR ", x); /* try it out */ hash[a]:aaa; hash[a]; hash[b]; From woollett at charter.net Tue Feb 7 15:51:20 2012 From: woollett at charter.net (Edwin Woollett) Date: Tue, 07 Feb 2012 21:51:20 -0000 Subject: [Maxima] display patch, was: get name of variable as string in function? Message-ID: <991931A0F3EA4FD8AED3827D2FD0112F@edwinc367e16bd> On Feb. 6, 2012, Robert Dodier wrote: ------------------------ ....No need to invent a work-around, it's easier to fix the bug. Here is a patch..... ----------------------------- Thanks for the patch. Ted From vext01 at gmail.com Tue Feb 7 17:26:23 2012 From: vext01 at gmail.com (Edd Barrett) Date: Tue, 7 Feb 2012 23:26:23 +0000 Subject: [Maxima] "guarded" fetch from hashed array In-Reply-To: <4F319902.3040202@eecs.berkeley.edu> References: <20120207163805.GG22183@edd-i386.kent.ac.uk> <4F319902.3040202@eecs.berkeley.edu> Message-ID: <20120207232623.GL22183@edd-i386.kent.ac.uk> On Tue, Feb 07, 2012 at 01:34:58PM -0800, Richard Fateman wrote: > Here is how you make all non-entries produce an error. > hash[x]:= error("ERROR ", x); Perfect! Many thanks -- Best Regards Edd Barrett http://www.theunixzoo.co.uk From woollett at charter.net Tue Feb 7 17:27:28 2012 From: woollett at charter.net (Edwin Woollett) Date: Tue, 07 Feb 2012 23:27:28 -0000 Subject: [Maxima] numeric approximation Message-ID: On Feb. 7, 2012, I wrote ----------------------------------------- >(%i1) load(nint); >(%o1) "c:/work2/nint.mac" >(%i2) g : 1/(sin(x)^2 + log(x))$ >(%i3) f(t) := nint(g,x,1,t)$ >(%i4) f(5); >(%o4) 2.729767710374242 >(%i5) goutL; >(%o5) [[qag,2.729767710374242,3.3769724748722686E-12,93,0]] >-------------------------------- >then one can make a table, for example: >(%i6) ntable (func, x0, dx, xf):= >block([nL, fL, nfL, jj, ii], > nL : makelist (zz, zz, x0, xf, dx), > fL : map ('func, nL), > nfL : makelist ( [" ", nL[jj], " ", fL[jj] ], jj, length(nL)), > for ii thru length (nfL) do apply ('print, nfL[ii]))$ >(%i7) ntable ( 'f, 2, 2, 10)$ > 2 0.80395247146645 > 4 2.307860373006648 > 6 3.188145387618254 > 8 4.049252091167718 > 10 4.843537149824256 >(%i8) time(%); >(%o8) [1.64] -------------------------------------- Of course it is much easier (but slightly slower) to use print with a do loop: ------------------------------------------ (%i20) for j:2 step 2 thru 10 do print(" ",j," ",f(j))$ 2 0.80395247146645 4 2.307860373006648 6 3.188145387618254 8 4.049252091167718 10 4.843537149824256 (%i21) time(%); (%o21) [2.11] --------------------------------- and much easier to define a table function in terms of the do loop: ---------------------------------------- (%i22) ftable(func,x0,xf,dx) := block([jj], for jj:x0 step dx thru xf do print(" ",jj," ",func(jj)))$ (%i23) ftable(f,2,10,2)$ 2 0.80395247146645 4 2.307860373006648 6 3.188145387618254 8 4.049252091167718 10 4.843537149824256 (%i24) time(%); (%o24) [2.71] -------------------------- Ted Woollett From vext01 at gmail.com Wed Feb 8 04:36:32 2012 From: vext01 at gmail.com (Edd Barrett) Date: Wed, 8 Feb 2012 10:36:32 +0000 Subject: [Maxima] Checking equivilence of equalities In-Reply-To: References: <20120207162558.GF22183@edd-i386.kent.ac.uk> Message-ID: <20120208103632.GP22183@edd-i386.kent.ac.uk> On Tue, Feb 07, 2012 at 04:00:23PM -0500, Stavros Macrakis wrote: > You could certainly do something like > > is ( equal( lhs(eq1)-rhs(eq1) , lhs(eq2)-rhs(eq2) ) ) > > as you suggest, but that does NOT test that the truth-values of the > equations are the same. > > After all, 2*x=0 and x=0 are equivalent equations, but 2*x is not equal to > x. Logically, what you want is something like > > is ( equal( zerop(lhs(eq1)-rhs(eq1)) , zerop( > lhs(eq2)-rhs(eq2) ) ) ) > > but Maxima doesn't support any such zerop function. > > You could define zerop(q) := signum(q)^2 , which is perfectly correct, but > the system won't be able to do anything useful with that. > > -s I am quite suprised that this functionality does not exist. I would have thought that equality equivilence would be a commonly used feature in a CAS system. I will raise a feature request and see what the developers say. Cheers -- Best Regards Edd Barrett http://www.theunixzoo.co.uk From macrakis at alum.mit.edu Wed Feb 8 05:01:31 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 8 Feb 2012 06:01:31 -0500 Subject: [Maxima] Checking equivilence of equalities In-Reply-To: <20120208103632.GP22183@edd-i386.kent.ac.uk> References: <20120207162558.GF22183@edd-i386.kent.ac.uk> <20120208103632.GP22183@edd-i386.kent.ac.uk> Message-ID: Could you give some examples of non-trivial situations where this functionality is useful? That might help in thinking about approaches. Your current example is easily handled with 'solve' but of course that won't work when Maxima can't solve the equations. -s On Feb 8, 2012 5:32 AM, "Edd Barrett" wrote: > On Tue, Feb 07, 2012 at 04:00:23PM -0500, Stavros Macrakis wrote: > > You could certainly do something like > > > > is ( equal( lhs(eq1)-rhs(eq1) , lhs(eq2)-rhs(eq2) ) ) > > > > as you suggest, but that does NOT test that the truth-values of the > > equations are the same. > > > > After all, 2*x=0 and x=0 are equivalent equations, but 2*x is not equal > to > > x. Logically, what you want is something like > > > > is ( equal( zerop(lhs(eq1)-rhs(eq1)) , zerop( > > lhs(eq2)-rhs(eq2) ) ) ) > > > > but Maxima doesn't support any such zerop function. > > > > You could define zerop(q) := signum(q)^2 , which is perfectly correct, > but > > the system won't be able to do anything useful with that. > > > > -s > > I am quite suprised that this functionality does not exist. I would have > thought that equality equivilence would be a commonly used feature in a > CAS system. > > I will raise a feature request and see what the developers say. > > Cheers > > -- > Best Regards > Edd Barrett > > http://www.theunixzoo.co.uk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vext01 at gmail.com Wed Feb 8 05:06:42 2012 From: vext01 at gmail.com (Edd Barrett) Date: Wed, 8 Feb 2012 11:06:42 +0000 Subject: [Maxima] "guarded" fetch from hashed array In-Reply-To: <4F319902.3040202@eecs.berkeley.edu> References: <20120207163805.GG22183@edd-i386.kent.ac.uk> <4F319902.3040202@eecs.berkeley.edu> Message-ID: <20120208110642.GQ22183@edd-i386.kent.ac.uk> On Tue, Feb 07, 2012 at 01:34:58PM -0800, Richard Fateman wrote: > Here is how you make all non-entries produce an error. > hash[x]:= error("ERROR ", x); > > /* try it out */ > > hash[a]:aaa; > > > > hash[a]; > > hash[b]; Whilst this works in the simple case, it did not work in the context I wish to use it -- contrived example follows: ---8<--- (%i0) kill(all)$ (%i1) new_hash() := ( hash : make_array(hashed), hash[x] := error("Error: ", x), /* populate */ hash[a] : 1, hash[b] : 2, hash[c] : 3, hash )$ (%i2) h : new_hash(); (%o2) HashTable (%i3) h[a]; (%o3) false ---8<--- It seems like the 'hash[x] := error(...)' declaration is syntactic, in that it will only match for hashes called 'hash'; the behavior is not associated with the hash itself. However, I would not have expected 'h[a]' to return false. That is a mystery. If you remove the 'hash[x] := error(...)' from new_hash(), 'h[a]' returns 1 as expected. A bug? -- Best Regards Edd Barrett http://www.theunixzoo.co.uk From vext01 at gmail.com Wed Feb 8 05:10:17 2012 From: vext01 at gmail.com (Edd Barrett) Date: Wed, 8 Feb 2012 11:10:17 +0000 Subject: [Maxima] Checking equivilence of equalities In-Reply-To: References: <20120207162558.GF22183@edd-i386.kent.ac.uk> <20120208103632.GP22183@edd-i386.kent.ac.uk> Message-ID: <20120208111017.GR22183@edd-i386.kent.ac.uk> On Wed, Feb 08, 2012 at 06:01:31AM -0500, Stavros Macrakis wrote: > Could you give some examples of non-trivial situations where this > functionality is useful? That might help in thinking about approaches. > Your current example is easily handled with 'solve' but of course that > won't work when Maxima can't solve the equations. I am writing regression tests for a maxima program that I have written. I will first decide test case inputs and then by hand determine the output I expect. When the tests are run, the actual result (as determined by my program( needs to be compared for equivilence to the expected result. Given that there are many ways to express the same equality, I either need to convert the equality into a canonical form and test for syntactic equality, or have maxima do this for me. I hope that explains this OK. -- Best Regards Edd Barrett http://www.theunixzoo.co.uk From rswarbrick at gmail.com Wed Feb 8 05:27:38 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Wed, 08 Feb 2012 11:27:38 +0000 Subject: [Maxima] Checking equivilence of equalities References: <20120207162558.GF22183@edd-i386.kent.ac.uk> <20120208103632.GP22183@edd-i386.kent.ac.uk> Message-ID: Edd Barrett writes: > On Tue, Feb 07, 2012 at 04:00:23PM -0500, Stavros Macrakis wrote: >> You could certainly do something like >> >> is ( equal( lhs(eq1)-rhs(eq1) , lhs(eq2)-rhs(eq2) ) ) >> >> as you suggest, but that does NOT test that the truth-values of the >> equations are the same. >> >> After all, 2*x=0 and x=0 are equivalent equations, but 2*x is not equal to >> x. Logically, what you want is something like >> >> is ( equal( zerop(lhs(eq1)-rhs(eq1)) , zerop( >> lhs(eq2)-rhs(eq2) ) ) ) >> >> but Maxima doesn't support any such zerop function. >> >> You could define zerop(q) := signum(q)^2 , which is perfectly correct, but >> the system won't be able to do anything useful with that. >> >> -s > > I am quite suprised that this functionality does not exist. I would have > thought that equality equivilence would be a commonly used feature in a > CAS system. > > I will raise a feature request and see what the developers say. Stavros is one of the core developers of Maxima. Also, look at the zeroequiv function, and maybe at past discussions of the topic. You might find this thread [1] interesting (it basically consists of people correctly telling me that I'm being very naive...). Less promising is [2]. Rupert [1] http://thread.gmane.org/gmane.comp.mathematics.maxima.general/25976/focus=25978 [2] http://article.gmane.org/gmane.comp.mathematics.maxima.general/10928 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From jan.mueller at math.uni-dortmund.de Wed Feb 8 06:07:13 2012 From: jan.mueller at math.uni-dortmund.de (Jan Mueller) Date: Wed, 8 Feb 2012 13:07:13 +0100 Subject: [Maxima] Checking equivilence of equalities In-Reply-To: References: <20120207162558.GF22183@edd-i386.kent.ac.uk> <20120208103632.GP22183@edd-i386.kent.ac.uk> Message-ID: Hope the following is a non-trivial example: from my point of view wxMaxima is becoming more and more popular in German secondary schools. Is(equal()) is a very helpful command to further Independent learning in Algebra, because pupils could check on their own if some algebraic transformations they made on their own are equivalent or not. From this point of view it would be nescessary that isequal-commands could check polynomial-equations and terms (e.g. with a maximum power of 3?), elementary exponential- and trigonometric equations and terms. But its up to you to decide if didactical aspects should play a role in the decision which commands should be developed or not Am 08.02.2012 um 12:01 schrieb Stavros Macrakis : > Could you give some examples of non-trivial situations where this functionality is useful? That might help in thinking about approaches. Your current example is easily handled with 'solve' but of course that won't work when Maxima can't solve the equations. > > -s > On Feb 8, 2012 5:32 AM, "Edd Barrett" wrote: > On Tue, Feb 07, 2012 at 04:00:23PM -0500, Stavros Macrakis wrote: > > You could certainly do something like > > > > is ( equal( lhs(eq1)-rhs(eq1) , lhs(eq2)-rhs(eq2) ) ) > > > > as you suggest, but that does NOT test that the truth-values of the > > equations are the same. > > > > After all, 2*x=0 and x=0 are equivalent equations, but 2*x is not equal to > > x. Logically, what you want is something like > > > > is ( equal( zerop(lhs(eq1)-rhs(eq1)) , zerop( > > lhs(eq2)-rhs(eq2) ) ) ) > > > > but Maxima doesn't support any such zerop function. > > > > You could define zerop(q) := signum(q)^2 , which is perfectly correct, but > > the system won't be able to do anything useful with that. > > > > -s > > I am quite suprised that this functionality does not exist. I would have > thought that equality equivilence would be a commonly used feature in a > CAS system. > > I will raise a feature request and see what the developers say. > > Cheers > > -- > Best Regards > Edd Barrett > > http://www.theunixzoo.co.uk > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Wed Feb 8 06:19:51 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Wed, 08 Feb 2012 12:19:51 +0000 Subject: [Maxima] Checking equivilence of equalities References: <20120207162558.GF22183@edd-i386.kent.ac.uk> <20120208103632.GP22183@edd-i386.kent.ac.uk> Message-ID: Jan Mueller writes: > Hope the following is a non-trivial example: from my point of view > wxMaxima is becoming more and more popular in German secondary > schools. Is(equal()) is a very helpful command to further Independent > learning in Algebra, because pupils could check on their own if some > algebraic transformations they made on their own are equivalent or > not. From this point of view it would be nescessary that > isequal-commands could check polynomial-equations and terms (e.g. with > a maximum power of 3?), elementary exponential- and trigonometric > equations and terms. But its up to you to decide if didactical aspects > should play a role in the decision which commands should be developed > or not Could one could write an "easy_equal_p" function or the like? This could go in share or even in src maybe, but it makes sense to distinguish it From something trying to do something more general... Maybe there is a list of functions that would be useful in a general teaching/learning package. I suspect they'd be reasonably easy to write. Do you have any other suggestions for some that should appear? Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From villate at fe.up.pt Wed Feb 8 09:35:12 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 08 Feb 2012 15:35:12 +0000 Subject: [Maxima] "guarded" fetch from hashed array In-Reply-To: <20120208110642.GQ22183@edd-i386.kent.ac.uk> References: <20120207163805.GG22183@edd-i386.kent.ac.uk> <4F319902.3040202@eecs.berkeley.edu> <20120208110642.GQ22183@edd-i386.kent.ac.uk> Message-ID: <4F329630.4040607@fe.up.pt> On 02/08/2012 11:06 AM, Edd Barrett wrote: > It seems like the 'hash[x] := error(...)' declaration is syntactic, in > that it will only match for hashes called 'hash'; the behavior is not > associated with the hash itself. That statement defines a function named hash, with one input variable x. You are also defining an array with the same function as the function and when use ask for hash[something] in some cases Maxima will give you the value of the function and in other cases the value of the array. That is a hack which should be handled with care. Also, notice that hash[x] := defines a "memoizing function", which will store its value in memory and then return it. For instance: (%i4) hash[b]; ERROR b #0: lambda([x],error("ERROR ",x))(x=b) The value lambda([x],error("ERROR ",x))(x=b) was stored in memory and then its result shown. In other words, every time you try hash[key] with an undefined key, you are using up more memory. Regards, Jaime From fateman at eecs.berkeley.edu Wed Feb 8 09:42:20 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 08 Feb 2012 07:42:20 -0800 Subject: [Maxima] "guarded" fetch from hashed array In-Reply-To: <20120208110642.GQ22183@edd-i386.kent.ac.uk> References: <20120207163805.GG22183@edd-i386.kent.ac.uk> <4F319902.3040202@eecs.berkeley.edu> <20120208110642.GQ22183@edd-i386.kent.ac.uk> Message-ID: <4F3297DC.10007@eecs.berkeley.edu> On 2/8/2012 3:06 AM, Edd Barrett wrote: I think you have to decide if you want a function with an associated default value other than those explicit values stored in a hash table, hash[x]:= .... or just a hash table defined via make_array(hashtable). The latter, defined in Maxima sometime after version 5.23.2 appears to me to be much less useful, and in particular does not have the functionality of defining default values. You are defining one of each. Omit the make_array and your contrived function works just fine. however, hash[a] and h[a] are the same. This can be fixed, perhaps by passing the name e.g. new_hash(h), but may require some diddling around to make sure the argument is properly evaluated. RJF > From villate at fe.up.pt Wed Feb 8 09:50:01 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 08 Feb 2012 15:50:01 +0000 Subject: [Maxima] "guarded" fetch from hashed array In-Reply-To: <4F329630.4040607@fe.up.pt> References: <20120207163805.GG22183@edd-i386.kent.ac.uk> <4F319902.3040202@eecs.berkeley.edu> <20120208110642.GQ22183@edd-i386.kent.ac.uk> <4F329630.4040607@fe.up.pt> Message-ID: <4F3299A9.3010809@fe.up.pt> On 02/08/2012 03:35 PM, Jaime Villate wrote: > On 02/08/2012 11:06 AM, Edd Barrett wrote: >> It seems like the 'hash[x] := error(...)' declaration is syntactic, in >> that it will only match for hashes called 'hash'; the behavior is not >> associated with the hash itself. > That statement defines a function named hash, with one input variable x. Please allow me to answer again, this time trying to be more clear: hash[x] := error(...) does not evaluate its arguments; "hash" and "x" will not be replaced with whatever values they might have within a loop or function body. Jaime From fateman at eecs.berkeley.edu Wed Feb 8 09:50:32 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 08 Feb 2012 07:50:32 -0800 Subject: [Maxima] Checking equivilence of equalities In-Reply-To: <20120208111017.GR22183@edd-i386.kent.ac.uk> References: <20120207162558.GF22183@edd-i386.kent.ac.uk> <20120208103632.GP22183@edd-i386.kent.ac.uk> <20120208111017.GR22183@edd-i386.kent.ac.uk> Message-ID: <4F3299C8.1040906@eecs.berkeley.edu> On 2/8/2012 3:10 AM, Edd Barrett wrote: > On Wed, Feb 08, 2012 at 06:01:31AM -0500, Stavros Macrakis wrote: >> Could you give some examples of non-trivial situations where this >> functionality is useful? That might help in thinking about approaches. >> Your current example is easily handled with 'solve' but of course that >> won't work when Maxima can't solve the equations. > I am writing regression tests for a maxima program that I have written. > I will first decide test case inputs and then by hand determine the > output I expect. > > When the tests are run, the actual result (as determined by my program( > needs to be compared for equivilence to the expected result. > > Given that there are many ways to express the same equality, I either > need to convert the equality into a canonical form and test for > syntactic equality, or have maxima do this for me. > > I hope that explains this OK. > Not really. If you compare EXPRESSIONS, this makes sense. If you compare EQUALITIES, then all you need to test for is 3 values. true, false, and unknown. 2=2 is true 2=3 is false f(x)=g(y) is presumably unknown. In the world of equalities, 4=4 is also true, so equal_test(2=2,4=4) is true. Is that what you want? The reason that some stuff, e.g. "comparing equalities" is not in Maxima or in any other computer algebra system, is that you probably don't need it. Comparing expressions, e.g. sin(x+2*%pi) and sin(x) DOES make sense. From fateman at eecs.berkeley.edu Wed Feb 8 10:09:43 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 08 Feb 2012 08:09:43 -0800 Subject: [Maxima] Equivalences. Re: Checking equivilence of equalities In-Reply-To: <4F3299C8.1040906@eecs.berkeley.edu> References: <20120207162558.GF22183@edd-i386.kent.ac.uk> <20120208103632.GP22183@edd-i386.kent.ac.uk> <20120208111017.GR22183@edd-i386.kent.ac.uk> <4F3299C8.1040906@eecs.berkeley.edu> Message-ID: <4F329E47.4000906@eecs.berkeley.edu> On 2/8/2012 7:50 AM, Richard Fateman wrote: > On 2/8/2012 3:10 AM, Edd Barrett wrote: >> On Wed, Feb 08, 2012 at 06:01:31AM -0500, Stavros Macrakis wrote: .... I think that what you want is this: for x being a single variable or a vector of variables... e1: A(x)=B(x) and e2: C(x)=D(x) are "equivalent" if for all values of x , A(x)=B(x) implies C(x)=D(x) AND C(x)=B(x) implies A(x)=B(x). As Stavros pointed out, if you solve(e1,x) and solve(e2,x) and the solutions are the same, then you are done, and Maxima has done the job. If you want another way of saying this, you could ask zeroequivalence of (C-D) subject to the relation A-B=0 and zeroequivalence of (A-B) subject to the relation C-D=0. A potentially useful goal that may have more general traction is finding an algorithm where you could reduce both e1 and e2 to a simpler form and then, even though you could not solve that, you could show they are the same. for example, e1: f(x)+4= g(x)+6 e2: f(x)-2 =g(x) could both be reduced to (say) f(x)=g(x)+2 For some classes of functions f and g this makes sense, e.g. finding minimal polynomials. RJF From villate at fe.up.pt Wed Feb 8 10:31:03 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 08 Feb 2012 16:31:03 +0000 Subject: [Maxima] Equivalences. Re: Checking equivilence of equalities In-Reply-To: <4F329E47.4000906@eecs.berkeley.edu> References: <20120207162558.GF22183@edd-i386.kent.ac.uk> <20120208103632.GP22183@edd-i386.kent.ac.uk> <20120208111017.GR22183@edd-i386.kent.ac.uk> <4F3299C8.1040906@eecs.berkeley.edu> <4F329E47.4000906@eecs.berkeley.edu> Message-ID: <4F32A347.8020202@fe.up.pt> On 02/08/2012 04:09 PM, Richard Fateman wrote: > e1: A(x)=B(x) and e2: C(x)=D(x) are "equivalent" if > > for all values of x , A(x)=B(x) implies C(x)=D(x) AND > C(x)=B(x) implies A(x)=B(x). > > As Stavros pointed out, if you solve(e1,x) and solve(e2,x) and the > solutions are the same, > then you are done, and Maxima has done the job. > > If you want another way of saying this, you could ask > > zeroequivalence of (C-D) subject to the relation A-B=0 and > > zeroequivalence of (A-B) subject to the relation C-D=0. > > A potentially useful goal that may have more general traction is > finding an algorithm > where you could reduce both e1 and e2 to > a simpler form and then, even though you could not solve that, you > could show they > are the same. > > for example, > e1: f(x)+4= g(x)+6 > e2: f(x)-2 =g(x) > > could both be reduced to (say) > > f(x)=g(x)+2 In some sense in this second case you are also solving the equations and comparing them: (%i1) solve(f+4=g+6, f); (%o1) [f = g + 2] (%i2) solve(f-2=g, f); (%o2) [f = g + 2] And again, this second example worked because we were able to find the solution. Cheers, Jaime From korte at lite.msu.edu Wed Feb 8 10:37:10 2012 From: korte at lite.msu.edu (Gerd Kortemeyer) Date: Wed, 8 Feb 2012 11:37:10 -0500 Subject: [Maxima] Equivalences. Re: Checking equivilence of equalities In-Reply-To: <4F32A347.8020202@fe.up.pt> References: <20120207162558.GF22183@edd-i386.kent.ac.uk> <20120208103632.GP22183@edd-i386.kent.ac.uk> <20120208111017.GR22183@edd-i386.kent.ac.uk> <4F3299C8.1040906@eecs.berkeley.edu> <4F329E47.4000906@eecs.berkeley.edu> <4F32A347.8020202@fe.up.pt> Message-ID: Hi, On Feb 8, 2012, at 11:31 AM, Jaime Villate wrote: > > In some sense in this second case you are also solving the equations and comparing them: > > (%i1) solve(f+4=g+6, f); > (%o1) [f = g + 2] > (%i2) solve(f-2=g, f); > (%o2) [f = g + 2] > > And again, this second example worked because we were able to find the solution. I agree. That's what I ended up doing for the LON-CAPA integration: http://www.math.utexas.edu/pipermail/maxima/2012/027556.html Works well, - Gerd. From vext01 at gmail.com Wed Feb 8 10:58:24 2012 From: vext01 at gmail.com (Edd Barrett) Date: Wed, 8 Feb 2012 16:58:24 +0000 Subject: [Maxima] Equivalences. Re: Checking equivilence of equalities In-Reply-To: References: <20120207162558.GF22183@edd-i386.kent.ac.uk> <20120208103632.GP22183@edd-i386.kent.ac.uk> <20120208111017.GR22183@edd-i386.kent.ac.uk> <4F3299C8.1040906@eecs.berkeley.edu> <4F329E47.4000906@eecs.berkeley.edu> <4F32A347.8020202@fe.up.pt> Message-ID: <20120208165824.GT22183@edd-i386.kent.ac.uk> On Wed, Feb 08, 2012 at 11:37:10AM -0500, Gerd Kortemeyer wrote: > Hi, > > On Feb 8, 2012, at 11:31 AM, Jaime Villate wrote: > > > > > In some sense in this second case you are also solving the equations and comparing them: > > > > (%i1) solve(f+4=g+6, f); > > (%o1) [f = g + 2] > > (%i2) solve(f-2=g, f); > > (%o2) [f = g + 2] > > > > And again, this second example worked because we were able to find the solution. > > I agree. That's what I ended up doing for the LON-CAPA integration: > > http://www.math.utexas.edu/pipermail/maxima/2012/027556.html > > Works well, Thanks for all of your replies. I think I can figure something out using solve() -- Best Regards Edd Barrett http://www.theunixzoo.co.uk From villate at fe.up.pt Wed Feb 8 11:02:09 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 08 Feb 2012 17:02:09 +0000 Subject: [Maxima] Equivalences. Re: Checking equivilence of equalities In-Reply-To: References: <20120207162558.GF22183@edd-i386.kent.ac.uk> <20120208103632.GP22183@edd-i386.kent.ac.uk> <20120208111017.GR22183@edd-i386.kent.ac.uk> <4F3299C8.1040906@eecs.berkeley.edu> <4F329E47.4000906@eecs.berkeley.edu> <4F32A347.8020202@fe.up.pt> Message-ID: <4F32AA91.9090301@fe.up.pt> On 02/08/2012 04:37 PM, Gerd Kortemeyer wrote: > Hi, > > On Feb 8, 2012, at 11:31 AM, Jaime Villate wrote: > >> In some sense in this second case you are also solving the equations and comparing them: >> >> (%i1) solve(f+4=g+6, f); >> (%o1) [f = g + 2] >> (%i2) solve(f-2=g, f); >> (%o2) [f = g + 2] >> >> And again, this second example worked because we were able to find the solution. > I agree. That's what I ended up doing for the LON-CAPA integration: > > http://www.math.utexas.edu/pipermail/maxima/2012/027556.html > > Works well, > In e-learning systems, you can check that the equations you are expecting as an answer to your questions can be solved with solve() and then you can confidently use an implementation like the following (unless you have genius students who can come up with equivalent algebraic equations that solve cannot handle). (%i2) equivp(e,f):= is(equal(solve(e,first(listofvars(e))),solve(f,first(listofvars(f)))))$ (%i3) e1: x^2-3*x+2=0$ (%i4) e2: 6*x-2*x^2-4=0$ (%i5) equivp(e1,e2); (%o5) true (%i6) e3: x+y=1$ (%i7) e4: x=1-y$ (%i8) equivp(e3,e4); (%o8) true (%i9) e5: x^2=1+y^2-2*y$ (%i10) e6: 4*y+2*x^2=2*y^2+2$ (%i11) equivp(e5,e6); (%o11) true But keep in mind that x=2 is not equivalent to x^2=4. Regards, Jaime From vext01 at gmail.com Wed Feb 8 11:10:56 2012 From: vext01 at gmail.com (Edd Barrett) Date: Wed, 8 Feb 2012 17:10:56 +0000 Subject: [Maxima] "guarded" fetch from hashed array In-Reply-To: <4F3297DC.10007@eecs.berkeley.edu> References: <20120207163805.GG22183@edd-i386.kent.ac.uk> <4F319902.3040202@eecs.berkeley.edu> <20120208110642.GQ22183@edd-i386.kent.ac.uk> <4F3297DC.10007@eecs.berkeley.edu> Message-ID: <20120208171056.GV22183@edd-i386.kent.ac.uk> On Wed, Feb 08, 2012 at 07:42:20AM -0800, Richard Fateman wrote: > however, hash[a] and h[a] are the same. I have also just realised that all variables are global in maxima unless explicitely marked local by block([], ...). This completely caught me off guard. -- Best Regards Edd Barrett http://www.theunixzoo.co.uk From macrakis at alum.mit.edu Wed Feb 8 11:20:15 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 8 Feb 2012 12:20:15 -0500 Subject: [Maxima] Equivalences. Re: Checking equivilence of equalities In-Reply-To: <4F32AA91.9090301@fe.up.pt> References: <20120207162558.GF22183@edd-i386.kent.ac.uk> <20120208103632.GP22183@edd-i386.kent.ac.uk> <20120208111017.GR22183@edd-i386.kent.ac.uk> <4F3299C8.1040906@eecs.berkeley.edu> <4F329E47.4000906@eecs.berkeley.edu> <4F32A347.8020202@fe.up.pt> <4F32AA91.9090301@fe.up.pt> Message-ID: Careful! The given solution has some problematic cases: listofvars(a+b=1) => [a, b] listofvars(b=1-a) => [b, a] So first(listofvars(...)) is not going to work. You could look at solutions in *all* variables, and sort the variables: sort(listofvars(...))); or the solutions: sort(solve(...)). More robustly, you might want to perform the symmdifference of the solution sets. If there is a family of solutions, they are parameterized: solve(a+b=1,[a,b]) => [[a = 1 - %r3, b = %r3]] solve(a+b=1,[a,b]) => [[a = 1 - %r4, b = %r4]] <<< new free variable names You may need to play with %rnum_list to handle this. Another big problem is that solve doesn't solve a lot of cases, e.g. solve(sin(x)^2+cos(x)^2=0,x) should give the empty set, but in fact just returns the equations. Are you interested in real solutions only? Solve generally gives all solutions, including complex. Solve uses arc-trig functions. etc. On Wed, Feb 8, 2012 at 12:02, Jaime Villate wrote: > On 02/08/2012 04:37 PM, Gerd Kortemeyer wrote: > >> Hi, >> >> On Feb 8, 2012, at 11:31 AM, Jaime Villate wrote: >> >> In some sense in this second case you are also solving the equations and >>> comparing them: >>> >>> (%i1) solve(f+4=g+6, f); >>> (%o1) [f = g + 2] >>> (%i2) solve(f-2=g, f); >>> (%o2) [f = g + 2] >>> >>> And again, this second example worked because we were able to find the >>> solution. >>> >> I agree. That's what I ended up doing for the LON-CAPA integration: >> >> http://www.math.utexas.edu/**pipermail/maxima/2012/027556.**html >> >> Works well, >> >> In e-learning systems, you can check that the equations you are > expecting as an answer to > your questions can be solved with solve() and then you can confidently use > an implementation > like the following (unless you have genius students who can come up with > equivalent algebraic > equations that solve cannot handle). > > (%i2) equivp(e,f):= is(equal(solve(e,first(** > listofvars(e))),solve(f,first(**listofvars(f)))))$ > > (%i3) e1: x^2-3*x+2=0$ > (%i4) e2: 6*x-2*x^2-4=0$ > (%i5) equivp(e1,e2); > (%o5) true > > (%i6) e3: x+y=1$ > (%i7) e4: x=1-y$ > (%i8) equivp(e3,e4); > (%o8) true > > (%i9) e5: x^2=1+y^2-2*y$ > (%i10) e6: 4*y+2*x^2=2*y^2+2$ > (%i11) equivp(e5,e6); > (%o11) true > > But keep in mind that x=2 is not equivalent to x^2=4. > > Regards, > Jaime > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Wed Feb 8 13:10:14 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 8 Feb 2012 14:10:14 -0500 Subject: [Maxima] "guarded" fetch from hashed array In-Reply-To: <20120208171056.GV22183@edd-i386.kent.ac.uk> References: <20120207163805.GG22183@edd-i386.kent.ac.uk> <4F319902.3040202@eecs.berkeley.edu> <20120208110642.GQ22183@edd-i386.kent.ac.uk> <4F3297DC.10007@eecs.berkeley.edu> <20120208171056.GV22183@edd-i386.kent.ac.uk> Message-ID: Dear Edd Barrett, I'm afraid you've come across one of the ugliest parts of Maxima. There are actually *two distinct kinds* of associative array in Maxima: "hashed" associative arrays (which you get without declarations), and "hash_table" associative arrays (which you get with make_array('hashed)). Bizarrely and inexcusably, the semantics of these two kinds of arrays are completely inconsistent. The "hash_table" style is problematic in various ways and I would recommend it be rethought and replaced. In the meantime, though, you can define the following: :lisp (defun $hash_table_defined (ar i) (multiple-value-bind (val ok) (marrayref-gensub ar i nil) ok)) Then hash_table_defined( <>, <> ) will return true or false. A simpler way to do this is just to make sure that FALSE is never a valid value. Since you are storing lists of variables, how can FALSE ever be valid? -s For example: *Hashed style* qq[3]: 5$ qq[3] => 5 OK qq[7] => qq[7] qq => qq << treated as an identifier, not as a first-class value kill(qq[3]) OK qq[3] => qq[3] restored to uninitialized state arrayinfo(qq) => [hashed,1,[3]] qq[5,5]: 999 => error -- must have consistent number of subscripts *Hash_table style* rr: make_array('hashed)$ rr[3]:5$ rr[3] => 5 OK rr[7] => false <<< inconsistent rr => {Lisp Array: #} << treated as a weird internal object kill(rr[3]) => error arrayinfo(rr) => [hash_table,1,3] << notice inconsistent conventions rr[5,5]: 999 => no error -- allows different numbers of subscripts arrayinfo(rr) => fatal error (implementation bug) -------------- next part -------------- An HTML attachment was scrubbed... URL: From vext01 at gmail.com Wed Feb 8 17:09:55 2012 From: vext01 at gmail.com (Edd Barrett) Date: Wed, 8 Feb 2012 23:09:55 +0000 Subject: [Maxima] "guarded" fetch from hashed array In-Reply-To: References: <20120207163805.GG22183@edd-i386.kent.ac.uk> <4F319902.3040202@eecs.berkeley.edu> <20120208110642.GQ22183@edd-i386.kent.ac.uk> <4F3297DC.10007@eecs.berkeley.edu> <20120208171056.GV22183@edd-i386.kent.ac.uk> Message-ID: <20120208230955.GW22183@edd-i386.kent.ac.uk> Thanks for geting back to me. On Wed, Feb 08, 2012 at 02:10:14PM -0500, Stavros Macrakis wrote: > The "hash_table" style is problematic in various ways and I would recommend > it be rethought and replaced. I would favor this. As a newcomer to maxima, I find these hashtables confusing. I guess I was looking for something like a Python dictionary... > In the meantime, though, you can define the following: > > :lisp (defun $hash_table_defined (ar i) (multiple-value-bind (val ok) > (marrayref-gensub ar i nil) ok)) I'll give it a go. Do you plan to implement something like this for real in maxima? -- Best Regards Edd Barrett http://www.theunixzoo.co.uk From macrakis at alum.mit.edu Wed Feb 8 17:10:06 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 8 Feb 2012 18:10:06 -0500 Subject: [Maxima] "guarded" fetch from hashed array In-Reply-To: <20120208230955.GW22183@edd-i386.kent.ac.uk> References: <20120207163805.GG22183@edd-i386.kent.ac.uk> <4F319902.3040202@eecs.berkeley.edu> <20120208110642.GQ22183@edd-i386.kent.ac.uk> <4F3297DC.10007@eecs.berkeley.edu> <20120208171056.GV22183@edd-i386.kent.ac.uk> <20120208230955.GW22183@edd-i386.kent.ac.uk> Message-ID: On Wed, Feb 8, 2012 at 18:09, Edd Barrett wrote: > Do you plan to implement something like this for real in maxima? No immediate plans, sorry. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Fri Feb 10 11:16:52 2012 From: woollett at charter.net (Edwin Woollett) Date: Fri, 10 Feb 2012 09:16:52 -0800 Subject: [Maxima] display patch, was: get name of variable as string in function? Message-ID: On Feb. 6, 2012, Robert Dodier wrote: ----------------------- >Well, OK. No need to invent a work-around, it's easier to fix the bug. >Here is a patch. Can someone commit this? My git sandbox >is messed up (OH WONDERS OF GIT WILL YOU NEVER CEASE) >and I can't take the time to straighten it out right now. [snip] >diff --git a/src/comm.lisp b/src/comm.lisp >index 1282784..94c3823 100644 >--- a/src/comm.lisp >+++ b/src/comm.lisp >@@ -753,7 +753,9 @@ > (setq ans (list '(mequal simp) (disp2 l) ans))) > (if lablist (nconc lablist (cons (elabel ans) nil))) > (setq tim (get-internal-run-time)) >- (displa (list '(mlable) (if lablist linelable) ans)) >+ (let ((*display-labels-p* nil)) >+ (declare (special *display-labels-p*)) >+ (displa (list '(mlable) (if lablist linelable) ans))) > (mterpri) > (timeorg tim))) ---------------------------------------- I am using the new version of comm.lisp downloaded from git, and find a peculiar interaction with integrate resulting in a lisp error: ------------------------------------ Maxima 5.26.0 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) integrate(-1/(x^2-x),x,-1/2,1/2); Principal Value (%o1) log(3) (%i2) load ("comm-new.lisp")$ (%i3) integrate(-1/(x^2-x),x,-1/2,1/2); Maxima encountered a Lisp error: Error in COND [or a callee]: The variable NUM is unbound. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%i4) build_info()$ Maxima version: 5.26.0 Maxima build date: 22:48 1/15/2012 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 ------------------------------------ Ted From toy.raymond at gmail.com Fri Feb 10 16:11:47 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 10 Feb 2012 14:11:47 -0800 Subject: [Maxima] display patch, was: get name of variable as string in function? In-Reply-To: References: Message-ID: On Fri, Feb 10, 2012 at 9:16 AM, Edwin Woollett wrote: > I am using the new version of comm.lisp downloaded from > git, and find a peculiar interaction with integrate > resulting in a lisp error: > > ------------------------------**------ > > Maxima 5.26.0 http://maxima.sourceforge.net > using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) > > > (%i1) integrate(-1/(x^2-x),x,-1/2,1/**2); > Principal Value > (%o1) log(3) > (%i2) load ("comm-new.lisp")$ > (%i3) integrate(-1/(x^2-x),x,-1/2,1/**2); > Maxima encountered a Lisp error: > > Error in COND [or a callee]: The variable NUM is unbound. > > I suspect this is not a problem with the new version. I'm guessing you will have the same problem if you load the original version of comm.lisp. With the current git version of maxima, I don't run into any problems (without loading com-new.lisp, separately). The output of integrate is different, though, but it is still correct. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Sat Feb 11 12:48:39 2012 From: woollett at charter.net (Edwin Woollett) Date: Sat, 11 Feb 2012 10:48:39 -0800 Subject: [Maxima] display patch, was: get name of variable as string in function? Message-ID: On Feb. 10, 2012, Raymond Toy wrote: ---------------------- >I suspect this is not a problem with the new version. I'm guessing you >will have the same problem if you load the original version of comm.lisp. > >With the current git version of maxima, I don't run into any problems... -------------------------------------------------------------------------- You are right - just loading in comm.lisp messes with integrate. ----------------------------------------------------------- (%i1) integrate(-1/(x^2-x),x,-1/2,1/2); Principal Value (%o1) log(3) (%i2) load ("comm-old.lisp")$ (%i3) integrate(-1/(x^2-x),x,-1/2,1/2); Maxima encountered a Lisp error: Error in COND [or a callee]: The variable NUM is unbound. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. ----------------------------------- Ted From toy.raymond at gmail.com Sat Feb 11 17:19:52 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 11 Feb 2012 15:19:52 -0800 Subject: [Maxima] display patch, was: get name of variable as string in function? In-Reply-To: References: Message-ID: On 2/11/12 10:48 AM, Edwin Woollett wrote: > On Feb. 10, 2012, Raymond Toy wrote: > ---------------------- >> I suspect this is not a problem with the new version. I'm guessing you >> will have the same problem if you load the original version of comm.lisp. >> >> With the current git version of maxima, I don't run into any problems... > -------------------------------------------------------------------------- > > You are right - just loading in comm.lisp messes with integrate. Not sure if it will make a difference, but you might want to compile and comm.lisp. Something like :lisp (load (compile-file "/comm.lisp")) Ray From woollett at charter.net Sun Feb 12 13:52:19 2012 From: woollett at charter.net (Edwin Woollett) Date: Sun, 12 Feb 2012 11:52:19 -0800 Subject: [Maxima] display patch, was: get name of variable as string in function? Message-ID: <7A87108A86304D8CBFD64F37B2AF7A23@edwinc367e16bd> On Feb. 11, 2012, Raymond Toy wrote: ------------------------------------------------ >Not sure if it will make a difference, but you might want to compile and >comm.lisp. Something like > > :lisp (load (compile-file "/comm.lisp")) --------------------------------------------------------------- This seems to work for me: (display2d:false set in my init file) ------------------------------------------ Maxima 5.26.0 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) a : 2$ (%i2) :lisp $_ ((MSETQ) $A 2) (%i2) :lisp (load (compile-file "c:/work2/comm-new.lisp")) Compiling c:/work2/comm-new.lisp. End of Pass 1. ;; Note: Tail-recursive call of SUBST1 was replaced by iteration. ;; Note: Tail-recursive call of SUBST2 was replaced by iteration. ;; Note: Tail-recursive call of $TRUNC was replaced by iteration. ;; Note: Tail-recursive call of DISP2 was replaced by iteration. ;; Note: Tail-recursive call of DISP2 was replaced by iteration. ;; Note: Tail-recursive call of FINDPOWERS1 was replaced by iteration. End of Pass 2. OPTIMIZE levels: Safety=2, Space=3, Speed=3 Finished compiling c:/work2/comm-new.lisp. 73680 (%i2) integrate(-1/(x^2-x),x,-1/2,1/2); Principal Value (%o2) log(3) (%i3) display(a)$ a = 2 --------------------------------- Thanks for the suggestion, Ted From p.blanchenay at lse.ac.uk Mon Feb 13 06:17:48 2012 From: p.blanchenay at lse.ac.uk (Patrick Blanchenay) Date: Mon, 13 Feb 2012 12:17:48 +0000 Subject: [Maxima] Graphing a function for several parameter values Message-ID: <4F38FF6C.2050104@lse.ac.uk> Dear list members, I am a somewhat beginner at Maxima, so please excuse me if my question is stupid. I would like to plot a function several times for different values of parameters. The function depends on a set of parameters, say paramOne and paramTwo. I would like to be able to specify several sets of those parameters, and for each set, get the function graphed. I do not want the number of parameter sets to be hard-coded, so I thought about using a for ... in ... do loop. This is what I tried, but it doesn't seem to work: parametersList: [ [paramOne=valueOne, paramTwo=valueTwo], [paramOne=valueThree, paramTwo=valueFour], ]$ for parameterSet in parametersList do block( i++, functionList[i] : ev(function(x,paramOne,paramTwo),parameterSet), return functionList ) wxplot2d(functionList,[x,0,1])$ Any suggestions? Thank you! Patrick PS: this was cross-posted on StackOverflow. From alserkli at inbox.ru Mon Feb 13 06:29:38 2012 From: alserkli at inbox.ru (Alexander Klimov) Date: Mon, 13 Feb 2012 14:29:38 +0200 Subject: [Maxima] Graphing a function for several parameter values In-Reply-To: <4F38FF6C.2050104@lse.ac.uk> References: <4F38FF6C.2050104@lse.ac.uk> Message-ID: On Mon, 13 Feb 2012, Patrick Blanchenay wrote: > I would like to plot a function several times for different values of > parameters. > > The function depends on a set of parameters, say paramOne and paramTwo. > I would like to be able to specify several sets of those parameters, and > for each set, get the function graphed. function: x * paramOne + paramTwo; parametersList: [ [paramOne=1, paramTwo=1], [paramOne=-1, paramTwo=0] ]$ functionList: map(lambda([p],ev(function,p)),parametersList)$ plot2d(functionList,[x,0,1])$ -- Regards, ASK From villate at fe.up.pt Mon Feb 13 08:36:22 2012 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 13 Feb 2012 14:36:22 +0000 Subject: [Maxima] Graphing a function for several parameter values In-Reply-To: <4F38FF6C.2050104@lse.ac.uk> References: <4F38FF6C.2050104@lse.ac.uk> Message-ID: <4F391FE6.5040002@fe.up.pt> On 02/13/2012 12:17 PM, Patrick Blanchenay wrote: > I would like to plot a function several times for different values of > parameters. > > The function depends on a set of parameters, say paramOne and paramTwo. > I would like to be able to specify several sets of those parameters, and > for each set, get the function graphed. > > I do not want the number of parameter sets to be hard-coded, so I > thought about using a for ... in ... do loop. This is what I tried, but > it doesn't seem to work: > > parametersList: [ > [paramOne=valueOne, paramTwo=valueTwo], > [paramOne=valueThree, paramTwo=valueFour], > ]$ > for parameterSet in parametersList do > block( > i++, > functionList[i] : ev(function(x,paramOne,paramTwo),parameterSet), > return functionList > ) > wxplot2d(functionList,[x,0,1])$ Hi, welcome to the list. You have several errors. 1- The statement "functionList[i]: ..." will not create a list but an array. By the end of the loop, functionList will not refer to the whole array, but rather to another variable, different from the array you created, and thus undefined. In any case, the plot command expects a list of functions and not an array. 2- i++ does not work in Maxima (unless you defined the postfix operator ++); you should have used i:0 .... i: i+1 3- return functionList will also fail; perhaps return(functionList) but it will not work as you expect from other programming languages. For that type of for loop you do not need to return anything from the loop. I recommend that you use makelist() to create your list of functions. Something like this: (%i2) f (x,A,w):= A*sin(w*x)$ (%i3) plist: [ [p1=1, p2=2], [p1=3, p2=4] ]$ (%i4) flist: makelist ( ev(f(x,p1,p2), p), p, plist); (%o4) [sin(2*x),3*sin(4*x)] (%i5) plot2d ( flist, [x, 0, 7]); As a matter of personal taste, I find simpler to use expressions, even though in this case the result is the same: (%i2) f: A*sin(w*x)$ (%i3) plist: [ [A=1, w=2], [A=3, w=4] ]$ (%i4) flist: makelist (subst (p,f), p, plist); (%o4) [sin(2*x),3*sin(4*x)] (%i5) plot2d ( flist, [x, 0, 7]); Cheers, Jaime From p.blanchenay at lse.ac.uk Mon Feb 13 10:20:53 2012 From: p.blanchenay at lse.ac.uk (Patrick Blanchenay) Date: Mon, 13 Feb 2012 16:20:53 +0000 Subject: [Maxima] Graphing a function for several parameter values In-Reply-To: <4F391FE6.5040002@fe.up.pt> References: <4F38FF6C.2050104@lse.ac.uk> <4F391FE6.5040002@fe.up.pt> Message-ID: <4F393865.6090208@lse.ac.uk> Je la 13/02/2012 14:36, Jaime Villate skribis: > I recommend that you use makelist() to create your list of functions. > Something like this: > > (%i2) f (x,A,w):= A*sin(w*x)$ > > (%i3) plist: [ [p1=1, p2=2], [p1=3, p2=4] ]$ > > (%i4) flist: makelist ( ev(f(x,p1,p2), p), p, plist); > > (%o4) [sin(2*x),3*sin(4*x)] > (%i5) plot2d ( flist, [x, 0, 7]); > Thank you very much Jaime, Do you know if I could apply the substitution of parameters to several functions? E.g. something like: flist: makelist ( concat(ev(f(x,p1,p2), p),",",ev(g(x,p1,p2), p)), p, plist); plot2d ( flist, [x, 0, 7]); I have no idea, but basically i'd like to plot two functions for several parameters values, so I need to have them like [f(under param_set1), g(under param_set1), f(under param_set2), g(under param_set2)] Is this still feasible with makelist? Thank you again! Patrick From villate at fe.up.pt Mon Feb 13 11:02:35 2012 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 13 Feb 2012 17:02:35 +0000 Subject: [Maxima] Graphing a function for several parameter values In-Reply-To: <4F393865.6090208@lse.ac.uk> References: <4F38FF6C.2050104@lse.ac.uk> <4F391FE6.5040002@fe.up.pt> <4F393865.6090208@lse.ac.uk> Message-ID: <4F39422B.6000009@fe.up.pt> On 02/13/2012 04:20 PM, Patrick Blanchenay wrote: > Do you know if I could apply the substitution of parameters to several > functions? > > E.g. something like: > > flist: makelist ( concat(ev(f(x,p1,p2), p),",",ev(g(x,p1,p2), p)), p, > plist); > plot2d ( flist, [x, 0, 7]); > > I have no idea, but basically i'd like to plot two functions for several > parameters values, so I need to have them like > [f(under param_set1), g(under param_set1), f(under param_set2), g(under > param_set2)] > > Is this still feasible with makelist? Sure, something such as: flist: makelist ( ev( [f(x,p1,p2), g(x,p1,p2)], p), p, plist)$ plot2d (flatten (flist), [x, 0, 7]); That makelist command will create a list of the type [[f1,g1], [f2,g2],...] flatten() will transform it into the list that plot2d needs: [f1, g1, f2, g2, ...] (concat will not work here because it will produce strings with a "," inside the strings, but not a list). Cheers, Jaime From p.blanchenay at lse.ac.uk Mon Feb 13 11:53:44 2012 From: p.blanchenay at lse.ac.uk (Patrick Blanchenay) Date: Mon, 13 Feb 2012 17:53:44 +0000 Subject: [Maxima] Graphing a function for several parameter values In-Reply-To: <4F39422B.6000009@fe.up.pt> References: <4F38FF6C.2050104@lse.ac.uk> <4F391FE6.5040002@fe.up.pt> <4F393865.6090208@lse.ac.uk> <4F39422B.6000009@fe.up.pt> Message-ID: <4F394E28.1050900@lse.ac.uk> Je la 13/02/2012 17:02, Jaime Villate skribis: > On 02/13/2012 04:20 PM, Patrick Blanchenay wrote: >> Do you know if I could apply the substitution of parameters to several >> functions? >> >> E.g. something like: >> >> flist: makelist ( concat(ev(f(x,p1,p2), p),",",ev(g(x,p1,p2), p)), p, >> plist); >> plot2d ( flist, [x, 0, 7]); >> >> I have no idea, but basically i'd like to plot two functions for several >> parameters values, so I need to have them like >> [f(under param_set1), g(under param_set1), f(under param_set2), g(under >> param_set2)] >> >> Is this still feasible with makelist? > Sure, something such as: > > flist: makelist ( ev( [f(x,p1,p2), g(x,p1,p2)], p), p, plist)$ > plot2d (flatten (flist), [x, 0, 7]); > > That makelist command will create a list of the type [[f1,g1], [f2,g2],...] > flatten() will transform it into the list that plot2d needs: [f1, g1, > f2, g2, ...] > Ah, flatten is exactly what I needed. Thank you very much for your help! (And thank you Alexander as well!) From p.blanchenay at lse.ac.uk Mon Feb 13 12:10:09 2012 From: p.blanchenay at lse.ac.uk (Patrick Blanchenay) Date: Mon, 13 Feb 2012 18:10:09 +0000 Subject: [Maxima] Graphing a function for several parameter values In-Reply-To: <4F394E28.1050900@lse.ac.uk> References: <4F38FF6C.2050104@lse.ac.uk> <4F391FE6.5040002@fe.up.pt> <4F393865.6090208@lse.ac.uk> <4F39422B.6000009@fe.up.pt> <4F394E28.1050900@lse.ac.uk> Message-ID: <4F395201.6030006@lse.ac.uk> Je la 13/02/2012 17:53, Patrick Blanchenay skribis: > Je la 13/02/2012 17:02, Jaime Villate skribis: >> On 02/13/2012 04:20 PM, Patrick Blanchenay wrote: >>> Do you know if I could apply the substitution of parameters to several >>> functions? >>> >>> E.g. something like: >>> >>> flist: makelist ( concat(ev(f(x,p1,p2), p),",",ev(g(x,p1,p2), p)), p, >>> plist); >>> plot2d ( flist, [x, 0, 7]); >>> >>> I have no idea, but basically i'd like to plot two functions for several >>> parameters values, so I need to have them like >>> [f(under param_set1), g(under param_set1), f(under param_set2), g(under >>> param_set2)] >>> >>> Is this still feasible with makelist? >> Sure, something such as: >> >> flist: makelist ( ev( [f(x,p1,p2), g(x,p1,p2)], p), p, plist)$ >> plot2d (flatten (flist), [x, 0, 7]); >> >> That makelist command will create a list of the type [[f1,g1], [f2,g2],...] >> flatten() will transform it into the list that plot2d needs: [f1, g1, >> f2, g2, ...] >> > > Ah, flatten is exactly what I needed. Thank you very much for your help! > (And thank you Alexander as well!) Actually I spoke too fast, the problem is that my functions are parametric, so each of them need to be in ['parametric, xOne(t),yOne(t),[t,0,1]]. In other words, not everything should be flatten. Is there any way to get "intermediate" flattening? What I get from the makelist() command, with for instance: plist: [ [p1=1, p2=2], [p1=3, p2=4] ] is: [ [ ['parametric, xOne(t,1,2),yOne(t,1,2),[t,0,1]], ['parametric, xTwo(t,1,2),yTwo(t,1,2),[t,0,1]] ], [ ['parametric, xOne(t,3,4),yOne(t,3,4),[t,0,1]], ['parametric, xTwo(t,3,4),yTwo(t,3,4),[t,0,1]] ] ] What I would like is to suppress the "intermediate" level of hierarchy, in order to get: [ ['parametric, xOne(t,1,2),yOne(t,1,2),[t,0,1]], ['parametric, xTwo(t,1,2),yTwo(t,1,2),[t,0,1]], ['parametric, xOne(t,3,4),yOne(t,3,4),[t,0,1]], ['parametric, xTwo(t,3,4),yTwo(t,3,4),[t,0,1]] ] whereas if I use flatten, I get: ['parametric, xOne(t,1,2),yOne(t,1,2),t,0,1, 'parametric, xTwo(t,1,2),yTwo(t,1,2),t,0,1, 'parametric, xOne(t,3,4),yOne(t,3,4),t,0,1, 'parametric, xTwo(t,3,4),yTwo(t,3,4),t,0,1] Any suggestions? From p.blanchenay at lse.ac.uk Mon Feb 13 13:39:41 2012 From: p.blanchenay at lse.ac.uk (Patrick Blanchenay) Date: Mon, 13 Feb 2012 19:39:41 +0000 Subject: [Maxima] Graphing a function for several parameter values In-Reply-To: <4F395201.6030006@lse.ac.uk> References: <4F38FF6C.2050104@lse.ac.uk> <4F391FE6.5040002@fe.up.pt> <4F393865.6090208@lse.ac.uk> <4F39422B.6000009@fe.up.pt> <4F394E28.1050900@lse.ac.uk> <4F395201.6030006@lse.ac.uk> Message-ID: <4F3966FD.1020104@lse.ac.uk> Je la 13/02/2012 18:10, Patrick Blanchenay skribis: > Je la 13/02/2012 17:53, Patrick Blanchenay skribis: >> Je la 13/02/2012 17:02, Jaime Villate skribis: >>> On 02/13/2012 04:20 PM, Patrick Blanchenay wrote: >>>> Do you know if I could apply the substitution of parameters to several >>>> functions? >>>> >>>> E.g. something like: >>>> >>>> flist: makelist ( concat(ev(f(x,p1,p2), p),",",ev(g(x,p1,p2), p)), p, >>>> plist); >>>> plot2d ( flist, [x, 0, 7]); >>>> >>>> I have no idea, but basically i'd like to plot two functions for several >>>> parameters values, so I need to have them like >>>> [f(under param_set1), g(under param_set1), f(under param_set2), g(under >>>> param_set2)] >>>> >>>> Is this still feasible with makelist? >>> Sure, something such as: >>> >>> flist: makelist ( ev( [f(x,p1,p2), g(x,p1,p2)], p), p, plist)$ >>> plot2d (flatten (flist), [x, 0, 7]); >>> >>> That makelist command will create a list of the type [[f1,g1], [f2,g2],...] >>> flatten() will transform it into the list that plot2d needs: [f1, g1, >>> f2, g2, ...] >>> >> >> Ah, flatten is exactly what I needed. Thank you very much for your help! >> (And thank you Alexander as well!) > > Actually I spoke too fast, the problem is that my functions are > parametric, so each of them need to be in ['parametric, > xOne(t),yOne(t),[t,0,1]]. In other words, not everything should be > flatten. Is there any way to get "intermediate" flattening? > > What I get from the makelist() command, with for instance: > plist: [ [p1=1, p2=2], [p1=3, p2=4] ] > is: > [ > [ > ['parametric, xOne(t,1,2),yOne(t,1,2),[t,0,1]], > ['parametric, xTwo(t,1,2),yTwo(t,1,2),[t,0,1]] > ], > [ > ['parametric, xOne(t,3,4),yOne(t,3,4),[t,0,1]], > ['parametric, xTwo(t,3,4),yTwo(t,3,4),[t,0,1]] > ] > ] > > What I would like is to suppress the "intermediate" level of hierarchy, > in order to get: > [ > ['parametric, xOne(t,1,2),yOne(t,1,2),[t,0,1]], > ['parametric, xTwo(t,1,2),yTwo(t,1,2),[t,0,1]], > ['parametric, xOne(t,3,4),yOne(t,3,4),[t,0,1]], > ['parametric, xTwo(t,3,4),yTwo(t,3,4),[t,0,1]] > ] > > whereas if I use flatten, I get: > ['parametric, xOne(t,1,2),yOne(t,1,2),t,0,1, > 'parametric, xTwo(t,1,2),yTwo(t,1,2),t,0,1, > 'parametric, xOne(t,3,4),yOne(t,3,4),t,0,1, > 'parametric, xTwo(t,3,4),yTwo(t,3,4),t,0,1] > > Any suggestions? I found how to do it using "append": f(x,A,w):= A*sin(w*x)$ g(x,B,w):= B*cos(w*x)$ parameterList: [ [p1=1, p2=2], [p1=3, p2=4] ]$ functionList: apply(append, makelist( ev( [['parametric, 2*t, f(t,p1,p2), [t, 0, 1], [nticks, 300]], ['parametric, g(t,p1,p2), 5*t+2, [t, 0, 1], [nticks, 300]]], p), p, paramaterList) ); plot2d(functionList, [x, 0, 7]); Sorry about the spam! From paweld2 at gmail.com Wed Feb 8 03:25:33 2012 From: paweld2 at gmail.com (=?ISO-8859-2?Q?Pawe=B3_Cesar_Sanjuan_Szklarz?=) Date: Wed, 8 Feb 2012 10:25:33 +0100 Subject: [Maxima] Generating octave functions from maxima Message-ID: Hello. Working on simulations for mechanical systems, I found really usefull to generate ODE equations on Maxima and then translate to octave to make simulations. I am using a simple function "generateOctaveFunction" at end of the mail to generate the octave functions as follow: load ("generateOctaveFunction.mac"); f(x,y) := sin(x) + cos(y) + t $ eq1 : -y + f(x,y); eq2 : x - f(x,y); testFunc : "generated"; generateOctaveFunction(testFunc,".",dq,[eq1,eq2],[x,y]); This generates file generated.maxgen with content: function dq =generated(q,t) dq(1,1) = t+cos(q(2))+sin(q(1))-q(2) dq(1,2) = -t-cos(q(2))-sin(q(1))+q(1) endfunction My question is: how to generate dq(i) in stand of dq(1,i)?? I am using f90mx inside generateOctaveFunction. Is there any more sofisticated way to pass Maxima equations to Octave?? Regards, Pawe? Cesar Sanjuan Szklarz. PD. generateOctaveFunction.mac /* Generate ODE function definition for octave Parameters functionName : Octave function name directoryName : target directory dq : matrix to save ODE equations EquationsList : equations [eq_1,eq_2,...] listVariables : state variables [x_1,x_2,...] Generated ODE function has form d(x_1)/dt = eq1; d(x_2)/dt = eq2; Variables [x_1,x_2,...] are replaced by [q[1],q[2],...] and generated is pseudo octave file "function dq =$funcName$(q,t) dq(1,i) = f90(eq_i) endfunction" Final equations should be repared to by q(1,i) = f90(eq_i) It can be done with command: sed -i -e 's/^d\(.\)(.\+,\(.\+\)) =\(.*\)$/d\1(\2)=\3;/g' TODO: fix to generate directly q(i). */ load (f90)$ generateOctaveFunction(functionName,directoryName,dq,EquationsList,listVariables) := block( /* x,y -> q_1,q_2 */ [q_eq : matrix( subst( map("=",listVariables,makelist(q[i],i,1,length(listVariables))), EquationsList )) ], FunHeader(funcName) := concat("function dq =",funcName,"(q,t)"), FunFileName(funcName,dir) := concat(dir,"/",funcName,".maxgen"), FunFooter : "endfunction", print (FunHeader(functionName)), f90mx(dq,q_eq), print (FunFooter), with_stdout (FunFileName(functionName,directoryName) , print (FunHeader(functionName)),f90mx(dq,q_eq),print (FunFooter)), dq:matrixEquation )$ From pchannell at lanl.gov Wed Feb 8 12:45:59 2012 From: pchannell at lanl.gov (Paul Channell) Date: Wed, 08 Feb 2012 11:45:59 -0700 Subject: [Maxima] numerical testing of identity Message-ID: <4F32C2E7.7040804@lanl.gov> In Maple there is a command, testeq, that checks a purported identity by numerically substituting random values for variables to establish falsehood with certainty or truth (with high probability). Is there an equivalent command in Maxima? Paul Channell From wissme at hotmail.com Wed Feb 8 13:44:18 2012 From: wissme at hotmail.com (WIZ Me) Date: Wed, 8 Feb 2012 19:44:18 +0000 Subject: [Maxima] Calling maxima from outside world Message-ID: Hello,Is there a document explaining in simple terms how to delegate computations to Maxima from another programming language ? Any *simple* example appreciated (it's ok to be able to send/get a Lisp expression as the result of a computation, it will be translated into another language, I don't know yet which one).Thanks a lot, it's for a student project... Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: From korte at lite.msu.edu Mon Feb 13 14:59:22 2012 From: korte at lite.msu.edu (Gerd Kortemeyer) Date: Mon, 13 Feb 2012 15:59:22 -0500 Subject: [Maxima] Calling maxima from outside world In-Reply-To: References: Message-ID: <46F09AC1-57DD-40B3-85CA-64DCC3B949A7@lite.msu.edu> Hi, On Feb 8, 2012, at 2:44 PM, WIZ Me wrote: > > Is there a document explaining in simple terms how to delegate computations to Maxima from another programming language ? As far as I know, there is no straightforward way to use MAXIMA as a kernel. Here's something that may be useful: http://www.lon-capa.org/maximaasserver.html The first program is a daemon that starts several instances of MAXIMA, keeps them alive, and let's you talk to them via a socket. From your other language, call the socket when you need anything (a Perl example is included). Works very well for us, just don't look at the duct tape behind the scenes. - Gerd. From willisb at unk.edu Mon Feb 13 15:49:51 2012 From: willisb at unk.edu (Barton Willis) Date: Mon, 13 Feb 2012 15:49:51 -0600 Subject: [Maxima] numerical testing of identity In-Reply-To: <4F32C2E7.7040804@lanl.gov> References: <4F32C2E7.7040804@lanl.gov> Message-ID: No, Maxima doesn't have nothing quite like that. Likely, Maxima has the tools to build such a function: (1) float or bfloat with various values of fpprec (or maybe nfloat), (2) rectform -- for complex values (float / bfloat don't always give a rectangular form), (3) random (4) errcatch -- deal with overflow, divsion by zero, ... (5) float_approx_equal and bfloat_approx_equal (undocumented, I think) --Barton maxima-bounces at math.utexas.edu wrote on 02/08/2012 12:45:59 PM: > From: Paul Channell > To: maxima at math.utexas.edu > Date: 02/13/2012 02:44 PM > Subject: [Maxima] numerical testing of identity > Sent by: maxima-bounces at math.utexas.edu > > In Maple there is a command, testeq, that checks a purported identity by > numerically substituting random values > for variables to establish falsehood with certainty or truth (with high > probability). Is there an equivalent > command in Maxima? > > Paul Channell > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From l_butler at users.sourceforge.net Mon Feb 13 17:26:44 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Mon, 13 Feb 2012 23:26:44 +0000 Subject: [Maxima] Calling maxima from outside world In-Reply-To: (message from WIZ Me on Wed, 8 Feb 2012 19:44:18 +0000) Message-ID: <1qp8vk62u2z.fsf@iceland.freeshell.org> WIZ Me writes: > [1:multipart/alternative Hide] > [1/1:text/plain Hide] > > Hello,Is there a document explaining in simple terms how to delegate computations to Maxima from another programming language ? Any *simple* example appreciated (it's ok to be able to send/get a Lisp expression as the result of a computation, it will be translated into another language, I don't know yet which one).Thanks a lot, it's for a student project... > Dan > On the documentation page you will find mention of a Perl programme pMaxima. You can get the source code, which is quite short and self-contained from here http://melusine.eu.org/syracuse/maxima/pmaxima/ If memory serves, it works by forking a parent server and child Maxima process. The parent does the usual Perl-ish stuff, sends Maxima code to the Maxima child and reads the output. Leo > [1/2:text/html Show] > [2:text/plain Hide] > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From macrakis at alum.mit.edu Mon Feb 13 18:56:52 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 13 Feb 2012 19:56:52 -0500 Subject: [Maxima] numerical testing of identity In-Reply-To: <4F32C2E7.7040804@lanl.gov> References: <4F32C2E7.7040804@lanl.gov> Message-ID: For smooth functions of a single variable, Maxima has zeroequiv. It works all right for simple cases, but quickly breaks down. Some current limitations are documented in https://sourceforge.net/tracker/index.php?func=detail&aid=593530&group_id=4933&atid=104933 : x-atan(x) => Dontknow, but this is perfectly well-behaved and numerically nonzero for abs(x) > 1.0e-8. sin(1/1000) => true sin(asin(x)+1/1000)-x => true sin(x+1/1000)-sin(x) => true atan(x)^1000 => internal error -s On Wed, Feb 8, 2012 at 13:45, Paul Channell wrote: > In Maple there is a command, testeq, that checks a purported identity by > numerically substituting random values > for variables to establish falsehood with certainty or truth (with high > probability). Is there an equivalent > command in Maxima? > > Paul Channell > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From filonenko.mikhail at gmail.com Mon Feb 13 23:13:51 2012 From: filonenko.mikhail at gmail.com (Michael Filonenko) Date: Tue, 14 Feb 2012 07:13:51 +0200 Subject: [Maxima] Calling maxima from outside world In-Reply-To: <1qp8vk62u2z.fsf@iceland.freeshell.org> References: <1qp8vk62u2z.fsf@iceland.freeshell.org> Message-ID: Also you can use simple stdin/stdout redirecting. Maxima is the usual console application. 2012/2/14 Leo Butler : > WIZ Me writes: > >> [1:multipart/alternative Hide] >> [1/1:text/plain Hide] >> >> Hello,Is there a document explaining in simple terms how to delegate computations to Maxima from another programming language ? Any *simple* example appreciated (it's ok to be able to send/get a Lisp expression as the result of a computation, it will be translated into another language, I don't know yet which one).Thanks a lot, it's for a student project... >> ? ?Dan >> > > On the documentation page you will find mention of a Perl programme > pMaxima. You can get the source code, which is quite short and > self-contained from here > > http://melusine.eu.org/syracuse/maxima/pmaxima/ > > If memory serves, it works by forking a parent server and child Maxima > process. The parent does the usual Perl-ish stuff, sends Maxima code to > the Maxima child and reads the output. > > Leo > > >> [1/2:text/html Show] >> [2:text/plain Hide] >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > > -- > Leo Butler ? ? ? ? ? ? ? ? > SDF Public Access UNIX System - ? http://sdf.lonestar.org > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- With best regards, Michael Filonenko From nijso at hotmail.com Tue Feb 14 03:12:07 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Tue, 14 Feb 2012 10:12:07 +0100 Subject: [Maxima] Can maxima be used for renormalization group analysis? Message-ID: Dear all, Recently I have become interested in renormalization group analysis, specifically for applications in turbulence modeling (the work of Yakhot and Orszag, McComb etc.). So my question to you is: is there a RNG package for maxima? Has anyone done RNG analysis with maxima (probably for quantum mechanical problems)? So things like obtaining the Fourier transform of a PDE, finding fixed points, etc. Kind regards, NB -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Tue Feb 14 17:29:59 2012 From: woollett at charter.net (Edwin Woollett) Date: Tue, 14 Feb 2012 15:29:59 -0800 Subject: [Maxima] float erf (%i) ?? Message-ID: <94F28DAF2DCC42DB8C0846BFD6D3F766@edwinc367e16bd> I am not getting erf(%i) to produce a float value. So this is a "feature request". If we use the manual def of erf(z), and the fact that the integrand is an entire function, the integral is independent of the path taken from the origin to the final complex point z. so we can choose a path along the imaginary axis to the final point %i to get erf(%i) = 2*%i*integrate(exp(y^2),y,0,1)/sqrt(%pi) = pure imaginary then use integrate with erfflag = false: ------------------------------------------- (%i1) expand(2*%i*integrate(exp(x^2),x,0,1)/sqrt(%pi)); (%o1) erf(%i) (%i2) float(%); (%o2) erf(%i) (%i3) erfflag; (%o3) true (%i4) erfflag:false$ (%i5) integrate(exp(x^2),x,0,1); (%o5) %i*gamma_incomplete(1/2,-1)/2-sqrt(%pi)*%i/2 (%i6) expand(float(%)); (%o6) 1.462651745907182 (%i7) float(2*%/sqrt(%pi)); (%o7) 1.650425758797543 ---------------------------------------------------------- so erf(%i) = 1.650425758797543*%i approx ------------------------------------- Ted Woollett From woollett at charter.net Tue Feb 14 17:55:47 2012 From: woollett at charter.net (Edwin Woollett) Date: Tue, 14 Feb 2012 15:55:47 -0800 Subject: [Maxima] float erf (%i) ?? Message-ID: On Feb. 14, 2012, I wrote ------------------- > I am not getting erf(%i) to produce a float > value. So this is a "feature request". ------------------------------------ Two possible routes to the correct answer in terms of existing Maxima functions are: ------------------------------------------- (%i1) %i*float(erfi(1)); (%o1) 1.650425758797543*%i (%i2) %i*imagpart(expand(float(1-gamma_incomplete(1/2,-1)/sqrt(%pi)))); (%o2) 1.650425758797543*%i ------------------------------------------------- Ted Woollett From lapeyre.math122a at gmail.com Tue Feb 14 18:01:45 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Wed, 15 Feb 2012 01:01:45 +0100 Subject: [Maxima] float erf (%i) ?? In-Reply-To: References: Message-ID: <4F3AF5E9.90906@gmail.com> It seems a bit weird and it's not documented, but ... (%i1) erf_representation:erfi$ (%i2) float(erf(%i)); (%o2) 1.650425758797543 %i From lapeyre.math122a at gmail.com Tue Feb 14 18:54:11 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Wed, 15 Feb 2012 01:54:11 +0100 Subject: [Maxima] float erf (%i) ?? In-Reply-To: References: Message-ID: <4F3B0233.7060702@gmail.com> In src/gamma.lisp, (defun simp-erf ... Add this immediately after the checks for minf and inf ((and (or (not (numberp ($imagpart z))) (/= 0 ($imagpart z))) (and (numberp ($realpart z)) (= 0 ($realpart z)))) (mul -1 '$%i (take '(%erfi) (mul '$%i z)))) Then, by default, erf(%i*z) will become %i erfi(z). And the float will be evaluated if requested. But, I think that's not the best, and I bet not foolproof, way to test for an explicitly imaginary argument. I didn't run tests to see what it breaks. -- John Lapeyre From toy.raymond at gmail.com Tue Feb 14 22:22:42 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 14 Feb 2012 20:22:42 -0800 Subject: [Maxima] float erf (%i) ?? In-Reply-To: <4F3B0233.7060702@gmail.com> References: <4F3B0233.7060702@gmail.com> Message-ID: <4F3B3312.7030806@gmail.com> On 2/14/12 4:54 PM, John Lapeyre wrote: > > In src/gamma.lisp, (defun simp-erf ... > > Add this immediately after the checks for minf and inf > > ((and (or (not (numberp ($imagpart z))) (/= 0 ($imagpart z))) > (and (numberp ($realpart z)) (= 0 ($realpart z)))) > (mul -1 '$%i (take '(%erfi) (mul '$%i z)))) > > Then, by default, erf(%i*z) will become %i erfi(z). And > the float will be evaluated if requested. But, I think that's > not the best, and I bet not foolproof, way to test for an > explicitly imaginary argument. I didn't run tests to see > what it breaks. I don't think this is the right thing to do. Why? Because: erf(%i),numer; returns 1.650425758797543 %i. How did I know? I cheated and looked at the code for float-numerical-eval-p which has a check for $numer. Perhaps %erf needs a 'subc property added to its property list? I also thought that float(erf(%i)) was supposed to convert the arguments to float, but that doesn't seem to be happening because erf(1.0*%i) instantly returns a numerical result. Ray From toy.raymond at gmail.com Tue Feb 14 22:22:42 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 14 Feb 2012 20:22:42 -0800 Subject: [Maxima] float erf (%i) ?? In-Reply-To: <4F3B0233.7060702@gmail.com> References: <4F3B0233.7060702@gmail.com> Message-ID: <4F3B3312.7030806@gmail.com> On 2/14/12 4:54 PM, John Lapeyre wrote: > > In src/gamma.lisp, (defun simp-erf ... > > Add this immediately after the checks for minf and inf > > ((and (or (not (numberp ($imagpart z))) (/= 0 ($imagpart z))) > (and (numberp ($realpart z)) (= 0 ($realpart z)))) > (mul -1 '$%i (take '(%erfi) (mul '$%i z)))) > > Then, by default, erf(%i*z) will become %i erfi(z). And > the float will be evaluated if requested. But, I think that's > not the best, and I bet not foolproof, way to test for an > explicitly imaginary argument. I didn't run tests to see > what it breaks. I don't think this is the right thing to do. Why? Because: erf(%i),numer; returns 1.650425758797543 %i. How did I know? I cheated and looked at the code for float-numerical-eval-p which has a check for $numer. Perhaps %erf needs a 'subc property added to its property list? I also thought that float(erf(%i)) was supposed to convert the arguments to float, but that doesn't seem to be happening because erf(1.0*%i) instantly returns a numerical result. Ray From jan.mueller at math.uni-dortmund.de Wed Feb 15 10:07:18 2012 From: jan.mueller at math.uni-dortmund.de (Jan Mueller) Date: Wed, 15 Feb 2012 17:07:18 +0100 Subject: [Maxima] sin computation Message-ID: <60EAC646-F635-45F9-9E88-27D048E89716@math.uni-dortmund.de> Hi, I am just writing an article about how pocket calculators compute values of trigonometric functions (especially Volders CORDIC algorithm). I also contacted Casio and TI about it but they gave no information because of company secrets. Could anyone explain to me how Maxima solves it? sin would be sufficient for me Jan From macrakis at alum.mit.edu Wed Feb 15 10:15:10 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 15 Feb 2012 11:15:10 -0500 Subject: [Maxima] sin computation In-Reply-To: <60EAC646-F635-45F9-9E88-27D048E89716@math.uni-dortmund.de> References: <60EAC646-F635-45F9-9E88-27D048E89716@math.uni-dortmund.de> Message-ID: For floating-point calculations, Maxima uses the numerical system of the underlying Lisp system, which typically uses the arithmetic packages provided with the underlying implementation language or operating system. For arbitrary-precision calculations (aka bfloats or bigfloats), the usual approximations are not useful -- Maxima reduces the range by subtracting the appropriate multiple of pi, then uses the Taylor expansion. The full Lisp code (functions fpsin and fpsincos1) is available for browsing at http://maxima.git.sourceforge.net/git/gitweb.cgi?p=maxima/maxima;a=blob;f=src/float.lisp;h=b881f47fcb443ee8c0a4a9c2887cf3261f08af06;hb=HEAD or via git. It is pretty simple if you're comfortable with Lisp, though some of the details are specific to the big float package. -s On Wed, Feb 15, 2012 at 11:07, Jan Mueller wrote: > Hi, > I am just writing an article about how pocket calculators compute values > of trigonometric functions (especially Volders CORDIC algorithm). I also > contacted Casio and TI about it but they gave no information because of > company secrets. Could anyone explain to me how Maxima solves it? sin would > be sufficient for me > Jan > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ephemeris at grayswandir.com Wed Feb 15 10:27:19 2012 From: ephemeris at grayswandir.com (Norman Beam) Date: Wed, 15 Feb 2012 11:27:19 -0500 Subject: [Maxima] sin computation In-Reply-To: <60EAC646-F635-45F9-9E88-27D048E89716@math.uni-dortmund.de> References: <60EAC646-F635-45F9-9E88-27D048E89716@math.uni-dortmund.de> Message-ID: <4F3BDCE7.8020200@grayswandir.com> Jan. If you have a good library available, see if they have a copy of the book 'Software Manual for the Elementary Functions' by William J. Cody Jr. and William Waite, 1980, Prentice Hall. The book was for compiler writers and assembly coder who needed to implement efficient finite word length floating point. Regards, Eph On 2/15/12 11:07 AM, Jan Mueller wrote: > Hi, > I am just writing an article about how pocket calculators compute values of trigonometric functions (especially Volders CORDIC algorithm). I also contacted Casio and TI about it but they gave no information because of company secrets. Could anyone explain to me how Maxima solves it? sin would be sufficient for me > Jan > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > From vext01 at gmail.com Wed Feb 15 10:45:44 2012 From: vext01 at gmail.com (Edd Barrett) Date: Wed, 15 Feb 2012 16:45:44 +0000 Subject: [Maxima] return statement Message-ID: <20120215164544.GP21867@edd-i386.kent.ac.uk> Hi, Is there kind of return statement which actually returns from a function and not just a block (even when nested)? I don't see one in the manual, did I miss it? Cheers -- Best Regards Edd Barrett http://www.theunixzoo.co.uk From macrakis at alum.mit.edu Wed Feb 15 10:44:47 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 15 Feb 2012 11:44:47 -0500 Subject: [Maxima] return statement In-Reply-To: <20120215164544.GP21867@edd-i386.kent.ac.uk> References: <20120215164544.GP21867@edd-i386.kent.ac.uk> Message-ID: I believe you need to use catch/throw for this. -s On Wed, Feb 15, 2012 at 11:45, Edd Barrett wrote: > Hi, > > Is there kind of return statement which actually returns from a function > and not just a block (even when nested)? > > I don't see one in the manual, did I miss it? > > Cheers > > -- > Best Regards > Edd Barrett > > http://www.theunixzoo.co.uk > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mxue at vroomlab.com Wed Feb 15 10:54:26 2012 From: mxue at vroomlab.com (mxue at vroomlab.com) Date: Wed, 15 Feb 2012 09:54:26 -0700 Subject: [Maxima] =?utf-8?q?ev_-_diff_error=3F?= Message-ID: <20120215095426.b7b3fc7d0c6ca0d100c8a34890539092.ba0f9ac6e0.wbe@email06.secureserver.net> An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Wed Feb 15 10:59:55 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 15 Feb 2012 11:59:55 -0500 Subject: [Maxima] ev - diff error? In-Reply-To: <20120215095426.b7b3fc7d0c6ca0d100c8a34890539092.ba0f9ac6e0.wbe@email06.secureserver.net> References: <20120215095426.b7b3fc7d0c6ca0d100c8a34890539092.ba0f9ac6e0.wbe@email06.secureserver.net> Message-ID: When you say ev(diff(sin(x),x),x=1); You are asking Maxima to calculate diff(sin(x),x) in a context where all x's are replaced by 1. That would give diff(sin(1),1), which is not what you want. What you want is first to calculate diff(sin(x),x), and only *then* substitute x=1. You can do that in various ways: subst(x=1,diff(sin(x),x)) at(diff(sin(x),x),x=1) ex: diff(sin(x),x)$ ev(ex,x=1) Maxima's notion of variable conflates *programming* variables and *mathematical *variables, which aren't really the same thing, but can be treated as the same in many cases. But in some cases, you have to be careful about the difference. -s On Wed, Feb 15, 2012 at 11:54, wrote: > Hi Maxima Jedis, > > I have the following encounter with maxima 5.23.2: > > (%i3) ev(diff(sin(x),x),x=1); > > diff: second argument must be a variable; found 1 > -- an error. To debug this try: debugmode(true); > > > but > > (%i5) diff(sin(x),x); > (%o5) cos(x) > (%i6) ev(%, x=1); > (%o6) cos(1) > > works ok. so is: > > (%i9) ev(diff(sin(x),x), x=%pi); > (%o9) 0 > > however, > (%i8) ev(diff(sin(x),x), x=%pi/2); > > %pi > diff: second argument must be a variable; found --- > 2 > > > Is this a bug of maxima or error/misunderstanding on my part? Could someone > enlighten me ? > > Thanks! > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Wed Feb 15 11:03:04 2012 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 15 Feb 2012 17:03:04 +0000 (UTC) Subject: [Maxima] sin computation References: <60EAC646-F635-45F9-9E88-27D048E89716@math.uni-dortmund.de> Message-ID: Jan Mueller wrote: > Hi, > I am just writing an article about how pocket calculators compute values of trigonometric functions (especially Volders CORDIC algorithm). I also contacted Casio and TI about it but they gave no information because of company secrets. Could anyone explain to me how Maxima solves it? sin would be sufficient for me > Jan Apparently the software for the HP 48 calculator has been written by the french mathematician B. Parisse from Grenoble, and can be downloaded here: ftp://ftp-fourier.ujf-grenoble.fr/linux/xcas/hpcas/erablsrc.zip so you can take a look at it. For the TI calculator it is the software Derive, i don't think one can get the source code. Another source for access to trig functions computations is to take a look at the source code for the libc and libm in free operating systems. For example for FreeBSD you can take a look at http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/msun/ but the code for i387 obviously uses hardware nstructions in the processor so it will ne be very useful to you. But there is a generic computation, for example for the sin here: http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/msun/src/k_sin.c?rev=1.11 which shows how one can proceed with approximate formula. -- Michel Talon From mxue at vroomlab.com Wed Feb 15 11:25:30 2012 From: mxue at vroomlab.com (michael) Date: Wed, 15 Feb 2012 17:25:30 +0000 (UTC) Subject: [Maxima] ev - diff error? References: <20120215095426.b7b3fc7d0c6ca0d100c8a34890539092.ba0f9ac6e0.wbe@email06.secureserver.net> Message-ID: Thank you very much for your quick reply. I am still puzzled by the fact that ev(diff(sin(x),x), x=%pi) returns 0 instead of an error. such as in the case of ev(diff(sin(x),x), x=%pi/4). From mxue at vroomlab.com Wed Feb 15 11:33:00 2012 From: mxue at vroomlab.com (michael) Date: Wed, 15 Feb 2012 17:33:00 +0000 (UTC) Subject: [Maxima] ev - diff error? References: <20120215095426.b7b3fc7d0c6ca0d100c8a34890539092.ba0f9ac6e0.wbe@email06.secureserver.net> Message-ID: Stavros Macrakis alum.mit.edu> writes: > > When you say > > ? ? ?ev(diff(sin(x),x),x=1);? > > You are asking Maxima to calculate diff(sin(x),x) in a context where all x's are replaced by 1. > > ? ? ? ? ? ? -s > > > Thank you very much for your quick reply. I am still puzzled by the fact that ev(diff(sin(x),x), x=%pi) returns 0 instead of an error. such as in the case of ev(diff(sin(x),x), x=%pi/4). From macrakis at alum.mit.edu Wed Feb 15 11:35:24 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 15 Feb 2012 12:35:24 -0500 Subject: [Maxima] ev - diff error? In-Reply-To: References: <20120215095426.b7b3fc7d0c6ca0d100c8a34890539092.ba0f9ac6e0.wbe@email06.secureserver.net> Message-ID: Thank you for reporting that problem. Indeed, diff(..., %pi) (or w.r.t. any other constant) should give an error. I have filed this as a bug, and assigned it to myself to fix. -s On Wed, Feb 15, 2012 at 12:25, michael wrote: > > Thank you very much for your quick reply. > I am still puzzled by the fact that > ev(diff(sin(x),x), x=%pi) returns 0 > instead of an error. such as in the case of > ev(diff(sin(x),x), x=%pi/4). > > > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.mueller at math.uni-dortmund.de Wed Feb 15 11:46:44 2012 From: jan.mueller at math.uni-dortmund.de (=?ISO-8859-1?Q?Jan_Hendrik_M=FCller?=) Date: Wed, 15 Feb 2012 18:46:44 +0100 Subject: [Maxima] sin computation In-Reply-To: <4F3BDCE7.8020200@grayswandir.com> References: <60EAC646-F635-45F9-9E88-27D048E89716@math.uni-dortmund.de> <4F3BDCE7.8020200@grayswandir.com> Message-ID: <4F3BEF84.7090905@math.uni-dortmund.de> Hi, the book is fortunately available via http://bookfi.org/dl/546944/f9a577 many thanks for your (plural!) help and hints! Jan Norman Beam schrieb: > Jan. > > If you have a good library available, see if they have a copy of the > book 'Software Manual for the Elementary Functions' by William J. Cody > Jr. and William Waite, 1980, Prentice Hall. The book was for compiler > writers and assembly coder who needed to implement efficient finite > word length floating point. > > Regards, > > Eph > > > On 2/15/12 11:07 AM, Jan Mueller wrote: >> Hi, >> I am just writing an article about how pocket calculators compute >> values of trigonometric functions (especially Volders CORDIC >> algorithm). I also contacted Casio and TI about it but they gave no >> information because of company secrets. Could anyone explain to me >> how Maxima solves it? sin would be sufficient for me >> Jan >> >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From lapeyre.math122a at gmail.com Wed Feb 15 12:29:11 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Wed, 15 Feb 2012 19:29:11 +0100 Subject: [Maxima] float erf (%i) ?? In-Reply-To: <4F3B3312.7030806@gmail.com> References: <4F3B0233.7060702@gmail.com> <4F3B3312.7030806@gmail.com> Message-ID: <4F3BF977.7040409@gmail.com> > > I don't think this is the right thing to do. Why? Because: > > erf(%i),numer; > > returns 1.650425758797543 %i. > > How did I know? I cheated and looked at the code for > float-numerical-eval-p which has a check for $numer. > Perhaps %erf needs a 'subc property added to its property list? I don't understand how that works, except that it has something to to with creating a subcontext. I just noticed there is erf_%iargs which behaves like %iargs for erf, but maybe it is not documented ? Also it is false by default and I think %iargs is true by default. One consequence of erf_%iargs:true is that float(erf(%i)) givs a number, which is at least a workaround. But float(erf(2*%i)) works as expected even with erf_%iargs:false; tracing shows that simp-erf is called twice, the second time , 2 has been converted to 2.0, and complex-float-numerical-eval-p returns true. But with float(erf(1*%i)), 1*%i -> %i and float leave this as it is, so complex-float-numerical-eval-p returns false. > I also thought that float(erf(%i)) was supposed to convert the arguments > to float, but that doesn't seem to be happening because erf(1.0*%i) > instantly returns a numerical result. simp-erf calls complex-float-numerical-eval-p and finds the 1.0. It seems there should be a way of having float(erf(%i)) work that is independent of how erf simplifies to erfi. John From fateman at eecs.berkeley.edu Wed Feb 15 13:04:46 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 15 Feb 2012 11:04:46 -0800 Subject: [Maxima] sin computation In-Reply-To: References: <60EAC646-F635-45F9-9E88-27D048E89716@math.uni-dortmund.de> Message-ID: <4F3C01CE.1070900@eecs.berkeley.edu> I think you will be able to find more information from Hewlett Packard. See, for example http://www.hpl.hp.com/hpjournal/pdfs/IssuePDFs/1979-12.pdf Also, I think you will find other material on wkahan's home page. As far as the algorithms for bigfloats in Maxima, they are generally inappropriate for calculators because they are "unrestricted" in the sense used by R.P. Brent. They provide algorithms for any precision. Calculators have some fixed precision, e.g. 10 decimal digits. (or 13, with guard digits etc.) So quite different routines are used. RJF On 2/15/2012 9:03 AM, Michel Talon wrote: > Jan Mueller wrote: >> Hi, >> I am just writing an article about how pocket calculators compute values of > trigonometric functions (especially Volders CORDIC algorithm). I also > contacted Casio and TI about it but they gave no information because of > company secrets. Could anyone explain to me how Maxima solves it? sin would be > sufficient for me >> Jan > Apparently the software for the HP 48 calculator has been written by the > french mathematician B. Parisse from Grenoble, and can be downloaded here: > ftp://ftp-fourier.ujf-grenoble.fr/linux/xcas/hpcas/erablsrc.zip > so you can take a look at it. For the TI calculator it is the software Derive, > i don't think one can get the source code. > > Another source for access to trig functions computations is to take a look at > the source code for the libc and libm in free operating systems. For example > for FreeBSD you can take a look at > http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/msun/ > but the code for i387 obviously uses hardware nstructions in the processor so > it will ne be very useful to you. But there is a generic computation, for > example for the sin here: > http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/msun/src/k_sin.c?rev=1.11 > which shows how one can proceed with approximate formula. > > From volkervannek at googlemail.com Wed Feb 15 15:49:35 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Wed, 15 Feb 2012 22:49:35 +0100 Subject: [Maxima] return statement In-Reply-To: References: <20120215164544.GP21867@edd-i386.kent.ac.uk> Message-ID: Yes. Here is an example: (%i1) f(x) := catch( block([y:0], for i thru 3 do if i = x then throw(i), y) )$ (%i2) map(f, [1,2,3,4,5,6,7]); (%o2) [1, 2, 3, 0, 0, 0, 0] Volker van Nek 2012/2/15 Stavros Macrakis > I believe you need to use catch/throw for this. > > -s > > On Wed, Feb 15, 2012 at 11:45, Edd Barrett wrote: > >> Hi, >> >> Is there kind of return statement which actually returns from a function >> and not just a block (even when nested)? >> >> I don't see one in the manual, did I miss it? >> >> Cheers >> >> -- >> Best Regards >> Edd Barrett >> >> http://www.theunixzoo.co.uk >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Wed Feb 15 17:26:26 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 15 Feb 2012 18:26:26 -0500 Subject: [Maxima] diff -- second argument Message-ID: Diff currently allows constants as a second argument; I've assigned the bugto myself (the fix is trivial). It also allows: diff(x,tan(x)) => 0 diff(x,f(x)) => 0 but not diff(x,1+x) => error In principle, all of these could of course be meaningful, but Maxima doesn't know that. Which seems more useful for users in such cases?: * Giving an error? * Leaving as noun forms? (which Maxima can't do anything useful with) I suspect that in most cases, an error would be welcome.... -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Wed Feb 15 18:25:07 2012 From: woollett at charter.net (Edwin Woollett) Date: Wed, 15 Feb 2012 16:25:07 -0800 Subject: [Maxima] new comm.lisp causes maxima to hang (a case) Message-ID: <84F9D0ED1F8847C5873A235E055B8558@edwinc367e16bd> If I don't load new comm.lisp (in compiled form) I get expected result (first example) If I do load new comm.lisp, the same example hangs maxima (gcl): ------------------------------------- /****** ok w/o comm-new.o *****/ Maxima 5.26.0 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) load("defint-new.o")$ (%i2) load("limit-new.o")$ (%i3) load("unwind_protect.lisp")$ (%i4) simp_assuming(e, [fcts]) ::= buildq([e,fcts], unwind_protect((apply(assume, fcts), expand(e,0,0)), apply(forget,fcts)))$ (%i5) integrate(2^(%i*x),x,1,10^4); (%o5) 2^%i*%i/log(2)-%i*2^(10000*%i)/log(2) (%i6) expand(float(rectform(%))); (%o6) 0.47915862215474*%i+0.37574425579291 (%i7) simp_assuming(integrate(sin(sin(x)),x,0,2), x >= 0, x <= 2); (%o7) 'integrate(sin(sin(x)),x,0,2) /*** not ok with comm-new.o ****/ Maxima 5.26.0 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) load("defint-new.o")$ (%i2) load("limit-new.o")$ (%i3) load ("comm-new.o")$ (%i4) load("unwind_protect.lisp")$ (%i5) simp_assuming(e, [fcts]) ::= buildq([e,fcts], unwind_protect((apply(assume, fcts), expand(e,0,0)), apply(forget,fcts)))$ (%i6) integrate(2^(%i*x),x,1,10^4); (%o6) 2^%i*%i/log(2)-%i*2^(10000*%i)/log(2) (%i7) expand(float(rectform(%))); (%o7) 0.47915862215474*%i+0.37574425579291 /* this hangs maxima */ (%i8) simp_assuming(integrate(sin(sin(x)),x,0,2), x >= 0, x <= 2); -------------------------------- Ted Woollett (%i1) build_info()$ Maxima version: 5.26.0 Maxima build date: 22:48 1/15/2012 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 From robert.dodier at gmail.com Wed Feb 15 23:35:48 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 15 Feb 2012 22:35:48 -0700 Subject: [Maxima] new comm.lisp causes maxima to hang (a case) In-Reply-To: <84F9D0ED1F8847C5873A235E055B8558@edwinc367e16bd> References: <84F9D0ED1F8847C5873A235E055B8558@edwinc367e16bd> Message-ID: On 2/15/12, Edwin Woollett wrote: > If I don't load new comm.lisp (in compiled form) > I get expected result (first example) > > If I do load new comm.lisp, the same example > hangs maxima (gcl): I can't reproduce this problem. I tried it with GCL and with CMUCL. I have to wonder what are defint-new and limit-new. I'm working with Maxima as retrieved from the source code repository (Git) and built all at once instead of loading some modified files. I suppose that probably makes a difference. best Robert Dodier From robert.dodier at gmail.com Thu Feb 16 01:28:12 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 16 Feb 2012 00:28:12 -0700 Subject: [Maxima] diff -- second argument In-Reply-To: References: Message-ID: On 2/15/12, Stavros Macrakis wrote: > diff(x,tan(x)) => 0 > diff(x,f(x)) => 0 > > but not > > diff(x,1+x) => error > > In principle, all of these could of course be meaningful, but Maxima > doesn't know that. > > Which seems more useful for users in such cases?: > > * Giving an error? > * Leaving as noun forms? (which Maxima can't do anything useful with) Well, in general it seems useful, and consistent with Maxima's behavior in other cases, to return a noun form. Then sufficiently clever people (whether it's the developers or anybody else) can impose an interpretation of such expressions via the simplification system. An error might be appropriate for cases in which Maxima has determined that the expression is undefined. best, Robert Dodier From A.G.Grozin at inp.nsk.su Thu Feb 16 02:59:01 2012 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Thu, 16 Feb 2012 15:59:01 +0700 (NOVT) Subject: [Maxima] sin computation In-Reply-To: <4F3BEF84.7090905@math.uni-dortmund.de> References: <60EAC646-F635-45F9-9E88-27D048E89716@math.uni-dortmund.de> <4F3BDCE7.8020200@grayswandir.com> <4F3BEF84.7090905@math.uni-dortmund.de> Message-ID: Algorithms to calculate elementary functions with arbitrarily high precision can also be fount in the sources of the python package mpmath. The code is well commented. Andrey From lapeyre.math122a at gmail.com Thu Feb 16 06:45:18 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Thu, 16 Feb 2012 13:45:18 +0100 Subject: [Maxima] bug in 'is' ? Message-ID: <4F3CFA5E.3000409@gmail.com> These both cause an error (in both 5.26.0, 5.25.1, and gcl,sbcl) is("zebra" > 0); every(lambda([x],is(x>0)), [1,2,"zebra"]); with sbcl: Maxima encountered a Lisp error: The value "zebra" is not of type LIST. gcl: Error in MACSYMA-TOP-LEVEL [or a callee]: Caught fatal error [memory may be damaged] -- John Lapeyre From macrakis at alum.mit.edu Thu Feb 16 06:54:59 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 16 Feb 2012 07:54:59 -0500 Subject: [Maxima] bug in 'is' ? In-Reply-To: <4F3CFA5E.3000409@gmail.com> References: <4F3CFA5E.3000409@gmail.com> Message-ID: Yes, anything that gives an internal error is a bug -- could you please report it? (see bug_report() ) Since strings are not (currently) in the domain of the Maxima comparison operators, this should either give an error or return 'unknown'. I think I know what Robert's preference would be.... -s On Thu, Feb 16, 2012 at 07:45, John Lapeyre wrote: > > These both cause an error (in both 5.26.0, 5.25.1, and gcl,sbcl) > > is("zebra" > 0); > > every(lambda([x],is(x>0)), [1,2,"zebra"]); > > with sbcl: > Maxima encountered a Lisp error: > The value "zebra" is not of type LIST. > > gcl: > Error in MACSYMA-TOP-LEVEL [or a callee]: > Caught fatal error [memory may be damaged] > > -- John Lapeyre > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Thu Feb 16 10:42:18 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 16 Feb 2012 08:42:18 -0800 Subject: [Maxima] diff -- second argument In-Reply-To: References: Message-ID: On Wed, Feb 15, 2012 at 11:28 PM, Robert Dodier wrote: > On 2/15/12, Stavros Macrakis wrote: > > > diff(x,tan(x)) => 0 > > diff(x,f(x)) => 0 > > > > but not > > > > diff(x,1+x) => error > > > > In principle, all of these could of course be meaningful, but Maxima > > doesn't know that. > > > > Which seems more useful for users in such cases?: > > > > * Giving an error? > > * Leaving as noun forms? (which Maxima can't do anything useful with) > > Well, in general it seems useful, and consistent with Maxima's > behavior in other cases, to return a noun form. Then sufficiently > clever people (whether it's the developers or anybody else) can > impose an interpretation of such expressions via the simplification > system. > Returning a noun form does seem to be Maxima's standard behavior, but I often find it rather annoying. Say I do an integral and I get a noun form back. Not because maxima can't really do the integral but because some function deep in the bowels of the integration routines failed. Rather than giving some indication of that, maxima silently returns a noun form. Noun forms are nice for users, but sometimes painful for developers. I don't know what the right balance should be. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Thu Feb 16 13:01:00 2012 From: woollett at charter.net (Edwin Woollett) Date: Thu, 16 Feb 2012 11:01:00 -0800 Subject: [Maxima] new comm.lisp causes maxima to hang (a case) Message-ID: <90BE5DB3A8CB4D46B83921432F51796A@edwinc367e16bd> On Feb. 15, 2012, Robert Dodier wrote: -------------------------------------- >> If I do load new comm.lisp, the same example >> hangs maxima (gcl): > >I can't reproduce this problem. I tried it with GCL and with CMUCL. > >I have to wonder what are defint-new and limit-new. > these are compiled versions of the latest defint.lisp and limit.lisp from git; just loading them on top of 5.26.0 seems to cure the integral bugs which gave rise to the new versions. >I'm working with Maxima as retrieved from the source code repository >(Git) and built all at once instead of loading some modified files. >I suppose that probably makes a difference. That's good info for me. I can just avoid using the new comm.lisp for now. Thanks for the test, Ted From macrakis at alum.mit.edu Thu Feb 16 13:12:48 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 16 Feb 2012 14:12:48 -0500 Subject: [Maxima] diff -- second argument In-Reply-To: References: Message-ID: Actually, a little reflection makes it clear that diff(f(x),g(x)) should not be an error or a noun form, because in fact it is perfectly well-defined and meaningful: diff(A,B) == ev(diff(A)/diff(B),del) For example, diff(sin(x),x) == cos(x)*del(x)/del(x) == cos(x) << diff(...,V) reduces to normal differentiation diff(sin(x),cos(x)) == cos(x)*del(x)/(-sin(x)*del(x)) == -cos(x)/sin(x) << in diff(f(x),g(x)), del(x)/del(x) => 1 diff(x*y,x^2+y^2) == (x*del(y)+y*del(x)) / (2*y*del(y) + 2*x*del(x)) << consistent handling of multiple-variable case How useful is this? I'll leave that to others.... Right now, Maxima doesn't do much of interest with del(...) -- not even giving an error for del(1) -- but it does do ev(del(x^2),del) == diff(x^2) == 2*x*del(x). You can even try ratsubst('diff(x,y),del(x)/del(y),...) on del expressions and get things that look reasonable (and useful?).... One problem: diff(del(x)) => 'diff(del(x),x)*del(x), which is I suppose correct, but ugly and hard to work with. Can be deferred for now. Any objections to this definition of diff with a second argument which is an expression? -s On Thu, Feb 16, 2012 at 11:42, Raymond Toy wrote: > > > On Wed, Feb 15, 2012 at 11:28 PM, Robert Dodier wrote: > >> On 2/15/12, Stavros Macrakis wrote: >> >> > diff(x,tan(x)) => 0 >> > diff(x,f(x)) => 0 >> > >> > but not >> > >> > diff(x,1+x) => error >> > >> > In principle, all of these could of course be meaningful, but Maxima >> > doesn't know that. >> > >> > Which seems more useful for users in such cases?: >> > >> > * Giving an error? >> > * Leaving as noun forms? (which Maxima can't do anything useful with) >> >> Well, in general it seems useful, and consistent with Maxima's >> behavior in other cases, to return a noun form. Then sufficiently >> clever people (whether it's the developers or anybody else) can >> impose an interpretation of such expressions via the simplification >> system. >> > > Returning a noun form does seem to be Maxima's standard behavior, but I > often find it rather annoying. Say I do an integral and I get a noun form > back. Not because maxima can't really do the integral but because some > function deep in the bowels of the integration routines failed. Rather > than giving some indication of that, maxima silently returns a noun form. > > Noun forms are nice for users, but sometimes painful for developers. > > I don't know what the right balance should be. > > Ray > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hbaker1 at pipeline.com Thu Feb 16 15:52:20 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Thu, 16 Feb 2012 13:52:20 -0800 Subject: [Maxima] diff -- second argument In-Reply-To: References: Message-ID: Whatever you do with 2nd arg for diff should also be mirrored in 2nd arg for integrate. At 11:12 AM 2/16/2012, Stavros Macrakis wrote: >Actually, a little reflection makes it clear that diff(f(x),g(x)) should not be an error or a noun form, because in fact it is perfectly well-defined and meaningful: > > diff(A,B) == ev(diff(A)/diff(B),del) > >For example, > > diff(sin(x),x) == cos(x)*del(x)/del(x) == cos(x) > << diff(...,V) reduces to normal differentiation > diff(sin(x),cos(x)) == cos(x)*del(x)/(-sin(x)*del(x)) == -cos(x)/sin(x) > << in diff(f(x),g(x)), del(x)/del(x) => 1 > diff(x*y,x^2+y^2) == (x*del(y)+y*del(x)) / (2*y*del(y) + 2*x*del(x)) > << consistent handling of multiple-variable case > >How useful is this? I'll leave that to others.... > >Right now, Maxima doesn't do much of interest with del(...) -- not even giving an error for del(1) -- but it does do ev(del(x^2),del) == diff(x^2) == 2*x*del(x). You can even try ratsubst('diff(x,y),del(x)/del(y),...) on del expressions and get things that look reasonable (and useful?).... > >One problem: diff(del(x)) => 'diff(del(x),x)*del(x), which is I suppose correct, but ugly and hard to work with. Can be deferred for now. > >Any objections to this definition of diff with a second argument which is an expression? > > -s > >On Thu, Feb 16, 2012 at 11:42, Raymond Toy wrote: > >On Wed, Feb 15, 2012 at 11:28 PM, Robert Dodier wrote: >On 2/15/12, Stavros Macrakis wrote: > >> diff(x,tan(x)) => 0 >> diff(x,f(x)) => 0 >> >> but not >> >> diff(x,1+x) => error >> >> In principle, all of these could of course be meaningful, but Maxima >> doesn't know that. >> >> Which seems more useful for users in such cases?: >> >> * Giving an error? >> * Leaving as noun forms? (which Maxima can't do anything useful with) > >Well, in general it seems useful, and consistent with Maxima's >behavior in other cases, to return a noun form. Then sufficiently >clever people (whether it's the developers or anybody else) can >impose an interpretation of such expressions via the simplification >system. > >Returning a noun form does seem to be Maxima's standard behavior, but I often find it rather annoying. Say I do an integral and I get a noun form back. Not because maxima can't really do the integral but because some function deep in the bowels of the integration routines failed. Rather than giving some indication of that, maxima silently returns a noun form. > >Noun forms are nice for users, but sometimes painful for developers. > >I don't know what the right balance should be. > >Ray From cloos at jhcloos.com Thu Feb 16 17:31:18 2012 From: cloos at jhcloos.com (James Cloos) Date: Thu, 16 Feb 2012 18:31:18 -0500 Subject: [Maxima] float erf (%i) ?? In-Reply-To: <94F28DAF2DCC42DB8C0846BFD6D3F766@edwinc367e16bd> (Edwin Woollett's message of "Tue, 14 Feb 2012 15:29:59 -0800") References: <94F28DAF2DCC42DB8C0846BFD6D3F766@edwinc367e16bd> Message-ID: >>>>> "EW" == Edwin Woollett writes: EW> I am not getting erf(%i) to produce a float FWIW, erf(1.0*%i) and erf(1.0B0*%i) work. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From wmixon at berry.edu Thu Feb 16 17:49:51 2012 From: wmixon at berry.edu (Mixon, Wilson) Date: Thu, 16 Feb 2012 23:49:51 +0000 Subject: [Maxima] Problem with lsquares_estimates Message-ID: I can't estimate the parameters of a function when the data have been generated with rk. I attach a wxMaxima file. The commands are below The first pass is taken from Woollett. In this case lsquares_estimates works as expected. dataL : [ [1,1], [2,7/4], [3,11/4], [4,13/4]]$ dataM : apply('matrix, dataL)$ dataM; load(lsquares)$ lsquares_estimates(dataM, [x, y], y = a+b*x^c, [a,b,c],initial=[0,1,1], iprint=[-1,0]); Next, I create some data using rk. As far as I can see, the data matrix is well-behaved, but lsquares_estimates now generates an error message. kill(all)$ w:2*%pi$ w0:1.5*w$ b:w0/4$ g:1.5$ phi0:-%pi/2$ data6a: rk( [y,-2*b*y-w0*w0*sin(x) + g*w0*w0*cos(w*t)], [x,y], [phi0,0], [t, 0, 20*%pi/w, 1])$ data6b: rk([y,-2*b*y-w0*w0*sin(x) + g*w0*w0*cos(w*t)], [x,y], [phi0+0.01,0], [t, 0, 20*%pi/w, 1])$ data6a: data6a, numer$ data6b: data6b, numer$ logDx: makelist(log(abs(data6a[i][2]-data6b[i][2])), i,1,11)$ tList: makelist(t,t,1,11)$ dataD: transpose(matrix(tList,logDx)); lsquares_estimates(dataD, [time, lDx], lDx = a+b*time, [a,b], initial=[1,1], iprint=[-1,0]); Next I recreate the Woollett exercise, getting error messages. dataL : [ [1,1], [2,7/4], [3,11/4], [4,13/4]]$ dataM : apply('matrix, dataL); load(lsquares)$ lsquares_estimates(dataM, [x, y], y = a+b*x^c, [a,b,c], initial=[0,1,1], iprint=[-1,0]); Finally, I execute kill(all)$ and recreate the Woollett exercise. Now lsquares_estimates works. kill(all)$ dataL : [ [1,1], [2,7/4], [3,11/4], [4,13/4]]$ dataM : apply('matrix, dataL)$ load(lsquares)$ lsquares_estimates(dataM, [x, y], y = a+b*x^c, [a,b,c], initial=[0,1,1], iprint=[-1,0]); -------------- next part -------------- A non-text attachment was scrubbed... Name: lsquares.wxm Type: application/octet-stream Size: 2498 bytes Desc: lsquares.wxm URL: From brianchacko at yahoo.com Fri Feb 17 01:47:28 2012 From: brianchacko at yahoo.com (Brian Chacko) Date: Thu, 16 Feb 2012 23:47:28 -0800 (PST) Subject: [Maxima] Error using Sockets with Maxima In-Reply-To: References: <1324444437.54181.YahooMailNeo@web39401.mail.mud.yahoo.com> <1324486072.94758.YahooMailNeo@web39403.mail.mud.yahoo.com> Message-ID: <1329464848.46406.YahooMailNeo@web39404.mail.mud.yahoo.com> Hi, I wanted my API to communicate with maxima using sockets the same way WxMaxima is being used. Using this method,? I created a local server application and try to connect maxima to the server using the command [Path to maxima.bat]/maxima.bat -s 7755 I get the following error... [Path to Maxima]\bin>maxima.bat -s 7755 Connecting Maxima to server on port 7755 Maxima encountered a Lisp error: ?Error in LISP:LAMBDA-CLOSURE [or a callee]: Could not connect Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. Error in START-CLIENT [or a callee]: The tag RETURN-FROM-DEBUGGER is undefined. Fast links are on: do (use-fast-links nil) for debugging Broken at CONDITIONS::CLCS-UNIVERSAL-ERROR-HANDLER.? Type :H for Help. ?1 (Abort) Return to top level. dbl:MAXIMA>> Could someone help me to resolve this? Thanks in advance... Brian Gee Chacko -------------- next part -------------- An HTML attachment was scrubbed... URL: From brianchacko at yahoo.com Fri Feb 17 01:54:01 2012 From: brianchacko at yahoo.com (Brian Chacko) Date: Thu, 16 Feb 2012 23:54:01 -0800 (PST) Subject: [Maxima] Fw: Error using Sockets with Maxima In-Reply-To: <1329464848.46406.YahooMailNeo@web39404.mail.mud.yahoo.com> References: <1324444437.54181.YahooMailNeo@web39401.mail.mud.yahoo.com> <1324486072.94758.YahooMailNeo@web39403.mail.mud.yahoo.com> <1329464848.46406.YahooMailNeo@web39404.mail.mud.yahoo.com> Message-ID: <1329465241.5641.YahooMailNeo@web39403.mail.mud.yahoo.com> Hi all, The error was the case sensitive 's' either, the actual command argument is maxima.bat -S 7755 while I used maxima.bat -s 7755 earlier. This was the issue. Regards, Brian Gee Chacko ----- Forwarded Message ----- From: Brian Chacko To: "maxima at math.utexas.edu" Sent: Friday, February 17, 2012 1:17 PM Subject: Error using Sockets with Maxima Hi, I wanted my API to communicate with maxima using sockets the same way WxMaxima is being used. Using this method,? I created a local server application and try to connect maxima to the server using the command [Path to maxima.bat]/maxima.bat -s 7755 I get the following error... [Path to Maxima]\bin>maxima.bat -s 7755 Connecting Maxima to server on port 7755 Maxima encountered a Lisp error: ?Error in LISP:LAMBDA-CLOSURE [or a callee]: Could not connect Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. Error in START-CLIENT [or a callee]: The tag RETURN-FROM-DEBUGGER is undefined. Fast links are on: do (use-fast-links nil) for debugging Broken at CONDITIONS::CLCS-UNIVERSAL-ERROR-HANDLER.? Type :H for Help. ?1 (Abort) Return to top level. dbl:MAXIMA>> Could someone help me to resolve this? Thanks in advance... Brian Gee Chacko -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Fri Feb 17 10:01:18 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 17 Feb 2012 09:01:18 -0700 Subject: [Maxima] Error using Sockets with Maxima In-Reply-To: <1329464848.46406.YahooMailNeo@web39404.mail.mud.yahoo.com> References: <1324444437.54181.YahooMailNeo@web39401.mail.mud.yahoo.com> <1324486072.94758.YahooMailNeo@web39403.mail.mud.yahoo.com> <1329464848.46406.YahooMailNeo@web39404.mail.mud.yahoo.com> Message-ID: On 2/17/12, Brian Chacko wrote: > I wanted my API to communicate with maxima using sockets the same way > WxMaxima is being used. Using this method, I created a local server > application and try to connect maxima to the server using the command > > [Path to maxima.bat]/maxima.bat -s 7755 > > I get the following error... > > [Path to Maxima]\bin>maxima.bat -s 7755 > Connecting Maxima to server on port 7755 > Maxima encountered a Lisp error: > > Error in LISP:LAMBDA-CLOSURE [or a callee]: Could not connect Brian, maxima -s doesn't create a Maxima server (i.e. listening on the specified port). Instead it creates a client, which attempts to connect to a server (such as wxMaxima) on the port. Take a look at pMaxima, which is a Maxima server implemented in Perl. There's a little bit about it in this message: http://permalink.gmane.org/gmane.comp.mathematics.maxima.general/37185 HTH Robert Dodier From robert.dodier at gmail.com Fri Feb 17 10:11:55 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 17 Feb 2012 09:11:55 -0700 Subject: [Maxima] Fw: Error using Sockets with Maxima In-Reply-To: <1329465241.5641.YahooMailNeo@web39403.mail.mud.yahoo.com> References: <1324444437.54181.YahooMailNeo@web39401.mail.mud.yahoo.com> <1324486072.94758.YahooMailNeo@web39403.mail.mud.yahoo.com> <1329464848.46406.YahooMailNeo@web39404.mail.mud.yahoo.com> <1329465241.5641.YahooMailNeo@web39403.mail.mud.yahoo.com> Message-ID: On 2/17/12, Brian Chacko wrote: > The error was the case sensitive 's' either, the actual command argument is > > maxima.bat -S 7755 I don't think that's right. When I try that, I get "Warning: argument S not recognized." HTH Robert Dodier From talon at lpthe.jussieu.fr Fri Feb 17 11:33:45 2012 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 17 Feb 2012 17:33:45 +0000 (UTC) Subject: [Maxima] Error using Sockets with Maxima References: <1324444437.54181.YahooMailNeo@web39401.mail.mud.yahoo.com> <1324486072.94758.YahooMailNeo@web39403.mail.mud.yahoo.com> <1329464848.46406.YahooMailNeo@web39404.mail.mud.yahoo.com> <1324444437.54181.YahooMailNeo@web39401.mail.mud.yahoo.com> <1324486072.94758.YahooMailNeo@web39403.mail.mud.yahoo.com> <1329464848.46406.YahooMailNeo@web39404.mail.mud.yahoo.com> Message-ID: Robert Dodier wrote: > On 2/17/12, Brian Chacko wrote: > >> I wanted my API to communicate with maxima using sockets the same way >> WxMaxima is being used. Using this method, I created a local server >> application and try to connect maxima to the server using the command >> >> [Path to maxima.bat]/maxima.bat -s 7755 >> >> I get the following error... >> >> [Path to Maxima]\bin>maxima.bat -s 7755 >> Connecting Maxima to server on port 7755 >> Maxima encountered a Lisp error: >> >> Error in LISP:LAMBDA-CLOSURE [or a callee]: Could not connect > > Brian, maxima -s doesn't create a Maxima server (i.e. listening on > the specified port). Instead it creates a client, which attempts to > connect to a server (such as wxMaxima) on the port. > > Take a look at pMaxima, which is a Maxima server implemented > in Perl. There's a little bit about it in this message: > http://permalink.gmane.org/gmane.comp.mathematics.maxima.general/37185 > > HTH > > Robert Dodier Indeed maxima -s doesn't create a listening socket so needs someone else to do that. What pMaxima does is that the perl program creates a listening socket and listens on it, and at the same time forks a child which fires up a maxima -s program connected to the same port. At lest for me, maxima -s does *not* work for whatever reason. If i do in one window Last login: Fri Feb 17 18:21:42 on ttys000 lilas% nc -l 8888 pid=13746 (%i1) 1+1; that is i create a listening socket with nc and in another window i create the maxima -s Last login: Fri Feb 17 01:18:08 on ttys000 lilas% maxima -s 8888 Connecting Maxima to server on port 8888 then i get the prompt (%i1) and i can type 1+1; but then everything hangs and i have no further output. Maybe this is nor exactly the intended use. If insted of using maxima -s i do the following lilas% maxima -r ":lisp (setup-client 8888)" (%i1) Then in the other window i have a maxima server which is not hanged: lilas% nc -l 8888 pid=13770 (%i1) 1+1; (%o1) 2 (%i2) What is the exact difference with maxima -s i don't know, but for me one works and not the other. -- Michel Talon From robert.dodier at gmail.com Fri Feb 17 13:01:33 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 17 Feb 2012 12:01:33 -0700 Subject: [Maxima] Problem with lsquares_estimates In-Reply-To: References: Message-ID: The variable b is assigned a value 0.75*%pi so that's why lsquares_estimates complains. Try kill(b) before the call to lsquares_estimates. HTH Robert Dodier From mickle.mouse at gmail.com Fri Feb 17 15:08:29 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Fri, 17 Feb 2012 14:08:29 -0700 Subject: [Maxima] Missing documentation or feature request Message-ID: I've been working on a particularly tricky problem and wanted to check my math. The problem simply an inverse matrix calculus derivative problem. Particularly: diff( -1/2 * transpose(invert(transpose(A)).(z-x)).(invert(transpose(A)).(z-x)), A), where A is a matrix ( cholesky decomposition of a covariance matrix), and z & x are vectors of the same length. I ran into several problems: 1) Invert only works on matrices if they are given - I need a symbolic matrix inversion for any sized matrix. I know differentiation of an inverted matrix is possible (see orion.uwaterloo.ca/~hwolkowi/matrixcookbook.pdf) 2) I tried other matrix calculus such as diff (transpose(x) . A . x, x), but Maxima returned " 'diff(transpose(x)) . A". The correct answer is " x . ( A + transpose(A) ) " 3) I have tried checking itensor and ctensor packages, but neither of them seemed to support a symbolic inverse. I'm not sure that even if it did, would I be able to differentiate the resulting expression. 4) Another thing I looked for, but couldn't find was a symbolic function inverse. I know the identity " diff( inverse(f(x)), x) = 1 / ( 'diff(f ( inverse f( x ) ), x ) " (see http://en.wikipedia.org/wiki/Inverse_functions_and_differentiation) So I guess this is a feature request unless someone can tell me how to use maxima to differentiate an expression (involving matrix inverses) with respect to the matrix. Features specifically useful would be: a) "Full" symbolic matrix inversion, which operates on any sized matrix and does not require specifying its components. b) Matrix calculus c) Symbolic function inverses (along with the associated calculus rules) or d) Better itensor/centsor documentation demonstrating how to handle a problem similar to mine. Thank you in advance for any advice. -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Fri Feb 17 15:25:33 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 17 Feb 2012 16:25:33 -0500 Subject: [Maxima] Missing documentation or feature request In-Reply-To: References: Message-ID: I can't help with the rest, but note that Maxima's notation for matrix inverse (symbolic or not) is A^^-1. "invert" is just a routine implementing a particular way of calculating explicit matrix inverses. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mickle.mouse at gmail.com Fri Feb 17 16:18:11 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Fri, 17 Feb 2012 15:18:11 -0700 Subject: [Maxima] Missing documentation or feature request In-Reply-To: References: Message-ID: Thank you - but the calculus rules are still wrong: /* [wxMaxima: input start ] */ diff( A(t)^^-1, t); /* [wxMaxima: input end ] */ 'diff(A(t)^^(-1),t,1) Should be A^^-1 . 'diff(A(t),t) . A^^-1 (http://orion.uwaterloo.ca/~hwolkowi/matrixcookbook.pdf) On Fri, Feb 17, 2012 at 2:25 PM, Stavros Macrakis wrote: > I can't help with the rest, but note that Maxima's notation for matrix > inverse (symbolic or not) is A^^-1. "invert" is just a routine > implementing a particular way of calculating explicit matrix inverses. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maillistor-cas at yahoo.se Sat Feb 18 03:00:52 2012 From: maillistor-cas at yahoo.se (Per Liss) Date: Sat, 18 Feb 2012 09:00:52 +0000 (GMT) Subject: [Maxima] The letter j as imaginary unit Message-ID: <1329555652.56753.YahooMailNeo@web171511.mail.ir2.yahoo.com> Hello, I'm am completely new to Maxima and computer algebra systems and am trying to learn how to make best use of it. After reading and introductory textbook, I have been now spent some time finding information on the Internet on how to make Maxima using the letter "j" as the imaginary unit in order not to make confusion with the symbol "i" for current. I would like Maxima not only to understand input using "%j" which I believe could be done by defining a constant, but also produce outputs using "j" instead of "i". My final goal is to find a way to permanently configure my installation to use the letter j. I would appreciate any tips where to find such info. I have searched the archive for this list and done a general Google search but didn't find any info. My installation is: Ubuntu Linux on an IBM T42p laptop running wxMaxima 0.8.4 (don't know hot to extract the Maxima core version) Best Regards, Per Liss From lapeyre.math122a at gmail.com Sat Feb 18 09:53:43 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Sat, 18 Feb 2012 16:53:43 +0100 Subject: [Maxima] how to format foreign object? Message-ID: <4F3FC987.1090209@gmail.com> I would like to tell Maxima how to format a particular lisp struct. I notice that for lisp list expressions there are some hooks that I don't understand. eg in nset.lisp. An example is the graph package: (%i68) (display2d:false, clebsch_graph()); (%o68) ?GRAPH\(16\ vertices\,\ 40\ edges\) (%i69) (display2d:true, clebsch_graph()); (%o69) GRAPH(16 vertices, 40 edges) (%i70) But, in particular, I am thinking of a struct with two slots that represents a maxima expression. If expr is a lisp list then the first slot is (car expr), the second is (cdr expr) copied to an array. The easiest is to convert the expression back to a list for printing. But sometimes, I want some indication of the representation. I can load a modified msize that tests with typep if the argument is this struct and converts it to a list. This is simple and seems fool-proof, but makes the array representation invisible. Also something like this does not belong at the top of msize, but somewhere down below the msize-atom code, I suppose. Maybe this is a complicated problem... John Lapeyre From l_butler at users.sourceforge.net Sat Feb 18 10:00:40 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Sat, 18 Feb 2012 16:00:40 +0000 Subject: [Maxima] Missing documentation or feature request In-Reply-To: (message from Mike Valenzuela on Fri, 17 Feb 2012 14:08:29 -0700) Message-ID: <1qp4nuo2kt3.fsf@iceland.freeshell.org> Mike Valenzuela writes: > [1:multipart/alternative Hide] > [1/1:text/plain Hide] > I've been working on a particularly tricky problem and wanted to check my > math. The problem simply an inverse matrix calculus derivative problem. > Particularly: > > diff( -1/2 * > transpose(invert(transpose(A)).(z-x)).(invert(transpose(A)).(z-x)), A), > where A is a matrix ( cholesky decomposition of a covariance matrix), and z > & x are vectors of the same length. > > I ran into several problems: > 1) Invert only works on matrices if they are given - I need a symbolic > matrix inversion for any sized matrix. I know differentiation of an > inverted matrix is possible (see > orion.uwaterloo.ca/~hwolkowi/matrixcookbook.pdf) > > 2) I tried other matrix calculus such as diff (transpose(x) . A . x, x), > but Maxima returned " 'diff(transpose(x)) . A". The correct answer is " x > . ( A + transpose(A) ) " > > 3) I have tried checking itensor and ctensor packages, but neither of them > seemed to support a symbolic inverse. I'm not sure that even if it did, > would I be able to differentiate the resulting expression. > > 4) Another thing I looked for, but couldn't find was a symbolic function > inverse. I know the identity " diff( inverse(f(x)), x) = 1 / ( 'diff(f ( > inverse f( x ) ), x ) " (see > http://en.wikipedia.org/wiki/Inverse_functions_and_differentiation) > > > So I guess this is a feature request unless someone can tell me how to use > maxima to differentiate an expression (involving matrix inverses) with > respect to the matrix. Features specifically useful would be: > a) "Full" symbolic matrix inversion, which operates on any sized matrix and > does not require specifying its components. > > b) Matrix calculus > > c) Symbolic function inverses (along with the associated calculus rules) > > or > > d) Better itensor/centsor documentation demonstrating how to handle a > problem similar to mine. Maxima has the capability to have simplification rules added to its built-in simplifier. Here are some: (%i1) kill(all)$ (%i1) display2d:false $ (%i2) matchdeclare(X,lambda([u],get(u,matrixp))) $ (%i3) matchdeclare(t,atom) $ (%i4) put(B,true,matrixp) $ (%i5) depends([A,B],x) $ (%i6) tellsimp('diff(X^^(-1),t),-X^^(-1) . diff(X,t) . X^^(-1)); (%i7) tellsimp('diff('transpose(X),t),transpose(diff(X,t))); tellsimp is a command that adds simplification rules; matchdeclare lets us apply these rules selectively. Now, we can try things out: (%i8) diff(B,x); (%o8) 'diff(B,x,1) (%i9) diff(B^^(-1),x); (%o9) -B^^(-1) . ('diff(B,x,1)) . B^^(-1) The correct answer. (%i10) diff(A,x); (%o10) 'diff(A,x,1) (%i11) diff(A^^(-1),x); (%o11) 'diff(A^^(-1),x,1) Because we have not told Maxima that A is a matrix, the simplifier leaves the expression unevaluated. (%i12) diff(transpose(B),x); (%o12) 'transpose('diff(B,x,1)) Again, the correct answer. (%i13) diff(transpose(B). A . B, x); (%o13) 'transpose('diff(B,x,1)) . A . B+'transpose(B) . ('diff(A,x,1)) . B +'transpose(B) . A . 'diff(B,x,1) Looks good, to.. (%i14) diff(transpose(B). C . B, x); (%o14) 'transpose('diff(B,x,1)) . C . B+'transpose(B) . C . 'diff(B,x,1) Looks good (Maxima treats C as a constant, unlike in %o13). -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From christian.stengg at gmx.at Sat Feb 18 10:33:38 2012 From: christian.stengg at gmx.at (Christian Stengg) Date: Sat, 18 Feb 2012 17:33:38 +0100 Subject: [Maxima] overview options of draw package Message-ID: <4F3FD2E2.7030009@gmx.at> Hello, is there anywhere an overview of all options (incl. possible values) of draw2d? Thank you, Christian From robert.dodier at gmail.com Sat Feb 18 10:44:07 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 18 Feb 2012 09:44:07 -0700 Subject: [Maxima] how to format foreign object? In-Reply-To: <4F3FC987.1090209@gmail.com> References: <4F3FC987.1090209@gmail.com> Message-ID: On 2/18/12, John Lapeyre wrote: > I would like to tell Maxima how to format a particular lisp > struct. I notice that for lisp list expressions there are > some hooks that I don't understand. eg in nset.lisp. For 2-d display, Maxima gets the formatting function name as (GET (CAAR EXPR) 'DIMENSION) and then calls that. For 1-d display, the property is GRIND The display code is pretty obtuse. When I need a display function I always just copy an existing one and then modify that. That only works for ordinary Maxima expressions which have the form ((FOO) ...). If you have some other kind of expression, I guess it won't work; you'd have to hack src/displa.lisp or src/grind.lisp. best Robert Dodier From p3aul1 at cox.net Sat Feb 18 01:20:17 2012 From: p3aul1 at cox.net (Paul) Date: Sat, 18 Feb 2012 02:20:17 -0500 Subject: [Maxima] inequities Message-ID: <4F3F5131.8060700@cox.net> I s Maxima intending to support inequities any time soon? Thanks, Paul From hbaker1 at pipeline.com Sat Feb 18 10:54:15 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Sat, 18 Feb 2012 08:54:15 -0800 Subject: [Maxima] "Portable" Maxima for PC's ?? Message-ID: Is Maxima available as a "portable" app for Windows ? "Portable" apps don't mess with the Registry, and they require only a limited number of read-only and read-write file locations. This allows the apps to live on a flash memory USB drive and be executed on a PC _without having to install the app on the PC itself_. In normal practise, the app is "installed" on the USB drive, and then merely inserted into the PC. The PC can then merely execute the app directly from the USB drive; all of the usual information that the app needs is on the USB drive, and any databases it needs are also on the USB drive. A Portable Maxima could be carried around on a USB drive, along with all of your own Maxima programs and data, which would allow you to run Maxima on nearly any PC that you have access to -- without having to "install" Maxima on that PC. Thus, if someone has a high performance PC & your home PC is too wimpy, you can plug your Maxima into the more powerful PC for a particularly difficult computation. More information here: http://portableapps.com/ http://portableapps.com/development From willisb at unk.edu Sat Feb 18 11:09:49 2012 From: willisb at unk.edu (Barton Willis) Date: Sat, 18 Feb 2012 11:09:49 -0600 Subject: [Maxima] The letter j as imaginary unit In-Reply-To: <1329555652.56753.YahooMailNeo@web171511.mail.ir2.yahoo.com> References: <1329555652.56753.YahooMailNeo@web171511.mail.ir2.yahoo.com> Message-ID: You might try declaring j to be an alias for %i. The command alias(j,%i) does this. You'll discover that j will print as %i: (%i3) exp(j * x); (%o3) %e^(%i*x) Maybe there is a workaround that prevents j from displaying as %i. Also, the alias command doesn't change the properties of %i--it is still the imaginary unit. Finally, there might be some limitations to alias that I don't know about. You can put the alias command into the Maxima initialization file "maxima-init.mac". To learn how to do this, see http://maxima.sourceforge.net/ui-tips.html. Working with any CAS involves some compromise with preferred notion, I think. Some users aren't thrilled that Maxima displays a+b+c as c+b+a. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: Inl?gg Maximalista >From: Per Liss >Sent by: maxima-bounces at math.utexas.edu >Date: 02/18/2012 03:00AM >Subject: [Maxima] The letter j as imaginary unit > >Hello, I'm am completely new to Maxima and computer algebra systems and >am trying to learn how to make best use of it. After reading and >introductory textbook, I have been now spent some time finding information >on the Internet on how to make Maxima using the letter "j" as the >imaginary unit in order not to make confusion with the symbol "i" for >current. I would like Maxima not only to understand input using "%j" which >I believe could be done by defining a constant, but also produce outputs >using "j" instead of "i". My final goal is to find a way to permanently >configure my installation to use the letter j. I would appreciate any >tips where to find such info. I have searched the archive for this list >and done a general Google search but didn't find any info. My >installation is: Ubuntu Linux on an IBM T42p laptop running wxMaxima 0.8.4 >(don't know hot to extract the Maxima core version) Best Regards, Per >Liss _______________________________________________ Maxima mailing list >Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From fateman at eecs.berkeley.edu Sat Feb 18 11:54:18 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 18 Feb 2012 09:54:18 -0800 Subject: [Maxima] how to format foreign object? In-Reply-To: References: <4F3FC987.1090209@gmail.com> Message-ID: <4F3FE5CA.1070205@eecs.berkeley.edu> On 2/18/2012 8:44 AM, Robert Dodier wrote: > On 2/18/12, John Lapeyre wrote: > >> I would like to tell Maxima how to format a particular lisp >> struct. I notice that for lisp list expressions there are >> some hooks that I don't understand. eg in nset.lisp. > For 2-d display, Maxima gets the formatting function name as > (GET (CAAR EXPR) 'DIMENSION) and then calls that. > For 1-d display, the property is GRIND > > The display code is pretty obtuse. When I need a display function > I always just copy an existing one and then modify that. > > That only works for ordinary Maxima expressions which have > the form ((FOO) ...). If you have some other kind of expression, > I guess it won't work; you'd have to hack src/displa.lisp or src/grind.lisp. > > best > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima If your internal expression is a lisp list of random stuff, then the obvious way to deal with maxima's display (and almost everything else) is to tag it, even though YOU don't need the tag. Robert's suggestion is more like an imperative. If you make it ((my_special_tag) mystuff1 mystuff2 ....) then everything else "works". A more modern approach would be to use an object system (like CLOS) in which each type of structure (= class) has a printing method. Maxima's organization is more around functions (e.g. display, simplify) than around objects (e.g. algebraic sum, matrix, ...) RJF From rswarbrick at gmail.com Sat Feb 18 11:47:10 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sat, 18 Feb 2012 17:47:10 +0000 Subject: [Maxima] The letter j as imaginary unit References: <1329555652.56753.YahooMailNeo@web171511.mail.ir2.yahoo.com> Message-ID: <1q4519xkm2.ln2@hake.rswarbrick.dnsalias.com> Per Liss writes: > After reading and introductory textbook, I have been now spent some > time finding information on the Internet on how to make Maxima using > the letter "j" as the imaginary unit in order not to make confusion > with the symbol "i" for current. I would like Maxima not only to > understand input using "%j" which I believe could be done by defining > a constant, but also produce outputs using "j" instead of "i". My > final goal is to find a way to permanently configure my installation > to use the letter j. The symbol %i is hard-coded throughout the source, so I'm pretty certain you just can't. However, %i is not the same as I or i, so I shouldn't think it's all that confusing seeing two of them in the same expression. If you want to be able to enter things using %j, you could start with the line %j: %i; But any calculation producing the imaginary unit will display as %i. If you've an expression that you want to eyeball without those distracting %i symbols, you could always do subst ('%j, %i, myexpr); which will replace them for you. Frankly, I'm not convinced it's worth the effort. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From macrakis at alum.mit.edu Sat Feb 18 12:28:33 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 18 Feb 2012 13:28:33 -0500 Subject: [Maxima] inequities In-Reply-To: <4F3F5131.8060700@cox.net> References: <4F3F5131.8060700@cox.net> Message-ID: Maxima will fight inequity wherever it is found! Maxima believes in liberty and justice and.... Oh, maybe you meant "inequalities"... Never mind. -s On Sat, Feb 18, 2012 at 02:20, Paul wrote: > I s Maxima intending to support inequities any time soon? > Thanks, > Paul > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Sat Feb 18 12:48:18 2012 From: willisb at unk.edu (Barton Willis) Date: Sat, 18 Feb 2012 12:48:18 -0600 Subject: [Maxima] inequities In-Reply-To: References: , <4F3F5131.8060700@cox.net> Message-ID: >On Sat, Feb 18, 2012 at 02:20, Paul wrote: > Is Maxima intending to support inequities any time soon? We do have fourier elimination (enter ? fourier_elim) and the simplex method (enter ?? simplex); further: (%i17) load(solve_rat_ineq)$ (%i18) solve_rat_ineq( (x-1)^2*(x+1) > 1+x ); (%o18) [[x>-1,x<0],[x>2]] Do any of these packages do what you need? --Barton From pbowyer at olynet.com Sat Feb 18 14:15:27 2012 From: pbowyer at olynet.com (Paul Bowyer) Date: Sat, 18 Feb 2012 12:15:27 -0800 Subject: [Maxima] "Portable" Maxima for PC's ?? In-Reply-To: References: Message-ID: <4F4006DF.4010806@olynet.com> On 02/18/2012 08:54 AM, Henry Baker wrote: > Is Maxima available as a "portable" app for Windows ? > > "Portable" apps don't mess with the Registry, and they require only a limited number of read-only and read-write file locations. > > This allows the apps to live on a flash memory USB drive and be executed on a PC _without having to install the app on the PC itself_. > > In normal practise, the app is "installed" on the USB drive, and then merely inserted into the PC. The PC can then merely execute the app directly from the USB drive; all of the usual information that the app needs is on the USB drive, and any databases it needs are also on the USB drive. > > A Portable Maxima could be carried around on a USB drive, along with all of your own Maxima programs and data, which would allow you to run Maxima on nearly any PC that you have access to -- without having to "install" Maxima on that PC. Thus, if someone has a high performance PC& your home PC is too wimpy, you can plug your Maxima into the more powerful PC for a particularly difficult computation. > > More information here: > > http://portableapps.com/ > > http://portableapps.com/development > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > Would a web interface satisfy your needs? http://www.vroomlab.com:8081/nhome/# I haven't really used it for anything of any complexity, but it does mention maxima is used. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleksasd873 at gmail.com Sat Feb 18 14:41:56 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Sat, 18 Feb 2012 22:41:56 +0200 Subject: [Maxima] inequities Message-ID: (%i1) load(solve_rat_ineq)$ (%i2) ineq:(x^2-x-6)/(x^2-7*x+12)<0; (%o2) (x^2-x-6)/(x^2-7*x+12)<0 (%i3) solve_rat_ineq(ineq); (%o3) [[x>-2,x<4]] Is x=3 solution? (%i4) subst(x=3,ineq); expt: undefined: 0 to a negative exponent. -- an error. To debug this try: debugmode(true); Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From lapeyre.math122a at gmail.com Sat Feb 18 15:39:10 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Sat, 18 Feb 2012 22:39:10 +0100 Subject: [Maxima] how to format foreign object? In-Reply-To: <4F3FE5CA.1070205@eecs.berkeley.edu> References: <4F3FC987.1090209@gmail.com> <4F3FE5CA.1070205@eecs.berkeley.edu> Message-ID: <4F401A7E.8030405@gmail.com> >> For 1-d display, the property is GRIND > A more modern approach would be to use an object system (like CLOS) in which > each type of structure (= class) has a printing method. Great, that was enough information to get something passable with a mininum of hacking. The print-function for structs is on the road to objects, but unless I'm mistaken the maxima display code doesn't use it in an intelligent way (the graph pacakge example I posted before comes from the struct print-function). A struct is an atom, so for display2d:false, I added a cond clause just before the default in msize-atom that checks for the struct with type-of. I then convert to a standard maxima expression, but call msize-matchfix-aex that retrieves the print symbols but appends an extra <>, or msize-function-aex that replaces () with <>. Not really pretty, but I can see what's happening. (%i1) aex( f(1,2,3) ); (%o1) f<1,2,3> (%i2) aex( [1,2,3] ); (%o2) <[1,2,3]> (%i3) aex ( [ [a,b], aex( set(x,y) ) ] ); (%o3) <[[a,b],<{x,y}>]> John Lapeyre From hbaker1 at pipeline.com Sat Feb 18 15:52:28 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Sat, 18 Feb 2012 13:52:28 -0800 Subject: [Maxima] "Portable" Maxima for PC's ?? In-Reply-To: References: Message-ID: That looks great! Unfortunately, it looks a bit old. Any chance to include a portable Maxima as a standard release? At 11:39 AM 2/18/2012, Jan Mueller wrote: >http://www.permucode.com/maxima/#download >BW >Jan > >Am 18.02.2012 um 17:54 schrieb Henry Baker : > >> Is Maxima available as a "portable" app for Windows ? >> >> "Portable" apps don't mess with the Registry, and they require only a limited number of read-only and read-write file locations. >> >> This allows the apps to live on a flash memory USB drive and be executed on a PC _without having to install the app on the PC itself_. >> >> In normal practise, the app is "installed" on the USB drive, and then merely inserted into the PC. The PC can then merely execute the app directly from the USB drive; all of the usual information that the app needs is on the USB drive, and any databases it needs are also on the USB drive. >> >> A Portable Maxima could be carried around on a USB drive, along with all of your own Maxima programs and data, which would allow you to run Maxima on nearly any PC that you have access to -- without having to "install" Maxima on that PC. Thus, if someone has a high performance PC & your home PC is too wimpy, you can plug your Maxima into the more powerful PC for a particularly difficult computation. >> >> More information here: >> >> http://portableapps.com/ >> >> http://portableapps.com/development From macrakis at alum.mit.edu Sat Feb 18 16:33:16 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 18 Feb 2012 17:33:16 -0500 Subject: [Maxima] The letter j as imaginary unit In-Reply-To: <1329555652.56753.YahooMailNeo@web171511.mail.ir2.yahoo.com> References: <1329555652.56753.YahooMailNeo@web171511.mail.ir2.yahoo.com> Message-ID: Maxima does not confuse i (for, e.g., current) with %i (the imaginary unit), so I'm not sure what the issue is here. And if you insist on "j", why would you want to use "%j"? But... If you really want to use j as the imaginary unit, that is easy enough to do by fiddling with some internal stuff: block([simp:false], ?putprop(%i,?j,'?texword), ?aliaslist: ?list(?cons(%i,j)), alias(j,%i)) After you execute that, you can use "j" on input as the imaginary unit, and Maxima will print "j" on output for the imaginary unit. It will also accept the input "%i" for the imaginary unit, but presumably that shouldn't be a problem. I am not sure why all this is useful, but there you are.... -s 2012/2/18 Per Liss > Hello, > > I'm am completely new to Maxima and computer algebra systems and am trying > to learn how to make best use of it. > > After reading and introductory textbook, I have been now spent some time > finding information on the Internet on how to make Maxima using the letter > "j" as the imaginary unit in order not to make confusion with the symbol > "i" for current. I would like Maxima not only to understand input using > "%j" which I believe could be done by defining a constant, but also produce > outputs using "j" instead of "i". My final goal is to find a way to > permanently configure my installation to use the letter j. > > I would appreciate any tips where to find such info. I have searched the > archive for this list and done a general Google search but didn't find any > info. > > My installation is: > Ubuntu Linux on an IBM T42p laptop running wxMaxima 0.8.4 (don't know hot > to extract the Maxima core version) > > > Best Regards, > Per Liss > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hbaker1 at pipeline.com Sat Feb 18 18:12:00 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Sat, 18 Feb 2012 16:12:00 -0800 Subject: [Maxima] "Portable" Maxima for PC's ?? In-Reply-To: References: Message-ID: I downloaded & installed this portable version of wxMaxima on a flash drive; it seems to work fine on XP. I haven't tried it on a Windows 7 machine yet. Apparently, it isn't terribly difficult to make programs portable, so perhaps a portable version could be put into the standard Maxima "make" file? At 11:39 AM 2/18/2012, Jan Mueller wrote: >http://www.permucode.com/maxima/#download >BW >Jan > >Am 18.02.2012 um 17:54 schrieb Henry Baker : > >> Is Maxima available as a "portable" app for Windows ? >> >> "Portable" apps don't mess with the Registry, and they require only a limited number of read-only and read-write file locations. >> >> This allows the apps to live on a flash memory USB drive and be executed on a PC _without having to install the app on the PC itself_. >> >> In normal practise, the app is "installed" on the USB drive, and then merely inserted into the PC. The PC can then merely execute the app directly from the USB drive; all of the usual information that the app needs is on the USB drive, and any databases it needs are also on the USB drive. >> >> A Portable Maxima could be carried around on a USB drive, along with all of your own Maxima programs and data, which would allow you to run Maxima on nearly any PC that you have access to -- without having to "install" Maxima on that PC. Thus, if someone has a high performance PC & your home PC is too wimpy, you can plug your Maxima into the more powerful PC for a particularly difficult computation. >> >> More information here: >> >> http://portableapps.com/ >> >> http://portableapps.com/development From mickle.mouse at gmail.com Sat Feb 18 19:00:05 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Sat, 18 Feb 2012 18:00:05 -0700 Subject: [Maxima] Missing documentation or feature request In-Reply-To: <1qp4nuo2kt3.fsf@iceland.freeshell.org> References: <1qp4nuo2kt3.fsf@iceland.freeshell.org> Message-ID: Ahhh, thank you Leo Butler. I assume this handles recursive rules too? I'll be needing to put in the matrix chain rule too. Maybe I'll start developing a package putting in most of the rules from the matrix cookbook. On 2012-02-18 9:00 AM, "Leo Butler" wrote: Mike Valenzuela writes: > [1:multipart/alternative Hide] > [1/1:text/plain Hide] > I've been working on a particularly tricky problem and wanted to check my > math. The problem simp... Maxima has the capability to have simplification rules added to its built-in simplifier. Here are some: (%i1) kill(all)$ (%i1) display2d:false $ (%i2) matchdeclare(X,lambda([u],get(u,matrixp))) $ (%i3) matchdeclare(t,atom) $ (%i4) put(B,true,matrixp) $ (%i5) depends([A,B],x) $ (%i6) tellsimp('diff(X^^(-1),t),-X^^(-1) . diff(X,t) . X^^(-1)); (%i7) tellsimp('diff('transpose(X),t),transpose(diff(X,t))); tellsimp is a command that adds simplification rules; matchdeclare lets us apply these rules selectively. Now, we can try things out: (%i8) diff(B,x); (%o8) 'diff(B,x,1) (%i9) diff(B^^(-1),x); (%o9) -B^^(-1) . ('diff(B,x,1)) . B^^(-1) The correct answer. (%i10) diff(A,x); (%o10) 'diff(A,x,1) (%i11) diff(A^^(-1),x); (%o11) 'diff(A^^(-1),x,1) Because we have not told Maxima that A is a matrix, the simplifier leaves the expression unevaluated. (%i12) diff(transpose(B),x); (%o12) 'transpose('diff(B,x,1)) Again, the correct answer. (%i13) diff(transpose(B). A . B, x); (%o13) 'transpose('diff(B,x,1)) . A . B+'transpose(B) . ('diff(A,x,1)) . B +'transpose(B) . A . 'diff(B,x,1) Looks good, to.. (%i14) diff(transpose(B). C . B, x); (%o14) 'transpose('diff(B,x,1)) . C . B+'transpose(B) . C . 'diff(B,x,1) Looks good (Maxima treats C as a constant, unlike in %o13). -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Sun Feb 19 04:20:56 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sun, 19 Feb 2012 10:20:56 +0000 Subject: [Maxima] inequities References: Message-ID: Aleksas Domarkas writes: > (%i1) load(solve_rat_ineq)$ > (%i2) ineq:(x^2-x-6)/(x^2-7*x+12)<0; > (%o2) (x^2-x-6)/(x^2-7*x+12)<0 > (%i3) solve_rat_ineq(ineq); > (%o3) [[x>-2,x<4]] > > Is x=3 solution? > > (%i4) subst(x=3,ineq); > expt: undefined: 0 to a negative exponent. > -- an error. To debug this try: debugmode(true); Er, yes. But the quotient is actually (x+2)/(x-4). Subst just substituted in the zero literally and you got 0/0. Try ratsubst: (%i5) ratsubst(3,x,ineq); (%o5) - 5 < 0 Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From yasuaki.honda at gmail.com Sun Feb 19 08:40:43 2012 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Sun, 19 Feb 2012 23:40:43 +0900 Subject: [Maxima] zeta(%i-1),numer; causes an error Message-ID: Dear all, Using Maxima-5.26.0 on Mac OS X and Windows pre-built binaries, it seems zeta() with some complex number arg generates errors. (%i1) zeta(%i-1),numer; BIGFLOAT: unable to convert #C(2.0 -1.0) to a CL or BIGFLOAT number. -- an error. To debug this try: debugmode(true); However, (%i2) zeta(%i),numer; .003300120024800517-0.418155468349857*%i I believe (%i1) case is a bug. Is there anyone working on this? Yasuaki Honda Chiba, Japan -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sun Feb 19 11:09:17 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 19 Feb 2012 10:09:17 -0700 Subject: [Maxima] zeta(%i-1),numer; causes an error In-Reply-To: References: Message-ID: On 2/19/12, ???? wrote: > (%i1) zeta(%i-1),numer; > BIGFLOAT: unable to convert #C(2.0 -1.0) to a CL or BIGFLOAT number. Looks like BIGFLOAT:TO is called w/ a Lisp complex as its argument, and it doesn't know what to do with that. I suppose it should just return it unmodified. I've attached a patch to do that; comments, anyone? This seems to fix the bug reported. best Robert Dodier PS. diff --git a/src/numeric.lisp b/src/numeric.lisp index bd136f7..397ced2 100644 --- a/src/numeric.lisp +++ b/src/numeric.lisp @@ -1548,7 +1548,7 @@ (setf im (float im re)))) (complex re im))) (t - (cond ((cl:realp maxima-num) + (cond ((or (cl:realp maxima-num) (cl:complexp maxima-num)) maxima-num) ((eq maxima-num 'maxima::$%i) ;; Convert %i to an exact complex cl:rational. From fateman at eecs.berkeley.edu Sun Feb 19 13:03:35 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 19 Feb 2012 11:03:35 -0800 Subject: [Maxima] zeta(%i-1),numer; causes an error In-Reply-To: References: Message-ID: <4F414787.3090704@eecs.berkeley.edu> On 2/19/2012 9:09 AM, Robert Dodier wrote: > On 2/19/12, ???? wrote: > >> (%i1) zeta(%i-1),numer; >> BIGFLOAT: unable to convert #C(2.0 -1.0) to a CL or BIGFLOAT number. > Looks like BIGFLOAT:TO is called w/ a Lisp complex as its > argument, and it doesn't know what to do with that. > I suppose it should just return it unmodified. I think bfloat( ?complex(2,-1)) should return 2.0b0 - 1.0b0*%i just as bfloat(2-%i) returns that. But why is zeta() using bigfloats? When Macsyma was written, lisp didn't have built-in complex numbers. Even now, lisp doesn't have built-in complex numbers with bigfloat parts, so we could either make a new complex-constant-with-any-Maxima-numbers for Re and Im. or just chug along with ((mplus) Re ((mtimes) %i Im))... RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sun Feb 19 13:11:00 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 19 Feb 2012 11:11:00 -0800 Subject: [Maxima] zeta(%i-1),numer; causes an error In-Reply-To: References: Message-ID: On 2/19/12 9:09 AM, Robert Dodier wrote: > On 2/19/12, ???? wrote: > >> (%i1) zeta(%i-1),numer; >> BIGFLOAT: unable to convert #C(2.0 -1.0) to a CL or BIGFLOAT number. > > Looks like BIGFLOAT:TO is called w/ a Lisp complex as its > argument, and it doesn't know what to do with that. > I suppose it should just return it unmodified. > I've attached a patch to do that; comments, anyone? > This seems to fix the bug reported. Thanks for looking into this. I think your patch is correct, but I'd just use cl:numberp instead. I think we want bigfloat:to to return any CL number as is. Ray From toy.raymond at gmail.com Sun Feb 19 13:19:31 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 19 Feb 2012 11:19:31 -0800 Subject: [Maxima] zeta(%i-1),numer; causes an error In-Reply-To: <4F414787.3090704@eecs.berkeley.edu> References: <4F414787.3090704@eecs.berkeley.edu> Message-ID: On 2/19/12 11:03 AM, Richard Fateman wrote: > On 2/19/2012 9:09 AM, Robert Dodier wrote: >> On 2/19/12, ???? wrote: >> >>> (%i1) zeta(%i-1),numer; >>> BIGFLOAT: unable to convert #C(2.0 -1.0) to a CL or BIGFLOAT number. >> Looks like BIGFLOAT:TO is called w/ a Lisp complex as its >> argument, and it doesn't know what to do with that. >> I suppose it should just return it unmodified. > > I think bfloat( ?complex(2,-1)) should return 2.0b0 - 1.0b0*%i > just as bfloat(2-%i) returns that. > > But why is zeta() using bigfloats? It's a badly named package. Originally, the BIGFLOAT package was only meant to provide an easy-to-use way of using maxima's bfloat numbers. Hence the package name of BIGFLOAT. But with a little bit of extra work, it also provided 99% of the infrastructure to allow one piece of lisp code to handle bfloats and floats (both real and complex) so that the author didn't need to write up to 4 different but essentially identical versions of the same piece of code. (To handle float, complex float, bfloat and complex bfloat). So there is just one routine to compute zeta functions, and it uses the BIGFLOAT package to handle floats and bfloats, and complex versions thereof. So, when given a float, only float arithmetic is used. Yes, this approach is slower (possibly much slower) than 4 separate routines, but at least then we get all precisions at once and if the speed of the float routine is a concern, it can easily be changed to a hand-written version. Ray From fateman at eecs.berkeley.edu Sun Feb 19 13:33:12 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 19 Feb 2012 11:33:12 -0800 Subject: [Maxima] zeta(%i-1),numer; causes an error In-Reply-To: References: <4F414787.3090704@eecs.berkeley.edu> Message-ID: <4F414E78.8080100@eecs.berkeley.edu> maybe we should have a cbfloat for complex bigfloats? I agree that bigfloat:to can't make a real bigfloat from a complex, [unless imag part happens to be zero] but it can make a bigfloaty-thing :) RJF From biomates at telefonica.net Sun Feb 19 13:51:40 2012 From: biomates at telefonica.net (Mario Rodriguez) Date: Sun, 19 Feb 2012 20:51:40 +0100 Subject: [Maxima] overview options of draw package In-Reply-To: <4F3FD2E2.7030009@gmx.at> References: <4F3FD2E2.7030009@gmx.at> Message-ID: <1329681100.1594.3.camel@pc> El s?b, 18-02-2012 a las 17:33 +0100, Christian Stengg escribi?: > Hello, > > is there anywhere an overview of all options (incl. possible values) of > draw2d? Hello, All draw options in alphabetical order are listed here, together with possible values and some examples: http://maxima.sourceforge.net/docs/manual/en/maxima_48.html#SEC241 -- Mario From toy.raymond at gmail.com Sun Feb 19 14:21:29 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 19 Feb 2012 12:21:29 -0800 Subject: [Maxima] zeta(%i-1),numer; causes an error In-Reply-To: References: Message-ID: <4F4159C9.9060902@gmail.com> On 2/19/12 11:11 AM, Raymond Toy wrote: > On 2/19/12 9:09 AM, Robert Dodier wrote: >> On 2/19/12, ???? wrote: >> >>> (%i1) zeta(%i-1),numer; >>> BIGFLOAT: unable to convert #C(2.0 -1.0) to a CL or BIGFLOAT number. >> Looks like BIGFLOAT:TO is called w/ a Lisp complex as its >> argument, and it doesn't know what to do with that. >> I suppose it should just return it unmodified. >> I've attached a patch to do that; comments, anyone? >> This seems to fix the bug reported. > Thanks for looking into this. I think your patch is correct, but I'd > just use cl:numberp instead. I think we want bigfloat:to to return any > CL number as is. > > Git repo updated. Ray From toy.raymond at gmail.com Sun Feb 19 14:27:15 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 19 Feb 2012 12:27:15 -0800 Subject: [Maxima] zeta(%i-1),numer; causes an error In-Reply-To: <4F414E78.8080100@eecs.berkeley.edu> References: <4F414787.3090704@eecs.berkeley.edu> <4F414E78.8080100@eecs.berkeley.edu> Message-ID: <4F415B23.8030604@gmail.com> On 2/19/12 11:33 AM, Richard Fateman wrote: > maybe we should have a cbfloat for complex bigfloats? You mean as something separate from what the bigfloat package does now? If so, that seems pretty invasive and not so useful unless you add support for "native" complex number as well. But this, in addition to your work on supporting CL rationals natively (instead of ((rat) num den)) would be nice. > > I agree that bigfloat:to can't make a real bigfloat from a complex, > [unless imag part happens to be zero] but > it can make a bigfloaty-thing :) No, bigfloat:to can't make a real bigfloat from a complex, but it will convert a bigfloat complex object to maxima's ((mplus) real ((mtimes) imag $%i)). Ray From toy.raymond at gmail.com Sun Feb 19 14:45:30 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 19 Feb 2012 12:45:30 -0800 Subject: [Maxima] float erf (%i) ?? In-Reply-To: <4F3BF977.7040409@gmail.com> References: <4F3B0233.7060702@gmail.com> <4F3B3312.7030806@gmail.com> <4F3BF977.7040409@gmail.com> Message-ID: On 2/15/12 10:29 AM, John Lapeyre wrote: >> >> I don't think this is the right thing to do. Why? Because: >> >> erf(%i),numer; >> >> returns 1.650425758797543 %i. >> >> How did I know? I cheated and looked at the code for >> float-numerical-eval-p which has a check for $numer. > >> Perhaps %erf needs a 'subc property added to its property list? > > I don't understand how that works, except that it has something > to to with creating a subcontext. My mistake. I was wondering how float(sin(%i)) will return a numerical result when float(erf(%i)) does not. We're missing something, but I don't know what that is right now. > It seems there should be a way of having float(erf(%i)) work that is > independent of how erf simplifies to erfi. Agreed. There is still the separate and long-standing issue of how float and numer behave differently in rather unexpected ways. Ray From toy.raymond at gmail.com Sun Feb 19 14:49:44 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 19 Feb 2012 12:49:44 -0800 Subject: [Maxima] maxima.sourceforge.net? Message-ID: Does anyone keep maxima.sourceforge.net up-to-date? The news feed is rather old with the latest news from Apr, 2011 and Maxima 5.24.0. Or is there another canonical site for maxima? If so, maxima.sourceforge.net should be updated to point to there. Ray From maillistor-cas at yahoo.se Sun Feb 19 15:01:52 2012 From: maillistor-cas at yahoo.se (Per Liss) Date: Sun, 19 Feb 2012 21:01:52 +0000 (GMT) Subject: [Maxima] The letter j as imaginary unit In-Reply-To: References: <1329555652.56753.YahooMailNeo@web171511.mail.ir2.yahoo.com> Message-ID: <1329685312.97780.YahooMailNeo@web171503.mail.ir2.yahoo.com> Thanks Stavros and others who responded, It seemed to be an interesting solution which would solve the problem. I tested z: 2+3*%i before and z: 2+3*%j after applying the solution and then converted to polar form using z1: polarform(z) Unfortunately z1 differ before and after applying the suggested solution and z1 is presented with a mix of? %i and %j and the result is less simplified with the solution applied. The reason I want to use j is that it is common practice among engineers, at least in electrical engineering, to use j instead of i as imaginary unit and it would be a good idea to keep that practice in all steps of the engineering processes instead of sometimes using i and sometimes using j. (BTW it seems that both Mathematica and Maple provide a built in solution to this.) /Per ________________________________ Fr?n: Stavros Macrakis Till: Per Liss Kopia: Inl?gg Maximalista Skickat: l?rdag, 18 februari 2012 23:33 ?mne: Re: [Maxima] The letter j as imaginary unit Maxima does not confuse i (for, e.g., current) with %i (the imaginary unit), so I'm not sure what the issue is here. ?And if you insist on "j", why would you want to use "%j"? But... If you really want to use j as the imaginary unit, that is easy enough to do by fiddling with some internal stuff: ? ? ?block([simp:false], ? ? ? ? ? ??putprop(%i,?j,'?texword), ? ? ? ? ? ??aliaslist: ?list(?cons(%i,j)), ? ? ? ? ? ?alias(j,%i)) After you execute that, you can use "j" on input as the imaginary unit, and Maxima will print "j" on output for the imaginary unit. ?It will also accept the input "%i" for the imaginary unit, but presumably that shouldn't be a problem. I am not sure why all this is useful, but there you are.... ? ? ? ? ? ? ? -s 2012/2/18 Per Liss Hello, > >I'm am completely new to Maxima and computer algebra systems and am trying to learn how to make best use of it. > >After reading and introductory textbook, I have been now spent some time finding information on the Internet on how to make Maxima using the letter "j" as the imaginary unit in order not to make confusion with the symbol "i" for current. I would like Maxima not only to understand input using "%j" which I believe could be done by defining a constant, but also produce outputs using "j" instead of "i". My final goal is to find a way to permanently configure my installation to use the letter j. > >I would appreciate any tips where to find such info. I have searched the archive for this list and done a general Google search but didn't find any info. > >My installation is: >Ubuntu Linux on an IBM T42p laptop running wxMaxima 0.8.4 (don't know hot to extract the Maxima core version) > > >Best Regards, >Per Liss > >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun Feb 19 15:09:01 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 19 Feb 2012 16:09:01 -0500 Subject: [Maxima] The letter j as imaginary unit In-Reply-To: <1329685312.97780.YahooMailNeo@web171503.mail.ir2.yahoo.com> References: <1329555652.56753.YahooMailNeo@web171511.mail.ir2.yahoo.com> <1329685312.97780.YahooMailNeo@web171503.mail.ir2.yahoo.com> Message-ID: The solution I presented was to support *** j *** as the imaginary unit. If you want *** %j *** and not *** j *** to be the imaginary unit, you need to write block([simp:false], ?putprop(%i,?j,'?texword), ?aliaslist: ?list(?cons(%i,%j)), alias(%j,%i)) Does that resolve your problem? If not, could you please supply a *complete transcript* of a Maxima session (using display2d:false) which shows the problem? -s 2012/2/19 Per Liss > Thanks Stavros and others who responded, > > It seemed to be an interesting solution which would solve the problem. > > I tested > > z: 2+3*%i > > before and > > z: 2+3*%j > > after applying the solution and then converted to polar form using > z1: polarform(z) > > Unfortunately z1 differ before and after applying the suggested solution > and z1 is presented with a mix of %i and %j and the result is less > simplified with the solution applied. > > The reason I want to use j is that it is common practice among engineers, > at least in electrical engineering, to use j instead of i as imaginary unit > and it would be a good idea to keep that practice in all steps of the > engineering processes instead of sometimes using i and sometimes using j. > (BTW it seems that both Mathematica and Maple provide a built in solution > to this.) > > /Per > > ------------------------------ > *Fr?n:* Stavros Macrakis > *Till:* Per Liss > *Kopia:* Inl?gg Maximalista > *Skickat:* l?rdag, 18 februari 2012 23:33 > *?mne:* Re: [Maxima] The letter j as imaginary unit > > Maxima does not confuse i (for, e.g., current) with %i (the imaginary > unit), so I'm not sure what the issue is here. And if you insist on "j", > why would you want to use "%j"? But... > > If you really want to use j as the imaginary unit, that is easy enough to > do by fiddling with some internal stuff: > > block([simp:false], > ?putprop(%i,?j,'?texword), > ?aliaslist: ?list(?cons(%i,j)), > alias(j,%i)) > > After you execute that, you can use "j" on input as the imaginary unit, > and Maxima will print "j" on output for the imaginary unit. It will also > accept the input "%i" for the imaginary unit, but presumably that shouldn't > be a problem. > > I am not sure why all this is useful, but there you are.... > > -s > > 2012/2/18 Per Liss > > Hello, > > I'm am completely new to Maxima and computer algebra systems and am trying > to learn how to make best use of it. > > After reading and introductory textbook, I have been now spent some time > finding information on the Internet on how to make Maxima using the letter > "j" as the imaginary unit in order not to make confusion with the symbol > "i" for current. I would like Maxima not only to understand input using > "%j" which I believe could be done by defining a constant, but also produce > outputs using "j" instead of "i". My final goal is to find a way to > permanently configure my installation to use the letter j. > > I would appreciate any tips where to find such info. I have searched the > archive for this list and done a general Google search but didn't find any > info. > > My installation is: > Ubuntu Linux on an IBM T42p laptop running wxMaxima 0.8.4 (don't know hot > to extract the Maxima core version) > > > Best Regards, > Per Liss > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sun Feb 19 15:58:28 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 19 Feb 2012 13:58:28 -0800 Subject: [Maxima] The letter j as imaginary unit In-Reply-To: <1329685312.97780.YahooMailNeo@web171503.mail.ir2.yahoo.com> References: <1329555652.56753.YahooMailNeo@web171511.mail.ir2.yahoo.com> <1329685312.97780.YahooMailNeo@web171503.mail.ir2.yahoo.com> Message-ID: <4F417084.7050208@gmail.com> On 2/19/12 1:01 PM, Per Liss wrote: > simplified with the solution applied. > > The reason I want to use j is that it is common practice among > engineers, at least in electrical engineering, to use j instead of i as > imaginary unit and it would be a good idea to keep that practice in all > steps of the engineering processes instead of sometimes using i and > sometimes using j. (BTW it seems that both Mathematica and Maple provide As an EE, I never had problems switching between i and j, and none of my college friends seem to have had problems either. Perhaps because everyone was taking EE classes at the same time as math classes, so i and j were always in use at the same time. The only time it was confusing if someone wanted to use i or j as an summation index. (Which I always felt was a bad idea because j looks very much like i which looks like 1 at the small font sizes used for summation indices.) Besides, I don't hear much complaint from mathematicians that maxima uses %i instead of just i. :-) Ray From toy.raymond at gmail.com Sun Feb 19 15:58:28 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 19 Feb 2012 13:58:28 -0800 Subject: [Maxima] The letter j as imaginary unit In-Reply-To: <1329685312.97780.YahooMailNeo@web171503.mail.ir2.yahoo.com> References: <1329555652.56753.YahooMailNeo@web171511.mail.ir2.yahoo.com> <1329685312.97780.YahooMailNeo@web171503.mail.ir2.yahoo.com> Message-ID: <4F417084.7050208@gmail.com> On 2/19/12 1:01 PM, Per Liss wrote: > simplified with the solution applied. > > The reason I want to use j is that it is common practice among > engineers, at least in electrical engineering, to use j instead of i as > imaginary unit and it would be a good idea to keep that practice in all > steps of the engineering processes instead of sometimes using i and > sometimes using j. (BTW it seems that both Mathematica and Maple provide As an EE, I never had problems switching between i and j, and none of my college friends seem to have had problems either. Perhaps because everyone was taking EE classes at the same time as math classes, so i and j were always in use at the same time. The only time it was confusing if someone wanted to use i or j as an summation index. (Which I always felt was a bad idea because j looks very much like i which looks like 1 at the small font sizes used for summation indices.) Besides, I don't hear much complaint from mathematicians that maxima uses %i instead of just i. :-) Ray From lapeyre.math122a at gmail.com Sun Feb 19 16:05:33 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Sun, 19 Feb 2012 23:05:33 +0100 Subject: [Maxima] float erf (%i) ?? In-Reply-To: References: <4F3B0233.7060702@gmail.com> <4F3B3312.7030806@gmail.com> <4F3BF977.7040409@gmail.com> Message-ID: <4F41722D.6000603@gmail.com> > result when float(erf(%i)) does not. We're missing something, but I > don't know what that is right now. I think maybe this is what you are already saying, but, (%i1) (%iargs:true, float(sin(%i))); (%o1) 1.175201193643801 %i (%i2) (%iargs:false, float(sin(%i))); (%o2) sin(%i) (%i3) (erf_%iargs:false, float(erf(%i))); (%o3) erf(%i) (%i4) (erf_%iargs:true, float(erf(%i))); (%o4) 1.650425758797543 %i float() has some special code for log. kinda ugly. you could add special code for sin , and erf, and .... I don't know how make a local binding for a dynamic variable that is seen in called functions, although I tried. But I did set a dynamic variable *want-float* as a flag in float() and then do meval on the argument, although it's already been evaluated when float was called, because this time the flag is set. In the same code in gamma.lisp that checks (or $numer ....) you put *want-float*. This is easy. Then I get: (%i1) float(erf(%i)); /* *want-float* is t */ (%o1) 1.650425758797543*%i (%i2) erf(%i); /* *want-float* is nil */ (%o2) erf(%i) which is what you want, but it's a hack. But maybe something along these lines. You could change $float to defmspec and set the flag and then do meval on the arg; less of a hack because the arg is evaluated once. But a bunch of code relies on calling $float as a lisp function. btw., I think Mathematica always transforms functions like sin(n*%i) --> %i * sinh(n). It might be interesting to see whether people like that or complain about it ... like they complain about returning unevaluated forms instead of errors. I like the idea of having it configurable, buy maybe not with multiple flags, and some of them undocumented... John Lapeyre From tomdean at speakeasy.org Sun Feb 19 16:26:46 2012 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Sun, 19 Feb 2012 14:26:46 -0800 Subject: [Maxima] The letter j as imaginary unit In-Reply-To: <4F417084.7050208@gmail.com> References: <1329555652.56753.YahooMailNeo@web171511.mail.ir2.yahoo.com> <1329685312.97780.YahooMailNeo@web171503.mail.ir2.yahoo.com> <4F417084.7050208@gmail.com> Message-ID: <4F417726.7090103@speakeasy.org> > As an EE, I never had problems switching between i and j, and none of my > college friends seem to have had problems either. Perhaps because > everyone was taking EE classes at the same time as math classes, so i > and j were always in use at the same time. The only time it was > confusing if someone wanted to use i or j as an summation index. One way to avoid problems with indexes, is to use idx, jdx, kdx, etc. Tom Dean From toy.raymond at gmail.com Sun Feb 19 17:29:03 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 19 Feb 2012 15:29:03 -0800 Subject: [Maxima] float erf (%i) ?? In-Reply-To: <4F41722D.6000603@gmail.com> References: <4F3B0233.7060702@gmail.com> <4F3B3312.7030806@gmail.com> <4F3BF977.7040409@gmail.com> <4F41722D.6000603@gmail.com> Message-ID: <4F4185BF.40406@gmail.com> On 2/19/12 2:05 PM, John Lapeyre wrote: > >> result when float(erf(%i)) does not. We're missing something, but I >> don't know what that is right now. > > I think maybe this is what you are already saying, but, > > (%i1) (%iargs:true, float(sin(%i))); > (%o1) 1.175201193643801 %i > (%i2) (%iargs:false, float(sin(%i))); > (%o2) sin(%i) > (%i3) (erf_%iargs:false, float(erf(%i))); > (%o3) erf(%i) > (%i4) (erf_%iargs:true, float(erf(%i))); > (%o4) 1.650425758797543 %i Hmm. Perhaps erf_%iargs should default to true? Or maybe just get rid of erf_%iargs in favor of %iargs? I hope Dieter can say something about this. (I think it was Dieter who wrote the erf code.) > > float() has some special code for log. kinda ugly. you could > add special code for sin , and erf, and .... I don't know > how make a local binding for a dynamic variable that is > seen in called functions, although I tried. But I did Usually done like (let ((*dynvar* new-value)) ) > > btw., I think Mathematica always transforms functions like > sin(n*%i) --> %i * sinh(n). It might be interesting to see > whether people like that or complain about it ... like they > complain about returning unevaluated forms instead of > errors. I like the idea of having it configurable, buy > maybe not with multiple flags, and some of them > undocumented... I think this is always tricky. Sometimes you want the transformation and sometimes you don't. Global flags are always troublesome (at least to me who can never remember the names and what they really control). I would be happy, however, to have a function that I can use to convert sin(x*%i) to %i*sinh(x) (and back) so I can decide when the transformation should be done. Ray From toy.raymond at gmail.com Sun Feb 19 17:29:03 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 19 Feb 2012 15:29:03 -0800 Subject: [Maxima] float erf (%i) ?? In-Reply-To: <4F41722D.6000603@gmail.com> References: <4F3B0233.7060702@gmail.com> <4F3B3312.7030806@gmail.com> <4F3BF977.7040409@gmail.com> <4F41722D.6000603@gmail.com> Message-ID: <4F4185BF.40406@gmail.com> On 2/19/12 2:05 PM, John Lapeyre wrote: > >> result when float(erf(%i)) does not. We're missing something, but I >> don't know what that is right now. > > I think maybe this is what you are already saying, but, > > (%i1) (%iargs:true, float(sin(%i))); > (%o1) 1.175201193643801 %i > (%i2) (%iargs:false, float(sin(%i))); > (%o2) sin(%i) > (%i3) (erf_%iargs:false, float(erf(%i))); > (%o3) erf(%i) > (%i4) (erf_%iargs:true, float(erf(%i))); > (%o4) 1.650425758797543 %i Hmm. Perhaps erf_%iargs should default to true? Or maybe just get rid of erf_%iargs in favor of %iargs? I hope Dieter can say something about this. (I think it was Dieter who wrote the erf code.) > > float() has some special code for log. kinda ugly. you could > add special code for sin , and erf, and .... I don't know > how make a local binding for a dynamic variable that is > seen in called functions, although I tried. But I did Usually done like (let ((*dynvar* new-value)) ) > > btw., I think Mathematica always transforms functions like > sin(n*%i) --> %i * sinh(n). It might be interesting to see > whether people like that or complain about it ... like they > complain about returning unevaluated forms instead of > errors. I like the idea of having it configurable, buy > maybe not with multiple flags, and some of them > undocumented... I think this is always tricky. Sometimes you want the transformation and sometimes you don't. Global flags are always troublesome (at least to me who can never remember the names and what they really control). I would be happy, however, to have a function that I can use to convert sin(x*%i) to %i*sinh(x) (and back) so I can decide when the transformation should be done. Ray From robert.dodier at gmail.com Mon Feb 20 01:17:51 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 20 Feb 2012 00:17:51 -0700 Subject: [Maxima] maxima.sourceforge.net? In-Reply-To: References: Message-ID: On 2/19/12, Raymond Toy wrote: > Does anyone keep maxima.sourceforge.net up-to-date? The news feed is > rather old with the latest news from Apr, 2011 and Maxima 5.24.0. Yes, maxima.sourceforge.net is still being maintained more or less. I think Alexey Beshenov was the person who was most recently in charge of that. If anyone wants to work on the web site, I'll be happy to bestow sufficient privilege. best Robert Dodier From robert.dodier at gmail.com Mon Feb 20 01:31:47 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 20 Feb 2012 00:31:47 -0700 Subject: [Maxima] diff -- second argument In-Reply-To: References: Message-ID: On 2/16/12, Stavros Macrakis wrote: > Actually, a little reflection makes it clear that diff(f(x),g(x)) should > not be an error or a noun form, because in fact it is perfectly > well-defined and meaningful: > > diff(A,B) == ev(diff(A)/diff(B),del) Looks OK to me. OK by me to merge this in. best Robert Dodier From robert.dodier at gmail.com Mon Feb 20 01:38:55 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 20 Feb 2012 00:38:55 -0700 Subject: [Maxima] bug in 'is' ? In-Reply-To: References: <4F3CFA5E.3000409@gmail.com> Message-ID: On 2/16/12, Stavros Macrakis wrote: > Since strings are not (currently) in the domain of the Maxima comparison > operators, this should either give an error or return 'unknown'. I think I > know what Robert's preference would be.... Well, an error is essentially a declaration that the expression in question can never have a meaningful interpretation. In the case of a string compared to a symbol, that could be be given a meaningful interpretation if the symbol is assigned a string value. (At present, is("a" < "b") triggers an error, but that's a separate problem; it should be true.) Therefore is("mystring" < mysymbol) should return 'unknown. best Robert Dodier From aishen at free.fr Mon Feb 20 01:46:22 2012 From: aishen at free.fr (aishen at free.fr) Date: Mon, 20 Feb 2012 08:46:22 +0100 Subject: [Maxima] The letter j as imaginary unit In-Reply-To: <4F417084.7050208@gmail.com> References: <1329555652.56753.YahooMailNeo@web171511.mail.ir2.yahoo.com> <1329685312.97780.YahooMailNeo@web171503.mail.ir2.yahoo.com> <4F417084.7050208@gmail.com> Message-ID: <4F41FA4E.3080805@free.fr> Le 19/02/2012 22:58, Raymond Toy a ?crit : > On 2/19/12 1:01 PM, Per Liss wrote: >> simplified with the solution applied. >> >> The reason I want to use j is that it is common practice among >> engineers, at least in electrical engineering, to use j instead of i as >> imaginary unit and it would be a good idea to keep that practice in all >> steps of the engineering processes instead of sometimes using i and >> sometimes using j. (BTW it seems that both Mathematica and Maple provide > As an EE, I never had problems switching between i and j, and none of my > college friends seem to have had problems either. Perhaps because > everyone was taking EE classes at the same time as math classes, so i > and j were always in use at the same time. The only time it was > confusing if someone wanted to use i or j as an summation index. (Which > I always felt was a bad idea because j looks very much like i which > looks like 1 at the small font sizes used for summation indices.) > > Besides, I don't hear much complaint from mathematicians that maxima > uses %i instead of just i. :-) > > Ray > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima I didn't like % (i j pi e) at the beginning as used wxmaxima but now I think it's a good idea because i often use the same letters as variable ! I even used e:%e p:%pi i:%i french epi but i forget about that... Thanks all for this good maxima tool :) From biomates at telefonica.net Mon Feb 20 02:53:32 2012 From: biomates at telefonica.net (Mario Rodriguez) Date: Mon, 20 Feb 2012 09:53:32 +0100 Subject: [Maxima] maxima.sourceforge.net? In-Reply-To: References: Message-ID: <1329728012.3210.5.camel@pc> El lun, 20-02-2012 a las 00:17 -0700, Robert Dodier escribi?: > On 2/19/12, Raymond Toy wrote: > > > Does anyone keep maxima.sourceforge.net up-to-date? The news feed is > > rather old with the latest news from Apr, 2011 and Maxima 5.24.0. > > Yes, maxima.sourceforge.net is still being maintained more or less. > I think Alexey Beshenov was the person who was most recently > in charge of that. If anyone wants to work on the web site, > I'll be happy to bestow sufficient privilege. > > best It's now updated. -- Mario From lapeyre.math122a at gmail.com Mon Feb 20 06:15:26 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Mon, 20 Feb 2012 13:15:26 +0100 Subject: [Maxima] bug in 'is' ? In-Reply-To: References: <4F3CFA5E.3000409@gmail.com> Message-ID: <4F42395E.60605@gmail.com> On 02/20/2012 08:38 AM, Robert Dodier wrote: > On 2/16/12, Stavros Macrakis wrote: > >> Since strings are not (currently) in the domain of the Maxima comparison >> operators, this should either give an error or return 'unknown'. I think I >> know what Robert's preference would be.... > string value. (At present, is("a" < "b") triggers an error, but that's > a separate problem; it should be true.) Just to keep the mailing list record straight, it triggers an untrapped lisp error (I filed a bug report). gcl even makes me think my RAM maybe got too hot ("memory may be damaged"). I wonder about the history of why languages differ on how they implement string comparison, and where maxima fits in. Mathematica does not transform "a" < "b", but the user can redefine this to do a string comparison. perl, although untyped, uses different symbols from numeric for all string comparisons. I guess that was a choice, perhaps for efficiency. A related issue is, Mma gives Length[] --> 0, maxima length() triggers a lisp error. You could argue that both Mma and maxima behavior are better than returning the string length because Part and part won't look inside a string. One could change length() to return the input form with no message. I imagine this would cause much confusion because many users would try it and be confused by the results. But, this stuff could be configurable, at different levels. The maxima function definition macro defmfun1 (in a version that I did not post yet) allows a runtime attribute to be set to choose whether argument checks trigger a maxima error or just print a message and return the form, like Mathematica. (%i2) nest(f,x,3); (%o2) f(f(f(x))) (%i3) nest(8,x,3); nest: Argument '8' is not a function in nest(8,x,3). (%i4) set_match_form(nest); /* maybe not a good name*/ (%o4) true (%i5) nest(8,x,3); nest: Argument '8' is not a function in nest(8,x,3). (%o5) nest(8,x,3) By the way, many Mathematica users who write largish programs find debugging and controlling the number of messages difficult. P.S. The untrapped lisp error for length("dog") is better than the trapped error for length(1). (%i1) length("dog"); Maxima encountered a Lisp error: The value "dog" is not of type LIST. (%i1) length(1) length: argument cannot be a number; found 1 /* what argument would be valid ? */ -- an error. To debug this try: debugmode(true); /* The user has seen this 10^6 times, and decides not to take another crash course in lisp syntax and printing a stack trace */ The reason the first kind of message is better is because it came from a generic error trapping mechanism where some thought or review of the message is possible. The second message is ad-hoc, written into the body of length(). P.P.S. But, apparently '-1' is not a number if inflag is false; (%i1) length(-1); (%o1) 1 -- John Lapeyre From hbaker1 at pipeline.com Mon Feb 20 09:40:51 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Mon, 20 Feb 2012 07:40:51 -0800 Subject: [Maxima] diff -- second argument In-Reply-To: References: Message-ID: You should probably wrap a "factor" around this, to try to get rid of as many del()'s as possible. E.g., (%i1) diff(x^2*y^2)/diff(x*y); 2 2 2 x y del(y) + 2 x y del(x) (%o1) ----------------------------- x del(y) + y del(x) (%i2) %,factor; (%o2) 2 x y At 11:31 PM 2/19/2012, Robert Dodier wrote: >On 2/16/12, Stavros Macrakis wrote: > >> Actually, a little reflection makes it clear that diff(f(x),g(x)) should >> not be an error or a noun form, because in fact it is perfectly >> well-defined and meaningful: >> >> diff(A,B) == ev(diff(A)/diff(B),del) > >Looks OK to me. OK by me to merge this in. > >best > >Robert Dodier From macrakis at alum.mit.edu Mon Feb 20 10:31:03 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 20 Feb 2012 11:31:03 -0500 Subject: [Maxima] diff -- second argument In-Reply-To: References: Message-ID: Yes, there are lots of ways to simplify these expressions. In this case, rat suffices (don't even need factor) -- the del's drop out. But there are messier cases: (%i1) diff(x*y)/diff(x/y); (%o1) (x*del(y)+y*del(x))/(del(x)/y-x*del(y)/y^2) (%i2) factor(%); (%o2) -y^2*(x*del(y)+y*del(x))/(x*del(y)-y*del(x)) <<< no better Ratsubst to the rescue: (%i3) ratsubst('diff(y,x),del(x)/del(y),%o1); (%o3) (y^3*'diff(y,x,1)+x*y^2)/(y*'diff(y,x,1)-x) (%i4) solve(%o3=z,'diff(y,x)); (%o4) ['diff(y,x,1) = (x*z+x*y^2)/(y*z-y^3)] << another way of looking at it -s On Mon, Feb 20, 2012 at 10:40, Henry Baker wrote: > You should probably wrap a "factor" around this, to try to get rid of as > many del()'s as possible. > > E.g., > > (%i1) diff(x^2*y^2)/diff(x*y); > 2 2 > 2 x y del(y) + 2 x y del(x) > (%o1) ----------------------------- > x del(y) + y del(x) > (%i2) %,factor; > (%o2) 2 x y > > At 11:31 PM 2/19/2012, Robert Dodier wrote: > >On 2/16/12, Stavros Macrakis wrote: > > > >> Actually, a little reflection makes it clear that diff(f(x),g(x)) should > >> not be an error or a noun form, because in fact it is perfectly > >> well-defined and meaningful: > >> > >> diff(A,B) == ev(diff(A)/diff(B),del) > > > >Looks OK to me. OK by me to merge this in. > > > >best > > > >Robert Dodier > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Feb 20 10:58:00 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 20 Feb 2012 11:58:00 -0500 Subject: [Maxima] bug in 'is' ? In-Reply-To: <4F42395E.60605@gmail.com> References: <4F3CFA5E.3000409@gmail.com> <4F42395E.60605@gmail.com> Message-ID: Using the same operator for string and number comparison naturally poses the question of mixed types. Some possibilities: (1) All numbers are smaller than all strings (or vice versa) -- I think this is what orderlessp does (2) Convert numbers to strings, then compare. Some systems do this for *all* mixed operations, so that 3+"5foo" => "35foo" (concatenation) Problem: 3 < 20 and 20 < "3", but "3" == 3; also "3e3" < "4e2", but 3e3 > 4e2 (3) Convert strings to numbers, then compare. Some systems do this for *all* mixed operations, so that 3+"5foo" => 8 Problem: what do you do with "foo"? with "3foo"? with "foo3"? with "4/4/2010"? (4) Undefined/Error Since Maxima can manipulate symbolic inequalities, it's especially important that the system be consistent. I think the only consistent possibilities are (1) and (4). I would say: if you want orderlessp behavior, use orderlessp. -s On Mon, Feb 20, 2012 at 07:15, John Lapeyre wrote: > > On 02/20/2012 08:38 AM, Robert Dodier wrote: > > On 2/16/12, Stavros Macrakis wrote: > > > >> Since strings are not (currently) in the domain of the Maxima comparison > >> operators, this should either give an error or return 'unknown'. I > think I > >> know what Robert's preference would be.... > > > string value. (At present, is("a" < "b") triggers an error, but that's > > a separate problem; it should be true.) > > Just to keep the mailing list record straight, it triggers > an untrapped lisp error (I filed a bug report). gcl even makes me > think my RAM maybe got too hot ("memory may be damaged"). > > I wonder about the history of why languages differ on how > they implement string comparison, and where maxima fits in. > Mathematica does not transform "a" < "b", but the user can > redefine this to do a string comparison. perl, although > untyped, uses different symbols from numeric for all string > comparisons. I guess that was a choice, perhaps for efficiency. > > A related issue is, Mma gives Length[] --> 0, maxima > length() triggers a lisp error. You could argue > that both Mma and maxima behavior are better than returning > the string length because Part and part won't look inside a > string. One could change length() to return the > input form with no message. I imagine this would cause much > confusion because many users would try it and be confused by > the results. > > But, this stuff could be configurable, at different > levels. The maxima function definition macro defmfun1 (in a > version that I did not post yet) allows a runtime attribute > to be set to choose whether argument checks trigger a maxima > error or just print a message and return the form, like > Mathematica. > > (%i2) nest(f,x,3); > (%o2) f(f(f(x))) > (%i3) nest(8,x,3); > > nest: Argument '8' is not a function in nest(8,x,3). > > (%i4) set_match_form(nest); /* maybe not a good name*/ > (%o4) true > (%i5) nest(8,x,3); > nest: Argument '8' is not a function in nest(8,x,3). > (%o5) nest(8,x,3) > > By the way, many Mathematica users who write largish > programs find debugging and controlling the number of > messages difficult. > > P.S. The untrapped lisp error for length("dog") is better > than the trapped error for length(1). > > (%i1) length("dog"); > Maxima encountered a Lisp error: > The value "dog" is not of type LIST. > > (%i1) length(1) > length: argument cannot be a number; found 1 /* what argument would be > valid ? */ > -- an error. To debug this try: debugmode(true); > /* The user has seen this 10^6 times, and decides not to take another > crash > course in lisp syntax and printing a stack trace */ > > The reason the first kind of message is better is because it came from a > generic > error trapping mechanism where some thought or review of the message is > possible. The second message is ad-hoc, written into the body of length(). > > P.P.S. But, apparently '-1' is not a number if inflag is false; > (%i1) length(-1); > (%o1) 1 > > > -- John Lapeyre > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Mon Feb 20 11:51:50 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 20 Feb 2012 10:51:50 -0700 Subject: [Maxima] bug in 'is' ? In-Reply-To: References: <4F3CFA5E.3000409@gmail.com> <4F42395E.60605@gmail.com> Message-ID: Well, I'm inclined to say that numbers and strings are incomparable under "<", so is(1 < "a") should be an error (4 below). The convenience of (2) or (3) is greatly outweighed by the confusion they'll cause. (I know you are not advocating these, Stavros.) Not sure about (1). It's not too bad, although the choice of strings before numbers or numbers before strings is arbitrary and therefore makes it a little more difficult to understand. I guess I don't see a reason that all kinds of object in Maxima should be comparable under "<". So we need not try too hard to make strings and numbers comparable. best Robert Dodier On 2/20/12, Stavros Macrakis wrote: > Using the same operator for string and number comparison naturally poses > the question of mixed types. Some possibilities: > > (1) All numbers are smaller than all strings (or vice versa) -- I think > this is what orderlessp does > (2) Convert numbers to strings, then compare. > Some systems do this for *all* mixed operations, so that 3+"5foo" => > "35foo" (concatenation) > Problem: 3 < 20 and 20 < "3", but "3" == 3; also "3e3" < "4e2", but > 3e3 > 4e2 > (3) Convert strings to numbers, then compare. > Some systems do this for *all* mixed operations, so that 3+"5foo" => 8 > Problem: what do you do with "foo"? with "3foo"? with "foo3"? with > "4/4/2010"? > (4) Undefined/Error > > Since Maxima can manipulate symbolic inequalities, it's especially > important that the system be consistent. I think the only consistent > possibilities are (1) and (4). I would say: if you want orderlessp > behavior, use orderlessp. > > -s From macrakis at alum.mit.edu Mon Feb 20 13:20:04 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 20 Feb 2012 14:20:04 -0500 Subject: [Maxima] Simplifying atan expressions Message-ID: Consider the expression 4*atan(1/5)-atan(1/239) (Machin's formula). How can we use Maxima to simplify it to %pi/4? Well, here's one approach: atan(trigexpand(trigexpand(tan(ex)))) And here's another way that doesn't depend on trig identities: (%i1) ex:4*atan(1/5)-atan(1/239); (%o1) 4*atan(1/5)-atan(1/239) (%i2) llex: logcontract(logarc(ex)); (%o2) %i*log(-(%i-5)^4*(%i+239)/((%i-239)*(%i+5)^4))/2 (%i3) rectform(llex); (%o3) (atan(sin(4*atan(1/5))/cos(4*atan(1/5)))-atan(sin(4*(%pi-atan(1/5)))/cos(4*(%pi-atan(1/5))))-2*atan(1/239))/2 <<< oops, not so helpful (%i4) scanmap(rectform,llex,bottomup); <<< but reorganizing the rectform calculation gives a better result <<< makes me think that rectform could be improved... (%o4) %pi/4 Are any of these techniques packaged into some analog of trigsimp? -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Feb 20 13:35:47 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 20 Feb 2012 14:35:47 -0500 Subject: [Maxima] bug in 'is' ? In-Reply-To: References: <4F3CFA5E.3000409@gmail.com> <4F42395E.60605@gmail.com> Message-ID: I agree. Though I was sort of hoping someone would come up with a solution which would know that "Louis VIII" < "Louis IX", "4/7"< "4/5", and "4/4/2000" < "3/3/2001" :-) -s On Mon, Feb 20, 2012 at 12:51, Robert Dodier wrote: > Well, I'm inclined to say that numbers and strings are incomparable > under "<", so is(1 < "a") should be an error (4 below). > > The convenience of (2) or (3) is greatly outweighed by the confusion > they'll cause. (I know you are not advocating these, Stavros.) > > Not sure about (1). It's not too bad, although the choice of strings > before numbers or numbers before strings is arbitrary and therefore > makes it a little more difficult to understand. > > I guess I don't see a reason that all kinds of object in Maxima > should be comparable under "<". So we need not try too hard > to make strings and numbers comparable. > > best > > Robert Dodier > > > On 2/20/12, Stavros Macrakis wrote: > > > Using the same operator for string and number comparison naturally poses > > the question of mixed types. Some possibilities: > > > > (1) All numbers are smaller than all strings (or vice versa) -- I think > > this is what orderlessp does > > (2) Convert numbers to strings, then compare. > > Some systems do this for *all* mixed operations, so that 3+"5foo" => > > "35foo" (concatenation) > > Problem: 3 < 20 and 20 < "3", but "3" == 3; also "3e3" < "4e2", but > > 3e3 > 4e2 > > (3) Convert strings to numbers, then compare. > > Some systems do this for *all* mixed operations, so that 3+"5foo" => > 8 > > Problem: what do you do with "foo"? with "3foo"? with "foo3"? with > > "4/4/2010"? > > (4) Undefined/Error > > > > Since Maxima can manipulate symbolic inequalities, it's especially > > important that the system be consistent. I think the only consistent > > possibilities are (1) and (4). I would say: if you want orderlessp > > behavior, use orderlessp. > > > > -s > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nijso at hotmail.com Mon Feb 20 13:44:57 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Mon, 20 Feb 2012 20:44:57 +0100 Subject: [Maxima] rat and bothcoef error Message-ID: Dear all, I am playing with a routine that checks if an input function is linear or not. In the bothcoef example in the manual, rat is used inside bothcoef like this: c: bothcoef (rat (expr, x), x), with some expressions, this gives me an error (bothcoef: invalid arguments) due to the use of 'rat', for example here: (%i01) expr : -(x)/(x*x+y); (%o01) -x/(x*x+y) (%i02) c: rat(expr,x); (%o02) -x/(x*x+y) (%i03) bothcoef(c,x); bothcoef: invalid arguments. -- an error. To debug this try: debugmode(true); (%i04) bothcoef(expr,x); (%o04) [-1/(y+x^2),0] rat(expr) is the same(?) here as expr but bothcoef(expr,x) gives me an answer whereas bothcoef(rat(expr,x),x) does not. Is this a bug or intended behavior? Kind regards, Nijso -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Feb 20 14:17:39 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 20 Feb 2012 15:17:39 -0500 Subject: [Maxima] bug in 'is' ? In-Reply-To: <4F42395E.60605@gmail.com> References: <4F3CFA5E.3000409@gmail.com> <4F42395E.60605@gmail.com> Message-ID: On Mon, Feb 20, 2012 at 07:15, John Lapeyre wrote: ... > A related issue is, Mma gives Length[] --> 0, > maxima length() triggers a lisp error. You could argue > that both Mma and maxima behavior are better than returning the string > length because Part and part won't look inside a > string. One could change length() to return the input form with no > message. I imagine this would cause much > confusion because many users would try it and be confused by the results. > length calculates the length of a list (including argument list). Thus length(f(a,b)) => 2, length(a+b) == length("+"(a,b)) => 2 and length(f()) =>0. Though logicians often treat constants as zero-argument functions, that is not the Maxima convention: args(f) is an error, and so length(f) should remain an error. As for length(-1), yes, I suppose that is somewhat confusing, but Maxima works hard (see the code in mpart, $length, nformat, etc.) to make -1 act like "-"(1) (after all, op(-1) => "-"), so length(-1) should indeed be 1, while length(1) should remain an error. So block([inflag:true],length(-1)) correctly gives an error, because it is operating on the internal form, which is the atomic -1, not the expression "-"(1). > But, this stuff could be configurable, at different levels. Configurability of things like this complicates the system and makes it harder to write libraries. Functions (sensibly) assume that the value of length(...) is a non-negative integer and are likely to do strange things if it is not. I don't really see how a return value like "for i thru length(3) do ..." could be useful to a user. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From hbaker1 at pipeline.com Mon Feb 20 14:45:34 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Mon, 20 Feb 2012 12:45:34 -0800 Subject: [Maxima] Simplifying atan expressions In-Reply-To: References: Message-ID: result=4*atan(1/5)-atan(1/239); 1 1 (%o1) result = 4 atan(-) - atan(---) 5 239 (%i2) lhs(%)=logcontract(logarc(rhs(%))); 4 (%i - 5) (%i + 239) %i log(- --------------------) 4 (%i - 239) (%i + 5) (%o2) result = ------------------------------ 2 (%i3) %*2/%i; 4 (%i - 5) (%i + 239) (%o3) - 2 %i result = log(- --------------------) 4 (%i - 239) (%i + 5) (%i4) exp(lhs(%))=exp(rhs(%)); 4 - 2 %i result (%i - 5) (%i + 239) (%o4) %e = - -------------------- 4 (%i - 239) (%i + 5) (%i5) lhs(%)=rectform(rhs(%)); - 2 %i result (%o5) %e = - %i (%i6) log(lhs(%))=log(rhs(%)); (%o6) - 2 %i result = log(- %i) (%i7) rectform(lhs(%))=rectform(rhs(%)); %i %pi (%o7) - 2 %i result = - ------ 2 (%i8) solve(%,result); %pi (%o8) [result = ---] 4 This example shows why rectform, log, exp, logcontract, logarc, etc., should distribute over "=". At 11:20 AM 2/20/2012, Stavros Macrakis wrote: >Consider the expression 4*atan(1/5)-atan(1/239) (Machin's formula). > >How can we use Maxima to simplify it to %pi/4? > >Well, here's one approach: > >atan(trigexpand(trigexpand(tan(ex)))) > >And here's another way that doesn't depend on trig identities: > >(%i1) ex:4*atan(1/5)-atan(1/239); >(%o1) 4*atan(1/5)-atan(1/239) >(%i2) llex: logcontract(logarc(ex)); >(%o2) %i*log(-(%i-5)^4*(%i+239)/((%i-239)*(%i+5)^4))/2 >(%i3) rectform(llex); >(%o3) (atan(sin(4*atan(1/5))/cos(4*atan(1/5)))-atan(sin(4*(%pi-atan(1/5)))/cos(4*(%pi-atan(1/5))))-2*atan(1/239))/2 > <<< oops, not so helpful >(%i4) scanmap(rectform,llex,bottomup); > <<< but reorganizing the rectform calculation gives a better result > <<< makes me think that rectform could be improved... >(%o4) %pi/4 > >Are any of these techniques packaged into some analog of trigsimp? > > -s From macrakis at alum.mit.edu Mon Feb 20 15:12:33 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 20 Feb 2012 16:12:33 -0500 Subject: [Maxima] Simplifying atan expressions In-Reply-To: References: Message-ID: Henry, Yes, this derivation is essentially the same as the bottomup rectform. In fact: expr: logcontract(logarc(4*atan(1/5)-atan(1/239))); rectform(substpart(e1:rectform(piece),expr,1,2,1)) => %pi/4 You'll see that e1 here is -%i. What rectform does internally by default looks more like rectform(substpart(e2:polarform(piece),expr,1,2,1)); where e2 isn't at all helpful. I agree that most mathematical functions (sin, etc.) and form-changing routines (factor etc.) should distribute over "=". -s On Mon, Feb 20, 2012 at 15:45, Henry Baker wrote: > result=4*atan(1/5)-atan(1/239); > 1 1 > (%o1) result = 4 atan(-) - atan(---) > 5 239 > (%i2) lhs(%)=logcontract(logarc(rhs(%))); > 4 > (%i - 5) (%i + 239) > %i log(- --------------------) > 4 > (%i - 239) (%i + 5) > (%o2) result = ------------------------------ > 2 > (%i3) %*2/%i; > 4 > (%i - 5) (%i + 239) > (%o3) - 2 %i result = log(- --------------------) > 4 > (%i - 239) (%i + 5) > (%i4) exp(lhs(%))=exp(rhs(%)); > 4 > - 2 %i result (%i - 5) (%i + 239) > (%o4) %e = - -------------------- > 4 > (%i - 239) (%i + 5) > (%i5) lhs(%)=rectform(rhs(%)); > - 2 %i result > (%o5) %e = - %i > (%i6) log(lhs(%))=log(rhs(%)); > (%o6) - 2 %i result = log(- %i) > (%i7) rectform(lhs(%))=rectform(rhs(%)); > %i %pi > (%o7) - 2 %i result = - ------ > 2 > (%i8) solve(%,result); > %pi > (%o8) [result = ---] > 4 > > This example shows why rectform, log, exp, logcontract, logarc, etc., > should distribute over "=". > > At 11:20 AM 2/20/2012, Stavros Macrakis wrote: > >Consider the expression 4*atan(1/5)-atan(1/239) (Machin's formula). > > > >How can we use Maxima to simplify it to %pi/4? > > > >Well, here's one approach: > > > >atan(trigexpand(trigexpand(tan(ex)))) > > > >And here's another way that doesn't depend on trig identities: > > > >(%i1) ex:4*atan(1/5)-atan(1/239); > >(%o1) 4*atan(1/5)-atan(1/239) > >(%i2) llex: logcontract(logarc(ex)); > >(%o2) %i*log(-(%i-5)^4*(%i+239)/((%i-239)*(%i+5)^4))/2 > >(%i3) rectform(llex); > >(%o3) > (atan(sin(4*atan(1/5))/cos(4*atan(1/5)))-atan(sin(4*(%pi-atan(1/5)))/cos(4*(%pi-atan(1/5))))-2*atan(1/239))/2 > > <<< oops, not so helpful > >(%i4) scanmap(rectform,llex,bottomup); > > <<< but reorganizing the rectform calculation gives a better > result > > <<< makes me think that rectform could be improved... > >(%o4) %pi/4 > > > >Are any of these techniques packaged into some analog of trigsimp? > > > > -s > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lapeyre.math122a at gmail.com Mon Feb 20 15:17:26 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Mon, 20 Feb 2012 22:17:26 +0100 Subject: [Maxima] bug in 'is' ? In-Reply-To: References: <4F3CFA5E.3000409@gmail.com> <4F42395E.60605@gmail.com> Message-ID: <4F42B866.6090402@gmail.com> > As for length(-1), yes, I suppose that is somewhat confusing, but Maxima works hard (see the code in > mpart, $length, nformat, etc.) to make -1 act like "-"(1) (after all, op(-1) => "-"), so length(-1) > > Configurability of things like this complicates the system and makes it harder to write libraries. I didn't mean to suggest changing length or making it configurable (I was mostly thinking of new functions). I realize that length, op, subst, etc. rely on this behavior. Whether, op(-1) => "-" is a good idea is to some extent moot since it can't be changed now. From fateman at eecs.berkeley.edu Mon Feb 20 16:25:22 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 20 Feb 2012 14:25:22 -0800 Subject: [Maxima] rat and bothcoef error In-Reply-To: References: Message-ID: <4F42C852.2060803@eecs.berkeley.edu> On 2/20/2012 11:44 AM, nijso beishuizen wrote: > Dear all, > > Iam playing with a routine that checks if an input function is linear > or not. In the bothcoef example in the manual, rat is used inside > bothcoef like this: > c: bothcoef (rat (expr, x), x), > > with some expressions, this gives me an error (bothcoef: invalid arguments) due to the use of 'rat', > for example here: > > (%i01) expr : -(x)/(x*x+y); > bothcoef works if expr is a polynomial in x. In this case, bothcoef is called on a rational expression in x. If you want to make expr into a polynomial, you can use taylor series and get -x/y + x^3/y^2 -x^5/y^3 + .... which is unlikely to be what you want. ratcoef and coef have different results. Not clear what you really want to produce. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From hbaker1 at pipeline.com Mon Feb 20 22:38:48 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Mon, 20 Feb 2012 20:38:48 -0800 Subject: [Maxima] Simplifying atan expressions In-Reply-To: References: Message-ID: How come log(-%i) doesn't already simplify by itself, instead of requiring rectform to do it? Is there some switch that Maxima uses to force log(constant) to simplify if it can? At 01:12 PM 2/20/2012, Stavros Macrakis wrote: >Henry, > >Yes, this derivation is essentially the same as the bottomup rectform. In fact: > > expr: logcontract(logarc(4*atan(1/5)-atan(1/239))); > rectform(substpart(e1:rectform(piece),expr,1,2,1)) => %pi/4 > >You'll see that e1 here is -%i. > >What rectform does internally by default looks more like > > rectform(substpart(e2:polarform(piece),expr,1,2,1)); > >where e2 isn't at all helpful. > >I agree that most mathematical functions (sin, etc.) and form-changing routines (factor etc.) should distribute over "=". > > -s > >On Mon, Feb 20, 2012 at 15:45, Henry Baker wrote: >result=4*atan(1/5)-atan(1/239); > 1 1 >(%o1) result = 4 atan(-) - atan(---) > 5 239 >(%i2) lhs(%)=logcontract(logarc(rhs(%))); > 4 > (%i - 5) (%i + 239) > %i log(- --------------------) > 4 > (%i - 239) (%i + 5) >(%o2) result = ------------------------------ > 2 >(%i3) %*2/%i; > 4 > (%i - 5) (%i + 239) >(%o3) - 2 %i result = log(- --------------------) > 4 > (%i - 239) (%i + 5) >(%i4) exp(lhs(%))=exp(rhs(%)); > 4 > - 2 %i result (%i - 5) (%i + 239) >(%o4) %e = - -------------------- > 4 > (%i - 239) (%i + 5) >(%i5) lhs(%)=rectform(rhs(%)); > - 2 %i result >(%o5) %e = - %i >(%i6) log(lhs(%))=log(rhs(%)); >(%o6) - 2 %i result = log(- %i) >(%i7) rectform(lhs(%))=rectform(rhs(%)); > %i %pi >(%o7) - 2 %i result = - ------ > 2 >(%i8) solve(%,result); > %pi >(%o8) [result = ---] > 4 > >This example shows why rectform, log, exp, logcontract, logarc, etc., should distribute over "=". > >At 11:20 AM 2/20/2012, Stavros Macrakis wrote: >>Consider the expression 4*atan(1/5)-atan(1/239) (Machin's formula). >> >>How can we use Maxima to simplify it to %pi/4? >> >>Well, here's one approach: >> >>atan(trigexpand(trigexpand(tan(ex)))) >> >>And here's another way that doesn't depend on trig identities: >> >>(%i1) ex:4*atan(1/5)-atan(1/239); >>(%o1) 4*atan(1/5)-atan(1/239) >>(%i2) llex: logcontract(logarc(ex)); >>(%o2) %i*log(-(%i-5)^4*(%i+239)/((%i-239)*(%i+5)^4))/2 >>(%i3) rectform(llex); >>(%o3) (atan(sin(4*atan(1/5))/cos(4*atan(1/5)))-atan(sin(4*(%pi-atan(1/5)))/cos(4*(%pi-atan(1/5))))-2*atan(1/239))/2 >> <<< oops, not so helpful >>(%i4) scanmap(rectform,llex,bottomup); >> <<< but reorganizing the rectform calculation gives a better result >> <<< makes me think that rectform could be improved... >>(%o4) %pi/4 >> >>Are any of these techniques packaged into some analog of trigsimp? >> >> -s From nijso at hotmail.com Tue Feb 21 03:02:09 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Tue, 21 Feb 2012 10:02:09 +0100 Subject: [Maxima] rat and bothcoef error In-Reply-To: <4F42C852.2060803@eecs.berkeley.edu> References: , <4F42C852.2060803@eecs.berkeley.edu> Message-ID: Hello Richard and others, The bothcoef description doesn't say that expr needs to be in polynomial form. Bothcoef calls ratcoef or coeff if I understand the manual correctly? So there is the need for expr to be in polynomial form because it calls the other routines. I need something like the example in bothcoef, a routine that checks if expr is a linear function of the form a*x+b (I don't actually need to know a and b). The problem is that the expression can contain anything except differential operators (so also sin(x), 1/x, integrals and unknown functions like f(x)). I have browsed the manual and maybe a better method would be to use the example from defmatch then: (%i1) matchdeclare (a, lambda ([e], e#0 and freeof(x, e)), b, freeof(x)); (%o1) done (%i2) defmatch (linearp, a*x + b, x); This seems to do work... Well at least I understand now why bothcoef is not supposed to work on general expressions. Thanks! Kind regards, Nijso -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Tue Feb 21 08:47:34 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 21 Feb 2012 06:47:34 -0800 Subject: [Maxima] rat and bothcoef error In-Reply-To: References: , <4F42C852.2060803@eecs.berkeley.edu> Message-ID: <4F43AE86.40808@eecs.berkeley.edu> On 2/21/2012 1:02 AM, nijso beishuizen wrote: > Hello Richard and others, > > The bothcoef description doesn't say that expr needs to be in > polynomial form. True. Perhaps it should. The point is, the command is probably meaningless unless expr is explicitly or implicitly a polynomial. > Bothcoef calls ratcoef or coeff if I understand the manual correctly? > So there is the need for expr to be in polynomial form because it > calls the other routines. that's right, but those are probably meaningless in the same circumstances. > > I need something like the example in bothcoef, a routine that checks > if expr is a linear function of the form a*x+b (I don't actually need > to know a and b). There are many ways of detecting linearity. f(x) is linear in x if its second derivative is zero, for example. > The problem is that the expression can contain anything except > differential operators (so also sin(x), 1/x, integrals and unknown > functions like f(x)). in which case bothcoef is hardly appropriate. What is the coefficient of x in sin(x) ? > > I have browsed the manual and maybe a better method would be to use > the example from defmatch then: > (%i1) matchdeclare (a, lambda ([e], e#0 and freeof(x, e)), b, freeof(x)); > (%o1) done > (%i2) defmatch (linearp, a*x + b, x); This will generally work only in the same circumstances, since defmatch generates calls to ratcoef. Another way of finding a and b in a*x+b is to find b: subst(0,x,expr). then to find a, subst(1,x,expr)-b. Then you can test if a*x+b = expr. There are probably another few plausible tricks. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From yasuaki.honda at gmail.com Tue Feb 21 09:10:52 2012 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Wed, 22 Feb 2012 00:10:52 +0900 Subject: [Maxima] zeta(%i-1),numer; causes an error In-Reply-To: <4F4159C9.9060902@gmail.com> References: <4F4159C9.9060902@gmail.com> Message-ID: Hi Raymond, Robert, Thanks for the patch and the updating of the git!! I "git pull" the source code from sourceforge server. The bug was indeed fixed. Thanks you!! Yasuaki Honda 2012?2?20?5:21 Raymond Toy : > On 2/19/12 11:11 AM, Raymond Toy wrote: > > On 2/19/12 9:09 AM, Robert Dodier wrote: > >> On 2/19/12, ???? wrote: > >> > >>> (%i1) zeta(%i-1),numer; > >>> BIGFLOAT: unable to convert #C(2.0 -1.0) to a CL or BIGFLOAT number. > >> Looks like BIGFLOAT:TO is called w/ a Lisp complex as its > >> argument, and it doesn't know what to do with that. > >> I suppose it should just return it unmodified. > >> I've attached a patch to do that; comments, anyone? > >> This seems to fix the bug reported. > > Thanks for looking into this. I think your patch is correct, but I'd > > just use cl:numberp instead. I think we want bigfloat:to to return any > > CL number as is. > > > > > Git repo updated. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Feb 21 10:30:21 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 21 Feb 2012 11:30:21 -0500 Subject: [Maxima] Simplifying atan expressions In-Reply-To: References: Message-ID: Good question. For that matter, log(-1) only simplifies to %i*%pi if lognegint = true (default is false). Here are the possible arguments I can think of for this behavior (I don't guarantee that they correspond to the original rationale...): 1) log is multivalued, and the user may want to control whether log(-1) => %pi or -%pi etc. 2) Maxima assumes the user is working in the real domain, so shouldn't introduce %i unless explicitly asked to. But domain:complex doesn't change the behavior. 3) log(-1) may appear as an intermediate result of a real calculation which goes away with simplification, e.g. logcontract(log(-1)+log(-x)), so why confuse matters? 4) Once you have an expression like log(x)+%i*%pi, converting back to log(-x) is slightly tricky -- actually, simply log(exp(EXPR)) will do it, but there is no easy way to apply that globally, like logcontract. I suspect that 3 and 4 are the most important. So perhaps the default is OK, but log(-C) and log(%i*C) should expand out when domain=complex or logexpand=ultra. Conversely, perhaps there should be a logconmode=all which contracts things like log(x)+C so that arguments 3 and 4 go away.... Thoughts? -s On Mon, Feb 20, 2012 at 23:38, Henry Baker wrote: > How come log(-%i) doesn't already simplify by itself, instead of requiring > rectform to do it? > > Is there some switch that Maxima uses to force log(constant) to simplify > if it can? > > At 01:12 PM 2/20/2012, Stavros Macrakis wrote: > >Henry, > > > >Yes, this derivation is essentially the same as the bottomup rectform. > In fact: > > > > expr: logcontract(logarc(4*atan(1/5)-atan(1/239))); > > rectform(substpart(e1:rectform(piece),expr,1,2,1)) => %pi/4 > > > >You'll see that e1 here is -%i. > > > >What rectform does internally by default looks more like > > > > rectform(substpart(e2:polarform(piece),expr,1,2,1)); > > > >where e2 isn't at all helpful. > > > >I agree that most mathematical functions (sin, etc.) and form-changing > routines (factor etc.) should distribute over "=". > > > > -s > > > >On Mon, Feb 20, 2012 at 15:45, Henry Baker wrote: > >result=4*atan(1/5)-atan(1/239); > > 1 1 > >(%o1) result = 4 atan(-) - atan(---) > > 5 239 > >(%i2) lhs(%)=logcontract(logarc(rhs(%))); > > 4 > > (%i - 5) (%i + 239) > > %i log(- --------------------) > > 4 > > (%i - 239) (%i + 5) > >(%o2) result = ------------------------------ > > 2 > >(%i3) %*2/%i; > > 4 > > (%i - 5) (%i + 239) > >(%o3) - 2 %i result = log(- --------------------) > > 4 > > (%i - 239) (%i + 5) > >(%i4) exp(lhs(%))=exp(rhs(%)); > > 4 > > - 2 %i result (%i - 5) (%i + 239) > >(%o4) %e = - -------------------- > > 4 > > (%i - 239) (%i + 5) > >(%i5) lhs(%)=rectform(rhs(%)); > > - 2 %i result > >(%o5) %e = - %i > >(%i6) log(lhs(%))=log(rhs(%)); > >(%o6) - 2 %i result = log(- %i) > >(%i7) rectform(lhs(%))=rectform(rhs(%)); > > %i %pi > >(%o7) - 2 %i result = - ------ > > 2 > >(%i8) solve(%,result); > > %pi > >(%o8) [result = ---] > > 4 > > > >This example shows why rectform, log, exp, logcontract, logarc, etc., > should distribute over "=". > > > >At 11:20 AM 2/20/2012, Stavros Macrakis wrote: > >>Consider the expression 4*atan(1/5)-atan(1/239) (Machin's formula). > >> > >>How can we use Maxima to simplify it to %pi/4? > >> > >>Well, here's one approach: > >> > >>atan(trigexpand(trigexpand(tan(ex)))) > >> > >>And here's another way that doesn't depend on trig identities: > >> > >>(%i1) ex:4*atan(1/5)-atan(1/239); > >>(%o1) 4*atan(1/5)-atan(1/239) > >>(%i2) llex: logcontract(logarc(ex)); > >>(%o2) %i*log(-(%i-5)^4*(%i+239)/((%i-239)*(%i+5)^4))/2 > >>(%i3) rectform(llex); > >>(%o3) > (atan(sin(4*atan(1/5))/cos(4*atan(1/5)))-atan(sin(4*(%pi-atan(1/5)))/cos(4*(%pi-atan(1/5))))-2*atan(1/239))/2 > >> <<< oops, not so helpful > >>(%i4) scanmap(rectform,llex,bottomup); > >> <<< but reorganizing the rectform calculation gives a better > result > >> <<< makes me think that rectform could be improved... > >>(%o4) %pi/4 > >> > >>Are any of these techniques packaged into some analog of trigsimp? > >> > >> -s > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hbaker1 at pipeline.com Tue Feb 21 10:43:49 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Tue, 21 Feb 2012 08:43:49 -0800 Subject: [Maxima] Simplifying atan expressions In-Reply-To: References: Message-ID: But I asked about log(-%i), which should be pretty non-controversial. If there is a switch for log, it should indicate what your favorite branch is: e.g., [-%pi,+%pi), [0,2*%pi), etc. At 08:30 AM 2/21/2012, Stavros Macrakis wrote: >Good question. For that matter, log(-1) only simplifies to %i*%pi if lognegint = true (default is false). > >Here are the possible arguments I can think of for this behavior (I don't guarantee that they correspond to the original rationale...): > >1) log is multivalued, and the user may want to control whether log(-1) => %pi or -%pi etc. >2) Maxima assumes the user is working in the real domain, so shouldn't introduce %i unless explicitly asked to. But domain:complex doesn't change the behavior. >3) log(-1) may appear as an intermediate result of a real calculation which goes away with simplification, e.g. logcontract(log(-1)+log(-x)), so why confuse matters? >4) Once you have an expression like log(x)+%i*%pi, converting back to log(-x) is slightly tricky -- actually, simply log(exp(EXPR)) will do it, but there is no easy way to apply that globally, like logcontract. > >I suspect that 3 and 4 are the most important. > >So perhaps the default is OK, but log(-C) and log(%i*C) should expand out when domain=complex or logexpand=ultra. Conversely, perhaps there should be a logconmode=all which contracts things like log(x)+C so that arguments 3 and 4 go away.... > >Thoughts? > > -s > >On Mon, Feb 20, 2012 at 23:38, Henry Baker wrote: >How come log(-%i) doesn't already simplify by itself, instead of requiring rectform to do it? > >Is there some switch that Maxima uses to force log(constant) to simplify if it can? > >At 01:12 PM 2/20/2012, Stavros Macrakis wrote: >>Henry, >> >>Yes, this derivation is essentially the same as the bottomup rectform. In fact: >> >> expr: logcontract(logarc(4*atan(1/5)-atan(1/239))); >> rectform(substpart(e1:rectform(piece),expr,1,2,1)) => %pi/4 >> >>You'll see that e1 here is -%i. >> >>What rectform does internally by default looks more like >> >> rectform(substpart(e2:polarform(piece),expr,1,2,1)); >> >>where e2 isn't at all helpful. >> >>I agree that most mathematical functions (sin, etc.) and form-changing routines (factor etc.) should distribute over "=". >> >> -s >> >>On Mon, Feb 20, 2012 at 15:45, Henry Baker wrote: >>result=4*atan(1/5)-atan(1/239); >> 1 1 >>(%o1) result = 4 atan(-) - atan(---) >> 5 239 >>(%i2) lhs(%)=logcontract(logarc(rhs(%))); >> 4 >> (%i - 5) (%i + 239) >> %i log(- --------------------) >> 4 >> (%i - 239) (%i + 5) >>(%o2) result = ------------------------------ >> 2 >>(%i3) %*2/%i; >> 4 >> (%i - 5) (%i + 239) >>(%o3) - 2 %i result = log(- --------------------) >> 4 >> (%i - 239) (%i + 5) >>(%i4) exp(lhs(%))=exp(rhs(%)); >> 4 >> - 2 %i result (%i - 5) (%i + 239) >>(%o4) %e = - -------------------- >> 4 >> (%i - 239) (%i + 5) >>(%i5) lhs(%)=rectform(rhs(%)); >> - 2 %i result >>(%o5) %e = - %i >>(%i6) log(lhs(%))=log(rhs(%)); >>(%o6) - 2 %i result = log(- %i) >>(%i7) rectform(lhs(%))=rectform(rhs(%)); >> %i %pi >>(%o7) - 2 %i result = - ------ >> 2 >>(%i8) solve(%,result); >> %pi >>(%o8) [result = ---] >> 4 >> >>This example shows why rectform, log, exp, logcontract, logarc, etc., should distribute over "=". >> >>At 11:20 AM 2/20/2012, Stavros Macrakis wrote: >>>Consider the expression 4*atan(1/5)-atan(1/239) (Machin's formula). >>> >>>How can we use Maxima to simplify it to %pi/4? >>> >>>Well, here's one approach: >>> >>>atan(trigexpand(trigexpand(tan(ex)))) >>> >>>And here's another way that doesn't depend on trig identities: >>> >>>(%i1) ex:4*atan(1/5)-atan(1/239); >>>(%o1) 4*atan(1/5)-atan(1/239) >>>(%i2) llex: logcontract(logarc(ex)); >>>(%o2) %i*log(-(%i-5)^4*(%i+239)/((%i-239)*(%i+5)^4))/2 >>>(%i3) rectform(llex); >>>(%o3) (atan(sin(4*atan(1/5))/cos(4*atan(1/5)))-atan(sin(4*(%pi-atan(1/5)))/cos(4*(%pi-atan(1/5))))-2*atan(1/239))/2 >>> <<< oops, not so helpful >>>(%i4) scanmap(rectform,llex,bottomup); >>> <<< but reorganizing the rectform calculation gives a better result >>> <<< makes me think that rectform could be improved... >>>(%o4) %pi/4 >>> >>>Are any of these techniques packaged into some analog of trigsimp? >>> >>> -s From macrakis at alum.mit.edu Tue Feb 21 10:56:29 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 21 Feb 2012 11:56:29 -0500 Subject: [Maxima] Simplifying atan expressions In-Reply-To: References: Message-ID: Well, log(%i) and log(-%i) have all the same issues as log(-1) (except for (2)). If you convert log(%i*x)+log(%i) to log(%i*x)+%i*%pi/2, you have the same contraction problem as before. That is why I'm suggesting that solving this reasonable may involve adding some functionality to logcontract as well as changing the default simplifications for log. -s On Tue, Feb 21, 2012 at 11:43, Henry Baker wrote: > But I asked about log(-%i), which should be pretty non-controversial. > > If there is a switch for log, it should indicate what your favorite branch > is: e.g., [-%pi,+%pi), [0,2*%pi), etc. > > At 08:30 AM 2/21/2012, Stavros Macrakis wrote: > >Good question. For that matter, log(-1) only simplifies to %i*%pi if > lognegint = true (default is false). > > > >Here are the possible arguments I can think of for this behavior (I don't > guarantee that they correspond to the original rationale...): > > > >1) log is multivalued, and the user may want to control whether log(-1) > => %pi or -%pi etc. > >2) Maxima assumes the user is working in the real domain, so shouldn't > introduce %i unless explicitly asked to. But domain:complex doesn't change > the behavior. > >3) log(-1) may appear as an intermediate result of a real calculation > which goes away with simplification, e.g. logcontract(log(-1)+log(-x)), so > why confuse matters? > >4) Once you have an expression like log(x)+%i*%pi, converting back to > log(-x) is slightly tricky -- actually, simply log(exp(EXPR)) will do it, > but there is no easy way to apply that globally, like logcontract. > > > >I suspect that 3 and 4 are the most important. > > > >So perhaps the default is OK, but log(-C) and log(%i*C) should expand out > when domain=complex or logexpand=ultra. Conversely, perhaps there should > be a logconmode=all which contracts things like log(x)+C so that arguments > 3 and 4 go away.... > > > >Thoughts? > > > > -s > > > >On Mon, Feb 20, 2012 at 23:38, Henry Baker wrote: > >How come log(-%i) doesn't already simplify by itself, instead of > requiring rectform to do it? > > > >Is there some switch that Maxima uses to force log(constant) to simplify > if it can? > > > >At 01:12 PM 2/20/2012, Stavros Macrakis wrote: > >>Henry, > >> > >>Yes, this derivation is essentially the same as the bottomup rectform. > In fact: > >> > >> expr: logcontract(logarc(4*atan(1/5)-atan(1/239))); > >> rectform(substpart(e1:rectform(piece),expr,1,2,1)) => %pi/4 > >> > >>You'll see that e1 here is -%i. > >> > >>What rectform does internally by default looks more like > >> > >> rectform(substpart(e2:polarform(piece),expr,1,2,1)); > >> > >>where e2 isn't at all helpful. > >> > >>I agree that most mathematical functions (sin, etc.) and form-changing > routines (factor etc.) should distribute over "=". > >> > >> -s > >> > >>On Mon, Feb 20, 2012 at 15:45, Henry Baker wrote: > >>result=4*atan(1/5)-atan(1/239); > >> 1 1 > >>(%o1) result = 4 atan(-) - atan(---) > >> 5 239 > >>(%i2) lhs(%)=logcontract(logarc(rhs(%))); > >> 4 > >> (%i - 5) (%i + 239) > >> %i log(- --------------------) > >> 4 > >> (%i - 239) (%i + 5) > >>(%o2) result = ------------------------------ > >> 2 > >>(%i3) %*2/%i; > >> 4 > >> (%i - 5) (%i + 239) > >>(%o3) - 2 %i result = log(- --------------------) > >> 4 > >> (%i - 239) (%i + 5) > >>(%i4) exp(lhs(%))=exp(rhs(%)); > >> 4 > >> - 2 %i result (%i - 5) (%i + 239) > >>(%o4) %e = - -------------------- > >> 4 > >> (%i - 239) (%i + 5) > >>(%i5) lhs(%)=rectform(rhs(%)); > >> - 2 %i result > >>(%o5) %e = - %i > >>(%i6) log(lhs(%))=log(rhs(%)); > >>(%o6) - 2 %i result = log(- %i) > >>(%i7) rectform(lhs(%))=rectform(rhs(%)); > >> %i %pi > >>(%o7) - 2 %i result = - ------ > >> 2 > >>(%i8) solve(%,result); > >> %pi > >>(%o8) [result = ---] > >> 4 > >> > >>This example shows why rectform, log, exp, logcontract, logarc, etc., > should distribute over "=". > >> > >>At 11:20 AM 2/20/2012, Stavros Macrakis wrote: > >>>Consider the expression 4*atan(1/5)-atan(1/239) (Machin's formula). > >>> > >>>How can we use Maxima to simplify it to %pi/4? > >>> > >>>Well, here's one approach: > >>> > >>>atan(trigexpand(trigexpand(tan(ex)))) > >>> > >>>And here's another way that doesn't depend on trig identities: > >>> > >>>(%i1) ex:4*atan(1/5)-atan(1/239); > >>>(%o1) 4*atan(1/5)-atan(1/239) > >>>(%i2) llex: logcontract(logarc(ex)); > >>>(%o2) %i*log(-(%i-5)^4*(%i+239)/((%i-239)*(%i+5)^4))/2 > >>>(%i3) rectform(llex); > >>>(%o3) > (atan(sin(4*atan(1/5))/cos(4*atan(1/5)))-atan(sin(4*(%pi-atan(1/5)))/cos(4*(%pi-atan(1/5))))-2*atan(1/239))/2 > >>> <<< oops, not so helpful > >>>(%i4) scanmap(rectform,llex,bottomup); > >>> <<< but reorganizing the rectform calculation gives a better > result > >>> <<< makes me think that rectform could be improved... > >>>(%o4) %pi/4 > >>> > >>>Are any of these techniques packaged into some analog of trigsimp? > >>> > >>> -s > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lapeyre.math122a at gmail.com Tue Feb 21 11:10:31 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Tue, 21 Feb 2012 18:10:31 +0100 Subject: [Maxima] Simplifying atan expressions In-Reply-To: References: Message-ID: <4F43D007.6040604@gmail.com> On 02/21/2012 05:43 PM, Henry Baker wrote: > But I asked about log(-%i), which should be pretty non-controversial. Looks like even the behavior advertised by ? log is broken...? Maxima 5.26.0 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (a.k.a. GCL) (%i1) lognegint; (%o1) false (%i2) log(-%i); (%o2) log(-%i) (%i3) lognegint:true; (%o3) true (%i4) log(-%i); (%o4) log(-%i) From macrakis at alum.mit.edu Tue Feb 21 11:29:55 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 21 Feb 2012 12:29:55 -0500 Subject: [Maxima] Simplifying atan expressions In-Reply-To: <4F43D007.6040604@gmail.com> References: <4F43D007.6040604@gmail.com> Message-ID: Documentation of lognegint: If `true' implements the rule `log(-n)' -> `log(n)+%i*%pi' for `n' a positive integer. %i is not a positive integer, so the behavior is as advertised as far as I can tell. -s On Tue, Feb 21, 2012 at 12:10, John Lapeyre wrote: > On 02/21/2012 05:43 PM, Henry Baker wrote: > > But I asked about log(-%i), which should be pretty non-controversial. > > Looks like even the behavior advertised by ? log is > broken...? > > Maxima 5.26.0 http://maxima.sourceforge.net > using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (a.k.a. GCL) > (%i1) lognegint; > (%o1) false > (%i2) log(-%i); > (%o2) log(-%i) > (%i3) lognegint:true; > (%o3) true > (%i4) log(-%i); > (%o4) log(-%i) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lapeyre.math122a at gmail.com Tue Feb 21 11:43:38 2012 From: lapeyre.math122a at gmail.com (John Lapeyre) Date: Tue, 21 Feb 2012 18:43:38 +0100 Subject: [Maxima] Simplifying atan expressions In-Reply-To: References: <4F43D007.6040604@gmail.com> Message-ID: <4F43D7CA.5000700@gmail.com> > %i is not a positive integer, so the behavior is as advertised as far as I can tell. ehh something really felt wrong when I sent that. I regret cluttering the record with nonsense. From hbaker1 at pipeline.com Tue Feb 21 13:02:15 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Tue, 21 Feb 2012 11:02:15 -0800 Subject: [Maxima] Simplifying atan expressions In-Reply-To: References: Message-ID: Yup, logcontract is broken: (%i1) declare(z,complex); (%o1) done (%i2) log(z); (%o2) log(z) (%i3) %,rectform; (%o3) log(abs(z)) + %i carg(z) (%i4) logcontract(%); (%o4) log(abs(z)) + %i carg(z) (%i5) %,logcontract; (%o5) log(abs(z)) + %i carg(z) At 08:56 AM 2/21/2012, Stavros Macrakis wrote: >Well, log(%i) and log(-%i) have all the same issues as log(-1) (except for (2)). If you convert log(%i*x)+log(%i) to log(%i*x)+%i*%pi/2, you have the same contraction problem as before. That is why I'm suggesting that solving this reasonable may involve adding some functionality to logcontract as well as changing the default simplifications for log. > > -s > >On Tue, Feb 21, 2012 at 11:43, Henry Baker wrote: >But I asked about log(-%i), which should be pretty non-controversial. > >If there is a switch for log, it should indicate what your favorite branch is: e.g., [-%pi,+%pi), [0,2*%pi), etc. > >At 08:30 AM 2/21/2012, Stavros Macrakis wrote: >>Good question. For that matter, log(-1) only simplifies to %i*%pi if lognegint = true (default is false). >> >>Here are the possible arguments I can think of for this behavior (I don't guarantee that they correspond to the original rationale...): >> >>1) log is multivalued, and the user may want to control whether log(-1) => %pi or -%pi etc. >>2) Maxima assumes the user is working in the real domain, so shouldn't introduce %i unless explicitly asked to. But domain:complex doesn't change the behavior. >>3) log(-1) may appear as an intermediate result of a real calculation which goes away with simplification, e.g. logcontract(log(-1)+log(-x)), so why confuse matters? >>4) Once you have an expression like log(x)+%i*%pi, converting back to log(-x) is slightly tricky -- actually, simply log(exp(EXPR)) will do it, but there is no easy way to apply that globally, like logcontract. >> >>I suspect that 3 and 4 are the most important. >> >>So perhaps the default is OK, but log(-C) and log(%i*C) should expand out when domain=complex or logexpand=ultra. Conversely, perhaps there should be a logconmode=all which contracts things like log(x)+C so that arguments 3 and 4 go away.... >> >>Thoughts? >> >> -s >> >>On Mon, Feb 20, 2012 at 23:38, Henry Baker wrote: >>How come log(-%i) doesn't already simplify by itself, instead of requiring rectform to do it? >> >>Is there some switch that Maxima uses to force log(constant) to simplify if it can? >> >>At 01:12 PM 2/20/2012, Stavros Macrakis wrote: >>>Henry, >>> >>>Yes, this derivation is essentially the same as the bottomup rectform. In fact: >>> >>> expr: logcontract(logarc(4*atan(1/5)-atan(1/239))); >>> rectform(substpart(e1:rectform(piece),expr,1,2,1)) => %pi/4 >>> >>>You'll see that e1 here is -%i. >>> >>>What rectform does internally by default looks more like >>> >>> rectform(substpart(e2:polarform(piece),expr,1,2,1)); >>> >>>where e2 isn't at all helpful. >>> >>>I agree that most mathematical functions (sin, etc.) and form-changing routines (factor etc.) should distribute over "=". >>> >>> -s >>> >>>On Mon, Feb 20, 2012 at 15:45, Henry Baker wrote: >>>result=4*atan(1/5)-atan(1/239); >>> 1 1 >>>(%o1) result = 4 atan(-) - atan(---) >>> 5 239 >>>(%i2) lhs(%)=logcontract(logarc(rhs(%))); >>> 4 >>> (%i - 5) (%i + 239) >>> %i log(- --------------------) >>> 4 >>> (%i - 239) (%i + 5) >>>(%o2) result = ------------------------------ >>> 2 >>>(%i3) %*2/%i; >>> 4 >>> (%i - 5) (%i + 239) >>>(%o3) - 2 %i result = log(- --------------------) >>> 4 >>> (%i - 239) (%i + 5) >>>(%i4) exp(lhs(%))=exp(rhs(%)); >>> 4 >>> - 2 %i result (%i - 5) (%i + 239) >>>(%o4) %e = - -------------------- >>> 4 >>> (%i - 239) (%i + 5) >>>(%i5) lhs(%)=rectform(rhs(%)); >>> - 2 %i result >>>(%o5) %e = - %i >>>(%i6) log(lhs(%))=log(rhs(%)); >>>(%o6) - 2 %i result = log(- %i) >>>(%i7) rectform(lhs(%))=rectform(rhs(%)); >>> %i %pi >>>(%o7) - 2 %i result = - ------ >>> 2 >>>(%i8) solve(%,result); >>> %pi >>>(%o8) [result = ---] >>> 4 >>> >>>This example shows why rectform, log, exp, logcontract, logarc, etc., should distribute over "=". >>> >>>At 11:20 AM 2/20/2012, Stavros Macrakis wrote: >>>>Consider the expression 4*atan(1/5)-atan(1/239) (Machin's formula). >>>> >>>>How can we use Maxima to simplify it to %pi/4? >>>> >>>>Well, here's one approach: >>>> >>>>atan(trigexpand(trigexpand(tan(ex)))) >>>> >>>>And here's another way that doesn't depend on trig identities: >>>> >>>>(%i1) ex:4*atan(1/5)-atan(1/239); >>>>(%o1) 4*atan(1/5)-atan(1/239) >>>>(%i2) llex: logcontract(logarc(ex)); >>>>(%o2) %i*log(-(%i-5)^4*(%i+239)/((%i-239)*(%i+5)^4))/2 >>>>(%i3) rectform(llex); >>>>(%o3) (atan(sin(4*atan(1/5))/cos(4*atan(1/5)))-atan(sin(4*(%pi-atan(1/5)))/cos(4*(%pi-atan(1/5))))-2*atan(1/239))/2 >>>> <<< oops, not so helpful >>>>(%i4) scanmap(rectform,llex,bottomup); >>>> <<< but reorganizing the rectform calculation gives a better result >>>> <<< makes me think that rectform could be improved... >>>>(%o4) %pi/4 >>>> >>>>Are any of these techniques packaged into some analog of trigsimp? >>>> >>>> -s From macrakis at alum.mit.edu Tue Feb 21 13:51:41 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 21 Feb 2012 14:51:41 -0500 Subject: [Maxima] Simplifying atan expressions In-Reply-To: References: Message-ID: Though it may be broken in the sense of "does not do what I want it to do", it is not broken in the sense of "does not conform to its definition": ...transform[s] subexpressions of the form `a1*log(b1) + a2*log(b2) + c' into `log(ratsimp(b1^a1 * b2^a2)) + c' Which is why I suggested changing its definition: perhaps there should be a logconmode=all which contracts things like log(x)+C I suspect that logconmode=all is *not* the right default. One generally doesn't want log(x)+1 to contract to log(%e*x). For that matter, Maxima currently can't do much useful with abs(z)*exp(%i*carg(z)). -s PS Someone should tell Maxima that imagpart(carg(...)) = 0... On Tue, Feb 21, 2012 at 14:02, Henry Baker wrote: > Yup, logcontract is broken: > > (%i1) declare(z,complex); > (%o1) done > (%i2) log(z); > (%o2) log(z) > (%i3) %,rectform; > (%o3) log(abs(z)) + %i carg(z) > (%i4) logcontract(%); > (%o4) log(abs(z)) + %i carg(z) > (%i5) %,logcontract; > (%o5) log(abs(z)) + %i carg(z) > > At 08:56 AM 2/21/2012, Stavros Macrakis wrote: > >Well, log(%i) and log(-%i) have all the same issues as log(-1) (except > for (2)). If you convert log(%i*x)+log(%i) to log(%i*x)+%i*%pi/2, you > have the same contraction problem as before. That is why I'm suggesting > that solving this reasonable may involve adding some functionality to > logcontract as well as changing the default simplifications for log. > > > > -s > > > >On Tue, Feb 21, 2012 at 11:43, Henry Baker wrote: > >But I asked about log(-%i), which should be pretty non-controversial. > > > >If there is a switch for log, it should indicate what your favorite > branch is: e.g., [-%pi,+%pi), [0,2*%pi), etc. > > > >At 08:30 AM 2/21/2012, Stavros Macrakis wrote: > >>Good question. For that matter, log(-1) only simplifies to %i*%pi if > lognegint = true (default is false). > >> > >>Here are the possible arguments I can think of for this behavior (I > don't guarantee that they correspond to the original rationale...): > >> > >>1) log is multivalued, and the user may want to control whether log(-1) > => %pi or -%pi etc. > >>2) Maxima assumes the user is working in the real domain, so shouldn't > introduce %i unless explicitly asked to. But domain:complex doesn't change > the behavior. > >>3) log(-1) may appear as an intermediate result of a real calculation > which goes away with simplification, e.g. logcontract(log(-1)+log(-x)), so > why confuse matters? > >>4) Once you have an expression like log(x)+%i*%pi, converting back to > log(-x) is slightly tricky -- actually, simply log(exp(EXPR)) will do it, > but there is no easy way to apply that globally, like logcontract. > >> > >>I suspect that 3 and 4 are the most important. > >> > >>So perhaps the default is OK, but log(-C) and log(%i*C) should expand > out when domain=complex or logexpand=ultra. Conversely, perhaps there > should be a logconmode=all which contracts things like log(x)+C so that > arguments 3 and 4 go away.... > >> > >>Thoughts? > >> > >> -s > >> > >>On Mon, Feb 20, 2012 at 23:38, Henry Baker wrote: > >>How come log(-%i) doesn't already simplify by itself, instead of > requiring rectform to do it? > >> > >>Is there some switch that Maxima uses to force log(constant) to simplify > if it can? > >> > >>At 01:12 PM 2/20/2012, Stavros Macrakis wrote: > >>>Henry, > >>> > >>>Yes, this derivation is essentially the same as the bottomup rectform. > In fact: > >>> > >>> expr: logcontract(logarc(4*atan(1/5)-atan(1/239))); > >>> rectform(substpart(e1:rectform(piece),expr,1,2,1)) => %pi/4 > >>> > >>>You'll see that e1 here is -%i. > >>> > >>>What rectform does internally by default looks more like > >>> > >>> rectform(substpart(e2:polarform(piece),expr,1,2,1)); > >>> > >>>where e2 isn't at all helpful. > >>> > >>>I agree that most mathematical functions (sin, etc.) and form-changing > routines (factor etc.) should distribute over "=". > >>> > >>> -s > >>> > >>>On Mon, Feb 20, 2012 at 15:45, Henry Baker > wrote: > >>>result=4*atan(1/5)-atan(1/239); > >>> 1 1 > >>>(%o1) result = 4 atan(-) - atan(---) > >>> 5 239 > >>>(%i2) lhs(%)=logcontract(logarc(rhs(%))); > >>> 4 > >>> (%i - 5) (%i + 239) > >>> %i log(- --------------------) > >>> 4 > >>> (%i - 239) (%i + 5) > >>>(%o2) result = ------------------------------ > >>> 2 > >>>(%i3) %*2/%i; > >>> 4 > >>> (%i - 5) (%i + 239) > >>>(%o3) - 2 %i result = log(- --------------------) > >>> 4 > >>> (%i - 239) (%i + 5) > >>>(%i4) exp(lhs(%))=exp(rhs(%)); > >>> 4 > >>> - 2 %i result (%i - 5) (%i + 239) > >>>(%o4) %e = - -------------------- > >>> 4 > >>> (%i - 239) (%i + 5) > >>>(%i5) lhs(%)=rectform(rhs(%)); > >>> - 2 %i result > >>>(%o5) %e = - %i > >>>(%i6) log(lhs(%))=log(rhs(%)); > >>>(%o6) - 2 %i result = log(- %i) > >>>(%i7) rectform(lhs(%))=rectform(rhs(%)); > >>> %i %pi > >>>(%o7) - 2 %i result = - ------ > >>> 2 > >>>(%i8) solve(%,result); > >>> %pi > >>>(%o8) [result = ---] > >>> 4 > >>> > >>>This example shows why rectform, log, exp, logcontract, logarc, etc., > should distribute over "=". > >>> > >>>At 11:20 AM 2/20/2012, Stavros Macrakis wrote: > >>>>Consider the expression 4*atan(1/5)-atan(1/239) (Machin's formula). > >>>> > >>>>How can we use Maxima to simplify it to %pi/4? > >>>> > >>>>Well, here's one approach: > >>>> > >>>>atan(trigexpand(trigexpand(tan(ex)))) > >>>> > >>>>And here's another way that doesn't depend on trig identities: > >>>> > >>>>(%i1) ex:4*atan(1/5)-atan(1/239); > >>>>(%o1) 4*atan(1/5)-atan(1/239) > >>>>(%i2) llex: logcontract(logarc(ex)); > >>>>(%o2) %i*log(-(%i-5)^4*(%i+239)/((%i-239)*(%i+5)^4))/2 > >>>>(%i3) rectform(llex); > >>>>(%o3) > (atan(sin(4*atan(1/5))/cos(4*atan(1/5)))-atan(sin(4*(%pi-atan(1/5)))/cos(4*(%pi-atan(1/5))))-2*atan(1/239))/2 > >>>> <<< oops, not so helpful > >>>>(%i4) scanmap(rectform,llex,bottomup); > >>>> <<< but reorganizing the rectform calculation gives a better > result > >>>> <<< makes me think that rectform could be improved... > >>>>(%o4) %pi/4 > >>>> > >>>>Are any of these techniques packaged into some analog of trigsimp? > >>>> > >>>> -s > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mickle.mouse at gmail.com Wed Feb 22 02:54:05 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Wed, 22 Feb 2012 01:54:05 -0700 Subject: [Maxima] Help building a matrix-calculus package Message-ID: Hello all, Leo Butler was helpful earlier in showing how to add custom rules to Maxima. I don't know how to do several more advanced rules. I was wondering if anyone was interested in helping me start developing a package that would more or less encapsulate many of the rules in the Matrix Cookbook. I am not sure how best to go about it (tellsimp / match declare or actually writing some Lisp functions). Regardless I'm new to adding functionality to Maxima (and I've never used lisp, but I suppose I could learn). Below I provide several example rules that I would need to know how to incorporate in order to write this package. I don't know how to tell maxima how write rules that extend to N variables. For example: (A_1 . A_2 ... A_n)^^-1 = A_n^^-1 ... A_2^^-1 . A_1^^-1 Also, there are some recursive rules (a recursive rule for just 2 elements could work for the above problem), which may work well using tellsimp, but I don't know. For instance the matrix-calculus chain rule: partial( g(U) ) / partial(X_ij) = Trace( transpose(partial g(U) / partial U) . partial U / partial X_ij), this may need to be applied multiple times for different g(U) and U. Some of the rules use indexed notation: partial ( transpose(X) . B . X ) / partial (X_ij) = transpose(X) . B . single_entry_matrix(i,j) +?single_entry_matrix(j,i) . B . X, where the?single_entry_matrix size is determined by the expression (in this case, it is the same size as?transpose(X) . B . X) Is there some way to define a variable as a row or column vector? It would be useful for expressions like: partial transpose( b ) . transpose(X) . X . c / partial X = X( b . transpose(c) + c . transpose(b) ), specifically I need to know that b and c are column vectors for the above identity to work. How can I tell Maxima to "Rotate" matrices inside a trace? Tr( A . B . C . single_entry_matrix(i, j) . D . E) = Tr( D . E . A . B . C . single_entry_matrix(i, j) ) = the ith, jth index of ( D . E . A . B . C ) Thanks in advance for any advice. I know this is a very ambitious undertaking since the first two chapters contain about 100 identities. I suspect at least some can be re-derived using the chain rule and some of the basic rules. Again, I am not sure how best to go about building a package to really help me out. From willisb at unk.edu Wed Feb 22 05:49:39 2012 From: willisb at unk.edu (Barton Willis) Date: Wed, 22 Feb 2012 05:49:39 -0600 Subject: [Maxima] Help building a matrix-calculus package In-Reply-To: References: Message-ID: > I don't know how to tell maxima how write rules that extend to N > variables. For example: > (A_1 . A_2 ... A_n)^^-1 = A_n^^-1 ... A_2^^-1 . A_1^^-1 One method is to substitute a lambda form for noncommuting exponentiation: (%i1) ncprod_p(e) := not mapatom(e) and op(e)="."$ (%i2) nc_subst(e) := subst("^^" = lambda([e,n], if n = -1 and ncprod_p(e) then map(lambda([s], s^^-1), reverse(e)) else e^^n), e); (%o2) nc_subst(e):=subst("^^"=lambda([e,n],if n=-1 and ncprod_p(e) then map(lambda([s],s^^(-1)),reverse(e)) else e^^n),e) (%i3) nc_subst(%pi * c.(a.b.c)^^-1 . a); (%o3) %pi*b^^(-1) (%i4) nc_subst((a * b)^^-1 - (a.b)^^-1); (%o4) (a*b)^^(-1)-b^^(-1) . a^^(-1) Also: Simplification of noncommuting multiplication is controlled by numerous option variables; enter ?? dot. --Barton From willisb at unk.edu Wed Feb 22 07:46:50 2012 From: willisb at unk.edu (Barton Willis) Date: Wed, 22 Feb 2012 07:46:50 -0600 Subject: [Maxima] Help building a matrix-calculus package In-Reply-To: References: , Message-ID: One more thing: Maybe it be helpful to be able to do things like: kron_delta(k,l) . m . kron_delta(k,l) --> matrix_element(m,k,l) * kron_delta(k,l) Maxima does have a simplifying multiple-indexed Kronecker delta, but there is no simplifying function similar to matrix_element (I think). --Barton From arawak1 at yahoo.com Wed Feb 22 18:12:38 2012 From: arawak1 at yahoo.com (Ronald Francis) Date: Wed, 22 Feb 2012 19:12:38 -0500 Subject: [Maxima] Completely clueless! Message-ID: Having installed wxMaxima on my iMac (running, of course Mac OS), I try the simple 2+3; - followed by Enter, Shift-Enter, Cntl-Enter, Command-Enter, and even Enter-Enter; result nothing!!! Maxima works perfectly in the Terminal - I definitely need help. Thanks, All. From arawak1 at yahoo.com Wed Feb 22 18:28:12 2012 From: arawak1 at yahoo.com (raf .) Date: Wed, 22 Feb 2012 16:28:12 -0800 (PST) Subject: [Maxima] wxMaxima not working for me. Message-ID: <1329956892.93897.YahooMailNeo@web121601.mail.ne1.yahoo.com> Having installed wxMaxima on my iMac (running, of course Mac OS), I try the simple 2+3; - followed by Enter, Shift-Enter, Cntl-Enter, Command-Enter, and even Enter-Enter; result nothing!!! Maxima works perfectly in the Terminal -? I definitely need help. Thanks, All. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexanderk.hansen at gmail.com Thu Feb 23 09:21:26 2012 From: alexanderk.hansen at gmail.com (Alexander Hansen) Date: Thu, 23 Feb 2012 08:21:26 -0700 Subject: [Maxima] Completely clueless! In-Reply-To: References: Message-ID: On Wed, Feb 22, 2012 at 5:12 PM, Ronald Francis wrote: > Having installed wxMaxima on my iMac (running, of course Mac OS), I try the simple 2+3; - followed by Enter, Shift-Enter, Cntl-Enter, Command-Enter, and even Enter-Enter; result nothing!!! > > Maxima works perfectly in the Terminal - ?I definitely need help. > > Thanks, All. Shift-Enter should do it, assuming you're on a recent wxMaxima (you didn't specify a version). One quick thing to look for is whether wxMaxima is indicating (in the status bar) that it is connected to Maxima and ready to do calculations. If that doesn't come up after a reasonable wait, then more information will be useful: 1) The versions of wxMaxima and Maxima you're using. Also where you got them: e.g. were they the official binaries from Sourceforge or via some other method. 2) The version of OS X you're using. 3) Also, you can run the Console application (from /Applications/Utilities) just before starting wxMaxima and see if any error messages come up. From robert.dodier at gmail.com Thu Feb 23 09:57:52 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 23 Feb 2012 08:57:52 -0700 Subject: [Maxima] Help building a matrix-calculus package In-Reply-To: References: Message-ID: On 2/22/12, Mike Valenzuela wrote: > (A_1 . A_2 ... A_n)^^-1 = A_n^^-1 ... A_2^^-1 . A_1^^-1 matchdeclare (aa, nctimesp); nctimesp (e) := not atom(e) and op(e) = "."; matchdeclare (xx, all); tellsimp (aa^^xx, map (lambda ([e], e^^xx), aa)); (a . b . c)^^-1; => a^^(-1) . b^^(-1) . c^^(-1) > Also, there are some recursive rules (a recursive rule for just 2 > elements could work for the above problem), which may work well using > tellsimp, but I don't know. At present, Maxima's pattern matcher can't deduce rules for n-ary operators from a pattern with just two operands of the same type. It would be useful and interesting to do that or other kinds of deductions based on properties of the operator (commutative, etc). It would be some work (I can do it) but not really a big job, so if you're interested, let's talk it over. > partial( g(U) ) / partial(X_ij) = Trace( transpose(partial g(U) / > partial U) . partial U / partial X_ij), Dunno, didn't try this one yet. > partial ( transpose(X) . B . X ) / partial (X_ij) = transpose(X) . B . > single_entry_matrix(i,j) + single_entry_matrix(j,i) . B . X, > where the single_entry_matrix size is determined by the expression (in > this case, it is the same size as transpose(X) . B . X) Let E = single_entry_matrix. (I didn't try to write this function.) matchdeclare ([xx, bb], nonscalarp); matchdeclare ([ii, jj], all); /* let built-in simplifier act on diff(transpose(xx) ...), * then construct new rule for simplified expression */ 'diff (transpose (xx) . bb . xx, xx [ii, jj]); tellsimpafter (''%, transpose(xx) . bb . E(ii, jj) + E(jj, ii) . bb . xx); declare ([X, B], nonscalar); diff (transpose (X) . B . X, X[i, j]); => 0 'diff (transpose (X) . B . X, X[i, j]); => transpose(X) . B . E(i, j) + E(j, i) . B . X There are various confusing details here (sorry). Would it work as well without the nonscalarp test? Maybe. Why is diff(...) different from 'diff(...) ? The rule was written for the noun expression 'diff(...), it doesn't match diff(...); maybe it should. > Is there some way to define a variable as a row or column vector? It > would be useful for expressions like: > partial transpose( b ) . transpose(X) . X . c / partial X = X( b . > transpose(c) + c . transpose(b) ), > specifically I need to know that b and c are column vectors for the > above identity to work. Well, a conventional way would be to represent them as matrices with 1 row or 1 column. That's not entirely satisfactory from an algebraic point of view ... I don't like conflating different types of objects for mere convenience. A more principled approach is to define a vector type and make it possible to have symbolic vectors (e.g. declare(x, vector)) in addition to literal vectors (e.g. x : vector(a, b, c)). I don't know if someone has already done so; several matrix/vector packages have been written over the years, maybe one of them has that stuff. > How can I tell Maxima to "Rotate" matrices inside a trace? > Tr( A . B . C . single_entry_matrix(i, j) . D . E) = Tr( D . E . A . B > . C . single_entry_matrix(i, j) ) = the ith, jth index of ( D . E . A > . B . C ) I don't see an obvious way to do it. Certainly it can be done in a messy way, but I don't see a neat way to do it. > Thanks in advance for any advice. I know this is a very ambitious > undertaking since the first two chapters contain about 100 identities. > I suspect at least some can be re-derived using the chain rule and > some of the basic rules. Again, I am not sure how best to go about > building a package to really help me out. Well, I think the way to go about this is to write out the list of identities you want, then implement as many of them as you can, maybe reusing bits from existing share packages and maybe punting to built-in rules sometimes. (Note that I'm specifically recommending that you make your list first and review existing packages afterwards.) I would be happy to help write rules and I'm willing to consider extensions to the pattern matching code. all the best Robert Dodier From robert.dodier at gmail.com Thu Feb 23 10:12:22 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 23 Feb 2012 09:12:22 -0700 Subject: [Maxima] Generating octave functions from maxima In-Reply-To: References: Message-ID: On 2/8/12, Pawe? Cesar Sanjuan Szklarz wrote: > My question is: how to generate dq(i) in stand of dq(1,i)?? I am > using f90mx inside generateOctaveFunction. I've committed the following changes to f90mx and fortmx, so now assignments to a 1-dimensional array are generated when the argument is a list (which caused an error before). A matrix is treated the same as before. In particular, no attempt is made to treat a 1-row or 1-column matrix as 1-dimensional. You can apply this patch to your local Maxima installation, or you can wait for the next release (sometime in April). Hope this helps, Robert Dodier PS. $ git diff d3f131579^..d3f131579 diff --git a/share/contrib/f90.lisp b/share/contrib/f90.lisp index 6c80b1e..4a0ce80 100644 --- a/share/contrib/f90.lisp +++ b/share/contrib/f90.lisp @@ -90,26 +90,34 @@ ;; Takes a name and a matrix and prints a sequence of F90 assignment ;; statements of the form ;; NAME(I,J) = +;; or, when the second argument is a list, +;; NAME(I) = (defmfun $f90mx (name mat) (cond ((not (symbolp name)) - (merror "~%First argument to `f90mx' must be a symbol.")) - ((not ($matrixp mat)) - (merror "Second argument to `f90mx' not a matrix: ~M" mat))) - (do ((mat (cdr mat) (cdr mat)) (i 1 (1+ i))) - ((null mat)) - (do ((m (cdar mat) (cdr m)) (j 1 (1+ j))) - ((null m)) - (f90-print `((mequal) ((,name) ,i ,j) ,(car m))))) + (merror "f90mx: first argument must be a symbol; found: ~M" name)) + ((not (or ($matrixp mat) ($listp mat))) + (merror "f90mx: second argument must be a list or matrix; found: ~M" mat))) + (cond + (($matrixp mat) + (do ((mat (cdr mat) (cdr mat)) (i 1 (1+ i))) + ((null mat)) + (do ((m (cdar mat) (cdr m)) (j 1 (1+ j))) + ((null m)) + (f90-print `((mequal) ((,name) ,i ,j) ,(car m)))))) + (($listp mat) + (do ((mat (cdr mat) (cdr mat)) (i 1 (1+ i))) + ((null mat)) + (f90-print `((mequal) ((,name) ,i) ,(car mat)))))) '$done) (defmspec $f90 (expr) (dolist (l (cdr expr)) (let ((value (strmeval l))) (cond ((msetqp l) (setq value `((mequal) ,(cadr l) ,(meval l))))) - (cond ((and (symbolp l) ($matrixp value)) + (cond ((and (symbolp l) (or ($matrixp value) ($listp value))) ($f90mx l value)) ((and (not (atom value)) (eq (caar value) 'mequal) - (symbolp (cadr value)) ($matrixp (caddr value))) + (symbolp (cadr value)) (or ($matrixp (caddr value)) ($listp (caddr value)))) ($f90mx (cadr value) (caddr value))) (t (f90-print value)))))) diff --git a/src/fortra.lisp b/src/fortra.lisp index 21da838..847a3e1 100644 --- a/src/fortra.lisp +++ b/src/fortra.lisp @@ -30,17 +30,17 @@ (defmvar $fortfloat nil "Something JPG is working on.") ;; This function is called from Macsyma toplevel. If the argument is a -;; symbol, and the symbol is bound to a matrix, then the matrix is printed +;; symbol, and the symbol is bound to a matrix or list, then the value is printed ;; using an array assignment notation. (defmspec $fortran (l) (setq l (fexprcheck l)) (let ((value (strmeval l))) (cond ((msetqp l) (setq value `((mequal) ,(cadr l) ,(meval l))))) - (cond ((and (symbolp l) ($matrixp value)) + (cond ((and (symbolp l) (or ($matrixp value) ($listp value))) ($fortmx l value)) ((and (not (atom value)) (eq (caar value) 'mequal) - (symbolp (cadr value)) ($matrixp (caddr value))) + (symbolp (cadr value)) (or ($matrixp (caddr value)) ($listp (caddr value)))) ($fortmx (cadr value) (caddr value))) (t (fortran-print value))))) @@ -144,17 +144,25 @@ ;; Takes a name and a matrix and prints a sequence of Fortran assignment ;; statements of the form ;; NAME(I,J) = +;; or, when the second argument is a list, +;; NAME(I) = (defmfun $fortmx (name mat &optional (stream *standard-output*) &aux ($loadprint nil)) (cond ((not (symbolp name)) (merror (intl:gettext "fortmx: first argument must be a symbol; found: ~M") name)) - ((not ($matrixp mat)) - (merror (intl:gettext "fortmx: second argument must be a matrix; found: ~M") mat))) - (do ((mat (cdr mat) (cdr mat)) (i 1 (1+ i))) - ((null mat)) - (do ((m (cdar mat) (cdr m)) (j 1 (1+ j))) - ((null m)) - (fortran-print `((mequal) ((,name) ,i ,j) ,(car m)) stream))) + ((not (or ($matrixp mat) ($listp mat))) + (merror (intl:gettext "fortmx: second argument must be a list or matrix; found: ~M") mat))) + (cond + (($matrixp mat) + (do ((mat (cdr mat) (cdr mat)) (i 1 (1+ i))) + ((null mat)) + (do ((m (cdar mat) (cdr m)) (j 1 (1+ j))) + ((null m)) + (fortran-print `((mequal) ((,name) ,i ,j) ,(car m)) stream)))) + (($listp mat) + (do ((mat (cdr mat) (cdr mat)) (i 1 (1+ i))) + ((null mat)) + (fortran-print `((mequal) ((,name) ,i) ,(car mat)) stream)))) '$done) ;; Local Modes: From macrakis at alum.mit.edu Thu Feb 23 11:56:39 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 23 Feb 2012 12:56:39 -0500 Subject: [Maxima] Help building a matrix-calculus package In-Reply-To: References: Message-ID: Mike, Robert's general approach works, but the rule itself has a bug. I would suggest something like this: matchdeclare (ncprod, nctimesp); nctimesp (e) := not atom(e) and op(e) = "."; matchdeclare(negint,lambda([x],featurep(x,integer) and x<0)); tellsimp (ncprod^^negint, (map (lambda ([e], e^^-1), reverse(aa) ) ^^ -negint)); The next issue you will encounter is simplifying expressions like (a.b.b)^^2 . (b^^-1 . a^^-1)^^5 . a.b.a Here's a simple way to do that: ncexpandsimp(ex):= block([dotexptsimp:true], expand(block([dotexptsimp:false],expand(ex))))$ ncexpandsimp( (a.b.b)^^2 . (b^^-1 . a^^-1)^^5 . a.b.a ) => a . b^^2 . a . b . (a^^(-1) . b^^(-1))^^3 Of course, there is more than one way to write some expressions, so for example ncexpandsimp((a.b.a)^^2 . b) => a.b.a.(a.b)^^2 which may not be what you want. If you want to handle symbolic exponents, e.g. (a.b.a)^^k . a^^-1 => (a.b.a)^^(k-1).a.b, you'll need to write additional simplification rules. -s On Thu, Feb 23, 2012 at 10:57, Robert Dodier wrote: > On 2/22/12, Mike Valenzuela wrote: > > > (A_1 . A_2 ... A_n)^^-1 = A_n^^-1 ... A_2^^-1 . A_1^^-1 > > matchdeclare (aa, nctimesp); > nctimesp (e) := not atom(e) and op(e) = "."; > matchdeclare (xx, all); > tellsimp (aa^^xx, map (lambda ([e], e^^xx), aa)); > > (a . b . c)^^-1; > => a^^(-1) . b^^(-1) . c^^(-1) > > > Also, there are some recursive rules (a recursive rule for just 2 > > elements could work for the above problem), which may work well using > > tellsimp, but I don't know. > > At present, Maxima's pattern matcher can't deduce rules for > n-ary operators from a pattern with just two operands of the same type. > It would be useful and interesting to do that or other kinds of > deductions based on properties of the operator (commutative, etc). > It would be some work (I can do it) but not really a big job, so if you're > interested, let's talk it over. > > > partial( g(U) ) / partial(X_ij) = Trace( transpose(partial g(U) / > > partial U) . partial U / partial X_ij), > > Dunno, didn't try this one yet. > > > partial ( transpose(X) . B . X ) / partial (X_ij) = transpose(X) . B . > > single_entry_matrix(i,j) + single_entry_matrix(j,i) . B . X, > > where the single_entry_matrix size is determined by the expression (in > > this case, it is the same size as transpose(X) . B . X) > > Let E = single_entry_matrix. (I didn't try to write this function.) > > matchdeclare ([xx, bb], nonscalarp); > matchdeclare ([ii, jj], all); > /* let built-in simplifier act on diff(transpose(xx) ...), > * then construct new rule for simplified expression > */ > 'diff (transpose (xx) . bb . xx, xx [ii, jj]); > tellsimpafter (''%, transpose(xx) . bb . E(ii, jj) + E(jj, ii) . bb . xx); > > declare ([X, B], nonscalar); > diff (transpose (X) . B . X, X[i, j]); > => 0 > 'diff (transpose (X) . B . X, X[i, j]); > => transpose(X) . B . E(i, j) + E(j, i) . B . X > > There are various confusing details here (sorry). > Would it work as well without the nonscalarp test? Maybe. > Why is diff(...) different from 'diff(...) ? The rule was written for the > noun expression 'diff(...), it doesn't match diff(...); maybe it should. > > > Is there some way to define a variable as a row or column vector? It > > would be useful for expressions like: > > partial transpose( b ) . transpose(X) . X . c / partial X = X( b . > > transpose(c) + c . transpose(b) ), > > specifically I need to know that b and c are column vectors for the > > above identity to work. > > Well, a conventional way would be to represent them as matrices > with 1 row or 1 column. That's not entirely satisfactory from an > algebraic point of view ... I don't like conflating different types of > objects for mere convenience. > > A more principled approach is to define a vector type and make it > possible to have symbolic vectors (e.g. declare(x, vector)) in addition > to literal vectors (e.g. x : vector(a, b, c)). I don't know if someone has > already done so; several matrix/vector packages have been written > over the years, maybe one of them has that stuff. > > > How can I tell Maxima to "Rotate" matrices inside a trace? > > Tr( A . B . C . single_entry_matrix(i, j) . D . E) = Tr( D . E . A . B > > . C . single_entry_matrix(i, j) ) = the ith, jth index of ( D . E . A > > . B . C ) > > I don't see an obvious way to do it. Certainly it can be done in a > messy way, but I don't see a neat way to do it. > > > Thanks in advance for any advice. I know this is a very ambitious > > undertaking since the first two chapters contain about 100 identities. > > I suspect at least some can be re-derived using the chain rule and > > some of the basic rules. Again, I am not sure how best to go about > > building a package to really help me out. > > Well, I think the way to go about this is to write out the list of > identities you want, then implement as many of them as you can, > maybe reusing bits from existing share packages and maybe > punting to built-in rules sometimes. (Note that I'm specifically > recommending that you make your list first and review existing > packages afterwards.) > > I would be happy to help write rules and I'm willing to consider > extensions to the pattern matching code. > > all the best > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mickle.mouse at gmail.com Thu Feb 23 14:14:37 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Thu, 23 Feb 2012 13:14:37 -0700 Subject: [Maxima] Help building a matrix-calculus package In-Reply-To: References: Message-ID: Thank you Stavros, Richard, and Barton, I think I may create either a Google doc or a drop-box project enumerating the rules I wish to implement, a link to the publicly available book "Matrix Cookbook (2008 ed.)", and a code file (dropbox has a version control system). I will then make it freely available to everyone who would want to help contribute. I typically have more time available for this at night (but I might be able to convince my academic adviser that this project would aid my research), so this may not be up for another day or so. Also, since I am a graduate student, I believe I might as well poll my university's math department to see if anyone there knows about Maxima and would be interested in helping (they may be able to publish a paper discussing the package). I believe it would be invaluable to have one or more experts generate test-cases / test-problems. One side note - I believe it ought to be possible to enter the matix calculus chain rule, even if it is not entered recursively, because Maxima appears to have a chain rule for traditional calculus. I don't know how it is implemented, but the matrix calculus chain rule is very similar and should be able to reuse much of the same logic. Once again, thank you all. On Thu, Feb 23, 2012 at 10:56 AM, Stavros Macrakis wrote: > Mike, > > Robert's general approach works, but the rule itself has a bug. > > I would suggest something like this: > > matchdeclare (ncprod, nctimesp); > nctimesp (e) := not atom(e) and op(e) = "."; > matchdeclare(negint,lambda([x],featurep(x,integer) and x<0)); > tellsimp (ncprod^^negint, (map (lambda ([e], e^^-1), reverse(aa) ) ^^ > -negint)); > > The next issue you will encounter is simplifying expressions like > > (a.b.b)^^2 . (b^^-1 . a^^-1)^^5 . a.b.a > > Here's a simple way to do that: > > ncexpandsimp(ex):= > block([dotexptsimp:true], > expand(block([dotexptsimp:false],expand(ex))))$ > > ncexpandsimp( (a.b.b)^^2 . (b^^-1 . a^^-1)^^5 . a.b.a ) => > a . b^^2 . a . b . (a^^(-1) . b^^(-1))^^3 > > Of course, there is more than one way to write some expressions, so for > example > > ncexpandsimp((a.b.a)^^2 . b) => a.b.a.(a.b)^^2 > > which may not be what you want. > > If you want to handle symbolic exponents, e.g. (a.b.a)^^k . a^^-1 => > (a.b.a)^^(k-1).a.b, you'll need to write additional simplification rules. > > -s > > > On Thu, Feb 23, 2012 at 10:57, Robert Dodier wrote: > >> On 2/22/12, Mike Valenzuela wrote: >> >> > (A_1 . A_2 ... A_n)^^-1 = A_n^^-1 ... A_2^^-1 . A_1^^-1 >> >> matchdeclare (aa, nctimesp); >> nctimesp (e) := not atom(e) and op(e) = "."; >> matchdeclare (xx, all); >> tellsimp (aa^^xx, map (lambda ([e], e^^xx), aa)); >> >> (a . b . c)^^-1; >> => a^^(-1) . b^^(-1) . c^^(-1) >> >> > Also, there are some recursive rules (a recursive rule for just 2 >> > elements could work for the above problem), which may work well using >> > tellsimp, but I don't know. >> >> At present, Maxima's pattern matcher can't deduce rules for >> n-ary operators from a pattern with just two operands of the same type. >> It would be useful and interesting to do that or other kinds of >> deductions based on properties of the operator (commutative, etc). >> It would be some work (I can do it) but not really a big job, so if you're >> interested, let's talk it over. >> >> > partial( g(U) ) / partial(X_ij) = Trace( transpose(partial g(U) / >> > partial U) . partial U / partial X_ij), >> >> Dunno, didn't try this one yet. >> >> > partial ( transpose(X) . B . X ) / partial (X_ij) = transpose(X) . B . >> > single_entry_matrix(i,j) + single_entry_matrix(j,i) . B . X, >> > where the single_entry_matrix size is determined by the expression (in >> > this case, it is the same size as transpose(X) . B . X) >> >> Let E = single_entry_matrix. (I didn't try to write this function.) >> >> matchdeclare ([xx, bb], nonscalarp); >> matchdeclare ([ii, jj], all); >> /* let built-in simplifier act on diff(transpose(xx) ...), >> * then construct new rule for simplified expression >> */ >> 'diff (transpose (xx) . bb . xx, xx [ii, jj]); >> tellsimpafter (''%, transpose(xx) . bb . E(ii, jj) + E(jj, ii) . bb . xx); >> >> declare ([X, B], nonscalar); >> diff (transpose (X) . B . X, X[i, j]); >> => 0 >> 'diff (transpose (X) . B . X, X[i, j]); >> => transpose(X) . B . E(i, j) + E(j, i) . B . X >> >> There are various confusing details here (sorry). >> Would it work as well without the nonscalarp test? Maybe. >> Why is diff(...) different from 'diff(...) ? The rule was written for the >> noun expression 'diff(...), it doesn't match diff(...); maybe it should. >> >> > Is there some way to define a variable as a row or column vector? It >> > would be useful for expressions like: >> > partial transpose( b ) . transpose(X) . X . c / partial X = X( b . >> > transpose(c) + c . transpose(b) ), >> > specifically I need to know that b and c are column vectors for the >> > above identity to work. >> >> Well, a conventional way would be to represent them as matrices >> with 1 row or 1 column. That's not entirely satisfactory from an >> algebraic point of view ... I don't like conflating different types of >> objects for mere convenience. >> >> A more principled approach is to define a vector type and make it >> possible to have symbolic vectors (e.g. declare(x, vector)) in addition >> to literal vectors (e.g. x : vector(a, b, c)). I don't know if someone has >> already done so; several matrix/vector packages have been written >> over the years, maybe one of them has that stuff. >> >> > How can I tell Maxima to "Rotate" matrices inside a trace? >> > Tr( A . B . C . single_entry_matrix(i, j) . D . E) = Tr( D . E . A . B >> > . C . single_entry_matrix(i, j) ) = the ith, jth index of ( D . E . A >> > . B . C ) >> >> I don't see an obvious way to do it. Certainly it can be done in a >> messy way, but I don't see a neat way to do it. >> >> > Thanks in advance for any advice. I know this is a very ambitious >> > undertaking since the first two chapters contain about 100 identities. >> > I suspect at least some can be re-derived using the chain rule and >> > some of the basic rules. Again, I am not sure how best to go about >> > building a package to really help me out. >> >> Well, I think the way to go about this is to write out the list of >> identities you want, then implement as many of them as you can, >> maybe reusing bits from existing share packages and maybe >> punting to built-in rules sometimes. (Note that I'm specifically >> recommending that you make your list first and review existing >> packages afterwards.) >> >> I would be happy to help write rules and I'm willing to consider >> extensions to the pattern matching code. >> >> all the best >> >> Robert Dodier >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mickle.mouse at gmail.com Thu Feb 23 14:20:19 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Thu, 23 Feb 2012 13:20:19 -0700 Subject: [Maxima] Help building a matrix-calculus package In-Reply-To: References: Message-ID: Oh and also a thank you to Robert (sorry, I missed your name in my original thank you list, it was an accident) On Thu, Feb 23, 2012 at 1:14 PM, Mike Valenzuela wrote: > Thank you Stavros, Richard, and Barton, > > I think I may create either a Google doc or a drop-box project enumerating > the rules I wish to implement, a link to the publicly available book > "Matrix Cookbook (2008 ed.)", and a code file (dropbox has a version > control system). I will then make it freely available to everyone who would > want to help contribute. I typically have more time available for this at > night (but I might be able to convince my academic adviser that this > project would aid my research), so this may not be up for another day or so. > > Also, since I am a graduate student, I believe I might as well poll my > university's math department to see if anyone there knows about Maxima and > would be interested in helping (they may be able to publish a paper > discussing the package). I believe it would be invaluable to have one or > more experts generate test-cases / test-problems. > > One side note - I believe it ought to be possible to enter the matix > calculus chain rule, even if it is not entered recursively, because Maxima > appears to have a chain rule for traditional calculus. I don't know how it > is implemented, but the matrix calculus chain rule is very similar and > should be able to reuse much of the same logic. > > Once again, thank you all. > > On Thu, Feb 23, 2012 at 10:56 AM, Stavros Macrakis wrote: > >> Mike, >> >> Robert's general approach works, but the rule itself has a bug. >> >> I would suggest something like this: >> >> matchdeclare (ncprod, nctimesp); >> nctimesp (e) := not atom(e) and op(e) = "."; >> matchdeclare(negint,lambda([x],featurep(x,integer) and x<0)); >> tellsimp (ncprod^^negint, (map (lambda ([e], e^^-1), reverse(aa) ) ^^ >> -negint)); >> >> The next issue you will encounter is simplifying expressions like >> >> (a.b.b)^^2 . (b^^-1 . a^^-1)^^5 . a.b.a >> >> Here's a simple way to do that: >> >> ncexpandsimp(ex):= >> block([dotexptsimp:true], >> expand(block([dotexptsimp:false],expand(ex))))$ >> >> ncexpandsimp( (a.b.b)^^2 . (b^^-1 . a^^-1)^^5 . a.b.a ) => >> a . b^^2 . a . b . (a^^(-1) . b^^(-1))^^3 >> >> Of course, there is more than one way to write some expressions, so for >> example >> >> ncexpandsimp((a.b.a)^^2 . b) => a.b.a.(a.b)^^2 >> >> which may not be what you want. >> >> If you want to handle symbolic exponents, e.g. (a.b.a)^^k . a^^-1 => >> (a.b.a)^^(k-1).a.b, you'll need to write additional simplification rules. >> >> -s >> >> >> On Thu, Feb 23, 2012 at 10:57, Robert Dodier wrote: >> >>> On 2/22/12, Mike Valenzuela wrote: >>> >>> > (A_1 . A_2 ... A_n)^^-1 = A_n^^-1 ... A_2^^-1 . A_1^^-1 >>> >>> matchdeclare (aa, nctimesp); >>> nctimesp (e) := not atom(e) and op(e) = "."; >>> matchdeclare (xx, all); >>> tellsimp (aa^^xx, map (lambda ([e], e^^xx), aa)); >>> >>> (a . b . c)^^-1; >>> => a^^(-1) . b^^(-1) . c^^(-1) >>> >>> > Also, there are some recursive rules (a recursive rule for just 2 >>> > elements could work for the above problem), which may work well using >>> > tellsimp, but I don't know. >>> >>> At present, Maxima's pattern matcher can't deduce rules for >>> n-ary operators from a pattern with just two operands of the same type. >>> It would be useful and interesting to do that or other kinds of >>> deductions based on properties of the operator (commutative, etc). >>> It would be some work (I can do it) but not really a big job, so if >>> you're >>> interested, let's talk it over. >>> >>> > partial( g(U) ) / partial(X_ij) = Trace( transpose(partial g(U) / >>> > partial U) . partial U / partial X_ij), >>> >>> Dunno, didn't try this one yet. >>> >>> > partial ( transpose(X) . B . X ) / partial (X_ij) = transpose(X) . B . >>> > single_entry_matrix(i,j) + single_entry_matrix(j,i) . B . X, >>> > where the single_entry_matrix size is determined by the expression (in >>> > this case, it is the same size as transpose(X) . B . X) >>> >>> Let E = single_entry_matrix. (I didn't try to write this function.) >>> >>> matchdeclare ([xx, bb], nonscalarp); >>> matchdeclare ([ii, jj], all); >>> /* let built-in simplifier act on diff(transpose(xx) ...), >>> * then construct new rule for simplified expression >>> */ >>> 'diff (transpose (xx) . bb . xx, xx [ii, jj]); >>> tellsimpafter (''%, transpose(xx) . bb . E(ii, jj) + E(jj, ii) . bb . >>> xx); >>> >>> declare ([X, B], nonscalar); >>> diff (transpose (X) . B . X, X[i, j]); >>> => 0 >>> 'diff (transpose (X) . B . X, X[i, j]); >>> => transpose(X) . B . E(i, j) + E(j, i) . B . X >>> >>> There are various confusing details here (sorry). >>> Would it work as well without the nonscalarp test? Maybe. >>> Why is diff(...) different from 'diff(...) ? The rule was written for the >>> noun expression 'diff(...), it doesn't match diff(...); maybe it should. >>> >>> > Is there some way to define a variable as a row or column vector? It >>> > would be useful for expressions like: >>> > partial transpose( b ) . transpose(X) . X . c / partial X = X( b . >>> > transpose(c) + c . transpose(b) ), >>> > specifically I need to know that b and c are column vectors for the >>> > above identity to work. >>> >>> Well, a conventional way would be to represent them as matrices >>> with 1 row or 1 column. That's not entirely satisfactory from an >>> algebraic point of view ... I don't like conflating different types of >>> objects for mere convenience. >>> >>> A more principled approach is to define a vector type and make it >>> possible to have symbolic vectors (e.g. declare(x, vector)) in addition >>> to literal vectors (e.g. x : vector(a, b, c)). I don't know if someone >>> has >>> already done so; several matrix/vector packages have been written >>> over the years, maybe one of them has that stuff. >>> >>> > How can I tell Maxima to "Rotate" matrices inside a trace? >>> > Tr( A . B . C . single_entry_matrix(i, j) . D . E) = Tr( D . E . A . B >>> > . C . single_entry_matrix(i, j) ) = the ith, jth index of ( D . E . A >>> > . B . C ) >>> >>> I don't see an obvious way to do it. Certainly it can be done in a >>> messy way, but I don't see a neat way to do it. >>> >>> > Thanks in advance for any advice. I know this is a very ambitious >>> > undertaking since the first two chapters contain about 100 identities. >>> > I suspect at least some can be re-derived using the chain rule and >>> > some of the basic rules. Again, I am not sure how best to go about >>> > building a package to really help me out. >>> >>> Well, I think the way to go about this is to write out the list of >>> identities you want, then implement as many of them as you can, >>> maybe reusing bits from existing share packages and maybe >>> punting to built-in rules sometimes. (Note that I'm specifically >>> recommending that you make your list first and review existing >>> packages afterwards.) >>> >>> I would be happy to help write rules and I'm willing to consider >>> extensions to the pattern matching code. >>> >>> all the best >>> >>> Robert Dodier >>> _______________________________________________ >>> Maxima mailing list >>> Maxima at math.utexas.edu >>> http://www.math.utexas.edu/mailman/listinfo/maxima >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mickle.mouse at gmail.com Thu Feb 23 17:56:57 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Thu, 23 Feb 2012 16:56:57 -0700 Subject: [Maxima] Help building a matrix-calculus package In-Reply-To: References: Message-ID: So I decided to start setting up a drop. For now this box is tied to my email address (but I suppose we can change at any point in time, I really don't care and don't use drop box for anything else yet). I can send an invite to share the project folder with anyone that is interested. On Thu, Feb 23, 2012 at 1:20 PM, Mike Valenzuela wrote: > Oh and also a thank you to Robert (sorry, I missed your name in my > original thank you list, it was an accident) > > On Thu, Feb 23, 2012 at 1:14 PM, Mike Valenzuela wrote: > >> Thank you Stavros, Richard, and Barton, >> >> I think I may create either a Google doc or a drop-box project >> enumerating the rules I wish to implement, a link to the publicly available >> book "Matrix Cookbook (2008 ed.)", and a code file (dropbox has a version >> control system). I will then make it freely available to everyone who would >> want to help contribute. I typically have more time available for this at >> night (but I might be able to convince my academic adviser that this >> project would aid my research), so this may not be up for another day or so. >> >> Also, since I am a graduate student, I believe I might as well poll my >> university's math department to see if anyone there knows about Maxima and >> would be interested in helping (they may be able to publish a paper >> discussing the package). I believe it would be invaluable to have one or >> more experts generate test-cases / test-problems. >> >> One side note - I believe it ought to be possible to enter the matix >> calculus chain rule, even if it is not entered recursively, because Maxima >> appears to have a chain rule for traditional calculus. I don't know how it >> is implemented, but the matrix calculus chain rule is very similar and >> should be able to reuse much of the same logic. >> >> Once again, thank you all. >> >> On Thu, Feb 23, 2012 at 10:56 AM, Stavros Macrakis > > wrote: >> >>> Mike, >>> >>> Robert's general approach works, but the rule itself has a bug. >>> >>> I would suggest something like this: >>> >>> matchdeclare (ncprod, nctimesp); >>> nctimesp (e) := not atom(e) and op(e) = "."; >>> matchdeclare(negint,lambda([x],featurep(x,integer) and x<0)); >>> tellsimp (ncprod^^negint, (map (lambda ([e], e^^-1), reverse(aa) ) ^^ >>> -negint)); >>> >>> The next issue you will encounter is simplifying expressions like >>> >>> (a.b.b)^^2 . (b^^-1 . a^^-1)^^5 . a.b.a >>> >>> Here's a simple way to do that: >>> >>> ncexpandsimp(ex):= >>> block([dotexptsimp:true], >>> expand(block([dotexptsimp:false],expand(ex))))$ >>> >>> ncexpandsimp( (a.b.b)^^2 . (b^^-1 . a^^-1)^^5 . a.b.a ) => >>> a . b^^2 . a . b . (a^^(-1) . b^^(-1))^^3 >>> >>> Of course, there is more than one way to write some expressions, so for >>> example >>> >>> ncexpandsimp((a.b.a)^^2 . b) => a.b.a.(a.b)^^2 >>> >>> which may not be what you want. >>> >>> If you want to handle symbolic exponents, e.g. (a.b.a)^^k . a^^-1 => >>> (a.b.a)^^(k-1).a.b, you'll need to write additional simplification rules. >>> >>> -s >>> >>> >>> On Thu, Feb 23, 2012 at 10:57, Robert Dodier wrote: >>> >>>> On 2/22/12, Mike Valenzuela wrote: >>>> >>>> > (A_1 . A_2 ... A_n)^^-1 = A_n^^-1 ... A_2^^-1 . A_1^^-1 >>>> >>>> matchdeclare (aa, nctimesp); >>>> nctimesp (e) := not atom(e) and op(e) = "."; >>>> matchdeclare (xx, all); >>>> tellsimp (aa^^xx, map (lambda ([e], e^^xx), aa)); >>>> >>>> (a . b . c)^^-1; >>>> => a^^(-1) . b^^(-1) . c^^(-1) >>>> >>>> > Also, there are some recursive rules (a recursive rule for just 2 >>>> > elements could work for the above problem), which may work well using >>>> > tellsimp, but I don't know. >>>> >>>> At present, Maxima's pattern matcher can't deduce rules for >>>> n-ary operators from a pattern with just two operands of the same type. >>>> It would be useful and interesting to do that or other kinds of >>>> deductions based on properties of the operator (commutative, etc). >>>> It would be some work (I can do it) but not really a big job, so if >>>> you're >>>> interested, let's talk it over. >>>> >>>> > partial( g(U) ) / partial(X_ij) = Trace( transpose(partial g(U) / >>>> > partial U) . partial U / partial X_ij), >>>> >>>> Dunno, didn't try this one yet. >>>> >>>> > partial ( transpose(X) . B . X ) / partial (X_ij) = transpose(X) . B . >>>> > single_entry_matrix(i,j) + single_entry_matrix(j,i) . B . X, >>>> > where the single_entry_matrix size is determined by the expression (in >>>> > this case, it is the same size as transpose(X) . B . X) >>>> >>>> Let E = single_entry_matrix. (I didn't try to write this function.) >>>> >>>> matchdeclare ([xx, bb], nonscalarp); >>>> matchdeclare ([ii, jj], all); >>>> /* let built-in simplifier act on diff(transpose(xx) ...), >>>> * then construct new rule for simplified expression >>>> */ >>>> 'diff (transpose (xx) . bb . xx, xx [ii, jj]); >>>> tellsimpafter (''%, transpose(xx) . bb . E(ii, jj) + E(jj, ii) . bb . >>>> xx); >>>> >>>> declare ([X, B], nonscalar); >>>> diff (transpose (X) . B . X, X[i, j]); >>>> => 0 >>>> 'diff (transpose (X) . B . X, X[i, j]); >>>> => transpose(X) . B . E(i, j) + E(j, i) . B . X >>>> >>>> There are various confusing details here (sorry). >>>> Would it work as well without the nonscalarp test? Maybe. >>>> Why is diff(...) different from 'diff(...) ? The rule was written for >>>> the >>>> noun expression 'diff(...), it doesn't match diff(...); maybe it should. >>>> >>>> > Is there some way to define a variable as a row or column vector? It >>>> > would be useful for expressions like: >>>> > partial transpose( b ) . transpose(X) . X . c / partial X = X( b . >>>> > transpose(c) + c . transpose(b) ), >>>> > specifically I need to know that b and c are column vectors for the >>>> > above identity to work. >>>> >>>> Well, a conventional way would be to represent them as matrices >>>> with 1 row or 1 column. That's not entirely satisfactory from an >>>> algebraic point of view ... I don't like conflating different types of >>>> objects for mere convenience. >>>> >>>> A more principled approach is to define a vector type and make it >>>> possible to have symbolic vectors (e.g. declare(x, vector)) in addition >>>> to literal vectors (e.g. x : vector(a, b, c)). I don't know if someone >>>> has >>>> already done so; several matrix/vector packages have been written >>>> over the years, maybe one of them has that stuff. >>>> >>>> > How can I tell Maxima to "Rotate" matrices inside a trace? >>>> > Tr( A . B . C . single_entry_matrix(i, j) . D . E) = Tr( D . E . A . B >>>> > . C . single_entry_matrix(i, j) ) = the ith, jth index of ( D . E . A >>>> > . B . C ) >>>> >>>> I don't see an obvious way to do it. Certainly it can be done in a >>>> messy way, but I don't see a neat way to do it. >>>> >>>> > Thanks in advance for any advice. I know this is a very ambitious >>>> > undertaking since the first two chapters contain about 100 identities. >>>> > I suspect at least some can be re-derived using the chain rule and >>>> > some of the basic rules. Again, I am not sure how best to go about >>>> > building a package to really help me out. >>>> >>>> Well, I think the way to go about this is to write out the list of >>>> identities you want, then implement as many of them as you can, >>>> maybe reusing bits from existing share packages and maybe >>>> punting to built-in rules sometimes. (Note that I'm specifically >>>> recommending that you make your list first and review existing >>>> packages afterwards.) >>>> >>>> I would be happy to help write rules and I'm willing to consider >>>> extensions to the pattern matching code. >>>> >>>> all the best >>>> >>>> Robert Dodier >>>> _______________________________________________ >>>> Maxima mailing list >>>> Maxima at math.utexas.edu >>>> http://www.math.utexas.edu/mailman/listinfo/maxima >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Thu Feb 23 23:55:12 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 23 Feb 2012 22:55:12 -0700 Subject: [Maxima] Help building a matrix-calculus package In-Reply-To: References: Message-ID: On 2/23/12, Stavros Macrakis wrote: > Robert's general approach works, but the rule itself has a bug. Yikes, yeah, that's pretty embarrassing. Let me try to recover. matchdeclare (aa, nctimesp); nctimesp (e) := not atom(e) and op(e) = "."; tellsimp (aa^^-1, map (lambda ([e], e^^-1), reverse (aa))); (a . b . c)^^-1; => c^^(-1) . b^^(-1) . a^^(-1) That's better .... Robert Dodier From mickle.mouse at gmail.com Fri Feb 24 01:31:51 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Fri, 24 Feb 2012 00:31:51 -0700 Subject: [Maxima] Help building a matrix-calculus package In-Reply-To: References: Message-ID: Okay - so I briefly looked for alternatives to dropbox (since it doesn't really provide more advanced management of the project such as forking the project, etc.) and decided to setup a github project: https://github.com/Mickle-Mouse/Maxima-Matrix-Calculus I'm new to it (but it has pretty good step-by-step instructions), but its basically made for this kind of project. Drop box is nice, but its not the most fit tool. This will also allow us to discuss this project further without continuing to spam the entire Maxima mailing list. On Thu, Feb 23, 2012 at 11:26 PM, Robert Dodier wrote: > On 2/23/12, Mike Valenzuela wrote: > > > So I decided to start setting up a drop. For now this box is tied to my > > email address (but I suppose we can change at any point in time, I really > > don't care and don't use drop box for anything else yet). I can send an > > invite to share the project folder with anyone that is interested. > > Hi Mike, I'm interested in having access to the project folder, > if that's OK with you. > > best > > Robert > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert_dodier at yahoo.com Fri Feb 24 12:06:53 2012 From: robert_dodier at yahoo.com (Robert Dodier) Date: Fri, 24 Feb 2012 10:06:53 -0800 (PST) Subject: [Maxima] Fw: SourceForge featured projects Message-ID: <1330106813.29912.YahooMailClassic@web111715.mail.gq1.yahoo.com> Hey gang, looks like Maxima will be a Sourceforge featured project. So I guess we'll get some additional exposure. Should be fun. best Robert Dodier --- On Fri, 2/24/12, Rich Bowen wrote: From: Rich Bowen Subject: SourceForge featured projects To: "Rich Bowen" Cc: "Roberto Galoppini" Date: Friday, February 24, 2012, 9:59 AM Hi, Rich Bowen here from SourceForge. I wanted to let you know that your project will be featured on the SourceForge front page next week. This generally results in a modest increase in traffic to your project, so you might want to take this opportunity to: * Ensure that your project summary page has an icon* Brush up on your project description and summary statement (See?https://sourceforge.net/blog/what-does-it-do/?for tips.)* Make sure that your screen shots, of any, reflect the most recent version of the project. If you have any questions as to how you can improve your project's summary page, or otherwise enhance your brand, please let me know. Also, for those of you who have more than one project on SourceForge, I've included the list of featured projects, so that you know which one I'm talking about, as well as what company you're keeping. ==================== ReactOS: ReactOS is an open source effort to develop a quality operating system that is compatible with applications and drivers written for the Microsoft Windows NT family of operating systems (NT4, 2000, XP, 2003). http://sourceforge.net/projects/reactos LOIC: Low Orbit Ion Cannon.?The project just keeps and maintenances (bug fixing) the code written by the original author - Praetox, but is not associated or related with it.?http://sourceforge.net/projects/loic Maxima -- GPL CAS based on DOE-MACSYMA: Maxima is a fairly complete computer algebra system written in lisp with an emphasis on symbolic computation. It is based on DOE-MACSYMA and licensed under the GPL. ? Its abilities include symbolic integration, 3D plotting, and an ODE solver.?http://sourceforge.net/projects/maxima Network Spoofer: Network Spoofer lets you mess with the internet on other people?s computers from an Android phone. http://sourceforge.net/projects/netspoof PDFedit: Free editor for PDF documents. Complete editing of PDF documents is possible with PDFedit. You can change raw pdf objects (for advanced users) or use many gui functions. Functionality can be easily extended using a scripting language (ECMAScript). http://sourceforge.net/projects/pdfedit Mega Gestor Financeiro: Controle seus gastos pessoais com o Mega Gestor Financeiro. http://sourceforge.net/projects/megagf Biet-O-Matic (Bid-O-Matic): Yet another sniper tool :-) BOM ist a tool to watch and bid on auctions. Many features like mail control, autoconnect/disconnect, integrated ODBC- client, multi-language-support, time sync, item grouping etc. http://sourceforge.net/projects/bom Digital Paint: Paintball 2: Paintball2 is a fast-paced first-person game with capture the flag, elimination, siege, and deathmatch (free-for-all) styles of gameplay. This project focuses on enhancing the Quake2-based engine it uses. http://sourceforge.net/projects/paintball2 iTALC - OpenSource classroom management: iTALC is a free classroom management software which enables teachers to view and control computers in their labs and interact with students. It supports Linux and Windows XP (Vista/7 soon) and it even can be used in mixed environments transparently. http://sourceforge.net/projects/italc -- Rich Bowen ::?rbowen at geek.net :: @rbowen ? ? ?Community Growth Hacker SourceForge.net :: @sourceforge ==== This e- mail message is intended only for the named recipient(s) above. It may contain confidential and privileged information. If you are not the intended recipient you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and delete the message and any attachment(s) from your system. Thank you. From nijso at hotmail.com Sat Feb 25 08:02:00 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Sat, 25 Feb 2012 15:02:00 +0100 Subject: [Maxima] determine if expression is polynomial P(x,y/Q(x,y) Message-ID: Dear all, The problem I am dealing with now is related to my previous question about determining if an expression is polynomial. I now want to determine if an expression is of the form P(x,y)/Q(x,y), where P and Q are bivariate polynomials in x and y. Like my previous problem, it should also accept expressions that contain e.g. sin(x) but then return something meaningful when it is not a polynomial. I think this can be done by putting the expression in CRE form and determine the numerator and denominator using Q:ratdenom(expr) and P:ratnumer(expr). If I call showratvars(Q), will Q then always be a polynomial in x and y if it returns [x,y]? Regards, Nyso -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sat Feb 25 08:25:54 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 25 Feb 2012 06:25:54 -0800 Subject: [Maxima] determine if expression is polynomial P(x,y/Q(x,y) In-Reply-To: References: Message-ID: <4F48EF72.6000906@eecs.berkeley.edu> On 2/25/2012 6:02 AM, nijso beishuizen wrote: > Dear all, > > The problem I am dealing with now is related to my previous question > about determining if an expression is polynomial. I now want to > determine if an expression is of the form P(x,y)/Q(x,y), where P and Q > are bivariate polynomials in x and y. Like my previous problem, it > should also accept expressions that contain e.g. sin(x) but then > return something meaningful when it is not a polynomial. > > I think this can be done by putting the expression in CRE form and > determine the numerator and denominator using Q:ratdenom(expr) and > P:ratnumer(expr). > If I call showratvars(Q), will Q then always be a polynomial in x and > y if it returns [x,y]? > > > Regards, > Nyso > Is sin(x)^2 +cos(x)^2 +x supposed to be a polynomial in x for your purposes? -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Sat Feb 25 09:50:37 2012 From: willisb at unk.edu (Barton Willis) Date: Sat, 25 Feb 2012 09:50:37 -0600 Subject: [Maxima] determine if expression is polynomial P(x,y/Q(x,y) In-Reply-To: References: Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- The problem I am dealing with now is related to my previous question about determining if an expression is polynomial. I now want to determine if an expression is of the form P(x,y)/Q(x,y), where P and Q are bivariate polynomials in x and y. Like my previous problem, it should also accept expressions that contain e.g. sin(x) but then return something meaningful when it is not a polynomial. The boolean valued function polynomialp does a syntactic test for a polynomial. For more information, enter ? polynomialp. To test for a rational expression, try something like: (%i1) rational_expression_p(e,vars) := block([p : ratdenom(e)], polynomialp(p,vars) and polynomialp(e*p,vars))$ (%i2) rational_expression_p((x-y)/(x + y),[x,y]); (%o2) true (%i3) rational_expression_p((x-y*(1-x^2))/(x + 1/y),[x,y]); (%o3) true (%i4) rational_expression_p(1 + 42 * x / y + x^sqrt(3),[x]); (%o4) false If you need something more powerful than a syntactic test, that's another problem. --Barton From macrakis at alum.mit.edu Sat Feb 25 11:34:43 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 25 Feb 2012 12:34:43 -0500 Subject: [Maxima] determine if expression is polynomial P(x,y/Q(x,y) In-Reply-To: References: Message-ID: It is very easy to determine whether an expression is *of the form* P(x,y)/Q(x,y), where P and Q are polynomials in a given list of variables: ratfunp(ex,vars) := polynomialp(num(ex),vars) and polynomialp(denom(ex),vars)$ If you need them, polynomialp has additional arguments that let you specify symbolic parameters etc. so that you can consider (a*x+1)/(b*y-1) a polynomial in variables x and y, with parameters a and b. Other people's solutions test whether an expression *can be written* in the form P(x,y)/Q(x,y) -- a problem which is in the general case unsolvable, but in many practical cases perfectly tractable. But beware of things like trigonometric identities (as RJF says), radicals, etc. -s On Sat, Feb 25, 2012 at 09:02, nijso beishuizen wrote: > Dear all, > > The problem I am dealing with now is related to my previous question about > determining if an expression is polynomial. I now want to determine if an > expression is of the form P(x,y)/Q(x,y), where P and Q are bivariate > polynomials in x and y. Like my previous problem, it should also accept > expressions that contain e.g. sin(x) but then return something meaningful > when it is not a polynomial. > > I think this can be done by putting the expression in CRE form and > determine the numerator and denominator using Q:ratdenom(expr) and > P:ratnumer(expr). > If I call showratvars(Q), will Q then always be a polynomial in x and y if > it returns [x,y]? > > > Regards, > Nyso > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sat Feb 25 11:47:30 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 25 Feb 2012 09:47:30 -0800 Subject: [Maxima] determine if expression is polynomial P(x,y/Q(x,y) In-Reply-To: References: Message-ID: <4F491EB2.6010003@eecs.berkeley.edu> On 2/25/2012 9:34 AM, Stavros Macrakis wrote: > But beware of things like trigonometric identities (as RJF says), > radicals, etc. > > -s > One of my favorite polynomial-producing expressions is along the lines of cos(p*acos(x)). For example, trigexpand(cos(5*acos(x)) is 5*x*(1-x^2)^2+x^5-10*x^3*(1-x^2) = 16*x^5-20*x^3+5*x -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sat Feb 25 12:41:50 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 25 Feb 2012 13:41:50 -0500 Subject: [Maxima] determine if expression is polynomial P(x,y/Q(x,y) In-Reply-To: <4F491EB2.6010003@eecs.berkeley.edu> References: <4F491EB2.6010003@eecs.berkeley.edu> Message-ID: You can often tell if something can be written as a polynomial by seeing if its Taylor series "runs out", e.g. taylor(cos(6*acos(x)),x,0,*100*) => -1+18*x^2-48*x^4+32*x^*6* +... This requires only arithmetic -- no clever simplifications, no pattern-matching, etc. Of course, this doesn't *guarantee* that the 101+th term is zero, but in many 'natural' expressions, it has to be. I wonder if there is some sort of analog to this for univariate rational functions? -s On Sat, Feb 25, 2012 at 12:47, Richard Fateman wrote: > On 2/25/2012 9:34 AM, Stavros Macrakis wrote: > > But beware of things like trigonometric identities (as RJF says), > radicals, etc. > > -s > > One of my favorite polynomial-producing expressions is along the lines > of cos(p*acos(x)). > > For example, trigexpand(cos(5*acos(x)) is > 5*x*(1-x^2)^2+x^5-10*x^3*(1-x^2) = 16*x^5-20*x^3+5*x > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nijso at hotmail.com Sat Feb 25 12:53:58 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Sat, 25 Feb 2012 19:53:58 +0100 Subject: [Maxima] determine if expression is polynomial P(x,y/Q(x,y) In-Reply-To: References: , Message-ID: Thank you for your input. I realize now that it is more difficult than I thought, because some input that could be rewritten to P/Q will not be recognized in my simple algorithms. Anyway, when the expression is already of the form P/Q, then polynomialp will do the trick. I will have to think about the cases where the expression can be rewritten to P/Q and see if there are other properties that I can use to detect (some of) these as well. Date: Sat, 25 Feb 2012 12:34:43 -0500 Subject: Re: [Maxima] determine if expression is polynomial P(x,y/Q(x,y) From: macrakis at alum.mit.edu To: nijso at hotmail.com CC: maxima at math.utexas.edu It is very easy to determine whether an expression is of the form P(x,y)/Q(x,y), where P and Q are polynomials in a given list of variables: ratfunp(ex,vars) := polynomialp(num(ex),vars) and polynomialp(denom(ex),vars)$ If you need them, polynomialp has additional arguments that let you specify symbolic parameters etc. so that you can consider (a*x+1)/(b*y-1) a polynomial in variables x and y, with parameters a and b. Other people's solutions test whether an expression can be written in the form P(x,y)/Q(x,y) -- a problem which is in the general case unsolvable, but in many practical cases perfectly tractable. But beware of things like trigonometric identities (as RJF says), radicals, etc. -s On Sat, Feb 25, 2012 at 09:02, nijso beishuizen wrote: Dear all, The problem I am dealing with now is related to my previous question about determining if an expression is polynomial. I now want to determine if an expression is of the form P(x,y)/Q(x,y), where P and Q are bivariate polynomials in x and y. Like my previous problem, it should also accept expressions that contain e.g. sin(x) but then return something meaningful when it is not a polynomial. I think this can be done by putting the expression in CRE form and determine the numerator and denominator using Q:ratdenom(expr) and P:ratnumer(expr). If I call showratvars(Q), will Q then always be a polynomial in x and y if it returns [x,y]? Regards, Nyso _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From akshaysrinivasan at gmail.com Sun Feb 26 06:49:44 2012 From: akshaysrinivasan at gmail.com (Akshay Srinivasan) Date: Sun, 26 Feb 2012 18:19:44 +0530 Subject: [Maxima] Maxima/Matlisp GSoC 2012 Message-ID: <4F4A2A68.1050305@gmail.com> Hello, I was thinking of applying for the GSoC this year, to work on Maxima/Matlisp. I intend to work on adding better numerical support for Maxima, by integrating parts of the FFI in Matlisp to interface with BLAS/LAPACK, ODEPACK amongst others. Although these can be f2cl-ed, I think having a nice FFI implementation is good nevertheless, since this would allow Maxima (lisp rather) to act like a glue-language (like Python!), while allowing one to do some very interesting things. I know Maxima applied to be an mentoring organisation some time back (and was rejected). Is there any interest to apply for being a mentoring organisation this year ? Can you recommend mentoring organisations to which I can apply to, or else ? I was thinking of Portland state, if they make it this year. There really were very few (if at all!) mentoring organisations in GSoC last year, which supported any work in lisp. Akshay -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sun Feb 26 11:06:34 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 26 Feb 2012 10:06:34 -0700 Subject: [Maxima] Maxima/Matlisp GSoC 2012 In-Reply-To: <4F4A2A68.1050305@gmail.com> References: <4F4A2A68.1050305@gmail.com> Message-ID: Akshay, if you have some ideas you'd like to push, by all means, please go ahead and submit a proposal to GSOC. You can assume that you are in the driver's seat; you don't need to get buy-in from anybody else (such as me). I submitted some proposals to GSOC which didn't get any traction, but maybe your luck will be better. best Robert Dodier From akshaysrinivasan at gmail.com Sun Feb 26 11:21:34 2012 From: akshaysrinivasan at gmail.com (Akshay Srinivasan) Date: Sun, 26 Feb 2012 22:51:34 +0530 Subject: [Maxima] Maxima/Matlisp GSoC 2012 In-Reply-To: References: <4F4A2A68.1050305@gmail.com> Message-ID: <4F4A6A1E.701@gmail.com> I really haven't done any development for Maxima yet, all I've done is some minor work on Matlisp. I think it'd be nicer to work under Maxima as a mentoring organisation than otherwise; but I can imagine that it is unlikely (apparently Sage has been rejected for 5 years in a row). Luck is a wretched thing :) Akshay On 02/26/2012 10:36 PM, Robert Dodier wrote: > Akshay, > > if you have some ideas you'd like to push, by all means, > please go ahead and submit a proposal to GSOC. > You can assume that you are in the driver's seat; you don't > need to get buy-in from anybody else (such as me). > > I submitted some proposals to GSOC which didn't get > any traction, but maybe your luck will be better. > > best > > Robert Dodier -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sun Feb 26 11:52:13 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 26 Feb 2012 09:52:13 -0800 Subject: [Maxima] Maxima/Matlisp GSoC 2012 In-Reply-To: <4F4A6A1E.701@gmail.com> References: <4F4A2A68.1050305@gmail.com> <4F4A6A1E.701@gmail.com> Message-ID: <4F4A714D.50400@eecs.berkeley.edu> On 2/26/2012 9:21 AM, Akshay Srinivasan wrote: > I really haven't done any development for Maxima yet, > all I've done is some minor work on Matlisp. I think it'd be nicer > to work under Maxima as a mentoring organisation > than otherwise; but I can imagine that it is unlikely > (apparently Sage has been rejected for 5 years in a row). > Luck is a wretched thing :) OK, here's on thought then. Suggest your idea to Sage. After all, Sage depends on Maxima. You are going to make Maxima better. They should be happy. If Sage gets to be a mentoring org, they can choose you and some mentor who knows about matlisp, maxima, SBCL, whatever. Or they can take the money and spend it on some high school student writing the 15th version of an interactive math front-end in python. That would be sad. RJF > > Akshay > > On 02/26/2012 10:36 PM, Robert Dodier wrote: >> Akshay, >> >> if you have some ideas you'd like to push, by all means, >> please go ahead and submit a proposal to GSOC. >> You can assume that you are in the driver's seat; you don't >> need to get buy-in from anybody else (such as me). >> >> I submitted some proposals to GSOC which didn't get >> any traction, but maybe your luck will be better. >> >> best >> >> Robert Dodier > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From plch at math.muni.cz Mon Feb 27 09:52:18 2012 From: plch at math.muni.cz (Roman Plch) Date: Mon, 27 Feb 2012 16:52:18 +0100 Subject: [Maxima] biggest integer in Maxima Message-ID: <20120227155218.GB15713@queen.math.muni.cz> Hi, what is the biggest integer we can use in Maxima (on 32 bit systems)? How Maxima store integers? Thanks in advance. Best regards Roman From macrakis at alum.mit.edu Mon Feb 27 10:17:53 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 27 Feb 2012 11:17:53 -0500 Subject: [Maxima] biggest integer in Maxima In-Reply-To: <20120227155218.GB15713@queen.math.muni.cz> References: <20120227155218.GB15713@queen.math.muni.cz> Message-ID: Maxima supports integers of arbitrary size, limited only by machine memory. Of course, some calculations will be slow on large integers: factor(10^100 - 9 ^ 100) => 11*19*31*41*101*181*241*401*761*1321*1901*3701*7541*259001*1912601*3438451*1363017301*48873277451 *875145743369801*4023238425162001 (takes 2.6 secs on my machine -- times go up rapidly with larger numbers) though others will be fast: mod(10^1000000,23456) => 9504 (0.4 sec) Maxima is perfectly happy to calculate (say) 10^1000000, but of course the printout is rather long.... Maxima can also calculate with arbitrary-precision decimals -- though you must specify the precision in advance: fpprec: 200$ <<< set precision to 200 decimal digits bfloat(sqrt(2)) => 1.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727350138462309122970249248360558507372126441214970999358314132226659275055927557999505011527820605715b0 -s On Mon, Feb 27, 2012 at 10:52, Roman Plch wrote: > Hi, > > what is the biggest integer we can use in Maxima (on 32 bit systems)? > How Maxima store integers? > > Thanks in advance. > > Best regards > > Roman > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Mon Feb 27 11:08:42 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 27 Feb 2012 12:08:42 -0500 Subject: [Maxima] biggest integer in Maxima In-Reply-To: <504FEF75-7E93-4230-A84E-F2BEDA3B1344@me.com> References: <20120227155218.GB15713@queen.math.muni.cz> <504FEF75-7E93-4230-A84E-F2BEDA3B1344@me.com> Message-ID: What exactly do you mean by "support"? Maxima certainly can *represent*many kinds of computable numbers as Maxima expressions -- 7, %e+%pi, sum(i^z,i,1,inf), sum(2^-i!,i,1,inf) -- or for that matter by arbitrary Maxima programs. Though there are some limitations. For example, if you try to use the representation 10^10^10, Maxima will run out of memory because it tries to calculate the integer explicitly. But just because you can represent these numbers doesn't mean you can do useful things with them. For example, the order relation on the computable numbers is not computable (see G?del) -- actually it's worse than that (Richardson). So what exactly are the operations you want to support? -s On Mon, Feb 27, 2012 at 11:31, Olivier Drolet wrote: > Does Maxima support Computable Reals? > > > On 2012-02-27, at 11:17 , Stavros Macrakis wrote: > > > Maxima supports integers of arbitrary size, limited only by machine > > memory. Of course, some calculations will be slow on large integers: > > > > factor(10^100 - 9 ^ 100) => > > > 11*19*31*41*101*181*241*401*761*1321*1901*3701*7541*259001*1912601*3438451*1363017301*48873277451 > > *875145743369801*4023238425162001 > > (takes 2.6 secs on my machine -- times go up rapidly with larger numbers) > > > > though others will be fast: > > > > mod(10^1000000,23456) => 9504 (0.4 sec) > > > > Maxima is perfectly happy to calculate (say) 10^1000000, but of course > > the printout is rather long.... > > > > Maxima can also calculate with arbitrary-precision decimals -- though > > you must specify the precision in advance: > > > > fpprec: 200$ <<< set precision to 200 decimal digits > > bfloat(sqrt(2)) => > > > 1.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727350138462309122970249248360558507372126441214970999358314132226659275055927557999505011527820605715b0 > > > > -s > > > > On Mon, Feb 27, 2012 at 10:52, Roman Plch wrote: > >> Hi, > >> > >> what is the biggest integer we can use in Maxima (on 32 bit systems)? > >> How Maxima store integers? > >> > >> Thanks in advance. > >> > >> Best regards > >> > >> Roman > >> _______________________________________________ > >> Maxima mailing list > >> Maxima at math.utexas.edu > >> http://www.math.utexas.edu/mailman/listinfo/maxima > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Mon Feb 27 12:31:32 2012 From: woollett at charter.net (Edwin Woollett) Date: Mon, 27 Feb 2012 10:31:32 -0800 Subject: [Maxima] get name of variable as string in function? Message-ID: <1235CF94D3344E93B3C9A101C95C8315@edwinc367e16bd> On Feb. 2, 2012, Stavros Macrakis wrote: -------------------------- >I suggest you keep things simple and modular: > >/* The worker function */ >mprintx(name,val) := print(sconcat(" ",name," = "),val)$ > >mprint('a,a)$ >[snip] ---------------------------------- How can I get nil to display as false and t to display as true? --------------------------------- (%i1) [a:false,b:true]$ (%i2) mprintx(name,val) := print(sconcat(" ",name," = "),val)$ (%i3) mprintx('a,a); a = nil (%o3) false (%i4) mprintx('b,b); b = t (%o4) true --------------------- Ted From eric.reyssat at unicaen.fr Mon Feb 27 12:39:07 2012 From: eric.reyssat at unicaen.fr (Eric Reyssat) Date: Mon, 27 Feb 2012 19:39:07 +0100 Subject: [Maxima] get name of variable as string in function? In-Reply-To: <1235CF94D3344E93B3C9A101C95C8315@edwinc367e16bd> References: <1235CF94D3344E93B3C9A101C95C8315@edwinc367e16bd> Message-ID: <4F4BCDCB.1020501@unicaen.fr> Le 27/02/2012 19:31, Edwin Woollett a ?crit : > On Feb. 2, 2012, Stavros Macrakis wrote: > -------------------------- >> I suggest you keep things simple and modular: >> >> /* The worker function */ >> mprintx(name,val) := print(sconcat(" ",name," = "),val)$ >> >> mprint('a,a)$ >> [snip] > ---------------------------------- > How can I get nil to display as false and t to > display as true? > > --------------------------------- > (%i1) [a:false,b:true]$ > > (%i2) mprintx(name,val) := print(sconcat(" ",name," = "),val)$ > > (%i3) mprintx('a,a); > a = nil (%o3) false > > (%i4) mprintx('b,b); > b = t (%o4) true --------------------- > Ted > It may depend on the maxima (or lisp ?) version : (%i1) [a:false,b:true]$ (%i2) mprintx(name,val) := print(sconcat(" ",name," = "),val)$ (%i3) mprintx('a,a); a = false (%o3) false (%i4) mprintx('b,b); b = true (%o4) true I have : Maxima version: 5.20.1 Maxima build date: 12:35 1/21/2010 Host type: i686-pc-linux-gnu Lisp implementation type: CLISP Lisp implementation version: 2.47 (2008-10-23) (built 3457458111) (memory 3473062541) Eric > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Mon Feb 27 12:41:24 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 27 Feb 2012 13:41:24 -0500 Subject: [Maxima] get name of variable as string in function? In-Reply-To: <1235CF94D3344E93B3C9A101C95C8315@edwinc367e16bd> References: <1235CF94D3344E93B3C9A101C95C8315@edwinc367e16bd> Message-ID: This is (was?) a bug. It works fine in Maxima 5.25.1 on GCL 2.6.8. What version are you on? -s On Mon, Feb 27, 2012 at 13:31, Edwin Woollett wrote: > On Feb. 2, 2012, Stavros Macrakis wrote: > -------------------------- >> >> I suggest you keep things simple and modular: >> >> /* The worker function */ >> mprintx(name,val) := print(sconcat(" ?",name," = "),val)$ >> >> mprint('a,a)$ >> [snip] > > ---------------------------------- > How can I get nil to display as false and t to > display as true? > > --------------------------------- > (%i1) [a:false,b:true]$ > > (%i2) mprintx(name,val) := print(sconcat(" ?",name," = "),val)$ > > (%i3) mprintx('a,a); > ?a = ?nil (%o3) false > > (%i4) mprintx('b,b); > ?b = ?t (%o4) true ? ? --------------------- > Ted > > From woollett at charter.net Mon Feb 27 12:55:33 2012 From: woollett at charter.net (Edwin Woollett) Date: Mon, 27 Feb 2012 10:55:33 -0800 Subject: [Maxima] get name of variable as string in function? Message-ID: <2491321653A4481EAF615A08568220AE@edwinc367e16bd> On Feb. 27, 2012, Eric Reyssat wrote: ------------------------ >It may depend on the maxima (or lisp ?) version : [snip] -------------- On Feb 27, 2012, Stavros Macrakis wrote: -------------------- >This is (was?) a bug. It works fine in Maxima 5.25.1 on GCL 2.6.8. >What version are you on? ----------------------------------- (%i5) build_info()$ Maxima version: 5.26.0 Maxima build date: 22:48 1/15/2012 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 ------------------------------- Ted P.S. I agree that 5.25.1 gives 'false' instead of 'nil' -------------------- (%i1) [a:false,b:true]$ (%i2) mprintx(name,val) := print(sconcat(" ",name," = "),val)$ (%i3) mprintx('a,a); a = false (%o3) false (%i4) mprintx('b,b); b = true (%o4) true (%i5) build_info()$ Maxima version: 5.25.1 Maxima build date: 10:2 9/6/2011 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 ------------ From woollett at charter.net Mon Feb 27 13:17:24 2012 From: woollett at charter.net (Edwin Woollett) Date: Mon, 27 Feb 2012 11:17:24 -0800 Subject: [Maxima] print ( false ) bug 5.26.0 Message-ID: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> print (false) ----> nil in 5.26.0 print (false) ----> false in 5.25.1 print (true) -----> t in 5.26.0 print (true) ------> true in 5.25.1 --------------------------------- 5.25.1: (%i1) print(false)$ false (%i2) print(true)$ true (%i3) build_info()$ Maxima version: 5.25.1 Maxima build date: 10:2 9/6/2011 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 --------------------------------------- 5.26.0: (%i1) print(false)$ nil (%i2) print(true)$ t (%i3) build_info()$ Maxima version: 5.26.0 Maxima build date: 22:48 1/15/2012 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 ---------------------------------- Ted Woollett From O.Kullmann at swansea.ac.uk Mon Feb 27 14:27:12 2012 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Mon, 27 Feb 2012 20:27:12 +0000 Subject: [Maxima] print ( false ) bug 5.26.0 In-Reply-To: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> References: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> Message-ID: <20120227202712.GA17019@cs-wsok.swan.ac.uk> Hi, I get the same 5.26.0 behaviour under ECL: (%i1) print(false,true); nil t Evaluation took 0.0000 seconds (0.0000 elapsed) (%o1) true (%i2) build_info(); Maxima version: 5.26.0 Maxima build date: 11:7 12/19/2011 Host type: x86_64-unknown-linux-gnu Lisp implementation type: ECL Lisp implementation version: 11.1.1 I guess it is not specified how to print "false" and "true", but the 5.25.1 behaviour seems much more sensible. Oliver On Mon, Feb 27, 2012 at 11:17:24AM -0800, Edwin Woollett wrote: > print (false) ----> nil in 5.26.0 > print (false) ----> false in 5.25.1 > > print (true) -----> t in 5.26.0 > print (true) ------> true in 5.25.1 > > --------------------------------- > 5.25.1: > > (%i1) print(false)$ > > false > (%i2) print(true)$ > > true > (%i3) build_info()$ > > Maxima version: 5.25.1 > Maxima build date: 10:2 9/6/2011 > Host type: i686-pc-mingw32 > Lisp implementation type: GNU Common Lisp (GCL) > Lisp implementation version: GCL 2.6.8 > --------------------------------------- > 5.26.0: > > (%i1) print(false)$ > nil (%i2) print(true)$ > t (%i3) build_info()$ > Maxima version: 5.26.0 > Maxima build date: 22:48 1/15/2012 > Host type: i686-pc-mingw32 > Lisp implementation type: GNU Common Lisp (GCL) > Lisp implementation version: GCL 2.6.8 > > ---------------------------------- > Ted Woollett > From macrakis at alum.mit.edu Mon Feb 27 14:28:58 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 27 Feb 2012 15:28:58 -0500 Subject: [Maxima] print ( false ) bug 5.26.0 In-Reply-To: <20120227202712.GA17019@cs-wsok.swan.ac.uk> References: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> <20120227202712.GA17019@cs-wsok.swan.ac.uk> Message-ID: Edwin, Oliver, Please file a bug report at sourceforge to help us track the bug and its fix. Thanks, -s On Mon, Feb 27, 2012 at 15:27, Oliver Kullmann wrote: > Hi, > > I get the same 5.26.0 behaviour under ECL: > > (%i1) print(false,true); > > nil t > Evaluation took 0.0000 seconds (0.0000 elapsed) > (%o1) true > (%i2) build_info(); > > Maxima version: 5.26.0 > Maxima build date: 11:7 12/19/2011 > Host type: x86_64-unknown-linux-gnu > Lisp implementation type: ECL > Lisp implementation version: 11.1.1 > > > I guess it is not specified how to print "false" and "true", > but the 5.25.1 behaviour seems much more sensible. > > Oliver > > On Mon, Feb 27, 2012 at 11:17:24AM -0800, Edwin Woollett wrote: >> print (false) ?----> nil ? ?in 5.26.0 >> print (false) ?----> false ? in 5.25.1 >> >> print (true) ?-----> t ? in 5.26.0 >> print (true) ------> true ? ?in 5.25.1 >> >> --------------------------------- >> 5.25.1: >> >> (%i1) print(false)$ >> >> false >> (%i2) print(true)$ >> >> true >> (%i3) build_info()$ >> >> Maxima version: 5.25.1 >> Maxima build date: 10:2 9/6/2011 >> Host type: i686-pc-mingw32 >> Lisp implementation type: GNU Common Lisp (GCL) >> Lisp implementation version: GCL 2.6.8 >> --------------------------------------- >> 5.26.0: >> >> (%i1) print(false)$ >> nil (%i2) print(true)$ >> t (%i3) build_info()$ >> Maxima version: 5.26.0 >> Maxima build date: 22:48 1/15/2012 >> Host type: i686-pc-mingw32 >> Lisp implementation type: GNU Common Lisp (GCL) >> Lisp implementation version: GCL 2.6.8 >> >> ---------------------------------- >> Ted Woollett >> > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From mickle.mouse at gmail.com Mon Feb 27 14:29:55 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Mon, 27 Feb 2012 13:29:55 -0700 Subject: [Maxima] Delivery Status Notification (Failure) In-Reply-To: <047d7b343f043f04e404b9ea15c7@google.com> References: <047d7b343f043f04e404b9ea15c7@google.com> Message-ID: So I've put together a github (social coding) project for this matrix calculus project. Anyone that wants to contribute, I suggest you create a free Github account. Github has a very good "getting started" page. I believe it basically consists of: 1) downloading the github software 2) creating an account 3) creating a public and private key (they give you step by step instructions) 4) submitting a pull request or just provide me your username and I'll add you as a collaborator. There is a GUI as well a command line interface (which provides similar syntax to svn) -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Mon Feb 27 16:06:06 2012 From: woollett at charter.net (Edwin Woollett) Date: Mon, 27 Feb 2012 14:06:06 -0800 Subject: [Maxima] bessel_i quadpack bug 5.26.0 Message-ID: <671D050ED8A142CA97A7FC862FD5F1B3@edwinc367e16bd> With 5.26.0 gcl ( and in 5.25.1 gcl) I get quadpack returning a noun form if integer orders are used for the cases: imagpart(bessel_i(odd,%i*x)) and: realpart(bessel_i(even,%i*x)) To get a numerical answer, I need to use float orders, as in imagpart(bessel_i(1.0,%i*x)) This behavior makes it difficult to design a quadpack evaluation of expressions involving bessel functions (ie., implementing "nintegrate"). ---------------------------------------- (%i1) alias(qs,quad_qags); (%o1) [qs] (%i2) qs(imagpart(bessel_i(1,%i*x)),x,1,2); (%o2) qs(-%i*bessel_i(1,%i*x),x,1,2,epsrel = 1.0E-8,epsabs = 0.0,limit = 200) (%i3) qs(imagpart(bessel_i(1.0,%i*x)),x,1,2); (%o3) [0.54130690741673,6.0097139200269267E-15,21,0] (%i4) qs(realpart(bessel_i(2,%i*x)),x,1,2); (%o4) qs(bessel_i(2,%i*x),x,1,2,epsrel = 1.0E-8,epsabs = 0.0,limit = 200) (%i5) qs(realpart(bessel_i(2.0,%i*x)),x,1,2); (%o5) [-0.23269143908339,2.5833939330353786E-15,21,0] (%i6) qs(imagpart(bessel_i(3,%i*x)),x,1,2); (%o6) qs(-%i*bessel_i(3,%i*x),x,1,2,epsrel = 1.0E-8,epsabs = 0.0,limit = 200) (%i7) qs(imagpart(bessel_i(3.0,%i*x)),x,1,2); (%o7) [-0.065445820049256,7.2659456284159177E-16,21,0] (%i8) qs(realpart(bessel_i(4,%i*x)),x,1,2); (%o8) qs(bessel_i(4,%i*x),x,1,2,epsrel = 1.0E-8,epsabs = 0.0,limit = 200) (%i9) qs(realpart(bessel_i(4.0,%i*x)),x,1,2); (%o9) [0.013931648099919,1.5467236491505718E-16,21,0] (%i10) qs(imagpart(bessel_i(5,%i*x)),x,1,2); (%o10) qs(-%i*bessel_i(5,%i*x),x,1,2,epsrel = 1.0E-8,epsabs = 0.0,limit = 200) (%i11) qs(imagpart(bessel_i(5.0,%i*x)),x,1,2); (%o11) [0.0024076583623394,2.6730377493005542E-17,21,0] (%i12) qs(realpart(bessel_i(6,%i*x)),x,1,2); (%o12) qs(bessel_i(6,%i*x),x,1,2,epsrel = 1.0E-8,epsabs = 0.0,limit = 200) (%i13) qs(realpart(bessel_i(6.0,%i*x)),x,1,2); (%o13) [-3.5190404859839462E-4,3.9069197721274786E-18,21,0] (%i14) build_info()$ Maxima version: 5.26.0 Maxima build date: 22:48 1/15/2012 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 ------------------------------------------- Ted Woollett From toy.raymond at gmail.com Mon Feb 27 16:44:15 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 27 Feb 2012 14:44:15 -0800 Subject: [Maxima] print ( false ) bug 5.26.0 In-Reply-To: References: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> <20120227202712.GA17019@cs-wsok.swan.ac.uk> Message-ID: FWIW, with sources from today, I get false and true. I don't have 5.26.0 handy to test there. Ray On Mon, Feb 27, 2012 at 12:28 PM, Stavros Macrakis wrote: > Edwin, Oliver, > > Please file a bug report at sourceforge to help us track the bug and its > fix. > > Thanks, > > -s > > On Mon, Feb 27, 2012 at 15:27, Oliver Kullmann > wrote: > > Hi, > > > > I get the same 5.26.0 behaviour under ECL: > > > > (%i1) print(false,true); > > > > nil t > > Evaluation took 0.0000 seconds (0.0000 elapsed) > > (%o1) true > > (%i2) build_info(); > > > > Maxima version: 5.26.0 > > Maxima build date: 11:7 12/19/2011 > > Host type: x86_64-unknown-linux-gnu > > Lisp implementation type: ECL > > Lisp implementation version: 11.1.1 > > > > > > I guess it is not specified how to print "false" and "true", > > but the 5.25.1 behaviour seems much more sensible. > > > > Oliver > > > > On Mon, Feb 27, 2012 at 11:17:24AM -0800, Edwin Woollett wrote: > >> print (false) ----> nil in 5.26.0 > >> print (false) ----> false in 5.25.1 > >> > >> print (true) -----> t in 5.26.0 > >> print (true) ------> true in 5.25.1 > >> > >> --------------------------------- > >> 5.25.1: > >> > >> (%i1) print(false)$ > >> > >> false > >> (%i2) print(true)$ > >> > >> true > >> (%i3) build_info()$ > >> > >> Maxima version: 5.25.1 > >> Maxima build date: 10:2 9/6/2011 > >> Host type: i686-pc-mingw32 > >> Lisp implementation type: GNU Common Lisp (GCL) > >> Lisp implementation version: GCL 2.6.8 > >> --------------------------------------- > >> 5.26.0: > >> > >> (%i1) print(false)$ > >> nil (%i2) print(true)$ > >> t (%i3) build_info()$ > >> Maxima version: 5.26.0 > >> Maxima build date: 22:48 1/15/2012 > >> Host type: i686-pc-mingw32 > >> Lisp implementation type: GNU Common Lisp (GCL) > >> Lisp implementation version: GCL 2.6.8 > >> > >> ---------------------------------- > >> Ted Woollett > >> > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Mon Feb 27 18:48:41 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 27 Feb 2012 17:48:41 -0700 Subject: [Maxima] print ( false ) bug 5.26.0 In-Reply-To: References: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> <20120227202712.GA17019@cs-wsok.swan.ac.uk> Message-ID: I tried it w/ 5.26.0 + Clisp on Linux; prints true and false as expected. HTH Robert Dodier From O.Kullmann at swansea.ac.uk Mon Feb 27 19:13:03 2012 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Tue, 28 Feb 2012 01:13:03 +0000 Subject: [Maxima] print ( false ) bug 5.26.0 In-Reply-To: References: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> <20120227202712.GA17019@cs-wsok.swan.ac.uk> Message-ID: <20120228011303.GA18715@cs-wsok.swan.ac.uk> Also with Clisp on Linux I get "nil" resp. "t": (%i1) print(false,true); nil t (%o1) true (%i2) build_info(); Maxima version: 5.26.0 Maxima build date: 0:53 2/28/2012 Host type: x86_64-unknown-linux-gnu Lisp implementation type: CLISP Lisp implementation version: 2.49 (2010-07-07) (built 3509374691) (memory 3539379203) This is all with the original 5.26.0. Oliver P.S. It would be good if build_info() would print the Git SHA1-ID. On Mon, Feb 27, 2012 at 05:48:41PM -0700, Robert Dodier wrote: > I tried it w/ 5.26.0 + Clisp on Linux; prints true and false as expected. > > HTH > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- Dr. Oliver Kullmann Department of Computer Science College of Science, Swansea University Faraday Building, Singleton Park Swansea SA2 8PP, UK http://cs.swan.ac.uk/~csoliver/ From tomdean at speakeasy.org Mon Feb 27 19:55:20 2012 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Mon, 27 Feb 2012 17:55:20 -0800 Subject: [Maxima] print ( false ) bug 5.26.0 In-Reply-To: References: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> <20120227202712.GA17019@cs-wsok.swan.ac.uk> Message-ID: <4F4C3408.7040106@speakeasy.org> On 02/27/12 16:48, Robert Dodier wrote: > I tried it w/ 5.26.0 + Clisp on Linux; prints true and false as expected. > > HTH > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > Maxima 5.26.0 http://maxima.sourceforge.net using Lisp CLISP 2.49 (2010-07-07) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) print(true); true (%o1) true (%i2) print(false); false (%o2) false (%i3) Tom Dean From trimtab at me.com Mon Feb 27 10:31:12 2012 From: trimtab at me.com (Olivier Drolet) Date: Mon, 27 Feb 2012 11:31:12 -0500 Subject: [Maxima] biggest integer in Maxima In-Reply-To: References: <20120227155218.GB15713@queen.math.muni.cz> Message-ID: <504FEF75-7E93-4230-A84E-F2BEDA3B1344@me.com> Does Maxima support Computable Reals? On 2012-02-27, at 11:17 , Stavros Macrakis wrote: > Maxima supports integers of arbitrary size, limited only by machine > memory. Of course, some calculations will be slow on large integers: > > factor(10^100 - 9 ^ 100) => > 11*19*31*41*101*181*241*401*761*1321*1901*3701*7541*259001*1912601*3438451*1363017301*48873277451 > *875145743369801*4023238425162001 > (takes 2.6 secs on my machine -- times go up rapidly with larger numbers) > > though others will be fast: > > mod(10^1000000,23456) => 9504 (0.4 sec) > > Maxima is perfectly happy to calculate (say) 10^1000000, but of course > the printout is rather long.... > > Maxima can also calculate with arbitrary-precision decimals -- though > you must specify the precision in advance: > > fpprec: 200$ <<< set precision to 200 decimal digits > bfloat(sqrt(2)) => > 1.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727350138462309122970249248360558507372126441214970999358314132226659275055927557999505011527820605715b0 > > -s > > On Mon, Feb 27, 2012 at 10:52, Roman Plch wrote: >> Hi, >> >> what is the biggest integer we can use in Maxima (on 32 bit systems)? >> How Maxima store integers? >> >> Thanks in advance. >> >> Best regards >> >> Roman >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From alexanderk.hansen at gmail.com Mon Feb 27 21:32:27 2012 From: alexanderk.hansen at gmail.com (Alexander Hansen) Date: Mon, 27 Feb 2012 22:32:27 -0500 Subject: [Maxima] print ( false ) bug 5.26.0 In-Reply-To: <4F4C3408.7040106@speakeasy.org> References: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> <20120227202712.GA17019@cs-wsok.swan.ac.uk> <4F4C3408.7040106@speakeasy.org> Message-ID: For maxima-5.26.0 using SBCL-1,0,55 under Mac OS Lion, I get: $ uname -v Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 $ maxima Maxima 5.26.0 http://maxima.sourceforge.net using Lisp SBCL 1.0.55 Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) print(true); true (%o1) true (%i2) print(false); false (%o2) false -- Alexander K. Hansen akh AT finkproject DOT org Fink User Liaison and Documenter From fateman at eecs.berkeley.edu Mon Feb 27 23:06:18 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 27 Feb 2012 21:06:18 -0800 Subject: [Maxima] biggest integer in Maxima In-Reply-To: <504FEF75-7E93-4230-A84E-F2BEDA3B1344@me.com> References: <20120227155218.GB15713@queen.math.muni.cz> <504FEF75-7E93-4230-A84E-F2BEDA3B1344@me.com> Message-ID: <4F4C60CA.7080307@eecs.berkeley.edu> On 2/27/2012 8:31 AM, Olivier Drolet wrote: > Does Maxima support Computable Reals? You mean like http://www.haible.de/bruno/MichaelStoll/reals.html ? You could just read that in to a Maxima system, though it would probably be simpler to just use it from Lisp. It would not play nicely with the usual Maxima data. > > > On 2012-02-27, at 11:17 , Stavros Macrakis wrote: > >> Maxima supports integers of arbitrary size, limited only by machine >> memory. Of course, some calculations will be slow on large integers: >> I suppose that a particular implementation of Common Lisp may have a biggest explicit integer that is less than the machine memory. From robert.dodier at gmail.com Tue Feb 28 00:41:22 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 27 Feb 2012 23:41:22 -0700 Subject: [Maxima] print ( false ) bug 5.26.0 In-Reply-To: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> References: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> Message-ID: On 2/27/12, Edwin Woollett wrote: > print (false) ----> nil in 5.26.0 > print (false) ----> false in 5.25.1 > > print (true) -----> t in 5.26.0 > print (true) ------> true in 5.25.1 I'm guessing you have display2d:false by default. If so, I think the following patch will fix the bug. best, Robert Dodier PS. diff --git a/src/grind.lisp b/src/grind.lisp index de1ee5d..cee89e9 100644 --- a/src/grind.lisp +++ b/src/grind.lisp @@ -297,12 +297,12 @@ (msz nil l r) (do ((nl) (w 0)) ((null (cdr x)) - (setq nl (cons (if (atom (car x)) + (setq nl (cons (if (stringp (car x)) (msz (makestring (car x)) l r) (msize (car x) l r lop rop)) nl)) (cons (+ w (caar nl)) (nreverse nl))) - (setq nl (cons (if (atom (car x)) + (setq nl (cons (if (stringp (car x)) (msz (makestring (car x)) l r) (msize (car x) l r lop rop)) nl) From O.Kullmann at swansea.ac.uk Tue Feb 28 05:21:38 2012 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Tue, 28 Feb 2012 11:21:38 +0000 Subject: [Maxima] print ( false ) bug 5.26.0 In-Reply-To: References: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> Message-ID: <20120228112138.GC18715@cs-wsok.swan.ac.uk> I can confirm that setting the display2d-variable governs the output of true/false: t,nil when false, true,false when true. Thanks for the patch. Oliver P.S. Wouldn't it be reasonable for the function bug_report to show also the values of all such flags? On Mon, Feb 27, 2012 at 11:41:22PM -0700, Robert Dodier wrote: > On 2/27/12, Edwin Woollett wrote: > > > print (false) ----> nil in 5.26.0 > > print (false) ----> false in 5.25.1 > > > > print (true) -----> t in 5.26.0 > > print (true) ------> true in 5.25.1 > > I'm guessing you have display2d:false by default. > If so, I think the following patch will fix the bug. > > best, > > Robert Dodier > > PS. > > diff --git a/src/grind.lisp b/src/grind.lisp > index de1ee5d..cee89e9 100644 > --- a/src/grind.lisp > +++ b/src/grind.lisp > @@ -297,12 +297,12 @@ > (msz nil l r) > (do ((nl) (w 0)) > ((null (cdr x)) > - (setq nl (cons (if (atom (car x)) > + (setq nl (cons (if (stringp (car x)) > (msz (makestring (car x)) l r) > (msize (car x) l r lop rop)) > nl)) > (cons (+ w (caar nl)) (nreverse nl))) > - (setq nl (cons (if (atom (car x)) > + (setq nl (cons (if (stringp (car x)) > (msz (makestring (car x)) l r) > (msize (car x) l r lop rop)) > nl) > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- Dr. Oliver Kullmann Department of Computer Science College of Science, Swansea University Faraday Building, Singleton Park Swansea SA2 8PP, UK http://cs.swan.ac.uk/~csoliver/ From toy.raymond at gmail.com Tue Feb 28 10:44:21 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 28 Feb 2012 08:44:21 -0800 Subject: [Maxima] print ( false ) bug 5.26.0 In-Reply-To: <20120228011303.GA18715@cs-wsok.swan.ac.uk> References: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> <20120227202712.GA17019@cs-wsok.swan.ac.uk> <20120228011303.GA18715@cs-wsok.swan.ac.uk> Message-ID: On Mon, Feb 27, 2012 at 5:13 PM, Oliver Kullmann > P.S. It would be good if build_info() would print the Git SHA1-ID. > > (%i1) build_info(); (%o1) Maxima version: "5.26.0_29_gbb0b0f7_dirty" Maxima build date: "2012-02-27 08:49:56" Host type: "x86_64-unknown-linux-gnu" Lisp implementation type: "CMU Common Lisp" Lisp implementation version: "Snapshot 2012-02 snapshot-2012-02 (20C Unicode)" So the next release will have this. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Feb 28 10:45:56 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 28 Feb 2012 08:45:56 -0800 Subject: [Maxima] print ( false ) bug 5.26.0 In-Reply-To: <20120228112138.GC18715@cs-wsok.swan.ac.uk> References: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> <20120228112138.GC18715@cs-wsok.swan.ac.uk> Message-ID: On Tue, Feb 28, 2012 at 3:21 AM, Oliver Kullmann wrote: > > Oliver > > P.S. Wouldn't it be reasonable for the function > bug_report to show also the values of all such > flags? > > I think that's a good idea. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Tue Feb 28 11:05:51 2012 From: willisb at unk.edu (Barton Willis) Date: Tue, 28 Feb 2012 11:05:51 -0600 Subject: [Maxima] print ( false ) bug 5.26.0 In-Reply-To: References: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> <20120228112138.GC18715@cs-wsok.swan.ac.uk> Message-ID: maxima-bounces at math.utexas.edu wrote on 02/28/2012 10:45:56 AM: > P.S. Wouldn't it be reasonable for the function > bug_report to show also the values of all such > flags? A stupid Maxima trick is to use reset to determine which user options have non-default values. When debugging deep inside a Maxima function, calling reset will print the non-default values of the option variables. It also resets them---that can cause problems as the calculation continues. Possibly the reset code could be modified to display non-default values but not reset them. The other day I couldn't figure out why s exp(log(x)) didn't simplify to x inside the function inte. A call to reset showed that logsimp (forgot about that) was false. --Barton -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Feb 28 12:51:25 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 28 Feb 2012 10:51:25 -0800 Subject: [Maxima] print ( false ) bug 5.26.0 In-Reply-To: References: <12E8C32CA38A4261AFDC7E6595A18B34@edwinc367e16bd> <20120228112138.GC18715@cs-wsok.swan.ac.uk> Message-ID: On Tue, Feb 28, 2012 at 9:05 AM, Barton Willis wrote: > maxima-bounces at math.utexas.edu wrote on 02/28/2012 10:45:56 AM: > > > P.S. Wouldn't it be reasonable for the function > > bug_report to show also the values of all such > > flags? > > A stupid Maxima trick is to use reset to determine which user options have > non-default values. When debugging deep inside a Maxima > function, calling reset will print the non-default values of the option > variables. It also resets them---that can cause problems as the > calculation continues. Possibly the reset code could be modified to > display non-default values but not reset them. > > That's a cute little trick! Shouldn't be too hard to add a new function to list all of the option variables that are changed. Just need to copy reset-do-the-work to a new function and modify it so that it doesn't do the work. :-) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Tue Feb 28 14:08:04 2012 From: woollett at charter.net (Edwin Woollett) Date: Tue, 28 Feb 2012 12:08:04 -0800 Subject: [Maxima] print ( false ) bug 5.26.0 Message-ID: <15DA01F2BADA41D5AE9F9CC88FA19524@edwinc367e16bd> On Feb. 28, 2012, Robert Dodier wrote: >I'm guessing you have display2d:false by default. You are correct and I should have included that default setting (via init file) in my report. On Feb. 28, 2012 Barton Willis wrote >A stupid Maxima trick is to use reset to determine > which user options have non-default values. Thanks for pointing out this use, which might have helped me notice what flags I had set in my init file. -------------------------------------- (%i1) logsimp; (%o1) true (%i2) exp(log(x)); (%o2) x (%i3) logsimp:false$ (%i4) exp(log(x)); (%o4) %e^log(x) (%i5) reset(); (%o1) [logsimp, maxima_userdir, maxima_tempdir, lispdisp, linenum, %, labels, tr-unique, features, ratprint, display2d, _, __] (%i2) exp(log(x)); (%o2) x ------------------------------------------- Ted From macrakis at alum.mit.edu Tue Feb 28 21:28:00 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 28 Feb 2012 22:28:00 -0500 Subject: [Maxima] determine if expression is polynomial P(x,y/Q(x,y) In-Reply-To: References: Message-ID: Can you give some examples of cases that you run into in your work where rat or ratsimp is not sufficient? Perhaps people on this list will have some ideas, or perhaps it will help us think of new functionality for Maxima. -s On Sat, Feb 25, 2012 at 13:53, nijso beishuizen wrote: > Thank you for your input. I realize now that it is more difficult than I > thought, because some input that could be rewritten to P/Q will not be > recognized in my simple algorithms. Anyway, when the expression is already > of the form P/Q, then polynomialp will do the trick. > I will have to think about the cases where the expression can be rewritten > to P/Q and see if there are other properties that I can use to detect (some > of) these as well. > > > > ------------------------------ > Date: Sat, 25 Feb 2012 12:34:43 -0500 > Subject: Re: [Maxima] determine if expression is polynomial P(x,y/Q(x,y) > From: macrakis at alum.mit.edu > To: nijso at hotmail.com > CC: maxima at math.utexas.edu > > > It is very easy to determine whether an expression is *of the form* P(x,y)/Q(x,y), > where P and Q are polynomials in a given list of variables: > > ratfunp(ex,vars) := polynomialp(num(ex),vars) and > polynomialp(denom(ex),vars)$ > > If you need them, polynomialp has additional arguments that let you > specify symbolic parameters etc. so that you can consider (a*x+1)/(b*y-1) a > polynomial in variables x and y, with parameters a and b. > > Other people's solutions test whether an expression *can be written* in > the form P(x,y)/Q(x,y) -- a problem which is in the general case > unsolvable, but in many practical cases perfectly tractable. But beware of > things like trigonometric identities (as RJF says), radicals, etc. > > -s > > On Sat, Feb 25, 2012 at 09:02, nijso beishuizen wrote: > > Dear all, > > The problem I am dealing with now is related to my previous question about > determining if an expression is polynomial. I now want to determine if an > expression is of the form P(x,y)/Q(x,y), where P and Q are bivariate > polynomials in x and y. Like my previous problem, it should also accept > expressions that contain e.g. sin(x) but then return something meaningful > when it is not a polynomial. > > I think this can be done by putting the expression in CRE form and > determine the numerator and denominator using Q:ratdenom(expr) and > P:ratnumer(expr). > If I call showratvars(Q), will Q then always be a polynomial in x and y if > it returns [x,y]? > > > Regards, > Nyso > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Wed Feb 29 11:37:04 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 29 Feb 2012 09:37:04 -0800 Subject: [Maxima] bessel_i quadpack bug 5.26.0 In-Reply-To: References: <671D050ED8A142CA97A7FC862FD5F1B3@edwinc367e16bd> Message-ID: On Tue, Feb 28, 2012 at 1:01 PM, Edwin Woollett wrote: > Thanks for the discussion of what is happening here. > I took a closer look, and it is as I guessed. quad_qags is working with %i*bessel_i(1,%i*x) and numerical evaluation of that gives a complex result with a small imaginary part. The function maybe-realpart returns nil in this case, causing quad_qags to think the integrand is bad. > > I see the small imaginary parts appearing if I print out > a table, but why does this only bother the evaluations > using bessel_i and not the other bessel functions. > This could probably be fixed by changing how bessel_i(1,%i*x) is computed. bessel_i(1,3*%i) has a small real part even though we know it must be purely imaginary. For the other bessel functions at %i*x the result is complex, except bessel_j. For bessel_j, it looks like we are careful and return a purely imaginary result. Or maybe tell maxima that bessel_i(n,%i*x) = bessel_j(n,x). Maxima doesn't seem to know that property. Maybe the simplifier should honor %iargs to do this transformation. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Wed Feb 29 15:38:31 2012 From: woollett at charter.net (Edwin Woollett) Date: Wed, 29 Feb 2012 13:38:31 -0800 Subject: [Maxima] bessel_i quadpack bug 5.26.0 Message-ID: <095E52FF3C734640B305238D2A3DAAF8@edwinc367e16bd> On Feb. 29, 2012, Raymond Toy wrote: ------------------------- >This could probably be fixed by changing how bessel_i(1,%i*x) is computed. >bessel_i(1,3*%i) has a small real part >even though we know it must be >purely imaginary. > >For the other bessel functions at %i*x the result is complex, except >bessel_j. For bessel_j, it looks like we are >careful and return a purely >imaginary result. > >Or maybe tell maxima that bessel_i(n,%i*x) = bessel_j(n,x). Maxima doesn't >seem to know that property. Maybe the >simplifier should honor %iargs to >do this transformation. the relation Mathematica has on page http://functions.wolfram.com/Bessel-TypeFunctions/BesselI/16/01/01/ is bessel_i(nu,%i*z) = (%i*z)^nu * bessel_j(nu,z) / z^nu but I haven't checked this numerically. Ted From woollett at charter.net Wed Feb 29 16:01:06 2012 From: woollett at charter.net (Edwin Woollett) Date: Wed, 29 Feb 2012 14:01:06 -0800 Subject: [Maxima] print ( false ) bug 5.26.0 Message-ID: <67CD97731BF3418E9DEECF025C233819@edwinc367e16bd> On Feb. 27, 2012, Stavros Macrakis wrote: >Please file a bug report at sourceforge to > help us track the bug and its fix. Since Robert Dodier submitted a fix on git 14 hours ago, a bug report is not needed. Ted From toy.raymond at gmail.com Wed Feb 29 17:07:19 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 29 Feb 2012 15:07:19 -0800 Subject: [Maxima] bessel_i quadpack bug 5.26.0 In-Reply-To: <095E52FF3C734640B305238D2A3DAAF8@edwinc367e16bd> References: <095E52FF3C734640B305238D2A3DAAF8@edwinc367e16bd> Message-ID: On Wed, Feb 29, 2012 at 1:38 PM, Edwin Woollett wrote: > On Feb. 29, 2012, Raymond Toy wrote: > ------------------------- > > This could probably be fixed by changing how bessel_i(1,%i*x) is computed. >> bessel_i(1,3*%i) has a small real part >even though we know it must be >> purely imaginary. >> >> For the other bessel functions at %i*x the result is complex, except >> bessel_j. For bessel_j, it looks like we are >careful and return a purely >> imaginary result. >> >> Or maybe tell maxima that bessel_i(n,%i*x) = bessel_j(n,x). Maxima >> doesn't >> seem to know that property. Maybe the >simplifier should honor %iargs to >> do this transformation. >> > > the relation Mathematica has on page > > http://functions.wolfram.com/**Bessel-TypeFunctions/BesselI/**16/01/01/ > > is > > bessel_i(nu,%i*z) = (%i*z)^nu * bessel_j(nu,z) / z^nu > > but I haven't checked this numerically. > > Yes, I was careless in my original email. I have implemented this on my tree and things work as expected. Still need to make bessel_i(n,%i*float) return a purely imaginary result, though. bessel_j apparently already does this. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From wmixon at berry.edu Wed Feb 29 13:47:16 2012 From: wmixon at berry.edu (Mixon, Wilson) Date: Wed, 29 Feb 2012 19:47:16 +0000 Subject: [Maxima] OLS in stats Message-ID: It appears that the simple_linear_regression routine in stats works for n < 345. The following works, but n > 344 results in this message: gamma: overflow in GAMMAFLOAT. load(stats)$ n: 344$ rL : makelist(2*random(3.0), i, 0, n) $ xL : makelist(i, i, 0, n)$ yL :-20+xL+rL$ data: map("[", xL,yL)$ simple_linear_regression(data); From paweld2 at gmail.com Thu Mar 1 05:10:25 2012 From: paweld2 at gmail.com (=?ISO-8859-2?Q?Pawe=B3_Cesar_Sanjuan_Szklarz?=) Date: Thu, 1 Mar 2012 12:10:25 +0100 Subject: [Maxima] Generating octave functions from maxima In-Reply-To: References: Message-ID: Hello. Thank You for the change, I build from source and it works. Pawel Szklarz. 2012/2/23 Robert Dodier : > On 2/8/12, Pawe? Cesar Sanjuan Szklarz wrote: > >> My question is: ?how to generate dq(i) in stand of dq(1,i)?? I am >> using f90mx inside generateOctaveFunction. > > I've committed the following changes to f90mx and fortmx, > so now assignments to a 1-dimensional array are generated > when the argument is a list (which caused an error before). > A matrix is treated the same as before. In particular, no attempt > is made to treat a 1-row or 1-column matrix as 1-dimensional. > > You can apply this patch to your local Maxima installation, > or you can wait for the next release (sometime in April). > > Hope this helps, > > Robert Dodier > > > PS. > $ git diff d3f131579^..d3f131579 > diff --git a/share/contrib/f90.lisp b/share/contrib/f90.lisp > index 6c80b1e..4a0ce80 100644 > --- a/share/contrib/f90.lisp > +++ b/share/contrib/f90.lisp > @@ -90,26 +90,34 @@ > ?;; Takes a name and a matrix and prints a sequence of F90 assignment > ?;; statements of the form > ?;; ?NAME(I,J) = > +;; or, when the second argument is a list, > +;; ?NAME(I) = > > ?(defmfun $f90mx (name mat) > ? (cond ((not (symbolp name)) > - ? ? ? ?(merror "~%First argument to `f90mx' must be a symbol.")) > - ? ? ? ((not ($matrixp mat)) > - ? ? ? ?(merror "Second argument to `f90mx' not a matrix: ~M" mat))) > - ?(do ((mat (cdr mat) (cdr mat)) (i 1 (1+ i))) > - ? ? ?((null mat)) > - ? ?(do ((m (cdar mat) (cdr m)) (j 1 (1+ j))) > - ? ? ? ((null m)) > - ? ? ?(f90-print `((mequal) ((,name) ,i ,j) ,(car m))))) > + ? ? ? ?(merror "f90mx: first argument must be a symbol; found: ~M" name)) > + ? ? ? ((not (or ($matrixp mat) ($listp mat))) > + ? ? ? ?(merror "f90mx: second argument must be a list or matrix; > found: ~M" mat))) > + ?(cond > + ? ?(($matrixp mat) > + ? ? (do ((mat (cdr mat) (cdr mat)) (i 1 (1+ i))) > + ? ? ? ((null mat)) > + ? ? ? (do ((m (cdar mat) (cdr m)) (j 1 (1+ j))) > + ? ? ? ? ((null m)) > + ? ? ? ? (f90-print `((mequal) ((,name) ,i ,j) ,(car m)))))) > + ? ?(($listp mat) > + ? ? (do ((mat (cdr mat) (cdr mat)) (i 1 (1+ i))) > + ? ? ? ((null mat)) > + ? ? ? (f90-print `((mequal) ((,name) ,i) ,(car mat)))))) > ? '$done) > > ?(defmspec $f90 (expr) > ? (dolist (l (cdr expr)) > ? (let ((value (strmeval l))) > ? ? (cond ((msetqp l) (setq value `((mequal) ,(cadr l) ,(meval l))))) > - ? ?(cond ((and (symbolp l) ($matrixp value)) > + ? ?(cond ((and (symbolp l) (or ($matrixp value) ($listp value))) > ? ? ? ? ? ($f90mx l value)) > ? ? ? ? ?((and (not (atom value)) (eq (caar value) 'mequal) > - ? ? ? ? ? ? ? (symbolp (cadr value)) ($matrixp (caddr value))) > + ? ? ? ? ? ? ? (symbolp (cadr value)) (or ($matrixp (caddr value)) > ($listp (caddr value)))) > ? ? ? ? ? ($f90mx (cadr value) (caddr value))) > ? ? ? ? ?(t (f90-print value)))))) > diff --git a/src/fortra.lisp b/src/fortra.lisp > index 21da838..847a3e1 100644 > --- a/src/fortra.lisp > +++ b/src/fortra.lisp > @@ -30,17 +30,17 @@ > ?(defmvar $fortfloat nil "Something JPG is working on.") > > ?;; This function is called from Macsyma toplevel. ?If the argument is a > -;; symbol, and the symbol is bound to a matrix, then the matrix is printed > +;; symbol, and the symbol is bound to a matrix or list, then the > value is printed > ?;; using an array assignment notation. > > ?(defmspec $fortran (l) > ? (setq l (fexprcheck l)) > ? (let ((value (strmeval l))) > ? ? (cond ((msetqp l) (setq value `((mequal) ,(cadr l) ,(meval l))))) > - ? ?(cond ((and (symbolp l) ($matrixp value)) > + ? ?(cond ((and (symbolp l) (or ($matrixp value) ($listp value))) > ? ? ? ? ? ($fortmx l value)) > ? ? ? ? ?((and (not (atom value)) (eq (caar value) 'mequal) > - ? ? ? ? ? ? ? (symbolp (cadr value)) ($matrixp (caddr value))) > + ? ? ? ? ? ? ? (symbolp (cadr value)) (or ($matrixp (caddr value)) > ($listp (caddr value)))) > ? ? ? ? ? ($fortmx (cadr value) (caddr value))) > ? ? ? ? ?(t (fortran-print value))))) > > @@ -144,17 +144,25 @@ > ?;; Takes a name and a matrix and prints a sequence of Fortran assignment > ?;; statements of the form > ?;; ?NAME(I,J) = > +;; or, when the second argument is a list, > +;; ?NAME(I) = > > ?(defmfun $fortmx (name mat &optional (stream *standard-output*) &aux > ($loadprint nil)) > ? (cond ((not (symbolp name)) > ? ? ? ? (merror (intl:gettext "fortmx: first argument must be a > symbol; found: ~M") name)) > - ? ? ? ((not ($matrixp mat)) > - ? ? ? ?(merror (intl:gettext "fortmx: second argument must be a > matrix; found: ~M") mat))) > - ?(do ((mat (cdr mat) (cdr mat)) (i 1 (1+ i))) > - ? ? ?((null mat)) > - ? ?(do ((m (cdar mat) (cdr m)) (j 1 (1+ j))) > - ? ? ? ((null m)) > - ? ? ?(fortran-print `((mequal) ((,name) ,i ,j) ,(car m)) stream))) > + ? ? ? ((not (or ($matrixp mat) ($listp mat))) > + ? ? ? ?(merror (intl:gettext "fortmx: second argument must be a list > or matrix; found: ~M") mat))) > + ?(cond > + ? ?(($matrixp mat) > + ? ? (do ((mat (cdr mat) (cdr mat)) (i 1 (1+ i))) > + ? ? ? ((null mat)) > + ? ? ? (do ((m (cdar mat) (cdr m)) (j 1 (1+ j))) > + ? ? ? ? ((null m)) > + ? ? ? ? (fortran-print `((mequal) ((,name) ,i ,j) ,(car m)) stream)))) > + ? ?(($listp mat) > + ? ? (do ((mat (cdr mat) (cdr mat)) (i 1 (1+ i))) > + ? ? ? ((null mat)) > + ? ? ? (fortran-print `((mequal) ((,name) ,i) ,(car mat)) stream)))) > ? '$done) > > ?;; Local Modes: From robert.dodier at gmail.com Thu Mar 1 09:53:19 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 1 Mar 2012 08:53:19 -0700 Subject: [Maxima] OLS in stats In-Reply-To: References: Message-ID: On 2/29/12, Mixon, Wilson wrote: > It appears that the simple_linear_regression routine in stats works for n < > 345. > The following works, but n > 344 results in this message: gamma: overflow > in GAMMAFLOAT. Looks like the error originates here: quantile_chi2 (0.975, 343); => error The problem appears to be in IIGAMMA (share/distrib/numdistrib.lisp) which computes the inverse of the incomplete gamma function. Probably there is no simple way to resolve the problem; I'm guessing IIGAMMA will have to apply some different algorithm for large arguments. There is gamma_incomplete in maxima/src but not its inverse, from what I can tell. Maybe the inverse is something we could put in src. Unfortunately, that's not a topic I know much about, so I probably wouldn't be the one to do the work. best Robert Dodier From toy.raymond at gmail.com Thu Mar 1 10:54:17 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 1 Mar 2012 08:54:17 -0800 Subject: [Maxima] OLS in stats In-Reply-To: References: Message-ID: On Thu, Mar 1, 2012 at 7:53 AM, Robert Dodier wrote: > On 2/29/12, Mixon, Wilson wrote: > > > It appears that the simple_linear_regression routine in stats works for > n < > > 345. > > The following works, but n > 344 results in this message: gamma: > overflow > > in GAMMAFLOAT. > > Looks like the error originates here: > > quantile_chi2 (0.975, 343); > => error > > The problem appears to be in IIGAMMA (share/distrib/numdistrib.lisp) > which computes the inverse of the incomplete gamma function. > Probably there is no simple way to resolve the problem; I'm guessing > IIGAMMA will have to apply some different algorithm for large arguments. > > Looks like the actual problem is in gamma_incomplete_regularized. The current method just computes gamma_incomplete and then divides by gamma. This kind of defeats the point of the regularized function. We need to come up with a different function that computes gamma_incomplete_regularized without having to call gamma for large arguments. Ray. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Thu Mar 1 12:17:18 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 01 Mar 2012 10:17:18 -0800 Subject: [Maxima] common lisp complex numbers, also common lisp rational numbers Message-ID: <4F4FBD2E.5040508@eecs.berkeley.edu> sometimes these may come up, from lisp routines. Or you can create them in maxima this way: A: ?complex(1,2) Should numberp(A) return true? (it doesn't). It is certainly a tricky situation to deal with, generally... should a complex constant like 1+2*%i be stored in common lisp as #c(1 2)... which has various positive aspects, mostly having to do with numerics. but has the negative aspects that 1. the re and im parts must be lisp number constants and that excludes bigfloats. 2. it also excludes symbolic re and im parts. I think numberp(A) should return true if ?numberp(A) returns true [it does].. that is, every common lisp number should be a number to Maxima as well. Oh, CL rational numbers might also be allowed as Maxima numbers too. Here's a confusing situation... :lisp (setf $aa 1/2) aa+1/3 returns 5/2/3 So the intermixing of Maxima rationals and CL rationals has bugs. But we knew this. RJF From macrakis at alum.mit.edu Thu Mar 1 12:20:51 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 1 Mar 2012 13:20:51 -0500 Subject: [Maxima] common lisp complex numbers, also common lisp rational numbers In-Reply-To: <4F4FBD2E.5040508@eecs.berkeley.edu> References: <4F4FBD2E.5040508@eecs.berkeley.edu> Message-ID: I wouldn't say that "the intermixing of Maxima rationals and CL rationals has bugs", but simply that "CL rationals and complexes are not supported as part of Maxima expressions". As far as I know, there has been no systematic effort to change this. -s On Thu, Mar 1, 2012 at 13:17, Richard Fateman wrote: > sometimes these may come up, from lisp routines. Or you can create them > in maxima > this way: > > A: ?complex(1,2) > > Should numberp(A) return true? (it doesn't). > > It is certainly a tricky situation to deal with, generally... should > a complex constant like 1+2*%i be stored in common lisp as #c(1 2)... > which has various positive aspects, mostly having to do with numerics. > > but has the negative aspects that > > 1. the re and im parts must be lisp number constants and that excludes > bigfloats. > 2. it also excludes symbolic re and im parts. > > I think numberp(A) should return true if ?numberp(A) returns true [it > does].. > that is, every common lisp number should be a number to Maxima as well. > > Oh, CL rational numbers might also be allowed as Maxima numbers too. > > Here's a confusing situation... > > :lisp (setf $aa 1/2) > > aa+1/3 > > returns 5/2/3 > > So the intermixing of Maxima rationals and CL rationals has bugs. > But we knew this. > > RJF > > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlakelan at street-artists.org Thu Mar 1 12:30:37 2012 From: dlakelan at street-artists.org (dlakelan) Date: Thu, 01 Mar 2012 10:30:37 -0800 Subject: [Maxima] rkf45 included in next release? Message-ID: <4F4FC04D.6050706@street-artists.org> I am playing with a coupled system of differential equations. This system has an initial transient behavior that involves a lot of fast dynamics, and then a long slow oscillation after the initial behavior. Using rk required a tiny time step and didn't allow me to get to the long slow oscillation efficiently. I installed the latest maxima sources thinking that the rkf45 code that was posted to the list would be included, but it doesn't seem to be as "load(rkf45)" doesn't work. I then went directly to https://sites.google.com/site/pjpapasot/maxima/libraries/rkf45 and downloaded the code myself and used batch to load it, and it was very helpful (THANK YOU Panagiotis !) Will this code be included in the next Maxima release? It is very helpful for getting numerical simulations of equations that are derived via Maxima. From woollett at charter.net Thu Mar 1 12:43:00 2012 From: woollett at charter.net (Edwin Woollett) Date: Thu, 1 Mar 2012 10:43:00 -0800 Subject: [Maxima] bessel_i quadpack bug 5.26.0 Message-ID: <98B44DC743A5430DBEDD4D4E020E85A7@edwinc367e16bd> On Feb. 29, 2012, Raymond Toy wrote >Still need to make bessel_i(n,%i*float) >return a purely imaginary result, though. >bessel_j apparently already does this. I use the blunt force tool fchop in my work: ----------------------------------- (%i1) cfloat(p):= expand(float(rectform(p)))$ (%i2) _small% : 1.0e-14$ (%i3) _chop%(ex) := block([eex], if numberp(ex) then (eex:float(ex), if ( abs(eex) < _small% ) then 0.0 else eex) else ex)$ (%i4) fchop(expr) := if mapatom(expr) then _chop%(expr) else scanmap(_chop%,expr)$ (%i5) for n thru 10 do print(n," ",cfloat(bessel_i(n,%i*2)))$ 1 0.57672480775687*%i+3.5313043199302822E-17 2 4.3208279328745645E-17*%i-0.35283402861564 3 -0.1289432494744*%i-2.3685708388328505E-17 4 0.033995719807568-8.3262748958227084E-18*%i 5 0.0070396297558717*%i+2.1551938318993842E-18 6 4.4175064766224005E-19*%i-0.00120242897179 7 -1.7494407486827413E-4*%i-7.4983168976543158E-20 8 2.2179552287925885E-5-1.0864488262691872E-20*%i 9 2.4923434351330654E-6*%i+1.3734628229571489E-21 10 1.5401790120662821E-22*%i-2.5153862827167347E-7 (%i6) for n thru 10 do print(n," ",fchop(cfloat(bessel_i(n,%i*2))))$ 1 0.57672480775687*%i 2 -0.3528340286156 3 -0.1289432494744*%i 4 0.033995719807568 5 0.0070396297558717*%i 6 -0.00120242897179 7 -1.7494407486827413E-4*%i 8 2.2179552287925885E-5 9 2.4923434351330654E-6*%i 10 -2.515386282716735E-7 ------------------------------------------------------ Ted From hbaker1 at pipeline.com Thu Mar 1 13:07:30 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Thu, 01 Mar 2012 11:07:30 -0800 Subject: [Maxima] common lisp complex numbers, also common lisp rational numbers In-Reply-To: References: <4F4FBD2E.5040508@eecs.berkeley.edu> Message-ID: Note: While Maxima may be _written_ in Common Lisp, it is not an _extension_ of Common Lisp. Now it might be a good idea to first _extend_ Common Lisp with Maxima data types, and only then interpret/compile the Maxima language in this extended language. If you wanted to do this cleanly, you probably want to implement Maxima data types in CLOS (object-oriented language for Common Lisp). This is because CLOS has full generic functions, so it is easy to add new datatypes to an already existing function. In a compiled language like C++, this notion is called "overloading"; CLOS allows overloading for _any_ generic function, not just for +,-,*,/,^, etc. At 10:20 AM 3/1/2012, Stavros Macrakis wrote: >I wouldn't say that "the intermixing of Maxima rationals and CL rationals has bugs", but simply that "CL rationals and complexes are not supported as part of Maxima expressions". As far as I know, there has been no systematic effort to change this. > > -s > >On Thu, Mar 1, 2012 at 13:17, Richard Fateman wrote: >sometimes these may come up, from lisp routines. Or you can create them in maxima >this way: > > A: ?complex(1,2) > >Should numberp(A) return true? (it doesn't). > >It is certainly a tricky situation to deal with, generally... should >a complex constant like 1+2*%i be stored in common lisp as #c(1 2)... >which has various positive aspects, mostly having to do with numerics. > > but has the negative aspects that > >1. the re and im parts must be lisp number constants and that excludes bigfloats. >2. it also excludes symbolic re and im parts. > >I think numberp(A) should return true if ?numberp(A) returns true [it does].. >that is, every common lisp number should be a number to Maxima as well. > >Oh, CL rational numbers might also be allowed as Maxima numbers too. > >Here's a confusing situation... > >:lisp (setf $aa 1/2) > >aa+1/3 > >returns 5/2/3 > >So the intermixing of Maxima rationals and CL rationals has bugs. >But we knew this. > >RJF From smh at franz.com Thu Mar 1 15:30:18 2012 From: smh at franz.com (Steve Haflich) Date: Thu, 01 Mar 2012 13:30:18 -0800 Subject: [Maxima] common lisp complex numbers, also common lisp rational numbers In-Reply-To: References: <4F4FBD2E.5040508@eecs.berkeley.edu> Message-ID: <19034.1330637418@gemini.franz.com> Henry Baker wrote: Now it might be a good idea to first _extend_ Common Lisp with Maxima data types, and only then interpret/compile the Maxima language in this extended language. If you wanted to do this cleanly, you probably want to implement Maxima data types in CLOS (object-oriented language for Common Lisp). This is because CLOS has full generic functions, so it is easy to add new datatypes to an already existing function. In a compiled language like C++, this notion is called "overloading"; CLOS allows overloading for _any_ generic function, not just for +,-,*,/,^, etc. (Ummm, CL is also a compiled language. But nevermind...) Not _every_ generic function can be overloaded in arbitrary ways. Adding a specialized primary method to handle a new class of argument will not necessarily work if the gf has :around, :before, or :after methods. Those methods will also see the extended argument classes and must be prepared to accept them. A more serious problem is that the functions +,-,*,/,^, etc. are _not_ specified to be generic functions. They are _allowed_ to be gfs, but it was a performance choice by X3J13 (wanting to define an industrial-strength programming language) not to require all functions be gfs. One could of course modify an exiting CL implementation to make all the desired functions generic, but this would be a larger, more-destabilizing, and more performance-killing job than one first might think. But I do agree it would be a neat thing to have! From robert.dodier at gmail.com Fri Mar 2 00:06:39 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 1 Mar 2012 23:06:39 -0700 Subject: [Maxima] rkf45 included in next release? In-Reply-To: <4F4FC04D.6050706@street-artists.org> References: <4F4FC04D.6050706@street-artists.org> Message-ID: OK, I'm working on including rkf45 in Maxima share. I remember this came up some months ago and people seemed generally happy about including it. Thanks to Panagiotis Papasotiriou for his work on this topic. best, Robert Dodier From fateman at eecs.berkeley.edu Fri Mar 2 00:09:00 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 01 Mar 2012 22:09:00 -0800 Subject: [Maxima] common lisp complex numbers, also common lisp rational numbers In-Reply-To: <19034.1330637418@gemini.franz.com> References: <4F4FBD2E.5040508@eecs.berkeley.edu> <19034.1330637418@gemini.franz.com> Message-ID: <4F5063FC.3070007@eecs.berkeley.edu> On 3/1/2012 1:30 PM, Steve Haflich wrote: > > One could of course modify an exiting CL implementation to make all the > desired functions generic, but this would be a larger, > more-destabilizing, and more performance-killing job than one first > might think. But I do agree it would be a neat thing to have! a generic arithmetic system for CL with many (all?) the "data types" in Maxima is posted in http://www.cs.berkeley.edu/~fateman/generic, using mpfr for bigfloats. It also has some data types not in Maxima like intervals, quad-precision. It even has a compiler. The difficulty remains that many of the coercions are not obvious. what do you do with interval + complex + symbol. etc. This code is more of a proof of concept than otherwise. Though I've used parts of it repeatedly. It uses allegro common lisp / foreign function interface for some things; this can be run in a free version, or you can leave off those pieces relying on external libmpfr.dll, libgmp, qd.dll From robert.dodier at gmail.com Fri Mar 2 01:12:11 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 2 Mar 2012 00:12:11 -0700 Subject: [Maxima] how to add to list of known integrals Message-ID: Hi everybody, is there some way to add to the list of known integrals? (Whether it's by some Lisp programming or otherwise.) e.g. we could add integrate(cos(x*sin(t)), t, 0, %pi) => %pi * bessel_j(0, x) and then integrate could recognize at least that and maybe do some related integrals. I guess there are at least two kinds known integrals, which would have to be handled in different ways -- namely definite and indefinite. Thanks for any information, Robert Dodier From wmixon at berry.edu Thu Mar 1 12:50:28 2012 From: wmixon at berry.edu (Mixon, Wilson) Date: Thu, 1 Mar 2012 18:50:28 +0000 Subject: [Maxima] OLS in stats In-Reply-To: References: , Message-ID: Thanks, Wilson ________________________________ From: Raymond Toy [toy.raymond at gmail.com] Sent: Thursday, March 01, 2012 11:54 AM To: Robert Dodier Cc: Mixon, Wilson; maxima at math.utexas.edu Subject: Re: [Maxima] OLS in stats On Thu, Mar 1, 2012 at 7:53 AM, Robert Dodier > wrote: On 2/29/12, Mixon, Wilson > wrote: > It appears that the simple_linear_regression routine in stats works for n < > 345. > The following works, but n > 344 results in this message: gamma: overflow > in GAMMAFLOAT. Looks like the error originates here: quantile_chi2 (0.975, 343); => error The problem appears to be in IIGAMMA (share/distrib/numdistrib.lisp) which computes the inverse of the incomplete gamma function. Probably there is no simple way to resolve the problem; I'm guessing IIGAMMA will have to apply some different algorithm for large arguments. Looks like the actual problem is in gamma_incomplete_regularized. The current method just computes gamma_incomplete and then divides by gamma. This kind of defeats the point of the regularized function. We need to come up with a different function that computes gamma_incomplete_regularized without having to call gamma for large arguments. Ray. From willisb at unk.edu Fri Mar 2 07:40:41 2012 From: willisb at unk.edu (Barton Willis) Date: Fri, 2 Mar 2012 07:40:41 -0600 Subject: [Maxima] how to add to list of known integrals In-Reply-To: References: Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Hi everybody, is there some way to add to the list of known integrals? >(Whether it's by some Lisp programming or otherwise.) e.g. we could add >integrate(cos(x*sin(t)), t, 0, %pi) => %pi * bessel_j(0, x) and then >integrate could recognize at least that and maybe do some related >integrals. For antiderivatives, giving a symbol the 'integral property is one way to extend Maxima's integrate function. Example (in simp.lisp) (defun abs-integral (x) (mul (div 1 2) x (take '(mabs) x))) (putprop 'mabs `((x) ,#'abs-integral) 'integral) An example from bessel.lisp (antiderivative with respect to order is unknown) (putprop '%bessel_j `((v z) nil ,#'bessel-j-integral-2) 'integral) For symbols with the 'integral property, Maxima tries derivative divides integration (substitution). >From a Maxima prompt, not sure how to give a symbol the 'integral property: (%i19) ?putprop(larry, lambda([x], patsy(x)), '?integral); (%o19) lambda([x],patsy(x)) Oops: (%i20) integrate(larry(x),x); (%o20) [x] For definite integrals, I don't know. Or did you have something else in mind? --bw From fateman at eecs.berkeley.edu Fri Mar 2 08:58:09 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 02 Mar 2012 06:58:09 -0800 Subject: [Maxima] how to add to list of known integrals In-Reply-To: References: Message-ID: <4F50E001.2080505@eecs.berkeley.edu> It seems to me that integral table lookup has been added to Maxima several times, including Moses' SIN program, which had a feature "Italu" (pronounced I tell you..) ... that would be for indefinite integrals. I think I did this at least once with pattern matching, just before the integration program gave up and returned an unevaluated integral. There is also "tilu", which was (is?) a lookup program that has a few hundred tabulated integrals in web server. Adding formulas to that is pretty easy. Then there were the experiments with making derivative-divides better, which One issue is that a clever human will transform a difficult integral into a simpler one and then look it up, so a formula may apply but not obviously so. Much of the heuristic integration program has to do with making integrals into more-or-less standardized forms. The definite integration problem is generally transformed into contour integration. A different set of programs. RJF On 3/2/2012 5:40 AM, Barton Willis wrote: > > -----maxima-bounces at math.utexas.edu wrote: ----- > >> Hi everybody, is there some way to add to the list of known integrals? >> (Whether it's by some Lisp programming or otherwise.) e.g. we could add >> integrate(cos(x*sin(t)), t, 0, %pi) => %pi * bessel_j(0, x) and then >> integrate could recognize at least that and maybe do some related >> integrals. > For antiderivatives, giving a symbol the 'integral property is one way to extend > Maxima's integrate function. Example (in simp.lisp) > > (defun abs-integral (x) > (mul (div 1 2) x (take '(mabs) x))) > > (putprop 'mabs `((x) ,#'abs-integral) 'integral) > > An example from bessel.lisp (antiderivative with respect to order is unknown) > > (putprop '%bessel_j `((v z) nil ,#'bessel-j-integral-2) 'integral) > > For symbols with the 'integral property, Maxima tries derivative divides integration > (substitution). > > From a Maxima prompt, not sure how to give a symbol the 'integral property: > > (%i19) ?putprop(larry, lambda([x], patsy(x)), '?integral); > (%o19) lambda([x],patsy(x)) > > Oops: > > (%i20) integrate(larry(x),x); > (%o20) [x] > > For definite integrals, I don't know. Or did you have something else in mind? > > > --bw > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From fateman at eecs.berkeley.edu Fri Mar 2 09:17:33 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 02 Mar 2012 07:17:33 -0800 Subject: [Maxima] how to add to list of known integrals /line added.. In-Reply-To: <4F50E001.2080505@eecs.berkeley.edu> References: <4F50E001.2080505@eecs.berkeley.edu> Message-ID: <4F50E48D.700@eecs.berkeley.edu> On 3/2/2012 6:58 AM, Richard Fateman wrote: > > There is also "tilu", which was (is?) a lookup program that has a few > hundred tabulated > integrals in web server. Adding formulas to that is pretty easy. > > Then there were the experiments with making derivative-divides better, > which Barton mentions; see http://www.cs.berkeley.edu/~fateman/papers/partition.pdf ... also you might find {A Proposal for Automated Integral Tables..} useful . see.. http://www.cs.berkeley.edu/~fateman/papers/intable.pdf which dates from 1992, and never really polished. From kcrisman at gmail.com Fri Mar 2 12:02:26 2012 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Fri, 2 Mar 2012 13:02:26 -0500 Subject: [Maxima] how to add to list of known integrals Message-ID: > ------------------------------ > > Message: 7 > Date: Fri, 2 Mar 2012 00:12:11 -0700 > From: Robert Dodier > To: Maxima Mailing List > Subject: [Maxima] how to add to list of known integrals > Message-ID: > ? ? ? ? > Content-Type: text/plain; charset=ISO-8859-1 > > Hi everybody, > > is there some way to add to the list of known integrals? > (Whether it's by some Lisp programming or otherwise.) > e.g. we could add integrate(cos(x*sin(t)), t, 0, %pi) => > %pi * bessel_j(0, x) and then integrate could recognize > at least that and maybe do some related integrals. > > I guess there are at least two kinds known integrals, > which would have to be handled in different ways -- namely > definite and indefinite. > Just wanted to say that at Sage we would be REALLY interested in this. We've been doing a lot of work trying to make a lot of our special functions more capable (which means compliant with Maxima and several other systems, and allowing for multiple libraries for numerical evaluation) lately, so this would be wonderful. It could also be a way for relative newcomers to both projects to contribute. You don't know how to program Python, Maxima, or Lisp? You can still at least add to the list of known integrals! From toy.raymond at gmail.com Fri Mar 2 12:13:25 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 2 Mar 2012 10:13:25 -0800 Subject: [Maxima] bessel_i quadpack bug 5.26.0 In-Reply-To: <98B44DC743A5430DBEDD4D4E020E85A7@edwinc367e16bd> References: <98B44DC743A5430DBEDD4D4E020E85A7@edwinc367e16bd> Message-ID: On Thu, Mar 1, 2012 at 10:43 AM, Edwin Woollett wrote: > On Feb. 29, 2012, Raymond Toy wrote > > Still need to make bessel_i(n,%i*float) >> return a purely imaginary result, though. bessel_j apparently already >> does this. >> > > I use the blunt force tool fchop in my work: > > That is pretty blunt. :-) Anyway, I've checked in a couple of changes. Thus, since %iargs defaults to true, (%i2) bessel_j(1,%i*x); (%o2) %i*bessel_i(1,x) (%i3) bessel_i(1,%i*x); (%o3) %i*bessel_j(1,x) (%i4) %iargs:false; (%o4) false (%i5) bessel_j(1,%i*x); (%o5) bessel_j(1,%i*x) (%i6) bessel_i(1,%i*x); (%o6) bessel_i(1,%i*x) (%i7) quad_qags(imagpart(bessel_i(1,%i*x)),x,1,2); (%o7) [.5413069074167308,6.009713920026927e-15,21,0] I think in this case you can download src/bessel.lisp and compile and load it into your lisp to test it. That's what I did when developing this. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlakelan at street-artists.org Fri Mar 2 12:18:15 2012 From: dlakelan at street-artists.org (dlakelan) Date: Fri, 02 Mar 2012 10:18:15 -0800 Subject: [Maxima] rkf45 included in next release? In-Reply-To: References: <4F4FC04D.6050706@street-artists.org> Message-ID: <4F510EE7.6090709@street-artists.org> On 03/01/2012 10:06 PM, Robert Dodier wrote: > OK, I'm working on including rkf45 in Maxima share. > I remember this came up some months ago and people > seemed generally happy about including it. > > Thanks to Panagiotis Papasotiriou for his work on this topic. Thank you Robert, I noticed in the code the use of "endcons" to accumulate the results into a list, which for large numbers of steps (and I am doing > 15k steps in my case) would give a slow result as it should grow as O(n^2). Surprisingly the function is still quite fast compared to rk, thanks to its superior algorithmic step size choice, but the usual method in these types of cases is to cons onto the front of list and then reverse the list right before returning it. The following patch does just that, and in my testing seemed to work: --- rkf45.mac.orig 2012-03-02 10:10:54.726724001 -0800 +++ rkf45.mac 2012-03-02 10:10:49.530724001 -0800 @@ -139,7 +139,7 @@ xi:xc+h, yi:yi+1.157407407407407e-1*k1+5.489278752436647e-1*k3 +5.353313840155946e-1*k4-0.2*k5, - if save_steps then sol:endcons(cons(xi,yi),sol), + if save_steps then sol:cons(cons(xi,yi),sol), estimated_errors[1]:min(trunc_error,estimated_errors[1]), estimated_errors[2]:max(trunc_error,estimated_errors[2]), step_extrema[1]:min(h,step_extrema[1]), @@ -180,6 +180,6 @@ print(" accuracy, and/or increase maximum number of steps.") ), /* Return solution */ - return(sol) + return(reverse(sol)) )$ /*----------------------------------------------------------------------------*/ From dlakelan at street-artists.org Fri Mar 2 12:59:45 2012 From: dlakelan at street-artists.org (dlakelan) Date: Fri, 02 Mar 2012 10:59:45 -0800 Subject: [Maxima] rkf45 included in next release? In-Reply-To: <4F510EE7.6090709@street-artists.org> References: <4F4FC04D.6050706@street-artists.org> <4F510EE7.6090709@street-artists.org> Message-ID: <4F5118A1.9040000@street-artists.org> On 03/02/2012 10:18 AM, dlakelan wrote: > The following patch does just that, and in my testing seemed to work: the previous patch worked unless you were asking for only the final result (ie. save_steps was false), the following patch takes care of that case and replaces the previous patch: --- rkf45.mac.orig 2012-03-02 10:10:54.726724001 -0800 +++ rkf45.mac 2012-03-02 10:57:22.402724001 -0800 @@ -139,7 +139,7 @@ xi:xc+h, yi:yi+1.157407407407407e-1*k1+5.489278752436647e-1*k3 +5.353313840155946e-1*k4-0.2*k5, - if save_steps then sol:endcons(cons(xi,yi),sol), + if save_steps then sol:cons(cons(xi,yi),sol), estimated_errors[1]:min(trunc_error,estimated_errors[1]), estimated_errors[2]:max(trunc_error,estimated_errors[2]), step_extrema[1]:min(h,step_extrema[1]), @@ -180,6 +180,9 @@ print(" accuracy, and/or increase maximum number of steps.") ), /* Return solution */ - return(sol) + if(save_steps) then + return(reverse(sol)) + else + return(sol) )$ /*----------------------------------------------------------------------------*/ From woollett at charter.net Fri Mar 2 13:47:05 2012 From: woollett at charter.net (Edwin Woollett) Date: Fri, 2 Mar 2012 11:47:05 -0800 Subject: [Maxima] slatec bessel_k(n, %i*x): lack of precision for large x Message-ID: A test of the slatec fortran - lisp translated bessel_k(n,%i*x) for large (real) x shows either a lack of precision or refusal to compute for large enough values of x. This may be the reason quad_qagi has problems with getting convergence for semi-infinite integrals involving bessel_k(2,%i*x) which I have been looking at. First for the large x test: the ierr=3 means "lack of precision warning" in evaluation of the bessel function, while ierr=4 means " no computation because abs(z) is too large". (See the slatec fortran code zbesk.f link on the page http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/src/numerical/slatec/fortran/ I load nint.mac so I can use my functions fchop and cfloat here: ------------------------------------------------------- (%i1) load(nint); (%o1) "c:/work2/nint.mac" (%i2) for n:2 thru 10 do print(n," ",fchop(cfloat(bessel_k(2,%i*10^n))))$ 2 0.120695-0.0338173*%i 3 -0.03892*%i-0.00748561 4 0.0111478*%i-0.00572773 zbesk ierr = 3 zbesk ierr = 3 5 0.00270057*%i-0.00290084 zbesk ierr = 3 zbesk ierr = 3 6 0.00114035-5.20003431E-4*%i zbesk ierr = 3 zbesk ierr = 3 7 1.36403863E-4*%i-3.72120436E-4 zbesk ierr = 3 zbesk ierr = 3 8 -5.03601919E-5*%i-1.14768525E-4 zbesk ierr = 3 zbesk ierr = 3 9 8.18451269E-6-3.87789902E-5*%i zbesk ierr = 4 zbesk ierr = 4 10 0.0 ------------------------------------- Already at arg = %i*10^4 bessel_k(2,arg) has precision problems. Finally, ar arg = %i*10^10 bessel_k(2,arg) shuts down with the return of 0.0. ------------------------ How this affects ability of quad_qagi is less clear. I use nint (which will call quad_qagi here) for a series of less and less convergent (or easy) integrals. The real and imaginary parts of the integrand are separately submitted to quad_qagi by nint. -------------------------------------------------- /* the denominator x^6 heavily damps the small wandering values of the numerator, so quag_qagi doesn't ask for large x values from bessel_k here: */ (%i3) nint(bessel_k(2,%i*x)/x^6,x,1,inf); (%o3) 0.0535655*%i-0.401416 (%i4) noutL; (%o4) [[[qagi,-0.401416,1.06713183E-9,195,0], [qagi,0.0535655,1.62460657E-10,255,0]]] (%i5) nint(bessel_k(2,%i*x)/x^5,x,1,inf); (%o5) 0.0728441*%i-0.474075 (%i6) noutL; (%o6) [[[qagi,-0.474075,2.49004643E-9,285,0], [qagi,0.0728441,5.43186958E-10,405,0]]] /* here zbesk starts to complain about loss of precision although the final answer agrees with Mma = wolfram alpha */ (%i7) nint(bessel_k(2,%i*x)/x^4,x,1,inf); zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 (%o7) 0.107823*%i-0.576049 /* this calculation also agrees with Mma, but the zbesk error messages clutter up the output, and show why it is desireable to have a way to surpress the printing of these messages to the screen! */ (%i8) nint(bessel_k(2,%i*x)/x^3,x,1,inf); (%i8) nint(bessel_k(2,%i*x)/x^3,x,1,inf); zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 (%o8) 0.17808*%i-0.724001 (%i9) noutL; (%o9) [[[qagi,-0.724001,1.95810235E-9,3135,0], [qagi,0.17808,2.86307006E-10,5925,0]]] running (%10) nint(bessel_k(2,%i*x)/x^2,x,1,inf); generates _many_ pages of the same error message and "too many subintervals done". ..................... ....................... zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 quadpack error code = too many subintervals done real part returns false (%o10) false note the imaginary part gave correct answer: (%i11) noutL; (%o11) [[qagi,-0.939769,3.75759298E-7,23985,1]] Mma's answer = 0.332602 i - 0.939769 ----------------------------------- The bottom line here is: are there better bessel function routines available which are reasonably accurate for large abs(z) args?? Ted Woollett From mickle.mouse at gmail.com Fri Mar 2 14:58:11 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Fri, 2 Mar 2012 13:58:11 -0700 Subject: [Maxima] how to add to list of known integrals In-Reply-To: References: Message-ID: I shouldn't have to say this (and I probably shouldn't), but its time someone stated the obvious: http://en.wikipedia.org/wiki/Lists_of_integrals http://en.wikipedia.org/wiki/Bessel_function http://en.wikipedia.org/wiki/List_of_integrals_of_exponential_functions (This only has a few special functions listed) Almost all of these links appear to have both integral and derivative information for special functions ( http://reference.wolfram.com/mathematica/guide/SpecialFunctions.html ). Here is another: http://www.math.tulane.edu/~vhm/Table.html On Fri, Mar 2, 2012 at 11:02 AM, Karl-Dieter Crisman wrote: > > ------------------------------ > > > > Message: 7 > > Date: Fri, 2 Mar 2012 00:12:11 -0700 > > From: Robert Dodier > > To: Maxima Mailing List > > Subject: [Maxima] how to add to list of known integrals > > Message-ID: > > PS0Kuwasuq3FLUn1gP1g at mail.gmail.com> > > Content-Type: text/plain; charset=ISO-8859-1 > > > > Hi everybody, > > > > is there some way to add to the list of known integrals? > > (Whether it's by some Lisp programming or otherwise.) > > e.g. we could add integrate(cos(x*sin(t)), t, 0, %pi) => > > %pi * bessel_j(0, x) and then integrate could recognize > > at least that and maybe do some related integrals. > > > > I guess there are at least two kinds known integrals, > > which would have to be handled in different ways -- namely > > definite and indefinite. > > > > Just wanted to say that at Sage we would be REALLY interested in this. > We've been doing a lot of work trying to make a lot of our special > functions more capable (which means compliant with Maxima and several > other systems, and allowing for multiple libraries for numerical > evaluation) lately, so this would be wonderful. > > It could also be a way for relative newcomers to both projects to > contribute. You don't know how to program Python, Maxima, or Lisp? > You can still at least add to the list of known integrals! > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Fri Mar 2 16:04:29 2012 From: woollett at charter.net (Edwin Woollett) Date: Fri, 2 Mar 2012 14:04:29 -0800 Subject: [Maxima] bessel_i quadpack bug 5.26.0 Message-ID: On Mar. 2, 2012, Raymond Toy wrote: ----------------------------------- >Anyway, I've checked in a couple of changes. Thus, since %iargs defaults >to true, > >(%i2) bessel_j(1,%i*x); > >(%o2) %i*bessel_i(1,x) >(%i3) bessel_i(1,%i*x); > >(%o3) %i*bessel_j(1,x) >(%i4) %iargs:false; > >(%o4) false >(%i5) bessel_j(1,%i*x); > >(%o5) bessel_j(1,%i*x) >(%i6) bessel_i(1,%i*x); > >(%o6) bessel_i(1,%i*x) >(%i7) quad_qags(imagpart(bessel_i(1,%i*x)),x,1,2); > >(%o7) [.5413069074167308,6.009713920026927e-15,21,0] > >I think in this case you can download src/bessel.lisp and compile and load >it into your lisp to test it. That's what I did when developing this. ----------------------------------------- Thanks for the bug fix. ----------------------------- (%i1) :lisp (compile-file "c:/work2/bessel-new.lisp") Compiling c:/work2/bessel-new.lisp. End of Pass 1. ;; Note: Tail-recursive call of BESSEL-J was replaced by iteration. ;; Note: Tail-recursive call of BESSEL-Y was replaced by iteration. ;; Note: Tail-recursive call of BESSEL-I was replaced by iteration. ;; Note: Tail-recursive call of BESSEL-I was replaced by iteration. End of Pass 2. OPTIMIZE levels: Safety=2, Space=3, Speed=3 Finished compiling c:/work2/bessel-new.lisp. #pc:/work2/bessel-new.o (%i1) load("bessel-new.o"); (%o1) c:/work2/bessel-new.o (%i2) %iargs; (%o2) true (%i3) bessel_j(1,%i*x); (%o3) %i bessel_i(1, x) (%i4) bessel_i(1,%i*x); (%o4) %i bessel_j(1, x) (%i5) %iargs:false$ (%i6) bessel_j(1,%i*x); (%o6) bessel_j(1, %i x) (%i7) bessel_i(1,%i*x); (%o7) bessel_i(1, %i x) (%i8) %iargs:true$ (%i9) quad_qags(imagpart(bessel_i(1,%i*x)),x,1,2); (%o9) [0.54130690741673, 6.0097139200269267E-15, 21, 0] (%i10) quad_qags(imagpart(bessel_i(1.0,%i*x)),x,1,2); (%o10) [0.54130690741673, 6.0097139200269267E-15, 21, 0] (%i1) load(nint); (%o1) "c:/work2/nint.mac" (%i2) nint(bessel_i(1,%i*x),x,1,2); (%o2) 0.541307*%i (%i3) noutL; (%o3) [[integrate,0.541307*%i]] (%i4) nint(bessel_i(1,%i*x),x,1,2,quad); (%o4) 0.541307*%i (%i5) noutL; (%o5) [[qags,0.541307,6.00971392E-15,21,0]] -------------------------------- Ted From toy.raymond at gmail.com Fri Mar 2 16:31:00 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 2 Mar 2012 14:31:00 -0800 Subject: [Maxima] slatec bessel_k(n, %i*x): lack of precision for large x In-Reply-To: References: Message-ID: On Fri, Mar 2, 2012 at 11:47 AM, Edwin Woollett wrote: > > /* this calculation also agrees with Mma, but the zbesk > error messages clutter up the output, and > show why it is desireable to have a way to > surpress the printing of these messages to > the screen! */ > What would you want? No messages so you have no way of knowing that something potentially bad happened? Signal an (annoying?) error? > > ------------------------------**----- > The bottom line here is: are there better bessel function > routines available which are reasonably accurate for large > abs(z) args?? > > Don't know. Maybe you can compute using bfloats and return a float at the end? (But we don't have a real bfloat implementation of Bessel functions, so you will have to use Barton's hypergeometric code to compute the Bessel functions.) Maybe bessel_k(v,%i*x) can be computed via http://www.wolframalpha.com/input/?i=BesselK[v%2Cix]. (See alternate form). The Bessel J and Y functions don't appear to have problems with the size of x in your tests. But I have no idea how accurate the result would be. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri Mar 2 17:14:02 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 02 Mar 2012 15:14:02 -0800 Subject: [Maxima] slatec bessel_k(n, %i*x): lack of precision for large x In-Reply-To: References: Message-ID: <4F51543A.5090900@eecs.berkeley.edu> If you want a bfloat bessel function, I can give you one for J, positive real order and positive real argument. Written in lisp for Maxima, or the Maxima language. J[n,%i*x] = (%i*^n) *I[n,x], so maybe all you need is a routine for I_n. RJF On 3/2/2012 2:31 PM, Raymond Toy wrote: > > > On Fri, Mar 2, 2012 at 11:47 AM, Edwin Woollett > wrote: > > > /* this calculation also agrees with Mma, but the zbesk > error messages clutter up the output, and > show why it is desireable to have a way to > surpress the printing of these messages to > the screen! */ > > > What would you want? No messages so you have no way of knowing that > something potentially bad happened? Signal an (annoying?) error? > > > ----------------------------------- > The bottom line here is: are there better bessel function > routines available which are reasonably accurate for large > abs(z) args?? > > > Don't know. Maybe you can compute using bfloats and return a float at > the end? (But we don't have a real bfloat implementation of Bessel > functions, so you will have to use Barton's hypergeometric code to > compute the Bessel functions.) > > Maybe bessel_k(v,%i*x) can be computed via > http://www.wolframalpha.com/input/?i=BesselK[v%2Cix]. (See alternate > form). The Bessel J and Y functions don't appear to have problems > with the size of x in your tests. But I have no idea how accurate the > result would be. > > Ray > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Fri Mar 2 18:04:02 2012 From: woollett at charter.net (Edwin Woollett) Date: Fri, 2 Mar 2012 16:04:02 -0800 Subject: [Maxima] defint "divergent" message incorrect Message-ID: <901DA17BA509466ABA449F6B10FD8D93@edwinc367e16bd> defint returns an incorrect "divergent" message for integrals of the form integrate ( sin(x)/x^n, x, 1, inf ) for n = even pos integer, n = 2, 4, 6, 8, 10, ... -------------------------------------------- (%i1) display2d:false$ (%i2) integrate(sin(x)/x^2,x,1,inf); defint: integral is divergent. -- an error. To debug this try: debugmode(true); I use nint program to avoid quadpack error messages on screen. For this type of integral, nint first tries integrate, and if not successful, passes it to quad_qagi. (%i3) load(nint); (%o3) "c:/work2/nint.mac" (%i4) nint(sin(x)/x^2,x,1,inf); defint: integral is divergent. quadpack error code = too many subintervals done (%o4) false Actually returns a good answer (nint code at present rejects quadpack answer with error number = 1. (%i5) noutL; (%o5) [[qagi,0.504076,4.02824006E-6,23985,1]] This was check with Mma = wolfram alpha, Mma has a symbolic answer: (%i6) float(sin(1) - expintegral_ci(1)); (%o6) 0.504067 (%i7) nint(sin(x)/x^4,x,1,inf); defint: integral is divergent. (%o7) 0.28653 (%i8) noutL; (%o8) [[qagi,0.28653,2.68053463E-9,1605,0]] Mma has a symbolic answer: (%i9) float((expintegral_ci(1)+sin(1)+cos(1))/6); (%o9) 0.28653 (%i10) nint(sin(x)/x^6,x,1,inf); defint: integral is divergent. (%o10) 0.180983 (%i11) noutL; (%o11) [[qagi,0.180983,1.09841563E-9,255,0]] Mma has a symbolic answer: (%i12) float((-expintegral_ci(1)+23*sin(1)+5*cos(1))/120); (%o12) 0.180983 (%i13) nint(sin(x)/x^8,x,1,inf); defint: integral is divergent. (%o13) 0.128765 (%i14) noutL; (%o14) [[qagi,0.128765,4.79375878E-10,135,0]] (%i15) nint(sin(x)/x^10,x,1,inf); defint: integral is divergent. (%o15) 0.0992126 (%i16) noutL; (%o16) [[qagi,0.0992126,8.11496319E-10,105,0]] --------------------------------- Ted Woollett From O.Kullmann at swansea.ac.uk Fri Mar 2 18:57:12 2012 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 3 Mar 2012 00:57:12 +0000 Subject: [Maxima] Building Maxima with Ecl 12.2.1 fails Message-ID: <20120303005712.GM27472@cs-wsok.swan.ac.uk> Hello, I'm trying to install Maxima (original 5.26.0) with the newest Ecl, 12.2.1, but I get the following error: ; - Loading binary file "binary-ecl/intl.fas" ;;; Loading "/home/kullmann/OKplatform/ExternalSources/builds/Maxima/ecl/maxima-5.26.0/src/binary-ecl/intl.fas" An error occurred during initialization: In form (PROGN (LOAD "../lisp-utils/defsystem.lisp") (FUNCALL (INTERN (SYMBOL-NAME :OPERATE-ON-SYSTEM) :MK) "maxima" :COMPILE :VERBOSE T) (COMMON-LISP-USER::BUILD-MAXIMA-LIB)) Unknown keyword :RENAME-AND-DELETE. make[2]: *** [binary-ecl/maxima] Error 1 Any idea what this is? Oliver From willisb at unk.edu Sat Mar 3 06:01:47 2012 From: willisb at unk.edu (Barton Willis) Date: Sat, 3 Mar 2012 06:01:47 -0600 Subject: [Maxima] defint "divergent" message incorrect In-Reply-To: <901DA17BA509466ABA449F6B10FD8D93@edwinc367e16bd> References: <901DA17BA509466ABA449F6B10FD8D93@edwinc367e16bd> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >defint returns an incorrect "divergent" message >for integrals of the form >integrate ( sin(x)/x^n, x, 1, inf ) for n = even pos integer, n = 2, 4, 6, 8, 10, ... Possibly related: (%i1) assume(b>1); (%o1) [b>1] (%i2) integrate(sin(x)/x^2, x, 1, b); (%o2) gamma_incomplete(-1,%i*b)/2+gamma_incomplete(-1,-%i*b)/2-gamma_incomplete(-1,%i)/2-gamma_incomplete(-1,-%i)/2 (%i3) limit(%,b,inf); (%o3) gamma_incomplete(-1,infinity)-gamma_incomplete(-1,%i)/2-gamma_incomplete(-1,-%i)/2 Tracing limit and ?limit while evaluating integrate(sin(x)/x^2, x, 1, b) shows that the limit bug shown in (%o3) might be partially to blame for integrate(sin(x)/x^2, x, 1, inf) --> divergent. --bw From willisb at unk.edu Sat Mar 3 06:46:18 2012 From: willisb at unk.edu (Barton Willis) Date: Sat, 3 Mar 2012 06:46:18 -0600 Subject: [Maxima] defint "divergent" message incorrect In-Reply-To: References: , <901DA17BA509466ABA449F6B10FD8D93@edwinc367e16bd> Message-ID: The simplim%function the incomplete gamma function uses direct substitution (that is, limit(f(x),x,a) = f(a)) in cases where I think it should not. Deleting the direct substitution case from simplim%gamma_incomplete gives (OK, I think) (%i10) integrate(sin(x)/x^2,x,1,inf); (%o10) -(gamma_incomplete(-1,%i)+gamma_incomplete(-1,-%i))/2 (%i11) float(%); (%o11) 0.50406706190693 But also the bogus: (%i14) integrate(sin(x)/x^4,x,1,b); "Is "b-1" positive, negative, or zero?"pos; (%o14) 0 So deleting the direct substitution case isn't correct. --bw (defun simplim%gamma_incomplete (expr var val) ;; Look for the limit of the arguments. (let ((a (limit (cadr expr) var val 'think)) (z (limit (caddr expr) var val 'think))) (cond ((eq z '$infinity) ;; http://dlmf.nist.gov/8.11#i (cond ((and (zerop1 ($realpart (caddr expr))) (eq ($csign (m+ -1 (cadr expr))) '$neg)) 0) (t (throw 'limit t)))) ;; Handle an argument 0 at this place. ((or (zerop1 z) (eq z '$zeroa) (eq z '$zerob)) (let ((sgn ($sign ($realpart a)))) (cond ((zerop1 a) '$inf) ((member sgn '($neg $nz)) '$infinity) ((eq sgn '($pos)) ($gamma a)) ;; Call the simplifier of the function. (t (simplify (list '(%gamma_incomplete) a z)))))) (t nil)))) ;; All other cases are handled by the simplifier of the function. ;;(simplify (list '(%gamma_incomplete) a z)))))) From aleksasd873 at gmail.com Sat Mar 3 07:37:31 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Sat, 3 Mar 2012 15:37:31 +0200 Subject: [Maxima] defint "divergent" message incorrect Message-ID: Maxima knows that (%i1) 'diff(expintegral_ci (x),x)=diff(expintegral_ci (x),x); (%o1) 'diff(expintegral_ci(x),x,1)=cos(x)/x (%i2) 'diff(expintegral_si (x),x)=diff(expintegral_si (x),x); (%o2) 'diff(expintegral_si(x),x,1)=sin(x)/x We need implement to to Maxima that integrate(sin(x)/x,x)=expintegral_si(x) integrate(cos(x)/x,x)=expintegral_ci(x) integrate(sin(x)/x,x,a,b)=expintegral_si(b)-expintegral_si(a) integrate(cos(x)/x,x,a,b)=expintegral_ci(b)-expintegral_ci(a) Solving of problem: integrate(sin(x)/x^2,x,1,inf) (%i3) S:'integrate(sin(x)/x^2,x,1,inf); (%o3) integrate(sin(x)/x^2,x,1,inf) We integrate by parts. For integrate by parts I write command "intparts" . Will this command be included in the next Maxima release? (%i4) intparts(S,u):=block([f,var,v,a,b], f:part(S,1),var:part(S,2),v:integrate(f/u,var), if last(S)#var then (a:part(S,3),b:part(S,4), limit(u*v,var,b,minus)-limit(u*v,var,a,plus) -'integrate(v*diff(u,var),var,a,b)) else u*v-'integrate(v*diff(u,var),var) )$ (%i5) intparts(S,sin(x)); (%o5) integrate(cos(x)/x,x,1,inf)+sin(1) (%i6) subst(cos(x)/x='diff(expintegral_ci(x),x),%); (%o6) integrate('diff(expintegral_ci(x),x,1),x,1,inf)+sin(1) (%i7) ev(%, integrate); Principal Value (%o7) sin(1)-expintegral_ci(1) (%i8) float(%), numer; (%o8) 0.50406706190693 Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sat Mar 3 09:22:18 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 03 Mar 2012 07:22:18 -0800 Subject: [Maxima] defint "divergent" message incorrect In-Reply-To: References: <901DA17BA509466ABA449F6B10FD8D93@edwinc367e16bd> Message-ID: On 3/3/12 4:01 AM, Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > >> defint returns an incorrect "divergent" message >> for integrals of the form > >> integrate ( sin(x)/x^n, x, 1, inf ) for n = even pos integer, n = 2, 4, 6, 8, 10, ... > > Possibly related: > > (%i1) assume(b>1); > (%o1) [b>1] > > (%i2) integrate(sin(x)/x^2, x, 1, b); > (%o2) gamma_incomplete(-1,%i*b)/2+gamma_incomplete(-1,-%i*b)/2-gamma_incomplete(-1,%i)/2-gamma_incomplete(-1,-%i)/2 > > (%i3) limit(%,b,inf); > (%o3) gamma_incomplete(-1,infinity)-gamma_incomplete(-1,%i)/2-gamma_incomplete(-1,-%i)/2 > What version of maxima are you using? With the current git sources, I don't get divergence for these integrals. The limit doesn't leave infinity, but is zero, leaving just the other terms, which is also what the infinite integral returns. I thought Dan Gildea (?) fixed this a little while ago. Ray From willisb at unk.edu Sat Mar 3 09:49:58 2012 From: willisb at unk.edu (Barton Willis) Date: Sat, 3 Mar 2012 09:49:58 -0600 Subject: [Maxima] defint "divergent" message incorrect In-Reply-To: References: , <901DA17BA509466ABA449F6B10FD8D93@edwinc367e16bd> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >What version of maxima are you using? ?With the current git sources, I >don't get divergence for these integrals. ?The limit doesn't leave >infinity, but is zero, leaving just the other terms, which is also what >the infinite integral returns. >I thought Dan Gildea (?) fixed this a little while ago. 5.25.0... Thanks to Dan Gildea for fixing these bugs (on 20 Dec 2011, Commit:48a6e97e1e5c74ade39d30f48f1d19ae3ef3e48a). --Barton From aleksasd873 at gmail.com Sat Mar 3 10:05:21 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Sat, 3 Mar 2012 18:05:21 +0200 Subject: [Maxima] defint "divergent" message incorrect Message-ID: I have proved Theorem. Let f(n)=integrate(sin(x)/x^(2*n),x,1,inf). Then f(1)=sin(1) - expintegral_ci(1), f(n) = -f(n-1)/(2*(n-1)*(2*n-1))+cos(1)/(2*(n-1)*(2*n-1))+sin(1)/(2*n-1) (%i1) f(n):=if n=1 then sin(1)-expintegral_ci(1) else -f(n-1)/(2*(n-1)*(2*n-1))+cos(1)/(2*(n-1)*(2*n-1))+sin(1)/(2*n-1)$ Next we compute integrate(sin(x)/x^(2*n),x,1,inf) for n=2, 3, 4, 5, .... (%i2) f(2),ratsimp; (%o2) (sin(1)+expintegral_ci(1)+cos(1))/6 (%i3) float(%), numer; (%o3) 0.28652953559617 (%i4) f(3),ratsimp; (%o4) (23*sin(1)-expintegral_ci(1)+5*cos(1))/120 (%i5) float(%), numer; (%o5) 0.18098283547518 (%i6) f(4),ratsimp; (%o6) (697*sin(1)+expintegral_ci(1)+115*cos(1))/5040 (%i7) float(%), numer; (%o7) 0.12876536617239 (%i8) f(5),ratsimp; (%o8) (39623*sin(1)-expintegral_ci(1)+4925*cos(1))/362880 (%i9) float(%), numer; (%o9) 0.099212566918874 This it's the same as numeric results from http://www.math.utexas.edu/pipermail/maxima/2012/027977.html I thank Edwin Woollett for the interesting problem. Aleksas D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Mar 3 11:10:33 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 3 Mar 2012 10:10:33 -0700 Subject: [Maxima] Building Maxima with Ecl 12.2.1 fails In-Reply-To: <20120303005712.GM27472@cs-wsok.swan.ac.uk> References: <20120303005712.GM27472@cs-wsok.swan.ac.uk> Message-ID: Hmm, I get a different error trying to compile Maxima w/ ECL 12.2.1. See below. I am working on Ubuntu. I downloaded the ECL tarball and compiled it. To the ECL list -- I tried to narrow down the error by compiling only the SLATEC stuff, but ran into trouble w/ package declarations and couldn't sort it out (too lazy). Looking at xerprn.fas, I see the following string of expressions -- (simple-array character (*)) (f2cl-lib::integer4) (simple-array f2cl-lib::integer4 (5)) (simple-array character (148)) (integer) f2cl-lib::integer4 " " (t (("~A")) "~%") slatec::xerprn slatec::xgetua f2cl-lib::i1mach f2cl-lib::len f2cl-lib::fstring-/= f2cl-lib::lun->stream f2cl-lib::execute-format-main f2cl-lib::index f2cl-lib::fstring-= "SLATEC" "$$" (simple-array character (2)) "CL-USER" Maybe that's some kind of clue. For the record, this succeeds in ECL 12.2.1: (coerce "$$" '(simple-array character (2))) => "$$" Thanks for any info, Robert Dodier PS. tail end of output from make following ./configure --enable-ecl: ; - Compiling source file ; "/home/robert/maxima/maxima-git/maxima/src/numerical/slatec/xerprn.lisp" ;;; ;;; Compiling /home/robert/maxima/maxima-git/maxima/src/numerical/slatec/xerprn.lisp. ;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=2 ;;; ;;; Style warning: ;;; in file xerprn.lisp, position 719 ;;; at (LET* (#) ...) ;;; ! The argument 1 of function REPLACE has type ;;; INTEGER4 ;;; instead of expected ;;; SEQUENCE ;;; Style warning: ;;; in file xerprn.lisp, position 719 ;;; at (LET* (#) ...) ;;; ! The argument 1 of function REPLACE has type ;;; INTEGER4 ;;; instead of expected ;;; SEQUENCE ;;; End of Pass 1. ;;; Style warning: ;;; ! The argument 1 of function REPLACE has type ;;; INTEGER4 ;;; instead of expected ;;; SEQUENCE ;;; Style warning: ;;; ! The argument 1 of function REPLACE has type ;;; INTEGER4 ;;; instead of expected ;;; SEQUENCE ;;; Emitting code for SLATEC::XERPRN. ;;; Finished compiling /home/robert/maxima/maxima-git/maxima/src/numerical/slatec/xerprn.lisp. ;;; ; - Loading binary file "binary-ecl/numerical/slatec/xerprn.fas" ;;; Loading "/home/robert/maxima/maxima-git/maxima/src/binary-ecl/numerical/slatec/xerprn.fas" An error occurred during initialization: "$$" is not of type (SIMPLE-ARRAY CHARACTER (2)).. make[1]: *** [binary-ecl/maxima] Error 1 From toy.raymond at gmail.com Sat Mar 3 12:06:11 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 03 Mar 2012 10:06:11 -0800 Subject: [Maxima] Building Maxima with Ecl 12.2.1 fails In-Reply-To: References: <20120303005712.GM27472@cs-wsok.swan.ac.uk> Message-ID: <4F525D93.40105@gmail.com> On 3/3/12 9:10 AM, Robert Dodier wrote: > Hmm, I get a different error trying to compile Maxima w/ ECL 12.2.1. > See below. I am working on Ubuntu. I downloaded the ECL tarball and > compiled it. > > To the ECL list -- I tried to narrow down the error by compiling > only the SLATEC stuff, but ran into trouble w/ package declarations > and couldn't sort it out (too lazy). > > Looking at xerprn.fas, I see the following string of expressions -- Known issue. I thought I checked in a tiny (temporary) fix for this, but I guess I didn't. I'll push the fix shortly. Oliver's issue seems different. :rename-and-delete looks like the keyword argument to OPEN, but I don't have 12.2.1 to test this. Ray From toy.raymond at gmail.com Sat Mar 3 12:06:11 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 03 Mar 2012 10:06:11 -0800 Subject: [Maxima] Building Maxima with Ecl 12.2.1 fails In-Reply-To: References: <20120303005712.GM27472@cs-wsok.swan.ac.uk> Message-ID: <4F525D93.40105@gmail.com> On 3/3/12 9:10 AM, Robert Dodier wrote: > Hmm, I get a different error trying to compile Maxima w/ ECL 12.2.1. > See below. I am working on Ubuntu. I downloaded the ECL tarball and > compiled it. > > To the ECL list -- I tried to narrow down the error by compiling > only the SLATEC stuff, but ran into trouble w/ package declarations > and couldn't sort it out (too lazy). > > Looking at xerprn.fas, I see the following string of expressions -- Known issue. I thought I checked in a tiny (temporary) fix for this, but I guess I didn't. I'll push the fix shortly. Oliver's issue seems different. :rename-and-delete looks like the keyword argument to OPEN, but I don't have 12.2.1 to test this. Ray From woollett at charter.net Sat Mar 3 13:04:29 2012 From: woollett at charter.net (Edwin Woollett) Date: Sat, 3 Mar 2012 11:04:29 -0800 Subject: [Maxima] slatec bessel_k(n, %i*x): lack of precision for large x Message-ID: <09D6A8CDCB5345768EED808D903D1C1C@edwinc367e16bd> On Mar. 2, 2012, Raymond Toy wrote: ------------------------------------ >> /* this calculation also agrees with Mma, but the zbesk >> error messages clutter up the output, and >> show why it is desireable to have a way to >> surpress the printing of these messages to >> the screen! */ >> > >What would you want? No messages so you have no way of knowing that >something potentially bad happened? Signal an (annoying?) error? ------------------------------------- Normally, zbesk sends a error message to the screen, which is needed to alert the user in a normal mode. For a package, like nint, which seeks to produce a clean answer or (false plus coherent overall error message), there could be a global switch and a global list, say spfun_flag and spfun_err_list. A package programmer could then change the normal setting of spfun_flag, (e.g., on entering nint) which would cause each slatec special function to cons an error code into spfun_list (instead of sending a ierr message to the screen) whenever the normal error code is > 0, say. The package programmer would set the global list spfun_err_list: [] at the start of the calculation, and would look at the list contents at the end of the calculation, to interpret the reliability of the results. The global switch would be returned to its default setting by the package programmer at the end of the calculation (e.g., before nint returns a result to the screen). Ted From robert.dodier at gmail.com Sat Mar 3 13:19:21 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 3 Mar 2012 12:19:21 -0700 Subject: [Maxima] Building Maxima with Ecl 12.2.1 fails In-Reply-To: <4F525D93.40105@gmail.com> References: <20120303005712.GM27472@cs-wsok.swan.ac.uk> <4F525D93.40105@gmail.com> Message-ID: On 3/3/12, Raymond Toy wrote: > On 3/3/12 9:10 AM, Robert Dodier wrote: >> Looking at xerprn.fas, I see the following string of expressions -- > > Known issue. I thought I checked in a tiny (temporary) fix for this, > but I guess I didn't. I'll push the fix shortly. Thanks for the info. I've applied the patch for xerprn.lisp and now make runs to completion successfully. I didn't run into the error about :RENAME-AND-DELETE. best, Robert Dodier From O.Kullmann at swansea.ac.uk Sun Mar 4 05:48:28 2012 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 4 Mar 2012 11:48:28 +0000 Subject: [Maxima] question on solve_rec and solve_rec_rat Message-ID: <20120304114828.GR27472@cs-wsok.swan.ac.uk> Hello, I want to find the solution for the recurrence t(0) = 1 t(n) = n*t(n-1) + n*n + 1 I use load(solve_rec); solve_rec(t[n]=n*t[n-1]+n*n+1, t[n]); t[n] = ('sum((%j^2+2*%j+2)/(%j+1)!,%j,0,n-1))*n!+%k[1]*n! Okay, I understand "%j" as summation-index; but what is "%k" ? And apparently it is an array? The documentation of solve_rec gives as first example solve_rec(a[n]=a[n-1]+a[n-2]+n/2^n, a[n]); which yields a[n] = (sqrt(5)-1)^n*%k[1]*(-1)^n/2^n-n/(5*2^n)+(sqrt(5)+1)^n*%k[2]/2^n-2^(1-n)/5 Again we find %k. Perhaps these are the initial conditions? Apparently k[1] = a[0] and k[2] = a[1]. This one should say in the documentation. It would also be good to show this example with initial conditions (actually, just giving the same example for a, but this time specifying one or two initial conditions would give a good hint what that %k is for --- but it can't hurt to also say it directly). Next I try solve_rec_rat(t[n]=n*t[n-1]+n*n+1, t[n], t[0]=1); and get an error: "Too many" arguments supplied to solve_rec_rat(eqn,fn); found: [t[n] = n*t[n-1]+n^2+1,t[n],t[0] = 1] -- an error. To debug this try: debugmode(true); So apparently the documentatioin of solve_rec_rat needs to be updated, since the "[init]"-argument is no longer there. And then, what does solve_rec_rat compute? The sentence in the documentation Solves for rational solutions to linear recurrences. See solve_rec for description of arguments. says nothing to me (while giving the impression it would be similar to solve_rec). It yields solve_rec_rat(t[n]=n*t[n-1]+n*n+1, t[n]); t[n] = %k[2]*n+%k[1] which doesn't seem to make sense. I think just a few updates to the documentation of solve_rec and solve_rec_rat would help a lot. Thanks for your time. Oliver From wilhelm.haager at htlstp.ac.at Mon Mar 5 12:20:49 2012 From: wilhelm.haager at htlstp.ac.at (Wilhelm Haager) Date: Mon, 05 Mar 2012 19:20:49 +0100 Subject: [Maxima] Problem with limit, zeroa, zerob Message-ID: <6308eea102c26a9ed97d2889439b7f0b@localhost> Hi, I think I have a problem with the constants zeroa and zerob (or does Maxima have that problem?): When I calculate the limit of sin(x)/abs(x) towards 0+ limit(sin(x)/abs(x),x,zeroa) I get the result "und", but is'nt the correct result "1"? Substituting x by 1/y and calculating the limit towards "inf" results in the expected answer. Thanks in advance Wilhelm Haager From wilhelm.haager at htlstp.ac.at Mon Mar 5 12:34:59 2012 From: wilhelm.haager at htlstp.ac.at (Wilhelm Haager) Date: Mon, 05 Mar 2012 19:34:59 +0100 Subject: [Maxima] limit, zeroa, zerob Message-ID: <000394c4c20e5595d6d0f051d4345382@localhost> Sorry, I have overlooked the possibility of giving the direction parameter "plus" or "minus", but the use of "zeroa" and "zerob" is still not clear for me. Wilhelm From dmitry.zhu at gmail.com Mon Mar 5 12:56:08 2012 From: dmitry.zhu at gmail.com (Tong Zhu) Date: Tue, 6 Mar 2012 07:56:08 +1300 Subject: [Maxima] Installation problem: cannot run maxima (MacBook) Message-ID: Hello, I can install maxima, gnuplot and wxMaxima with no error messages. However, I have trouble running maxima in the Terminal. Below are the messages I have: Maxima 5.26.0 http://maxima.sourceforge.net using Lisp CMU Common Lisp 20a (20A Unicode) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. then I tried to test it with 1+1 (%i1) 1+1 It stopped there with no response at al. It happens both on my Mac (intel duo core) and Linux (Fedora) machines. I have also tried a few different combinations of various versions of CMUCL and Maxima. It did not solve the problem. The only version of CMUCL I had not tried was *19d. *I believe it is the one that should work but I could not find the source file for x86-darwin machine. The funnies part was that I used to have maxima and wxMaxima working perfectly fine on my Mac but after I upgraded the system from Tiger to Snow Leopard, I could never run maxima anymore... I have also tried to install it by .dmg file. However, I cannot run maxima (by clicking .maxima in the Application folder) as well. I understand that it is because my Mac has a 32-bit CPU while the .dmg version only works for 64-bit CPU. Is my understanding correct? Or are there any solutions to this problem in particular? My computer knowledge is very limited and I am exhausted after installing almost every versions of CMUCL and Maxima... Any help is much appreciated. Thank you so much. Best, Tong Zhu -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Mon Mar 5 13:13:26 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 5 Mar 2012 11:13:26 -0800 Subject: [Maxima] Installation problem: cannot run maxima (MacBook) In-Reply-To: References: Message-ID: On Mon, Mar 5, 2012 at 10:56 AM, Tong Zhu wrote: > Hello, > > I can install maxima, gnuplot and wxMaxima with no error messages. > However, I have trouble running maxima in the Terminal. Below are the > messages I have: > > Maxima 5.26.0 http://maxima.sourceforge.net > using Lisp CMU Common Lisp 20a (20A Unicode) > Distributed under the GNU Public License. See the file COPYING. > Dedicated to the memory of William Schelter. > The function bug_report() provides bug reporting information. > > > then I tried to test it with 1+1 > > (%i1) 1+1 > > > If you are running from the command line, then you need to add a semicolon: 1 + 1; If you're using wxMaxima, I don't know since I don't use that. It stopped there with no response at al. It happens both on my Mac (intel > duo core) and Linux (Fedora) machines. I have also tried a few different > combinations of various versions of CMUCL and Maxima. It did not solve the > problem. The only version of CMUCL I had not tried was *19d. *I believe > it is the one that should work but I could not find the source file for > x86-darwin machine. The funnies part was that I used to have maxima and > wxMaxima working perfectly fine on my Mac but after I upgraded the system > from Tiger to Snow Leopard, I could never run maxima anymore... > I regularly run maxima with cmucl on Snow Leopard. Works fine. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitry.zhu at gmail.com Mon Mar 5 13:33:58 2012 From: dmitry.zhu at gmail.com (Tong Zhu) Date: Tue, 6 Mar 2012 08:33:58 +1300 Subject: [Maxima] Installation problem: cannot run maxima (MacBook) In-Reply-To: References: Message-ID: It certainly does work... Thank you so much Raymond. I am hitting against the wall right now... Well at least that mean almost all versions of CMUCL works well with maxima... Best, Tong Zhu On 6 March 2012 08:13, Raymond Toy wrote: > > > On Mon, Mar 5, 2012 at 10:56 AM, Tong Zhu wrote: > >> Hello, >> >> I can install maxima, gnuplot and wxMaxima with no error messages. >> However, I have trouble running maxima in the Terminal. Below are the >> messages I have: >> >> Maxima 5.26.0 http://maxima.sourceforge.net >> using Lisp CMU Common Lisp 20a (20A Unicode) >> Distributed under the GNU Public License. See the file COPYING. >> Dedicated to the memory of William Schelter. >> The function bug_report() provides bug reporting information. >> >> >> then I tried to test it with 1+1 >> >> (%i1) 1+1 >> >> >> If you are running from the command line, then you need to add a > semicolon: > > 1 + 1; > > If you're using wxMaxima, I don't know since I don't use that. > > It stopped there with no response at al. It happens both on my Mac (intel >> duo core) and Linux (Fedora) machines. I have also tried a few different >> combinations of various versions of CMUCL and Maxima. It did not solve the >> problem. The only version of CMUCL I had not tried was *19d. *I believe >> it is the one that should work but I could not find the source file for >> x86-darwin machine. The funnies part was that I used to have maxima and >> wxMaxima working perfectly fine on my Mac but after I upgraded the system >> from Tiger to Snow Leopard, I could never run maxima anymore... >> > > I regularly run maxima with cmucl on Snow Leopard. Works fine. > > Ray > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From harald at ccbib.org Mon Mar 5 15:44:58 2012 From: harald at ccbib.org (Harald Geyer) Date: Mon, 05 Mar 2012 22:44:58 +0100 Subject: [Maxima] limit, zeroa, zerob In-Reply-To: <000394c4c20e5595d6d0f051d4345382@localhost> References: <000394c4c20e5595d6d0f051d4345382@localhost> Message-ID: > Sorry, I have overlooked the possibility of giving the direction > parameter "plus" or "minus", > but the use of "zeroa" and "zerob" is still not clear for me. I believe these are just internal variables that never should be entered by the user directly. I might be wrong. HTH, Harald From woollett at charter.net Mon Mar 5 17:11:04 2012 From: woollett at charter.net (Edwin Woollett) Date: Mon, 5 Mar 2012 15:11:04 -0800 Subject: [Maxima] quad_control: one message not surpressed Message-ID: <9A160F262DE94147AF6567249E031F8D@edwinc367e16bd> One message from slatec is not surpressed when using quad_control: ---------------------------------------- (%i1) display2d:false$ (%i2) float(bessel_i(1,10^4)); ***MESSAGE FROM ROUTINE DBESI1 IN LIBRARY SLATEC. ***FATAL ERROR, PROG ABORTED, TRACEBACK REQUESTED * ABS(X) SO BIG I1 OVERFLOWS * ERROR NUMBER = 2 * ***END OF MESSAGE ***JOB ABORT DUE TO FATAL ERROR. 0 ERROR MESSAGE SUMMARY LIBRARY SUBROUTINE MESSAGE START NERR LEVEL COUNT SLATEC DBESI1 ABS(X) SO BIG I1 OVE 2 2 1 (%o2) 1..#INF00e+000E+0 (%i3) quad_control ('control,0)$ (%i4) float(bessel_i(1,10^4)); * ABS(X) SO BIG I1 OVERFLOWS (%o4) 1..#INF00e+000E+2289304 --------------------------- Ted From toy.raymond at gmail.com Tue Mar 6 00:28:26 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 05 Mar 2012 22:28:26 -0800 Subject: [Maxima] quad_control: one message not surpressed In-Reply-To: <9A160F262DE94147AF6567249E031F8D@edwinc367e16bd> References: <9A160F262DE94147AF6567249E031F8D@edwinc367e16bd> Message-ID: On 3/5/12 3:11 PM, Edwin Woollett wrote: > One message from slatec is not surpressed when > using quad_control: > ---------------------------------------- > (%i1) display2d:false$ > > (%i2) float(bessel_i(1,10^4)); > > ***MESSAGE FROM ROUTINE DBESI1 IN LIBRARY SLATEC. > ***FATAL ERROR, PROG ABORTED, TRACEBACK REQUESTED > * ABS(X) SO BIG I1 OVERFLOWS > * ERROR NUMBER = 2 > * ***END OF MESSAGE I think that's because it's a fatal error and dbesi is expecting the program to abort. Of course, we don't. I think it would be better to handle this in the Lisp wrapper and check for overflows there instead of mucking around with the slatec fortran routines. Ray From andrej.vodopivec at gmail.com Tue Mar 6 02:13:31 2012 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Tue, 6 Mar 2012 09:13:31 +0100 Subject: [Maxima] question on solve_rec and solve_rec_rat In-Reply-To: <20120304114828.GR27472@cs-wsok.swan.ac.uk> References: <20120304114828.GR27472@cs-wsok.swan.ac.uk> Message-ID: On Sun, Mar 4, 2012 at 12:48 PM, Oliver Kullmann wrote: > a[n] = (sqrt(5)-1)^n*%k[1]*(-1)^n/2^n-n/(5*2^n)+(sqrt(5)+1)^n*%k[2]/2^n-2^(1-n)/5 > > Again we find %k. Perhaps these are the initial conditions? > Apparently k[1] = a[0] and k[2] = a[1]. > > This one should say in the documentation. > > It would also be good to show this example with initial conditions > (actually, just giving the same example for a, but this time specifying one > or two initial conditions would give a good hint what that %k is for --- but > it can't hurt to also say it directly). A general solution of a recurrence equation contains some parameters, which are represented as %k[1],...,%k[d]. This are not initial terms, but if initial terms are provided, then the values for parameters can be computed. > Next I try > solve_rec_rat(t[n]=n*t[n-1]+n*n+1, t[n], t[0]=1); > and get an error: > > "Too many" arguments supplied to solve_rec_rat(eqn,fn); found: > ? ? ? ? ?[t[n] = n*t[n-1]+n^2+1,t[n],t[0] = 1] > ?-- an error. To debug this try: debugmode(true); This is a bug in the documentation. solve_rec_rat does not accept initial terms as a parameter. Andrej From woollett at charter.net Tue Mar 6 12:18:52 2012 From: woollett at charter.net (Edwin Woollett) Date: Tue, 6 Mar 2012 10:18:52 -0800 Subject: [Maxima] quad_control: one message not surpressed Message-ID: On Mar. 6, Raymond Toy wrote ---------------------- >> One message from slatec is not surpressed when >> using quad_control: >> ---------------------------------------- >> (%i1) display2d:false$ >> >> (%i2) float(bessel_i(1,10^4)); >> >> ***MESSAGE FROM ROUTINE DBESI1 IN LIBRARY SLATEC. >> ***FATAL ERROR, PROG ABORTED, TRACEBACK REQUESTED >> * ABS(X) SO BIG I1 OVERFLOWS >> * ERROR NUMBER = 2 >> * ***END OF MESSAGE > >I think that's because it's a fatal error and dbesi is expecting the >program to abort. Of course, we don't. > >I think it would be better to handle this in the Lisp wrapper and check >for overflows there instead of mucking around with the slatec fortran >routines. --------------------------- I agree. Ted From r2d2floyd at mac.com Wed Mar 7 02:16:32 2012 From: r2d2floyd at mac.com (R.D. Floyd) Date: Wed, 7 Mar 2012 00:16:32 -0800 Subject: [Maxima] Maxima version for MAC OSX ppc Message-ID: Is there a version of Maxima that runs on the MAC PowerPC G4 OS X version 10.5.8? TIA -- R.D.Floyd, Asst Prof Physics Emerotus From javier.arantegui at gmail.com Wed Mar 7 04:31:06 2012 From: javier.arantegui at gmail.com (Javier Arantegui) Date: Wed, 7 Mar 2012 11:31:06 +0100 Subject: [Maxima] Maxima version for MAC OSX ppc In-Reply-To: References: Message-ID: Hi, I think that the best option is Fink. Install Fink: http://www.finkproject.org/index.php You will need to install the developer tools. They are in the Mac OS installation discs and they are a free download in Apple's website (registration required). Then, you could download Maxima, wxMaxima, etc. and compile them for your system: http://pdb.finkproject.org/pdb/package.php/bundle-maxima?rel_id=10.5-powerpc-current-stable It's quite easy. Compiling takes time but you don't need to be in front of your computer, lunch times and nights are good options. I hope this helps. Javier On Wed, Mar 7, 2012 at 9:16 AM, R.D. Floyd wrote: > Is there a version of Maxima that runs on the MAC PowerPC G4 OS X version > 10.5.8? > > TIA > > -- > R.D.Floyd, Asst Prof Physics Emerotus > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- Lee mi blog: "Un peque?o paso para Neil" http://up3n.wordpress.com/ ?Ahora tambi?n en Twitter! http://twitter.com/javierarantegui From alexanderk.hansen at gmail.com Wed Mar 7 07:30:10 2012 From: alexanderk.hansen at gmail.com (Alexander Hansen) Date: Wed, 07 Mar 2012 08:30:10 -0500 Subject: [Maxima] Maxima version for MAC OSX ppc In-Reply-To: References: Message-ID: <4F5762E2.90608@gmail.com> Hi. I'm the maintainer for maxima for Fink. Just to amplify on what Javier told you, we do provide an up-to-date maxima package for PowerPCs. We use SBCL as the lisp interpreter for maxima--that's not quite up-to-date (1.0.54 vs. 1.0.55), due to an upstream bug in the PowerPC build. If you decide to use Fink, feel free to report any problems with the build to our general mailing lists: fink-beginners at lists.sourceforge.net -or- fink-users at lists.sourceforge.net or else contact me. On 3/7/12 5:31 AM, Javier Arantegui wrote: > Hi, > > I think that the best option is Fink. Install Fink: > > http://www.finkproject.org/index.php > > You will need to install the developer tools. They are in the Mac OS > installation discs and they are a free download in Apple's website > (registration required). > > Then, you could download Maxima, wxMaxima, etc. and compile them for > your system: > > http://pdb.finkproject.org/pdb/package.php/bundle-maxima?rel_id=10.5-powerpc-current-stable > > It's quite easy. Compiling takes time but you don't need to be in > front of your computer, lunch times and nights are good options. > > I hope this helps. > > Javier > > > > On Wed, Mar 7, 2012 at 9:16 AM, R.D. Floyd wrote: >> Is there a version of Maxima that runs on the MAC PowerPC G4 OS X version >> 10.5.8? >> >> TIA >> >> -- >> R.D.Floyd, Asst Prof Physics Emerotus >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > > From razif66 at gmail.com Thu Mar 8 01:59:57 2012 From: razif66 at gmail.com (razif razali) Date: Thu, 8 Mar 2012 15:59:57 +0800 Subject: [Maxima] how to simplify this equation Message-ID: I have below equation ------------------ %e^(-sqrt(sqrt(73)-10)*%psi-sqrt(-sqrt(73)-10)*%psi)*((7*sqrt(73)+73)*f_6_1(0)*%e^(2*sqrt(sqrt(73)-10)*%psi+sqrt(-sqrt(73)-10)*%psi)+((73-7*sqrt(73))*f_6_1(0)*%e^(2*sqrt(-sqrt(73)-10)*%psi)+(73-7*sqrt(73))*f_6_1(0))*%e^(sqrt(sqrt(73)-10)*%psi)+(7*sqrt(73)+73)*f_6_1(0)*%e^(sqrt(-sqrt(73)-10)*%psi))/292; ------------- and I want to simplify the equation so that it become (longEquation) x f_6_1(0) can anyone give me some hint on how to do it?it seems fullratsimp, tragsimp can't help me to do it.. thanks in advanced -- Regards, RAZIF RAZALI, -------------- next part -------------- An HTML attachment was scrubbed... URL: From andre.maute at gmx.de Thu Mar 8 04:28:12 2012 From: andre.maute at gmx.de (andre maute) Date: Thu, 08 Mar 2012 11:28:12 +0100 Subject: [Maxima] how to simplify this equation In-Reply-To: References: Message-ID: <4F5889BC.1000103@gmx.de> On 03/08/2012 08:59 AM, razif razali wrote: > I have below equation > ------------------ > %e^(-sqrt(sqrt(73)-10)*%psi-sqrt(-sqrt(73)-10)*%psi)*((7*sqrt(73)+73)*f_6_1(0)*%e^(2*sqrt(sqrt(73)-10)*%psi+sqrt(-sqrt(73)-10)*%psi)+((73-7*sqrt(73))*f_6_1(0)*%e^(2*sqrt(-sqrt(73)-10)*%psi)+(73-7*sqrt(73))*f_6_1(0))*%e^(sqrt(sqrt(73)-10)*%psi)+(7*sqrt(73)+73)*f_6_1(0)*%e^(sqrt(-sqrt(73)-10)*%psi))/292; > ------------- > and I want to simplify the equation so that it become (longEquation) x > f_6_1(0) > > can anyone give me some hint on how to do it?it seems fullratsimp, tragsimp > can't help me to do it.. This is no equation, there is no "=" sign, nevertheless one could try display2d : false; t : %e^(-sqrt(sqrt(73)-10)*%psi-sqrt(-sqrt(73)-10)*%psi)*((7*sqrt(73)+73)*f_6_1(0)*%e^(2*sqrt(sqrt(73)-10)*%psi+sqrt(-sqrt(73)-10)*%psi)+((73-7*sqrt(73))*f_6_1(0)*%e^(2*sqrt(-sqrt(73)-10)*%psi)+(73-7*sqrt(73))*f_6_1(0))*%e^(sqrt(sqrt(73)-10)*%psi)+(7*sqrt(73)+73)*f_6_1(0)*%e^(sqrt(-sqrt(73)-10)*%psi))/292; ratsimp(t/f_6_1(0)*f_6_1_0); From mickle.mouse at gmail.com Thu Mar 8 12:26:33 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Thu, 8 Mar 2012 11:26:33 -0700 Subject: [Maxima] how to simplify this equation In-Reply-To: References: Message-ID: There are actually a couple of ways of doing this. My favorite method is to use a package called 'scifac' which includes a method called 'gcfac.' Sometimes it is helpful to declare a variable as 'mainvar,' but it is not necessary here. solution 1: as andre maute suggested. --- (%i12) display2d:false$ (%i13) expr: %e^(-sqrt(sqrt(73)-10)*%psi-sqrt(-sqrt(73)-10)*%psi)*((7*sqrt(73)+73)*f_6_1(0)*%e^(2*sqrt(sqrt(73)-10)*%psi+sqrt(-sqrt(73)-10)*%psi)+((73-7*sqrt(73))*f_6_1(0)*%e^(2*sqrt(-sqrt(73)-10)*%psi)+(73-7*sqrt(73))*f_6_1(0))*%e^(sqrt(sqrt(73)-10)*%psi)+(7*sqrt(73)+73)*f_6_1(0)*%e^(sqrt(-sqrt(73)-10)*%psi))/292$ (%i14) ratsimp(expr/f_6_1(0)) * f_6_1(0); (%o14) f_6_1(0)*%e^(-sqrt(sqrt(73)-10)*%psi-sqrt(-sqrt(73)-10)*%psi) *((7*sqrt(73)+73)*%e^(2*sqrt(sqrt(73)-10)*%psi +sqrt(-sqrt(73)-10)*%psi) +((73-7*sqrt(73))*%e^(2*sqrt(-sqrt(73)-10)*%psi) -7*sqrt(73)+73) *%e^(sqrt(sqrt(73)-10)*%psi) +(7*sqrt(73)+73)*%e^(sqrt(-sqrt(73)-10)*%psi)) Solution 2, there is actually a special package for this kind of simplification: display2d:false$ (%i15) expr: %e^(-sqrt(sqrt(73)-10)*%psi-sqrt(-sqrt(73)-10)*%psi)*((7*sqrt(73)+73)*f_6_1(0)*%e^(2*sqrt(sqrt(73)-10)*%psi+sqrt(-sqrt(73)-10)*%psi)+((73-7*sqrt(73))*f_6_1(0)*%e^(2*sqrt(-sqrt(73)-10)*%psi)+(73-7*sqrt(73))*f_6_1(0))*%e^(sqrt(sqrt(73)-10)*%psi)+(7*sqrt(73)+73)*f_6_1(0)*%e^(sqrt(-sqrt(73)-10)*%psi))/292$ (%i16) load(scifac)$ (%i17) gcfac( expr ); (%o17) f_6_1(0)*%e^-((sqrt(-(sqrt(73)+10))+sqrt(sqrt(73)-10))*%psi) *((7*sqrt(73)+73)*%e^((sqrt(-(sqrt(73)+10)) +2*sqrt(sqrt(73)-10)) *%psi) +(73-7*sqrt(73))*%e^(sqrt(sqrt(73)-10)*%psi) *(%e^(2*sqrt(-(sqrt(73)+10))*%psi)+1) +(7*sqrt(73)+73)*%e^(sqrt(-(sqrt(73)+10))*%psi)) On Thu, Mar 8, 2012 at 12:59 AM, razif razali wrote: > > I have below equation > ------------------ > %e^(-sqrt(sqrt(73)-10)*%psi-sqrt(-sqrt(73)-10)*%psi)*((7*sqrt(73)+73)*f_6_1(0)*%e^(2*sqrt(sqrt(73)-10)*%psi+sqrt(-sqrt(73)-10)*%psi)+((73-7*sqrt(73))*f_6_1(0)*%e^(2*sqrt(-sqrt(73)-10)*%psi)+(73-7*sqrt(73))*f_6_1(0))*%e^(sqrt(sqrt(73)-10)*%psi)+(7*sqrt(73)+73)*f_6_1(0)*%e^(sqrt(-sqrt(73)-10)*%psi))/292; > ------------- > and I want to simplify the equation so that it become (longEquation) x f_6_1(0) > > can anyone give me some hint on how to do it?it seems fullratsimp, tragsimp can't help me to do it.. > > thanks in advanced > -- > Regards, > > RAZIF RAZALI, > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vishraj at gmail.com Thu Mar 8 13:06:18 2012 From: vishraj at gmail.com (Vishnu Rajasekharan) Date: Thu, 8 Mar 2012 12:06:18 -0700 Subject: [Maxima] Using one of the roots of a polynomial Message-ID: Greetings, I obtained three roots for a cubic equation. I want to use one of the roots later on in my calculation. Is there a way in maxima where I can pick and choose one of the roots for later use. Your help is highly appreciated. Best, Vishraj -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Thu Mar 8 13:10:48 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 8 Mar 2012 13:10:48 -0600 Subject: [Maxima] how to simplify this equation In-Reply-To: References: Message-ID: Try: factor(t) or rat(t, var) Where var is the main variable. On Mar 8, 2012 2:00 AM, "razif razali" wrote: > I have below equation > ------------------ > > %e^(-sqrt(sqrt(73)-10)*%psi-sqrt(-sqrt(73)-10)*%psi)*((7*sqrt(73)+73)*f_6_1(0)*%e^(2*sqrt(sqrt(73)-10)*%psi+sqrt(-sqrt(73)-10)*%psi)+((73-7*sqrt(73))*f_6_1(0)*%e^(2*sqrt(-sqrt(73)-10)*%psi)+(73-7*sqrt(73))*f_6_1(0))*%e^(sqrt(sqrt(73)-10)*%psi)+(7*sqrt(73)+73)*f_6_1(0)*%e^(sqrt(-sqrt(73)-10)*%psi))/292; > ------------- > and I want to simplify the equation so that it become (longEquation) x > f_6_1(0) > > can anyone give me some hint on how to do it?it seems fullratsimp, > tragsimp can't help me to do it.. > > thanks in advanced > -- > Regards, > > RAZIF RAZALI, > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Thu Mar 8 13:54:40 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 8 Mar 2012 11:54:40 -0800 Subject: [Maxima] Using one of the roots of a polynomial In-Reply-To: References: Message-ID: On Thu, Mar 8, 2012 at 11:06 AM, Vishnu Rajasekharan wrote: > Greetings, > > I obtained three roots for a cubic equation. I want to use one of the > roots later on in my calculation. Is there a way in maxima where I can pick > and choose one of the roots for later use. > > You mean something like this: (%i1) solve((x-1)*(x^2+x+1),x); (%o1) [x = -(sqrt(3)*%i+1)/2,x = (sqrt(3)*%i-1)/2,x = 1] (%i2) rhs(%o1[3]); (%o2) 1 For the second root, you can use rhs(%o1[2]). Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From jensaxel at soegaard.net Thu Mar 8 16:09:46 2012 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Thu, 8 Mar 2012 23:09:46 +0100 Subject: [Maxima] Using Maxima from Racket Message-ID: Hi All, I am trying to send commands from Racket to Maxima. Here is a normal interaction with Maxima in my terminal: soegaard$ /Applications/Maxima.app/Contents/Resources/maxima.sh Maxima 5.25.1 http://maxima.sourceforge.net using Lisp SBCL 1.0.47 Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) 1+2; (%o1) 3 (%i2) After displaying the welcome message, Maxima display the prompt "(%i1) ". Then I entered 1+2;. Maxima then evaluated the expression and printed the line beginning with (%o1). Maxima has an option -s that makes Maxima listen on a give port. I have used this to write the following: #lang racket (require racket/tcp) (define PORT 8082) (let ([listener (tcp-listen PORT 1 #t)]) (process (format "/Applications/Maxima.app/Contents/Resources/maxima.sh -s ~a >/dev/null" PORT)) (let-values ([(in out) (tcp-accept listener)]) (for ([i (in-range 6)]) ; there are 6 lines in the welcome message (display (read-line in)) (newline)) (display "prompt:\n") (write (read in)) ; this displays the prompt (%i1) (newline) (write (read-char in)) ; eat whitespace (newline) (display "Prompt read correctly.\n") (display "Sending command to Maxima.\n") (display "1+2;\n" out) (flush-output out) (display "Wait, before readin result.\n") (sleep 1) (display "Read and print the result one character at a time.\n") (for ([i (in-range 6)]) (display (peek-char in)) (display ".")))) This gives the following output when run in DrRacket: pid=15314 Maxima 5.25.1 http://maxima.sourceforge.net using Lisp SBCL 1.0.47 Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. prompt: (%i1) #\space Prompt read correctly. Sending command to Maxima. Wait, before readin result. Read and print the result one character at a time. (and then nothing is printed) My problem is that I don't get any output back. I have a feeling I am missing something obvious - but what? -- Jens Axel S?gaard -------------- next part -------------- An HTML attachment was scrubbed... URL: From marinho.rubens at gmail.com Thu Mar 8 19:24:34 2012 From: marinho.rubens at gmail.com (Rubens Marinho) Date: Thu, 8 Mar 2012 22:24:34 -0300 Subject: [Maxima] maxima bug Message-ID: Dear all, I think I have found a bug in maxima I have entered the following commands: reset();kill(all); assume(z>r); radcan(sqrt(r^2-2*z*r+z^2)); it gives z-r works fine but with capital R reset();kill(all); assume(z>R); radcan(sqrt(R^2-2*z*R+z^2)); it gives R-z should be z-R z-r Sincerely Rubens Marinho -------------- next part -------------- An HTML attachment was scrubbed... URL: From miguelmarinho at seoutopia.com Fri Mar 9 07:49:17 2012 From: miguelmarinho at seoutopia.com (Miguel Marinho) Date: Fri, 09 Mar 2012 13:49:17 +0000 Subject: [Maxima] List on Maxima Message-ID: <4F5A0A5D.9010502@seoutopia.com> Dear Sir, I would like to know if is possible to know the 1st element of a list (named a) by using a[0] in stead of using a[1]. Example: a:[10,11,12] a[0]=10 ; a[1]=11 ; a[2]=12 Your faithfully, Miguel Marinho From robert.dodier at gmail.com Fri Mar 9 10:04:15 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 9 Mar 2012 09:04:15 -0700 Subject: [Maxima] Using Maxima from Racket In-Reply-To: References: Message-ID: On 3/8/12, Jens Axel S?gaard wrote: > using Lisp SBCL 1.0.47 > Maxima has an option -s that makes Maxima listen on a give port. Well, maxima -s makes Maxima the client, not the server. For a simple-minded Unixish server, try share/contrib/maxima-server.lisp. It only works with SBCL, but you're in luck! See the comment header of maxima-server.lisp for some info. Also there are command-line options to suppress output cruft. Try maxima --help and look for --quiet and --very-quiet. As to the output format, after display2d:false, output is rendered in the so-called 1-d format, which might be easier to parse automatically. You can probably convince Maxima to return only S-expressions by :lisp (print #$$) I just tried maxima-server w/ --very-quiet and it looks like Maxima fails to flush its output buffer. If you want to try that I can look into it. HTH Robert Dodier From toy.raymond at gmail.com Fri Mar 9 10:37:14 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 9 Mar 2012 08:37:14 -0800 Subject: [Maxima] maxima bug In-Reply-To: References: Message-ID: On Thu, Mar 8, 2012 at 5:24 PM, Rubens Marinho wrote: > > > Dear all, > > I think I have found a bug in maxima > > I have entered the following commands: > > reset();kill(all); > assume(z>r); > radcan(sqrt(r^2-2*z*r+z^2)); > > it gives > > z-r > > works fine > > but with capital R > > reset();kill(all); > assume(z>R); > radcan(sqrt(R^2-2*z*R+z^2)); > > it gives > > R-z > > should be > z-R > I don't think this is a bug. Radcan does sometimes do things like this and that is the expected result. I don't think radcan recognizes assume either. See also http://cadadr.org/maxima/faq.html. We should document radcan better. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Fri Mar 9 10:39:10 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 9 Mar 2012 08:39:10 -0800 Subject: [Maxima] List on Maxima In-Reply-To: <4F5A0A5D.9010502@seoutopia.com> References: <4F5A0A5D.9010502@seoutopia.com> Message-ID: On Fri, Mar 9, 2012 at 5:49 AM, Miguel Marinho wrote: > Dear Sir, > > I would like to know if is possible to know the 1st element of a list > (named a) by using a[0] in stead of using a[1]. > > Example: > > a:[10,11,12] > > a[0]=10 ; a[1]=11 ; a[2]=12 > > I'm not aware of any way to use zero-indexed lists in maxima. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From hbaker1 at pipeline.com Fri Mar 9 10:58:57 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Fri, 09 Mar 2012 08:58:57 -0800 Subject: [Maxima] List on Maxima In-Reply-To: References: <4F5A0A5D.9010502@seoutopia.com> Message-ID: Maxima/Macsyma's Fortran envy strikes again! At 08:39 AM 3/9/2012, Raymond Toy wrote: >On Fri, Mar 9, 2012 at 5:49 AM, Miguel Marinho wrote: >Dear Sir, > >I would like to know if is possible to know the 1st element of a list (named a) by using a[0] in stead of using a[1]. > >Example: > >a:[10,11,12] > >a[0]=10 ; a[1]=11 ; a[2]=12 > >I'm not aware of any way to use zero-indexed lists in maxima. > >Ray From toy.raymond at gmail.com Fri Mar 9 11:05:14 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 9 Mar 2012 09:05:14 -0800 Subject: [Maxima] List on Maxima In-Reply-To: References: <4F5A0A5D.9010502@seoutopia.com> Message-ID: On Fri, Mar 9, 2012 at 8:58 AM, Henry Baker wrote: > Maxima/Macsyma's Fortran envy strikes again! > > What? Does Macsyma allow zero-indexed lists? And for those who don't use Fortran, even Fortran 77 (!) supports zero-indexed or even negative indexed arrays. ( http://www.fortran.com/F77_std/rjcnf0001-sh-5.html#sh-5.1.1) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From jensaxel at soegaard.net Fri Mar 9 11:47:48 2012 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Fri, 9 Mar 2012 18:47:48 +0100 Subject: [Maxima] Using Maxima from Racket In-Reply-To: References: Message-ID: Hi Robert, 2012/3/9 Robert Dodier > On 3/8/12, Jens Axel S?gaard wrote: > > > using Lisp SBCL 1.0.47 > > > Maxima has an option -s that makes Maxima listen on a give port. > > Well, maxima -s makes Maxima the client, not the server. > Yes. In my snippet I use the Racket construct tcp-accept to setup a listener, and I did get the welcome message from Maxima. > For a simple-minded Unixish server, try share/contrib/maxima-server.lisp. > It only works with SBCL, but you're in luck! > See the comment header of maxima-server.lisp for some info. > I'll take a look. > Also there are command-line options to suppress output cruft. > Try maxima --help and look for --quiet and --very-quiet. > Ooh! Thanks for pointing to --very-quiet. I missed them in the documentation. > As to the output format, after display2d:false, output is rendered in > the so-called 1-d format, which might be easier to parse automatically. > You can probably convince Maxima to return only S-expressions by > > :lisp (print #$$) > Great! This will be particular easy to parse in Scheme. I just tried maxima-server w/ --very-quiet and it looks like Maxima > fails to flush its output buffer. If you want to try that I can look into > it. > Since my original email, I have actually written a working repl. Something is puzzling me though. Using the -s option with Maxima on SBCL on OS X, I can receive the output from Maxima via the socket on the given port. Sending to Maxima via the socket doesn't work though. I have to send the commands via the input port of the Maxima process. Is this the intended way of sending commands to Maxima when using the -s flag? Maybe the cause of this is SBCL? The same (I think) problem is described here: http://osdir.com/ml/mathematics.maxima.general/2004-03/msg00020.html -- Jens Axel S?gaard -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Fri Mar 9 12:09:32 2012 From: willisb at unk.edu (Barton Willis) Date: Fri, 9 Mar 2012 12:09:32 -0600 Subject: [Maxima] List on Maxima In-Reply-To: References: <4F5A0A5D.9010502@seoutopia.com> Message-ID: One workaround (might need error checking, and ...) (%i42) aref(l,[k]) := apply('inpart, cons(l,map(lambda([s], s+1),k)))$ (%i43) aref([a,b,c],0); (%o43) a (%i44) aref([[1,2,3],[5,6,7]],0,1); (%o44) 2 (%i45) m : matrix([1,2,3],[4,5,6],[7,8,9]); (%o45) matrix([1,2,3],[4,5,6],[7,8,9]) (%i46) aref(m,0,1); (%o46) 2 The use of apply will be a problem (too many arguments for some versions of CL) --Barton From: Raymond Toy To: Henry Baker Cc: maxima at math.utexas.edu, Miguel Marinho Date: 03/09/2012 11:04 AM Subject: Re: [Maxima] List on Maxima Sent by: maxima-bounces at math.utexas.edu On Fri, Mar 9, 2012 at 8:58 AM, Henry Baker wrote: Maxima/Macsyma's Fortran envy strikes again! What? Does Macsyma allow zero-indexed lists? And for those who don't use Fortran, even Fortran 77 (!) supports zero-indexed or even negative indexed arrays. ( http://www.fortran.com/F77_std/rjcnf0001-sh-5.html#sh-5.1.1) Ray _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Fri Mar 9 12:18:24 2012 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 9 Mar 2012 18:18:24 +0000 (UTC) Subject: [Maxima] Using Maxima from Racket References: Message-ID: Jens Axel S?gaard wrote: > Hi Robert, > > 2012/3/9 Robert Dodier > >> On 3/8/12, Jens Axel S?gaard wrote: >> >> > using Lisp SBCL 1.0.47 >> >> > Maxima has an option -s that makes Maxima listen on a give port. >> >> Well, maxima -s makes Maxima the client, not the server. >> > > Yes. In my snippet I use the Racket construct tcp-accept to setup a > listener, > and I did get the welcome message from Maxima. > > >> For a simple-minded Unixish server, try share/contrib/maxima-server.lisp. >> It only works with SBCL, but you're in luck! >> See the comment header of maxima-server.lisp for some info. >> > > I'll take a look. > > >> Also there are command-line options to suppress output cruft. >> Try maxima --help and look for --quiet and --very-quiet. >> > > Ooh! Thanks for pointing to --very-quiet. I missed them in the > documentation. > > >> As to the output format, after display2d:false, output is rendered in >> the so-called 1-d format, which might be easier to parse automatically. >> You can probably convince Maxima to return only S-expressions by >> >> :lisp (print #$$) >> > > Great! This will be particular easy to parse in Scheme. > > I just tried maxima-server w/ --very-quiet and it looks like Maxima >> fails to flush its output buffer. If you want to try that I can look into >> it. >> > > Since my original email, I have actually written a working repl. > > Something is puzzling me though. Using the -s option with Maxima on SBCL on > OS X, I can receive the output from Maxima via the socket on the given port. > Sending to Maxima via the socket doesn't work though. I have to send the > commands via the input port of the Maxima process. > > Is this the intended way of sending commands to Maxima when using the -s > flag? > > Maybe the cause of this is SBCL? The same (I think) problem is described > here: > http://osdir.com/ml/mathematics.maxima.general/2004-03/msg00020.html > Try to use the technique in http://www.math.utexas.edu/pipermail/maxima/2012/027820.html -- Michel Talon From kcrisman at gmail.com Fri Mar 9 13:32:05 2012 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Fri, 9 Mar 2012 14:32:05 -0500 Subject: [Maxima] Can Maxima do this integral with some additional package? Message-ID: This came up in http://ask.sagemath.org/question/1222/difficult-integral . Is there an optional package which might do more integrals that are HG functions? (%i2) display2d:false; (%o2) false (%i3) integrate( (a/x + b*x^c)^d, x); (%o3) 'integrate((b*x^c+a/x)^d,x) Apparently Mathematica has no trouble with this in terms of hypergeometric functions. Here is Maxima, for various values of d. It can do positive integers, though sometimes with a ghastly series of questions :) Thanks! (%i8) integrate( (a/x + b*x^c)^(5/4),x); (%o8) 'integrate((b*x^c+a/x)^(5/4),x) (%i9) integrate( (a/x + b*x^c)^(20/3),x); (%o9) 'integrate((b*x^c+a/x)^(20/3),x) (%i5) integrate( (a/x + b*x^c)^3,x); Is c-1 zero or nonzero? nonzero; Is 3*c+1 zero or nonzero? nonzero; Is c zero or nonzero? nonzero; (%o5) b^3*x^(3*c+1)/(3*c+1)+3*a*b^2*x^(2*c)/(2*c)+3*a^2*b*x^(c-1)/(c-1)-a^3 /(2 *x^2) (%i6) integrate( (a/x + b*x^c)^4,x); Is c-2 zero or nonzero? nonzero; Is 4*c+1 zero or nonzero? nonzero; Is 2*c-1 zero or nonzero? nonzero; Is c zero or nonzero? nonzero; (%o6) b^4*x^(4*c+1)/(4*c+1)+6*a^2*b^2*x^(2*c-1)/(2*c-1)+4*a*b^3*x^(3*c)/(3*c) +4*a^3*b*x^(c-2)/(c-2)-a^4/(3*x^3) (%i7) integrate( (a/x + b*x^c)^24,x); Is c-22 zero or nonzero? nonzero; Is 24*c+1 zero or nonzero? nonzero; Is 2*c-21 zero or nonzero? nonzero; Is 3*c-20 zero or nonzero? nonzero; Is 4*c-19 zero or nonzero? nonzero; Is 5*c-18 zero or nonzero? nonzero; Is 6*c-17 zero or nonzero? nonzero; Is 7*c-16 zero or nonzero? nonzero; Is 8*c-15 zero or nonzero? nonzero; Is 9*c-14 zero or nonzero? nonzero; Is 10*c-13 zero or nonzero? nonzero; Is 11*c-12 zero or nonzero? nonzero; Is 12*c-11 zero or nonzero? nonzero; Is 13*c-10 zero or nonzero? nonzero; Is 14*c-9 zero or nonzero? nonzero; Is 15*c-8 zero or nonzero? nonzero; Is 16*c-7 zero or nonzero? nonzero; Is 17*c-6 zero or nonzero? nonzero; Is 18*c-5 zero or nonzero? nonzero; Is 19*c-4 zero or nonzero? nonzero; Is 20*c-3 zero or nonzero? nonzero; Is 21*c-2 zero or nonzero? nonzero; Is 22*c-1 zero or nonzero? nonzero; Is c zero or nonzero? nonzero; (%o7) b^24*x^(24*c+1)/(24*c+1)+276*a^2*b^22*x^(22*c-1)/(22*c-1) +2024*a^3*b^21*x^(21*c-2)/(21*c-2) +10626*a^4*b^20*x^(20*c-3)/(20*c-3) +42504*a^5*b^19*x^(19*c-4)/(19*c-4) +134596*a^6*b^18*x^(18*c-5)/(18*c-5) +346104*a^7*b^17*x^(17*c-6)/(17*c-6) +735471*a^8*b^16*x^(16*c-7)/(16*c-7) +1307504*a^9*b^15*x^(15*c-8)/(15*c-8) +1961256*a^10*b^14*x^(14*c-9)/(14*c-9) +2496144*a^11*b^13*x^(13*c-10)/(13*c-10) +2704156*a^12*b^12*x^(12*c-11)/(12*c-11) +2496144*a^13*b^11*x^(11*c-12)/(11*c-12) +1961256*a^14*b^10*x^(10*c-13)/(10*c-13) +1307504*a^15*b^9*x^(9*c-14)/(9*c-14) +735471*a^16*b^8*x^(8*c-15)/(8*c-15) +346104*a^17*b^7*x^(7*c-16)/(7*c-16) +134596*a^18*b^6*x^(6*c-17)/(6*c-17) +42504*a^19*b^5*x^(5*c-18)/(5*c-18) +10626*a^20*b^4*x^(4*c-19)/(4*c-19) +2024*a^21*b^3*x^(3*c-20)/(3*c-20) +276*a^22*b^2*x^(2*c-21)/(2*c-21) +24*a*b^23*x^(23*c)/(23*c) +24*a^23*b*x^(c-22)/(c-22)-a^24/(23*x^23) From andre.maute at gmx.de Fri Mar 9 19:13:09 2012 From: andre.maute at gmx.de (andre maute) Date: Sat, 10 Mar 2012 02:13:09 +0100 Subject: [Maxima] saving/loading a hashed array from/to file Message-ID: <4F5AAAA5.7090403@gmx.de> Hi list, as the subject says, suppose we have the following maxima file with a very simple hashed array function F ------------- hashed.max ------------ display2d : false; F[k] := block(print(" F",k),return(k*11)); for k : 1 thru 4 do block( h : F[k], print(k,h) ); print("----"); for k : 1 thru 4 do block( h : F[k], print(k,h) ); for k : 1 thru 4 do block( h : F[[k,k]], print(k,h) ); print("----"); for k : 1 thru 4 do block( h : F[[k,k]], print(k,h) ); print(F); print(arrayinfo(F)); print(listarray(F)); ------------- hashed.max ------------ Question: arrayinfo and listarray give the computed values, Is it possible to save this data to a file and and load it again for a later computation? Any hint where I should look in the documentation? Best regards Andre From rich.hennessy at verizon.net Fri Mar 9 22:31:00 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Fri, 09 Mar 2012 23:31:00 -0500 Subject: [Maxima] Is there a package for physics vector notation? Message-ID: <468A92A50CBB4EC8944894CBA0EFDE70@RichsLaptop> Hi, I want to use Maxima to use i, j, k notation for vectors and have a dot product and cross product operation for two vectors inputted this way. I have quickly tried the dirty method below but if there is something already written then maybe I can avoid reinventing the wheel. (%i9) reset(); (%o1) (%i2) kill(rules); (%o2) (%i3) kill(all); (%o0) (%i1) display2d:false; (%o1) false (%i2) tellsimp(i*i,1); (%o2) [?\^rule7,?simpexpt] (%i3) tellsimp(j*j,1); (%o3) [?\^rule8,?\^rule7,?simpexpt] (%i4) tellsimp(k*k,1); (%o4) [?\^rule9,?\^rule8,?\^rule7,?simpexpt] (%i5) v1=.7*i-3.4*j-.6*k; (%o5) v1 = -0.6*k-3.4*j+0.7*i (%i6) v2=1.4*i+6.9*j-9.78*k; (%o6) v2 = -9.779999999999999*k+6.9*j+1.4*i (%i7) v1*v2,%o5,%o6; (%o7) (-9.779999999999999*k+6.9*j+1.4*i)*(-0.6*k-3.4*j+0.7*i) (%i8) expand(%); (%o8) 29.112*j*k-7.685999999999999*i*k+0.07*i*j-16.612 I can pick off the answer as the last item in the last sum (-16.612). Is there another way? As far as the cross product is concerned, I know there already is a way using matrices, but I want to avoid that too. Rich From villate at fe.up.pt Sat Mar 10 03:36:57 2012 From: villate at fe.up.pt (Jaime Villate) Date: Sat, 10 Mar 2012 09:36:57 +0000 Subject: [Maxima] Is there a package for physics vector notation? In-Reply-To: <468A92A50CBB4EC8944894CBA0EFDE70@RichsLaptop> References: <468A92A50CBB4EC8944894CBA0EFDE70@RichsLaptop> Message-ID: <4F5B20B9.4050508@fe.up.pt> On 03/10/2012 04:31 AM, Richard Hennessy wrote: > I want to use Maxima to use i, j, k notation for vectors and have a > dot product and cross product operation for two vectors inputted this > way. I have quickly tried the dirty method below but if there is > something already written then maybe I can avoid reinventing the wheel. > Hi Richard, I have to work with vectors in Maxima very often and the best solution I've found is to represent them as lists. Check this out to see whether you like it: (%i1) display2d: false$ (%i2) fpprintprec: 12$ (%i3) [i,j,k]: [[1,0,0],[0,1,0],[0,0,1]]$ (%i4) ?(a,b) := determinant(matrix([i,j,k],a,b))$ (%i5) infix(?)$ (%i6) v1: .7*i-3.4*j-.6*k; (%o6) [0.7,-3.4,-0.6] (%i7) v2: 1.4*i+6.9*j-9.78*k; (%o7) [1.4,6.9,-9.78] (%i8) v1.v2; (%o8) -16.612 (%i9) v1?v2; (%o9) [37.392,6.006,9.59] If you do not want to use the Unicode character ? that I used for the cross product, or if the Lisp flavor you are using will not allow it, you can also define the cross product as cross(a,b) Regards, Jaime From andre.maute at gmx.de Sat Mar 10 06:37:26 2012 From: andre.maute at gmx.de (andre maute) Date: Sat, 10 Mar 2012 13:37:26 +0100 Subject: [Maxima] saving/loading a hashed array from/to file In-Reply-To: <4F5AAAA5.7090403@gmx.de> References: <4F5AAAA5.7090403@gmx.de> Message-ID: <4F5B4B06.2000604@gmx.de> On 03/10/2012 02:13 AM, andre maute wrote: > Hi list, > > as the subject says, suppose we have the following maxima file > with a very simple hashed array function F > > ------------- hashed.max ------------ > display2d : false; > > F[k] := block(print(" F",k),return(k*11)); > > for k : 1 thru 4 do block( > h : F[k], > print(k,h) > ); > print("----"); > for k : 1 thru 4 do block( > h : F[k], > print(k,h) > ); > > for k : 1 thru 4 do block( > h : F[[k,k]], > print(k,h) > ); > print("----"); > for k : 1 thru 4 do block( > h : F[[k,k]], > print(k,h) > ); > > print(F); > print(arrayinfo(F)); > print(listarray(F)); > ------------- hashed.max ------------ > > Question: > > arrayinfo and listarray give the computed values, > Is it possible to save this data to a file and > and load it again for a later computation? > > Any hint where I should look in the documentation? Reduced question: if I already know, that F should look like (%i10) arrayinfo(F) (%o10) [hashed,1,[1],[2],[3],[4],[[1,1]],[[2,2]],[[3,3]],[[4,4]]] (%i11) listarray(F) (%o11) [11,22,33,44,[11,11],[22,22],[33,33],[44,44]] but don't want to recalculate using F, how can I attach this data to F? Best regards Andre From andre.maute at gmx.de Sat Mar 10 08:34:58 2012 From: andre.maute at gmx.de (andre maute) Date: Sat, 10 Mar 2012 15:34:58 +0100 Subject: [Maxima] saving/loading a hashed array from/to file In-Reply-To: <4F5B52C1.8020605@eecs.berkeley.edu> References: <4F5AAAA5.7090403@gmx.de> <4F5B4B06.2000604@gmx.de> <4F5B52C1.8020605@eecs.berkeley.edu> Message-ID: <4F5B6692.8020200@gmx.de> On 03/10/2012 02:10 PM, Richard Fateman wrote: > did you try the save command? Ah! save("./Fdata.lisp",F); load("./Fdata.lisp"); works. I read the documentation of save and load, but due to the missing variable of load I thought you can't get the data back to F but now I see that the name F is stored in the lisp file too. But my reduced question remains. If I have two lists ai : [hashed,1,[1],[2],[3],[4],[[1,1]],[[2,2]],[[3,3]],[[4,4]]]; la : [11,22,33,44,[11,11],[22,22],[33,33],[44,44]]; is it possible to attach them to F? Kind regards, Andre > > On 3/10/12 4:37 AM, andre maute wrote: >> On 03/10/2012 02:13 AM, andre maute wrote: >>> Hi list, >>> >>> as the subject says, suppose we have the following maxima file >>> with a very simple hashed array function F >>> >>> ------------- hashed.max ------------ >>> display2d : false; >>> >>> F[k] := block(print(" F",k),return(k*11)); >>> >>> for k : 1 thru 4 do block( >>> h : F[k], >>> print(k,h) >>> ); >>> print("----"); >>> for k : 1 thru 4 do block( >>> h : F[k], >>> print(k,h) >>> ); >>> >>> for k : 1 thru 4 do block( >>> h : F[[k,k]], >>> print(k,h) >>> ); >>> print("----"); >>> for k : 1 thru 4 do block( >>> h : F[[k,k]], >>> print(k,h) >>> ); >>> >>> print(F); >>> print(arrayinfo(F)); >>> print(listarray(F)); >>> ------------- hashed.max ------------ >>> >>> Question: >>> >>> arrayinfo and listarray give the computed values, >>> Is it possible to save this data to a file and >>> and load it again for a later computation? >>> >>> Any hint where I should look in the documentation? >> >> Reduced question: >> >> if I already know, that F should look like >> >> (%i10) arrayinfo(F) >> (%o10) [hashed,1,[1],[2],[3],[4],[[1,1]],[[2,2]],[[3,3]],[[4,4]]] >> (%i11) listarray(F) >> (%o11) [11,22,33,44,[11,11],[22,22],[33,33],[44,44]] >> >> but don't want to recalculate using F, >> how can I attach this data to F? >> >> Best regards >> Andre >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > > From toy.raymond at gmail.com Sat Mar 10 12:04:58 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 10 Mar 2012 10:04:58 -0800 Subject: [Maxima] [Maxima-commits] Maxima, A Computer Algebra System branch master updated. 5.26.0-80-g578fd63 In-Reply-To: References: Message-ID: <4F5B97CA.5090703@gmail.com> On 3/10/12 9:55 AM, Dan Gildea wrote: > This is an automated email from the git hooks/post-receive script. It was > generated because a ref change was pushed to the repository containing > the project "Maxima, A Computer Algebra System". > > The branch, master has been updated > via 578fd635a3f7933a8d7e01f0d0ed75d295b8f898 (commit) > from aa5722262ab76b15f12f64cc24be24a39213e26e (commit) > > Those revisions listed above that are new to this repository have > not appeared on any other notification email; so we list those > revisions in full, below. > > - Log ----------------------------------------------------------------- > commit 578fd635a3f7933a8d7e01f0d0ed75d295b8f898 > Author: Dan Gildea > Date: Sat Mar 10 12:53:26 2012 -0500 > > fix Integration of products of sin(nz)/(nz) sometimes fails - ID: 3497046 > > src/defint.lisp: > o mtosc: don't check for poles. > You set intanalysis to false now. Is that really the right solution? Hard to tell from the comments on why this is right. If it is, can we have a better explanation? The code is hard enough to understand as it is, but let's not continue the bad habit of zero documentation. Ray, who is guilty of this, but is trying not to. From rich.hennessy at verizon.net Sat Mar 10 12:25:46 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sat, 10 Mar 2012 13:25:46 -0500 Subject: [Maxima] Is there a package for physics vector notation? In-Reply-To: <4F5B20B9.4050508@fe.up.pt> References: <468A92A50CBB4EC8944894CBA0EFDE70@RichsLaptop> <4F5B20B9.4050508@fe.up.pt> Message-ID: <6B53FA0EE7F540F58017A52A9698C11F@RichsLaptop> Hi Jaime, Thanks, this is just what I have been looking for. The only thing is, I don't mind the answers coming back as lists except when you have to use the answer as input in another computation, then you would have to turn the list back into i,j,k notation. Is that something you have done? I may be able to figure out something, or not. Rich -----Original Message----- From: Jaime Villate Sent: Saturday, March 10, 2012 4:36 AM To: maxima at math.utexas.edu Subject: Re: [Maxima] Is there a package for physics vector notation? On 03/10/2012 04:31 AM, Richard Hennessy wrote: > I want to use Maxima to use i, j, k notation for vectors and have a dot > product and cross product operation for two vectors inputted this way. I > have quickly tried the dirty method below but if there is something > already written then maybe I can avoid reinventing the wheel. > Hi Richard, I have to work with vectors in Maxima very often and the best solution I've found is to represent them as lists. Check this out to see whether you like it: (%i1) display2d: false$ (%i2) fpprintprec: 12$ (%i3) [i,j,k]: [[1,0,0],[0,1,0],[0,0,1]]$ (%i4) ?(a,b) := determinant(matrix([i,j,k],a,b))$ (%i5) infix(?)$ (%i6) v1: .7*i-3.4*j-.6*k; (%o6) [0.7,-3.4,-0.6] (%i7) v2: 1.4*i+6.9*j-9.78*k; (%o7) [1.4,6.9,-9.78] (%i8) v1.v2; (%o8) -16.612 (%i9) v1?v2; (%o9) [37.392,6.006,9.59] If you do not want to use the Unicode character ? that I used for the cross product, or if the Lisp flavor you are using will not allow it, you can also define the cross product as cross(a,b) Regards, Jaime _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From l_butler at users.sourceforge.net Sat Mar 10 12:41:39 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Sat, 10 Mar 2012 18:41:39 +0000 Subject: [Maxima] Is there a package for physics vector notation? In-Reply-To: <468A92A50CBB4EC8944894CBA0EFDE70@RichsLaptop> (message from Richard Hennessy on Fri, 9 Mar 2012 23:31:00 -0500) Message-ID: <1qp1up0e1ss.fsf@iceland.freeshell.org> Richard Hennessy writes: > Hi, > > I want to use Maxima to use i, j, k notation for vectors and have a dot > product and cross product operation for two vectors inputted this way. I > have quickly tried the dirty method below but if there is something already > written then maybe I can avoid reinventing the wheel. Rich, you may not know this, but this notation is actually a legacy of the quaternions. Baez spins a nice yarn here http://math.ucr.edu/home/baez/octonions/octonions.html In particular, R^3 is the subspace of purely imaginary quaternions, the cross product is the imaginary part of x . y, and the dot product is the real part of x . conjuage(y). Knowing this, we can write rules for the simplifier to do what you want: kill(all); qbasis:{%I,%J,%K}; declare([%I,%J,%K],imaginary); dotscrules:true $ tellsimp(%I . %I, -1); tellsimp(%J . %J, -1); tellsimp(%K . %K, -1); tellsimp(%I . %J, %K); tellsimp(%J . %I, -%K); tellsimp(%J . %K, %I); tellsimp(%K . %J, -%I); tellsimp(%K . %I, %J); tellsimp(%I . %K, -%J); /* cross product */ xp(a,b) := block([x:expand(a . b)], x-realpart(x))$ x : 3*%I $ y : 4*%J $ xp(x,y); declare([r,s],scalar); xp(r*%I + 4*%K, r*%J); /* dot product */ dotp(x,y) := realpart(x . conjugate(y)); dotp(x,y); You may prefer infix notation for these operators, but the ascii character set is so small that I prefer not to do this. Leo > > (%i9) reset(); > (%o1) > (%i2) kill(rules); > (%o2) > (%i3) kill(all); > (%o0) > (%i1) display2d:false; > > (%o1) false > (%i2) tellsimp(i*i,1); > > (%o2) [?\^rule7,?simpexpt] > (%i3) tellsimp(j*j,1); > > (%o3) [?\^rule8,?\^rule7,?simpexpt] > (%i4) tellsimp(k*k,1); > > (%o4) [?\^rule9,?\^rule8,?\^rule7,?simpexpt] > (%i5) v1=.7*i-3.4*j-.6*k; > > (%o5) v1 = -0.6*k-3.4*j+0.7*i > (%i6) v2=1.4*i+6.9*j-9.78*k; > > (%o6) v2 = -9.779999999999999*k+6.9*j+1.4*i > (%i7) v1*v2,%o5,%o6; > > (%o7) (-9.779999999999999*k+6.9*j+1.4*i)*(-0.6*k-3.4*j+0.7*i) > (%i8) expand(%); > > (%o8) 29.112*j*k-7.685999999999999*i*k+0.07*i*j-16.612 > > I can pick off the answer as the last item in the last sum (-16.612). Is > there another way? As far as the cross product is concerned, I know there > already is a way using matrices, but I want to avoid that too. > > Rich > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From rich.hennessy at verizon.net Sat Mar 10 13:14:53 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sat, 10 Mar 2012 14:14:53 -0500 Subject: [Maxima] Is there a package for physics vector notation? In-Reply-To: <6B53FA0EE7F540F58017A52A9698C11F@RichsLaptop> References: <468A92A50CBB4EC8944894CBA0EFDE70@RichsLaptop> <4F5B20B9.4050508@fe.up.pt> <6B53FA0EE7F540F58017A52A9698C11F@RichsLaptop> Message-ID: Quoting myself, "I don't mind the answers coming back as lists except when you have to use the answer as input in another computation, then you would have to turn the list back into i,j,k notation." Actually that is not true, it works fine as is. Thanks a lot Jamie. Rich -----Original Message----- From: Richard Hennessy Sent: Saturday, March 10, 2012 1:25 PM To: Jaime Villate ; maxima at math.utexas.edu Subject: Re: [Maxima] Is there a package for physics vector notation? Hi Jaime, Thanks, this is just what I have been looking for. The only thing is, I don't mind the answers coming back as lists except when you have to use the answer as input in another computation, then you would have to turn the list back into i,j,k notation. Is that something you have done? I may be able to figure out something, or not. Rich -----Original Message----- From: Jaime Villate Sent: Saturday, March 10, 2012 4:36 AM To: maxima at math.utexas.edu Subject: Re: [Maxima] Is there a package for physics vector notation? On 03/10/2012 04:31 AM, Richard Hennessy wrote: > I want to use Maxima to use i, j, k notation for vectors and have a dot > product and cross product operation for two vectors inputted this way. I > have quickly tried the dirty method below but if there is something > already written then maybe I can avoid reinventing the wheel. > Hi Richard, I have to work with vectors in Maxima very often and the best solution I've found is to represent them as lists. Check this out to see whether you like it: (%i1) display2d: false$ (%i2) fpprintprec: 12$ (%i3) [i,j,k]: [[1,0,0],[0,1,0],[0,0,1]]$ (%i4) ?(a,b) := determinant(matrix([i,j,k],a,b))$ (%i5) infix(?)$ (%i6) v1: .7*i-3.4*j-.6*k; (%o6) [0.7,-3.4,-0.6] (%i7) v2: 1.4*i+6.9*j-9.78*k; (%o7) [1.4,6.9,-9.78] (%i8) v1.v2; (%o8) -16.612 (%i9) v1?v2; (%o9) [37.392,6.006,9.59] If you do not want to use the Unicode character ? that I used for the cross product, or if the Lisp flavor you are using will not allow it, you can also define the cross product as cross(a,b) Regards, Jaime _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Sat Mar 10 13:42:25 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 10 Mar 2012 12:42:25 -0700 Subject: [Maxima] saving/loading a hashed array from/to file In-Reply-To: <4F5B4B06.2000604@gmx.de> References: <4F5AAAA5.7090403@gmx.de> <4F5B4B06.2000604@gmx.de> Message-ID: On 3/10/12, andre maute wrote: > (%i10) arrayinfo(F) > (%o10) [hashed,1,[1],[2],[3],[4],[[1,1]],[[2,2]],[[3,3]],[[4,4]]] > (%i11) listarray(F) > (%o11) [11,22,33,44,[11,11],[22,22],[33,33],[44,44]] > > but don't want to recalculate using F, > how can I attach this data to F? F[x] : y when F is an array function (i.e. defined as F[x] := ...) assigns specific (uncalculated) values. So something like xx : rest (rest (my_arrayinfo_stuff)); yy : my_listarray_stuff; for i thru length (xx) do F [first (xx [i])] : yy [i]; HTH Robert Dodier From villate at fe.up.pt Sat Mar 10 14:08:41 2012 From: villate at fe.up.pt (Jaime Villate) Date: Sat, 10 Mar 2012 20:08:41 +0000 Subject: [Maxima] Is there a package for physics vector notation? In-Reply-To: <6B53FA0EE7F540F58017A52A9698C11F@RichsLaptop> References: <468A92A50CBB4EC8944894CBA0EFDE70@RichsLaptop> <4F5B20B9.4050508@fe.up.pt> <6B53FA0EE7F540F58017A52A9698C11F@RichsLaptop> Message-ID: <4F5BB4C9.4050404@fe.up.pt> On 03/10/2012 06:25 PM, Richard Hennessy wrote: > Thanks, this is just what I have been looking for. The only thing is, > I don't mind the answers coming back as lists except when you have to > use the answer as input in another computation, then you would have to > turn the list back into i,j,k notation. Is that something you have > done? I may be able to figure out something, or not. You can do further calculations with the results, because the . and ? operators accept lists are their arguments: (%i4) v1: .7*i - 3.4*j - .6*k; (%o4) [0.7,-3.4,-0.6] (%i5) v2: 1.4*i + 6.9*j - 9.78*k; (%o5) [1.4,6.9,-9.78] (%i6) v1?v2; (%o6) [37.392,6.006,9.59] (%i7) 3*% ? [2,0,-3]; (%o7) [-54.054,394.068,-36.036] Only when I have to put the result back into a text file, for instance for the answers in a multiple-choice quiz generated from Maxima, do I have to go back to the i, j, k notation. In those cases I use the following: (%i8) print_vector (%); (%o8) "-54.054*i-394.068*j-36.036*k" Notice that the result is a string and cannot be used to make calculations. The function print_vector above has been defined as: print_vector(x) := block ([res], if (first(x) # 0) then res: printf (false, "~a*i", first(x)), if (length (x) > 1) then (if (second(x) # 0) then (if (second(x) < 0) then res: concat (res, printf( false, "~a*j", second(x))) else res: concat (res, printf( false, "-~a*j", second(x))))), if (length (x) > 2) then (if (third (x) # 0) then (if (third(x) < 0) then res: concat (res, printf( false, "~a*k", third(x))) else res: concat (res, printf( false, "-~a*k", third(x))))), printf(false, "~a", res))$ There might be more clever ways to achieve that. print_vector only works for vectors with numerical components and not for vectors with expressions in their components. Cheers, Jaime From rich.hennessy at verizon.net Sat Mar 10 14:43:57 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sat, 10 Mar 2012 15:43:57 -0500 Subject: [Maxima] Is there a package for physics vector notation? In-Reply-To: <1qp1up0e1ss.fsf@iceland.freeshell.org> References: <1qp1up0e1ss.fsf@iceland.freeshell.org> Message-ID: <7F2CC907037E4141862B67864ED7005F@RichsLaptop> "Knowing this, we can write rules for the simplifier to do what you want:" I can't get this to work for some reason. I tried copying your code into Maxima, but for the dot product, I get wrong results. v1:6*%I+4*%K; v2:4.4*%I-3.7*%J+8.9*%K; (%i23) xp(v1,v2); // OK (%o23) -22.2*%K-35.8*%J+14.8*%I (%i24) dotp(v1,v2); (%o24) 'realpart((4*%K+6*%I) . (-8.9*%K+3.7*%J-4.4*%I)) (%i25) ev(%); (%o25) 'realpart((4*%K+6*%I) . (-8.9*%K+3.7*%J-4.4*%I)) (%i26) ev(%,nouns); (%o26) 'realpart((4*%K+6*%I) . (-8.9*%K+3.7*%J-4.4*%I)) (%i27) 6*4.4+4*8.9; (%o27) 62.0 (%i28) expand(dotp(v1,v2)); (%o28) 'realpart(22.2*%K+35.8*%J-14.8*%I+62.0) This does not simplify to 62.0. BTW it is a fascinating and curious thing that this way works at all. I suppose if I understood the article you mentioned better I would know why. I did take a look, but I found it contained too much terminology that I don't know. Rich -----Original Message----- From: Leo Butler Sent: Saturday, March 10, 2012 1:41 PM To: Richard Hennessy Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Is there a package for physics vector notation? Richard Hennessy writes: > Hi, > > I want to use Maxima to use i, j, k notation for vectors and have a dot > product and cross product operation for two vectors inputted this way. I > have quickly tried the dirty method below but if there is something > already > written then maybe I can avoid reinventing the wheel. Rich, you may not know this, but this notation is actually a legacy of the quaternions. Baez spins a nice yarn here http://math.ucr.edu/home/baez/octonions/octonions.html In particular, R^3 is the subspace of purely imaginary quaternions, the cross product is the imaginary part of x . y, and the dot product is the real part of x . conjuage(y). Knowing this, we can write rules for the simplifier to do what you want: kill(all); qbasis:{%I,%J,%K}; declare([%I,%J,%K],imaginary); dotscrules:true $ tellsimp(%I . %I, -1); tellsimp(%J . %J, -1); tellsimp(%K . %K, -1); tellsimp(%I . %J, %K); tellsimp(%J . %I, -%K); tellsimp(%J . %K, %I); tellsimp(%K . %J, -%I); tellsimp(%K . %I, %J); tellsimp(%I . %K, -%J); /* cross product */ xp(a,b) := block([x:expand(a . b)], x-realpart(x))$ x : 3*%I $ y : 4*%J $ xp(x,y); declare([r,s],scalar); xp(r*%I + 4*%K, r*%J); /* dot product */ dotp(x,y) := realpart(x . conjugate(y)); dotp(x,y); You may prefer infix notation for these operators, but the ascii character set is so small that I prefer not to do this. Leo > > (%i9) reset(); > (%o1) > (%i2) kill(rules); > (%o2) > (%i3) kill(all); > (%o0) > (%i1) display2d:false; > > (%o1) false > (%i2) tellsimp(i*i,1); > > (%o2) [?\^rule7,?simpexpt] > (%i3) tellsimp(j*j,1); > > (%o3) [?\^rule8,?\^rule7,?simpexpt] > (%i4) tellsimp(k*k,1); > > (%o4) [?\^rule9,?\^rule8,?\^rule7,?simpexpt] > (%i5) v1=.7*i-3.4*j-.6*k; > > (%o5) v1 = -0.6*k-3.4*j+0.7*i > (%i6) v2=1.4*i+6.9*j-9.78*k; > > (%o6) v2 = -9.779999999999999*k+6.9*j+1.4*i > (%i7) v1*v2,%o5,%o6; > > (%o7) (-9.779999999999999*k+6.9*j+1.4*i)*(-0.6*k-3.4*j+0.7*i) > (%i8) expand(%); > > (%o8) 29.112*j*k-7.685999999999999*i*k+0.07*i*j-16.612 > > I can pick off the answer as the last item in the last sum (-16.612). Is > there another way? As far as the cross product is concerned, I know there > already is a way using matrices, but I want to avoid that too. > > Rich > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From andre.maute at gmx.de Sat Mar 10 15:03:08 2012 From: andre.maute at gmx.de (andre maute) Date: Sat, 10 Mar 2012 22:03:08 +0100 Subject: [Maxima] saving/loading a hashed array from/to file In-Reply-To: <4F5BC121.8080306@gmx.de> References: <4F5AAAA5.7090403@gmx.de> <4F5B4B06.2000604@gmx.de> <4F5BC121.8080306@gmx.de> Message-ID: <4F5BC18C.9090805@gmx.de> On 03/10/2012 08:42 PM, Robert Dodier wrote: >> On 3/10/12, andre maute wrote: >> >>> (%i10) arrayinfo(F) >>> (%o10) [hashed,1,[1],[2],[3],[4],[[1,1]],[[2,2]],[[3,3]],[[4,4]]] >>> (%i11) listarray(F) >>> (%o11) [11,22,33,44,[11,11],[22,22],[33,33],[44,44]] >>> >>> but don't want to recalculate using F, >>> how can I attach this data to F? >> F[x] : y when F is an array function (i.e. defined as F[x] := ...) >> assigns specific (uncalculated) values. >> >> So something like >> >> xx : rest (rest (my_arrayinfo_stuff)); >> yy : my_listarray_stuff; >> >> for i thru length (xx) do F [first (xx [i])] : yy [i]; Thanks Richard, thanks Robert everything works Best regards Andre From rich.hennessy at verizon.net Sat Mar 10 15:50:37 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sat, 10 Mar 2012 16:50:37 -0500 Subject: [Maxima] Is there a package for physics vector notation? In-Reply-To: <7F2CC907037E4141862B67864ED7005F@RichsLaptop> References: <1qp1up0e1ss.fsf@iceland.freeshell.org> <7F2CC907037E4141862B67864ED7005F@RichsLaptop> Message-ID: I figured out a solution that I thought I should share. I changed the definition of dotp() to /* dot product */ dotp(x,y) := realpart(expand(x . conjugate(y))); Now everything works fine. Thanks Leo, Rich -----Original Message----- From: Richard Hennessy Sent: Saturday, March 10, 2012 3:43 PM To: Leo Butler Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Is there a package for physics vector notation? "Knowing this, we can write rules for the simplifier to do what you want:" I can't get this to work for some reason. I tried copying your code into Maxima, but for the dot product, I get wrong results. v1:6*%I+4*%K; v2:4.4*%I-3.7*%J+8.9*%K; (%i23) xp(v1,v2); // OK (%o23) -22.2*%K-35.8*%J+14.8*%I (%i24) dotp(v1,v2); (%o24) 'realpart((4*%K+6*%I) . (-8.9*%K+3.7*%J-4.4*%I)) (%i25) ev(%); (%o25) 'realpart((4*%K+6*%I) . (-8.9*%K+3.7*%J-4.4*%I)) (%i26) ev(%,nouns); (%o26) 'realpart((4*%K+6*%I) . (-8.9*%K+3.7*%J-4.4*%I)) (%i27) 6*4.4+4*8.9; (%o27) 62.0 (%i28) expand(dotp(v1,v2)); (%o28) 'realpart(22.2*%K+35.8*%J-14.8*%I+62.0) This does not simplify to 62.0. BTW it is a fascinating and curious thing that this way works at all. I suppose if I understood the article you mentioned better I would know why. I did take a look, but I found it contained too much terminology that I don't know. Rich -----Original Message----- From: Leo Butler Sent: Saturday, March 10, 2012 1:41 PM To: Richard Hennessy Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Is there a package for physics vector notation? Richard Hennessy writes: > Hi, > > I want to use Maxima to use i, j, k notation for vectors and have a dot > product and cross product operation for two vectors inputted this way. I > have quickly tried the dirty method below but if there is something > already > written then maybe I can avoid reinventing the wheel. Rich, you may not know this, but this notation is actually a legacy of the quaternions. Baez spins a nice yarn here http://math.ucr.edu/home/baez/octonions/octonions.html In particular, R^3 is the subspace of purely imaginary quaternions, the cross product is the imaginary part of x . y, and the dot product is the real part of x . conjuage(y). Knowing this, we can write rules for the simplifier to do what you want: kill(all); qbasis:{%I,%J,%K}; declare([%I,%J,%K],imaginary); dotscrules:true $ tellsimp(%I . %I, -1); tellsimp(%J . %J, -1); tellsimp(%K . %K, -1); tellsimp(%I . %J, %K); tellsimp(%J . %I, -%K); tellsimp(%J . %K, %I); tellsimp(%K . %J, -%I); tellsimp(%K . %I, %J); tellsimp(%I . %K, -%J); /* cross product */ xp(a,b) := block([x:expand(a . b)], x-realpart(x))$ x : 3*%I $ y : 4*%J $ xp(x,y); declare([r,s],scalar); xp(r*%I + 4*%K, r*%J); /* dot product */ dotp(x,y) := realpart(x . conjugate(y)); dotp(x,y); You may prefer infix notation for these operators, but the ascii character set is so small that I prefer not to do this. Leo > > (%i9) reset(); > (%o1) > (%i2) kill(rules); > (%o2) > (%i3) kill(all); > (%o0) > (%i1) display2d:false; > > (%o1) false > (%i2) tellsimp(i*i,1); > > (%o2) [?\^rule7,?simpexpt] > (%i3) tellsimp(j*j,1); > > (%o3) [?\^rule8,?\^rule7,?simpexpt] > (%i4) tellsimp(k*k,1); > > (%o4) [?\^rule9,?\^rule8,?\^rule7,?simpexpt] > (%i5) v1=.7*i-3.4*j-.6*k; > > (%o5) v1 = -0.6*k-3.4*j+0.7*i > (%i6) v2=1.4*i+6.9*j-9.78*k; > > (%o6) v2 = -9.779999999999999*k+6.9*j+1.4*i > (%i7) v1*v2,%o5,%o6; > > (%o7) (-9.779999999999999*k+6.9*j+1.4*i)*(-0.6*k-3.4*j+0.7*i) > (%i8) expand(%); > > (%o8) 29.112*j*k-7.685999999999999*i*k+0.07*i*j-16.612 > > I can pick off the answer as the last item in the last sum (-16.612). Is > there another way? As far as the cross product is concerned, I know there > already is a way using matrices, but I want to avoid that too. > > Rich > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From l_butler at users.sourceforge.net Sat Mar 10 16:56:29 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Sat, 10 Mar 2012 22:56:29 +0000 Subject: [Maxima] Is there a package for physics vector notation? In-Reply-To: <7F2CC907037E4141862B67864ED7005F@RichsLaptop> (message from Richard Hennessy on Sat, 10 Mar 2012 15:43:57 -0500) Message-ID: <1qpy5r8cbfm.fsf@iceland.freeshell.org> Richard Hennessy writes: > "Knowing this, we can write rules for the simplifier to do what you want:" > > I can't get this to work for some reason. I tried copying your code into > Maxima, but for the dot product, I get wrong results. > > v1:6*%I+4*%K; > v2:4.4*%I-3.7*%J+8.9*%K; > > (%i23) xp(v1,v2); // OK > (%o23) -22.2*%K-35.8*%J+14.8*%I > (%i24) dotp(v1,v2); > > (%o24) 'realpart((4*%K+6*%I) . (-8.9*%K+3.7*%J-4.4*%I)) > (%i25) ev(%); > > (%o25) 'realpart((4*%K+6*%I) . (-8.9*%K+3.7*%J-4.4*%I)) > (%i26) ev(%,nouns); > > (%o26) 'realpart((4*%K+6*%I) . (-8.9*%K+3.7*%J-4.4*%I)) > (%i27) 6*4.4+4*8.9; > > (%o27) 62.0 > (%i28) expand(dotp(v1,v2)); > > (%o28) 'realpart(22.2*%K+35.8*%J-14.8*%I+62.0) > Try dotdistrib:true; > This does not simplify to 62.0. BTW it is a fascinating and curious thing > that this way works at all. I suppose if I understood the article you > mentioned better I would know why. I did take a look, but I found it > contained too much terminology that I don't know. The article is interesting for the historical bits, if nothing else. > > Rich > > > -----Original Message----- > From: Leo Butler > Sent: Saturday, March 10, 2012 1:41 PM > To: Richard Hennessy > Cc: maxima at math.utexas.edu > Subject: Re: [Maxima] Is there a package for physics vector notation? > > Richard Hennessy writes: > >> Hi, >> >> I want to use Maxima to use i, j, k notation for vectors and have a dot >> product and cross product operation for two vectors inputted this way. I >> have quickly tried the dirty method below but if there is something >> already >> written then maybe I can avoid reinventing the wheel. > > Rich, you may not know this, but this notation is actually a legacy of > the quaternions. Baez spins a nice yarn here > http://math.ucr.edu/home/baez/octonions/octonions.html > > In particular, R^3 is the subspace of purely imaginary quaternions, the > cross product is the imaginary part of x . y, and the dot product is the > real part of x . conjuage(y). > > Knowing this, we can write rules for the simplifier to do what you want: > > kill(all); > qbasis:{%I,%J,%K}; > declare([%I,%J,%K],imaginary); > dotscrules:true $ > tellsimp(%I . %I, -1); > tellsimp(%J . %J, -1); > tellsimp(%K . %K, -1); > tellsimp(%I . %J, %K); > tellsimp(%J . %I, -%K); > tellsimp(%J . %K, %I); > tellsimp(%K . %J, -%I); > tellsimp(%K . %I, %J); > tellsimp(%I . %K, -%J); > > > /* cross product */ > xp(a,b) := block([x:expand(a . b)], x-realpart(x))$ > x : 3*%I $ > y : 4*%J $ > xp(x,y); > declare([r,s],scalar); > xp(r*%I + 4*%K, r*%J); > > /* dot product */ > dotp(x,y) := realpart(x . conjugate(y)); > dotp(x,y); > > You may prefer infix notation for these operators, but the ascii > character set is so small that I prefer not to do this. > > Leo > >> >> (%i9) reset(); >> (%o1) >> (%i2) kill(rules); >> (%o2) >> (%i3) kill(all); >> (%o0) >> (%i1) display2d:false; >> >> (%o1) false >> (%i2) tellsimp(i*i,1); >> >> (%o2) [?\^rule7,?simpexpt] >> (%i3) tellsimp(j*j,1); >> >> (%o3) [?\^rule8,?\^rule7,?simpexpt] >> (%i4) tellsimp(k*k,1); >> >> (%o4) [?\^rule9,?\^rule8,?\^rule7,?simpexpt] >> (%i5) v1=.7*i-3.4*j-.6*k; >> >> (%o5) v1 = -0.6*k-3.4*j+0.7*i >> (%i6) v2=1.4*i+6.9*j-9.78*k; >> >> (%o6) v2 = -9.779999999999999*k+6.9*j+1.4*i >> (%i7) v1*v2,%o5,%o6; >> >> (%o7) (-9.779999999999999*k+6.9*j+1.4*i)*(-0.6*k-3.4*j+0.7*i) >> (%i8) expand(%); >> >> (%o8) 29.112*j*k-7.685999999999999*i*k+0.07*i*j-16.612 >> >> I can pick off the answer as the last item in the last sum (-16.612). Is >> there another way? As far as the cross product is concerned, I know there >> already is a way using matrices, but I want to avoid that too. >> >> Rich >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From jensaxel at soegaard.net Sun Mar 11 06:38:27 2012 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Sun, 11 Mar 2012 12:38:27 +0100 Subject: [Maxima] Maxima in Racket In-Reply-To: References: Message-ID: Hi All, The Maxima in Racket experiment now has a working REPL. I have attached a screenshot and the code so far. Maybe someone can use it as an example. The Maxima command tex(expr) will convert an expression into TeX. Jays McCarthy's slideshow-latex package is used to turn the TeX into a bitmap, that can be displayed in DrRacket. One problem though: When displaying long equations with TeX I use the LaTeX package breqn to break the lines automatically. However I can't get the package to produce wide lines. For example: Wrapping the output from tex( expand( (x+1)^20 ) ); into a dmath* environment produces 8 narrow lines, but on my screen they could easily fit into 3 lines. I have tried to changing paper size to a3 and a2, but that didn't have any impact. Do anyone happen to know how to tell breqn that lines are wider? -- Jens Axel S?gaard -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: racket-maxima.png Type: image/png Size: 62816 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: racket-maxima.rkt Type: application/octet-stream Size: 4112 bytes Desc: not available URL: From fateman at eecs.berkeley.edu Sun Mar 11 07:46:12 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 11 Mar 2012 05:46:12 -0700 Subject: [Maxima] Maxima in Racket In-Reply-To: References: Message-ID: <4F5C9E94.9000609@eecs.berkeley.edu> I'm not sure what the objective here is; just doing a REPL looks like a very weak alternative to wxmaxima; to the extent that Racket and Common Lisp coincide, one might as well write in Lisp. But people like their own variations on programming languages, I suppose. I would like to comment on breqn. Unless it has been considerably revised and improved from the last time I tried it, it is unlikely to be a satisfactory solution to the problem of breaking equations into multiple lines in general. TeX ordinarily doesn't encode enough information to do as good a job as can be done by Maxima. Sometimes it doesn't matter ...if the structure is simple enough, the demo works. I don't understand what your question is regarding page sizes. Sorry. On 3/11/12 4:38 AM, Jens Axel S?gaard wrote: > Hi All, > > The Maxima in Racket experiment now has a working REPL. > I have attached a screenshot and the code so far. > Maybe someone can use it as an example. > > The Maxima command tex(expr) will convert an expression into TeX. > Jays McCarthy's slideshow-latex package is used to turn the TeX into > a bitmap, that can be displayed in DrRacket. > > One problem though: > When displaying long equations with TeX I use the LaTeX > package breqn to break the lines automatically. > However I can't get the package to produce wide lines. > > For example: Wrapping the output from tex( expand( (x+1)^20 ) ); > into a dmath* environment produces 8 narrow lines, but on my screen > they could easily fit into 3 lines. I have tried to changing paper size > to a3 and a2, but that didn't have any impact. > > Do anyone happen to know how to tell breqn that lines are wider? > > -- > Jens Axel S?gaard > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From jensaxel at soegaard.net Sun Mar 11 10:12:50 2012 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Sun, 11 Mar 2012 16:12:50 +0100 Subject: [Maxima] Maxima in Racket Message-ID: Hi, Richard Fateman writes: > I'm not sure what the objective here is; just doing a REPL > looks like a very weak alternative to wxmaxima; > to the extent that Racket and Common Lisp coincide, one > might as well write in Lisp. But people like their own > variations on programming languages, I suppose. The REPL was just to show that I got the communication back and forth from Racket to Maxima working. The intention is not to make yet another Maxima interface. My vague plans are to make some educational software in Racket that needs a CAS backend to determine whether students have reduced algebraic expressions correctly. > I would like to comment on breqn. Unless it has been > considerably revised and improved from the last time I > tried it, it is unlikely to be > a satisfactory solution to the problem of breaking equations > into multiple lines in general. You confirm my fears. > TeX ordinarily doesn't encode enough information to > do as good a job as can be done by Maxima. Sometimes it > doesn't matter ...if the structure is simple enough, the > demo works. > I don't understand what your question is regarding page sizes. > Sorry. I was a little brief. The library that converts strings with tex into bitmaps first save the tex into a file, call latex, and then dvi2png to get a bitmap. My thinking was that could get a bitmap with a larger width if I told LaTeX my page size was larger than the standard a4. But breqn didn't pick up on the larger width. -- Jens Axel S?gaard From jwaixs at gmail.com Sun Mar 11 11:11:29 2012 From: jwaixs at gmail.com (Noud) Date: Sun, 11 Mar 2012 17:11:29 +0100 Subject: [Maxima] Basic Hypergeometric Series Message-ID: Dear developers group of Maxima, I'm a phd student in Mathematics, but with quite some programming experience (however, none of them in Lisp). At the moment I work a lot with Special Functions and in particular with Basic Hypergeometric Series. In the future I expect to do a lot of symbolic calculations with these functions and therefore I would like to see them implemented in Sage. I did some research to find out how to implement them by looking at the Sage implementation of Hypergeometric Series. It basically puts everything in an expression and let Maxima do the calculations. Therefore I want to try to implement Basic Hypergeometric Series in Maxima. I tried to read the hypergeometric.lisp, but I could not make much of it. Probably the biggest problem here is that I do not have a lot of experience with Lisp, but I do also not really know how Maxima work. Is there more documentation about how to implement new functions in Maxima? Or could you give me some advice on how to proceed? Best regards, Noud -------------- next part -------------- An HTML attachment was scrubbed... URL: From vim.unix at googlemail.com Sun Mar 11 12:13:12 2012 From: vim.unix at googlemail.com (Pau) Date: Sun, 11 Mar 2012 18:13:12 +0100 Subject: [Maxima] solving two equations Message-ID: Hi, I am sorry for a rather trivial question... If I have two equations like T(a,e) = a^4 ( 1 - e^3) H(a,e) = e^3 * constants * a^(-1) and I want to find the values of a ,e that equate them T(a,e) = H(a,e) ---> a = XXXX f(e) how could I do this in maxima? The best would be an example. Thanks for this nice piece of software. I am looking forward to learning how to use it in detail. Looks very promising. Cheers, Pau From l_butler at users.sourceforge.net Sun Mar 11 18:56:29 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Sun, 11 Mar 2012 23:56:29 +0000 Subject: [Maxima] solving two equations In-Reply-To: (message from Pau on Sun, 11 Mar 2012 18:13:12 +0100) Message-ID: <1qpvcmad74i.fsf@iceland.freeshell.org> Pau writes: > Hi, > > I am sorry for a rather trivial question... If I have two equations like > > T(a,e) = a^4 ( 1 - e^3) > H(a,e) = e^3 * constants * a^(-1) > > and I want to find the values of a ,e that equate them > > T(a,e) = H(a,e) ---> a = XXXX f(e) Try ? solve at the Maxima command line. A couple notes: -the assignment operator in Maxima is : -the function definition operator is := -to solve your problem, I did (%i1) T : a^4*(1 - e^3) $ H : c*e^3/a $ display2d : false $ (%i4) solve(T=H,e); (%o4) [e = (sqrt(3)*%i-1)*a^(5/3)/(2*(c+a^5)^(1/3)), e = -(sqrt(3)*%i+1)*a^(5/3)/(2*(c+a^5)^(1/3)), e = a^(5/3)/(c+a^5)^(1/3)] > > how could I do this in maxima? The best would be an example. > > Thanks for this nice piece of software. I am looking forward to > learning how to use it in detail. Looks very promising. > > Cheers, > > Pau > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From rich.hennessy at verizon.net Sun Mar 11 19:27:43 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 11 Mar 2012 20:27:43 -0400 Subject: [Maxima] Is there a package for physics vector notation? In-Reply-To: <1qpy5r8cbfm.fsf@iceland.freeshell.org> References: <1qpy5r8cbfm.fsf@iceland.freeshell.org> Message-ID: >-----Original Message----- >From: Leo Butler >Sent: Saturday, March 10, 2012 5:56 PM >To: Richard Hennessy >Cc: l_butler at users.sourceforge.net ; maxima at math.utexas.edu >Subject: Re: [Maxima] Is there a package for physics vector notation? > >Richard Hennessy writes: > > "Knowing this, we can write rules for the simplifier to do what you want:" > > I can't get this to work for some reason. I tried copying your code into > Maxima, but for the dot product, I get wrong results. > > v1:6*%I+4*%K; > v2:4.4*%I-3.7*%J+8.9*%K; > > (%i23) xp(v1,v2); // OK > (%o23) -22.2*%K-35.8*%J+14.8*%I > (%i24) dotp(v1,v2); > > (%o24) 'realpart((4*%K+6*%I) . (-8.9*%K+3.7*%J-4.4*%I)) > (%i25) ev(%); > > (%o25) 'realpart((4*%K+6*%I) . (-8.9*%K+3.7*%J-4.4*%I)) > (%i26) ev(%,nouns); > > (%o26) 'realpart((4*%K+6*%I) . (-8.9*%K+3.7*%J-4.4*%I)) > (%i27) 6*4.4+4*8.9; > > (%o27) 62.0 > (%i28) expand(dotp(v1,v2)); > > (%o28) 'realpart(22.2*%K+35.8*%J-14.8*%I+62.0) > > >Try >dotdistrib:true; > > This does not simplify to 62.0. BTW it is a fascinating and curious thing > that this way works at all. I suppose if I understood the article you > mentioned better I would know why. I did take a look, but I found it > contained too much terminology that I don't know. >The article is interesting for the historical bits, if nothing else. It is more accessible than I first thought, I have been reading more of it. It is interesting. I was a turned off by the Fano plane diagram on the first page, but then after reading the explanation of what it is for and how to use it, it is quite easy. Thank you, Rich > > Rich > > > -----Original Message----- > From: Leo Butler > Sent: Saturday, March 10, 2012 1:41 PM > To: Richard Hennessy > Cc: maxima at math.utexas.edu > Subject: Re: [Maxima] Is there a package for physics vector notation? > > Richard Hennessy writes: > >> Hi, >> >> I want to use Maxima to use i, j, k notation for vectors and have a dot >> product and cross product operation for two vectors inputted this way. I >> have quickly tried the dirty method below but if there is something >> already >> written then maybe I can avoid reinventing the wheel. > > Rich, you may not know this, but this notation is actually a legacy of > the quaternions. Baez spins a nice yarn here > http://math.ucr.edu/home/baez/octonions/octonions.html > > In particular, R^3 is the subspace of purely imaginary quaternions, the > cross product is the imaginary part of x . y, and the dot product is the > real part of x . conjuage(y). > > Knowing this, we can write rules for the simplifier to do what you want: > > kill(all); > qbasis:{%I,%J,%K}; > declare([%I,%J,%K],imaginary); > dotscrules:true $ > tellsimp(%I . %I, -1); > tellsimp(%J . %J, -1); > tellsimp(%K . %K, -1); > tellsimp(%I . %J, %K); > tellsimp(%J . %I, -%K); > tellsimp(%J . %K, %I); > tellsimp(%K . %J, -%I); > tellsimp(%K . %I, %J); > tellsimp(%I . %K, -%J); > > > /* cross product */ > xp(a,b) := block([x:expand(a . b)], x-realpart(x))$ > x : 3*%I $ > y : 4*%J $ > xp(x,y); > declare([r,s],scalar); > xp(r*%I + 4*%K, r*%J); > > /* dot product */ > dotp(x,y) := realpart(x . conjugate(y)); > dotp(x,y); > > You may prefer infix notation for these operators, but the ascii > character set is so small that I prefer not to do this. > > Leo > >> >> (%i9) reset(); >> (%o1) >> (%i2) kill(rules); >> (%o2) >> (%i3) kill(all); >> (%o0) >> (%i1) display2d:false; >> >> (%o1) false >> (%i2) tellsimp(i*i,1); >> >> (%o2) [?\^rule7,?simpexpt] >> (%i3) tellsimp(j*j,1); >> >> (%o3) [?\^rule8,?\^rule7,?simpexpt] >> (%i4) tellsimp(k*k,1); >> >> (%o4) [?\^rule9,?\^rule8,?\^rule7,?simpexpt] >> (%i5) v1=.7*i-3.4*j-.6*k; >> >> (%o5) v1 = -0.6*k-3.4*j+0.7*i >> (%i6) v2=1.4*i+6.9*j-9.78*k; >> >> (%o6) v2 = -9.779999999999999*k+6.9*j+1.4*i >> (%i7) v1*v2,%o5,%o6; >> >> (%o7) (-9.779999999999999*k+6.9*j+1.4*i)*(-0.6*k-3.4*j+0.7*i) >> (%i8) expand(%); >> >> (%o8) 29.112*j*k-7.685999999999999*i*k+0.07*i*j-16.612 >> >> I can pick off the answer as the last item in the last sum (-16.612). Is >> there another way? As far as the cross product is concerned, I know >> there >> already is a way using matrices, but I want to avoid that too. >> >> Rich >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From willisb at unk.edu Sun Mar 11 20:30:49 2012 From: willisb at unk.edu (Barton Willis) Date: Sun, 11 Mar 2012 20:30:49 -0500 Subject: [Maxima] Basic Hypergeometric Series In-Reply-To: References: Message-ID: > Is there more documentation about how to implement new functions in Maxima? Or could you give me some advice on how to proceed? http://www.math.utexas.edu/pipermail/maxima/2009/018577.html --Barton From dbmaxima at gmail.com Mon Mar 12 00:27:54 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Mon, 12 Mar 2012 16:27:54 +1100 Subject: [Maxima] Basic Hypergeometric Series In-Reply-To: References: Message-ID: <4F5D895A.10007@gmail.com> On 12/03/2012 3:11 AM, Noud wrote: > I tried to read the hypergeometric.lisp, but I could not make much of > it. Probably the biggest problem here is that I do not have a lot of > experience with Lisp, but I do also not really know how Maxima work. > Is there more documentation about how to implement new functions in > Maxima? Or could you give me some advice on how to proceed? > > Best regards, > Noud > Have a look at the implementation of some other special functions. For example. * Airy functions http://maxima.git.sourceforge.net/git/gitweb.cgi?p=maxima/maxima;a=blob;f=src/airy.lisp * Bessel functions http://maxima.git.sourceforge.net/git/gitweb.cgi?p=maxima/maxima;a=blob;f=src/bessel.lisp -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Mon Mar 12 03:57:08 2012 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 12 Mar 2012 08:57:08 +0000 Subject: [Maxima] Bug with the noun form of integrate Message-ID: <4F5DBA64.6040303@fe.up.pt> (%i3) 'integrate (x^2,x); (%o3) 'integrate(x^2,x) (%i4) 'integrate (v^2,x); (%o4) v^2*x (%i5) 'integrate (f(x),x); (%o5) 'integrate(f(x),x) (%i6) 'integrate (f(y),x); (%o6) x*f(y) (%i7) build_info(); Checked in: Maxima version: 5.26.0 Maxima build date: 15:14 2/22/2012 Host type: x86_64-unknown-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.29.11.debian and: Maxima version: 5.25.1 Maxima build date: 10:56 12/29/2011 Host type: x86_64-unknown-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.50.0.debian Regards, Jaime From fateman at eecs.berkeley.edu Mon Mar 12 08:12:13 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 12 Mar 2012 06:12:13 -0700 Subject: [Maxima] Bug with the noun form of integrate In-Reply-To: <4F5DBA64.6040303@fe.up.pt> References: <4F5DBA64.6040303@fe.up.pt> Message-ID: <4F5DF62D.8040401@eecs.berkeley.edu> 'integrate ... apparently does not inhibit SIMPLIFICATION, which says that if g is free of x, then 'integrate(g,x) is g*x. Is this a bug? Probably not, in the sense that whoever programmed that intended it to behave that way. It is a feature. Of course, one person's bug is another person's feature. RJF On 3/12/12 1:57 AM, Jaime Villate wrote: > (%i3) 'integrate (x^2,x); > (%o3) 'integrate(x^2,x) > > (%i4) 'integrate (v^2,x); > (%o4) v^2*x > > (%i5) 'integrate (f(x),x); > (%o5) 'integrate(f(x),x) > > (%i6) 'integrate (f(y),x); > (%o6) x*f(y) > > (%i7) build_info(); > > Checked in: > > Maxima version: 5.26.0 > Maxima build date: 15:14 2/22/2012 > Host type: x86_64-unknown-linux-gnu > Lisp implementation type: SBCL > Lisp implementation version: 1.0.29.11.debian > > and: > > Maxima version: 5.25.1 > Maxima build date: 10:56 12/29/2011 > Host type: x86_64-unknown-linux-gnu > Lisp implementation type: SBCL > Lisp implementation version: 1.0.50.0.debian > > Regards, > Jaime > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From fateman at eecs.berkeley.edu Mon Mar 12 08:35:30 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 12 Mar 2012 06:35:30 -0700 Subject: [Maxima] Basic Hypergeometric Series In-Reply-To: References: Message-ID: <4F5DFBA2.1070400@eecs.berkeley.edu> On 3/11/12 6:30 PM, Barton Willis wrote: >> Is there more documentation about how to implement new functions in Maxima? Or could you give me some advice on how to proceed? > http://www.math.utexas.edu/pipermail/maxima/2009/018577.html > > --Barton > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima There's more to "implement' a new function completely. For example, determining under what conditions this new function appears in the result of (say) integrate, solve, simplify, limit, taylor, etc. Also bigfloat functions for numerical evaluation to arbitrary precision. Not everything that is "implemented" is implemented completely. RJF From vext01 at gmail.com Mon Mar 12 10:06:09 2012 From: vext01 at gmail.com (Edd Barrett) Date: Mon, 12 Mar 2012 15:06:09 +0000 Subject: [Maxima] return statement In-Reply-To: References: <20120215164544.GP21867@edd-i386.kent.ac.uk> Message-ID: <20120312150609.GQ759@edd-i386.kent.ac.uk> On Wed, Feb 15, 2012 at 10:49:35PM +0100, Volker van Nek wrote: > Yes. Here is an example: > > (%i1) f(x) := catch( block([y:0], for i thru 3 do if i = x then throw(i), > y) )$ > (%i2) map(f, [1,2,3,4,5,6,7]); > (%o2) [1, 2, 3, 0, 0, 0, 0] Sorry to drag an old thread up, but can i recommend some syntactic sugar for this? It seems like a very common thing to want to do; or, atleast if you come for an imperative programming background (as i do). Thanks -- Best Regards Edd Barrett http://www.theunixzoo.co.uk From woollett at charter.net Mon Mar 12 13:54:11 2012 From: woollett at charter.net (Edwin Woollett) Date: Mon, 12 Mar 2012 11:54:11 -0700 Subject: [Maxima] mydefint2 Message-ID: <1AC27E4278D4490AB930158BE1BA2407@edwinc367e16bd> I have defined mydefint2, which uses your mydefint, but I am still getting unwanted messages that the limits of integration should answer, as in: ------------------------------------------------------- (%i20) mydefint2 (1/sqrt(x+y),[x,0,1],[y,0,1]); Is x+1 positive, negative, or zero? p; Is x positive or negative? p; (%o20) (2^(7/2)-8)/3 (%i21) float(%); (%o21) 1.1045695 ----------------------------------- The definitions I am using are: -------------------------- load("unwind_protect.lisp")$ simp_assuming(e, [fcts]) ::= buildq([e,fcts], unwind_protect((apply(assume, fcts), expand(e,0,0)), apply(forget,fcts)))$ mydefint(e78,x78,a78,b78) := block ([domain:complex], ratsimp (simp_assuming (integrate(e78,x78,a78,b78), x78 >= a78, x78 <= b78)))$ mydefint2(qe,qxL,qyL) := block([qrr], assume (not equal (qxL[1],0)), qrr : apply('mydefint, flatten([apply('mydefint, flatten([qe,qyL])),qxL])), forget (not equal (qxL[1],0)), qrr)$ ------------------------------------------------ Can you think of other definitions which could avoid these questions? Ted From woollett at charter.net Mon Mar 12 14:14:56 2012 From: woollett at charter.net (Edwin Woollett) Date: Mon, 12 Mar 2012 12:14:56 -0700 Subject: [Maxima] mydefint2 Message-ID: <00D0114294214484BECEE7974570D7CE@edwinc367e16bd> a redefinition of mydefint2 seems to work for this example: ------------------------------------------ (%i25) mydefint2(qe,qxL,qyL) := block([qrr], assume (not equal (qxL[1],0),qxL[1] > qxL[2],qxL[1] <= qxL[3]), qrr : apply('mydefint, flatten([apply('mydefint, flatten([qe,qyL])),qxL])), forget (not equal (qxL[1],0),qxL[1] > qxL[2],qxL[1] <= qxL[3]), qrr)$ (%i26) mydefint2 (1/sqrt(x+y),[x,0,1],[y,0,1]); (%o26) (2^(7/2)-8)/3 -------------------------------------------- Ted From woollett at charter.net Mon Mar 12 14:41:08 2012 From: woollett at charter.net (Edwin Woollett) Date: Mon, 12 Mar 2012 12:41:08 -0700 Subject: [Maxima] mydefint2 Message-ID: On Mar 12, 2012, I wrote ------------------ >a redefinition of mydefint2 seems to work >for this example: --------------------------------- A second redefinition uses simp_assuming in the same way that mydefint does: ------------------------- (%i27) mydefint21(qe,qxL,qyL) := block([qrr], qrr : apply('mydefint, flatten([apply('mydefint, flatten([qe,qyL])),qxL])), qrr)$ (%i28) mydefint2(re,rxL,ryL) := block ([domain:complex], ratsimp (simp_assuming (mydefint21(re,rxL,ryL), not equal (rxL[1],0), rxL[1] > rxL[2], rxL[1] <= rxL[3])))$ (%i29) mydefint2 (1/sqrt(x+y),[x,0,1],[y,0,1]); (%o29) (2^(7/2)-8)/3 ---------------------------- Ted From willisb at unk.edu Mon Mar 12 15:53:42 2012 From: willisb at unk.edu (Barton Willis) Date: Mon, 12 Mar 2012 15:53:42 -0500 Subject: [Maxima] mydefint2 In-Reply-To: References: Message-ID: maxima-bounces at math.utexas.edu wrote on 03/12/2012 02:41:08 PM: > A second redefinition uses simp_assuming in the same way that mydefint does: simp_assuming cleans up the fact data base even if an error is signaled while evaluating the definite integral. And that's a good thing. There doesn't seem to be a simple cure for: (%i14) mydefint2(x,[x,0,%i],[y,0,1]); defint: upper limit of integration must be real; found %i #0: mydefint(e78=x,x78=x,a78=0,b78=%i) #1: mydefint2(qe=x,qxl=[x,0,%i],qyl=[y,0,1]) -- an error. To debug this try: debugmode(true); -bw -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Tue Mar 13 00:08:04 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 12 Mar 2012 23:08:04 -0600 Subject: [Maxima] Basic Hypergeometric Series In-Reply-To: References: Message-ID: On 3/11/12, Noud wrote: > I tried to read the hypergeometric.lisp, but I could not make much of it. > Probably the biggest problem here is that I do not have a lot of experience > with Lisp, but I do also not really know how Maxima work. Is there more > documentation about how to implement new functions in Maxima? Or could you > give me some advice on how to proceed? Well, probably the way to go about this is for you to tell us a list of identities you want to put into play, and we'll try to advise you as to the best way to accomplish that. Maybe the best way is to write a Maxima function, or create a user-defined simplification rule, or something else. Maybe Lisp programming is needed, and maybe it isn't; no need to jump to conclusions just yet. best Robert Dodier From aleksasd873 at gmail.com Tue Mar 13 02:00:28 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Tue, 13 Mar 2012 09:00:28 +0200 Subject: [Maxima] simplify_sum error Message-ID: I calculate integral integrate(sqrt(x)*sqrt(1+x^2), x, 0, 1); The answer should be (%i1) 2/3*hypergeometric([-1/2,3/4],[7/4],-1); (%o1) (2*hypergeometric([-1/2,3/4],[7/4],-1))/3 (%i2) a1:float(%), numer; (%o2) 0.79248561598088 (%i3) quad_qags(sqrt(x)*sqrt(1+x^2), x, 0, 1); (%o3) [0.79248561598088,1.0454970222895099*10^-12,231,0] (%i4) load(simplify_sum)$ (%i5) sqrt(x)*niceindices(powerseries(sqrt(1+x^2),x,0)); (%o5) (2*sqrt(x)*sum(x^(2*i)/beta(3/2-i,i+1),i,0,inf))/3 (%i6) intosum(%); (%o6) sum((2*x^(2*i+1/2))/(3*beta(3/2-i,i+1)),i,0,inf) (%i7) integrate(%,x); (%o7) (2*sum(x^(2*i+3/2)/(beta(3/2-i,i+1)*(2*i+3/2)),i,0,inf))/3 (%i8) sol:ev(%,x=1)-ev(%,x=0); (%o8) (2*sum(1/(beta(3/2-i,i+1)*(2*i+3/2)),i,0,inf))/3 (%i9) simplify_sum(sol); expt: undefined: 0 to a negative exponent. #0: to_hypergeometric1(expr=2/((4*i+3)*beta(i+1,-(2*i-3)/2)),var=i,lo=0,hi=inf)(simplify_sum.mac line 781) #1: to_hypergeometric(expr=2/((4*i+3)*beta(i+1,-(2*i-3)/2)),var=i,lo=0,hi=inf)(simplify_sum.mac line 743) #2: simplify_sum(expr='sum(1/(beta(3/2-i,i+1)*(2*i+3/2)),i,0,inf))(simplify_sum.mac line 292) -- an error. To debug this try: debugmode(true); (%i10) subst(inf=1000,sol)$ (%i11) ev(%, nouns)$ (%i12) float(%), numer; (%o12) 0.79248561375435 (%i13) a1; (%o13) 0.79248561598088 Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrej.vodopivec at gmail.com Tue Mar 13 02:35:53 2012 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Tue, 13 Mar 2012 08:35:53 +0100 Subject: [Maxima] simplify_sum error In-Reply-To: References: Message-ID: On Tue, Mar 13, 2012 at 8:00 AM, Aleksas Domarkas wrote: > ?I calculate integral > integrate(sqrt(x)*sqrt(1+x^2), x, 0, 1); > > The answer should be > (%i1) 2/3*hypergeometric([-1/2,3/4],[7/4],-1); > (%o1) (2*hypergeometric([-1/2,3/4],[7/4],-1))/3 > (%i2) a1:float(%), numer; > (%o2) 0.79248561598088 > > (%i3) quad_qags(sqrt(x)*sqrt(1+x^2), x, 0, 1); > (%o3) [0.79248561598088,1.0454970222895099*10^-12,231,0] > > (%i4) load(simplify_sum)$ > (%i5) sqrt(x)*niceindices(powerseries(sqrt(1+x^2),x,0)); > (%o5) (2*sqrt(x)*sum(x^(2*i)/beta(3/2-i,i+1),i,0,inf))/3 > > (%i6) intosum(%); > (%o6) sum((2*x^(2*i+1/2))/(3*beta(3/2-i,i+1)),i,0,inf) > > (%i7) integrate(%,x); > (%o7) (2*sum(x^(2*i+3/2)/(beta(3/2-i,i+1)*(2*i+3/2)),i,0,inf))/3 > > (%i8) sol:ev(%,x=1)-ev(%,x=0); > (%o8) (2*sum(1/(beta(3/2-i,i+1)*(2*i+3/2)),i,0,inf))/3 > > (%i9) simplify_sum(sol); > expt: undefined: 0 to a negative exponent. > #0: > to_hypergeometric1(expr=2/((4*i+3)*beta(i+1,-(2*i-3)/2)),var=i,lo=0,hi=inf)(simplify_sum.mac > line 781) > #1: > to_hypergeometric(expr=2/((4*i+3)*beta(i+1,-(2*i-3)/2)),var=i,lo=0,hi=inf)(simplify_sum.mac > line 743) > #2: > simplify_sum(expr='sum(1/(beta(3/2-i,i+1)*(2*i+3/2)),i,0,inf))(simplify_sum.mac > line 292) > ?-- an error. To debug this try: debugmode(true); simplify_sum finds that this sum equals 2/3*hypergeometric([-1/2, 3/4],[7/4],-1). The error comes from hgfred: (%i1) 2/3*hgfred([-1/2,3/4],[7/4],-1); expt: undefined: 0 to a negative exponent. -- an error. To debug this try: debugmode(true); Numerical evaluation using the hypergeometric package agrees with your numerical integration: (%i2) 2/3*hypergeometric([-1/2,3/4],[7/4],-1); (%o2) (2*hypergeometric([-1/2,3/4],[7/4],-1))/3 (%i3) float(%); (%o3) .7924856159808843 HTH, Andrej From jan.mueller at math.uni-dortmund.de Tue Mar 13 02:53:34 2012 From: jan.mueller at math.uni-dortmund.de (=?ISO-8859-15?Q?Jan_Hendrik_M=FCller?=) Date: Tue, 13 Mar 2012 08:53:34 +0100 Subject: [Maxima] part of equation as function Message-ID: <4F5EFCFE.3090502@math.uni-dortmund.de> Hi all, how can I use parts of an equation as a function, e.g. o% z = x*y and I would like to define f(x,y):=x*y by using the output. f(x,y):=rhs(eq) doesn't work if I want to evaluate e.g. f(1,2) bw Jan From villate at fe.up.pt Tue Mar 13 04:04:27 2012 From: villate at fe.up.pt (Jaime Villate) Date: Tue, 13 Mar 2012 09:04:27 +0000 Subject: [Maxima] part of equation as function In-Reply-To: <4F5EFCFE.3090502@math.uni-dortmund.de> References: <4F5EFCFE.3090502@math.uni-dortmund.de> Message-ID: <4F5F0D9B.8080404@fe.up.pt> On 03/13/2012 07:53 AM, Jan Hendrik M?ller wrote: > Hi all, > how can I use parts of an equation as a function, e.g. > o% z = x*y > and I would like to define f(x,y):=x*y by using the output. > f(x,y):=rhs(eq) doesn't work if I want to evaluate e.g. f(1,2) Use: define (f(x,y), rhs(eq)); for mathematical functions use always define() instead of :=. Think of := as a way to define a small program, rather than defining a function. Cheers, Jaime From vim.unix at googlemail.com Mon Mar 12 10:18:58 2012 From: vim.unix at googlemail.com (Pau) Date: Mon, 12 Mar 2012 16:18:58 +0100 Subject: [Maxima] solving two equations In-Reply-To: <1qpvcmad74i.fsf@iceland.freeshell.org> References: <1qpvcmad74i.fsf@iceland.freeshell.org> Message-ID: Thanks... however something seems strange... it looks like maxima is trying to simplify the expression and in the end I get 3 - gamma 3/8 - --------- 3 3 1/4 8 2 G M + m G 1/4 4 6 sqrt(7) a sqrt(2 e + 1) sqrt(M) (-----------) c a = -----------------------------------------------------------------------] gamma - 3 5/4 4 2 1/4 Rinfl M 1/8 1/8 5 c (37 e + 292 e + 96) (----------------) (G M) m (I hope that the alignment is right) As you can see, there's an "a" in the right hand side... that's strange I did this: (%i1) Fe : 1 + (73/24)*e^2 + (37/96)*e^4$ (%i2) Na : (M/m) * (a/Rinfl)^(3-gamma)$ (%i3) TGW : (5/64) * (c^5/G^3) * a^4/(m*M * (m + M)) * Fe$ (%i4) TRRV : a^(3/2)/(sqrt(G*M)) * M/m * (0.28*(e^2+0.5))^2/sqrt(Na)$ (%i5) solve(TGW=TRRV,a); Any idea of what might have gone wrong? thanks On 12 March 2012 00:56, Leo Butler wrote: > Pau writes: > >> Hi, >> >> I am sorry for a rather trivial question... If I have two equations like >> >> T(a,e) = a^4 ( 1 - e^3) >> H(a,e) = e^3 * constants * a^(-1) >> >> and I want to find the values of a ,e that equate them >> >> T(a,e) = H(a,e) ?---> a = XXXX f(e) > > Try > ? solve > at the Maxima command line. > > A couple notes: > -the assignment operator in Maxima is : > -the function definition operator is := > -to solve your problem, > ?I did > > (%i1) T : a^4*(1 - e^3) $ H : c*e^3/a $ display2d : false $ > > (%i4) solve(T=H,e); > > (%o4) [e = (sqrt(3)*%i-1)*a^(5/3)/(2*(c+a^5)^(1/3)), > ? ? ? e = -(sqrt(3)*%i+1)*a^(5/3)/(2*(c+a^5)^(1/3)), > ? ? ? e = a^(5/3)/(c+a^5)^(1/3)] > >> >> how could I do this in maxima? The best would be an example. >> >> Thanks for this nice piece of software. I am looking forward to >> learning how to use it in detail. Looks very promising. >> >> Cheers, >> >> Pau >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > > -- > Leo Butler ? ? ? ? ? ? ? ? > SDF Public Access UNIX System - ? http://sdf.lonestar.org From javier.arantegui at gmail.com Tue Mar 13 05:58:04 2012 From: javier.arantegui at gmail.com (Javier Arantegui) Date: Tue, 13 Mar 2012 11:58:04 +0100 Subject: [Maxima] part of equation as function In-Reply-To: <4F5F0D9B.8080404@fe.up.pt> References: <4F5EFCFE.3090502@math.uni-dortmund.de> <4F5F0D9B.8080404@fe.up.pt> Message-ID: Hi! The difference between ":=" and "define" is a topic that has been discussed several times. It's one of those things that separate newbies (like me) and experts. For experts, the difference seems to be very clear, but most of the new users think that := is the way to define functions in Maxima. And, frankly the difference is very hard to tell if you just read the documentation. Let's see what the Maxima Manual says about := : http://maxima.sourceforge.net/docs/manual/en/maxima_7.html#IDX264 And, what about define: http://maxima.sourceforge.net/docs/manual/en/maxima_36.html#IDX1469 There is only (I think) one small difference between them: "The function definition operator. f(x_1, ..., x_n) := expr defines a function named f with arguments x_1, ?, x_n and function body expr. := never evaluates the function body (unless explicitly evaluated by quote-quote '')." "Defines a function named f with arguments x_1, ?, x_n and function body expr. define always evaluates its second argument (unless explicitly quoted). " Because it's a FAQ, maybe a new sentence should be added to explain the consequences of that difference, and a new example should be added showing the different behaviour. Now, the set of examples is the same in both cases. Javier On Tue, Mar 13, 2012 at 10:04 AM, Jaime Villate wrote: > On 03/13/2012 07:53 AM, Jan Hendrik M?ller wrote: >> >> Hi all, >> how can I use parts of an equation as a function, e.g. >> o% z = x*y >> and I would like to define f(x,y):=x*y by using the output. >> f(x,y):=rhs(eq) doesn't work if I want to evaluate e.g. f(1,2) > > Use: > > define (f(x,y), rhs(eq)); > > for mathematical functions use always define() instead of :=. Think of := as > a way to define a small program, rather than defining a function. > Cheers, > Jaime > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- Lee mi blog: "Un peque?o paso para Neil" http://up3n.wordpress.com/ ?Ahora tambi?n en Twitter! http://twitter.com/javierarantegui From willisb at unk.edu Tue Mar 13 06:06:49 2012 From: willisb at unk.edu (Barton Willis) Date: Tue, 13 Mar 2012 06:06:49 -0500 Subject: [Maxima] simplify_sum error In-Reply-To: References: , Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- > simplify_sum finds that this sum equals 2/3*hypergeometric([-1/2,3/4],[7/4],-1). The error comes from hgfred: A trick: (%i12) (2*sum(1/(beta(3/2-i,i+1)*(2*i+3/2)),i,0,inf))/3$ (%i13) simplify_sum(%), hgfred(p,q,x) := hypergeometric(p,q,x); (%o13) (2*hypergeometric([-1/2,3/4],[7/4],-1))/3 The error message from simplify_sum doesn't say that hgfred is the real problem :( Barton From l_butler at users.sourceforge.net Tue Mar 13 08:58:13 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Tue, 13 Mar 2012 13:58:13 +0000 Subject: [Maxima] solving two equations In-Reply-To: (message from Pau on Mon, 12 Mar 2012 16:18:58 +0100) Message-ID: <1qpsjhcd2mi.fsf@iceland.freeshell.org> Pau writes: > Thanks... however something seems strange... it looks like maxima is > trying to simplify the expression and in the end I get > > 3 - gamma > 3/8 - --------- 3 3 > 1/4 8 2 G M + m G 1/4 > 4 6 sqrt(7) a sqrt(2 e + 1) sqrt(M) (-----------) > c > a = -----------------------------------------------------------------------] > gamma - 3 > 5/4 4 2 1/4 Rinfl M 1/8 1/8 > 5 c (37 e + 292 e + 96) (----------------) (G M) > m > > > (I hope that the alignment is right) > > As you can see, there's an "a" in the right hand side... that's strange > > I did this: > > (%i1) Fe : 1 + (73/24)*e^2 + (37/96)*e^4$ > > (%i2) Na : (M/m) * (a/Rinfl)^(3-gamma)$ > > (%i3) TGW : (5/64) * (c^5/G^3) * a^4/(m*M * (m + M)) * Fe$ > > (%i4) TRRV : a^(3/2)/(sqrt(G*M)) * M/m * (0.28*(e^2+0.5))^2/sqrt(Na)$ > > (%i5) solve(TGW=TRRV,a); > > Any idea of what might have gone wrong? > > thanks For some reason, solve gave up and returned a partial answer. Here are a couple ideas: solve(first(%o5)/a,a); solve(log(TGW)=log(TRRV),a), logexpand=all; Both give me an answer. Btw, gamma is the name of a function in Maxima. Although variables and functions may share the same name, this will likely lead to obscure and wierd errors, so it is better to use another name. Leo > > On 12 March 2012 00:56, Leo Butler wrote: >> Pau writes: >> >>> Hi, >>> >>> I am sorry for a rather trivial question... If I have two equations like >>> >>> T(a,e) = a^4 ( 1 - e^3) >>> H(a,e) = e^3 * constants * a^(-1) >>> >>> and I want to find the values of a ,e that equate them >>> >>> T(a,e) = H(a,e) ?---> a = XXXX f(e) >> >> Try >> ? solve >> at the Maxima command line. >> >> A couple notes: >> -the assignment operator in Maxima is : >> -the function definition operator is := >> -to solve your problem, >> ?I did >> >> (%i1) T : a^4*(1 - e^3) $ H : c*e^3/a $ display2d : false $ >> >> (%i4) solve(T=H,e); >> >> (%o4) [e = (sqrt(3)*%i-1)*a^(5/3)/(2*(c+a^5)^(1/3)), >> ? ? ? e = -(sqrt(3)*%i+1)*a^(5/3)/(2*(c+a^5)^(1/3)), >> ? ? ? e = a^(5/3)/(c+a^5)^(1/3)] >> >>> >>> how could I do this in maxima? The best would be an example. >>> >>> Thanks for this nice piece of software. I am looking forward to >>> learning how to use it in detail. Looks very promising. >>> >>> Cheers, >>> >>> Pau >>> _______________________________________________ >>> Maxima mailing list >>> Maxima at math.utexas.edu >>> http://www.math.utexas.edu/mailman/listinfo/maxima >>> >> >> -- >> Leo Butler ? ? ? ? ? ? ? ? >> SDF Public Access UNIX System - ? http://sdf.lonestar.org > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From toy.raymond at gmail.com Tue Mar 13 11:04:03 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 13 Mar 2012 09:04:03 -0700 Subject: [Maxima] simplify_sum error In-Reply-To: References: Message-ID: On Tue, Mar 13, 2012 at 12:35 AM, Andrej Vodopivec < andrej.vodopivec at gmail.com> wrote: > > simplify_sum finds that this sum equals 2/3*hypergeometric([-1/2, > 3/4],[7/4],-1). The error comes from hgfred: > > (%i1) 2/3*hgfred([-1/2,3/4],[7/4],-1); > expt: undefined: 0 to a negative exponent. > -- an error. To debug this try: debugmode(true); > Curious. I was getting this error too. But then I went and recompiled src/hyp.lisp and the error went away. I now get (%i16) hgfred([-1/2,3/4],[7/4],-1); SIMP2F1-WILL-CONTINUE-IN (%o16) %f[2,1]([-1/2,3/4],[7/4],-1) I don't always recompile everything from scratch, so there must be some bad interaction between compiling parts of maxima and loading an old hyp.fasl. What that could be, I don't know. Perhaps some issue with special variables. (There are quite a few in hyp and hypgeo.) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Mar 13 11:31:55 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 13 Mar 2012 12:31:55 -0400 Subject: [Maxima] solving two equations In-Reply-To: <1qpsjhcd2mi.fsf@iceland.freeshell.org> References: <1qpsjhcd2mi.fsf@iceland.freeshell.org> Message-ID: When you run into something like this, it is helpful to simplify it to the simplest case that reproduces the problem (removing any parameters which don't contribute to the problem you're having), something like this (also please use display2d:false to create a readable transcript). In your example, all the coefficients (except gamma) can be removed, and you get the same basic behavior: (%i1) TGW : 1 * a^4/1; (%o1) a^4 (%i2) Na: a^(3-g); (%o2) a^(3-g) (%i3) TRRV : a^(3/2)/(1) * 1 * 1/sqrt(Na); (%o3) a^(3/2)*sqrt(a^(g-3)) (%i4) eq: TGW=TRRV; (%o4) a^4 = a^(3/2)*sqrt(a^(g-3)) (%i5) solve(eq,a); (%o5) [a = %i*a^(g/8),a = -a^(g/8),a = -%i*a^(g/8),a = a^(g/8)] <<< note 'a' on the RHS An even simpler case showing this behavior is (%i6) solve(a^n=a,a); (%o6) [a = a^n] This is annoying. The excuse for this behavior is presumably that in general the number of solutions depends on the value of n, and Maxima has no way of expressing this as a finite list of solutions. But Maxima is not consistent about this. For example, solve(a^n=1,a) returns [a=1], though of course if (e.g.) n=2, then a=-1 is also a solution. Is anyone interested in designing and implementing a clean solution for this? -s On Tue, Mar 13, 2012 at 09:58, Leo Butler wrote: > Pau writes: > > > Thanks... however something seems strange... it looks like maxima is > > trying to simplify the expression and in the end I get > > > > 3 - gamma > > 3/8 - --------- 3 3 > > 1/4 8 2 G M + m G > 1/4 > > 4 6 sqrt(7) a sqrt(2 e + 1) sqrt(M) (-----------) > > c > > a = > -----------------------------------------------------------------------] > > gamma - 3 > > 5/4 4 2 1/4 Rinfl M 1/8 1/8 > > 5 c (37 e + 292 e + 96) (----------------) (G M) > > m > > > > > > (I hope that the alignment is right) > > > > As you can see, there's an "a" in the right hand side... that's strange > > > > I did this: > > > > (%i1) Fe : 1 + (73/24)*e^2 + (37/96)*e^4$ > > > > (%i2) Na : (M/m) * (a/Rinfl)^(3-gamma)$ > > > > (%i3) TGW : (5/64) * (c^5/G^3) * a^4/(m*M * (m + M)) * Fe$ > > > > (%i4) TRRV : a^(3/2)/(sqrt(G*M)) * M/m * (0.28*(e^2+0.5))^2/sqrt(Na)$ > > > > (%i5) solve(TGW=TRRV,a); > > > > Any idea of what might have gone wrong? > > > > thanks > > For some reason, solve gave up and returned a partial answer. > Here are a couple ideas: > > solve(first(%o5)/a,a); > > solve(log(TGW)=log(TRRV),a), logexpand=all; > > Both give me an answer. > > Btw, gamma is the name of a function in Maxima. Although variables and > functions may share the same name, this will likely lead to obscure and > wierd errors, so it is better to use another name. > > Leo > > > > > On 12 March 2012 00:56, Leo Butler > wrote: > >> Pau writes: > >> > >>> Hi, > >>> > >>> I am sorry for a rather trivial question... If I have two equations > like > >>> > >>> T(a,e) = a^4 ( 1 - e^3) > >>> H(a,e) = e^3 * constants * a^(-1) > >>> > >>> and I want to find the values of a ,e that equate them > >>> > >>> T(a,e) = H(a,e) ---> a = XXXX f(e) > >> > >> Try > >> ? solve > >> at the Maxima command line. > >> > >> A couple notes: > >> -the assignment operator in Maxima is : > >> -the function definition operator is := > >> -to solve your problem, > >> I did > >> > >> (%i1) T : a^4*(1 - e^3) $ H : c*e^3/a $ display2d : false $ > >> > >> (%i4) solve(T=H,e); > >> > >> (%o4) [e = (sqrt(3)*%i-1)*a^(5/3)/(2*(c+a^5)^(1/3)), > >> e = -(sqrt(3)*%i+1)*a^(5/3)/(2*(c+a^5)^(1/3)), > >> e = a^(5/3)/(c+a^5)^(1/3)] > >> > >>> > >>> how could I do this in maxima? The best would be an example. > >>> > >>> Thanks for this nice piece of software. I am looking forward to > >>> learning how to use it in detail. Looks very promising. > >>> > >>> Cheers, > >>> > >>> Pau > >>> _______________________________________________ > >>> Maxima mailing list > >>> Maxima at math.utexas.edu > >>> http://www.math.utexas.edu/mailman/listinfo/maxima > >>> > >> > >> -- > >> Leo Butler > >> SDF Public Access UNIX System - http://sdf.lonestar.org > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > > > > > -- > Leo Butler > SDF Public Access UNIX System - http://sdf.lonestar.org > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From l_butler at users.sourceforge.net Tue Mar 13 14:30:31 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Tue, 13 Mar 2012 19:30:31 +0000 Subject: [Maxima] solving two equations In-Reply-To: (message from Pau on Tue, 13 Mar 2012 17:05:46 +0100) Message-ID: <1qppqcgcn8o.fsf@iceland.freeshell.org> Pau writes: > Dear Leo, > > thanks for the help. In my case, I get: > > (%i5) solve(first(%o5)/a,a); > > first: argument must be a non-atomic expression; found %o5 > -- an error. To debug this try: debugmode(true); Try: solns : solve(TGW=TRRV,a); solve(first(solns)/a, a); The latter command takes the first solution from solve and divides both sides by a, to give 1 = ..., then asks solve to solve the equation for a. You will be ask some inconsequential question and then voila, a solution. > > The other option > > solve(log(TGW)=log(TRRV),a), logexpand=all; > > leads to something... > > But could you explain me what you did? What does first(%o5)/a mean? > > And why does the log help? Your equations involve only multiplication. Take logs and you have a linear equation in a. > > The reply starts with > > 3146 log(Rinfl) gamma 6292 log(M + m) > (%o6) [a = expt(%e, --------------------- - ------------------ > 3146 gamma - 25168 3146 gamma - 25168 > > > .... > > What does that %e mean? %e is the base of the natural logarithm: log(%e) ==> 1. Mathematicians write it as just e. > > I suppose the answer is the exponent of the log? > Look at the answer more carefully. > thanks! > > > > On 13 March 2012 14:58, Leo Butler wrote: >> Pau writes: >> >>> Thanks... however something seems strange... it looks like maxima is >>> trying to simplify the expression and in the end I get >>> >>> ? ? ? ? ? ? ? ? ? ? ? ? ? 3 - gamma >>> ? ? ? ? ? ? ? ? ? ? 3/8 - --------- ? ? ? ? ? ? ? ? ? ? ? ? ?3 ? ? ? ?3 >>> ? ? ? ?1/4 ? ? ? ? ? ? ? ? ? ?8 ? ? ? ? ? ? 2 ? ? ? ? ? ? ? G ?M + m G ?1/4 >>> ? ? 4 6 ? ?sqrt(7) a ? ? ? ? ? ? ? ?sqrt(2 e ?+ 1) sqrt(M) (-----------) >>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?c >>> a = -----------------------------------------------------------------------] >>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? gamma - 3 >>> ? ? ? ? ?5/4 ? ? ? ?4 ? ? ? ?2 ? ? ?1/4 ?Rinfl ? ? ? ? ?M 1/8 ? ? ?1/8 >>> ? ? ? ? 5 ? ?c (37 e ?+ 292 e ?+ 96) ? ?(----------------) ? ?(G M) >>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? m >>> >>> >>> (I hope that the alignment is right) >>> >>> As you can see, there's an "a" in the right hand side... that's strange >>> >>> I did this: >>> >>> (%i1) Fe : 1 + (73/24)*e^2 + (37/96)*e^4$ >>> >>> (%i2) Na : (M/m) * (a/Rinfl)^(3-gamma)$ >>> >>> (%i3) TGW : (5/64) * (c^5/G^3) * a^4/(m*M * (m + M)) * Fe$ >>> >>> (%i4) TRRV : a^(3/2)/(sqrt(G*M)) * M/m * (0.28*(e^2+0.5))^2/sqrt(Na)$ >>> >>> (%i5) solve(TGW=TRRV,a); >>> >>> Any idea of what might have gone wrong? >>> >>> thanks >> >> For some reason, solve gave up and returned a partial answer. >> Here are a couple ideas: >> >> solve(first(%o5)/a,a); >> >> solve(log(TGW)=log(TRRV),a), logexpand=all; >> >> Both give me an answer. >> >> Btw, gamma is the name of a function in Maxima. Although variables and >> functions may share the same name, this will likely lead to obscure and >> wierd errors, so it is better to use another name. >> >> Leo >> >>> >>> On 12 March 2012 00:56, Leo Butler wrote: >>>> Pau writes: >>>> >>>>> Hi, >>>>> >>>>> I am sorry for a rather trivial question... If I have two equations like >>>>> >>>>> T(a,e) = a^4 ( 1 - e^3) >>>>> H(a,e) = e^3 * constants * a^(-1) >>>>> >>>>> and I want to find the values of a ,e that equate them >>>>> >>>>> T(a,e) = H(a,e) ?---> a = XXXX f(e) >>>> >>>> Try >>>> ? solve >>>> at the Maxima command line. >>>> >>>> A couple notes: >>>> -the assignment operator in Maxima is : >>>> -the function definition operator is := >>>> -to solve your problem, >>>> ?I did >>>> >>>> (%i1) T : a^4*(1 - e^3) $ H : c*e^3/a $ display2d : false $ >>>> >>>> (%i4) solve(T=H,e); >>>> >>>> (%o4) [e = (sqrt(3)*%i-1)*a^(5/3)/(2*(c+a^5)^(1/3)), >>>> ? ? ? e = -(sqrt(3)*%i+1)*a^(5/3)/(2*(c+a^5)^(1/3)), >>>> ? ? ? e = a^(5/3)/(c+a^5)^(1/3)] >>>> >>>>> >>>>> how could I do this in maxima? The best would be an example. >>>>> >>>>> Thanks for this nice piece of software. I am looking forward to >>>>> learning how to use it in detail. Looks very promising. >>>>> >>>>> Cheers, >>>>> >>>>> Pau >>>>> _______________________________________________ >>>>> Maxima mailing list >>>>> Maxima at math.utexas.edu >>>>> http://www.math.utexas.edu/mailman/listinfo/maxima >>>>> >>>> >>>> -- >>>> Leo Butler ? ? ? ? ? ? ? ? >>>> SDF Public Access UNIX System - ? http://sdf.lonestar.org >>> _______________________________________________ >>> Maxima mailing list >>> Maxima at math.utexas.edu >>> http://www.math.utexas.edu/mailman/listinfo/maxima >>> >>> >> >> -- >> Leo Butler ? ? ? ? ? ? ? ? >> SDF Public Access UNIX System - ? http://sdf.lonestar.org > > -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From macrakis at alum.mit.edu Tue Mar 13 16:27:54 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 13 Mar 2012 17:27:54 -0400 Subject: [Maxima] mydefint2 In-Reply-To: <1AC27E4278D4490AB930158BE1BA2407@edwinc367e16bd> References: <1AC27E4278D4490AB930158BE1BA2407@edwinc367e16bd> Message-ID: On Mon, Mar 12, 2012 at 14:54, Edwin Woollett wrote: > ... load("unwind_protect.lisp")$ > > simp_assuming(e, [fcts]) ::= > buildq([e,fcts], unwind_protect((apply(assume, fcts), expand(e,0,0)), > apply(forget,fcts)))$ > I'm guessing you copied this definition from the contrib package abs_integrate. Keep in mind that contrib packages are *not* necessarily maintained by the Maxima developers, and are often inconsistent with core Maxima. In particular, there are two problems with this definition: a) It is actually eval_assuming, not simp_assuming (remember that ::= defines a macro). b) It does *not* necessarily return you to the original state: assume(x>0)$ facts() => [x>0] block( assume(x>0), forget(x>0) ) facts() => [] <<< oops, deleted existing fact A better definition would use the 'context' mechanism to do this cleanly. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Tue Mar 13 22:42:16 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 13 Mar 2012 23:42:16 -0400 Subject: [Maxima] mydefint2 In-Reply-To: References: <1AC27E4278D4490AB930158BE1BA2407@edwinc367e16bd> Message-ID: >From: Stavros Macrakis >Sent: Tuesday, March 13, 2012 5:27 PM > >To: Edwin Woollett >Cc: maxima mailing list ; Barton Willis >Subject: Re: [Maxima] mydefint2 > >On Mon, Mar 12, 2012 at 14:54, Edwin Woollett wrote: >... load("unwind_protect.lisp")$ >simp_assuming(e, [fcts]) ::= >buildq([e,fcts], unwind_protect((apply(assume, fcts), expand(e,0,0)), >apply(forget,fcts)))$ >I'm guessing you copied this definition from the contrib package >abs_integrate. Keep in mind that contrib packages are *not* necessarily >maintained >by the Maxima developers, and are often inconsistent with core >Maxima. >In particular, there are two problems with this definition: >a) It is actually eval_assuming, not simp_assuming (remember that ::= >defines a macro). >b) It does not necessarily return you to the original state: >assume(x>0)$ >facts() => [x>0] >block( assume(x>0), forget(x>0) ) >facts() => [] <<< oops, deleted existing fact I thought I would chime in here because I have noticed this bug in simp_assuming and don't use it in pw.mac anymore, which is my package. I have another variation on it copied from pw.mac version 4 which fixes the problem above. I don't know if it is perfect but it may solve this issue, I think. /* a variation of simp_assuming that fixes a minor bug. */ simp_given(e, [fcts]) ::= buildq([e,fcts], block([_ans], unwind_protect((_ans:apply(assume, fcts), expand(e,0,0)), apply(forget,_ans)))); Rich From willisb at unk.edu Tue Mar 13 22:43:28 2012 From: willisb at unk.edu (Barton Willis) Date: Tue, 13 Mar 2012 22:43:28 -0500 Subject: [Maxima] mydefint2 In-Reply-To: References: , <1AC27E4278D4490AB930158BE1BA2407@edwinc367e16bd> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >In particular, there are two problems with this definition: > >a) It is actually eval_assuming, not simp_assuming (remember that ::= >defines a macro). > > b) It does not?necessarily return you to the original state: > >assume(x>0)$ > >facts() => [x>0] >block( assume(x>0), forget(x>0) ) >facts() => [] ? <<< oops, deleted existing fact > > >A better definition would use the 'context' mechanism to do this cleanly. I have no experience using contexts. Maybe somebody would like to comment on my first waffle: (the first waffle is never quite right) (%i1) larry(e,[fcts]) ::= block([cntx], newcontext(cntx), for f in fcts do assume(f), unwind_protect(expand(e,0,0), killcontext(cntx)))$ (%i2) george(e,[fcts]) ::= block([cntx], supcontext(cntx), for f in fcts do assume(f), unwind_protect(expand(e,0,0), killcontext(cntx)))$ (%i3) load(unwind_protect)$ (%i4) assume(x > 10)$ (%i5) larry(max(x,x^2), 0 < x, x < 1); (%o5) x (%i6) george(max(x,x^2), 0 < x, x < 1); (%o6) x^2 (%i7) facts(); (%o7) [x>10] (%i8) contexts; (%o8) [initial,global] (%i9) max(x,x^2); (%o9) x^2 --bw From robert.dodier at gmail.com Wed Mar 14 01:15:15 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 14 Mar 2012 00:15:15 -0600 Subject: [Maxima] part of equation as function In-Reply-To: <4F5F0D9B.8080404@fe.up.pt> References: <4F5EFCFE.3090502@math.uni-dortmund.de> <4F5F0D9B.8080404@fe.up.pt> Message-ID: On 3/13/12, Jaime Villate wrote: > for mathematical functions use always define() instead of :=. Think of > := as a way to define a small program, rather than defining a function. I dunno. The difference between ":=" and define is that the latter evaluates its arguments and the former doesn't. That's the extent of it. There isn't any sense in which one is more mathematical than the other. best Robert Dodier From robert.dodier at gmail.com Wed Mar 14 01:20:07 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 14 Mar 2012 00:20:07 -0600 Subject: [Maxima] part of equation as function In-Reply-To: References: <4F5EFCFE.3090502@math.uni-dortmund.de> <4F5F0D9B.8080404@fe.up.pt> Message-ID: On 3/13/12, Javier Arantegui wrote: > Because it's a FAQ, maybe a new sentence should be added to explain > the consequences of that difference, and a new example should be added > showing the different behaviour. Now, the set of examples is the same > in both cases. The first example for ":=" says ":= never evaluates the function body ..." and the first example for define says "define always evaluates its second argument ...". Doesn't that cover it? best Robert Dodier From jensaxel at soegaard.net Wed Mar 14 01:31:02 2012 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Wed, 14 Mar 2012 07:31:02 +0100 Subject: [Maxima] part of equation as function In-Reply-To: References: <4F5EFCFE.3090502@math.uni-dortmund.de> <4F5F0D9B.8080404@fe.up.pt> Message-ID: 2012/3/13 Javier Arantegui : > The difference between ":=" and "define" is a topic that has been > discussed several times. It's one of those things that separate > newbies (like me) and experts. For experts, the difference seems to be > very clear, but most of the new users think that := is the way to > define functions in Maxima. And, frankly the difference is very hard > to tell if you just read the documentation. ... > Because it's a FAQ, maybe a new sentence should be added to explain > the consequences of that difference, and a new example should be added > showing the different behaviour. Now, the set of examples is the same > in both cases. Here is a simple example: (%i13) f(x) := expand( x*(x+1) ); (%o13) f(x) := expand(x (x + 1)) (%i14) define( g(x), expand( x*(x+1) )); 2 (%o14) g(x) := x + x -- Jens Axel S?gaard From villate at fe.up.pt Wed Mar 14 03:22:19 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 14 Mar 2012 08:22:19 +0000 Subject: [Maxima] part of equation as function In-Reply-To: References: <4F5EFCFE.3090502@math.uni-dortmund.de> <4F5F0D9B.8080404@fe.up.pt> Message-ID: <4F60553B.1010104@fe.up.pt> On 03/14/2012 06:15 AM, Robert Dodier wrote: > On 3/13/12, Jaime Villate wrote: > >> for mathematical functions use always define() instead of :=. Think of >> := as a way to define a small program, rather than defining a function. > I dunno. The difference between ":=" and define is that the latter > evaluates its arguments and the former doesn't. That's the extent > of it. There isn't any sense in which one is more mathematical > than the other. > I didn't say that define is more mathematical than := you just read it that way. I just advised the user to use define for what he is doing, in anticipation of his next question: "why df(x) := diff(f(x), x) doesn't work? Cheers, Jaime From mickle.mouse at gmail.com Wed Mar 14 04:05:43 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Wed, 14 Mar 2012 02:05:43 -0700 Subject: [Maxima] part of equation as function In-Reply-To: <4F60553B.1010104@fe.up.pt> References: <4F5EFCFE.3090502@math.uni-dortmund.de> <4F5F0D9B.8080404@fe.up.pt> <4F60553B.1010104@fe.up.pt> Message-ID: I've not really been following this much but you can make ":=" evaluate parts of the right-hand-side by putting it inside parentheses and prefixing with two single quotes ('') (%i1) f(x) := expand( x*(x+1) ); (%o1) f(x) := expand(x (x + 1)) (%i2) g(x) := ''( expand( x*(x+1) ) ) (%o2) g(x) := x^2 + x On Wed, Mar 14, 2012 at 1:22 AM, Jaime Villate wrote: > On 03/14/2012 06:15 AM, Robert Dodier wrote: >> >> On 3/13/12, Jaime Villate ?wrote: >> >>> for mathematical functions use always define() instead of :=. Think of >>> := as a way to define a small program, rather than defining a function. >> >> I dunno. The difference between ":=" and define is that the latter >> evaluates its arguments and the former doesn't. That's the extent >> of it. There isn't any sense in which one is more mathematical >> than the other. >> > I didn't say that define is more mathematical than := you just read it that > way. > > I just advised the user to use define for what he is doing, in anticipation > of his > next question: "why df(x) := diff(f(x), x) doesn't work? > > Cheers, > Jaime > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From jwaixs at gmail.com Tue Mar 13 07:29:39 2012 From: jwaixs at gmail.com (Noud) Date: Tue, 13 Mar 2012 13:29:39 +0100 Subject: [Maxima] Basic Hypergeometric Series In-Reply-To: References: Message-ID: On Tue, Mar 13, 2012 at 6:08 AM, Robert Dodier wrote: > On 3/11/12, Noud wrote: > > > I tried to read the hypergeometric.lisp, but I could not make much of it. > > Probably the biggest problem here is that I do not have a lot of > experience > > with Lisp, but I do also not really know how Maxima work. Is there more > > documentation about how to implement new functions in Maxima? Or could > you > > give me some advice on how to proceed? > > Well, probably the way to go about this is for you to tell us a list > of identities you want to put into play, and we'll try to advise you as > to the best way to accomplish that. Maybe the best way is to write > a Maxima function, or create a user-defined simplification rule, > or something else. Maybe Lisp programming is needed, and maybe > it isn't; no need to jump to conclusions just yet. > > best > > Robert Dodier > There is this book Basic Hypergeometric Series from Gasper and Rahman, I basically want to implement the first chapter of this book. The main identities and functions here are: (-) The q-binomial formula, (-) q-exponentials, (-) Heine's transformation formulas for 2_\phi_1, (-) Heine's q-analogue of Gauss' summation formula, (-) q-analogue of Saalschutz's summation formula, (-) Bailey-Daum summation formula, (-) q-Gamma and q-Beta functions Furthermore there are quite some identities spread through the first chapter and exercises which are very basic but important. Also I would like to have some q-analoges for orthogonal polynomials like the Little q-Jacobi polynomials, q-Hermite polynomials, etc. Best regards, Noud -------------- next part -------------- An HTML attachment was scrubbed... URL: From vim.unix at googlemail.com Tue Mar 13 11:05:46 2012 From: vim.unix at googlemail.com (Pau) Date: Tue, 13 Mar 2012 17:05:46 +0100 Subject: [Maxima] solving two equations In-Reply-To: <1qpsjhcd2mi.fsf@iceland.freeshell.org> References: <1qpsjhcd2mi.fsf@iceland.freeshell.org> Message-ID: Dear Leo, thanks for the help. In my case, I get: (%i5) solve(first(%o5)/a,a); first: argument must be a non-atomic expression; found %o5 -- an error. To debug this try: debugmode(true); The other option solve(log(TGW)=log(TRRV),a), logexpand=all; leads to something... But could you explain me what you did? What does first(%o5)/a mean? And why does the log help? The reply starts with 3146 log(Rinfl) gamma 6292 log(M + m) (%o6) [a = expt(%e, --------------------- - ------------------ 3146 gamma - 25168 3146 gamma - 25168 .... What does that %e mean? I suppose the answer is the exponent of the log? thanks! On 13 March 2012 14:58, Leo Butler wrote: > Pau writes: > >> Thanks... however something seems strange... it looks like maxima is >> trying to simplify the expression and in the end I get >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? 3 - gamma >> ? ? ? ? ? ? ? ? ? ? 3/8 - --------- ? ? ? ? ? ? ? ? ? ? ? ? ?3 ? ? ? ?3 >> ? ? ? ?1/4 ? ? ? ? ? ? ? ? ? ?8 ? ? ? ? ? ? 2 ? ? ? ? ? ? ? G ?M + m G ?1/4 >> ? ? 4 6 ? ?sqrt(7) a ? ? ? ? ? ? ? ?sqrt(2 e ?+ 1) sqrt(M) (-----------) >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?c >> a = -----------------------------------------------------------------------] >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? gamma - 3 >> ? ? ? ? ?5/4 ? ? ? ?4 ? ? ? ?2 ? ? ?1/4 ?Rinfl ? ? ? ? ?M 1/8 ? ? ?1/8 >> ? ? ? ? 5 ? ?c (37 e ?+ 292 e ?+ 96) ? ?(----------------) ? ?(G M) >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? m >> >> >> (I hope that the alignment is right) >> >> As you can see, there's an "a" in the right hand side... that's strange >> >> I did this: >> >> (%i1) Fe : 1 + (73/24)*e^2 + (37/96)*e^4$ >> >> (%i2) Na : (M/m) * (a/Rinfl)^(3-gamma)$ >> >> (%i3) TGW : (5/64) * (c^5/G^3) * a^4/(m*M * (m + M)) * Fe$ >> >> (%i4) TRRV : a^(3/2)/(sqrt(G*M)) * M/m * (0.28*(e^2+0.5))^2/sqrt(Na)$ >> >> (%i5) solve(TGW=TRRV,a); >> >> Any idea of what might have gone wrong? >> >> thanks > > For some reason, solve gave up and returned a partial answer. > Here are a couple ideas: > > solve(first(%o5)/a,a); > > solve(log(TGW)=log(TRRV),a), logexpand=all; > > Both give me an answer. > > Btw, gamma is the name of a function in Maxima. Although variables and > functions may share the same name, this will likely lead to obscure and > wierd errors, so it is better to use another name. > > Leo > >> >> On 12 March 2012 00:56, Leo Butler wrote: >>> Pau writes: >>> >>>> Hi, >>>> >>>> I am sorry for a rather trivial question... If I have two equations like >>>> >>>> T(a,e) = a^4 ( 1 - e^3) >>>> H(a,e) = e^3 * constants * a^(-1) >>>> >>>> and I want to find the values of a ,e that equate them >>>> >>>> T(a,e) = H(a,e) ?---> a = XXXX f(e) >>> >>> Try >>> ? solve >>> at the Maxima command line. >>> >>> A couple notes: >>> -the assignment operator in Maxima is : >>> -the function definition operator is := >>> -to solve your problem, >>> ?I did >>> >>> (%i1) T : a^4*(1 - e^3) $ H : c*e^3/a $ display2d : false $ >>> >>> (%i4) solve(T=H,e); >>> >>> (%o4) [e = (sqrt(3)*%i-1)*a^(5/3)/(2*(c+a^5)^(1/3)), >>> ? ? ? e = -(sqrt(3)*%i+1)*a^(5/3)/(2*(c+a^5)^(1/3)), >>> ? ? ? e = a^(5/3)/(c+a^5)^(1/3)] >>> >>>> >>>> how could I do this in maxima? The best would be an example. >>>> >>>> Thanks for this nice piece of software. I am looking forward to >>>> learning how to use it in detail. Looks very promising. >>>> >>>> Cheers, >>>> >>>> Pau >>>> _______________________________________________ >>>> Maxima mailing list >>>> Maxima at math.utexas.edu >>>> http://www.math.utexas.edu/mailman/listinfo/maxima >>>> >>> >>> -- >>> Leo Butler ? ? ? ? ? ? ? ? >>> SDF Public Access UNIX System - ? http://sdf.lonestar.org >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> > > -- > Leo Butler ? ? ? ? ? ? ? ? > SDF Public Access UNIX System - ? http://sdf.lonestar.org From fateman at eecs.berkeley.edu Wed Mar 14 06:40:25 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 14 Mar 2012 04:40:25 -0700 Subject: [Maxima] part of equation as function In-Reply-To: References: <4F5EFCFE.3090502@math.uni-dortmund.de> <4F5F0D9B.8080404@fe.up.pt> Message-ID: <4F6083A9.4050606@eecs.berkeley.edu> On 3/13/12 11:31 PM, Jens Axel S?gaard wrote: > > Here is a simple example: > > (%i13) f(x) := expand( x*(x+1) ); > (%o13) f(x) := expand(x (x + 1)) > > (%i14) define( g(x), expand( x*(x+1) )); > 2 > (%o14) g(x) := x + x > If you are going to try for a FAQ, it seems to me it would be this. the difference between f(x) := %o5 f(x):=''%o5 define(f(x), %o5) define(f(x),'%o5) and maybe a few others. In particular, the first line, f(x):=%o5 will always return the value of %o5, and if you change %o5, it will affect the meaning of f. IF you want to re-type %o5 in to the system as the right hand side of the definition of f, then use the second line. Or the third line. The fourth line is unlikely to be anything you want. It is like the first line. RJF From fateman at eecs.berkeley.edu Wed Mar 14 06:46:02 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 14 Mar 2012 04:46:02 -0700 Subject: [Maxima] Basic Hypergeometric Series In-Reply-To: References: Message-ID: <4F6084FA.3040208@eecs.berkeley.edu> On 3/13/12 5:29 AM, Noud wrote: > On Tue, Mar 13, 2012 at 6:08 AM, Robert Dodier > > wrote: > > On 3/11/12, Noud > wrote: > > > I tried to read the hypergeometric.lisp, but I could not make > much of it. > > Probably the biggest problem here is that I do not have a lot of > experience > > with Lisp, but I do also not really know how Maxima work. Is > there more > > documentation about how to implement new functions in Maxima? Or > could you > > give me some advice on how to proceed? > > Well, probably the way to go about this is for you to tell us a list > of identities you want to put into play, and we'll try to advise > you as > to the best way to accomplish that. Maybe the best way is to write > a Maxima function, or create a user-defined simplification rule, > or something else. Maybe Lisp programming is needed, and maybe > it isn't; no need to jump to conclusions just yet. > > best > > Robert Dodier > > > There is this book Basic Hypergeometric Series from Gasper and Rahman, > I basically want to implement the first chapter of this book. You can't "implement an identity" generally. You have to decide "if the simplifier sees XXX then it should replace it with YYY [under some conditions]" An identity doesn't say which way to transform. There are papers to look at which attempt to meld the hypergeometric function adjacency relations into a goal-oriented simplifier. I don't know to what extent your series ideas are the same as the HG function issues, but there is literature to look at, as well as a person to consult, Bill Gosper who has written about some of these issues in terms of programming in Lisp and Macsyma. ..... > The main identities and functions here are: > > (-) The q-binomial formula, > (-) q-exponentials, > (-) Heine's transformation formulas for 2_\phi_1, > (-) Heine's q-analogue of Gauss' summation formula, > (-) q-analogue of Saalschutz's summation formula, > (-) Bailey-Daum summation formula, > (-) q-Gamma and q-Beta functions > > Furthermore there are quite some identities spread through the first > chapter and exercises which are very basic but important. Also I would > like to have some q-analoges for orthogonal polynomials like the > Little q-Jacobi polynomials, q-Hermite polynomials, etc. > > Best regards, > Noud > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From javier.arantegui at gmail.com Wed Mar 14 07:09:38 2012 From: javier.arantegui at gmail.com (Javier Arantegui) Date: Wed, 14 Mar 2012 13:09:38 +0100 Subject: [Maxima] part of equation as function In-Reply-To: References: <4F5EFCFE.3090502@math.uni-dortmund.de> <4F5F0D9B.8080404@fe.up.pt> <4F60553B.1010104@fe.up.pt> Message-ID: Hello! On Wed, Mar 14, 2012 at 10:05 AM, Mike Valenzuela wrote: > (%i1) f(x) := expand( x*(x+1) ); > (%o1) f(x) := expand(x (x + 1)) > > (%i2) g(x) := ''( expand( x*(x+1) ) ) > (%o2) g(x) := x^2 + x But: (%i6) z=x+y; (%o6) z=y+x (%i8) f(x,y):=''rhs(%o6); (%o8) f(x,y):=rhs(%o6) (%i9) f(1,2); (%o9) y+x And: (%i10) define(g(x,y),rhs(%o6)); (%o10) g(x,y):=y+x (%i11) g(1,2); (%o11) 3 Javier -- Lee mi blog: "Un peque?o paso para Neil" http://up3n.wordpress.com/ ?Ahora tambi?n en Twitter! http://twitter.com/javierarantegui From fateman at eecs.berkeley.edu Wed Mar 14 07:16:08 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 14 Mar 2012 05:16:08 -0700 Subject: [Maxima] part of equation as function In-Reply-To: References: <4F5EFCFE.3090502@math.uni-dortmund.de> <4F5F0D9B.8080404@fe.up.pt> <4F60553B.1010104@fe.up.pt> Message-ID: <4F608C08.7020505@eecs.berkeley.edu> On 3/14/12 5:09 AM, Javier Arantegui wrote: > (%i8) f(x,y):=''rhs(%o6); compare this to the correct expression, f(x,y):= rhs(''%o6) RJF From aleksasd873 at gmail.com Wed Mar 14 10:32:36 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Wed, 14 Mar 2012 17:32:36 +0200 Subject: [Maxima] How factor exp(x+y) ? Message-ID: How factor exp(x+y) ? For examaple, I want integrate(exp(x+y)*f(y),y) convert to exp(x)*integrate(exp(y)*f(y),y). -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Wed Mar 14 10:37:12 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 14 Mar 2012 09:37:12 -0600 Subject: [Maxima] maxima bug In-Reply-To: References: Message-ID: On 3/9/12, Raymond Toy wrote: >> reset();kill(all); >> assume(z>r); >> radcan(sqrt(r^2-2*z*r+z^2)); >> >> it gives >> >> z-r >> >> works fine >> >> but with capital R >> >> reset();kill(all); >> assume(z>R); >> radcan(sqrt(R^2-2*z*R+z^2)); >> >> it gives >> >> R-z >> >> should be >> z-R > I don't think this is a bug. Radcan does sometimes do things like this and > that is the expected result. I don't think radcan recognizes assume either. radcan ignores assume -- I think that's a bug. That the result depends on the ordering of the variables is OK only if all possible results are equally valid. That's not the case when there are facts (stated by assume) to take into account. It's true that many functions in Maxima ignore assume. I don't think that's desirable, although I do understand that it's hard to fix. best Robert Dodier From macrakis at alum.mit.edu Wed Mar 14 11:26:08 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 14 Mar 2012 12:26:08 -0400 Subject: [Maxima] maxima bug In-Reply-To: References: Message-ID: Robert, Though I agree that, in general, Maxima functions should not ignore assumptions, radcan is *by design* oblivious to them. Radcan is supposed to return a near-canonical "over a large class of expressions and *a given ordering of variables*" (my emphasis), so radcan(EX) should return the same value *regardless* of assumptions. It would be a bug if radcan(EX) returned different values dependent on the environment. Radcan does not follow the numerical-analysis convention that sqrt(EX) is the positive square root; rather, it represents *some* consistently-chosen square root. What is more confusing is that radcan(sqrt(x^2)-x) doesn't return 0 -- because the general simplification sqrt(x^2)->abs(x) interferes. That can of course be corrected by setting domain:complex. -s On Wed, Mar 14, 2012 at 11:37, Robert Dodier wrote: > On 3/9/12, Raymond Toy wrote: > > >> reset();kill(all); > >> assume(z>r); > >> radcan(sqrt(r^2-2*z*r+z^2)); > >> > >> it gives > >> > >> z-r > >> > >> works fine > >> > >> but with capital R > >> > >> reset();kill(all); > >> assume(z>R); > >> radcan(sqrt(R^2-2*z*R+z^2)); > >> > >> it gives > >> > >> R-z > >> > >> should be > >> z-R > > > I don't think this is a bug. Radcan does sometimes do things like this > and > > that is the expected result. I don't think radcan recognizes assume > either. > > radcan ignores assume -- I think that's a bug. That the result depends on > the ordering of the variables is OK only if all possible results are > equally valid. > That's not the case when there are facts (stated by assume) to take into > account. > > It's true that many functions in Maxima ignore assume. I don't think > that's desirable, although I do understand that it's hard to fix. > > best > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ultradenso at gmail.com Wed Mar 14 11:38:40 2012 From: ultradenso at gmail.com (joaquin borges) Date: Wed, 14 Mar 2012 13:38:40 -0300 Subject: [Maxima] plotting problem with trigonometric functions Message-ID: <4F60C990.5050207@gmail.com> Hello : I have a problem with the command "plot2d(sec(x)*cos(x),[x,-1,1]);" It does not complete an takes almost all cpu power. I'm on ubuntu 10.10 64 bits with an amd athlon processor and 2 GiB of memory. I run the command from rmaxima . best regards joaquin From toy.raymond at gmail.com Wed Mar 14 11:50:47 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 14 Mar 2012 09:50:47 -0700 Subject: [Maxima] plotting problem with trigonometric functions In-Reply-To: <4F60C990.5050207@gmail.com> References: <4F60C990.5050207@gmail.com> Message-ID: On Wed, Mar 14, 2012 at 9:38 AM, joaquin borges wrote: > Hello : > I have a problem with the command "plot2d(sec(x)*cos(x),[x,-1,1]**);" > It does not complete an takes almost all cpu power. > I'm on ubuntu 10.10 64 bits with an amd athlon processor and 2 GiB of > memory. > > Hmm. I see a similar thing, but it's not maxima. Maxima returns almost instantly, but gnuplot is sucking up 100% cpu plotting a (mostly) constant. Not sure why that is because plot2d(1,[x,-1,1]) brings up a plot instantly. So it's not a maxima problem per se. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From O.Kullmann at swansea.ac.uk Wed Mar 14 11:56:25 2012 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Wed, 14 Mar 2012 16:56:25 +0000 Subject: [Maxima] plotting problem with trigonometric functions In-Reply-To: <4F60C990.5050207@gmail.com> References: <4F60C990.5050207@gmail.com> Message-ID: <20120314165625.GD7109@cs-wsok.swan.ac.uk> I can confirm that behaviour, using Maxima version: 5.26.0 Maxima build date: 1:35 12/20/2011 Host type: x86_64-unknown-linux-gnu Lisp implementation type: ECL Lisp implementation version: 11.1.1 Plotting just sec(x) or cos(x) is not a problem, but the product seems to run into an infinite loop. Oliver On Wed, Mar 14, 2012 at 01:38:40PM -0300, joaquin borges wrote: > Hello : > I have a problem with the command "plot2d(sec(x)*cos(x),[x,-1,1]);" > It does not complete an takes almost all cpu power. > I'm on ubuntu 10.10 64 bits with an amd athlon processor and 2 GiB > of memory. > I run the command from rmaxima . > best regards > > joaquin > > From toy.raymond at gmail.com Wed Mar 14 12:12:35 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 14 Mar 2012 10:12:35 -0700 Subject: [Maxima] plotting problem with trigonometric functions In-Reply-To: <20120314165625.GD7109@cs-wsok.swan.ac.uk> References: <4F60C990.5050207@gmail.com> <20120314165625.GD7109@cs-wsok.swan.ac.uk> Message-ID: On Wed, Mar 14, 2012 at 9:56 AM, Oliver Kullmann wrote: > I can confirm that behaviour, using > > Maxima version: 5.26.0 > Maxima build date: 1:35 12/20/2011 > Host type: x86_64-unknown-linux-gnu > Lisp implementation type: ECL > Lisp implementation version: 11.1.1 > > Plotting just sec(x) or cos(x) is not a problem, > but the product seems to run into an infinite loop. > Maxima hangs and not gnuplot? If so, try changing the adapt_depth plot_option to 1 or 0 and see if that helps. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Wed Mar 14 13:22:12 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 14 Mar 2012 12:22:12 -0600 Subject: [Maxima] plotting problem with trigonometric functions In-Reply-To: References: <4F60C990.5050207@gmail.com> <20120314165625.GD7109@cs-wsok.swan.ac.uk> Message-ID: Looks like a Gnuplot bug to me. This is enough to trigger it: $ cat /tmp/baz.data -1. 1. 0.7068965517241379 0.99999999999999989 1. 1. then in gunplot, issue: plot "/tmp/baz.data" $ gnuplot --version gnuplot 4.4 patchlevel 2 I suppose Gnuplot is trying to find the range and getting mixed up somehow. Incidentally if all y-values are exactly the same it doesn't seem to have the same problem. I guess somebody should forward this to the Gnuplot team but I'm too lazy. best Robert Dodier On 3/14/12, Raymond Toy wrote: > On Wed, Mar 14, 2012 at 9:56 AM, Oliver Kullmann > wrote: > >> I can confirm that behaviour, using >> >> Maxima version: 5.26.0 >> Maxima build date: 1:35 12/20/2011 >> Host type: x86_64-unknown-linux-gnu >> Lisp implementation type: ECL >> Lisp implementation version: 11.1.1 >> >> Plotting just sec(x) or cos(x) is not a problem, >> but the product seems to run into an infinite loop. >> > > Maxima hangs and not gnuplot? > > If so, try changing the adapt_depth plot_option to 1 or 0 and see if that > helps. > > Ray > From macrakis at alum.mit.edu Wed Mar 14 13:58:02 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 14 Mar 2012 14:58:02 -0400 Subject: [Maxima] part of equation as function In-Reply-To: References: <4F5EFCFE.3090502@math.uni-dortmund.de> <4F5F0D9B.8080404@fe.up.pt> <4F60553B.1010104@fe.up.pt> Message-ID: Javier, Maxima parses ''f(x) as (''f)(x), not as ''(f(x)), which will do what you want. But I still recommend using define(A(...),B) rather than A(...):=''(B). I recommend avoiding the '' operator for several reasons: - Read-time evaluation is confusing and weird. Consider for example: (%i36) [print(4),''(print(3))]; 3 4 (%o36) [4,3] or (%i41) x:1$ (%i42) [''x,x,''(x:x+1),x:x+1,''x]; (%o42) [1,2,2,3,2] - Read-time evaluation doesn't (can't!) respect scope rules: block([x],''x) uses the global x, not the local x. - '' cannot be used to create new function bodies within programs, making interactive programming and function definition inconsistent. - When reviewing code, it is hard to tell the difference between '' (two single quotes) and " (one double quote). Of course, old-time Lisp hackers like me love all these crazy different evaluation times (read time, load time, compilation time, macro expansion time, execution time...), but I don't think we should impose this complexity on straightforward mathematical usage of Maxima. -s On Wed, Mar 14, 2012 at 08:09, Javier Arantegui wrote: > Hello! > > On Wed, Mar 14, 2012 at 10:05 AM, Mike Valenzuela > wrote: > > (%i1) f(x) := expand( x*(x+1) ); > > (%o1) f(x) := expand(x (x + 1)) > > > > (%i2) g(x) := ''( expand( x*(x+1) ) ) > > (%o2) g(x) := x^2 + x > > But: > > (%i6) z=x+y; > (%o6) z=y+x > > (%i8) f(x,y):=''rhs(%o6); > (%o8) f(x,y):=rhs(%o6) > > (%i9) f(1,2); > (%o9) y+x > > And: > > (%i10) define(g(x,y),rhs(%o6)); > (%o10) g(x,y):=y+x > > (%i11) g(1,2); > (%o11) 3 > > Javier > > > > -- > Lee mi blog: "Un peque?o paso para Neil" http://up3n.wordpress.com/ > ?Ahora tambi?n en Twitter! http://twitter.com/javierarantegui > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Wed Mar 14 14:09:58 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 14 Mar 2012 15:09:58 -0400 Subject: [Maxima] How factor exp(x+y) ? In-Reply-To: References: Message-ID: exp(x) automatically simplifies to %e^x, and %e^x * %e^y automatically simplifies to %e^(x+y), so Maxima can't return the expression %e^x * %e^y. It's unfortunate that 'integrate(%e^(x+y)*f(x),x) doesn't simplify to %e^y*'integrate(%e^x*f(x),x). Definitely a misfeature, maybe even a bug. As a workaround, try the following: (%i1) integrate(exp(x+y)*f(y),y); (%o1) 'integrate(%e^(y+x)*f(y),y) (%i2) ratsubst(expx,exp(x),%o1); (%o2) expx*'integrate(%e^y*f(y),y) (%i3) subst(exp(x),expx,%o2); (%o3) %e^x*'integrate(%e^y*f(y),y) Does this solve your problem? -s On Wed, Mar 14, 2012 at 11:32, Aleksas Domarkas wrote: > How factor exp(x+y) ? > > For examaple, I want > integrate(exp(x+y)*f(y),y) convert to > exp(x)*integrate(exp(y)*f(y),y). > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From biomates at telefonica.net Wed Mar 14 14:45:02 2012 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 14 Mar 2012 20:45:02 +0100 Subject: [Maxima] plotting problem with trigonometric functions In-Reply-To: References: <4F60C990.5050207@gmail.com> <20120314165625.GD7109@cs-wsok.swan.ac.uk> Message-ID: <1331754302.9580.20.camel@pc> El mi?, 14-03-2012 a las 12:22 -0600, Robert Dodier escribi?: > Looks like a Gnuplot bug to me. > This is enough to trigger it: > > $ cat /tmp/baz.data > > -1. 1. > 0.7068965517241379 0.99999999999999989 > 1. 1. > > then in gunplot, issue: plot "/tmp/baz.data" > > $ gnuplot --version > gnuplot 4.4 patchlevel 2 > > I suppose Gnuplot is trying to find the range and getting > mixed up somehow. Incidentally if all y-values are exactly the > same it doesn't seem to have the same problem. > > I guess somebody should forward this to the Gnuplot team > but I'm too lazy. > > best When I plot this function with draw (and Gnuplot 4.4 patchlevel 3) I get: (%i1) load(draw)$ (%i2) draw2d(explicit(sec(x)*cos(x),x,-1,1))$ (%i3) line 27: warning: tick interval too small for machine precision The problem is that the y-range is too narrow for this function and Gnuplot complains. If I type (%i4) draw2d(explicit(sec(x)*cos(x),x,-1,1), yrange=[0.9, 1.1])$ I get a perfect horizontal line without any warning in only 0.176011 sec. A similar workaround for plot2d: (%i16) plot2d( sec(x)*cos(x),[x,-1,1], [gnuplot_preamble, "set yrange [0.9:1.1]"]); I think it wouldn't be too hard to fix this in package draw. -- Mario From O.Kullmann at swansea.ac.uk Wed Mar 14 14:46:25 2012 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Wed, 14 Mar 2012 19:46:25 +0000 Subject: [Maxima] plotting problem with trigonometric functions In-Reply-To: References: <4F60C990.5050207@gmail.com> <20120314165625.GD7109@cs-wsok.swan.ac.uk> Message-ID: <20120314194625.GD21563@cs-wsok.swan.ac.uk> How can I find out *which* gnuplot is called by Maxima? Can Maxima ask "its" gnuplot to output the version number? Under "?? gnuplot" quite a number of possibilities show up, but nothing tells me which gnuplot is used by Maxima? Oliver On Wed, Mar 14, 2012 at 12:22:12PM -0600, Robert Dodier wrote: > Looks like a Gnuplot bug to me. > This is enough to trigger it: > > $ cat /tmp/baz.data > > -1. 1. > 0.7068965517241379 0.99999999999999989 > 1. 1. > > then in gunplot, issue: plot "/tmp/baz.data" > > $ gnuplot --version > gnuplot 4.4 patchlevel 2 > > I suppose Gnuplot is trying to find the range and getting > mixed up somehow. Incidentally if all y-values are exactly the > same it doesn't seem to have the same problem. > > I guess somebody should forward this to the Gnuplot team > but I'm too lazy. > > best > > Robert Dodier > > On 3/14/12, Raymond Toy wrote: > > On Wed, Mar 14, 2012 at 9:56 AM, Oliver Kullmann > > wrote: > > > >> I can confirm that behaviour, using > >> > >> Maxima version: 5.26.0 > >> Maxima build date: 1:35 12/20/2011 > >> Host type: x86_64-unknown-linux-gnu > >> Lisp implementation type: ECL > >> Lisp implementation version: 11.1.1 > >> > >> Plotting just sec(x) or cos(x) is not a problem, > >> but the product seems to run into an infinite loop. > >> > > > > Maxima hangs and not gnuplot? > > > > If so, try changing the adapt_depth plot_option to 1 or 0 and see if that > > helps. > > > > Ray > > -- Dr. Oliver Kullmann Department of Computer Science College of Science, Swansea University Faraday Building, Singleton Park Swansea SA2 8PP, UK http://cs.swan.ac.uk/~csoliver/ From villate at fe.up.pt Wed Mar 14 14:46:56 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 14 Mar 2012 19:46:56 +0000 Subject: [Maxima] plotting problem with trigonometric functions In-Reply-To: References: <4F60C990.5050207@gmail.com> Message-ID: <4F60F5B0.6080603@fe.up.pt> On 03/14/2012 04:50 PM, Raymond Toy wrote: > Hmm. I see a similar thing, but it's not maxima. Maxima returns > almost instantly, but gnuplot is sucking up 100% cpu plotting a > (mostly) constant. Not sure why that is because plot2d(1,[x,-1,1]) > brings up a plot instantly. > > So it's not a maxima problem per se. Right. plot2d(sec(x)*cos(x),[x,-1,1],[plot_format,xmaxima]) works fine. But even being a Gnuplot issue, this suggests that we could use something such as fpprintprec: 14 when creating the data file for Gnuplot. In any case no graphic display will be able to use more than 14 digits for a plot (I think!). Is anyone against that I go ahead and do such change in plot2d? Regards, Jaime From villate at fe.up.pt Wed Mar 14 15:01:35 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 14 Mar 2012 20:01:35 +0000 Subject: [Maxima] plotting problem with trigonometric functions In-Reply-To: <1331754302.9580.20.camel@pc> References: <4F60C990.5050207@gmail.com> <20120314165625.GD7109@cs-wsok.swan.ac.uk> <1331754302.9580.20.camel@pc> Message-ID: <4F60F91F.203@fe.up.pt> On 03/14/2012 07:45 PM, Mario Rodriguez wrote: > A similar workaround for plot2d: > > (%i16) plot2d( > sec(x)*cos(x),[x,-1,1], > [gnuplot_preamble, "set yrange [0.9:1.1]"]); Or even simpler: plot2d (sec(x)*cos(x), [x,-1,1], [y,0.9,1.1]); Jaime From fateman at eecs.berkeley.edu Wed Mar 14 15:34:37 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 14 Mar 2012 13:34:37 -0700 Subject: [Maxima] radcan and assume (was Re: maxima bug) In-Reply-To: References: Message-ID: <4F6100DD.20905@eecs.berkeley.edu> On 3/14/12 8:37 AM, Robert Dodier wrote: > On 3/9/12, Raymond Toy wrote: > >>> reset();kill(all); >>> assume(z>r); >>> radcan(sqrt(r^2-2*z*r+z^2)); >>> >>> it gives >>> >>> z-r >>> >>> works fine >>> >>> but with capital R >>> >>> reset();kill(all); >>> assume(z>R); >>> radcan(sqrt(R^2-2*z*R+z^2)); >>> >>> it gives >>> >>> R-z >>> >>> should be >>> z-R >> I don't think this is a bug. Radcan does sometimes do things like this and >> that is the expected result. I don't think radcan recognizes assume either. > radcan ignores assume -- I think that's a bug. That the result depends on > the ordering of the variables is OK only if all possible results are > equally valid. > That's not the case when there are facts (stated by assume) to take into > account. radcan was written before assume. Radcan produces a particular well-defined answer, and yes it depends on the ordering of variable names. If you want to write a different program to do something else, then I suggest you (a) define what that program will do (b) implement a working version of assume() and friends so that it too can be well defined (c) implement your new version of simplification of radicals with respect to assumptions. While you are at it, use denesting and perhaps rootof() features. By the way, this may require re-writing a substantial part of Maxima, because you have to deal with multi-valued objects. For example, assume(x>0) does not make sqrt(x^2) equal to x. nor does assume(x<=0) make sqrt(x^2) = -x. sqrt(3^2) = sqrt(9) = {-3,+3} sqrt((-3)^2)=sqrt(9) = {-3,3} > > It's true that many functions in Maxima ignore assume. I don't think > that's desirable, although I do understand that it's hard to fix. Unless assume works a lot better than it works now, it is hard to get excited about making other things depend on it. In general, assume and deductions from it can be used to express undecidable predicates, but assume() falls far short, even in the places that are decidable. RJF From robert.dodier at gmail.com Wed Mar 14 23:36:39 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 14 Mar 2012 22:36:39 -0600 Subject: [Maxima] plotting problem with trigonometric functions In-Reply-To: <20120314194625.GD21563@cs-wsok.swan.ac.uk> References: <4F60C990.5050207@gmail.com> <20120314165625.GD7109@cs-wsok.swan.ac.uk> <20120314194625.GD21563@cs-wsok.swan.ac.uk> Message-ID: On 3/14/12, Oliver Kullmann wrote: > How can I find out *which* gnuplot is called by > Maxima? Can Maxima ask "its" gnuplot to output > the version number? There isn't any way to do that, and I'm opposed to making it possible. Writing code that depends on specific versions of stuff is just a mess. I know it's painful but the right solution is to fix the bugs that one would otherwise try to work around. FWIW Robert Dodier From willisb at unk.edu Thu Mar 15 05:46:28 2012 From: willisb at unk.edu (Barton Willis) Date: Thu, 15 Mar 2012 05:46:28 -0500 Subject: [Maxima] simp_assuming (was Re: mydefint2) In-Reply-To: References: , , <1AC27E4278D4490AB930158BE1BA2407@edwinc367e16bd> Message-ID: The easiest way to fix simp_assuming is to eliminate it. I've tested replacing calls to simp_assuming with things such as: supcontext(cntx), e : unwind_protect((assume(lo <= x, x <= hi),expand(e,0,0)), killcontext(cntx)), Likely, I'll expunge simp_assuming from abs_integrate (in share/contrib). One more thing: ?? subcontext gives -- Function: supcontext () Creates a new context, called , which has as a subcontext. must exist. If is not specified, the current context is assumed. But the user documentation is: Function: supcontext (name, context) Function: supcontext (name) Creates a new context, called name, which has context as a subcontext. context must exist. If context is not specified, the current context is assumed. The ?? supcontext documentation is missing "Function: supcontext (name, context)" --Barton From toy.raymond at gmail.com Thu Mar 15 11:02:18 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 15 Mar 2012 09:02:18 -0700 Subject: [Maxima] plotting problem with trigonometric functions In-Reply-To: <4F60F5B0.6080603@fe.up.pt> References: <4F60C990.5050207@gmail.com> <4F60F5B0.6080603@fe.up.pt> Message-ID: On Wed, Mar 14, 2012 at 12:46 PM, Jaime Villate wrote: > On 03/14/2012 04:50 PM, Raymond Toy wrote: > >> Hmm. I see a similar thing, but it's not maxima. Maxima returns almost >> instantly, but gnuplot is sucking up 100% cpu plotting a (mostly) constant. >> Not sure why that is because plot2d(1,[x,-1,1]) brings up a plot instantly. >> >> So it's not a maxima problem per se. >> > Right. > plot2d(sec(x)*cos(x),[x,-1,1],**[plot_format,xmaxima]) works fine. > > But even being a Gnuplot issue, this suggests that we could use something > such as fpprintprec: 14 > when creating the data file for Gnuplot. In any case no graphic display > will be able to use more than 14 digits for a plot (I think!). > That's true, but consider this particular example. sec(x)*cos(x) isn't always exactly 1 because of numerical issues in computing sec and cos. Sometimes it's nice to be able to see that in a plot. If you make maxima only print 14 digits, this difference goes a way. (Yes, it might be better to plot sec(x)*cos(x)-1, but that adds yet another round-off.) > > Is anyone against that I go ahead and do such change in plot2d? > So, I guess I'm (slightly) opposed to this change. It's definitely not a maxima problem, and we should let the gnuplot folks know about it. Or recommend a version of gnuplot that doesn't seem to have this problem (if possible). Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Thu Mar 15 12:03:33 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 15 Mar 2012 11:03:33 -0600 Subject: [Maxima] plotting problem with trigonometric functions In-Reply-To: References: <4F60C990.5050207@gmail.com> <4F60F5B0.6080603@fe.up.pt> Message-ID: I'm opposed to it too. I don;t like trying very to work around other people's problems, and I don't like throwing away information. Incidentally I got latest Gnuplot from CVS (version 4.7 to be) and it doesn't have this problem. Instead I get a warning about "range too small for machine precision" or something like that, which seems appropriate, and a graph is drawn. best, Robert Dodier On 3/15/12, Raymond Toy wrote: > On Wed, Mar 14, 2012 at 12:46 PM, Jaime Villate wrote: > >> On 03/14/2012 04:50 PM, Raymond Toy wrote: >> >>> Hmm. I see a similar thing, but it's not maxima. Maxima returns almost >>> instantly, but gnuplot is sucking up 100% cpu plotting a (mostly) >>> constant. >>> Not sure why that is because plot2d(1,[x,-1,1]) brings up a plot >>> instantly. >>> >>> So it's not a maxima problem per se. >>> >> Right. >> plot2d(sec(x)*cos(x),[x,-1,1],**[plot_format,xmaxima]) works fine. >> >> But even being a Gnuplot issue, this suggests that we could use something >> such as fpprintprec: 14 >> when creating the data file for Gnuplot. In any case no graphic display >> will be able to use more than 14 digits for a plot (I think!). >> > > That's true, but consider this particular example. sec(x)*cos(x) isn't > always exactly 1 because of numerical issues in computing sec and cos. > Sometimes it's nice to be able to see that in a plot. If you make maxima > only print 14 digits, this difference goes a way. (Yes, it might be better > to plot sec(x)*cos(x)-1, but that adds yet another round-off.) > > >> >> Is anyone against that I go ahead and do such change in plot2d? >> > > So, I guess I'm (slightly) opposed to this change. It's definitely not a > maxima problem, and we should let the gnuplot folks know about it. Or > recommend a version of gnuplot that doesn't seem to have this problem (if > possible). > > Ray > From villate at fe.up.pt Thu Mar 15 12:06:56 2012 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 15 Mar 2012 17:06:56 +0000 Subject: [Maxima] plotting problem with trigonometric functions In-Reply-To: References: <4F60C990.5050207@gmail.com> <4F60F5B0.6080603@fe.up.pt> Message-ID: <4F6221B0.40408@fe.up.pt> On 03/15/2012 05:03 PM, Robert Dodier wrote: > I'm opposed to it too. I don;t like trying very to work around > other people's problems, and I don't like throwing away information. OK, I will not do it then. > > Incidentally I got latest Gnuplot from CVS (version 4.7 to be) > and it doesn't have this problem. Instead I get a warning about > "range too small for machine precision" or something like that, > which seems appropriate, and a graph is drawn. That's good. Regards, Jaime From macrakis at alum.mit.edu Thu Mar 15 12:07:25 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 15 Mar 2012 13:07:25 -0400 Subject: [Maxima] plotting problem with trigonometric functions In-Reply-To: References: <4F60C990.5050207@gmail.com> <4F60F5B0.6080603@fe.up.pt> Message-ID: I agree with Ray -- it would be a bad idea to have Maxima arbitrarily limit the precision of numbers passed to the plotting program. From time to time, it really is useful to plot down to the last bit to understand the details of the behavior of a numerical algorithm. For example, I remember plotting the old PDP-10 cos routine and finding that it was not smooth around 0 -- it jittered a bit in the last bit or two, which caused problems in some calculations. -s On Thu, Mar 15, 2012 at 12:02, Raymond Toy wrote: > > > On Wed, Mar 14, 2012 at 12:46 PM, Jaime Villate wrote: > >> On 03/14/2012 04:50 PM, Raymond Toy wrote: >> >>> Hmm. I see a similar thing, but it's not maxima. Maxima returns almost >>> instantly, but gnuplot is sucking up 100% cpu plotting a (mostly) constant. >>> Not sure why that is because plot2d(1,[x,-1,1]) brings up a plot instantly. >>> >>> So it's not a maxima problem per se. >>> >> Right. >> plot2d(sec(x)*cos(x),[x,-1,1],**[plot_format,xmaxima]) works fine. >> >> But even being a Gnuplot issue, this suggests that we could use something >> such as fpprintprec: 14 >> when creating the data file for Gnuplot. In any case no graphic display >> will be able to use more than 14 digits for a plot (I think!). >> > > That's true, but consider this particular example. sec(x)*cos(x) isn't > always exactly 1 because of numerical issues in computing sec and cos. > Sometimes it's nice to be able to see that in a plot. If you make maxima > only print 14 digits, this difference goes a way. (Yes, it might be better > to plot sec(x)*cos(x)-1, but that adds yet another round-off.) > > >> >> Is anyone against that I go ahead and do such change in plot2d? >> > > So, I guess I'm (slightly) opposed to this change. It's definitely not a > maxima problem, and we should let the gnuplot folks know about it. Or > recommend a version of gnuplot that doesn't seem to have this problem (if > possible). > > Ray > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Thu Mar 15 12:41:05 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 15 Mar 2012 13:41:05 -0400 Subject: [Maxima] simp_assuming (was Re: mydefint2) In-Reply-To: References: <1AC27E4278D4490AB930158BE1BA2407@edwinc367e16bd> Message-ID: The code looks good... but I'd think it would be handy to have a with_assumptions macro encapsulating this functionality. The only slightly tricky/annoying thing here is that you'll need gensyms for the context names (since they have to be unique) and supcontext takes a quoted argument. Have I mentioned that I find autoquoting to be really annoying? -s On Thu, Mar 15, 2012 at 06:46, Barton Willis wrote: > The easiest way to fix simp_assuming is to eliminate it. I've tested > replacing calls to simp_assuming with things such as: > > supcontext(cntx), > e : unwind_protect((assume(lo <= x, x <= hi),expand(e,0,0)), > killcontext(cntx)), > > Likely, I'll expunge simp_assuming from abs_integrate (in share/contrib). > > One more thing: ?? subcontext gives > > -- Function: supcontext () > Creates a new context, called , which has as a > subcontext. must exist. > If is not specified, the current context is assumed. > > But the user documentation is: > > Function: supcontext (name, context) > Function: supcontext (name) > Creates a new context, called name, which has context as a subcontext. > context must exist. > > If context is not specified, the current context is assumed. > > The ?? supcontext documentation is missing "Function: supcontext (name, > context)" > > --Barton > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Thu Mar 15 12:56:44 2012 From: willisb at unk.edu (Barton Willis) Date: Thu, 15 Mar 2012 12:56:44 -0500 Subject: [Maxima] simp_assuming (was Re: mydefint2) In-Reply-To: References: <1AC27E4278D4490AB930158BE1BA2407@edwinc367e16bd> Message-ID: maxima-bounces at math.utexas.edu wrote on 03/15/2012 12:41:05 PM: > ... but I'd think it would be handy to have a with_assumptions macro encapsulating this functionality. I'll give the macro approach another try---macro + buildq isn't the easiest thing to understand for users or for me :) >The only slightly tricky/annoying thing here is that you'll need gensyms for > the context names (since they have to be unique) and supcontext > takes a quoted argument. OK thanks for the tip---I guess I need to use the odious apply('supcontext,[cntx]). > Have I mentioned that I find autoquoting to be really annoying? Yes :) --bw -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Thu Mar 15 14:49:30 2012 From: woollett at charter.net (Edwin Woollett) Date: Thu, 15 Mar 2012 12:49:30 -0700 Subject: [Maxima] mydefint1 Message-ID: On Mar. 13, 2012, Stavros Macrakis wrote ----------------------------------- > ... >b) It does *not* necessarily return you to the original state: > >assume(x>0)$ >facts() => [x>0] >block( assume(x>0), forget(x>0) ) >facts() => [] <<< oops, deleted existing fact --------------------------------------------- On Mar 13, 2012, Richard Hennessy wrote ---------------------------------------- > .... I have another variation on it copied from pw.mac > version 4 which fixes the problem above. I > don't know if it is perfect but it may solve this issue, > I think. > >/* a variation of simp_assuming that fixes a minor bug. */ >simp_given(e, [fcts]) ::= > buildq([e,fcts], block([_ans], unwind_protect((_ans:apply(assume, fcts), >expand(e,0,0)), apply(forget,_ans)))); -------------------------------------------------------- On Mar. 15, 2012, Barton Willis wrote ------------------------------------------------------ > The easiest way to fix simp_assuming is to eliminate it. I've tested > replacing calls to simp_assuming with things such as: > ... ----------------------------------------- In the spirit of avoiding the versions of simp_assuming or simp_given,..., I have used Rich's idea to avoid changing the global facts, in what I call mydefint1 -------------------------------------------------- (%i1) display2d:false$ (%i2) mydefint1 (e78, x78, a78, b78) := block ( [domain : complex, res1, _ans], _ans : apply ( 'assume, [ not equal (x78,a78), x78 > a78, x78 < b78, not equal (x78,b78) ] ), res1 : ratsimp (integrate (e78, x78, a78, b78 ) ), apply ( 'forget, _ans), res1)$ (%i3) assume ( x > 1, x < 10 ); (%o3) [ x > 1, x < 10] (%i4) mydefint1 ( cos (x)/x^6, x, 1, 10 ); (%o4) -(%i*gamma_incomplete(-5,10*%i)-%i*gamma_incomplete(-5,%i) +%i*gamma_incomplete(-5,-%i) -%i*gamma_incomplete(-5,-10*%i)) /2 (%i5) facts(); (%o5) [ x > 1, 10 > x ] ----------------------------------------- Whether this continues to work in 2d version mydefint2 remains to be seen. Thanks for the suggestions, and I look forward to learning more about contexts. Ted From macrakis at alum.mit.edu Thu Mar 15 15:10:07 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 15 Mar 2012 16:10:07 -0400 Subject: [Maxima] mydefint1 In-Reply-To: References: Message-ID: Ted, I was wondering why you assume both not equal (x,a) and x>a, since the second implies the first? Have you found problematic cases? If so, those should be reported as bugs. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From vishraj at gmail.com Thu Mar 15 15:56:49 2012 From: vishraj at gmail.com (Vishnu Rajasekharan) Date: Thu, 15 Mar 2012 14:56:49 -0600 Subject: [Maxima] Plotting Message-ID: Greetings, I have four functions: h(t), i(t), j(t), k(t) Then I have a cubic equation incorporating the four functions l(t):=(Z^3)*h(t)+(Z^2)*i(t)+(Z)*j(t)+k(t) I solved it using P:realroots(l(t)) and selected the root using z:rhs(%[1]); Now I need to plot with "t" in the x axis ans "P" in the y axis. I used wxplot2d([P(t)],[t,0,100],[xlabel, "t)"],[style,[lines,3,5]], [ylabel, "P"],[gnuplot_preamble, "set grid; set key top left; set title P vs. t; "])$ and it would allow me to plot. Any help will be greatly appreciated. Thanks vishraj -------------- next part -------------- An HTML attachment was scrubbed... URL: From ultradenso at gmail.com Thu Mar 15 16:10:01 2012 From: ultradenso at gmail.com (joaquin borges) Date: Thu, 15 Mar 2012 18:10:01 -0300 Subject: [Maxima] still having plotting problem Message-ID: <4F625AA9.2060300@gmail.com> Hello : I installed gnuplot form cvs (4.7) and still have the same problem as before. From rmaxima and wxmaxima: plot2d(sec(x)*cos(x),[x,-1,1]) takes all cpu . Running maxima on ubuntu 10.10 (64) with cmucl . best joaquin From woollett at charter.net Thu Mar 15 16:38:28 2012 From: woollett at charter.net (Edwin Woollett) Date: Thu, 15 Mar 2012 14:38:28 -0700 Subject: [Maxima] mydefint1 Message-ID: On Mar. 15, Stavros Macrakis wrote -------------------------- >I was wondering why you assume both not equal (x,a) and x>a, since the >second implies the first? Have you found problematic cases? If so, those >should be reported as bugs. --------------------------------------- You are correct that I found cases where I needed to insert both assumptions to avoid integrate questions. One case I can find quickly is (using 5.26.0gcl): ------------------------------------------------------ (%i1) display2d:false$ (%i2) facts(); (%o2) [] (%i3) assume ( x >= 0, x <= 1 )$ (%i4) integrate (integrate (log (x+y), y, 0, 1), x, 0, 1); Is x - 1.0 negative or zero? n; (%o4) (4*log(2)-3)/2 (%i5) forget( x >= 0, x <= 1)$ (%i6) assume( x >= 0, x < 1, not equal (x, 1)); (%o6) [x >= 0, x < 1, redundant] (%i7) facts(); (%o7) [ x >= 0, 1 > x] (%i8) integrate (integrate (log (x+y), y, 0, 1), x, 0, 1); (%o8) (4*log(2)-3)/2 (%i9) forget( x >= 0, x < 1, not equal (x,1)); (%o9) [ x >= 0, x < 1, notequal (x, 1)] (%i10) facts(); (%o10) [] (%i11) assume (not equal (x,0), x > 0, x < 1, not equal (x, 1)); (%o11) [notequal (x, 0), x > 0, x < 1, redundant] (%i12) facts(); (%o12) [notequal (x, 0), x > 0, 1 > x] (%i13) integrate (integrate (log (x+y), y, 0, 1), x, 0, 1); (%o13) (4*log(2)-3)/2 ----------------------------------------------- Although the code considered not equal(x,1) to be "redundant", and it was not included in the list of facts(), the method avoided the question from integrate. Ted From macrakis at alum.mit.edu Thu Mar 15 16:56:56 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 15 Mar 2012 17:56:56 -0400 Subject: [Maxima] mydefint1 In-Reply-To: References: Message-ID: Um, I think you might want to proofread your examples. In your %i3, you say x<=1, not x<1, which is what I think you intended. I tested your example without the not equal assumptions, and it doesn't ask questions (for me) in Maxima 5.25.1 GCL 2.6.8: (%i1) display2d:false$ (%i2) assume (x > 0, x < 1); (%o2) [x > 0,x < 1] (%i3) integrate (integrate (log (x+y), y, 0, 1), x, 0, 1); (%o3) (4*log(2)-3)/2 -s On Thu, Mar 15, 2012 at 17:38, Edwin Woollett wrote: > On Mar. 15, Stavros Macrakis wrote > -------------------------- > > I was wondering why you assume both not equal (x,a) and x>a, since the >> second implies the first? Have you found problematic cases? If so, those >> should be reported as bugs. >> > ------------------------------**--------- > You are correct that I found cases where I needed to insert both > assumptions to avoid integrate questions. > > One case I can find quickly is (using 5.26.0gcl): > ------------------------------**------------------------ > (%i1) display2d:false$ > > (%i2) facts(); > (%o2) [] > > (%i3) assume ( x >= 0, x <= 1 )$ > > (%i4) integrate (integrate (log (x+y), y, 0, 1), x, 0, 1); > > Is x - 1.0 negative or zero? > > n; > > (%o4) (4*log(2)-3)/2 > > (%i5) forget( x >= 0, x <= 1)$ > > (%i6) assume( x >= 0, x < 1, not equal (x, 1)); > > (%o6) [x >= 0, x < 1, redundant] > > (%i7) facts(); > > (%o7) [ x >= 0, 1 > x] > > (%i8) integrate (integrate (log (x+y), y, 0, 1), x, 0, 1); > (%o8) (4*log(2)-3)/2 > > (%i9) forget( x >= 0, x < 1, not equal (x,1)); > > (%o9) [ x >= 0, x < 1, notequal (x, 1)] > > (%i10) facts(); > (%o10) [] > > (%i11) assume (not equal (x,0), x > 0, x < 1, not equal (x, 1)); > > (%o11) [notequal (x, 0), x > 0, x < 1, redundant] > > (%i12) facts(); > > (%o12) [notequal (x, 0), x > 0, 1 > x] > > (%i13) integrate (integrate (log (x+y), y, 0, 1), x, 0, 1); > (%o13) (4*log(2)-3)/2 > ------------------------------**----------------- > Although the code considered not equal(x,1) to be "redundant", > and it was not included in the list of facts(), the method > avoided the question from integrate. > > Ted > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Thu Mar 15 17:00:42 2012 From: woollett at charter.net (Edwin Woollett) Date: Thu, 15 Mar 2012 15:00:42 -0700 Subject: [Maxima] mydefint1 Message-ID: <1ED85B35795147D5B7126F323CE4401B@edwinc367e16bd> On Mar. 15, 2012, I wrote ---------------------------- >You are correct that I found cases where I needed to insert both >assumptions to avoid integrate questions. ---------------------------------- My example suggests that I can avoid questions by using x < b rather than x <= b. ------------------------------------- (%i1) display2d:false$ (%i2) facts(); (%o2) [] (%i3) assume(x >= 0,x < 1)$ (%i4) integrate(integrate(log(x+y),y,0,1),x,0,1); (%o4) (4*log(2)-3)/2 (%i5) forget(x >= 0,x < 1)$ (%i6) assume(x >= 0,x <= 1)$ (%i7) integrate(integrate(log(x+y),y,0,1),x,0,1); Is x-1.0 negative or zero? n; (%o7) (4*log(2)-3)/2 ---------------------------------- Ted From macrakis at alum.mit.edu Thu Mar 15 17:04:49 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 15 Mar 2012 18:04:49 -0400 Subject: [Maxima] mydefint1 In-Reply-To: <1ED85B35795147D5B7126F323CE4401B@edwinc367e16bd> References: <1ED85B35795147D5B7126F323CE4401B@edwinc367e16bd> Message-ID: Exactly. You should use assume(x wrote: > On Mar. 15, 2012, I wrote > > ---------------------------- > >> You are correct that I found cases where I needed to insert both >> assumptions to avoid integrate questions. >> > ------------------------------**---- > My example suggests that I can avoid questions by using x < b rather than > x <= b. > > > ------------------------------**------- > (%i1) display2d:false$ > (%i2) facts(); > (%o2) [] > (%i3) assume(x >= 0,x < 1)$ > (%i4) integrate(integrate(log(x+y),**y,0,1),x,0,1); > (%o4) (4*log(2)-3)/2 > (%i5) forget(x >= 0,x < 1)$ > (%i6) assume(x >= 0,x <= 1)$ > (%i7) integrate(integrate(log(x+y),**y,0,1),x,0,1); > Is x-1.0 negative or zero? > > n; > (%o7) (4*log(2)-3)/2 > ------------------------------**---- > Ted > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Thu Mar 15 22:48:10 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 15 Mar 2012 20:48:10 -0700 Subject: [Maxima] Plotting In-Reply-To: References: Message-ID: <4F62B7FA.4050305@gmail.com> On 3/15/12 1:56 PM, Vishnu Rajasekharan wrote: > Greetings, > > I have four functions: > > h(t), i(t), j(t), k(t) > > Then I have a cubic equation incorporating the four functions > > l(t):=(Z^3)*h(t)+(Z^2)*i(t)+(Z)*j(t)+k(t) > > I solved it using > > P:realroots(l(t)) > Can you provide more info? I don't see how this can work since realroots requires a polynomial with numbers for the coefficients. Since it's a cubic, you could use solve to get the three roots, but picking the root that is real could be tricky since will depend on the value of t. Ray From toy.raymond at gmail.com Thu Mar 15 23:08:38 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 15 Mar 2012 21:08:38 -0700 Subject: [Maxima] still having plotting problem In-Reply-To: <4F625AA9.2060300@gmail.com> References: <4F625AA9.2060300@gmail.com> Message-ID: On 3/15/12 2:10 PM, joaquin borges wrote: > Hello : > I installed gnuplot form cvs (4.7) and still have the same problem as > before. > From rmaxima and wxmaxima: > plot2d(sec(x)*cos(x),[x,-1,1]) takes all cpu . Did you try plot2d(sec(x)*cos(x),[x,-1,1],[y,.9,1.1]); as Jaime suggested? That works for me. Ray From toy.raymond at gmail.com Thu Mar 15 23:14:04 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 15 Mar 2012 21:14:04 -0700 Subject: [Maxima] plotting problem with trigonometric functions In-Reply-To: <20120314194625.GD21563@cs-wsok.swan.ac.uk> References: <4F60C990.5050207@gmail.com> <20120314165625.GD7109@cs-wsok.swan.ac.uk> <20120314194625.GD21563@cs-wsok.swan.ac.uk> Message-ID: On 3/14/12 12:46 PM, Oliver Kullmann wrote: > How can I find out *which* gnuplot is called by > Maxima? Can Maxima ask "its" gnuplot to output > the version number? > Under "?? gnuplot" quite a number of possibilities show up, > but nothing tells me which gnuplot is used by Maxima? I'm pretty sure it uses "gnuplot", wherever that is in your path. If you want to use a very specific gnuplot, I think you can set gnuplot_command to be the path to the version of gnuplot you want to run. (gnuplot_command isn't documented; perhaps it should be.) Ray From robert.dodier at gmail.com Fri Mar 16 00:07:15 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 15 Mar 2012 23:07:15 -0600 Subject: [Maxima] still having plotting problem In-Reply-To: <4F625AA9.2060300@gmail.com> References: <4F625AA9.2060300@gmail.com> Message-ID: On 3/15/12, joaquin borges wrote: > I installed gnuplot form cvs (4.7) and still have the same problem as > before. > From rmaxima and wxmaxima: > plot2d(sec(x)*cos(x),[x,-1,1]) takes all cpu . > Running maxima on ubuntu 10.10 (64) with cmucl . Hmm. In Maxima, what is the value of the variable gnuplot_command ? In the command shell from which you launch Maxima, what does which gnuplot report? What I'm trying to figure out is, are you sure that you're executing the new version of Gnuplot? If you are not executing the new Gnuplot, run make install in the Gnuplot build directory if you have sufficient privilege, or assign gnuplot_command : "/home/your/path/to/gnuplot" . Maxima creates an output file which is just a list of numbers and then executes Gnuplot to draw the plot. The output file is /home/you/maxout.gnuplot_pipes if I'm not mistaken. In Gnuplot, what do you get from: plot "/home/you/maxout.gnuplot_pipes" For the record, I'm working on Ubuntu 8.04 (x86) + cmucl 19a. best Robert Dodier PS. what is the content of your maxout.gnuplot_pipes file? From robert.dodier at gmail.com Fri Mar 16 00:17:03 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 15 Mar 2012 23:17:03 -0600 Subject: [Maxima] Plotting In-Reply-To: References: Message-ID: On 3/15/12, Vishnu Rajasekharan wrote: > I have four functions: > > h(t), i(t), j(t), k(t) > > Then I have a cubic equation incorporating the four functions > > l(t):=(Z^3)*h(t)+(Z^2)*i(t)+(Z)*j(t)+k(t) > > I solved it using > > P:realroots(l(t)) > > and selected the root using > > z:rhs(%[1]); > > Now I need to plot with "t" in the x axis ans "P" in the y axis. > > I used > > wxplot2d([P(t)],[t,0,100],[xlabel, "t)"],[style,[lines,3,5]], > [ylabel, "P"],[gnuplot_preamble, "set grid; set key top left; > set title P vs. t; "])$ Without knowing the functions h, i, j, & k, it's hard to say for sure. But maybe P(t) := (realroots (l (t)), rhs (%% [1])) gives the result you want. Oh, and you'll want to just put the name of P in the call to the plotting function, like plot2d (P, [t, 0, 100]) (I don't know if wxplot2d recognizes function names). I don't know if realroots is guaranteed to return its results in increasing order or something like that. Maybe you need to throw in sort(%%) to impose an order. best Robert Dodier From robert.dodier at gmail.com Fri Mar 16 00:56:45 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 15 Mar 2012 23:56:45 -0600 Subject: [Maxima] simp_assuming (was Re: mydefint2) In-Reply-To: References: <1AC27E4278D4490AB930158BE1BA2407@edwinc367e16bd> Message-ID: Well, fwiw here's another attempt at simp_assuming ... simp_assuming (e, [fcts])::=buildq ([e, fcts], unwind_protect ((apply (supcontext, ?gensym ("cntxt")]), apply (assume, fcts), expand (e, 0, 0)), killcontext (context))); (killcontext(context) kills the current context whatever it is, so it isn't necessary to remember the gensym.) Does that work any better? best Robert Dodier From ultradenso at gmail.com Fri Mar 16 01:37:43 2012 From: ultradenso at gmail.com (joaquin borges) Date: Fri, 16 Mar 2012 03:37:43 -0300 Subject: [Maxima] still having plotting problem In-Reply-To: References: <4F625AA9.2060300@gmail.com> Message-ID: <4F62DFB7.8010607@gmail.com> On 03/16/2012 02:07 AM, Robert Dodier wrote: > On 3/15/12, joaquin borges wrote: > >> I installed gnuplot form cvs (4.7) and still have the same problem as >> before. >> From rmaxima and wxmaxima: >> plot2d(sec(x)*cos(x),[x,-1,1]) takes all cpu . >> Running maxima on ubuntu 10.10 (64) with cmucl . > Hmm. In Maxima, what is the value of the variable gnuplot_command ? > In the command shell from which you launch Maxima, gnuplot > what does > > which gnuplot > > report? /usr/local/bin/gnuplot > What I'm trying to figure out is, are you sure that you're executing > the new version of Gnuplot? If you are not executing the new > Gnuplot, run > > make install > > in the Gnuplot build directory if you have sufficient privilege, > or assign gnuplot_command : "/home/your/path/to/gnuplot" . gnuplot 4.7 cvs is the only one on my system, installed with "make install" when I run gnuplot in the shell I get the version number 4.7 cvs. > > Maxima creates an output file which is just a list of numbers > and then executes Gnuplot to draw the plot. > The output file is /home/you/maxout.gnuplot_pipes if I'm not > mistaken. In Gnuplot, what do you get from: > > plot "/home/you/maxout.gnuplot_pipes" same problem as running from maxima > > For the record, I'm working on Ubuntu 8.04 (x86) + cmucl 19a. > > best > > Robert Dodier > > PS. what is the content of your maxout.gnuplot_pipes file? > best joaquin -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: maxout.gnuplot_pipes URL: From toy.raymond at gmail.com Fri Mar 16 10:52:17 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 16 Mar 2012 08:52:17 -0700 Subject: [Maxima] hgfred([a,b],[0],x) and hgfred([a,0],[0],x) Message-ID: While playing around with hypergeometrics again, I noticed that hgfred([a,b],[0],x) returns the noun form. Wolfram Alpha says it's complex infinity. This seems right. Maybe we should return infinity too? For fun, I wanted to see what maxima gives for hgfred([a,0],[0],x). Maxima says 1/(1-x)^a. When I ask Wolfram Alpha for 2f1(a,0,;0,x), it says it's identically 1. But it also gives a series expansion for 2f1(a,0;0;x) which is obviously not 1. In fact, it looks like 1/(1-x)^a. The moral? I guess we should always check our work and check our references too. :-) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Fri Mar 16 12:53:41 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 16 Mar 2012 13:53:41 -0400 Subject: [Maxima] simp_assuming (was Re: mydefint2) In-Reply-To: References: <1AC27E4278D4490AB930158BE1BA2407@edwinc367e16bd> Message-ID: The name is still misleading. This is really "evaluate and resimplify with assumptions", and *not* "simplify with assumptions". I would suggest something like this: /* internal programming version without convenience feature */ with_assumption_list (e, fcts) ::= buildq ([e, fcts], unwind_protect( (apply ('supcontext, [?gensym ("cntxt")]), apply ('assume, fcts), e), killcontext (context)))$ /* evaluate with assumptions */ with_assumptions(e,[fcts]) ::= buildq([e,fcts], with_assumption_list(e,fcts))$ /* resimplify with assumptions */ resimplify(e,[fcts]) := /* Note := NOT ::= */ if fcts=[] then expand(e,0,0) else with_assumption_list(expand(e,0,0),fcts)$ Examples: with_assumptions changes the evaluation context: (%i9) with_assumptions(integrate(x^a,x),not equal(a,-1)); (%o9) x^(a+1)/(a+1) <<< takes assumptions into account in evaluating the integral (%i10) foo:abs(x)$ (%i11) resimplify(foo,x<0); (%o11) -x <<< resimplifies the expression abs(x) (%i12) with_assumptions(foo,x<0); (%o12) abs(x) <<< evaluating 'foo' in that context doesn't resimplify the result (%i13) resimplify(integrate(x^a,x),not equal(a,-1)); Is a+1 zero or nonzero? <<< expression is not evaluated in the assumption context n; (%o13) x^(a+1)/(a+1) An evaluate-and-resimplify function combines two different concepts -- but it might be easier to use for new users, so perhaps with_assumptions should do an implicit resimplify.... -s On Fri, Mar 16, 2012 at 01:56, Robert Dodier wrote: > Well, fwiw here's another attempt at simp_assuming ... > > simp_assuming (e, [fcts])::=buildq ([e, fcts], > unwind_protect ((apply (supcontext, ?gensym ("cntxt")]), > apply (assume, fcts), > expand (e, 0, 0)), > killcontext (context))); > > (killcontext(context) kills the current context whatever it is, > so it isn't necessary to remember the gensym.) > > Does that work any better? > > best > > Robert Dodier > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Fri Mar 16 15:51:17 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Fri, 16 Mar 2012 16:51:17 -0400 Subject: [Maxima] simp_assuming (was Re: mydefint2) In-Reply-To: References: <1AC27E4278D4490AB930158BE1BA2407@edwinc367e16bd> Message-ID: From: Stavros Macrakis Sent: Friday, March 16, 2012 1:53 PM To: Robert Dodier Cc: woollett at charter.net ; maxima at math.utexas.edu ; maxima-bounces at math.utexas.edu ; Barton Willis Subject: Re: [Maxima] simp_assuming (was Re: mydefint2) The name is still misleading. This is really "evaluate and resimplify with assumptions", and not "simplify with assumptions". I would suggest something like this: /* internal programming version without convenience feature */ with_assumption_list (e, fcts) ::= buildq ([e, fcts], unwind_protect( (apply ('supcontext, [?gensym ("cntxt")]), apply ('assume, fcts), e), killcontext (context)))$ /* evaluate with assumptions */ with_assumptions(e,[fcts]) ::= buildq([e,fcts], with_assumption_list(e,fcts))$ /* resimplify with assumptions */ resimplify(e,[fcts]) := /* Note := NOT ::= */ if fcts=[] then expand(e,0,0) else with_assumption_list(expand(e,0,0),fcts)$ Examples: with_assumptions changes the evaluation context: (%i9) with_assumptions(integrate(x^a,x),not equal(a,-1)); (%o9) x^(a+1)/(a+1) <<< takes assumptions into account in evaluating the integral (%i10) foo:abs(x)$ (%i11) resimplify(foo,x<0); (%o11) -x <<< resimplifies the expression abs(x) (%i12) with_assumptions(foo,x<0); (%o12) abs(x) <<< evaluating 'foo' in that context doesn't resimplify the result (%i13) resimplify(integrate(x^a,x),not equal(a,-1)); Is a+1 zero or nonzero? <<< expression is not evaluated in the assumption context n; (%o13) x^(a+1)/(a+1) An evaluate-and-resimplify function combines two different concepts -- but it might be easier to use for new users, so perhaps with_assumptions should do an implicit resimplify.... -s I modified simp_given() in pw.mac to use these new context based methods with good results. simp_given(e,[fcts]) ::= buildq([e,fcts], with_assumption_list(resimplify(e,fcts),fcts))$ When running rtest_pw.mac with this new definition of simp_given(), I get all tests passed, 223/223 and performance was unaffected. So it looks as good as pw?s original simp_given(). Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Fri Mar 16 18:14:01 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 16 Mar 2012 16:14:01 -0700 Subject: [Maxima] maxima bug In-Reply-To: References: Message-ID: On Fri, Mar 16, 2012 at 4:06 PM, Rubens Marinho wrote: > Dear all, > > radcan do understand assume and do it correctly. > consider de code > No, not quite. > > (%i1) reset()$kill(all)$ > (%i3) radcan(sqrt(x^2)-x); > (%o3) |x| -x > (%i4) assume(x>0); > (%o4)[x>0] > (%i5) radcan(sqrt(x^2)-x); > (%o5)0 > This happens because maxima has already simplified sqrt(x^2)-x to zero, so radcan effectively gets 0. > (%i7) reset()$kill(all)$ > (%i1) assume(x<0); > (%o1)[x<0] > (%i2) radcan(sqrt(x^2)-x); > (%o2)-2 x > > Similarly, maxima has already simplified this to -2*x by the time radcan gets it. You can see this if you trace(radcan). Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Fri Mar 16 18:45:28 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Fri, 16 Mar 2012 19:45:28 -0400 Subject: [Maxima] maxima bug In-Reply-To: References: Message-ID: <79522404B87340A6AB0B3C2EF843ACB4@RichsLaptop> Dear all, radcan do understand assume and do it correctly. consider de code No, not quite. (%i1) reset()$kill(all)$ (%i3) radcan(sqrt(x^2)?x); (%o3) |x| ?x (%i4) assume(x>0); (%o4)[x>0] (%i5) radcan(sqrt(x^2)?x); (%o5)0 This happens because maxima has already simplified sqrt(x^2)-x to zero, so radcan effectively gets 0. (%i7) reset()$kill(all)$ (%i1) assume(x<0); (%o1)[x<0] (%i2) radcan(sqrt(x^2)?x); (%o2)?2 x Similarly, maxima has already simplified this to -2*x by the time radcan gets it. You can see this if you trace(radcan). You can see it without tracing (%i1) reset()$kill(all)$ (%i2) (%i1) sqrt(x^2)?x; (%o1) abs(x)-x (%i2) assume(x>0); (%o2) [x > 0] (%i3) sqrt(x^2)?x; (%o3) 0 (%i4) forget(x>0); (%o4) [x > 0] (%i5) assume(x<0); (%o5) [x < 0] (%i6) sqrt(x^2)?x; (%o6) ? 2*x (%i7) -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Fri Mar 16 23:25:42 2012 From: willisb at unk.edu (Barton Willis) Date: Fri, 16 Mar 2012 23:25:42 -0500 Subject: [Maxima] simp_assuming (was Re: mydefint2) In-Reply-To: References: , <1AC27E4278D4490AB930158BE1BA2407@edwinc367e16bd> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- > I would suggest something like this: I would be great if somebody tested, documented, and put these functions into /share. --bw From macrakis at alum.mit.edu Fri Mar 16 23:43:22 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 17 Mar 2012 00:43:22 -0400 Subject: [Maxima] maxima bug In-Reply-To: References: Message-ID: On Fri, Mar 16, 2012 at 19:06, Rubens Marinho wrote: > ...with small r radcan works fine > but with capital R it gives a wrong mathematical result. > Square root is a multi-valued function. Both the negative and positive square roots are the "correct mathematical result". Yes, in numerical work it is common to interpret sqrt as the positive square root, but that is difficult or impossible to provide consistently in a symbolic system. > Thank you for your attention and I congratulate to you to continue the > work of William Schelter > We all appreciate Schelter's work as a maintainer and promoter of Macsyma/Maxima, but he contributed none (or almost none) of the core of Maxima. radcan, in particular, was written by Richard Fateman >>10 years before Schelter worked on Macsyma/Maxima. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Mar 17 00:37:10 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 16 Mar 2012 23:37:10 -0600 Subject: [Maxima] still having plotting problem In-Reply-To: <4F62DFB7.8010607@gmail.com> References: <4F625AA9.2060300@gmail.com> <4F62DFB7.8010607@gmail.com> Message-ID: Thanks for sending maxout.gnuplot_pipes. When I run gnuplot (4.7 from cvs) it successfully plots the data. So it's hard to figure out what's going on. One idea: can you run Gnuplot within gdb (debugger). If the installed binary has been stripped of symbols, try running the one from the build directory. e.g. $ cd /gnuplot $ gdb src/gnuplot When Gnuplot seems to wait forever, hit control-C and then enter the command "where" in gdb. It should give you a stack trace. best Robert Dodier From marinho.rubens at gmail.com Fri Mar 16 18:06:04 2012 From: marinho.rubens at gmail.com (Rubens Marinho) Date: Fri, 16 Mar 2012 20:06:04 -0300 Subject: [Maxima] maxima bug In-Reply-To: References: Message-ID: Dear all, radcan do understand assume and do it correctly. consider de code (%i1) reset()$kill(all)$ (%i3) radcan(sqrt(x^2)-x); (%o3) |x| -x (%i4) assume(x>0); (%o4)[x>0] (%i5) radcan(sqrt(x^2)-x); (%o5)0 (%i7) reset()$kill(all)$ (%i1) assume(x<0); (%o1)[x<0] (%i2) radcan(sqrt(x^2)-x); (%o2)-2 x The problems that I have raised in the first e-mails is that with small r radcan works fine but with capital R it gives a wrong mathematical result. As a physicist, a final user of this excellent program, I think that the best to do in order not to return a wrong mathematical result is, in the case of the example bellow is to return, abs(R-z) Thank you for your attention and I congratulate to you to continue the work of William Schelter Best regards Rubens Marinho Head of Physics Department of Instituto Tecnol?gico de Aeron?utica 2012/3/14 Stavros Macrakis > Robert, > > Though I agree that, in general, Maxima functions should not ignore > assumptions, radcan is *by design* oblivious to them. Radcan is supposed > to return a near-canonical "over a large class of expressions and *a > given ordering of variables*" (my emphasis), so radcan(EX) should return > the same value *regardless* of assumptions. It would be a bug if > radcan(EX) returned different values dependent on the environment. > > Radcan does not follow the numerical-analysis convention that sqrt(EX) is the > positive square root; rather, it represents *some* consistently-chosen > square root. > > What is more confusing is that radcan(sqrt(x^2)-x) doesn't return 0 -- > because the general simplification sqrt(x^2)->abs(x) interferes. That can > of course be corrected by setting domain:complex. > > -s > > On Wed, Mar 14, 2012 at 11:37, Robert Dodier wrote: > >> On 3/9/12, Raymond Toy wrote: >> >> >> reset();kill(all); >> >> assume(z>r); >> >> radcan(sqrt(r^2-2*z*r+z^2)); >> >> >> >> it gives >> >> >> >> z-r >> >> >> >> works fine >> >> >> >> but with capital R >> >> >> >> reset();kill(all); >> >> assume(z>R); >> >> radcan(sqrt(R^2-2*z*R+z^2)); >> >> >> >> it gives >> >> >> >> R-z >> >> >> >> should be >> >> z-R >> >> > I don't think this is a bug. Radcan does sometimes do things like this >> and >> > that is the expected result. I don't think radcan recognizes assume >> either. >> >> radcan ignores assume -- I think that's a bug. That the result depends on >> the ordering of the variables is OK only if all possible results are >> equally valid. >> That's not the case when there are facts (stated by assume) to take into >> account. >> >> It's true that many functions in Maxima ignore assume. I don't think >> that's desirable, although I do understand that it's hard to fix. >> >> best >> >> Robert Dodier >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nijso at hotmail.com Sat Mar 17 07:07:02 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Sat, 17 Mar 2012 13:07:02 +0100 Subject: [Maxima] pdelie from peter vafeades Message-ID: Hi, Does somebody know if pdelie from peter vafeades is available for maxima? It used to be in macsyma in the '90's but I thought it was also in maxima. -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sat Mar 17 07:48:50 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 17 Mar 2012 08:48:50 -0400 Subject: [Maxima] simp_assuming (was Re: mydefint2) In-Reply-To: References: <1AC27E4278D4490AB930158BE1BA2407@edwinc367e16bd> Message-ID: I'd like some discussion on whether with_assumptions should resimplify the result or not. Arguments against resimplification: * It's orthogonal to the main meaning of with_assumptions, which is to * evaluate* an expression in a given context. * Resimplifying the result is unnecessary overhead when the functionality isn't needed. * Including resimplification is more likely to DWIM (Do What I Mean), just like 'ev'; this makes it less predictable sometimes. * It is surely what the user intends if he/she writes with_assumptions(integrate(...), x>0). * Users shouldn't be writing with_assumptions when all they really want is resimplification with assumptions. Arguments for resimplification: * The distinction between evaluating in a context and resimplifying in a context is subtle, and new users will have trouble with it. * It almost never hurts to resimplify. * Including resimplification is more likely to DWIM (Do What I Mean), just like 'ev'. This dispenses with semantic subtleties and just gives the user what he/she wants. * It is surely what the user intends if he/she writes with_assumptions(%o23,x>0), and the user is not going to bother with resimplify(%o23,x>0). * It would be a good idea to add assumptions to 'ev' and with_assumptions is the* ? la carte *version of this -- e.g. (%i23) abs(x),x<0; => -x (%i45) q:abs(x)$ (%i46) q,x<0; => -x As a general rule, I prefer clean and simple to DWIM and messy. We all know what a mess ev's semantics are, and how they can confuse users. But we also know how convenient the syntax is, and how easily new users get lost in subtle distinctions, notably evaluation vs. simplification. With some misgivings, I think I'll recommend that with_assumptions *do include* the resimplify step. On a separate topic, what do people think of adding the resimplify function (including optional relations) I suggested? Should it also include value-setting, * ? la *ev? So resimplify(abs(x),x=3) => 3. Again, this makes it more DWIMy and inconsistent -- note for example that resimplify(abs(x),equal(-3,x)) would return -x rather than 3 (a limitation of the current simplifier), while resimplify(abs(x),x=-3) would return 3. I would like to put this in share/simplification, not share/contrib -- so let's get it right. Discussion? -s /* evaluate with assumptions -- without resimplification */ with_assumptions(e,[fcts]) ::= buildq([e,fcts], with_assumption_list(e,fcts))$ /* evaluate with assumptions -- with resimplification */ with_assumptions(e,[fcts]) ::= buildq([e,fcts], with_assumption_list(expand(e,0,0),fcts))$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Sat Mar 17 07:56:40 2012 From: villate at fe.up.pt (Jaime Villate) Date: Sat, 17 Mar 2012 12:56:40 +0000 Subject: [Maxima] pdelie from peter vafeades In-Reply-To: References: Message-ID: <4F648A08.1010909@fe.up.pt> On 03/17/2012 12:07 PM, nijso beishuizen wrote: > Does somebody know if pdelie from peter vafeades is available for > maxima? It used to be in macsyma in the '90's but I thought it was > also in maxima. Hi, perhaps symmgrp might be useful to you? (http://inside.mines.edu/~whereman/software.html) Regards, Jaime From fateman at eecs.berkeley.edu Sat Mar 17 09:25:40 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 17 Mar 2012 07:25:40 -0700 Subject: [Maxima] sqrt, abs, radcan. Re: maxima bug In-Reply-To: References: Message-ID: <4F649EE4.3060606@eecs.berkeley.edu> On 3/16/2012 4:06 PM, Rubens Marinho wrote: > Dear all, > > radcan do understand assume and do it correctly. > consider de code 1. The radcan program does not use the assume facility. The simplification that is done on the argument to radcan is outside the radcan program. 2. If you say assume(z<0) then sqrt(z^2) comes out -z. This has nothing to do with radcan. This is a consequence of sqrt(z^2) being simplified to abs(z), and abs(z) simplifying to -z. I think it is an error to simplify sqrt(z^2) to abs(z). To avoid this error in the case that there are no assumptions on z, set radexpand:false. Unfortunately this is insufficient protection against mathematical errors in Maxima's current setup. Sqrt(9) is {3,-3}, and if you forget it you will get wrong answers sometimes. From akshaysrinivasan at gmail.com Sat Mar 17 11:43:24 2012 From: akshaysrinivasan at gmail.com (Akshay Srinivasan) Date: Sat, 17 Mar 2012 22:13:24 +0530 Subject: [Maxima] Writing a new module ? Message-ID: <4F64BF2C.9040502@gmail.com> Hello, I was thinking of moving my Lagrange equations-of-motion put here: https://github.com/enupten/Classical-Mechanic completely into Maxima, because then a class I'll be lecturing will be able to use it completely in Windows without requiring a Lisp implementation installed explicitly. I looked at the tutorial by Dieter Kaiser, but it still misses out a lot of things (and I couldn't find the other 4 chapters). For instance what exactly is a prop ? It looks like some kind of a special function-symbol declaration, I couldn't find any comments about what each 'indic means (verb .. ?). I have to say it is terribly hard for want-to-be developers to get -a vague- understanding of Maxima works. Help. Thanks! Akshay P.S: Is there a good reason why parts of Maxima still has (exploden ..) instead of using proper strings ? From macrakis at alum.mit.edu Sat Mar 17 11:55:06 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 17 Mar 2012 12:55:06 -0400 Subject: [Maxima] Writing a new module ? In-Reply-To: <4F64BF2C.9040502@gmail.com> References: <4F64BF2C.9040502@gmail.com> Message-ID: It would be great to add your functionality to Maxima! In looking at your existing code, it seems that most of it is concerned with the details of string manipulation and C syntax. Fortunately, none of this is necessary in Maxima. It sounds as though you're looking at a presentation of Maxima internals (URL?). For your application, I'm almost certain that you'd be better off programming in the Maxima language rather than in Lisp. You can then use normal mathematical infix notation, and simplification etc. is "magically" taken care of. Can you give us an example of the input-output behavior of your code? -s On Sat, Mar 17, 2012 at 12:43, Akshay Srinivasan wrote: > Hello, > I was thinking of moving my Lagrange equations-of-motion put here: > https://github.com/enupten/Classical-Mechanic > completely into Maxima, because then a class I'll be lecturing will be > able to use it completely in Windows without requiring a Lisp > implementation installed explicitly. > I looked at the tutorial by Dieter Kaiser, but it still misses out a > lot of things (and I couldn't find the other 4 chapters). > For instance what exactly is a prop ? It looks like some kind of a > special function-symbol declaration, I couldn't find any comments > about what each 'indic means (verb .. ?). I have to say it is terribly > hard for want-to-be developers to get -a vague- understanding of > Maxima works. Help. > > Thanks! > Akshay > > P.S: Is there a good reason why parts of Maxima still has (exploden > ..) instead of using proper strings ? > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From akshaysrinivasan at gmail.com Sat Mar 17 12:39:54 2012 From: akshaysrinivasan at gmail.com (Akshay Srinivasan) Date: Sat, 17 Mar 2012 23:09:54 +0530 Subject: [Maxima] Writing a new module ? In-Reply-To: References: <4F64BF2C.9040502@gmail.com> Message-ID: <4F64CC6A.7000409@gmail.com> Yes it will probably be much easier (not to mention far more elegant) to write the whole thing in Maxima. At the time I wrote the thing, I hardly knew any lisp (much less about the internals of Maxima), so the whole thing was hacked up to work. The purpose of the project is to actually generate the C code; I need to get the jacobian of the vector field governing the dynamics, which is feasible only using AD for large systems. Here's an example of the maxima (predominant) part of an example: https://github.com/enupten/Classical-Mechanic/blob/master/tests/double-pendulum/double-pendulum.mac --------------------------------------------------------------------------- load("../../maxima/eom.mac"); L_double_pendulum(t, q, q1, p) := block([theta_1, theta_2, thetadot_1, thetadot_2, L], theta_1: q[1][1], theta_2: q[2][1], thetadot_1: q1[1][1], thetadot_2: q1[2][1], m: p[1][1], L: thetadot_2^2/2. + thetadot_1^2 * (1 + m)/2 + thetadot_1 * thetadot_2 * cos(theta_1 - theta_2) - (1 + m) * sin(theta_1) -sin(theta_2), return(L))$ /*^^q*/ q: transpose(matrix([phi, theta])); /*^^v*/ qdot: transpose(matrix([phidot, thetadot])); /*^^u*/ u: transpose(matrix([tau_theta])); /*^^t*/ t: t; /*^^p*/ p: transpose(matrix([m])); S : generate_eom(L_double_pendulum, t, q, qdot, transpose(matrix([- u[1][1], u[1][1]])), p); save_system(S, "expr/pend"); --------------------------------------------------------------------------- "S" here is a list of (d^2 L)/(dq' dq'), (d^2 L)/(dq dq') ... matrices which are dumped into (barely) C compatible expressions by save_system(..) into separate files of the form "expr/pend_Pv_12". The lisp code currently just takes the expression in these files and generates C++ code to compute the various terms of the equations of motion, all the while using ADOL-C so that one can obtain the derivatives of these matrices. There is a C library which then takes these functions and assembles the vector field and its jacobian, so that all one needs to do in C is something like: ----------------------------------------------------------------- clmech_system *pend = create_double_pendulum_system(); clmech_workspace_alloc(pend); clmech_field(qdot, t, q, u, p, pend); clmech_jacobian(qdot, dfdt, dfdx, dfdu, dfdp, t, q, u, p, pend); ----------------------------------------------------------------- I have a vague idea of what I should write in Maxima (lisp module), I think I have to write something like fortra.lisp which generates C compatible expressions. I will then have to then format them into a file-stream which should be easy to do because the existing parser is in lisp anyway. I thought string processing was hard (annoying) in maxima itself ? That was my actual motivation to use lisp: so that it can be merged back into maxima. Akshay On 03/17/2012 10:25 PM, Stavros Macrakis wrote: > It would be great to add your functionality to Maxima! > > In looking at your existing code, it seems that most of it is > concerned with the details of string manipulation and C syntax. > Fortunately, none of this is necessary in Maxima. > > It sounds as though you're looking at a presentation of Maxima > internals (URL?). For your application, I'm almost certain that > you'd be better off programming in the Maxima language rather than > in Lisp. You can then use normal mathematical infix notation, and > simplification etc. is "magically" taken care of. > > Can you give us an example of the input-output behavior of your > code? > > -s > > On Sat, Mar 17, 2012 at 12:43, Akshay Srinivasan > > > wrote: > > Hello, I was thinking of moving my Lagrange equations-of-motion > put here: https://github.com/enupten/Classical-Mechanic completely > into Maxima, because then a class I'll be lecturing will be able to > use it completely in Windows without requiring a Lisp > implementation installed explicitly. I looked at the tutorial by > Dieter Kaiser, but it still misses out a lot of things (and I > couldn't find the other 4 chapters). For instance what exactly is a > prop ? It looks like some kind of a special function-symbol > declaration, I couldn't find any comments about what each 'indic > means (verb .. ?). I have to say it is terribly hard for want-to-be > developers to get -a vague- understanding of Maxima works. Help. > > Thanks! Akshay > > P.S: Is there a good reason why parts of Maxima still has > (exploden ..) instead of using proper strings ? > _______________________________________________ Maxima mailing > list Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > From macrakis at alum.mit.edu Sat Mar 17 13:22:48 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 17 Mar 2012 14:22:48 -0400 Subject: [Maxima] Writing a new module ? In-Reply-To: <4F64CC6A.7000409@gmail.com> References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> Message-ID: (reply in line) On Sat, Mar 17, 2012 at 13:39, Akshay Srinivasan wrote: > Yes it will probably be much easier (not to mention far more elegant) > to write the whole thing in Maxima. At the time I wrote the thing, I > hardly knew any lisp (much less about the internals of Maxima), so the > whole thing was hacked up to work. > You shouldn't need to know anything about either Lisp or the internals of Maxima for the mathematical part -- you can write in the Maxima language itself, and then simply output the expressions in C syntax. You will need to use Lisp if you need to fiddle the "fortran" module (which may not even be necessary, since Fortran and C syntax for mathematical expressions (as opposed to procedural code) are almost identical). The purpose of the project is to actually generate the C code; I need > to get the jacobian of the vector field governing the dynamics, which > is feasible only using AD for large systems. > The way I'd do this is to generate the expressions then simply *output* them in C format. For mathematical expressions, I think Fortran and C syntax are the same, so you can use the Fortran function. If that doesn't work, you may need to write a small variant of the Fortran package specifically for C. That would be generally useful, and would still be easier than doing this via string processing. > I have a vague idea of what I should write in Maxima (lisp module), I > think I have to write something like fortra.lisp which generates C > compatible expressions. I will then have to then format them into a > file-stream which should be easy to do because the existing parser is > in lisp anyway. > Exactly. The Maxima-to-C component should not be specific to Lagrange. But you should not start from scratch. fortra.lisp is 95% of what you need. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Mar 17 13:46:01 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 17 Mar 2012 12:46:01 -0600 Subject: [Maxima] pdelie from peter vafeades In-Reply-To: References: Message-ID: On 3/17/12, nijso beishuizen wrote: > Does somebody know if pdelie from peter vafeades is available for maxima? It > used to be in macsyma in the '90's but I thought it was also in maxima. I don't know anything about pdelie, but maybe you can get in touch with the author to ask him if he is interested in contributing it to Maxima. Seems like a long shot but what the heck. I wonder under what terms pdelie was contributed to Macsyma. Maybe the license granted to Macsyma was relatively broad, so (again speculating here) perhaps it would apply to Maxima as well. I guess the only way to find out is to get a copy of Macsyma and see if there is any kind of license statement for pdelie. best Robert Dodier From mickle.mouse at gmail.com Sat Mar 17 14:33:42 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Sat, 17 Mar 2012 12:33:42 -0700 Subject: [Maxima] sqrt, abs, radcan. Re: maxima bug In-Reply-To: <4F649EE4.3060606@eecs.berkeley.edu> References: <4F649EE4.3060606@eecs.berkeley.edu> Message-ID: I just thought I'd throw in my two cents. Some would say that polar form is a more "natural" way to treat powers and roots: x+%i*y --> r*exp(%i*theta) --> r*exp(%i*theta + 2*n*%i*%pi), where r = positive value of sqrt(x^2 + y^2), theta = atan2(x,y), and n is an integer. Then taking a root produces multiple answers: ( r*exp(%i*theta + 2*n*%i*%pi) )^(z) = r^(z) * exp(%i*theta*z + 2*n*%i*%pi*z), where r^z only has to worry about the "simple case" returning a real positive value. Then the trick is to run through as many integers of n as we care about. If z is rational number, then an finite set of n covers all possible outputs. I believe (although I ask someone fact check this), if z is irrational, then there are infinitely many answers. Here is a less symbolic example (assuming sqrt returns the positive value): ( 1/sqrt(2) + %i/sqrt(2) )^(1/3) = ( 1 * exp( %i*pi/4 + 2*%i*%pi*n ) )^(1/3) = ( 1 * exp( %i*pi/12 + 2*%i*%pi*n/3 ) ) = { cos(%pi/12) + %i*sin(%pi/12), cos(%pi*9/12) + %i*sin(%pi*9/12), cos(%pi*17/12) + %i*sin(%pi*17/12) } The moral of my story - the polar form with a factor of +2*n*pi*i reveals that there are potentially multiple answers to general powers other than just square root. On Sat, Mar 17, 2012 at 7:25 AM, Richard Fateman wrote: > On 3/16/2012 4:06 PM, Rubens Marinho wrote: > >> Dear all, >> >> radcan do understand assume and do it correctly. >> consider de code >> > 1. The radcan program does not use the assume facility. The simplification > that is done on the argument to radcan is outside the radcan program. > > 2. If you say assume(z<0) > then sqrt(z^2) comes out -z. > This has nothing to do with radcan. > > This is a consequence of sqrt(z^2) being simplified to abs(z), and abs(z) > simplifying to -z. > > I think it is an error to simplify sqrt(z^2) to abs(z). To avoid this > error in > the case that there are no assumptions on z, set radexpand:false. > > Unfortunately this is insufficient protection against mathematical errors > in Maxima's current setup. Sqrt(9) is {3,-3}, and if you forget it you > will get wrong answers sometimes. > > > > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Sat Mar 17 14:40:09 2012 From: willisb at unk.edu (Barton Willis) Date: Sat, 17 Mar 2012 14:40:09 -0500 Subject: [Maxima] simp_assuming (was Re: mydefint2) In-Reply-To: References: , <1AC27E4278D4490AB930158BE1BA2407@edwinc367e16bd> Message-ID: > I'd like some discussion on whether with_assumptions should resimplify the result or not. Uses new and old have reason to be confused between simplification or evaluation: (%i4) :lisp($integrate (list (list 'mtimes) 5 (list (list '$f) 'x)) 'x)) ((%INTEGRATE) ((MTIMES) 5 (($F) X)) X) (%i4) :lisp(take '(%integrate) (list (list 'mtimes) 5 (list (list '$f) 'x)) 'x) ((MTIMES SIMP) 5 ((%INTEGRATE SIMP) (($F SIMP) X) X)) Further: (%i1) load(abs_integrate)$ (%i2) assume(a>0)$ Bogus answer + spurious asksign: (%i3) integrate(1/(1+abs(x)),x,-a,a); "Is "a-1" positive, negative, or zero?"pos; Principal Value (%o3) log(a+1)-log(1-a)+%i*%pi Oops...same problem different variables: OK answer + spurious asksign: (%i4) assume(aa > 0)$ (%i5) integrate(1/(1+abs(x)),x,-aa,aa); "Is "aa" positive, negative, or zero?"pos; (%o5) 2*log(aa+1) Cut the expand(e,0,0) out of simp_assuming: (%i6) simp_assuming (e, [fcts]) ::= buildq ([e, fcts], unwind_protect((apply('supcontext, [gensym("cntxt")]), apply('assume, fcts),e), killcontext (context))); (%o6) simp_assuming(e,[fcts])::=buildq([e,fcts],unwind_protect((apply('supcontext, [gensym("cntxt")]),apply('assume,fcts),e),killcontext(context))) OK: (%i7) integrate(1/(1+abs(x)),x,-a,a); (%o7) 2*log(a+1) Maybe all this is due to the way abs_integrate extends integration by tellsimp: matchdeclare(x, symbolp, [q,a,b], lambda([s], true)); block([simp : false], tellsimpafter('integrate(q,x), extra_integrate(q,x)), tellsimpafter('integrate(q,x,a,b), extra_definite_integrate(q,x,a,b))); Maybe it's something else. The macro in my simp_assuming made debugging challenging. My simp_assuming-less version fixes this bug--debugging is a easier without the macro, at least for me. --bw From macrakis at alum.mit.edu Sat Mar 17 15:16:26 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 17 Mar 2012 16:16:26 -0400 Subject: [Maxima] simp_assuming (was Re: mydefint2) In-Reply-To: References: <1AC27E4278D4490AB930158BE1BA2407@edwinc367e16bd> Message-ID: On Sat, Mar 17, 2012 at 15:40, Barton Willis wrote: > Uses new and old have reason to be confused between simplification or > evaluation: > (%i4) :lisp($integrate (list (list 'mtimes) 5 (list (list '$f) 'x)) 'x)) > ((%INTEGRATE) ((MTIMES) 5 (($F) X)) X) > (%i4) :lisp(take '(%integrate) (list (list 'mtimes) 5 (list (list '$f) > 'x)) 'x) > ((MTIMES SIMP) 5 ((%INTEGRATE SIMP) (($F SIMP) X) X)) > Not sure what your point is here. Yes, there is a simplification 'integrate( freeof_var*..., var) => freeof_var * 'integrate(..., var), just as there is a simplification abs(non_neg*...) => non_neg*abs(...). I suppose the confusion is that the integral (noun-form) and the "calculate an antiderivative" subroutine are spelled the same -- but would it really be less confusing if we had integral(...) vs. integrate(...), limit(...) vs. find_limit(...), etc.? Further: > > (%i1) load(abs_integrate)$ > (%i2) assume(aa>0)$... > I don't think this is an inconsistency, just a garden-variety bug in abs_integrate (which is after all in contrib, so not expected to be as robust as core Maxima): (%i1) display2d:false$ (%o1) false (%i2) integrate(1/(abs(x)+1),x,-aa,aa); (%o2) 'integrate(1/(abs(x)+1),x,-aa,aa) (%i3) assume(aa>0); (%o3) [aa > 0] (%i4) integrate(1/(abs(x)+1),x,-aa,aa); (%o4) 'integrate(1/(abs(x)+1),x,-aa,aa) (%i5) is(aa>0); (%o5) true <<< no problem with regular integrate (%i6) load(abs_integrate); (%o6) "C:/PROGRA~2/MAXIMA~1.1-G/share/maxima/5.25.1/share/contrib/integration/abs_integrate.mac" (%i7) is(aa>0); (%o7) true (%i8) integrate(1/(abs(x)+1),x,-aa,aa); Is aa positive, negative, or zero? <<< should know this!! p; (%o8) 2*log(aa+1) (%i9) is(aa>0); (%o9) unknown <<< why was fact deleted? -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sat Mar 17 15:33:49 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 17 Mar 2012 16:33:49 -0400 Subject: [Maxima] sqrt, abs, radcan. Re: maxima bug In-Reply-To: References: <4F649EE4.3060606@eecs.berkeley.edu> Message-ID: I agree in principle. We could perfectly well have solve(x^k=a,x) return [x=abs(a)^(1/k)*%e^(2*%i*%pi*%n23/k)] for positive a -- and %n23 would be declared integer. Current value is simply [x=a^(1/n)] (if n declared integer), which isn't correct even for the pure real case, since for even n there should be two real solutions. As is often the case, the tradeoff is between simplicity and completeness/correctness. Will our elementary users find the complex exponential useful? Presumably not, so we'd need to have the feature be controlled by a flag (perhaps the existing domain:complex flag?). It would also be more useful if we'd improve the simplification of exp -- declare(n,integer)$ %e^(2*%i*%pi*n) currently doesn't simplify to 1. -s On Sat, Mar 17, 2012 at 15:33, Mike Valenzuela wrote: > I just thought I'd throw in my two cents. > > Some would say that polar form is a more "natural" way to treat powers and > roots: > x+%i*y --> r*exp(%i*theta) --> r*exp(%i*theta + 2*n*%i*%pi), > where r = positive value of sqrt(x^2 + y^2), theta = atan2(x,y), and n is > an integer. > > Then taking a root produces multiple answers: > ( r*exp(%i*theta + 2*n*%i*%pi) )^(z) = r^(z) * exp(%i*theta*z + > 2*n*%i*%pi*z), > where r^z only has to worry about the "simple case" returning a real > positive value. Then the trick is to run through as many integers of n as > we care about. If z is rational number, then an finite set of n covers all > possible outputs. I believe (although I ask someone fact check this), if z > is irrational, then there are infinitely many answers. > > Here is a less symbolic example (assuming sqrt returns the positive value): > ( 1/sqrt(2) + %i/sqrt(2) )^(1/3) = > ( 1 * exp( %i*pi/4 + 2*%i*%pi*n ) )^(1/3) = > ( 1 * exp( %i*pi/12 + 2*%i*%pi*n/3 ) ) = > > { > cos(%pi/12) + %i*sin(%pi/12), > cos(%pi*9/12) + %i*sin(%pi*9/12), > cos(%pi*17/12) + %i*sin(%pi*17/12) > } > > The moral of my story - the polar form with a factor of +2*n*pi*i reveals > that there are potentially multiple answers to general powers other than > just square root. > > > On Sat, Mar 17, 2012 at 7:25 AM, Richard Fateman < > fateman at eecs.berkeley.edu> wrote: > >> On 3/16/2012 4:06 PM, Rubens Marinho wrote: >> >>> Dear all, >>> >>> radcan do understand assume and do it correctly. >>> consider de code >>> >> 1. The radcan program does not use the assume facility. The simplification >> that is done on the argument to radcan is outside the radcan program. >> >> 2. If you say assume(z<0) >> then sqrt(z^2) comes out -z. >> This has nothing to do with radcan. >> >> This is a consequence of sqrt(z^2) being simplified to abs(z), and abs(z) >> simplifying to -z. >> >> I think it is an error to simplify sqrt(z^2) to abs(z). To avoid this >> error in >> the case that there are no assumptions on z, set radexpand:false. >> >> Unfortunately this is insufficient protection against mathematical errors >> in Maxima's current setup. Sqrt(9) is {3,-3}, and if you forget it you >> will get wrong answers sometimes. >> >> >> >> >> ______________________________**_________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/**mailman/listinfo/maxima >> > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nijso at hotmail.com Sat Mar 17 15:35:59 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Sat, 17 Mar 2012 21:35:59 +0100 Subject: [Maxima] pdelie from peter vafeades In-Reply-To: References: , Message-ID: I also don't know under what terms it was distributed and I don't know if Vafeades is still available. I did try to contact him though, but I think he's not at Trinity anymore. An important difference between SYMMGRP.MAX and PDELIE is (from what I know from Hereman's comparisons) that PDELIE can solve the determining equations automatically, which could be a big advantage (time saving). But being able to solve systems of pde's automatically might mean it depends on many other original macsyma functionalities so porting to maxima might be difficult. > Date: Sat, 17 Mar 2012 12:46:01 -0600 > Subject: Re: [Maxima] pdelie from peter vafeades > From: robert.dodier at gmail.com > To: nijso at hotmail.com > CC: maxima at math.utexas.edu > > On 3/17/12, nijso beishuizen wrote: > > > Does somebody know if pdelie from peter vafeades is available for maxima? It > > used to be in macsyma in the '90's but I thought it was also in maxima. > > I don't know anything about pdelie, but maybe you can get in touch > with the author to ask him if he is interested in contributing it to Maxima. > Seems like a long shot but what the heck. > > I wonder under what terms pdelie was contributed to Macsyma. > Maybe the license granted to Macsyma was relatively broad, > so (again speculating here) perhaps it would apply to Maxima as well. > I guess the only way to find out is to get a copy of Macsyma and > see if there is any kind of license statement for pdelie. > > best > > Robert Dodier -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sat Mar 17 15:50:54 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 17 Mar 2012 13:50:54 -0700 Subject: [Maxima] Writing a new module ? In-Reply-To: <4F64CC6A.7000409@gmail.com> References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> Message-ID: <4F64F92E.9000604@eecs.berkeley.edu> You mention AD (automatic differentiation). Have you seen this? http://www.cs.berkeley.edu/~fateman/papers/overload-AD.pdf From woollett at charter.net Sat Mar 17 16:10:16 2012 From: woollett at charter.net (Edwin Woollett) Date: Sat, 17 Mar 2012 14:10:16 -0700 Subject: [Maxima] defint1 abs trouble Message-ID: <67701FBAB24449D4BE938DBA362618C7@edwinc367e16bd> I have found a definite integral which integrate can do but mydefint1 (revised to see what is going on) cannot do, leading to a defint complaint. The example involves the abs function. --------------------------------------------------- (%i1) integrate (exp (-abs (x)), x, minf, 0); (%o1) 1 (%i2) assume(x < 0); (%o2) [x < 0] (%i3) integrate (exp (-abs (x)), x, minf, 0); (%o3) 1 (%i4) forget(x<0); (%o4) [x < 0] (%i5) facts(); (%o5) [] (%i6) mydefint1 (e78, x78, a78, b78) := block ( [domain : complex, xmin, xmax, assumeL : [], res1, _ans], xmin : min (a78, b78), xmax : max (a78, b78), if xmin # minf then assumeL : cons ( x78 > xmin, assumeL), if xmax # inf then assumeL : cons (x78 < xmax, assumeL), if debug then display (xmin, xmax, assumeL), _ans : apply ( 'assume, assumeL ), res1 : ratsimp (integrate (e78, x78, a78, b78 ) ), apply ( 'forget, _ans), res1)$ (%i7) debug:true$ (%i8) mydefint1 ( exp (-abs (x)), x, minf, 0); xmin = minf xmax = 0 assumeL = [x < 0] defint: integral is divergent. #0: mydefint1(e78=%e^-abs(x),x78=x,a78=minf,b78=0) -- an error. To debug this try: debugmode(true); (%i9) facts(); (%o9) [0 > x] ---------------------------------------------------------- I don't see what difference there is in terms of assumptions between calling integrate directly and using mydefint1 in the above example. If I remove the abs(x) part, both methods work: ------------------------------------------------------- (%i10) forget(x<0); (%o10) [x < 0] (%i11) facts(); (%o11) [] (%i13) integrate(exp(x),x,minf,0); (%o13) 1 (%i14) mydefint1(exp(x),x,minf,0); xmin = minf xmax = 0 assumeL = [x < 0] (%o14) 1 (%i15) facts(); (%o15) [] ------------------------------------------------------------- So something about the presence of abs in the integrand prevents mydefint1 from working as expected. Ted From talon at lpthe.jussieu.fr Sat Mar 17 17:03:39 2012 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sat, 17 Mar 2012 22:03:39 +0000 (UTC) Subject: [Maxima] Writing a new module ? References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> Message-ID: Stavros Macrakis wrote: > (reply in line) > > On Sat, Mar 17, 2012 at 13:39, Akshay Srinivasan > wrote: > > Exactly. The Maxima-to-C component should not be specific to Lagrange. > But you should not start from scratch. fortra.lisp is 95% of what you > need. > Already done, e.g. in http://www.lpthe.jussieu.fr/~talon/cgrind.lisp -- Michel Talon From willisb at unk.edu Sat Mar 17 17:04:38 2012 From: willisb at unk.edu (Barton Willis) Date: Sat, 17 Mar 2012 17:04:38 -0500 Subject: [Maxima] defint1 abs trouble In-Reply-To: <67701FBAB24449D4BE938DBA362618C7@edwinc367e16bd> References: <67701FBAB24449D4BE938DBA362618C7@edwinc367e16bd> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I have found a definite integral which integrate can do but mydefint1 >(revised to see what is going on) cannot do, leading to a defint >complaint. The example involves the abs function. After the assumptions and before integration, the integrand needs to be simplified. To fix this, either insert e78 : expand(e78,0,0) before res1 : integrate (e78, x78, a78, b78) or try res1 : block([?dosimp : t], integrate (e78, x78, a78, b78)). (Maybe using ?dosimp this way in Maxima code is bad form.) Also, a context version might look like (%i2) mydefinite_integrate(e,x,a,b) := block([contx : gensym("contx")], unwind_protect(( supcontext(contx), assume(min(a,b) <4F649EE4.3060606@eecs.berkeley.edu> <4F649EE4.3060606@eecs.berkeley.edu> Message-ID: Mike Valenzuela wrote: > Then taking a root produces multiple answers: > ( r*exp(%i*theta + 2*n*%i*%pi) )^(z) = r^(z) * exp(%i*theta*z + > 2*n*%i*%pi*z), > where r^z only has to worry about the "simple case" returning a real > positive value. Then the trick is to run through as many integers of n as > we care about. If z is rational number, then an finite set of n covers all > possible outputs. I believe (although I ask someone fact check this), if z > is irrational, then there are infinitely many answers. > This results from Kronecker density theorem (which is refined by Weyl uniform density theorem) of the points multiples on an irrational on the circle. See for example last chapter of Hardy and Wright. -- Michel Talon From macrakis at alum.mit.edu Sat Mar 17 17:22:41 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 17 Mar 2012 18:22:41 -0400 Subject: [Maxima] defint1 abs trouble In-Reply-To: <67701FBAB24449D4BE938DBA362618C7@edwinc367e16bd> References: <67701FBAB24449D4BE938DBA362618C7@edwinc367e16bd> Message-ID: This is a bug in integrate: (%i1) expr:exp(-abs(x))$ integrate(expr,'x,minf,0); (%o2) 1 (%i3) assume(x<0)$ integrate(expr,'x,minf,0); defint: integral is divergent. -- an error. To debug this try: debugmode(true); The user should absolutely not have to fiddle with internal variables like ?dosimp to get this right. I have filed this as bug 3507277 . -s On Sat, Mar 17, 2012 at 17:10, Edwin Woollett wrote: > I have found a definite integral which integrate > can do but mydefint1 (revised to see what > is going on) cannot do, leading to a defint complaint. The example > involves > the abs function. > ------------------------------**--------------------- > > (%i1) integrate (exp (-abs (x)), x, minf, 0); > (%o1) 1 > > (%i2) assume(x < 0); > (%o2) [x < 0] > > (%i3) integrate (exp (-abs (x)), x, minf, 0); > (%o3) 1 > > (%i4) forget(x<0); > (%o4) [x < 0] > (%i5) facts(); > (%o5) [] > > (%i6) mydefint1 (e78, x78, a78, b78) := > block ( [domain : complex, xmin, xmax, > assumeL : [], res1, _ans], xmin : min > (a78, b78), > xmax : max (a78, b78), > if xmin # minf then assumeL : cons ( x78 > xmin, assumeL), > if xmax # inf then assumeL : cons (x78 < xmax, assumeL), > if debug then display (xmin, xmax, assumeL), > _ans : apply ( 'assume, assumeL ), > res1 : ratsimp (integrate (e78, x78, a78, b78 ) ), > apply ( 'forget, _ans), > res1)$ > > (%i7) debug:true$ > > (%i8) mydefint1 ( exp (-abs (x)), x, minf, 0); > > xmin = minf > > xmax = 0 > > assumeL = [x < 0] > > defint: integral is divergent. > > #0: mydefint1(e78=%e^-abs(x),x78=**x,a78=minf,b78=0) > -- an error. To debug this try: debugmode(true); > > (%i9) facts(); > (%o9) [0 > x] > > ------------------------------**---------------------------- > I don't see what difference there is in terms of > assumptions between calling integrate directly > and using mydefint1 in the above example. > > If I remove the abs(x) part, both methods work: > ------------------------------**------------------------- > (%i10) forget(x<0); > (%o10) [x < 0] > (%i11) facts(); > (%o11) [] > > (%i13) integrate(exp(x),x,minf,0); > (%o13) 1 > > (%i14) mydefint1(exp(x),x,minf,0); > xmin = minf > > xmax = 0 > > assumeL = [x < 0] > > (%o14) 1 > > (%i15) facts(); > (%o15) [] > ------------------------------**------------------------------**- > So something about the presence of abs in the > integrand prevents mydefint1 from working > as expected. > > Ted > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sat Mar 17 17:23:55 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 17 Mar 2012 18:23:55 -0400 Subject: [Maxima] Writing a new module ? In-Reply-To: References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> Message-ID: Michel, would you be willing to contribute cgrind to the Maxima distribution? -s On Sat, Mar 17, 2012 at 18:03, Michel Talon wrote: > Stavros Macrakis wrote: > > (reply in line) > > > > On Sat, Mar 17, 2012 at 13:39, Akshay Srinivasan < > akshaysrinivasan at gmail.com > >> wrote: > > > > Exactly. The Maxima-to-C component should not be specific to Lagrange. > > But you should not start from scratch. fortra.lisp is 95% of what you > > need. > > > > Already done, e.g. in > http://www.lpthe.jussieu.fr/~talon/cgrind.lisp > > > -- > Michel Talon > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Sat Mar 17 17:32:06 2012 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sat, 17 Mar 2012 23:32:06 +0100 Subject: [Maxima] Writing a new module ? In-Reply-To: References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> Message-ID: <2FFE670D-22C7-42DE-A540-57923D652DA5@lpthe.jussieu.fr> Le 17 mars 2012 ? 23:23, Stavros Macrakis a ?crit : > Michel, would you be willing to contribute cgrind to the Maxima distribution? > > -s Of course, no problem, you can do whatever you want with it. By the way the main difference between C and Fortran is the exponentiation which is ** in Fortran and pow in C. -- Michel Talon talon at lpthe.jussieu.fr -------------- next part -------------- An HTML attachment was scrubbed... URL: From akshaysrinivasan at gmail.com Sat Mar 17 22:13:12 2012 From: akshaysrinivasan at gmail.com (Akshay Srinivasan) Date: Sun, 18 Mar 2012 08:43:12 +0530 Subject: [Maxima] Writing a new module ? In-Reply-To: References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> Message-ID: <4F6552C8.30803@gmail.com> On 03/17/2012 11:52 PM, Stavros Macrakis wrote: > (reply in line) > > On Sat, Mar 17, 2012 at 13:39, Akshay Srinivasan > > > wrote: > > Yes it will probably be much easier (not to mention far more > elegant) to write the whole thing in Maxima. At the time I wrote > the thing, I hardly knew any lisp (much less about the internals of > Maxima), so the whole thing was hacked up to work. > > > You shouldn't need to know anything about either Lisp or the > internals of Maxima for the mathematical part -- you can write in > the Maxima language itself, and then simply output the expressions > in C syntax. You will need to use Lisp if you need to fiddle the > "fortran" module (which may not even be necessary, since Fortran > and C syntax for mathematical expressions (as opposed to procedural > code) are almost identical). > > The purpose of the project is to actually generate the C code; I > need to get the jacobian of the vector field governing the > dynamics, which is feasible only using AD for large systems. > > > The way I'd do this is to generate the expressions then simply > *output* them in C format. For mathematical expressions, I think > Fortran and C syntax are the same, so you can use the Fortran > function. If that doesn't work, you may need to write a small > variant of the Fortran package specifically for C. That would be > generally useful, and would still be easier than doing this via > string processing. > > > I have a vague idea of what I should write in Maxima (lisp module), > I think I have to write something like fortra.lisp which generates > C compatible expressions. I will then have to then format them into > a file-stream which should be easy to do because the existing > parser is in lisp anyway. > > > Exactly. The Maxima-to-C component should not be specific to > Lagrange. But you should not start from scratch. fortra.lisp is > 95% of what you need. Yes, so the trouble is, although I can get-by without understanding the source of fortra.lisp, it'd just be very annoying. For instance I have no idea how defmspec differs from defmfun and defmtrfun. Is there something like a Maxima-internals-for-dummies document, so that I can make better use of Maxima's extensive abstraction ? Akshay From macrakis at alum.mit.edu Sat Mar 17 22:34:38 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 17 Mar 2012 23:34:38 -0400 Subject: [Maxima] Writing a new module ? In-Reply-To: <4F6552C8.30803@gmail.com> References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F6552C8.30803@gmail.com> Message-ID: Did you see Michel's email? He already has a cgrind program that will output Maxima expressions for computation in C. -s On Sat, Mar 17, 2012 at 23:13, Akshay Srinivasan wrote: > On 03/17/2012 11:52 PM, Stavros Macrakis wrote: > > (reply in line) > > > > On Sat, Mar 17, 2012 at 13:39, Akshay Srinivasan > > > > > wrote: > > > > Yes it will probably be much easier (not to mention far more > > elegant) to write the whole thing in Maxima. At the time I wrote > > the thing, I hardly knew any lisp (much less about the internals of > > Maxima), so the whole thing was hacked up to work. > > > > > > You shouldn't need to know anything about either Lisp or the > > internals of Maxima for the mathematical part -- you can write in > > the Maxima language itself, and then simply output the expressions > > in C syntax. You will need to use Lisp if you need to fiddle the > > "fortran" module (which may not even be necessary, since Fortran > > and C syntax for mathematical expressions (as opposed to procedural > > code) are almost identical). > > > > The purpose of the project is to actually generate the C code; I > > need to get the jacobian of the vector field governing the > > dynamics, which is feasible only using AD for large systems. > > > > > > The way I'd do this is to generate the expressions then simply > > *output* them in C format. For mathematical expressions, I think > > Fortran and C syntax are the same, so you can use the Fortran > > function. If that doesn't work, you may need to write a small > > variant of the Fortran package specifically for C. That would be > > generally useful, and would still be easier than doing this via > > string processing. > > > > > > I have a vague idea of what I should write in Maxima (lisp module), > > I think I have to write something like fortra.lisp which generates > > C compatible expressions. I will then have to then format them into > > a file-stream which should be easy to do because the existing > > parser is in lisp anyway. > > > > > > Exactly. The Maxima-to-C component should not be specific to > > Lagrange. But you should not start from scratch. fortra.lisp is > > 95% of what you need. > Yes, so the trouble is, although I can get-by without understanding > the source of fortra.lisp, it'd just be very annoying. For instance I > have no idea how defmspec differs from defmfun and defmtrfun. Is there > something like a Maxima-internals-for-dummies document, so that I can > make better use of Maxima's extensive abstraction ? > > Akshay > -------------- next part -------------- An HTML attachment was scrubbed... URL: From akshaysrinivasan at gmail.com Sat Mar 17 23:40:55 2012 From: akshaysrinivasan at gmail.com (Akshay Srinivasan) Date: Sun, 18 Mar 2012 10:10:55 +0530 Subject: [Maxima] Writing a new module ? In-Reply-To: References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F6552C8.30803@gmail.com> Message-ID: <4F656757.60504@gmail.com> Sorry, I didn't read them before shooting off my mail. This looks very nice. Michel: Can I include your source code in my work (with attribution ofcourse) ? I think a better way would be to just add cgrind to maxima's source. Akshay On 03/18/2012 09:04 AM, Stavros Macrakis wrote: > Did you see Michel's email? He already has a cgrind program that > will output Maxima expressions for computation in C. > > -s > > On Sat, Mar 17, 2012 at 23:13, Akshay Srinivasan > > > wrote: > > On 03/17/2012 11:52 PM, Stavros Macrakis wrote: >> (reply in line) >> >> On Sat, Mar 17, 2012 at 13:39, Akshay Srinivasan >> > >> >> wrote: >> >> Yes it will probably be much easier (not to mention far more >> elegant) to write the whole thing in Maxima. At the time I wrote >> the thing, I hardly knew any lisp (much less about the internals >> of Maxima), so the whole thing was hacked up to work. >> >> >> You shouldn't need to know anything about either Lisp or the >> internals of Maxima for the mathematical part -- you can write >> in the Maxima language itself, and then simply output the >> expressions in C syntax. You will need to use Lisp if you need to >> fiddle the "fortran" module (which may not even be necessary, >> since Fortran and C syntax for mathematical expressions (as >> opposed to procedural code) are almost identical). >> >> The purpose of the project is to actually generate the C code; I >> need to get the jacobian of the vector field governing the >> dynamics, which is feasible only using AD for large systems. >> >> >> The way I'd do this is to generate the expressions then simply >> *output* them in C format. For mathematical expressions, I >> think Fortran and C syntax are the same, so you can use the >> Fortran function. If that doesn't work, you may need to write a >> small variant of the Fortran package specifically for C. That >> would be generally useful, and would still be easier than doing >> this via string processing. >> >> >> I have a vague idea of what I should write in Maxima (lisp >> module), I think I have to write something like fortra.lisp which >> generates C compatible expressions. I will then have to then >> format them into a file-stream which should be easy to do because >> the existing parser is in lisp anyway. >> >> >> Exactly. The Maxima-to-C component should not be specific to >> Lagrange. But you should not start from scratch. fortra.lisp is >> 95% of what you need. > Yes, so the trouble is, although I can get-by without > understanding the source of fortra.lisp, it'd just be very > annoying. For instance I have no idea how defmspec differs from > defmfun and defmtrfun. Is there something like a > Maxima-internals-for-dummies document, so that I can make better > use of Maxima's extensive abstraction ? > > Akshay > > From akshaysrinivasan at gmail.com Sat Mar 17 23:57:40 2012 From: akshaysrinivasan at gmail.com (Akshay Srinivasan) Date: Sun, 18 Mar 2012 10:27:40 +0530 Subject: [Maxima] Writing a new module ? In-Reply-To: <4F64F92E.9000604@eecs.berkeley.edu> References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> Message-ID: <4F656B44.5010908@gmail.com> On 03/18/2012 02:20 AM, Richard Fateman wrote: > You mention AD (automatic differentiation). Have you seen this? > > http://www.cs.berkeley.edu/~fateman/papers/overload-AD.pdf > > Yes, well sort of, I remember that I didn't read the paper completely or try the source code though. I think the trouble is, as it is now, I don't think I can rely on Maxima for doing efficient numerical calculations, and there really isn't a very usable lisp alternative for something like NumPy, although Matlisp comes close. Ray and I have been incorporating new stuff into Matlisp though, hopefully that will mature into something that I'd be happy using. Akshay From talon at lpthe.jussieu.fr Sun Mar 18 05:54:19 2012 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sun, 18 Mar 2012 10:54:19 +0000 (UTC) Subject: [Maxima] Writing a new module ? References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> Message-ID: Akshay Srinivasan wrote: > On 03/18/2012 02:20 AM, Richard Fateman wrote: >> You mention AD (automatic differentiation). Have you seen this? >> >> http://www.cs.berkeley.edu/~fateman/papers/overload-AD.pdf >> >> > Yes, well sort of, I remember that I didn't read the paper completely > or try the source code though. > > I think the trouble is, as it is now, I don't think I can rely on > Maxima for doing efficient numerical calculations, and there really > isn't a very usable lisp alternative for something like NumPy, > although Matlisp comes close. Indeed, from my experience with colnew, i don't think that Common Lisp may really be used for extensive numerical computations, contrary to what is claimed by lisp evangelists. Knowing how well NumPy works, i think like you that the solution is to allow convenient translation of the numerical intensive work from maxima to Fortran or C, automatic compilation of this code and linking in the maxima process. Automatic translation can be helped by primitive programs like fortran (or my cgrind), but also by more sophisticated ones like contrib/gentran. Dan Stanger has recently contributed work to gentran so i think it works now on recent Maxima, at least up to producing fortran code. As far as i remember some work is still needed for producing C code. If you are interested it should not be difficult to do: by comparing an old version of gentran and a recent one you will see what Dan has done to make fortran generation work. Basically the point is that gentran has been written for old versions of lisp, and needs some adaptation to work with sbcl, cmucl, etc. gentran is *very* sophisticated, it can translate whole maxima programs to fortran programs (resp C) including the logical flow operators, etc. so i think that with some polishing and testing, you have here a tool which is as least as sophisticated as anything existing for python. Arranging things so that gcc is invoked on the code produced from within lisp is probably trivial. Arranging that the object can be linked into maxima is perhaps less trivial, this has to do with foreign function interface in lisp, which apparently may have variations from lisp to lisp. Unfortunately there are several Common Lisp variants, with differences in the non normalized parts of the language, but fortunately it seems that sbcl emerges as the only widely used variant, at least in the free software world, which may help creating equivalents of NumPy working with sbcl. > > Ray and I have been incorporating new stuff into Matlisp though, > hopefully that will mature into something that I'd be happy using. > > Akshay -- Michel Talon From fateman at eecs.berkeley.edu Sun Mar 18 10:05:51 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 18 Mar 2012 08:05:51 -0700 Subject: [Maxima] Writing a new module ? In-Reply-To: References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> Message-ID: <4F65F9CF.8000706@eecs.berkeley.edu> On 3/18/2012 3:54 AM, Michel Talon wrote: > Akshay Srinivasan wrote: >> On 03/18/2012 02:20 AM, Richard Fateman wrote: >>> You mention AD (automatic differentiation). Have you seen this? >>> >>> http://www.cs.berkeley.edu/~fateman/papers/overload-AD.pdf >>> >>> >> Yes, well sort of, I remember that I didn't read the paper completely >> or try the source code though. >> >> I think the trouble is, as it is now, I don't think I can rely on >> Maxima for doing efficient numerical calculations, and there really >> isn't a very usable lisp alternative for something like NumPy, >> although Matlisp comes close. Are you saying that NumPy is efficient? Or that you like its user interface? Or its scope? The efficiency of numerical calculations in Lisp is heavily dependent on the particular implementation. CMU-CL or SBCL, among the free lisps, should be pretty good. > Indeed, from my experience with colnew, i don't think that Common Lisp > may really be used for extensive numerical computations, contrary to what > is claimed by lisp evangelists. With GCL? Also, there is a certain loss inherent in the f2cl, if that was used. For example, the result of a fortran call by reference is mimicked by a multiple-value return, and there may be other issues too. > Knowing how well NumPy works, i think > like you that the solution is to allow convenient translation of the numerical > intensive work from maxima to Fortran or C, automatic compilation of this code > and linking in the maxima process. This has been a long-time traditional way of dealing with the issue. Actually, C was traditionally less favored compared to FORTRAN because the optimization of FORTRAN was more sophisticated (e.g. loop unrolling, code motion, common subexpression optimization....). Either C has got this kind of stuff too, or no one cares. Consider the possibility that, if you are not wedded to portability, you can generate assembler (from lisp directly)! > Automatic translation can be helped by > primitive programs like fortran (or my cgrind), but also by more sophisticated > ones like contrib/gentran. Yep, original Gentran and related stuff is decades old. > Dan Stanger has recently contributed work to > gentran so i think it works now on recent Maxima, at least up to producing > fortran code. As far as i remember some work is still needed for producing C > code. If you are interested it should not be difficult to do: by comparing an > old version of gentran and a recent one you will see what Dan > has done to make fortran generation work. Basically the point is that gentran > has been written for old versions of lisp, and needs some adaptation to work > with sbcl, cmucl, etc. gentran is *very* sophisticated, it can translate whole > maxima programs to fortran programs (resp C) including the logical flow > operators, etc. so i think that with some polishing and testing, you have here > a tool which is as least as sophisticated as anything existing for python. > Arranging things so that gcc is invoked on the code produced from within lisp > is probably trivial. Arranging that the object can be linked into maxima is > perhaps less trivial, this has to do with foreign function interface in lisp, > which apparently may have variations from lisp to lisp. > Unfortunately there > are several Common Lisp variants, with differences in the non normalized parts > of the language, but fortunately it seems that sbcl emerges as the only widely > used variant, at least in the free software world, which may help creating > equivalents of NumPy working with sbcl. There is some attempt, CFFI, which I have not used myself, to standardize foreign function interfaces. My understanding is the GCL doesn't allow this. If SBCL truly runs on Windows, (for which there seems to be some issues), that would help. I personally solve these issues by not using "several Common Lisp variants" but only one. > > > > > >> Ray and I have been incorporating new stuff into Matlisp though, >> hopefully that will mature into something that I'd be happy using. Great! I'm a fan of Matlisp, at least in principle; I haven't used it myself :) >> >> Akshay From macrakis at alum.mit.edu Sun Mar 18 10:32:22 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 18 Mar 2012 11:32:22 -0400 Subject: [Maxima] Writing a new module ? In-Reply-To: <4F65F9CF.8000706@eecs.berkeley.edu> References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F65F9CF.8000706@eecs.berkeley.edu> Message-ID: Re efficiency of numerical Lisp vs. C and Fortran.... I have over the years done some detailed low-level analyses of the *theoretical *efficiency of the various languages, based on the run-time models they require -- and assuming that the compiler technology is equally good (which it may or may not be). For numerical routines which pass many arrays as parameters, Fortran has traditionally had an advantage over C because any two pointers in C can potentially point to the same thing (aka aliasing). That means that after the sequence *p1 = 1; *p2 = 2, it is possible for *p1 to be 1, and so every assignment to *var (which is how array parameters are accessed) must be saved to memory (not kept in a register). This is a significant overhead if the inner loop of your code accesses more than one array. Fortran takes care of this problem by saying that arrays passed by reference can be assumed not to overlap -- even if you pass the same array in two different parameters. I believe more recent versions of C allow you to declare the same thing. Lisp doesn't allow array parameters to be aliased, but when the same array is passed in two parameters, it has the same problem, so it must write array assignments into memory. Also, Lisp supports dynamic array resizing and (possibly relocating) garbage collection. This means that array references are double indirections (the intermediate cell can be changed by relocation). The actual array address can of course be cached in many cases, but the compiler can't assume that it is stable across function calls-- in the sequence ar[1]<-1; b<-cons(...); ar[2]<-2, the compiler cannot assume that the address of ar remains the same. I don't know of any way around this, but I am certainly not aware of all Lisp implementations' tricks. Now, how much overhead can you expect from all this? I would think that in the very worst case, we're talking about a factor of 2, and not a factor of 10, but I have not measured it. Has anyone? -s PS Of course there are other issues like calling sequences. Fateman did a performance test of Lisp vs. Fortran arithmetic speed in the 70's which was dominated by PDP-10 Fortran's very heavy procedure call sequence (save all registers across calls). On Sun, Mar 18, 2012 at 11:05, Richard Fateman wrote: > On 3/18/2012 3:54 AM, Michel Talon wrote: > >> Akshay Srinivasan wrote: >> >>> On 03/18/2012 02:20 AM, Richard Fateman wrote: >>> >>>> You mention AD (automatic differentiation). Have you seen this? >>>> >>>> http://www.cs.berkeley.edu/~**fateman/papers/overload-AD.pdf >>>> >>>> >>>> Yes, well sort of, I remember that I didn't read the paper completely >>> or try the source code though. >>> >>> I think the trouble is, as it is now, I don't think I can rely on >>> Maxima for doing efficient numerical calculations, and there really >>> isn't a very usable lisp alternative for something like NumPy, >>> although Matlisp comes close. >>> >> Are you saying that NumPy is efficient? Or that you like its user > interface? Or its scope? > The efficiency of numerical calculations in Lisp is heavily dependent on > the particular > implementation. CMU-CL or SBCL, among the free lisps, should be pretty > good. > > > Indeed, from my experience with colnew, i don't think that Common Lisp >> may really be used for extensive numerical computations, contrary to what >> is claimed by lisp evangelists. >> > With GCL? Also, there is a certain loss inherent in the f2cl, if that was > used. For example, > the result of a fortran call by reference is mimicked by a multiple-value > return, and there may > be other issues too. > > Knowing how well NumPy works, i think >> like you that the solution is to allow convenient translation of the >> numerical >> intensive work from maxima to Fortran or C, automatic compilation of this >> code >> and linking in the maxima process. >> > This has been a long-time traditional way of dealing with the issue. > Actually, C was traditionally > less favored compared to FORTRAN because the optimization of FORTRAN was > more > sophisticated (e.g. loop unrolling, code motion, common subexpression > optimization....). > Either C has got this kind of stuff too, or no one cares. Consider the > possibility that, if you > are not wedded to portability, you can generate assembler (from lisp > directly)! > > > Automatic translation can be helped by >> primitive programs like fortran (or my cgrind), but also by more >> sophisticated >> ones like contrib/gentran. >> > Yep, original Gentran and related stuff is decades old. > > Dan Stanger has recently contributed work to >> gentran so i think it works now on recent Maxima, at least up to producing >> fortran code. As far as i remember some work is still needed for >> producing C >> code. If you are interested it should not be difficult to do: by >> comparing an >> old version of gentran and a recent one you will see what Dan >> has done to make fortran generation work. Basically the point is that >> gentran >> has been written for old versions of lisp, and needs some adaptation to >> work >> with sbcl, cmucl, etc. gentran is *very* sophisticated, it can translate >> whole >> maxima programs to fortran programs (resp C) including the logical flow >> operators, etc. so i think that with some polishing and testing, you have >> here >> a tool which is as least as sophisticated as anything existing for python. >> Arranging things so that gcc is invoked on the code produced from within >> lisp >> is probably trivial. Arranging that the object can be linked into maxima >> is >> perhaps less trivial, this has to do with foreign function interface in >> lisp, >> which apparently may have variations from lisp to lisp. >> Unfortunately there >> are several Common Lisp variants, with differences in the non normalized >> parts >> of the language, but fortunately it seems that sbcl emerges as the only >> widely >> used variant, at least in the free software world, which may help creating >> equivalents of NumPy working with sbcl. >> > There is some attempt, CFFI, which I have not used myself, to standardize > foreign function interfaces. > My understanding is the GCL doesn't allow this. If SBCL truly runs on > Windows, (for which there > seems to be some issues), that would help. I personally solve these > issues by not > using "several Common Lisp variants" but only one. > > > >> >> >> >> >> Ray and I have been incorporating new stuff into Matlisp though, >>> hopefully that will mature into something that I'd be happy using. >>> >> Great! I'm a fan of Matlisp, at least in principle; I haven't used it > myself :) > >> >>> Akshay >>> >> > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Sun Mar 18 11:34:03 2012 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sun, 18 Mar 2012 16:34:03 +0000 (UTC) Subject: [Maxima] Writing a new module ? References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F65F9CF.8000706@eecs.berkeley.edu> Message-ID: Richard Fateman wrote: > On 3/18/2012 3:54 AM, Michel Talon wrote: >>> I think the trouble is, as it is now, I don't think I can rely on >>> Maxima for doing efficient numerical calculations, and there really >>> isn't a very usable lisp alternative for something like NumPy, >>> although Matlisp comes close. > Are you saying that NumPy is efficient? Or that you like its user > interface? Or its scope? NumPy and things going with it are very efficient. For example with weave you can code the inner parts of a loop in C which is intermingled in the python code. The system will compile and load the small code snippet and the execution will run at full compiled speed. http://docs.scipy.org/doc/scipy/reference/tutorial/weave.html For more extensive mixing of C and python there are things like pyrex and cython. There is a nice document comparing these techniques here: http://www.scipy.org/PerformancePython This document ends with a benchmark which shows that using pyrex or cython really allows to have the same performance as pure C. > With GCL? Also, there is a certain loss inherent in the f2cl, if that > was used. For example, > the result of a fortran call by reference is mimicked by a > multiple-value return, and there may > be other issues too. There are other issues far worse than inefficient calls and inefficient matrix elements access. Looking at the assembly code corresponding to lisp generated by f2cl from the lapack library will show them more than obviously. > Actually, C was traditionally > less favored compared to FORTRAN because the optimization of FORTRAN was > more > sophisticated (e.g. loop unrolling, code motion, common subexpression > optimization....). > Either C has got this kind of stuff too, or no one cares. Of course modern C compilers (notably modern gcc) do loop unrolling, common subexpression elimination, etc. I have an example of a computation on which using a strong optimisation flag on gcc allows the code to run more than 3 times faster than without optimisation. This is a testimony to the work done by the optimiser. By the way this is a domain where the closed source compiler by Intel was traditionally very good. At present i don't see big difference with the most recent gcc. Consider the > possibility that, if you > are not wedded to portability, you can generate assembler (from lisp > directly)! Maybe the lisp compiler (that is python in the case of cmucl) lacks a lot of sophistication compared to the extensive work which has been done in C compilers, so that it is more beneficial to go from lisp to C (or fortran) and delegate the job of producing assembler to an external tool when high performance is required. I have read that one of the lisp like able to outperform hand written C, i mean the scheme "compiler" Stalin, produces in fact C code, but heavily tuned for great performance. > There is some attempt, CFFI, which I have not used myself, to > standardize foreign function interfaces. > My understanding is the GCL doesn't allow this. If SBCL truly runs on > Windows, (for which there > seems to be some issues), that would help. I personally solve these > issues by not > using "several Common Lisp variants" but only one. > which is perhaps outstanding for commercial use, but we are not speaking commercial use here. -- Michel Talon From akshaysrinivasan at gmail.com Sun Mar 18 11:35:14 2012 From: akshaysrinivasan at gmail.com (Akshay Srinivasan) Date: Sun, 18 Mar 2012 22:05:14 +0530 Subject: [Maxima] Writing a new module ? In-Reply-To: <4F65F9CF.8000706@eecs.berkeley.edu> References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F65F9CF.8000706@eecs.berkeley.edu> Message-ID: <4F660EC2.5050807@gmail.com> >>> although Matlisp comes close. > Are you saying that NumPy is efficient? Or that you like its user > interface? Or its scope? The efficiency of numerical calculations > in Lisp is heavily dependent on the particular implementation. > CMU-CL or SBCL, among the free lisps, should be pretty good. Yes, SBCL is quite fast by the looks of it, CCL not quite (maybe because it was interpreted ?); having numerics in Lisp kind of ties one down to an interpreter. For me it had been mostly the NumPy/SciPy/Matplotlib/Mayavi ecosystem. NumPy/SciPy doesn't look as fast as MATLAB or Octave even, at certain tasks, but python is a much nicer language. What excites me with Lisp, is that I can - in theory - do symbolic, numerical computation seamlessly, and at the end of prototyping, compile the code :) >> creating equivalents of NumPy working with sbcl. > There is some attempt, CFFI, which I have not used myself, to > standardize foreign function interfaces. My understanding is the > GCL doesn't allow this. If SBCL truly runs on Windows, (for which > there seems to be some issues), that would help. I personally > solve these issues by not using "several Common Lisp variants" but > only one. > >>> Ray and I have been incorporating new stuff into Matlisp >>> though, hopefully that will mature into something that I'd be >>> happy using. > Great! I'm a fan of Matlisp, at least in principle; I haven't used > it myself :) :) If anyone is interested in having a go at the code, the bleeding-edge branch of Matlisp is here: git://matlisp.git.sourceforge.net/gitroot/matlisp/matlisp matlisp-cffi The basic datastructure has been tweaked so as to be able to handle matrix slices and row/col-major matrices seamlessly. Things like: -------------------------------------------------- (defvar e (make-complex-matrix '((#c(1 2) #c(2 6)) (#c(3 1) #c(4 5))))) (defvar out (make-complex-matrix 2 2)) (gemm! 1d0 (realpart! e) (imagpart! e) 0d0 out) -------------------------------------------------- can be done without ever having to copy the store. Not everything works, and SBCL throws up an error about row-stride midway, but if you just accept that and fool lisp into believing everything is hunky-dory; the above example should work. Akshay > > _______________________________________________ Maxima mailing > list Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Sun Mar 18 11:45:17 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 18 Mar 2012 12:45:17 -0400 Subject: [Maxima] Writing a new module ? In-Reply-To: References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F65F9CF.8000706@eecs.berkeley.edu> Message-ID: On Sun, Mar 18, 2012 at 12:34, Michel Talon wrote: > Richard Fateman wrote: > > ,,,I personally solve these issues by not using "several Common Lisp > variants" but only one. > > which is perhaps outstanding for commercial use, but we are not speaking > commercial use here. This isn't about commercial *use* -- non-commercial users can and do use commercial tools. I'd hope your research group can find the budget to license the appropriate quality of tool (software or otherwise) for your work. Free software is great, especially when you want to modify it (e.g. Maxima), but what's the problem with using a proprietary Lisp implementation if it works better than free ones? Surely your research institute uses proprietary books (copyright by author), commercial instruments (covered by patents), etc. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sun Mar 18 11:51:56 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 18 Mar 2012 09:51:56 -0700 Subject: [Maxima] Writing a new module ? In-Reply-To: References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F65F9CF.8000706@eecs.berkeley.edu> Message-ID: <4F6612AC.8040503@gmail.com> On 3/18/12 8:32 AM, Stavros Macrakis wrote: > > Lisp doesn't allow array parameters to be aliased, but when the same > array is passed in two parameters, it has the same problem, so it must > write array assignments into memory. Also, Lisp supports dynamic > array resizing and (possibly relocating) garbage collection. This > means that array references are double indirections (the intermediate > cell can be changed by relocation). The actual array address can of > course For the one lisp I'm really familiar with (cmucl), 1D specialized arrays don't have this problem. But all other arrays types have this issue. > be cached in many cases, but the compiler can't assume that it is > stable across function calls-- in the sequence ar[1]<-1; b<-cons(...); > ar[2]<-2, the compiler cannot assume that the address of ar remains > the same. I don't know of any way around this, but I am certainly not > aware of all Lisp implementations' tricks. > For cmucl, this isn't a problem because the GC knows how to collect items in registers. So if ar is in a register, you call some routine which causes GC, and ar moves, the GC will update the value in the register so it now has the correct new address of ar. So nothing needed by the compiler. > Now, how much overhead can you expect from all this? I would think > that in the very worst case, we're talking about a factor of 2, and > not a factor of 10, but I have not measured it. Has anyone? > While Michel rightly complains about how slow colnew (translated by f2cl) is, it is not so simplistic as blaming lisp. The slowness comes from several areas. One major factor was the need to call from Lisp back into Maxima to compute the various functions and the need of marshalling the lisp arrays to and from Maxima lists. There's also the issue with array access and how f2cl (and lisp) has to handle Fortran's array slicing, which runs into the issue you mention above. But these are not the only issues. The translation itself is much slower than fortran because I've run some of the demo programs from colnew and they are quite a bit slower than fortran. I've been too lazy to track this down, but several years ago, I worked with Richard Fateman on a paper. As part of the work, we took Brent's mpfun package in Fortran and converted it to Lisp via f2cl. The test was computing pi to thousands of digits. Lisp was much slower (10x?). This was partly due to the translation, but mostly due to the fact that Fortran could assume things didn't overflow (or you didn't care), but Lisp couldn't. So the bottle neck was in truncating floats to integers. Fortran assumes the result fits in a fortran integer. Lisp had to assume a bignum. With a few careful declarations, we got lisp down to around 2x slower, maybe less. Some further optimizations in inlining simple (lisp) functions got it down more. This helped a lot too. And finally fixing the very badly converted print function (which used to take minutes or hours to print out 10000 digits of pi) made the test program quite reasonable compared to Fortran. I don't know colnew could be made to be only 2x slower, but there is certainly room for improvement, but it certainly can't be as fast as the Fortran version, even if we called out directly to the Fortran code, simply because there are a lot of calls back into Maxima, which is slow. Ray From fateman at eecs.berkeley.edu Sun Mar 18 11:52:10 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 18 Mar 2012 09:52:10 -0700 Subject: [Maxima] Writing a new module ? In-Reply-To: References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F65F9CF.8000706@eecs.berkeley.edu> Message-ID: <4F6612BA.2000308@eecs.berkeley.edu> On 3/18/2012 8:32 AM, Stavros Macrakis wrote: > Re efficiency of numerical Lisp vs. C and Fortran.... Good explanation. Some of these issues can be addressed by extensions to the ANSI Common Lisp language. For example, Allegro has a bunch of features (maybe SBCL etc have similar stuff) like this: "foreign" types which can correspond to anything in C, e.g. structs. They can be addressed, changed, allocated, allocated in static space (that is, not subject to being moved in a copying garbage collection), and they can also be garbage collected. An array allocated in foreign space could be addressed in the same way (and host the same aliasing problems) as in FORTRAN. Using these features allows the Lisp compiler, at least in principle, to generate the same code for array accessing, arithmetic, etc as FORTRAN, I think. I think that as a language definition issue, it would be impossible as you say for Lisp to assume that it can cache the address of a lisp array between function calls, but some memory references (e.g. the ones that are needed for indirectly referencing an array) are likely to be in hardware cache, and so they are negligible in cost. One trick in making Lisp and FORTRAN run at the same speed may be to slow them both down by allocating and using huge arrays... so that the cost of full memory accesses dominates everything, and the little indirection stuff is just a blip. But this would be something of a cooked-up benchmark. And no, I haven't measured this. RJF > > I have over the years done some detailed low-level analyses of the > /theoretical /efficiency of the various languages, based on the > run-time models they require -- and assuming that the compiler > technology is equally good (which it may or may not be). > > For numerical routines which pass many arrays as parameters, Fortran > has traditionally had an advantage over C because any two pointers in > C can potentially point to the same thing (aka aliasing). That means > that after the sequence *p1 = 1; *p2 = 2, it is possible for *p1 to be > 1, and so every assignment to *var (which is how array parameters are > accessed) must be saved to memory (not kept in a register). This is a > significant overhead if the inner loop of your code accesses more than > one array. Fortran takes care of this problem by saying that arrays > passed by reference can be assumed not to overlap -- even if you pass > the same array in two different parameters. I believe more recent > versions of C allow you to declare the same thing. > > Lisp doesn't allow array parameters to be aliased, but when the same > array is passed in two parameters, it has the same problem, so it must > write array assignments into memory. Also, Lisp supports dynamic > array resizing and (possibly relocating) garbage collection. This > means that array references are double indirections (the intermediate > cell can be changed by relocation). The actual array address can of > course be cached in many cases, but the compiler can't assume that it > is stable across function calls-- in the sequence ar[1]<-1; > b<-cons(...); ar[2]<-2, the compiler cannot assume that the address of > ar remains the same. I don't know of any way around this, but I am > certainly not aware of all Lisp implementations' tricks. > > Now, how much overhead can you expect from all this? I would think > that in the very worst case, we're talking about a factor of 2, and > not a factor of 10, but I have not measured it. Has anyone? > > -s > > PS Of course there are other issues like calling sequences. Fateman > did a performance test of Lisp vs. Fortran arithmetic speed in the > 70's which was dominated by PDP-10 Fortran's very heavy procedure call > sequence (save all registers across calls). > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sun Mar 18 11:57:40 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 18 Mar 2012 09:57:40 -0700 Subject: [Maxima] Writing a new module ? In-Reply-To: References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F65F9CF.8000706@eecs.berkeley.edu> Message-ID: <4F661404.8040803@gmail.com> On 3/18/12 9:34 AM, Michel Talon wrote: > Richard Fateman wrote: >> On 3/18/2012 3:54 AM, Michel Talon wrote: >>>> I think the trouble is, as it is now, I don't think I can rely on >>>> Maxima for doing efficient numerical calculations, and there really >>>> isn't a very usable lisp alternative for something like NumPy, >>>> although Matlisp comes close. >> Are you saying that NumPy is efficient? Or that you like its user >> interface? Or its scope? > NumPy and things going with it are very efficient. For example with weave > you can code the inner parts of a loop in C which is intermingled in the > python code. The system will compile and load the small code snippet and > the execution will run at full compiled speed. > http://docs.scipy.org/doc/scipy/reference/tutorial/weave.html I'm not at all familiar with these things, but perhaps this would be interesting: http://trac.common-lisp.net/cmucl/browser/src/contrib/embedded-c/embedded-c.catalog It allows you to compile C code easily (even on the fly) and makes it directly available to cmucl. Ray > For more extensive mixing of C and python there are things like pyrex and > cython. There is a nice document comparing these techniques here: > http://www.scipy.org/PerformancePython > This document ends with a benchmark which shows that using pyrex or cython > really allows to have the same performance as pure C. > >> With GCL? Also, there is a certain loss inherent in the f2cl, if that >> was used. For example, >> the result of a fortran call by reference is mimicked by a >> multiple-value return, and there may >> be other issues too. > > There are other issues far worse than inefficient calls and inefficient matrix > elements access. Looking at the assembly code corresponding to lisp generated > by f2cl from the lapack library will show them more than obviously. > > > >> Actually, C was traditionally >> less favored compared to FORTRAN because the optimization of FORTRAN was >> more >> sophisticated (e.g. loop unrolling, code motion, common subexpression >> optimization....). >> Either C has got this kind of stuff too, or no one cares. > Of course modern C compilers (notably modern gcc) do loop unrolling, common > subexpression elimination, etc. I have an example of a computation on which > using a strong optimisation flag on gcc allows the code to run more than 3 > times faster than without optimisation. This is a testimony to the work done > by the optimiser. By the way this is a domain where the closed source compiler > by Intel was traditionally very good. At present i don't see big difference > with the most recent gcc. > > > > > Consider the >> possibility that, if you >> are not wedded to portability, you can generate assembler (from lisp >> directly)! > Maybe the lisp compiler (that is python in the case of cmucl) lacks a lot of > sophistication compared to the extensive work which has been done in C > compilers, so that it is more beneficial to go from lisp to C (or > fortran) and delegate the job of producing assembler to an external tool > when high performance is required. I have read that one of the lisp like > able to outperform hand written C, i mean the scheme "compiler" Stalin, > produces in fact C code, but heavily tuned for great performance. > > >> There is some attempt, CFFI, which I have not used myself, to >> standardize foreign function interfaces. >> My understanding is the GCL doesn't allow this. If SBCL truly runs on >> Windows, (for which there >> seems to be some issues), that would help. I personally solve these >> issues by not >> using "several Common Lisp variants" but only one. >> > which is perhaps outstanding for commercial use, but we are not speaking > commercial use here. > > > From tkpapp at gmail.com Sun Mar 18 12:47:36 2012 From: tkpapp at gmail.com (Tamas Papp) Date: Sun, 18 Mar 2012 17:47:36 +0000 (UTC) Subject: [Maxima] variable names and order Message-ID: Hi, I could not figure out the answers to the following: 1. Maxima reorders terms for commutative operators, (%i1) a=b+c; (%o1) a = c + b Is it possible to preserve the original order in the underlying S-expression, so that when I need a LaTeX fragment I get the original order? Also, is it possible to influence/change ordering of results? 2. If I have a variable that I want to show up as \lambda_e in LaTeX (and rendered as such in imaxima), what should I name it? lambda[e] does not work when I am solving equations. Also, how can I get a variable named W^* or W^+ (ie as a single variable name)? Best, Tamas From willisb at unk.edu Sun Mar 18 13:09:15 2012 From: willisb at unk.edu (Barton Willis) Date: Sun, 18 Mar 2012 13:09:15 -0500 Subject: [Maxima] defint1 abs trouble In-Reply-To: References: , <67701FBAB24449D4BE938DBA362618C7@edwinc367e16bd> Message-ID: One more thing to think about: (%i155) assume(x>0)$ (%i156) mydefint1(abs(x),x,-1,1); (%o156) 0 (%i157) integrate(abs(x),x,-1,1); (%o157) 0 Some may disagree, but I think these are bugs (answer should be 1, not 0). One cure is to substitute a gensym for the integration variable. If Maxima subsequently does an asksign, it might ask for the sign of the gensym--the user won't know how to answer. You could create a completely new context. If the global fact database contained -a 0. And this fact wouldn't be known in the completely new context. --Barton From woollett at charter.net Sun Mar 18 13:09:58 2012 From: woollett at charter.net (Edwin Woollett) Date: Sun, 18 Mar 2012 11:09:58 -0700 Subject: [Maxima] defint1 abs trouble Message-ID: <1A65EC42A948446DB8F176F7F8575B78@edwinc367e16bd> On Mar. 17, 2012, Barton Willis wrote: ------------------------------ >After the assumptions and before integration, the integrand needs to be >simplified. >To fix this, either insert e78 : expand(e78,0,0) before res1 : integrate >(e78, x78, a78, b78) or >try res1 : block([?dosimp : t], integrate (e78, x78, a78, b78)). (Maybe >using ?dosimp this way >in Maxima code is bad form.) ------------------------------ Thanks for the suggestion, which looks like: ------------------------- (%i1) mydefint1 (e78, x78, a78, b78) := block( [domain : complex, res1, _ans,e781], _ans : assume (x78 > min(a78,b78), x78 < max(a78,b78)), e781 : expand (e78,0,0), res1 : ratsimp (integrate (e781, x78, a78, b78 ) ), apply ('forget, _ans), res1)$ (%i2) facts(); (%o2) [] (%i3) mydefint1 ( exp (-abs (x)), x, minf, 0); (%o3) 1 (%i4) facts(); (%o4) [] (%i5) mydefint1 ( exp (x), x, minf, 0); (%o5) 1 (%i6) facts(); (%o6) [] ------------------------------------------ and thanks for a version using context, which I want to understand (when I get back from Las Vegas end of next week). --------------------------------------------------------- On Mar. 17, 2012, Stavros Macrakis wrote: ------------------------------------- >This is a bug in integrate: >[snip] >I have filed this as bug 3507277 > ------------------- Thanks for the feedback. Ted From aleksasd873 at gmail.com Sun Mar 18 13:21:15 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Sun, 18 Mar 2012 20:21:15 +0200 Subject: [Maxima] variable names and order Message-ID: *Tamas Papp in* http://www.math.utexas.edu/pipermail/maxima/2012/028162.html write: Maxima reorders terms for commutative operators, (%i1) a=b+c; (%o1) a = c + b Is it possible to preserve the original order in the underlying S-expression, so that when I need a LaTeX fragment I get the original order? Also, is it possible to influence/change ordering of results? (%i1) a=b+c; (%o1) a=c+b (%i2) a+b+c; (%o2) c+b+a (%i3) ordergreat(a,b,c); (%o3) done (%i4) a=b+c; (%o4) a=b+c (%i5) a+b+c; (%o5) a+b+c Aleksas -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Sun Mar 18 13:43:02 2012 From: woollett at charter.net (Edwin Woollett) Date: Sun, 18 Mar 2012 11:43:02 -0700 Subject: [Maxima] defint1 abs trouble Message-ID: On Mar. 18, Barton Willis wrote: ----------------------------- >(%i155) assume(x>0)$ > > (%i156) mydefint1(abs(x),x,-1,1); > (%o156) 0 ------------------------------------- Thanks for pointing out this further problem with mydefint1, an effort to ignore global assumptions and use local assumptions. With my code I get: ------------------------------ (%i1) mydefint1 (e78, x78, a78, b78) := block( [domain : complex, res1, _ans,e781], _ans : assume (x78 > min(a78,b78), x78 < max(a78,b78)), e781 : expand (e78,0,0), res1 : ratsimp (integrate (e781, x78, a78, b78 ) ), apply ('forget, _ans), res1)$ (%i2) assume(x>0); (%o2) [x > 0] (%i3) mydefint1(abs(x),x,-1,1); (%o3) 0 (%i4) facts(); (%o4) [x > 0] --------------------------------------- which is trouble with a capital T. If I try to explicitly save and forget global assumptions, restoring them at the end, I still get the wrong answer: --------------------------------------------------- (%i1) mydefint1 (e78, x78, a78, b78) := block( [domain : complex,glob_assume, res1, loc_assume,e781], glob_assume : facts(), display(glob_assume), apply('forget,glob_assume), loc_assume : assume (x78 > min(a78,b78), x78 < max(a78,b78)), e781 : expand (e78,0,0), res1 : ratsimp (integrate (e781, x78, a78, b78 ) ), apply ('forget, loc_assume), apply ('assume, glob_assume), res1)$ (%i2) assume(x>0); (%o2) [x > 0] (%i3) mydefint1(abs(x),x,-1,1); glob_assume = [x > 0] (%o3) 0 (%i4) facts(); (%o4) [x > 0] ---------------------------------------------- Ted From robert.dodier at gmail.com Sun Mar 18 16:40:52 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 18 Mar 2012 15:40:52 -0600 Subject: [Maxima] variable names and order In-Reply-To: References: Message-ID: On 3/18/12, Tamas Papp wrote: > (%i1) a=b+c; > (%o1) a = c + b > > Is it possible to preserve the original order in the underlying > S-expression, so that when I need a LaTeX fragment I get the original > order? Also, is it possible to influence/change ordering of results? Well, powerdisp:true reverses the default order for terms in a "+" expression. As far as I know, there is no way to preserve the order in which they were entered. Well, sort of. simp:false disables reordering terms, and lots of other things, so it's probably not too useful. > 2. If I have a variable that I want to show up as \lambda_e in LaTeX > (and rendered as such in imaxima), what should I name it? lambda[e] > does not work when I am solving equations. I don't see the problem -- solve seems to work OK w/ lambda[e], e.g. solve(lambda[e]^2 - lambda[e] = 4, lambda[e]) => [lambda[e] = -(17^(1/2)-1)/2,lambda[e] = (17^(1/2)+1)/2] Can you be more specific about the sense in which lambda[e] doesn't work with solve? > Also, how can I get a > variable named W^* or W^+ (ie as a single variable name)? Couple of ideas -- (1) just write W^"*" and W^"+" (2) let your variables be W\* and W\+ and define their TeX properties via texput(W\*, "W^{*}"); texput(W\+, "W^{+}"); HTH Robert Dodier From robert.dodier at gmail.com Mon Mar 19 00:19:19 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 18 Mar 2012 23:19:19 -0600 Subject: [Maxima] Fwd: plotting problem solved ? In-Reply-To: <4F667592.2040203@gmail.com> References: <4F625AA9.2060300@gmail.com> <4F62DFB7.8010607@gmail.com> <4F64C6AD.6030907@gmail.com> <4F6503D5.2040700@gmail.com> <4F667592.2040203@gmail.com> Message-ID: Great, looks like the problem is fixed (in Gnuplot CVS) now. best Robert Dodier ---------- Forwarded message ---------- From: joaquin borges Date: Sun, 18 Mar 2012 20:53:54 -0300 Subject: plotting problem solved ? To: Robert Dodier Hi Robert : This is the output of plot2d(sec(x)*cos(x),[x,-1,1]) with the last changes (less than 60' ago) to gnuplot cvs. best joaquin image attached . -------------- next part -------------- A non-text attachment was scrubbed... Name: sec*cos.png Type: image/png Size: 16070 bytes Desc: not available URL: From tkpapp at gmail.com Mon Mar 19 00:26:13 2012 From: tkpapp at gmail.com (Tamas Papp) Date: Mon, 19 Mar 2012 05:26:13 +0000 (UTC) Subject: [Maxima] variable names and order References: Message-ID: On Sun, 18 Mar 2012 15:40:52 -0600, Robert Dodier wrote: >> 2. If I have a variable that I want to show up as \lambda_e in LaTeX >> (and rendered as such in imaxima), what should I name it? lambda[e] >> does not work when I am solving equations. > > I don't see the problem -- solve seems to work OK w/ lambda[e], e.g. > solve(lambda[e]^2 - lambda[e] = 4, lambda[e]) > => [lambda[e] = -(17^(1/2)-1)/2,lambda[e] = (17^(1/2)+1)/2] > > Can you be more specific about the sense in which lambda[e] doesn't work > with solve? This eq1: lambda[e]+lambda[u]=3; eq2: lambda[e]+2*lambda[u]=4; solve([eq1,eq2],[lambda[e],lambda[u]]); gives me Maxima encountered a Lisp error: Error in PROGN [or a callee]: Caught fatal error [memory may be damaged] Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. Best, Tamas PS: I am using the maxima from Debian/testing. Maxima version: 5.26.0 Maxima build date: 17:25 1/21/2012 Host type: x86_64-unknown-linux-gnu Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.7 From robert.dodier at gmail.com Mon Mar 19 00:45:40 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 18 Mar 2012 23:45:40 -0600 Subject: [Maxima] variable names and order In-Reply-To: References: Message-ID: On 3/18/12, Tamas Papp wrote: > eq1: lambda[e]+lambda[u]=3; > eq2: lambda[e]+2*lambda[u]=4; > solve([eq1,eq2],[lambda[e],lambda[u]]); > Error in PROGN [or a callee]: Caught fatal error [memory may be damaged] OK, this is a bug in freeof: freeof (lambda [e], lambda [u]); => error It turns out freeof has a special case for lambda expressions, assuming that the expression looks like lambda([x], ...). I guess I can fix that, although it seems plausible that you'll bump into similar cases ... So let's back up. How about this: just write %lambda[e], %lambda[u], etc, with texput(%lambda, "\\lambda") -- that should be enough. best Robert Dodier From akhorshidi at live.com Mon Mar 19 01:04:31 2012 From: akhorshidi at live.com (A. Khorshidi) Date: Mon, 19 Mar 2012 06:04:31 +0000 (UTC) Subject: [Maxima] maxima & a wrong limit at infinity Message-ID: Hello, When I solve the following limit at infinity by Maxima , the output is infinity. limit((2*sqrt((x/2+1)^2-(cos(29*%pi/360)*x/2)^2)- x*sin(29*%pi/360))/(%pi*cos(29*%pi/360)),x,inf); To solve this limit, we?ll need the conjugate multiplication technique. I multiplying the numerator and denominator by the conjugate of the numerator and after simplification: limit((4*x+4)/(%pi*cos(29*%pi/360)* (2*sqrt(x^2/4+x+1-x^2/4*cos(29*%pi/360)^2)+x*sin(29*%pi/360))), x, inf); Now, the output is correct. (=2.62) Why the answer of the first limit was " Infinity "? Why Maxima could not solve this limit correctly? Please see the attached file! Thank you in advance. From akhorshidi at live.com Mon Mar 19 01:05:45 2012 From: akhorshidi at live.com (A. Khorshidi) Date: Mon, 19 Mar 2012 06:05:45 +0000 (UTC) Subject: [Maxima] maxima & a wrong limit at infinity Message-ID: Hello, When I solve the following limit at infinity by Maxima , the output is infinity. limit((2*sqrt((x/2+1)^2-(cos(29*%pi/360)*x/2)^2)- x*sin(29*%pi/360))/(%pi*cos(29*%pi/360)),x,inf); To solve this limit, we'll need the conjugate multiplication technique. I multiplying the numerator and denominator by the conjugate of the numerator and after simplification: limit((4*x+4)/(%pi*cos(29*%pi/360)* (2*sqrt(x^2/4+x+1-x^2/4*cos(29*%pi/360)^2)+ x*sin(29*%pi/360))), x, inf); Now, the output is correct. (=2.62) Why the answer of the first limit was " Infinity "? Why Maxima could not solve this limit correctly? Please see the attached file! Thank you in advance. From tkpapp at gmail.com Mon Mar 19 02:25:34 2012 From: tkpapp at gmail.com (Tamas Papp) Date: Mon, 19 Mar 2012 07:25:34 +0000 (UTC) Subject: [Maxima] variable names and order References: Message-ID: On Sun, 18 Mar 2012 23:45:40 -0600, Robert Dodier wrote: > On 3/18/12, Tamas Papp wrote: > >> eq1: lambda[e]+lambda[u]=3; >> eq2: lambda[e]+2*lambda[u]=4; >> solve([eq1,eq2],[lambda[e],lambda[u]]); > >> Error in PROGN [or a callee]: Caught fatal error [memory may be >> damaged] > > OK, this is a bug in freeof: > > freeof (lambda [e], lambda [u]); > => error > > It turns out freeof has a special case for lambda expressions, assuming > that the expression looks like lambda([x], ...). > > I guess I can fix that, although it seems plausible that you'll bump > into similar cases ... > > So let's back up. How about this: just write %lambda[e], %lambda[u], > etc, with texput(%lambda, "\\lambda") -- that should be enough. Yes, that should be perfect. Maybe I stumbled into this accidentally, but I am a bit surprised that it is so easy to get Maxima into a situation where "memory may be damaged". I don't know much about Maxima's internals, but since it is built on CL, normally I would just expect a some condition with restarts as the worst case. Are these fatal errors a GCL thing? Would it help if I ran Maxima on top of, say, SBCL? Best, Tamas From talon at lpthe.jussieu.fr Mon Mar 19 07:39:12 2012 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Mon, 19 Mar 2012 12:39:12 +0000 (UTC) Subject: [Maxima] Writing a new module ? References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F65F9CF.8000706@eecs.berkeley.edu> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F65F9CF.8000706@eecs.berkeley.edu> <4F6612AC.8040503@gmail.com> Message-ID: Raymond Toy wrote: > This was partly due to the translation, but mostly due to the fact that > Fortran could assume things didn't overflow (or you didn't care), but > Lisp couldn't. So the bottle neck was in truncating floats to > integers. Fortran assumes the result fits in a fortran integer. Lisp > had to assume a bignum. I think this is the main source of slowness in the translation to lisp of lapack routines. However f2cl produces the type declarations automatically, perhaps they are not correct. This may be fixable in f2cl. > > I don't know colnew could be made to be only 2x slower, but there is > certainly room for improvement, but it certainly can't be as fast as the > Fortran version, even if we called out directly to the Fortran code, > simply because there are a lot of calls back into Maxima, which is slow. Yes, half of the running time comes from callbacks to maxima, which one cannot speed up (maybe one can compile the maxima formulae, but when i tried it was buggy). Half of the running time comes from lapack and colnew routines (translated from fortran to lisp). These are literally 100 times slower than the Fortran versions, and this is terrible. One may hope to cut this to 10 times slower, this would be very nice, but at the end of the day would only cut total execution time by 2, unfortunately. The nice feature of scientific python is that one can easily convert the equivalent of the maxima callbacks to code snippets in C that the system compiles, links and runs at full speed. This is the reason why the benchmark i have mentioned above shows much better performance using scipy with such compilation hacks than with for example octave (it would be the same with scilab or matlab) which always needs callbacks to its own language. This is the reason why i advocated translating the compute intensive code to C or fortran and compiling it. -- Michel Talon From talon at lpthe.jussieu.fr Mon Mar 19 07:39:15 2012 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Mon, 19 Mar 2012 12:39:15 +0000 (UTC) Subject: [Maxima] variable names and order References: Message-ID: Tamas Papp wrote: > Maybe I stumbled into this accidentally, but I am a bit surprised that > it is so easy to get Maxima into a situation where "memory may be > damaged". I don't know much about Maxima's internals, but since it is > built on CL, normally I would just expect a some condition with > restarts as the worst case. Are these fatal errors a GCL thing? > Would it help if I ran Maxima on top of, say, SBCL? If you apply the recipe given by the message: To enable the Lisp debugger set *debugger-hook* to nil. then you will get into the lisp debugger and perhaps will be able to find restarts. :lisp (setq *debugger-hook* nil) then run your crashing program. -- Michel Talon From robert.dodier at gmail.com Mon Mar 19 09:59:45 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 19 Mar 2012 08:59:45 -0600 Subject: [Maxima] variable names and order In-Reply-To: References: Message-ID: On 3/19/12, Tamas Papp wrote: > Maybe I stumbled into this accidentally, but I am a bit surprised that > it is so easy to get Maxima into a situation where "memory may be > damaged". I don't know much about Maxima's internals, but since it is > built on CL, normally I would just expect a some condition with > restarts as the worst case. Are these fatal errors a GCL thing? > Would it help if I ran Maxima on top of, say, SBCL? Yeah, that's a GCL idiosyncrasy. I'd say CMUCL or SBCL are less so. :lisp (setq *debugger-hook* nil) drops the user into a debugging session when an error is encountered. Maybe that's helpful. best Robert Dodier From fateman at eecs.berkeley.edu Mon Mar 19 11:08:53 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 19 Mar 2012 09:08:53 -0700 Subject: [Maxima] Memory may be damaged (was Re: variable names and order) In-Reply-To: References: Message-ID: <4F675A15.2010206@eecs.berkeley.edu> On 3/19/2012 12:25 AM, Tamas Papp wrote: > Maybe I stumbled into this accidentally, but I am a bit surprised that > it is so easy to get Maxima into a situation where "memory may be > damaged". I don't know much about Maxima's internals, but since it is > built on CL, normally I would just expect a some condition with > restarts as the worst case. Are these fatal errors a GCL thing? Would > it help if I ran Maxima on top of, say, SBCL? Best, Tamas "memory may be damaged" but it may not be any part of memory you are going to be using anyway. And it may not be damaged at all. If you were using C, you might not get such a message, just a system crash. Typically a lisp compiler will have different levels of optimization, and optimizing for speed (speed=3) may mean that error (such as incorrect type declarations) will not be caught at runtime. Common Lisp's definition allows that the result of some kinds of errors are not defined by the standard, and so different implementations may do different things.. (" it is an error to do .....") . Usually a program compiled with safety=3 will catch more errors and recover gracefully than a program compiled with safety=0 speed=3. // I don't know what the optimization settings are for the part of Maxima that you were using. It is not clear how much checking should be done by Lisp, how much should be done by Maxima's programs, and how much by humans. If humans go swimming in a raging river and are carried over a waterfall and drown, is it a bug in the river? If a sign says "Do not go in water here" (and in other languages) is it still a bug? If there is a fence with barbed wire preventing access to the river, is it still a bug, if someone cuts through the fence? Is it necessary to (say) dam the river? RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Mon Mar 19 13:06:40 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 19 Mar 2012 11:06:40 -0700 Subject: [Maxima] Memory may be damaged (was Re: variable names and order) In-Reply-To: <4F675A15.2010206@eecs.berkeley.edu> References: <4F675A15.2010206@eecs.berkeley.edu> Message-ID: On Mon, Mar 19, 2012 at 9:08 AM, Richard Fateman wrote: > On 3/19/2012 12:25 AM, Tamas Papp wrote: > > Maybe I stumbled into this accidentally, but I am a bit surprised that it > is so easy to get Maxima into a situation where "memory may be damaged". I > don't know much about Maxima's internals, but since it is built on CL, > normally I would just expect a some condition with restarts as the worst > case. Are these fatal errors a GCL thing? Would it help if I ran Maxima on > top of, say, SBCL? Best, Tamas > > "memory may be damaged" but it may not be any part of memory you are > going to be using anyway. > And it may not be damaged at all. > > If you were using C, you might not get such a message, just a system crash. > > Typically a lisp compiler will have different levels of optimization, and > optimizing for speed (speed=3) > may mean that error (such as incorrect type declarations) will not be > caught at runtime. > I think there used to be quite a bit of code compiled with speed=3 and safety=0. The safety=0 is pretty bad if you're not careful to check that things are what you think they are. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From akshaysrinivasan at gmail.com Mon Mar 19 23:44:05 2012 From: akshaysrinivasan at gmail.com (Akshay Srinivasan) Date: Tue, 20 Mar 2012 10:14:05 +0530 Subject: [Maxima] Writing a new module ? In-Reply-To: References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F65F9CF.8000706@eecs.berkeley.edu> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F65F9CF.8000706@eecs.berkeley.edu> <4F6612AC.8040503@gmail.com> Message-ID: <4F680B15.2040507@gmail.com> > The nice feature of scientific python is that one can easily > convert the equivalent of the maxima callbacks to code snippets in > C that the system compiles, links and runs at full speed. This is > the reason why the benchmark i have mentioned above shows much > better performance using scipy with such compilation hacks than > with for example octave (it would be the same with scilab or > matlab) which always needs callbacks to its own language. This is > the reason why i advocated translating the compute intensive code > to C or fortran and compiling it. That's interesting, do you know how this compares with C callbacks in Lisp (called from a Fortran library) ? Akshay From akshaysrinivasan at gmail.com Tue Mar 20 08:24:55 2012 From: akshaysrinivasan at gmail.com (Akshay Srinivasan) Date: Tue, 20 Mar 2012 18:54:55 +0530 Subject: [Maxima] Writing a new module ? In-Reply-To: References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F65F9CF.8000706@eecs.berkeley.edu> Message-ID: <4F688527.60800@gmail.com> > > NumPy and things going with it are very efficient. For example with > weave you can code the inner parts of a loop in C which is > intermingled in the python code. The system will compile and load > the small code snippet and the execution will run at full compiled > speed. > http://docs.scipy.org/doc/scipy/reference/tutorial/weave.html Looks like Python needs macros :) Poking fun aside, this is very impressive. Is string processing also the usual way of generating numerical functions from symbolic results in non-lispy languages (C++, Python mostly) ? Akshay From leon.magiera at wp.pl Thu Mar 22 00:54:55 2012 From: leon.magiera at wp.pl (leon.magiera at wp.pl) Date: Thu, 22 Mar 2012 06:54:55 +0100 Subject: [Maxima] sign Message-ID: <4f6abeafbb62f4.71602613@wp.pl> I want to get the result of calculation (simplification) assume( x>0, x<%pi/2 ); sign(cos(x)); I expect to get 1, whereas MAXIMA returns: pnz Leon From willisb at unk.edu Thu Mar 22 06:51:55 2012 From: willisb at unk.edu (Barton Willis) Date: Thu, 22 Mar 2012 06:51:55 -0500 Subject: [Maxima] defint1 abs trouble In-Reply-To: References: Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- On Mar. 18, Barton Willis wrote: ----------------------------- >>(%i155) assume(x>0)$ >> >> (%i156) mydefint1(abs(x),x,-1,1); >> (%o156) 0 ------------------------------------- >Thanks for pointing out this further ?problem >with mydefint1, ?an effort to ignore global >assumptions and use local assumptions. Switching mydefint1 to a macro (a ::= function) doesn't fix this (a macro prevents evaluation, but not simplification, of the arguments). By the way: a bug with translation of Maxima macros: (%i1) sally(a) ::= (?print(a),print(a),a)$ Input '(sin(0)) is correctly simplified to 0: (%i2) sally('(sin(0))); ((MQUOTE SIMP) 0) '0 (%o2) 0 Translate macro (%i3) translate(sally)$ Oops--argument isn't simplified (this is a translate bug). (%i4) sally('(sin(0))); ((MQUOTE) ((%SIN) 0)) '(sin(0)) (%o4) 0 The only way I know get (assume(x>0), mydefint1(abs(x),x,-1,1)) --> 1 is to write mydefint1 as a CL defmspec function. I don't know this is possible using the Maxima language. Example of a defmspec function: (defmspec $patsy (x) (setq x (first (margs x))) (print x) ($print x) x) (%i12) patsy(sin(0)); ((%SIN) 0) sin(0) (%o12) 0 --bw From macrakis at alum.mit.edu Thu Mar 22 08:22:31 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 22 Mar 2012 09:22:31 -0400 Subject: [Maxima] sign In-Reply-To: <4f6abeafbb62f4.71602613@wp.pl> References: <4f6abeafbb62f4.71602613@wp.pl> Message-ID: Yes, I'm afraid that sign/asksign aren't very complete. In general, sign/asksign doesn't do any sort of interval arithmetic or zero-finding to determine signs. assume(x>1,x<2); sign(4*x-x^2) => pos <<< determined by factorization sign(4*x-x^2+1) => pnz <<< can't factor, so gives up; interval arith would give (4,8) - (1,2) + 1 = (3,8) We should be able to do better! -s On Thu, Mar 22, 2012 at 01:54, wrote: > > I want to get the result of calculation (simplification) > > assume( x>0, x<%pi/2 ); > sign(cos(x)); > > I expect to get 1, whereas MAXIMA returns: > > pnz > > > Leon > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marik at mendelu.cz Thu Mar 22 09:30:26 2012 From: marik at mendelu.cz (Robert Marik) Date: Thu, 22 Mar 2012 14:30:26 +0000 (UTC) Subject: [Maxima] Bug in changevar. Should I submit the bug report? Message-ID: Dear all, I think that the following computation is a bug in changevar. Trying substitution cos(x)+sin(x)=t in integral of (cos(x)+sin(x))^6*(-sin(x)+cos(x)) I get a mixture of function in t and x variable, see the output of (%o2). The same is in version 5.24. Substutitution in (cos(x)+sin(x))^(1/6)*(-sin(x)+cos(x)) gives t^(1/6), as expected. I was not able to find related bugreport. Should I open new one? Can you confirm that this is a new bug? Thanks. Robert Marik ----------------------------------------------------------- Maxima 5.26.0 http://maxima.sourceforge.net using Lisp SBCL 1.0.50.0.debian Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) display2d:false; (%o1) false (%i2) changevar('integrate(((cos(x)+sin(x)))^(6)* (-sin(x)+cos(x)),x),t=cos(x)+sin(x),t,x); (%o2) 'integrate(sin(x)^6+(6*cos(x)-12*t)*sin(x)^5 +(15*cos(x)^2-60*t*cos(x)+60*t^2)*sin(x)^4 +(20*cos(x)^3-120*t*cos(x)^2+240*t^2*cos(x)-160*t^3) *sin(x)^3 +(15*cos(x)^4-120*t*cos(x)^3+360*t^2*cos(x)^2 -480*t^3*cos(x)+240*t^4) *sin(x)^2 +(6*cos(x)^5-60*t*cos(x)^4+240*t^2*cos(x)^3 -480*t^3*cos(x)^2+480*t^4*cos(x)-192*t^5) *sin(x)+cos(x)^6-12*t*cos(x)^5+60*t^2*cos(x)^4 -160*t^3*cos(x)^3+240*t^4*cos(x)^2-192*t^5*cos(x) +64*t^6,t) (%i3) changevar('integrate(cos(x)^6*sin(x),x),t=cos(x),t,x); solve: using arc-trig functions to get a solution. Some solutions will be lost. (%o3) -'integrate(t^6,t) (%i4) bug_report(); ------------------------------------------------------------- Maxima version: 5.26.0 Maxima build date: 15:14 3/22/2012 Host type: i686-pc-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.50.0.debian ------------------------------------------------------------- The above information is also reported by the function 'build_info'. (%o4) "" From marik at mendelu.cz Thu Mar 22 10:19:50 2012 From: marik at mendelu.cz (Robert Marik) Date: Thu, 22 Mar 2012 15:19:50 +0000 (UTC) Subject: [Maxima] Bug in changevar. Should I submit the bug report? References: Message-ID: Robert Marik mendelu.cz> writes: > > Dear all, > > I think that the following computation is a bug in changevar. Trying > substitution cos(x)+sin(x)=t in integral of > (cos(x)+sin(x))^6*(-sin(x)+cos(x)) > I get a mixture of function in t and x variable, see the output of (%o2). > The same is in version 5.24. Substutitution in > (cos(x)+sin(x))^(1/6)*(-sin(x)+cos(x)) gives t^(1/6), as expected. > Btw, I have the function changevar2 which behaves better in this problem and can be used to handle more substitutions than ordinary changevar. Allows substitutions like sin(x)+cos(x)=t if the integral is in the form "integral of f(phi(x))*phi'(x)*dx". Could be interesting for teachers. Feel free to reuse, comment or improve the code from https://bitbucket.org/robert.marik/maw/changeset/e35563446d06 - it is a first initial version. Examples are at the end of the file. Solves also the problem from http://www.ma.utexas.edu/pipermail/maxima/2007/008486.html Robert Marik From toy.raymond at gmail.com Thu Mar 22 10:58:50 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 22 Mar 2012 08:58:50 -0700 Subject: [Maxima] Bug in changevar. Should I submit the bug report? In-Reply-To: References: Message-ID: On Thu, Mar 22, 2012 at 7:30 AM, Robert Marik wrote: > Dear all, > > I think that the following computation is a bug in changevar. Trying > substitution cos(x)+sin(x)=t in integral of > (cos(x)+sin(x))^6*(-sin(x)+cos(x)) > I get a mixture of function in t and x variable, see the output of (%o2). > This is most likely a failure in solve. I'm pretty sure changevar uses solve to express x in terms of t, and solve(t=cos(x)+sin(x),x) -> [sin(x) = t - cos(x)]. > The same is in version 5.24. Substutitution in > (cos(x)+sin(x))^(1/6)*(-sin(x)+cos(x)) gives t^(1/6), as expected. > I don't follow here, but I guess you really meant cos(x)^(1/6)*sin(x), as your example shows. This works because solve(t=cos(x),x) works. > > I was not able to find related bugreport. Should I open new one? > Yes, that would be very nice if you could. There's really no harm in opening a new bug. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From marik at mendelu.cz Thu Mar 22 13:10:06 2012 From: marik at mendelu.cz (Robert Marik) Date: Thu, 22 Mar 2012 18:10:06 +0000 (UTC) Subject: [Maxima] Bug in changevar. Should I submit the bug report? References: Message-ID: Raymond Toy gmail.com> writes: > This is most likely a failure in solve.? I'm pretty sure changevar uses > solve to express x in terms of t, and > solve(t=cos(x)+sin(x),x) -> [sin(x) = t - cos(x)]. > ? Reported a bug ID: 3510167 https://sourceforge.net/tracker /?func=detail&aid=3510167&group_id=4933&atid=104933 > > I don't follow here, but I guess you really meant cos(x)^(1/6)*sin(x), > as your example shows.? This works because solve(t=cos(x),x) works. > No, it is suficient to change 6 into 1/6 and the computation is correct. I added this computation to the bug report. Thanks. Robert Marik From cloos at jhcloos.com Thu Mar 22 14:58:12 2012 From: cloos at jhcloos.com (James Cloos) Date: Thu, 22 Mar 2012 15:58:12 -0400 Subject: [Maxima] sign In-Reply-To: <4f6abeafbb62f4.71602613@wp.pl> (leon magiera's message of "Thu, 22 Mar 2012 06:54:55 +0100") References: <4f6abeafbb62f4.71602613@wp.pl> Message-ID: >>>>> "lm" == leon magiera writes: lm> I want to get the result of calculation (simplification) lm> assume( x>0, x<%pi/2 ); lm> sign(cos(x)); lm> I expect to get 1, whereas MAXIMA returns: lm> pnz I just hit that today, too. For {-1,0,1} use signum(). Cf: ? sign vs ? signum -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From macrakis at alum.mit.edu Thu Mar 22 15:03:06 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 22 Mar 2012 16:03:06 -0400 Subject: [Maxima] sign In-Reply-To: References: <4f6abeafbb62f4.71602613@wp.pl> Message-ID: Well, sign(x) => pos and signum(x) => 1, but signum(sin(x)) => signum(sin(x)). As I say, Maxima's sign/asksign functionality (which signum depends on) is not very powerful. -s On Thu, Mar 22, 2012 at 15:58, James Cloos wrote: > >>>>> "lm" == leon magiera writes: > > lm> I want to get the result of calculation (simplification) > > lm> assume( x>0, x<%pi/2 ); > lm> sign(cos(x)); > > lm> I expect to get 1, whereas MAXIMA returns: > > lm> pnz > > I just hit that today, too. For {-1,0,1} use signum(). > > Cf: > > ? sign > vs > ? signum > > -JimC > -- > James Cloos OpenPGP: 1024D/ED7DAEA6 > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From volkervannek at googlemail.com Thu Mar 22 16:11:55 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Thu, 22 Mar 2012 22:11:55 +0100 Subject: [Maxima] functions for number theory Message-ID: I would like to commit to src/numth.lisp some new functions: zn_primroot(n): find the smallest generator of (Z/nZ)* zn_primroot_p(x, n): check, if x is a generator of (Z/nZ)* zn_order(x, n): compute the order of x in (Z/nZ)* zn_log(a, g, n): discrete logarithm: solve g^x = a in (Z/nZ)* chinese(rems, mods): chinese remainder theorem where n is not necessarily prime. Most of the function names I have taken from pari/gp. The discrete logarithm is a very time consuming computation and at least with CLISP and GCL it will benefit from being compiled in src. The timing results are not too bad. Compared to pari/gp a little bit slower, but compared to the existing Galois Fields package in share incredibly fast. If there are no objections I will go ahead and also add the according documentation in German and English. In the next months I plan to revise the Galois Fields package. Greetings Volker van Nek -------------- next part -------------- An HTML attachment was scrubbed... URL: From mickle.mouse at gmail.com Thu Mar 22 17:18:32 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Thu, 22 Mar 2012 15:18:32 -0700 Subject: [Maxima] Development of a matrix calculus package Message-ID: Hello everyone, a while back I asked about writing rules for derivatives of matrices. There were many, many rules. But by replacing some fundamental identities (dX/dX --> 4th dimensional object), I think I have found a general approach which appears to rederive about 80% of all the rules. The draw back is I need to be able to replace some fundamental identities in Maxima's default calculus package. If I can just rewrite the fundamental rules, then the rest of calculus applies as normal. I know this is possible since the itensor package does something similar. Way too many details below, but it should help clarify what I mean by replacing Maxima's default fundamental identities: TASK 1: replacing fundamental identities. I was wondering how to make the following rules, using as much of Maxima's underlying functionality as possible. (a) diff( X, X[i][j] ), where X is a general matrix --> J[i][j], the single entry matrix I may prefer the notation X[i,j], but notation is just a side note. (b) diff( X, X[i][j] ), where X is a structured matrix --> Struct[i][j] (c) diff( X, X[i][j] ), where X is a symmetric matrix --> Sym[i][j] expand( Sym[i][j] ) --> delta(i,j) * J[i][i] + (1-delta(i,j) ) * ( J[i][j] + J[j][i] ) (d) diff( f(U(X)), X[i][j] ), where X is a matrix --> trace( transpose( diff( f(U), U ) ) . diff(U, X[i][j] ) ) (e) diff( g(X) . f(X) , X[i][j] ), where X is a matrix --> diff( g(X), X[i][j] ) . f(X) + g(X) . diff( f(X), X[i][j] ) For instance, (a) and (e) ought to be able to process: diff( X^3, X[i][j] ) --> diff( X.(X.X), X[i][j] ) --> J[i][j] . (X . X) + X . diff( X . X, X[i][j]) --> J[i][j] . X . X + X . J[i][j] . X + X . X . J[i][j] (f) diff( v, v[i] ), where v is a general vector --> e[i] (g) diff( transpose(f(X)), X[i][j] ) --> transpose( diff( f(X), X[i][j] ) ) (h) diff( exp( X . t ), t), where X is a matrix, t is scalar --> X . exp(X . t) == exp(X . t) . X The output matrices commute, and Maxima knows this! (i) diff( trace( X ), X[i][j] ) --> I[i][j] Which reduces to the identity matrix when indices are removed (j) diff( trace( F(X) ), X ), where X is a general matrix --> transpose( f(X) ) Where f(.) is the scalar derivative of F(.). And several other fundamental rules like these. I wish to include Hadamard and Kronecker products as well. I would appreciate help with extensions of these rules for symmetric, hermitian, diagonal, toeplitz, etc. --- TASK2: Attempting to remove indices (2a) diff( transpose( v ) . X . v, v ) --> contractIndices( diff( transpose( v ) . X . v, v[i] ), [i] ) --> contractIndices( transpose(e[i]) . X . v + transpose( v ) . X . e[i], i ) --> (X + transpose(X)) . v (2b) diff( trace(X . X), X ) --> contractIndices( diff( trace(X . X), X[i][j] ), [i,j] ) --> we use the scalar derivative contractIndices( transpose( 1 * X[i][j] + X[i][j] * 1 ), [i,j] ) --> 2 transpose( X ) I don't know a good general procedure for index removal, but I would appreciate anyone willing to help with the contract indices method. Thanks in advance for any help/pointers. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Thu Mar 22 17:32:16 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 22 Mar 2012 15:32:16 -0700 Subject: [Maxima] Development of a matrix calculus package In-Reply-To: References: Message-ID: <4F6BA870.7020203@eecs.berkeley.edu> I suggest you start out by not using the command "diff". Later, if it appears that everything you need can be put on top of diff without changing its behavior in the previous cases, then they can be joined. From mickle.mouse at gmail.com Thu Mar 22 17:59:07 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Thu, 22 Mar 2012 15:59:07 -0700 Subject: [Maxima] Development of a matrix calculus package In-Reply-To: <4F6BA870.7020203@eecs.berkeley.edu> References: <4F6BA870.7020203@eecs.berkeley.edu> Message-ID: Thanks for the advice, but will other rules, outside of the ``diff'' command, be applied intelligently/recursively? For example will rules (a) and (e) combine to process: diff( X^3, X[i][j] ) --> diff( X.(X.X), X[i][j] ) --> J[i][j] . (X . X) + X . diff( X . X, X[i][j]) --> J[i][j] . X . X + X . J[i][j] . X + X . X . J[i][j] ? How is the ``diff'' command coded? Would you recommend I copy and modify it? On Thu, Mar 22, 2012 at 3:32 PM, Richard Fateman wrote: > I suggest you start out by not using the command "diff". > Later, if it appears that everything you need can be put on top of diff > without changing its > behavior in the previous cases, then they can be joined. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Thu Mar 22 18:47:05 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 22 Mar 2012 16:47:05 -0700 Subject: [Maxima] Development of a matrix calculus package In-Reply-To: References: <4F6BA870.7020203@eecs.berkeley.edu> Message-ID: <4F6BB9F9.9050506@eecs.berkeley.edu> On 3/22/2012 3:59 PM, Mike Valenzuela wrote: > Thanks for the advice, > > but will other rules, outside of the ``diff'' command, be applied > intelligently/recursively? For example will rules (a) and (e) combine > to process: > diff( X^3, X[i][j] ) --> > diff( X.(X.X), X[i][j] ) --> > J[i][j] . (X . X) + X . diff( X . X, X[i][j]) --> > J[i][j] . X . X + X . J[i][j] . X + X . X . J[i][j] ? > > How is the ``diff'' command coded? Would you recommend I copy and > modify it? > > On Thu, Mar 22, 2012 at 3:32 PM, Richard Fateman > > wrote: > > I suggest you start out by not using the command "diff". > Later, if it appears that everything you need can be put on top of > diff without changing its > behavior in the previous cases, then they can be joined. > > I haven't looked at the details of your rules. The diff command is not so neat because, among other things it has a variable number of arguments. e.g. diff(f(x),x) diff(f(x),x,3) diff(f(x),x,3,y,4) etc. Also it probably takes shortcuts like diff(f,x) is 0 if f is free of x. So copying it and modifying it would probably not be easy. In terms of defining your own separate program, you can declare that operators are linear. Also the simplification of dot products is independent of diff. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vttoth at vttoth.com Thu Mar 22 22:00:50 2012 From: vttoth at vttoth.com (Viktor T. Toth) Date: Thu, 22 Mar 2012 23:00:50 -0400 Subject: [Maxima] Development of a matrix calculus package In-Reply-To: References: Message-ID: <006101cd08a1$2aa33bb0$7fe9b310$@vttoth.com> I am not sure whether or not it addresses your needs, but have you looked at the tensor calculus capabilities that are already in the itensor package? In particular, look at the einhil demo, which shows how itensor can be used to derive the Einstein field equations from the Einstein-Hilbert Lagrangian. (The functionality is not limited to general relativity though.) Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Mike Valenzuela Sent: Thursday, March 22, 2012 6:19 PM To: maxima Subject: [Maxima] Development of a matrix calculus package Hello everyone, a while back I asked about writing rules for derivatives of matrices. There were many, many rules. But by replacing some fundamental identities (dX/dX --> 4th dimensional object), I think I have found a general approach which appears to rederive about 80% of all the rules. The draw back is I need to be able to replace some fundamental identities in Maxima's default calculus package. If I can just rewrite the fundamental rules, then the rest of calculus applies as normal. I know this is possible since the itensor package does something similar. Way too many details below, but it should help clarify what I mean by replacing Maxima's default fundamental identities: TASK 1: replacing fundamental identities. I was wondering how to make the following rules, using as much of Maxima's underlying functionality as possible. (a) diff( X, X[i][j] ), where X is a general matrix --> J[i][j], the single entry matrix I may prefer the notation X[i,j], but notation is just a side note. (b) diff( X, X[i][j] ), where X is a structured matrix --> Struct[i][j] (c) diff( X, X[i][j] ), where X is a symmetric matrix --> Sym[i][j] expand( Sym[i][j] ) --> delta(i,j) * J[i][i] + (1-delta(i,j) ) * ( J[i][j] + J[j][i] ) (d) diff( f(U(X)), X[i][j] ), where X is a matrix --> trace( transpose( diff( f(U), U ) ) . diff(U, X[i][j] ) ) (e) diff( g(X) . f(X) , X[i][j] ), where X is a matrix --> diff( g(X), X[i][j] ) . f(X) + g(X) . diff( f(X), X[i][j] ) For instance, (a) and (e) ought to be able to process: diff( X^3, X[i][j] ) --> diff( X.(X.X), X[i][j] ) --> J[i][j] . (X . X) + X . diff( X . X, X[i][j]) --> J[i][j] . X . X + X . J[i][j] . X + X . X . J[i][j] (f) diff( v, v[i] ), where v is a general vector --> e[i] (g) diff( transpose(f(X)), X[i][j] ) --> transpose( diff( f(X), X[i][j] ) ) (h) diff( exp( X . t ), t), where X is a matrix, t is scalar --> X . exp(X . t) == exp(X . t) . X The output matrices commute, and Maxima knows this! (i) diff( trace( X ), X[i][j] ) --> I[i][j] Which reduces to the identity matrix when indices are removed (j) diff( trace( F(X) ), X ), where X is a general matrix --> transpose( f(X) ) Where f(.) is the scalar derivative of F(.). And several other fundamental rules like these. I wish to include Hadamard and Kronecker products as well. I would appreciate help with extensions of these rules for symmetric, hermitian, diagonal, toeplitz, etc. --- TASK2: Attempting to remove indices (2a) diff( transpose( v ) . X . v, v ) --> contractIndices( diff( transpose( v ) . X . v, v[i] ), [i] ) --> contractIndices( transpose(e[i]) . X . v + transpose( v ) . X . e[i], i ) --> (X + transpose(X)) . v (2b) diff( trace(X . X), X ) --> contractIndices( diff( trace(X . X), X[i][j] ), [i,j] ) --> we use the scalar derivative contractIndices( transpose( 1 * X[i][j] + X[i][j] * 1 ), [i,j] ) --> 2 transpose( X ) I don't know a good general procedure for index removal, but I would appreciate anyone willing to help with the contract indices method. Thanks in advance for any help/pointers. From mickle.mouse at gmail.com Thu Mar 22 22:49:54 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Thu, 22 Mar 2012 20:49:54 -0700 Subject: [Maxima] Development of a matrix calculus package In-Reply-To: <006101cd08a1$2aa33bb0$7fe9b310$@vttoth.com> References: <006101cd08a1$2aa33bb0$7fe9b310$@vttoth.com> Message-ID: Thank you, I'll take a look. I've used the itensor package in the past, but it seemed quite limited as far multiplicative inverses, transposes, and it appears to assume everything is a general tensor. But maybe that demo will show more than I've come to expect of the itensor package. On Thu, Mar 22, 2012 at 8:00 PM, Viktor T. Toth wrote: > I am not sure whether or not it addresses your needs, but have you looked > at > the tensor calculus capabilities that are already in the itensor package? > In > particular, look at the einhil demo, which shows how itensor can be used to > derive the Einstein field equations from the Einstein-Hilbert Lagrangian. > (The functionality is not limited to general relativity though.) > > > Viktor > > > > > -----Original Message----- > From: maxima-bounces at math.utexas.edu [mailto: > maxima-bounces at math.utexas.edu] > On Behalf Of Mike Valenzuela > Sent: Thursday, March 22, 2012 6:19 PM > To: maxima > Subject: [Maxima] Development of a matrix calculus package > > Hello everyone, > > a while back I asked about writing rules for derivatives of matrices. There > were many, many rules. But by replacing some fundamental identities (dX/dX > --> 4th dimensional object), I think I have found a general approach which > appears to rederive about 80% of all the rules. The draw back is I need to > be able to replace some fundamental identities in Maxima's default calculus > package. If I can just rewrite the fundamental rules, then the rest of > calculus applies as normal. I know this is possible since the itensor > package does something similar. > > Way too many details below, but it should help clarify what I mean by > replacing Maxima's default fundamental identities: > TASK 1: replacing fundamental identities. I was wondering how to make the > following rules, using as much of Maxima's underlying functionality as > possible. > > (a) diff( X, X[i][j] ), where X is a general matrix --> J[i][j], the single > entry matrix > I may prefer the notation X[i,j], but notation is just a side note. > > (b) diff( X, X[i][j] ), where X is a structured matrix --> Struct[i][j] > > (c) diff( X, X[i][j] ), where X is a symmetric matrix --> Sym[i][j] > expand( Sym[i][j] ) --> delta(i,j) * J[i][i] + (1-delta(i,j) ) * ( J[i][j] > + > J[j][i] ) > > (d) diff( f(U(X)), X[i][j] ), where X is a matrix --> trace( transpose( > diff( f(U), U ) ) . diff(U, X[i][j] ) ) > > (e) diff( g(X) . f(X) , X[i][j] ), where X is a matrix --> diff( g(X), > X[i][j] ) . f(X) + g(X) . diff( f(X), X[i][j] ) > For instance, (a) and (e) ought to be able to process: > diff( X^3, X[i][j] ) --> diff( X.(X.X), X[i][j] ) --> J[i][j] . (X . X) + X > . diff( X . X, X[i][j]) --> J[i][j] . X . X + X . J[i][j] . X + X . X . > J[i][j] > > (f) diff( v, v[i] ), where v is a general vector --> e[i] > > (g) diff( transpose(f(X)), X[i][j] ) --> transpose( diff( f(X), X[i][j] ) ) > > (h) diff( exp( X . t ), t), where X is a matrix, t is scalar --> X . exp(X > . > t) == exp(X . t) . X > The output matrices commute, and Maxima knows this! > > (i) diff( trace( X ), X[i][j] ) --> I[i][j] > Which reduces to the identity matrix when indices are removed > > (j) diff( trace( F(X) ), X ), where X is a general matrix --> transpose( > f(X) ) > Where f(.) is the scalar derivative of F(.). > > And several other fundamental rules like these. I wish to include Hadamard > and Kronecker products as well. I would appreciate help with extensions of > these rules for symmetric, hermitian, diagonal, toeplitz, etc. > > --- > TASK2: Attempting to remove indices > > (2a) diff( transpose( v ) . X . v, v ) --> contractIndices( diff( > transpose( v ) . X . v, v[i] ), [i] ) --> > contractIndices( transpose(e[i]) . X . v + transpose( v ) . X . e[i], i ) > --> > (X + transpose(X)) . v > > (2b) diff( trace(X . X), X ) --> contractIndices( diff( trace(X . X), > X[i][j] ), [i,j] ) --> we use the scalar derivative > contractIndices( transpose( 1 * X[i][j] + X[i][j] * 1 ), [i,j] ) --> > 2 transpose( X ) > > I don't know a good general procedure for index removal, but I would > appreciate anyone willing to help with the contract indices method. > > Thanks in advance for any help/pointers. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marik at mendelu.cz Fri Mar 23 05:19:16 2012 From: marik at mendelu.cz (Robert Marik) Date: Fri, 23 Mar 2012 10:19:16 +0000 (UTC) Subject: [Maxima] Bug in changevar. Should I submit the bug report? References: Message-ID: Robert Marik mendelu.cz> writes: > > Raymond Toy gmail.com> writes: > > I don't follow here, but I guess you really meant cos(x)^(1/6)*sin(x), > > as your example shows.? This works because solve(t=cos(x),x) works. > > Oops, sorry, Raymond is right. This was my mistake. I checked it again and changevar sin(x)+cos(x)=t for (sin(x)+cos(x))^(1/6)*(cos(x)-sin(x)) returns the same integral. R.M. From akhorshidi at live.com Sat Mar 17 22:11:09 2012 From: akhorshidi at live.com (A. Khorshidi) Date: Sun, 18 Mar 2012 03:11:09 +0000 (UTC) Subject: [Maxima] maxima & a wrong limit at infinity Message-ID: Hello, When I solve the following limit at infinity by Maxima ,the output is infinity(-inf). limit((2*sqrt((x/2+1)^2-(cos(29*%pi/360)*x/2)^2) -x*sin(29*%pi/360))/ (%pi*cos(29*%pi/360)),x,inf); To solve this limit, we?ll need the conjugate multiplication technique. I multiplying the numerator and denominator by the conjugate of the numerator and after simplification: limit((4*x+4)/(%pi*cos(29*%pi/360)* (2*sqrt(x^2/4+x+1-x^2/4*cos(29*%pi/360)^2) +x*sin(29*%pi/360))), x, inf); Now, the output is correct. (=2.62) Why the answer of the first limit was " infinity "? Why Maxima could not solve this limit correctly? Thank you in advance. From matamatyk at wp.pl Sun Mar 18 15:58:40 2012 From: matamatyk at wp.pl (piotr) Date: Sun, 18 Mar 2012 20:58:40 +0000 (UTC) Subject: [Maxima] =?utf-8?q?Extending_assignment_Was=3A_Functions_with_any?= =?utf-8?q?_number_of=09arguments?= References: Message-ID: Robert Dodier gmail.com> writes: > > On 1/19/12, Alexander Klimov inbox.ru> wrote: > > > On Sun, 15 Jan 2012, Aleksas Domarkas wrote: > >> How in Maxima define functions with any number of arguments ? > >> > >> For example, i need function MIN(arg1,arg2, ...) > >> MIN(2) => 2 > >> MIN(3,4) =>3 > >> MIN(2/3,1/2,sqrt(2)/2) => 1/2 > > > > MIN([args]) := block([m:first(args)], > > for i in rest(args) do m:min(m,i), > > m); > > >> Other example. How define G with following properties: > >> G(n) => gamma(n) > >> G(5) => 24 > >> G(a, x) => gamma_incomplete (a, x) > >> G(a, z1, z2) => gamma_incomplete_generalized (a, z1, z2) > > For functions with arbitrary numbers of arguments, try sth like this: how_many_args(X):=( is_end:0, arr_if:make_array(any,1), arr_if[0]:x[1]=1.1, for i:1 while is_end=0 do ( S:subst(listarray(arr_if),X), if numberp(S) then (is_end:1,last:i), arr_if:rearray(arr_if,i), arr_if[i]:x[i+1]=1.1 ), arr_xx :make_array(any,last), for i:1 thru last do arr_xx[i-1]:x[i], [last,listarray(arr_xx)] ); It works for function of arguments x[1], x[2], ... for example how_many_args(x[1]*x[2]+x[3]+sin(x[4])) => [4,[x[1],x[2],x[3],x[4]]] how_many_args(x[1]+x[21]/x[23]+x[3]+sin(x[4])) => [23,[x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10], x[11],x[12],x[13],x[14],x[15],x[16],x[17],x[18],x[19],x[20] ,x[21],x[22],x[23]]] it is not nice but it works. Be carefull if you put 0 insteed 1.1 in last example uou do [21,[x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11] ,x[12],x[13],x[14],x[15],x[16],x[17],x[18],x[19],x[20],x[21]]] because 0*x[23]=0. best Piotr From rswarbrick at gmail.com Fri Mar 23 09:09:57 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 23 Mar 2012 14:09:57 +0000 Subject: [Maxima] Moderation Message-ID: Hi guys, I'm one of the people that moderates the mailing list. Using listping[1] and listadmin, this is pretty swift and painless, but I think it might be good if one or two others got involved. I was away in Italy for most of the week and the queue grew 5 days long... I'm not sure who should appoint a volunteer/victim: Robert? Rupert [1] https://github.com/rswarbrick/listping -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From willisb at unk.edu Fri Mar 23 09:26:31 2012 From: willisb at unk.edu (Barton Willis) Date: Fri, 23 Mar 2012 09:26:31 -0500 Subject: [Maxima] Extending assignment Was: Functions with any number of arguments In-Reply-To: References: , Message-ID: The function listofvars might be useful. To view the user documentation for this function, enter ? listofvars. Also, the option variable listdummyvars might be important to you as well. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- For functions with arbitrary numbers of arguments, try sth like this: how_many_args(X):=( is_end:0, arr_if:make_array(any,1), arr_if[0]:x[1]=1.1, for i:1 while is_end=0 do ( ?? ?S:subst(listarray(arr_if),X), ... ? From aleksasd873 at gmail.com Fri Mar 23 12:30:37 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Fri, 23 Mar 2012 19:30:37 +0200 Subject: [Maxima] Bug in changevar. Should I submit the bug report? Message-ID: On 3/22/12, Robert Marik marik at mendelu.cz wrote: Dear all, I think that the following computation is a bug in changevar. Trying substitution cos(x)+sin(x)=t in integral of (cos(x)+sin(x))^6*(-sin(x)+cos(x)) I get a mixture of function in t and x variable, see the output of (%o2). The same is in version 5.24. Substutitution in (cos(x)+sin(x))^(1/6)*(-sin(x)+cos(x)) gives t^(1/6), as expected. I was not able to find related bugreport. Should I open new one? Can you confirm that this is a new bug? Thanks. Robert Marik ----------------------------------------------------------- Maxima 5.26.0 http://maxima.sourceforge.net using Lisp SBCL 1.0.50.0.debian Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) display2d:false; (%o1) false (%i2) changevar('integrate(((cos(x)+sin(x)))^(6)* (-sin(x)+cos(x)),x),t=cos(x)+sin(x),t,x); (%o2) 'integrate(sin(x)^6+(6*cos(x)-12*t)*sin(x)^5 +(15*cos(x)^2-60*t*cos(x)+60*t^2)*sin(x)^4 +(20*cos(x)^3-120*t*cos(x)^2+240*t^2*cos(x)-160*t^3) *sin(x)^3 +(15*cos(x)^4-120*t*cos(x)^3+360*t^2*cos(x)^2 -480*t^3*cos(x)+240*t^4) *sin(x)^2 +(6*cos(x)^5-60*t*cos(x)^4+240*t^2*cos(x)^3 -480*t^3*cos(x)^2+480*t^4*cos(x)-192*t^5) *sin(x)+cos(x)^6-12*t*cos(x)^5+60*t^2*cos(x)^4 -160*t^3*cos(x)^3+240*t^4*cos(x)^2-192*t^5*cos(x) +64*t^6,t) *********************************************************************************** One solution of this bug is (%i1) changevar1(S,tr,t,x):=block( factor(first(S)/diff(rhs(tr),x)), ratsubst (t,rhs(tr),%%), if member(x,listofvars(%%)) then changevar(S,tr,t,x) else 'integrate(%%,t))$ Test examples: (%i2) changevar1('integrate(sqrt(x+sin(x))*(1+cos(x)),x),t=x+sin(x),t,x); changevar1('integrate(sqrt(x+sin(x))*(1+cos(x)),x),t=x+sin(x),t,x); changevar1('integrate(sqrt(sin(x))*(cos(x)),x),t=sin(x),t,x); changevar1('integrate((2+sin(x+log(x)))*(1+1/x),x),t=x+log(x),t,x); changevar1('integrate((2+exp(x+log(x)))*(1+1/x),x),t=2+exp(x+log(x)),t,x); changevar1('integrate((2+exp(x+sin(x)))*(1+cos(x)),x),t=x+sin(x),t,x); changevar1('integrate(sqrt((cos(x)+sin(x)))*(sin(x)-cos(x)),x),t=cos(x)+sin(x),t,x); changevar1('integrate(((cos(x)+sin(x)))^(1/6)*(-sin(x)+cos(x)),x),t=cos(x)+sin(x),t,x); changevar1('integrate((log(x)+1)*sqrt(1+(x*log(x))^2),x),u=x*log(x),u,x); changevar1('integrate((x*cos(x)+sin(x))/(x*sin(x))^2,x),y=x*sin(x),y,x); changevar1('integrate((x^2+1)/(x^4+1),x),y=x-1/x,y,x); changevar1('integrate(exp(sqrt(x))/sqrt(x),x),t=sqrt(x),t,x); changevar1('integrate(sqrt(1+sqrt(x+1)),x),t=1+sqrt(x+1),t,x); changevar1('integrate((x+1)/(x+exp(-x)),x),t=x*exp(x)+1,t,x); (%o2) integrate(sqrt(t),t) (%o3) integrate(sqrt(t),t) (%o4) integrate(sqrt(t),t) (%o5) integrate(sin(t)+2,t) (%o6) integrate(t/(t-2),t) (%o7) integrate(%e^t+2,t) (%o8) -integrate(sqrt(t),t) (%o9) integrate(t^(1/6),t) (%o10) integrate(sqrt(u^2+1),u) (%o11) integrate(1/y^2,y) (%o12) integrate(1/(y^2+2),y) (%o13) 2*integrate(%e^t,t) (%o14) integrate(2*t^(3/2)-2*sqrt(t),t) (%o15) integrate(1/t,t) Please send comments. Thank you in advance. Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Mar 24 11:07:55 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 24 Mar 2012 10:07:55 -0600 Subject: [Maxima] Moderation In-Reply-To: References: Message-ID: On 3/23/12, Rupert Swarbrick wrote: > I'm one of the people that moderates the mailing list. Using listping[1] > and listadmin, this is pretty swift and painless, but I think it might > be good if one or two others got involved. I was away in Italy for most > of the week and the queue grew 5 days long... Well, the thing about moderating the mailing list is that all moderators see the same queue, which is usually empty, and therefore most of them conclude they don't need to do anything. Is there any way to set a up a round-robin-like system which allocates a fraction of the messages to each moderator? I don't know, I;m just guessing. If anyone has some ideas, I'd be glad to hear about it. > I'm not sure who should appoint a volunteer/victim: Robert? I think the mailing list moderators (there are about 5 or so) have the ability to appoint other another moderator. Failing that, maybe maybe the project administrators (again, there are several) can take some appropriate action. As far as I'm concerned, anybody who sees something that needs to be done, should go ahead and do it. That seems more effective than trying to identify the "right" person. best Robert Dodier From rswarbrick at gmail.com Sat Mar 24 11:16:12 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sat, 24 Mar 2012 16:16:12 +0000 Subject: [Maxima] Moderation In-Reply-To: (Robert Dodier's message of "Sat, 24 Mar 2012 10:07:55 -0600") References: Message-ID: <87ehsirn3n.fsf@hake.rswarbrick.dnsalias.com> Robert Dodier writes: > On 3/23/12, Rupert Swarbrick wrote: >> I'm one of the people that moderates the mailing list. Using listping[1] >> and listadmin, this is pretty swift and painless, but I think it might >> be good if one or two others got involved. I was away in Italy for most >> of the week and the queue grew 5 days long... > > Well, the thing about moderating the mailing list is that > all moderators see the same queue, which is usually empty, > and therefore most of them conclude they don't need to do > anything. Is there any way to set a up a round-robin-like system > which allocates a fraction of the messages to each moderator? > I don't know, I;m just guessing. If anyone has some ideas, I'd > be glad to hear about it. Hmm. Not sure what the best solution is here. Mailman has an option where you can spam all the "list owners" whenever there's a message to be moderated, but since most messages are junk and there are ~3-4 a day, this seems like a bad idea. I wrote the listping thingy I mentioned earlier to deal with basically this problem on a university society mailing list that I helped out with. It has the advantage of notifying the person running it when there's mail to check. However, it only works with linux (and Gtk/Glib etc), so I don't know how useful it is to others. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From marik at mendelu.cz Sat Mar 24 15:53:48 2012 From: marik at mendelu.cz (Robert Marik) Date: Sat, 24 Mar 2012 20:53:48 +0000 (UTC) Subject: [Maxima] Bug in changevar. Should I submit the bug report? References: Message-ID: Helo, thanks for the suggestion. changevar can be used to substitute 2* x=t in 1/2*'integrate(exp(2*x),x) but changevar1 fails with the following error (%i4) changevar(('integrate(exp(2*x),x))/2,2*x = t,t,x) (%o4) ('integrate(%e^t,t))/4 (%i5) changevar1(('integrate(exp(2*x),x))/2,2*x = t,t,x) expt: undefined: 0 to a negative exponent. #0: changevar1(s=('integrate(%e^(2*x),x))/2,tr=2*x = t,t=t,x=x)(a.mac line 1) -- an error. To debug this try: debugmode(true); Robert Marik Aleksas Domarkas gmail.com> writes: From aleksasd873 at gmail.com Sun Mar 25 03:28:22 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Sun, 25 Mar 2012 11:28:22 +0300 Subject: [Maxima] Bug in changevar. Should I submit the bug report? Message-ID: Robert Marik marik at mendelu.cz writes: Helo, thanks for the suggestion. changevar can be used to substitute 2* x=t in 1/2*'integrate(exp(2*x),x) but changevar1 fails with the following error (%i4) changevar(('integrate(exp(2*x),x))/2,2*x = t,t,x) (%o4) ('integrate(%e^t,t))/4 (%i5) changevar1(('integrate(exp(2*x),x))/2,2*x = t,t,x) expt: undefined: 0 to a negative exponent. #0: changevar1(s=('integrate(%e^(2*x),x))/2,tr=2*x = t,t=t,x=x)(a.mac line 1) -- an error. To debug this try: debugmode(true); Robert Marik ************************************************************************** In changevar1 the second argument must be transformation in form t=phi(x) Updated version of changevar1 with error message: (%i1) changevar1(S,tr,t,x):=block( if is(first(tr)#t or op(tr)#"=") then error("the second argument must be transformation in form t=phi(x)"), factor(first(S)/diff(rhs(tr),x)), ratsubst (t,rhs(tr),%%), if member(x,listofvars(%%)) then changevar(S,tr,t,x) else 'integrate(%%,t))$ old version of changevar1 see in http://www.math.utexas.edu/pipermail/maxima/2012/028202.html Help for changevar1 changevar1 perform a change of variables in an indefinite integral Calling Sequence: changevar1(S,tr,t,x) Arguments: S - indefinite integral tr - transformation in form t=phi(x) t - new variable x - old variable Examples: (%i2) changevar1(('integrate(exp(2*x),x))/2, t=2*x,t,x); (%o2) integrate(%e^t,t)/4 (%i3) changevar1(('integrate(exp(2*x),x))/2, u=2*x,u,x); (%o3) integrate(%e^u,u)/4 (%i4) changevar1(('integrate(exp(2*x),x))/2, 2*x=t,t,x); the second argument must be transformation in form t=phi(x) #0: changevar1(s=('integrate(%e^(2*x),x))/2,tr=2*x = t,t=t,x=x) -- an error. To debug this try: debugmode(true); (%i5) changevar1('integrate((2+sin(x+log(x)))*(1+1/x),x),t=x+log(x),t,x); (%o5) integrate(sin(t)+2,t) (%i6) changevar1('integrate((x*cos(x)+sin(x))/(x*sin(x))^2,x),y=x*sin(x),y,x); (%o6) integrate(1/y^2,y) (%i7) changevar1('integrate((log(x)+1)*sqrt(1+(x*log(x))^2),x),u=x*log(x),u,x); (%o7) integrate(sqrt(u^2+1),u) (%i8) changevar1('integrate((x+1)/(x+exp(-x)),x),t=x*exp(x)+1,t,x); (%o8) integrate(1/t,t) Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Sun Mar 25 17:14:20 2012 From: woollett at charter.net (Edwin Woollett) Date: Sun, 25 Mar 2012 15:14:20 -0700 Subject: [Maxima] overflow and underflow function returns Message-ID: <4114F66AF9514E9FAC49E6BCF8AF67F5@edwinc367e16bd> When designing possible overflow detection prior to calling quadpack in a wrapper package, I have the problem that bessel functions don't have the same overflow return as core math functions like exp. ------------------------------------ (%i1) float(exp(700)); (%o1) 1.0142320547350045E+304 (%i2) float(exp(800)); (%o2) 1..#INF00e+000E+2289560 (%i3) float(bessel_j(1,%i*700)); (%o3) 1.5285003902339006E+302 %i (%i4) float(bessel_j(1,%i*800)); zbesj ierr = 2 (%o4) 0.0 -------------------------------------------------- I can try trapping normal function overflow by looking for the typical 1..#INF start of the return result, but if I look at bessel function overflow having 0.0 return, this won't work for *underflow* returns from exp (for example) which normally can be ignored. -------------------------------- (%i5) float(exp(-700)); (%o5) 9.8596765437597708E-305 (%i6) float(exp(-800)); (%o6) 0.0 -------------------------------------------------- My problem is that overflow checks need to work for an arbitrary integrand, with or without bessel functions. Ted Woollett From willisb at unk.edu Mon Mar 26 06:13:06 2012 From: willisb at unk.edu (Barton Willis) Date: Mon, 26 Mar 2012 06:13:06 -0500 Subject: [Maxima] overflow and underflow function returns In-Reply-To: <4114F66AF9514E9FAC49E6BCF8AF67F5@edwinc367e16bd> References: <4114F66AF9514E9FAC49E6BCF8AF67F5@edwinc367e16bd> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >When designing possible overflow detection >prior to calling quadpack in a wrapper package, >I have the problem that bessel functions don't >have the same overflow return as core math >functions like exp. What happens with floating point overflow depends on the version of CL used to compile Maxima. Example: with Clozure CL (%i1) exp(800.0); Maxima encountered a Lisp error: FLOATING-POINT-OVERFLOW detected Every Lisp error reported by Maxima is at least a venial bug (I think). Likely, making floating point overflow work the same with all CLs would require a great deal work: $ wx86cl64 Welcome to Clozure Common Lisp Version 1.7-r14925M (WindowsX8664)! ? (ignore-errors (exp 800.0)) NIL # ? But GCL gives (%i52) :lisp(exp 800.0) #<1.#INF00e+000> --Barton From vhfhermans at gmail.com Tue Mar 27 01:00:02 2012 From: vhfhermans at gmail.com (Victor Hermans) Date: Tue, 27 Mar 2012 08:00:02 +0200 Subject: [Maxima] Phantastic Program! One bug Message-ID: Dear Friends! Thank you very much for this great program. I have a sabbatical at Riga Technical University and they did not have any Computer Algebra System. So I asked all my students to download Maxima. However, there is one bug. The net present value does not seem to work very well. This gives 2 different solutions load("finance")$ npv(0.03,[-1000,0,0,0,1200]); -1000+1200/(1.03)^4; I included the calculation in the attachment. If there is anything I can do for you, please tell me. I am not much of a mathematician, though. I am an economist. Bye, -- Victor Hermans Bartoklaan 14 2253 CX - Voorschoten Netherlands tel. 00-31-715613589 mob. 00-31- (0)6-24345774 -------------- next part -------------- A non-text attachment was scrubbed... Name: FinanceTricksBugs.wxm Type: application/octet-stream Size: 793 bytes Desc: not available URL: From villate at fe.up.pt Tue Mar 27 03:55:52 2012 From: villate at fe.up.pt (Jaime Villate) Date: Tue, 27 Mar 2012 09:55:52 +0100 Subject: [Maxima] Phantastic Program! One bug In-Reply-To: References: Message-ID: <4F718098.50402@fe.up.pt> On 03/27/2012 07:00 AM, Victor Hermans wrote: > Dear Friends! > Thank you very much for this great program. Hi, Welcome to this list. I'm glad to hear you find Maxima useful. > I have a sabbatical at Riga Technical University and they did not have > any Computer Algebra System. > So I asked all my students to download Maxima. > However, there is one bug. The net present value does not seem to work > very well. > This gives 2 different solutions > > load("finance")$ > > npv(0.03,[-1000,0,0,0,1200]); > > -1000+1200/(1.03)^4; Thank you for telling us about that bug. The program "finance" is one of the "contributed package", which means that has been contributed by a user and it might not been checked by other developers. In this case, the calculation is wrongly being done as -1000/1.03 + 1200/1.03^5. This will be fixed in the next release of Maxima, but for the time being you can solve the problem by using the version that I'm sending in the attachment. Please start Maxima and type the command: maxima_userdir; this will tell you the directory that is being used as your user directory. You will have to copy the "finance.mac" file in the attachment into that directory. If you then do: load ("finance"); It should show you that it is loading the file in the directory referred above, and not the original file in share/contrib which has the bug. The package finance might have some other bugs. I will examine it carefully in the next few days and if I find any other bugs I will let you know. Best regards, Jaime -------------- next part -------------- /* COPYRIGHT NOTICE Copyright (C) 2008 Nicolas Guarin Zapata This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org/copyleft/gpl.html */ /* **************************************************** * FINANCE PACKAGE V.0.1 * **************************************************** *This is the Finance Package. * *Actually, there are only basic functions, we hope * *you could improve the package with brand new lines* **************************************************** *In all the functions rate is the compound interest* *rate, num is the number of periods and must be * *postivive & "flow" refers to cash flow so if you * *have and Output the flow is negative & positive * *for Inputs. * **************************************************** */ load(draw)$ /* Returns the amortization table determinated by rate, Ammount, and number of periods. */ amortization(rate,Ammount,num):= block([result,A,payment,k,a], if num<0 then error("num must be a positive value") else A:genmatrix(a, num+2, 5), payment:Ammount*rate*((1+rate)^(num)/((1+rate)^num-1)), A[1]:["n", "Balance", "Interest", "Amortization","Payment"], A[2]:[0,0,0,0,0], A[2,2]:Ammount, for k:3 thru num+2 step 1 do ( A[k,5]:payment, A[k,1]:k-2, A[k,3]:A[k-1,2]*rate, A[k,4]:A[k,5]-A[k,3], A[k,2]:A[k-1,2]-A[k,4] ), printf(true," "), printf(true,"~7s~14s~13s~16s~14s ~% ~{ ~{ ~12,3f ~} ~% ~}", A[1,1],A[1,2],A[1,3],A[1,4],A[1,5], args(submatrix(1,A))) )$ /* Returns the annuity knowing the desired value (future value), it is a constant and periodic payment. */ annuity_fv(rate,FV,num):=FV*rate/((1+rate)^num-1)$ /* Returns the annuity knowing the present value (like an ammount), it is a constant and periodic payment. */ annuity_pv(rate,PV,num):=PV*rate*((1+rate)^(num)/((1+rate)^num-1))$ /* Returns the amortization table determinated by rate, Ammount, and number of periods. The payment is not constant, it presents an arithmetic growing, increment is then the difference between two consecutive rows in the "Payment" column. */ arit_amortization(rate,increment,Ammount,num):= block([result,A,payment,k,a], if num<0 then error("num must be a positive value") else A:genmatrix(a, num+2, 5), payment:(rate^2*(rate+1)^num*Ammount+(rate*num-(1+rate)^num+1)*increment)/(rate*(rate+1)^num-rate), A[1]:["n", "Balance", "Interest", "Amortization","Payment"], A[2]:[0,0,0,0,0], A[2,2]:Ammount, A[3,5]:payment, for k:4 thru num+2 step 1 do (A[k,5]:A[k-1,5]+increment), for k:3 thru num+2 step 1 do ( A[k,1]:k-2, A[k,3]:A[k-1,2]*rate, A[k,4]:A[k,5]-A[k,3], A[k,2]:A[k-1,2]-A[k,4] ), printf(true," "), printf(true,"~7s~14s~13s~16s~14s ~% ~{ ~{ ~12,3f ~} ~% ~}", A[1,1],A[1,2],A[1,3],A[1,4],A[1,5], args(submatrix(1,A))) )$ /* Calculate the ratio Benefit/Cost, Benefit is the Net Present Value (NPV) of the inputs, and Cost is the Net Present Value (NPV) of the outputs. */ benefit_cost(rate,Input,Output):= block([result,NVIn,NVOut], NVIn:0,NVOut:0, if length(Input)#length(Output) then error("Input & Output must have the same length") else (NVIn:npv(rate,Input), NVOut:npv(rate,Output)), result:NVIn/NVOut )$ /* Calculate the distance between 2 dates, assuming 360 days years, 30 days months. */ days360(year1,month1,day1,year2,month2,day2):=block([years,months,days], if month2>month1 then (years:year2-year1, if day2>day1 then (months:month2-month1,days:day2-day1) else (months:month2-month1-1,days:day2+30-day1) ) else (years:year2-year1-1, if day2>day1 then (months:month2+12-month1,days:day2-day1) else (months:month2+11-month1, days:day2+30-day1) ), days:days+years*360+months*30 )$ /* Returns the Future Value of a Present one, the diference in the values is the Interest given by the interest rate. */ fv(rate,PV,num):=PV*(1+rate)^num$ /* Plot the money flow in a time line, the positive values in blue and upside; the negative ones in red and downside. The direction of the flow is given by the sign of the value. */ graph_flow(flowValues):= block([vectors, options], vectors: flatten(makelist([color = if flowValues[k]<0 then 'red else 'blue,vector([k-1,0],[0,flowValues[k]])], k,1,length(flowValues))), options: [head_length=0.05, xaxis=true, yaxis=false, xrange=[-1,length(flowValues)+1]], apply(draw2d,append(options,vectors)) )$ /* Returns the amortization table determinated by rate, Ammount, and number of periods. The payment is not constant, it presents ah geometric growing, growinRate is then the cocient between two consecutive rows in the "Payment" column. */ geo_amortization(rate,growing_rate,Ammount,num):= block([result,A,payment,k,a], if num<0 then error("num must be a positive value") else A:genmatrix(a,num+2, 5), payment:Ammount*(rate-growing_rate)/(1-(1+growing_rate)^(num)/((1+rate)^num)), A[1]:["n", "Balance", "Interest", "Amortization","Payment"], A[2]:[0,0,0,0,0], A[2,2]:Ammount, A[3,5]:payment, for k:4 thru num+2 step 1 do (A[k,5]:A[k-1,5]*(1+growing_rate)), for k:3 thru num+2 step 1 do ( A[k,1]:k-2, A[k,3]:A[k-1,2]*rate, A[k,4]:A[k,5]-A[k,3], A[k,2]:A[k-1,2]-A[k,4] ), printf(true," "), printf(true,"~7s~14s~13s~16s~14s ~% ~{ ~{ ~12,3f ~} ~% ~}", A[1,1],A[1,2],A[1,3],A[1,4],A[1,5], args(submatrix(1,A))) )$ /* Returns the growing annuity knowing the desired value (future value), it is a growing payment. */ geo_annuity_fv(rate,growing_rate,FV,num):=FV*(rate-growing_rate)/((1+rate)^num-(1+growing_rate)^(num))$ /* Returns the growing annuity knowing the desired value (like an ammount), it is a growing payment. */ geo_annuity_pv(rate,growing_rate,PV,num):=PV*(rate-growing_rate)/(1-(1+growing_rate)^(num)/((1+rate)^num))$ /* IRR (Internal Rate of Return), is the value of rate wich makes Net Present Value zero. */ irr(flowValues,I0):= block([r,sum], sum:npv(r,flowValues)-I0, realonly:true, result:float(algsys([sum=0],[r])), realonly:false, result )$ /* Calculate de present value of a value series to evaluate the viability in a project. */ npv(rate,flowValues):= block([sum,k], sum:0, for k:1 thru length(flowValues) step 1 do (sum:sum+pv(rate,flowValues[k],k-1)), sum )$ /* Returns the Present Value of a Future one, the diference in the values is the Interest given by the interest rate. */ pv(rate,FV,num):=FV/(1+rate)^num$ /* Returns a table that represent the values in a constant an periodic saving. Ammount represent the desired quantity and num the number of periods to save. */ saving(rate,Ammount,num):= block([result,A,payment,k,a], if num<0 then error("num must be a positive value") else A:genmatrix(a,num+2, 4), payment:Ammount*rate/((1+rate)^num-1), A[1]:["n", "Balance", "Interest","Payment"], A[2]:[0,0,0,0], A[2,2]:0, for k:3 thru num+2 step 1 do( A[k,4]:payment, A[k,1]:k-2, A[k,3]:A[k-1,2]*rate, A[k,2]:A[k-1,2]+A[k,3]+A[k,4] ), printf(true," "), printf(true,"~7s~14s~13s~14s ~% ~{ ~{ ~12,3f ~} ~% ~}", A[1,1],A[1,2],A[1,3],A[1,4], args(submatrix(1,A))) )$ From mateusz.kaduk at gmail.com Tue Mar 27 04:18:57 2012 From: mateusz.kaduk at gmail.com (mateusz.kaduk at gmail.com) Date: Tue, 27 Mar 2012 11:18:57 +0200 Subject: [Maxima] Reduced row echelon form Message-ID: Hi, Does Maxima provide a function for reduced row echelon form of matrix ? I know echelon(..) exists, but it provides not reduced form. It's quite basic function, and I am supprised that I cannot find it. Thanks, Mateusz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ghiaie at email.de Tue Mar 27 05:51:14 2012 From: ghiaie at email.de (ghiaie at email.de) Date: Tue, 27 Mar 2012 12:51:14 +0200 (CEST) Subject: [Maxima] Working with Inequalities Message-ID: An HTML attachment was scrubbed... URL: From sarapashm at googlemail.com Tue Mar 27 07:03:12 2012 From: sarapashm at googlemail.com (Sara Pashmin) Date: Tue, 27 Mar 2012 14:03:12 +0200 Subject: [Maxima] Working with Inequalities Message-ID: Hello, I try to solve inequalities of a list with Maxima. A simple example is: load(to_poly_solver) $ y : [1,4,8]$ for i:1 step 1 thru length(y) do ( tt[i]: %solve( [(x[i]^2-y[i])<0, (x[i])<0], [x[i]]), display (tt[i]) ); the answer: (%o144) [1,4,8] tt[1]=%union([-10]) (%o145) I would like to know : 1) how to get a result of tt[3] like that: %union( [x[3]<0 , x[3]>-2.828]) and: 2) how to display the results of "x" without using "display (tt[i])". For example when I use the single variable (without list and "for") like this: y : 8$ %solve( [(x^2-y)<0, (x)<0], [x]); I get the following result of x: (%o157) %union([x<0,-(x^2-8)>0]) I will be thankfur for help, Best Regards Sarah From volkervannek at googlemail.com Tue Mar 27 09:24:43 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Tue, 27 Mar 2012 16:24:43 +0200 Subject: [Maxima] Working with Inequalities In-Reply-To: References: Message-ID: (%i1) display(foo)$ foo = foo (%i2) disp(foo)$ foo Maybe disp is what you want. Volker van Nek 2012/3/27 Sara Pashmin > Hello, > > I try to solve inequalities of a list with Maxima. > > A simple example is: > > load(to_poly_solver) $ > y : [1,4,8]$ > for i:1 step 1 thru length(y) do > ( tt[i]: %solve( [(x[i]^2-y[i])<0, (x[i])<0], [x[i]]), > display (tt[i]) > ); > > the answer: > > (%o144) [1,4,8] > tt[1]=%union([-1 tt[2]=%union([-2 tt[3]=%union([x[3]<0,-(x[3]^2-8)>0]) > (%o145) > > I would like to know : > > 1) how to get a result of tt[3] like that: > > %union( [x[3]<0 , x[3]>-2.828]) > > and: > 2) how to display the results of "x" without using "display (tt[i])". > For example when I use the single variable (without list and "for") like > this: > y : 8$ > %solve( [(x^2-y)<0, (x)<0], [x]); > I get the following result of x: > (%o157) %union([x<0,-(x^2-8)>0]) > > I will be thankfur for help, > > Best Regards > > Sarah > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarapashm at googlemail.com Tue Mar 27 09:57:27 2012 From: sarapashm at googlemail.com (Sara Pashmin) Date: Tue, 27 Mar 2012 16:57:27 +0200 Subject: [Maxima] Working with Inequalities In-Reply-To: References: Message-ID: Thanks, Volker. It was helpful. Now my only problem is to solve of the inqualities: [((x)^2-8)<0 , (x)<0]. For the inaualities: [((x)^2-9)<0 , (x)<0] : fourier_elim( [((x)^2-9)<0 , (x)<0], [x]); I get the satisfied answer: [-30] I tried to use the functions of equalities like "allroots (eqn)" and "bfallroots (eqn)" but they were not helpful. Regards Sara Pashmin Am 27. M?rz 2012 16:24 schrieb Volker van Nek : > (%i1) display(foo)$ > ?????????????????????????????????? foo = foo > > (%i2) disp(foo)$ > ????????????????????????????????????? foo > > Maybe disp is what you want. > > Volker van Nek > > 2012/3/27 Sara Pashmin >> >> Hello, >> >> I try to solve inequalities of a list with Maxima. >> >> A simple example is: >> >> load(to_poly_solver) $ >> y : [1,4,8]$ >> for i:1 step 1 thru length(y) do >> ( tt[i]: %solve( [(x[i]^2-y[i])<0, (x[i])<0], [x[i]]), >> display (tt[i]) >> ); >> >> the answer: >> >> (%o144) [1,4,8] >> tt[1]=%union([-1> tt[2]=%union([-2> tt[3]=%union([x[3]<0,-(x[3]^2-8)>0]) >> (%o145) >> >> I would like to know : >> >> 1) how to get a result of tt[3] like that: >> >> %union( [x[3]<0 , x[3]>-2.828]) >> >> and: >> 2) how to display the results of "x" without using "display (tt[i])". >> For example when I use the single variable (without list and "for") like >> this: >> y : 8$ >> %solve( [(x^2-y)<0, (x)<0], [x]); >> I get the following result of x: >> (%o157) %union([x<0,-(x^2-8)>0]) >> >> I will be thankfur for help, >> >> Best Regards >> >> Sarah >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > > From vhfhermans at gmail.com Tue Mar 27 10:13:53 2012 From: vhfhermans at gmail.com (Victor Hermans) Date: Tue, 27 Mar 2012 17:13:53 +0200 Subject: [Maxima] a financial problem again Message-ID: Dear Friends, Maxima cannot solve this relatively simple problem. Why? Thanks in advance, Victor A principal of USD 7650 is invested at a rate of 3.7% compounded annually. After how many years will the investment exceed USD 12250? solve([7650*1.037^x=12250], [x]); -- Victor Hermans Bartoklaan 14 2253 CX - Voorschoten Netherlands tel. 00-31-715613589 mob. 00-31- (0)6-24345774 From vishraj at gmail.com Tue Mar 27 10:33:39 2012 From: vishraj at gmail.com (Vishnu Rajasekharan) Date: Tue, 27 Mar 2012 09:33:39 -0600 Subject: [Maxima] Substituting a value for a differential function Message-ID: Hi, I have a function below. I am trying to subsitute t=25 in the dC(t) and I am getting an error. Please let me know what I missing ot get the value of the differential function. C(t):=(Ax^2)+(Bx)+C dC(t):=(diff(C(t),t,1))$ Thanks your time and help. Vishraj -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Tue Mar 27 10:35:40 2012 From: villate at fe.up.pt (Jaime Villate) Date: Tue, 27 Mar 2012 16:35:40 +0100 Subject: [Maxima] a financial problem again In-Reply-To: References: Message-ID: <4F71DE4C.1040603@fe.up.pt> On 03/27/2012 04:13 PM, Victor Hermans wrote: > Maxima cannot solve this relatively simple problem. Why? > > A principal of USD 7650 is invested at a rate of 3.7% compounded annually. > After how many years will the investment exceed USD 12250? > Hi, some developers with more experience than me will tell you why Maxima has been built that way. In the meantime, you can give "solve" a little help to get the answer you want: (%i2) logexpand: all$ (%i3) solve ( log(7650*1.037^x=12250), x); (%o3) [x = (193246*log(12250)-193246*log(7650))/7021] (%i4) float(%); (%o4) [x = 12.9588573703922] Cheers, Jaime From fateman at eecs.berkeley.edu Tue Mar 27 10:36:23 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 27 Mar 2012 08:36:23 -0700 Subject: [Maxima] a financial problem again In-Reply-To: References: Message-ID: <4F71DE77.3030506@eecs.berkeley.edu> On 3/27/2012 8:13 AM, Victor Hermans wrote: > solve([7650*1.037^x=12250], [x]); The proper syntax is simpler for a single equation: solve(7650*1.037^x=12250, x); This equation has an infinite number of solutions. Radcan can be used to choose one interpretation of radicals and logs, and so this seems to work: solve(radcan(log(...)), x) It's possible that this task (finding approximate solutions of single numerical equations) should be added to what solve does. However solve is intended to find exact solutions, which this question does not seem to require. x=12.95885737160805... in case it matters. From villate at fe.up.pt Tue Mar 27 10:46:09 2012 From: villate at fe.up.pt (Jaime Villate) Date: Tue, 27 Mar 2012 16:46:09 +0100 Subject: [Maxima] Substituting a value for a differential function In-Reply-To: References: Message-ID: <4F71E0C1.9020600@fe.up.pt> On 03/27/2012 04:33 PM, Vishnu Rajasekharan wrote: > I have a function below. I am trying to subsitute t=25 in the dC(t) > and I am getting an error. Please let me know what I missing ot get > the value of the differential function. > C(t):=(Ax^2)+(Bx)+C > dC(t):=(diff(C(t),t,1))$ Hi, there are several things that you must have in mind here: 1) I think you meant A*x^2 and B*x instead of Ax^2 and Bx. 2) I think you meant t instead of x in the definition of C(t). 3) The operator := does not calculate the right side before defining the function. That means that when you try to replace t=15, that substitution will be made before the function is differentiated. Try it this way: (%i2) define (C(t), A*t^2+ B*t+C); (%o2) C(t):=C+t*B+t^2*A (%i3) define (dC(t), diff(C(t),t)); (%o3) dC(t):=B+2*t*A (%i4) dC(15); (%o4) B+30*A define(f(x), exp) is similar to :=, but the exp will be simplified before f(x) is defined. In some cases one needs := and in some other cases define(). Cheers, Jaime From hbaker1 at pipeline.com Tue Mar 27 10:45:51 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Tue, 27 Mar 2012 08:45:51 -0700 Subject: [Maxima] a financial problem again In-Reply-To: <4F71DE4C.1040603@fe.up.pt> References: <4F71DE4C.1040603@fe.up.pt> Message-ID: Suggestion for the Maxima manual: Instead of only specifying what the default is, how about specifying all of the possible values for logexpand? e.g., Default value: false Possible values: {false,true,all,super} Or give "possible values", where the first value given is the default value. At 08:35 AM 3/27/2012, Jaime Villate wrote: >On 03/27/2012 04:13 PM, Victor Hermans wrote: >>Maxima cannot solve this relatively simple problem. Why? >> >>A principal of USD 7650 is invested at a rate of 3.7% compounded annually. >>After how many years will the investment exceed USD 12250? > >Hi, >some developers with more experience than me will tell you why Maxima has been built that way. > >In the meantime, you can give "solve" a little help to get the answer you want: > >(%i2) logexpand: all$ >(%i3) solve ( log(7650*1.037^x=12250), x); >(%o3) [x = (193246*log(12250)-193246*log(7650))/7021] >(%i4) float(%); > >(%o4) [x = 12.9588573703922] > >Cheers, >Jaime From mickle.mouse at gmail.com Tue Mar 27 13:22:01 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Tue, 27 Mar 2012 11:22:01 -0700 Subject: [Maxima] Reduced row echelon form In-Reply-To: References: Message-ID: Take a look at http://www.math.utexas.edu/pipermail/maxima/2007/008246.html. Basically put the first section of code (request_rational_matrix through rref) into some file (rref.mac). Place the file somewhere you can load it every time you need it. I also a modified version which works in modulus 2 (for coding theory). Let me know if you're interested. On Tue, Mar 27, 2012 at 2:18 AM, mateusz.kaduk at gmail.com < mateusz.kaduk at gmail.com> wrote: > Hi, > > Does Maxima provide a function for reduced row echelon form of matrix ? > I know echelon(..) exists, but it provides not reduced form. It's quite > basic function, and I am supprised that I cannot find it. > > Thanks, > Mateusz > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Mar 27 13:30:55 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 27 Mar 2012 14:30:55 -0400 Subject: [Maxima] a financial problem again In-Reply-To: References: Message-ID: solve(2^x=3,x) correctly gets x=log(3)/log(2), but solve((2/3)^x=3,x) is treated as 2^x/3^x=3, from which solve cannot isolate x. I'd think this would be fairly straightforward to fix.... -s On Tue, Mar 27, 2012 at 11:13, Victor Hermans wrote: > solve([7650*1.037^x=12250], [x]); -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Mar 27 13:35:04 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 27 Mar 2012 14:35:04 -0400 Subject: [Maxima] Substituting a value for a differential function In-Reply-To: <4F71E0C1.9020600@fe.up.pt> References: <4F71E0C1.9020600@fe.up.pt> Message-ID: In general, in Maxima it is easier and more natural to work with expressions (which you can assign to variables) than with explicitly defined functions. Thus: C: A*t^2+B*t+C; dC: diff(C,t); subst(t=25,dC); -s On Tue, Mar 27, 2012 at 11:46, Jaime Villate wrote: > On 03/27/2012 04:33 PM, Vishnu Rajasekharan wrote: > >> I have a function below. I am trying to subsitute t=25 in the dC(t) and >> I am getting an error. Please let me know what I missing ot get the value >> of the differential function. >> C(t):=(Ax^2)+(Bx)+C >> dC(t):=(diff(C(t),t,1))$ >> > Hi, > there are several things that you must have in mind here: > > 1) I think you meant A*x^2 and B*x instead of Ax^2 and Bx. > 2) I think you meant t instead of x in the definition of C(t). > 3) The operator := does not calculate the right side before defining the > function. That means > that when you try to replace t=15, that substitution will be made before > the function is differentiated. > > Try it this way: > > (%i2) define (C(t), A*t^2+ B*t+C); > > (%o2) C(t):=C+t*B+t^2*A > (%i3) define (dC(t), diff(C(t),t)); > > (%o3) dC(t):=B+2*t*A > (%i4) dC(15); > > (%o4) B+30*A > > define(f(x), exp) is similar to :=, but the exp will be simplified before > f(x) is defined. In some cases > one needs := and in some other cases define(). > > Cheers, > Jaime > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From volkervannek at googlemail.com Tue Mar 27 14:25:29 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Tue, 27 Mar 2012 21:25:29 +0200 Subject: [Maxima] Working with Inequalities In-Reply-To: References: Message-ID: Hi Sara Pashmin, I assume you read the documentation for fourier_elim. fourier_elim is a very powerfull tool, but I am afraid that I am not very familiar with it. Perhaps some else can be of more help. But I will give it a try: (%i1) load(fourier_elim); (%o1) /usr/share/maxima/5.26.0/share/contrib/fourier_elim/fourier_elim.lisp (%i2) load(solve_rat_ineq); (%o2) /usr/share/maxima/5.26.0/share/contrib/solve_rat_ineq.mac (%i3) sol : solve_rat_ineq(x^2-9 < 0); (%o3) [[x > - 3, x < 3]] (%i4) fourier_elim(append(sol[1], [x < 0]), [x]); (%o4) [- 3 < x, x < 0] solve_rat_ineq is not documented at the moment, but you will find some examples inside of the file share/contrib/solve_rat_ineq.mac itself. Maybe you can generally use solve_rat_ineq to return a list of linear inequalities, append them and let fourier_elim do the rest. However solve_rat_ineq ist restricted to rational expressions. Hope that helps Vollker van Nek By the way. Some of your paranthesises aren't necessary. 2012/3/27 Sara Pashmin > Thanks, Volker. It was helpful. > > Now my only problem is to solve of the inqualities: [((x)^2-8)<0 , (x)<0]. > > For the inaualities: [((x)^2-9)<0 , (x)<0] : > fourier_elim( [((x)^2-9)<0 , (x)<0], [x]); > I get the satisfied answer: > [-3 > But the solve of the first inaualities is: > > [ x<0, -(x^2-8)>0] > > I tried to use the functions of equalities like "allroots (eqn)" and > "bfallroots (eqn)" but they were not helpful. > > Regards > > Sara Pashmin > > > Am 27. M?rz 2012 16:24 schrieb Volker van Nek >: > > (%i1) display(foo)$ > > foo = foo > > > > (%i2) disp(foo)$ > > foo > > > > Maybe disp is what you want. > > > > Volker van Nek > > > > 2012/3/27 Sara Pashmin > >> > >> Hello, > >> > >> I try to solve inequalities of a list with Maxima. > >> > >> A simple example is: > >> > >> load(to_poly_solver) $ > >> y : [1,4,8]$ > >> for i:1 step 1 thru length(y) do > >> ( tt[i]: %solve( [(x[i]^2-y[i])<0, (x[i])<0], [x[i]]), > >> display (tt[i]) > >> ); > >> > >> the answer: > >> > >> (%o144) [1,4,8] > >> tt[1]=%union([-1 >> tt[2]=%union([-2 >> tt[3]=%union([x[3]<0,-(x[3]^2-8)>0]) > >> (%o145) > >> > >> I would like to know : > >> > >> 1) how to get a result of tt[3] like that: > >> > >> %union( [x[3]<0 , x[3]>-2.828]) > >> > >> and: > >> 2) how to display the results of "x" without using "display (tt[i])". > >> For example when I use the single variable (without list and "for") like > >> this: > >> y : 8$ > >> %solve( [(x^2-y)<0, (x)<0], [x]); > >> I get the following result of x: > >> (%o157) %union([x<0,-(x^2-8)>0]) > >> > >> I will be thankfur for help, > >> > >> Best Regards > >> > >> Sarah > >> _______________________________________________ > >> Maxima mailing list > >> Maxima at math.utexas.edu > >> http://www.math.utexas.edu/mailman/listinfo/maxima > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mateusz.kaduk at gmail.com Tue Mar 27 14:35:57 2012 From: mateusz.kaduk at gmail.com (mateusz.kaduk at gmail.com) Date: Tue, 27 Mar 2012 21:35:57 +0200 Subject: [Maxima] Reduced row echelon form In-Reply-To: References: Message-ID: The post comes from 2007, maybe it can be contributed and released as builtin functionality in next maxima version ? So far I needed just that, but thanks :) On 27 March 2012 20:22, Mike Valenzuela wrote: > Take a look at > http://www.math.utexas.edu/pipermail/maxima/2007/008246.html. Basically > put the first section of code (request_rational_matrix through rref) into > some file (rref.mac). Place the file somewhere you can load it every time > you need it. > > I also a modified version which works in modulus 2 (for coding theory). > Let me know if you're interested. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Tue Mar 27 18:17:58 2012 From: woollett at charter.net (Edwin Woollett) Date: Tue, 27 Mar 2012 16:17:58 -0700 Subject: [Maxima] quad_qags and qag interval bug Message-ID: <08218B37E15B4AA38BBAC4BBF5510CF3@edwinc367e16bd> If I use quad_qags or quad_qag to integrate over an interval [-n, n] an error message results, changing to interval (-n, n+1) makes the error message (and error number = 2) go away. ------------------------------------------------------------------------ Maxima 5.26.0 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) quad_qags(sin(x),x,-1,1); ***MESSAGE FROM ROUTINE DQAGS IN LIBRARY SLATEC. ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED * ABNORMAL RETURN * ERROR NUMBER = 2 * ***END OF MESSAGE (%o1) [0.0, 1.0165933519183943E-14, 21, 2] (%i2) quad_qags(sin(x),x,-1,2); (%o2) [0.95644914241528, 2.0841030850705445E-14, 21, 0] (%i3) quad_qags(sin(x),x,-2,2); ***MESSAGE FROM ROUTINE DQAGS IN LIBRARY SLATEC. ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED * ABNORMAL RETURN * ERROR NUMBER = 2 * ***END OF MESSAGE (%o3) [0.0, 3.1278966234842519E-14, 21, 2] (%i4) quad_qags(sin(x),x,-2,3); (%o4) [0.5738456600533, 3.7903979626832496E-14, 21, 0] (%i5) quad_qags(sin(x),x,-3,3); ***MESSAGE FROM ROUTINE DQAGS IN LIBRARY SLATEC. ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED * ABNORMAL RETURN * ERROR NUMBER = 2 * ***END OF MESSAGE (%o5) [0.0, 4.3812931738840094E-14, 21, 2] (%i6) build_info(); Maxima version: 5.26.0 Maxima build date: 22:48 1/15/2012 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 --------------------------------------------- Same errors show up with quad_qag. Haven't investigated other quadpack functions. Ted From woollett at charter.net Tue Mar 27 19:05:55 2012 From: woollett at charter.net (Edwin Woollett) Date: Tue, 27 Mar 2012 17:05:55 -0700 Subject: [Maxima] quad_qags and qag interval bug Message-ID: <261F9EE8B9514DF89653F285792C4E0E@edwinc367e16bd> On Mar. 27, I wrote: ---------------------------- >If I use quad_qags or quad_qag to integrate over >an interval [-n, n] an error message results, >changing to interval (-n, n+1) makes the error >message (and error number = 2) go away. ------------------------------- Clearly the example I used can be blamed on using an odd function sin(x), the correct answer over [-n,n] being exactly zero, and quadpack has trouble dealing with an odd function over such an interval. For the purposes of a quadpack wrapper, which should give a reliable answer for an arbitrary integrand, integrating sin(x) over [-n,n] should be a possible task, even if mathematically it looks like wasted effort to use quadpack. Are there other examples in which quadpack has troubles when a) the integrand is *not* odd, but, b) the answer should be exactly zero? To detect an odd function for a complicated function symbolically might not always be possible, but perhaps numerical sampling would be enough? Ted From fateman at eecs.berkeley.edu Tue Mar 27 19:27:54 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 27 Mar 2012 17:27:54 -0700 Subject: [Maxima] quad_qags and qag interval bug In-Reply-To: <261F9EE8B9514DF89653F285792C4E0E@edwinc367e16bd> References: <261F9EE8B9514DF89653F285792C4E0E@edwinc367e16bd> Message-ID: <4F725B0A.1020700@eecs.berkeley.edu> On 3/27/2012 5:05 PM, Edwin Woollett wrote:.. ... > > To detect an odd function for a complicated function > symbolically might not always be possible, true > but > perhaps numerical sampling would be enough? you could (probably) say that an integral's value is "bounded away from zero" or "can't say if it is bounded away from zero with the tools at our disposal." Another approach is to say that the quadrature program provides only "absolute error" bounds if the answer is near zero, instead of "relative error" (or X digits of accuracy) elsewhere. I think this latter approach is typical of lots of numerical software written using conventional arithmetic (e.g. double float). Can one do better with variable (arbitrary) precision? Yes, sometimes. RJF From toy.raymond at gmail.com Tue Mar 27 22:46:38 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 27 Mar 2012 20:46:38 -0700 Subject: [Maxima] Writing a new module ? In-Reply-To: References: <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F65F9CF.8000706@eecs.berkeley.edu> <4F64BF2C.9040502@gmail.com> <4F64CC6A.7000409@gmail.com> <4F64F92E.9000604@eecs.berkeley.edu> <4F656B44.5010908@gmail.com> <4F65F9CF.8000706@eecs.berkeley.edu> <4F6612AC.8040503@gmail.com> Message-ID: <4F72899E.9020807@gmail.com> On 3/19/12 5:39 AM, Michel Talon wrote: > > Yes, half of the running time comes from callbacks to maxima, which one cannot > speed up (maybe one can compile the maxima formulae, but when i tried it was > buggy). Half of the running time comes from lapack and colnew routines > (translated from fortran to lisp). These are literally 100 times slower than > the Fortran versions, and this is terrible. One may hope to cut this to > 10 times slower, this would be very nice, but at the end of the day would only > cut total execution time by 2, unfortunately. Just wanted to mention that in the latest development version of matlisp, Akshay Srinivasan has added CFFI support and support for callbacks. It's still in the development stage, but it seems to work quite nicely. Therefore, I took the opportunity to compile up the Fortran version of colnew and run this in matlisp with the callbacks written in lisp. Demo 2, in maxima, takes about 3 sec to load(prob2), which includes all of the stuff to set up the problem. If I time just the call to colnew, it takes about 2.5 sec. And I turned off all of the diagnostic prints. F2cl is pretty bad with Fortran prints. (Actually cmucl's format is somewhat slow too because it works very hard to get a correctly printed floating-point result.) When run in matlisp, the equivalent takes about 0.13 sec on the same machine, including all of the diagnostic prints. A better benchmark might be to use Michel's prob4 demo. Haven't gotten around to functions to Lisp. Ray From villate at fe.up.pt Wed Mar 28 02:00:44 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 28 Mar 2012 08:00:44 +0100 Subject: [Maxima] Substituting a value for a differential function In-Reply-To: References: <4F71E0C1.9020600@fe.up.pt> Message-ID: <4F72B71C.10709@fe.up.pt> On 03/27/2012 07:35 PM, Stavros Macrakis wrote: > In general, in Maxima it is easier and more natural to work with > expressions (which you can assign to variables) than with explicitly > defined functions. Thus: > > C: A*t^2+B*t+C; > dC: diff(C,t); Hi Stavros, while we're at it, perhaps you could explain to us why Maxima does not get into an endless loop with that derivative calculation? I'm puzzled to see that dC does not go into an endless loop: 2*A*t + B + 2*A*t + B + 2*A*t + B + ... Apparently diff knows that there are two different C's, the expression that depends on t, and the constant that enters in the definition of that expression. Cheers, Jaime -------------- next part -------------- An HTML attachment was scrubbed... URL: From tkpapp at gmail.com Wed Mar 28 10:09:49 2012 From: tkpapp at gmail.com (Tamas Papp) Date: Wed, 28 Mar 2012 15:09:49 +0000 (UTC) Subject: [Maxima] resources for learning maxima Message-ID: Hi, I have been using Maxima for simple calculations in the past week or so, and I find it really useful. I would like to learn it better, and I am looking for recommendations on what books/articles to read. Primarily, I am planning to use Maxima as an "algebra notebook", ie most of the time I would like to guide it through computations that I could do myself, but it is really nice to have a tool that keeps track of manipulations and ensures that they are correct. Best, Tamas From macrakis at alum.mit.edu Wed Mar 28 10:21:31 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 28 Mar 2012 11:21:31 -0400 Subject: [Maxima] Substituting a value for a differential function In-Reply-To: <4F72B71C.10709@fe.up.pt> References: <4F71E0C1.9020600@fe.up.pt> <4F72B71C.10709@fe.up.pt> Message-ID: I really shouldn't have used C both ways. Though it causes no problems in this particular case, it is bound to be problematic in longer or more complicated calculations. There is no endless loop because expressions are only evaluated once. This is consistent with almost every other programming language (including Lisp). I understand that some systems have "infinite evaluation" semantics, but Maxima doesn't. Example: (a: b, b: c, c: d)$ [a,b,c] => [b,c,d] When a variable is not assigned a value, it evaluates to itself. The *order* of the assignments is critical: (q:s, r:q, p:r)$ [p,q,r] => [s,s,s] You can force infinite evaluation, though: [a,b,c], infeval => [d,d,d] -s On Wed, Mar 28, 2012 at 03:00, Jaime Villate wrote: > On 03/27/2012 07:35 PM, Stavros Macrakis wrote: > > In general, in Maxima it is easier and more natural to work with > expressions (which you can assign to variables) than with explicitly > defined functions. Thus: > > C: A*t^2+B*t+C; > dC: diff(C,t); > > Hi Stavros, > while we're at it, perhaps you could explain to us why Maxima does not get > into an endless loop with that > derivative calculation? I'm puzzled to see that dC does not go into an > endless loop: > 2*A*t + B + 2*A*t + B + 2*A*t + B + ... > Apparently diff knows that there are two different C's, the expression > that depends on t, and the constant > that enters in the definition of that expression. > > Cheers, > Jaime > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Wed Mar 28 10:35:15 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 28 Mar 2012 08:35:15 -0700 Subject: [Maxima] resources for learning maxima In-Reply-To: References: Message-ID: On Wed, Mar 28, 2012 at 8:09 AM, Tamas Papp wrote: > Hi, > > I have been using Maxima for simple calculations in the past week or > so, and I find it really useful. I would like to learn it better, and > I am looking for recommendations on what books/articles to read. > Hi Tamas! Here is a good place to start: http://maxima.sourceforge.net/documentation.html. > > Primarily, I am planning to use Maxima as an "algebra notebook", ie > most of the time I would like to guide it through computations that I > could do myself, but it is really nice to have a tool that keeps track > of manipulations and ensures that they are correct. > Sorry, but you'll still have to check your results. :-) Maxima is not, unfortunately, bug free. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Wed Mar 28 10:35:01 2012 From: willisb at unk.edu (Barton Willis) Date: Wed, 28 Mar 2012 10:35:01 -0500 Subject: [Maxima] Substituting a value for a differential function In-Reply-To: References: <4F71E0C1.9020600@fe.up.pt> <4F72B71C.10709@fe.up.pt> Message-ID: maxima-bounces at math.utexas.edu wrote on 03/28/2012 10:21:31 AM: > There is no endless loop because expressions are only evaluated once. Putative bug: (%i1) (a : b, b : c, c : d)$ Should be b[x], not d[x], I think: (%i2) a[x]; (%o2) d[x] --bw -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Wed Mar 28 13:22:22 2012 From: woollett at charter.net (Edwin Woollett) Date: Wed, 28 Mar 2012 11:22:22 -0700 Subject: [Maxima] quad_qags and qag interval bug Message-ID: <00579F7E78B242C6ACD7FBB92D921CA1@edwinc367e16bd> On Mar. 27, 2012, Richard Fateman wrote: ----------------- >Another approach is to say that the quadrature program provides >only "absolute error" bounds if the answer is near zero, instead of >"relative error" (or X digits of accuracy) elsewhere. ---------------------------------- This suggests that a quadpack wrapper redo a calculation which returns an answer "near" zero (together with error code = 2) by replacing the rel error criterion with an abs error criterion. Using an example suggested by Ray Toy: ---------------------- (%i1) (display2d:false,fpprintprec:8)$ (%i2) integrate(sin(x+1),x,-3,1); (%o2) 0 (%i3) quad_qags(sin(x+1),x,-3,1); ***MESSAGE FROM ROUTINE DQAGS IN LIBRARY SLATEC. ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED * ABNORMAL RETURN * ERROR NUMBER = 2 * ***END OF MESSAGE (%o3) [1.51674678E-17,3.12789662E-14,21,2] (%i4) quad_qags(sin(x+1),x,-3,1,'epsabs = 1d-8); (%o4) [1.51674678E-17,3.12789662E-14,21,0] (%io5) quad_qags(sin(x+1),x,-3,1,'epsabs = 1d-8,'epsrel = 0.0,limit=800); (%o5) [1.51674678E-17,3.12789662E-14,21,0] --------------------------------------------- Ted From toy.raymond at gmail.com Wed Mar 28 18:24:19 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 28 Mar 2012 16:24:19 -0700 Subject: [Maxima] quad_qags and qag interval bug In-Reply-To: <00579F7E78B242C6ACD7FBB92D921CA1@edwinc367e16bd> References: <00579F7E78B242C6ACD7FBB92D921CA1@edwinc367e16bd> Message-ID: On Wed, Mar 28, 2012 at 11:22 AM, Edwin Woollett wrote: > On Mar. 27, 2012, Richard Fateman wrote: > ----------------- > > Another approach is to say that the quadrature program provides >> only "absolute error" bounds if the answer is near zero, instead of >> "relative error" (or X digits of accuracy) elsewhere. >> > ------------------------------**---- > This suggests that a quadpack wrapper redo a calculation > which returns an answer "near" zero (together with > error code = 2) by replacing the rel error criterion with > an abs error criterion. Using an example suggested > by Ray Toy: > ---------------------- > Perhaps you've seen this already, but in case you haven't, take a look at the end of src/numerical/slatec/quadpack.lisp. There are a bunch examples taken from the quadpack book. You might be interested in the failure cases. (The listed failure cases and values are from the book, I think. The actual failures appear to be somewhat different, if you run the tests yourself.) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleksasd873 at gmail.com Thu Mar 29 00:16:33 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Thu, 29 Mar 2012 08:16:33 +0300 Subject: [Maxima] Why integrate (0, x) # 0 ? Message-ID: (%i1) integrate(diff(y(x),x)=0,x); (%o1) y(x)=%c1+integrate(0,x) Why integrate (0, x) # 0 ? (%i2) integrate('diff(y,x)=0,x); (%o2) integrate('diff(y,x,1),x)=%c2+integrate(0,x) (%i3) ev(%, nouns); (%o3) 0=%c2 Why integrate('diff(y,x),x) =0 ? (%i4) depends(y,x); (%o4) [y(x)] (%i5) integrate(diff(y,x)=0,x); (%o5) integrate('diff(y,x,1),x)=%c3+integrate(0,x) (%i6) ev(%, nouns); (%o6) integrate('diff(y,x,1),x)=%c3 Why integrate(diff(y,x),x) # y ? if depends(y,x) A good result is obtained only in this case: (%i7) integrate(diff(y(x),x),x); (%o7) y(x) Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarapashm at googlemail.com Thu Mar 29 07:32:27 2012 From: sarapashm at googlemail.com (Sara Pashmin) Date: Thu, 29 Mar 2012 14:32:27 +0200 Subject: [Maxima] an empty list with 76 elements Message-ID: Hello, I made a list like A with elements from 0 until 7.5: A : makelist(i*0.1, i, 0, 75); equal to this list I need as well an empty list with the same size. I would like to know please how to make a "empty" list with for example 76 elements? Thanks and best regards Sara From dbmaxima at gmail.com Thu Mar 29 07:48:48 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Thu, 29 Mar 2012 23:48:48 +1100 Subject: [Maxima] an empty list with 76 elements In-Reply-To: References: Message-ID: <4F745A30.6060607@gmail.com> On 29/03/2012 11:32 PM, Sara Pashmin wrote: > I would like to know please how to make a "empty" list with for > example 76 elements? Is this what you want? (%i1) makelist([],i,0,75); (%o1) [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] From macrakis at alum.mit.edu Thu Mar 29 08:12:52 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 29 Mar 2012 09:12:52 -0400 Subject: [Maxima] an empty list with 76 elements In-Reply-To: References: Message-ID: Not sure I understand your question. The usual definition of an empty list is a list of length 0. How can a list of length 0 have 76 elements? What exactly do you want to do with this second list? -s On Thu, Mar 29, 2012 at 08:32, Sara Pashmin wrote: > Hello, > > I made a list like A with elements from 0 until 7.5: > > A : makelist(i*0.1, i, 0, 75); > > equal to this list I need as well an empty list with the same size. > > > I would like to know please how to make a "empty" list with for > example 76 elements? > > Thanks and best regards > > Sara > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarapashm at googlemail.com Thu Mar 29 08:15:07 2012 From: sarapashm at googlemail.com (Sara Pashmin) Date: Thu, 29 Mar 2012 15:15:07 +0200 Subject: [Maxima] an empty list with 76 elements In-Reply-To: <4F745A30.6060607@gmail.com> References: <4F745A30.6060607@gmail.com> Message-ID: Hello Christopher and David, thanks for your answer. I try to solve a loop for example like this: A: makelist(i*0.1,i,0,75); for i:1 thrue length(A) step 1 do fourier_elim( [A[i]-B[i]+C[i]>2, A[i]+B[i]<4] , [ B[i], C[i] ]); At the beginning I wantet to make a list for B and C with the same size, but now I understand that the list of B and C can not be empty. I should define variable for their elements like [x,y,z,t,...]. Best regards Sara Am 29. M?rz 2012 14:48 schrieb David Billinghurst : > On 29/03/2012 11:32 PM, Sara Pashmin wrote: >> >> I would like to know please how to make a "empty" list with for >> example 76 elements? > > Is this what you want? > > (%i1) makelist([],i,0,75); > (%o1) [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], > [], > [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], > [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], > [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], > []] > From macrakis at alum.mit.edu Thu Mar 29 08:35:08 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 29 Mar 2012 09:35:08 -0400 Subject: [Maxima] an empty list with 76 elements In-Reply-To: References: <4F745A30.6060607@gmail.com> Message-ID: Sara, The real problem here is probably that you have run into a bug in fourier_elim, which does not appear to allow subscripted variables (though subscripted variables should work exactly like unsubscripted variables): fourier_elim( [a1>1], [a1] ) => [11], [a[1]] ) => Maxima encountered a Lisp error <<< bug! A workaround for this is to use concat to generate pseudo-subscripted variables: fourier_elim( [ concat('a,1) >1], [ concat('a,1) ] ) => [11], [a[1]] ) => [1wrote: > Hello Christopher and David, > > thanks for your answer. > > I try to solve a loop for example like this: > > A: makelist(i*0.1,i,0,75); > > for i:1 thrue length(A) step 1 do > > fourier_elim( [A[i]-B[i]+C[i]>2, A[i]+B[i]<4] , [ B[i], C[i] ]); > > At the beginning I wantet to make a list for B and C with the same > size, but now I understand that the list of B and C can not be empty. > I should define variable for their elements like [x,y,z,t,...]. > > Best regards > > Sara > > Am 29. M?rz 2012 14:48 schrieb David Billinghurst : > > On 29/03/2012 11:32 PM, Sara Pashmin wrote: > >> > >> I would like to know please how to make a "empty" list with for > >> example 76 elements? > > > > Is this what you want? > > > > (%i1) makelist([],i,0,75); > > (%o1) [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], > [], > > [], > > [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], > [], > > [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], > [], > > [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], > [], > > []] > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tkpapp at gmail.com Thu Mar 29 08:51:01 2012 From: tkpapp at gmail.com (Tamas Papp) Date: Thu, 29 Mar 2012 13:51:01 +0000 (UTC) Subject: [Maxima] solving simple systems of equations manually Message-ID: Hi, This is a newbie question, I am still learning Maxima. I know a bit of CL. I have the following system: /* equations */ eq1: r*U = b+lambda_u*(W0-U); eq2: r*W0 = w0 + lambda_e*(W1-W0) + sigma*(U-W0); eq3: r*W1 = p + sigma*(U-W1); eq4: W0-U=beta*(W1-U); The unknowns are W0, W1, U, and w0. I am interested in the expression (w0-b)/(w1-w0) I could just use solve() and simplify, but the problem has a specific structure and I want to see the steps -- I am using this problem to gain intuition about a more complex one. Using economic intuition about this problem, we want to write everything in terms of S=W1-U. So I did the following: /* utility functions */ mysub(expression,equation) := subst(rhs(equation),lhs(equation),expression); flip(equation) := rhs(equation)=lhs(equation); /* exchange sides */ solve1(equation,variable) := solve(equation,variable)[1]; /* solve and return the eq */ eqS: S=W1-U; /* define surplus */ eqW1fromS: solve1(eqS,W1); eqW0fromS: mysub(solve1(eq4,W0),eqW1fromS); sub2(expression) := ratsimp(mysub(mysub(expression,eqW1fromS),eqW0fromS)); eq1s: sub2(eq1); eq2s: sub2(eq2); eq3s: sub2(eq3); eq2f: eq2s-eq1s; The last one has w0-b, but I am stuck. I would appreciate advice on the following: 1. How can I extract the term w0-b from the last expression? Or, equivalently, how can I group coefficients of S on one side? 2. I am sure that I am doing a lot of things non-idiomatically. Style advice, pointers to tutorials about this etc would be very welcome. 3. sub2 could be done more generally with reduce. I tried :lisp (defmspec $mysuball (expression equations) (reduce #'$mysub equations \:initial-value expression)) but it doesn't work as expected, it returns a list of expressions. Best, Tamas From vishraj at gmail.com Thu Mar 29 09:35:59 2012 From: vishraj at gmail.com (Vishnu Rajasekharan) Date: Thu, 29 Mar 2012 08:35:59 -0600 Subject: [Maxima] Plotting Message-ID: Hello: I have the following set of expressions. define (Z(t),A(t)+(B*C(t)*1000))$ define (Y(t),Z(t)/D(t))$ wxplot2d([Y(25)],[B,0,1])$ wxplot2d([Z(25)],[B,0,1])$ I need to plot Y(25) in the Y axis and Z(25) in the X axis varying B from 0 to 1 which would be reflected in the X axis. Any suggestions or help is highly appreciated. Thank you for your time. Regards Vishraj -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarapashm at googlemail.com Thu Mar 29 10:13:08 2012 From: sarapashm at googlemail.com (Sara Pashmin) Date: Thu, 29 Mar 2012 17:13:08 +0200 Subject: [Maxima] an empty list with 76 elements In-Reply-To: References: <4F745A30.6060607@gmail.com> Message-ID: Hello Stavros, thank you very much for your answer, which helped me to make a list with variables as elements. Best regards Sara Am 29. M?rz 2012 15:35 schrieb Stavros Macrakis : > Sara, > > The real problem here is probably that you have run into a bug in > fourier_elim, which does not appear to allow subscripted variables (though > subscripted variables should work exactly like unsubscripted variables): > > ? ? ? ? ? fourier_elim( [a1>1], [a1] ) => [1 ? ? ? ? ? fourier_elim( [a[1]>1], [a[1]] ) => ?Maxima encountered a Lisp > error ? <<< bug! > > A workaround for this is to use concat to generate pseudo-subscripted > variables: > > ? ? ? ? ? fourier_elim( [ concat('a,1) >1], [ concat('a,1) ] ) => ?[1 > You can automate this by defining: > > ? ? ? ? ? a[i]:= concat('a,i)$ > ? ? ? ? ? fourier_elim( [a[1]>1], [a[1]] ) ?=> [1 > Tested in > > Maxima version: 5.26.0 > Maxima build date: 13:32 1/18/2012 > Host type: i686-apple-darwin11.2.0 > Lisp implementation type: SBCL > Lisp implementation version: 1.0.52.0-11e4aa5 > > ? ? ? ? ? -s > > > > > > > On Thu, Mar 29, 2012 at 09:15, Sara Pashmin > wrote: >> >> Hello Christopher and David, >> >> thanks for your answer. >> >> I try to solve a loop for example like this: >> >> A: makelist(i*0.1,i,0,75); >> >> for i:1 thrue length(A) step 1 do >> >> fourier_elim( [A[i]-B[i]+C[i]>2, A[i]+B[i]<4] , [ B[i], C[i] ]); >> >> At the beginning I wantet to make a list for B and C with the same >> size, but now I understand that the list of B and C can not be empty. >> I should define variable for their elements like [x,y,z,t,...]. >> >> Best regards >> >> Sara >> >> Am 29. M?rz 2012 14:48 schrieb David Billinghurst : >> > On 29/03/2012 11:32 PM, Sara Pashmin wrote: >> >> >> >> I would like to know please how to make a "empty" list with for >> >> example 76 elements? >> > >> > Is this what you want? >> > >> > (%i1) makelist([],i,0,75); >> > (%o1) [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], >> > [], >> > [], >> > [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], >> > [], >> > [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], >> > [], >> > [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], >> > [], >> > []] >> > >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > > From volkervannek at googlemail.com Thu Mar 29 10:53:36 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Thu, 29 Mar 2012 17:53:36 +0200 Subject: [Maxima] Why integrate (0, x) # 0 ? In-Reply-To: References: Message-ID: Hi Aleksas. It seems to me that you are trying to solve a differential equation. Have a look at chapter 21 : Differential Equations Maybe ode2 is what you want. (%i1) ode2('diff(y(x),x) = 0, y(x), x); (%o1) y(x) = %c Hope that helps Volker van Nek 2012/3/29 Aleksas Domarkas > (%i1) integrate(diff(y(x),x)=0,x); > (%o1) y(x)=%c1+integrate(0,x) > Why integrate (0, x) # 0 ? > > (%i2) integrate('diff(y,x)=0,x); > (%o2) integrate('diff(y,x,1),x)=%c2+integrate(0,x) > (%i3) ev(%, nouns); > (%o3) 0=%c2 > Why integrate('diff(y,x),x) =0 ? > > (%i4) depends(y,x); > (%o4) [y(x)] > (%i5) integrate(diff(y,x)=0,x); > (%o5) integrate('diff(y,x,1),x)=%c3+integrate(0,x) > (%i6) ev(%, nouns); > (%o6) integrate('diff(y,x,1),x)=%c3 > Why integrate(diff(y,x),x) # y ? if depends(y,x) > > A good result is obtained only in this case: > (%i7) integrate(diff(y(x),x),x); > (%o7) y(x) > > Aleksas D > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Thu Mar 29 11:10:17 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 29 Mar 2012 10:10:17 -0600 Subject: [Maxima] an empty list with 76 elements In-Reply-To: References: <4F745A30.6060607@gmail.com> Message-ID: The bug triggered by fourier_elim( [a[1]>1], [a[1]] ) appears to be somewhere downstream from GENSYM-READABLE. So it's probably relatively easy to fix, as it's not in fourier_elim. Not sure what's going on, though. best Robert Dodier From villate at fe.up.pt Thu Mar 29 11:24:25 2012 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 29 Mar 2012 17:24:25 +0100 Subject: [Maxima] Plotting In-Reply-To: References: Message-ID: <4F748CB9.2020407@fe.up.pt> On 03/29/2012 03:35 PM, Vishnu Rajasekharan wrote: > Hello: > I have the following set of expressions. > define (Z(t),A(t)+(B*C(t)*1000))$ > > define (Y(t),Z(t)/D(t))$ > > wxplot2d([Y(25)],[B,0,1])$ > > wxplot2d([Z(25)],[B,0,1])$ > I need to plot Y(25) in the Y axis and Z(25) in the X axis varying B > from 0 to 1 which would be reflected in the X axis. Any suggestions > or help is highly appreciated. > To be able to make a plot, you need an expression/function that will evaluate to a number. First make sure that subst(B=0,Y(25)) and subst(B=0,Z(25)) give numbers and not expressions. If you only have the definitions above, they will not evaluate to numerical values, because A(25), C(25) and D(25) will not give numerical values. Regards, Jaime From robert.dodier at gmail.com Thu Mar 29 11:26:48 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 29 Mar 2012 10:26:48 -0600 Subject: [Maxima] Maxima 5.27 branch planned for April 1 Message-ID: Hi, I'm planning to make a branch for Maxima 5.27 on April 1 or shortly thereafter, with a release to follow. best Robert Dodier From dlakelan at street-artists.org Thu Mar 29 12:40:57 2012 From: dlakelan at street-artists.org (dlakelan) Date: Thu, 29 Mar 2012 10:40:57 -0700 Subject: [Maxima] solving simple systems of equations manually In-Reply-To: References: Message-ID: <4F749EA9.1050008@street-artists.org> On 03/29/2012 06:51 AM, Tamas Papp wrote: > Hi, > > This is a newbie question, I am still learning Maxima. I know a bit > of CL. > > I have the following system: > > /* equations */ > eq1: r*U = b+lambda_u*(W0-U); > eq2: r*W0 = w0 + lambda_e*(W1-W0) + sigma*(U-W0); > eq3: r*W1 = p + sigma*(U-W1); > eq4: W0-U=beta*(W1-U); > > The unknowns are W0, W1, U, and w0. I am interested in the expression You've got W0 listed twice? what did you mean here? > (w0-b)/(w1-w0) > Using economic intuition about this problem, we want to write > everything in terms of S=W1-U. So I did the following: ratsubst(S,W1-U,expr) may be a good way to make this transformation (where expr is the expression you want to make the change in). I'm afraid that the overall goal you're seeking is a little confusing based on your description. From tkpapp at gmail.com Thu Mar 29 13:16:56 2012 From: tkpapp at gmail.com (Tamas Papp) Date: Thu, 29 Mar 2012 18:16:56 +0000 (UTC) Subject: [Maxima] solving simple systems of equations manually References: <4F749EA9.1050008@street-artists.org> Message-ID: On Thu, 29 Mar 2012 10:40:57 -0700, dlakelan wrote: > On 03/29/2012 06:51 AM, Tamas Papp wrote: >> Hi, >> >> This is a newbie question, I am still learning Maxima. I know a bit of >> CL. >> >> I have the following system: >> >> /* equations */ >> eq1: r*U = b+lambda_u*(W0-U); >> eq2: r*W0 = w0 + lambda_e*(W1-W0) + sigma*(U-W0); eq3: r*W1 = p + >> sigma*(U-W1); >> eq4: W0-U=beta*(W1-U); >> >> The unknowns are W0, W1, U, and w0. I am interested in the expression > > You've got W0 listed twice? what did you mean here? Note the difference in case. Tamas From l_butler at users.sourceforge.net Thu Mar 29 14:16:23 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Thu, 29 Mar 2012 19:16:23 +0000 Subject: [Maxima] infinite loop Message-ID: <1qp4nt7qku0.fsf@iceland.freeshell.org> The following leads to an infinite loop. Could someone explain why? f(x,y) := x(1)*y(2); f(y,x); -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From dlakelan at street-artists.org Thu Mar 29 15:31:50 2012 From: dlakelan at street-artists.org (dlakelan) Date: Thu, 29 Mar 2012 13:31:50 -0700 Subject: [Maxima] solving simple systems of equations manually In-Reply-To: References: <4F749EA9.1050008@street-artists.org> Message-ID: <4F74C6B6.5030303@street-artists.org> On 03/29/2012 11:16 AM, Tamas Papp wrote: > On Thu, 29 Mar 2012 10:40:57 -0700, dlakelan wrote: > >> On 03/29/2012 06:51 AM, Tamas Papp wrote: >>> Hi, >>> >>> This is a newbie question, I am still learning Maxima. I know a bit of >>> CL. >>> >>> I have the following system: >>> >>> /* equations */ >>> eq1: r*U = b+lambda_u*(W0-U); >>> eq2: r*W0 = w0 + lambda_e*(W1-W0) + sigma*(U-W0); eq3: r*W1 = p + >>> sigma*(U-W1); >>> eq4: W0-U=beta*(W1-U); >>> >>> The unknowns are W0, W1, U, and w0. I am interested in the expression >> >> You've got W0 listed twice? what did you mean here? > > Note the difference in case. aha, I thought that was a typo, as I didn't notice the lowercase version in the equations. This is presumably from notation that is standard within your problem, but might not be the best notation for computer algebra. You are trying to find how the expression (w0-b)/(w1-w0) looks in terms of your other unknowns, but you're trying to do it "by hand" yet doing it "by hand" does not automatically generalize to the REAL problem you're trying to solve (you mention this is a toy to find out how to tackle a more complex problem). so perhaps I can give some helpful general advice: subst is for substituting things syntactically, ratsubst does a more mathematical substitution which is what you're trying to do with your other functions, I think. the "format" package can be useful for writing things in terms of polynomials of certain variables, it's a pretty heavy duty package so it can do a lot and may be overkill. ratsimp(a,b,c) will write a as a (ratio of) polynomials in b whose coefficients are polynomials in c. ratexpand(a) will write a as a sum of terms in a useful way. The way I would tackle your problem would be to create a new equation, and then use solve. eq1: r*U = b+lambda_u*(W0-U); eq2: r*W0 = w0 + lambda_e*(W1-W0) + sigma*(U-W0); eq3: r*W1 = p + sigma*(U-W1); eq4: W0-U=beta*(W1-U); eq5: Myexpr = (w0-b)/(W1-w0); solve([eq1,eq2,eq3,eq4,eq5],[W0,w0,W1,U,Myexpr]); this is straightforward but evidently doesn't meet your needs, but I don't know really what your needs are. Presumably you'd like to see some intermediate results, but which ones you want to see are not clear. You could, of course, always create other equations for intermediate results, such as mydenom=W1-w0 and include those in the things you want to solve for. From macrakis at alum.mit.edu Thu Mar 29 16:29:07 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 29 Mar 2012 17:29:07 -0400 Subject: [Maxima] infinite loop In-Reply-To: <1qp4nt7qku0.fsf@iceland.freeshell.org> References: <1qp4nt7qku0.fsf@iceland.freeshell.org> Message-ID: This is a misfeature (i.e. it is supposed to work this way, but it is a bad idea) in the way function/array names are evaluated. Unlike normal evaluation in Maxima, they do 'infinite evaluation'. A simple example: x: 'y$ y: 'x$ x(1) => infinite loop x[1] => infinite loop -s Tested in Maxima version: 5.26.0 Maxima build date: 13:32 1/18/2012 Host type: i686-apple-darwin11.2.0 Lisp implementation type: SBCL Lisp implementation version: 1.0.52.0-11e4aa5 On Thu, Mar 29, 2012 at 15:16, Leo Butler wrote: > The following leads to an infinite loop. Could someone explain why? > > f(x,y) := x(1)*y(2); > f(y,x); > > > -- > Leo Butler > SDF Public Access UNIX System - http://sdf.lonestar.org > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Thu Mar 29 17:22:21 2012 From: willisb at unk.edu (Barton Willis) Date: Thu, 29 Mar 2012 17:22:21 -0500 Subject: [Maxima] an empty list with 76 elements In-Reply-To: References: , <4F745A30.6060607@gmail.com> Message-ID: --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >The bug triggered by fourier_elim( [a[1]>1], [a[1]] ) appears to be >somewhere downstream from GENSYM-READABLE. Maxima compiled with Clozure CL handles this example OK: (%i3) fourier_elim( [a[1]>1], [a[1]] ); (%o3) [1 < a[1]] (%i4) build_info(); (%o4) ?%build_info("5.26.0","2012-03-06 05:48:14","i686-pc-mingw32","Clozure Common Lisp","Version 1.7-r14925M (WindowsX8664)") From tkpapp at gmail.com Fri Mar 30 04:05:08 2012 From: tkpapp at gmail.com (Tamas Papp) Date: Fri, 30 Mar 2012 09:05:08 +0000 (UTC) Subject: [Maxima] how to make maxima-mode start imaxima Message-ID: Hi, I am trying to figure out how to make maxima-mode start imaxima when something is sent to maxima but there is no maxima buffer yet. I found this in the archives: http://article.gmane.org/gmane.comp.mathematics.maxima.general/32916 but could not get it working (it breaks the interaction with the maxima buffer). Are there any other possibilities? Best, Tamas From c.j.sangwin at bham.ac.uk Thu Mar 29 07:44:31 2012 From: c.j.sangwin at bham.ac.uk (Christopher Sangwin) Date: Thu, 29 Mar 2012 13:44:31 +0100 Subject: [Maxima] an empty list with 76 elements In-Reply-To: References: Message-ID: <4CBBDBC075F4FA42A00426E1246A1D83331DF6DF6E@EPSEXC1.adf.bham.ac.uk> Dear Sara, In my understanding there is only one "empty list", which is [], the list with no elements. If you mean a list with 76 elements, each of which are "blank", you could use something like L:makelist(null,76); null isn't anything special in Maxima. It is just a variable name to which (I guess) you have assigned nothing yet. Using something like null, rather than 0, enables you to later tell the difference between a blank element and another which has been actually set to "0" (it is one of your examples below). Anyway, I hope this makes sense. Chris -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Sara Pashmin Sent: 29 March 2012 13:32 To: maxima at math.utexas.edu Subject: [Maxima] an empty list with 76 elements Hello, I made a list like A with elements from 0 until 7.5: A : makelist(i*0.1, i, 0, 75); equal to this list I need as well an empty list with the same size. I would like to know please how to make a "empty" list with for example 76 elements? Thanks and best regards Sara _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Fri Mar 30 00:28:49 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 30 Mar 2012 05:28:49 +0000 (UTC) Subject: [Maxima] an empty list with 76 elements References: <4F745A30.6060607@gmail.com> Message-ID: On 2012-03-29, Barton Willis wrote: > Maxima compiled with Clozure CL handles this example OK: > > (%i3) fourier_elim( [a[1]>1], [a[1]] ); > > (%o3) [1 < a[1]] > (%i4) build_info(); > > (%o4) ?%build_info("5.26.0","2012-03-06 05:48:14","i686-pc-mingw32","Clozure Common Lisp","Version 1.7-r14925M (WindowsX8664)") OK, looks like this bug was fixed recently. See commit 8455fc98. I don't get that error in a recent build from git. best, Robert Dodier From l_butler at users.sourceforge.net Fri Mar 30 11:15:37 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Fri, 30 Mar 2012 16:15:37 +0000 Subject: [Maxima] how to make maxima-mode start imaxima In-Reply-To: (message from Tamas Papp on Fri, 30 Mar 2012 09:05:08 +0000) Message-ID: <1qpzkayoyja.fsf@iceland.freeshell.org> Tamas Papp writes: > Hi, > > I am trying to figure out how to make maxima-mode start imaxima when > something is sent to maxima but there is no maxima buffer yet. I > found this in the archives: > > http://article.gmane.org/gmane.comp.mathematics.maxima.general/32916 > > but could not get it working (it breaks the interaction with the > maxima buffer). Are there any other possibilities? Advising maxima-send-region seems the most sensible way to do this, for the reasons explained in that message. Could you explain what you mean by 'it breaks the interaction with the maxima buffer'? In fact, could you back up and explain what you have done to produce what results, please. -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From hbaker1 at pipeline.com Fri Mar 30 16:51:27 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Fri, 30 Mar 2012 14:51:27 -0700 Subject: [Maxima] Google math Message-ID: Type sqrt(x*x+y*y)+3*cos(sqrt(x*x+y*y))+5 into Google. From lorenzo.isella at gmail.com Sat Mar 31 03:46:19 2012 From: lorenzo.isella at gmail.com (Lorenzo Isella) Date: Sat, 31 Mar 2012 10:46:19 +0200 Subject: [Maxima] Trouble in Solving Equation Message-ID: <20120331104619.6bca23e0489d1fc9051c001e@gmail.com> Dear All, I am not very much into Maxima, but I am using it to do some symbolic manipulations. Please have a look at the small snippet below assume (N>1000); assume (df>1); assume (b<0); assume (kf>1); assume (a>0); Rg:(N/kf)^(1/df); Rm:0.512*(1-1/log(2*N))*Rg+0.72*N^0.413; Req:N^(1/3); phi:N/Rgeo^3; Rm/Rgeo: a*Rg/Rgeo+b; myeq: Rm/Rgeo = c*Rg/Rgeo+d; solve(myeq, Rgeo); but then maxima does not return the solution for the equation which, to be honest, does not look so terrible. Am I making some mistake? Any suggestion is welcome. Many thanks Lorenzo From willisb at unk.edu Sat Mar 31 05:54:52 2012 From: willisb at unk.edu (Barton Willis) Date: Sat, 31 Mar 2012 05:54:52 -0500 Subject: [Maxima] Trouble in Solving Equation In-Reply-To: <20120331104619.6bca23e0489d1fc9051c001e@gmail.com> References: <20120331104619.6bca23e0489d1fc9051c001e@gmail.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- > Rg:(N/kf)^(1/df); > Rm:0.512*(1-1/log(2*N))*Rg+0.72*N^0.413; > Req:N^(1/3); > phi:N/Rgeo^3; > Rm/Rgeo: a*Rg/Rgeo+b; > myeq: Rm/Rgeo = c*Rg/Rgeo+d; > solve(myeq, Rgeo); The assignment Rm / Rgeo : a*Rg/Rgeo+b does something, but maybe it doesn't do what you think it does. To read the user documentation for assignment, enter ? :. Just guessing, maybe you want: (Rg:(N/kf)^(1/df), Rm:0.512*(1-1/log(2*N))*Rg+0.72*N^0.413, Req:N^(1/3), phi:N/Rgeo^3, myeq: Rm/Rgeo = c*Rg/Rgeo+d, solve(myeq, Rgeo)); And this works OK, I think. Let us know if this doesn't resolve your question. --Barton From tkpapp at gmail.com Sat Mar 31 07:38:57 2012 From: tkpapp at gmail.com (Tamas Papp) Date: Sat, 31 Mar 2012 12:38:57 +0000 (UTC) Subject: [Maxima] how to make maxima-mode start imaxima References: <1qpzkayoyja.fsf@iceland.freeshell.org> Message-ID: On Fri, 30 Mar 2012 16:15:37 +0000, Leo Butler wrote: > Tamas Papp writes: > >> Hi, >> >> I am trying to figure out how to make maxima-mode start imaxima when >> something is sent to maxima but there is no maxima buffer yet. I found >> this in the archives: >> >> http://article.gmane.org/gmane.comp.mathematics.maxima.general/32916 >> >> but could not get it working (it breaks the interaction with the maxima >> buffer). Are there any other possibilities? > > Advising maxima-send-region seems the most sensible way to do this, for > the reasons explained in that message. > > Could you explain what you mean by 'it breaks the interaction with the > maxima buffer'? In fact, could you back up and explain what you have > done to produce what results, please. Sorry, I should have done that originally. I can reproduce the bug like this: I open a Maxima source file, type the equations eq1: 1+a=2; eq2: a+b=c; then start pressing C-c C-c on each. I get (%i1) block(load(("/usr/share/emacs-snapshot/site-lisp/maxima/imaxima.lisp")), linenum:0)$ Maxima 5.2; (%i1) incorrect syntax: 5.2000000000000002 is not an infix operator MaximaSpace5.2; ^ (%i2) .0 http://m; incorrect syntax: HTTP is not an infix operator .0Spacehttp: ^ in the imaxima buffer. Otherwise, it is an imaxima buffer that works correctly when typed into directly. I have the following maxima-related configuration: (autoload 'maxima-mode "maxima" "Maxima mode" t) (autoload 'maxima "maxima" "Maxima interaction" t) (setq auto-mode-alist (cons '("\\.max" . maxima-mode) auto-mode-alist)) (autoload 'imaxima "imaxima" "Frontend for maxima with Image support" t) (autoload 'imath-mode "imath" "Imath mode for math formula input" t) (setq imaxima-use-maxima-mode-flag t imaxima-fnt-size "LARGE" imaxima-latex-preamble "\\usepackage{concrete}\\usepackage{euler}") (defadvice maxima-send-region (before maxima-start-imaxima first) "Ensures that imaxima is running and the correct flag is set." (setq imaxima-use-maxima-mode-flag t) (imaxima)) (ad-activate 'maxima-send-region) (defun customize-maxima-mode () (interactive) (setq imaxima-use-maxima-mode-flag t) (local-set-key (kbd "C-c C-i") 'maxima-complete)) (add-hook 'maxima-mode-hook 'customize-maxima-mode) (defun customize-imaxima () (interactive) (local-set-key (kbd "TAB") 'maxima-complete)) (add-hook 'imaxima-startup-hook 'customize-imaxima) Versions: $ dpkg -l 'maxima*' Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description +++-=================================-=================================-================================================================================== ii maxima 5.26.0-3 Computer algebra system -- base system ii maxima-doc 5.26.0-3 Computer algebra system -- documentation ii maxima-emacs 5.26.0-3 Computer algebra system -- emacs interface ii maxima-share 5.26.0-3 Computer algebra system -- extra code ii maxima-src 5.26.0-3 Computer algebra system -- source code $ dpkg -l 'emacs-snapshot*' Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description +++-=================================-=================================-================================================================================== ii emacs-snapshot 2:20120326-1 The GNU Emacs editor (development snapshot) ii emacs-snapshot-bin-common 2:20120326-1 The GNU Emacs editor's shared, architecture dependent files ii emacs-snapshot-common 2:20120326-1 The GNU Emacs editor's common infrastructure ii emacs-snapshot-el 2:20120326-1 GNU Emacs LISP (.el) files Best, Tamas From rswarbrick at gmail.com Sat Mar 31 05:00:29 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sat, 31 Mar 2012 11:00:29 +0100 Subject: [Maxima] Trouble in Solving Equation References: <20120331104619.6bca23e0489d1fc9051c001e@gmail.com> Message-ID: <171j49x3kr.ln2@hake.rswarbrick.dnsalias.com> Lorenzo Isella writes: > Dear All, > I am not very much into Maxima, but I am using it to do some symbolic manipulations. > Please have a look at the small snippet below > > assume (N>1000); > assume (df>1); > assume (b<0); > assume (kf>1); > assume (a>0); > Rg:(N/kf)^(1/df); > Rm:0.512*(1-1/log(2*N))*Rg+0.72*N^0.413; > Req:N^(1/3); > > phi:N/Rgeo^3; > Rm/Rgeo: a*Rg/Rgeo+b; > myeq: Rm/Rgeo = c*Rg/Rgeo+d; > > solve(myeq, Rgeo); > > but then maxima does not return the solution for the equation which, to be honest, does not look so terrible. > Am I making some mistake? > Any suggestion is welcome. > Many thanks > > Lorenzo Your problem arises because of the > Rm/Rgeo: a*Rg/Rgeo+b; line. I'm not quite sure what Maxima tries to do here: I think it allows assignment to non-atoms so that code like this works: (%i20) [a,b] : [3,4]; (%o20) [3, 4] (%i21) a; b; (%o21) 3 (%o22) 4 But then code like this is strange: (%i24) a/b : 3/4; (%o24) 4 (%i25) a; b; (%o25) 3 3 (%o26) - 4 Maybe a Maxima guru can explain what's going on here and why anything but MLIST is allowed as the top-level operator for the left hand value of an assignment? Anyway, to solve the problem you were having, just insert the value you were giving Rm/Rgeo on the next line: (%i1) assume (N>1000)$ assume (df>1)$ assume (b<0)$ assume (kf>1)$ assume (a>0)$ (%i6) Rg:(N/kf)^(1/df); 1/df N (%o6) ------ 1/df kf (%i7) Rm:0.512*(1-1/log(2*N))*Rg+0.72*N^0.413; 1/df 1 0.512 N (1 - --------) log(2 N) 0.413 (%o7) -------------------------- + 0.72 N 1/df kf (%i8) Req:N^(1/3); 1/3 (%o8) N (%i9) phi:N/Rgeo^3; N (%o9) ----- 3 Rgeo (%i10) myeq: a*Rg/Rgeo+b = c*Rg/Rgeo+d; 1/df 1/df a N c N (%o10) ----------- + b = ----------- + d 1/df 1/df kf Rgeo kf Rgeo (%i11) solve(myeq, Rgeo); 1/df (c - a) N (%o11) [Rgeo = - --------------] 1/df (d - b) kf Tada! Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From l_butler at users.sourceforge.net Sat Mar 31 09:06:01 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Sat, 31 Mar 2012 14:06:01 +0000 Subject: [Maxima] how to make maxima-mode start imaxima In-Reply-To: (message from Tamas Papp on Sat, 31 Mar 2012 12:38:57 +0000) Message-ID: <1qpvclkq306.fsf@iceland.freeshell.org> Tamas Papp writes: > On Fri, 30 Mar 2012 16:15:37 +0000, Leo Butler wrote: > >> Tamas Papp writes: >> >>> Hi, >>> >>> I am trying to figure out how to make maxima-mode start imaxima when >>> something is sent to maxima but there is no maxima buffer yet. I found >>> this in the archives: >>> >>> http://article.gmane.org/gmane.comp.mathematics.maxima.general/32916 >>> >>> but could not get it working (it breaks the interaction with the maxima >>> buffer). Are there any other possibilities? >> >> Advising maxima-send-region seems the most sensible way to do this, for >> the reasons explained in that message. >> >> Could you explain what you mean by 'it breaks the interaction with the >> maxima buffer'? In fact, could you back up and explain what you have >> done to produce what results, please. > > Sorry, I should have done that originally. > No worries. Try this: (defadvice maxima-send-region (before maxima-start-imaxima first) "Ensures that imaxima is running and the correct flag is set." (setq imaxima-use-maxima-mode-flag t) (unless (get-buffer maxima-buffer-name) (with-temp-buffer (imaxima)))) (ad-activate 'maxima-send-region) > I can reproduce the bug like this: I open a Maxima source file, type the > equations > > eq1: 1+a=2; > eq2: a+b=c; > > then start pressing C-c C-c on each. I get > > (%i1) block(load(("/usr/share/emacs-snapshot/site-lisp/maxima/imaxima.lisp")), linenum:0)$ > Maxima 5.2; > > (%i1) incorrect syntax: 5.2000000000000002 is not an infix operator > MaximaSpace5.2; > ^ > (%i2) .0 http://m; > incorrect syntax: HTTP is not an infix operator > .0Spacehttp: > ^ > > in the imaxima buffer. Otherwise, it is an imaxima buffer that works > correctly when typed into directly. I can't reproduce this exactly. When I use the advice without wrapping the call to imaxima in a with-temp-buffer macro, I get an 'args out of range' error--presumably because emacs is in the *maxima* buffer when the call to maxima-send-region is called. By wrapping the call to imaxima in a with-temp-buffer macro, I ensure that maxima-send-region is called in the source buffer. I am not sure if this will fix all your problems, though. To me, it looks like comint mode is messing up input and output. > > I have the following maxima-related configuration: > > (autoload 'maxima-mode "maxima" "Maxima mode" t) > (autoload 'maxima "maxima" "Maxima interaction" t) > (setq auto-mode-alist (cons '("\\.max" . maxima-mode) auto-mode-alist)) > (autoload 'imaxima "imaxima" "Frontend for maxima with Image support" t) > (autoload 'imath-mode "imath" "Imath mode for math formula input" t) > (setq imaxima-use-maxima-mode-flag t > imaxima-fnt-size "LARGE" > imaxima-latex-preamble "\\usepackage{concrete}\\usepackage{euler}") > > (defadvice maxima-send-region (before maxima-start-imaxima first) > "Ensures that imaxima is running and the correct flag is set." > (setq imaxima-use-maxima-mode-flag t) > (imaxima)) > > (ad-activate 'maxima-send-region) > > (defun customize-maxima-mode () > (interactive) > (setq imaxima-use-maxima-mode-flag t) > (local-set-key (kbd "C-c C-i") 'maxima-complete)) > > (add-hook 'maxima-mode-hook 'customize-maxima-mode) > > (defun customize-imaxima () > (interactive) > (local-set-key (kbd "TAB") 'maxima-complete)) > > (add-hook 'imaxima-startup-hook 'customize-imaxima) > > Versions: > > $ dpkg -l 'maxima*' > Desired=Unknown/Install/Remove/Purge/Hold > | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend > |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) > ||/ Name Version Description > +++-=================================-=================================-================================================================================== > ii maxima 5.26.0-3 Computer algebra system -- base system > ii maxima-doc 5.26.0-3 Computer algebra system -- documentation > ii maxima-emacs 5.26.0-3 Computer algebra system -- emacs interface > ii maxima-share 5.26.0-3 Computer algebra system -- extra code > ii maxima-src 5.26.0-3 Computer algebra system -- source code > $ dpkg -l 'emacs-snapshot*' > Desired=Unknown/Install/Remove/Purge/Hold > | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend > |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) > ||/ Name Version Description > +++-=================================-=================================-================================================================================== > ii emacs-snapshot 2:20120326-1 The GNU Emacs editor (development snapshot) > ii emacs-snapshot-bin-common 2:20120326-1 The GNU Emacs editor's shared, architecture dependent files > ii emacs-snapshot-common 2:20120326-1 The GNU Emacs editor's common infrastructure > ii emacs-snapshot-el 2:20120326-1 GNU Emacs LISP (.el) files > > Best, > > Tamas > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From tkpapp at gmail.com Sat Mar 31 09:13:33 2012 From: tkpapp at gmail.com (Tamas Papp) Date: Sat, 31 Mar 2012 14:13:33 +0000 (UTC) Subject: [Maxima] how to make maxima-mode start imaxima References: <1qpvclkq306.fsf@iceland.freeshell.org> Message-ID: On Sat, 31 Mar 2012 14:06:01 +0000, Leo Butler wrote: > No worries. Try this: > > (defadvice maxima-send-region (before maxima-start-imaxima first) > "Ensures that imaxima is running and the correct flag is set." (setq > imaxima-use-maxima-mode-flag t) (unless (get-buffer > maxima-buffer-name) > (with-temp-buffer (imaxima)))) > (ad-activate 'maxima-send-region) It works with the following modification: (defadvice maxima-send-region (before maxima-start-imaxima first) "Ensures that imaxima is running and the correct flag is set." (setq imaxima-use-maxima-mode-flag t) (unless (get-buffer "*maxima*") (with-temp-buffer (imaxima)))) (ad-activate 'maxima-send-region) The variable maxima-buffer-name is not defined in the version I am using. Is there a way to show the (i)maxima window automatically when it starts? Best, Tamas From rswarbrick at gmail.com Sat Mar 31 09:13:07 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sat, 31 Mar 2012 15:13:07 +0100 Subject: [Maxima] Trouble in Solving Equation References: <20120331104619.6bca23e0489d1fc9051c001e@gmail.com> Message-ID: Barton Willis writes: > The assignment Rm / Rgeo : a*Rg/Rgeo+b does something, but maybe it > doesn't do what you think it does. To read the user documentation for > assignment, enter ? :. My copy of the documentation doesn't seem to have any information about what a statement like (%i1) a/b : c/d; should do. The results are quite surprising to me, at least. Is there some logic behind them? Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From willisb at unk.edu Sat Mar 31 09:29:03 2012 From: willisb at unk.edu (Barton Willis) Date: Sat, 31 Mar 2012 09:29:03 -0500 Subject: [Maxima] Trouble in Solving Equation In-Reply-To: References: , <20120331104619.6bca23e0489d1fc9051c001e@gmail.com> Message-ID: ----maxima-bounces at math.utexas.edu wrote: ----- > My copy of the documentation doesn't seem to have any information about > what a statement like >??(%i1) a/b : c/d; > should do. The results are quite surprising to me, at least. Is there > some logic behind them? The assignment (a+b) : (c+d) gives an error. Surely a/b : c/d should also give an error. The user documentation doesn't say what happens for assignments to expressions such as a/b. --Barton From fateman at eecs.berkeley.edu Sat Mar 31 09:36:09 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 31 Mar 2012 07:36:09 -0700 Subject: [Maxima] Trouble in Solving Equation In-Reply-To: References: , <20120331104619.6bca23e0489d1fc9051c001e@gmail.com> Message-ID: <4F771659.5080801@eecs.berkeley.edu> On 3/31/12 7:29 AM, Barton Willis wrote: > ----maxima-bounces at math.utexas.edu wrote: ----- > >> My copy of the documentation doesn't seem to have any information about >> what a statement like >> (%i1) a/b : c/d; >> should do. The results are quite surprising to me, at least. Is there >> some logic behind them? > The assignment (a+b) : (c+d) gives an error. Surely a/b : c/d should also give > an error. The user documentation doesn't say what happens for assignments to > expressions such as a/b. > > --Barton > _______________________________________________ > a/b:c/d parses as a/ (b:c/d) and so what happens is that b is assigned c/d, and then the value a/(c/d) or a*d/c is returned. (a/b):(c/d) gives an error message. note that a+b:c+d does not give an error. RJF From l_butler at users.sourceforge.net Sat Mar 31 10:04:44 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Sat, 31 Mar 2012 15:04:44 +0000 Subject: [Maxima] how to make maxima-mode start imaxima In-Reply-To: (message from Tamas Papp on Sat, 31 Mar 2012 14:13:33 +0000) Message-ID: <1qpsjgoq0ab.fsf@iceland.freeshell.org> Tamas Papp writes: > On Sat, 31 Mar 2012 14:06:01 +0000, Leo Butler wrote: > >> No worries. Try this: >> >> (defadvice maxima-send-region (before maxima-start-imaxima first) >> "Ensures that imaxima is running and the correct flag is set." (setq >> imaxima-use-maxima-mode-flag t) (unless (get-buffer >> maxima-buffer-name) >> (with-temp-buffer (imaxima)))) >> (ad-activate 'maxima-send-region) > > It works with the following modification: > > (defadvice maxima-send-region (before maxima-start-imaxima first) > "Ensures that imaxima is running and the correct flag is set." > (setq imaxima-use-maxima-mode-flag t) > (unless (get-buffer "*maxima*") > (with-temp-buffer (imaxima)))) > (ad-activate 'maxima-send-region) > > The variable maxima-buffer-name is not defined in the version I am > using. Ahh, sorry, that is a personal customisation. > > Is there a way to show the (i)maxima window automatically when it > starts? You can add the following after advice: (defadvice maxima-send-region (after show-maxima-buffer last) "Show the *maxima* buffer after sending input." (ignore-errors (set-window-buffer 1 "*maxima*"))) In my configuration, this will split the window to show the *maxima* buffer, but the active buffer remains the source buffer. -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From nijso at hotmail.com Sun Apr 1 08:09:23 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Sun, 1 Apr 2012 15:09:23 +0200 Subject: [Maxima] separation of variables Message-ID: Dear all, I have written a function separable(expr,x,y) that checks if expr is separable into f(x) and g(y) and returns [f,g]. The algorithm is based on Cid (2009), webs.uvigo.es/angelcid/Archivos/Papers/IJMEST.pdf. But the algorithm sometimes introduces an arbitrary constant, such that it returns [A*f(x),g(y)/A]. Here is an example: (%i01) expr:exp(x*x+y*y)*(cos(x+y)+cos(x-y)); (%i02) grind(separable(expr,x,y)); [%e^x^2*cos(x),2*%e^y^2*cos(y)]$ (%o02) done (%i03) expr:y/(sin(x+3.5)+5); (%i04) grind(separable(expr,x,y)); [4.64921677231038/(sin(x+3.5)+5),.2150899923522087*y]$ (%o46) done The first example worked fine, but the second one introduced an arbitrary constant (sin(7/2)+5=4.6492... and 1/(sin(7/2)+5)=0.2150...). Is there a maxima way of finding the greatest common constant factor A in two expressions? Or is it possible to find the largest subexpression that is independent of x,y? At the moment I am thinking of using gcd(Ans[1],1/Ans[2]) and gcd(Ans[2],1/Ans[1]) and take the one that is independent on x,y as my premultiplication factor, but there may be a better way? Also, are there limitations to the input of gcd that make it fail for more general/exotic input expressions? -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sun Apr 1 09:46:44 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 01 Apr 2012 07:46:44 -0700 Subject: [Maxima] separation of variables In-Reply-To: References: Message-ID: <4F786A54.9000402@eecs.berkeley.edu> On 4/1/12 6:09 AM, nijso beishuizen wrote: > Dear all, > > I have written a function separable(expr,x,y) that checks if expr is > separable into f(x) and g(y) and returns [f,g]. The algorithm is based > on Cid (2009), webs.uvigo.es/angelcid/Archivos/Papers/IJMEST.pdf. > > But the algorithm sometimes introduces an arbitrary constant, such > that it returns [A*f(x),g(y)/A]. > .... You could look at 'content', however the gcd of floating point numbers is officially not defined. You might have to call content more than once, as it is defined. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sun Apr 1 13:06:17 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 1 Apr 2012 12:06:17 -0600 Subject: [Maxima] Substituting a value for a differential function In-Reply-To: References: <4F71E0C1.9020600@fe.up.pt> <4F72B71C.10709@fe.up.pt> Message-ID: On 3/28/12, Barton Willis wrote: > Putative bug: > > (%i1) (a : b, b : c, c : d)$ > > Should be b[x], not d[x], I think: > > (%i2) a[x]; > (%o2) d[x] Not a bug, but a misfeature; the code works as intended, but the intent is questionable. I looked into this, and there is a loop in MEVAL1 which reevaluates the name of the function. The code is pretty convoluted -- I'm guessing it could be simplified a lot. I don't know the motivation for reevaluating function names. It would be interesting to disable that somehow to find out what, if anything, in existing Maxima code (e.g. share) depends on it. best Robert Dodier From macrakis at alum.mit.edu Sun Apr 1 14:44:02 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 1 Apr 2012 15:44:02 -0400 Subject: [Maxima] Substituting a value for a differential function In-Reply-To: References: <4F71E0C1.9020600@fe.up.pt> <4F72B71C.10709@fe.up.pt> Message-ID: Yes, please see my note from Thursday: ---------- Forwarded message ---------- From: Stavros Macrakis Date: Thu, Mar 29, 2012 at 17:29 Subject: Re: [Maxima] infinite loop To: Leo Butler Cc: maxima at math.utexas.edu This is a misfeature (i.e. it is supposed to work this way, but it is a bad idea) in the way function/array names are evaluated. Unlike normal evaluation in Maxima, they do 'infinite evaluation'. A simple example: x: 'y$ y: 'x$ x(1) => infinite loop x[1] => infinite loop -s Tested in Maxima version: 5.26.0 Maxima build date: 13:32 1/18/2012 Host type: i686-apple-darwin11.2.0 Lisp implementation type: SBCL Lisp implementation version: 1.0.52.0-11e4aa5 On Thu, Mar 29, 2012 at 15:16, Leo Butler wrote: > The following leads to an infinite loop. Could someone explain why? > > f(x,y) := x(1)*y(2); > f(y,x); > > > -- > Leo Butler > SDF Public Access UNIX System - http://sdf.lonestar.org > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > On Sun, Apr 1, 2012 at 14:06, Robert Dodier wrote: > On 3/28/12, Barton Willis wrote: > > > Putative bug: > > > > (%i1) (a : b, b : c, c : d)$ > > > > Should be b[x], not d[x], I think: > > > > (%i2) a[x]; > > (%o2) d[x] > > Not a bug, but a misfeature; the code works as intended, > but the intent is questionable. > > I looked into this, and there is a loop in MEVAL1 which reevaluates > the name of the function. The code is pretty convoluted -- I'm guessing > it could be simplified a lot. > > I don't know the motivation for reevaluating function names. > It would be interesting to disable that somehow to find out what, > if anything, in existing Maxima code (e.g. share) depends on it. > > best > > Robert Dodier > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarapashm at googlemail.com Mon Apr 2 09:35:34 2012 From: sarapashm at googlemail.com (Sara Pashmin) Date: Mon, 2 Apr 2012 16:35:34 +0200 Subject: [Maxima] x-elements of solve and the list "x" Message-ID: Hello, I try to make a list like "x" from the solve function as the following: for i:1 thru 3 step 1 do ( K: solve([ i*x[i]^2+y[i]=2, i*x[i]^2+z[i]=2, x[i]+2*i*y[i]=4],[x[i],y[i],z[i]]), display(K), display(x[i])); The answer of Maxima is: (%o27) K=[[x[1]=1/2,y[1]=7/4,z[1]=7/4],[x[1]=0,y[1]=2,z[1]=2]] x[1]=x[1] K=[[x[2]=(sqrt(129)+1)/16,y[2]=-(sqrt(3)*sqrt(43)-63)/64,z[2]=-(sqrt(3)*sqrt(43)-63)/64],[x[2]=-(sqrt(129)-1)/16,y[2]=(sqrt(3)*sqrt(43)+63)/64,z[2]=(sqrt(3)*sqrt(43)+63)/64]] x[2]=x[2] K=[[x[3]=(sqrt(577)+1)/36,y[3]=-(sqrt(577)-143)/216,z[3]=-(sqrt(577)-143)/216],[x[3]=-(sqrt(577)-1)/36,y[3]=(sqrt(577)+143)/216,z[3]=(sqrt(577)+143)/216]] x[3]=x[3] What I expected is: x[1]=1/2 x[2]=(sqrt(129)+1)/16 x[3]=sqrt(577)+1)/36 But the list "x" does not contain any x-elements of solve and I don't know why. I would be happy for any help. Thanks Sara From fateman at eecs.berkeley.edu Mon Apr 2 09:42:23 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 02 Apr 2012 07:42:23 -0700 Subject: [Maxima] x-elements of solve and the list "x" In-Reply-To: References: Message-ID: <4F79BACF.2040706@eecs.berkeley.edu> On 4/2/2012 7:35 AM, Sara Pashmin wrote: > But the list "x" does not contain any x-elements of solve and I don't know why. > > I would be happy for any help. > > Thanks > Sara > I think your difficulty can be solved by globalsolve : true$ By default, the unknowns are not assigned values. From yasuaki.honda at gmail.com Mon Apr 2 10:21:44 2012 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Tue, 3 Apr 2012 00:21:44 +0900 Subject: [Maxima] expintegral_ei() bug on convergence Message-ID: Dear all, It seems that the Maxima function expintegral_ei() behaves unexpectedly for some complex arguments. (There should be some bugs in the implementation). Specifically, considering a line log(20.0)/2+%i*t on the complex plane and t gets increasing, such as t=30, 40, 50. the values can (%i22) expintegral_ei(log(20.0)/2+30*%i); (%o22) 3.116181583331404*%i-.1466880831183789 (%i23) expintegral_ei(log(20.0)/2+40*%i); (%o23) 3.205076248461513*%i+.1490949857975915 (%i24) expintegral_ei(log(20.0)/2+50*%i); (%o24) 1766.649087960532-1098.205534849491*%i So, (%o24) indicates that somewhere betwee log(20.0)/2+40*%i and log(20.0)/2+50*%i, there is a point where expintegral_ei() starts unstable ( not converge). This function, however, should converge for these values. (See below for the values obtained using mpmath in python). >>> ei(log(20.0)/2+30j) (-0.146702095677588 + 3.11618365490682j) >>> ei(log(20.0)/2+40j) (0.0823128975103259 + 3.21713799038662j) >>> ei(log(20.0)/2+50j) (-0.0225961649812214 + 3.05509271574427j) Thanks and best regards, Yasuaki Honda, Chiba, Japan -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Mon Apr 2 10:52:58 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 2 Apr 2012 08:52:58 -0700 Subject: [Maxima] expintegral_ei() bug on convergence In-Reply-To: References: Message-ID: 2012/4/2 ???? > Dear all, > > It seems that the Maxima function expintegral_ei() behaves unexpectedly for > some complex arguments. (There should be some bugs in the implementation). > > Specifically, considering a line log(20.0)/2+%i*t on the complex plane and > t gets > increasing, such as t=30, 40, 50. > the values can > (%i22) expintegral_ei(log(20.0)/2+30*%i); > (%o22) 3.116181583331404*%i-.1466880831183789 > > (%i23) expintegral_ei(log(20.0)/2+40*%i); > (%o23) 3.205076248461513*%i+.1490949857975915 > > (%i24) expintegral_ei(log(20.0)/2+50*%i); > (%o24) 1766.649087960532-1098.205534849491*%i > > So, (%o24) indicates that somewhere betwee log(20.0)/2+40*%i and > log(20.0)/2+50*%i, > there is a point where expintegral_ei() starts unstable ( not converge). > This function, > however, should converge for these values. (See below for the values > obtained using > mpmath in python). > > Thanks for reporting this. It looks like it's really an issue with expintegral_e. Maxima compute expintegral_ei(z) using expintegral_e(1,-z), and the expIntegral_e appears to have problems because it's using a series. I think if the continued fraction is used instead, the problem goes away. I'll look into it. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From l_butler at users.sourceforge.net Mon Apr 2 11:25:15 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Mon, 02 Apr 2012 12:25:15 -0400 Subject: [Maxima] how to make maxima-mode start imaxima References: <1qpsjgoq0ab.fsf@iceland.freeshell.org> Message-ID: <87y5qerthw.fsf@users.sourceforge.net> Leo Butler writes: > Tamas Papp writes: > >> On Sat, 31 Mar 2012 14:06:01 +0000, Leo Butler wrote: >> >>> No worries. Try this: >>> >>> (defadvice maxima-send-region (before maxima-start-imaxima first) >>> "Ensures that imaxima is running and the correct flag is set." (setq >>> imaxima-use-maxima-mode-flag t) (unless (get-buffer >>> maxima-buffer-name) >>> (with-temp-buffer (imaxima)))) >>> (ad-activate 'maxima-send-region) >> >> It works with the following modification: >> >> (defadvice maxima-send-region (before maxima-start-imaxima first) >> "Ensures that imaxima is running and the correct flag is set." >> (setq imaxima-use-maxima-mode-flag t) >> (unless (get-buffer "*maxima*") >> (with-temp-buffer (imaxima)))) >> (ad-activate 'maxima-send-region) >> >> The variable maxima-buffer-name is not defined in the version I am >> using. > > Ahh, sorry, that is a personal customisation. > >> >> Is there a way to show the (i)maxima window automatically when it >> starts? > > You can add the following after advice: > > (defadvice maxima-send-region (after show-maxima-buffer last) > "Show the *maxima* buffer after sending input." > (ignore-errors (set-window-buffer 1 "*maxima*"))) > > In my configuration, this will split the window to show the *maxima* > buffer, but the active buffer remains the source buffer. After looking into this, I see maxima-send-region calls maxima-display-buffer at the end, so you should not need to add this advice. -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From macrakis at alum.mit.edu Mon Apr 2 19:14:41 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 2 Apr 2012 17:14:41 -0700 Subject: [Maxima] x-elements of solve and the list "x" In-Reply-To: References: Message-ID: ? What do you mean by "the list x"? There is no list x -- there are subscripted formal variables called x[1], x[2], etc. And solve correctly finds 2 solutions for each equation -- so there is not one list of solutions. Setting globalsolve:true will assign values to solved-for variables, but only for *linear* equations where the solutions are unique. If you want to construct a list of (say) the positive solutions to your equations, you will have to do a little more programming work.... -s On Mon, Apr 2, 2012 at 07:35, Sara Pashmin wrote: > Hello, > > I try to make a list like "x" from the solve function as the following: > > for i:1 thru 3 step 1 do > ( K: solve([ i*x[i]^2+y[i]=2, i*x[i]^2+z[i]=2, > x[i]+2*i*y[i]=4],[x[i],y[i],z[i]]), > display(K), > display(x[i])); > > The answer of Maxima is: > (%o27) > K=[[x[1]=1/2,y[1]=7/4,z[1]=7/4],[x[1]=0,y[1]=2,z[1]=2]] > x[1]=x[1] > > K=[[x[2]=(sqrt(129)+1)/16,y[2]=-(sqrt(3)*sqrt(43)-63)/64,z[2]=-(sqrt(3)*sqrt(43)-63)/64],[x[2]=-(sqrt(129)-1)/16,y[2]=(sqrt(3)*sqrt(43)+63)/64,z[2]=(sqrt(3)*sqrt(43)+63)/64]] > x[2]=x[2] > > K=[[x[3]=(sqrt(577)+1)/36,y[3]=-(sqrt(577)-143)/216,z[3]=-(sqrt(577)-143)/216],[x[3]=-(sqrt(577)-1)/36,y[3]=(sqrt(577)+143)/216,z[3]=(sqrt(577)+143)/216]] > x[3]=x[3] > > > What I expected is: > x[1]=1/2 > x[2]=(sqrt(129)+1)/16 > x[3]=sqrt(577)+1)/36 > But the list "x" does not contain any x-elements of solve and I don't know > why. > > I would be happy for any help. > > Thanks > Sara > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yasuaki.honda at gmail.com Tue Apr 3 02:24:07 2012 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Tue, 3 Apr 2012 16:24:07 +0900 Subject: [Maxima] expintegral_ei() bug on convergence In-Reply-To: References: Message-ID: Hi Raymond san, Thanks for looking into this problem. When you create a fix and want to test it, drop me the code and I will test it. Thanks and best regards, Yasuaki Honda, Chiba, Japan 2012?4?3?0:52 Raymond Toy : > > > 2012/4/2 ???? > >> Dear all, >> >> It seems that the Maxima function expintegral_ei() behaves unexpectedly >> for >> some complex arguments. (There should be some bugs in the implementation). >> >> Specifically, considering a line log(20.0)/2+%i*t on the complex plane >> and t gets >> increasing, such as t=30, 40, 50. >> the values can >> (%i22) expintegral_ei(log(20.0)/2+30*%i); >> (%o22) 3.116181583331404*%i-.1466880831183789 >> >> (%i23) expintegral_ei(log(20.0)/2+40*%i); >> (%o23) 3.205076248461513*%i+.1490949857975915 >> >> (%i24) expintegral_ei(log(20.0)/2+50*%i); >> (%o24) 1766.649087960532-1098.205534849491*%i >> >> So, (%o24) indicates that somewhere betwee log(20.0)/2+40*%i and >> log(20.0)/2+50*%i, >> there is a point where expintegral_ei() starts unstable ( not converge). >> This function, >> however, should converge for these values. (See below for the values >> obtained using >> mpmath in python). >> >> Thanks for reporting this. It looks like it's really an issue with > expintegral_e. Maxima compute expintegral_ei(z) using expintegral_e(1,-z), > and the expIntegral_e appears to have problems because it's using a > series. I think if the continued fraction is used instead, the problem > goes away. > > I'll look into it. > > Ray > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tkpapp at gmail.com Tue Apr 3 03:48:18 2012 From: tkpapp at gmail.com (Tamas Papp) Date: Tue, 3 Apr 2012 08:48:18 +0000 (UTC) Subject: [Maxima] macros (or similar) in Maxima Message-ID: Hi, Can I achieve the effect of texput(W10,"W_{10}")$ texput(W11,"W_{11}")$ texput(W20,"W_{20}")$ texput(W21,"W_{21}")$ texput(W22,"W_{22}")$ texput(w10,"w_{10}")$ texput(w11,"w_{11}")$ texput(w20,"w_{20}")$ texput(w21,"w_{21}")$ texput(w22,"w_{22}")$ texput(g10,"g_{10}")$ texput(g11,"g_{11}")$ texput(g20,"g_{20}")$ texput(g21,"g_{21}")$ texput(g22,"g_{22}")$ with some kind of macro in Maxima? This is how I attempted to do it (not with a macro, but by calling texput directly): :lisp (flet ((texputall (prefix &key (latex prefix) (subscripts '("10" "11" "20" "21" "22"))) (loop for subscript in subscripts do (mfuncall '$texput (make-symbol (format nil "$~A~A" prefix subscript)) (format nil "~A_{~A}" latex subscript))))) (loop for s in '("w" "W" "g") do (texputall s))) but it didn't work (Lisp error: (void-function mfuncall)). Generally, what's the best way to write (debug, etc) more complex CL constructs used in Maxima? I am using Emacs and I am familiar with SLIME, so it would be great if I could use it to write CL for Maxima somehow. It would be nice to get indentation in the code I write, also not being forced to put in on one line for :lisp. Best, Tamas From filonenko.mikhail at gmail.com Tue Apr 3 04:19:50 2012 From: filonenko.mikhail at gmail.com (Michael Filonenko) Date: Tue, 3 Apr 2012 12:19:50 +0300 Subject: [Maxima] macros (or similar) in Maxima In-Reply-To: References: Message-ID: Hi, Tamas. May be it will be usefull for you. I made some changes in maxima to use it in common lisp projects. This fork fully compatibly with original maxima, and I keep sources up-to-date to original repository. You can download sources here: https://github.com/filonenko-mikhail/embeddable-maxima/tarball/quicklisp Usage: ;;;;; COMMON LISP REPL (push "/path/to/sources/embaddalbe-maxima" asdf:*central-registry*) (ql:quickload :embeddable-maxima) ;;;; run maxima repl for tests for your cl implementation (cl-user::run) ;;;; MAXIMA REPL ;;;; run tests runt_testsuite(); quit(); ;;;;; COMMON LISP REPL ;;; Maxima does not export symbols, we go to it package. (in-package :maxima) ;;;; Make AST from string. Do NOT forget semicolon at the end of string. (macsyma-read-string "x:1+y;") -> ((MSETQ) $X ((MPLUS) 1 $Y)) ;;;; Evaluate returned AST (mfuncall '$ev *) -> ((MPLUS SIMP) 1 $Y) ;;;; Convert returned result AST to maxima string (displa *) 2012/4/3 Tamas Papp : > Hi, > > Can I achieve the effect of > > texput(W10,"W_{10}")$ > texput(W11,"W_{11}")$ > texput(W20,"W_{20}")$ > texput(W21,"W_{21}")$ > texput(W22,"W_{22}")$ > > texput(w10,"w_{10}")$ > texput(w11,"w_{11}")$ > texput(w20,"w_{20}")$ > texput(w21,"w_{21}")$ > texput(w22,"w_{22}")$ > > texput(g10,"g_{10}")$ > texput(g11,"g_{11}")$ > texput(g20,"g_{20}")$ > texput(g21,"g_{21}")$ > texput(g22,"g_{22}")$ > > with some kind of macro in Maxima? > > This is how I attempted to do it (not with a macro, but by calling texput directly): > > :lisp (flet ((texputall (prefix &key (latex prefix) (subscripts '("10" "11" "20" "21" "22"))) (loop for subscript in subscripts do (mfuncall '$texput (make-symbol (format nil "$~A~A" prefix subscript)) (format nil "~A_{~A}" latex subscript))))) (loop for s in '("w" "W" "g") do (texputall s))) > > but it didn't work (Lisp error: (void-function mfuncall)). > > Generally, what's the best way to write (debug, etc) more complex CL > constructs used in Maxima? ?I am using Emacs and I am familiar with > SLIME, so it would be great if I could use it to write CL for Maxima > somehow. ?It would be nice to get indentation in the code I write, > also not being forced to put in on one line for :lisp. > > Best, > > Tamas > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- With best regards, Michael Filonenko From sarapashm at googlemail.com Tue Apr 3 06:03:19 2012 From: sarapashm at googlemail.com (Sara Pashmin) Date: Tue, 3 Apr 2012 13:03:19 +0200 Subject: [Maxima] changing an equation into an allocation Message-ID: Hello, I try to eliminate the right side of the following equation, which I got from algsys-function: a = x+y but rhs(a) gives the answer: "0" For "a : x+y " rhs(a) gives the answer "x+y". Now it is my problem to change an equation into an allocation. I mean to change the equation "a=x+y" to "a: x+y" for eliminating the right side of the equation. I would be happy for any help. Thanks and regards, Sara From sarapashm at googlemail.com Tue Apr 3 06:03:21 2012 From: sarapashm at googlemail.com (Sara Pashmin) Date: Tue, 3 Apr 2012 13:03:21 +0200 Subject: [Maxima] changing an equation into an allocation Message-ID: Hello, I try to eliminate the right side of the following equation, which I got from algsys-function: a = x+y but rhs(a) gives the answer: "0" For "a : x+y " rhs(a) gives the answer "x+y". Now it is my problem to change an equation into an allocation. I mean to change the equation "a=x+y" to "a: x+y" for eliminating the right side of the equation. I would be happy for any help. Thanks and regards, Sara From tkpapp at gmail.com Tue Apr 3 06:54:14 2012 From: tkpapp at gmail.com (Tamas Papp) Date: Tue, 3 Apr 2012 11:54:14 +0000 (UTC) Subject: [Maxima] changing an equation into an allocation References: Message-ID: On Tue, 03 Apr 2012 13:03:19 +0200, Sara Pashmin wrote: > Hello, > > I try to eliminate the right side of the following equation, which I got > from algsys-function: > > a = x+y > > but rhs(a) gives the answer: "0" I guess 'a' is not defined. rhs returns 0 if 'a' is not an equation (or inequality, etc). You need to assign the resulting equation to a variable and take the rhs of that, eg eq1: 2*x+y=4; eq2: x+2*y=5; sol:algsys([eq1,eq2],[x,y]); solx:sol[1][1]; soly:sol[1][2]; rhs(solx); /* gives you 1 */ or do it directly: rhs(sol[1][1]); Best, Tamas From sarapashm at googlemail.com Tue Apr 3 07:23:58 2012 From: sarapashm at googlemail.com (Sara Pashmin) Date: Tue, 3 Apr 2012 14:23:58 +0200 Subject: [Maxima] changing an equation into an allocation In-Reply-To: References: Message-ID: Hi Tamas. thank you very much. It works. Best, Sara Am 3. April 2012 13:54 schrieb Tamas Papp : > On Tue, 03 Apr 2012 13:03:19 +0200, Sara Pashmin wrote: > >> Hello, >> >> I try to eliminate the right side of the following equation, which I got >> from algsys-function: >> >> a = x+y >> >> but rhs(a) gives the answer: "0" > > I guess 'a' is not defined. ?rhs returns 0 if 'a' is not an equation (or > inequality, etc). > > You need to assign the resulting equation to a variable and take the > rhs of that, eg > > eq1: 2*x+y=4; > eq2: x+2*y=5; > sol:algsys([eq1,eq2],[x,y]); > solx:sol[1][1]; > soly:sol[1][2]; > rhs(solx); /* gives you 1 */ > > or do it directly: > > rhs(sol[1][1]); > > Best, > > Tamas > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From maxima at etherjones.us Tue Apr 3 09:09:36 2012 From: maxima at etherjones.us (Ether Jones) Date: Tue, 3 Apr 2012 07:09:36 -0700 (PDT) Subject: [Maxima] use "for" loop to create list Message-ID: <1333462176.92237.YahooMailNeo@web161805.mail.bf1.yahoo.com> How do I create this list: f(x):=x^2; myList: [ [1, f(1)], [2, f(2)], [3, f(3)], [4, f(4)], [5, f(5)], [6, f(6)], [7, f(7)], [8, f(8)], [9, f(9)], [10,f(10)] ]; ... using a "for" loop? -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Tue Apr 3 09:33:28 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 03 Apr 2012 07:33:28 -0700 Subject: [Maxima] Fwd: Re: use "for" loop to create list In-Reply-To: <4F7B06DA.7060201@eecs.berkeley.edu> References: <4F7B06DA.7060201@eecs.berkeley.edu> Message-ID: <4F7B0A38.40706@eecs.berkeley.edu> -------- Original Message -------- Subject: Re: [Maxima] use "for" loop to create list Date: Tue, 03 Apr 2012 07:19:06 -0700 From: Richard Fateman To: Ether Jones On 4/3/2012 7:09 AM, Ether Jones wrote: > How do I create this list: > > f(x):=x^2; > > myList: [ > [1, f(1)], > [2, f(2)], ... mylist: makelist([i,i^2],i,1,10) or if you insist on a " for loop ', s:[], for i:1 thru 10 do s:cons([i,i^2],s), mylist: reverse(s), ... I had suggested (and, I think, implemented) a change to allow mylist: for i:1 thru 10 collect [i,i^2]; but that somehow didn't happen. The common lisp "loop" could be used as an inspiration for other extensions. RJF the implementation, waiting for someone to insert into the code, is in www.cs.berkeley.edu/~fateman/lisp.mdo.lisp which you can load in to your maxima and then the "collect" will work. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Tue Apr 3 10:25:52 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 3 Apr 2012 09:25:52 -0600 Subject: [Maxima] having trouble w/ git & rpm for 5.27 release Message-ID: Hi, I'm trying to pull together a 5.27 release and I ran into some problems. I can't devote much time to this for the next few weeks so your help will get us that much closer to a release. In fact if someone can take over the git & rpm stuff entirely, that would be awesome. (1) I created a branch-5_27 in git via git branch. I see that git checkout -b is recommended in various places. Is the effect of git branch any different from git checkout -b ? (1a) The only commit on branch-5_27 is to change the version number in configure.in to 5.27.0. If it makes things simpler, I'd be happy to nuke the branch and re-do the commit, it's no big deal. (2) I tagged 5.27.0 via git tag -a 5.27.0 and I can git checkout that tag. However, git tells me I'm in a "detached head" state. How did that happen? and what, if anything, should I do about it? (3) rpmbuild compiles Maxima successfully but then when it is trying to build the rpms, there is a long list of "installed but unpackaged" files -- at first glance it looks like all the files that are supposed to be in rpms. I suppose this menas rpmbuild is confused about directory names or something. Can someone investigate that? thanks for any info, Robert Dodier From robert.dodier at gmail.com Tue Apr 3 10:28:10 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 3 Apr 2012 09:28:10 -0600 Subject: [Maxima] having trouble w/ git & rpm for 5.27 release In-Reply-To: References: Message-ID: Oh, another bit of strangeness is that switching to branch-5_27 doesn't show the 5.27.0 version number in configure.in, although switching to the 5.27.0 tag does show it ... wonder what's up with that. best Robert Dodier From maxima at etherjones.us Tue Apr 3 10:35:01 2012 From: maxima at etherjones.us (Ether Jones) Date: Tue, 3 Apr 2012 08:35:01 -0700 (PDT) Subject: [Maxima] use "for" loop to create list In-Reply-To: <4F7B06DA.7060201@eecs.berkeley.edu> References: <1333462176.92237.YahooMailNeo@web161805.mail.bf1.yahoo.com> <4F7B06DA.7060201@eecs.berkeley.edu> Message-ID: <1333467301.84943.YahooMailNeo@web161803.mail.bf1.yahoo.com> . Thanks.? That's a whole lot easier than the way I was trying to do it: n: 10$ f(x):=x^2; h[i,j] := i$ MX: genmatrix (h,n,1)$ k[i,j] := i^(j+1)$ MY: genmatrix (k,n,1)$ X: list_matrix_entries(MX); Y: list_matrix_entries(MY); plot2d([discrete,X,Y]); I still haven't figured out how to effectively search the Maxima help.? If you don't know the word you're searching for (in this case "makelist"), sometimes it's hard to find what you need.? . ________________________________ From: Richard Fateman To: Ether Jones Sent: Tuesday, April 3, 2012 10:19 AM Subject: Re: [Maxima] use "for" loop to create list On 4/3/2012 7:09 AM, Ether Jones wrote: How do I create this list: > > >f(x):=x^2; > >myList: [ >[1, f(1)], >[2, f(2)], > ... mylist: makelist([i,i^2],i,1,10) or if you insist on a " for loop ', s:[], for i:1 thru 10 do s:cons([i,i^2],s), mylist: reverse(s), ... I had suggested (and, I think, implemented) a change to allow mylist: for i:1 thru 10 collect [i,i^2]; but that somehow didn't happen. The common lisp "loop" could be used as an inspiration for other extensions. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Apr 3 10:48:31 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 3 Apr 2012 08:48:31 -0700 Subject: [Maxima] macros (or similar) in Maxima In-Reply-To: References: Message-ID: On Tue, Apr 3, 2012 at 1:48 AM, Tamas Papp wrote: > Hi, > > Can I achieve the effect of > > texput(W10,"W_{10}")$ > texput(W11,"W_{11}")$ > texput(W20,"W_{20}")$ > texput(W21,"W_{21}")$ > texput(W22,"W_{22}")$ > > texput(w10,"w_{10}")$ > texput(w11,"w_{11}")$ > texput(w20,"w_{20}")$ > texput(w21,"w_{21}")$ > texput(w22,"w_{22}")$ > > texput(g10,"g_{10}")$ > texput(g11,"g_{11}")$ > texput(g20,"g_{20}")$ > texput(g21,"g_{21}")$ > texput(g22,"g_{22}")$ > > with some kind of macro in Maxima? > How about this: foo(var, n) := texput(concat(var, n), sconcat(var, "_{", n, "})); foo(W,10)$ tex(W10); -> $$W_{10}$$ for index in [10, 11, 20, 21, 22] do foo(W,index); > Generally, what's the best way to write (debug, etc) more complex CL > constructs used in Maxima? I am using Emacs and I am familiar with > SLIME, so it would be great if I could use it to write CL for Maxima > somehow. It would be nice to get indentation in the code I write, > also not being forced to put in on one line for :lisp. > Someone posted here a while ago about how to get maxima to work with slime. I haven't done that in many years. And I usually avoid writing in CL what I can do in maxima itself, although some things are easier in CL. If you have a specific case in mind, please share so that we can help. For debugging I just use prints (formats) in my CL and maxima code. I also start maxima with the -g option so that CL error drops me into the CL debugger and I can use that as I would normally. I never write anything important using :lisp. For that I just save it in a file as I would with any lisp code and use load("dir/file.lisp") to load it. If I want it compiled, I use :lisp to compile and load it. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Apr 3 11:23:32 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 3 Apr 2012 09:23:32 -0700 Subject: [Maxima] having trouble w/ git & rpm for 5.27 release In-Reply-To: References: Message-ID: Disclaimer: I'm not very good with git. On Tue, Apr 3, 2012 at 8:25 AM, Robert Dodier wrote: > Hi, > > I'm trying to pull together a 5.27 release and I ran into some problems. > I can't devote much time to this for the next few weeks so your help > will get us that much closer to a release. In fact if someone can take > over the git & rpm stuff entirely, that would be awesome. > > (1) I created a branch-5_27 in git via git branch. > I see that git checkout -b is recommended in various places. > Is the effect of git branch any different from git checkout -b ? > I think they're basically equivalent, except that git checkout -b creates the branch and them checks it out so that your working directory is now on the branch. git branch just creates it, but doesn't change the branch of the working directory. > > (1a) The only commit on branch-5_27 is to change the version > number in configure.in to 5.27.0. If it makes things simpler, > I'd be happy to nuke the branch and re-do the commit, it's no > big deal. > > (2) I tagged 5.27.0 via git tag -a 5.27.0 and I can git checkout > that tag. However, git tells me I'm in a "detached head" state. > How did that happen? and what, if anything, should I do about it? > I think that's correct. You checkout the tag and you get exactly that version. If you want to work on the branch you check out the branch, not the tag. Did you remember to push your new branch-5_27 branch to the repo? I didn't see any commit messages about any changes to that branch. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From l_butler at users.sourceforge.net Tue Apr 3 11:44:14 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Tue, 03 Apr 2012 16:44:14 +0000 Subject: [Maxima] having trouble w/ git & rpm for 5.27 release In-Reply-To: (message from Robert Dodier on Tue, 3 Apr 2012 09:25:52 -0600) Message-ID: <1qppqbopxy9.fsf@iceland.freeshell.org> Robert Dodier writes: > Hi, > > I'm trying to pull together a 5.27 release and I ran into some problems. > I can't devote much time to this for the next few weeks so your help > will get us that much closer to a release. In fact if someone can take > over the git & rpm stuff entirely, that would be awesome. > > (1) I created a branch-5_27 in git via git branch. > I see that git checkout -b is recommended in various places. > Is the effect of git branch any different from git checkout -b ? git branch lets you manipulate branches without changing your working copy. git checkout -b creates and then checks out a new branch. > > (1a) The only commit on branch-5_27 is to change the version > number in configure.in to 5.27.0. If it makes things simpler, > I'd be happy to nuke the branch and re-do the commit, it's no > big deal. > > (2) I tagged 5.27.0 via git tag -a 5.27.0 and I can git checkout > that tag. However, git tells me I'm in a "detached head" state. > How did that happen? and what, if anything, should I do about it? > git checkout branch-5_27 will let you do the work you need. git lets you check out tags, but there is no branch associated with the tag, so it leaves you in a 'detached head' state (i.e. an anonymous branch). HTH -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From macrakis at alum.mit.edu Tue Apr 3 13:00:49 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 3 Apr 2012 11:00:49 -0700 Subject: [Maxima] use "for" loop to create list In-Reply-To: <1333467301.84943.YahooMailNeo@web161803.mail.bf1.yahoo.com> References: <1333462176.92237.YahooMailNeo@web161805.mail.bf1.yahoo.com> <4F7B06DA.7060201@eecs.berkeley.edu> <1333467301.84943.YahooMailNeo@web161803.mail.bf1.yahoo.com> Message-ID: A word to the wise ... if you want helpful advice on this list, it is best to describe (ideally with an example) the *result* you want, not the method you think you want to use. Your question was "use 'for' loop to create list...". But in fact 'for' loops were not the issue. -s On Tue, Apr 3, 2012 at 08:35, Ether Jones wrote: > . > Thanks. That's a whole lot easier than the way I was trying to do it: > > n: 10$ > f(x):=x^2; > h[i,j] := i$ > MX: genmatrix (h,n,1)$ > k[i,j] := i^(j+1)$ > MY: genmatrix (k,n,1)$ > X: list_matrix_entries(MX); > Y: list_matrix_entries(MY); > plot2d([discrete,X,Y]); > > I still haven't figured out how to effectively search the Maxima help. If > you don't know the word you're searching for (in this case "makelist"), > sometimes it's hard to find what you need. > . > > > ------------------------------ > *From:* Richard Fateman > *To:* Ether Jones > *Sent:* Tuesday, April 3, 2012 10:19 AM > > *Subject:* Re: [Maxima] use "for" loop to create list > > On 4/3/2012 7:09 AM, Ether Jones wrote: > > How do I create this list: > > f(x):=x^2; > > myList: [ > [1, f(1)], > [2, f(2)], > > ... > > mylist: makelist([i,i^2],i,1,10) > > or if you insist on a " for loop ', > > s:[], > for i:1 thru 10 do s:cons([i,i^2],s), > mylist: reverse(s), > ... > > I had suggested (and, I think, implemented) a change to allow > > mylist: for i:1 thru 10 collect [i,i^2]; > > but that somehow didn't happen. > > The common lisp "loop" could be used as an inspiration for other > extensions. > > RJF > > > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From l_butler at users.sourceforge.net Tue Apr 3 13:21:12 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Tue, 03 Apr 2012 18:21:12 +0000 Subject: [Maxima] macros (or similar) in Maxima In-Reply-To: (message from Tamas Papp on Tue, 3 Apr 2012 08:48:18 +0000) Message-ID: <1qplimcptgn.fsf@iceland.freeshell.org> Tamas Papp writes: > Hi, > > Can I achieve the effect of > > texput(W10,"W_{10}")$ > texput(W11,"W_{11}")$ > texput(W20,"W_{20}")$ > texput(W21,"W_{21}")$ > texput(W22,"W_{22}")$ > > texput(w10,"w_{10}")$ > texput(w11,"w_{11}")$ > texput(w20,"w_{20}")$ > texput(w21,"w_{21}")$ > texput(w22,"w_{22}")$ > > texput(g10,"g_{10}")$ > texput(g11,"g_{11}")$ > texput(g20,"g_{20}")$ > texput(g21,"g_{21}")$ > texput(g22,"g_{22}")$ > > with some kind of macro in Maxima? This doesn't need a macro. But, anyhow, buildq lets you write macros in Maxima's own language. > > This is how I attempted to do it (not with a macro, but by calling texput directly): > > :lisp (flet ((texputall (prefix &key (latex prefix) (subscripts '("10" "11" "20" "21" "22"))) (loop for subscript in subscripts do (mfuncall '$texput (make-symbol (format nil "$~A~A" prefix subscript)) (format nil "~A_{~A}" latex subscript))))) (loop for s in '("w" "W" "g") do (texputall s))) > > but it didn't work (Lisp error: (void-function mfuncall)). > > Generally, what's the best way to write (debug, etc) more complex CL > constructs used in Maxima? I am using Emacs and I am familiar with > SLIME, so it would be great if I could use it to write CL for Maxima > somehow. It would be nice to get indentation in the code I write, > also not being forced to put in on one line for :lisp. You can use slime to run both a CL top-level and a Maxima top-level from the same Maxima lisp image. Here is the configuration I use with an up-to-date Debian testing installation: ;; see http://common-lisp.net/pipermail/slime-devel/2009-December/017018.html (defun load-swank-dont-close (port-filename encoding) (format "%S\n\n" `(progn (load ,(expand-file-name slime-backend slime-path) :verbose t) (funcall (read-from-string "swank-loader:init")) (funcall (read-from-string "swank:start-server") ,port-filename :coding-system ,(slime-coding-system-cl-name encoding) :dont-close t)))) (defun slime-init-fn-msbcl () (insert "(in-package :maxima)\n(run)\n") (comint-send-input)) (setq slime-lisp-implementations '((maxima-sbcl ("sbcl" "--core" "/path/to/maxima/src/binary-sbcl/maxima.core") :init-function slime-init-fn-msbcl :env ("SBCL_HOME=/usr/lib/sbcl") :init load-swank-dont-close ))) The *slime* buffer ends up in the CL package, and the *inferior-lisp* buffer is running a Maxima top level. Note that there is a reader macro that lets you enter Maxima code from the Lisp toplevel: #$ x:1 $ -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From l_butler at users.sourceforge.net Tue Apr 3 13:29:55 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Tue, 03 Apr 2012 18:29:55 +0000 Subject: [Maxima] use "for" loop to create list In-Reply-To: (message from Stavros Macrakis on Tue, 3 Apr 2012 11:00:49 -0700) Message-ID: <1qpiphgpt24.fsf@iceland.freeshell.org> > On Tue, Apr 3, 2012 at 08:35, Ether Jones wrote: > >> . >> Thanks. That's a whole lot easier than the way I was trying to do it: >> >> n: 10$ >> f(x):=x^2; >> h[i,j] := i$ >> MX: genmatrix (h,n,1)$ >> k[i,j] := i^(j+1)$ >> MY: genmatrix (k,n,1)$ >> X: list_matrix_entries(MX); >> Y: list_matrix_entries(MY); >> plot2d([discrete,X,Y]); >> >> I still haven't figured out how to effectively search the Maxima help. If >> you don't know the word you're searching for (in this case "makelist"), >> sometimes it's hard to find what you need. >> . Try ?? list This will give you a menu of items with `list' in their description. ---- Unfortunately, the Maxima help system tends to be only useful for helping users who need some details, and it tends to be pretty hard for novices to decipher. IMO, Ted Woollett's `Maxima by Example' series is the best documentation for novices and not-so novices to Maxima. http://www.csulb.edu/~woollett/ ---- There are other references here: http://maxima.sourceforge.net/documentation.html -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From ziegenbalg at ph-karlsruhe.de Tue Apr 3 12:27:37 2012 From: ziegenbalg at ph-karlsruhe.de (Jochen Ziegenbalg) Date: Tue, 3 Apr 2012 18:27:37 +0100 Subject: [Maxima] a Maxima program running under the Windows implementation but not under Linux implementation of Maxima / wxMaxima Message-ID: Ladies and gentlemen, in the appendix I send you a small Maxima program running without any problem under wxMaxima for Windows (wxMaxima 11.08.0 / Maxima 5.25.1) but not running under the (Ubuntu-) Linux implementation (wxMaxima 0.85 / Maxima 5.22.1). The purpose of the program is to convert a string into its bit structure (using the ASCII-code) and display this bit structure graphically. Under Windows the program runs as expected. Under Linux (after defining the "helper"-functions like Byte), calling the procedure StringToGraphic("Karlsruhe", yellow, black) results in the error message Maxima encountered a Lisp error: Error in Apply [or a callee]:The function NIL is undefined. Automatically continuing. ... I would be grateful for some clarification on why this is so ... and a hint on how to run the program under Linux. Thank you very much, Jochen Ziegenbalg -------------- next part -------------- A non-text attachment was scrubbed... Name: StringToGraphic.wxm Type: application/octet-stream Size: 1915 bytes Desc: not available URL: From keeganlt at mcmaster.ca Tue Apr 3 14:54:57 2012 From: keeganlt at mcmaster.ca (Lindsay Keegan) Date: Tue, 3 Apr 2012 15:54:57 -0400 Subject: [Maxima] Simplifying gamma distributions Message-ID: <3B9C6951-5D26-48A6-93E9-04125B4625D8@mcmaster.ca> I am trying to simplify: gamma(a+1)/gamma(a) and maxima keeps spitting out gamma(a+1)/gamma(a) but it should equal a. Does anyone know how to simplify this? Thank you, Lindsay Lindsay Keegan PhD Candidate Theoretical Biology Lab Department of Biology McMaster University -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Tue Apr 3 16:43:23 2012 From: willisb at unk.edu (Barton Willis) Date: Tue, 3 Apr 2012 16:43:23 -0500 Subject: [Maxima] Simplifying gamma distributions In-Reply-To: <3B9C6951-5D26-48A6-93E9-04125B4625D8@mcmaster.ca> References: <3B9C6951-5D26-48A6-93E9-04125B4625D8@mcmaster.ca> Message-ID: > I am trying to simplify: > > gamma(a+1)/gamma(a) and maxima keeps spitting out gamma(a+1)/gamma > (a) but it should equal a. > > Does anyone know how to simplify this? On way (%i6) gamma(a+1)/gamma(a); (%o6) gamma(a+1)/gamma(a) (%i7) minfactorial(makefact(%)); (%o7) a Maybe somebody knows a more direct way. Barton -------------- next part -------------- An HTML attachment was scrubbed... URL: From vi5u0-maxima at yahoo.co.uk Tue Apr 3 16:49:29 2012 From: vi5u0-maxima at yahoo.co.uk (Dan) Date: Tue, 3 Apr 2012 22:49:29 +0100 (BST) Subject: [Maxima] Simplifying gamma distributions In-Reply-To: <3B9C6951-5D26-48A6-93E9-04125B4625D8@mcmaster.ca> References: <3B9C6951-5D26-48A6-93E9-04125B4625D8@mcmaster.ca> Message-ID: On Tue, 3 Apr 2012, Lindsay Keegan wrote: > gamma(a+1)/gamma(a) and maxima keeps spitting out > gamma(a+1)/gamma(a) but it should equal a. You could try setting the option gamma_expand:true ; then doing gamma(a+1)/gamma(a) ; From toy.raymond at gmail.com Tue Apr 3 16:58:18 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 3 Apr 2012 14:58:18 -0700 Subject: [Maxima] Simplifying gamma distributions In-Reply-To: References: <3B9C6951-5D26-48A6-93E9-04125B4625D8@mcmaster.ca> Message-ID: On Tue, Apr 3, 2012 at 2:43 PM, Barton Willis wrote: > > > > I am trying to simplify: > > > > gamma(a+1)/gamma(a) and maxima keeps spitting out gamma(a+1)/gamma > > (a) but it should equal a. > > > > Does anyone know how to simplify this? > > On way > > (%i6) gamma(a+1)/gamma(a); > (%o6) gamma(a+1)/gamma(a) > > (%i7) minfactorial(makefact(%)); > (%o7) a > > Maybe somebody knows a more direct way. > This is what I usually do. It would be nice if there were a mingamma function. Something like mingamma(e) := makegamma(minfactorial(makefact(e))); ? Ray > > Barton > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From O.Kullmann at swansea.ac.uk Tue Apr 3 17:12:09 2012 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Tue, 3 Apr 2012 23:12:09 +0100 Subject: [Maxima] Simplifying gamma distributions In-Reply-To: References: <3B9C6951-5D26-48A6-93E9-04125B4625D8@mcmaster.ca> Message-ID: <20120403221209.GZ31642@cs-wsok.swan.ac.uk> What I don't understand: Why are there two functions, factorial and gamma? Is there a different pragmatics behind it? If not, shouldn't the simplifications yield the same? And if one is going for "maximal strength" simplification, shouldn't one always apply makefact, since apparently Maxima understands factorial better than gamma? Oliver On Tue, Apr 03, 2012 at 04:43:23PM -0500, Barton Willis wrote: > > I am trying to simplify: > > > > gamma(a+1)/gamma(a) and maxima keeps spitting out gamma(a+1)/gamma > > (a) but it should equal a. > > > > Does anyone know how to simplify this? > > On way > > (%i6) gamma(a+1)/gamma(a); > (%o6) gamma(a+1)/gamma(a) > > (%i7) minfactorial(makefact(%)); > (%o7) a > > Maybe somebody knows a more direct way. > > Barton > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From enrio at online.no Tue Apr 3 18:15:26 2012 From: enrio at online.no (Enrique Perez-Terron) Date: Wed, 04 Apr 2012 01:15:26 +0200 Subject: [Maxima] Q: How to control rewriting Message-ID: Hello, I have an expression of the form A*B*C*D EQ1: F = --------- E where C/E has a particular simplification. I would like to have this expression rewritten on the form C EQ2: F = A*B*D*--- E This would allow me to use, e.g. substpart( simplify(piece), EQ2, 2, 4 ) My question is how to produce EQ2 from EQ1, short of rewriting manually or copying and pasting. I am clumsy; when I do complex things manually I invariably do mistakes, forget a parenthesis or whatever, so I would like to have methods of doing this where I either get an error message or I get something that is mathematically equivalent to what I started with. Maybe A: part(EQ1, 2,1,1) B: part(EQ1, 2,1,2) C: part(EQ1, 2,1,3) D: part(EQ1, 2,1,4) E: part(EQ1, 2,2) F: part(EQ1, 1) EQ2: F = A*B*D*(C/E) EQ1 - EQ2 would be an approach, where the last line is the control. (Assume that the letters A-E are actually not in use up to this point.) Now, this could work, but it is quite a bit of writing. I wish something more legible too. How can I do this? Thanks Enrique From volkervannek at googlemail.com Tue Apr 3 19:21:25 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Wed, 4 Apr 2012 02:21:25 +0200 Subject: [Maxima] a Maxima program running under the Windows implementation but not under Linux implementation of Maxima / wxMaxima In-Reply-To: References: Message-ID: Hallo Jochen Ziegenbalg, I can confirm that your wxm file runs on Ubuntu with Maxima 5.26.0 and 5.25.1 but fails with 5.20.1. I can't tell about the version 5.22.1. The wxdraw2d function is a quite recent development if I am not mistaken. In a first step I would just replace the last line in your StringToGraphic function by a simple return value like 1 or so and check if it works without errors. StringToGraphic(Str, c0, c1) := ... LG : append(LG, [Gbit]) ), 1) ; Let us know what the result is. Volker van Nek 2012/4/3 Jochen Ziegenbalg > Ladies and gentlemen, > > in the appendix I send you a small Maxima program running without any > problem under wxMaxima for Windows (wxMaxima 11.08.0 / Maxima 5.25.1) > but not running under the (Ubuntu-) Linux implementation (wxMaxima > 0.85 / Maxima 5.22.1). > > The purpose of the program is to convert a string into its bit > structure (using the ASCII-code) and display this bit structure > graphically. > > Under Windows the program runs as expected. > > Under Linux (after defining the "helper"-functions like Byte), calling > the procedure > StringToGraphic("Karlsruhe", yellow, black) > results in the error message > > Maxima encountered a Lisp error: > Error in Apply [or a callee]:The function NIL is undefined. > Automatically continuing. > ... > > I would be grateful for some clarification on why this is so ... and a > hint on how to run the program under Linux. > > Thank you very much, > Jochen Ziegenbalg > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxima at etherjones.us Tue Apr 3 20:43:22 2012 From: maxima at etherjones.us (Ether Jones) Date: Tue, 3 Apr 2012 18:43:22 -0700 (PDT) Subject: [Maxima] use "for" loop to create list References: <1333462176.92237.YahooMailNeo@web161805.mail.bf1.yahoo.com> <4F7B06DA.7060201@eecs.berkeley.edu> <1333467301.84943.YahooMailNeo@web161803.mail.bf1.yahoo.com> Message-ID: <1333503802.17709.YahooMailNeo@web161805.mail.bf1.yahoo.com> This works too: (%i1)f(x):=x^2$ ????? m: [0,0,0,0,0]$ ????? for i: 1 thru 5 do m[i]: [i,f(i)]$ ????? m; (%o4) [[1,1],[2,4],[3,9],[4,16],[5,25]] ... except you have to "pre-declare" m to the right size or it won't work. -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Apr 3 20:47:22 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 03 Apr 2012 18:47:22 -0700 Subject: [Maxima] Simplifying gamma distributions In-Reply-To: <20120403221209.GZ31642@cs-wsok.swan.ac.uk> References: <3B9C6951-5D26-48A6-93E9-04125B4625D8@mcmaster.ca> <20120403221209.GZ31642@cs-wsok.swan.ac.uk> Message-ID: <4F7BA82A.7010408@gmail.com> On 4/3/12 3:12 PM, Oliver Kullmann wrote: > What I don't understand: > > Why are there two functions, factorial and gamma? Presumably for the same reason you will find x! and gamma(x) often used in the same book. > Is there a different pragmatics behind it? > If not, shouldn't the simplifications yield the same? > > And if one is going for "maximal strength" simplification, > shouldn't one always apply makefact, since apparently > Maxima understands factorial better than gamma? Or maybe someone can make minfactorial also work with gamma instead of just factorials. (That would be nicer, sort of, than also having a mingamma function.) Ray From toy.raymond at gmail.com Tue Apr 3 20:51:20 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 03 Apr 2012 18:51:20 -0700 Subject: [Maxima] Q: How to control rewriting In-Reply-To: References: Message-ID: <4F7BA918.4010009@gmail.com> On 4/3/12 4:15 PM, Enrique Perez-Terron wrote: > Hello, > > I have an expression of the form > > A*B*C*D > EQ1: F = --------- > E > > where C/E has a particular simplification. > > I would like to have this expression rewritten on the form > > C > EQ2: F = A*B*D*--- > E > > This would allow me to use, e.g. > > substpart( simplify(piece), EQ2, 2, 4 ) > > My question is how to produce EQ2 from EQ1, short of rewriting manually > or copying and pasting. Not sure exactly what you're trying to achieve other than getting EQ1 into a specific form that you can use. I'm not particularly good at this, but I would just do EQ1/(A*B*D). That will give you C/E and you can do your substpart and then multiply everything by A*B*D to get your new expression. Ray From toy.raymond at gmail.com Tue Apr 3 20:47:22 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 03 Apr 2012 18:47:22 -0700 Subject: [Maxima] Simplifying gamma distributions In-Reply-To: <20120403221209.GZ31642@cs-wsok.swan.ac.uk> References: <3B9C6951-5D26-48A6-93E9-04125B4625D8@mcmaster.ca> <20120403221209.GZ31642@cs-wsok.swan.ac.uk> Message-ID: <4F7BA82A.7010408@gmail.com> On 4/3/12 3:12 PM, Oliver Kullmann wrote: > What I don't understand: > > Why are there two functions, factorial and gamma? Presumably for the same reason you will find x! and gamma(x) often used in the same book. > Is there a different pragmatics behind it? > If not, shouldn't the simplifications yield the same? > > And if one is going for "maximal strength" simplification, > shouldn't one always apply makefact, since apparently > Maxima understands factorial better than gamma? Or maybe someone can make minfactorial also work with gamma instead of just factorials. (That would be nicer, sort of, than also having a mingamma function.) Ray From toy.raymond at gmail.com Tue Apr 3 20:51:20 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 03 Apr 2012 18:51:20 -0700 Subject: [Maxima] Q: How to control rewriting In-Reply-To: References: Message-ID: <4F7BA918.4010009@gmail.com> On 4/3/12 4:15 PM, Enrique Perez-Terron wrote: > Hello, > > I have an expression of the form > > A*B*C*D > EQ1: F = --------- > E > > where C/E has a particular simplification. > > I would like to have this expression rewritten on the form > > C > EQ2: F = A*B*D*--- > E > > This would allow me to use, e.g. > > substpart( simplify(piece), EQ2, 2, 4 ) > > My question is how to produce EQ2 from EQ1, short of rewriting manually > or copying and pasting. Not sure exactly what you're trying to achieve other than getting EQ1 into a specific form that you can use. I'm not particularly good at this, but I would just do EQ1/(A*B*D). That will give you C/E and you can do your substpart and then multiply everything by A*B*D to get your new expression. Ray From tkpapp at gmail.com Wed Apr 4 06:26:41 2012 From: tkpapp at gmail.com (Tamas Papp) Date: Wed, 4 Apr 2012 11:26:41 +0000 (UTC) Subject: [Maxima] subseq, array slice Message-ID: Hi, 1. Is there a Maxima equivalent for CL's subseq? 2. Is there something similar for arrays (similar to a[i:j,k:l] in R)? Best, Tamas From volkervannek at googlemail.com Wed Apr 4 07:10:23 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Wed, 4 Apr 2012 14:10:23 +0200 Subject: [Maxima] a Maxima program running under the Windows implementation but not under Linux implementation of Maxima / wxMaxima In-Reply-To: References: Message-ID: Hello, I would download a newer version from debian (Ubuntu uses debian files) http://packages.debian.org/sid/maxima and double click on the deb file. A graphical interface should open and it will check if all the necessary dependencies are fullfilled. In case that works I guess you have to download the maxima-emacs package as well. A grep-search tells me that wxdraw2d is defined in interfaces/emacs/imaxima/imaxima.lisp. Let me know what you experience. Volker van Nek 2012/4/4 Jochen Ziegenbalg > Hello Volker van Nek, > > thank you for your quick response. As you suggest, the program "runs > through" without an error message if I replace the wxdraw2d command by > returning just 1. Also, if I return the graphics list LG it works and > contentwise the list LG seems to be OK. So, the problem is with the > wxdraw2d command. Replacing the wxdraw2d commond by just draw2d does > not help, either. > > As I mentioned in my first mail, the ubuntu-based system is running > Maxima version 5.22.1. Of course, before writing to > maxima at math.utexas.edu, I tried to update my ubuntu Maxima system, > first. Not being very experienced with ubuntu, I tried to do this > using the Synaptic Package Manager. But whatever I tried, it did not > result in a newer version of Maxima. So I thought, version 5.22.1 was > the most recent version. > > Of course, if the problem would be solved if I used a more recent > version of Maxima, this would be the thing to do (instead of trying to > repair version 5.22.1). But how do I get my 5.22.1 version updated > under ubuntu? I would be grateful for a hint. > > Thank you for your help, > Jochen > > > > On Wed, Apr 4, 2012 at 1:21 AM, Volker van Nek > wrote: > > Hallo Jochen Ziegenbalg, > > > > I can confirm that your wxm file runs on Ubuntu with Maxima 5.26.0 and > > 5.25.1 but fails with 5.20.1. I can't tell about the version 5.22.1. > > > > The wxdraw2d function is a quite recent development if I am not > mistaken. In > > a first step I would just replace the last line in your StringToGraphic > > function > > by a simple return value like 1 or so and check if it works without > errors. > > > > StringToGraphic(Str, c0, c1) := > > ... > > LG : append(LG, [Gbit]) ), > > 1) ; > > > > Let us know what the result is. > > > > Volker van Nek > > > > 2012/4/3 Jochen Ziegenbalg > >> > >> Ladies and gentlemen, > >> > >> in the appendix I send you a small Maxima program running without any > >> problem under wxMaxima for Windows (wxMaxima 11.08.0 / Maxima 5.25.1) > >> but not running under the (Ubuntu-) Linux implementation (wxMaxima > >> 0.85 / Maxima 5.22.1). > >> > >> The purpose of the program is to convert a string into its bit > >> structure (using the ASCII-code) and display this bit structure > >> graphically. > >> > >> Under Windows the program runs as expected. > >> > >> Under Linux (after defining the "helper"-functions like Byte), calling > >> the procedure > >> StringToGraphic("Karlsruhe", yellow, black) > >> results in the error message > >> > >> Maxima encountered a Lisp error: > >> Error in Apply [or a callee]:The function NIL is undefined. > >> Automatically continuing. > >> ... > >> > >> I would be grateful for some clarification on why this is so ... and a > >> hint on how to run the program under Linux. > >> > >> Thank you very much, > >> Jochen Ziegenbalg > >> > >> _______________________________________________ > >> Maxima mailing list > >> Maxima at math.utexas.edu > >> http://www.math.utexas.edu/mailman/listinfo/maxima > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From volkervannek at googlemail.com Wed Apr 4 07:40:26 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Wed, 4 Apr 2012 14:40:26 +0200 Subject: [Maxima] a Maxima program running under the Windows implementation but not under Linux implementation of Maxima / wxMaxima In-Reply-To: References: Message-ID: Or maybe a better source for maxima deb files is https://code.launchpad.net/~blahota/+archive/wxmaxima Here packages for Ubuntu versions down to lucid are available. To use them you need to follow the instructions under Adding this PPA to your system HTH Volker van Nek 2012/4/4 Volker van Nek > Hello, > > I would download a newer version from debian (Ubuntu uses debian files) > > http://packages.debian.org/sid/maxima > > and double click on the deb file. A graphical interface should open and it > will check if all the necessary dependencies are fullfilled. > > In case that works I guess you have to download the maxima-emacs package > as well. A grep-search tells me that wxdraw2d is defined in > interfaces/emacs/imaxima/imaxima.lisp. > > Let me know what you experience. > > Volker van Nek > > > > 2012/4/4 Jochen Ziegenbalg > >> Hello Volker van Nek, >> >> thank you for your quick response. As you suggest, the program "runs >> through" without an error message if I replace the wxdraw2d command by >> returning just 1. Also, if I return the graphics list LG it works and >> contentwise the list LG seems to be OK. So, the problem is with the >> wxdraw2d command. Replacing the wxdraw2d commond by just draw2d does >> not help, either. >> >> As I mentioned in my first mail, the ubuntu-based system is running >> Maxima version 5.22.1. Of course, before writing to >> maxima at math.utexas.edu, I tried to update my ubuntu Maxima system, >> first. Not being very experienced with ubuntu, I tried to do this >> using the Synaptic Package Manager. But whatever I tried, it did not >> result in a newer version of Maxima. So I thought, version 5.22.1 was >> the most recent version. >> >> Of course, if the problem would be solved if I used a more recent >> version of Maxima, this would be the thing to do (instead of trying to >> repair version 5.22.1). But how do I get my 5.22.1 version updated >> under ubuntu? I would be grateful for a hint. >> >> Thank you for your help, >> Jochen >> >> >> >> On Wed, Apr 4, 2012 at 1:21 AM, Volker van Nek >> wrote: >> > Hallo Jochen Ziegenbalg, >> > >> > I can confirm that your wxm file runs on Ubuntu with Maxima 5.26.0 and >> > 5.25.1 but fails with 5.20.1. I can't tell about the version 5.22.1. >> > >> > The wxdraw2d function is a quite recent development if I am not >> mistaken. In >> > a first step I would just replace the last line in your StringToGraphic >> > function >> > by a simple return value like 1 or so and check if it works without >> errors. >> > >> > StringToGraphic(Str, c0, c1) := >> > ... >> > LG : append(LG, [Gbit]) ), >> > 1) ; >> > >> > Let us know what the result is. >> > >> > Volker van Nek >> > >> > 2012/4/3 Jochen Ziegenbalg >> >> >> >> Ladies and gentlemen, >> >> >> >> in the appendix I send you a small Maxima program running without any >> >> problem under wxMaxima for Windows (wxMaxima 11.08.0 / Maxima 5.25.1) >> >> but not running under the (Ubuntu-) Linux implementation (wxMaxima >> >> 0.85 / Maxima 5.22.1). >> >> >> >> The purpose of the program is to convert a string into its bit >> >> structure (using the ASCII-code) and display this bit structure >> >> graphically. >> >> >> >> Under Windows the program runs as expected. >> >> >> >> Under Linux (after defining the "helper"-functions like Byte), calling >> >> the procedure >> >> StringToGraphic("Karlsruhe", yellow, black) >> >> results in the error message >> >> >> >> Maxima encountered a Lisp error: >> >> Error in Apply [or a callee]:The function NIL is undefined. >> >> Automatically continuing. >> >> ... >> >> >> >> I would be grateful for some clarification on why this is so ... and a >> >> hint on how to run the program under Linux. >> >> >> >> Thank you very much, >> >> Jochen Ziegenbalg >> >> >> >> _______________________________________________ >> >> Maxima mailing list >> >> Maxima at math.utexas.edu >> >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> >> > >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Wed Apr 4 07:50:40 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 04 Apr 2012 05:50:40 -0700 Subject: [Maxima] subseq, array slice In-Reply-To: References: Message-ID: <4F7C43A0.4020108@eecs.berkeley.edu> On 4/4/2012 4:26 AM, Tamas Papp wrote: > Hi, > > 1. Is there a Maxima equivalent for CL's subseq? look at the documentation for rest. > > 2. Is there something similar for arrays (similar to a[i:j,k:l] in R)? notationally, no. you can construct this via rest. A matrix (not array) is a list of lists. if M is a matrix, creating a new row j by removing its rightmost element would be rest(M[j],-1). From macrakis at alum.mit.edu Wed Apr 4 08:10:49 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 4 Apr 2012 06:10:49 -0700 Subject: [Maxima] Q: How to control rewriting In-Reply-To: References: Message-ID: Not clear what you really want... Maybe ratsubst (..., c/e, eq1) solves your problem? -s On Apr 3, 2012 4:15 PM, "Enrique Perez-Terron" wrote: > Hello, > > I have an expression of the form > > A*B*C*D > EQ1: F = --------- > E > > where C/E has a particular simplification. > > I would like to have this expression rewritten on the form > > C > EQ2: F = A*B*D*--- > E > > This would allow me to use, e.g. > > substpart( simplify(piece), EQ2, 2, 4 ) > > My question is how to produce EQ2 from EQ1, short of rewriting manually or > copying and pasting. > I am clumsy; when I do complex things manually I invariably do mistakes, > forget a parenthesis or whatever, so I would like to have methods of doing > this where I either get an error message or I get something that is > mathematically equivalent to what I started with. > > Maybe > > A: part(EQ1, 2,1,1) > B: part(EQ1, 2,1,2) > C: part(EQ1, 2,1,3) > D: part(EQ1, 2,1,4) > E: part(EQ1, 2,2) > F: part(EQ1, 1) > > EQ2: F = A*B*D*(C/E) > > EQ1 - EQ2 > > would be an approach, where the last line is the control. (Assume that the > letters A-E are actually not in use up to this point.) > > Now, this could work, but it is quite a bit of writing. I wish something > more legible too. > > How can I do this? > > Thanks > Enrique > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From volkervannek at googlemail.com Wed Apr 4 08:17:33 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Wed, 4 Apr 2012 15:17:33 +0200 Subject: [Maxima] a Maxima program running under the Windows implementation but not under Linux implementation of Maxima / wxMaxima In-Reply-To: References: Message-ID: Hello, you had to scroll down to the end of the page and klick on i368 resp. amd64. But try please try the ubuntu launchpad page first (see my last mail). Volker van Nek 2012/4/4 Jochen Ziegenbalg > Hello, > > On Wed, Apr 4, 2012 at 2:10 PM, Volker van Nek > wrote: > > Hello, > > > > I would download a newer version from debian (Ubuntu uses debian files) > > > > http://packages.debian.org/sid/maxima > > > > and double click on the deb file. > > I'll be happy to do this. But which of the files under the above > address is the deb file? > (I downloaded the file maxima_5.26.0-3.debian.tar.gz but could not > find any file to double click on, there). > > Grateful for some further help, > Jochen > > > > > > A graphical interface should open and it > > will check if all the necessary dependencies are fullfilled. > > In case that works I guess you have to download the maxima-emacs package > as > > well. A grep-search tells me that wxdraw2d is defined in > > interfaces/emacs/imaxima/imaxima.lisp. > > > > Let me know what you experience. > > > > Volker van Nek > > > > > > > > 2012/4/4 Jochen Ziegenbalg > >> > >> Hello Volker van Nek, > >> > >> thank you for your quick response. As you suggest, the program "runs > >> through" without an error message if I replace the wxdraw2d command by > >> returning just 1. Also, if I return the graphics list LG it works and > >> contentwise the list LG seems to be OK. So, the problem is with the > >> wxdraw2d command. Replacing the wxdraw2d commond by just draw2d does > >> not help, either. > >> > >> As I mentioned in my first mail, the ubuntu-based system is running > >> Maxima version 5.22.1. Of course, before writing to > >> maxima at math.utexas.edu, I tried to update my ubuntu Maxima system, > >> first. Not being very experienced with ubuntu, I tried to do this > >> using the Synaptic Package Manager. But whatever I tried, it did not > >> result in a newer version of Maxima. So I thought, version 5.22.1 was > >> the most recent version. > >> > >> Of course, if the problem would be solved if I used a more recent > >> version of Maxima, this would be the thing to do (instead of trying to > >> repair version 5.22.1). But how do I get my 5.22.1 version updated > >> under ubuntu? I would be grateful for a hint. > >> > >> Thank you for your help, > >> Jochen > >> > >> > >> > >> On Wed, Apr 4, 2012 at 1:21 AM, Volker van Nek > >> wrote: > >> > Hallo Jochen Ziegenbalg, > >> > > >> > I can confirm that your wxm file runs on Ubuntu with Maxima 5.26.0 and > >> > 5.25.1 but fails with 5.20.1. I can't tell about the version 5.22.1. > >> > > >> > The wxdraw2d function is a quite recent development if I am not > >> > mistaken. In > >> > a first step I would just replace the last line in your > StringToGraphic > >> > function > >> > by a simple return value like 1 or so and check if it works without > >> > errors. > >> > > >> > StringToGraphic(Str, c0, c1) := > >> > ... > >> > LG : append(LG, [Gbit]) ), > >> > 1) ; > >> > > >> > Let us know what the result is. > >> > > >> > Volker van Nek > >> > > >> > 2012/4/3 Jochen Ziegenbalg > >> >> > >> >> Ladies and gentlemen, > >> >> > >> >> in the appendix I send you a small Maxima program running without any > >> >> problem under wxMaxima for Windows (wxMaxima 11.08.0 / Maxima 5.25.1) > >> >> but not running under the (Ubuntu-) Linux implementation (wxMaxima > >> >> 0.85 / Maxima 5.22.1). > >> >> > >> >> The purpose of the program is to convert a string into its bit > >> >> structure (using the ASCII-code) and display this bit structure > >> >> graphically. > >> >> > >> >> Under Windows the program runs as expected. > >> >> > >> >> Under Linux (after defining the "helper"-functions like Byte), > calling > >> >> the procedure > >> >> StringToGraphic("Karlsruhe", yellow, black) > >> >> results in the error message > >> >> > >> >> Maxima encountered a Lisp error: > >> >> Error in Apply [or a callee]:The function NIL is undefined. > >> >> Automatically continuing. > >> >> ... > >> >> > >> >> I would be grateful for some clarification on why this is so ... and > a > >> >> hint on how to run the program under Linux. > >> >> > >> >> Thank you very much, > >> >> Jochen Ziegenbalg > >> >> > >> >> _______________________________________________ > >> >> Maxima mailing list > >> >> Maxima at math.utexas.edu > >> >> http://www.math.utexas.edu/mailman/listinfo/maxima > >> >> > >> > > > > > > > > > -- > *********************************************************** > Prof. Dr. Jochen Ziegenbalg > Institut fuer Mathematik und Informatik > Paedagogische Hochschule Karlsruhe > University of Education, Karlsruhe (Germany) > ---------------------------------------------------------------------- > ziegenbalg at ph-karlsruhe.de > www.ziegenbalg.ph-karlsruhe.de > ---------------------------------------------------------------------- > Tel. privat: 030-21237725 > *********************************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Wed Apr 4 10:23:55 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 4 Apr 2012 09:23:55 -0600 Subject: [Maxima] Maxima 5.27.0 tagged in Git & posted to SF Message-ID: Hi, I got the situation w/ Git & rpmbuild straightened out -- Git was OK, rpmbuild got messed up because the logic in configure.in to detect the version from Git doesn't work for building from a tarball so I changed that. Anyway now 5.27.0 is tagged in Git and I've built rpms and tar.gz and posted that stuff to the SF file manager. http://sourceforge.net/projects/maxima/files or thereabouts. If someone can build a Windows installer & post it, that would be terrific. Please give it a try if you can and let us know how it turns out. best Robert Dodier From tkpapp at gmail.com Wed Apr 4 11:08:42 2012 From: tkpapp at gmail.com (Tamas Papp) Date: Wed, 4 Apr 2012 16:08:42 +0000 (UTC) Subject: [Maxima] ratsubst within logarithm Message-ID: Hi, If I do texput(%lambda,"\\lambda"); assume(%lambda > 0); integrate(1/(1+A*exp(%lambda*(p-s))),p,x,inf); I get an expression where x-s always occurs together, so it would be convenient to replace them by a single parameter y=x-s. I tried ratsubst(y,x-s,%); but the substitution is not performed inside the logarithm. Is there a way I could make Maxima simplify this? I guess I need to cancel the exp(something)*exp(-something) terms first inside the log, but I don't know how. Best, Tamas From macrakis at alum.mit.edu Wed Apr 4 12:26:18 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 4 Apr 2012 10:26:18 -0700 Subject: [Maxima] ratsubst within logarithm In-Reply-To: References: Message-ID: Could you please provide a full transcript (with display2d:false) of your interaction? I don't see x-s in the result of the integration. -s On Wed, Apr 4, 2012 at 09:08, Tamas Papp wrote: > Hi, > > If I do > > texput(%lambda,"\\lambda"); > assume(%lambda > 0); > integrate(1/(1+A*exp(%lambda*(p-s))),p,x,inf); > > I get an expression where x-s always occurs together, so it would be > convenient to replace them by a single parameter y=x-s. I tried > > ratsubst(y,x-s,%); > > but the substitution is not performed inside the logarithm. Is there > a way I could make Maxima simplify this? I guess I need to cancel the > exp(something)*exp(-something) terms first inside the log, but I don't > know how. > > Best, > > Tamas > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Wed Apr 4 12:52:34 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 4 Apr 2012 10:52:34 -0700 Subject: [Maxima] Simplifying gamma distributions In-Reply-To: <20120403221209.GZ31642@cs-wsok.swan.ac.uk> References: <3B9C6951-5D26-48A6-93E9-04125B4625D8@mcmaster.ca> <20120403221209.GZ31642@cs-wsok.swan.ac.uk> Message-ID: As a general rule, simplification works best when there is a single representation for a given concept. If Maxima were designed for convenience of implementation, we'd probably represent all trig and hyperbolic functions in the exponential form, we'd represent abs(x) as x*unit_step(x) or as (if x>=0 then x else -x) or ..., etc. On the other hand, users have different preferences. In this case, some prefer factorial (with the connotation, but not the requirement, that the argument is integer), others prefer gamma, and I suppose some might even prefer product(i,i,1,n) (for integer arguments). My personal preference would be to standardize on an internal representation and simply treat factorial and gamma as different *external* representations. The problem with this is that it adds another confusing piece of global state (e.g. factorial_display_form: "!" or 'gamma). It also means that you can't mix gamma and factorial in a single expression. Another alternative implementation simply *annotates* each individual instance of gamma/factorial with the preferred display form, starting with the form it was input in. This sounds more confusing to me. (And of course we'd need to figure out what to do with non-user-input cases.) A sort of compromise between the two would be to have a global factorial_display_form which is set by the user's first input of gamma or "!". But this could be confusing, too -- especially if some library function happens to set the default.... But in any case, internally, gamma and "!" should be the same, and minfactorial/mingamma etc. should not have to worry about the two forms. -s On Tue, Apr 3, 2012 at 15:12, Oliver Kullmann wrote: > What I don't understand: > > Why are there two functions, factorial and gamma? > Is there a different pragmatics behind it? > If not, shouldn't the simplifications yield the same? > > And if one is going for "maximal strength" simplification, > shouldn't one always apply makefact, since apparently > Maxima understands factorial better than gamma? > > Oliver > > On Tue, Apr 03, 2012 at 04:43:23PM -0500, Barton Willis wrote: > > > I am trying to simplify: > > > > > > gamma(a+1)/gamma(a) and maxima keeps spitting out gamma(a+1)/gamma > > > (a) but it should equal a. > > > > > > Does anyone know how to simplify this? > > > > On way > > > > (%i6) gamma(a+1)/gamma(a); > > (%o6) gamma(a+1)/gamma(a) > > > > (%i7) minfactorial(makefact(%)); > > (%o7) a > > > > Maybe somebody knows a more direct way. > > > > Barton > > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nijso at hotmail.com Wed Apr 4 14:49:06 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Wed, 4 Apr 2012 21:49:06 +0200 Subject: [Maxima] kovacic algorithm Message-ID: Dear all, Again, a question about something that was once written in/with macsyma and now (probably) lost... Does somebody know of a surviving macsyma/maxima implementation of the kovacic algorithm (solving second order ode's using differential Galois theory)? In some papers from the beginning of the 80's the authors state that they 'have implemented the algorithm in macsyma', most notably Prelle&Singer (1983). At least 4 different groups have written a version in macsyma and one version of this algorithm was probably part of Macsyma at one point (mentioned in the Handbook of differential equations in 1989). Kind regards, NB -------------- next part -------------- An HTML attachment was scrubbed... URL: From O.Kullmann at swansea.ac.uk Wed Apr 4 15:09:56 2012 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Wed, 4 Apr 2012 21:09:56 +0100 Subject: [Maxima] Maxima 5.27.0 tagged in Git & posted to SF In-Reply-To: References: Message-ID: <20120404200956.GC15185@cs-wsok.swan.ac.uk> http://sourceforge.net/projects/maxima/files/Maxima-source/5.27.0-source/ There are apparently no files in there: Looking for the latest version? Download maxima-5.26.0.tar.gz (26.0 MB) Home / Maxima-source / 5.27.0-source Name Modified Size Status Parent folder Totals: 2 Items 54.2 MB Nothing visible. Oliver On Wed, Apr 04, 2012 at 09:23:55AM -0600, Robert Dodier wrote: > Hi, > > I got the situation w/ Git & rpmbuild straightened out -- > Git was OK, rpmbuild got messed up because the logic in > configure.in to detect the version from Git doesn't work for > building from a tarball so I changed that. > > Anyway now 5.27.0 is tagged in Git and I've built rpms > and tar.gz and posted that stuff to the SF file manager. > http://sourceforge.net/projects/maxima/files > or thereabouts. > > If someone can build a Windows installer & post it, > that would be terrific. > > Please give it a try if you can and let us know how it turns out. > > best > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Wed Apr 4 15:48:57 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 4 Apr 2012 14:48:57 -0600 Subject: [Maxima] Maxima 5.27.0 tagged in Git & posted to SF In-Reply-To: <20120404200956.GC15185@cs-wsok.swan.ac.uk> References: <20120404200956.GC15185@cs-wsok.swan.ac.uk> Message-ID: Yeah, there is some bug in the SF file manager. I remember this happened during the last release as well. Maybe if we wait a while, the files will appear. If the files don't appear, I don't know what to do. By the way I did check the file permissions on the created files and the directories which contain them, and permissions should be sufficient to allow group and others to read them. best Robert Dodier On 4/4/12, Oliver Kullmann wrote: > http://sourceforge.net/projects/maxima/files/Maxima-source/5.27.0-source/ > > There are apparently no files in there: > > Looking for the latest version? Download maxima-5.26.0.tar.gz (26.0 MB) > Home / Maxima-source / 5.27.0-source > Name > Modified > Size > Status > Parent folder > Totals: 2 Items 54.2 MB > > Nothing visible. > > Oliver > > On Wed, Apr 04, 2012 at 09:23:55AM -0600, Robert Dodier wrote: >> Hi, >> >> I got the situation w/ Git & rpmbuild straightened out -- >> Git was OK, rpmbuild got messed up because the logic in >> configure.in to detect the version from Git doesn't work for >> building from a tarball so I changed that. >> >> Anyway now 5.27.0 is tagged in Git and I've built rpms >> and tar.gz and posted that stuff to the SF file manager. >> http://sourceforge.net/projects/maxima/files >> or thereabouts. >> >> If someone can build a Windows installer & post it, >> that would be terrific. >> >> Please give it a try if you can and let us know how it turns out. >> >> best >> >> Robert Dodier >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > > From dbmaxima at gmail.com Wed Apr 4 17:50:55 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Thu, 05 Apr 2012 08:50:55 +1000 Subject: [Maxima] kovacic algorithm In-Reply-To: References: Message-ID: <4F7CD04F.9050601@gmail.com> On 5/04/2012 5:49 AM, nijso beishuizen wrote: > Dear all, > > Again, a question about something that was once written in/with > macsyma and now (probably) lost... > > Does somebody know of a surviving macsyma/maxima implementation of the > kovacic algorithm (solving second order ode's using differential > Galois theory)? In some papers from the beginning of the 80's the > authors state that they 'have implemented the algorithm in macsyma', > most notably Prelle&Singer (1983). At least 4 different groups have > written a version in macsyma and one version of this algorithm was > probably part of Macsyma at one point (mentioned in the Handbook of > differential equations in 1989). I asked about this up a few years ago without success. At the time I contacted David Saunders about his 1981 code, but he no longer had a copy./ / -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Thu Apr 5 01:44:04 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 5 Apr 2012 06:44:04 +0000 (UTC) Subject: [Maxima] subseq, array slice References: Message-ID: On 2012-04-04, Tamas Papp wrote: > 2. Is there something similar for arrays (similar to a[i:j,k:l] in R)? There is an experimental share package amatrix which is an implementation of matrices using a Lisp array for storage. Various notations for indexing are recognized: list of indices, Boolean expressions, 'all. demo(amatrix) shows some examples. Ranges aren't recognized, although it would be straightforward to add them. amatrix is an attempt at a matrix reimplementation. Disclaimer: I wrote it. Unfortunately amatrix isn't integrated with the rest of Maxima -- operations which work on ordinary matrices won't work on amatrix. Hope this helps, Robert Dodier From rswarbrick at gmail.com Thu Apr 5 05:34:43 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Thu, 05 Apr 2012 11:34:43 +0100 Subject: [Maxima] ratsubst within logarithm References: Message-ID: <639059xhq7.ln2@hake.rswarbrick.dnsalias.com> Tamas Papp writes: > Hi, > > If I do > > texput(%lambda,"\\lambda"); > assume(%lambda > 0); > integrate(1/(1+A*exp(%lambda*(p-s))),p,x,inf); > > I get an expression where x-s always occurs together, so it would be > convenient to replace them by a single parameter y=x-s. I tried > > ratsubst(y,x-s,%); > > but the substitution is not performed inside the logarithm. Is there > a way I could make Maxima simplify this? I guess I need to cancel the > exp(something)*exp(-something) terms first inside the log, but I don't > know how. There's a slight work-around that I generally use in this sort of situation. Instead substitute y+s for x: (%i1) assume(? > 0); (%o1) [? > 0] (%i2) assume(A > 0); (%o2) [A > 0] (%i3) integrate(1/(1+A*exp(?*(p-s))),p,x,inf); Is s ? an integer? no; - s ? x ? s ? log(%e (A %e + %e )) log(A) (%o3) ------------------------------ - ------ - x + s ? ? (%i4) subst(y+s, x, %); - s ? (y + s) ? s ? log(%e (A %e + %e )) log(A) (%o4) ------------------------------------ - ------ - y ? ? (%i5) factor(%); y ? log(A %e + 1) - y ? - log(A) (%o5) ------------------------------- ? Tada! I'm not sure how to convince ratsubst to deal with the exponentials correctly: my attempts with map and scanmap failed miserably. Anyone got any suggestions? Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From A.G.Grozin at inp.nsk.su Thu Apr 5 09:02:21 2012 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Thu, 5 Apr 2012 21:02:21 +0700 (NOVT) Subject: [Maxima] Maxima 5.27.0 tagged in Git & posted to SF In-Reply-To: References: Message-ID: maxima-5.27.0 is in Gentoo. Testsuite full times on my 32-bit x86 box (seconds) and failed tests are: sbcl-1.0.55 166 cmucl-20c 181 gcl-2.6.8_pre 184 clozurecl-1.8 253 rtest15 (37, 193, 196) ecl-12.2.1 345 rtest8.mac (126, 127) clisp-2.49 569 Details of failed tests: clozurecl: ---------------------------------------------------------------- ********************** Problem 37 *************** Input: 2 2 - %pi sin (3 a) sin (----- + a + b) 3 (----------------------------- 2 %pi sin (a - ---) 3 - %pi 2 sin(a) sin(3 a) cos(b) sin(----- + a + b) sin(3 a + 3 b) 3 - ---------------------------------------------------------- %pi sin(a - ---) sin(a + b) 3 2 2 sin (a) sin (3 a + 3 b) + -----------------------, result : trigrat(%%), 2 sin (a + b) expected : (- (- 9 + 10 cos(2 a) - 2 sqrt(3) sin(2 a) - cos(4 a) + sqrt(3) sin(4 a) + 10 cos(2 b) - 2 sqrt(3) sin(2 b) - cos(4 b) + sqrt(3) sin(4 b) - 4 cos(2 b - 2 a) - 8 cos(2 a + 2 b) + 4 sqrt(3) sin(2 a + 2 b) + 2 cos(4 a + 2 b) - 2 sqrt(3) sin(4 a + 2 b) + 2 cos(2 a + 4 b) - 2 sqrt(3) sin(2 a + 4 b) - cos(4 a + 4 b) + sqrt(3) sin(4 a + 4 b)))/4, ratsimp(result - expected)) Result: Polynomial quotient is not exact error-catch This differed from the expected result: 0 ********************** Problem 193 *************** Input: 2 t log(t) integrate(-----------------, t, 0, 1) 2 4 (t - 1) (1 + t ) Result: 2 (sqrt(2) - 2) %pi - ------------------ 32 This differed from the expected result: 2 (sqrt(2) - 1) %pi ------------------ 9/2 2 ********************** Problem 196 *************** Input: 1 factor(expand(sqrtdenest(integrate(------------, x, 0, 1)))) 1 4 - + (x - 3) 2 3/4 9/4 73 + sqrt(2) + 2 - 3 2 - factor((- (- log(----------------------------) 33 3/4 9/4 3/4 5/2 13/4 73 + sqrt(2) - 2 + 3 2 - 2 + 2 - 2 + log(----------------------------) + 2 atan(---------------------) 33 3/4 13/4 98 + 2 - 2 3/4 5/2 13/4 2 + 2 + 2 7/4 + 2 atan(-------------------)))/2 ) 3/4 13/4 - 98 + 2 - 2 Result: 13/4 5/2 3/4 13/4 5/2 3/4 2 + 2 + 2 - 2 + 2 - 2 (2 atan(-------------------) + 2 atan(---------------------) 13/4 3/4 13/4 3/4 - 2 + 2 - 98 - 2 + 2 + 98 9/4 3/4 9/4 3/4 3 2 - 2 + sqrt(2) + 73 - 3 2 + 2 + sqrt(2) + 73 + log(----------------------------) - log(------------------------------)) 33 33 9/4 3/4 7/4 3 2 - 2 + sqrt(2) + 73 /2 - (log(----------------------------) 33 9/4 3/4 - 3 2 + 2 + sqrt(2) + 73 - log(------------------------------) - 2 33 3/4 1/4 79 2 + 365 sqrt(2) + 877 2 + 5 atan(------------------------------------) 10657 3/4 1/4 - 79 2 + 365 sqrt(2) - 877 2 + 5 7/4 + 2 atan(--------------------------------------))/2 10657 This differed from the expected result: 0 ---------------------------------------------------------------- ecl: ---------------------------------------------------------------- ********************** Problem 126 *************** Input: 1 2 (f : diff(----------------, a), g : quad_qags(f b (1 - b) , b, 0, 1) , 2 1 (a - b) + 1 + 1 find_root(g = 0, a, 0, 1)) Result: 2 2 (1 - b) (a - b) b find_root(subscript(quad_qags(- --------------------, b, 0, 1, epsrel = 1.e-8, 2 2 ((a - b) + 2) epsabs = 0.0, limit = 200), 1) = 0, a, .3980373668760611, 0.375) This differed from the expected result: .3978613590133817 ********************** Problem 127 *************** Input: 1 2 (f : diff(----------------, a), g : quad_qags(f b (1 - b) , b, 0, 1) , 2 1 (a - b) + 1 + 1 find_root(g = 0, a, 0, 1)) Result: 2 2 (1 - b) (a - b) b find_root(quad_qags(- --------------------, b, 0, 1) = 0, a, 2 2 ((a - b) + 2) 1 .3980373668760611, 0.375) This differed from the expected result: .3978613590133817 ---------------------------------------------------------------- Andrey From akshaysrinivasan at gmail.com Thu Apr 5 09:58:11 2012 From: akshaysrinivasan at gmail.com (Akshay Srinivasan) Date: Thu, 05 Apr 2012 20:28:11 +0530 Subject: [Maxima] Classical Mechanic Message-ID: <4F7DB303.5000409@gmail.com> Hello, This is a follow up of a previous mail about generating the equations of motion of a Lagrangian system in C++ (with other fancy stuff). I finally got rid of the ugly hack that was there before, the entire code generation part is now in Maxima. Checkout the code from the git repository here: git://github.com/enupten/Classical-Mechanic.git Akshay From yasuaki.honda at gmail.com Thu Apr 5 10:54:39 2012 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Fri, 6 Apr 2012 00:54:39 +0900 Subject: [Maxima] expintegral_ei() bug on convergence In-Reply-To: References: Message-ID: Hi Raymond san, all, I am looking at the expintegral.lisp line 534 where the continued fraction or power series is chosen. According to DLMF Section 6.18 (http://dlmf.nist.gov/6.18 which is an updated publication of A&S), "For small or moderate values of x and z, the expansion in power series (?6.6) or in series of spherical Bessel functions (?6.10(ii)) can be used. .... Lastly, the continued fraction (6.9.1) can be used if z is bounded away from the origin. Convergence becomes slow when z is near the negative real axis, however." So, I would like to propose: if z is close to origin or z is close to the negative real axis, we expand in power series, otherwise, we expand in continued fraction. The actual patch comes below. It would be great if someone could verify (or modify if necessary) this patch. Thanks and best regards, Yasuaki Honda, Chiba Japan [iMacG5-2F-2:maxima-git-development/maxima/src] yasube% git diff expintegral.lisp diff --git a/src/expintegral.lisp b/src/expintegral.lisp index 6bf7d82..e27339e 100644 --- a/src/expintegral.lisp +++ b/src/expintegral.lisp @@ -531,7 +531,7 @@ (format t "~& : z = ~A~%" z)) (cond - ((and (>= (realpart z) 0) (> (abs z) 1.0)) + ((not (or (< (abs z) 5.0) (and (< (realpart z) 0.0) (< (abs (imagpart z)) 2.0)))) ;; We expand in continued fractions. (when *debug-expintegral* (format t "~&We expand in continued fractions.~%")) 2012?4?3?16:24 ???? : > Hi Raymond san, > > Thanks for looking into this problem. When you create a fix and want to > test it, > drop me the code and I will test it. > > Thanks and best regards, > Yasuaki Honda, Chiba, Japan > > 2012?4?3?0:52 Raymond Toy : > > >> >> 2012/4/2 ???? >> >>> Dear all, >>> >>> It seems that the Maxima function expintegral_ei() behaves unexpectedly >>> for >>> some complex arguments. (There should be some bugs in the >>> implementation). >>> >>> Specifically, considering a line log(20.0)/2+%i*t on the complex plane >>> and t gets >>> increasing, such as t=30, 40, 50. >>> the values can >>> (%i22) expintegral_ei(log(20.0)/2+30*%i); >>> (%o22) 3.116181583331404*%i-.1466880831183789 >>> >>> (%i23) expintegral_ei(log(20.0)/2+40*%i); >>> (%o23) 3.205076248461513*%i+.1490949857975915 >>> >>> (%i24) expintegral_ei(log(20.0)/2+50*%i); >>> (%o24) 1766.649087960532-1098.205534849491*%i >>> >>> So, (%o24) indicates that somewhere betwee log(20.0)/2+40*%i and >>> log(20.0)/2+50*%i, >>> there is a point where expintegral_ei() starts unstable ( not converge). >>> This function, >>> however, should converge for these values. (See below for the values >>> obtained using >>> mpmath in python). >>> >>> Thanks for reporting this. It looks like it's really an issue with >> expintegral_e. Maxima compute expintegral_ei(z) using expintegral_e(1,-z), >> and the expIntegral_e appears to have problems because it's using a >> series. I think if the continued fraction is used instead, the problem >> goes away. >> >> I'll look into it. >> >> Ray >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Thu Apr 5 12:10:36 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 5 Apr 2012 10:10:36 -0700 Subject: [Maxima] expintegral_ei() bug on convergence In-Reply-To: References: Message-ID: 2012/4/5 ???? > Hi Raymond san, all, > > I am looking at the expintegral.lisp line 534 where the continued fraction > or power series > is chosen. > > According to DLMF Section 6.18 (http://dlmf.nist.gov/6.18 which is an > updated publication of A&S), > > "For small or moderate values of x and z, the expansion in power series > (?6.6) or in series of spherical Bessel functions (?6.10(ii)) can be used. > .... > Lastly, the continued fraction (6.9.1) can be used if z is > bounded away from the origin. Convergence becomes slow when z is near the > negative real axis, however." > > So, I would like to propose: > if z is close to origin or z is close to the negative real axis, we expand > in power series, > otherwise, we expand in continued fraction. The actual patch comes below. > Yes, this was basically what I had in mind, except the condition would have been abs(z) > 1 and, maybe, abs(phase(z)) < 3.1, so that we stay away from the negative axis. This fixes your immediate problem, I think, but we are still left with the issue of what do we do if we want expintegral_e on the negative axis. I haven't figured that out yet.... Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From volkervannek at googlemail.com Thu Apr 5 14:45:53 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Thu, 5 Apr 2012 21:45:53 +0200 Subject: [Maxima] a Maxima program running under the Windows implementation but not under Linux implementation of Maxima / wxMaxima In-Reply-To: References: Message-ID: Hello Jochen, I am happy to read that you got it work. I found two pages in http://wiki.ubuntuusers.de about ppa. Perhaps these can give a little bit more understanding on software sources and ppa. http://wiki.ubuntuusers.de/Paketquellen_freischalten/PPA?highlight=ppa http://wiki.ubuntuusers.de/Launchpad/PPA?highlight=ppa I believe Ubuntu is not supplied via sourceforge because it is simply one of hundreds of Linux distributions. The distributions maintainers are doing a great job in resolving all dependencies. This should not be a task to the Maxima developers. Yes, the old version is overwritten. If you want it back, unflag the repository from Istvan Blahota in synaptic and reinstall. But I guess you won't. Why don't you upgrade your Ubuntu? Best Volker van Nek PS: Please always cc to this list. Thank you. 2012/4/5 Jochen Ziegenbalg > Hello Volker van Nek, > > this worked (i.e. doing the PPA-stuff, downloading the Maxima 5.26 > packages, installing them and running my program) thank you. > > But installing the PPA stuff and everything was rather like a "blind > flight" > due to big holes in the documentation and instructions. > > Why is the ubuntu version of Maxima 5.26 not supplied via sourceforge? > > And: The older version of Maxima seems to be deleted or overwritten. > Is this OK? > > Thank you very much, > Jochen > > > On Wed, Apr 4, 2012 at 1:40 PM, Volker van Nek > wrote: > > Or maybe a better source for maxima deb files is > > > > https://code.launchpad.net/~blahota/+archive/wxmaxima > > > > Here packages for Ubuntu versions down to lucid are available. > > > > To use them you need to follow the instructions under > > > > Adding this PPA to your system > > > > > > HTH > > Volker van Nek > > > > > > > > 2012/4/4 Volker van Nek > >> > >> Hello, > >> > >> I would download a newer version from debian (Ubuntu uses debian files) > >> > >> http://packages.debian.org/sid/maxima > >> > >> and double click on the deb file. A graphical interface should open and > it > >> will check if all the necessary dependencies are fullfilled. > >> > >> In case that works I guess you have to download the maxima-emacs package > >> as well. A grep-search tells me that wxdraw2d is defined in > >> interfaces/emacs/imaxima/imaxima.lisp. > >> > >> Let me know what you experience. > >> > >> Volker van Nek > >> > >> > >> > >> 2012/4/4 Jochen Ziegenbalg > >>> > >>> Hello Volker van Nek, > >>> > >>> thank you for your quick response. As you suggest, the program "runs > >>> through" without an error message if I replace the wxdraw2d command by > >>> returning just 1. Also, if I return the graphics list LG it works and > >>> contentwise the list LG seems to be OK. So, the problem is with the > >>> wxdraw2d command. Replacing the wxdraw2d commond by just draw2d does > >>> not help, either. > >>> > >>> As I mentioned in my first mail, the ubuntu-based system is running > >>> Maxima version 5.22.1. Of course, before writing to > >>> maxima at math.utexas.edu, I tried to update my ubuntu Maxima system, > >>> first. Not being very experienced with ubuntu, I tried to do this > >>> using the Synaptic Package Manager. But whatever I tried, it did not > >>> result in a newer version of Maxima. So I thought, version 5.22.1 was > >>> the most recent version. > >>> > >>> Of course, if the problem would be solved if I used a more recent > >>> version of Maxima, this would be the thing to do (instead of trying to > >>> repair version 5.22.1). But how do I get my 5.22.1 version updated > >>> under ubuntu? I would be grateful for a hint. > >>> > >>> Thank you for your help, > >>> Jochen > >>> > >>> > >>> > >>> On Wed, Apr 4, 2012 at 1:21 AM, Volker van Nek > >>> wrote: > >>> > Hallo Jochen Ziegenbalg, > >>> > > >>> > I can confirm that your wxm file runs on Ubuntu with Maxima 5.26.0 > and > >>> > 5.25.1 but fails with 5.20.1. I can't tell about the version 5.22.1. > >>> > > >>> > The wxdraw2d function is a quite recent development if I am not > >>> > mistaken. In > >>> > a first step I would just replace the last line in your > StringToGraphic > >>> > function > >>> > by a simple return value like 1 or so and check if it works without > >>> > errors. > >>> > > >>> > StringToGraphic(Str, c0, c1) := > >>> > ... > >>> > LG : append(LG, [Gbit]) ), > >>> > 1) ; > >>> > > >>> > Let us know what the result is. > >>> > > >>> > Volker van Nek > >>> > > >>> > 2012/4/3 Jochen Ziegenbalg > >>> >> > >>> >> Ladies and gentlemen, > >>> >> > >>> >> in the appendix I send you a small Maxima program running without > any > >>> >> problem under wxMaxima for Windows (wxMaxima 11.08.0 / Maxima > 5.25.1) > >>> >> but not running under the (Ubuntu-) Linux implementation (wxMaxima > >>> >> 0.85 / Maxima 5.22.1). > >>> >> > >>> >> The purpose of the program is to convert a string into its bit > >>> >> structure (using the ASCII-code) and display this bit structure > >>> >> graphically. > >>> >> > >>> >> Under Windows the program runs as expected. > >>> >> > >>> >> Under Linux (after defining the "helper"-functions like Byte), > calling > >>> >> the procedure > >>> >> StringToGraphic("Karlsruhe", yellow, black) > >>> >> results in the error message > >>> >> > >>> >> Maxima encountered a Lisp error: > >>> >> Error in Apply [or a callee]:The function NIL is undefined. > >>> >> Automatically continuing. > >>> >> ... > >>> >> > >>> >> I would be grateful for some clarification on why this is so ... > and a > >>> >> hint on how to run the program under Linux. > >>> >> > >>> >> Thank you very much, > >>> >> Jochen Ziegenbalg > >>> >> > >>> >> _______________________________________________ > >>> >> Maxima mailing list > >>> >> Maxima at math.utexas.edu > >>> >> http://www.math.utexas.edu/mailman/listinfo/maxima > >>> >> > >>> > > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nijso at hotmail.com Fri Apr 6 04:19:40 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Fri, 6 Apr 2012 11:19:40 +0200 Subject: [Maxima] kovacic algorithm In-Reply-To: <4F7CD04F.9050601@gmail.com> References: , <4F7CD04F.9050601@gmail.com> Message-ID: Thanks for the reply. I have Saunders' paper as well, describing the algorithm. I am also checking some newer results from Hoeij and Weil, which result in more compact answers. Might be interesting to implement, the only problem is time... Date: Thu, 5 Apr 2012 08:50:55 +1000 From: dbmaxima at gmail.com To: nijso at hotmail.com CC: maxima at math.utexas.edu Subject: Re: [Maxima] kovacic algorithm On 5/04/2012 5:49 AM, nijso beishuizen wrote: Dear all, Again, a question about something that was once written in/with macsyma and now (probably) lost... Does somebody know of a surviving macsyma/maxima implementation of the kovacic algorithm (solving second order ode's using differential Galois theory)? In some papers from the beginning of the 80's the authors state that they 'have implemented the algorithm in macsyma', most notably Prelle&Singer (1983). At least 4 different groups have written a version in macsyma and one version of this algorithm was probably part of Macsyma at one point (mentioned in the Handbook of differential equations in 1989). I asked about this up a few years ago without success. At the time I contacted David Saunders about his 1981 code, but he no longer had a copy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri Apr 6 08:14:05 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 06 Apr 2012 06:14:05 -0700 Subject: [Maxima] kovacic algorithm In-Reply-To: References: , <4F7CD04F.9050601@gmail.com> Message-ID: <4F7EEC1D.7070705@eecs.berkeley.edu> On 4/6/2012 2:19 AM, nijso beishuizen wrote: > Thanks for the reply. I have Saunders' paper as well, describing the > algorithm. I am also checking some newer results from Hoeij and Weil, > which result in more compact answers. Might be interesting to > implement, the only problem is time... There is an implementation, in Maple, by Carolyn Smith, in her MS thesis at Waterloo, 1984. http://www.cs.uwaterloo.ca/research/tr/1984/CS-84-35.pdf > > > ------------------------------------------------------------------------ > Date: Thu, 5 Apr 2012 08:50:55 +1000 > From: dbmaxima at gmail.com > To: nijso at hotmail.com > CC: maxima at math.utexas.edu > Subject: Re: [Maxima] kovacic algorithm > > On 5/04/2012 5:49 AM, nijso beishuizen wrote: > > Dear all, > > Again, a question about something that was once written in/with > macsyma and now (probably) lost... > > Does somebody know of a surviving macsyma/maxima implementation of > the kovacic algorithm (solving second order ode's using > differential Galois theory)? In some papers from the beginning of > the 80's the authors state that they 'have implemented the > algorithm in macsyma', most notably Prelle&Singer (1983). At least > 4 different groups have written a version in macsyma and one > version of this algorithm was probably part of Macsyma at one > point (mentioned in the Handbook of differential equations in 1989). > > > I asked about this up a few years ago without success. At the time I > contacted David Saunders about his 1981 code, but he no longer had a > copy./ > / > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From volkervannek at googlemail.com Fri Apr 6 13:19:09 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Fri, 6 Apr 2012 20:19:09 +0200 Subject: [Maxima] a Maxima program running under the Windows implementation but not under Linux implementation of Maxima / wxMaxima In-Reply-To: References: Message-ID: Hello Jochen, I attached a file containing some comments on your paper and also containing my personal view on Ubuntu. I noticed that you are interested in number theory. Chinese remainder and primroot computation in (Z/nZ)* will be in src in version 5.27. Since 2008 there is already a share package about finite fields. load(gf); will load the package and tell you about the directory containing it. There you will also find a pdf documentation about this package. But be warned. It is not bug free and produces side effects to variables in top level. I plan to revise gf.mac this year. Greetings from Aachen Volker van Nek 2012/4/6 Jochen Ziegenbalg > Sorry, the correct address for the introductory manual is: > > > http://www.ziegenbalg.ph-karlsruhe.de/materialien-homepage-jzbg/Manuskripte/Erste-Hinweise-zu-Maxima.pdf > > All the best, > Jochen > > ---------- Forwarded message ---------- > From: Jochen Ziegenbalg > Date: Fri, Apr 6, 2012 at 7:05 AM > Subject: Re: [Maxima] a Maxima program running under the Windows > implementation but not under Linux implementation of Maxima / wxMaxima > To: Volker van Nek > > > Hello Volker, > > thank you for the references and for your help, alltogether. I wholly > appreciate the work done by the Maxima and the ubuntu and Linux > developers ... and certainly, I don't want the old version back. > > As for upgrading ubuntu, I work with several computers, some of them > pretty old, some not quite so old, but none of them very new. For a > while, I worked with ubuntu version 10.4 on all of them. Then I > upgraded one of them to the newer version (11.04) of ubuntu. But I > didn't like the new user interface. One of my students showed me how > to keep the newer version but have it run under the old user > interface. That's what I did - and as for ubuntu I didn't change > anything else, so far - keeping in mind Jerry Pournelle's dictum > "Don't fix it if it ain't broken". > > Now I am somewhat at loss on if and when to upgrade ubuntu once again. > > Thank you, again, > wishing you happy Easter holidays, > Jochen > > > P.S.: Having had to struggle quite a bit to get used to Maxima > (although it certainly is worthwhile the effort) I wrote a tiny > tutorial for the very first beginners focussing on programming > features for my students - alas in German. If you read German (with > your first name being Volker, there is some probability speaking for > it) and if are interested, you can find it here: > http://www.ziegenbalg.ph-karlsruhe.de/Erste-Hinweise-zu-Maxima > > > > On Thu, Apr 5, 2012 at 8:45 PM, Volker van Nek > wrote: > > Hello Jochen, > > > > I am happy to read that you got it work. > > > > I found two pages in http://wiki.ubuntuusers.de about ppa. Perhaps > these can > > give a little bit more understanding on software sources and ppa. > > > > http://wiki.ubuntuusers.de/Paketquellen_freischalten/PPA?highlight=ppa > > > > http://wiki.ubuntuusers.de/Launchpad/PPA?highlight=ppa > > > > I believe Ubuntu is not supplied via sourceforge because it is simply > one of > > hundreds of Linux distributions. The distributions maintainers are doing > a > > great job in resolving all dependencies. This should not be a task to the > > Maxima developers. > > > > Yes, the old version is overwritten. If you want it back, unflag the > > repository from Istvan Blahota in synaptic and reinstall. But I guess you > > won't. > > > > Why don't you upgrade your Ubuntu? > > > > Best > > Volker van Nek > > > > PS: Please always cc to this list. Thank you. > > > > > > > > > > 2012/4/5 Jochen Ziegenbalg > >> > >> Hello Volker van Nek, > >> > >> this worked (i.e. doing the PPA-stuff, downloading the Maxima 5.26 > >> packages, installing them and running my program) thank you. > >> > >> But installing the PPA stuff and everything was rather like a "blind > >> flight" > >> due to big holes in the documentation and instructions. > >> > >> Why is the ubuntu version of Maxima 5.26 not supplied via sourceforge? > >> > >> And: The older version of Maxima seems to be deleted or overwritten. > >> Is this OK? > >> > >> Thank you very much, > >> Jochen > >> > >> > >> On Wed, Apr 4, 2012 at 1:40 PM, Volker van Nek > >> wrote: > >> > Or maybe a better source for maxima deb files is > >> > > >> > https://code.launchpad.net/~blahota/+archive/wxmaxima > >> > > >> > Here packages for Ubuntu versions down to lucid are available. > >> > > >> > To use them you need to follow the instructions under > >> > > >> > Adding this PPA to your system > >> > > >> > > >> > HTH > >> > Volker van Nek > >> > > >> > > >> > > >> > 2012/4/4 Volker van Nek > >> >> > >> >> Hello, > >> >> > >> >> I would download a newer version from debian (Ubuntu uses debian > files) > >> >> > >> >> http://packages.debian.org/sid/maxima > >> >> > >> >> and double click on the deb file. A graphical interface should open > and > >> >> it > >> >> will check if all the necessary dependencies are fullfilled. > >> >> > >> >> In case that works I guess you have to download the maxima-emacs > >> >> package > >> >> as well. A grep-search tells me that wxdraw2d is defined in > >> >> interfaces/emacs/imaxima/imaxima.lisp. > >> >> > >> >> Let me know what you experience. > >> >> > >> >> Volker van Nek > >> >> > >> >> > >> >> > >> >> 2012/4/4 Jochen Ziegenbalg > >> >>> > >> >>> Hello Volker van Nek, > >> >>> > >> >>> thank you for your quick response. As you suggest, the program > "runs > >> >>> through" without an error message if I replace the wxdraw2d command > by > >> >>> returning just 1. Also, if I return the graphics list LG it works > and > >> >>> contentwise the list LG seems to be OK. So, the problem is with the > >> >>> wxdraw2d command. Replacing the wxdraw2d commond by just draw2d > does > >> >>> not help, either. > >> >>> > >> >>> As I mentioned in my first mail, the ubuntu-based system is running > >> >>> Maxima version 5.22.1. Of course, before writing to > >> >>> maxima at math.utexas.edu, I tried to update my ubuntu Maxima system, > >> >>> first. Not being very experienced with ubuntu, I tried to do this > >> >>> using the Synaptic Package Manager. But whatever I tried, it did > not > >> >>> result in a newer version of Maxima. So I thought, version 5.22.1 > was > >> >>> the most recent version. > >> >>> > >> >>> Of course, if the problem would be solved if I used a more recent > >> >>> version of Maxima, this would be the thing to do (instead of trying > to > >> >>> repair version 5.22.1). But how do I get my 5.22.1 version updated > >> >>> under ubuntu? I would be grateful for a hint. > >> >>> > >> >>> Thank you for your help, > >> >>> Jochen > >> >>> > >> >>> > >> >>> > >> >>> On Wed, Apr 4, 2012 at 1:21 AM, Volker van Nek > >> >>> wrote: > >> >>> > Hallo Jochen Ziegenbalg, > >> >>> > > >> >>> > I can confirm that your wxm file runs on Ubuntu with Maxima 5.26.0 > >> >>> > and > >> >>> > 5.25.1 but fails with 5.20.1. I can't tell about the version > 5.22.1. > >> >>> > > >> >>> > The wxdraw2d function is a quite recent development if I am not > >> >>> > mistaken. In > >> >>> > a first step I would just replace the last line in your > >> >>> > StringToGraphic > >> >>> > function > >> >>> > by a simple return value like 1 or so and check if it works > without > >> >>> > errors. > >> >>> > > >> >>> > StringToGraphic(Str, c0, c1) := > >> >>> > ... > >> >>> > LG : append(LG, [Gbit]) ), > >> >>> > 1) ; > >> >>> > > >> >>> > Let us know what the result is. > >> >>> > > >> >>> > Volker van Nek > >> >>> > > >> >>> > 2012/4/3 Jochen Ziegenbalg > >> >>> >> > >> >>> >> Ladies and gentlemen, > >> >>> >> > >> >>> >> in the appendix I send you a small Maxima program running without > >> >>> >> any > >> >>> >> problem under wxMaxima for Windows (wxMaxima 11.08.0 / Maxima > >> >>> >> 5.25.1) > >> >>> >> but not running under the (Ubuntu-) Linux implementation > (wxMaxima > >> >>> >> 0.85 / Maxima 5.22.1). > >> >>> >> > >> >>> >> The purpose of the program is to convert a string into its bit > >> >>> >> structure (using the ASCII-code) and display this bit structure > >> >>> >> graphically. > >> >>> >> > >> >>> >> Under Windows the program runs as expected. > >> >>> >> > >> >>> >> Under Linux (after defining the "helper"-functions like Byte), > >> >>> >> calling > >> >>> >> the procedure > >> >>> >> StringToGraphic("Karlsruhe", yellow, black) > >> >>> >> results in the error message > >> >>> >> > >> >>> >> Maxima encountered a Lisp error: > >> >>> >> Error in Apply [or a callee]:The function NIL is undefined. > >> >>> >> Automatically continuing. > >> >>> >> ... > >> >>> >> > >> >>> >> I would be grateful for some clarification on why this is so ... > >> >>> >> and a > >> >>> >> hint on how to run the program under Linux. > >> >>> >> > >> >>> >> Thank you very much, > >> >>> >> Jochen Ziegenbalg > >> >>> >> > >> >>> >> _______________________________________________ > >> >>> >> Maxima mailing list > >> >>> >> Maxima at math.utexas.edu > >> >>> >> http://www.math.utexas.edu/mailman/listinfo/maxima > >> >>> >> > >> >>> > > >> >> > >> >> > >> > > > > > > > > > -- > *********************************************************** > Prof. Dr. Jochen Ziegenbalg > Institut fuer Mathematik und Informatik > Paedagogische Hochschule Karlsruhe > University of Education, Karlsruhe (Germany) > ---------------------------------------------------------------------- > ziegenbalg at ph-karlsruhe.de > www.ziegenbalg.ph-karlsruhe.de > ---------------------------------------------------------------------- > Tel. privat: 030-21237725 > *********************************************************** > > > -- > *********************************************************** > Prof. Dr. Jochen Ziegenbalg > Institut fuer Mathematik und Informatik > Paedagogische Hochschule Karlsruhe > University of Education, Karlsruhe (Germany) > ---------------------------------------------------------------------- > ziegenbalg at ph-karlsruhe.de > www.ziegenbalg.ph-karlsruhe.de > ---------------------------------------------------------------------- > Tel. privat: 030-21237725 > *********************************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- Seite 1: - Der System-Kern von Maxima enth?lt ein komplettes Lisp-System. Nein. Es wird zwar in die Windows-Maxima-Executable ein GCL mit hinein kompiliert, Maxima selbst aber enth?lt kein Lisp System, sondern verwendet eins. Sie k?nnen sich den Installationsprozess unter Ubuntu mal genauer ansehen. Wenn sie in Synaptic maxima ausw?hlen, dann werden die Abh?ngigkeiten aufgel?st und es wird zuerst ein Lisp installiert. Wer aus dem Quellcode Maxima kompiliert, kann vorher mehrere Lisps installieren und Maxima bef?higen, zur Ausf?hrung wahlweise dieses oder jenes Lisp zu verwenden. Bis Anfang der 80er lief Macsyma nur am MIT und nur auf Maclisp und wurde erst dann nach Berkeley auf Franz Lisp portiert. Danach auch auf andere Lisps. Common Lisp wurde in den 90ern standardisiert, trotzdem findet man im Quelltext von Maxima noch viele Fallunterscheidungen bzgl. der einzelnen Varianten. - wxMaxima-Interface trotz einiger Eigenheiten Vielleicht teilen sie dem Entwickler mit, was ihnen nicht gef?llt. wxMaxima hat ein eigenes Forum und Bug-Tracking. Im Prinzip ein separates Projekt. Entwickler haben immer eine sehr eingeschr?nkte Sicht auf ihr Produkt. Deswegen sind wir auf Feedback angewiesen. Das geh?rt zu den Prinzipien der Open Source Enntwicklung. - Urspr?nglich sollte das Programm Newplot hei?en Interessant! Wusste ich gar nicht. Seite 2: - Tastenkombination [Shift-Return]. Schreibt man im Wesentlichen nur einzeilige Audr?cke, kann man das auch auf [Return] umstellen. [Shift-Return] macht dann den Umbruch ohne Auswertung. - Bemerkung: Maxima/Lisp arbeiten mit Ausdr?cken. Und jeder Ausdruck hat einen Wert. Es gibt kein void. Es geht nicht darum, Befehle abzuarbeiten. Das w?re der prozedurale Ans?tz. (foo : 42, bar : foo, baz : bar) ist z.B. ein einziger Ausdruck mit einem einzigen Wert. Dem Wert des letzten Arguments. Man kann diese 3 durch Kommata separierte Ausdr?cke als Argumente einer Block-Funktion auffassen. (%i1) (foo : 42, bar : foo, baz : bar); (%o1) 42 (%i2) :lisp $_ ((MPROGN) ((MSETQ) $FOO 42) ((MSETQ) $BAR $FOO) ((MSETQ) $BAZ $BAR)) Mehr zu diesem Thema in dem ausgezeichneten http://maxima.sourceforge.net/docs/tutorial/en/minimal-maxima.pdf Seite 5: - Der Ausgabewert 22.5 ist nur scheinbar korrekt 22.5 l?sst sich doch exakt abbilden, oder vertue ich mich da? Sollte man nicht besser ein Beispiel nehmen, wo z.B. .3 am Ende steht? Jedenfalls ist das ein immer wiederkehrendes Thema. Oft sind Einsteiger bei Antworten wie 0.3000000000000004 irritiert und fragen, ob das ein Bug sei. Seite 6: - beim Aufruf hugo(5) eine Fehlermeldung Warum sollte das ?berhaupt ein Fehler sein? Maxima kann ja gar nicht wissen, was hugo(5) f?r den Programmierer bedeutet. hugo(5) ist hugo(5), wenn keine weiteren Informationen vorliegen. Das ist symbolische Programmierung. Zitat aus dem minimal-maxima.pdf: Maxima is not much worried about the meaning of an expression. Whether an expression is meaningful is for the user to decide. - Beschreibung des printf-Befehls Der stammt von mir. Ich hatte seinerzeit dieser Funktion in einem CAS keine so hohe Bedeutung beigemessen und wollte dieses Thema eher nicht ?bertreiben. Mittlerweile haben mich jedoch schon mehrere Kommentare davon ?berzeugt, dass ich besser noch etwas ausf?hrlicher werden sollte. printf ist jedoch nichts weiter als ein Frontend f?r die Lisp-Funktion format, erweitert um die nicht Standard-Lisp-konforme Direktive ~h f?r Bigfloats. Zur Zeit muss man also nach format googeln. Mein Tipp: http://www.cs.cmu.edu/Groups/AI/html/cltl/cltl2.html 22.3.3. Formatted Output to Character Streams - wxMaxima XML Dokument: Dateikennung: wxmx vielleicht noch erg?nzen, dass es komprimierte XML-Dokumente sind. (Man muss die noch entpacken, bevor man sie im Text-Editor ?ffnen kann. Vorteil von wxmx: Unicode. Kein Problem mehr mit Umlauten beim Transport von Windows nach Linux.) Seite 8: - Wert done done ist der Wert der Funktion do. done ist ein Symbol mit sich selbst als Wert. Man kann z.B. wie folgt testen, ob die Schleife ganz durchgelaufen ist. getan : do ( foo, bar, if test then return(), baz )$ if getan = 'done then Seite 9: - Euklid_Subtraktionsform(a, b) := block([x : a, y : b], while x*y # 0 do /* solange x und y von Null verschieden sind */ (if x>y then x : x-y else y : y-x), return(x+y) ); Es ist nicht notwendig, neue Variablen zu verwenden. Sind a und b 32 Bit Fixnums, dann geschieht eh nur ein Call-By-Value. Andernfalls sind es Bignums, die zwar als Objekte (Lisp-Listen) gespeichert werden, es findet aber an keiner Stelle eine Dereferenzierung statt, so dass man sich keine Sorgen um die an a und b ?bergebenen Bignums machen muss. x*y, x-y, y-x erzeugt wiederum neue Objekte. Die alten bleiben wie sie sind. Man muss hier im funktionalen Sinn denken. Die Entwickler verwenden nur an Stellen Dereferenzierungen, wo es gefahrlos ist und echten Zeitvorteil bringt. Maxima ist dadurch etwas langsamer aber grunds?tzlich sehr sicher. Sie schrieben ja selbst, dass am Ende ein return keinen Sinn macht. Bitte ?ndern sie das ab. Danke. Euklid_Subtraktionsform(x, y) := ( while x*y # 0 do /* solange x und y von Null verschieden sind */ (if x>y then x : x-y else y : y-x), x+y )$ - Eratosthenes(UpperLimit) := ... while i*i <= UpperLimit do ... Effizienter ist wohl isqrtUL : isqrt(UpperLimit), while i <= isqrtUL do Seite 10: - sublist(E, lambda([x], not(is(x=0)))) ); sublist erwartet eine Pr?dikatfunktion. Deshalb kann man kurz schreiben sublist(E, lambda([x], x#0)) )$ Seite 11: - (%i1) :lisp (car '(A B)); :q; A Da bin ich platt! Wie bekomme sie das hin? volker at uvw32:~$ maxima Maxima 5.25.1 http://maxima.sourceforge.net using Lisp CLISP 2.49 (2010-07-07) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) :lisp (car '(A B)) A (%i1) Sie ben?tigen kein ; am Ende. Das mit dem :q kann ich nicht nachvollziehen. Seite 12: - Die Beschreibung des Befehls set_display(ascii) ist im Hilfe-System leider ziemlich gut versteckt. set_display ist auch keine Maxima- sondern eine wxMaxima-Funktion. --> wxMaxima/Men? Maxima/Format 2D Anzeige - Initialisierungs- oder setup-Datei Das ist die maxima-init.lisp. (%i1) load("maxima-init.lisp"); (%o1) /usr/local/share/maxima/5.25.1/share/maxima-init.lisp Dies f?hrt mich zu dem entsprechenden Verzeichnis. Unter Windows liegt sie an ?hnlicher Stelle. Hier k?nnen sie Lisp-Befehle ablegen. Sie k?nnen zus?tzlich an gleicher Stelle eine maxima-init.mac erzeugen und dort Maxima Befehle rein schreiben. Sie k?nnen alternativ auch das Home-Verzeichnis verwenden. (%i2) :lisp *maxima-userdir* /home/volker/.maxima In Windows wird das so lauten: (%i2) :lisp *maxima-userdir* C:/Users/volker/maxima Dieses Verzeichnis anlegen und dort eine init-Datei ablegen. Diese Datei hat dann Vorrang vor gleichnamigen in /share/. Ubuntu: Abschlie?end eine Bemerkung zu diesem Thema (geh?rt ja nicht auf die Maxima Liste). F?r alte Computer gibt es Lubuntu. Ich spreche da aus Erfahrung. Ich administriere ein System mit 22 Clients, einem File/Ldap-Server und einem Proxy. Die Hardware ist 6 Jahre alt. Die Rechner sind mit Lubuntu superschnell und absolut zuverl?ssig. Und ich bin sehr sehr zufrieden damit. Zu Hause verwende ich Xubuntu und Lubuntu. Ich mag auch den neuen Gnome3/Unity-Style nicht. Wesentlich ist f?r mich auch, dass Ubuntu seit einiger Zeit Release Upgrades ohne Neuinstallation anbietet. Lief bisher unproblematisch. Ich habe sicherlich ein weinig an Zeit in den Umstieg von Windows investiert, aber ich kann nur sagen, dass es sich wirklich sehr gelohnt hat. Nicht nur, dass in Linux alles viel einfacher ist, es ist auch sicher, schnell und zuverl?ssig. From dan.stanger at ieee.org Fri Apr 6 14:09:15 2012 From: dan.stanger at ieee.org (Dan Stanger) Date: Fri, 06 Apr 2012 15:09:15 -0400 Subject: [Maxima] kovacic algorithm In-Reply-To: <4F7EEC1D.7070705@eecs.berkeley.edu> References: , <4F7CD04F.9050601@gmail.com> <4F7EEC1D.7070705@eecs.berkeley.edu> Message-ID: <4F7F3F5B.9030504@ieee.org> There is also a translator from Maple to Maxima in the Maxima distribution. Dan Stanger Richard Fateman wrote: > On 4/6/2012 2:19 AM, nijso beishuizen wrote: >> Thanks for the reply. I have Saunders' paper as well, describing the >> algorithm. I am also checking some newer results from Hoeij and Weil, >> which result in more compact answers. Might be interesting to >> implement, the only problem is time... > > There is an implementation, in Maple, by Carolyn Smith, in her MS > thesis at Waterloo, 1984. > > http://www.cs.uwaterloo.ca/research/tr/1984/CS-84-35.pdf > From nijso at hotmail.com Fri Apr 6 14:57:39 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Fri, 6 Apr 2012 21:57:39 +0200 Subject: [Maxima] kovacic algorithm In-Reply-To: <4F7F3F5B.9030504@ieee.org> References: , , <4F7CD04F.9050601@gmail.com> , <4F7EEC1D.7070705@eecs.berkeley.edu>, <4F7F3F5B.9030504@ieee.org> Message-ID: This is good news, it will save a lot of time implementing this algorithm. I also didn't know that you could translate Maple into Maxima code. Where is it in the sources and is there documentation? I couldn't find it by grepping 'maple' in 5.26.0. > Date: Fri, 6 Apr 2012 15:09:15 -0400 > From: dan.stanger at ieee.org > To: nijso at hotmail.com; maxima at math.utexas.edu > Subject: Re: [Maxima] kovacic algorithm > > There is also a translator from Maple to Maxima in the Maxima distribution. > Dan Stanger > Richard Fateman wrote: > > On 4/6/2012 2:19 AM, nijso beishuizen wrote: > >> Thanks for the reply. I have Saunders' paper as well, describing the > >> algorithm. I am also checking some newer results from Hoeij and Weil, > >> which result in more compact answers. Might be interesting to > >> implement, the only problem is time... > > > > There is an implementation, in Maple, by Carolyn Smith, in her MS > > thesis at Waterloo, 1984. > > > > http://www.cs.uwaterloo.ca/research/tr/1984/CS-84-35.pdf > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Fri Apr 6 15:56:36 2012 From: woollett at charter.net (Edwin Woollett) Date: Fri, 6 Apr 2012 13:56:36 -0700 Subject: [Maxima] is equal with realpart Message-ID: <521FD0CC1E2B44EC9149EA810FCC66CC@edwinc367e16bd> To save possible time I want to use a test like ---------- if is (equal (bex, realpart(bex))) then do something ----------- This saves time (and up to now works) so that I don't have to take into account that I need to deal separately with the real and imaginary parts of bex. But now I have a case where it doesn't work: (5.26.0 gcl ) -------------------------- (%i1) display2d:false$ (%i2) bex : 1/sqrt(sin(x)); (%o2) 1/sqrt(sin(x)) (%i3) realpart(bex); (%o3) cos(atan2(0,sin(x))/2)/sqrt(abs(sin(x))) (%i4) imagpart(bex); (%o4) -sin(atan2(0,sin(x))/2)/sqrt(abs(sin(x))) (%i5) is (equal (bex, realpart(bex))); (%o5) true <== wrong! (%i6) is (equal (bex, imagpart(bex))); (%o6) false <== correct --------------------------------- Is there a better test I can use? Ted Woollett From nijso at hotmail.com Fri Apr 6 15:59:03 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Fri, 6 Apr 2012 22:59:03 +0200 Subject: [Maxima] assigning a value to x in diff(f(x),x) Message-ID: Dear all, I have written a function separable(expr,x,y) that returns [f(x),g(y)] if expr is separable, and false otherwise. However, I have a problem with the exotic case where expr contains the derivative of an unknown function f(x), i.e. when expr:diff(f(x),x)*y The problem is that the algorithm works by assigning a value to x. Is there a way to make 'something like this' work: depends(f,x); define(F(x),diff(f,x)); F(0); which should then result in the equivalent of f '(0). -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Fri Apr 6 16:09:59 2012 From: woollett at charter.net (Edwin Woollett) Date: Fri, 6 Apr 2012 14:09:59 -0700 Subject: [Maxima] is equal with realpart Message-ID: <1B58B31AFFC34D8CBC90164684E861B6@edwinc367e16bd> On April 6, 2012, I wrote ------------------------------ (%i2) bex : 1/sqrt(sin(x)); (%o2) 1/sqrt(sin(x)) (%i3) realpart(bex); (%o3) cos(atan2(0,sin(x))/2)/sqrt(abs(sin(x))) (%i4) imagpart(bex); (%o4) -sin(atan2(0,sin(x))/2)/sqrt(abs(sin(x))) (%i5) is (equal (bex, realpart(bex))); (%o5) true <== wrong! (%i6) is (equal (bex, imagpart(bex))); (%o6) false <== correct -------------------------------- The help manual, under equal, discusses is( equal(...)) and implies that is (equal(a,b)) returns true if ratsimp (a - b) returns 0. For my case: -------------------------------- (%i34) ratsimp(bex-imagpart(bex)); (%o34) (sqrt(abs(sin(x)))+sin(atan2(0,sin(x))/2)*sqrt(sin(x))) /(sqrt(sin(x))*sqrt(abs(sin(x)))) (%i35) ratsimp(bex-realpart(bex)); (%o35) (sqrt(abs(sin(x)))-cos(atan2(0,sin(x))/2)*sqrt(sin(x))) /(sqrt(sin(x))*sqrt(abs(sin(x)))) --------------- Ted Woollett From fateman at eecs.berkeley.edu Fri Apr 6 17:24:00 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 06 Apr 2012 15:24:00 -0700 Subject: [Maxima] want to run Maxima on Google App Engine? Message-ID: <4F7F6D00.30806@eecs.berkeley.edu> see http://research.google.com/university/relations/appengine/index.html From woollett at charter.net Sat Apr 7 17:40:57 2012 From: woollett at charter.net (Edwin Woollett) Date: Sat, 7 Apr 2012 15:40:57 -0700 Subject: [Maxima] is equal with realpart Message-ID: <83710106FD3F488AB6EBF760C316EAF9@edwinc367e16bd> On April 6, 2012, I wrote: ------------------------------ (%i1) display2d:false$ (%i2) bex : 1/sqrt(sin(x)); (%o2) 1/sqrt(sin(x)) (%i3) realpart(bex); (%o3) cos(atan2(0,sin(x))/2)/sqrt(abs(sin(x))) (%i4) imagpart(bex); (%o4) -sin(atan2(0,sin(x))/2)/sqrt(abs(sin(x))) (%i5) is (equal (bex, realpart(bex))); (%o5) true <== wrong! (%i6) is (equal (bex, imagpart(bex))); (%o6) false <== correct --------------------------------- Here we also show that if a calling program (test) gets the wrong "true" answer from is(equal(...)), and then calls a subprogram (test1), an incorrect evaluation of realpart(expr) is found in test1. This occurs in both 5.26.0gcl and 5.25.1gcl. First with 5.26.0gcl: (see code file at end) -------------------------------------------- (%i1) load(test); (%o1) "c:/work2/test.mac" (%i2) test(1/sqrt(sin(x))); test aex = 1/sqrt(sin(x)) aexr = cos(atan2(0,sin(x))/2)/sqrt(abs(sin(x))) isr = t test1 bex = 1/sqrt(sin(x)) bexr = 1/sqrt(sin(x)) (%o2) 1/sqrt(sin(x)) (%i3) realpart(1/sqrt(sin(x))); (%o3) cos(atan2(0,sin(x))/2)/sqrt(abs(sin(x))) (%i4) is(equal(1/sqrt(sin(x)), realpart(1/sqrt(sin(x))))); (%o4) true (%i5) build_info(); Maxima version: 5.26.0 Maxima build date: 22:48 1/15/2012 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 -------------------------------------------- Next with 5.25.1gcl: -------------------------------- (%i1) load(test); (%o1) "c:/work2/test.mac" (%i2) test(1/sqrt(sin(x))); test aex = 1/sqrt(sin(x)) aexr = cos(atan2(0,sin(x))/2)/sqrt(abs(sin(x))) isr = true test1 bex = 1/sqrt(sin(x)) bexr = 1/sqrt(sin(x)) (%o2) 1/sqrt(sin(x)) -------------------------- Here is the code file test.mac: -------------------------------------- /* test.mac */ test1(bex) := block([bexr], print (" test1 "), print(" bex = ",bex), bexr : realpart(bex), print(" bexr = ",bexr), bexr)$ test(aex) := block([aexr,ans1,isr], print(" test "), print(" aex = ",aex), aexr : realpart(aex), print(" aexr = ",aexr), isr : is(equal(aex,realpart(aex))), print(" isr = ",isr), ans1 : test1(aex), ans1)$ display2d:false$ ------------------------------- Ted Woollett From woollett at charter.net Sat Apr 7 18:20:20 2012 From: woollett at charter.net (Edwin Woollett) Date: Sat, 7 Apr 2012 16:20:20 -0700 Subject: [Maxima] is equal with realpart Message-ID: <6FD3F2C711234524BB2FF61EB4CB15B1@edwinc367e16bd> On April 7, 2012, I wrote: ---------------------------------- >Here we also show that if a calling program (test) >gets the wrong "true" answer from is(equal(...)), >and then calls a subprogram (test1), an incorrect >evaluation of realpart(expr) is found in test1. > >This occurs in both 5.26.0gcl and 5.25.1gcl. ----------------------------------------------- We can avoid this bug by using a homemade isequal function: isequal(a23,b23) := (if ratsimp(a23-b23) = 0 then true else false)$ and replacing the definition of isr in test with: isr : isequal(aex,realpart(aex)), with correct evaluation in the subprogram test1: ----------------------------- (%i1) load(test); (%o1) "c:/work2/test.mac" (%i2) test(1/sqrt(sin(x))); test aex = 1/sqrt(sin(x)) aexr = cos(atan2(0,sin(x))/2)/sqrt(abs(sin(x))) isr = nil test1 bex = 1/sqrt(sin(x)) bexr = cos(atan2(0,sin(x))/2)/sqrt(abs(sin(x))) (%o2) cos(atan2(0,sin(x))/2)/sqrt(abs(sin(x))) --------------------------------------- Ted Woollett From yasuaki.honda at gmail.com Sat Apr 7 23:20:29 2012 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Sun, 8 Apr 2012 13:20:29 +0900 Subject: [Maxima] expintegral_ei() bug on convergence In-Reply-To: References: Message-ID: Hi Raymond san, > Yes, this was basically what I had in mind, except the condition would have been abs(z) > 1 and, > maybe, abs(phase(z)) < 3.1, so that we stay away from the negative axis. The condition (and (> (abs z) 1) (< (abs (phase z)) (* pi 0.99))) did not pass the rtest_expintegral. The condition that passes the rtest_expintegral is: (and (> (abs z) 2) (< (abs (phase z)) (* pi 0.9))) If you think this is OK, then I will modify bfloat and frac versions of expintegral-e() in a same manner and create a patch for everyone's review. For the z on the negative real axis, I don't know the correct behavior of the expintegral_e(). Just I experimented with couple of z values such as z=-100, z=-200, z=-300 with expintegral_e(1, z) in Maxima and e1(z) in mpmath in Python. They coincide with each other. (%i52) expintegral_e1(-100.0); (%o52) -3.141592653589793*%i-2.715552744853881e+41 (%i53) expintegral_e1(-200.0); (%o53) -3.141592653589793*%i-3.631235233159359e+84 (%i54) expintegral_e1(-300.0); (%o54) -3.141592653589793*%i-6.49648250808866e+127 >>> e1(-100.0) (-2.71555274485388e+41 - 3.14159265358979j) >>> e1(-200.0) (-3.63123523315936e+84 - 3.14159265358979j) >>> e1(-300.0) (-6.49648250808867e+127 - 3.14159265358979j) Thanks and best regards, Yasuaki Honda, Chiba, Japan 2012?4?6?2:10 Raymond Toy : > > > 2012/4/5 ???? > >> Hi Raymond san, all, >> >> I am looking at the expintegral.lisp line 534 where the continued >> fraction or power series >> is chosen. >> >> According to DLMF Section 6.18 (http://dlmf.nist.gov/6.18 which is an >> updated publication of A&S), >> >> "For small or moderate values of x and z, the expansion in power series >> (?6.6) or in series of spherical Bessel functions (?6.10(ii)) can be used. >> .... >> Lastly, the continued fraction (6.9.1) can be used if z is >> bounded away from the origin. Convergence becomes slow when z is near the >> negative real axis, however." >> >> So, I would like to propose: >> if z is close to origin or z is close to the negative real axis, we >> expand in power series, >> otherwise, we expand in continued fraction. The actual patch comes below. >> > > Yes, this was basically what I had in mind, except the condition would > have been abs(z) > 1 and, maybe, abs(phase(z)) < 3.1, so that we stay away > from the negative axis. > > This fixes your immediate problem, I think, but we are still left with the > issue of what do we do if we want expintegral_e on the negative axis. I > haven't figured that out yet.... > > Ray > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sun Apr 8 01:23:21 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 07 Apr 2012 23:23:21 -0700 Subject: [Maxima] expintegral_ei() bug on convergence In-Reply-To: References: Message-ID: <4F812ED9.5030304@gmail.com> On 4/7/12 9:20 PM, ???? wrote: > Hi Raymond san, > > > Yes, this was basically what I had in mind, except the condition > would have been abs(z) > 1 and, > > maybe, abs(phase(z)) < 3.1, so that we stay away from the negative axis. > > The condition (and (> (abs z) 1) (< (abs (phase z)) (* pi 0.99))) did > not pass the rtest_expintegral. The condition that passes the > rtest_expintegral is: > (and (> (abs z) 2) (< (abs (phase z)) (* pi 0.9))) How does rtest_expintegral fail for the first case? Accuracy reduced? > > If you think this is OK, then I will modify bfloat and frac versions > of expintegral-e() in a same manner and create a patch for everyone's > review. If you think this is the right solution, I think you should just go ahead. If there's a problem we'll find it. :-) And for those that are interested, I'm sure they'll look at your patch. > > For the z on the negative real axis, I don't know the correct behavior > of the expintegral_e(). Just I experimented with couple of z values > such as z=-100, z=-200, z=-300 with expintegral_e(1, z) in Maxima and > e1(z) in mpmath in Python. They coincide with each other. Sorry about that. I was just thinking that evaluating the power series with terms like 200^k would not converge very well, but I didn't check. And the values are reasonably close to the asymptotic value of exp(-z)/z, so it looks good. Might be good to add a few test cases for z = -100 and -200. Ray From nijso at hotmail.com Sun Apr 8 04:54:56 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Sun, 8 Apr 2012 11:54:56 +0200 Subject: [Maxima] assigning a value to x in diff(f(x),x) In-Reply-To: <4F7F6A6E.9080100@eecs.berkeley.edu> References: , <4F7F6A6E.9080100@eecs.berkeley.edu> Message-ID: Thanks! This looks promising. is at(F(x,y),[x=0,y=0]) the same as F(0,0) when no derivatives are involved? I still need to know which variables, if any, are involved in differential operators. I now declare dependencies to deal with this (using atvalue, assuming all dependencies are involved in differentiation), but if somebody knows a more elegant method of finding the free dependent variables in an expression, please let me know. Date: Fri, 6 Apr 2012 15:13:02 -0700 From: fateman at eecs.berkeley.edu To: nijso at hotmail.com Subject: Re: [Maxima] assigning a value to x in diff(f(x),x) try looking at "at" On 4/6/2012 1:59 PM, nijso beishuizen wrote: Dear all, I have written a function separable(expr,x,y) that returns [f(x),g(y)] if expr is separable, and false otherwise. However, I have a problem with the exotic case where expr contains the derivative of an unknown function f(x), i.e. when expr:diff(f(x),x)*y The problem is that the algorithm works by assigning a value to x. Is there a way to make 'something like this' work: depends(f,x); define(F(x),diff(f,x)); F(0); which should then result in the equivalent of f '(0). _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From nijso at hotmail.com Sun Apr 8 13:58:02 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Sun, 8 Apr 2012 20:58:02 +0200 Subject: [Maxima] 'at' simplification Message-ID: Dear all, This: at(diff(g(x),x),[y=1]) - at(diff(g(x),x),[y=0]) should result in 0. Is there a (built-in) way to achieve this? I would expect that 'at' (or some simplification function) would recognize that the expression is independent of y. -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun Apr 8 14:08:06 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 8 Apr 2012 15:08:06 -0400 Subject: [Maxima] is equal with realpart In-Reply-To: <6FD3F2C711234524BB2FF61EB4CB15B1@edwinc367e16bd> References: <6FD3F2C711234524BB2FF61EB4CB15B1@edwinc367e16bd> Message-ID: Some related cases: sx: sqrt(x)$ cat: cos(atan2(0,x)/2)*sqrt(x)$ catab: cos(atan2(0,x)/2)*sqrt(abs(x))$ sign(sx-cat) => zero sign(sx-catab) => zero sign(cat-catab) => zero is(equal(sx,cat)) => unknown <<< inconsistent with sign is(equal(sx,catab)) => true is(equal(cat,catab)) => true Apparently sign/equal only compare the parts which are well-defined in the reals. This is fairly consistent with Maxima's general approach -- namely that things are real unless explicitly not real -- but obviously poses some problems.... It also seems awfully clumsy to have realpart(sqrt(x)) return cos(atan2(0,x)/2)*sqrt(abs(x)) rather than say step_function(x)*sqrt(abs(x)), but then most of Maxima isn't very clever about step_function (or for that matter signum). In particular: catst: step_function(x)*sqrt(abs(x)); sign(sx[,cat,catab] -catst) => pnz is(equal(sx [,cat,catab] ,catst)) => unknown Tested in 5.25.1 GCL 2.6.8 -s On Sat, Apr 7, 2012 at 19:20, Edwin Woollett wrote: > On April 7, 2012, I wrote: > ------------------------------**---- > > Here we also show that if a calling program (test) gets the wrong "true" >> answer from is(equal(...)), and then calls a subprogram (test1), an >> incorrect >> evaluation of realpart(expr) is found in test1. >> >> This occurs in both 5.26.0gcl and 5.25.1gcl. >> > ------------------------------**----------------- > We can avoid this bug by using a homemade > isequal function: > > isequal(a23,b23) := > (if ratsimp(a23-b23) = 0 then true else false)$ > > and replacing the definition of isr in test with: > > isr : isequal(aex,realpart(aex)), > > with correct evaluation in the subprogram test1: > > ----------------------------- > (%i1) load(test); > (%o1) "c:/work2/test.mac" > (%i2) test(1/sqrt(sin(x))); > test aex = 1/sqrt(sin(x)) aexr = cos(atan2(0,sin(x))/2)/sqrt(**abs(sin(x))) > isr = nil test1 bex = 1/sqrt(sin(x)) bexr = cos(atan2(0,sin(x))/2)/sqrt( > **abs(sin(x))) (%o2) cos(atan2(0,sin(x))/2)/sqrt(**abs(sin(x))) > ------------------------------**--------- > > Ted Woollett > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun Apr 8 14:24:22 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 8 Apr 2012 15:24:22 -0400 Subject: [Maxima] want to run Maxima on Google App Engine? In-Reply-To: <4F7F6D00.30806@eecs.berkeley.edu> References: <4F7F6D00.30806@eecs.berkeley.edu> Message-ID: It appears that ABCL is a Common Lisp implementation that runs on the JVM, and therefore on Google App Engine. Previous posts have said that Maxima runs on ABCL, so it should be possible to run Maxima on App Engine. The post you point to is about Google's Research Awards program for App Engine applications. I suspect that they wouldn't consider a simple port of Maxima to App Engine to be an "innovative research idea" (though it could be a useful SaaS implementation of Maxima for some users), but I'm not sure what you have in mind. -s PS I am an employee of Google, but I have nothing to do with the App Engine group and in any case the above opinions are my own, not Google's. On Fri, Apr 6, 2012 at 18:24, Richard Fateman wrote: > see > http://research.google.com/**university/relations/**appengine/index.html > > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sun Apr 8 16:18:51 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 08 Apr 2012 14:18:51 -0700 Subject: [Maxima] 'at' simplification In-Reply-To: References: Message-ID: <4F8200BB.5040408@eecs.berkeley.edu> On 4/8/2012 11:58 AM, nijso beishuizen wrote: > Dear all, > > This: > > at(diff(g(x),x),[y=1]) - at(diff(g(x),x),[y=0]) > > should result in 0. Is there a (built-in) way to achieve this? no, because if g(x):=x*y it is false. > I would expect that 'at' (or some simplification function) would > recognize that the expression is independent of y. > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun Apr 8 16:37:19 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 8 Apr 2012 17:37:19 -0400 Subject: [Maxima] 'at' simplification In-Reply-To: <4F8200BB.5040408@eecs.berkeley.edu> References: <4F8200BB.5040408@eecs.berkeley.edu> Message-ID: Agreed with Fateman, but a bit more explanation may be useful. The verb 'diff' assumes that all dependencies are included: diff( y,x ) => 0 diff( f(y), x ) => 0 Explicit dependencies can be declared with "depends": depends(q,r)$ diff(q,r) => 'diff(q,r) The *noun* 'diff' does not; on the contrary, it assumes that any variables can later be substituted for: 'diff(y,x) => 'diff(y,x) 'diff(f(y),x) => 'diff(f(y), x) This corresponds to standard mathematical notation, where dy/dx is not normally taken to be 0. "At" cannot assume differently in general, but I can see that it would be useful in many cases to tell Maxima that g(x) does not depend on y for the purposes of "diff" and "at". I suppose the easiest way to do that would be with simplification rules on diff and at. Another limitation of the "at" scheme is that it is sensitive to the variable name: at(diff(f(x),x),x=0)-at(diff(f(y),y),y=0) does not simplify to 0. The positional derivative package (pdiff) probably handles things like this better, but I am no expert in it. -s On Sun, Apr 8, 2012 at 17:18, Richard Fateman wrote: > On 4/8/2012 11:58 AM, nijso beishuizen wrote: > > Dear all, > > This: > > at(diff(g(x),x),[y=1]) - at(diff(g(x),x),[y=0]) > > should result in 0. Is there a (built-in) way to achieve this? > > no, because if g(x):=x*y > it is false. > > I would expect that 'at' (or some simplification function) would > recognize that the expression is independent of y. > > > _______________________________________________ > Maxima mailing listMaxima at math.utexas.eduhttp://www.math.utexas.edu/mailman/listinfo/maxima > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dr_schacht at t-online.de Wed Apr 4 13:26:20 2012 From: dr_schacht at t-online.de (Dr. Schacht) Date: Wed, 4 Apr 2012 20:26:20 +0200 Subject: [Maxima] Macsyma and PDEase2D Message-ID: <000001cd1290$6edb2a60$4c917f20$@t-online.de> Dear Sirs, I have got Macsyma 2.2, Macsyma 2.4 and PDEase2D 3.0 with a license. I have worked successfully with Macsyma and PDEase2D programs for many years. What can I do to use it with Windows XP or with Windows 7? Sincerely yours Dr. Wolfgang Schacht Projektmanager f?r Maschinen- und Energietechnik Parkstra?e 19 16348 Wandlitz Tel.: 033397-273057 E-Mail: dr_schacht at t-online.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From nijso at hotmail.com Mon Apr 9 07:38:04 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Mon, 9 Apr 2012 14:38:04 +0200 Subject: [Maxima] 'at' simplification In-Reply-To: References: , <4F8200BB.5040408@eecs.berkeley.edu>, Message-ID: But I gave 'at' a verb. Shouldn't 'at' then assume that all dependencies are included and that g(x) does not depend on y (and therefore it can drop the [y=1] restriction)? I would expect a different result for at(diff(g(x),x),[y=1]); and at('diff(g(x),x),[y=1]); Also: does depends() change the verb diff to a noun? Does this mean 'at' assumes all input is a noun? Date: Sun, 8 Apr 2012 17:37:19 -0400 Subject: Re: [Maxima] 'at' simplification From: macrakis at alum.mit.edu To: nijso at hotmail.com; fateman at eecs.berkeley.edu CC: Maxima at math.utexas.edu Agreed with Fateman, but a bit more explanation may be useful. The verb 'diff' assumes that all dependencies are included: diff( y,x ) => 0 diff( f(y), x ) => 0 Explicit dependencies can be declared with "depends": depends(q,r)$ diff(q,r) => 'diff(q,r) The noun 'diff' does not; on the contrary, it assumes that any variables can later be substituted for: 'diff(y,x) => 'diff(y,x) 'diff(f(y),x) => 'diff(f(y), x) This corresponds to standard mathematical notation, where dy/dx is not normally taken to be 0. "At" cannot assume differently in general, but I can see that it would be useful in many cases to tell Maxima that g(x) does not depend on y for the purposes of "diff" and "at". I suppose the easiest way to do that would be with simplification rules on diff and at. Another limitation of the "at" scheme is that it is sensitive to the variable name: at(diff(f(x),x),x=0)-at(diff(f(y),y),y=0) does not simplify to 0. The positional derivative package (pdiff) probably handles things like this better, but I am no expert in it. -s On Sun, Apr 8, 2012 at 17:18, Richard Fateman wrote: On 4/8/2012 11:58 AM, nijso beishuizen wrote: Dear all, This: at(diff(g(x),x),[y=1]) - at(diff(g(x),x),[y=0]) should result in 0. Is there a (built-in) way to achieve this? no, because if g(x):=x*y it is false. I would expect that 'at' (or some simplification function) would recognize that the expression is independent of y. _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Mon Apr 9 08:32:58 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 09 Apr 2012 06:32:58 -0700 Subject: [Maxima] 'at' simplification In-Reply-To: References: , <4F8200BB.5040408@eecs.berkeley.edu>, Message-ID: <4F82E50A.5070604@eecs.berkeley.edu> Writing 'g(x) does not indicate that g(x) or 'g(x) depends only on x. 'g means "don't look up the definition for g, right now." On 4/9/2012 5:38 AM, nijso beishuizen wrote: > But I gave 'at' a verb. .... -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Apr 9 09:36:32 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 9 Apr 2012 07:36:32 -0700 Subject: [Maxima] 'at' simplification In-Reply-To: References: <4F8200BB.5040408@eecs.berkeley.edu> Message-ID: You should not expect different results in these two cases, because diff(g(x),x) (a verb application) returns the value 'diff(g(x),x). This is a typical case of the noun/verb distinction: diff (the verb) *does* something (convert one form to another); 'diff (the noun) *represents* something. -s On Mon, Apr 9, 2012 at 05:38, nijso beishuizen wrote: > But I gave 'at' a verb. Shouldn't 'at' then assume that all dependencies > are included and that g(x) does not depend on y (and therefore it can drop > the [y=1] restriction)? > > I would expect a different result for > at(diff(g(x),x),[y=1]); > > and > > at('diff(g(x),x),[y=1]); > > Also: does depends() change the verb diff to a noun? > > Does this mean 'at' assumes all input is a noun? > > > > > ------------------------------ > Date: Sun, 8 Apr 2012 17:37:19 -0400 > Subject: Re: [Maxima] 'at' simplification > From: macrakis at alum.mit.edu > To: nijso at hotmail.com; fateman at eecs.berkeley.edu > CC: Maxima at math.utexas.edu > > > Agreed with Fateman, but a bit more explanation may be useful. > > The verb 'diff' assumes that all dependencies are included: > > diff( y,x ) => 0 > diff( f(y), x ) => 0 > > Explicit dependencies can be declared with "depends": > > depends(q,r)$ > diff(q,r) => 'diff(q,r) > > The *noun* 'diff' does not; on the contrary, it assumes that any > variables can later be substituted for: > > 'diff(y,x) => 'diff(y,x) > 'diff(f(y),x) => 'diff(f(y), x) > > This corresponds to standard mathematical notation, where dy/dx is not > normally taken to be 0. > > "At" cannot assume differently in general, but I can see that it would be > useful in many cases to tell Maxima that g(x) does not depend on y for the > purposes of "diff" and "at". I suppose the easiest way to do that would be > with simplification rules on diff and at. > > Another limitation of the "at" scheme is that it is sensitive to the > variable name: > > at(diff(f(x),x),x=0)-at(diff(f(y),y),y=0) > > does not simplify to 0. The positional derivative package (pdiff) > probably handles things like this better, but I am no expert in it. > > -s > > On Sun, Apr 8, 2012 at 17:18, Richard Fateman wrote: > > On 4/8/2012 11:58 AM, nijso beishuizen wrote: > > Dear all, > > This: > > at(diff(g(x),x),[y=1]) - at(diff(g(x),x),[y=0]) > > should result in 0. Is there a (built-in) way to achieve this? > > no, because if g(x):=x*y > it is false. > > I would expect that 'at' (or some simplification function) would > recognize that the expression is independent of y. > > > _______________________________________________ > Maxima mailing listMaxima at math.utexas.eduhttp://www.math.utexas.edu/mailman/listinfo/maxima > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nijso at hotmail.com Mon Apr 9 15:15:09 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Mon, 9 Apr 2012 22:15:09 +0200 Subject: [Maxima] 'at' simplification In-Reply-To: References: , <4F8200BB.5040408@eecs.berkeley.edu>, , , Message-ID: Thanks for the explanation, it is more clear to me now. I also checked pdiff and it does seem that diff(g(x),x) means that x is the only independent variable: at(diff(g(x),x),[y=1]) - at(diff(g(x),x),[y=0]); 0 Which is the behavior I was looking for. I will do some tests/reading to see what the other consequences of pdiff are. Date: Mon, 9 Apr 2012 07:36:32 -0700 Subject: Re: [Maxima] 'at' simplification From: macrakis at alum.mit.edu To: nijso at hotmail.com CC: fateman at eecs.berkeley.edu; maxima at math.utexas.edu You should not expect different results in these two cases, because diff(g(x),x) (a verb application) returns the value 'diff(g(x),x). This is a typical case of the noun/verb distinction: diff (the verb) does something (convert one form to another); 'diff (the noun) represents something. -s On Mon, Apr 9, 2012 at 05:38, nijso beishuizen wrote: But I gave 'at' a verb. Shouldn't 'at' then assume that all dependencies are included and that g(x) does not depend on y (and therefore it can drop the [y=1] restriction)? I would expect a different result for at(diff(g(x),x),[y=1]); and at('diff(g(x),x),[y=1]); Also: does depends() change the verb diff to a noun? Does this mean 'at' assumes all input is a noun? Date: Sun, 8 Apr 2012 17:37:19 -0400 Subject: Re: [Maxima] 'at' simplification From: macrakis at alum.mit.edu To: nijso at hotmail.com; fateman at eecs.berkeley.edu CC: Maxima at math.utexas.edu Agreed with Fateman, but a bit more explanation may be useful. The verb 'diff' assumes that all dependencies are included: diff( y,x ) => 0 diff( f(y), x ) => 0 Explicit dependencies can be declared with "depends": depends(q,r)$ diff(q,r) => 'diff(q,r) The noun 'diff' does not; on the contrary, it assumes that any variables can later be substituted for: 'diff(y,x) => 'diff(y,x) 'diff(f(y),x) => 'diff(f(y), x) This corresponds to standard mathematical notation, where dy/dx is not normally taken to be 0. "At" cannot assume differently in general, but I can see that it would be useful in many cases to tell Maxima that g(x) does not depend on y for the purposes of "diff" and "at". I suppose the easiest way to do that would be with simplification rules on diff and at. Another limitation of the "at" scheme is that it is sensitive to the variable name: at(diff(f(x),x),x=0)-at(diff(f(y),y),y=0) does not simplify to 0. The positional derivative package (pdiff) probably handles things like this better, but I am no expert in it. -s On Sun, Apr 8, 2012 at 17:18, Richard Fateman wrote: On 4/8/2012 11:58 AM, nijso beishuizen wrote: Dear all, This: at(diff(g(x),x),[y=1]) - at(diff(g(x),x),[y=0]) should result in 0. Is there a (built-in) way to achieve this? no, because if g(x):=x*y it is false. I would expect that 'at' (or some simplification function) would recognize that the expression is independent of y. _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From nijso at hotmail.com Mon Apr 9 15:24:53 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Mon, 9 Apr 2012 22:24:53 +0200 Subject: [Maxima] Macsyma and PDEase2D In-Reply-To: References: Message-ID: I haven't used windows in a while, but you can use compatibility mode to get backward compatibility until windows 95. If it ran under windows 95, it should run. just right-click on the executable and go to the compatibility tab in the properties. On Monday, April 09, 2012 02:38:07 pm maxima-request at math.utexas.edu wrote: > Message: 4 > Date: Wed, 4 Apr 2012 20:26:20 +0200 > From: "Dr. Schacht" > To: > Subject: [Maxima] Macsyma and PDEase2D > Message-ID: <000001cd1290$6edb2a60$4c917f20$@t-online.de> > Content-Type: text/plain; charset="iso-8859-1" > > Dear Sirs, > > > I have got Macsyma 2.2, Macsyma 2.4 and PDEase2D 3.0 with a license. > I have worked successfully with Macsyma and PDEase2D programs for many > years. > What can I do to use it with Windows XP or with Windows 7? > > > Sincerely yours > > > Dr. Wolfgang Schacht > > > Projektmanager f?r Maschinen- und Energietechnik > Parkstra?e 19 > 16348 Wandlitz > Tel.: 033397-273057 > E-Mail: dr_schacht at t-online.de From jensaxel at soegaard.net Mon Apr 9 16:08:35 2012 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Mon, 9 Apr 2012 23:08:35 +0200 Subject: [Maxima] Macsyma and PDEase2D In-Reply-To: References: Message-ID: 2012/4/9 nijso beishuizen : > I haven't used windows in a while, but you can use compatibility mode to get > backward compatibility until windows 95. If it ran under windows 95, it should > run. just right-click on the executable and go to the compatibility tab in the > properties. Note that not all Windows 7 editions include a Windows XP compatibility mode. Professional or ultimate is needed: http://windows.microsoft.com/en-US/windows7/products/compare?T1=tab01 -- Jens Axel S?gaard From dan.stanger at ieee.org Mon Apr 9 20:14:44 2012 From: dan.stanger at ieee.org (Dan Stanger) Date: Mon, 09 Apr 2012 21:14:44 -0400 Subject: [Maxima] Maple to maxima translation In-Reply-To: References: <4F8200BB.5040408@eecs.berkeley.edu> Message-ID: <4F838984.1050008@ieee.org> Hello All, I cannot seem to find a copy of the translator code. Also, someone emailed me a few years back, saying that they had corrected some bugs in it. Would that person please get back to me, or check the code into the maxima project somewhere. Thanks, Dan Stanger From vttoth at vttoth.com Mon Apr 9 21:12:05 2012 From: vttoth at vttoth.com (Viktor T. Toth) Date: Mon, 9 Apr 2012 22:12:05 -0400 Subject: [Maxima] Macsyma and PDEase2D In-Reply-To: References: Message-ID: <006001cd16bf$575d9d90$0618d8b0$@vttoth.com> Just to clarify, I believe that the compatibility tab mentioned by nijso beishuizen is not the same as "Windows XP Mode". The former is a feature available in all versions of Windows XP/Vista/7, where you can mark a program as being compatible with a previous version of Windows (whether or not it'll actually make it run is another question). The latter is a preconfigured copy of Windows XP that runs in a Micrsoft Virtual PC virtual machine environment and is integrated with the Windows 7 desktop. Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Jens Axel S?gaard Sent: Monday, April 09, 2012 5:09 PM To: nijso beishuizen Cc: dr_schacht at t-online.de; maxima at math.utexas.edu Subject: Re: [Maxima] Macsyma and PDEase2D 2012/4/9 nijso beishuizen : > I haven't used windows in a while, but you can use compatibility mode to get > backward compatibility until windows 95. If it ran under windows 95, it should > run. just right-click on the executable and go to the compatibility tab in the > properties. Note that not all Windows 7 editions include a Windows XP compatibility mode. Professional or ultimate is needed: http://windows.microsoft.com/en-US/windows7/products/compare?T1=tab01 -- Jens Axel S?gaard _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From hfinkel at anl.gov Mon Apr 9 22:52:08 2012 From: hfinkel at anl.gov (Hal Finkel) Date: Mon, 9 Apr 2012 22:52:08 -0500 Subject: [Maxima] Loading gentran Message-ID: <20120409225208.5698deed@sapling2> Hello, I'm using Maxima 5.27.0 with CMUCL 20c on Linux and I'm trying to use the gentran package from a Maxima batch script. Unfortunately, just using load("local.gtload.lisp") works only from the contrib/gentran directory. I came up with the following work-around, but is there a better way? cd(dir) := ?xchdir(dir); :lisp (setq $orig_wd (maxima-getenv "PWD")) gentran_loader: "local.gtload.lisp"$ gentran_loader_dir: pathname_directory(file_search(gentran_loader))$ cd(gentran_loader_dir)$ load(gentran_loader); cd(orig_wd)$ Thanks in advance, Hal -- Hal Finkel Postdoctoral Appointee Leadership Computing Facility Argonne National Laboratory From tiabaldu at gmail.com Mon Apr 9 23:57:57 2012 From: tiabaldu at gmail.com (Ruslan Mullakhmetov) Date: Tue, 10 Apr 2012 08:57:57 +0400 Subject: [Maxima] split result of linsolve Message-ID: Hi! I solve some linear equation and wish to get result explicitly for further work. But linsolve returns list of equalities. illustrate it. s:linsolve([a*x+b=0],[x]); s[1]; x=-b/a how can i extract "-b/a" from this equality? -- BR, Ruslan Mullakhmetov From toy.raymond at gmail.com Tue Apr 10 00:25:02 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 09 Apr 2012 22:25:02 -0700 Subject: [Maxima] split result of linsolve In-Reply-To: References: Message-ID: <4F83C42E.9070208@gmail.com> On 4/9/12 9:57 PM, Ruslan Mullakhmetov wrote: > Hi! > > I solve some linear equation and wish to get result explicitly for further work. But linsolve returns list of equalities. illustrate it. > > s:linsolve([a*x+b=0],[x]); > s[1]; > > x=-b/a > > how can i extract "-b/a" from this equality? > > rhs(s[1]) Ray From toy.raymond at gmail.com Tue Apr 10 10:47:32 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 10 Apr 2012 08:47:32 -0700 Subject: [Maxima] Loading gentran In-Reply-To: <20120409225208.5698deed@sapling2> References: <20120409225208.5698deed@sapling2> Message-ID: On Mon, Apr 9, 2012 at 8:52 PM, Hal Finkel wrote: > Hello, > > I'm using Maxima 5.27.0 with CMUCL 20c on Linux and I'm trying to use > the gentran package from a Maxima batch script. Unfortunately, just > using load("local.gtload.lisp") works only from the contrib/gentran > directory. I came up with the following work-around, but is there a > better way? > > Try the attached version of local.gtload.lisp. Replace the version in share/contrib/gentran with this one. You should be able to do load("local.gtload.lisp") to load gentran. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: local.gtload.lisp Type: application/octet-stream Size: 1393 bytes Desc: not available URL: From piminusmeson at bk.ru Tue Apr 10 12:30:32 2012 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Tue, 10 Apr 2012 21:30:32 +0400 Subject: [Maxima] maxima5.27.0 download link In-Reply-To: <006001cd16bf$575d9d90$0618d8b0$@vttoth.com> References: <006001cd16bf$575d9d90$0618d8b0$@vttoth.com> Message-ID: <4F846E38.2000902@bk.ru> Hello, list. On the http://sourceforge.net/projects/maxima/files/Maxima-source/5.27.0-source/ there is no any link for the maxima 5.27.0. downloading ( http://i41.tinypic.com/euirud.jpg ). Is it normal? From hfinkel at anl.gov Tue Apr 10 12:50:21 2012 From: hfinkel at anl.gov (Hal Finkel) Date: Tue, 10 Apr 2012 12:50:21 -0500 Subject: [Maxima] Loading gentran In-Reply-To: References: <20120409225208.5698deed@sapling2> Message-ID: <20120410125021.0b7cbd97@sapling2> On Tue, 10 Apr 2012 08:47:32 -0700 Raymond Toy wrote: > On Mon, Apr 9, 2012 at 8:52 PM, Hal Finkel wrote: > > > Hello, > > > > I'm using Maxima 5.27.0 with CMUCL 20c on Linux and I'm trying to > > use the gentran package from a Maxima batch script. Unfortunately, > > just using load("local.gtload.lisp") works only from the > > contrib/gentran directory. I came up with the following > > work-around, but is there a better way? > > > > Try the attached version of local.gtload.lisp. Replace the version > > in > share/contrib/gentran with this one. You should be able to do > load("local.gtload.lisp") to load gentran. Ray, Thanks! Is this change in trunk? If not, can it please be put there? -Hal > > Ray -- Hal Finkel Postdoctoral Appointee Leadership Computing Facility Argonne National Laboratory From toy.raymond at gmail.com Tue Apr 10 12:55:10 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 10 Apr 2012 10:55:10 -0700 Subject: [Maxima] Loading gentran In-Reply-To: <20120410125021.0b7cbd97@sapling2> References: <20120409225208.5698deed@sapling2> <20120410125021.0b7cbd97@sapling2> Message-ID: On Tue, Apr 10, 2012 at 10:50 AM, Hal Finkel wrote: > On Tue, 10 Apr 2012 08:47:32 -0700 > Raymond Toy wrote: > > > On Mon, Apr 9, 2012 at 8:52 PM, Hal Finkel wrote: > > > > > Hello, > > > > > > I'm using Maxima 5.27.0 with CMUCL 20c on Linux and I'm trying to > > > use the gentran package from a Maxima batch script. Unfortunately, > > > just using load("local.gtload.lisp") works only from the > > > contrib/gentran directory. I came up with the following > > > work-around, but is there a better way? > > > > > > Try the attached version of local.gtload.lisp. Replace the version > > > in > > share/contrib/gentran with this one. You should be able to do > > load("local.gtload.lisp") to load gentran. > > Ray, > > Thanks! Is this change in trunk? If not, can it please be put there? > > No, it's not yet in the trunk. Does it work for you? It works for me. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Tue Apr 10 13:06:24 2012 From: woollett at charter.net (Edwin Woollett) Date: Tue, 10 Apr 2012 11:06:24 -0700 Subject: [Maxima] maxima analysis of a 'wav' data file References: <87AB986691834070A89D3D4BFF4AA9DC@edwinc367e16bd> Message-ID: <9163E0D9DB7246C081B9FEEEFD72FF22@edwinc367e16bd> I am not familar with *.wav files: is it a text file, and how is the data coded, etc? Also why don't you send me the example you are working with so I can take a look at it. The mfiles.mac software is written in maxima code rather than lisp. If the software were written in lisp instead, I have been told by Richard Fateman that things would run about 10 times faster. I haven't tried translating into lisp (and perhaps compiling) the file mfiles.mac: perhaps this would speed up the process of reading the file. Alternatively, a special purpose read function which applies only to the structure and design of the data in a *.wav file might be a better approach. Combining such a function with my fourier transform software might lead to a usable approach to [y, fs, bits] = wavread ("file.wav"). Ted ========================== ----- Original Message ----- From: bernardo gomez To: Edwin Woollett Sent: Tuesday, April 10, 2012 5:07 AM Subject: Re: maxima Thanks Ted! For your quick answer! In Matlab, there is a function, "wavread" which returns the sampling frequency, intensity and number of bits of "file.wav". [y, fs, bits] = wavread ('file.wav'); I tried with the functions that are chapter 2 but I can not read it. On the other hand, I converted to a vector file.dat file.wav micro external program made ??in c., But a recorded sound of a few seconds it takes a long time to read through maxima with the function "read_nested_list". My goal is to obtain the Fourier Transform to files.wav. Thanks for your help again. bernardo 2012/4/9 Edwin Woollett : > Hi Bernardo, > > Checkout Ch. 2, Maxima by Example, > Plots, Files, Read, Write, and Fit, > mbe2plotfit.pdf, > > Section 2.2: > Working with Files using the Package > mfiles.mac. > > This package includes some basic > stuff, could clearly be extended in > numerous directions. > > I am working now on a maxima > version of nintegrate to supplement > a revised version of Ch. 8. > > Best, > > Ted > > ===================== > ----- Original Message ----- From: bernardo gomez > To: woollett at charter.net > Sent: Monday, April 09, 2012 7:32 AM > Subject: maxima > > > > Dear Edwin > Thanks for your page, it is helpful to others! > I am interested in being able to read and process files ".wav" > As I can read with maxima? > Function that I can read and get information from the file. > Thanks ! > bernardo > -- > > Instituto de F?sica Rosario > Grupo de F?sica de Plasmas > 27 de Febrero 210 bis > (S2000EZP) Rosario -- Instituto de F?sica Rosario Grupo de F?sica de Plasmas 27 de Febrero 210 bis (S2000EZP) Rosario From hfinkel at anl.gov Tue Apr 10 13:12:25 2012 From: hfinkel at anl.gov (Hal Finkel) Date: Tue, 10 Apr 2012 13:12:25 -0500 Subject: [Maxima] Loading gentran In-Reply-To: References: <20120409225208.5698deed@sapling2> <20120410125021.0b7cbd97@sapling2> Message-ID: <20120410131225.3abfbf0d@sapling2> On Tue, 10 Apr 2012 10:55:10 -0700 Raymond Toy wrote: > On Tue, Apr 10, 2012 at 10:50 AM, Hal Finkel wrote: > > > On Tue, 10 Apr 2012 08:47:32 -0700 > > Raymond Toy wrote: > > > > > On Mon, Apr 9, 2012 at 8:52 PM, Hal Finkel > > > wrote: > > > > > > > Hello, > > > > > > > > I'm using Maxima 5.27.0 with CMUCL 20c on Linux and I'm trying > > > > to use the gentran package from a Maxima batch script. > > > > Unfortunately, just using load("local.gtload.lisp") works only > > > > from the contrib/gentran directory. I came up with the following > > > > work-around, but is there a better way? > > > > > > > > Try the attached version of local.gtload.lisp. Replace the > > > > version in > > > share/contrib/gentran with this one. You should be able to do > > > load("local.gtload.lisp") to load gentran. > > > > Ray, > > > > Thanks! Is this change in trunk? If not, can it please be put there? > > > > > No, it's not yet in the trunk. Does it work for you? It works for > me. It works for me. Thanks again, Hal > > Ray -- Hal Finkel Postdoctoral Appointee Leadership Computing Facility Argonne National Laboratory From hfinkel at anl.gov Tue Apr 10 13:38:54 2012 From: hfinkel at anl.gov (Hal Finkel) Date: Tue, 10 Apr 2012 13:38:54 -0500 Subject: [Maxima] Loading gentran In-Reply-To: <20120410131225.3abfbf0d@sapling2> References: <20120409225208.5698deed@sapling2> <20120410125021.0b7cbd97@sapling2> <20120410131225.3abfbf0d@sapling2> Message-ID: <20120410133854.7fede534@sapling2> On Tue, 10 Apr 2012 13:12:25 -0500 Hal Finkel wrote: > On Tue, 10 Apr 2012 10:55:10 -0700 > Raymond Toy wrote: > > > On Tue, Apr 10, 2012 at 10:50 AM, Hal Finkel > > wrote: > > > > > On Tue, 10 Apr 2012 08:47:32 -0700 > > > Raymond Toy wrote: > > > > > > > On Mon, Apr 9, 2012 at 8:52 PM, Hal Finkel > > > > wrote: > > > > > > > > > Hello, > > > > > > > > > > I'm using Maxima 5.27.0 with CMUCL 20c on Linux and I'm trying > > > > > to use the gentran package from a Maxima batch script. > > > > > Unfortunately, just using load("local.gtload.lisp") works only > > > > > from the contrib/gentran directory. I came up with the > > > > > following work-around, but is there a better way? > > > > > > > > > > Try the attached version of local.gtload.lisp. Replace the > > > > > version in > > > > share/contrib/gentran with this one. You should be able to do > > > > load("local.gtload.lisp") to load gentran. > > > > > > Ray, > > > > > > Thanks! Is this change in trunk? If not, can it please be put > > > there? > > > > > > > > No, it's not yet in the trunk. Also, I think that it would make sense to rename the file for import into trunk so that load(gentran); works as one might expect. -Hal Does it work for you? It works for > > me. > > It works for me. > > Thanks again, > Hal > > > > > Ray > > > -- Hal Finkel Postdoctoral Appointee Leadership Computing Facility Argonne National Laboratory From toy.raymond at gmail.com Tue Apr 10 14:03:37 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 10 Apr 2012 12:03:37 -0700 Subject: [Maxima] Loading gentran In-Reply-To: <20120410133854.7fede534@sapling2> References: <20120409225208.5698deed@sapling2> <20120410125021.0b7cbd97@sapling2> <20120410131225.3abfbf0d@sapling2> <20120410133854.7fede534@sapling2> Message-ID: On Tue, Apr 10, 2012 at 11:38 AM, Hal Finkel wrote: > On Tue, 10 Apr 2012 13:12:25 -0500 > Hal Finkel wrote: > > > On Tue, 10 Apr 2012 10:55:10 -0700 > > Raymond Toy wrote: > > > > > On Tue, Apr 10, 2012 at 10:50 AM, Hal Finkel > > > wrote: > > > > > > > On Tue, 10 Apr 2012 08:47:32 -0700 > > > > Raymond Toy wrote: > > > > > > > > > On Mon, Apr 9, 2012 at 8:52 PM, Hal Finkel > > > > > wrote: > > > > > > > > > > > Hello, > > > > > > > > > > > > I'm using Maxima 5.27.0 with CMUCL 20c on Linux and I'm trying > > > > > > to use the gentran package from a Maxima batch script. > > > > > > Unfortunately, just using load("local.gtload.lisp") works only > > > > > > from the contrib/gentran directory. I came up with the > > > > > > following work-around, but is there a better way? > > > > > > > > > > > > Try the attached version of local.gtload.lisp. Replace the > > > > > > version in > > > > > share/contrib/gentran with this one. You should be able to do > > > > > load("local.gtload.lisp") to load gentran. > > > > > > > > Ray, > > > > > > > > Thanks! Is this change in trunk? If not, can it please be put > > > > there? > > > > > > > > > > > No, it's not yet in the trunk. > > Also, I think that it would make sense to rename the file for import > into trunk so that load(gentran); works as one might expect. > Yes, I think that's a good idea. I'll check in the changes soon. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Apr 10 14:08:51 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 10 Apr 2012 12:08:51 -0700 Subject: [Maxima] maxima analysis of a 'wav' data file In-Reply-To: <9163E0D9DB7246C081B9FEEEFD72FF22@edwinc367e16bd> References: <87AB986691834070A89D3D4BFF4AA9DC@edwinc367e16bd> <9163E0D9DB7246C081B9FEEEFD72FF22@edwinc367e16bd> Message-ID: On Tue, Apr 10, 2012 at 11:06 AM, Edwin Woollett wrote: > > I am not familar with *.wav files: is it a text file, > and how is the data coded, etc? > It's a binary file format for storing audio data: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ It's fairly easy to read in the simplest wav file containing pcm samples. The more complicated ones with codecs are, obviously, more complicated. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From smh at franz.com Tue Apr 10 15:09:42 2012 From: smh at franz.com (Steve Haflich) Date: Tue, 10 Apr 2012 13:09:42 -0700 Subject: [Maxima] maxima analysis of a 'wav' data file In-Reply-To: References: <87AB986691834070A89D3D4BFF4AA9DC@edwinc367e16bd> <9163E0D9DB7246C081B9FEEEFD72FF22@edwinc367e16bd> Message-ID: <17545.1334088582@gemini.franz.com> I think I have some old Common Lisp code that can read wav files, at least simple ones, perhaps mono only. Anyone who wants it can contact me. From biomates at telefonica.net Tue Apr 10 15:40:53 2012 From: biomates at telefonica.net (Mario Rodriguez) Date: Tue, 10 Apr 2012 22:40:53 +0200 Subject: [Maxima] maxima analysis of a 'wav' data file In-Reply-To: <9163E0D9DB7246C081B9FEEEFD72FF22@edwinc367e16bd> References: <87AB986691834070A89D3D4BFF4AA9DC@edwinc367e16bd> <9163E0D9DB7246C081B9FEEEFD72FF22@edwinc367e16bd> Message-ID: <1334090453.2883.16.camel@pc> Hello, Time ago I wrote a Maxima package for playing with sounds. Here is all available documentation about it: http://riotorto.users.sourceforge.net/sound There is a function called 'load_sound_wav' for reading wav files. To learn how to use it, see last example in http://riotorto.users.sourceforge.net/sound/sample Here is an example of combining this package with (the old version of) package 'fft': http://riotorto.users.sourceforge.net/sound/filters Note that samples are stored in Maxima lists, and large files may need a long processing time. And, finally, the funniest parts are the last examples here: http://riotorto.users.sourceforge.net/sound/music and here: http://riotorto.users.sourceforge.net/sound/channels -- Mario From macrakis at alum.mit.edu Tue Apr 10 16:50:08 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 10 Apr 2012 14:50:08 -0700 Subject: [Maxima] macros (or similar) in Maxima In-Reply-To: References: Message-ID: Tamas, I think Ray Toy's answer solves your problem. But I'm curious to understand why you thought you needed to use Maxima macros rather than regular Maxima functions to solve this problem. Also curious to understand why you went directly to Lisp rather than code in the Maxima language. Perhaps some other computer algebra system you've used wasn't fully programmable? or had macro semantics instead of function semantics? -s On Tue, Apr 3, 2012 at 01:48, Tamas Papp wrote: > Hi, > > Can I achieve the effect of > > texput(W10,"W_{10}")$ > texput(W11,"W_{11}")$ > texput(W20,"W_{20}")$ > texput(W21,"W_{21}")$ > texput(W22,"W_{22}")$ > > texput(w10,"w_{10}")$ > texput(w11,"w_{11}")$ > texput(w20,"w_{20}")$ > texput(w21,"w_{21}")$ > texput(w22,"w_{22}")$ > > texput(g10,"g_{10}")$ > texput(g11,"g_{11}")$ > texput(g20,"g_{20}")$ > texput(g21,"g_{21}")$ > texput(g22,"g_{22}")$ > > with some kind of macro in Maxima? > > This is how I attempted to do it (not with a macro, but by calling texput > directly): > > :lisp (flet ((texputall (prefix &key (latex prefix) (subscripts '("10" > "11" "20" "21" "22"))) (loop for subscript in subscripts do (mfuncall > '$texput (make-symbol (format nil "$~A~A" prefix subscript)) (format nil > "~A_{~A}" latex subscript))))) (loop for s in '("w" "W" "g") do (texputall > s))) > > but it didn't work (Lisp error: (void-function mfuncall)). > > Generally, what's the best way to write (debug, etc) more complex CL > constructs used in Maxima? I am using Emacs and I am familiar with > SLIME, so it would be great if I could use it to write CL for Maxima > somehow. It would be nice to get indentation in the code I write, > also not being forced to put in on one line for :lisp. > > Best, > > Tamas > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tkpapp at gmail.com Wed Apr 11 00:44:28 2012 From: tkpapp at gmail.com (Tamas K Papp) Date: Wed, 11 Apr 2012 07:44:28 +0200 Subject: [Maxima] macros (or similar) in Maxima In-Reply-To: References: , Message-ID: <87vcl6yg8z.fsf@gmail.com> Hi Stavros, I guess there are two reasons: (1) I know CL so it was easier to reach for the familiar, and (2) I am still developing my mental model of Maxima and I need to wrap my head around the fact that being written in CL does not make it CL. BTW, Maxima is the first CAS I have ever used seriously, and the fact that I can always drop to CL played a large role in choosing it. Best, Tamas On Tue 10 Apr 2012 11:50:08 PM CEST, Stavros Macrakis wrote: > Tamas, > > I think Ray Toy's answer solves your problem. > > But I'm curious to understand why you thought you needed to use Maxima > macros rather than regular Maxima functions to solve this problem. Also > curious to understand why you went directly to Lisp rather than code in the > Maxima language. > > Perhaps some other computer algebra system you've used wasn't fully > programmable? or had macro semantics instead of function semantics? > > -s > > On Tue, Apr 3, 2012 at 01:48, Tamas Papp wrote: > > > Hi, > > > > Can I achieve the effect of > > > > texput(W10,"W_{10}")$ > > texput(W11,"W_{11}")$ > > texput(W20,"W_{20}")$ > > texput(W21,"W_{21}")$ > > texput(W22,"W_{22}")$ > > > > texput(w10,"w_{10}")$ > > texput(w11,"w_{11}")$ > > texput(w20,"w_{20}")$ > > texput(w21,"w_{21}")$ > > texput(w22,"w_{22}")$ > > > > texput(g10,"g_{10}")$ > > texput(g11,"g_{11}")$ > > texput(g20,"g_{20}")$ > > texput(g21,"g_{21}")$ > > texput(g22,"g_{22}")$ > > > > with some kind of macro in Maxima? > > > > This is how I attempted to do it (not with a macro, but by calling texput > > directly): > > > > :lisp (flet ((texputall (prefix &key (latex prefix) (subscripts '("10" > > "11" "20" "21" "22"))) (loop for subscript in subscripts do (mfuncall > > '$texput (make-symbol (format nil "$~A~A" prefix subscript)) (format nil > > "~A_{~A}" latex subscript))))) (loop for s in '("w" "W" "g") do (texputall > > s))) > > > > but it didn't work (Lisp error: (void-function mfuncall)). > > > > Generally, what's the best way to write (debug, etc) more complex CL > > constructs used in Maxima? I am using Emacs and I am familiar with > > SLIME, so it would be great if I could use it to write CL for Maxima > > somehow. It would be nice to get indentation in the code I write, > > also not being forced to put in on one line for :lisp. > > > > Best, > > > > Tamas > > > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > > From talon at lpthe.jussieu.fr Wed Apr 11 08:39:13 2012 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 11 Apr 2012 13:39:13 +0000 (UTC) Subject: [Maxima] Maple to maxima translation References: <4F8200BB.5040408@eecs.berkeley.edu> <4F8200BB.5040408@eecs.berkeley.edu> <4F838984.1050008@ieee.org> Message-ID: Dan Stanger wrote: > Hello All, > I cannot seem to find a copy of the translator code. Also, someone > emailed me a few years back, saying that they had corrected some bugs in > it. Would that person please get back to me, or check the code into the > maxima project somewhere. > Thanks, > Dan Stanger I think i have found a similar tool on a server at INRIA here: https://who.rocq.inria.fr/Francois.Thomasset/Maple-MuPad/ Unfortunately this ones does conversion to mupad. Still from the following http://comments.gmane.org/gmane.comp.mathematics.maxima.general/467 it seems that Fran?ois Thomasser is the author of the translator. -- Michel Talon From sarapashm at googlemail.com Wed Apr 11 10:26:48 2012 From: sarapashm at googlemail.com (Sara Pashmin) Date: Wed, 11 Apr 2012 17:26:48 +0200 Subject: [Maxima] plot2d Message-ID: Hello, I try to plot results of an calculation in a loop like the following example: for i:1 thru 5 step 1 do (x:i*3, y:i, plot2d([discrete, [[x, y]]],[color,cyan], [xlabel,"Ux (V)"], [ylabel,"Uy (V)"],[style, points], [gnuplot_preamble, "set nokey; set title 'output voltage'"])); But I get the plotting of the last result, that means for i:5: the plotting of the point (Ux=15, Uy=5) I would be thankful for any help. Thanks and regards Sara I would like to know, how can I fix the plotting of each result. From villate at fe.up.pt Wed Apr 11 10:42:34 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 11 Apr 2012 16:42:34 +0100 Subject: [Maxima] plot2d In-Reply-To: References: Message-ID: <4F85A66A.4060306@fe.up.pt> On 04/11/2012 04:26 PM, Sara Pashmin wrote: > I try to plot results of an calculation in a loop like the following example: > > for i:1 thru 5 step 1 do > (x:i*3, > y:i, > plot2d([discrete, [[x, y]]],[color,cyan], > [xlabel,"Ux (V)"], > [ylabel,"Uy (V)"],[style, points], > [gnuplot_preamble, > "set nokey; > set title 'output voltage'"])); > > But I get the plotting of the last result, that means for i:5: > the plotting of the point (Ux=15, Uy=5) > > I would be thankful for any help Hi, I think this is what you wanted to do: plot2d([discrete, makelist ([3*i,i],i,1,5)], [color,cyan], [xlabel,"Ux (V)"], [ylabel,"Uy (V)"],[style, points], [gnuplot_preamble, "set nokey; set title 'output voltage'"]); You do not want five plots, each one with only one point, but only one plot with five points in it. Regards, Jaime From sarapashm at googlemail.com Wed Apr 11 11:14:30 2012 From: sarapashm at googlemail.com (Sara Pashmin) Date: Wed, 11 Apr 2012 18:14:30 +0200 Subject: [Maxima] plot2d In-Reply-To: <4F85A66A.4060306@fe.up.pt> References: <4F85A66A.4060306@fe.up.pt> Message-ID: Hello Jaime, thanks for your answer. My example is very simple, better to say it's a wrong example. I have a complex calculation for each step in a loop. My interest is to plot results for each step. For example in Matlab I can plot all results in one window with commands "on" and stop it with "off". But how is about Maxima? Is there any command for continuing the plotting? Best regards, Sara Am 11. April 2012 17:42 schrieb Jaime Villate : > On 04/11/2012 04:26 PM, Sara Pashmin wrote: >> >> I try to plot results of an calculation in a loop like the following >> example: >> >> for i:1 thru 5 step 1 do >> (x:i*3, >> y:i, >> plot2d([discrete, [[x, y]]],[color,cyan], >> ? ? ? ? [xlabel,"Ux (V)"], >> ? ? ? ? [ylabel,"Uy (V)"],[style, points], >> [gnuplot_preamble, >> "set nokey; >> set title 'output voltage'"])); >> >> But I get the plotting of the last result, that means for i:5: >> the plotting of the point (Ux=15, Uy=5) >> >> I would be thankful for any help > > Hi, > I think this is what you wanted to do: > > plot2d([discrete, makelist ([3*i,i],i,1,5)], [color,cyan], > > ? ? ? ?[xlabel,"Ux (V)"], > ? ? ? ?[ylabel,"Uy (V)"],[style, points], > [gnuplot_preamble, > "set nokey; > set title 'output voltage'"]); > > You do not want five plots, each one with only one point, but only one plot > with five points in it. > Regards, > Jaime > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From smh at franz.com Wed Apr 11 11:16:53 2012 From: smh at franz.com (Steve Haflich) Date: Wed, 11 Apr 2012 09:16:53 -0700 Subject: [Maxima] maxima analysis of a 'wav' data file In-Reply-To: <17545.1334088582@gemini.franz.com> References: <87AB986691834070A89D3D4BFF4AA9DC@edwinc367e16bd> <9163E0D9DB7246C081B9FEEEFD72FF22@edwinc367e16bd> <17545.1334088582@gemini.franz.com> Message-ID: <5649.1334161013@gemini.franz.com> Steve Haflich wrote: I think I have some old Common Lisp code that can read wav files, at least simple ones, perhaps mono only. Anyone who wants it can contact me. Found the code. Looks like it can both read and write wav files with any number of channels. Essentially no documentation, so it might be hard to use (hard to kno0w which routine to call where) without first reading and understanding some separate documentation about wav format. See for example here from where one can download the original Microsoft (revised) specification: http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html My code is downloadable here: http://www.franz.com/~smh/win-wav.lisp From villate at fe.up.pt Wed Apr 11 12:32:43 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 11 Apr 2012 18:32:43 +0100 Subject: [Maxima] plot2d In-Reply-To: References: <4F85A66A.4060306@fe.up.pt> Message-ID: <4F85C03B.3000408@fe.up.pt> On 04/11/2012 05:14 PM, Sara Pashmin wrote: > I have a complex calculation for each step in a loop. > > My interest is to plot results for each step. > > For example in Matlab I can plot all results in one window with > commands "on" and stop it with "off". > > But how is about Maxima? > Is there any command for continuing the plotting? No, in Maxima you have to prepare all the data first and then do the plot. As far as I know you cannot do that with Maxima and gnuplot, but Mario (the author of draw2d) might have some experience in that area? similar has not been implemented for plot2d. From woollett at charter.net Wed Apr 11 13:11:27 2012 From: woollett at charter.net (Edwin Woollett) Date: Wed, 11 Apr 2012 11:11:27 -0700 Subject: [Maxima] maxima analysis of a 'wav' data file References: <87AB986691834070A89D3D4BFF4AA9DC@edwinc367e16bd><9163E0D9DB7246C081B9FEEEFD72FF22@edwinc367e16bd> Message-ID: Bernardo, Glad you are experimenting with Mario's package. We should encourage him to update it to use the current version of fft. That package might prove very useful to maxima users. You should feel free to translate all or any portion of my chapters, adding any material which would be helpful. Might inspire me to upgrade my own treatment of topics and add additional applications. Thanks for the wav file which I read in as a list using read_binary_list (see contents: numericalio in help manual). The rest command is used to look at the first six elements of the list aL. -------------------------- (%i1) display2d:false$ (%i2) aL:read_binary_list("c:/work2/la-440.wav")$ (%i3) time(%); (%o3) [2.22] (%i4) length(aL); (%o4) 40016 (%i5) rest(aL,-40010); (%o5) [2.5139205266201174E+88,2.0846937317106928E+112,1.2882297587185297E-231, 6.6113149948854108E+22,4.7969767859419973E-299,1.4537771370613018E+120] =========================== ----- Original Message ----- From: bernardo gomez To: Edwin Woollett Sent: Wednesday, April 11, 2012 6:13 AM Subject: Re: maxima analysis of a 'wav' data file Thanks ! Edwin What we need is a function that has developed Mario. dat : load_sound_wav ("la-mi.wav") $ gives us the following very useful information on the "file.wav": "Number of channels.: 1" "Samples per second.: 44100" "Bits per sample....: 16" "Number of samples..: 160044 In addition: N:length(dat[2]); fs:dat[1]; Anyway I have not managed to make the Fourier transform, but I'm very close. I wanted to ask permission to translate into Spanish Chapter 11 adding featuresMario for my students to study. Thanks !! bernardo ====================== From sarapashm at googlemail.com Wed Apr 11 13:14:50 2012 From: sarapashm at googlemail.com (Sara Pashmin) Date: Wed, 11 Apr 2012 20:14:50 +0200 Subject: [Maxima] plot2d In-Reply-To: <4F85C03B.3000408@fe.up.pt> References: <4F85A66A.4060306@fe.up.pt> <4F85C03B.3000408@fe.up.pt> Message-ID: Thank you very much, Jaime. Now I understand. I will try to make lists from resolutions and at the end plot them. Am 11. April 2012 19:32 schrieb Jaime Villate : > On 04/11/2012 05:14 PM, Sara Pashmin wrote: >> >> I have a complex calculation for each step in a loop. >> >> My interest is to plot results for each step. >> >> For example in Matlab I can plot all results in one window with >> commands "on" and stop it with "off". >> >> But how is about Maxima? >> Is there any command for continuing the plotting? > > No, in Maxima you have to prepare all the data first and then do the plot. > As far as I know you cannot do that with ?Maxima and gnuplot, but Mario (the > author of draw2d) might have some experience in that area? > > similar has not been implemented for plot2d. From macrakis at alum.mit.edu Wed Apr 11 13:55:25 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 11 Apr 2012 14:55:25 -0400 Subject: [Maxima] Real solutions In-Reply-To: <2DC17D36-652A-4022-A9BC-DACC5F8F65DC@gmx.net> References: <2DC17D36-652A-4022-A9BC-DACC5F8F65DC@gmx.net> Message-ID: Depending on the syntactic presence of %i to indicate that a solution is non-real is unreliable. One way to check is to see if the imagpart is zero: sols: solve(8*x^3-6*x-1,x)$ subset(setify(sols),lambda([q],is(equal(imagpart(rhs(q)),0))) Of course, there are also expressions which are syntactically %i-free which are complex, e.g. sqrt(-x^2-1). -s On Wed, Apr 11, 2012 at 14:13, Holger Schulz wrote: > I often have to compute zeros of functions. I use solve() for that. Often > I need real solutions only. How can I suppress the solutions with %i? > > Thanks. > > hs > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Wed Apr 11 14:03:07 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 11 Apr 2012 15:03:07 -0400 Subject: [Maxima] Real solutions In-Reply-To: <1A032517-2812-4525-92DC-8A569CCB4092@gmx.net> References: <2DC17D36-652A-4022-A9BC-DACC5F8F65DC@gmx.net> <1A032517-2812-4525-92DC-8A569CCB4092@gmx.net> Message-ID: map(rhs,...) On Wed, Apr 11, 2012 at 15:02, Holger Schulz wrote: > > Am 2012-04-11 um 20:55 schrieb Stavros Macrakis: > > > sols: solve(8*x^3-6*x-1,x)$ > > subset(setify(sols),lambda([q],is(equal(imagpart(rhs(q)),0))) > > > Thanks. > > Further, is there a chance to oppress the leading "x=" parts in the set? > Solutions would be easier to read. > > Thanks. > > hs > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Wed Apr 11 14:16:09 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 11 Apr 2012 12:16:09 -0700 Subject: [Maxima] Real solutions In-Reply-To: <21EA2681-B22F-4F7B-8276-A71A02C8EBF2@gmx.net> References: <2DC17D36-652A-4022-A9BC-DACC5F8F65DC@gmx.net> <4F85D1A8.9020805@eecs.berkeley.edu> <21EA2681-B22F-4F7B-8276-A71A02C8EBF2@gmx.net> Message-ID: <4F85D879.7080806@eecs.berkeley.edu> On 4/11/2012 11:58 AM, Holger Schulz wrote: > I'm not quite sue if I understand your question. English is not my native language. > > sqrt(q) is real for non-negative values of q. > > But, what about maxima knowing if a solution is real? I just want solutions with an imnaginary pert not to be printed. Is that possible? > > Thanks. > > hs > > Am 2012-04-11 um 20:47 schrieb Richard Fateman: > >> How do you know if a solution is real? Is sqrt(q) real? Maxima deals with symbols as well as numbers. Here's an equation: sin(y)=x Solve for y. y=asin(x). Is this real? we know that if x is real and abs(x)>1 that this is a complex solution. But say we don't know ANYTHING about x, in general. Maxima is quite capable of continuing to compute with asin(x) regardless. So the determination of whether a SYMBOLIC expression is real or complex is not possible in general. as another example.. %i*sin(%i*x) is real if x is real... From aleksasd873 at gmail.com Wed Apr 11 14:57:10 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Wed, 11 Apr 2012 22:57:10 +0300 Subject: [Maxima] Real solutions Message-ID: Reply to http://www.math.utexas.edu/pipermail/maxima/2012/028386.html http://www.math.utexas.edu/pipermail/maxima/2012/028387.html Theorem. Real roots of 8*x^3-6*x-1=0 is [cos(%pi/9),cos((5*%pi)/9),cos((7*%pi)/9)] Proof. (%i1) solve(8*x^3-6*x-1,x)$ (%i2) sol:map(rhs,%)$ (%i3) makelist(map(polarform,sol[k]),k,1,3); (%o3) [%e^((5*%i*%pi)/9)/2+%e^(-(5*%i*%pi)/9)/2,%e^((7*%i*%pi)/9)/2+%e^(-(7*%i*%pi)/9)/2,%e^((%i*%pi)/9)/2+%e^(-(%i*%pi)/9)/2] (%i4) rectform(%); (%o4) [cos((5*%pi)/9),cos((7*%pi)/9),cos(%pi/9)] (%i5) sort(%); (%o5) [cos(%pi/9),cos((5*%pi)/9),cos((7*%pi)/9)] Test: (%i6) float(%)$ sort(%); (%o7) [-0.766044443118978,-0.17364817766693,0.939692620785908] (%i8) allroots(8*x^3-6*x-1)$ sort(%); (%o9) [x=-0.766044443118978,x=-0.17364817766693,x=0.939692620785908] Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Wed Apr 11 15:34:52 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 11 Apr 2012 13:34:52 -0700 Subject: [Maxima] Real solutions In-Reply-To: References: <2DC17D36-652A-4022-A9BC-DACC5F8F65DC@gmx.net> <4F85D1A8.9020805@eecs.berkeley.edu> <21EA2681-B22F-4F7B-8276-A71A02C8EBF2@gmx.net> <4F85D879.7080806@eecs.berkeley.edu> Message-ID: On Wed, Apr 11, 2012 at 12:22 PM, Holger Schulz wrote: > Okay. The cases I'm thinking of will have no variables in the solutions. > Usually roots of polynomials and stuff like that. I think it should be > possible to decide if these are real. My question wasN't precise enough in > that point. > Consider the casus irreducilis < https://en.wikipedia.org/wiki/Casus_irreducibilis> case cubic polynomials. The roots are real, but the solution from solve will contain cube roots of complex numbers. If you want numerical answers, then you can use allroots for bfallroots. Then it's pretty easy to remove the complex solutions, assuming that the complex roots don't have spurious non-zero imaginary parts due to roundoff in the algorithm. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From biomates at telefonica.net Wed Apr 11 15:44:22 2012 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 11 Apr 2012 22:44:22 +0200 Subject: [Maxima] maxima analysis of a 'wav' data file In-Reply-To: References: <87AB986691834070A89D3D4BFF4AA9DC@edwinc367e16bd> <9163E0D9DB7246C081B9FEEEFD72FF22@edwinc367e16bd> Message-ID: <1334177062.6890.3.camel@pc> El mi?, 11-04-2012 a las 11:11 -0700, Edwin Woollett escribi?: > Bernardo, > > Glad you are experimenting with Mario's package. We > should encourage him to update it to use the current > version of fft. I have just updated documentation with latest fft. See last examples here: http://riotorto.users.sourceforge.net/sound/sample and here: http://riotorto.users.sourceforge.net/sound/filters Hope this helps. -- Mario From daniel.dalton47 at gmail.com Wed Apr 11 21:09:31 2012 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Thu, 12 Apr 2012 12:09:31 +1000 Subject: [Maxima] Solving trig functions Message-ID: <20120412020931.GA7322@gwsc.vic.edu.au> Hi, I need to solve trig functions on maxima and get all solutions for a given domain. For example, sin(x) = 1/2 In the domain of [-2*%pi, 2*%pi]. Currently with maxima I can only get the solution in the first quadrant - %pi/6. Does anyone know how to do this or have any idea of some reliable code I could write for my own function definition to find the rest of the angles? Thank you very much. Dan From willisb at unk.edu Thu Apr 12 06:04:21 2012 From: willisb at unk.edu (Barton Willis) Date: Thu, 12 Apr 2012 11:04:21 +0000 Subject: [Maxima] Solving trig functions In-Reply-To: <20120412020931.GA7322@gwsc.vic.edu.au> References: <20120412020931.GA7322@gwsc.vic.edu.au> Message-ID: <83FD4DC40F97654495E2C9AED4765836041F3494@BL2PRD0710MB361.namprd07.prod.outlook.com> > I need to solve trig functions on maxima and get all solutions for a > given domain. For example, sin(x) = 1/2 In the domain of [-2*%pi, 2*%pi]. The package (in share/contrib) is able to find the complete solution to some trigonometric equations, but it doesn't have a mechanism for determining the solutions in a given interval. Examples: (%i1) load(to_poly_solver)$ The solution to sin(x)=1/2 is given in terms of arbitrary integers %z6 and %z8 (%i2) %solve(sin(x)=1/2,x); (%o2) %union([x=2*%pi*%z6+%pi/6],[x=2*%pi*%z8+(5*%pi)/6]) The function nicedummies resets the indices of the dummy variables to 0 and 1 (%i3) nicedummies(%); (%o3) %union([x=2*%pi*%z0+%pi/6],[x=2*%pi*%z1+(5*%pi)/6]) Determining the values of the %z0 and %z1 that give solutions in a given interval will not be easy, I think. Another example: (%i4) %solve(cos(3*x)*sin(x-%pi/4)=0,x); (%o4) %union([x=-(-2*%pi*%z18-%pi)/2],[x=-(%pi/3-2*%pi*%z20)/2],[x=-(-2*%pi*%z22-%pi/3)/2],[x=-(-2*%pi*%z24-%pi/2)/2]) By the way: A high school student can outwit %solve: (%i5) %solve(cos(42*x)*sin(x),x); (%o5) %solve([sin(x)*cos(42*x)],[x]) First %solve makes the change of variable z = exp(%i x); second it tries to solve a degree 86 polynomial equation for z. It's unable to find all 86 solutions, so %solve fails to return any solutions. The degree 86 polynomial (z ---> %g205) is (%i20) (-%g205^86+%g205^84-%g205^2+1); (%o20) -%g205^86+%g205^84-%g205^2+1 Show that %g205 = exp(%i * %pi/84) is a solution: (%i21) subst(%g205=exp(%i * %pi/84),%); (%o21) -%e^((%i*%pi)/42)-%e^(-(41*%i*%pi)/42) (%i22) rectform(%); (%o22) %i*(sin((41*%pi)/42)-sin(%pi/42))-cos((41*%pi)/42)-cos(%pi/42) (%i23) trigrat(%); (%o23) 0 Oh surely, %solve should notice that %solve(cos(42*x)*sin(x),x) = union(%solve(cos(42*x),x), %solve(sin(x),x)). The %to_poly_solver has other weaknesses too :( --bw (author of %to_poly_solver) From ziegenbalg at ph-karlsruhe.de Thu Apr 12 10:46:11 2012 From: ziegenbalg at ph-karlsruhe.de (Jochen Ziegenbalg) Date: Thu, 12 Apr 2012 16:46:11 +0100 Subject: [Maxima] Maxima / wxMaxima behaviour Message-ID: Dear all, maybe, in response to the following two remarks I will be told that "This is not a problem of Maxima but of wxMaxima". If so, please let me know if a separate mailing list exist for wxMaxima. However, since new users of Maxima tend not to draw a line between Maxima and wxMaxima (they rather tend to see it as one system - which, I think, is good for Maxima) I would appreciate if wxMaxima-questions could be dealt with in this mailing list as well. Remark 1: When I start Maxima / wxMaxima and evaluate the term 100! I get the output 933262154439441526816992388562[98 digits]916864000000000000000000000000. It took me quite a while to find out about the set_display(ascii) command delivering the full output. Many new users of Maxima, as I could, for instance, observe with my students, are irritated by the above default display behaviour. They expect the full output. Wouldn't it be possible to make "full output" the standard default display behaviour after installation of Maxima/wxMaxima? If so, I would opt for this as a default. Remark 2: After invoking the Maxima/wxMaxima help-window it does not disappear when I click on the Maxima/wxMaxima worksheet again. I have to close the help-window explicitely or at least I have to drag it aside in order to be able to see all of my Maxima/wxMaxima worksheet. Wouldn't it be possible to change the behaviour of the help-window to the effect that it goes one step to the background when I click on the worksheet? Thank you, best regards, Jochen From macrakis at alum.mit.edu Thu Apr 12 13:05:12 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 12 Apr 2012 14:05:12 -0400 Subject: [Maxima] Maxima / wxMaxima behaviour In-Reply-To: References: Message-ID: Jochen, I don't think there's any problem discussing wxMaxima on this mailing list. The problem comes when a user (typically a new user) asks about some issue which happens to be specific to wxMaxima without specifying that he's using wxMaxima. This is not the users' fault. In fact, the way things are set up, they have every reason to believe that Maxima = wxMaxima: - The command-line functions bug_report/build_info do not mention that Maxima is running under wxMaxima (let alone report the version -- I hope that info is being passed in somehow?). - Even the GUI command Help/Bug Report doesn't (it just invokes the command-line function). - In fact, *none* of the GUI Help commands (except Show Tips) even * mention* wxMaxima -- you have to look in the menu wxMaxima/About..., which has a link to a wxMaxima page , which in turn has a link to a help page with lots of tutorials . - But even after all that, there is no reference manual for wxMaxima that I can find! - When you download an installation package for Maxima for some platforms (in particular MacOS X), it *only* installs wxMaxima (as far as I can tell), not command-line Maxima or XMaxima. No wonder people confuse Maxima and wxMaxima. There does seem to be a moderately active user forum for wxMaxima at sourceforge , but the wxMaxima Help does not point to it. In any case, many of the questions there are actually generic Maxima questions, so it might make more sense to auto-forward postings there to this list (though auto-posting responses back is probably going to be a nightmare). Andrej, if I'm not mistaken, you're the maintainer of wxMaxima. Thanks for all your good work on it! I wonder -- would it be possible to improve the bug_report/build_info functionality, and provide some pointer from Help to wxMaxima-specific documentation? Also, is there a reference manual somewhere? I am having trouble using wxMaxima effectively because of the lack of documentation. For example, what is the command for "reenter previous command" (like control-P in XMaxima?)? And how do I refer to the previous result in the worksheet? "%" refers to the (dynamic) last result calculated, not the (lexical) previous one in the worksheet. How do I copy a series of lines to the paste buffer including the %i/%o numbers? etc. etc. Thanks! -s On Thu, Apr 12, 2012 at 11:46, Jochen Ziegenbalg wrote: > Dear all, > > maybe, in response to the following two remarks I will be told that > "This is not a problem of Maxima but of wxMaxima". > If so, please let me know if a separate mailing list exist for wxMaxima. > However, since new users of Maxima tend not to draw a line between > Maxima and wxMaxima (they rather tend to see it as one system - which, > I think, is good for Maxima) I would appreciate if wxMaxima-questions > could be dealt with in this mailing list as well. > > Remark 1: When I start Maxima / wxMaxima and evaluate the term 100! > I get the output > 933262154439441526816992388562[98 > digits]916864000000000000000000000000. > It took me quite a while to find out about the set_display(ascii) > command delivering the full output. > Many new users of Maxima, as I could, for instance, observe with my > students, are irritated by the above default display behaviour. They > expect the full output. > Wouldn't it be possible to make "full output" the standard default > display behaviour after installation of Maxima/wxMaxima? > If so, I would opt for this as a default. > > Remark 2: After invoking the Maxima/wxMaxima help-window it does not > disappear when I click on the Maxima/wxMaxima worksheet again. I have > to close the help-window explicitely or at least I have to drag it > aside in order to be able to see all of my Maxima/wxMaxima worksheet. > Wouldn't it be possible to change the behaviour of the help-window to > the effect that it goes one step to the background when I click on the > worksheet? > > Thank you, > best regards, > Jochen > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Thu Apr 12 13:22:45 2012 From: woollett at charter.net (Edwin Woollett) Date: Thu, 12 Apr 2012 11:22:45 -0700 Subject: [Maxima] how to "fool" Gauss-Kronrod 21-point rule Message-ID: Robert, In your paper http://riso.sourceforge.net/docs/heterogeneous-polytree.pdf which I found via http://en.scientificcommons.org/robert_dodier on page 5, in section 5: Numerical Subtleties, Integration Algorithm, you say: "Integration algorithm. Numerical integrations in more than one dimensions are difficult. In the current implementation, multidimensional integrations are reduced to repeated one-dimensional integrations. The one-dimensional integrations are carried out by an adaptive region-splitting algorithm based on a Gauss- Kronrod 21-point rule. (The code is a translation of the QAGS algorithm from quadpack, a collection of quadrature algorithms available from www.- netlib.org.) The adaptive quadrature algorithm can be "fooled" if the integrand varies on a scale much smaller than I/42, where I is the length of the interval of integration. For this reason, riso tries to find the smallest effective support of the integrand, as described under the preceding heading." I would be interested in some examples which illustrate this ability to fool quad_qags. Ted Woollett From macrakis at alum.mit.edu Thu Apr 12 14:09:10 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 12 Apr 2012 15:09:10 -0400 Subject: [Maxima] Installing Maxima on MacOS X Message-ID: I am new to the Mac, and trying to get my bearings.... In particular, I'm trying to install Maxima on Mac OS X 10.7.3 (is that = OS X.7.3 = OS 10.7.3?). The page about downloads on sourceforgegives no advice for Macs. The Sourceforge download page does include a Maxima-MacOS directory, but as far as I can tell, that installs only wxMaxima as a Mac application. Which is fine except that it is nowhere mentioned that that is what it does. (See previous message about wxMaxima / Maxima confusion.) When you install wxMaxima from Sourceforge, there are some shell scripts hidden in /Applications/Maxima.app/Contents/Resources. maxima.sh seems to work as a simple command-line interface, without auto-adjustment of linel when window width changes (a good start). But xmaxima.sh gives errors ("Maxima data directory not found"). The Maxima ports page at sourceforgehas lots of information, but no recommendations. It says that Clisp, SBCL, and CMUCL are "A-OK", but doesn't say how to install them or Maxima on top of them. There are also links to things called Fink and MacPorts, which seem to be twisty mazes of little passages. Presumably I just need to install from source. I have no problem with that, but instructions would be nice, as I've never installed anything on a Mac from source. There must be some standard approach to dependency, source, and build management, but I'm afraid I don't know anything about those. Can someone help? I imagine there is some equivalent to Cygwin and I don't have to get down and dirty with ftp, gzip, tar, git, configure, make, etc.? Thanks! -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexanderk.hansen at gmail.com Thu Apr 12 14:17:55 2012 From: alexanderk.hansen at gmail.com (Alexander Hansen) Date: Thu, 12 Apr 2012 12:17:55 -0700 Subject: [Maxima] Installing Maxima on MacOS X In-Reply-To: References: Message-ID: <4F872A63.4060401@gmail.com> On 4/12/12 12:09 PM, Stavros Macrakis wrote: > I am new to the Mac, and trying to get my bearings.... > > In particular, I'm trying to install Maxima on Mac OS X 10.7.3 (is > that = OS X.7.3 = OS 10.7.3? Yes. > ). The page about downloads on sourceforge > gives no advice for > Macs. The Sourceforge download page > does include a > Maxima-MacOS directory, but as far as I can tell, that installs only > wxMaxima as a Mac application. Which is fine except that it is > nowhere mentioned that that is what it does. (See previous message > about wxMaxima / Maxima confusion.) > > When you install wxMaxima from Sourceforge, there are someshell > scripts hidden in /Applications/Maxima.app/Contents/Resources. > maxima.sh seems to work as a simple command-line interface, without > auto-adjustment of linel when window width changes (a good start). But > xmaxima.sh gives errors ("Maxima data directory not found"). > > The Maxima ports page at sourceforge > > has lots of information, but no recommendations. It says that Clisp, > SBCL, and CMUCL are "A-OK", but doesn't say how to install them or > Maxima on top of them. There are also links to things called Fink and > MacPorts, which seem to be twisty mazes of little passages. > Presumably I just need to install from source. I have no problem > with that, but instructions would be nice, as I've never installed > anything on a Mac from source. There must be some standard approach > to dependency, source, and build management, but I'm afraid I don't > know anything about those. Can someone help? I imagine there is > some equivalent to Cygwin and I don't have to get down and dirty with > ftp, gzip, tar, git, configure, make, etc.? > > Thanks! > > -s > Fink and Macports both provide dependency, source, and build management. Disclaimer: I maintain maxima and wxmaxima for Fink. -- Alex Hansen -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Thu Apr 12 14:33:13 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 12 Apr 2012 12:33:13 -0700 Subject: [Maxima] Installing Maxima on MacOS X In-Reply-To: References: Message-ID: On Thu, Apr 12, 2012 at 12:09 PM, Stavros Macrakis wrote: > > The Maxima ports page at sourceforgehas lots of information, but no recommendations. It says that Clisp, SBCL, > and CMUCL are "A-OK", but doesn't say how to install them or Maxima on top > of them. There are also links to things called Fink and MacPorts, which > seem to be twisty mazes of little passages. Presumably I just need to > install from source. I have no problem with that, but instructions would > be nice, as I've never installed anything on a Mac from source. There must > be some standard approach to dependency, source, and build management, but > I'm afraid I don't know anything about those. Can someone help? I > imagine there is some equivalent to Cygwin and I don't have to get down and > dirty with ftp, gzip, tar, git, configure, make, etc.? > I think OSX comes with everything you need except git. You can install git from sources or use Fink or MacPorts to get git. If you have a source tarball for maxima, and you have on of the supported lisps installed somewhere, you basically run bootstrap in the maxima directory. Then configure and make. (Run configure --help for some options, including on specifying which lisp you're using and where it's located if not in your PATH.) If you don't have a lisp installed, might be easiest to get ccl from clozure.com. Yes, I know there are lots of detail missing here. :-( Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexanderk.hansen at gmail.com Thu Apr 12 14:40:06 2012 From: alexanderk.hansen at gmail.com (Alexander Hansen) Date: Thu, 12 Apr 2012 12:40:06 -0700 Subject: [Maxima] Installing Maxima on MacOS X In-Reply-To: References: Message-ID: <4F872F96.90703@gmail.com> On 4/12/12 12:33 PM, Raymond Toy wrote: > > > On Thu, Apr 12, 2012 at 12:09 PM, Stavros Macrakis > > wrote: > > > The Maxima ports page at sourceforge > > has lots of information, but no recommendations. It says that > Clisp, SBCL, and CMUCL are "A-OK", but doesn't say how to install > them or Maxima on top of them. There are also links to things > called Fink and MacPorts, which seem to be twisty mazes of little > passages. Presumably I just need to install from source. I have > no problem with that, but instructions would be nice, as I've > never installed anything on a Mac from source. There must be some > standard approach to dependency, source, and build management, but > I'm afraid I don't know anything about those. Can someone help? > I imagine there is some equivalent to Cygwin and I don't have to > get down and dirty with ftp, gzip, tar, git, configure, make, etc.? > > > I think OSX comes with everything you need except git. You can > install git from sources or use Fink or MacPorts to get git. > > If you have a source tarball for maxima, and you have on of the > supported lisps installed somewhere, you basically run bootstrap in > the maxima directory. Then configure and make. (Run configure --help > for some options, including on specifying which lisp you're using and > where it's located if not in your PATH.) > > If you don't have a lisp installed, might be easiest to get ccl from > clozure.com . > > Yes, I know there are lots of detail missing here. :-( > > Ray > > git is included with Xcode 4.1 and later, so it's available for 10.7 folks. -- Alexander Hansen, Ph.D. Fink User Liaison http://finkakh.wordpress.com/2012/02/21/got-job/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrej.vodopivec at gmail.com Thu Apr 12 15:43:37 2012 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Thu, 12 Apr 2012 22:43:37 +0200 Subject: [Maxima] Installing Maxima on MacOS X In-Reply-To: References: Message-ID: On Thu, Apr 12, 2012 at 9:09 PM, Stavros Macrakis wrote: > I am new to the Mac, and trying to get my bearings.... > > In particular, I'm trying to install Maxima on Mac OS X 10.7.3 (is that = OS > X.7.3 = OS 10.7.3?). ?The page about?downloads on sourceforge gives no > advice for Macs. ?The Sourceforge download page does include a Maxima-MacOS > directory, but as far as I can tell, that installs only wxMaxima as a Mac > application. ?Which is fine except that it is nowhere mentioned that that is > what it does. (See previous message about wxMaxima / Maxima confusion.) > > When you install wxMaxima from Sourceforge, there are some?shell scripts > hidden in?/Applications/Maxima.app/Contents/Resources. ?maxima.sh seems to > work as a simple command-line interface, without auto-adjustment of linel > when window width changes (a good start). But xmaxima.sh gives errors > ("Maxima data directory not found"). The package at the sourceforge site contains Maxima compiled with sbcl. If you double-click on Maxima.app, maxima is executed in a terminal. The problem with xmaxima.sh is a bug, I will fix it for the next version. But xmaxima does not work well with OS X anyway. Andrej From fateman at eecs.berkeley.edu Thu Apr 12 17:48:52 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 12 Apr 2012 15:48:52 -0700 Subject: [Maxima] Installing Maxima on MacOS X In-Reply-To: References: Message-ID: <4F875BD4.20408@eecs.berkeley.edu> You do know that it is entirely unnecessary to do this if you just want to just run maxima on a Mac OS-X system? visit http://sourceforge.net/projects/maxima/files/Maxima-MacOS/5.26.0-MacOSX/ You can also add to this version online, interactively, by loading in lisp code. RJF On 5/25/11 2:29 PM, Jorge Calvo wrote: > Hello. I know that a couple of people have asked about this recently, but I am still confused. I tried looking at Stuart Schmitt's page (http://pangea.stanford.edu/~schmitt/maxima.html) for help, but I can't tell which steps apply to the new install method (from the latest .dmg file) and which apply only to the old install method (from the .tar.gz files). > > Here is where I am at: > 1. I have the downloaded CMUCL and it appears to be running correctly. > 2. I have downloaded and expanded the latest .dmg file. > 3. I have copied maxima.app, wxMaxima.app, and Gnuplot.app to the Aplications folder. > > I suppose this means that I am done with step 6 in Scmitt's instructions, but I don't know how to interpret the commands in the next step. In particular, I get errors when I try to "configure" and "make". > > Thanks for your assistance! > > Jorge > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From villate at fe.up.pt Fri Apr 13 02:11:52 2012 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 13 Apr 2012 08:11:52 +0100 Subject: [Maxima] Installing Maxima on MacOS X In-Reply-To: References: Message-ID: <4F87D1B8.7000707@fe.up.pt> On 04/12/2012 09:43 PM, Andrej Vodopivec wrote: > The problem with xmaxima.sh is a bug, I will fix it for the next > version. But xmaxima does not work well with OS X anyway. What do you mean by that? Were you running Xmaxima with tk8.4, or tk8.5? Regards, Jaime From jean.vittor at free.fr Fri Apr 13 06:39:57 2012 From: jean.vittor at free.fr (Jean Vittor) Date: Fri, 13 Apr 2012 13:39:57 +0200 Subject: [Maxima] simplification Message-ID: Hi, I'm new to maxima and I have a hard time understanding how simplification works. My point is to use "sign" values (I mean integers which take their value from {-1;1}) and to be able to automate some trigo simplifications like (in the following, e is a sign and x a real expression): - sin(e*x) -> e*sin(x) - cos(e*x) -> cos(x) - cos(x+(1-e)*%pi/2) -> e*cos(x) - ... - and, of course, e^2 -> 1 Is there a way to do this with maxima ? Thanks, Jean From hhh.guo at gmail.com Fri Apr 13 07:26:22 2012 From: hhh.guo at gmail.com (Ning Guo) Date: Fri, 13 Apr 2012 20:26:22 +0800 Subject: [Maxima] 0 to a negative exponent for rk Message-ID: <4F881B6E.4090400@gmail.com> Hi, I'm using rk to solve a differential equation set. The script is attached. There is a piecewise function I wrote in two ways: q(s) and qq(s), where q(s) is simplified from pp(s) so actually they are equivalent. But when I use them in the differential equation, one (q(s)) is solvable and the other (qq(s)) is not which results in a following error: expt: undefined: 0 to a negative exponent. Besides, the solved results are also not good (not smooth solution). What causes these problems? Thanks. Best regards, Ning -- Geotechnical Group Department of Civil and Environmental Engineering Hong Kong University of Science and Technology Clear Water Bay, Kowloon, Hong Kong -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: stz2.wxm URL: From villate at fe.up.pt Fri Apr 13 08:58:58 2012 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 13 Apr 2012 14:58:58 +0100 Subject: [Maxima] 0 to a negative exponent for rk In-Reply-To: <4F881B6E.4090400@gmail.com> References: <4F881B6E.4090400@gmail.com> Message-ID: <4F883122.2040608@fe.up.pt> On 04/13/2012 01:26 PM, Ning Guo wrote: > I'm using rk to solve a differential equation set. The script is > attached. There is a piecewise function I wrote in two ways: q(s) and > qq(s), where q(s) is simplified from pp(s) so actually they are > equivalent. But when I use them in the differential equation, one > (q(s)) is solvable and the other (qq(s)) is not which results in a > following error: > > expt: undefined: 0 to a negative exponent. > > Besides, the solved results are also not good (not smooth solution). > What causes these problems? Thanks. Hi, I'm not fully convinced that q(s) and qq(s) are equivalent but I have not looked at them carefully. It is also hard to tell whether they are smooth functions, since the involve numerical integrations using quad-qags. Have you made a plot2d of q(s) and qq(s)? A numerical problem with one of the functions and the equivalence and smoothness of them will be easier to check with plot2d, before using rk. Cheers, Jaime From hhh.guo at gmail.com Fri Apr 13 09:18:50 2012 From: hhh.guo at gmail.com (Ning Guo) Date: Fri, 13 Apr 2012 22:18:50 +0800 Subject: [Maxima] 0 to a negative exponent for rk In-Reply-To: <4F883122.2040608@fe.up.pt> References: <4F881B6E.4090400@gmail.com> <4F883122.2040608@fe.up.pt> Message-ID: <4F8835CA.4060108@gmail.com> On Friday, April 13, 2012 09:58 PM, Jaime Villate wrote: Hi Jaime, Thanks for you reply. I plotted these two function which is also shown in the script (though I used wxplot2d). They show overlapped curves. With regard to `quad_qags`, I also tried `integrate` instead. The behavior is simply same. Cheers, Ning > On 04/13/2012 01:26 PM, Ning Guo wrote: >> I'm using rk to solve a differential equation set. The script is >> attached. There is a piecewise function I wrote in two ways: q(s) and >> qq(s), where q(s) is simplified from pp(s) so actually they are >> equivalent. But when I use them in the differential equation, one >> (q(s)) is solvable and the other (qq(s)) is not which results in a >> following error: >> >> expt: undefined: 0 to a negative exponent. >> >> Besides, the solved results are also not good (not smooth solution). >> What causes these problems? Thanks. > Hi, > I'm not fully convinced that q(s) and qq(s) are equivalent but I have > not looked at them carefully. > It is also hard to tell whether they are smooth functions, since the > involve numerical integrations using quad-qags. > > Have you made a plot2d of q(s) and qq(s)? A numerical problem with one > of the functions and the equivalence and smoothness of them will be > easier to check with plot2d, before using rk. > > Cheers, > Jaime > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- Geotechnical Group Department of Civil and Environmental Engineering Hong Kong University of Science and Technology Clear Water Bay, Kowloon, Hong Kong From beroset at mindspring.com Fri Apr 13 10:08:27 2012 From: beroset at mindspring.com (Ed Beroset) Date: Fri, 13 Apr 2012 11:08:27 -0400 Subject: [Maxima] simplification In-Reply-To: References: Message-ID: <4F88416B.5070704@mindspring.com> Jean Vittor wrote: > Hi, > > I'm new to maxima and I have a hard time understanding how > simplification works. > > My point is to use "sign" values (I mean integers which take their value > from {-1;1}) and to be able to automate some trigo simplifications like > (in the following, e is a sign and x a real expression): > - sin(e*x) -> e*sin(x) > - cos(e*x) -> cos(x) > - cos(x+(1-e)*%pi/2) -> e*cos(x) > - ... > - and, of course, e^2 -> 1 > > Is there a way to do this with maxima ? If I've understood your question correctly, yes, there is a way to do that using subst and ratsimp. For example: f(x):=cos(x+(1-e)*%pi/2); ratsimp(subst(-1,e,%)); gives f(x) := - cos(x) If you want, you can also create both possibilities simultaneously like so: [ratsimp(subst(+1,e,f(x))), ratsimp(subst(-1,e,f(x)))] Ed From willisb at unk.edu Fri Apr 13 10:17:31 2012 From: willisb at unk.edu (Barton Willis) Date: Fri, 13 Apr 2012 15:17:31 +0000 Subject: [Maxima] simplification In-Reply-To: References: Message-ID: <83FD4DC40F97654495E2C9AED4765836041F381C@BL2PRD0710MB361.namprd07.prod.outlook.com> The general simplifier for trigonometric functions has a method for deciding when to apply a reflection identity; for example (%i1) sin(-x); (%o1) -sin(x) (%i2) cos(-x); (%o2) cos(x) (%i3) makelist(cos(x + (1-e) * %pi/2),e,[-1,0,1]); (%o3) [-cos(x),-sin(x),cos(x)] Maxima uses an ordering predicate (defined on expressions, not just numbers) to decide when to use the reflection identity: (%i4) sin(b-x); (%o4) -sin(x-b) (%i5) sin(b-a); (%o5) sin(b-a) The aim of the algorithm is to simplify as many expressions to zero as possible: (%i7) sin(b-x) + sin(x-b); (%o7) 0 (%i8) sin(a-b) + sin(b-a); (%o8) 0 Also, the function trigrat might be useful to you? I didn't answer your question, but maybe some of this is useful. --bw ________________________________________ From: maxima-bounces at math.utexas.edu [maxima-bounces at math.utexas.edu] on behalf of Jean Vittor [jean.vittor at free.fr] Sent: Friday, April 13, 2012 06:39 To: maxima at math.utexas.edu Subject: [Maxima] simplification Hi, I'm new to maxima and I have a hard time understanding how simplification works. My point is to use "sign" values (I mean integers which take their value from {-1;1}) and to be able to automate some trigo simplifications like (in the following, e is a sign and x a real expression): - sin(e*x) -> e*sin(x) - cos(e*x) -> cos(x) - cos(x+(1-e)*%pi/2) -> e*cos(x) - ... - and, of course, e^2 -> 1 Is there a way to do this with maxima ? Thanks, Jean _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From fateman at eecs.berkeley.edu Fri Apr 13 10:42:17 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 13 Apr 2012 08:42:17 -0700 Subject: [Maxima] simplification In-Reply-To: <83FD4DC40F97654495E2C9AED4765836041F381C@BL2PRD0710MB361.namprd07.prod.outlook.com> References: <83FD4DC40F97654495E2C9AED4765836041F381C@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: <4F884959.206@eecs.berkeley.edu> In some sense the original poster is asking for something that can't be effectively implemented. At least as I read it, the question is, can Maxima handle this situation: "I'm thinking of a number, either one or minus one. Call it e. I'm going to write an expression (trigonometric, but really e*x is not trig..) involving exactly one occurrence of e. I want it simplified for either value of e, but with the result expressed as a function of e, in a nice form." Well, look at this: sin(3.0+e). What are you going to do? How about 0^e? The original question is really such a special special case that it seems unlikely to be a built-in "feature". On the other hand, a computer algebra system has lots of features and it is hard, especially for a new user, to gather what has been implemented or not. There are a fair number of peculiar functionalities which are included not so much because they are useful, but because they could be programmed. There is a reasonable approach if you are willing to reformulate the problem as actions on pairs, as suggested. instead of sin(e*x), use {sin(x), sin(-x)}. If both elements are identical, convert to a single value. Otherwise, all operations are mapped on to each of the two values. Doing this systematically might be possible by some cleverness. RJF On 4/13/12 8:17 AM, Barton Willis wrote: > The general simplifier for trigonometric functions has a method for deciding when to apply a reflection identity; for example > > (%i1) sin(-x); > (%o1) -sin(x) > > (%i2) cos(-x); > (%o2) cos(x) > > (%i3) makelist(cos(x + (1-e) * %pi/2),e,[-1,0,1]); > (%o3) [-cos(x),-sin(x),cos(x)] > > Maxima uses an ordering predicate (defined on expressions, not just numbers) to decide when to use the reflection identity: > > (%i4) sin(b-x); > (%o4) -sin(x-b) > > (%i5) sin(b-a); > (%o5) sin(b-a) > > The aim of the algorithm is to simplify as many expressions to zero as possible: > > (%i7) sin(b-x) + sin(x-b); > (%o7) 0 > > (%i8) sin(a-b) + sin(b-a); > (%o8) 0 > > Also, the function trigrat might be useful to you? I didn't answer your question, but maybe some of this is useful. > > --bw > > ________________________________________ > From: maxima-bounces at math.utexas.edu [maxima-bounces at math.utexas.edu] on behalf of Jean Vittor [jean.vittor at free.fr] > Sent: Friday, April 13, 2012 06:39 > To: maxima at math.utexas.edu > Subject: [Maxima] simplification > > Hi, > > I'm new to maxima and I have a hard time understanding how > simplification works. > > My point is to use "sign" values (I mean integers which take their value > from {-1;1}) and to be able to automate some trigo simplifications like > (in the following, e is a sign and x a real expression): > - sin(e*x) -> e*sin(x) > - cos(e*x) -> cos(x) > - cos(x+(1-e)*%pi/2) -> e*cos(x) > - ... > - and, of course, e^2 -> 1 > > Is there a way to do this with maxima ? > > > Thanks, > > Jean > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Fri Apr 13 10:44:52 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 13 Apr 2012 11:44:52 -0400 Subject: [Maxima] Installing Maxima on MacOS X In-Reply-To: <4F875BD4.20408@eecs.berkeley.edu> References: <4F875BD4.20408@eecs.berkeley.edu> Message-ID: RJF, Did you read my original posting? That is how I installed Maxima on my Mac. But only the wxMaxima app is installed in the Applications folder when you do that (which may lead to users thinking that wxMaxima = Maxima). There is a shell file that purportedly runs XMaxima, but it currently has a bug (and in any case is not installed as a Mac application). There is also a shell file that runs command-line Maxima. Both of these are buried in the Application Resources folder and as far as I can tell not documented anywhere. -s On Thu, Apr 12, 2012 at 18:48, Richard Fateman wrote: > You do know that it is entirely unnecessary to do this if you just want to > just run maxima on a Mac OS-X system? > visit > > http://sourceforge.net/**projects/maxima/files/Maxima-** > MacOS/5.26.0-MacOSX/ > > You can also add to this version online, interactively, by loading in lisp > code. > > RJF > > > On 5/25/11 2:29 PM, Jorge Calvo wrote: > >> Hello. I know that a couple of people have asked about this recently, >> but I am still confused. I tried looking at Stuart Schmitt's page ( >> http://pangea.stanford.edu/~**schmitt/maxima.html) >> for help, but I can't tell which steps apply to the new install method >> (from the latest .dmg file) and which apply only to the old install method >> (from the .tar.gz files). >> >> Here is where I am at: >> 1. I have the downloaded CMUCL and it appears to be running correctly. >> 2. I have downloaded and expanded the latest .dmg file. >> 3. I have copied maxima.app, wxMaxima.app, and Gnuplot.app to the >> Aplications folder. >> >> I suppose this means that I am done with step 6 in Scmitt's instructions, >> but I don't know how to interpret the commands in the next step. In >> particular, I get errors when I try to "configure" and "make". >> >> Thanks for your assistance! >> >> Jorge >> ______________________________**_________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/**mailman/listinfo/maxima >> > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Fri Apr 13 10:56:38 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 13 Apr 2012 11:56:38 -0400 Subject: [Maxima] simplification In-Reply-To: <4F884959.206@eecs.berkeley.edu> References: <83FD4DC40F97654495E2C9AED4765836041F381C@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F884959.206@eecs.berkeley.edu> Message-ID: Though I don't know any way of solving the original poster's problem simply and effectively, I don't think it's fair to say that it is "something that can't be effectively implemented". Just as today we can declare that equal(e,1), we could in principle support assume(equal(abs(e),1)). Alas, Maxima can't do much of interest with that fact, not even "easy" things like is(equal(e,0)) => false and is(e<2) => true. Another possible way of expressing the fact is assume(equal(e,1) or equal(e,-1)), but Maxima doesn't allow that at all. -s On Fri, Apr 13, 2012 at 11:42, Richard Fateman wrote: > In some sense the original poster is asking for something that can't be > effectively implemented. > At least as I read it, the question is, can Maxima handle this situation: > > "I'm thinking of a number, either one or minus one. Call it e. I'm going > to > write an expression (trigonometric, but really e*x is not trig..) > involving exactly one occurrence of e. > I want it simplified for either value of e, but with the result expressed > as a function > of e, in a nice form." > > > Well, look at this: sin(3.0+e). What are you going to do? How about > 0^e? > > The original question is really such a special special case that it seems > unlikely to > be a built-in "feature". On the other hand, a computer algebra system has > lots > of features and it is hard, especially for a new user, to gather what has > been > implemented or not. There are a fair number of peculiar functionalities > which > are included not so much because they are useful, but because they could be > programmed. > > There is a reasonable approach if you are willing to reformulate the > problem as > actions on pairs, as suggested. > > instead of sin(e*x), use {sin(x), sin(-x)}. > > If both elements are identical, convert to a single value. Otherwise, all > operations are > mapped on to each of the two values. Doing this systematically might be > possible by > some cleverness. > > RJF > > > > On 4/13/12 8:17 AM, Barton Willis wrote: > >> The general simplifier for trigonometric functions has a method for >> deciding when to apply a reflection identity; for example >> >> (%i1) sin(-x); >> (%o1) -sin(x) >> >> (%i2) cos(-x); >> (%o2) cos(x) >> >> (%i3) makelist(cos(x + (1-e) * %pi/2),e,[-1,0,1]); >> (%o3) [-cos(x),-sin(x),cos(x)] >> >> Maxima uses an ordering predicate (defined on expressions, not just >> numbers) to decide when to use the reflection identity: >> >> (%i4) sin(b-x); >> (%o4) -sin(x-b) >> >> (%i5) sin(b-a); >> (%o5) sin(b-a) >> >> The aim of the algorithm is to simplify as many expressions to zero as >> possible: >> >> (%i7) sin(b-x) + sin(x-b); >> (%o7) 0 >> >> (%i8) sin(a-b) + sin(b-a); >> (%o8) 0 >> >> Also, the function trigrat might be useful to you? I didn't answer your >> question, but maybe some of this is useful. >> >> --bw >> >> ______________________________**__________ >> From: maxima-bounces at math.utexas.edu [maxima-bounces at math.utexas.**edu] >> on behalf of Jean Vittor [jean.vittor at free.fr] >> Sent: Friday, April 13, 2012 06:39 >> To: maxima at math.utexas.edu >> Subject: [Maxima] simplification >> >> Hi, >> >> I'm new to maxima and I have a hard time understanding how >> simplification works. >> >> My point is to use "sign" values (I mean integers which take their value >> from {-1;1}) and to be able to automate some trigo simplifications like >> (in the following, e is a sign and x a real expression): >> - sin(e*x) -> e*sin(x) >> - cos(e*x) -> cos(x) >> - cos(x+(1-e)*%pi/2) -> e*cos(x) >> - ... >> - and, of course, e^2 -> 1 >> >> Is there a way to do this with maxima ? >> >> >> Thanks, >> >> Jean >> >> ______________________________**_________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/**mailman/listinfo/maxima >> >> >> ______________________________**_________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/**mailman/listinfo/maxima >> > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Fri Apr 13 11:05:44 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 13 Apr 2012 09:05:44 -0700 Subject: [Maxima] Installing Maxima on MacOS X In-Reply-To: References: <4F875BD4.20408@eecs.berkeley.edu> Message-ID: On Fri, Apr 13, 2012 at 8:44 AM, Stavros Macrakis wrote: > RJF, > > Did you read my original posting? That is how I installed Maxima on my > Mac. But only the wxMaxima app is installed in the Applications folder > when you do that (which may lead to users thinking that wxMaxima = Maxima). > There is a shell file that purportedly runs XMaxima, but it currently has > a bug (and in any case is not installed as a Mac application). There is > also a shell file that runs command-line Maxima. Both of these are buried > in the Application Resources folder and as far as I can tell not documented > anywhere. > > I have never used the installer, but I presume it's meant that you use wxMaxima (which I have also never used). I just install my favorite lisp(s) somewhere, build from source, and run maxima-local inside a shell window in xemacs. Perhaps not the best user interface, but at at least M-p and M-r will bring back previous inputs easily. (The shell mode gets confused by maxima's prompt and things with factorials (!) confuse it too since ! is a csh shortcut of some kind.) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Fri Apr 13 12:30:12 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 13 Apr 2012 10:30:12 -0700 Subject: [Maxima] how to "fool" Gauss-Kronrod 21-point rule In-Reply-To: References: Message-ID: On Thu, Apr 12, 2012 at 11:22 AM, Edwin Woollett wrote: > > Robert, > > In your paper > http://riso.sourceforge.net/**docs/heterogeneous-polytree.**pdf > > which I found via http://en.scientificcommons.**org/robert_dodier > > on page 5, in section 5: Numerical Subtleties, > Integration Algorithm, > > you say: > > "Integration algorithm. Numerical integrations in > more than one dimensions are difficult. In the current > implementation, multidimensional integrations are reduced > to repeated one-dimensional integrations. The > one-dimensional integrations are carried out by an > adaptive region-splitting algorithm based on a Gauss- > Kronrod 21-point rule. (The code is a translation > of the QAGS algorithm from quadpack, a collection > of quadrature algorithms available from www.- > netlib.org.) The adaptive quadrature algorithm can > be "fooled" if the integrand varies on a scale much > smaller than I/42, where I is the length of the interval > of integration. For this reason, riso tries to find > the smallest effective support of the integrand, as described > under the preceding heading." > > I would be interested in some examples which illustrate > this ability to fool quad_qags. > Not exactly sure what you're looking for but here is one example where quad_qags gives no error or warning messages, but the result is totally wrong: quad_qags(4^(-16)/((x - %pi/4)^2 + 16^(-16)),x,0,1); [1.4602196559157534e-6, 1.8681728113217153e-6, 693, 5] Maxima can actually compute the integral: ratsimp(integrate(4^(-16)/((x - %pi/4)^2 + 16^(-16)),x,0,1)); atan(1073741824 %pi) - atan(1073741824 %pi - 4294967296) float(%) 3.141592652208402 (This example from the quadpack book, also listed in numerical/slatec/quadpack.lisp. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Fri Apr 13 16:45:26 2012 From: woollett at charter.net (Edwin Woollett) Date: Fri, 13 Apr 2012 14:45:26 -0700 Subject: [Maxima] how to "fool" Gauss-Kronrod 21-point rule Message-ID: <1F7E81EC136F4A058073745909658C31@edwinc367e16bd> On April 13, 2012, Raymond Toy wrote: ------------------------------- >Not exactly sure what you're looking for but here is one example where >quad_qags gives no error or warning messages, but the result is totally >wrong: > > quad_qags(4^(-16)/((x - %pi/4)^2 + 16^(-16)),x,0,1); > [1.4602196559157534e-6, 1.8681728113217153e-6, 693, 5] ----------------------------------------------- Thanks for the example, which my present quadpack wrapper does successfully: ----------------------------------------------------- (%i1) load(quad); load nint_util.mac load quad1d.mac load quad2d.mac (%o1) "c:/work2/quad.mac" (%i2) quad(4^(-16)/((x - %pi/4)^2 + 16^(-16)),x,0,1); (%o2) 3.1415926 (%i3) nargL; (%o3) [qag,1/(4294967296*((x-%pi/4)^2+1/18446744073709551616)),x,0.0,1.0,3, limit = 800] (%i4) noutL; (%o4) [qag,3.1415926,9.28343605E-9,2201,0] (%i5) mdefint(4^(-16)/((x - %pi/4)^2 + 16^(-16)),x,0,1); (%o5) atan(1073741824*%pi)-atan(1073741824*%pi-4294967296) (%i6) float(%); (%o6) 3.1415927 --------------------------------------------------- I am getting to the point of looking for more obscure examples for testing of the code. The call to quad above (with no general options) sends the expression to a competition between qags and qag. For each method the epsrel criterion is tried, and if it doesn't work, the epsabs criterion is tried. For this case quad_qag with the epsrel criterion (the default) succeeds, and neither of the quad_qags tries succeeds. Ted From woollett at charter.net Fri Apr 13 17:19:52 2012 From: woollett at charter.net (Edwin Woollett) Date: Fri, 13 Apr 2012 15:19:52 -0700 Subject: [Maxima] how to "fool" Gauss-Kronrod 21-point rule Message-ID: <01B9A568C8C54E808A647172B6F3413F@edwinc367e16bd> On April 13, 2012, I wrote: -------------------------------- >Thanks for the example, which my present quadpack wrapper >does successfully: > . . . . ----------------------------- A weird case of quad_qag behavior is that the factored form of the integrand is treated successfully, but expanded forms are not (5.26.0gcl, Windows, XMaxima): ---------------------------------- (%i1) display2d:false$ (%i2) e1:4^(-16)/((x - %pi/4)^2 + 16^(-16)); (%o2) 1/(4294967296*((x-%pi/4)^2+1/18446744073709551616)) (%i3) e2:expand(e1); (%o3) 1/(4294967296*x^2-2147483648*%pi*x+268435456*%pi^2+1/4294967296) (%i4) quad_qag(e1,x,0,1,3); (%o4) [3.141592628838887,9.2834360519558821E-9,2201,0] (%i5) quad_qag(e2,x,0,1,3); (%o5) quad_qag(1/(4294967296*x^2-2147483648*%pi*x+268435456*%pi^2 +1/4294967296),x,0,1,3,epsrel = 1.0E-8, epsabs = 0.0,limit = 200) (%i6) quad_qag(float(e2),x,0,1,3); (%o6) quad_qag(1/(4.294967296E+9*x^2-6.7465188522610092E+9*x +2.6493517579460287E+9),x,0,1,3, epsrel = 1.0E-8,epsabs = 0.0,limit = 200) ----------------------------------------------------- Is there something about quad_qag internals that I need to worry about here? Ted From toy.raymond at gmail.com Fri Apr 13 17:32:48 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 13 Apr 2012 15:32:48 -0700 Subject: [Maxima] how to "fool" Gauss-Kronrod 21-point rule In-Reply-To: <01B9A568C8C54E808A647172B6F3413F@edwinc367e16bd> References: <01B9A568C8C54E808A647172B6F3413F@edwinc367e16bd> Message-ID: On Fri, Apr 13, 2012 at 3:19 PM, Edwin Woollett wrote: > On April 13, 2012, I wrote: > ------------------------------**-- > >> Thanks for the example, which my present quadpack wrapper >> does successfully: >> . . . . >> > ----------------------------- > A weird case of quad_qag behavior is that the factored > form of the integrand is treated successfully, but expanded forms are not > (5.26.0gcl, Windows, XMaxima): > > ------------------------------**---- > (%i1) display2d:false$ > > (%i2) e1:4^(-16)/((x - %pi/4)^2 + 16^(-16)); > > (%o2) 1/(4294967296*((x-%pi/4)^2+1/**18446744073709551616)) > > (%i3) e2:expand(e1); > > (%o3) 1/(4294967296*x^2-2147483648*%**pi*x+268435456*%pi^2+1/**4294967296) > > It's a numerical issue. e1 is clearly more accurate when x is near %pi/4. Compare the value of e1 and e2 for x =.78539816. (If this doesn't cause a problem, add a few for digits from %pi/4.). For your tests, maybe you can replace the -16 with values like -32. This makes the spike even narrower. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Sat Apr 14 11:59:07 2012 From: woollett at charter.net (Edwin Woollett) Date: Sat, 14 Apr 2012 09:59:07 -0700 Subject: [Maxima] how to "fool" Gauss-Kronrod 21-point rule Message-ID: <08F3717D0FB647A291478784ACF39E7B@edwinc367e16bd> On April 13, 2012, Raymond Toy wrote: ------------------------------ >It's a numerical issue. e1 is clearly more accurate when x is near %pi/4. >Compare the value of e1 and e2 for x =.78539816. (If this doesn't cause a >problem, add a few for digits from %pi/4.). -------------------------------------- Yes, that is the problem, and I should have looked at that difference in accuracy of the two expressions. --------------------------------------------------- (%i1) load(quad); (%o1) "c:/work2/quad.mac" (%i2) e1 : 4^(-16)/((x - %pi/4)^2 + 16^(-16)); (%o2) 1/(4294967296*((x-%pi/4)^2+1/18446744073709551616)) (%i3) e2 : expand(e1); (%o3) 1/(4294967296*x^2-2147483648*%pi*x+268435456*%pi^2+1/4294967296) (%i4) xL : [0.785,0.7853,0.78539,0.785398]$ (%i5) for xv in xL do print(" ",xv," ",fcompare(e1,e2,x,xv,20))$ 0.785 [1.53645769E-13, 6.40931986E-10] 0.7853 [6.23703981E-13, 2.47483209E-9] 0.78539 [7.500549E-12, 4.79013095E-7] 0.785398 [3.74731578E-10, 0.00215256] ----------------------------------------------------------- where fcompare is: ---------------------------------- fcompare (ee1,ee2,xx,xval,fppval):= block([fpprec:fppval, tval, e1f, e2f, relerr1, relerr2], tval : bfloat (subst (xx = xval, ee1)), e1f : float (subst (xx = xval, ee1)), e2f : float (subst (xx = xval, ee2)), relerr1 : float (abs ((e1f - tval)/tval)), relerr2 : float (abs ((e2f - tval)/tval)), [relerr1, relerr2])$ --------------------------------------------- Ted From woollett at charter.net Sat Apr 14 16:14:54 2012 From: woollett at charter.net (Edwin Woollett) Date: Sat, 14 Apr 2012 14:14:54 -0700 Subject: [Maxima] mydefint2 Message-ID: <25364554E03941ACBE1D5002239CBA34@edwinc367e16bd> mydefint2 does 2d integration using integrate twice. Calls separate and mydefint1. An attempt to define functions which result in minimal questions about the variables of integration. Of course, questions may be asked about unbound parameters in the integrand. Example of use: ---------------------------- (%i1) load(mydefint); (%o1) "c:/work2/mydefint.mac" (%i2) mydefint2(x*y,[x,0,1],[y,0,1]); (%o2) 1/4 (%i3) mydefint2 (log(x+y),[x,0,1],[y,0,1]); (%o3) (4*log(2)-3)/2 (%i4) mydefint2 (1/sqrt(x+y),[x,0,1],[y,0,1]); (%o4) (2^(7/2)-8)/3 (%i5) mydefint2(sqrt(x^2 - 2*x*y + y^2),[x,-1,1],[y,-1,1]); (%o5) 8/3 (%i6) mydefint2(sqrt(x^2 - 2*x*y + y^2),[x,-1,1],[y,-x,x]); (%o6) 0 ---------------------------------- code file mydefint.mac: ----------------------------------- /* mydefint.mac */ /* separate(aL,x) returns a list of two lists, the first being the elements of aL which contain x, the second being the elements of aL which do not contain x */ separate(a11L,xx11) := block([t11,t11L:[],t22L:[]], for t11 in a11L do if length(t11) < 2 then t22L : cons(t11,t22L) else if (part(t11,1) = xx11 or part(t11,2) = xx11) then t11L : cons(t11,t11L) else t22L : cons(t11,t22L), [t11L,t22L])$ /**** mydefint1 calls separate. forgets those global facts which involve the integration variable. before creating local facts. After doing the integral the the forgotten facts are re-assumed. *********/ mydefint1 (e78, x78, a78, b78) := block( [domain : complex,forgetL,ignoreL, res1, loc_assume,e781], [forgetL,ignoreL] : separate(facts(),x78), if debug then display (forgetL,ignoreL), apply('forget,forgetL), loc_assume : apply('assume, [x78 > min(a78,b78), x78 < max(a78,b78)] ), e781 : expand (e78,0,0), res1 : ratsimp (integrate (e781, x78, a78, b78 ) ), apply ('forget, loc_assume), apply ('assume, forgetL), res1)$ /******** mydefint2 calls separate and mydefint1 ************/ mydefint2(qe,qxL,qyL) := block([forget2L,ignore2L,locx_assume,qe79, qxmin,qxmax,res79,res791,res792,xsign], qxmin : min(qxL[2],qxL[3]), qxmax : max(qxL[2],qxL[3]), if qxmin = qxL[3] then xsign:-1 else xsign:1, [forget2L,ignore2L] : separate(facts(),qxL[1]), apply('forget,forget2L), /* case x doesn't change sign */ if (qxmin >= 0 or qxmax <= 0) then (locx_assume : apply('assume, [qxL[1] > qxmin, qxL[1] < qxmax] ), qe79 : expand (qe,0,0), res79 : apply('integrate, [apply('mydefint1,flatten([qe79,qyL])),qxL[1],qxmin,qxmax]), res79 : xsign*ratsimp(res79), apply ('forget, locx_assume)) else /* case x does change sign */ (locx_assume : apply('assume, [qxL[1] > qxmin,qxL[1] < 0] ), qe79 : expand (qe,0,0), res791 : apply('integrate, [apply('mydefint1,flatten([qe79,qyL])),qxL[1],qxmin,0]), apply('forget,locx_assume), locx_assume : apply('assume, [qxL[1] > 0,qxL[1] < qxmax] ), qe79 : expand (qe,0,0), res792 : apply('integrate, [apply('mydefint1,flatten([qe79,qyL])),qxL[1],0,qxmax]), res79 : xsign*ratsimp(res791 + res792), apply('forget,locx_assume)), apply ('assume, forget2L), res79)$ display2d:false$ ratprint:false$ ---------------------------------------------- From willisb at unk.edu Sun Apr 15 13:26:58 2012 From: willisb at unk.edu (Barton Willis) Date: Sun, 15 Apr 2012 18:26:58 +0000 Subject: [Maxima] mydefint2 In-Reply-To: <25364554E03941ACBE1D5002239CBA34@edwinc367e16bd> References: <25364554E03941ACBE1D5002239CBA34@edwinc367e16bd> Message-ID: <83FD4DC40F97654495E2C9AED47658360420195D@BL2PRD0710MB361.namprd07.prod.outlook.com> ________________________________________ >From: Edwin Woollett >mydefint2 does 2d integration using integrate twice. >Calls separate and mydefint1. > An attempt to define functions which result in minimal questions about the variables of integration. The integrand (first argument to mydefin1) is automatically simplified in the current context; thus (%i2) (assume(x < 0), mydefint1(abs(x),x,0,1)); (%o2) -1/2 No amount of quoting changes this. If this bothers you (first simplify in global context and second in the context defined by the definite integral), you could specify the integrand as a lambda form, or you could write your code in Common Lisp as a defmspec function. Also, your code forgets all assumptions that involve the variable of integration. If the global context is (0 < x, x < a) and x is the integration variable, the body of mydefinit1 will not be able deduce that a is positive, for example. --bw From jean.vittor at free.fr Sun Apr 15 14:08:00 2012 From: jean.vittor at free.fr (Jean Vittor) Date: Sun, 15 Apr 2012 21:08:00 +0200 Subject: [Maxima] simplification In-Reply-To: References: <83FD4DC40F97654495E2C9AED4765836041F381C@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F884959.206@eecs.berkeley.edu> Message-ID: Thanks for all response I got. I've tried {subst(1, e1, %), subst(-1, e1, %)}; then union((subst(1, e2, %), subst(-1, e2, %)) and so on... It kinda works: I get some simplifications but I lose variables e1, e2... and the result set is large (as I have a lot of iterations with at least one sign variable for each iteration). Moreover, I would like to use functions that returns either 1 or -1. Is there a solution which would consist in: - declaring a variable type (or feature, or property, I'm not familiar with maxima's vocabulary) : say 'sign'; - adding some rules like tellsimp(sin(e*x), e*sin(x)) if e is a 'sign' and x an expression that leads to a real number ? Even a 'function' (let's call it simplify_sign) could fit if I could have: simplify_sign(e, sin(e*a_complex_expression)) returns e*sin(a_complex_expression). Thanks, Jean Le 13/04/2012 17:56, Stavros Macrakis a ?crit : > [...] From macrakis at alum.mit.edu Sun Apr 15 15:07:49 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 15 Apr 2012 16:07:49 -0400 Subject: [Maxima] simplification In-Reply-To: References: <83FD4DC40F97654495E2C9AED4765836041F381C@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F884959.206@eecs.berkeley.edu> Message-ID: Yes, you can certainly define patterns like sin(e*x) => e*sin(x) where 'e' has a certain property. See chapter 34 of the manual (you can get to it with ?? patterns on the command line). And you can use 'trigexpand' to transform cos(x+e*%pi/4) => cos(%pi*e/4)*cos(x)-sin(%pi*e/4)*sin(x), which then includes expressions of the form cos(e*x). You can also define patterns like e^n => 1 if n is an odd integer and e if n is an even integer. -s On Sun, Apr 15, 2012 at 15:08, Jean Vittor wrote: > Thanks for all response I got. > > > I've tried {subst(1, e1, %), subst(-1, e1, %)}; then union((subst(1, e2, > %), subst(-1, e2, %)) and so on... > > It kinda works: I get some simplifications but I lose variables e1, e2... > and the result set is large (as I have a lot of iterations with at least > one sign variable for each iteration). Moreover, I would like to use > functions that returns either 1 or -1. > > Is there a solution which would consist in: > - declaring a variable type (or feature, or property, I'm not familiar > with maxima's vocabulary) : say 'sign'; > - adding some rules like tellsimp(sin(e*x), e*sin(x)) if e is a 'sign' > and x an expression that leads to a real number ? > > Even a 'function' (let's call it simplify_sign) could fit if I could have: > simplify_sign(e, sin(e*a_complex_expression)) returns > e*sin(a_complex_expression). > > > Thanks, > > Jean > > Le 13/04/2012 17:56, Stavros Macrakis a ?crit : > >> [...] >> > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sun Apr 15 21:24:40 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 15 Apr 2012 22:24:40 -0400 Subject: [Maxima] how to "fool" Gauss-Kronrod 21-point rule In-Reply-To: References: Message-ID: On 4/12/12, Edwin Woollett wrote: > The adaptive quadrature algorithm can > be "fooled" if the integrand varies on a scale much > smaller than I/42, where I is the length of the interval > of integration. Well, what I meant is that if two functions f and g agree on the set of points evaluated by QAGS, and differ elsewhere, then QAGS will return the same estimate for both, although the integrals might actually differ by any amount you like. You could construct an example by what points are evaluated for an easy function such as sin or whatever, and then construct a spline which goes through those points as well as some others which you can choose as you wish. Sorry for the late reply -- I've been on the road. best Robert Dodier From jean.vittor at free.fr Mon Apr 16 00:40:29 2012 From: jean.vittor at free.fr (Jean Vittor) Date: Mon, 16 Apr 2012 07:40:29 +0200 Subject: [Maxima] simplification In-Reply-To: References: <83FD4DC40F97654495E2C9AED4765836041F381C@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F884959.206@eecs.berkeley.edu> Message-ID: Le 15/04/2012 22:07, Stavros Macrakis a ?crit : > [...] > > You can also define patterns like e^n => 1 if n is an odd integer and e > if n is an even integer. > I've tried this but I must have missed sth : (%i1) matchdeclare(e, lambda([e],equal(abs(e), 1))); (%o1) done (%i2) matchdeclare(n, integer); (%o2) done (%i3) tellsimp(e^n,e^(mod(n,2))); (%o3) [^rule1,simpexpt] (%i4) declare(e1, integer); (%o4) done (%i5) assume(equal(abs(e1), 1)); (%o5) [equal(abs(e1),1)] (%i6) e1^5; (%o6) e1^5 (%i7) ratsimp(%); (%o7) e1^5 Jean > -s > On Sun, Apr 15, 2012 at 15:08, Jean Vittor > wrote: > [...] From yasuaki.honda at gmail.com Mon Apr 16 11:34:45 2012 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Tue, 17 Apr 2012 01:34:45 +0900 Subject: [Maxima] expintegral_ei() bug on convergence In-Reply-To: <4F812ED9.5030304@gmail.com> References: <4F812ED9.5030304@gmail.com> Message-ID: Hi all, I have created a patch for expintegral.lisp for improving the behavior of expintegral-e(n,z) when imagpart(z) is negative. Basically it adds additional region where the continued fraction is used rather than power series. The same modification is made on bfloat-expintegral-e(n,z). The patch passes all the existing test as well as newly added 20 tests in the rtest_expintegral.mac. Also, 'make check' is performed to ensure that all the tests are OK. So, if everyone is OK with these changes, I will submit it to the git server. Thanks in advance for your comments!! Yasuaki Honda, Chiba, Japan % git diff expintegral.lisp diff --git a/src/expintegral.lisp b/src/expintegral.lisp index 6bf7d82..f25866f 100644 --- a/src/expintegral.lisp +++ b/src/expintegral.lisp @@ -531,7 +531,8 @@ (format t "~& : z = ~A~%" z)) (cond - ((and (>= (realpart z) 0) (> (abs z) 1.0)) + ((or (and (> (abs z) 2) (< (abs (phase z)) (* pi 0.9))) + (and (>= (realpart z) 0) (> (abs z) 1.0))) ;; We expand in continued fractions. (when *debug-expintegral* (format t "~&We expand in continued fractions.~%")) @@ -689,17 +690,17 @@ (*expint-maxit* 5000) ; arbitrarily chosen, we need a better choice (bigfloattwo (add bigfloatone bigfloatone)) (bigfloat%e ($bfloat '$%e)) - (bigfloat%gamma ($bfloat '$%gamma))) + (bigfloat%gamma ($bfloat '$%gamma)) + (flz (complex ($float ($realpart z)) ($float ($imagpart z))))) (when *debug-expintegral* (format t "~&BFLOAT-EXPINTEGRAL-E called with:~%") (format t "~& : n = ~A~%" n) - (format t "~& : z = ~A~%" z)) + (format t "~& : z = ~A~%" flz)) (cond - ((and (or (eq ($sign ($realpart z)) '$pos) - (eq ($sign ($realpart z)) '$zero)) - (eq ($sign (sub (cabs z) bigfloatone)) '$pos)) + ((or (and (> (abs flz) 2) (< (abs (phase flz)) (* pi 0.9))) + (and (>= (realpart flz) 0) (> (abs flz) 1.0))) ;; We expand in continued fractions. (when *debug-expintegral* (format t "~&We expand in continued fractions.~%")) 2012?4?8?15:23 Raymond Toy : > On 4/7/12 9:20 PM, ???? wrote: > > Hi Raymond san, > > > > > Yes, this was basically what I had in mind, except the condition > > would have been abs(z) > 1 and, > > > maybe, abs(phase(z)) < 3.1, so that we stay away from the negative > axis. > > > > The condition (and (> (abs z) 1) (< (abs (phase z)) (* pi 0.99))) did > > not pass the rtest_expintegral. The condition that passes the > > rtest_expintegral is: > > (and (> (abs z) 2) (< (abs (phase z)) (* pi 0.9))) > How does rtest_expintegral fail for the first case? Accuracy reduced? > > > > If you think this is OK, then I will modify bfloat and frac versions > > of expintegral-e() in a same manner and create a patch for everyone's > > review. > If you think this is the right solution, I think you should just go > ahead. If there's a problem we'll find it. :-) And for those that are > interested, I'm sure they'll look at your patch. > > > > For the z on the negative real axis, I don't know the correct behavior > > of the expintegral_e(). Just I experimented with couple of z values > > such as z=-100, z=-200, z=-300 with expintegral_e(1, z) in Maxima and > > e1(z) in mpmath in Python. They coincide with each other. > Sorry about that. I was just thinking that evaluating the power series > with terms like 200^k would not converge very well, but I didn't check. > And the values are reasonably close to the asymptotic value of > exp(-z)/z, so it looks good. Might be good to add a few test cases for z > = -100 and -200. > > Ray > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Mon Apr 16 13:32:54 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 16 Apr 2012 11:32:54 -0700 Subject: [Maxima] expintegral_ei() bug on convergence In-Reply-To: References: <4F812ED9.5030304@gmail.com> Message-ID: 2012/4/16 ???? > > So, if everyone is OK with these changes, I will submit it to the git > server. > I'm happy with these changes but I have a few minor questions. > > (cond > - ((and (>= (realpart z) 0) (> (abs z) 1.0)) > + ((or (and (> (abs z) 2) (< (abs (phase z)) (* pi 0.9))) > + (and (>= (realpart z) 0) (> (abs z) 1.0))) > These conditions seem a little strange. So basically the boundary of the region looks like a semicircle of radius 1 for the right half-plane and a semicircle of radius 2 for the left half-plane with a sector taken out near the negative real axis. Why the discontinuity on the imaginary axis? Why a radius of 2? Does this improve accuracy? (It might be useful to add a comment that pi*.9 is needed to pass the testsuite. Values bigger than .9 (roughly) cause tests to fail, right? Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeromehuck at orange.fr Mon Apr 16 08:35:08 2012 From: jeromehuck at orange.fr (Jerome Huck) Date: Mon, 16 Apr 2012 15:35:08 +0200 Subject: [Maxima] Maxima version 5.27 Message-ID: <4F8C200C.6040605@orange.fr> from Jerome Huck Can we hope to have a 5.27 version of Maxima soon ? Linux version 5.27 was available nearly two wekks ago. Thanks in advance. Best regards. Jerome Huck. From toy.raymond at gmail.com Mon Apr 16 16:47:17 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 16 Apr 2012 14:47:17 -0700 Subject: [Maxima] Maxima version 5.27 In-Reply-To: <4F8C200C.6040605@orange.fr> References: <4F8C200C.6040605@orange.fr> Message-ID: On Mon, Apr 16, 2012 at 6:35 AM, Jerome Huck wrote: > from Jerome Huck > > Can we hope to have a 5.27 version of Maxima soon ? Linux version 5.27 > was available nearly two wekks ago. > > What version are you looking for? You didn't say, except 5.27. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From yasuaki.honda at gmail.com Tue Apr 17 08:13:03 2012 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Tue, 17 Apr 2012 22:13:03 +0900 Subject: [Maxima] expintegral_ei() bug on convergence In-Reply-To: References: <4F812ED9.5030304@gmail.com> Message-ID: Dear Ray san, Thanks for your questions. I will anser them inline below. 2012/04/17 3:32 "Raymond Toy" : > > > > 2012/4/16 ???? >> >> >> So, if everyone is OK with these changes, I will submit it to the git server. > > > I'm happy with these changes but I have a few minor questions. > >> >> >> (cond >> - ((and (>= (realpart z) 0) (> (abs z) 1.0)) >> + ((or (and (> (abs z) 2) (< (abs (phase z)) (* pi 0.9))) >> + (and (>= (realpart z) 0) (> (abs z) 1.0))) > > > These conditions seem a little strange. So basically the boundary of the region looks like a semicircle of radius 1 for the right half-plane and a semicircle of radius 2 for the left half-plane with a sector taken out near the negative real axis. > > Why the discontinuity on the imaginary axis? Why a radius of 2? Does this improve accuracy? There is a point between the radius 1 and 2 simicircles in left half plane where continued fraction expansion does not converge. So, I picked up a larger radius. I have not investigated the cf-expansion's convergence region in detail. > > (It might be useful to add a comment that pi*.9 is needed to pass the testsuite. Values bigger than .9 (roughly) cause tests to fail, right? That is right. There may be some room (0.01 or 0.02) for improvement, though. > > Ray > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Apr 17 11:11:19 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 17 Apr 2012 09:11:19 -0700 Subject: [Maxima] expintegral_ei() bug on convergence In-Reply-To: References: <4F812ED9.5030304@gmail.com> Message-ID: 2012/4/17 ???? > Dear Ray san, > > Thanks for your questions. I will anser them inline below. > > 2012/04/17 3:32 "Raymond Toy" : > > > > > > > > > 2012/4/16 ???? > >> > >> > >> So, if everyone is OK with these changes, I will submit it to the git > server. > > > > > > I'm happy with these changes but I have a few minor questions. > > > >> > >> > >> (cond > >> - ((and (>= (realpart z) 0) (> (abs z) 1.0)) > >> + ((or (and (> (abs z) 2) (< (abs (phase z)) (* pi 0.9))) > >> + (and (>= (realpart z) 0) (> (abs z) 1.0))) > > > > > > These conditions seem a little strange. So basically the boundary of the > region looks like a semicircle of radius 1 for the right half-plane and a > semicircle of radius 2 for the left half-plane with a sector taken out near > the negative real axis. > > > > Why the discontinuity on the imaginary axis? Why a radius of 2? Does > this improve accuracy? > > There is a point between the radius 1 and 2 simicircles in left half plane > where continued fraction expansion does not converge. So, I picked up a > larger radius. I have not investigated the cf-expansion's convergence > region in detail. > > Do you have an example where the continued fraction does not converge? I looked at A&S 5.1.22 for the continued fraction and it says it converges for |arg(z)| 1 and |arg(z)| < .9*pi. > > > (It might be useful to add a comment that pi*.9 is needed to pass the > testsuite. Values bigger than .9 (roughly) cause tests to fail, right? > > That is right. There may be some room (0.01 or 0.02) for improvement, > though. > > 0.9 is good enough for me. I don't think we need to refine this, unless we find a case where the series gives the wrong value but the continued fraction does not. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Tue Apr 17 16:45:16 2012 From: woollett at charter.net (Edwin Woollett) Date: Tue, 17 Apr 2012 14:45:16 -0700 Subject: [Maxima] mydefint2 Message-ID: <406D4A7CC1414A19A60E390C3DE14571@edwinc367e16bd> On April 14, 2012, Barton Willis wrote: ----------------------- >bug? > > (%i26) mydefint2(1,[y,-x,x],[x,-1,1]); > (%o26) res79 > I have provided for such a user error in the new version. >Also > > separate(l,x) := map('listify, partition_set(setify(l), lambda([s], > freeof(x,s)))) > > might useful--I think your use of length causes trouble: > > (%i28) separate([x,y],x); > length: argument cannot be a symbol; found x --------------------------------- The purpose of the function separate was not well described. It's use is to filter the existing list facts(), each element of which will (probably?) have the form x < a, or x > 0, or a < b, for example. I want to ignore elements like aThe integrand (first argument to mydefin1) is automatically simplified in >the current context; thus > > (%i2) (assume(x < 0), mydefint1(abs(x),x,0,1)); > (%o2) -1/2 > >No amount of quoting changes this. If this bothers you > (first simplify in global context and second in the >context defined by the definite integral), you could specify >the integrand as a lambda form, or you could write >your code in Common Lisp as a defmspec function. --------------------------------------- I agree that I need to write mydefint1 and mydefint2 as defmspec lisp functions. The present version (which assumes facts() has no elements involving x, as described above in more detail) has been modularized to cover two different cases. If the outer integral limits involve unbound parameters, the code makes assumptions and informs the user. This looks clunky, but this code is not being developed as a standalone utility, but rather is intended to only be called by the "nintegrate" utility I have been calling nint, which is designed to produce a floating point number, and hence the outer integral limits will always be bound to numbers. There are numerical integrals which quadpack cannot do, but integrate can do, so unless there are other problems such as multivalued expressions, etc., it is useful to first try integrate and see if it succeeds. In so doing, I want to minimize the number of variable questions which can easily be answered by looking at the limits requested. The present version of mydefint2 then produces: ----------------------------------- (%i1) load(mydefint); (%o1) "c:/work2/mydefint.mac" (%i2) mydefint2(1,[x,0,1],[y,0,1]); (%o2) 1 (%i3) mydefint2(1,[x,0,a],[y,0,b]); Since the outer integral limits involve unbound parameter(s), the code assumes that 0 <= x <= a (%o3) a*b (%i4) mydefint2(x*y,[x,0,1],[y,0,1]); (%o4) 1/4 (%i5) mydefint2 (log(x+y),[x,0,1],[y,0,1]); (%o5) (4*log(2)-3)/2 (%i6) mydefint2 (1/sqrt(x+y),[x,0,1],[y,0,1]); (%o6) (2^(7/2)-8)/3 (%i7) mydefint2(sqrt(x^2 - 2*x*y + y^2),[x,-1,1],[y,-1,1]); (%o7) 8/3 (%i8) mydefint2(sqrt(x^2 - 2*x*y + y^2),[x,-1,1],[y,-x,x]); (%o8) 0 (%i9) mydefint2(1,[x,-y,y],[y,-1,1]); the outer integral limits should not depend on your chosen inner integral variable of integration (%o9) false ------------------------------------- and the present code is: ---------------------------------------- /* mydefint.mac */ /* future work load("c:/work2/mydefint.lisp")$ */ /* separate(aL,x) returns a list of the elements of aL which involve x . to do: need to design a filter which looks for symbolic limits like x < a and ignores them separate(a11L,xx11) := block ( [t11,t11L:[]], for t11 in a11L do if (part (t11,1) = xx11 or part (t11,2) = xx11) then t11L : cons (t11,t11L), t11L)$ */ /* mydefint1 is only reliable if facts() = [] or if facts() has no entries involving the variable of integration . to do: write as a defmspec lisp function. */ mydefint1 (e78, x78, a78, b78) := block( [domain : complex, res1, loc_assume,e781], loc_assume : apply ('assume, [x78 > min(a78,b78), x78 < max(a78,b78)] ), e781 : expand (e78,0,0), res1 : ratsimp (integrate (e781, x78, a78, b78 ) ), apply ('forget, loc_assume), res1)$ /* mydefint2_symb_lim makes assumptions about ordering of outer integral variable x relative to x2 and x1 if qxL = [x,x1,x2], say, and informs user. This code is only reliable if global facts() = [] or entries don't involve qxL[1]. Calls mydefint1. to do: write as a defmspec lisp function. */ mydefint2_symb_lim(qe,qxL,qyL) := block ( [locx_assume,qe79,res79], /* this is the case in which the outer integral limits involve unbound parameters */ print (" Since the outer integral limits involve unbound parameter(s), the code assumes that ",qxL[2]," <= ",qxL[1]," <= ",qxL[3]), locx_assume : apply ('assume, [qxL[1] > qxL[2], qxL[1] < qxL[3]] ), qe79 : expand (qe,0,0), res79 : apply ('integrate, flatten ( [apply ('mydefint1,flatten ( [qe79,qyL])), qxL])), apply ('forget, locx_assume), ratsimp (res79))$ /* mydefint2_numer_lim is only reliable if global facts() = [] or entries don't involve qxL[1]. Calls mydefint1. to do: write as a defmspec lisp function. */ mydefint2_numer_lim (qe,qxL,qyL) := block ( [locx_assume, qe79, qxmin,qxmax,res79,res791,res792,xsign], /* this is the case in which the outer integral limits are numbers, or involve %pi or %e etc which will reduce to numbers when they appear as args of min and max and compared to each other or to numbers : (%i18) max(1,%pi); (%o18) %pi */ qxmin : min (qxL[2], qxL[3]), qxmax : max (qxL[2], qxL[3]), if qxmin = qxL[3] then xsign : -1 else xsign : 1, /* case x doesn't change sign */ if (qxmin >= 0 or qxmax <= 0) then (locx_assume : apply ('assume, [qxL[1] > qxmin, qxL[1] < qxmax] ), qe79 : expand (qe,0,0), res79 : apply ('integrate, [apply ('mydefint1,flatten ( [qe79,qyL])), qxL[1], qxmin, qxmax]), res79 : xsign*ratsimp (res79), apply ('forget, locx_assume)) else /* case x does change sign: split into two integrals */ ( locx_assume : apply ('assume, [qxL[1] > qxmin,qxL[1] < 0] ), qe79 : expand (qe,0,0), res791 : apply ('integrate, [apply ('mydefint1, flatten ([qe79,qyL])),qxL[1],qxmin,0]), apply ('forget, locx_assume), locx_assume : apply ('assume, [qxL[1] > 0,qxL[1] < qxmax] ), qe79 : expand (qe,0,0), res792 : apply ('integrate, [apply ('mydefint1,flatten ([qe79,qyL])),qxL[1],0,qxmax]), res79 : xsign*ratsimp (res791 + res792), apply ('forget,locx_assume)), res79)$ /** mydefint2 is only reliable if global facts() = [] or entries don't involve qxL[1]. Calls either mydefint2_numer_lim or mydefint2_symb_lim. to do: write as a defmspec lisp function. */ mydefint2 (pqe,pqxL,pqyL) := block ( if member (pqyL[1], listofvars(pqxL)) then (print ("the outer integral limits should not depend on your chosen inner integral variable of integration"), return (false)), if member (false, map ('numberp,float (rest (pqxL)))) then mydefint2_symb_lim (pqe,pqxL,pqyL) else mydefint2_numer_lim (pqe,pqxL,pqyL))$ display2d:false$ ratprint:false$ --------------------------------------- Ted From woollett at charter.net Tue Apr 17 18:35:02 2012 From: woollett at charter.net (Edwin Woollett) Date: Tue, 17 Apr 2012 16:35:02 -0700 Subject: [Maxima] minimal maxima function def to use mfuncall? Message-ID: <44594051BC5440CE9E38218F26A64177@edwinc367e16bd> What is the minimum amount of preparation one must do in defining a maxima function using := to be able to use it with mfuncall? --------------------------- (%i1) :lisp (mfuncall '$sin '1.570796) 0.9999999999999466 (%i1) f(x) := x^2$ (%i2) :lisp (mfuncall 'f '3) ((F SIMP) 3) (%i2) -------------------------- Ted Woollett From woollett at charter.net Tue Apr 17 18:53:01 2012 From: woollett at charter.net (Edwin Woollett) Date: Tue, 17 Apr 2012 16:53:01 -0700 Subject: [Maxima] minimal maxima function def to use mfuncall? Message-ID: <19ED3D0136E242AEB43129BC48E81B75@edwinc367e16bd> On Apr. 17, 2012, I wrote: ------------------ What is the minimum amount of preparation one must do in defining a maxima function using := to be able to use it with mfuncall? ----------------------- dumb mistake: left out dollar sign ($) ------------ (%i1) f(x):=x^2$ (%i2) :lisp (mfuncall '$f '3) 9 (%i2) ------------ sorry for the noise Ted From rswarbrick at gmail.com Tue Apr 17 18:49:54 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Wed, 18 Apr 2012 00:49:54 +0100 Subject: [Maxima] minimal maxima function def to use mfuncall? References: <44594051BC5440CE9E38218F26A64177@edwinc367e16bd> Message-ID: <56c169xo36.ln2@hake.rswarbrick.dnsalias.com> "Edwin Woollett" writes: > What is the minimum amount of preparation one > must do in defining a maxima function using := > to be able to use it with mfuncall? > --------------------------- > (%i1) :lisp (mfuncall '$sin '1.570796) > 0.9999999999999466 > > (%i1) f(x) := x^2$ > > (%i2) :lisp (mfuncall 'f '3) > ((F SIMP) 3) > > (%i2) -------------------------- > Ted Woollett Just one more character :-) Maxima 5.26.0_43_gc6e4bdc_dirty http://maxima.sourceforge.net using Lisp SBCL 1.0.56.0.debian Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) f(x) := x^2; 2 (%o1) f(x) := x (%i2) :lisp (mfuncall '$f 3) 9 (%i2) (And note that you don't need to quote the three) Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From robert.l.maynard at gmail.com Tue Apr 17 23:37:55 2012 From: robert.l.maynard at gmail.com (Robert Maynard) Date: Tue, 17 Apr 2012 23:37:55 -0500 Subject: [Maxima] Parallel Applications Message-ID: Is maxima currently compatible with parallel computation resources? My primary interest is the CUDA platform, but I'm sure that full cluster compatibility would be of interest to some as well. I understand that the question may have more to do with which distribution of lisp is being run as well - any insight into this would be quite helpful. Thanks, Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From volkervannek at googlemail.com Wed Apr 18 04:03:06 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Wed, 18 Apr 2012 11:03:06 +0200 Subject: [Maxima] Maxima 5.27.0 tagged in Git & posted to SF In-Reply-To: References: Message-ID: Thanks for posting that 5.27 is available separate from sourceforge. I googled a little bit and found ftp://ftp.pbone.net/mirror/ftp.sourceforge.net/pub/sourceforge/m/ma/maxima/Maxima-source/5.27.0-source/maxima-5.27.0-1.centos4.src.rpm which contains maxima-5.27.0.tar.gz In addition I found 5.27.0-deb-files in debian sid and installed all of them on my Ubuntu. The debian version is precompiled with gcl and the testsuite runs without error, info and html doc seem to work. Volker van Nek 2012/4/5 Andrey G. Grozin > maxima-5.27.0 is in Gentoo. Testsuite full times on my 32-bit x86 box > (seconds) and failed tests are: > > sbcl-1.0.55 166 > cmucl-20c 181 > gcl-2.6.8_pre 184 > clozurecl-1.8 253 rtest15 (37, 193, 196) > ecl-12.2.1 345 rtest8.mac (126, 127) > clisp-2.49 569 > > Details of failed tests: > > clozurecl: > ------------------------------**------------------------------**---- > ********************** Problem 37 *************** > Input: > 2 2 - %pi > sin (3 a) sin (----- + a + b) > 3 > (----------------------------- > 2 %pi > sin (a - ---) > 3 > - %pi > 2 sin(a) sin(3 a) cos(b) sin(----- + a + b) sin(3 a + 3 b) > 3 > - ------------------------------**---------------------------- > %pi > sin(a - ---) sin(a + b) > 3 > 2 2 > sin (a) sin (3 a + 3 b) > + -----------------------, result : trigrat(%%), > 2 > sin (a + b) > expected : (- (- 9 + 10 cos(2 a) - 2 sqrt(3) sin(2 a) - cos(4 a) > + sqrt(3) sin(4 a) + 10 cos(2 b) - 2 sqrt(3) sin(2 b) - cos(4 b) > + sqrt(3) sin(4 b) - 4 cos(2 b - 2 a) - 8 cos(2 a + 2 b) > + 4 sqrt(3) sin(2 a + 2 b) + 2 cos(4 a + 2 b) - 2 sqrt(3) sin(4 a + 2 b) > + 2 cos(2 a + 4 b) - 2 sqrt(3) sin(2 a + 4 b) - cos(4 a + 4 b) > + sqrt(3) sin(4 a + 4 b)))/4, ratsimp(result - expected)) > > > Result: > Polynomial quotient is not exact > error-catch > > This differed from the expected result: > 0 > > ********************** Problem 193 *************** > Input: > 2 > t log(t) > integrate(-----------------, t, 0, 1) > 2 4 > (t - 1) (1 + t ) > > > Result: > 2 > (sqrt(2) - 2) %pi > - ------------------ > 32 > > This differed from the expected result: > 2 > (sqrt(2) - 1) %pi > ------------------ > 9/2 > 2 > > ********************** Problem 196 *************** > Input: > 1 > factor(expand(sqrtdenest(**integrate(------------, x, 0, 1)))) > 1 4 > - + (x - 3) > 2 > 3/4 9/4 > 73 + sqrt(2) + 2 - 3 2 > - factor((- (- log(--------------------------**--) > 33 > 3/4 9/4 3/4 5/2 13/4 > 73 + sqrt(2) - 2 + 3 2 - 2 + 2 - 2 > + log(--------------------------**--) + 2 atan(---------------------) > 33 3/4 13/4 > 98 + 2 - 2 > 3/4 5/2 13/4 > 2 + 2 + 2 7/4 > + 2 atan(-------------------)))/2 ) > 3/4 13/4 > - 98 + 2 - 2 > > > Result: > 13/4 5/2 3/4 13/4 5/2 3/4 > 2 + 2 + 2 - 2 + 2 - 2 > (2 atan(-------------------) + 2 atan(---------------------) > 13/4 3/4 13/4 3/4 > - 2 + 2 - 98 - 2 + 2 + 98 > 9/4 3/4 9/4 3/4 > 3 2 - 2 + sqrt(2) + 73 - 3 2 + 2 + sqrt(2) + 73 > + log(--------------------------**--) - log(--------------------------** > ----)) > 33 33 > 9/4 3/4 > 7/4 3 2 - 2 + sqrt(2) + 73 > /2 - (log(-------------------------**---) > 33 > 9/4 3/4 > - 3 2 + 2 + sqrt(2) + 73 > - log(--------------------------**----) - 2 > 33 > 3/4 1/4 > 79 2 + 365 sqrt(2) + 877 2 + 5 > atan(-------------------------**-----------) > 10657 > 3/4 1/4 > - 79 2 + 365 sqrt(2) - 877 2 + 5 7/4 > + 2 atan(-------------------------**-------------))/2 > 10657 > > This differed from the expected result: > 0 > ------------------------------**------------------------------**---- > > ecl: > ------------------------------**------------------------------**---- > ********************** Problem 126 *************** > Input: > 1 2 > (f : diff(----------------, a), g : quad_qags(f b (1 - b) , b, 0, 1) , > 2 1 > (a - b) + 1 + 1 > find_root(g = 0, a, 0, > 1)) > > > Result: > 2 > 2 (1 - b) (a - b) b > find_root(subscript(quad_qags(**- --------------------, b, 0, 1, epsrel = > 1.e-8, > 2 2 > ((a - b) + 2) > epsabs = 0.0, limit = 200), 1) = 0, a, .3980373668760611, > 0.375) > > This differed from the expected result: > .3978613590133817 > > ********************** Problem 127 *************** > Input: > 1 2 > (f : diff(----------------, a), g : quad_qags(f b (1 - b) , b, 0, 1) , > 2 1 > (a - b) + 1 + 1 > find_root(g = 0, a, 0, > 1)) > > > Result: > 2 > 2 (1 - b) (a - b) b > find_root(quad_qags(- --------------------, b, 0, 1) = 0, a, > 2 2 > ((a - b) + 2) > 1 > .3980373668760611, > 0.375) > > This differed from the expected result: > .3978613590133817 > ------------------------------**------------------------------**---- > > Andrey > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Wed Apr 18 05:39:14 2012 From: willisb at unk.edu (Barton Willis) Date: Wed, 18 Apr 2012 10:39:14 +0000 Subject: [Maxima] using infix --> to define a lambda form Message-ID: <83FD4DC40F97654495E2C9AED476583604202CFE@BL2PRD0710MB361.namprd07.prod.outlook.com> By the way: (not sure about lbp & rbp) (%i20) infix("-->",90,90)$ (%i21) assume(x < 0)$ (%i22) f : x --> abs(x); (%o22) lambda([x],abs(x)) (%i23) f : [] --> %pi; (%o23) lambda([],%pi) (%i24) f : [x,y] --> x+y; (%o24) lambda([x,y],x+y) (%i30) f : [x,y] --> -x; (%o30) lambda([x,y],-x) (defmspec $--> (l) (let* ((op (car (pop l))) (x (if l (pop l) (wna-err op))) (e (if l (pop l) (wna-err op)))) (if l (wna-err op)) (take '(lambda) (if ($listp x) x (take '(mlist) x)) e))) --bw From sarapashm at googlemail.com Wed Apr 18 06:30:21 2012 From: sarapashm at googlemail.com (Sara Pashmin) Date: Wed, 18 Apr 2012 13:30:21 +0200 Subject: [Maxima] wrong result from function solve Message-ID: Hello, I wanted to solve 3 equations, which are equal to each other: kill(all); z:0.01; ratprint:false; eq1:(2.15-x)*(y-x)-((y-x)^2/2)$ eq2:(2.2-y)*(z-y)-((z-y)^2/2)$ eq3:2.15*x-(x^2/2)$ solve([ eq1=eq3 , eq2= eq3 , t=eq3], [x,y,t]),numer; The answer is: [[x=4.330183106910809,y=4.359953703703703,t=-.06534923339011925],[x=4.29664660361135,y=.006712608473711077,t=.007204789943107004],[x=- .03018312788515193,y=4.359953703703703,t=-.06534923339011925],[x=.003353680604145053,y=.006712608473711077,t=.007204789943107004]] I checked two terms of results but unfortunately the answers of equations are not the same that means the equations are not equal to each other: x:.003353680604145053 ; y:.006712608473711077 ; t:.007204789943107004 ; eq1=(2.15-x)*(y-x)-((y-x)^2/2); eq2=(2.2-y)*(z-y)-((z-y)^2/2); T=2.15*x-(x^2/2); (%o11) (2.15-x)*(y-x)-(y-x)^2/2=.007204788950103592 (%o12) (0.01-y)*(2.2-y)-(0.01-y)^2/2=.007204790914096299 (%o13) 2.15*x-x^2/2=.007204789712114554 x:4.29664660361135; y:.006712608473711077; t:.007204789943107004; eq1=(2.15-x)*(y-x)-((y-x)^2/2); eq2=(2.2-y)*(z-y)-((z-y)^2/2); T=2.15*x-(x^2/2); (%o17) (2.15-x)*(y-x)-(y-x)^2/2=.007205399060291384 (%o18) (0.01-y)*(2.2-y)-(0.01-y)^2/2=.007204790914096299 (%o19) 2.15*x-x^2/2=.007204179601927763 What could be the problem of this solving? Thanks and best regards Sara From robert.dodier at gmail.com Wed Apr 18 07:00:44 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 18 Apr 2012 12:00:44 +0000 (UTC) Subject: [Maxima] simplification References: <83FD4DC40F97654495E2C9AED4765836041F381C@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F884959.206@eecs.berkeley.edu> Message-ID: Hi Jean, thanks for your interest in Maxima. On 2012-04-16, Jean Vittor wrote: > (%i1) matchdeclare(e, lambda([e],equal(abs(e), 1))); I guess to be pedantic we should narrow this to +1 or -1. (the rule won't apply if imaginary part != 0, right?) > (%i2) matchdeclare(n, integer); Unfortunately to specify that n is an integer is a little clumsy. Maxima's integerp isn't enough either (it only detects literal integers). Also I think we need to specify that n isn't in {0, 1}, otherwise we'll get an infinite loop in the rule. Here is an example which seems to work OK. matchdeclare (ee, lambda ([e], featurep (e, integer) and equal (abs (e), 1))); matchdeclare (nn, lambda ([e], featurep (e, integer) and e > 1)); tellsimp (ee^nn, ee^(mod (nn, 2))); declare (e1, integer); assume (equal (abs (e1), 1)); Then e1^17; => e1 e1^16; => 1 declare (m, integer); e1^m; => e1^m assume (m > 1); e1^m; => e1^(mod(m, 2)) Oops, I put e > 1 in the matchdeclare for nn -- that's not equivalent to e not in {0, 1} if e is negative. Rats. HTH Robert Dodier From villate at fe.up.pt Wed Apr 18 08:27:07 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 18 Apr 2012 14:27:07 +0100 Subject: [Maxima] wrong result from function solve In-Reply-To: References: Message-ID: <4F8EC12B.3040505@fe.up.pt> On 04/18/2012 12:30 PM, Sara Pashmin wrote: > I waned to solve 3 equations, which are equal to each other: > > kill(all); > z:0.01; > ratprint:false; > eq1:(2.15-x)*(y-x)-((y-x)^2/2)$ > eq2:(2.2-y)*(z-y)-((z-y)^2/2)$ > eq3:2.15*x-(x^2/2)$ eq1, eq2 and eq3 are not equations, but expressions. > solve([ > eq1=eq3 , > eq2= eq3 , > t=eq3], > [x,y,t]),numer; > > The answer is: > [[x=4.330183106910809,y=4.359953703703703,t=-.06534923339011925],[x=4.29664660361135,y=.006712608473711077,t=.007204789943107004],[x=- > .03018312788515193,y=4.359953703703703,t=-.06534923339011925],[x=.003353680604145053,y=.006712608473711077,t=.007204789943107004]] > > I checked two terms of results but unfortunately the answers of > equations are not the same that means the equations are not equal to > each other: > > > x:.003353680604145053 ; > y:.006712608473711077 ; > t:.007204789943107004 ; > eq1=(2.15-x)*(y-x)-((y-x)^2/2); > eq2=(2.2-y)*(z-y)-((z-y)^2/2); > T=2.15*x-(x^2/2); > > (%o11) (2.15-x)*(y-x)-(y-x)^2/2=.007204788950103592 > (%o12) (0.01-y)*(2.2-y)-(0.01-y)^2/2=.007204790914096299 > (%o13) 2.15*x-x^2/2=.007204789712114554 The answer is OK, up to 7 decimal places. A numerical result has always an error. The moment you wrote 0.01, 2.2 and 2.15 in your definition of the expressions, you already introduced numerical errors, because those numbers can not be represented exactly in a binary system. You could have written those number in exact form: 1/100, 22/10 and 215/100 but in this example solve is not able to find an exact solution and it will use floating point anyway. Writing those three numbers in "big float notation": 1b-2, 2.2b0, 2.15b0 give higher accuracy, but apparently solve always uses single floating-point precision regardless of the equations. Perhaps there is a way to force solve to use big floating-point precision, but I'm not aware of it. Some comments: if you save the solutions into a variable, it will then be easier to check the results, without having to write again the equations or the results: (%o23) [[x = 4.330183106910809, y = 4.359953703703703, t = - .06534923339011925], [x = 4.29664660361135, y = .006712608473711077, t = .007204789943107004], [x = - .03018312788515193, y = 4.359953703703703, t = - .06534923339011925], [x = .003353680604145053, y = .006712608473711077, t = .007204789943107004]] (%i24) eq1,sol[4]; (%o24) .007204788950103593 (%i25) eq2,sol[4]; (%o25) .007204790914096299 (%i26) eq3,sol[4]; (%o26) .007204789712114554 Regards, Jaime From villate at fe.up.pt Wed Apr 18 08:43:45 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 18 Apr 2012 14:43:45 +0100 Subject: [Maxima] wrong result from function solve In-Reply-To: <4F8EC12B.3040505@fe.up.pt> References: <4F8EC12B.3040505@fe.up.pt> Message-ID: <4F8EC511.4090003@fe.up.pt> On 04/18/2012 02:27 PM, Jaime Villate wrote: > Some comments: > if you save the solutions into a variable, it will then be easier to > check the results, without having to write > again the equations or the results: > > (%o23) [[x = 4.330183106910809, y = 4.359953703703703, > t = - .06534923339011925], [x = 4.29664660361135, > y = .006712608473711077, t = .007204789943107004], > [x = - .03018312788515193, y = 4.359953703703703, > t = - .06534923339011925], [x = .003353680604145053, > y = .006712608473711077, t = .007204789943107004]] Sorry, I forgot to paste (%i23) which was the following: (%i23) sol: ev (solve([eq1=eq3,eq2= eq3,t=eq3],[x,y,t]), numer); > > (%i24) eq1,sol[4]; > (%o24) .007204788950103593 > > (%i25) eq2,sol[4]; > (%o25) .007204790914096299 > > (%i26) eq3,sol[4]; > (%o26) .007204789712114554 > Regards, Jaime From arawak1 at yahoo.com Wed Apr 18 08:51:13 2012 From: arawak1 at yahoo.com (raf .) Date: Wed, 18 Apr 2012 06:51:13 -0700 (PDT) Subject: [Maxima] (no subject) Message-ID: <1334757073.44897.YahooMailNeo@web121602.mail.ne1.yahoo.com> Please remove from mailing list. Thank You! -------------- next part -------------- An HTML attachment was scrubbed... URL: From jean.vittor at free.fr Wed Apr 18 11:04:22 2012 From: jean.vittor at free.fr (Jean Vittor) Date: Wed, 18 Apr 2012 18:04:22 +0200 Subject: [Maxima] simplification In-Reply-To: References: <83FD4DC40F97654495E2C9AED4765836041F381C@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F884959.206@eecs.berkeley.edu> Message-ID: Thanks very much ! Now my expressions get simplified with the following rules (in case someone's interested). matchdeclare (ee, lambda ([e], featurep (e, integer) and equal (abs (e), 1))); tellsimp(1/ee, ee); matchdeclare (nn, lambda ([e], featurep (e, integer) and not(elementp(e, {0,1})))); tellsimp (ee^nn, ee^(mod (nn, 2))); matchdeclare([xx, yy, zz], lambda([e], featurep(e, real))); tellsimpafter(sin(ee*xx), ee*sin(xx)); tellsimpafter(sin(xx*ee), ee*sin(xx)); tellsimpafter(sin(xx*ee*yy), ee*sin(xx*yy)); tellsimpafter(sin((xx*ee*zz)/yy), ee*sin(xx*zz/yy)); tellsimpafter(cos(ee*xx), cos(xx)); tellsimpafter(cos(xx*ee), cos(xx)); tellsimpafter(cos(xx*ee*yy), cos(xx*yy)); tellsimpafter(cos((xx*ee)/yy), cos(xx/yy)); tellsimpafter(cos((xx*ee*zz)/yy), cos(xx*zz/yy)); Jean Le 18/04/2012 14:00, Robert Dodier a ?crit : > [...] From yasuaki.honda at gmail.com Wed Apr 18 12:02:21 2012 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Thu, 19 Apr 2012 02:02:21 +0900 Subject: [Maxima] expintegral_ei() bug on convergence In-Reply-To: References: <4F812ED9.5030304@gmail.com> Message-ID: Hi Ray san, > Why the discontinuity on the imaginary axis? Why a radius of 2? Does this improve accuracy? > There is a point between the radius 1 and 2 simicircles in left half plane >> where continued fraction expansion does not converge. So, I picked up a >> larger radius. I have not investigated the cf-expansion's convergence >> region in detail. >> >> Do you have an example where the continued fraction does not converge? I > looked at A&S 5.1.22 for the continued fraction and it says it converges > for |arg(z)| 1 > and |arg(z)| < .9*pi. > That was my original thought, too. However, expintegral_e(1,-1.700598-0.612828*%i); will not converge if you use continued fraction expansion. Here is the error message: (%i7) expintegral_e(1,-1.700598-0.612828*%i); expintegral_e: continued fractions failed.#C(-1.700598 -0.612828) -- an error. To debug this try: debugmode(true); Note that abs(-1.700598-0.612828*%i) is around 1.8 . Thanks and best regards, Yasuaki Honda, Chiba, Japan > > > >> > (It might be useful to add a comment that pi*.9 is needed to pass the >> testsuite. Values bigger than .9 (roughly) cause tests to fail, right? >> >> That is right. There may be some room (0.01 or 0.02) for improvement, >> though. >> >> > 0.9 is good enough for me. I don't think we need to refine this, unless > we find a case where the series gives the wrong value but the continued > fraction does not. > > Ray > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Wed Apr 18 13:04:49 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 18 Apr 2012 11:04:49 -0700 Subject: [Maxima] expintegral_ei() bug on convergence In-Reply-To: References: <4F812ED9.5030304@gmail.com> Message-ID: 2012/4/18 ???? > Hi Ray san, > > > > Why the discontinuity on the imaginary axis? Why a radius of 2? Does > this improve accuracy? > >> There is a point between the radius 1 and 2 simicircles in left half >>> plane where continued fraction expansion does not converge. So, I picked up >>> a larger radius. I have not investigated the cf-expansion's convergence >>> region in detail. >>> >>> Do you have an example where the continued fraction does not converge? >> I looked at A&S 5.1.22 for the continued fraction and it says it converges >> for |arg(z)| 1 >> and |arg(z)| < .9*pi. >> > > That was my original thought, too. However, > expintegral_e(1,-1.700598-0.612828*%i); will not converge if you use > continued fraction expansion. Here is the error message: > (%i7) expintegral_e(1,-1.700598-0.612828*%i); > > expintegral_e: continued fractions failed.#C(-1.700598 -0.612828) > -- an error. To debug this try: debugmode(true); > > Note that abs(-1.700598-0.612828*%i) is around 1.8 . > And that the phase is just less than .9*pi so we would apply the continued fraction. It would be useful to add this case to the tests, in case someone forgets why the left and right half-planes have different regions. I'm quite happy with your patch so feel free to apply it whenever you want. Thanks for being so patient and answering my questions. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Wed Apr 18 13:55:17 2012 From: willisb at unk.edu (Barton Willis) Date: Wed, 18 Apr 2012 18:55:17 +0000 Subject: [Maxima] wrong result from function solve Message-ID: <83FD4DC40F97654495E2C9AED476583604202D87@BL2PRD0710MB361.namprd07.prod.outlook.com> I haven't looked at your equations all that carefully, but maybe the following is relevant: Pasting an approximate solution into an equation yields the so-called residual. A "small" residual does not imply an accurate solution: for example, (%i1) eq : (x-1)^10000 = 0; (%o1) (x-1)^10000=0 (%i2) subst(x=1.99,eq); (%o2) 2.248774849816094*10^-44=0 The residual (2.248774849816094*10^-44) is small, but 1.99 is not close to any solution of (x-1)^10000 = 0. A large residual does not imply an inaccurate answer; for example, (%i3) eq : (x-1)^(1/10000)=0; (%o3) (x-1)^(1/10000)=0 (%i4) subst(x=1.000000000000001,eq); (%o4) 0.996562500229301=0 Here 1.000000000000001 is close to a solution of (x-1)^(1/10000)=0 but the residual 0.9965... isn't small. Of course, "large" and "small" have no definite meaning. The standard advice is to consult a good numerical analysis text for details. Specifically for this, I don't have a good book in mind. --bw From lorenzo.isella at gmail.com Wed Apr 18 15:10:26 2012 From: lorenzo.isella at gmail.com (Lorenzo Isella) Date: Wed, 18 Apr 2012 22:10:26 +0200 Subject: [Maxima] Trouble in Solving Equation In-Reply-To: References: <20120331104619.6bca23e0489d1fc9051c001e@gmail.com> Message-ID: <20120418221026.08898ad980faec7d9908c310@gmail.com> Hello, And sorry for the late reply. Indeed the problem was an extra line. The snippet Rg:(N/kf)^(1/df); Rm:0.512*(1-1/log(2*N))*Rg+0.72*N^0.413; Req:N^(1/3); phi:N/Rgeo^3; myeq: Rm/Rgeo = c*Rg/Rgeo+d; solve(myeq, Rgeo); does exact what I need. Cheers Lorenzo On Sat, 31 Mar 2012 05:54:52 -0500 Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > > > Rg:(N/kf)^(1/df); > > Rm:0.512*(1-1/log(2*N))*Rg+0.72*N^0.413; > > Req:N^(1/3); > > phi:N/Rgeo^3; > > Rm/Rgeo: a*Rg/Rgeo+b; > > myeq: Rm/Rgeo = c*Rg/Rgeo+d; > > solve(myeq, Rgeo); > > The assignment Rm / Rgeo : a*Rg/Rgeo+b does something, but maybe it doesn't do what you think it does. > To read the user documentation for assignment, enter ? :. > > Just guessing, maybe you want: > > (Rg:(N/kf)^(1/df), > Rm:0.512*(1-1/log(2*N))*Rg+0.72*N^0.413, > Req:N^(1/3), > phi:N/Rgeo^3, > myeq: Rm/Rgeo = c*Rg/Rgeo+d, > solve(myeq, Rgeo)); > > And this works OK, I think. Let us know if this doesn't resolve your question. > > --Barton > > > From mathemage at gmail.com Wed Apr 18 16:46:42 2012 From: mathemage at gmail.com (Duc Trung Ha) Date: Wed, 18 Apr 2012 23:46:42 +0200 Subject: [Maxima] `to_poly_solve` inconsistency of solutions for equivalent forms of goniometric equations Message-ID: <20120418214642.GA13818@ThinQuarium> Hola, I am sorry if this would come as a completely stupid question but I was really amazed at this Maxima's behavior: When I searched for solution of goniometric equation `tan(x) = 1`:: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (%i22) to_poly_solve(tan(x) = 1, x); %pi - 2 %pi %z30 - --- 2 (%o22) %union([x = - ------------------]) 2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; answer was given to me. On the other hand, when I entered what I consider an equivalent form of the very same equation: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (%i23) to_poly_solve((sin(x)/cos(x)) - 1 = 0, x); %pi - 4 %pi %z40 - --- %pi (8 %z40 + 1) 2 (%o23) %union(%if(cos(----------------) # 0, [x = - ------------------], 4 2 3 %pi %union()), [x = 2 %pi %z38 - -----]) 4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; output came out. After a brief inspection one can unravel that this solution is in fact identical, however, denoted in very much less elegant & transparent way. This may cause some serious troubles to external programs exploiting Maxima's functionality. For instance, I discovered this issue while using Sage's `solve` command -- original bug can be viewed at https://groups.google.com/forum/?hl=en&fromgroups#!topic/sage-support/ys3CASZ3vrs Similarly, `solve` also is not capable of recognizing `sin/cos` form of `tan`:: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (%i24) solve(tan(x) = 1, x); solve: using arc-trig functions to get a solution. Some solutions will be lost. %pi (%o24) [x = ---] 4 (%i25) solve((sin(x)/cos(x)) - 1 = 0, x); (%o25) [sin(x) = cos(x)] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Is it somehow possible to alter the output for equivalent forms of such well-known goniometric functions and thus fix this pseudo-bug? --- Duc Trung Ha From robert.dodier at gmail.com Wed Apr 18 16:56:59 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 18 Apr 2012 21:56:59 +0000 (UTC) Subject: [Maxima] simplification References: <83FD4DC40F97654495E2C9AED4765836041F381C@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F884959.206@eecs.berkeley.edu> Message-ID: On 2012-04-18, Jean Vittor wrote: > Now my expressions get simplified with the following rules (in case > someone's interested). Terrific! I'm glad to hear it works OK for you. Maxima's pattern matcher isn't very strong -- there are a lot of interesting patterns it can't match. I'm glad to hear that the set of matchable patterns includes some of interest to you. > tellsimpafter(sin(ee*xx), ee*sin(xx)); > tellsimpafter(sin(xx*ee), ee*sin(xx)); > tellsimpafter(sin(xx*ee*yy), ee*sin(xx*yy)); > tellsimpafter(sin((xx*ee*zz)/yy), ee*sin(xx*zz/yy)); Keep in mind that the multiplication and division expressions above will be simplified before tellsimpafter works on them, so any permutation of terms yields the same pattern. All the best, Robert Dodier From macrakis at alum.mit.edu Wed Apr 18 17:28:14 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 18 Apr 2012 18:28:14 -0400 Subject: [Maxima] simplification In-Reply-To: References: <83FD4DC40F97654495E2C9AED4765836041F381C@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F884959.206@eecs.berkeley.edu> Message-ID: On Wed, Apr 18, 2012 at 17:56, Robert Dodier wrote: > On 2012-04-18, Jean Vittor wrote: > ... > > tellsimpafter(sin(ee*xx), ee*sin(xx)); > > tellsimpafter(sin(xx*ee), ee*sin(xx)); > > tellsimpafter(sin(xx*ee*yy), ee*sin(xx*yy)); > > tellsimpafter(sin((xx*ee*zz)/yy), ee*sin(xx*zz/yy)); > > Keep in mind that the multiplication and division expressions > above will be simplified before tellsimpafter works on them, > so any permutation of terms yields the same pattern. > Indeed, if you needed to add patterns (2,3,4) to get the desired behavior, you should report that as a bug. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Wed Apr 18 17:34:40 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 18 Apr 2012 18:34:40 -0400 Subject: [Maxima] `to_poly_solve` inconsistency of solutions for equivalent forms of goniometric equations In-Reply-To: <20120418214642.GA13818@ThinQuarium> References: <20120418214642.GA13818@ThinQuarium> Message-ID: You can use trigreduce to convert sin(x)/cos(x) to tan(x). But I agree that it would be nice if solve(sin(x)/cos(x)=1,x) gave a reasonable answer. Besides to_poly_solve, another way to handle trigonometric equations more systematically is to put them in exponential form, e.g. rectform(solve(exponentialize(...), ...)). But the result can be ugly in some cases. As for to_poly_solve, it's unreasonable to expect in general that equivalent solution sets will be syntactically identical. That is a very hard problem (actually unsolvable in general), though over time, more and more cases will be handled nicely. -s On Wed, Apr 18, 2012 at 17:46, Duc Trung Ha wrote: > Hola, I am sorry if this would come as a completely stupid question but I was really amazed at this Maxima's behavior: When I searched for solution of goniometric equation `tan(x) = 1`:: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (%i22) to_poly_solve(tan(x) = 1, x); %pi - 2 %pi %z30 - --- 2 (%o22) %union([x = - ------------------]) 2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; answer was given to me. On the other hand, when I entered what I consider an equivalent form of the very same equation: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (%i23) to_poly_solve((sin(x)/cos(x)) - 1 = 0, x); %pi - 4 %pi %z40 - --- %pi (8 %z40 + 1) 2 (%o23) %union(%if(cos(----------------) # 0, [x = - ------------------], 4 2 3 %pi %union()), [x = 2 %pi %z38 - -----]) 4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; output came out. After a brief inspection one can unravel that this solution is in fact identical, however, denoted in very much less elegant & transparent way. This may cause some serious troubles to external programs exploiting Maxima's functionality. For instance, I discovered this issue while using Sage's `solve` command -- original bug can be viewed at https://groups.google.com/forum/?hl=en&fromgroups#!topic/sage-support/ys3CASZ3vrs Similarly, `solve` also is not capable of recognizing `sin/cos` form of `tan`:: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (%i24) solve(tan(x) = 1, x); solve: using arc-trig functions to get a solution. Some solutions will be lost. %pi (%o24) [x = ---] 4 (%i25) solve((sin(x)/cos(x)) - 1 = 0, x); (%o25) [sin(x) = cos(x)] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Is it somehow possible to alter the output for equivalent forms of such well-known goniometric functions and thus fix this pseudo-bug? --- Duc Trung Ha _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Wed Apr 18 18:02:57 2012 From: willisb at unk.edu (Barton Willis) Date: Wed, 18 Apr 2012 23:02:57 +0000 Subject: [Maxima] `to_poly_solve` inconsistency of solutions for equivalent forms of goniometric equations In-Reply-To: <20120418214642.GA13818@ThinQuarium> References: <20120418214642.GA13818@ThinQuarium> Message-ID: <83FD4DC40F97654495E2C9AED476583604202ED7@BL2PRD0710MB361.namprd07.prod.outlook.com> Appending 'simpfuncs = ['expand] helps somewhat; try to_poly_solve(sin(x)/cos(x) = 1, x, 'simpfuncs = ['expand]); I made no particular effort to make to_poly_solve (usually) find syntactically identical solution sets to semantically identical equations. That simply wasn't a design goal. Although it might seem easy to do write a pre-processor that would do things such as sin(x)/cos(x) --> tan(x), it's not so easy to do this in a way that doesn't make some answers much much more complicated, or to do it without introducing spurious solutions. Most days, I'm happy when nobody locates an abject bug in to_poly_solve :) Thanks for the interest in to_poly_solve. --bw ________________________________________ From tioguerra at gmail.com Wed Apr 18 18:34:41 2012 From: tioguerra at gmail.com (Rodrigo da Silva Guerra) Date: Wed, 18 Apr 2012 20:34:41 -0300 Subject: [Maxima] Basic question on verbifying expressions Message-ID: <38695541-D17D-48E7-9B59-C4ECB06E790D@gmail.com> Hi, I am new to Maxima, and I am having trouble trying to force Maxima to evaluate an expression with a noun. See the commented code below. I hope some of you can help. Thanks in advance, Rodrigo /* I was calculating a Laplace transform, like below: */ ex1:exp(-3*t)*'diff(x(t),t); lap_ex1:laplace(ex1,t,s); /* Then I added an initial condition: */ atvalue(x(t),t=0,0); /* And I managed to re-evaluate the expression: */ lap_ex1:ev(lap_ex1); /* Now I what I wanted to do is to plug an specific x(t) into that expression: */ x(t):=1 /* Now the solution to the expression is trivial (it should be 1), but I can't figure how to tell Maxima to compute it for me */ lap_ex1:ev(lap_ex1); From toy.raymond at gmail.com Wed Apr 18 19:08:38 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 18 Apr 2012 17:08:38 -0700 Subject: [Maxima] `to_poly_solve` inconsistency of solutions for equivalent forms of goniometric equations In-Reply-To: <83FD4DC40F97654495E2C9AED476583604202ED7@BL2PRD0710MB361.namprd07.prod.outlook.com> References: <20120418214642.GA13818@ThinQuarium> <83FD4DC40F97654495E2C9AED476583604202ED7@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: On 4/18/12 4:02 PM, Barton Willis wrote: > Appending 'simpfuncs = ['expand] helps somewhat; try to_poly_solve(sin(x)/cos(x) = 1, x, 'simpfuncs = ['expand]); > > I made no particular effort to make to_poly_solve (usually) find syntactically identical solution sets to semantically identical equations. That simply > wasn't a design goal. Although it might seem easy to do write a pre-processor that would do things such as sin(x)/cos(x) --> tan(x), it's not so > easy to do this in a way that doesn't make some answers much much more complicated, or to do it without introducing spurious solutions. I think it should be this way. Maxima doesn't automatically convert sin(x)/cos(x) to tan(x). I don't think to_poly_solve should magically do that either. Although it would be nice for %union and %if were smarter so that %if would know that cos(%pi/4*(8*%z40+1)) is never zero. Then we'd just have %union of two values of x. And it would be nice to see that they differ by just an integral multiple of %pi so that they could be combined into one. Ray From razif66 at gmail.com Wed Apr 18 20:44:34 2012 From: razif66 at gmail.com (razif razali) Date: Thu, 19 Apr 2012 09:44:34 +0800 Subject: [Maxima] continue calculation after power failure Message-ID: Dear Maxima users, I just want to ask if there any possibility that I can resume my calculation in MAXIMA if my PC suddenly reboot on it ownself since my calculation already takes 4days and it will take more time if I need to start from zero back. Thanks a lot, hope to get reply from all of you soon. -- Regards, RAZIF RAZALI, Tutor & Master Student, Physics Department, Faculty Of Science, Universiti Teknologi Malaysia(UTM). +60199393606 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Wed Apr 18 21:36:59 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 18 Apr 2012 19:36:59 -0700 Subject: [Maxima] continue calculation after power failure In-Reply-To: References: Message-ID: <4F8F7A4B.3020301@eecs.berkeley.edu> Not automatically. You would have to make periodic backup/restart by saving stuff. Getting maxima to re-load and restart from a backup on auto-reboot is presumably possible. It is also possible that you could figure out how to make your program run faster. 4 days on a PC ?? Do you have enough memory?? Is there a better algorithm?? RJF On 4/18/2012 6:44 PM, razif razali wrote: > Dear Maxima users, > > I just want to ask if there any possibility that I can resume my > calculation in MAXIMA if my PC suddenly reboot on it ownself since my > calculation already takes 4days and it will take more time if I need > to start from zero back. > > Thanks a lot, hope to get reply from all of you soon. > > -- > Regards, > > RAZIF RAZALI, > Tutor & Master Student, > Physics Department, > Faculty Of Science, > Universiti Teknologi Malaysia(UTM). > +60199393606 > > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From razif66 at gmail.com Thu Apr 19 02:14:30 2012 From: razif66 at gmail.com (razif razali) Date: Thu, 19 Apr 2012 15:14:30 +0800 Subject: [Maxima] continue calculation after power failure In-Reply-To: References: <4F8F7A4B.3020301@eecs.berkeley.edu> Message-ID: Here i attach my sample code. Download both file in same folder and batch("pnn_42"); inside Maxima On Thu, Apr 19, 2012 at 10:55 AM, razif razali wrote: > How to periodically backup and rerun the calculation? > > Before this I got not enough RAM but then I create large swap memory for > this and it run non stop for 4days before I got power failure, I will > attach my code here soon since I reply this using phone..thanks RJF > On Apr 19, 2012 10:37 AM, "Richard Fateman" > wrote: > >> Not automatically. >> >> You would have to make periodic backup/restart by saving stuff. >> >> Getting maxima to re-load and restart from a backup on auto-reboot is >> presumably possible. >> >> It is also possible that you could figure out how to make your program >> run faster. 4 days on a PC ?? Do you have enough memory?? Is >> there a better algorithm?? >> >> RJF >> >> On 4/18/2012 6:44 PM, razif razali wrote: >> >> Dear Maxima users, >> >> I just want to ask if there any possibility that I can resume my >> calculation in MAXIMA if my PC suddenly reboot on it ownself since my >> calculation already takes 4days and it will take more time if I need to >> start from zero back. >> >> Thanks a lot, hope to get reply from all of you soon. >> >> -- >> Regards, >> >> RAZIF RAZALI, >> Tutor & Master Student, >> Physics Department, >> Faculty Of Science, >> Universiti Teknologi Malaysia(UTM). >> +60199393606 >> >> >> >> >> >> _______________________________________________ >> Maxima mailing listMaxima at math.utexas.eduhttp://www.math.utexas.edu/mailman/listinfo/maxima >> >> >> -- Regards, RAZIF RAZALI, Tutor & Master Student, Physics Department, Faculty Of Science, Universiti Teknologi Malaysia(UTM). +60199393606 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: braket.mac Type: application/octet-stream Size: 5564 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pnn_42 Type: application/octet-stream Size: 1528 bytes Desc: not available URL: From cedric.listes at gmail.com Thu Apr 19 02:37:54 2012 From: cedric.listes at gmail.com (=?ISO-8859-1?Q?c=E9dric_ody?=) Date: Thu, 19 Apr 2012 09:37:54 +0200 Subject: [Maxima] perturbation technique to compute surface wave stokes solutions Message-ID: Dear Maxima users, I am working on oceanic surface waves and I would like to compute the well-known Stokes solution to this problem at various orders. The first order solution, which is also know as Airy's wave, is obtained from irrotational potential flow theory providing that the surface undulation is given (as a harmonic function). Solutions at higher order are obtained with a asymptotic/expansion technique. I am quite unexperienced to softwares allowing symbolic calculus and I would like to know if it is possible to use the method of expansions in Maxima. If so, could you please give some directions? Thank you very much by advance, C?dric Ody From rswarbrick at gmail.com Thu Apr 19 06:07:26 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Thu, 19 Apr 2012 12:07:26 +0100 Subject: [Maxima] Basic question on verbifying expressions References: <38695541-D17D-48E7-9B59-C4ECB06E790D@gmail.com> Message-ID: Rodrigo da Silva Guerra writes: > /* I was calculating a Laplace transform, like below: */ > ex1:exp(-3*t)*'diff(x(t),t); > lap_ex1:laplace(ex1,t,s); > > /* Then I added an initial condition: */ > > atvalue(x(t),t=0,0); > > /* And I managed to re-evaluate the expression: */ > > lap_ex1:ev(lap_ex1); Following you so far, I get: (%i4) lap_ex1:ev(lap_ex1); ! (%o4) (s + 3) (laplace(x(t), t, s)! ) !s = s + 3 > /* Now I what I wanted to do is to plug an specific x(t) into that > expression: */ > > x(t):=1 > The easiest way to do this sort of thing is syntactically: instead of saying to Maxima "please resimplify the expression, knowing also that x(t)=1", just say "replace all occurrences of x(t) with 1 in here". (%i5) subst(x(t)=1, lap_ex1); ! (%o5) (laplace(1, t, s)! ) (s + 3) !s = s + 3 This has the added benefit of not clobbering x(t) for future work: maybe you want to look at the laplace transform for other functions too (eg using the Laplace transform's linearity and expanding a periodic function as a sum of trig functions or whatever) Of course, you need to tell the laplace code to get run again (what looks like a function call in %o5 is actually a noun form, as I guess you've realised, given the title of the thread). (%i6) %, nouns; (%o6) 1 Tada! If you want to read more about this, have a look at the documentation for the ev function. The line "expr, nouns" is just a shorthand for "ev(expr, nouns)". Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From yasuaki.honda at gmail.com Thu Apr 19 07:27:43 2012 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Thu, 19 Apr 2012 21:27:43 +0900 Subject: [Maxima] expintegral_ei() bug on convergence In-Reply-To: References: <4F812ED9.5030304@gmail.com> Message-ID: Hi Raymond san, Thanks for your comments. I will commit expintegral.lisp and rtest_expintegral.mac with mentioned changes. Thanks and best regards, Yasuaki Honda, Chiba, Japan 2012/04/19 3:04 "Raymond Toy" : > > > > 2012/4/18 ???? >> >> Hi Ray san, >> >> >> > Why the discontinuity on the imaginary axis? Why a radius of 2? Does this improve accuracy? >>>> >>>> There is a point between the radius 1 and 2 simicircles in left half plane where continued fraction expansion does not converge. So, I picked up a larger radius. I have not investigated the cf-expansion's convergence region in detail. >>> >>> Do you have an example where the continued fraction does not converge? I looked at A&S 5.1.22 for the continued fraction and it says it converges for |arg(z)| 1 and |arg(z)| < .9*pi. >> >> >> That was my original thought, too. However, expintegral_e(1,-1.700598-0.612828*%i); will not converge if you use continued fraction expansion. Here is the error message: >> (%i7) expintegral_e(1,-1.700598-0.612828*%i); >> >> expintegral_e: continued fractions failed.#C(-1.700598 -0.612828) >> -- an error. To debug this try: debugmode(true); >> >> Note that abs(-1.700598-0.612828*%i) is around 1.8 . > > > And that the phase is just less than .9*pi so we would apply the continued fraction. > > It would be useful to add this case to the tests, in case someone forgets why the left and right half-planes have different regions. > > I'm quite happy with your patch so feel free to apply it whenever you want. > > Thanks for being so patient and answering my questions. > > Ray > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Thu Apr 19 07:56:24 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 19 Apr 2012 08:56:24 -0400 Subject: [Maxima] Basic question on verbifying expressions In-Reply-To: References: <38695541-D17D-48E7-9B59-C4ECB06E790D@gmail.com> Message-ID: On Thu, Apr 19, 2012 at 07:07, Rupert Swarbrick wrote: > ...The easiest way to do this sort of thing is syntactically: instead of > saying to Maxima "please resimplify the expression, knowing also that > x(t)=1", just say "replace all occurrences of x(t) with 1 in here". > Well, that works if it's literally x(t) in the expression; but what if it's x(t-1) or x(t^2)? For *local* substitution of f, you can also do expr: f(t-1) then block(local(f), f(x):=x^3, ev(expr) ) or ev( expr , f(x):=x^3 ) -s > (%i5) subst(x(t)=1, lap_ex1); > ! > (%o5) (laplace(1, t, s)! ) (s + 3) > !s = s + 3 > > This has the added benefit of not clobbering x(t) for future work: maybe > you want to look at the laplace transform for other functions too (eg > using the Laplace transform's linearity and expanding a periodic > function as a sum of trig functions or whatever) > > Of course, you need to tell the laplace code to get run again (what > looks like a function call in %o5 is actually a noun form, as I guess > you've realised, given the title of the thread). > > (%i6) %, nouns; > (%o6) 1 > > Tada! If you want to read more about this, have a look at the > documentation for the ev function. The line "expr, nouns" is just a > shorthand for "ev(expr, nouns)". > > Rupert > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Thu Apr 19 08:01:14 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Thu, 19 Apr 2012 14:01:14 +0100 Subject: [Maxima] Basic question on verbifying expressions In-Reply-To: (Stavros Macrakis's message of "Thu, 19 Apr 2012 08:56:24 -0400") References: <38695541-D17D-48E7-9B59-C4ECB06E790D@gmail.com> Message-ID: <87obqnswo5.fsf@hake.rswarbrick.dnsalias.com> Stavros Macrakis writes: > On Thu, Apr 19, 2012 at 07:07, Rupert Swarbrick wrote: > >> ...The easiest way to do this sort of thing is syntactically: instead of >> saying to Maxima "please resimplify the expression, knowing also that >> x(t)=1", just say "replace all occurrences of x(t) with 1 in here". >> > > Well, that works if it's literally x(t) in the expression; but what if it's > x(t-1) or x(t^2)? > > For *local* substitution of f, you can also do > > expr: f(t-1) > > then > > block(local(f), f(x):=x^3, ev(expr) ) > or > ev( expr , f(x):=x^3 ) > > -s Ah that's a good point. I have done things like this in the past: (%i9) f(x + 1); (%o9) f(x + 1) (%i10) subst(f=lambda([x], x^2), %o9); 2 (%o10) (x + 1) but I agree that it's not necessarily any more obvious what's going on. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From macrakis at alum.mit.edu Thu Apr 19 08:14:50 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 19 Apr 2012 09:14:50 -0400 Subject: [Maxima] continue calculation after power failure In-Reply-To: References: <4F8F7A4B.3020301@eecs.berkeley.edu> Message-ID: Razif, You can use the command 'save' to store your intermediate results into a file, and 'load' to restore them. You'll probably also want to save some indication of which was the most recent result. If I were you, I would name the intermediate results rather than use '%'. Without looking at the details of your computation, a few simple questions: - How confident are you that this computation will complete in a reasonable amount of time (with or without restarts)? (What do the intermediate times look like?) - How confident are you that the final result will be useful? What are the sizes of the intermediate expressions, and how confident are you that there will be enough simplifications that the final result will be manageable? -s On Thu, Apr 19, 2012 at 03:14, razif razali wrote: > Here i attach my sample code. > Download both file in same folder and batch("pnn_42"); inside Maxima > > On Thu, Apr 19, 2012 at 10:55 AM, razif razali wrote: > >> How to periodically backup and rerun the calculation? >> >> Before this I got not enough RAM but then I create large swap memory for >> this and it run non stop for 4days before I got power failure, I will >> attach my code here soon since I reply this using phone..thanks RJF >> On Apr 19, 2012 10:37 AM, "Richard Fateman" >> wrote: >> >>> Not automatically. >>> >>> You would have to make periodic backup/restart by saving stuff. >>> >>> Getting maxima to re-load and restart from a backup on auto-reboot is >>> presumably possible. >>> >>> It is also possible that you could figure out how to make your program >>> run faster. 4 days on a PC ?? Do you have enough memory?? Is >>> there a better algorithm?? >>> >>> RJF >>> >>> On 4/18/2012 6:44 PM, razif razali wrote: >>> >>> Dear Maxima users, >>> >>> I just want to ask if there any possibility that I can resume my >>> calculation in MAXIMA if my PC suddenly reboot on it ownself since my >>> calculation already takes 4days and it will take more time if I need to >>> start from zero back. >>> >>> Thanks a lot, hope to get reply from all of you soon. >>> >>> -- >>> Regards, >>> >>> RAZIF RAZALI, >>> Tutor & Master Student, >>> Physics Department, >>> Faculty Of Science, >>> Universiti Teknologi Malaysia(UTM). >>> +60199393606 >>> >>> >>> >>> >>> >>> _______________________________________________ >>> Maxima mailing listMaxima at math.utexas.eduhttp://www.math.utexas.edu/mailman/listinfo/maxima >>> >>> >>> > > > -- > Regards, > > RAZIF RAZALI, > Tutor & Master Student, > Physics Department, > Faculty Of Science, > Universiti Teknologi Malaysia(UTM). > +60199393606 > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anees at aneconomist.com Thu Apr 19 08:34:17 2012 From: anees at aneconomist.com (Muhammad Anees) Date: Thu, 19 Apr 2012 18:34:17 +0500 Subject: [Maxima] Anybody else using and learning Matlab beside my favorite Maxima? Message-ID: Hello, I just wanted to share this good news with all the fellow members of Maxima list, that I am learning, using and teaching Matlab beside my favorite Maxima. Are you also using Matlab, would you learn it, would you use it jointly with Maxima, I can help you in blending the two Great Mathematical Modeling Tools. The Two MM (Maxima and Matlab). -- Best --------------------------- Muhammad Anees Assistant Professor/Programme Coordinator COMSATS Institute of Information Technology Attock 43600, Pakistan http://elearning.aneconomist.com From fateman at eecs.berkeley.edu Thu Apr 19 09:33:07 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 19 Apr 2012 07:33:07 -0700 Subject: [Maxima] continue calculation after power failure In-Reply-To: References: <4F8F7A4B.3020301@eecs.berkeley.edu> Message-ID: <4F902223.1070209@eecs.berkeley.edu> Your computational steps could be improved. 1. I think that all the declare( ) statements have no affect. 2. You are trying to add rules to the simplification of "." (non-commutative multiplication). Why not write a program that does it more efficiently, instead of having hugely redundant matching? If you insist on writing with patterns, why not do this: write a pattern that completely reduces in one step the expression (Lx1^^k1.Rx1^^k2.Lx2^^k3. .... ). ket(x1,x2, .....) completely, instead of just decrementing k1 by 1, and then looking for the pattern all over again? My guess is that , for all occurrences of patterns with k in them, k is an integer. It thus becomes unnecessary to explicitly check that k is an integer, which you are doing over and over and over and over again. 3. while using expand() may do what you want, it is notoriously inefficient. Can you think of another way, perhaps via "map" to combine items rather than expand ( (......) . (.....)) ? I also agree with Stavros below. Unless your answer comes out to be quite small compared with your inputs, it may be of any use. RJF On 4/19/2012 6:14 AM, Stavros Macrakis wrote: > Razif, > > You can use the command 'save' to store your intermediate results into > a file, and 'load' to restore them. You'll probably also want to > save some indication of which was the most recent result. If I were > you, I would name the intermediate results rather than use '%'. > > Without looking at the details of your computation, a few simple > questions: > > * How confident are you that this computation will complete in a > reasonable amount of time (with or without restarts)? (What do > the intermediate times look like?) > * How confident are you that the final result will be useful? What > are the sizes of the intermediate expressions, and how confident > are you that there will be enough simplifications that the final > result will be manageable? > > -s > > On Thu, Apr 19, 2012 at 03:14, razif razali > wrote: > > Here i attach my sample code. > Download both file in same folder and batch("pnn_42"); inside Maxima > > On Thu, Apr 19, 2012 at 10:55 AM, razif razali > wrote: > > How to periodically backup and rerun the calculation? > > Before this I got not enough RAM but then I create large swap > memory for this and it run non stop for 4days before I got > power failure, I will attach my code here soon since I reply > this using phone..thanks RJF > > On Apr 19, 2012 10:37 AM, "Richard Fateman" > > > wrote: > > Not automatically. > > You would have to make periodic backup/restart by saving > stuff. > > Getting maxima to re-load and restart from a backup on > auto-reboot is > presumably possible. > > It is also possible that you could figure out how to make > your program > run faster. 4 days on a PC ?? Do you have enough memory?? Is > there a better algorithm?? > > RJF > > On 4/18/2012 6:44 PM, razif razali wrote: >> Dear Maxima users, >> >> I just want to ask if there any possibility that I can >> resume my calculation in MAXIMA if my PC suddenly reboot >> on it ownself since my calculation already takes 4days >> and it will take more time if I need to start from zero back. >> >> Thanks a lot, hope to get reply from all of you soon. >> >> -- >> Regards, >> >> RAZIF RAZALI, >> Tutor & Master Student, >> Physics Department, >> Faculty Of Science, >> Universiti Teknologi Malaysia(UTM). >> +60199393606 >> >> >> >> >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > > > > > -- > Regards, > > RAZIF RAZALI, > Tutor & Master Student, > Physics Department, > Faculty Of Science, > Universiti Teknologi Malaysia(UTM). > +60199393606 > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aishen at free.fr Thu Apr 19 09:38:38 2012 From: aishen at free.fr (aishen) Date: Thu, 19 Apr 2012 16:38:38 +0200 Subject: [Maxima] Anybody else using and learning Matlab beside my favorite Maxima? In-Reply-To: References: Message-ID: <4F90236E.4060703@free.fr> no spam Le 19/04/2012 15:34, Muhammad Anees a ?crit : > Hello, > > I just wanted to share this good news with all the fellow members of > Maxima list, that I am learning, using and teaching Matlab beside my > favorite Maxima. Are you also using Matlab, would you learn it, would > you use it jointly with Maxima, I can help you in blending the two > Great Mathematical Modeling Tools. The Two MM (Maxima and Matlab). > From zpc010 at gmail.com Fri Apr 20 01:32:15 2012 From: zpc010 at gmail.com (=?UTF-8?B?5byg6bmP56iL?=) Date: Fri, 20 Apr 2012 14:32:15 +0800 Subject: [Maxima] Solving linear second-order PDE in closed form Message-ID: Hi, I'm a undergraduate strudent, learning linear second-order PDE now.I want to write some programs to solve the boring PDEs.Are there any examples to help me begin the work? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jean.vittor at free.fr Wed Apr 18 21:40:21 2012 From: jean.vittor at free.fr (Jean Vittor) Date: Thu, 19 Apr 2012 04:40:21 +0200 Subject: [Maxima] simplification In-Reply-To: References: <83FD4DC40F97654495E2C9AED4765836041F381C@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F884959.206@eecs.berkeley.edu> Message-ID: Le 19/04/2012 00:28, Stavros Macrakis a ?crit : > On Wed, Apr 18, 2012 at 17:56, Robert Dodier > wrote: > > On 2012-04-18, Jean Vittor > wrote: > ... > > > tellsimpafter(sin(ee*xx), ee*sin(xx)); > > tellsimpafter(sin(xx*ee), ee*sin(xx)); > > tellsimpafter(sin(xx*ee*yy), ee*sin(xx*yy)); > > tellsimpafter(sin((xx*ee*zz)/yy), ee*sin(xx*zz/yy)); > > Keep in mind that the multiplication and division expressions > above will be simplified before tellsimpafter works on them, > so any permutation of terms yields the same pattern. > > > Indeed, if you needed to add patterns (2,3,4) to get the desired > behavior, you should report that as a bug. > Right. My mistake... Thanks, Jean From jean.vittor at free.fr Wed Apr 18 21:54:11 2012 From: jean.vittor at free.fr (Jean Vittor) Date: Thu, 19 Apr 2012 04:54:11 +0200 Subject: [Maxima] composed function return Message-ID: Hi, I would have expected last command of the following sequence to return true. (%i1) declare(x,real); (%o1) done (%i2) featurep(x,real); (%o2) true (%i3) featurep(sin(x),real); (%o3) true (%i4) featurep(acos(sin(x)),real); (%o4) false Am I wrong ? If so, is there a way to assume that acos(sin(x)) is real when x is real. Thanks, Jean From talon at lpthe.jussieu.fr Fri Apr 20 09:54:10 2012 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 20 Apr 2012 14:54:10 +0000 (UTC) Subject: [Maxima] Solving linear second-order PDE in closed form References: Message-ID: ??? wrote: > Hi, > I'm a undergraduate strudent, learning linear second-order PDE now.I > want to write some programs to solve the boring PDEs.Are there any examples > to help me begin the work? > Have you looked at contrib_ode and ode2? -- Michel Talon From villate at fe.up.pt Fri Apr 20 10:18:09 2012 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 20 Apr 2012 16:18:09 +0100 Subject: [Maxima] Solving linear second-order PDE in closed form In-Reply-To: References: Message-ID: <4F917E31.1010706@fe.up.pt> On 04/20/2012 03:54 PM, Michel Talon wrote: > ??? wrote: >> Hi, >> I'm a undergraduate strudent, learning linear second-order PDE now.I >> want to write some programs to solve the boring PDEs.Are there any examples >> to help me begin the work? >> > Have you looked at contrib_ode and ode2? > Those will not help him, because they are for ODEs and not for PDEs. It will be very nice to have a Maxima package for PDE, even if it only solves "boring" cases. Regards, Jaime From macrakis at alum.mit.edu Fri Apr 20 12:55:25 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 20 Apr 2012 13:55:25 -0400 Subject: [Maxima] composed function return In-Reply-To: References: Message-ID: Alas, Maxima is not smart enough to realize that acos(sin(x)) is real for real x. In fact, Maxima doesn't even know that -1 <= sin(x) <= 1 for real x. (By the way, Maxima treats undeclared variables as real in most cases....) I'd think the right way to handle that would be (symbolic) interval analysis where sin(x) => [-1,1] for real x and acos([-1,1]) => [0,%pi] (assuming the principal value interpretation). But Maxima doesn't currently do that, sorry. -s On Wed, Apr 18, 2012 at 22:54, Jean Vittor wrote: > Hi, > > > I would have expected last command of the following sequence to return > true. > > (%i1) declare(x,real); > (%o1) done > (%i2) featurep(x,real); > (%o2) true > (%i3) featurep(sin(x),real); > (%o3) true > (%i4) featurep(acos(sin(x)),real); > (%o4) false > > Am I wrong ? > If so, is there a way to assume that acos(sin(x)) is real when x is real. > > > Thanks, > > Jean > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleksasd873 at gmail.com Fri Apr 20 14:57:06 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Fri, 20 Apr 2012 22:57:06 +0300 Subject: [Maxima] Solving linear second-order PDE in closed form Message-ID: *??? wrote:*>>* Hi,*>>* I'm a undergraduate strudent, learning linear second-order PDE now.I*>>* want to write some programs to solve the boring PDEs.Are there any examples*>>* to help me begin the work?* Example(example 2.22 fom Prem K. Kythe, e.a., Partial differential equations and Mathematica, 1997) Solve pde (%i1) eq:y^2*'diff(u,x,2)-4*x*y*'diff(u,x,1,y,1)+3*x^2*'diff(u,y,2)-y^2/x*'diff(u,x,1)-3*x^2/y*'diff(u,y,1)=0$ (%i2) load(contrib_ode)$ load(pdiff)$ Characteristic equation: (%i4) char_eq:y^2*'diff(y,x)^2+4*x*y*'diff(y,x)+3*x^2=0; (%o4) y^2*('diff(y,x,1))^2+4*x*y*('diff(y,x,1))+3*x^2=0 (%i5) s:contrib_ode(char_eq,y,x); (%t5) y^2*('diff(y,x,1))^2+4*x*y*('diff(y,x,1))+3*x^2=0 "first order equation not linear in y'" (%o5) [-y^2/2=x^2/2+%c,-y^2/6=x^2/2+%c] (%i6) solve(s[1],%c); (%o6) [%c=-(y^2+x^2)/2] (%i7) sol1:reverse(%[1]*(-2)); (%o7) y^2+x^2=-2*%c (%i8) solve(s[2],%c); (%o8) [%c=-(y^2+3*x^2)/6] (%i9) sol2:reverse(%[1]*(-6)); (%o9) y^2+3*x^2=-6*%c (%i10) tr:[xi=lhs(sol1),eta=lhs(sol2)]; (%o10) [xi=y^2+x^2,eta=y^2+3*x^2] (%i11) depends(u,[xi,eta],xi,[x,y],eta,[x,y])$ (%i12) isv:append(diff(tr,x),diff(tr,x,2),diff(tr,y),diff(tr,y,2),diff(tr,x,1,y,1)); (%o12) ['diff(xi,x,1)=2*x,'diff(eta,x,1)=6*x,'diff(xi,x,2)=2,'diff(eta,x,2)=6,'diff(xi,y,1)=2*y,'diff(eta,y,1)=2*y,'diff(xi,y,2)=2,'diff(eta,y,2)=2,'diff(xi,x,1,y,1)=0,'diff(eta,x,1,y,1)=0] (%i13) subst(isv,ev(eq,nouns)),expand; (%o13) -16*('diff(u,eta,1,xi,1))*x^2*y^2=0 We get the canonical form(hyperbolic equation) (%i14) can_form:solve(%,'diff(u,eta,1,xi,1))[1]; (%o14) 'diff(u,eta,1,xi,1)=0 solution of this equation is (%i15) u=F(xi)+G(eta); (%o15) u=F(xi)+G(eta) whose solution is (%i16) solution:subst(tr,%); (%o16) u=G(y^2+3*x^2)+F(y^2+x^2) where G and F any differentiable functions. Test of solution: (%i17) subst(solution,eq)$ (%i18) ev(%, nouns)$ (%i19) ratsimp(%); (%o19) 0=0 Moore examples with Maple see http://www.maplesoft.com/applications/author.aspx?mid=17 Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From nijso at hotmail.com Fri Apr 20 15:35:48 2012 From: nijso at hotmail.com (nijso beishuizen) Date: Fri, 20 Apr 2012 22:35:48 +0200 Subject: [Maxima] simplify sqrt(y) to y^1/2 Message-ID: Dear all, I want to check if expr is of the form y^n. Is there a way to tell maxima that all sqrt() terms should be converted to/written as ()^1/2? -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri Apr 20 17:14:32 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 20 Apr 2012 15:14:32 -0700 Subject: [Maxima] simplify sqrt(y) to y^1/2 In-Reply-To: References: Message-ID: <4F91DFC8.4000406@eecs.berkeley.edu> On 4/20/2012 1:35 PM, nijso beishuizen wrote: > Dear all, > > I want to check if expr is of the form y^n. Is there a way to tell > maxima that all sqrt() terms should be converted to/written as ()^1/2? > > Internally, it already is. inpart(sqrt(x),0) is ^ inpart(1/sqrt(x),0) is ^ etc. Is that enough for your purposes? RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexanderk.hansen at gmail.com Fri Apr 20 17:29:11 2012 From: alexanderk.hansen at gmail.com (Alexander Hansen) Date: Fri, 20 Apr 2012 15:29:11 -0700 Subject: [Maxima] Official release date for 5.27.0 Message-ID: <4F91E337.4050402@gmail.com> I was wondering whether it's permissible to make a public release of Maxima-5.27.0 in Fink. -- Alexander Hansen From talon at lpthe.jussieu.fr Fri Apr 20 17:51:31 2012 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 20 Apr 2012 22:51:31 +0000 (UTC) Subject: [Maxima] Solving linear second-order PDE in closed form References: <4F917E31.1010706@fe.up.pt> Message-ID: Jaime Villate wrote: > On 04/20/2012 03:54 PM, Michel Talon wrote: >> ??? wrote: >>> Hi, >>> I'm a undergraduate strudent, learning linear second-order PDE now.I >>> want to write some programs to solve the boring PDEs.Are there any examples >>> to help me begin the work? >>> >> Have you looked at contrib_ode and ode2? >> > Those will not help him, because they are for ODEs and not for PDEs. It > will be very nice to > have a Maxima package for PDE, even if it only solves "boring" cases. Oh, sorry, i confused P with O. Well for PDEs besides constant coefficients there is not much available for explicit solutions. The Riemann method of characteristics being one of the few that can treat some exceptional non constant coeffs problems, as in the Riemann solution of the 1-dim propagation of compressible fluids. Or some exact solutions for "integrable" systems of PDEs (solitons, etc.) but all this is beyond what a CAS software can do, most presumably. -- Michel Talon From fateman at eecs.berkeley.edu Fri Apr 20 18:03:11 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 20 Apr 2012 16:03:11 -0700 Subject: [Maxima] solving a pde with finite differences In-Reply-To: References: Message-ID: <4F91EB2F.8080906@eecs.berkeley.edu> On 10/7/2011 1:51 AM, c?dric ody wrote: > Dear Maxima users, > > I am relatively new to maxima. > > Is there a method in maxima to use finite differences to solve simple > pdes? > > C?dric > Is there something "symbolic" about your problem that makes Maxima more suitable to use that the typical numerical finite element PDE codes? There have been some papers on various methods by C.M. Anderson, A. Miola, and others. There is also a Macsyma package "PDEase" which is proprietary but you may be able to find a demo or documentation. RJF From jean.vittor at free.fr Sat Apr 21 01:46:47 2012 From: jean.vittor at free.fr (Jean Vittor) Date: Sat, 21 Apr 2012 08:46:47 +0200 Subject: [Maxima] composed function return In-Reply-To: References: Message-ID: Le 20/04/2012 19:55, Stavros Macrakis a ?crit : > Alas, Maxima is not smart enough to realize that acos(sin(x)) is real > for real x. In fact, Maxima doesn't even know that -1 <= sin(x) <= 1 > for real x. (By the way, Maxima treats undeclared variables as real in > most cases....) > > I'd think the right way to handle that would be (symbolic) interval > analysis where sin(x) => [-1,1] for real x and acos([-1,1]) => [0,%pi] > (assuming the principal value interpretation). Yes. By the way, does Maxima handle variable domain ? I mean a way to declare (or assume) that variable x is always in set s. > But Maxima doesn't > currently do that, sorry. > OK. Thanks anyway. Jean > [...] From krobe8 at gmail.com Sat Apr 21 18:02:20 2012 From: krobe8 at gmail.com (Ken Roberts) Date: Sat, 21 Apr 2012 23:02:20 +0000 (UTC) Subject: [Maxima] Polylogarithms Message-ID: What would be involved in modifying Maxima to support numerical calculation of polylogarithm function li[s](z) for values of s besides s=2 and s=3? I've been using some code in C for that purpose (the ANANT package of Linas Vepstas, GPL) but would like to make my application calculation code (which uses polylogs) readily modifiable by others in our project group who are not comfortable with C, and also to utilize some of the visualization features of Maxima (plotting). I'm new to Maxima, but an experienced C programmer. Not LISP. Can I help with getting polylog numerical calculations li[s](z) for general complex s implemented into Maxima? Ken Roberts krobe8 at gmail.com April 21, 2012 From toy.raymond at gmail.com Sat Apr 21 18:13:10 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 21 Apr 2012 16:13:10 -0700 Subject: [Maxima] Polylogarithms In-Reply-To: References: Message-ID: <4F933F06.7020607@gmail.com> On 4/21/12 4:02 PM, Ken Roberts wrote: > What would be involved in modifying Maxima to support numerical calculation of > polylogarithm function li[s](z) for values of s besides s=2 and s=3? I've been > using some code in C for that purpose (the ANANT package of Linas Vepstas, GPL) > but would like to make my application calculation code (which uses polylogs) > readily modifiable by others in our project group who are not comfortable with > C, and also to utilize some of the visualization features of Maxima (plotting). > > I'm new to Maxima, but an experienced C programmer. Not LISP. Can I help with > getting polylog numerical calculations li[s](z) for general complex s > implemented into Maxima? > It would be fantastic to have a numerical evaluation of polylogs. (I think the current version only gives single-float precision, all other functions in maxima.) If you have a reference to the algorithm, that would help a lot. That might allow maxima to do a bigfloat implementation. If all there is is the C code you mentioned, that would be helpful too. Ray From krobe8 at gmail.com Sat Apr 21 18:58:58 2012 From: krobe8 at gmail.com (Ken Roberts) Date: Sat, 21 Apr 2012 23:58:58 +0000 (UTC) Subject: [Maxima] Polylogarithms References: <4F933F06.7020607@gmail.com> Message-ID: Raymond Toy gmail.com> writes: > On 4/21/12 4:02 PM, Ken Roberts wrote: > > What would be involved in modifying Maxima to support > > numerical calculation of > > polylogarithm function li[s](z) for values of s besides s=2 and s=3? > > It would be fantastic to have a numerical evaluation of polylogs. (I > think the current version only gives single-float precision, all other > functions in maxima.) > > If you have a reference to the algorithm, that would help a lot. That > might allow maxima to do a bigfloat implementation. If all there is is > the C code you mentioned, that would be helpful too. > > Ray > Hi Ray, Thanks for such a prompt reply! The code I'm using for polylog is from Linas Vepstas, his package called ANANT, which stands for "Algorithms in Analytic Number Theory". You can see the code at https://launchpad.net/anant and it is GPL and does arbitrary precision calcs. The code implements an extension of the GNU multiprecision (GMP) C library, with a complex data type (structure with two multiprecision floats), and a variety of appropriate routines for complex arithmetic. Then there are several special functions for complex argument, implemented in multiprecision. The polylog algorithms, and Linas' recommendations re choices based on domain, are discussed in his paper: Linas Vepstas, "An efficient algorithm for accelerating the convergence of oscillatory series, useful for computing the polylogarithm and Hurwitz zeta functions", Numerical Algorithms, 2008, vol 47, pp 211-252. In general, complex polylog is the Borwein algorithm. But there is an argument transformation to get into the domain where that algorithm will be convergent. It is possible to use arguments which cause cpx_polylog to blow up; there is a need, in a general usage implementation, to do some argument screening, and to flip over to simpler algorithms in some particular situations. Linas has used his code for particular regions, and I'm doing the same (different regions, in my case related to some physical properties of materials calculations). But a general exploration of the entire complex domain C x C for Li(s,z) would likely be problematic. Not to mention branch cut considerations. However, for my physical calcs, everything is real at present (the complex args are for fun, playing around with functional relationships ideas, not explicitly related to materials properties optimization). It would be really nice if real args were possible within Maxima! It would mean everyone in our material group could do his own calcs, instead of waiting for me to code in C, and hope that I got it right. If I can help further, please just ask. Thanks! Ken Roberts krobe8 at gmail.com From claudio.botarelli at gmail.com Sun Apr 22 09:54:58 2012 From: claudio.botarelli at gmail.com (Claudio Botarelli) Date: Sun, 22 Apr 2012 16:54:58 +0200 Subject: [Maxima] inconsistency with complex numbers? Message-ID: <4F941BC2.3070709@gmail.com> Dear developers and users of Maxima, troubleshooting a program of mine, I have discovered a Maxima's behaviour which appears inconsistent to me. There is a strange utilization of integer, real and complex numbers. Input of the example: kill(all)$ a: 0.1+%i*0.0; b: 0.0+%i*0.0; c: 0.0+%i*0.1; d: 0.1+%i*0.1; realpart(b); realpart(c); is(realpart(a)=realpart(d)); is(realpart(b)=realpart(c)); is(imagpart(c)=imagpart(d)); is(imagpart(a)=imagpart(b)); exp(%i*0); exp(%i*0.0); limit(exp(%i*x),x,0.0,plus); is(limit(exp(%i*x),x,0.0,plus)=exp(%i*0.0)); build_info(); output of the example: 0.1 0.0 0.1*%i 0.1*%i+0.1 0.0 0 true false true true 1 1.0 1 false Maxima version: 5.26.0 Maxima build date: 22:48 1/15/2012 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 Particularly interesting the tests: is(realpart(b)=realpart(c)) is(limit(exp(%i*x),x,0.0,plus)=exp(%i*0.0)) both should produce true rather than false. Any idea about? Do I improperly/wrongly use Maxima? Is it a Maxima's bug? Thanks in advance for your support. Kind Regards Claudio From fateman at eecs.berkeley.edu Sun Apr 22 10:13:10 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 22 Apr 2012 08:13:10 -0700 Subject: [Maxima] inconsistency with complex numbers? In-Reply-To: <4F941BC2.3070709@gmail.com> References: <4F941BC2.3070709@gmail.com> Message-ID: <4F942006.20900@eecs.berkeley.edu> On 4/22/2012 7:54 AM, Claudio Botarelli wrote: > > > Particularly interesting the tests: > is(realpart(b)=realpart(c)) > is(limit(exp(%i*x),x,0.0,plus)=exp(%i*0.0)) > both should produce true rather than false. > Any idea about? Yes, This happens if you use "=" to compare numbers that are of different types is (0=0.0) is false. I You can avoid it by not using floating point numbers (best recommendation) or by using is ( equal(0,0.0)) instead. > Do I improperly/wrongly use Maxima? Probably. > Is it a Maxima's bug? No opinion. Floating point numbers should be used primarily as a last step in reducing a calculation to an approximate number for (say) plotting. > Thanks in advance for your support. > Kind Regards > Claudio > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Sun Apr 22 13:14:12 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 22 Apr 2012 14:14:12 -0400 Subject: [Maxima] inconsistency with complex numbers? In-Reply-To: <4F941BC2.3070709@gmail.com> References: <4F941BC2.3070709@gmail.com> Message-ID: Several things: The Maxima convention is that numbers with decimal points are approximate and are represented as floating-point numbers. In general, calculations on approximate numbers yield approximate numbers. is(a=b) is *syntactic* equality, comparing the *form* of a and b, not their value. Thus is((x+1)^2=expand((x+1)^2)) returns false. For value equality, use is(equal(a,b)), e.g. is(equal((x+1)^2,expand((x+1)^2))). The integer 0 is not syntactically equal to the float 0.0, but Maxima considers them to be equal in value. (Though one could argue that floats should never compare equal....) As for the behavior of "limit", a limit at a float is not useful or meaningful. Is the value of limit(tan(x),x,float(%pi/2)) 1.6e+16? I suppose we could have limit give an error for floating-point arguments, but that doesn't really seem helpful or useful. -s On Sun, Apr 22, 2012 at 10:54, Claudio Botarelli < claudio.botarelli at gmail.com> wrote: > Dear developers and users of Maxima, > troubleshooting a program of mine, I have discovered a Maxima's behaviour > which appears inconsistent to me. > There is a strange utilization of integer, real and complex numbers. > Input of the example: > > kill(all)$ > > a: 0.1+%i*0.0; > b: 0.0+%i*0.0; > c: 0.0+%i*0.1; > d: 0.1+%i*0.1; > > realpart(b); > realpart(c); > > is(realpart(a)=realpart(d)); > is(realpart(b)=realpart(c)); > is(imagpart(c)=imagpart(d)); > is(imagpart(a)=imagpart(b)); > > exp(%i*0); > exp(%i*0.0); > limit(exp(%i*x),x,0.0,plus); > > is(limit(exp(%i*x),x,0.0,plus)**=exp(%i*0.0)); > > build_info(); > > output of the example: > > 0.1 > 0.0 > 0.1*%i > 0.1*%i+0.1 > 0.0 > 0 > true > false > true > true > 1 > 1.0 > 1 > false > Maxima version: 5.26.0 > Maxima build date: 22:48 1/15/2012 > Host type: i686-pc-mingw32 > Lisp implementation type: GNU Common Lisp (GCL) > Lisp implementation version: GCL 2.6.8 > > > Particularly interesting the tests: > is(realpart(b)=realpart(c)) > is(limit(exp(%i*x),x,0.0,plus)**=exp(%i*0.0)) > both should produce true rather than false. > Any idea about? > Do I improperly/wrongly use Maxima? Is it a Maxima's bug? > Thanks in advance for your support. > Kind Regards > Claudio > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amca01 at gmail.com Mon Apr 23 08:44:57 2012 From: amca01 at gmail.com (Alasdair McAndrew) Date: Mon, 23 Apr 2012 23:44:57 +1000 Subject: [Maxima] A quick question about imaxima Message-ID: When I use imaxima in my Emacs (GNU Emacs 23.3.1), each answer is preceded by the characters ^[[00;30m appearing at the left of the line. I know this has something to do with the colours - but how can I get rid of them? Thanks, Alasdair -- Blog: http://amca01.wordpress.com Web: http://sites.google.com/site/amca01/ Facebook: http://www.facebook.com/alasdair.mcandrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Mon Apr 23 10:29:43 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 23 Apr 2012 15:29:43 +0000 (UTC) Subject: [Maxima] Official release date for 5.27.0 References: <4F91E337.4050402@gmail.com> Message-ID: On 2012-04-20, Alexander Hansen wrote: > I was wondering whether it's permissible to make a public release of > Maxima-5.27.0 in Fink. Yes, please do. For the record, I've been numbering releases so that if corrections need to be made to 5.27.0, the corrections are found in 5.27.1, 5.27.2, etc. I don't plan to make any subminor releases for 5.27 at this point (although I will if the need arises). In general, I would like to encourage others to make any packages for any purpose at any time, as it suits them. I think the project has more to gain from people working on stuff as they see fit -- trying to coordinate all efforts would result in less work getting done. FWIW & all the best, Robert Dodier From willisb at unk.edu Tue Apr 24 06:31:18 2012 From: willisb at unk.edu (Barton Willis) Date: Tue, 24 Apr 2012 11:31:18 +0000 Subject: [Maxima] macro returning a nounform = infinite loop? Message-ID: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> Ordinary function that returns a nounform--OK: (%i13) f(x) := funmake('f,[x])$ (%i14) f(1); (%o14) f(1) Macro that returns a nounform---infinite loop: (%i15) g(x) ::= funmake('g,[x])$ (%i16) g(1); Maxima encountered a Lisp error: Error in PROGN [or a callee]: Bind stack overflow. What's the story? --bw From rich.hennessy at verizon.net Tue Apr 24 16:27:52 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 24 Apr 2012 17:27:52 -0400 Subject: [Maxima] 1/0? Why the error In-Reply-To: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: <3C0C1385F4DE458694980523C4F494EA@RichsLaptop> If you type in : (%i5) kill(all); (%o0) done (%i1) 3/4; (%o1) 3/4 (%i2) 3/2; (%o2) 3/2 (%i3) 3/1; (%o3) 3 (%i4) 3/0; expt: undefined: 0 to a negative exponent. -- an error. To debug this try: debugmode(true); Since Maxima is not trying to compute the answer, it just simplifies the input in these cases, why the error? Would it be better if you could get the unsimplified form back? (%i5) 3/0; (%o5) 3/0 Rich From macrakis at alum.mit.edu Tue Apr 24 16:37:42 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 24 Apr 2012 17:37:42 -0400 Subject: [Maxima] 1/0? Why the error In-Reply-To: <3C0C1385F4DE458694980523C4F494EA@RichsLaptop> References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <3C0C1385F4DE458694980523C4F494EA@RichsLaptop> Message-ID: Carrying around undefined forms like this has been proposed before, but first think about what semantics you'd want around them. Is 3/0 equal to 2/0? In that case, perhaps they should both simplify to 1/0. Is 1/0 > 2345? Is -1/0 < 1/0? Is -1/0 the same as minf? Is 1/0 - 1/0 equal to 0? What is 3/0 - 2/0 ? What is (3/0)*0? Should that simplify to 3? to 1? Or just remain unsimplified? If unsimplified, what use is it? -s On Tue, Apr 24, 2012 at 17:27, Richard Hennessy wrote: > If you type in : > > (%i5) kill(all); > (%o0) done > (%i1) 3/4; > (%o1) 3/4 > (%i2) 3/2; > (%o2) 3/2 > (%i3) 3/1; > (%o3) 3 > (%i4) 3/0; > expt: undefined: 0 to a negative exponent. > -- an error. To debug this try: debugmode(true); > > Since Maxima is not trying to compute the answer, it just simplifies the > input in these cases, why the error? Would it be better if you could get > the unsimplified form back? > > (%i5) 3/0; > (%o5) 3/0 > > Rich > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Tue Apr 24 17:33:04 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 24 Apr 2012 18:33:04 -0400 Subject: [Maxima] 1/0? Why the error In-Reply-To: References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <3C0C1385F4DE458694980523C4F494EA@RichsLaptop> Message-ID: <98364F2D912E47D2B90A7634C59AEF3A@RichsLaptop> Carrying around undefined forms like this has been proposed before, but first think about what semantics you'd want around them. Is 3/0 equal to 2/0? In that case, perhaps they should both simplify to 1/0. Is 1/0 > 2345? Is -1/0 < 1/0? Is -1/0 the same as minf? Is 1/0 - 1/0 equal to 0? What is 3/0 - 2/0 ? What is (3/0)*0? Should that simplify to 3? to 1? Or just remain unsimplified? If unsimplified, what use is it? Keeping terms like this unsimplified is of some use to programmers who write their own simplification rules taking the current problem context into account. That is why I would like to keep terms like this from blowing up Maxima before my program that I might have written can even get the input. Rich On Tue, Apr 24, 2012 at 17:27, Richard Hennessy wrote: If you type in : (%i5) kill(all); (%o0) done (%i1) 3/4; (%o1) 3/4 (%i2) 3/2; (%o2) 3/2 (%i3) 3/1; (%o3) 3 (%i4) 3/0; expt: undefined: 0 to a negative exponent. -- an error. To debug this try: debugmode(true); Since Maxima is not trying to compute the answer, it just simplifies the input in these cases, why the error? Would it be better if you could get the unsimplified form back? (%i5) 3/0; (%o5) 3/0 Rich _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Apr 24 18:38:33 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 24 Apr 2012 19:38:33 -0400 Subject: [Maxima] 1/0? Why the error In-Reply-To: <98364F2D912E47D2B90A7634C59AEF3A@RichsLaptop> References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <3C0C1385F4DE458694980523C4F494EA@RichsLaptop> <98364F2D912E47D2B90A7634C59AEF3A@RichsLaptop> Message-ID: Why not define your own ' power' operator? Then you can write whatever rules you want, including seeing what it simplifies to with the built-in '^' operator. You could also change simpexpt to have a flag controlling the 0^-n case for your special needs... The power of open source! -s On Apr 24, 2012 6:33 PM, "Richard Hennessy" wrote: > Carrying around undefined forms like this has been proposed before, but > first think about what semantics you'd want around them. > > Is 3/0 equal to 2/0? In that case, perhaps they should both simplify to > 1/0. > > Is 1/0 > 2345? > > Is -1/0 < 1/0? > > Is -1/0 the same as minf? > > Is 1/0 - 1/0 equal to 0? What is 3/0 - 2/0 ? > > What is (3/0)*0? Should that simplify to 3? to 1? Or just remain > unsimplified? If unsimplified, what use is it? > > Keeping terms like this unsimplified is of some use to programmers who > write their own simplification rules taking the current problem context > into account. That is why I would like to keep terms like this from blowing > up Maxima before my program that I might have written can even get the > input. > > Rich > > > > On Tue, Apr 24, 2012 at 17:27, Richard Hennessy < > rich.hennessy at verizon.net> wrote: > >> If you type in : >> >> (%i5) kill(all); >> (%o0) done >> (%i1) 3/4; >> (%o1) 3/4 >> (%i2) 3/2; >> (%o2) 3/2 >> (%i3) 3/1; >> (%o3) 3 >> (%i4) 3/0; >> expt: undefined: 0 to a negative exponent. >> -- an error. To debug this try: debugmode(true); >> >> Since Maxima is not trying to compute the answer, it just simplifies the >> input in these cases, why the error? Would it be better if you could get >> the unsimplified form back? >> >> (%i5) 3/0; >> (%o5) 3/0 >> >> Rich >> >> ______________________________**_________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/**mailman/listinfo/maxima >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Tue Apr 24 19:36:25 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 24 Apr 2012 17:36:25 -0700 Subject: [Maxima] 1/0? Why the error In-Reply-To: References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <3C0C1385F4DE458694980523C4F494EA@RichsLaptop> <98364F2D912E47D2B90A7634C59AEF3A@RichsLaptop> Message-ID: <4F974709.6050106@eecs.berkeley.edu> There is at least one proposal as to how to extend the rational numbers (already in common lisp), to include denominators of 0; adding objects 0/0, 1/0, and -1/0. They correspond in most respects to the floating-point objects in the IEEE standard of NotANumber, Infinity, and negative Infinity. As a consequence, one can look in the literature for reasonable definitions for (say) expt, log, cosine, addition, multiplication, ... of these objects. Unfortunately this does not always lead to consistency (in IEEE .. as well). Just patching one spot to leave 1/0 alone may have some momentary appeal, but if you think about it a little, it requires a lot of work and considerable thought to make such a feature work. RJF ps www.cs.berkeley.edu/~*fateman*/papers/extrat.ps -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Tue Apr 24 22:22:04 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 24 Apr 2012 23:22:04 -0400 Subject: [Maxima] 1/0? Why the error In-Reply-To: <4F974709.6050106@eecs.berkeley.edu> References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <3C0C1385F4DE458694980523C4F494EA@RichsLaptop> <98364F2D912E47D2B90A7634C59AEF3A@RichsLaptop> <4F974709.6050106@eecs.berkeley.edu> Message-ID: <86DA353465344D6799057C8791A2C011@RichsLaptop> Well, maybe it is not worth that effort. Rich From: Richard Fateman Sent: Tuesday, April 24, 2012 8:36 PM To: Stavros Macrakis Cc: Richard Hennessy ; maxima at math.utexas.edu Subject: Re: [Maxima] 1/0? Why the error There is at least one proposal as to how to extend the rational numbers (already in common lisp), to include denominators of 0; adding objects 0/0, 1/0, and -1/0. They correspond in most respects to the floating-point objects in the IEEE standard of NotANumber, Infinity, and negative Infinity. As a consequence, one can look in the literature for reasonable definitions for (say) expt, log, cosine, addition, multiplication, ... of these objects. Unfortunately this does not always lead to consistency (in IEEE .. as well). Just patching one spot to leave 1/0 alone may have some momentary appeal, but if you think about it a little, it requires a lot of work and considerable thought to make such a feature work. RJF ps www.cs.berkeley.edu/~fateman/papers/extrat.ps -------------- next part -------------- An HTML attachment was scrubbed... URL: From kun3721 at yahoo.com.cn Tue Apr 24 23:09:43 2012 From: kun3721 at yahoo.com.cn (kun) Date: Wed, 25 Apr 2012 12:09:43 +0800 (CST) Subject: [Maxima] about trigreduce Message-ID: <1335326983.46464.YahooMailNeo@web15807.mail.cnb.yahoo.com> Hello everyone, I entered the following line into Maxima: trigreduce(cos(la)*cos(u)*sin(v)*R - sin(la)*cos(u)*cos(v)*R); I expect: sin(v-la)*cos(u)*R but Maxima returned: ?sin(v + u - la) R ? sin(v - u - la) R ? ----------------- + ----------------- ? ? ? ? ? ? ?2 ? ? ? ? ? ? ? ? ? 2 how can I get my wanted result? Regards, Kun -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Apr 24 23:28:22 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 25 Apr 2012 00:28:22 -0400 Subject: [Maxima] about trigreduce In-Reply-To: <1335326983.46464.YahooMailNeo@web15807.mail.cnb.yahoo.com> References: <1335326983.46464.YahooMailNeo@web15807.mail.cnb.yahoo.com> Message-ID: trigreduce(factor(cos(la)*cos(u)*sin(v)*R - sin(la)*cos(u)*cos(v)*R)); On Wed, Apr 25, 2012 at 00:09, kun wrote: > Hello everyone, > > I entered the following line into Maxima: > trigreduce(cos(la)*cos(u)*sin(v)*R - sin(la)*cos(u)*cos(v)*R); > > I expect: > sin(v-la)*cos(u)*R > > but Maxima returned: > sin(v + u - la) R sin(v - u - la) R > ----------------- + ----------------- > 2 2 > > how can I get my wanted result? > > Regards, > > Kun > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Wed Apr 25 03:29:58 2012 From: willisb at unk.edu (Barton Willis) Date: Wed, 25 Apr 2012 08:29:58 +0000 Subject: [Maxima] macro returning a nounform = infinite loop? In-Reply-To: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: <83FD4DC40F97654495E2C9AED47658360420FD59@BL2PRD0710MB361.namprd07.prod.outlook.com> A workaround is (%i47) h(x) ::= buildq([h,x], funmake(h,[x]))$ (%i48) h(1); (%o48) h(1) But I don't understand why there is an infinite loop or why the workaround cures the infinite loop. --bw ________________________________________ Ordinary function that returns a nounform--OK: (%i13) f(x) := funmake('f,[x])$ (%i14) f(1); (%o14) f(1) Macro that returns a nounform---infinite loop: (%i15) g(x) ::= funmake('g,[x])$ (%i16) g(1); Maxima encountered a Lisp error: Error in PROGN [or a callee]: Bind stack overflow. What's the story? --bw From piminusmeson at bk.ru Wed Apr 25 08:32:45 2012 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Wed, 25 Apr 2012 17:32:45 +0400 Subject: [Maxima] asymptotic expansion of the error function In-Reply-To: <83FD4DC40F97654495E2C9AED47658360420FD59@BL2PRD0710MB361.namprd07.prod.outlook.com> References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <83FD4DC40F97654495E2C9AED47658360420FD59@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: <4F97FCFD.2010406@bk.ru> Hello, list. Is there any way to perform the asymptotic expansion of the error function for large argument in maxima? (see http://en.wikipedia.org/wiki/Error_function the first formula in the "Asymptotic expansion" section) From macrakis at alum.mit.edu Wed Apr 25 08:38:25 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 25 Apr 2012 09:38:25 -0400 Subject: [Maxima] macro returning a nounform = infinite loop? In-Reply-To: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: On Tue, Apr 24, 2012 at 07:31, Barton Willis wrote: > Ordinary function that returns a nounform--OK: > > (%i13) f(x) := funmake('f,[x])$ This does not return a nounform, just an expression (which it doesn't evaluate). If this were a macro, it would return the same expression, then evaluate it, hence the infinite recursion. (%i1) display2d:false$ (%i2) f(x); (%o2) f(x) <<< regular function call (%i3) 'f(x); (%o3) 'f(x) <<< nounified function call (%i5) funmake('f,[x]); (%o5) f(x) <<< regular function call (%i6) funmake(nounify('f),[x]); (%o6) 'f(x) <<< nounified function call (%i7) fmac(x)::=funmake(nounify('fmac),[x])$ <<< macro returning nounified function call (%i8) fmac(4); (%o8) 'fmac(4) <<< no problem The buildq works because it is returning the expression "funmake( FFF, [XXX] ), which is then evaluated at main eval time (not macro expansiontime). -s > Macro that returns a nounform---infinite loop: > > (%i15) g(x) ::= funmake('g,[x])$ > > (%i16) g(1); > Maxima encountered a Lisp error: > Error in PROGN [or a callee]: Bind stack overflow. > > What's the story? > > --bw > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Wed Apr 25 08:45:32 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 25 Apr 2012 09:45:32 -0400 Subject: [Maxima] asymptotic expansion of the error function In-Reply-To: <4F97FCFD.2010406@bk.ru> References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <83FD4DC40F97654495E2C9AED47658360420FD59@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F97FCFD.2010406@bk.ru> Message-ID: What do you mean to "perform" the asymptotic expansion? The formula you cite can certainly be expanded to any number of terms you want by simply specifying the upper bound, e.g. sum(x^i, i, 1, 4) gives x+x^2+x^3+x^4. The cited article also gives an explicit formula for the remainder, so you should be able to cut off the expansion in an appropriate place. -s On Wed, Apr 25, 2012 at 09:32, Dmitry Shkirmanov wrote: > Hello, list. Is there any way to perform the asymptotic expansion of the > error function for large argument in maxima? > > (see http://en.wikipedia.org/wiki/**Error_function > the first formula in the "Asymptotic expansion" section) > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vi5u0-maxima at yahoo.co.uk Wed Apr 25 10:45:04 2012 From: vi5u0-maxima at yahoo.co.uk (Dan) Date: Wed, 25 Apr 2012 16:45:04 +0100 (BST) Subject: [Maxima] perturbation technique to compute surface wave stokes solutions In-Reply-To: References: Message-ID: On Thu, 19 Apr 2012, c?dric ody wrote: > I am working on oceanic surface waves and I would like to compute the > well-known Stokes solution to this problem at various orders. The > first order solution, which is also know as Airy's wave, is obtained > from irrotational potential flow theory providing that the surface > undulation is given (as a harmonic function). Solutions at higher > order are obtained with a asymptotic/expansion technique. If I've understood correctly, what happens in the leading order is that your "given surface undulation" imposes separability in co-ordinates of horizontal position, vertical position, and time. Given this separability, Laplace's equation (implementing conservation of volume) reduces to a second-order, linear, inhomogeneous ODE for the potential as a function of the verical co-ordinate. The Maxima function "ode2" should be able to solve this equation, with or without a no-penetration boundary condition at the ocean floor. Substituting (which can be done with the Maxima function "subst") this solution into the combination of the linearized, generalized Bernoulli theorem (implementing conservation of momentum) and the free surface boundary condition (implementing the principle that the free surface moves at the same vertical velocity as the fluid immediately below it), gives you a second-order, linear, homogeneous ODE for the potential at mean sea level as a function of time. Again, the Maxima function "ode2" should be able to solve this equation. The process is pretty similar at each successive order of the perturbation series, except that, on each occasion, the solutions from the previous orders introduce a known (both to the user and to the CAS that solved the previous orders) non-linear term in the generalized Bernoulli theorem, and a known (both to the user and to the CAS that solved the previous orders) difference in potential between mean sea level and the free surface. Mathematically, the effect of these is to alter the inhomogeneity in the vertical ODE, and introduce an inhomogenity in the temporal ODE; the Maxima functions "ode2" and "subst" should still do the business. So, I guess a good first step might be to search for "ode2" and "subst" in the Maxima manual. -- HTH, Dan From toy.raymond at gmail.com Wed Apr 25 10:52:59 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 25 Apr 2012 08:52:59 -0700 Subject: [Maxima] asymptotic expansion of the error function In-Reply-To: References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <83FD4DC40F97654495E2C9AED47658360420FD59@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F97FCFD.2010406@bk.ru> Message-ID: On Wed, Apr 25, 2012 at 6:45 AM, Stavros Macrakis wrote: > What do you mean to "perform" the asymptotic expansion? The formula you > cite can certainly be expanded to any number of terms you want by simply > specifying the upper bound, e.g. > > Too bad this doesn't work: taylor(erfc(z),z,inf,4) like it does for other expressions like, for example, taylor(sqrt(x^2+1)-x, x, inf, 4) -> 1/(2*x)-1/(8*x^3) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Wed Apr 25 10:53:57 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 25 Apr 2012 08:53:57 -0700 Subject: [Maxima] perturbation technique to compute surface wave stokes solutions In-Reply-To: References: Message-ID: <4F981E15.8050606@eecs.berkeley.edu> I don't know about the specifics of your problem, but years ago I worked from a book by Nayfeh on asymptotic methods, trying to use computer algebra. Most methods seem to have a step in which some human judgment is used to eliminate terms, so not so easy to totally automate. In particular, human judgment is used in 2 ways. (a) To figure out which simplification functionality to use to simplify an intermediate result, and (b) To figure out which resulting terms are "secular". On the other hand, the rest of the algebra can be largely automated. (Perhaps by using the ode2 program) There are some methods that appear more mechanical than others, e.g. method of multiple scales. However, the bulk of the material I encountered looked like the presentation of particular examples for which particular methods worked, without any hint of what other problems could also be solved the same way or how you could choose among various competing methods to try. On 4/25/2012 8:45 AM, Dan wrote: > On Thu, 19 Apr 2012, c?dric ody wrote: > >> I am working on oceanic surface waves and I would like to compute the >> well-known Stokes solution to this problem at various orders. The >> first order solution, which is also know as Airy's wave, is obtained >> from irrotational potential flow theory providing that the surface >> undulation is given (as a harmonic function). Solutions at higher >> order are obtained with a asymptotic/expansion technique. > > If I've understood correctly, what happens in the leading order is > that your "given surface undulation" imposes separability in > co-ordinates of horizontal position, vertical position, and time. > Given this separability, Laplace's equation (implementing conservation > of volume) reduces to a second-order, linear, inhomogeneous ODE for > the potential as a function of the verical co-ordinate. The Maxima > function "ode2" should be able to solve this equation, with or without > a no-penetration boundary condition at the ocean floor. Substituting > (which can be done with the Maxima function "subst") this solution > into the combination of the linearized, generalized Bernoulli theorem > (implementing conservation of momentum) and the free surface boundary > condition (implementing the principle that the free surface moves at > the same vertical velocity as the fluid immediately below it), gives > you a second-order, linear, homogeneous ODE for the potential at mean > sea level as a function of time. Again, the Maxima function "ode2" > should be able to solve this equation. > > The process is pretty similar at each successive order of the > perturbation series, except that, on each occasion, the solutions from > the previous orders introduce a known (both to the user and to the CAS > that solved the previous orders) non-linear term in the generalized > Bernoulli theorem, and a known (both to the user and to the CAS that > solved the previous orders) difference in potential between mean sea > level and the free surface. Mathematically, the effect of these is to > alter the inhomogeneity in the vertical ODE, and introduce an > inhomogenity in the temporal ODE; the Maxima functions "ode2" and > "subst" should still do the business. > > So, I guess a good first step might be to search for "ode2" and > "subst" in the Maxima manual. > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From vi5u0-maxima at yahoo.co.uk Wed Apr 25 12:10:45 2012 From: vi5u0-maxima at yahoo.co.uk (Dan) Date: Wed, 25 Apr 2012 18:10:45 +0100 (BST) Subject: [Maxima] asymptotic expansion of the error function In-Reply-To: References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <83FD4DC40F97654495E2C9AED47658360420FD59@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F97FCFD.2010406@bk.ru> Message-ID: On Wed, 25 Apr 2012, Raymond Toy wrote: > Too bad this doesn't work: > > taylor(erfc(z),z,inf,4) It can't, because erfc(1/y) has an essential singularity at y = 0, and therefore no series representation there in powers of y alone. The asymptotic series is allowed to evade that by containing an explicit exponential factor. From hbaker1 at pipeline.com Wed Apr 25 12:08:10 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Wed, 25 Apr 2012 10:08:10 -0700 Subject: [Maxima] Current state of "recognizing zero" ? Message-ID: I was curious about the current state of the problem of simplifying constant expressions. I realize that the problem is unsolvable, in general, but I wonder if there are classes of solutions that exist. Basically, I'm talking about finite expressions built up from constant integers, using +,-,*,/,exp(x),log(x),expt(x,y), sqrt(x), etc. Ditto for additional standard constants like %pi, %e, %i, etc. I'm not talking about floating point numbers here, but exact computations. I'm not talking about "for all" or "there exists" types of computations, but merely constant expressions. From vi5u0-maxima at yahoo.co.uk Wed Apr 25 12:58:49 2012 From: vi5u0-maxima at yahoo.co.uk (Dan) Date: Wed, 25 Apr 2012 18:58:49 +0100 (BST) Subject: [Maxima] asympa.mac Message-ID: Dear All, I just stumbled across the asympa.mac package. Looks interesting - but does there exist any documentation, please? -- Thanks, Dan From fateman at eecs.berkeley.edu Wed Apr 25 13:17:50 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 25 Apr 2012 11:17:50 -0700 Subject: [Maxima] Current state of "recognizing zero" ? In-Reply-To: References: Message-ID: <4F983FCE.8000603@eecs.berkeley.edu> On 4/25/2012 10:08 AM, Henry Baker wrote: > I was curious about the current state of the problem of simplifying constant expressions. > > I realize that the problem is unsolvable, in general, but I wonder if there are classes of solutions that exist. You can find work by Daniel Richardson and others involving Schanuel's conjecture and log-exp expressions with a google search. > > Basically, I'm talking about finite expressions built up from constant integers, using +,-,*,/,exp(x),log(x),expt(x,y), sqrt(x), etc. Ditto for additional standard constants like %pi, %e, %i, etc. > > I'm not talking about floating point numbers here, but exact computations. > > I'm not talking about "for all" or "there exists" types of computations, but merely constant expressions. There's also work that can be done by evaluating expressions as floating point numbers and then trying to find another expression that evaluates to the same number, see for example, http://www.cecm.sfu.ca/organics/papers/bailey/ > From willisb at unk.edu Wed Apr 25 13:46:01 2012 From: willisb at unk.edu (Barton Willis) Date: Wed, 25 Apr 2012 18:46:01 +0000 Subject: [Maxima] asymptotic expansion of the error function In-Reply-To: References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <83FD4DC40F97654495E2C9AED47658360420FD59@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F97FCFD.2010406@bk.ru> , Message-ID: <83FD4DC40F97654495E2C9AED47658360420FE87@BL2PRD0710MB361.namprd07.prod.outlook.com> A workaround might be something similar to (likely this is buggy) (%i33) erfc_asymp(e, x, n) := subst('erfc = lambda([s], if freeof(x,s) then funmake('erfc, [s]) else block([z : taylor(s, x, inf, n)], exp(-s^2) * sum((-1)^k * (2*k+1)!! / (2 * z^(2*k)),k,0,n))), e)$ The stirling function (load("stirling")) works something like this. Example (%i43) erfc_asymp(erfc(x), x, 3); (%o43)/T/ (1/2-3/(2*x^2)+15/(2*x^4)-105/(2*x^6)+...)*%e^(-x^2)+... (%i44) erfc_asymp(erfc(x + 1/x), x, 3); (%o44)/T/ (1/(2*%e^2)-2/(%e^2*x^2)+49/(4*%e^2*x^4)-295/(3*%e^2*x^6)+23161/(48*%e^2*x^8)-101269/(60*%e^2*x^10)+6339529/(1440*%e^2*x^12)-25829911/(2520*%e^2*x^14)+...)*%e^(-x^2)+... --bw From hbaker1 at pipeline.com Wed Apr 25 14:46:14 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Wed, 25 Apr 2012 12:46:14 -0700 Subject: [Maxima] 1/0? Why the error In-Reply-To: <4F974709.6050106@eecs.berkeley.edu> References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <3C0C1385F4DE458694980523C4F494EA@RichsLaptop> <98364F2D912E47D2B90A7634C59AEF3A@RichsLaptop> <4F974709.6050106@eecs.berkeley.edu> Message-ID: Graphics people, including the Postscript language, utilize "homogeneous coordinates" in 1 extra dimension in order to put off the possibility of dividing by zero until the last minute. Homogeneous coordinates also have the advantage that conversion to proper perspective is done as the last step, when the extra coordinate is divided out. Lots of other types of computations are sometimes easier with "extra" coordinates, which are only eliminated when absolutely necessary. Examples are homogeneous polynomials and the use of quaternions (which avoid so-called "gimbal lock"). http://en.wikipedia.org/wiki/Gimbal_lock With modern computers, doing a few extra arithmetic ops is not very expensive, when compared with memory latency, so "redundant" calculation in homogeneous coordinates is actually cheaper when it avoids branching. At 05:36 PM 4/24/2012, Richard Fateman wrote: >There is at least one proposal as to how to extend the rational numbers >(already in common lisp), to include denominators of 0; adding objects >0/0, 1/0, and -1/0. They correspond in most respects to the floating-point >objects in the IEEE standard of NotANumber, Infinity, and negative Infinity. > >As a consequence, one can look in the literature for reasonable definitions >for (say) expt, log, cosine, addition, multiplication, ... of these objects. >Unfortunately this does not always lead to consistency (in IEEE .. as well). > >Just patching one spot to leave 1/0 alone may have some momentary appeal, >but if you think about it a little, it requires a lot of work and considerable thought >to make such a feature work. > >RJF > >ps > >www.cs.berkeley.edu/~fateman/papers/extrat.ps From rich.hennessy at verizon.net Thu Apr 26 00:12:38 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 26 Apr 2012 01:12:38 -0400 Subject: [Maxima] 1/0? Why the error In-Reply-To: References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <3C0C1385F4DE458694980523C4F494EA@RichsLaptop> <98364F2D912E47D2B90A7634C59AEF3A@RichsLaptop> <4F974709.6050106@eecs.berkeley.edu> Message-ID: <369CA1388996494188159FE5CFEA7541@RichsLaptop> This is somewhat new to me but it suggests that the idea might be useful. It reminds me of my Excel spreadsheet macro that rotates the eigenvector of a rotation matrix. Rich -----Original Message----- From: Henry Baker Sent: Wednesday, April 25, 2012 3:46 PM To: Richard Fateman Cc: Stavros Macrakis ; maxima at math.utexas.edu Subject: Re: [Maxima] 1/0? Why the error Graphics people, including the Postscript language, utilize "homogeneous coordinates" in 1 extra dimension in order to put off the possibility of dividing by zero until the last minute. Homogeneous coordinates also have the advantage that conversion to proper perspective is done as the last step, when the extra coordinate is divided out. Lots of other types of computations are sometimes easier with "extra" coordinates, which are only eliminated when absolutely necessary. Examples are homogeneous polynomials and the use of quaternions (which avoid so-called "gimbal lock"). http://en.wikipedia.org/wiki/Gimbal_lock With modern computers, doing a few extra arithmetic ops is not very expensive, when compared with memory latency, so "redundant" calculation in homogeneous coordinates is actually cheaper when it avoids branching. At 05:36 PM 4/24/2012, Richard Fateman wrote: >There is at least one proposal as to how to extend the rational numbers >(already in common lisp), to include denominators of 0; adding objects >0/0, 1/0, and -1/0. They correspond in most respects to the floating-point >objects in the IEEE standard of NotANumber, Infinity, and negative >Infinity. > >As a consequence, one can look in the literature for reasonable definitions >for (say) expt, log, cosine, addition, multiplication, ... of these >objects. >Unfortunately this does not always lead to consistency (in IEEE .. as >well). > >Just patching one spot to leave 1/0 alone may have some momentary appeal, >but if you think about it a little, it requires a lot of work and >considerable thought >to make such a feature work. > >RJF > >ps > >www.cs.berkeley.edu/~fateman/papers/extrat.ps _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From piminusmeson at bk.ru Thu Apr 26 01:08:33 2012 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Thu, 26 Apr 2012 10:08:33 +0400 Subject: [Maxima] asymptotic expansion of the error function In-Reply-To: <83FD4DC40F97654495E2C9AED47658360420FE87@BL2PRD0710MB361.namprd07.prod.outlook.com> References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <83FD4DC40F97654495E2C9AED47658360420FD59@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F97FCFD.2010406@bk.ru> , <83FD4DC40F97654495E2C9AED47658360420FE87@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: <4F98E661.4070200@bk.ru> Thanks for the suggestions, i defined the erfc_asymp function: (%i1) erfc_asymp(z,n):=exp(-z^2)/(z*sqrt(%pi))* (1+sum((-1)^k *((2*k-1))!! / (2 * z^(2))^k,k,1,n))$ (%i2) erfc_asymp(x+%i*y,2); 2 1 3 - (%i y + x) (- ------------- + ------------- + 1) %e 2 4 2 (%i y + x) 4 (%i y + x) (%o2) ----------------------------------------------------- sqrt(%pi) (%i y + x) It gives just what i need. > What do you mean to "perform" the asymptotic expansion? The formula > you cite can certainly be expanded to any number of terms you want by > simply specifying the upper bound, e.g. > > sum(x^i, i, 1, 4) > > gives x+x^2+x^3+x^4. The cited article also gives an explicit formula > for the remainder, so you should be able to cut off the expansion in > an appropriate place. > > -s > > On Wed, Apr 25, 2012 at 09:32, Dmitry Shkirmanov > wrote: > Hello, list. Is there any way to perform the asymptotic expansion of > the error function for large argument in maxima? > > (see http://en.wikipedia.org/wiki/Error_function > the first formula in the "Asymptotic expansion" section) > A workaround might be something similar to (likely this is buggy) > > (%i33) erfc_asymp(e, x, n) := > subst('erfc = lambda([s], > if freeof(x,s) then funmake('erfc, [s]) else > block([z : taylor(s, x, inf, n)], exp(-s2) * sum((-1)^k * (2*k+1)!! / (2 * z^(2*k)),k,0,n))), e)$ > > The stirling function (load("stirling")) works something like this. Example > > (%i43) erfc_asymp(erfc(x), x, 3); > (%o43)/T/ (1/2-3/(2*x2)+15/(2*x4)-105/(2*x6)+...)*%e^(-x2)+... > > (%i44) erfc_asymp(erfc(x + 1/x), x, 3); > (%o44)/T/ (1/(2*%e2)-2/(%e2*x2)+49/(4*%e2*x4)-295/(3*%e2*x6)+23161/(48*%e2*x8)-101269/(60*%e2*x10)+6339529/(1440*%e2*x12)-25829911/(2520*%e2*x14)+...)*%e^(-x2)+... > -------------- next part -------------- An HTML attachment was scrubbed... URL: From piminusmeson at bk.ru Thu Apr 26 03:51:03 2012 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Thu, 26 Apr 2012 12:51:03 +0400 Subject: [Maxima] do not expand sums explicitly In-Reply-To: <4F98E661.4070200@bk.ru> References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <83FD4DC40F97654495E2C9AED47658360420FD59@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F97FCFD.2010406@bk.ru> , <83FD4DC40F97654495E2C9AED47658360420FE87@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F98E661.4070200@bk.ru> Message-ID: <4F990C77.8040302@bk.ru> Hello, list. Is it possible to don't expand sums explicitly? Let's consider an example: (%i1) expr1: exp( sum(a[i]*b[i],i,1,3)); a b + a b + a b 3 3 2 2 1 1 (%o1) %e (%i2) result: factor(sum(c[j]*diff(expr1,a[j]),j,1,3)); a b + a b + a b 3 3 2 2 1 1 (%o2) %e (b c + b c + b c ) 3 3 2 2 1 1 Is it possible to get answer in form, that does not have explicit summation, something like this: exp( sum(a[i]*b[i],i,1,3)) * sum(b[i]*c[i],i,1,3)) ? I tried to do not specify the number of terms: (%i3) expr2: exp( sum(a[i]*b[i],i,1,n)); n ==== \ > a b / i i ==== i = 1 (%o3) %e It is just what i need. But, it seems that is impossible to get derivative of such expression: (%i4) diff(exp2,a[j]); (%o4) 0 It gives zero instead of b[j]*exp( sum(a[i]*b[i],i,1,3)), so i cannot cannot define: (%i6) result2: sum(c[j]*diff(expr2,a[j]),j,1,n); It gives zero instead of n ==== \ > a b / i i n ==== ==== i = 1 \ (%o7) %e> b c / j j ==== j = 1 Any ideas? From michael.soegtrop at intel.com Thu Apr 26 03:59:28 2012 From: michael.soegtrop at intel.com (Soegtrop, Michael) Date: Thu, 26 Apr 2012 08:59:28 +0000 Subject: [Maxima] Expanion of vector expressions Message-ID: <0F7D3B1B3C4B894D824F5B822E3E5A17060BCFEA@IRSMSX102.ger.corp.intel.com> Dear Maxima Users, I came across a problem with vector simplification (using maxima 5.25.1, I have problems with maxima 5.26). For products of a scalar and a vector, it depends on the length of the scalar expression, if it is distributed over the vector or not. E.g. with a 5 element denominator I get (%i1) [x,y,z]/(a+b+c+d+e); (%o1) [x/(e+d+c+b+a),y/(e+d+c+b+a),z/(e+d+c+b+a)] And with a 6 element denominator I get (%i2) [x,y,z]/(a+b+c+d+e+f); (%o2) [x,y,z]/(f+e+d+c+b+a) I found no way to expand such a vector*scalar expression, e.g. expand, vectorsimp with expandall:true don't work. This is especially inconvenient when I want to retrieve an element of the vector as in (%i3) ([x,y,z]/(a+b+c+d+e))[1]; (%o3) x/(e+d+c+b+a) but (%i4) ([x,y,z]/(a+b+c+d+e+f))[1]; (%o4) ([x,y,z]/(f+e+d+c+b+a))[1] Is there a way of doing this without writing my own function for this? Thanks & best regards, Michael From michael.soegtrop at intel.com Thu Apr 26 04:10:55 2012 From: michael.soegtrop at intel.com (Soegtrop, Michael) Date: Thu, 26 Apr 2012 09:10:55 +0000 Subject: [Maxima] do not expand sums explicitly In-Reply-To: <4F990C77.8040302@bk.ru> References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <83FD4DC40F97654495E2C9AED47658360420FD59@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F97FCFD.2010406@bk.ru> , <83FD4DC40F97654495E2C9AED47658360420FE87@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F98E661.4070200@bk.ru> <4F990C77.8040302@bk.ru> Message-ID: <0F7D3B1B3C4B894D824F5B822E3E5A17060BD024@IRSMSX102.ger.corp.intel.com> Dear Dmitry, Does a quote solve your problem? E.g.: (%i1) exp('sum(a[i]*b[i],i,1,3)) (%o1) %e^sum(a[i]*b[i],i,1,3) This is fairly persistent over reevaluation, but of cause at some point it might still be expanded. Best regards, Michael -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Dmitry Shkirmanov Sent: Thursday, April 26, 2012 10:51 AM To: maxima at math.utexas.edu Subject: [Maxima] do not expand sums explicitly Hello, list. Is it possible to don't expand sums explicitly? Let's consider an example: (%i1) expr1: exp( sum(a[i]*b[i],i,1,3)); a b + a b + a b 3 3 2 2 1 1 (%o1) %e (%i2) result: factor(sum(c[j]*diff(expr1,a[j]),j,1,3)); a b + a b + a b 3 3 2 2 1 1 (%o2) %e (b c + b c + b c ) 3 3 2 2 1 1 Is it possible to get answer in form, that does not have explicit summation, something like this: exp( sum(a[i]*b[i],i,1,3)) * sum(b[i]*c[i],i,1,3)) ? I tried to do not specify the number of terms: (%i3) expr2: exp( sum(a[i]*b[i],i,1,n)); n ==== \ > a b / i i ==== i = 1 (%o3) %e It is just what i need. But, it seems that is impossible to get derivative of such expression: (%i4) diff(exp2,a[j]); (%o4) 0 It gives zero instead of b[j]*exp( sum(a[i]*b[i],i,1,3)), so i cannot cannot define: (%i6) result2: sum(c[j]*diff(expr2,a[j]),j,1,n); It gives zero instead of n ==== \ > a b / i i n ==== ==== i = 1 \ (%o7) %e> b c / j j ==== j = 1 Any ideas? _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From piminusmeson at bk.ru Thu Apr 26 04:43:39 2012 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Thu, 26 Apr 2012 13:43:39 +0400 Subject: [Maxima] do not expand sums explicitly In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A17060BD024@IRSMSX102.ger.corp.intel.com> References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <83FD4DC40F97654495E2C9AED47658360420FD59@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F97FCFD.2010406@bk.ru> , <83FD4DC40F97654495E2C9AED47658360420FE87@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F98E661.4070200@bk.ru> <4F990C77.8040302@bk.ru> <0F7D3B1B3C4B894D824F5B822E3E5A17060BD024@IRSMSX102.ger.corp.intel.com> Message-ID: <4F9918CB.2090602@bk.ru> Thaks for the suggestion, but it seems that it is impossible to get the derivative of an expression by using quote: (%i15) expr:exp('sum(a[i]*b[i],i,1,3)); 3 ==== \ > a b / i i ==== i = 1 (%o15) %e (%i16) result: factor(sum(diff(expr,a[j])*c[j],j,1,3)); (%o16) 0 Without quote the result is: (%i17) expr:exp(sum(a[i]*b[i],i,1,3)); a b + a b + a b 3 3 2 2 1 1 (%o17) %e (%i18) result: factor(sum(diff(expr,a[j])*c[j],j,1,3)); a b + a b + a b 3 3 2 2 1 1 (%o18) %e (b c + b c + b c ) 3 3 2 2 1 1 So, it seems that quote cannot provide the result in form: n ==== \ > a b / i i n ==== ==== i = 1 \ (%o7) %e> b c / j j ==== j = 1 Other suggestions? > Dear Dmitry, > > Does a quote solve your problem? E.g.: > > (%i1) exp('sum(a[i]*b[i],i,1,3)) > > (%o1) %e^sum(a[i]*b[i],i,1,3) > > This is fairly persistent over reevaluation, but of cause at some point it might still be expanded. > > Best regards, > > Michael > > -----Original Message----- > From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Dmitry Shkirmanov > Sent: Thursday, April 26, 2012 10:51 AM > To: maxima at math.utexas.edu > Subject: [Maxima] do not expand sums explicitly > > Hello, list. Is it possible to don't expand sums explicitly? > Let's consider an example: > > (%i1) expr1: exp( sum(a[i]*b[i],i,1,3)); > a b + a b + a b > 3 3 2 2 1 1 > (%o1) %e > (%i2) result: factor(sum(c[j]*diff(expr1,a[j]),j,1,3)); > a b + a b + a b > 3 3 2 2 1 1 > (%o2) %e (b c + b c + b c ) > 3 3 2 2 1 1 > > Is it possible to get answer in form, that does not have explicit summation, something like this: > > exp( sum(a[i]*b[i],i,1,3)) * sum(b[i]*c[i],i,1,3)) ? > > I tried to do not specify the number of terms: > > > (%i3) expr2: exp( sum(a[i]*b[i],i,1,n)); > n > ==== > \ > > a b > / i i > ==== > i = 1 > (%o3) %e > > It is just what i need. But, it seems that is impossible to get derivative of such expression: > (%i4) diff(exp2,a[j]); > (%o4) 0 > It gives zero instead of b[j]*exp( sum(a[i]*b[i],i,1,3)), so i cannot cannot define: > > (%i6) result2: sum(c[j]*diff(expr2,a[j]),j,1,n); > > It gives zero instead of > > n > ==== > \ > > a b > / i i n > ==== ==== > i = 1 \ > (%o7) %e> b c > / j j > ==== > j = 1 Any ideas? > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > > From michael.soegtrop at intel.com Thu Apr 26 05:52:47 2012 From: michael.soegtrop at intel.com (Soegtrop, Michael) Date: Thu, 26 Apr 2012 10:52:47 +0000 Subject: [Maxima] do not expand sums explicitly In-Reply-To: <4F9918CB.2090602@bk.ru> References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <83FD4DC40F97654495E2C9AED47658360420FD59@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F97FCFD.2010406@bk.ru> , <83FD4DC40F97654495E2C9AED47658360420FE87@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F98E661.4070200@bk.ru> <4F990C77.8040302@bk.ru> <0F7D3B1B3C4B894D824F5B822E3E5A17060BD024@IRSMSX102.ger.corp.intel.com> <4F9918CB.2090602@bk.ru> Message-ID: <0F7D3B1B3C4B894D824F5B822E3E5A17060BD0B4@IRSMSX102.ger.corp.intel.com> Dear Dmitry, you could later force the evaluation of the sum by ev(expr, simpsum). result: factor(sum(diff(ev(expr,simpsum),a[j])*c[j],j,1,3)); %e^(a[3]*b[3]+a[2]*b[2]+a[1]*b[1])*(b[3]*c[3]+b[2]*c[2]+b[1]*c[1]) But I agree that it would be convenient, if maxima would be able to evaluate the differentiation, especially if the sum limits are not explicit. Best regards, Michael From piminusmeson at bk.ru Thu Apr 26 06:31:00 2012 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Thu, 26 Apr 2012 15:31:00 +0400 Subject: [Maxima] do not expand sums explicitly In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A17060BD0B4@IRSMSX102.ger.corp.intel.com> References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <83FD4DC40F97654495E2C9AED47658360420FD59@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F97FCFD.2010406@bk.ru> , <83FD4DC40F97654495E2C9AED47658360420FE87@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F98E661.4070200@bk.ru> <4F990C77.8040302@bk.ru> <0F7D3B1B3C4B894D824F5B822E3E5A17060BD024@IRSMSX102.ger.corp.intel.com> <4F9918CB.2090602@bk.ru> <0F7D3B1B3C4B894D824F5B822E3E5A17060BD0B4@IRSMSX102.ger.corp.intel.com> Message-ID: <4F9931F4.1040506@bk.ru> On 26.04.2012 14:52, Soegtrop, Michael wrote: > Dear Dmitry, > > you could later force the evaluation of the sum by ev(expr, simpsum). > > result: factor(sum(diff(ev(expr,simpsum),a[j])*c[j],j,1,3)); > > %e^(a[3]*b[3]+a[2]*b[2]+a[1]*b[1])*(b[3]*c[3]+b[2]*c[2]+b[1]*c[1]) > > But I agree that it would be convenient, if maxima would be able to evaluate the differentiation, especially if the sum limits are not explicit. > > Best regards, > > Michael > > > Thanks for reply. It is possible, but the point is to get the result in form n ==== \ > a b / i i n ==== ==== i = 1 \ (%o7) %e> b c / j j ==== j = 1 Of course,in this simple example the form of the output does not matter, but a real task is much more complicated, so it's difficult to collect terms by hands after applying ev(expr, simpsum) there. > Thaks for the suggestion, but it seems that it is impossible to get > the derivative of an expression by using quote: (%i15) > expr:exp('sum(a[i]*b[i],i,1,3)); 3 ==== \ > a b / i i ==== i = 1 > (%o15) %e (%i16) result: factor(sum(diff(expr,a[j])*c[j],j,1,3)); > (%o16) 0 Without quote the result is: (%i17) > expr:exp(sum(a[i]*b[i],i,1,3)); a b + a b + a b 3 3 2 2 1 1 (%o17) %e > (%i18) result: factor(sum(diff(expr,a[j])*c[j],j,1,3)); a b + a b + a > b 3 3 2 2 1 1 (%o18) %e (b c + b c + b c ) 3 3 2 2 1 1 So, it seems > that quote cannot provide the result in form: n ==== \ > a b / i i n > ==== ==== i = 1 \ (%o7) %e> b c / j j ==== j = 1 Other suggestions? > > Dear Dmitry, > > Does a quote solve your problem? E.g.: > > (%i1) > exp('sum(a[i]*b[i],i,1,3)) > > (%o1) %e^sum(a[i]*b[i],i,1,3) > > This > is fairly persistent over reevaluation, but of cause at some point it > might still be expanded. > > Best regards, > > Michael > > > -----Original Message----- > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Dmitry Shkirmanov > > Sent: Thursday, April 26, 2012 10:51 AM > To: maxima at math.utexas.edu > > Subject: [Maxima] do not expand sums explicitly > > Hello, list. Is > it possible to don't expand sums explicitly? > Let's consider an > example: > > (%i1) expr1: exp( sum(a[i]*b[i],i,1,3)); > a b + a b + a > b > 3 3 2 2 1 1 > (%o1) %e > (%i2) result: > factor(sum(c[j]*diff(expr1,a[j]),j,1,3)); > a b + a b + a b > 3 3 2 2 > 1 1 > (%o2) %e (b c + b c + b c ) > 3 3 2 2 1 1 > > Is it possible to > get answer in form, that does not have explicit summation, something > like this: > > exp( sum(a[i]*b[i],i,1,3)) * sum(b[i]*c[i],i,1,3)) ? > > > I tried to do not specify the number of terms: > > > (%i3) expr2: > exp( sum(a[i]*b[i],i,1,n)); > n > ==== > \ > > a b > / i i > ==== > i > = 1 > (%o3) %e > > It is just what i need. But, it seems that is > impossible to get derivative of such expression: > (%i4) > diff(exp2,a[j]); > (%o4) 0 > It gives zero instead of b[j]*exp( > sum(a[i]*b[i],i,1,3)), so i cannot cannot define: > > (%i6) result2: > sum(c[j]*diff(expr2,a[j]),j,1,n); > > It gives zero instead of > > n > > ==== > \ > > a b > / i i n > ==== ==== > i = 1 \ > (%o7) %e> b c > / j > j > ==== > j = 1 Any ideas? > > > _______________________________________________ > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > > > _______________________________________________ Maxima mailing list > Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From volkervannek at googlemail.com Thu Apr 26 06:57:19 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Thu, 26 Apr 2012 13:57:19 +0200 Subject: [Maxima] Expanion of vector expressions In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A17060BCFEA@IRSMSX102.ger.corp.intel.com> References: <0F7D3B1B3C4B894D824F5B822E3E5A17060BCFEA@IRSMSX102.ger.corp.intel.com> Message-ID: Hello Michael, I cannot reproduce what you experience. Not in 5.25.1, 5.26.0 and 5.27.0. Your output (%o1) is 1-dimensional, which normally isn't. Do you use maxima-init.lisp to set any environment for Maxima? Anyway here is a workaround for your problem. Mapping a lambda expression over your list. (%i1) display2d : false$ (%i2) map(lambda([i], i/(a+b+c+d+e+f)), [x,y,z]); (%o2) [x/(f+e+d+c+b+a),y/(f+e+d+c+b+a),z/(f+e+d+c+b+a)] (%i3) map(lambda([i], i/(a+b+c+d+e+f)), [x,y,z])[1]; (%o3) x/(f+e+d+c+b+a) HTH Volker van Nek 2012/4/26 Soegtrop, Michael > Dear Maxima Users, > > I came across a problem with vector simplification (using maxima 5.25.1, I > have problems with maxima 5.26). For products of a scalar and a vector, it > depends on the length of the scalar expression, if it is distributed over > the vector or not. > > E.g. with a 5 element denominator I get > > (%i1) [x,y,z]/(a+b+c+d+e); > > (%o1) [x/(e+d+c+b+a),y/(e+d+c+b+a),z/(e+d+c+b+a)] > > And with a 6 element denominator I get > > (%i2) [x,y,z]/(a+b+c+d+e+f); > > (%o2) [x,y,z]/(f+e+d+c+b+a) > > I found no way to expand such a vector*scalar expression, e.g. expand, > vectorsimp with expandall:true don't work. This is especially inconvenient > when I want to retrieve an element of the vector as in > > (%i3) ([x,y,z]/(a+b+c+d+e))[1]; > > (%o3) x/(e+d+c+b+a) > > but > > (%i4) ([x,y,z]/(a+b+c+d+e+f))[1]; > > (%o4) ([x,y,z]/(f+e+d+c+b+a))[1] > > Is there a way of doing this without writing my own function for this? > > Thanks & best regards, > > Michael > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From crruizbravo at gmail.com Thu Apr 26 08:35:22 2012 From: crruizbravo at gmail.com (Dissident Penguin) Date: Thu, 26 Apr 2012 13:35:22 +0000 (UTC) Subject: [Maxima] List on Maxima References: <4F5A0A5D.9010502@seoutopia.com> Message-ID: Maxima's indexing for Lists starts at 1 and for arrays at 0. If you are working with numbers only (i.e., no symbolic elements), it is better to use arrays instead of lists. It will reduce your execution times for large array operations. dp From michael.soegtrop at intel.com Thu Apr 26 11:07:17 2012 From: michael.soegtrop at intel.com (Soegtrop, Michael) Date: Thu, 26 Apr 2012 16:07:17 +0000 Subject: [Maxima] Expanion of vector expressions In-Reply-To: References: <0F7D3B1B3C4B894D824F5B822E3E5A17060BCFEA@IRSMSX102.ger.corp.intel.com> Message-ID: <0F7D3B1B3C4B894D824F5B822E3E5A17060BD2E7@IRSMSX102.ger.corp.intel.com> Dear Volker, Thanks for the answer and for trying to reproduce it. I found the problem: somehow a declare(f, nonscalar) got in, which I overlooked. So as soon as an f is in the denominator, expansion is blocked. Best regards, Michael From toy.raymond at gmail.com Thu Apr 26 11:50:32 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 26 Apr 2012 09:50:32 -0700 Subject: [Maxima] Loading gentran In-Reply-To: References: <20120409225208.5698deed@sapling2> <20120410125021.0b7cbd97@sapling2> <20120410131225.3abfbf0d@sapling2> <20120410133854.7fede534@sapling2> Message-ID: On Tue, Apr 10, 2012 at 12:03 PM, Raymond Toy wrote: > > > On Tue, Apr 10, 2012 at 11:38 AM, Hal Finkel wrote: > >> >> Also, I think that it would make sense to rename the file for import >> into trunk so that load(gentran); works as one might expect. >> > > Yes, I think that's a good idea. I'll check in the changes soon. > > Sorry for the delay. I've moved the file to gentran.lisp and fixed the loading. This is checked in now. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Thu Apr 26 13:27:05 2012 From: woollett at charter.net (Edwin Woollett) Date: Thu, 26 Apr 2012 11:27:05 -0700 Subject: [Maxima] dilogarithm float for complex arg? Message-ID: <15B4F66EA3D84ADAB5940917E89021E9@edwinc367e16bd> An integral which returns an expression in terms of the dilogarithm function Li[2](z), in which z is in general complex, is ------------------------------------------- (%i11) integrate(log(sin(x)),x,1,2); (%o11) -2*%i*atan(sin(2)/(cos(2)+1))-2*%i*atan(sin(2)/(cos(2)-1)) +2*log(sin(2))-log(2*cos(2)+2) -log(2-2*cos(2)) +%i*atan(sin(1)/(cos(1)+1)) +%i*atan(sin(1)/(cos(1)-1))-log(sin(1)) +log(2*cos(1)+2)/2+log(2-2*cos(1))/2 +%i*li[2](%e^(2*%i))+%i*li[2](-%e^(2*%i)) -%i*li[2](%e^%i)-%i*li[2](-%e^%i)+3*%i/2 --------------------------------------------- quadpack gives a numerical value -0.0455 for this integral, but maxima doesn't know how to get numbers for Li[2](z) if z is complex ------------------------------------ (%i12) float(li[2](1+%i)); (%o12) li[2](%i+1.0) ---------------------------------- wolframalpha gives (0.62 + 1.5 i) approx for this float (using PolyLog[2, 1 + I]). Ted Woollett From toy.raymond at gmail.com Thu Apr 26 14:32:43 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 26 Apr 2012 12:32:43 -0700 Subject: [Maxima] dilogarithm float for complex arg? In-Reply-To: <15B4F66EA3D84ADAB5940917E89021E9@edwinc367e16bd> References: <15B4F66EA3D84ADAB5940917E89021E9@edwinc367e16bd> Message-ID: On Thu, Apr 26, 2012 at 11:27 AM, Edwin Woollett wrote: > > An integral which returns an expression in terms > of the dilogarithm function Li[2](z), in which z is > in general complex, is > ------------------------------**------------- > (%i11) integrate(log(sin(x)),x,1,2); > > (%o11) -2*%i*atan(sin(2)/(cos(2)+1))-**2*%i*atan(sin(2)/(cos(2)-1)) > +2*log(sin(2))-log(2*cos(2)+2) > -log(2-2*cos(2)) > +%i*atan(sin(1)/(cos(1)+1)) > +%i*atan(sin(1)/(cos(1)-1))-** > log(sin(1)) > +log(2*cos(1)+2)/2+log(2-2***cos(1))/2 > +%i*li[2](%e^(2*%i))+%i*li[2](** > -%e^(2*%i)) > -%i*li[2](%e^%i)-%i*li[2](-%e^** > %i)+3*%i/2 > ------------------------------**--------------- > quadpack gives a numerical value -0.0455 for this integral, > but maxima doesn't know how to get numbers for Li[2](z) > if z is complex > Known problem. See also the thread from http://www.math.utexas.edu/pipermail/maxima/2012/028480.html for a possible solution. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From mxue at vroomlab.com Thu Apr 26 16:25:57 2012 From: mxue at vroomlab.com (Michael) Date: Thu, 26 Apr 2012 21:25:57 +0000 (UTC) Subject: [Maxima] error when compiling maxima-5.26.0 on solaris 10 References: <15B4F66EA3D84ADAB5940917E89021E9@edwinc367e16bd> Message-ID: Hello Maxima Jedis, When building maxima-5.26.0 (solaris10 on sun sparc ultra 10), I got: ... 0 errors, 4 warnings make[1]: *** [binary-clisp/maxima.mem] Error 1 make[1]: Leaving directory `/home/mxue/maxima-5.26.0/src' make: *** [all-recursive] Error 1 I am using GNU CLISP 2.47 Your help is greatly appreciated. From toy.raymond at gmail.com Thu Apr 26 17:21:32 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 26 Apr 2012 15:21:32 -0700 Subject: [Maxima] error when compiling maxima-5.26.0 on solaris 10 In-Reply-To: References: <15B4F66EA3D84ADAB5940917E89021E9@edwinc367e16bd> Message-ID: On Thu, Apr 26, 2012 at 2:25 PM, Michael wrote: > Hello Maxima Jedis, > When building maxima-5.26.0 (solaris10 on sun sparc ultra 10), I got: > > ... > 0 errors, 4 warnings > make[1]: *** [binary-clisp/maxima.mem] Error 1 > make[1]: Leaving directory `/home/mxue/maxima-5.26.0/src' > make: *** [all-recursive] Error 1 > > That doesn't say anything about what failed. We need more information. Any other error or warning messages? Having said that, I have built maxima with clisp on a sparc before. I don't recall any issues, but that was quite a while ago. I have done a build of maxima with cmucl and ecl on sparc a few months ago. That worked. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Thu Apr 26 21:56:39 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 26 Apr 2012 19:56:39 -0700 Subject: [Maxima] error when compiling maxima-5.26.0 on solaris 10 In-Reply-To: References: <15B4F66EA3D84ADAB5940917E89021E9@edwinc367e16bd> Message-ID: <4F9A0AE7.6090807@gmail.com> On 4/26/12 3:21 PM, Raymond Toy wrote: > > > On Thu, Apr 26, 2012 at 2:25 PM, Michael > wrote: > > Hello Maxima Jedis, > When building maxima-5.26.0 (solaris10 on sun sparc ultra 10), I got: > > ... > 0 errors, 4 warnings > make[1]: *** [binary-clisp/maxima.mem] Error 1 > make[1]: Leaving directory `/home/mxue/maxima-5.26.0/src' > make: *** [all-recursive] Error 1 > > > That doesn't say anything about what failed. We need more information. > Any other error or warning messages? > > Having said that, I have built maxima with clisp on a sparc before. I > don't recall any issues, but that was quite a while ago. I have done a > build of maxima with cmucl and ecl on sparc a few months ago. That worked. Just tried it out. Had no problems build maxima (current git) with clisp 2.47 and cmucl 2012-04 and gcl 2.6.8. The testsuite hasn't finished yet, but I'm pretty sure they will pass. Ray From toy.raymond at gmail.com Thu Apr 26 21:56:39 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 26 Apr 2012 19:56:39 -0700 Subject: [Maxima] error when compiling maxima-5.26.0 on solaris 10 In-Reply-To: References: <15B4F66EA3D84ADAB5940917E89021E9@edwinc367e16bd> Message-ID: <4F9A0AE7.6090807@gmail.com> On 4/26/12 3:21 PM, Raymond Toy wrote: > > > On Thu, Apr 26, 2012 at 2:25 PM, Michael > wrote: > > Hello Maxima Jedis, > When building maxima-5.26.0 (solaris10 on sun sparc ultra 10), I got: > > ... > 0 errors, 4 warnings > make[1]: *** [binary-clisp/maxima.mem] Error 1 > make[1]: Leaving directory `/home/mxue/maxima-5.26.0/src' > make: *** [all-recursive] Error 1 > > > That doesn't say anything about what failed. We need more information. > Any other error or warning messages? > > Having said that, I have built maxima with clisp on a sparc before. I > don't recall any issues, but that was quite a while ago. I have done a > build of maxima with cmucl and ecl on sparc a few months ago. That worked. Just tried it out. Had no problems build maxima (current git) with clisp 2.47 and cmucl 2012-04 and gcl 2.6.8. The testsuite hasn't finished yet, but I'm pretty sure they will pass. Ray From robert.dodier at gmail.com Fri Apr 27 00:53:26 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 27 Apr 2012 05:53:26 +0000 (UTC) Subject: [Maxima] do not expand sums explicitly References: <83FD4DC40F97654495E2C9AED47658360420F2D2@BL2PRD0710MB361.namprd07.prod.outlook.com> <83FD4DC40F97654495E2C9AED47658360420FD59@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F97FCFD.2010406@bk.ru> <83FD4DC40F97654495E2C9AED47658360420FE87@BL2PRD0710MB361.namprd07.prod.outlook.com> <4F98E661.4070200@bk.ru> <4F990C77.8040302@bk.ru> Message-ID: On 2012-04-26, Dmitry Shkirmanov wrote: > (%i3) expr2: exp( sum(a[i]*b[i],i,1,n)); > n > ==== > \ > > a b > / i i > ==== > i = 1 > (%o3) %e > > It is just what i need. But, it seems that is impossible to get derivative of such expression: > (%i4) diff(exp2,a[j]); > (%o4) 0 Maxima doesn't know much about differentiating sums. I suppose it can be done with simplification rules (tellsimp). After thinking about it for a few minutes, I don't see a solution. I'll think about it over the weekend. Basically we need a rule that is something like diff (sum (foo (a[i]), i, 1, n), a[j]) --> sum (delta (i, j) * diff (foo (a[i]), a[j]), i, 1, n) --> diff (foo (a[j]), a[j]) which is probably not too hard, but the devil is in the details. best Robert Dodier From wilhelm.haager at htlstp.ac.at Fri Apr 27 05:16:08 2012 From: wilhelm.haager at htlstp.ac.at (Wilhelm Haager) Date: Fri, 27 Apr 2012 12:16:08 +0200 Subject: [Maxima] enforce real solutions Message-ID: <8dc000f5fd861538c541835c455627bd@localhost> Hi! Solving the equation solve(a*x**3+x*(1-x**2)=0,x); gives imaginary results: [x = -%i/sqrt(a-1),x = %i/sqrt(a-1),x = 0] I would like to have the results in the following form, i.e. real: [x = -1/sqrt(1-a),x = 1/sqrt(1-a),x = 0] assume(a<1) gives the desired result, but I require real solutions in automated calculations where I cannot make any assumptions in advance. Before the equation is solved, I cannot see what I have to assume. Is there a simple way (without subsequent maps and other tricky transformations) to enforce that? (algsys with realonly=true does not work in the desired way). Thanks in advance Wilhelm Haager From andre.maute at gmx.de Fri Apr 27 06:08:14 2012 From: andre.maute at gmx.de (andre maute) Date: Fri, 27 Apr 2012 13:08:14 +0200 Subject: [Maxima] enforce real solutions In-Reply-To: <8dc000f5fd861538c541835c455627bd@localhost> References: <8dc000f5fd861538c541835c455627bd@localhost> Message-ID: <4F9A7E1E.6020301@gmx.de> On 04/27/2012 12:16 PM, Wilhelm Haager wrote: > Hi! > > Solving the equation > > solve(a*x**3+x*(1-x**2)=0,x); > > gives imaginary results: > > [x = -%i/sqrt(a-1),x = %i/sqrt(a-1),x = 0] > > I would like to have the results in the following form, i.e. real: > > [x = -1/sqrt(1-a),x = 1/sqrt(1-a),x = 0] > > assume(a<1) gives the desired result, but I require real solutions in > automated calculations > where I cannot make any assumptions in advance. > Before the equation is solved, I cannot see what I have to assume. > > Is there a simple way (without subsequent maps and other tricky > transformations) to enforce that? > (algsys with realonly=true does not work in the desired way). Doesn't the casus irreducibilis apply here? See http://en.wikipedia.org/wiki/Casus_irreducibilis > Thanks in advance > Wilhelm Haager > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From andre.maute at gmx.de Fri Apr 27 06:12:33 2012 From: andre.maute at gmx.de (andre maute) Date: Fri, 27 Apr 2012 13:12:33 +0200 Subject: [Maxima] enforce real solutions In-Reply-To: <4F9A7E1E.6020301@gmx.de> References: <8dc000f5fd861538c541835c455627bd@localhost> <4F9A7E1E.6020301@gmx.de> Message-ID: <4F9A7F21.5060500@gmx.de> On 04/27/2012 01:08 PM, andre maute wrote: > On 04/27/2012 12:16 PM, Wilhelm Haager wrote: >> Hi! >> >> Solving the equation >> >> solve(a*x**3+x*(1-x**2)=0,x); >> >> gives imaginary results: >> >> [x = -%i/sqrt(a-1),x = %i/sqrt(a-1),x = 0] >> >> I would like to have the results in the following form, i.e. real: >> >> [x = -1/sqrt(1-a),x = 1/sqrt(1-a),x = 0] >> >> assume(a<1) gives the desired result, but I require real solutions in >> automated calculations >> where I cannot make any assumptions in advance. >> Before the equation is solved, I cannot see what I have to assume. >> >> Is there a simple way (without subsequent maps and other tricky >> transformations) to enforce that? >> (algsys with realonly=true does not work in the desired way). > Doesn't the casus irreducibilis apply here? > > See http://en.wikipedia.org/wiki/Casus_irreducibilis Oh sorry, for the noise, x=0 is a solution. Andre From XeCycle at Gmail.com Fri Apr 27 08:44:32 2012 From: XeCycle at Gmail.com (XeCycle) Date: Fri, 27 Apr 2012 21:44:32 +0800 Subject: [Maxima] What are the magic performed by (cl-user::run)? Message-ID: <87397pthkv.fsf@Gmail.com> Hi, I want to embed maxima in my common lisp program, i.e. calling maxima routines directly. I tried embeddable maxima, which works in most cases except with some packages, namely FFT. That one doesn't load. Some else are loadable with the ($load "vect") syntax. My normal maxima installation can load FFT via load(fft);, but cannot accept ($load "fft"), unless I do (cl-user::run) then to_lisp(); and type that. Seems the (run) did some magic? Starting maxima and return to lisp is not acceptable for my task, can I do what it did to setup my environment correctly? Thanks. -- Carl Lei (XeCycle) Department of Physics, Shanghai Jiao Tong University OpenPGP public key: 7795E591 Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 489 bytes Desc: not available URL: From XeCycle at Gmail.com Fri Apr 27 09:07:45 2012 From: XeCycle at Gmail.com (XeCycle) Date: Fri, 27 Apr 2012 22:07:45 +0800 Subject: [Maxima] What are the magic performed by (cl-user::run)? References: <87397pthkv.fsf@Gmail.com> Message-ID: <87ty05s1xq.fsf@Gmail.com> XeCycle writes: > Hi, > > I want to embed maxima in my common lisp program, i.e. calling > maxima routines directly. I tried embeddable maxima, which works > in most cases except with some packages, namely FFT. That one > doesn't load. Some else are loadable with the ($load "vect") > syntax. My normal maxima installation can load FFT via > load(fft);, but cannot accept ($load "fft"), unless I do > (cl-user::run) then to_lisp(); and type that. Seems the (run) > did some magic? Starting maxima and return to lisp is not > acceptable for my task, can I do what it did to setup my > environment correctly? Yup, found a workaround. Start maxima normally, to_lisp(), then save the core image. Loading this core image afterwards works. -- Carl Lei (XeCycle) Department of Physics, Shanghai Jiao Tong University OpenPGP public key: 7795E591 Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591 From rswarbrick at gmail.com Fri Apr 27 09:42:54 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 27 Apr 2012 15:42:54 +0100 Subject: [Maxima] What are the magic performed by (cl-user::run)? References: <87397pthkv.fsf@Gmail.com> Message-ID: XeCycle writes: > ... Seems the (run) > did some magic? Starting maxima and return to lisp is not > acceptable for my task, can I do what it did to setup my > environment correctly? RUN does indeed do some setting-up tasks. You'll find its code in src/init-cl.lisp (at line 550 or so). I'd try calling some of the functions inside the CATCH form and see which one makes things work. To the rest of the list: Should there be an init-maxima-and-make-it-work-please function that RUN calls? Then people that want to embed maxima into another CL image wouldn't have to guess about what's needed. Yes, I know you can load your code into a maxima image, but if you don't want a maxima REPL, that doesn't really help (since RUN brings one up). Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From XeCycle at Gmail.com Fri Apr 27 10:24:45 2012 From: XeCycle at Gmail.com (XeCycle) Date: Fri, 27 Apr 2012 23:24:45 +0800 Subject: [Maxima] What are the magic performed by (cl-user::run)? References: <87397pthkv.fsf@Gmail.com> Message-ID: <87pqatryde.fsf@Gmail.com> Rupert Swarbrick writes: [...] > RUN does indeed do some setting-up tasks. You'll find its code in > src/init-cl.lisp (at line 550 or so). I'd try calling some of the > functions inside the CATCH form and see which one makes things work. Thanks for the info, but after some comparison I think using a generated core image is better for my usage, since it starts fast. Why don't we build a complete core image in our distribution, without the need for these setup at run-time? It should also be easier for a lisp programmer to embed maxima, simply by using the core image from their installation of maxima from OS repo. -- Carl Lei (XeCycle) Department of Physics, Shanghai Jiao Tong University OpenPGP public key: 7795E591 Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 489 bytes Desc: not available URL: From toy.raymond at gmail.com Fri Apr 27 10:44:56 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 27 Apr 2012 08:44:56 -0700 Subject: [Maxima] What are the magic performed by (cl-user::run)? In-Reply-To: References: <87397pthkv.fsf@Gmail.com> Message-ID: On Fri, Apr 27, 2012 at 7:42 AM, Rupert Swarbrick wrote: > XeCycle writes: > > ... Seems the (run) > > did some magic? Starting maxima and return to lisp is not > > acceptable for my task, can I do what it did to setup my > > environment correctly? > > RUN does indeed do some setting-up tasks. You'll find its code in > src/init-cl.lisp (at line 550 or so). I'd try calling some of the > functions inside the CATCH form and see which one makes things work. > > To the rest of the list: Should there be an > init-maxima-and-make-it-work-please function that RUN calls? Then people > that want to embed maxima into another CL image wouldn't have to guess > about what's needed. Yes, I know you can load your code into a maxima > image, but if you don't want a maxima REPL, that doesn't really help > (since RUN brings one up). > Stick to_lisp() in your .maxima/maxima-init.mac file. :-) Even if I wanted an embedded maxima, I think having a repl is invaluable. What would you do with an embedded maxima other than to compute symbolic (and numeric) stuff with maybe some plots? I would not enjoy using a regular lisp repl to interact with maxima's symbolic stuff. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Fri Apr 27 10:51:53 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 27 Apr 2012 08:51:53 -0700 Subject: [Maxima] enforce real solutions In-Reply-To: <4F9A7F21.5060500@gmx.de> References: <8dc000f5fd861538c541835c455627bd@localhost> <4F9A7E1E.6020301@gmx.de> <4F9A7F21.5060500@gmx.de> Message-ID: On Fri, Apr 27, 2012 at 4:12 AM, andre maute wrote: > On 04/27/2012 01:08 PM, andre maute wrote: > >> On 04/27/2012 12:16 PM, Wilhelm Haager wrote: >> >>> Hi! >>> >>> Solving the equation >>> >>> solve(a*x**3+x*(1-x**2)=0,x); >>> >>> gives imaginary results: >>> >>> [x = -%i/sqrt(a-1),x = %i/sqrt(a-1),x = 0] >>> >>> I would like to have the results in the following form, i.e. real: >>> >>> [x = -1/sqrt(1-a),x = 1/sqrt(1-a),x = 0] >>> >>> assume(a<1) gives the desired result, but I require real solutions in >>> automated calculations >>> where I cannot make any assumptions in advance. >>> Before the equation is solved, I cannot see what I have to assume. >>> >>> Is there a simple way (without subsequent maps and other tricky >>> transformations) to enforce that? >>> (algsys with realonly=true does not work in the desired way). >>> >> Doesn't the casus irreducibilis apply here? >> >> See http://en.wikipedia.org/wiki/**Casus_irreducibilis >> > > Oh sorry, for the noise, x=0 is a solution. > I think this is still a valid point. I assume Wilhelm is not just going to solve that one equation. Even in this example, I don't know how maxima can possibly tell what the "right" expression would be. The equation being solved reduces to (a-1)*x^2+1 = 0. The straightforward solution is x = sqrt(-1/(a-1)). How would maxima know that multiplying the equation by -1 and solving gives a "nicer" answer? Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Fri Apr 27 11:31:22 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 27 Apr 2012 09:31:22 -0700 Subject: [Maxima] asympa.mac In-Reply-To: References: Message-ID: On Wed, Apr 25, 2012 at 10:58 AM, Dan wrote: > > Dear All, > > I just stumbled across the asympa.mac package. Looks interesting - > but does there exist any documentation, please? > > Don't know of any, but there is the message http://www.ma.utexas.edu/pipermail/maxima/2003/004844.html that shows some info. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri Apr 27 13:22:42 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 27 Apr 2012 11:22:42 -0700 Subject: [Maxima] display of "lisp arrays" from make_array Message-ID: <4F9AE3F2.1050601@eecs.berkeley.edu> I wonder if there is a reason to use lisp display rather than maxima display to show the results of make_array. foo:make_array(any,5); foo[0]:2*x; foo; foo displays as {Lisp Array: #(((MTIMES SIMP) 2 $X) NIL)} There is a way around this, sortof. foo: apply(array,[?gensym(),5]) From toy.raymond at gmail.com Fri Apr 27 14:33:56 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 27 Apr 2012 12:33:56 -0700 Subject: [Maxima] display of "lisp arrays" from make_array In-Reply-To: <4F9AE3F2.1050601@eecs.berkeley.edu> References: <4F9AE3F2.1050601@eecs.berkeley.edu> Message-ID: On Fri, Apr 27, 2012 at 11:22 AM, Richard Fateman wrote: > I wonder if there is a reason to use lisp display rather than > maxima display to show the results of make_array. > > foo:make_array(any,5); > foo[0]:2*x; > foo; > > foo displays as > {Lisp Array: #(((MTIMES SIMP) 2 $X) NIL)} > > Shouldn't they be displayed in some unique way so you can tell the difference between a list and an array? Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Ronis at McGill.CA Fri Apr 27 14:32:51 2012 From: David.Ronis at McGill.CA (David Ronis) Date: Fri, 27 Apr 2012 15:32:51 -0400 Subject: [Maxima] Simplification not working as hoped. Message-ID: <1335555171.20411.2.camel@ronispc.chem.mcgill.ca> I have an expression that ultimately becomes: f:(exp(x)+exp(x/2))/(exp(x/2)+1); I've tried various simplification routines: ratsimp(f); trigsimp(f); radcan(f); The only one that works is radcan(). Is there a flag that would make the other ones work? Alternately, is there a function that forces the exponentials to be represented as sums of hyperbolic functions? From vi5u0-maxima at yahoo.co.uk Fri Apr 27 15:23:31 2012 From: vi5u0-maxima at yahoo.co.uk (Dan) Date: Fri, 27 Apr 2012 21:23:31 +0100 (BST) Subject: [Maxima] asympa.mac In-Reply-To: References: Message-ID: > On Wed, Apr 25, 2012 at 10:58 AM, Dan wrote: >> I just stumbled across the asympa.mac package. Looks interesting - >> but does there exist any documentation, please? On Fri, 27 Apr 2012, Raymond Toy wrote: > Don't know of any, but there is the message > http://www.ma.utexas.edu/pipermail/maxima/2003/004844.html that > shows some info. Thanks Raymond. That message showcases the ability of asympa.mac to obtain asymptotic expansions of ratsimped or radcanned algebraic expressions, by (iteratively) picking the largest-order atom in the numerator and the largest-order atom in the denominator. But what I had in mind was more in the way of obtaining asymptotic expansions for integrals, or for solutions to differential equations. For example, I tried load ("asympa") ; put(x,'inf,'limit) ; asympseries(integrate(exp(-x*t)/(1-t),t,0,inf),1) ; pos ; I was hoping for the answer asymp(1/x), but instead got a noun form. This might mean that asympa.mac doesn't know about Watson's lemma, or it might just mean that I'm querying it wrongly. I was hoping for some documentation that would tell me which - then, similarly, for documentation on whether asympa.mac knows about, e.g., Laplace's method, the Riemann-Lebesgue lemma, the method of stationary phase, the method of steepest descents, and/or the Liouville-Green method. -- Thanks again, Dan From fateman at eecs.berkeley.edu Fri Apr 27 15:46:49 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 27 Apr 2012 13:46:49 -0700 Subject: [Maxima] asympa.mac In-Reply-To: References: Message-ID: <4F9B05B9.8050906@eecs.berkeley.edu> Look at page 181 of http://www.cs.berkeley.edu/~fateman/macsyma/docs/refman16.pdf for the description of this from the Macsyma manual. Good luck. RJF On 4/27/2012 1:23 PM, Dan wrote: >> On Wed, Apr 25, 2012 at 10:58 AM, Dan wrote: > >>> I just stumbled across the asympa.mac package. Looks interesting - >>> but does there exist any documentation, please? > > On Fri, 27 Apr 2012, Raymond Toy wrote: > >> Don't know of any, but there is the message >> http://www.ma.utexas.edu/pipermail/maxima/2003/004844.html that >> shows some info. > > Thanks Raymond. That message showcases the ability of asympa.mac to > obtain asymptotic expansions of ratsimped or radcanned algebraic > expressions, by (iteratively) picking the largest-order atom in the > numerator and the largest-order atom in the denominator. > > But what I had in mind was more in the way of obtaining asymptotic > expansions for integrals, or for solutions to differential equations. > For example, I tried > > load ("asympa") ; > put(x,'inf,'limit) ; > asympseries(integrate(exp(-x*t)/(1-t),t,0,inf),1) ; > pos ; > > I was hoping for the answer asymp(1/x), but instead got a noun form. > This might mean that asympa.mac doesn't know about Watson's lemma, or > it might just mean that I'm querying it wrongly. I was hoping for > some documentation that would tell me which - then, similarly, for > documentation on whether asympa.mac knows about, e.g., Laplace's > method, the Riemann-Lebesgue lemma, the method of stationary phase, > the method of steepest descents, and/or the Liouville-Green method. > From macrakis at alum.mit.edu Fri Apr 27 16:00:17 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 27 Apr 2012 17:00:17 -0400 Subject: [Maxima] Simplification not working as hoped. In-Reply-To: <1335555171.20411.2.camel@ronispc.chem.mcgill.ca> References: <1335555171.20411.2.camel@ronispc.chem.mcgill.ca> Message-ID: We might be able to help if you could share your original expression. But I don't really understand your question. You say that radcan puts your expression in the form you want. So use radcan! -- Why would you expect ratsimp or trigsimp or default simplification to do the same thing as radcan? As for representing exponentials as hyperbolic functions, here's an approach that will often work: (%i1) ex: %e^(a*x) + %e^(x-b)$ (%i3) subst(%e^(qq*%i*x),%e,ex); (%o3) %e^(%i*a*qq*x^2)+%e^(%i*qq*x*(x-b)) (%i4) rectform(%); (%o4) %i*(sin(a*qq*x^2)+sin(qq*x*(x-b)))+cos(a*qq*x^2)+cos(qq*x*(x-b)) (%i5) subst(-%i,qq,%); (%o5) %i*(-%i*sinh(a*x^2)-%i*sinh(x*(x-b)))+cosh(a*x^2)+cosh(x*(x-b)) (%i6) ratsimp(%); (%o6) sinh(x^2-b*x)+cosh(x^2-b*x)+sinh(a*x^2)+cosh(a*x^2) or...: (%i8) demoivre(%o3); (%o8) %i*sin(a*qq*x^2)+cos(a*qq*x^2)+%i*sin(qq*x*(x-b))+cos(qq*x*(x-b)) (%i9) subst(-%i,qq,%); (%o9) sinh(a*x^2)+cosh(a*x^2)+sinh(x*(x-b))+cosh(x*(x-b)) Does this help in your case? -s ----------------------------------- On Fri, Apr 27, 2012 at 15:32, David Ronis wrote: > I have an expression that ultimately becomes: > > f:(exp(x)+exp(x/2))/(exp(x/2)+1); > > I've tried various simplification routines: > > > ratsimp(f); > trigsimp(f); > radcan(f); > > > The only one that works is radcan(). Is there a flag that > would make the other ones work? Alternately, is there a function that > forces the exponentials to be represented as sums of hyperbolic > functions? > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Ronis at McGill.CA Fri Apr 27 16:07:48 2012 From: David.Ronis at McGill.CA (David Ronis) Date: Fri, 27 Apr 2012 17:07:48 -0400 Subject: [Maxima] Simplification not working as hoped. In-Reply-To: References: <1335555171.20411.2.camel@ronispc.chem.mcgill.ca> Message-ID: <1335560868.3412.4.camel@ronispc.chem.mcgill.ca> Thanks for the reply Stavros, I thought I had given the orignal expression: f:(exp(x)+exp(x/2))/(exp(x/2)+1); I get there using ratsimp or factor on the result of a limit from something a bit more complicated. It's the next simplification that doesn't always work, as I described. Radcan works, but I think that factor should be able to factor something as simple as my f. David On Fri, 2012-04-27 at 17:00 -0400, Stavros Macrakis wrote: > We might be able to help if you could share your original expression. > > > But I don't really understand your question. You say that radcan puts > your expression in the form you want. So use radcan! -- Why would you > expect ratsimp or trigsimp or default simplification to do the same > thing as radcan? > > > As for representing exponentials as hyperbolic functions, here's an > approach that will often work: > > > (%i1) ex: %e^(a*x) + %e^(x-b)$ > > > (%i3) subst(%e^(qq*%i*x),%e,ex); > (%o3) %e^(%i*a*qq*x^2)+%e^(%i*qq*x*(x-b)) > > > (%i4) rectform(%); > (%o4) %i*(sin(a*qq*x^2)+sin(qq*x*(x-b)))+cos(a*qq*x^2)+cos(qq*x*(x-b)) > (%i5) subst(-%i,qq,%); > (%o5) %i*(-%i*sinh(a*x^2)-%i*sinh(x*(x-b)))+cosh(a*x^2)+cosh(x*(x-b)) > (%i6) ratsimp(%); > (%o6) sinh(x^2-b*x)+cosh(x^2-b*x)+sinh(a*x^2)+cosh(a*x^2) > > > or...: > > > (%i8) demoivre(%o3); > (%o8) %i*sin(a*qq*x^2)+cos(a*qq*x^2)+% > i*sin(qq*x*(x-b))+cos(qq*x*(x-b)) > (%i9) subst(-%i,qq,%); > (%o9) sinh(a*x^2)+cosh(a*x^2)+sinh(x*(x-b))+cosh(x*(x-b)) > > > Does this help in your case? > > > -s > > > ----------------------------------- > > On Fri, Apr 27, 2012 at 15:32, David Ronis > wrote: > I have an expression that ultimately becomes: > > f:(exp(x)+exp(x/2))/(exp(x/2)+1); > > I've tried various simplification routines: > > > ratsimp(f); > trigsimp(f); > radcan(f); > > > The only one that works is radcan(). Is there a flag that > would make the other ones work? Alternately, is there a > function that > forces the exponentials to be represented as sums of > hyperbolic > functions? > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > From macrakis at alum.mit.edu Fri Apr 27 16:16:07 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 27 Apr 2012 17:16:07 -0400 Subject: [Maxima] enforce real solutions In-Reply-To: <8dc000f5fd861538c541835c455627bd@localhost> References: <8dc000f5fd861538c541835c455627bd@localhost> Message-ID: What is the family of equations you are solving? If they are all of some common generic form (with parameters), perhaps you could solve them generically, and write a simple program to solve specific cases in the form you prefer. Your example is really just x*(quadratic), which makes the problem extremely simple. -s On Fri, Apr 27, 2012 at 06:16, Wilhelm Haager wrote: > Hi! > > Solving the equation > > solve(a*x**3+x*(1-x**2)=0,x); > > gives imaginary results: > > [x = -%i/sqrt(a-1),x = %i/sqrt(a-1),x = 0] > > I would like to have the results in the following form, i.e. real: > > [x = -1/sqrt(1-a),x = 1/sqrt(1-a),x = 0] > > assume(a<1) gives the desired result, but I require real solutions in > automated calculations > where I cannot make any assumptions in advance. > Before the equation is solved, I cannot see what I have to assume. > > Is there a simple way (without subsequent maps and other tricky > transformations) to enforce that? > (algsys with realonly=true does not work in the desired way). > > Thanks in advance > Wilhelm Haager > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Fri Apr 27 16:21:08 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 27 Apr 2012 17:21:08 -0400 Subject: [Maxima] Simplification not working as hoped. In-Reply-To: <1335560868.3412.4.camel@ronispc.chem.mcgill.ca> References: <1335555171.20411.2.camel@ronispc.chem.mcgill.ca> <1335560868.3412.4.camel@ronispc.chem.mcgill.ca> Message-ID: The way you worded it, it sounded as though f was the form you were looking for...! radcan is Maxima's 'specialist' in algebraic relations among exponentials, so is the right tool here. Another approach which helps the rational function package understand what is going on is subst(x/2,y,factor(subst(2*y,x,f))) . -s On Fri, Apr 27, 2012 at 17:07, David Ronis wrote: > Thanks for the reply Stavros, I thought I had given the orignal > expression: > > f:(exp(x)+exp(x/2))/(exp(x/2)+1); > > I get there using ratsimp or factor on the result of a limit from > something a bit more complicated. It's the next simplification that > doesn't always work, as I described. Radcan works, but I think that > factor should be able to factor something as simple as my f. > > David > > > On Fri, 2012-04-27 at 17:00 -0400, Stavros Macrakis wrote: > > We might be able to help if you could share your original expression. > > > > > > But I don't really understand your question. You say that radcan puts > > your expression in the form you want. So use radcan! -- Why would you > > expect ratsimp or trigsimp or default simplification to do the same > > thing as radcan? > > > > > > As for representing exponentials as hyperbolic functions, here's an > > approach that will often work: > > > > > > (%i1) ex: %e^(a*x) + %e^(x-b)$ > > > > > > (%i3) subst(%e^(qq*%i*x),%e,ex); > > (%o3) %e^(%i*a*qq*x^2)+%e^(%i*qq*x*(x-b)) > > > > > > (%i4) rectform(%); > > (%o4) %i*(sin(a*qq*x^2)+sin(qq*x*(x-b)))+cos(a*qq*x^2)+cos(qq*x*(x-b)) > > (%i5) subst(-%i,qq,%); > > (%o5) %i*(-%i*sinh(a*x^2)-%i*sinh(x*(x-b)))+cosh(a*x^2)+cosh(x*(x-b)) > > (%i6) ratsimp(%); > > (%o6) sinh(x^2-b*x)+cosh(x^2-b*x)+sinh(a*x^2)+cosh(a*x^2) > > > > > > or...: > > > > > > (%i8) demoivre(%o3); > > (%o8) %i*sin(a*qq*x^2)+cos(a*qq*x^2)+% > > i*sin(qq*x*(x-b))+cos(qq*x*(x-b)) > > (%i9) subst(-%i,qq,%); > > (%o9) sinh(a*x^2)+cosh(a*x^2)+sinh(x*(x-b))+cosh(x*(x-b)) > > > > > > Does this help in your case? > > > > > > -s > > > > > > ----------------------------------- > > > > On Fri, Apr 27, 2012 at 15:32, David Ronis > > wrote: > > I have an expression that ultimately becomes: > > > > f:(exp(x)+exp(x/2))/(exp(x/2)+1); > > > > I've tried various simplification routines: > > > > > > ratsimp(f); > > trigsimp(f); > > radcan(f); > > > > > > The only one that works is radcan(). Is there a flag that > > would make the other ones work? Alternately, is there a > > function that > > forces the exponentials to be represented as sums of > > hyperbolic > > functions? > > > > > > > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aishen at free.fr Sat Apr 28 05:31:17 2012 From: aishen at free.fr (aishen) Date: Sat, 28 Apr 2012 12:31:17 +0200 Subject: [Maxima] any help ? In-Reply-To: <4F90236E.4060703@free.fr> References: <4F90236E.4060703@free.fr> Message-ID: <4F9BC6F5.8010708@free.fr> I am trying to compute this in wxmaxima but iL2:iL2(t),L=0.01; I can't find why ? if I take away 0.005 (constante d'int?gration which generate the problem) it works but evidently the result is not the same ! Any help, Thanks, Henri /* [wxMaxima: input start ] */ v1:20.0;v2:-20.0; v(t):= if(t<0.005) then (v1) else (v2); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ iR1(t):=v1/R;iR2(t):=v2/R; iR1:iR1(t), R=4;iR2:iR2(t), R=4; iR(t):= if(t<0.005) then (iR1) else (iR2); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ iL1(t):=(1/L)*integrate(v1,t,0,t); iL2(t):=(1/L)*integrate(v2,t,0.005,t)+iL1(0.005); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ iL1:iL1(t),L=0.01; /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ iL2:iL2(t),L=0.01; /* [wxMaxima: input end ] */ From pdx7l1 at yahoo.es Sat Apr 28 08:27:58 2012 From: pdx7l1 at yahoo.es (Manuel Pedrinero rossetil) Date: Sat, 28 Apr 2012 14:27:58 +0100 (BST) Subject: [Maxima] julia language Message-ID: <1335619678.88712.YahooMailNeo@web132501.mail.ird.yahoo.com> The people of julia language are trying to make a language that can replace? R and Matlab.? Lisp is used to manipulate the AST, there is a small Lisp developed by one of the core members of the group (femlisp) available in github. I think that julia could be a good replacement for the maxima language.? Julia can use LAPLACK and other libraries, and recently in the list there has been some talks about CPYTHON developers trying to link with julia. For julia developers adding symbolics capabilities could be very interesting.? For maxima developers, being able to interface with R, C and fortran could be also very interesting, so I think this is a win-win situation. ?Best., gluemath. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sat Apr 28 10:01:08 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 28 Apr 2012 08:01:08 -0700 Subject: [Maxima] display of "lisp arrays" from make_array In-Reply-To: References: <4F9AE3F2.1050601@eecs.berkeley.edu> Message-ID: <4F9C0634.2050103@eecs.berkeley.edu> On 4/27/2012 12:33 PM, Raymond Toy wrote: > > > On Fri, Apr 27, 2012 at 11:22 AM, Richard Fateman > > wrote: > > I wonder if there is a reason to use lisp display rather than > maxima display to show the results of make_array. > > foo:make_array(any,5); > foo[0]:2*x; > foo; > > foo displays as > {Lisp Array: #(((MTIMES SIMP) 2 $X) NIL)} > > > Shouldn't they be displayed in some unique way so you can tell the > difference between a list and an array? > > Ray > I'd be happy with something like LispArray{0..4}[2*x, false,false,....], for example. We need to specify where the element with index 0 is. More generally I think that we could LispArray{type}{lo1..hi1}{lo2..hi2}... -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sat Apr 28 10:05:46 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 28 Apr 2012 08:05:46 -0700 Subject: [Maxima] julia language In-Reply-To: <1335619678.88712.YahooMailNeo@web132501.mail.ird.yahoo.com> References: <1335619678.88712.YahooMailNeo@web132501.mail.ird.yahoo.com> Message-ID: <4F9C074A.5010908@eecs.berkeley.edu> On 4/28/2012 6:27 AM, Manuel Pedrinero rossetil wrote: > The people of julia language are trying to make a language that can > replace R and Matlab. Lisp is used to manipulate the AST, there is > a small Lisp developed by one of the core members of the group > (femlisp) available in github. > > I think that julia could be a good replacement for the maxima > language. Julia can use LAPLACK and other libraries, and recently > in the list there has been some talks about CPYTHON developers trying > to link with julia. Pro: Since Maxima is implemented in Lisp, it would seem that femlisp would be unnecessary to implement Julia in the same core image as Maxima. So an additional read-eval-print loop that looks like Julia but has the Maxima system as its "library" should be simple, and someone familiar with Lisp could rapidly implement at least a demonstration of Julia interfaced to Maxima. Con: Many people with experience using Maxima or Macsyma have suggested improvements or changes to the language. Are you aware of these issues? If you are not aware of them, your new language design might not address them at all. A glance through the Julia tutorial suggests that it is not especially supportive of computer algebra, since it lacks an arbitrary precision integer type. Access to libraries for numerics, graphics, web access, parallel constructs, etc are generally well known to Lisp implementors; unfortunately the level of support and the details differ between implementations. It is not clear to me that Julia's features in this regard would be a big selling point in any case, unless you re-implemented all of Maxima in Julia, not just the front end Maxima language. Perhaps you could share with us your reasoning as to why the maxima language needs to be replaced. If you have limited experience with symbolic computing, it really doesn't work to just claim that "Julia is good for whatever you are doing, whatever you are doing", since it probably reflects a sentiment not a reason: for example, "I like Julia, and I really don't know what you are doing, but maybe you'll like it too." > > For julia developers adding symbolics capabilities could be very > interesting. Probably the case. The legacy of Lisp in Julia's metaprogramming seems to have good intentions, but it is hard to get enthusiastic about the plethora of notations inherited from c, c++, java, ... unless one is first familiar with them and not lisp z.head instead of (first z) or (car z) z.args instead of (rest z) or (cdr z) The target audience for Macsyma/ Maxima language is usually considered (a) people who do not know other programming languages (like C or Lisp) but are familiar with mathematical notation and would like to continue using it as much as possible. and (b) people who (probably knowledgeable about PLs) would like to present programs that are relatively concise and easy to explain to persons familiar principally with mathematical notation. That is, there should be a minimum of programmer-ese. (like foo++, a//b, glub.args ...). > For maxima developers, being able to interface with R, C and fortran > could be also very interesting, > so I think this is a win-win situation. Probably not, as I said above, unless the back-end is written in Julia, this won't happen via Julia. It could continue to happen (in all dialects of Common Lisp supporting Maxima except, apparently GCL), simply by using Lisp foreign-function interfaces. The success of a new programming language does not seem to depend so much on its intrinsic merits as on other factors. How else to explain the rise of so many languages, including many derided by academics as really bad designs. Some of them fall into disuse, but certainly not all. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From pdx7l1 at yahoo.es Sat Apr 28 10:58:04 2012 From: pdx7l1 at yahoo.es (Manuel Pedrinero rossetil) Date: Sat, 28 Apr 2012 16:58:04 +0100 (BST) Subject: [Maxima] Rv: julia language In-Reply-To: <1335628139.62730.YahooMailNeo@web132506.mail.ird.yahoo.com> References: <1335619678.88712.YahooMailNeo@web132501.mail.ird.yahoo.com> <4F9C074A.5010908@eecs.berkeley.edu> <1335628139.62730.YahooMailNeo@web132506.mail.ird.yahoo.com> Message-ID: <1335628684.24735.YahooMailNeo@web132501.mail.ird.yahoo.com> ----- Mensaje reenviado ----- De: Manuel Pedrinero rossetil Para: Richard Fateman Enviado: S?bado 28 de abril de 2012 17:48 Asunto: Re: [Maxima] julia language ________________________________ Dear Prof. Fateman, I admire your work in maxima.? I don't participate in the Julia language, I am only a curious person, that should'nt spend so much time learning new programming languages (lisp, clojure, shen, lua, python, ruby, R, Mathematica, ...) .? I teach Calculus and Statistics and I use maxima in class.? But for my students a mixture of maxima and R should be ideal.? I am Spanish and I admire the work of Mario Riiotorto (the statistics) and I lurk in comp.lang.lisp and gmane - maxima, but I don't code a single line, that seems to be my fate.? I wish some efforts like clpython, matlisp, incanter, clr don't die, but sadly the only way to survive is to join efforts. ?Well, I just read in the julia-dev list this about interacting Julia and Lisp (femlisp) so, using for example sbcl and julia seems not to be such a difficult task, but I recognize that I will not write a single line of code, just play reading posts (this is my free time). ?Anyway, is wonderful there are people like maxima team that makes this project a reality. ?Best to all of you. femtolisp and julia interoperability Opciones ? 2 mensajes?-?Contraer todos ?-? Traducir todo al Espa?ol Celil ? Ver perfil ? Traducir al Espa?ol ?M?s opciones 28 abr, 07:29 Is it currently possible to call functions implemented in femtolisp from julia, and vice versa? Celil ? Jeff Bezanson ? Ver perfil ? Traducir al Espa?ol ?M?s opciones 28 abr, 08:53 It's possible, but there aren't any easy interfaces for it. It's considered an implementation detail of the compiler. src/ast.c has examples of calling in both directions. De: Richard Fateman Para: Manuel Pedrinero rossetil CC: "maxima at math.utexas.edu" Enviado: S?bado 28 de abril de 2012 17:05 Asunto: Re: [Maxima] julia language On 4/28/2012 6:27 AM, Manuel Pedrinero rossetil wrote: The people of julia language are trying to make a language that can replace? R and Matlab.? Lisp is used to manipulate the AST, there is >a small Lisp developed by one of the core members of the group (femlisp) available in github. > > > >I think that julia could be a good replacement for the maxima language.? Julia can use LAPLACK and other libraries, and recently > >in the list there has been some talks about CPYTHON developers trying to link with julia. Pro:? Since Maxima is implemented in Lisp, it would seem that femlisp would be unnecessary to implement Julia? in the same core image as Maxima.? So an additional read-eval-print loop that looks like Julia but has the Maxima system as its "library" should be simple, and someone familiar with Lisp could rapidly implement at least a demonstration of Julia interfaced to Maxima. Con: Many people with experience using Maxima or Macsyma have suggested improvements or changes to the language. Are you aware of these issues?? If you are not aware of them, your new language design might not address them at all. A glance through the Julia tutorial suggests that it is not especially supportive of computer algebra, since it lacks an arbitrary precision integer type. ?Access to libraries for numerics, graphics, web access, parallel constructs, etc are generally well known to Lisp implementors; unfortunately the level of support and the details differ between implementations. It is not clear to me that Julia's features in this regard would be a big selling point in any case, unless you re-implemented all of Maxima in Julia, not just the front end Maxima language. Perhaps you could share with us your reasoning as to why the maxima language needs to be replaced. If you have limited experience with symbolic computing, it really doesn't work to just claim that ?"Julia is good for whatever you are doing, whatever you are doing", since it probably reflects a sentiment not a reason:? for example, "I like Julia, and I really don't know what you are doing, but maybe you'll like it too." > >For julia developers adding symbolics capabilities could be very interesting.? > Probably the case.? The legacy of Lisp in Julia's metaprogramming seems to have good intentions, but it is hard to get enthusiastic about the plethora of notations inherited from c, c++, java, ... unless one is first familiar with them and not lisp z.head?? instead of? (first z)?? or (car z) z.args?? instead of (rest z) or (cdr z) The target audience for Macsyma/ Maxima language is usually considered (a) people who do not know other programming languages (like C or Lisp) but are familiar with mathematical notation and would like to continue using it as much as possible. ? and (b) people who (probably knowledgeable about PLs) would like to present programs that are relatively concise and easy to explain to persons familiar principally with mathematical notation.? That is, there should be a minimum of programmer-ese.? (like foo++, a//b, glub.args ...). For maxima developers, being able to interface with R, C and fortran could be also very interesting, > >so I think this is a win-win situation. > Probably not, as I said above, unless the back-end is written in Julia, this won't happen via Julia.? It could continue to happen (in all dialects of Common Lisp supporting Maxima except, apparently GCL), simply by using Lisp foreign-function interfaces. The success of a new programming language does not seem to depend so much on its intrinsic merits as on other factors.? How else to explain the rise of so many languages, including many derided by academics as really bad designs. Some of them fall into disuse, but certainly not all. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sat Apr 28 11:12:10 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 28 Apr 2012 09:12:10 -0700 Subject: [Maxima] display of "lisp arrays" from make_array In-Reply-To: <4F9C0634.2050103@eecs.berkeley.edu> References: <4F9AE3F2.1050601@eecs.berkeley.edu> <4F9C0634.2050103@eecs.berkeley.edu> Message-ID: <4F9C16DA.5050902@gmail.com> On 4/28/12 8:01 AM, Richard Fateman wrote: > On 4/27/2012 12:33 PM, Raymond Toy wrote: >> >> >> On Fri, Apr 27, 2012 at 11:22 AM, Richard Fateman >> > wrote: >> >> I wonder if there is a reason to use lisp display rather than >> maxima display to show the results of make_array. >> >> foo:make_array(any,5); >> foo[0]:2*x; >> foo; >> >> foo displays as >> {Lisp Array: #(((MTIMES SIMP) 2 $X) NIL)} >> >> >> Shouldn't they be displayed in some unique way so you can tell the >> difference between a list and an array? >> >> Ray >> > I'd be happy with something like LispArray{0..4}[2*x, > false,false,....], for example. > We need to specify where the element with index 0 is. > More generally I think that we could > LispArray{type}{lo1..hi1}{lo2..hi2}... > Wouldn't this be a rather odd presentation? All (almost all?) of maxima's output can be pretty much cut-and-pasted and reused as input (not including 2D output). Would we have to be able to read that back in? Why is the lower limit required in the output? Lisp arrays always start with index 0. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sat Apr 28 11:32:00 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 28 Apr 2012 09:32:00 -0700 Subject: [Maxima] display of "lisp arrays" from make_array In-Reply-To: <4F9C16DA.5050902@gmail.com> References: <4F9AE3F2.1050601@eecs.berkeley.edu> <4F9C0634.2050103@eecs.berkeley.edu> <4F9C16DA.5050902@gmail.com> Message-ID: <4F9C1B80.5030003@eecs.berkeley.edu> On 4/28/2012 9:12 AM, Raymond Toy wrote: > On 4/28/12 8:01 AM, Richard Fateman wrote: >> On 4/27/2012 12:33 PM, Raymond Toy wrote: >>> >>> >>> On Fri, Apr 27, 2012 at 11:22 AM, Richard Fateman >>> > wrote: >>> >>> I wonder if there is a reason to use lisp display rather than >>> maxima display to show the results of make_array. >>> >>> foo:make_array(any,5); >>> foo[0]:2*x; >>> foo; >>> >>> foo displays as >>> {Lisp Array: #(((MTIMES SIMP) 2 $X) NIL)} >>> >>> >>> Shouldn't they be displayed in some unique way so you can tell the >>> difference between a list and an array? >>> >>> Ray >>> >> I'd be happy with something like LispArray{0..4}[2*x, >> false,false,....], for example. >> We need to specify where the element with index 0 is. >> More generally I think that we could >> LispArray{type}{lo1..hi1}{lo2..hi2}... >> > Wouldn't this be a rather odd presentation? All (almost all?) of > maxima's output can be pretty much cut-and-pasted and reused as input > (not including 2D output). Yes, the current output .... { Lisp Array ....} cannot be cut-and-pasted either! Perhaps a 'constructor' form can be arranged though. > Would we have to be able to read that back in? no but ... > > Why is the lower limit required in the output? Lisp arrays always > start with index 0. or using facilities already in Maxima, we could display this Lisp Array as ... fillarray(make_array(any,4),[2*x,false,false,false]) and this could be cut-and-pasted. Or we could have a slightly nice format that was equivalent to the one above, e.g. LispArray([any,4], [2*x,false,false,false]) I'm assuming that extensions for more dimensions could be tacked on by listing stuff in row-major order or whatever. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From hbaker1 at pipeline.com Sat Apr 28 15:29:21 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Sat, 28 Apr 2012 13:29:21 -0700 Subject: [Maxima] julia language In-Reply-To: <4F9C074A.5010908@eecs.berkeley.edu> References: <1335619678.88712.YahooMailNeo@web132501.mail.ird.yahoo.com> <4F9C074A.5010908@eecs.berkeley.edu> Message-ID: I didn't completely understand this discussion. I looked briefly at "femlisp", and it appears to be a language implemented _in_ (Common) Lisp, rather than another implementation _of_ Lisp. I've never understood the penchant for hacking syntax; it appears that 95% of the differences between computer languages have to do with syntax, and 95% of those differences are trivial, yet provide huge barriers (perhaps intended) to people learning and expressing themselves in these languages. I'm glad to see that people are hacking FEM in Lisp & these people should be encouraged as much as possible. I don't know who said it first, but Lisp has proven to be much better than the vast majority of its successors (wannabes?). I'd love to see another Lisp, but one based on interesting semantic improvements rather than any syntax changes. The most important elements on my list of improvements have to do with concurrency, parallelism, clean separation of pure (referentially transparent/side-effect-free) and impure (assignments) constructs, incorporation of persistence, incorporation of editing/program development/debugging model. Interestingly, this list hasn't really changed in 20 years, but modern computer languages still haven't successfully addressed these issues. At 08:05 AM 4/28/2012, Richard Fateman wrote: >On 4/28/2012 6:27 AM, Manuel Pedrinero rossetil wrote: >>The people of julia language are trying to make a language that can replace R and Matlab. Lisp is used to manipulate the AST, there is >>a small Lisp developed by one of the core members of the group (femlisp) available in github. >> >>I think that julia could be a good replacement for the maxima language. Julia can use LAPLACK and other libraries, and recently >>in the list there has been some talks about CPYTHON developers trying to link with julia. > >Pro: Since Maxima is implemented in Lisp, it would seem that femlisp would be unnecessary to implement >Julia in the same core image as Maxima. So an additional read-eval-print loop that looks like Julia >but has the Maxima system as its "library" should be simple, and someone familiar with Lisp could >rapidly implement at least a demonstration of Julia interfaced to Maxima. > >Con: Many people with experience using Maxima or Macsyma have suggested improvements or changes to the language. >Are you aware of these issues? If you are not aware of them, your new language design >might not address them at all. > >A glance through the Julia tutorial suggests that it is not especially supportive of computer algebra, >since it lacks an arbitrary precision integer type. > > Access to libraries for numerics, graphics, web access, >parallel constructs, etc are generally well known to Lisp implementors; unfortunately the level of >support and the details differ between implementations. It is not clear to me that Julia's features >in this regard would be a big selling point in any case, unless you re-implemented all of Maxima >in Julia, not just the front end Maxima language. > >Perhaps you could share with us your reasoning as to why the maxima language needs to be replaced. >If you have limited experience with symbolic computing, it really doesn't work to just claim that > "Julia is good for whatever you are doing, whatever you are doing", since it probably reflects >a sentiment not a reason: for example, >"I like Julia, and I really don't know what you are doing, but maybe you'll like it too." > >>For julia developers adding symbolics capabilities could be very interesting. > >Probably the case. The legacy of Lisp in Julia's metaprogramming seems to have >good intentions, but it is hard to get enthusiastic about the plethora of notations >inherited from c, c++, java, ... unless one is first familiar with them and not lisp > >z.head instead of (first z) or (car z) >z.args instead of (rest z) or (cdr z) > >The target audience for Macsyma/ Maxima language is usually considered >(a) people who do not know other programming languages (like C or Lisp) but are familiar >with mathematical notation and would like to continue using it as much as possible. > and >(b) people who (probably knowledgeable about PLs) would like to present >programs that are relatively concise and easy to explain to persons familiar >principally with mathematical notation. That is, there should be a minimum of >programmer-ese. (like foo++, a//b, glub.args ...). > >>For maxima developers, being able to interface with R, C and fortran could be also very interesting, >>so I think this is a win-win situation. > >Probably not, as I said above, unless the back-end is written in Julia, this won't happen >via Julia. It could continue to happen (in all dialects of Common Lisp supporting >Maxima except, apparently GCL), simply by using Lisp foreign-function interfaces. > >The success of a new programming language does not seem to depend so much >on its intrinsic merits as on other factors. How else to explain the rise of >so many languages, including many derided by academics as really bad designs. >Some of them fall into disuse, but certainly not all. > >RJF From pdx7l1 at yahoo.es Sat Apr 28 16:04:15 2012 From: pdx7l1 at yahoo.es (Manuel Pedrinero rossetil) Date: Sat, 28 Apr 2012 22:04:15 +0100 (BST) Subject: [Maxima] julia language In-Reply-To: References: <1335619678.88712.YahooMailNeo@web132501.mail.ird.yahoo.com> <4F9C074A.5010908@eecs.berkeley.edu> Message-ID: <1335647055.21743.YahooMailNeo@web132501.mail.ird.yahoo.com> To clarify: femlisp is just a very small part of the julia language (just a way of manipulating the ast). Julia is not femlisp, and femlisp seems to be just a hobby project. But julia seems to be promising? to emulate matlab and R. Having a way to interact between? lisp and julia could be used by maxima in order to improve its numeric capabilities.? Julia has some libraries for concurrency and parallelism. So this is not about femlisp but about julia. ________________________________ De: Henry Baker Para: Richard Fateman CC: Manuel Pedrinero rossetil ; maxima at math.utexas.edu Enviado: S?bado 28 de abril de 2012 22:29 Asunto: Re: [Maxima] julia language I didn't completely understand this discussion. I looked briefly at "femlisp", and it appears to be a language implemented _in_ (Common) Lisp, rather than another implementation _of_ Lisp. I've never understood the penchant for hacking syntax; it appears that 95% of the differences between computer languages have to do with syntax, and 95% of those differences are trivial, yet provide huge barriers (perhaps intended) to people learning and expressing themselves in these languages. I'm glad to see that people are hacking FEM in Lisp & these people should be encouraged as much as possible. I don't know who said it first, but Lisp has proven to be much better than the vast majority of its successors (wannabes?). I'd love to see another Lisp, but one based on interesting semantic improvements rather than any syntax changes.? The most important elements on my list of improvements have to do with concurrency, parallelism, clean separation of pure (referentially transparent/side-effect-free) and impure (assignments) constructs, incorporation of persistence, incorporation of editing/program development/debugging model. Interestingly, this list hasn't really changed in 20 years, but modern computer languages still haven't successfully addressed these issues. At 08:05 AM 4/28/2012, Richard Fateman wrote: >On 4/28/2012 6:27 AM, Manuel Pedrinero rossetil wrote: >>The people of julia language are trying to make a language that can replace? R and Matlab.? Lisp is used to manipulate the AST, there is >>a small Lisp developed by one of the core members of the group (femlisp) available in github. >> >>I think that julia could be a good replacement for the maxima language.? Julia can use LAPLACK and other libraries, and recently >>in the list there has been some talks about CPYTHON developers trying to link with julia. > >Pro:? Since Maxima is implemented in Lisp, it would seem that femlisp would be unnecessary to implement >Julia? in the same core image as Maxima.? So an additional read-eval-print loop that looks like Julia >but has the Maxima system as its "library" should be simple, and someone familiar with Lisp could >rapidly implement at least a demonstration of Julia interfaced to Maxima. > >Con: Many people with experience using Maxima or Macsyma have suggested improvements or changes to the language. >Are you aware of these issues?? If you are not aware of them, your new language design >might not address them at all. > >A glance through the Julia tutorial suggests that it is not especially supportive of computer algebra, >since it lacks an arbitrary precision integer type. > > Access to libraries for numerics, graphics, web access, >parallel constructs, etc are generally well known to Lisp implementors; unfortunately the level of >support and the details differ between implementations. It is not clear to me that Julia's features >in this regard would be a big selling point in any case, unless you re-implemented all of Maxima >in Julia, not just the front end Maxima language. > >Perhaps you could share with us your reasoning as to why the maxima language needs to be replaced. >If you have limited experience with symbolic computing, it really doesn't work to just claim that > "Julia is good for whatever you are doing, whatever you are doing", since it probably reflects >a sentiment not a reason:? for example, >"I like Julia, and I really don't know what you are doing, but maybe you'll like it too." > >>For julia developers adding symbolics capabilities could be very interesting.? > >Probably the case.? The legacy of Lisp in Julia's metaprogramming seems to have >good intentions, but it is hard to get enthusiastic about the plethora of notations >inherited from c, c++, java, ... unless one is first familiar with them and not lisp > >z.head? instead of? (first z)? or (car z) >z.args? instead of (rest z) or (cdr z) > >The target audience for Macsyma/ Maxima language is usually considered >(a) people who do not know other programming languages (like C or Lisp) but are familiar >with mathematical notation and would like to continue using it as much as possible. >? and >(b) people who (probably knowledgeable about PLs) would like to present >programs that are relatively concise and easy to explain to persons familiar >principally with mathematical notation.? That is, there should be a minimum of >programmer-ese.? (like foo++, a//b, glub.args ...). > >>For maxima developers, being able to interface with R, C and fortran could be also very interesting, >>so I think this is a win-win situation. > >Probably not, as I said above, unless the back-end is written in Julia, this won't happen >via Julia.? It could continue to happen (in all dialects of Common Lisp supporting >Maxima except, apparently GCL), simply by using Lisp foreign-function interfaces. > >The success of a new programming language does not seem to depend so much >on its intrinsic merits as on other factors.? How else to explain the rise of >so many languages, including many derided by academics as really bad designs. >Some of them fall into disuse, but certainly not all. > >RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sat Apr 28 16:41:33 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 28 Apr 2012 14:41:33 -0700 Subject: [Maxima] julia language In-Reply-To: <1335647055.21743.YahooMailNeo@web132501.mail.ird.yahoo.com> References: <1335619678.88712.YahooMailNeo@web132501.mail.ird.yahoo.com> <4F9C074A.5010908@eecs.berkeley.edu> <1335647055.21743.YahooMailNeo@web132501.mail.ird.yahoo.com> Message-ID: <4F9C640D.8000701@gmail.com> On 4/28/12 2:04 PM, Manuel Pedrinero rossetil wrote: > To clarify: > > femlisp is just a very small part of the julia language (just a way of > manipulating the > ast). > > Julia is not femlisp, and femlisp seems to be just a hobby project. And Julia is not a hobby project? (I didn't look.) I think maxima is a hobby project, at least for me anyway. > But julia seems to be promising to emulate matlab and R. > Having a way to interact between lisp and julia could be used by > maxima in order to > improve its numeric capabilities. >From which I infer you are saying maxima is missing some numeric capabilities. What capabilities are missing? Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From yasuaki.honda at gmail.com Sun Apr 29 05:10:36 2012 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Sun, 29 Apr 2012 19:10:36 +0900 Subject: [Maxima] Windows and Mac package for 5.27.0 ? Message-ID: Hi all, Is there anyone out there who is preparing for Windows / Mac installer package for 5.27.0 ? Alternatively, anyone knows the document of how to create them? Then, I can do that and put them on SF, if this is not too complex. Thanks and best regards, Yasuaki Honda, Chiba, Japan -------------- next part -------------- An HTML attachment was scrubbed... URL: From vi5u0-maxima at yahoo.co.uk Sun Apr 29 05:45:31 2012 From: vi5u0-maxima at yahoo.co.uk (Dan) Date: Sun, 29 Apr 2012 11:45:31 +0100 (BST) Subject: [Maxima] asympa.mac In-Reply-To: <4F9B05B9.8050906@eecs.berkeley.edu> References: <4F9B05B9.8050906@eecs.berkeley.edu> Message-ID: On Fri, 27 Apr 2012, Richard Fateman wrote: > http://www.cs.berkeley.edu/~fateman/macsyma/docs/refman16.pdf > > for the description of this from the Macsyma manual. > > Good luck. Thanks Richard. Interesting stuff. From willisb at unk.edu Sun Apr 29 08:53:29 2012 From: willisb at unk.edu (Barton Willis) Date: Sun, 29 Apr 2012 13:53:29 +0000 Subject: [Maxima] julia language In-Reply-To: <4F9C640D.8000701@gmail.com> References: <1335619678.88712.YahooMailNeo@web132501.mail.ird.yahoo.com> <4F9C074A.5010908@eecs.berkeley.edu> <1335647055.21743.YahooMailNeo@web132501.mail.ird.yahoo.com>, <4F9C640D.8000701@gmail.com> Message-ID: <83FD4DC40F97654495E2C9AED47658360421DE70@BL2PRD0710MB361.namprd07.prod.outlook.com> > Julia is not femlisp, and femlisp seems to be just a hobby project. femlisp (http://www.femlisp.org/ ) or femtolisp ( http://code.google.com/p/femtolisp/) ? I'm guessing femtolisp (see https://github.com/JuliaLang/julia#readme ) --bw From macrakis at alum.mit.edu Sun Apr 29 11:12:17 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 29 Apr 2012 12:12:17 -0400 Subject: [Maxima] julia language In-Reply-To: <1335619678.88712.YahooMailNeo@web132501.mail.ird.yahoo.com> References: <1335619678.88712.YahooMailNeo@web132501.mail.ird.yahoo.com> Message-ID: Thanks for the message about Julia. I am very familiar with R and Maxima, and it would be great if we could somehow keep the "good stuff" from those systems while moving to a more consistent, modern framework. It seems to me that there are four main kinds of challenge: - Design philosophy. R was designed by statisticians for statisticians. Maxima was developed (largely) for physicists. The languages' semantic peculiarities support important user behaviors. The user communities tend to be very pragmatic, and generally don't seem to care much about computer scientist language designers' notions of semantic consistency as long as they can get their work done. - Both R and Maxima have many extension packages written in their own languages which depend heavily on the current semantics. How would those be moved to or interface with to another system? - Maxima in particular has a lot of global state (assumptions, flag settings, patterns, etc.) which needs to persist and presumably be shared across parallel processes. How would that be done? - Simple inertia. People use R because everyone else in statistics uses R, there are lots of books and articles on R, there is an active user community, etc. The Maxima community is much smaller and might be more open to moving. In more detail: - There are many valuable extension packages for R which depend on the current peculiar R class semantics. I wonder how they could be moved to another system without actually modifying each package or writing a custom wrapper for each one? - One of the things that makes R so handy for statistical manipulation is the way arguments are passed -- both the unevaluated and the evaluated form are available to the called function, so (e.g) a plot function can label axes. Presumably this would be handled in Julia using macros, but Julia macros have different syntax than normal function calls (why?). Maxima's handling of unassigned variables as formal variables is really convenient. This all makes semantics messy, but users seem to find it handy. - One of the things that makes the Maxima language convenient and easy to use is the blurring of the line between formal (mathematical) expressions and evaluated expressions. I suspect this would be difficult to support in a language not designed for symbolic algebra. The clean solution is presumably to use Julia's :x syntax, so you'd write e.g. diff( :(x^2), :x) instead of diff(x^2, x). Though this makes for much cleaner and simpler semantics, I don't think our users would appreciate it. - Julia's current semantics for sqrt(4), sqrt(2), sqrt(-1), (1+im)/(1-im), etc. aren't acceptable for a symbolic system. sqrt(4) should be the *integer* 2, not the float 2.0; sqrt(2) should remain as the formal object sqrt(2) == 2^(1/2); sqrt(-1) and (1+im)/(1-im) should return 1im (an exact Gaussian integer), and certainly not 0.0+1.0im (or NaN). Would the user have to explicitly write e.g. sqrt(:2) or and sqrt(:-1) to force a symbolic result? - I suspect users will also have more trouble with a Julia-type treatment of nouns/verbs than with the current Maxima approach -- although admittedly the current system is confusing, too. The Julia notation would presumably be :(diff(y,x)) (currently written as 'diff(y,x) : a formal differential) and diff(:y,:x) (currently written as diff(y,x): evaluates to 0). But actually that isn't quite right, either. In Maxima, you can write q:sin(x) and then 'diff(q,x) evaluates to 'diff(sin(x),x) -- that is, the *arguments* are evaluated, though the operator remains formal. - Arguments about semantic consistency etc. don't seem to impress the R community -- witness the bizarre and inconsistent treatment of factors in various parts of the *core *packages (let alone user contributions); or of lists vs. vectors. Witness the ugly (but handy!) S3 object system, and the profusion of other object systems (S4, proto, R.oo), none of which has displaced S3. Over the years, there have been cleaner alternatives proposed, e.g. (x)Lisp-Stat , but none have succeeded. Similarly, Maxima, though designed by computer scientists, was designed for the convenience of its mathematician users. More formally clean systems like the Scheme-based Scmutils haven't been as successful. cf. "Worse is Better". - How would other kinds of arithmetic objects -- arbitrary-precision integers (bigfloat), extended-precision floats (bfloat), etc. -- be integrated into Julia? Would it be possible to have literals for them? Can overflow of fixed-point integers generate arbitrary-precision numbers? Is there anything preventing them from being in the right place in the type hierarchy, e.g. Real <: Bigfloat <: Float ? Can exact numbers like 2^(1/2) be between Number and Complex? >From what I've read on the Julia web site, it seems that its biggest advertised strength is highly optimized numerical compilation and a clean language. I don't think either of those are big enough advantages to overcome the challenges above. But I really really *would* like to see both Maxima and R become cleaner and more consistent. Then again, I'm a computer scientist, not a statistician or physicist.... -s PS What is meant in the Julia blurb by "Julia... provides... numerical accuracy"? Does it do something other than standard IEEE floating-point? On Sat, Apr 28, 2012 at 09:27, Manuel Pedrinero rossetil wrote: > The people of julia language are trying to make a language that can > replace R and Matlab. Lisp is used to manipulate the AST, there is > a small Lisp developed by one of the core members of the group (femlisp) > available in github. > > I think that julia could be a good replacement for the maxima language. > Julia can use LAPLACK and other libraries, and recently > in the list there has been some talks about CPYTHON developers trying to > link with julia. > > For julia developers adding symbolics capabilities could be very > interesting. > For maxima developers, being able to interface with R, C and fortran could > be also very interesting, > so I think this is a win-win situation. > > Best., gluemath. > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hbaker1 at pipeline.com Sun Apr 29 11:14:08 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Sun, 29 Apr 2012 09:14:08 -0700 Subject: [Maxima] julia language In-Reply-To: <83FD4DC40F97654495E2C9AED47658360421DE70@BL2PRD0710MB361.n amprd07.prod.outlook.com> References: <1335619678.88712.YahooMailNeo@web132501.mail.ird.yahoo.com> <4F9C074A.5010908@eecs.berkeley.edu> <1335647055.21743.YahooMailNeo@web132501.mail.ird.yahoo.com> <4F9C640D.8000701@gmail.com> <83FD4DC40F97654495E2C9AED47658360421DE70@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: It is possible to convert femtolisp into attolisp by removing cond, and, or, for, prog1, without loss of generality or execution speed. Actually, "microscheme" would be a slightly more appropriate name. I do like the fundamental integration of C/C++ libraries, tho. http://code.google.com/p/femtolisp/wiki/APIReference Builtin special forms (quote val) (cond (cond1 do1 do2 ...) (cond2 do1 do2 ...) ...) (if cond then else) (and ...) (or ...) (while cond . bodies) (lambda args . bodies) args is a list or dotted list. (begin ...) (set! sym expr) set lexically-bound variable (sym is not evaluated) (trycatch body func) if an exception occurs evaluating body, func is invoked with the exception as its argument (for lo hi (lambda (n) body)) fast bounded iteration. the supplied function is invoked successively for n from lo to hi, inclusive. (prog1 expr1 expr2) evaluate expr1 and expr2 in order, then return the result of expr1 At 06:53 AM 4/29/2012, Barton Willis wrote: >> Julia is not femlisp, and femlisp seems to be just a hobby project. > >femlisp (http://www.femlisp.org/ ) or femtolisp ( http://code.google.com/p/femtolisp/) ? I'm guessing femtolisp (see https://github.com/JuliaLang/julia#readme ) > >--bw From robert.dodier at gmail.com Sun Apr 29 12:24:52 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 29 Apr 2012 17:24:52 +0000 (UTC) Subject: [Maxima] can someone please create a Windows installer for Maxima 5.27.0 Message-ID: Hi, can someone please create a Windows installer for Maxima 5.27.0? There are instructions in INSTALL.win32 in the top-level maxima directory. When we have a Windows installer, I'll make a general announcement about the release. Thanks in advance, Robert Dodier From robert.dodier at gmail.com Sun Apr 29 12:28:06 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 29 Apr 2012 17:28:06 +0000 (UTC) Subject: [Maxima] Windows and Mac package for 5.27.0 ? References: Message-ID: On 2012-04-29, =?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?= wrote: > Is there anyone out there who is preparing for Windows / Mac installer > package for 5.27.0 ? It appears there is nobody who has built a Windows installer. If you wish to do so, please go ahead. See INSTALL.win32 in the top-level directory. Alexander Hansen is the maintainer of the Maxima package in Fink. There is a message on his blog about 5.27.0 (http://finkakh.wordpress.com/2012/04/21/maxima-5-27-0) although I don't see Maxima 5.27.0 in Fink. Maybe you can ask him about it. Thank you for your efforts, Robert Dodier From alexanderk.hansen at gmail.com Sun Apr 29 13:13:02 2012 From: alexanderk.hansen at gmail.com (Alexander Hansen) Date: Sun, 29 Apr 2012 11:13:02 -0700 Subject: [Maxima] Windows and Mac package for 5.27.0 ? In-Reply-To: References: Message-ID: <4F9D84AE.2090802@gmail.com> On 4/29/12 10:28 AM, Robert Dodier wrote: > On 2012-04-29, =?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?= wrote: > >> Is there anyone out there who is preparing for Windows / Mac installer >> package for 5.27.0 ? > > It appears there is nobody who has built a Windows installer. > If you wish to do so, please go ahead. See INSTALL.win32 in the > top-level directory. > > Alexander Hansen is the maintainer of the Maxima package in Fink. > There is a message on his blog about 5.27.0 > (http://finkakh.wordpress.com/2012/04/21/maxima-5-27-0) > although I don't see Maxima 5.27.0 in Fink. Maybe you can ask him about it. > > Thank you for your efforts, > > Robert Dodier > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Our package database generator script got stuck, unfortunately. 5.26.0 is what's listed right now online at http://pdb.finkproject.org/pdb/package.php/maxima but 5.27.0 is available in the Fink distribution. Sorry for the confusion. That being said, my packages aren't really set up currently to provide a fully standalone maxima installation. -- Alexander Hansen, Ph.D. Fink User Liaison http://finkakh.wordpress.com/2012/02/21/got-job/ From yeniferhat at yahoo.com Sun Apr 29 15:10:14 2012 From: yeniferhat at yahoo.com (Ferhat ______) Date: Sun, 29 Apr 2012 13:10:14 -0700 (PDT) Subject: [Maxima] Using Maxima Software In Physics Message-ID: <1335730214.7931.YahooMailNeo@web161306.mail.bf1.yahoo.com> I have prepared a documentation about maxima for beginners. It was published in Balkan Physics Letters. It covers simple calculus, ODEs, plotting graphics, creating gif animations etc. You can access the article from http://bpl.turkfizikdernegi.org/index.php?content=vol15B Alternatively direct link of the pdf file is http://bpl.turkfizikdernegi.org/vol16/16-1-014.PDF Ferhat Nutku -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun Apr 29 16:19:00 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 29 Apr 2012 17:19:00 -0400 Subject: [Maxima] sqrt(1-x^2)/(2-2*x^2) --/--> 1/(2*sqrt(1-x^2)) In-Reply-To: References: Message-ID: Another way to solve the original problem is 1/gfactor(1/S)). But that really shouldn't be necessary. An even simpler case showing this problem is sqrt(1-x)/(x-1). -s On Wed, Feb 1, 2012 at 03:36, Aleksas Domarkas wrote: > Barton Willis willisb at unk.edu > Tue Jan 31 19:12:08 CST 2012 > > The general simplifier does sqrt(1-x^2)/(1-x^2) --> 1/sqrt(1-x^2), but it > doesn't > simplify sqrt(1-x^2)/(2-2*x^2) to 1/(2*sqrt(1-x^2)). Ratsimp, radcan, and > rootscontract > don't do this simplification either. > > --Barton > > > ***************************************************************************************** > > (%i1) S:sqrt(1-x^2)/(2-2*x^2)$ > (%i2) subst(2-2*x^2=2*(1-x^2),S); > (%o2) 1/(2*sqrt(1-x^2)) > > Aleksas > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From O.Kullmann at swansea.ac.uk Sun Apr 29 17:16:10 2012 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 29 Apr 2012 23:16:10 +0100 Subject: [Maxima] sqrt(1-x^2)/(2-2*x^2) --/--> 1/(2*sqrt(1-x^2)) In-Reply-To: References: Message-ID: <20120429221610.GB8656@cs-wsok.swan.ac.uk> On Sun, Apr 29, 2012 at 05:19:00PM -0400, Stavros Macrakis wrote: > Another way to solve the original problem is 1/gfactor(1/S)). But that > really shouldn't be necessary. An even simpler case showing this problem > is sqrt(1-x)/(x-1). > > -s > I was trying to help Maxima by giving it the term -sqrt(1-x)/(x-1) to simplify, however it doesn't help, and it seems Maxima can't simplify -1/(x-1) to 1/(1-x), which I think is clearly simpler. Oliver From dbmaxima at gmail.com Sun Apr 29 17:17:18 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Mon, 30 Apr 2012 08:17:18 +1000 Subject: [Maxima] can someone please create a Windows installer for Maxima 5.27.0 In-Reply-To: References: Message-ID: <4F9DBDEE.8040605@gmail.com> On 30/04/2012 3:24 AM, Robert Dodier wrote: > can someone please create a Windows installer for Maxima 5.27.0? There is a windows installer at http://billinghurst.customer.netspace.net.au/maxima-5.27.0.exe It is built using the ancient gcl/gcc-3.3.1 used for previous windows builds. From hbaker1 at pipeline.com Sun Apr 29 17:55:44 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Sun, 29 Apr 2012 15:55:44 -0700 Subject: [Maxima] can someone please create a Windows installer for Maxima 5.27.0 In-Reply-To: <4F9DBDEE.8040605@gmail.com> References: <4F9DBDEE.8040605@gmail.com> Message-ID: Any hope for an updated "Portable Maxima" ?? http://portableapps.com/ I like to carry many of my apps around on a SD card or a USB stick. The most current version of Portable Maxima is 5.17.1. At 03:17 PM 4/29/2012, David Billinghurst wrote: >On 30/04/2012 3:24 AM, Robert Dodier wrote: >>can someone please create a Windows installer for Maxima 5.27.0? >There is a windows installer at http://billinghurst.customer.netspace.net.au/maxima-5.27.0.exe > >It is built using the ancient gcl/gcc-3.3.1 used for previous windows builds. From dbmaxima at gmail.com Sun Apr 29 18:35:34 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Mon, 30 Apr 2012 09:35:34 +1000 Subject: [Maxima] can someone please create a Windows installer for Maxima 5.27.0 In-Reply-To: References: <4F9DBDEE.8040605@gmail.com> Message-ID: <4F9DD046.7090901@gmail.com> On 30/04/2012 8:55 AM, Henry Baker wrote: > Any hope for an updated "Portable Maxima" ?? > > http://portableapps.com/ > > I like to carry many of my apps around on a SD card or a USB stick. > > The most current version of Portable Maxima is 5.17.1. I think the maxima-x.xx-x directory is self contained. It may be sufficient to set the environment variable MAXIMA_PREFIX in bin/maxima.bat appropriately for your USB drive. Patches considered. From macrakis at alum.mit.edu Sun Apr 29 21:00:57 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 29 Apr 2012 22:00:57 -0400 Subject: [Maxima] sqrt(1-x^2)/(2-2*x^2) --/--> 1/(2*sqrt(1-x^2)) In-Reply-To: <20120429221610.GB8656@cs-wsok.swan.ac.uk> References: <20120429221610.GB8656@cs-wsok.swan.ac.uk> Message-ID: There is no universal definition of "clearly simpler". In any case, more important in some ways than superficial simplicity is consistency. -s On Sun, Apr 29, 2012 at 18:16, Oliver Kullmann wrote: > On Sun, Apr 29, 2012 at 05:19:00PM -0400, Stavros Macrakis wrote: > > Another way to solve the original problem is 1/gfactor(1/S)). But that > > really shouldn't be necessary. An even simpler case showing this problem > > is sqrt(1-x)/(x-1). > > > > -s > > > > I was trying to help Maxima by giving it the term -sqrt(1-x)/(x-1) to > simplify, > however it doesn't help, and it seems Maxima can't simplify > -1/(x-1) to 1/(1-x), which I think is clearly simpler. > > Oliver > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From volkervannek at googlemail.com Mon Apr 30 01:19:58 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Mon, 30 Apr 2012 08:19:58 +0200 Subject: [Maxima] can someone please create a Windows installer for Maxima 5.27.0 In-Reply-To: <4F9DD046.7090901@gmail.com> References: <4F9DBDEE.8040605@gmail.com> <4F9DD046.7090901@gmail.com> Message-ID: Hello David, thanks for building the Windows installer. I have installed it in my virtual box. The test suite shows 2 errors: Maxima 5.27.0 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) Running tests in rtest16: ********************** Problem 187 *************** Input: float((2^60-1)/2^60)-1 Result: -1.1102230246251565E-16 This differed from the expected result: 0.0 ********************** Problem 188 *************** Input: float((2^1000-1)/2^1000)-1 Result: -1.1102230246251565E-16 This differed from the expected result: 0.0 604/606 tests passed The following 2 problems failed: (187 188) Don't know if this is a problem of this specific Windows gcl version. On my Linux I installed Maxima from the debian repos which also uses gcl. Here the tests run without error. Maxima 5.27.0 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (a.k.a. GCL) Running tests in rtest16: 606/606 tests passed Volker van Nek -------------- next part -------------- An HTML attachment was scrubbed... URL: From aishen at free.fr Mon Apr 30 02:27:28 2012 From: aishen at free.fr (aishen) Date: Mon, 30 Apr 2012 09:27:28 +0200 Subject: [Maxima] Maxima_wxm_all_zip In-Reply-To: References: <4F9DBDEE.8040605@gmail.com> <4F9DD046.7090901@gmail.com> Message-ID: <4F9E3EE0.5090805@free.fr> Hi, I am trying to get Maxima_wxm_all_zip from snow.edu/stevez who wrote them. Apparently link is broken, anybody has it ? I am doing a compilation of as many wxm I can get (or maxima, but with this name it's difficult to googling ) on internet, I forsee to make an open source book with texmacs to get a nice work about this excellent maxima and co in french. Thanks all, Henri From robert.dodier at gmail.com Mon Apr 30 10:21:08 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 30 Apr 2012 15:21:08 +0000 (UTC) Subject: [Maxima] What are the magic performed by (cl-user::run)? References: <87397pthkv.fsf@Gmail.com> Message-ID: On 2012-04-27, Rupert Swarbrick wrote: > To the rest of the list: Should there be an > init-maxima-and-make-it-work-please function that RUN calls? Then people > that want to embed maxima into another CL image wouldn't have to guess > about what's needed. Yes, I know you can load your code into a maxima > image, but if you don't want a maxima REPL, that doesn't really help > (since RUN brings one up). I;ve separated the initialization stuff from the read-eval-print loop in CL-USER:RUN and moved that stuff into a new function, INITIALIZE-RUNTIME-GLOBALS. I expect this will be useful to programs which want to replace the read-eval-print loop. CL-USER:RUN has the same effect as before; it calls the new function and then starts its loop. I've pushed this change; for the record there is a diff below. best, Robert Dodier PS. diff --git a/src/init-cl.lisp b/src/init-cl.lisp index c0f17f4..78527ad 100644 --- a/src/init-cl.lisp +++ b/src/init-cl.lisp @@ -546,6 +546,17 @@ When one changes, the other does too." (defun cl-user::run () "Run Maxima in its own package." (in-package :maxima) + (initialize-runtime-globals) + (let ((input-stream *standard-input*) + (batch-flag nil)) + (catch 'to-lisp + (setf (values input-stream batch-flag) + (process-maxima-args input-stream batch-flag)) + (loop + (with-simple-restart (macsyma-quit "Maxima top-level") + (macsyma-top-level input-stream batch-flag)))))) + +(defun initialize-runtime-globals () (setf *load-verbose* nil) (setf *debugger-hook* #'maxima-lisp-debugger) ;; See discussion on the maxima list @@ -568,30 +579,23 @@ When one changes, the other does too." ;; variable. Hence we need to set it here to get our desired ;; behavior. (setf *read-default-float-format* 'double-float)) - (let ((input-stream *standard-input*) - (batch-flag nil)) - #+allegro - (progn - (set-readtable-for-macsyma) - (setf *read-default-float-format* 'lisp::double-float)) - (catch 'to-lisp - (initialize-real-and-run-time) - (intl::setlocale) - (set-locale-subdir) - (adjust-character-encoding) - (set-pathnames) - (when (boundp '*maxima-prefix*) - (push (pathname (concatenate 'string *maxima-prefix* - (if *maxima-layout-autotools* - "/share/locale/" - "/locale/"))) - intl::*locale-directories*)) - (setf (values input-stream batch-flag) - (process-maxima-args input-stream batch-flag)) - (loop - (with-simple-restart (macsyma-quit "Maxima top-level") - (macsyma-top-level input-stream batch-flag)))))) + #+allegro + (progn + (set-readtable-for-macsyma) + (setf *read-default-float-format* 'lisp::double-float)) + + (initialize-real-and-run-time) + (intl::setlocale) + (set-locale-subdir) + (adjust-character-encoding) + (set-pathnames) + (when (boundp '*maxima-prefix*) + (push (pathname (concatenate 'string *maxima-prefix* + (if *maxima-layout-autotools* + "/share/locale/" + "/locale/"))) + intl::*locale-directories*))) (defun adjust-character-encoding () (ignore-errors From hbaker1 at pipeline.com Mon Apr 30 10:31:13 2012 From: hbaker1 at pipeline.com (Henry Baker) Date: Mon, 30 Apr 2012 08:31:13 -0700 Subject: [Maxima] can someone please create a Windows installer for Maxima 5.27.0 In-Reply-To: References: <4F9DBDEE.8040605@gmail.com> Message-ID: Thanks! Hopefully, other people on this list will come to appreciate the advantages of "Portable Maxima". At 11:53 PM 4/29/2012, Johann Weilharter wrote: >There is a portable 5.24-Version at http://portableapps.com/node/23391 >KR Johnny W. > >2012/4/30 Henry Baker >Any hope for an updated "Portable Maxima" ?? > >http://portableapps.com/ > >I like to carry many of my apps around on a SD card or a USB stick. > >The most current version of Portable Maxima is 5.17.1. > >At 03:17 PM 4/29/2012, David Billinghurst wrote: >>On 30/04/2012 3:24 AM, Robert Dodier wrote: >>>can someone please create a Windows installer for Maxima 5.27.0? >>There is a windows installer at http://billinghurst.customer.netspace.net.au/maxima-5.27.0.exe >> >>It is built using the ancient gcl/gcc-3.3.1 used for previous windows builds. From mxue at vroomlab.com Mon Apr 30 15:36:23 2012 From: mxue at vroomlab.com (Michael) Date: Mon, 30 Apr 2012 20:36:23 +0000 (UTC) Subject: [Maxima] maxima problem References: <4F9DBDEE.8040605@gmail.com> Message-ID: Hi All, With the help of fellow maxima users, I finally got a maxima build on a sunsparc ultra 10 machine (solaris 10) However, when I type 'maxima' at the command line prompt, it returns to the command line immediately. Has anyone here encountered this problem before? I used cmucl lisp compiler for the build. Thanks! From toy.raymond at gmail.com Mon Apr 30 17:16:05 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 30 Apr 2012 15:16:05 -0700 Subject: [Maxima] maxima problem In-Reply-To: References: <4F9DBDEE.8040605@gmail.com> Message-ID: On Mon, Apr 30, 2012 at 1:36 PM, Michael wrote: > > Hi All, > With the help of fellow maxima users, I finally got a maxima build > on a sunsparc ultra 10 machine (solaris 10) However, when I type 'maxima' > at the command line prompt, it returns to the command line immediately. Has > anyone here encountered this problem before? I used cmucl lisp > compiler for the build. Thanks! > > No messages? In the maxima directory that holds the maxima sources, can you try running maxima-local. This should bring up a maxima using your local build instead of the installed version. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Mon Apr 30 20:12:02 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 30 Apr 2012 18:12:02 -0700 Subject: [Maxima] display of lisp complex numbers in wxmaxima Message-ID: <4F9F3862.7040607@eecs.berkeley.edu> with set_display('none), ?complex(3,4) displays as #c(3 4) which is, I suppose, fine. with set_display('xml), ?complex(3,4) returns $C(3Space4) which is peculiar. I suppose the rest of this note should be in a separate message .... There are subtle issues with representing 3+4*%i as a lisp complex number. For example, 3.0b0+4.0b0*%i cannot be a lisp complex number. But introducing lisp complex numbers into maxima sometimes may be helpful. Extending bigfloats to complex bigfloats may also be helpful. Does anyone actually need 1/(3+4*%i) or can we always clear the denominator ... 1/25*(3-4*%i) ? RJF From toy.raymond at gmail.com Mon Apr 30 21:26:42 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 30 Apr 2012 19:26:42 -0700 Subject: [Maxima] Maxima complex numbers (Was Re: display of lisp complex numbers in wxmaxima) In-Reply-To: <4F9F3862.7040607@eecs.berkeley.edu> References: <4F9F3862.7040607@eecs.berkeley.edu> Message-ID: <4F9F49E2.2050006@gmail.com> On 4/30/12 6:12 PM, Richard Fateman wrote: > > I suppose the rest of this note should be in a separate > message .... > > There are subtle issues with representing 3+4*%i as a lisp > complex number. For example, > 3.0b0+4.0b0*%i cannot be a lisp complex number. And don't forget that 4.0*%i is not really #c(0d0 4d0) for Lisp's that have signed floating-point zeroes. But this is really an esoteric corner case that is important only if you really, really need to deal with branch cuts on the imaginary axis. > > But introducing lisp complex numbers into maxima sometimes > may be helpful. Extending bigfloats to complex bigfloats > may also be helpful. This has been done in the bigfloat package that's built into maxima. Using (bigfloat:to <3b0+4b0*%i>) will convert to it to a bigfloat object that you can manipulate as if it were a standard Lisp complex object. At the end, when you need to get a representation that maxima understands, use (maxima::to ). > > > Does anyone actually need 1/(3+4*%i) or can we always > clear the denominator ... 1/25*(3-4*%i) ? This is probably one of the corner cases like whether sqrt(2)/2 should be automatically converted to 1/sqrt(2) or vice versa? It seems that long ago maxima did not convert sqrt(2)/2 to 1/sqrt(2) unless asked to. Current maxima always does the conversion. Ray From willisb at unk.edu Tue May 1 07:09:48 2012 From: willisb at unk.edu (Barton Willis) Date: Tue, 1 May 2012 12:09:48 +0000 Subject: [Maxima] assume & integrate = bugs Message-ID: <83FD4DC40F97654495E2C9AED47658360421E17A@BL2PRD0710MB361.namprd07.prod.outlook.com> By the way http://sourceforge.net/tracker/?func=detail&aid=3522750&group_id=4933&atid=104933 Maybe related bugs have been reported many times. --bw From robert.dodier at gmail.com Tue May 1 10:41:49 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 1 May 2012 15:41:49 +0000 (UTC) Subject: [Maxima] can someone please create a Windows installer for Maxima 5.27.0 References: <4F9DBDEE.8040605@gmail.com> Message-ID: On 2012-04-29, David Billinghurst wrote: > There is a windows installer at > http://billinghurst.customer.netspace.net.au/maxima-5.27.0.exe > > It is built using the ancient gcl/gcc-3.3.1 used for previous windows > builds. Thanks, David. I have uploaded maxima-5.27.0.exe to the Sourceforge file manager. http://sourceforge.net/projects/maxima/files Interested parties can give it a try and let us know how it turns out. best, Robert Dodier From yasuaki.honda at gmail.com Tue May 1 11:41:59 2012 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Wed, 2 May 2012 01:41:59 +0900 Subject: [Maxima] Windows and Mac package for 5.27.0 ? In-Reply-To: <4F9D84AE.2090802@gmail.com> References: <4F9D84AE.2090802@gmail.com> Message-ID: Dear all, I just noticed that Mac OS X package for 5.27.0 is uploaded to the SF file manager. I tested it on my Mac OS X 10.7.3, perfomed run_testsuite() and everything went well. Thanks !! 2012/4/30 Alexander Hansen > On 4/29/12 10:28 AM, Robert Dodier wrote: > > On 2012-04-29, =?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?= < > yasuaki.honda at gmail.com> wrote: > > > >> Is there anyone out there who is preparing for Windows / Mac installer > >> package for 5.27.0 ? > > > > It appears there is nobody who has built a Windows installer. > > If you wish to do so, please go ahead. See INSTALL.win32 in the > > top-level directory. > > > > Alexander Hansen is the maintainer of the Maxima package in Fink. > > There is a message on his blog about 5.27.0 > > (http://finkakh.wordpress.com/2012/04/21/maxima-5-27-0) > > although I don't see Maxima 5.27.0 in Fink. Maybe you can ask him about > it. > > > > Thank you for your efforts, > > > > Robert Dodier > > > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > Our package database generator script got stuck, unfortunately. 5.26.0 > is what's listed right now online at > > http://pdb.finkproject.org/pdb/package.php/maxima > > but 5.27.0 is available in the Fink distribution. Sorry for the confusion. > > > That being said, my packages aren't really set up currently to provide a > fully standalone maxima installation. > -- > Alexander Hansen, Ph.D. > Fink User Liaison > http://finkakh.wordpress.com/2012/02/21/got-job/ > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wmixon at berry.edu Tue May 1 11:37:52 2012 From: wmixon at berry.edu (Mixon, Wilson) Date: Tue, 1 May 2012 16:37:52 +0000 Subject: [Maxima] (no subject) Message-ID: I often use this function for illustration: z: x^a*y^b - c*x - d*y; Maxima will not provide the solution requested below. [Dx,Dy] : [diff(z,x),diff(z,y)]; solve([Dx,Dy],[x,y]); I can solve the system in a few steps, as below. declare(a,noninteger)$ assume(a>0,b>0,c>0,d>0,x>0,y>0)$ solve(Dx/Dy, x); subst(rhs(%[1]), x, Dy); solve(%,y); /*and so forth*/ Does Maxima offer a way for me to tell solve( ) enough for it to return a solution? From wmixon at berry.edu Tue May 1 11:41:27 2012 From: wmixon at berry.edu (Mixon, Wilson) Date: Tue, 1 May 2012 16:41:27 +0000 Subject: [Maxima] solve x^a*y^b-c*x-d*y In-Reply-To: References: Message-ID: I apologize for sending this message earlier without a subject line. I often use this function for illustration: z: x^a*y^b - c*x - d*y; Maxima will not provide the solution requested below. [Dx,Dy] : [diff(z,x),diff(z,y)]; solve([Dx,Dy],[x,y]); I can solve the system in a few steps, as below. declare(a,noninteger)$ assume(a>0,b>0,c>0,d>0,x>0,y>0)$ solve(Dx/Dy, x); subst(rhs(%[1]), x, Dy); solve(%,y); /*and so forth*/ Does Maxima offer a way for me to tell solve( ) enough for it to return a solution? From willisb at unk.edu Wed May 2 06:26:13 2012 From: willisb at unk.edu (Barton Willis) Date: Wed, 2 May 2012 11:26:13 +0000 Subject: [Maxima] solve x^a*y^b-c*x-d*y In-Reply-To: References: , Message-ID: <83FD4DC40F97654495E2C9AED47658360421E410@BL2PRD0710MB361.namprd07.prod.outlook.com> The solve function doesn't use the fact database all that much, so it's unlikely that any additional assumptions or declarations will allow Maxima to solve these equations automatically. For an automated solution to these equations (and similar equations), it's likely that you'll need to write additional code for either the solve function or the to_poly_solve function. --bw ________________________________________ I often use this function for illustration: z: x^a*y^b - c*x - d*y; Maxima will not provide the solution requested below. [Dx,Dy] : [diff(z,x),diff(z,y)]; solve([Dx,Dy],[x,y]); I can solve the system in a few steps, as below. declare(a,noninteger)$ assume(a>0,b>0,c>0,d>0,x>0,y>0)$ solve(Dx/Dy, x); subst(rhs(%[1]), x, Dy); solve(%,y); /*and so forth*/ Does Maxima offer a way for me to tell solve( ) enough for it to return a solution? From dbmaxima at gmail.com Wed May 2 06:54:43 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Wed, 02 May 2012 21:54:43 +1000 Subject: [Maxima] [Maxima-commits] Maxima, A Computer Algebra System branch branch-5_27 updated. branch-5_27-base-7-gfc9ff56 In-Reply-To: <4F9FDE3C.6070008@fe.up.pt> References: <4F9FDE3C.6070008@fe.up.pt> Message-ID: <4FA12083.9040301@gmail.com> On 1/05/2012 10:59 PM, Jaime Villate wrote: > On 05/01/2012 01:49 PM, David Billinghurst wrote: >> + cp $(MINGW)/bin/tclpip84.dll $(prefix)/bin > Hi David, > thank you for building the Maxima image for Windows. Could you please > make sure to use > tcl/tk 8.5 rather that 8.4? > Xmaxima works much better with 8.5. > Best regards, > Jaime > Thanks for the feedback. As discussed previously, the current build system for windows uses very old (2003) versions of gcc and mingw. As you have noted, it also uses tcl 8.4. I am not sure if there is a compatible tcl-8.5 available, although an update of the tclkit wrapper may be sufficient. I have an experimental build using recent mingw and gcc, and I hope to make a test build of 5.27.0 available shortly. I will see if I can use tcl-8.5 for this release. Unfortunately, I can only get this working under windows xp - builds under windows 7 (and vista) fail. From dbmaxima at gmail.com Wed May 2 07:21:54 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Wed, 02 May 2012 22:21:54 +1000 Subject: [Maxima] [Maxima-commits] Maxima, A Computer Algebra System branch branch-5_27 updated. branch-5_27-base-7-gfc9ff56 In-Reply-To: <4FA12083.9040301@gmail.com> References: <4F9FDE3C.6070008@fe.up.pt> <4FA12083.9040301@gmail.com> Message-ID: <4FA126E2.7060203@gmail.com> On 2/05/2012 9:54 PM, David Billinghurst wrote: > On 1/05/2012 10:59 PM, Jaime Villate wrote: >> On 05/01/2012 01:49 PM, David Billinghurst wrote: >>> + cp $(MINGW)/bin/tclpip84.dll $(prefix)/bin >> Hi David, >> thank you for building the Maxima image for Windows. Could you please >> make sure to use >> tcl/tk 8.5 rather that 8.4? >> Xmaxima works much better with 8.5. >> Best regards, >> Jaime >> > > Thanks for the feedback. > > As discussed previously, the current build system for windows uses > very old (2003) versions of gcc and mingw. As you have noted, it also > uses tcl 8.4. I am not sure if there is a compatible tcl-8.5 > available, although an update of the tclkit wrapper may be sufficient. > > I have an experimental build using recent mingw and gcc, and I hope to > make a test build of 5.27.0 available shortly. I will see if I can > use tcl-8.5 for this release. Unfortunately, I can only get this > working under windows xp - builds under windows 7 (and vista) fail. > The xmaxima shipped with the windows release of 5.27.0 uses tcl/tk-8.5.8 from tclkit-8.5.8-win32.upx.exe. tclpip84.dll is only used by tclwinkill. From macrakis at alum.mit.edu Wed May 2 07:39:16 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 2 May 2012 08:39:16 -0400 Subject: [Maxima] solve x^a*y^b-c*x-d*y In-Reply-To: References: Message-ID: The function name "solve" gives an exaggerated sense of power.... In particular, the multi-equation case only handles systems of linear or algebraic equations. This is documented, but still disappointing. Solve doesn't even handle trivial non-algebraic cases which can be handled using utterly elementary techniques. For example, solve has no problem with sin(x)=0 (let's ignore the multiple root issue), but solve([sin(x)=y,y=0],[x,y]) fails. In that case, to_poly_solve does succeed, and reports the multiple roots to boot. It would be great if someone would work on extending solve and %solve. By the way, as far as I can tell, Barton's %solve is better in every way than solve. It might be a good idea to have it replace the base system's solve, except that its output format is (necessarily) different from solve's, and it doesn't handle many of solve's fancy modes, so any code that depends on solve will have problems. -s On Tue, May 1, 2012 at 12:41 PM, Mixon, Wilson wrote: > I apologize for sending this message earlier without a subject line. > > > I often use this function for illustration: > z: x^a*y^b - c*x - d*y; > > Maxima will not provide the solution requested below. > [Dx,Dy] : [diff(z,x),diff(z,y)]; > solve([Dx,Dy],[x,y]); > > I can solve the system in a few steps, as below. > declare(a,noninteger)$ assume(a>0,b>0,c>0,d>0,x>0,y>0)$ > solve(Dx/Dy, x); subst(rhs(%[1]), x, Dy); > solve(%,y); > /*and so forth*/ > > Does Maxima offer a way for me to tell solve( ) enough for it to return a > solution? > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Wed May 2 07:57:20 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 02 May 2012 13:57:20 +0100 Subject: [Maxima] [Maxima-commits] Maxima, A Computer Algebra System branch branch-5_27 updated. branch-5_27-base-7-gfc9ff56 In-Reply-To: <4FA126E2.7060203@gmail.com> References: <4F9FDE3C.6070008@fe.up.pt> <4FA12083.9040301@gmail.com> <4FA126E2.7060203@gmail.com> Message-ID: <4FA12F30.609@fe.up.pt> On 05/02/2012 01:21 PM, David Billinghurst wrote: > The xmaxima shipped with the windows release of 5.27.0 uses > tcl/tk-8.5.8 from tclkit-8.5.8-win32.upx.exe. tclpip84.dll is only > used by tclwinkill. OK, that's good then. Thanks for your reply. Cheers, Jaime From willisb at unk.edu Wed May 2 10:03:49 2012 From: willisb at unk.edu (Barton Willis) Date: Wed, 2 May 2012 15:03:49 +0000 Subject: [Maxima] solve x^a*y^b-c*x-d*y In-Reply-To: References: , Message-ID: <83FD4DC40F97654495E2C9AED47658360421F4D9@BL2PRD0710MB361.namprd07.prod.outlook.com> > By the way, as far as I can tell, Barton's %solve is better in every way than solve. It might be a good idea to have it replace the base system's solve, except that its output > format is (necessarily) different from solve's, and it doesn't handle many of solve's fancy modes, so any code that depends on solve will have problems. The solve function sets the global multiplicities, but %solve doesn't. Actually, the mechanism is broken (and globals used this way are icky, I think) (%i2) solve(x,x); (%o2) [x=0] OK: (%i4) multiplicities; (%o4) [1] (%i5) solve(x^a,x); (%o5) [x=0] Bogus: ( (%i6) multiplicities; (%o6) [1] Compatibility with solve wasn't what I was aiming for when I wrote the to_poly_solver--replacing solve with %solve isn't something I've tried to do. Most of %solve is written in Maxima--I think this was a good choice. Maybe it will make it easier for others to extend. --bw From macrakis at alum.mit.edu Wed May 2 10:13:26 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 2 May 2012 11:13:26 -0400 Subject: [Maxima] solve x^a*y^b-c*x-d*y In-Reply-To: <83FD4DC40F97654495E2C9AED47658360421F4D9@BL2PRD0710MB361.namprd07.prod.outlook.com> References: <83FD4DC40F97654495E2C9AED47658360421F4D9@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: Yes, other "fancy" features in solve include breakup, programmode, globalsolve, solveradcan, etc. Most of these should probably disappear if we can ever bring ourselves to break compatibility with vintage solve.... -s On Wed, May 2, 2012 at 11:03 AM, Barton Willis wrote: > > By the way, as far as I can tell, Barton's %solve is better in every way > than solve. It might be a good idea to have it replace the base system's > solve, except that its output > > format is (necessarily) different from solve's, and it doesn't handle > many of solve's fancy modes, so any code that depends on solve will have > problems. > > The solve function sets the global multiplicities, but %solve doesn't. > Actually, the mechanism is broken (and globals used this way are icky, I > think) > > (%i2) solve(x,x); > (%o2) [x=0] > > OK: > > (%i4) multiplicities; > (%o4) [1] > > (%i5) solve(x^a,x); > (%o5) [x=0] > > Bogus: ( > > (%i6) multiplicities; > (%o6) [1] > > Compatibility with solve wasn't what I was aiming for when I wrote the > to_poly_solver--replacing solve with %solve isn't something I've tried to > do. > Most of %solve is written in Maxima--I think this was a good choice. Maybe > it will make it easier for others to extend. > > --bw > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From soichi777 at gmail.com Wed May 2 20:19:12 2012 From: soichi777 at gmail.com (ishi soichi) Date: Thu, 3 May 2012 10:19:12 +0900 Subject: [Maxima] eliminating '1.0' when divided by float numbers Message-ID: Maxima 5.25 Hi. say I have an equation like 3 = 3.5 %e^( ...); then, I want to eliminate '3.5', so I divide the whole thing by 3.5. %/3.5; it gives, ... = 1.0 %e^(...) '1.0' remains there. Of course there is no influence in terms of math, but it matters if I want to take log of it, log(%); gives, ... = log(1.0 %e^(...)) Is there anyway to eliminate '1.0' so that it becomes easier to compute it? soichi -------------- next part -------------- An HTML attachment was scrubbed... URL: From soichi777 at gmail.com Wed May 2 20:22:23 2012 From: soichi777 at gmail.com (ishi soichi) Date: Thu, 3 May 2012 10:22:23 +0900 Subject: [Maxima] imaxima: copying outputs to clipboard Message-ID: Maxima 5.15 I am using imaxima so that Maxima runs on Emacs. I have a simple question (which must be tedious for many of you). How can I copy outputs to clipboard? Since the outputs are generated as LaTex image, the equation and numbers appear in the buffer are images rather than strings. Thanks in advance. soichi -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Wed May 2 20:29:23 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 2 May 2012 21:29:23 -0400 Subject: [Maxima] eliminating '1.0' when divided by float numbers In-Reply-To: References: Message-ID: In Maxima, floating-point numbers represent approximate quantities. The formula 1.0*x is different from just x, which is an exact number. If you want to convert all approximate numbers to a nearby round number, you could do something like floats_to_rats(expr) := block([ratprint:false], scanmap(lambda([q],if floatnump(q) then rat(q) else q),expr))$ see ? ratepsilon to control the tolerance. You could also do rat(expr), but that will change the form of the expression in general. -s On Wed, May 2, 2012 at 9:19 PM, ishi soichi wrote: > Maxima 5.25 > > Hi. say I have an equation like > > 3 = 3.5 %e^( ...); > > then, I want to eliminate '3.5', so I divide the whole thing by 3.5. > > %/3.5; > > it gives, > > ... = 1.0 %e^(...) > > > '1.0' remains there. Of course there is no influence in terms of math, > but it matters if I want to take log of it, > > log(%); > > gives, > > ... = log(1.0 %e^(...)) > > Is there anyway to eliminate '1.0' so that it becomes easier to compute it? > > > soichi > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From soichi777 at gmail.com Wed May 2 20:32:11 2012 From: soichi777 at gmail.com (ishi soichi) Date: Thu, 3 May 2012 10:32:11 +0900 Subject: [Maxima] eliminating '1.0' when divided by float numbers In-Reply-To: References: Message-ID: Thanks for your answer. it helps a lot! soichi 2012/5/3 Stavros Macrakis > In Maxima, floating-point numbers represent approximate quantities. The > formula 1.0*x is different from just x, which is an exact number. If you > want to convert all approximate numbers to a nearby round number, you could > do something like > > floats_to_rats(expr) := > block([ratprint:false], > scanmap(lambda([q],if floatnump(q) then rat(q) else q),expr))$ > > see ? ratepsilon to control the tolerance. You could also do rat(expr), > but that will change the form of the expression in general. > > -s > > On Wed, May 2, 2012 at 9:19 PM, ishi soichi wrote: > >> Maxima 5.25 >> >> Hi. say I have an equation like >> >> 3 = 3.5 %e^( ...); >> >> then, I want to eliminate '3.5', so I divide the whole thing by 3.5. >> >> %/3.5; >> >> it gives, >> >> ... = 1.0 %e^(...) >> >> >> '1.0' remains there. Of course there is no influence in terms of math, >> but it matters if I want to take log of it, >> >> log(%); >> >> gives, >> >> ... = log(1.0 %e^(...)) >> >> Is there anyway to eliminate '1.0' so that it becomes easier to compute >> it? >> >> >> soichi >> >> >> >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Thu May 3 00:11:22 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 02 May 2012 22:11:22 -0700 Subject: [Maxima] New slatec translations for ecl's string issue Message-ID: I've regenerated all of the slatec code using the latest version of f2cl. This fixes an issue with ecl 11.x where ecl would convert literal strings to either base-strings or strings depending on the content and this causes problems with the declarations f2cl had generated. As a side effect, a couple of the find_root(quad_qags(...)) tests in rtest14 now pass. They were failing because quad_qags wanted to print some warnings, but the type declarations caused an runtime error that maxima thought was a general failure of quad_qags. I've tested these changes using the testsuite with cmucl, ccl, ecl, and sbcl on my Mac, and no unexpected tests fail. Please test these with your favorite lisp and let me know if there are any issues. Ray From Bart.Vandewoestyne at telenet.be Thu May 3 06:18:39 2012 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Thu, 03 May 2012 13:18:39 +0200 Subject: [Maxima] plotting modulus of complex function Message-ID: <4FA2698F.9040702@gmail.com> Hello list, Using wxMaxima 0.8.5, I'm trying to plot the modulus of two complex function on the positive real axis.: d: 1e-3$ f: 10^6$ omega: 2*%pi*f$ epsilon[0]: 8.8541878176e-2$ mu[0]: 4*%pi*10^(-7)$ v[0]: 1/sqrt(epsilon[0]*mu[0])$ k[0]: 2*%pi*f/v[0]$ epsilon[sub]: 12.9*epsilon[0]$ Z_TE_sub(s) := %i*omega*mu[0]/(k[0]*sqrt(s^2-epsilon[sub]/epsilon[0]))$ Z_TE_0(s) := %i*omega*mu[0]/(k[0]*sqrt(s^2-1))$ Z_TM_sub(s) := (k[0]*sqrt(s^2-epsilon[sub]/epsilon[0]))/(%i*omega*epsilon[sub])$ Z_TM_0(s) := (k[0]*sqrt(s^2-1))/(%i*omega*epsilon[0])$ vTE(s) := (Z_TE_sub(s)*Z_TE_0(s))/(Z_TE_sub(s) + Z_TE_0(s)*coth(d*k[0]*sqrt(s^2-epsilon[sub]/epsilon[0])))$ vTM(s) := (Z_TM_sub(s)*Z_TM_0(s))/(Z_TM_sub(s) + Z_TM_0(s)*coth(d*k[0]*sqrt(s^2-epsilon[sub]/epsilon[0])))$ Gm(s) := -vTE(s)/(2*%pi)$ Ge(s) := (vTE(s)-vTM(s))/(2*%pi*s*k[0])$ plot2d(float(abs(Gm(s))), [s, 1e-1, 1e3]); plot2d(float(abs(Ge(s))), [s, 1e-1, 1e3]); Unfortunately, this fails. I get the error: (%i18) plot2d(float(abs(Gm(s))),[s,0.1,1000.0]) Maxima encountered a Lisp error: Couldn't write to #: Broken pipe Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%i19) plot2d(float(abs(Ge(s))),[s,0.1,1000.0]) Maxima encountered a Lisp error: Couldn't write to #: Broken pipe Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. Unfortunately, from the error I cannot make up what I'm doing wrong. Could someone explain it to me? My .mac file can also be found at https://www.dropbox.com/s/934yxkm4bq3bcg9/bartfile.mac Kind regards, Bart From maxima at peutch.e4ward.com Thu May 3 06:32:17 2012 From: maxima at peutch.e4ward.com (maxima at peutch.e4ward.com) Date: Thu, 03 May 2012 12:32:17 +0100 Subject: [Maxima] Labelled indices on arrays Message-ID: <4FA26CC1.5000707@blanchenay.net> Dear all, Sorry for this very simple question, I basically would like to use arrays to create a bunch of repetitive variables. I would like to create variables for each of the 2x2 possible states of my model. Along the first dimension, the state is either a or b. Along the second: x or y. I started by creating manually: variable_ax: 1; variable_ay: 33; variable_bx: 4; variable_by: 50; What I would like to do is something like being able to assign: variable['a]['x] : 1; variable['a]['y] : 33; and so on. But i get an error (assignment: cannot assign to (variable['a])['x]). In other words, I would like to create arrays the indices of which are actually letters, not numbers. I looked and looked at the manual but arrays are a bit cryptic to me. Could anyone explain to me briefly how I could achieve that? Thanks for your help! Patrick From villate at fe.up.pt Thu May 3 08:26:24 2012 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 03 May 2012 14:26:24 +0100 Subject: [Maxima] plotting modulus of complex function In-Reply-To: <4FA2698F.9040702@gmail.com> References: <4FA2698F.9040702@gmail.com> Message-ID: <4FA28780.6070909@fe.up.pt> On 05/03/2012 12:18 PM, Bart Vandewoestyne wrote: > sing wxMaxima 0.8.5, I'm trying to plot the modulus of two complex > function on the positive real axis.: > > d: 1e-3$ > f: 10^6$ > omega: 2*%pi*f$ > epsilon[0]: 8.8541878176e-2$ > mu[0]: 4*%pi*10^(-7)$ > v[0]: 1/sqrt(epsilon[0]*mu[0])$ > k[0]: 2*%pi*f/v[0]$ > epsilon[sub]: 12.9*epsilon[0]$ > > Z_TE_sub(s) := %i*omega*mu[0]/(k[0]*sqrt(s^2-epsilon[sub]/epsilon[0]))$ > Z_TE_0(s) := %i*omega*mu[0]/(k[0]*sqrt(s^2-1))$ > Z_TM_sub(s) := > (k[0]*sqrt(s^2-epsilon[sub]/epsilon[0]))/(%i*omega*epsilon[sub])$ > Z_TM_0(s) := (k[0]*sqrt(s^2-1))/(%i*omega*epsilon[0])$ > vTE(s) := (Z_TE_sub(s)*Z_TE_0(s))/(Z_TE_sub(s) + > Z_TE_0(s)*coth(d*k[0]*sqrt(s^2-epsilon[sub]/epsilon[0])))$ > vTM(s) := (Z_TM_sub(s)*Z_TM_0(s))/(Z_TM_sub(s) + > Z_TM_0(s)*coth(d*k[0]*sqrt(s^2-epsilon[sub]/epsilon[0])))$ > Gm(s) := -vTE(s)/(2*%pi)$ > Ge(s) := (vTE(s)-vTM(s))/(2*%pi*s*k[0])$ > > plot2d(float(abs(Gm(s))), [s, 1e-1, 1e3]); > plot2d(float(abs(Ge(s))), [s, 1e-1, 1e3]); > > > Unfortunately, this fails. I get the error: Hi, the function used to obtain the modulus of a complex number is cabs() and not abs(). However, in the command plot2d(float(abs(Ge(s))), [s, 1e-1, 1e3]) cabs would give you a very long expression in terms of s which might get your system stuck. I suggest that you first compute the floating-point value for a given s, then compute cabs and only then pass the result. Also, the notation epsilon[0] might look cute in Wxmaxima, but it means defining an array which you really don't need and will add to the computational complexity. You might want to try something such as: d: 1e-3$ f: 1e6$ omega: 2*%pi*f$ epsilon0: 8.8541878176e-2$ mu0: 4*%pi*1e-7$ v0: 1/sqrt(epsilon0*mu0)$ k0: 2*%pi*f/v0$ epsilonsub: 12.9*epsilon0$ Z_TE_sub(s) := %i*omega*mu0/(k0*sqrt(s^2-epsilonsub/epsilon0))$ Z_TE_0(s) := %i*omega*mu0/(k0*sqrt(s^2-1))$ Z_TM_sub(s) := (k0*sqrt(s^2-epsilonsub/epsilon0))/(%i*omega*epsilonsub)$ Z_TM_0(s) := (k0*sqrt(s^2-1))/(%i*omega*epsilon0)$ vTE(s) := (Z_TE_sub(s)*Z_TE_0(s))/(Z_TE_sub(s) + Z_TE_0(s)*coth(d*k0*sqrt(s^2-epsilonsub/epsilon0)))$ vTM(s) := (Z_TM_sub(s)*Z_TM_0(s))/(Z_TM_sub(s) + Z_TM_0(s)*coth(d*k0*sqrt(s^2-epsilonsub/epsilon0)))$ Gm(s) := cabs(float(-vTE(s)/(2*%pi)))$ Ge(s) := cabs(float((vTE(s)-vTM(s))/(2*%pi*s*k0)))$ Your functions have several steep spikes, so you might have to view separate parts of the frequency domain in separate plots, in order to see the separate spikes. For instance: plot2d(Ge, [s,0.1,3.5]); plot2d(Ge, [s,1.1,3.5]); and notice that I have called Ge by name, rather than Ge(s), which would pass a huge expression of s to plot2d. Regards, Jaime -------------- next part -------------- An HTML attachment was scrubbed... URL: From andre.maute at gmx.de Thu May 3 08:26:08 2012 From: andre.maute at gmx.de (andre maute) Date: Thu, 03 May 2012 15:26:08 +0200 Subject: [Maxima] Labelled indices on arrays In-Reply-To: <4FA26CC1.5000707@blanchenay.net> References: <4FA26CC1.5000707@blanchenay.net> Message-ID: <4FA28770.60307@gmx.de> On 05/03/2012 01:32 PM, maxima at peutch.e4ward.com wrote: > Dear all, > Sorry for this very simple question, I basically would like to use > arrays to create a bunch of repetitive variables. > > I would like to create variables for each of the 2x2 possible states of > my model. Along the first dimension, the state is either a or b. Along > the second: x or y. > > I started by creating manually: > variable_ax: 1; > variable_ay: 33; > variable_bx: 4; > variable_by: 50; > > What I would like to do is something like being able to assign: > variable['a]['x] : 1; > variable['a]['y] : 33; > > and so on. But i get an error (assignment: cannot assign to > (variable['a])['x]). > In other words, I would like to create arrays the indices of which are > actually letters, not numbers. > > I looked and looked at the manual but arrays are a bit cryptic to me. > Could anyone explain to me briefly how I could achieve that? Why can't you use something like (%i1) display2d : false; (%o1) false (%i2) a : makelist(concat(a_,k),k,1,7); (%o2) [a_1,a_2,a_3,a_4,a_5,a_6,a_7] Andre From maxima at peutch.e4ward.com Thu May 3 08:45:53 2012 From: maxima at peutch.e4ward.com (maxima at peutch.e4ward.com) Date: Thu, 03 May 2012 14:45:53 +0100 Subject: [Maxima] Labelled indices on arrays In-Reply-To: <4FA28770.60307@gmx.de> References: <4FA26CC1.5000707@blanchenay.net> <4FA28770.60307@gmx.de> Message-ID: <4FA28C11.9030607@blanchenay.net> Je la 03/05/2012 14:26, andre maute skribis: >> What I would like to do is something like being able to assign: >> variable['a]['x] : 1; >> variable['a]['y] : 33; >> >> and so on. But i get an error (assignment: cannot assign to >> (variable['a])['x]). >> In other words, I would like to create arrays the indices of which are >> actually letters, not numbers. > Why can't you use something like > > (%i1) display2d : false; > (%o1) false > (%i2) a : makelist(concat(a_,k),k,1,7); > (%o2) [a_1,a_2,a_3,a_4,a_5,a_6,a_7] > > Andre Hi Andre, Actually, my state space is more than 2x2, it's four by four. What I'd l ike to do ultimately is to do loops that will define a lot of other arrays with the same indices, e.g. for state1 in [a,b,c,d] do for state2 in [w,x,y,z] do variable_bis[state1][state2]: 4* variable[state1][state2]; variable_ter[state1][state2]: cos(variable[state1][state2]); (Sorry I know the loop syntax is wrong but I don't have time to check right now.) It would just make my life a lot easier if I didn't have to remember what integer represented what state if I write something like variable[1][3]. Thanks Patrick From villate at fe.up.pt Thu May 3 08:50:20 2012 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 03 May 2012 14:50:20 +0100 Subject: [Maxima] Labelled indices on arrays In-Reply-To: <4FA26CC1.5000707@blanchenay.net> References: <4FA26CC1.5000707@blanchenay.net> Message-ID: <4FA28D1C.3010902@fe.up.pt> On 05/03/2012 12:32 PM, maxima at peutch.e4ward.com wrote: > I would like to create variables for each of the 2x2 possible states of > my model. Along the first dimension, the state is either a or b. Along > the second: x or y. > > I started by creating manually: > variable_ax: 1; > variable_ay: 33; > variable_bx: 4; > variable_by: 50; > > What I would like to do is something like being able to assign: > variable['a]['x] : 1; > variable['a]['y] : 33; > > and so on. But i get an error (assignment: cannot assign to > (variable['a])['x]). (%i2) concat('variable_,'a,'x) :: 1; (%o2) 1 (%i3) concat('variable_,'a,'y) :: 33; (%o3) 33 (%i4) variable_ax; (%o4) 1 (%i5) variable_ay; (%o5) 33 Cheers, Jaime From villate at fe.up.pt Thu May 3 08:53:34 2012 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 03 May 2012 14:53:34 +0100 Subject: [Maxima] Labelled indices on arrays In-Reply-To: <4FA28D1C.3010902@fe.up.pt> References: <4FA26CC1.5000707@blanchenay.net> <4FA28D1C.3010902@fe.up.pt> Message-ID: <4FA28DDE.7060808@fe.up.pt> On 05/03/2012 02:50 PM, Jaime Villate wrote: > On 05/03/2012 12:32 PM, maxima at peutch.e4ward.com wrote: >> I would like to create variables for each of the 2x2 possible states of >> my model. Along the first dimension, the state is either a or b. Along >> the second: x or y. >> >> I started by creating manually: >> variable_ax: 1; >> variable_ay: 33; >> variable_bx: 4; >> variable_by: 50; >> >> What I would like to do is something like being able to assign: >> variable['a]['x] : 1; >> variable['a]['y] : 33; >> >> and so on. But i get an error (assignment: cannot assign to >> (variable['a])['x]). > (%i2) concat('variable_,'a,'x) :: 1; > (%o2) 1 > (%i3) concat('variable_,'a,'y) :: 33; > (%o3) 33 > (%i4) variable_ax; > (%o4) 1 > (%i5) variable_ay; > (%o5) 33 I forgot to paste: (%i6) ''(concat('variable_,'a,'x)); (%o8) 1 Jaime From jeff.bezanson at gmail.com Wed May 2 17:08:10 2012 From: jeff.bezanson at gmail.com (Jeff Bezanson) Date: Wed, 2 May 2012 22:08:10 +0000 (UTC) Subject: [Maxima] julia language References: <1335619678.88712.YahooMailNeo@web132501.mail.ird.yahoo.com> Message-ID: Hello, one of the creators of Julia here. Just want to clear a few things up. First of all, maxima is a great system. I'm familiar with some of you guys' work in the lisp world and I am a big fan. Yes, it is femtolisp not femlisp. This is a small lisp dialect I wrote for fun, and used to write the parser and initial lowering pass for julia. From there further optimizations are implemented in julia itself, and eventually LLVM code is generated. We have no illusions about being a computer algebra system; trying to recreate the work that's gone into maxima would be insane. We could of course benefit from calling maxima, but it would probably have to be through some interface that wouldn't feel entirely natural. People's rejection of lisp syntax is not rational but we seem to be stuck with it. However Julia is not *just* a skin on lisp. It is based on generic functions as the primary abstraction mechanism. As in CLOS, but it is used for everything from the ground up. We feel our design combines several forms of polymorphism into one seamless experience, plus is well-integrated with dynamic type inference. Julia is designed to push more functionality into libraries, so the details of arithmetic for example are not entirely embedded in the compiler. It is pretty easy to integrate new numeric types, and there are user-defined "bits types" which have the same representation and performance as our default numeric types, but type-wise are totally distinct (though they may share abstract supertypes). regards, -Jeff From l_butler at users.sourceforge.net Thu May 3 10:47:10 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Thu, 03 May 2012 15:47:10 +0000 Subject: [Maxima] imaxima: copying outputs to clipboard In-Reply-To: (message from ishi soichi on Thu, 3 May 2012 10:22:23 +0900) Message-ID: <1qplil9i7wh.fsf@iceland.freeshell.org> ishi soichi writes: > [1:multipart/alternative Hide] > [1/1:text/plain Hide] > Maxima 5.15 > > I am using imaxima so that Maxima runs on Emacs. > > I have a simple question (which must be tedious for many of you). > > How can I copy outputs to clipboard? > > Since the outputs are generated as LaTex image, the equation and numbers > appear in the buffer are images rather than strings. I don't know if this exactly answers your question, but you can change between text and image output in the imaxima buffer with display2d:true $ /* change to 2d text output */ display2d:imaxima $ /* image output */ Since Maxima keeps its output in the variables %o1, etc, you can toggle between the two display modes and (re)print output as text as need be. It would be pretty easy to write a convenience function in emacs lisp to do this, and bind it to a key combination. Leo From patrick at blanchenay.net Thu May 3 12:21:46 2012 From: patrick at blanchenay.net (Patrick Blanchenay) Date: Thu, 03 May 2012 18:21:46 +0100 Subject: [Maxima] Labelled indices on arrays In-Reply-To: <4FA28DDE.7060808@fe.up.pt> References: <4FA26CC1.5000707@blanchenay.net> <4FA28D1C.3010902@fe.up.pt> <4FA28DDE.7060808@fe.up.pt> Message-ID: <4FA2BEAA.7020607@blanchenay.net> Je la 03/05/2012 14:53, Jaime Villate skribis: > On 05/03/2012 02:50 PM, Jaime Villate wrote: >> On 05/03/2012 12:32 PM, maxima at peutch.e4ward.com wrote: >>> I would like to create variables for each of the 2x2 possible states of >>> my model. Along the first dimension, the state is either a or b. Along >>> the second: x or y. >>> >>> I started by creating manually: >>> variable_ax: 1; >>> variable_ay: 33; >>> variable_bx: 4; >>> variable_by: 50; >>> >>> What I would like to do is something like being able to assign: >>> variable['a]['x] : 1; >>> variable['a]['y] : 33; >>> >>> and so on. But i get an error (assignment: cannot assign to >>> (variable['a])['x]). >> (%i2) concat('variable_,'a,'x) :: 1; >> (%o2) 1 >> (%i3) concat('variable_,'a,'y) :: 33; >> (%o3) 33 >> (%i4) variable_ax; >> (%o4) 1 >> (%i5) variable_ay; >> (%o5) 33 > I forgot to paste: > > (%i6) ''(concat('variable_,'a,'x)); > (%o8) 1 > > Jaime > > Thanks! Does that mean that there is no solution with arrays? From macrakis at alum.mit.edu Thu May 3 12:30:15 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 3 May 2012 13:30:15 -0400 Subject: [Maxima] Labelled indices on arrays In-Reply-To: <4FA2BEAA.7020607@blanchenay.net> References: <4FA26CC1.5000707@blanchenay.net> <4FA28D1C.3010902@fe.up.pt> <4FA28DDE.7060808@fe.up.pt> <4FA2BEAA.7020607@blanchenay.net> Message-ID: var['a,'x]:1$ Longer example: (%i1) for i in '[a,b,c,d] do for j in '[q,r,s,t] do var[i,j] : random(100); (%o1) done (%i2) listarray(var); (%o2) [12,2,34,85,4,91,29,85,98,3,35,65,40,26,39,20] (%i3) arrayinfo(var); (%o3) [hashed,2,[a,q],[a,r],[a,s],[a,t],[b,q],[b,r],[b,s],[b,t],[c,q],[c,r],[c,s],[c,t],[d,q],[d,r],[d,s],[d,t]] On Thu, May 3, 2012 at 1:21 PM, Patrick Blanchenay wrote: > Je la 03/05/2012 14:53, Jaime Villate skribis: > > On 05/03/2012 02:50 PM, Jaime Villate wrote: > >> On 05/03/2012 12:32 PM, maxima at peutch.e4ward.com wrote: > >>> I would like to create variables for each of the 2x2 possible states of > >>> my model. Along the first dimension, the state is either a or b. Along > >>> the second: x or y. > >>> > >>> I started by creating manually: > >>> variable_ax: 1; > >>> variable_ay: 33; > >>> variable_bx: 4; > >>> variable_by: 50; > >>> > >>> What I would like to do is something like being able to assign: > >>> variable['a]['x] : 1; > >>> variable['a]['y] : 33; > >>> > >>> and so on. But i get an error (assignment: cannot assign to > >>> (variable['a])['x]). > >> (%i2) concat('variable_,'a,'x) :: 1; > >> (%o2) 1 > >> (%i3) concat('variable_,'a,'y) :: 33; > >> (%o3) 33 > >> (%i4) variable_ax; > >> (%o4) 1 > >> (%i5) variable_ay; > >> (%o5) 33 > > I forgot to paste: > > > > (%i6) ''(concat('variable_,'a,'x)); > > (%o8) 1 > > > > Jaime > > > > > > Thanks! Does that mean that there is no solution with arrays? > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Thu May 3 12:34:27 2012 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 03 May 2012 18:34:27 +0100 Subject: [Maxima] Labelled indices on arrays In-Reply-To: <4FA2BEAA.7020607@blanchenay.net> References: <4FA26CC1.5000707@blanchenay.net> <4FA28D1C.3010902@fe.up.pt> <4FA28DDE.7060808@fe.up.pt> <4FA2BEAA.7020607@blanchenay.net> Message-ID: <4FA2C1A3.1070809@fe.up.pt> On 05/03/2012 06:21 PM, Patrick Blanchenay wrote: > Thanks! Does that mean that there is no solution with arrays? I don't know how to create hashed arrays with more than one index in Maxima. If you want to investigate that, search for hashed arrays. Regards, Jaime From macrakis at alum.mit.edu Thu May 3 12:44:02 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 3 May 2012 13:44:02 -0400 Subject: [Maxima] Labelled indices on arrays In-Reply-To: <4FA2C1A3.1070809@fe.up.pt> References: <4FA26CC1.5000707@blanchenay.net> <4FA28D1C.3010902@fe.up.pt> <4FA28DDE.7060808@fe.up.pt> <4FA2BEAA.7020607@blanchenay.net> <4FA2C1A3.1070809@fe.up.pt> Message-ID: a['x,'y] : 23 On Thu, May 3, 2012 at 1:34 PM, Jaime Villate wrote: > On 05/03/2012 06:21 PM, Patrick Blanchenay wrote: > >> Thanks! Does that mean that there is no solution with arrays? >> > I don't know how to create hashed arrays with more than one index in > Maxima. > If you want to investigate that, search for hashed arrays. > Regards, > Jaime > > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxima at peutch.e4ward.com Thu May 3 13:25:28 2012 From: maxima at peutch.e4ward.com (maxima at peutch.e4ward.com) Date: Thu, 03 May 2012 19:25:28 +0100 Subject: [Maxima] Labelled indices on arrays In-Reply-To: References: <4FA26CC1.5000707@blanchenay.net> <4FA28D1C.3010902@fe.up.pt> <4FA28DDE.7060808@fe.up.pt> <4FA2BEAA.7020607@blanchenay.net> Message-ID: <4FA2CD98.4000806@blanchenay.net> Thanks, just what I needed! Je la 03/05/2012 18:30, Stavros Macrakis skribis: > var['a,'x]:1$ > > Longer example: > > (%i1) for i in '[a,b,c,d] do for j in '[q,r,s,t] do var[i,j] : random(100); > (%o1) done > (%i2) listarray(var); > (%o2) [12,2,34,85,4,91,29,85,98,3,35,65,40,26,39,20] > (%i3) arrayinfo(var); > (%o3) > [hashed,2,[a,q],[a,r],[a,s],[a,t],[b,q],[b,r],[b,s],[b,t],[c,q],[c,r],[c,s],[c,t],[d,q],[d,r],[d,s],[d,t]] > > On Thu, May 3, 2012 at 1:21 PM, Patrick Blanchenay > > wrote: > > Je la 03/05/2012 14:53, Jaime Villate skribis: > > On 05/03/2012 02:50 PM, Jaime Villate wrote: > >> On 05/03/2012 12:32 PM, maxima at peutch.e4ward.com > wrote: > >>> I would like to create variables for each of the 2x2 possible > states of > >>> my model. Along the first dimension, the state is either a or b. > Along > >>> the second: x or y. > >>> > >>> I started by creating manually: > >>> variable_ax: 1; > >>> variable_ay: 33; > >>> variable_bx: 4; > >>> variable_by: 50; > >>> > >>> What I would like to do is something like being able to assign: > >>> variable['a]['x] : 1; > >>> variable['a]['y] : 33; > >>> > >>> and so on. But i get an error (assignment: cannot assign to > >>> (variable['a])['x]). > >> (%i2) concat('variable_,'a,'x) :: 1; > >> (%o2) 1 > >> (%i3) concat('variable_,'a,'y) :: 33; > >> (%o3) 33 > >> (%i4) variable_ax; > >> (%o4) 1 > >> (%i5) variable_ay; > >> (%o5) 33 > > I forgot to paste: > > > > (%i6) ''(concat('variable_,'a,'x)); > > (%o8) 1 > > > > Jaime > > > > > > Thanks! Does that mean that there is no solution with arrays? > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Thu May 3 13:46:14 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 3 May 2012 14:46:14 -0400 Subject: [Maxima] Labelled indices on arrays In-Reply-To: <4FA2CD98.4000806@blanchenay.net> References: <4FA26CC1.5000707@blanchenay.net> <4FA28D1C.3010902@fe.up.pt> <4FA28DDE.7060808@fe.up.pt> <4FA2BEAA.7020607@blanchenay.net> <4FA2CD98.4000806@blanchenay.net> Message-ID: The solutions using concat may (unfortunately) be necessary in some cases -- some parts of Maxima (sorry, I don't have a list) don't allow subscripted variables. But if they're not necessary, a[i,j] is cleaner, simpler, and more efficient. -s On Thu, May 3, 2012 at 2:25 PM, wrote: > Thanks, just what I needed! > > Je la 03/05/2012 18:30, Stavros Macrakis skribis: > > var['a,'x]:1$ > > > > Longer example: > > > > (%i1) for i in '[a,b,c,d] do for j in '[q,r,s,t] do var[i,j] : > random(100); > > (%o1) done > > (%i2) listarray(var); > > (%o2) [12,2,34,85,4,91,29,85,98,3,35,65,40,26,39,20] > > (%i3) arrayinfo(var); > > (%o3) > > > [hashed,2,[a,q],[a,r],[a,s],[a,t],[b,q],[b,r],[b,s],[b,t],[c,q],[c,r],[c,s],[c,t],[d,q],[d,r],[d,s],[d,t]] > > > > On Thu, May 3, 2012 at 1:21 PM, Patrick Blanchenay > > > wrote: > > > > Je la 03/05/2012 14:53, Jaime Villate skribis: > > > On 05/03/2012 02:50 PM, Jaime Villate wrote: > > >> On 05/03/2012 12:32 PM, maxima at peutch.e4ward.com > > wrote: > > >>> I would like to create variables for each of the 2x2 possible > > states of > > >>> my model. Along the first dimension, the state is either a or b. > > Along > > >>> the second: x or y. > > >>> > > >>> I started by creating manually: > > >>> variable_ax: 1; > > >>> variable_ay: 33; > > >>> variable_bx: 4; > > >>> variable_by: 50; > > >>> > > >>> What I would like to do is something like being able to assign: > > >>> variable['a]['x] : 1; > > >>> variable['a]['y] : 33; > > >>> > > >>> and so on. But i get an error (assignment: cannot assign to > > >>> (variable['a])['x]). > > >> (%i2) concat('variable_,'a,'x) :: 1; > > >> (%o2) 1 > > >> (%i3) concat('variable_,'a,'y) :: 33; > > >> (%o3) 33 > > >> (%i4) variable_ax; > > >> (%o4) 1 > > >> (%i5) variable_ay; > > >> (%o5) 33 > > > I forgot to paste: > > > > > > (%i6) ''(concat('variable_,'a,'x)); > > > (%o8) 1 > > > > > > Jaime > > > > > > > > > > Thanks! Does that mean that there is no solution with arrays? > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > > > > > > > > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From soichi777 at gmail.com Thu May 3 18:05:06 2012 From: soichi777 at gmail.com (ishi soichi) Date: Fri, 4 May 2012 08:05:06 +0900 Subject: [Maxima] imaxima: copying outputs to clipboard In-Reply-To: <1qplil9i7wh.fsf@iceland.freeshell.org> References: <1qplil9i7wh.fsf@iceland.freeshell.org> Message-ID: Wow, this looks nice. It is much better than I was. Thanks for your answer! soichi 2012/5/4 Leo Butler > ishi soichi writes: > > > [1:multipart/alternative Hide] > > [1/1:text/plain Hide] > > Maxima 5.15 > > > > I am using imaxima so that Maxima runs on Emacs. > > > > I have a simple question (which must be tedious for many of you). > > > > How can I copy outputs to clipboard? > > > > Since the outputs are generated as LaTex image, the equation and numbers > > appear in the buffer are images rather than strings. > > I don't know if this exactly answers your question, but you can change > between text and image output in the imaxima buffer with > > display2d:true $ /* change to 2d text output */ > display2d:imaxima $ /* image output */ > > Since Maxima keeps its output in the variables %o1, etc, you can toggle > between the two display modes and (re)print output as text as need be. > It would be pretty easy to write a convenience function in emacs lisp to > do this, and bind it to a key combination. > > Leo > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Fri May 4 01:06:47 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 4 May 2012 06:06:47 +0000 (UTC) Subject: [Maxima] plotting modulus of complex function References: <4FA2698F.9040702@gmail.com> Message-ID: On 2012-05-03, Bart Vandewoestyne wrote: > Unfortunately, this fails. I get the error: > > (%i18) plot2d(float(abs(Gm(s))),[s,0.1,1000.0]) > Maxima encountered a Lisp error: > Couldn't write to #: > Broken pipe Your example bartfile.mac works OK for me. I am working w/ Maxima 5.26.0 and approximately 5.27.0 (built from Git) on Linux. I suspect the broken pipe means that Maxima failed to launch Gnuplot (so there is nobody to listen to the plotting commands Maxima wants to send). By default the plot format is gnuplot_pipes; try set_plot_option ([plot_format, gnuplot]); (writes a file instead of opening a pipe), or set_plot_option ([plot_format, openmath]); Openmath format uses a Tcl/Tk widget. By the way, can you launch gnuplot from the command line? (Maybe Gnuplot is not installed on your system?) Hope this helps, Robert Dodier From Bart.Vandewoestyne at telenet.be Fri May 4 02:04:44 2012 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Fri, 04 May 2012 09:04:44 +0200 Subject: [Maxima] plotting modulus of complex function In-Reply-To: References: <4FA2698F.9040702@gmail.com> Message-ID: <4FA37F8C.2060809@gmail.com> On 05/04/2012 08:06 AM, Robert Dodier wrote: > On 2012-05-03, Bart Vandewoestyne wrote: > >> Unfortunately, this fails. I get the error: >> >> (%i18) plot2d(float(abs(Gm(s))),[s,0.1,1000.0]) >> Maxima encountered a Lisp error: >> Couldn't write to #: >> Broken pipe > > Your example bartfile.mac works OK for me. I am working w/ Maxima 5.26.0 > and approximately 5.27.0 (built from Git) on Linux. > > I suspect the broken pipe means that Maxima failed to launch Gnuplot (so > there is nobody to listen to the plotting commands Maxima wants to > send). By default the plot format is gnuplot_pipes; try > > set_plot_option ([plot_format, gnuplot]); > > (writes a file instead of opening a pipe), or > > set_plot_option ([plot_format, openmath]); > > Openmath format uses a Tcl/Tk widget. > > By the way, can you launch gnuplot from the command line? > (Maybe Gnuplot is not installed on your system?) > > Hope this helps, > > Robert Dodier Hello Robert (and list), In the meanwhile, I also figured out that there was a problem with my gnuplot install. Because I'm working on an older Red Hat linux distro, the packaged gnuplot is quite old and I had compiled a more recent one myself. Apparently, I couldn't start gnuplot from the command-line either... so that's why I got the error. After switching back to the packaged version instead of my own compiled version, the plots now work. Kind regards, Bart From Bart.Vandewoestyne at telenet.be Fri May 4 03:07:54 2012 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Fri, 04 May 2012 10:07:54 +0200 Subject: [Maxima] plotting modulus of complex function In-Reply-To: <4FA28780.6070909@fe.up.pt> References: <4FA2698F.9040702@gmail.com> <4FA28780.6070909@fe.up.pt> Message-ID: <4FA38E5A.4080105@gmail.com> On 05/03/2012 03:26 PM, Jaime Villate wrote: > > Hi, > the function used to obtain the modulus of a complex number is cabs() > and not abs(). However, in the command plot2d(float(abs(Ge(s))), [s, > 1e-1, 1e3]) cabs would give you a very long expression in terms of s > which might get your system stuck. I suggest that you first compute the > floating-point value for a given s, > then compute cabs and only then pass the result. Also, the notation > epsilon[0] might look cute in Wxmaxima, > but it means defining an array which you really don't need and will add > to the computational complexity. > You might want to try something such as: > > [... snip code ...] > > Your functions have several steep spikes, so you might have to view separate > parts of the frequency domain in separate plots, in order to see the > separate spikes. > [...] Hello Jaime (and list), Thanks for the hints. Actually, the main problem for me not being able to plot, appeared to be a problem with my gnuplot install. The real reason why I wanted to look at the Ge(s) function is that I want to understand its behavior for s->0. If I plot its modulus, i see a quite smooth behavior between 1e-7 and 1e-1, but for values lower than 1e-7 the abs(Ge(s)) function seems to go up again??? So I'm in doubt... is lim_{s->0} Ge(s) = constant or infinity? Is the 'weird behavior' below 1e-8 just a result of rounding error, or could it really be that lim_{s->0} Ge(s) = infinity? My educated guess is that it's rounding error and that the limit should indeed give me a constant value. Calculating the limit analytically by hand turned out to be a mess and I gave up... If i try with Maxima, i can't get a result... the computation seems to take long and it gives up at the end. Is there any Maxima-expert who can change my code so that the evaluation of lim_{s->0} Ge(s) gives me the constant value for the limit that I expect? Preferably in parametric form, but a numerical value obtained with all the parameters filled in would also be nice. My script, with some comments concerning the problem description, can be found at https://www.dropbox.com/s/6ie4i31b1gi2nm1/bartscript.mac Kind regards, Bart From mission.imp at tiscali.it Fri May 4 05:01:16 2012 From: mission.imp at tiscali.it (mission.imp at tiscali.it) Date: Fri, 4 May 2012 12:01:16 +0200 (CEST) Subject: [Maxima] [UTEXAS: SUSPECTED SPAM] Can't read from file Message-ID: <25278424.55271336125676439.JavaMail.defaultUser@defaultHost> WARNING: The University of Texas at Austin spam defense system has flagged the following message as suspicious. If the message asks you for a username and/or password, such as your UT EID or your Webmail login, DO NOT respond to the message. The university will NEVER ask for your username or password in an e-mail message. If you have sent your username or password in response to this message or a message like it, contact the ITS Help Desk immediately at 512-475-9400. ------------------------- Original Message Below ------------------------- Dear Maxima friends, i worote a simple ronin.txt file as following: a+B^2; ended by a semicolon. When I read it by: s : read_matrix (file_search ("C:/ronin.txt"),"semicolon"); to which the kernel says: numericalio: separator flag "semicolon" not recognized; assume ``space''. however s[1] is read as [a,B,^,2,,] taking a space as separation flag that I did not put. More absurd what happens with read_array (%i1) array (a, 1, 1); (%23) a (%i2) read_array (file_search ("C:/ronin.txt"), a,semicolon); (%o2) done (%i3) aa[1,1]; (%o3) ^ Could anyone help me? Thanks a lot. Invita i tuoi amici e Tiscali ti premia! Il consiglio di un amico vale pi? di uno spot in TV. Per ogni nuovo abbonato 30 ? di premio per te e per lui! Un amico al mese e parli e navighi sempre gratis: http://freelosophy.tiscali.it/ From robert.dodier at gmail.com Fri May 4 10:25:24 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 4 May 2012 15:25:24 +0000 (UTC) Subject: [Maxima] plotting modulus of complex function References: <4FA2698F.9040702@gmail.com> <4FA28780.6070909@fe.up.pt> <4FA38E5A.4080105@gmail.com> Message-ID: On 2012-05-04, Bart Vandewoestyne wrote: > The real reason why I wanted to look at the Ge(s) function is that I > want to understand its behavior for s->0. If I plot its modulus, i see > a quite smooth behavior between 1e-7 and 1e-1, but for values lower than > 1e-7 the abs(Ge(s)) function seems to go up again??? Try replacing the ordinary floats (approx. 16 digits) with bigfloats (variable number of digits). I replaced the floats with bigfloats in your script as shown by the diff in the PS. Increasing fpprec (50, 100, 200) yields results that seem to converge to approximately 2.3b-4 as s goes to 0. (Usual disclaimer about numerical results applies.) Note that if you change fpprec, you probably have to reconstruct Ge and Gm because some arithmetic has already been carried out by the time you get around to defining the functions. By the way, after replacing the floats, you can still apply plot2d to the function, but since the plotting code wants floats, it's not an entirely accurate representation of the function. So to investigate the behavior close to s = 0, I think you can try something like: foo(s):=abs(Ge(s))$ for n thru 16 do print(bfloat(foo(1.0b0/10^n)))$ Hope this helps, it's an interesting problem. Robert Dodier PS. $ diff -u bartscript.mac bartscript_bigfloat.mac --- bartscript.mac 2012-05-04 08:45:16.000000000 -0600 +++ bartscript_bigfloat.mac 2012-05-04 08:56:20.000000000 -0600 @@ -18,14 +18,15 @@ assum(d>0)$ */ -d: 1e-3$ -f: 10e9$ +fpprec : 50; +d: 1b-3$ +f: 10^9$ omega: 2*%pi*f$ -e0: 8.8541878176e-12$ -mu0: 4e-7*%pi$ +e0: 8.8541878176b-12$ +mu0: 4b-7*%pi$ v0: 1/sqrt(e0*mu0)$ k0: 2*%pi*f/v0$ -esub: 12.9*e0$ +esub: 12.9b0*e0$ Z_TE_sub(s) := %i*omega*mu0/(k0*sqrt(s^2-esub/e0))$ Z_TE_0(s) := %i*omega*mu0/(k0*sqrt(s^2-1))$ From toy.raymond at gmail.com Fri May 4 10:58:35 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 4 May 2012 08:58:35 -0700 Subject: [Maxima] plotting modulus of complex function In-Reply-To: <4FA38E5A.4080105@gmail.com> References: <4FA2698F.9040702@gmail.com> <4FA28780.6070909@fe.up.pt> <4FA38E5A.4080105@gmail.com> Message-ID: On Fri, May 4, 2012 at 1:07 AM, Bart Vandewoestyne < Bart.Vandewoestyne at telenet.be> wrote: > On 05/03/2012 03:26 PM, Jaime Villate wrote: > >> >> Hi, >> the function used to obtain the modulus of a complex number is cabs() >> and not abs(). However, in the command plot2d(float(abs(Ge(s))), [s, >> 1e-1, 1e3]) cabs would give you a very long expression in terms of s >> which might get your system stuck. I suggest that you first compute the >> floating-point value for a given s, >> then compute cabs and only then pass the result. Also, the notation >> epsilon[0] might look cute in Wxmaxima, >> but it means defining an array which you really don't need and will add >> to the computational complexity. >> You might want to try something such as: >> > > > > [... snip code ...] > > >> Your functions have several steep spikes, so you might have to view >> separate >> parts of the frequency domain in separate plots, in order to see the >> separate spikes. >> > > [...] > > Hello Jaime (and list), > > Thanks for the hints. Actually, the main problem for me not being able to > plot, appeared to be a problem with my gnuplot install. > > The real reason why I wanted to look at the Ge(s) function is that I want > to understand its behavior for s->0. If I plot its modulus, i see a quite > smooth behavior between 1e-7 and 1e-1, but for values lower than 1e-7 the > abs(Ge(s)) function seems to go up again??? > > So I'm in doubt... is lim_{s->0} Ge(s) = constant or infinity? Is the > 'weird behavior' below 1e-8 just a result of rounding error, or could it > really be that lim_{s->0} Ge(s) = infinity? My educated guess is that it's > rounding error and that the limit should indeed give me a constant value. > Since, as you said, limit isn't working very well, let's try a taylor expansion around 0: result:rectform(float(taylor(Ge(s),s,0,1)))$ realpart(result) -> 4.495690568998906e-23/s-1.1606583177590578e-8*s imagpart(result); -> 1.1535859169661196e-7*s+3.833768849248987e-24/s So, it looks like Ge(s) is approximately (4.5e-23+%i*3.8e-24)/s. However, there may be numerical inaccuracies in this result since you used floating-point numbers in the original equations. But this kind of matches what you see where Ge(s) increases as s gets closer to 0. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Fri May 4 18:03:07 2012 From: villate at fe.up.pt (Jaime Villate) Date: Sat, 05 May 2012 00:03:07 +0100 Subject: [Maxima] plotting modulus of complex function In-Reply-To: References: <4FA2698F.9040702@gmail.com> <4FA28780.6070909@fe.up.pt> <4FA38E5A.4080105@gmail.com> Message-ID: <4FA4602B.9050604@fe.up.pt> On 05/04/2012 04:25 PM, Robert Dodier wrote: > d: 1e-3$ > -f: 10e9$ > +fpprec : 50; > +d: 1b-3$ > +f: 10^9$ Did Bart mean to use a frequ?ncy f equal to 10^9 or 10^10 ? If "f: 10e9" was correct, it should then be replaced by "f: 10^10" Regards, Jaime -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Fri May 4 21:39:37 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 04 May 2012 19:39:37 -0700 Subject: [Maxima] Pending tickets are closing Message-ID: It used to be that pending tickets would automatically close after 14 days or so if no one responded. That doesn't seem to be the case anymore and sourceforge apparently won't fix it: https://sourceforge.net/apps/trac/sourceforge/ticket/24729 I guess they want projects to migrate to the new beta sourceforge system. Ray From jacipe.maxima at gmail.com Fri May 4 22:17:15 2012 From: jacipe.maxima at gmail.com (jacipe yang) Date: Sat, 5 May 2012 11:17:15 +0800 Subject: [Maxima] separation of variables Message-ID: hello, I am in a school team on a task that is to solve some usual PDEs on maxima, Now, we are concerning on the SOV, and I am wondering if there is any previous work here? Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri May 4 22:22:23 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 04 May 2012 20:22:23 -0700 Subject: [Maxima] separation of variables In-Reply-To: References: Message-ID: <4FA49CEF.2020804@eecs.berkeley.edu> On 5/4/2012 8:17 PM, jacipe yang wrote: > hello, > I am in a school team on a task that is to solve some usual PDEs on > maxima, Now, we are concerning on the SOV, and I am wondering if > there is any previous work here? > Thank you > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima I suggest you look at http://www.cs.berkeley.edu/~fateman/papers/partition.pdf -------------- next part -------------- An HTML attachment was scrubbed... URL: From aishen at free.fr Sat May 5 02:18:51 2012 From: aishen at free.fr (aishen at free.fr) Date: Sat, 05 May 2012 09:18:51 +0200 Subject: [Maxima] Any light ? In-Reply-To: References: Message-ID: <4FA4D45B.7020702@free.fr> assume(omega > 0)$ ode2( 'diff(y, t, 2) + omega^2* y= 0, y, t ); ic2(%, t = 0, y = a, 'diff(y,t) = 0); y=a*cos(omega*t) is the answer ... I am trying to get a sin ... instead a cos but I can't !!! I am not an expert in maths, but as this question arise in my mind, I would like to know an answer ? Any help welcome Kind regards, Henri From vi5u0-maxima at yahoo.co.uk Sat May 5 05:22:28 2012 From: vi5u0-maxima at yahoo.co.uk (Dan) Date: Sat, 5 May 2012 11:22:28 +0100 (BST) Subject: [Maxima] Any light ? In-Reply-To: <4FA4D45B.7020702@free.fr> References: <4FA4D45B.7020702@free.fr> Message-ID: On Sat, 5 May 2012, aishen at free.fr wrote: > assume(omega > 0)$ > ode2( 'diff(y, t, 2) + omega^2* y= 0, y, t ); > ic2(%, t = 0, y = a, 'diff(y,t) = 0); > > y=a*cos(omega*t) is the answer ... > > I am trying to get a sin ... instead a cos but I can't !!! The 'diff(y,t) term in your ic2 command imposes a boundary condition that the sine can satisfy only by having a zero coefficient, i.e. by being absent from the answer. From piminusmeson at bk.ru Sat May 5 05:47:27 2012 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Sat, 05 May 2012 14:47:27 +0400 Subject: [Maxima] bug in the integrate()? In-Reply-To: <4FA4D45B.7020702@free.fr> References: <4FA4D45B.7020702@free.fr> Message-ID: <4FA5053F.5000402@bk.ru> Hello, list, it seems that i have found a bug in the integrate() function.It is obvious that integrate(x^n*exp(-a*x^2+b*x),x,X_0,inf) is equal to the diff(integrate(exp(-a*x^2+b*x),x,X_0,inf),b,n). The result can be obtained in terms of the error function. Maple can do the integration without any trouble. Let's see what gives maxima. ya at debian:~$ maxima Maxima 5.27.0 http://maxima.sourceforge.net using Lisp CLISP 2.48 (2009-07-28) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) assume(a>0); (%o1) [a> 0] (%i2) expr: exp(-a*x^2+b*x)*x; 2 b x - a x (%o2) x %e (%i3) res1:integrate(expr,x,X_0,inf)$ Is 2 a X_0 - b positive, negative, or zero? positive; Let's do the integration once again: (%i4) res1new:integrate(expr,x,X_0,inf)$ Is 2 a X_0 - b positive, negative, or zero? positive; Let's see the results: first (%i5) factor(ratsimp(res1)); 2 b --- 2 2 2 4 a 4 a X_0 - 4 a b X_0 + b (%o5) (%e (2 gamma_incomplete(1, --------------------------) a 4 a 2 2 2 1 4 a X_0 - 4 a b X_0 + b 3/2 abs(2 a X_0 - b) + 2 gamma_incomplete(-, --------------------------) a b 2 4 a 2 2 2 1 4 a X_0 - 4 a b X_0 + b 2 X_0 - gamma_incomplete(-, --------------------------) sqrt(a) b )) 2 4 a 2 /(4 a abs(2 a X_0 - b)) second: (%i6) factor(ratsimp(res1new)); 2 2 2 1 4 a X_0 - 4 a b X_0 + b (%o6) ((gamma_incomplete(-, --------------------------) sqrt(a) b 2 4 a 2 b 2 2 2 --- 4 a X_0 - 4 a b X_0 + b 4 a 2 + 2 gamma_incomplete(1, --------------------------) a) %e )/(4 a ) 4 a The results are different!!! Let's continue:(now 2 a X_0 -b is negative) (%i7) res2:integrate(expr,x,X_0,inf)$ Is 2 a X_0 - b positive, negative, or zero? negative; (%i8) res2new:integrate(expr,x,X_0,inf)$ Is 2 a X_0 - b positive, negative, or zero? negative; (%i9) factor(ratsimp(res2)); 2 2 2 1 4 a X_0 - 4 a b X_0 + b (%o9) - ((gamma_incomplete(-, --------------------------) b - 2 sqrt(%pi) b 2 4 a 2 b 2 2 2 --- 4 a X_0 - 4 a b X_0 + b 4 a 3/2 - 2 gamma_incomplete(1, --------------------------) sqrt(a)) %e )/(4 a ) Let'see the difference between expressions with positive and negative2 a X_0 -b 4 a (%i10) factor(ratsimp(res2-res1new)); 2 b 2 2 2 --- 1 4 a X_0 - 4 a b X_0 + b 4 a (gamma_incomplete(-, --------------------------) - sqrt(%pi)) b %e 2 4 a (%o10) - --------------------------------------------------------------------- 3/2 2 a But results must be the same, it can be seen from the diff(integrate(exp(-a*x^2+b*x),x,X_0,inf),b). -------------- next part -------------- An HTML attachment was scrubbed... URL: From pdx7l1 at yahoo.es Sat May 5 09:36:54 2012 From: pdx7l1 at yahoo.es (Manuel Pedrinero rossetil) Date: Sat, 5 May 2012 15:36:54 +0100 (BST) Subject: [Maxima] Maxima Lapack is very slow: 7 seconds versus 0.002 seconds in Julia. Message-ID: <1336228614.51112.YahooMailClassic@web132504.mail.ird.yahoo.com> Recently Raimond Toy asked about what capabilities are lacking in maxima, numeric computations in linear algebra seems to be very slow ? ?This is an example in gcl using lapack (%i1) load(lapack); /share/lapack/binary-gcl/dgemm.o (%o1)????????? /usr/share/maxima/5.24.0/share/lapack/lapack.mac (%i2) h[i,j]:= 1/(i+j); ?????????????????????????????????????????? 1 (%o2)?????????????????????????? h???? := ----- ???????????????????????????????? i, j??? i + j (%i3) m : genmatrix(h,50,50)$ (%i4) showtime : true; Evaluation took 0.0000 seconds (0.0000 elapsed) (%o4)??????????????????????????????? true (%i5) [one,two,three] : dgeev(m)$ Evaluation took 7.3200 seconds (7.4000 elapsed) In Julia computing eigenvalues of a 50x50 matrix whose entries are random numbers from a normal distribution is about 0.007 seconds. julia> @time v1,others = eig(randn(50,50)); elapsed time: 0.0070650577545166016 seconds ?The same computation takes 0.002 seconds in Julia. (first make some computation with eig so that it loads the function in memory). filewrite("path/file",m); to convert m to Julia format one can use system and sed replacing "," => "space" ? "]" by ";" and deleting "["? the final step is to put parenthesis around the numbers (that are separated by space inside rows and ";" separate rows. Julia: @time one,others = eig(m) ? Maxima version: 5.24.0 Maxima build date: 9:11 2/29/2012 Host type: x86_64-unknown-linux-gnu Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.7 ? I know that some efforts like matlisp are trying to improve this situation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sat May 5 10:29:28 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 05 May 2012 08:29:28 -0700 Subject: [Maxima] Maxima Lapack is very slow: 7 seconds versus 0.002 seconds in Julia. In-Reply-To: <1336228614.51112.YahooMailClassic@web132504.mail.ird.yahoo.com> References: <1336228614.51112.YahooMailClassic@web132504.mail.ird.yahoo.com> Message-ID: <4FA54758.2000108@gmail.com> On 5/5/12 7:36 AM, Manuel Pedrinero rossetil wrote: > Recently Raimond Toy asked about what capabilities are lacking in > maxima, numeric computations in linear algebra seems to be very slow > That's not a lack of capability, but rather a quality of implementation issue. > > This is an example in gcl using lapack > > (%i1) load(lapack); > /share/lapack/binary-gcl/dgemm.o > (%o1) /usr/share/maxima/5.24.0/share/lapack/lapack.mac > (%i2) h[i,j]:= 1/(i+j); > 1 > (%o2) h := ----- > i, j i + j > (%i3) m : genmatrix(h,50,50)$ > > (%i4) showtime : true; > Evaluation took 0.0000 seconds (0.0000 elapsed) > (%o4) true > (%i5) [one,two,three] : dgeev(m)$ > Evaluation took 7.3200 seconds (7.4000 elapsed) > What kind of machine did you run this on? On my machine, this took .04 sec (using cmucl). In any case, this could be faster but it is not because lapack is a (machine) translation from the original Fortran to Lisp. Maxima does not have an ffi so this is the only reasonably simple and portable approach available. [1] If all you care about is computing a huge number of eigenvalues/vectors, then maxima is the wrong tool. Use a different tool. Ray [1] Matlisp has recently been updated to use cffi, suddenly making matlisp basically available on any lisp supported by cffi, which includes all lisps supported by maxima, except gcl. But based on my experience with building lapack in matlisp, this is not that easy to do because there are many fortran compilers out there and that all do different things which the ffi needs to take into account. While adding support for cffi to maxima is straighforward making it useful with the existing code that we have is not as easy, but it's not rocket science either. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pdx7l1 at yahoo.es Sat May 5 11:00:31 2012 From: pdx7l1 at yahoo.es (Manuel Pedrinero rossetil) Date: Sat, 5 May 2012 17:00:31 +0100 (BST) Subject: [Maxima] Maxima Lapack is very slow: 7 seconds versus 0.002 seconds in Julia. In-Reply-To: <1336228614.51112.YahooMailClassic@web132504.mail.ird.yahoo.com> Message-ID: <1336233631.74042.YahooMailClassic@web132503.mail.ird.yahoo.com> Hello: ?Thanks for the information about cffi, and for your work in matlisp. ? ?There are some projects to improve the? port of? sbcl to windows. Since gcl lacks ffi, sbcl seems a good candidate once the port is mature.? (good speed and cffi). ? Perhaps the efforts in linear algebra of Rosseti, Tamas, Raymond, Liliam (gsl), Luis Oliveira. (cffi) and others could be ported to maxima or some interface via cffi between Julia and maxima could be very interesting.? There also some Lispers that use Lisp and R (for example C. Rhodes) .? Improving the numeric capabilities of maxima could appeal to more people and communities. ?Today ECL develoopers announce improving? multithreading in ECL (see planet.lisp) ?My wish is that maxima becomes both in Symbolics and Numeric capabilities, also there is ceres solver (google project), maxima also has a least square solver by Robert. Perhaps? some of those advances could be ported to maxima? (ceres is in C++ so problem with cffi, Julia is also thinking about this). Best ?Recently other people are trying to link Julia with gnuplot, (like Mario Riotorto work in the draw packages), also perhaps some work in solving ODE and plotting like plotvectorfield are things that could be improved numeracally. ? ? Raymond said: What kind of machine did you run this on?? On my machine, this took .04 sec (using cmucl). In any case, this could be faster but it is not because lapack is a (machine) translation from the original Fortran to Lisp.? Maxima does not have an ffi so this is the only reasonably simple and portable approach available. [1] If all you care about is computing a huge number of eigenvalues/vectors, then maxima is the wrong tool.? Use a different tool. Ray [1] Matlisp has recently been updated to use cffi, suddenly making matlisp basically available on any lisp supported by cffi, which includes all lisps supported by maxima, except gcl.? But based on my experience with building lapack in matlisp, this is not that easy to do because there are many fortran compilers out there and that all do different things which the ffi needs to take into account. While adding support for cffi to maxima is straighforward making it useful with the existing code that we have is not as easy, but it's not rocket science either. --- El s?b, 5/5/12, Manuel Pedrinero rossetil escribi?: De: Manuel Pedrinero rossetil Asunto: Maxima Lapack is very slow: 7 seconds versus 0.002 seconds in Julia. Para: maxima at math.utexas.edu Fecha: s?bado, 5 de mayo, 2012 16:36 Recently Raimond Toy asked about what capabilities are lacking in maxima, numeric computations in linear algebra seems to be very slow ? ?This is an example in gcl using lapack (%i1) load(lapack); /share/lapack/binary-gcl/dgemm.o (%o1)????????? /usr/share/maxima/5.24.0/share/lapack/lapack.mac (%i2) h[i,j]:= 1/(i+j); ?????????????????????????????????????????? 1 (%o2)?????????????????????????? h???? := ----- ???????????????????????????????? i, j??? i + j (%i3) m : genmatrix(h,50,50)$ (%i4) showtime : true; Evaluation took 0.0000 seconds (0.0000 elapsed) (%o4)??????????????????????????????? true (%i5) [one,two,three] : dgeev(m)$ Evaluation took 7.3200 seconds (7.4000 elapsed) In Julia computing eigenvalues of a 50x50 matrix whose entries are random numbers from a normal distribution is about 0.007 seconds. julia> @time v1,others = eig(randn(50,50)); elapsed time: 0.0070650577545166016 seconds ?The same computation takes 0.002 seconds in Julia. (first make some computation with eig so that it loads the function in memory). filewrite("path/file",m); to convert m to Julia format one can use system and sed replacing "," => "space" ? "]" by ";" and deleting "["? the final step is to put parenthesis around the numbers (that are separated by space inside rows and ";" separate rows. Julia: @time one,others = eig(m) ? Maxima version: 5.24.0 Maxima build date: 9:11 2/29/2012 Host type: x86_64-unknown-linux-gnu Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.7 ? I know that some efforts like matlisp are trying to improve this situation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat May 5 11:50:17 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 5 May 2012 16:50:17 +0000 (UTC) Subject: [Maxima] plotting modulus of complex function References: <4FA2698F.9040702@gmail.com> <4FA28780.6070909@fe.up.pt> <4FA38E5A.4080105@gmail.com> <4FA4602B.9050604@fe.up.pt> Message-ID: On 2012-05-04, Jaime Villate wrote: > On 05/04/2012 04:25 PM, Robert Dodier wrote: >> d: 1e-3$ >> -f: 10e9$ >> +fpprec : 50; >> +d: 1b-3$ >> +f: 10^9$ > Did Bart mean to use a frequ?ncy f equal to 10^9 or 10^10 ? > If "f: 10e9" was correct, it should then be replaced by "f: 10^10" Yes, you're right. I misread 10e9 as 1e9. best, Robert Dodier From willisb at unk.edu Sat May 5 11:59:53 2012 From: willisb at unk.edu (Barton Willis) Date: Sat, 5 May 2012 16:59:53 +0000 Subject: [Maxima] bug in the integrate()? In-Reply-To: <4FA5053F.5000402@bk.ru> References: <4FA4D45B.7020702@free.fr>,<4FA5053F.5000402@bk.ru> Message-ID: <83FD4DC40F97654495E2C9AED476583604228029@BL2PRD0710MB361.namprd07.prod.outlook.com> A related bug is: (%i2) integrate(x*exp(-x^2+b*x),x,0,inf); "Is "b" positive, negative, or zero?"pos; (%o2) -(gamma_incomplete(1/2,b^2/4)*%e^(b^2/4)*abs(b))/4+(sqrt(%pi)*b*%e^(b^2/4))/2+(gamma_incomplete(1,b^2/4)*%e^(b^2/4))/2 (%i3) integrate(x*exp(-x^2+b*x),x,0,inf); "Is "b" positive, negative, or zero?"pos; (%o3) -(gamma_incomplete(1/2,b^2/4)*b*%e^(b^2/4))/4+(sqrt(%pi)*b*%e^(b^2/4))/2+(gamma_incomplete(1,b^2/4)*%e^(b^2/4))/2 I think both answers are correct--the first has a term abs(b), but the second has just b. Maybe you could file a bug report. --bw ________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat May 5 12:07:07 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 5 May 2012 17:07:07 +0000 (UTC) Subject: [Maxima] Can't read from file References: <25278424.55271336125676439.JavaMail.defaultUser@defaultHost> Message-ID: > i worote a simple ronin.txt file as following: > > > a+B^2; > > ended by a semicolon. > When I read it by: > s : read_matrix > (file_search ("C:/ronin.txt"),"semicolon"); > to which the kernel says: > > numericalio: separator flag "semicolon" not recognized; assume > ``space''. The numericalio code reads parser tokens (numbers, symbols, etc). (I suppose it should be renamed accordingly ....) It doesn't recognize whole Maxima expressions; as you have observed, expressions are read as a series of tokens. In order to read whole expressions, you can try this. I don't know if there's a better way to do it. S : openr ("ronin.txt"); /* S is a file input stream */ while (e : ?mread (S)) # false do print ("INPUT EXPR:", second (e)); close (S); Hope this helps, Robert Dodier From robert.dodier at gmail.com Sat May 5 12:30:51 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 5 May 2012 11:30:51 -0600 Subject: [Maxima] announcement: Maxima 5.27 Message-ID: Please distribute this message as you see fit. Announcing Maxima 5.27 Maxima is a GPL'd branch of Macsyma, the venerable symbolic computation system. Maxima 5.27 is a bug fix and feature enhancement release. The current version is 5.27.0. Maxima has functions to work with polynomials, matrices, finite sets, integrals, derivatives and differential equations, linear algebra, plotting, floating point and arbitrary-precision arithmetic, etc. Maxima can run on MS Windows and various flavors of Unix, including MacOS X. There is a precompiled executable installer for Windows, RPM's for Linux, and source code tar.gz. Maxima is implemented in Common Lisp; several Lisps can compile and run Maxima, including CMUCL, SBCL, Clisp, GCL, and ECL. The Maxima project welcomes new participants. You can contribute in several ways: reporting bugs, fixing bugs, writing new add-on packages, revising core functions, user interfaces, documentation, etc. Why not see what's happening on the mailing list and consider how you might contribute to the project. Thanks to everyone who contributed to the 5.27 release. Regards, Robert Dodier Maxima developer and 5.27 release manager Project page: http://sourceforge.net/projects/maxima Documentation: http://maxima.sourceforge.net/documentation.html Bug reports. You must create a Sourceforge login before filing a bug report (anonymous reports no longer allowed). http://sourceforge.net/tracker/?group_id=4933&atid=104933 Mailing list. Please sign up before posting a message. http://maxima.sourceforge.net/maximalist.html Download page: http://sourceforge.net/projects/maxima/files Ports page: http://apps.sourceforge.net/mediawiki/maxima/index.php?title=Maxima_ports Project home page: http://maxima.sourceforge.net Change log: Maxima 5.27 change log Backwards-incompatible changes: * remove obsolete Cray Fortran translator * rename topoly and to_poly_solver to to_poly and to_poly_solve, respectively New items in core: * new functions zn_order, zn_primroot_p, zn_primroot, zn_log, chinese New items in share: * package rkf45: Runge-Kutta-Fehlberg 4th-5th order numerical o.d.e. solver Other changes: * functions bessel_i, bessel_j: results for imaginary arguments * function build_info: return a structure instead of just printing its data * function plot3d: allow 3-d parametric plots * functions fortmx, f90mx: generate assignments to 1-d array when argument is a list * package ezunits: update values for physical constants * revise and update documentation * reorganization of directory maxima/share * clean up source code by cutting out unused functions Bug fixes: 3509430: limit of tanh(x) at 0 makes no sense 3497046: Integration of products of sin(nz)/(nz) sometimes fails 3495182: hgfred([-n/2, (n-1)/2],[1],x) --> error 3484414: display places (false) before output if display2d is false 3480954: integrate(sin(x)^2/x,x,minf,inf) gives not zero 3473549: gcl bug using 1-12-2012 defint.lisp 3470668: Integration is not correct: invalid 'false' term in results 3469184: integrate(exp(-x^n),x,0,1) bug for n >2 3449369: nfloat 3397562: sin(x^2)/(x^2) improper integral incorrect? mailing list 2012-02-27: print ( false ) bug 5.26.0 mailing list circa 2012-02-19: BIGFLOAT::%TO should pass CL complex numbers mailing list circa 2012-01-27: nonstandard extension in category scripts mailing list circa 2012-01-09: invert_by_lu does not work as expected overflow in regularized incomplete gamma function incorrect value for gamma_incomplete(0,200*%i) From Bart.Vandewoestyne at telenet.be Sat May 5 12:51:21 2012 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Sat, 05 May 2012 19:51:21 +0200 Subject: [Maxima] plotting modulus of complex function Message-ID: <4FA56899.3060208@telenet.be> On 05/05/2012 01:03 AM, Jaime Villate wrote: > On 05/04/2012 04:25 PM, Robert Dodier wrote: >> d: 1e-3$ >> -f: 10e9$ >> +fpprec : 50; >> +d: 1b-3$ >> +f: 10^9$ > Did Bart mean to use a frequ?ncy f equal to 10^9 or 10^10 ? > If "f: 10e9" was correct, it should then be replaced by "f: 10^10" For the record, I *did* mean 10 GHz = 10e9 Hz. Regards, Bart From toy.raymond at gmail.com Sat May 5 16:15:45 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 05 May 2012 14:15:45 -0700 Subject: [Maxima] Maxima Lapack is very slow: 7 seconds versus 0.002 seconds in Julia. In-Reply-To: <1336233631.74042.YahooMailClassic@web132503.mail.ird.yahoo.com> References: <1336228614.51112.YahooMailClassic@web132504.mail.ird.yahoo.com> <1336233631.74042.YahooMailClassic@web132503.mail.ird.yahoo.com> Message-ID: <4FA59881.1040800@gmail.com> On 5/5/12 9:00 AM, Manuel Pedrinero rossetil wrote: > > Hello: > > Thanks for the information about cffi, and for your work in matlisp. > > There are some projects to improve the port of sbcl to windows. Since I understand that ccl works very well on windows, so why wait for an improved port of sbcl? > gcl lacks ffi, sbcl seems a good candidate once the port is mature. > (good speed and cffi). > > Perhaps the efforts in linear algebra of Rosseti, Tamas, Raymond, > Liliam (gsl), Luis Oliveira. (cffi) and others could be ported to maxima > or some interface via cffi between Julia and maxima could be very > interesting. There also some Lispers that use Lisp and R (for example > C. Rhodes) . Improving the numeric capabilities of maxima could appeal > to more people and communities. Let us not lose sight of what maxima is. It is a computer algebra system, not a numerical evaluation system. There are many of those already. Ray From pdx7l1 at yahoo.es Sat May 5 16:56:55 2012 From: pdx7l1 at yahoo.es (Manuel Pedrinero rossetil) Date: Sat, 5 May 2012 22:56:55 +0100 (BST) Subject: [Maxima] maxima speed is important and an appeal to developers Message-ID: <1336255015.63601.YahooMailClassic@web132505.mail.ird.yahoo.com> In some tests sbcl speed is equal or better than Julia, and computation speed is? a big appeal for developers, for example Cython and panda developers consider important the speed of the code. Below some posts and code. --- El s?b, 5/5/12, Manuel Pedrinero rossetil escribi?: De: Manuel Pedrinero rossetil Asunto: Re: Maxima Lapack is very slow: 7 seconds versus 0.002 seconds in Julia. Para: "Raymond Toy" Fecha: s?bado, 5 de mayo, 2012 23:47 ?Maxima can also be used numerically.? For example in some benchmarks sbcl speed is equal or better than Julia: Example: 1.- sbcl? has better speed than julia? at lisp processing:? https://groups.google.com/forum/#!topic/julia-dev/Fo91y_mSZVI 2.- Speed is important, for example Cython people trying to join with Julia.? Cython existence is because its speed, since pure python is not enough. https://groups.google.com/forum/#!topic/julia-dev/YftOOEfcwrk? 3.- Developers of libraries,? (like panda =? similar to dataframes in R ported to python) should jump into another language if it gives them enough speed. see http://wesmckinney.com/blog/?p=475 below code for the test in sbcl. Time is about 0.037 seconds, similar to? julia code:? (defvar a1) (defvar a2) (defvar a3) (setq a1 (make-array (expt 10 7) :element-type 'double-float :adjustable nil :fill-pointer nil :initial-element 0d0 :displaced-to nil) ????? a2 (make-array (expt 10 7) :element-type 'double-float :adjustable nil :fill-pointer nil :initial-element 0d0 :displaced-to nil) ????? a3 nil) (loop for i below (expt 10 7) do ???? (setf (aref a1 i) (random 10d0) ??? ?? (aref a2 i) (random 10d0))) (defun haz() ??? (declare (optimize (speed 3) (safety 0) (compilation-speed 0) (space 0))??? ???? ??? ???? (type (simple-array double-float) a1 a2)) ? (let ((res 0d0)) ??? (loop? for x double-float across a1 ?????? for y double-float across a2? do ?(setf ????????????????????????????????? res (the double-float (+ res (the double-float (* x y)))))))) --- El s?b, 5/5/12, Raymond Toy escribi?: De: Raymond Toy Asunto: Re: Maxima Lapack is very slow: 7 seconds versus 0.002 seconds in Julia. Para: "Manuel Pedrinero rossetil" Fecha: s?bado, 5 de mayo, 2012 23:15 On 5/5/12 9:00 AM, Manuel Pedrinero rossetil wrote: > > Hello: > >? Thanks for the information about cffi, and for your work in matlisp. >? >? There are some projects to improve the? port of? sbcl to windows. Since I understand that ccl works very well on windows, so why wait for an improved port of sbcl? > gcl lacks ffi, sbcl seems a good candidate once the port is mature. > (good speed and cffi). > >???Perhaps the efforts in linear algebra of Rosseti, Tamas, Raymond, > Liliam (gsl), Luis Oliveira. (cffi) and others could be ported to maxima > or some interface via cffi between Julia and maxima could be very > interesting.? There also some Lispers that use Lisp and R (for example > C. Rhodes) .? Improving the numeric capabilities of maxima could appeal > to more people and communities. Let us not lose sight of what maxima is.? It is a computer algebra system, not a numerical evaluation system.? There are many of those already. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From l.couraud at free.fr Sat May 5 17:00:35 2012 From: l.couraud at free.fr (laurent couraud) Date: Sun, 6 May 2012 00:00:35 +0200 Subject: [Maxima] Maxima 5.27 crashes Message-ID: <789E8888AFDE4B84A3DF3379B4E53533@PASSERELLE> Hi everyone, Maxima 5.27.0 command line crashes nearly systematically. I can do 1+1 but if I try any command like factor or ratsimp it crashes instantly. And with XMaxima it crashes even before I see the maxima prompt. Regards. From l.couraud at gmail.com Sat May 5 17:09:11 2012 From: l.couraud at gmail.com (laurent couraud) Date: Sun, 6 May 2012 00:09:11 +0200 Subject: [Maxima] Bug in XMaxima (Winkill) Message-ID: <1DDCD135D1544CA6B1A077BC73FFC531@PASSERELLE> Hi, When I enter Ctrl+g on XMaxima I have the error message: winkill: Could not open file-mapping object. while executing "exec $maxima_priv(kill) $signal $pid" (procedure "CMkill" line 8) invoked from within "CMkill -INT $pid" (procedure "CMinterrupt" line 5) invoked from within "CMinterrupt .maxima.text " (command bound to event) The version information: Maxima 5.26.0 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. I could not find version information for XMaxima itself. Best regards. From l.couraud at gmail.com Sat May 5 17:10:37 2012 From: l.couraud at gmail.com (laurent couraud) Date: Sun, 6 May 2012 00:10:37 +0200 Subject: [Maxima] Maxima 5.27 crashes Message-ID: <76BF6592DC8B44AEB3C4EC3CEE68B572@PASSERELLE> Hi everyone, Maxima 5.27.0 command line crashes nearly systematically. I can do 1+1 but if I try any command like factor or ratsimp it crashes instantly. And with XMaxima it crashes even before I see the maxima prompt. Regards. From l.couraud at gmail.com Sat May 5 17:19:45 2012 From: l.couraud at gmail.com (laurent couraud) Date: Sun, 6 May 2012 00:19:45 +0200 Subject: [Maxima] Maxima 5.27 crashes In-Reply-To: <789E8888AFDE4B84A3DF3379B4E53533@PASSERELLE> Message-ID: Sorry I forget to mention it is under Windows XP. > -----Message d'origine----- > > Hi everyone, > > Maxima 5.27.0 command line crashes nearly systematically. > I can do 1+1 but if I try any command like factor or ratsimp it crashes instantly. > And with XMaxima it crashes even before I see the maxima prompt. > > Regards. > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From talon at lpthe.jussieu.fr Sat May 5 18:38:00 2012 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sat, 5 May 2012 23:38:00 +0000 (UTC) Subject: [Maxima] Maxima Lapack is very slow: 7 seconds versus 0.002 seconds in Julia. References: <1336228614.51112.YahooMailClassic@web132504.mail.ird.yahoo.com> <1336228614.51112.YahooMailClassic@web132504.mail.ird.yahoo.com> <4FA54758.2000108@gmail.com> Message-ID: Raymond Toy wrote: > On 5/5/12 7:36 AM, Manuel Pedrinero rossetil wrote: >> Recently Raimond Toy asked about what capabilities are lacking in >> maxima, numeric computations in linear algebra seems to be very slow >> > That's not a lack of capability, but rather a quality of implementation > issue. >> >> This is an example in gcl using lapack >> >> (%i1) load(lapack); >> /share/lapack/binary-gcl/dgemm.o >> (%o1) /usr/share/maxima/5.24.0/share/lapack/lapack.mac >> (%i2) h[i,j]:= 1/(i+j); >> 1 >> (%o2) h := ----- >> i, j i + j >> (%i3) m : genmatrix(h,50,50)$ >> >> (%i4) showtime : true; >> Evaluation took 0.0000 seconds (0.0000 elapsed) >> (%o4) true >> (%i5) [one,two,three] : dgeev(m)$ >> Evaluation took 7.3200 seconds (7.4000 elapsed) >> > > What kind of machine did you run this on? On my machine, this took .04 > sec (using cmucl). > My machine is like yours. On this macbook air laptop, with maxima compiled from sbcl, i get: (%i5) [one,two,three] : dgeev(m)$ Evaluation took 0.0250 seconds (0.0370 elapsed) using 2.128 MB. This is not that bad compared to the reported result from julia. -- Michel Talon From fateman at eecs.berkeley.edu Sat May 5 20:12:24 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 05 May 2012 18:12:24 -0700 Subject: [Maxima] Maxima Lapack is very slow: 7 seconds versus 0.002 seconds in Julia. In-Reply-To: References: <1336228614.51112.YahooMailClassic@web132504.mail.ird.yahoo.com> <1336228614.51112.YahooMailClassic@web132504.mail.ird.yahoo.com> <4FA54758.2000108@gmail.com> Message-ID: <4FA5CFF8.8010905@eecs.berkeley.edu> It seems to me that there are about 2.5 plausible choices for numerical code for Maxima. 1. Write the code in Lisp, properly declared, and run it through a high quality compiler. It should be possible to generate good code. (Otherwise one would have to argue that Lisp, the language, is inherently unsuited to expressing numerical computation, by which I mean loops, array references, and arithmetic.) 2. Use the existing code, or write additional code, in whatever language is deemed to be the best host for numerical code by virtue of excellent compilers (etc.) That would probably be FORTRAN, but possibly C. Link to the code, or to the library using some foreign-function interface. To do this nicely for Maxima it may be necessary to devote attention to programming that would benefit just one Lisp implementation family, or maybe even just one machine architecture. 2.5 Translate code (e.g. from FORTRAN) into Lisp, converting to choice 1. There are a number of implausible choices. e.g. 3. Rewrite Maxima in some other existing language (e.g. C, C++, Python, Java...) 4. Introduce yet another language that is "just as fast/compact/.... as" some existing language, and write Maxima in that. This is not to say that Common Lisp is the ideal language for implementing Maxima, but any other language proposal would have to be so much better than Common Lisp as to convince people to change. Note that Macsyma/Maxima was NOT written in Common Lisp, but in a dialect called Maclisp, implemented on the DEC PDP-6 and PDP-10 computers, on GE 645 (Multics), and DEC VAX ("Franz Lisp"). It was converted to Symbolics Lisp-machine Lisp, and eventually to Common Lisp. It is likely that the source code could be converted to (say) Python or Java or Julia by some automated process, but this would be unlikely to make it run faster or make it easier to comprehend. My opinions, anyway RJF From shinabe.munehiro at hotmail.co.jp Sat May 5 20:35:43 2012 From: shinabe.munehiro at hotmail.co.jp (Part Marty) Date: Sun, 6 May 2012 10:35:43 +0900 Subject: [Maxima] The differential equation numerical analysis Message-ID: Please tell me the differential equation numerical analysis like this! atvalue(y(x),x=0,0); atvalue(z(x),x=0,1); s1:'diff(y(x),x)=y(x)^2+x*z(x); s2:'diff(z(x),x)=x^2+y(x)*z(x); desolve([s1,s2],[y(x),z(x)]); -------------- next part -------------- An HTML attachment was scrubbed... URL: From dbmaxima at gmail.com Sun May 6 00:18:44 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Sun, 06 May 2012 15:18:44 +1000 Subject: [Maxima] Maxima 5.27 crashes In-Reply-To: References: Message-ID: <4FA609B4.4040206@gmail.com> On 6/05/2012 8:19 AM, laurent couraud wrote: > Sorry I forget to mention it is under Windows XP. >> Hi everyone, >> >> Maxima 5.27.0 command line crashes nearly systematically. >> I can do 1+1 but if I try any command like factor or ratsimp it crashes instantly. >> And with XMaxima it crashes even before I see the maxima prompt. Hi Laurent, I built the windows installer. It works for me under Windows XP SP3, and the testsuite passes (with 2 fails). I don't know what to suggest. Does 5.26.0 work for you? It was built using the same system and I haven't has any reports of problems. From villate at fe.up.pt Sun May 6 05:40:02 2012 From: villate at fe.up.pt (Jaime Villate) Date: Sun, 06 May 2012 11:40:02 +0100 Subject: [Maxima] The differential equation numerical analysis In-Reply-To: References: Message-ID: <4FA65502.7010501@fe.up.pt> On 05/06/2012 02:35 AM, Part Marty wrote: > Please tell me the differential equation numerical analysis like this! > > atvalue(y(x),x=0,0); > atvalue(z(x),x=0,1); > s1:'diff(y(x),x)=y(x)^2+x*z(x); > s2:'diff(z(x),x)=x^2+y(x)*z(x); > desolve([s1,s2],[y(x),z(x)]); sol: rk ([y^2+x*z,x^2+y*z], [y,z], [0,1], [x,0,1.5,0.01])$ plot2d ([[discrete, makelist ([sol[i][1], sol[i][2]], i, 1, length(sol))], [discrete, makelist ([sol[i][1], sol[i][3]], i, 1, length(sol))]]); See "? rk" for details. Regards, Jaime From willisb at unk.edu Sun May 6 06:38:43 2012 From: willisb at unk.edu (Barton Willis) Date: Sun, 6 May 2012 11:38:43 +0000 Subject: [Maxima] Maxima 5.27 crashes In-Reply-To: <4FA609B4.4040206@gmail.com> References: , <4FA609B4.4040206@gmail.com> Message-ID: <83FD4DC40F97654495E2C9AED47658360422C1B4@BL2PRD0710MB361.namprd07.prod.outlook.com> My 5.27.0 runs OK under Windows 7, but command line "?" doesn't work. I tried both wxMaxima and Xmaxima: Maxima 5.27.0 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) ? diff; warning: empty documentation index; ? and ?? won't work! No exact match found for topic `diff'. Try `?? diff' (inexact match) instead. (%o1) false (%i2) ?? diff; (%o2) false (%i3) --bw From l.couraud at gmail.com Sun May 6 11:07:01 2012 From: l.couraud at gmail.com (laurent couraud) Date: Sun, 6 May 2012 18:07:01 +0200 Subject: [Maxima] RE : Maxima 5.27 crashes In-Reply-To: <4FA609B4.4040206@gmail.com> Message-ID: > -----Message d'origine----- > De?: David Billinghurst [mailto:dbmaxima at gmail.com] > Envoy??: dimanche 6 mai 2012 07:19 > ??: laurent couraud > Cc?: maxima at math.utexas.edu > Objet?: Re: [Maxima] Maxima 5.27 crashes > > On 6/05/2012 8:19 AM, laurent couraud wrote: > > Sorry I forget to mention it is under Windows XP. > >> Hi everyone, > >> > >> Maxima 5.27.0 command line crashes nearly systematically. > >> I can do 1+1 but if I try any command like factor or ratsimp it crashes instantly. > >> And with XMaxima it crashes even before I see the maxima prompt. > Hi Laurent, > > I built the windows installer. It works for me under Windows XP SP3, > and the testsuite passes (with 2 fails). > > I don't know what to suggest. Does 5.26.0 work for you? It was built > using the same system and I haven't has any reports of problems. Yes at least the last published 5.26 version works. But I remember I had the same problem with the first published 5.26 version. And in fact I thought someone else than you build and published on Sourceforge the last 5.26. But from what you say it seems this is you, then finally I don't understand. And I don't have any idea of what I can try to find the source of the problem. At first I ran the installer with the Windows "Run As" command. But installing it login in as administrator give the same result. From l.couraud at gmail.com Sun May 6 11:27:43 2012 From: l.couraud at gmail.com (laurent couraud) Date: Sun, 6 May 2012 18:27:43 +0200 Subject: [Maxima] RE : Maxima 5.27 crashes In-Reply-To: <4FA609B4.4040206@gmail.com> Message-ID: <8DB72F28AFD448109D0388A34BFEEE94@PASSERELLE> > -----Message d'origine----- > De?: David Billinghurst [mailto:dbmaxima at gmail.com] > Envoy??: dimanche 6 mai 2012 07:19 > ??: laurent couraud > Cc?: maxima at math.utexas.edu > Objet?: Re: [Maxima] Maxima 5.27 crashes > > On 6/05/2012 8:19 AM, laurent couraud wrote: > > Sorry I forget to mention it is under Windows XP. > >> Hi everyone, > >> > >> Maxima 5.27.0 command line crashes nearly systematically. > >> I can do 1+1 but if I try any command like factor or ratsimp it crashes instantly. > >> And with XMaxima it crashes even before I see the maxima prompt. > Hi Laurent, > > I built the windows installer. It works for me under Windows XP SP3, > and the testsuite passes (with 2 fails). > > I don't know what to suggest. Does 5.26.0 work for you? It was built > using the same system and I haven't has any reports of problems. I see one difference between the 5.26 and 5.27 executable. 5.26 depend on "libgmp-10.dll" but this is not the case for 5.27 I don't know if this matter or not. From cloos at jhcloos.com Sun May 6 11:14:45 2012 From: cloos at jhcloos.com (James Cloos) Date: Sun, 06 May 2012 12:14:45 -0400 Subject: [Maxima] Maxima Lapack is very slow: 7 seconds versus 0.002 seconds in Julia. In-Reply-To: <4FA54758.2000108@gmail.com> (Raymond Toy's message of "Sat, 05 May 2012 08:29:28 -0700") References: <1336228614.51112.YahooMailClassic@web132504.mail.ird.yahoo.com> <4FA54758.2000108@gmail.com> Message-ID: I tried playing along. I had to pass: --lisp-options='--dynamic-space-size 2048' to have enough heap for sbcl to compile the lapack lisp. (I didn't determine exactly what would have been enough, but 1024 was not.) On a 2.8 GHz amd64 box, after 135 seconds of lisp compilation, the dgeev() call took: Evaluation took 0.0240 seconds (0.0240 elapsed) using 2.661 MB. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From mickle.mouse at gmail.com Sun May 6 16:14:51 2012 From: mickle.mouse at gmail.com (Mike Valenzuela) Date: Sun, 6 May 2012 14:14:51 -0700 Subject: [Maxima] Lapack loading in Maxima, but not wxMaxima Message-ID: I'm not sure if this bug has ever been resolved but I've noticed that the wxMaxima distributed with Maxima 2.26.0 and 2.27.0 hangs forever after trying to load lapack. I do not have this problem using Maxima (command line) Does anyone know how a work-around or fix wxMaxima? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bart.Vandewoestyne at telenet.be Mon May 7 03:51:20 2012 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Mon, 07 May 2012 10:51:20 +0200 Subject: [Maxima] plotting modulus of complex function In-Reply-To: References: <4FA2698F.9040702@gmail.com> <4FA28780.6070909@fe.up.pt> <4FA38E5A.4080105@gmail.com> Message-ID: <4FA78D08.9020101@gmail.com> On 05/04/2012 05:25 PM, Robert Dodier wrote: > On 2012-05-04, Bart Vandewoestyne wrote: > >> The real reason why I wanted to look at the Ge(s) function is that I >> want to understand its behavior for s->0. If I plot its modulus, i see >> a quite smooth behavior between 1e-7 and 1e-1, but for values lower than >> 1e-7 the abs(Ge(s)) function seems to go up again??? > > Try replacing the ordinary floats (approx. 16 digits) with bigfloats > (variable number of digits). I replaced the floats with bigfloats in > your script as shown by the diff in the PS. Increasing fpprec (50, 100, > 200) yields results that seem to converge to approximately 2.3b-4 as s > goes to 0. (Usual disclaimer about numerical results applies.) > > Note that if you change fpprec, you probably have to reconstruct Ge and > Gm because some arithmetic has already been carried out by the time you > get around to defining the functions. > > By the way, after replacing the floats, you can still apply plot2d to > the function, but since the plotting code wants floats, it's not > an entirely accurate representation of the function. So to investigate > the behavior close to s = 0, I think you can try something like: > > foo(s):=abs(Ge(s))$ > for n thru 16 do print(bfloat(foo(1.0b0/10^n)))$ > > Hope this helps, it's an interesting problem. > > Robert Dodier Hmmm... interesting... so according to Robert, the limit for s->0 is 2.3b-4 (a constant) while Raymond Toy's conclusion in another reply appears to be approximately (4.5e-23+%i*3.8e-24)/s (1/s behavior) Note the dramatic difference between these two! Which of these two is closest to the real truth (close to 0, the Ge(s) behaves as a constant OR as a 1/s singularity) is *exactly* what I'm interested in :-) I didn't have the courage yet to calculate this limit with pencil and paper... but looking at the above results, it seems like i might go and grab lots of ink and lots of sheets of paper to come to a real analytic solution ;-) Any other answers more than welcome! The script/problem we're talking about is still online at https://www.dropbox.com/s/6ie4i31b1gi2nm1/bartscript.mac Regards, Bart From mxue at vroomlab.com Mon May 7 10:53:38 2012 From: mxue at vroomlab.com (Michael) Date: Mon, 7 May 2012 15:53:38 +0000 (UTC) Subject: [Maxima] A request on Maxima 5.27 References: <789E8888AFDE4B84A3DF3379B4E53533@PASSERELLE> Message-ID: Hello Maxima Jedi(s) I just notice that maxima's describe has changed. for example, when I do 'describe(diff)' it used to describe diff in 'one shot'. it is ask user to choose options (0, 1) now. May I ask respectfully that the coder who made the change put the describe back to what it used to be, and put out a new build (rpm) or source (tar) ? Thank you very much. -Michael From toy.raymond at gmail.com Mon May 7 12:30:25 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 7 May 2012 10:30:25 -0700 Subject: [Maxima] A request on Maxima 5.27 In-Reply-To: References: <789E8888AFDE4B84A3DF3379B4E53533@PASSERELLE> Message-ID: On Mon, May 7, 2012 at 8:53 AM, Michael wrote: > Hello Maxima Jedi(s) I just notice that maxima's describe has changed. for > example, when I do 'describe(diff)' it used to describe diff in 'one shot'. > it is ask user to choose options (0, 1) now. May I ask respectfully that > the coder who made the change put the describe back to what it used to be, > and > put out a new build (rpm) or source (tar) ? Thank you very much. > If this is done, how will the user who wants the documentation for how diff works with tensors get the desired documentation? Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From dbmaxima at gmail.com Mon May 7 19:51:50 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Tue, 08 May 2012 10:51:50 +1000 Subject: [Maxima] Maxima 5.27 crashes In-Reply-To: <83FD4DC40F97654495E2C9AED47658360422C1B4@BL2PRD0710MB361.namprd07.prod.outlook.com> References: , <4FA609B4.4040206@gmail.com> <83FD4DC40F97654495E2C9AED47658360422C1B4@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: <4FA86E26.4090902@gmail.com> On 6/05/2012 9:38 PM, Barton Willis wrote: > My 5.27.0 runs OK under Windows 7, but command line "?" doesn't work. I tried both wxMaxima and Xmaxima: I can reproduce this. Will investigate. From mxue at vroomlab.com Mon May 7 20:26:44 2012 From: mxue at vroomlab.com (Michael) Date: Tue, 8 May 2012 01:26:44 +0000 (UTC) Subject: [Maxima] A request on Maxima 5.27 References: <789E8888AFDE4B84A3DF3379B4E53533@PASSERELLE> Message-ID: Hi Ray, Perhaps we can append the diff tensor usage to the common diff derivative usages, something similar to what is in describe(diff) from maxima-5.25.1. I prefer to see results from describe in one shot. - Michael From dbmaxima at gmail.com Mon May 7 22:19:35 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Tue, 08 May 2012 13:19:35 +1000 Subject: [Maxima] RE : Maxima 5.27 crashes In-Reply-To: <8DB72F28AFD448109D0388A34BFEEE94@PASSERELLE> References: <8DB72F28AFD448109D0388A34BFEEE94@PASSERELLE> Message-ID: <4FA890C7.6030907@gmail.com> On 7/05/2012 2:27 AM, laurent couraud wrote: >> De : David Billinghurst [mailto:dbmaxima at gmail.com] >> >> On 6/05/2012 8:19 AM, laurent couraud wrote: >>> Sorry I forget to mention it is under Windows XP. >>>> Hi everyone, >>>> >>>> Maxima 5.27.0 command line crashes nearly systematically. >>>> I can do 1+1 but if I try any command like factor or ratsimp it crashes instantly. >>>> And with XMaxima it crashes even before I see the maxima prompt. >> Hi Laurent, >> >> I built the windows installer. It works for me under Windows XP SP3, >> and the testsuite passes (with 2 fails). >> >> I don't know what to suggest. Does 5.26.0 work for you? It was built >> using the same system and I haven't has any reports of problems. > I see one difference between the 5.26 and 5.27 executable. > 5.26 depend on "libgmp-10.dll" but this is not the case for 5.27 > I don't know if this matter or not The windows 5.26 build with libgmp-10.dll is an experimental build I made using recent mingw/msys/gcc. It wasn't released officially. I plan to do the same for 5.27 when I get time. I would like to switch to this for future maxima releases but I can't get the build working on Windows 7 machines. Time to try an XP virtual machine under Windows 7 Professional. From dbmaxima at gmail.com Mon May 7 22:23:58 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Tue, 08 May 2012 13:23:58 +1000 Subject: [Maxima] Maxima 5.27 crashes In-Reply-To: <4FA86E26.4090902@gmail.com> References: , <4FA609B4.4040206@gmail.com> <83FD4DC40F97654495E2C9AED47658360422C1B4@BL2PRD0710MB361.namprd07.prod.outlook.com> <4FA86E26.4090902@gmail.com> Message-ID: <4FA891CE.4050601@gmail.com> On 8/05/2012 10:51 AM, David Billinghurst wrote: > On 6/05/2012 9:38 PM, Barton Willis wrote: >> My 5.27.0 runs OK under Windows 7, but command line "?" doesn't work. >> I tried both wxMaxima and Xmaxima: > I can reproduce this. Will investigate. My fault. Didn't read my notes from last release, and didn't test properly. The makeinfo in my old mingw/msys build tree is too old, so the documentation doesn't build correctly. I will spin a new release with updated gnuplot and wxmaxima, once I work out how to build wxmaxima from source. From toy.raymond at gmail.com Mon May 7 23:16:18 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 07 May 2012 21:16:18 -0700 Subject: [Maxima] plotting modulus of complex function In-Reply-To: <4FA78D08.9020101@gmail.com> References: <4FA2698F.9040702@gmail.com> <4FA28780.6070909@fe.up.pt> <4FA38E5A.4080105@gmail.com> <4FA78D08.9020101@gmail.com> Message-ID: <4FA89E12.6050200@gmail.com> On 5/7/12 1:51 AM, Bart Vandewoestyne wrote: > On 05/04/2012 05:25 PM, Robert Dodier wrote: >> On 2012-05-04, Bart Vandewoestyne wrote: >> >>> The real reason why I wanted to look at the Ge(s) function is that I >>> want to understand its behavior for s->0. If I plot its modulus, i see >>> a quite smooth behavior between 1e-7 and 1e-1, but for values lower than >>> 1e-7 the abs(Ge(s)) function seems to go up again??? >> >> Try replacing the ordinary floats (approx. 16 digits) with bigfloats >> (variable number of digits). I replaced the floats with bigfloats in >> your script as shown by the diff in the PS. Increasing fpprec (50, 100, >> 200) yields results that seem to converge to approximately 2.3b-4 as s >> goes to 0. (Usual disclaimer about numerical results applies.) >> >> Note that if you change fpprec, you probably have to reconstruct Ge and >> Gm because some arithmetic has already been carried out by the time you >> get around to defining the functions. >> >> By the way, after replacing the floats, you can still apply plot2d to >> the function, but since the plotting code wants floats, it's not >> an entirely accurate representation of the function. So to investigate >> the behavior close to s = 0, I think you can try something like: >> >> foo(s):=abs(Ge(s))$ >> for n thru 16 do print(bfloat(foo(1.0b0/10^n)))$ >> >> Hope this helps, it's an interesting problem. >> >> Robert Dodier > > Hmmm... interesting... so according to Robert, the limit for s->0 is > > 2.3b-4 (a constant) > > while Raymond Toy's conclusion in another reply appears to be approximately > > (4.5e-23+%i*3.8e-24)/s (1/s behavior) > > Note the dramatic difference between these two! Which of these two is > closest to the real truth (close to 0, the Ge(s) behaves as a constant > OR as a 1/s singularity) is *exactly* what I'm interested in :-) I don't know what the true answer is, but if you use your script and plot from 1e-11 instead of 1e-8, you'll get a straight line near 1e-11, so I think that hints that Ge(s) behaves like 1/s. > > I didn't have the courage yet to calculate this limit with pencil and > paper... but looking at the above results, it seems like i might go and > grab lots of ink and lots of sheets of paper to come to a real analytic > solution ;-) Shouldn't be too hard (says someone who hasn't tried it!). The sqrt(s^2-a) terms are easily approximated near s=0 and coth(x) is approximately 1/x, so all the terms should be easy to write out. Ray From toy.raymond at gmail.com Mon May 7 23:16:18 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 07 May 2012 21:16:18 -0700 Subject: [Maxima] plotting modulus of complex function In-Reply-To: <4FA78D08.9020101@gmail.com> References: <4FA2698F.9040702@gmail.com> <4FA28780.6070909@fe.up.pt> <4FA38E5A.4080105@gmail.com> <4FA78D08.9020101@gmail.com> Message-ID: <4FA89E12.6050200@gmail.com> On 5/7/12 1:51 AM, Bart Vandewoestyne wrote: > On 05/04/2012 05:25 PM, Robert Dodier wrote: >> On 2012-05-04, Bart Vandewoestyne wrote: >> >>> The real reason why I wanted to look at the Ge(s) function is that I >>> want to understand its behavior for s->0. If I plot its modulus, i see >>> a quite smooth behavior between 1e-7 and 1e-1, but for values lower than >>> 1e-7 the abs(Ge(s)) function seems to go up again??? >> >> Try replacing the ordinary floats (approx. 16 digits) with bigfloats >> (variable number of digits). I replaced the floats with bigfloats in >> your script as shown by the diff in the PS. Increasing fpprec (50, 100, >> 200) yields results that seem to converge to approximately 2.3b-4 as s >> goes to 0. (Usual disclaimer about numerical results applies.) >> >> Note that if you change fpprec, you probably have to reconstruct Ge and >> Gm because some arithmetic has already been carried out by the time you >> get around to defining the functions. >> >> By the way, after replacing the floats, you can still apply plot2d to >> the function, but since the plotting code wants floats, it's not >> an entirely accurate representation of the function. So to investigate >> the behavior close to s = 0, I think you can try something like: >> >> foo(s):=abs(Ge(s))$ >> for n thru 16 do print(bfloat(foo(1.0b0/10^n)))$ >> >> Hope this helps, it's an interesting problem. >> >> Robert Dodier > > Hmmm... interesting... so according to Robert, the limit for s->0 is > > 2.3b-4 (a constant) > > while Raymond Toy's conclusion in another reply appears to be approximately > > (4.5e-23+%i*3.8e-24)/s (1/s behavior) > > Note the dramatic difference between these two! Which of these two is > closest to the real truth (close to 0, the Ge(s) behaves as a constant > OR as a 1/s singularity) is *exactly* what I'm interested in :-) I don't know what the true answer is, but if you use your script and plot from 1e-11 instead of 1e-8, you'll get a straight line near 1e-11, so I think that hints that Ge(s) behaves like 1/s. > > I didn't have the courage yet to calculate this limit with pencil and > paper... but looking at the above results, it seems like i might go and > grab lots of ink and lots of sheets of paper to come to a real analytic > solution ;-) Shouldn't be too hard (says someone who hasn't tried it!). The sqrt(s^2-a) terms are easily approximated near s=0 and coth(x) is approximately 1/x, so all the terms should be easy to write out. Ray From robert.dodier at gmail.com Mon May 7 23:33:16 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 8 May 2012 04:33:16 +0000 (UTC) Subject: [Maxima] Maxima 5.27 crashes References: <4FA609B4.4040206@gmail.com> <83FD4DC40F97654495E2C9AED47658360422C1B4@BL2PRD0710MB361.namprd07.prod.outlook.com> <4FA86E26.4090902@gmail.com> <4FA891CE.4050601@gmail.com> Message-ID: On 2012-05-08, David Billinghurst wrote: >> On 6/05/2012 9:38 PM, Barton Willis wrote: >>> My 5.27.0 runs OK under Windows 7, but command line "?" doesn't work. > My fault. Didn't read my notes from last release, and didn't test > properly. The makeinfo in my old mingw/msys build tree is too old, so > the documentation doesn't build correctly. I will spin a new release > with updated gnuplot and wxmaxima, once I work out how to build wxmaxima > from source. Well, I wonder if we can avoid rebuilding the documentation. The tar ball contains maxima-index.lisp and .info files, for all languages. Shouldn't make just skip over the documentation since it exists already? I guess character encoding might be a problem. I don't know in what encoding the .info files are encoded (aside from the ones in the foo.utf8 directories, which, I guess, are UTF-8), and I don't know what Windows wants, nor what GCL is capable of. Thanks very much for working on the Windows release, we all appreciate it very much. best, Robert Dodier From robert.dodier at gmail.com Mon May 7 23:35:27 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 8 May 2012 04:35:27 +0000 (UTC) Subject: [Maxima] Pending tickets are closing References: Message-ID: On 2012-05-05, Raymond Toy wrote: > It used to be that pending tickets would automatically close after 14 > days or so if no one responded. That doesn't seem to be the case > anymore and sourceforge apparently won't fix it: > https://sourceforge.net/apps/trac/sourceforge/ticket/24729 OK by me. Not a big deal either way. > I guess they want projects to migrate to the new beta sourceforge system. Would anyone care to comment about the new system? I don't know anything about it. best Robert Dodier From robert.dodier at gmail.com Mon May 7 23:41:57 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 8 May 2012 04:41:57 +0000 (UTC) Subject: [Maxima] plotting modulus of complex function References: <4FA2698F.9040702@gmail.com> <4FA28780.6070909@fe.up.pt> <4FA38E5A.4080105@gmail.com> <4FA78D08.9020101@gmail.com> Message-ID: On 2012-05-07, Bart Vandewoestyne wrote: > On 05/04/2012 05:25 PM, Robert Dodier wrote: >> foo(s):=abs(Ge(s))$ >> for n thru 16 do print(bfloat(foo(1.0b0/10^n)))$ > Hmmm... interesting... so according to Robert, the limit for s->0 is > > 2.3b-4 (a constant) > > while Raymond Toy's conclusion in another reply appears to be approximately > > (4.5e-23+%i*3.8e-24)/s (1/s behavior) > > Note the dramatic difference between these two! Which of these two is > closest to the real truth (close to 0, the Ge(s) behaves as a constant > OR as a 1/s singularity) is *exactly* what I'm interested in :-) Bart, if you try the loop I suggested but work closer to 0 (by increasing n to, say, 50) I think you will see it blow up. The value is approximately constant for a while (maybe up to n = 20 or so) but then it starts growing. Whether it's approximately 1/s or not, I didn't investigate carefully. Hope this helps, Robert Dodier From robert.dodier at gmail.com Tue May 8 00:03:59 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 8 May 2012 05:03:59 +0000 (UTC) Subject: [Maxima] Maxima Lapack is very slow: 7 seconds versus 0.002 seconds in Julia. References: <1336228614.51112.YahooMailClassic@web132504.mail.ird.yahoo.com> <1336233631.74042.YahooMailClassic@web132503.mail.ird.yahoo.com> <4FA59881.1040800@gmail.com> Message-ID: On 2012-05-05, Raymond Toy wrote: > On 5/5/12 9:00 AM, Manuel Pedrinero rossetil wrote: >> Perhaps the efforts in linear algebra of Rosseti, Tamas, Raymond, >> Liliam (gsl), Luis Oliveira. (cffi) and others could be ported to maxima >> or some interface via cffi between Julia and maxima could be very >> interesting. There also some Lispers that use Lisp and R (for example >> C. Rhodes) . Improving the numeric capabilities of maxima could appeal >> to more people and communities. > Let us not lose sight of what maxima is. It is a computer algebra > system, not a numerical evaluation system. There are many of those already. Well, we don't have to choose one or the other. Ideally Maxima would combine symbolic and numerical capabilities. Given the history of the project and the people working on it, there's more emphasis on symbolic stuff. But there's no reason to rule out expanded numerical functions, and in fact we have made good progress over the past several years. (Special thanks to you, Ray, for that.) best Robert Dodier From robert.dodier at gmail.com Tue May 8 00:08:32 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 8 May 2012 05:08:32 +0000 (UTC) Subject: [Maxima] Lapack loading in Maxima, but not wxMaxima References: Message-ID: On 2012-05-06, Mike Valenzuela wrote: > I'm not sure if this bug has ever been resolved but I've noticed that the > wxMaxima distributed with Maxima 2.26.0 and 2.27.0 hangs forever after > trying to load lapack. > > I do not have this problem using Maxima (command line) WxMaxima seems to collect all the output and print it all at once. Are you sure that wxMaxima is really stuck? or is it just waiting for lapack to finish loading? What happens if you wait a while and then try entering something else like 1 + 1 ? Sorry I can't be more helpful -- Robert Dodier From willisb at unk.edu Tue May 8 07:47:29 2012 From: willisb at unk.edu (Barton Willis) Date: Tue, 8 May 2012 12:47:29 +0000 Subject: [Maxima] plotting modulus of complex function In-Reply-To: References: <4FA2698F.9040702@gmail.com> <4FA28780.6070909@fe.up.pt> <4FA38E5A.4080105@gmail.com> <4FA78D08.9020101@gmail.com>, Message-ID: <83FD4DC40F97654495E2C9AED47658360422E4AF@BL2PRD0710MB361.namprd07.prod.outlook.com> I think that Ge(s) = tiny / s^2 + O(1/s), s --> 0. The tiny / s^2 term might be due to rounding of the floats in Ge. (%i16) e : taylor(rationalize(Ge(s)),s,0,2)$ (%i17) lopow(e,s); (%o17) -2 (%i24) bfloat(rectform(coeff(e,s,-2))), fpprec : 200; (%o24) 9.8480154028659045663685635665[145 digits]04666166039093880989658562b-20*%i+2.2564140069591173798376206889[145 digits]79608157633058364356016944b-20 Trying various values of fpprec makes me think that %o24 is nonzero. --bw ________________________________________ From: maxima-bounces at math.utexas.edu [maxima-bounces at math.utexas.edu] on behalf of Robert Dodier [robert.dodier at gmail.com] Sent: Monday, May 07, 2012 23:41 To: maxima at math.utexas.edu Subject: Re: [Maxima] plotting modulus of complex function On 2012-05-07, Bart Vandewoestyne wrote: > On 05/04/2012 05:25 PM, Robert Dodier wrote: >> foo(s):=abs(Ge(s))$ >> for n thru 16 do print(bfloat(foo(1.0b0/10^n)))$ > Hmmm... interesting... so according to Robert, the limit for s->0 is > > 2.3b-4 (a constant) > > while Raymond Toy's conclusion in another reply appears to be approximately > > (4.5e-23+%i*3.8e-24)/s (1/s behavior) > > Note the dramatic difference between these two! Which of these two is > closest to the real truth (close to 0, the Ge(s) behaves as a constant > OR as a 1/s singularity) is *exactly* what I'm interested in :-) Bart, if you try the loop I suggested but work closer to 0 (by increasing n to, say, 50) I think you will see it blow up. The value is approximately constant for a while (maybe up to n = 20 or so) but then it starts growing. Whether it's approximately 1/s or not, I didn't investigate carefully. Hope this helps, Robert Dodier _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From toy.raymond at gmail.com Tue May 8 11:02:53 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 8 May 2012 09:02:53 -0700 Subject: [Maxima] Pending tickets are closing In-Reply-To: References: Message-ID: On Mon, May 7, 2012 at 9:35 PM, Robert Dodier wrote: > On 2012-05-05, Raymond Toy wrote: > > > It used to be that pending tickets would automatically close after 14 > > days or so if no one responded. That doesn't seem to be the case > > anymore and sourceforge apparently won't fix it: > > https://sourceforge.net/apps/trac/sourceforge/ticket/24729 > > OK by me. Not a big deal either way. > Agreed. But it was kind of nice to kind of "fire and forget" so no one has to look at them again. > > > I guess they want projects to migrate to the new beta sourceforge system. > > Would anyone care to comment about the new system? I don't know anything > about it. > > I don't have any experience with that either. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue May 8 12:12:56 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 8 May 2012 10:12:56 -0700 Subject: [Maxima] Maxima Lapack is very slow: 7 seconds versus 0.002 seconds in Julia. In-Reply-To: References: <1336228614.51112.YahooMailClassic@web132504.mail.ird.yahoo.com> <1336233631.74042.YahooMailClassic@web132503.mail.ird.yahoo.com> <4FA59881.1040800@gmail.com> Message-ID: On Mon, May 7, 2012 at 10:03 PM, Robert Dodier wrote: > On 2012-05-05, Raymond Toy wrote: > > On 5/5/12 9:00 AM, Manuel Pedrinero rossetil wrote: > > >> Perhaps the efforts in linear algebra of Rosseti, Tamas, Raymond, > >> Liliam (gsl), Luis Oliveira. (cffi) and others could be ported to maxima > >> or some interface via cffi between Julia and maxima could be very > >> interesting. There also some Lispers that use Lisp and R (for example > >> C. Rhodes) . Improving the numeric capabilities of maxima could appeal > >> to more people and communities. > > > Let us not lose sight of what maxima is. It is a computer algebra > > system, not a numerical evaluation system. There are many of those > already. > > Well, we don't have to choose one or the other. Ideally Maxima would > combine symbolic and numerical capabilities. Given the history of the > project and the people working on it, there's more emphasis on symbolic > stuff. But there's no reason to rule out expanded numerical functions, > and in fact we have made good progress over the past several years. > Didn't mean that we should never do numerics. And, in fact, I think we should be able to evaluate everything using bigfloats. We're not there yet But speed is not the major concern because there are many systems out there that already do that and probably better than maxima can ever do (because we very likely need to marshal data back and forth). On the other hand, if we have a decent method to make things fast, we should do that and not intentionally make it slow. :-) Lapack is one of the things that we are reasonably fast, but making it really fast as in octave or others would be pretty hard. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Tue May 8 22:17:39 2012 From: willisb at unk.edu (Barton Willis) Date: Wed, 9 May 2012 03:17:39 +0000 Subject: [Maxima] plotting modulus of complex function In-Reply-To: <83FD4DC40F97654495E2C9AED47658360422E4AF@BL2PRD0710MB361.namprd07.prod.outlook.com> References: <4FA2698F.9040702@gmail.com> <4FA28780.6070909@fe.up.pt> <4FA38E5A.4080105@gmail.com> <4FA78D08.9020101@gmail.com>, , <83FD4DC40F97654495E2C9AED47658360422E4AF@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: <83FD4DC40F97654495E2C9AED47658360422E5D3@BL2PRD0710MB361.namprd07.prod.outlook.com> Try: load("bartfile.mac")$ load(hypergeometric)$ abs(rationalize(Ge(s)))$ larry(x) := float(nfloat(''%,[s=x],10))$ plot2d([abs(Ge(x)), '(larry(x))], [x, 1e-8, 1e1], [logx],[logy]); --Barton From dbmaxima at gmail.com Wed May 9 08:36:31 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Wed, 09 May 2012 23:36:31 +1000 Subject: [Maxima] Second windows installer for maxima 5.27.0 Message-ID: <4FAA72DF.8020209@gmail.com> There is a new windows installer at http://billinghurst.customer.netspace.net.au/maxima-5.27.0.exe A couple of changes from the first package 1. Describe and ? work. My version of makeinfo was too old and the indexes weren't built properly 2. Updated wxmaxima to 12.04.0. Thanks to Andrej Vodopivec for the binary 3. Updated gnuplot to 4.6.0. Thanks to Ihor Rokach for the reminder. As with past windows binaries this is built with an ancient mingw/msys and gcl/gcc-3.3.1 A couple of other problems have been reported. I haven't been able to reproduce them. From jason.filippou at gmail.com Wed May 9 13:46:17 2012 From: jason.filippou at gmail.com (Jason Filippou) Date: Wed, 9 May 2012 21:46:17 +0300 Subject: [Maxima] Solving a two equation system yields strange results Message-ID: Good afternoon. I've been using ?Maxima 5.21.1 in a Debian GNU / Linux 2.6.32-5-686 system to solve a particular two equation system that I have to. The system is as follows: (1): b*(k - 1) = 0.1 (2): exp(-1/b) / sum(i! * b^i, i, 0, k -1) = 0.02 I've been using solve/2 for this, but I've been returned an empty solution set. Namely: %i9) solve([b * (k - 1) = 0.1, exp(-1/b) / sum(i! * b^i, i, 0, k -1) = 0.02], [b, k]); rat: replaced -0.1 by -1/10 = -0.1 rat: replaced -0.02 by -1/50 = -0.02 (%o9) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [] Now, normally I would assume that this means that the system doesn't have a solution, but after substituting beta with its equivalent from the first equation, i.e 0.1 / (k - 1), I noticed that the evaluation of the second equation halts after a couple of steps: (%i5) solve([exp(-(k - 1) / 0.1) * sum(1/(i! * (0.1 / (k-1))^i), i, 0, k -1) = 0.02], [k]); rat: replaced -0.02 by -1/50 = -0.02 rat: replaced 0.1 by 1/10 = 0.1 rat: replaced 10.0 by 10/1 = 10.0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?%i %pi ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?------ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?5 ? ? ? ? 1 - k ? ? ? ? ? ? ? ?%e (%o5) [%e ? ? ?= -----------------------------------, ? ? ? ? ? ? ? ? ? ? ? ? ? ? k - 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ?i ? ? ? ?i ? ? ? ? ? ? ? ? ?1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 ? ? ? ? ? ? ? ? 2 ? ? 5 ? ?( > ? ?------------) ? ? ? ? ? ? ? ? ? ? ? ? ? ? / ? ? ? ? ?i! ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ? ? ? ? ? ? ? ? ? ? ? ? ? i = 0 ? ? ? ? ? ? ? ? ? ? ? ?2 %i %pi ? ? ? ? ? ? ? ? ? ? ? ?-------- ? ? ? ? ? ? ? ? ? ? ? ? ? 5 ?1 - k ? ? ? ? ? ? ? %e %e ? ? ?= -----------------------------------, ? ? ? ? ? ? ? ? ? ? ?k - 1 ? ? ? ? ? ? ? ? ? ? ?==== ? ?i ? ? ? ?i ? ? ? ? ? 1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 ? ? ? ? ?2 ? ? 5 ? ?( > ? ?------------) ? ? ? ? ? ? ? ? ? ? ?/ ? ? ? ? ?i! ? ? ? ? ? ? ? ? ? ? ?==== ? ? ? ? ? ? ? ? ? ? ?i = 0 ? ? ? ? ? ? ? ? ? ? ? ?3 %i %pi ? ? ? ? ? ? ? ? ? ? ? ?-------- ? ? ? ? ? ? ? ? ? ? ? ? ? 5 ?1 - k ? ? ? ? ? ? ? %e %e ? ? ?= -----------------------------------, ? ? ? ? ? ? ? ? ? ? ?k - 1 ? ? ? ? ? ? ? ? ? ? ?==== ? ?i ? ? ? ?i ? ? ? ? ? 1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 ? ? ? ? ?2 ? ? 5 ? ?( > ? ?------------) ? ? ? ? ? ? ? ? ? ? ?/ ? ? ? ? ?i! ? ? ? ? ? ? ? ? ? ? ?==== ? ? ? ? ? ? ? ? ? ? ?i = 0 ? ? ? ? ? ? ? ? ? ? ? ?4 %i %pi ? ? ? ? ? ? ? ? ? ? ? ?-------- ? ? ? ? ? ? ? ? ? ? ? ? ? 5 ?1 - k ? ? ? ? ? ? ? %e %e ? ? ?= -----------------------------------, ? ? ? ? ? ? ? ? ? ? ?k - 1 ? ? ? ? ? ? ? ? ? ? ?==== ? ?i ? ? ? ?i ? ? ? ? ? 1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 ? ? ? ? ?2 ? ? 5 ? ?( > ? ?------------) ? ? ? ? ? ? ? ? ? ? ?/ ? ? ? ? ?i! ? ? ? ? ? ? ? ? ? ? ?==== ? ? ? ? ? ? ? ? ? ? ?i = 0 ?1 - k ? ? ? ? ? ? ? ? ? ? ?1 %e ? ? ?= - -----------------------------------, ? ? ? ? ? ? ? ? ? ? ? ?k - 1 ? ? ? ? ? ? ? ? ? ? ? ?==== ? ?i ? ? ? ?i ? ? ? ? ? ? 1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 ? ? ? ? ? ?2 ? ? 5 ? ?( > ? ?------------) ? ? ? ? ? ? ? ? ? ? ? ?/ ? ? ? ? ?i! ? ? ? ? ? ? ? ? ? ? ? ?==== ? ? ? ? ? ? ? ? ? ? ? ?i = 0 ? ?5 k - 4 %i %pi - 5 ?- ------------------ ? ? ? ? ? ?5 ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 %e ? ? ? ? ? ? ? ? ? ? = -----------------------------------, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? k - 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ?i ? ? ? ?i ? ? ? ? ? ? ? ? ? ? ? ? ?1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 ? ? ? ? ? ? ? ? ? ? ? ? 2 ? ? 5 ? ?( > ? ?------------) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? / ? ? ? ? ?i! ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? i = 0 ? ?5 k - 3 %i %pi - 5 ?- ------------------ ? ? ? ? ? ?5 ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 %e ? ? ? ? ? ? ? ? ? ? = -----------------------------------, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? k - 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ?i ? ? ? ?i ? ? ? ? ? ? ? ? ? ? ? ? ?1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 ? ? ? ? ? ? ? ? ? ? ? ? 2 ? ? 5 ? ?( > ? ?------------) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? / ? ? ? ? ?i! ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? i = 0 ? ?5 k - 2 %i %pi - 5 ?- ------------------ ? ? ? ? ? ?5 ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 %e ? ? ? ? ? ? ? ? ? ? = -----------------------------------, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? k - 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ?i ? ? ? ?i ? ? ? ? ? ? ? ? ? ? ? ? ?1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 ? ? ? ? ? ? ? ? ? ? ? ? 2 ? ? 5 ? ?( > ? ?------------) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? / ? ? ? ? ?i! ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? i = 0 ? ?5 k - %i %pi - 5 ?- ---------------- ? ? ? ? ? 5 ? ? ? ? ? ? ? ? ? ? ? ? ? ?1 %e ? ? ? ? ? ? ? ? ? = -----------------------------------, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? k - 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ?i ? ? ? ?i ? ? ? ? ? ? ? ? ? ? ? ?1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 ? ? ? ? ? ? ? ? ? ? ? 2 ? ? 5 ? ?( > ? ?------------) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? / ? ? ? ? ?i! ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? i = 0 ?1 - k ? ? ? ? ? ? ? ? ? ?1 %e ? ? ?= -----------------------------------] ? ? ? ? ? ? ? ? ? ? ?k - 1 ? ? ? ? ? ? ? ? ? ? ?==== ? ?i ? ? ? ?i ? ? ? ? ? 1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 ? ? ? ? ?2 ? ? 5 ? ?( > ? ?------------) ? ? ? ? ? ? ? ? ? ? ?/ ? ? ? ? ?i! ? ? ? ? ? ? ? ? ? ? ?==== ? ? ? ? ? ? ? ? ? ? ?i = 0 And then if I try to "solve" it any further I get no solutions: (%i6) solve(%, [k]); (%o6) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [] What am I doing wrong here? Thanks, Jason -- Jason Filippou Research Associate NCSR Demokritos NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ LinkedIn! Profile: http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro -- Jason Filippou Research Associate NCSR Demokritos NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ LinkedIn! Profile: http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro From jason.filippou at gmail.com Wed May 9 13:47:56 2012 From: jason.filippou at gmail.com (Jason Filippou) Date: Wed, 9 May 2012 21:47:56 +0300 Subject: [Maxima] Solving a two equation system yields strange results In-Reply-To: References: Message-ID: Pardon, the second equation (2) should read (as is implied by the output that I typed in): (%i7) exp(-1/b) * sum(1/(i! * b^i), i, 0, k -1) = 0.02; k - 1 ==== - 1/b \ 1 (%o7) %e > ----- = 0.02 / i ==== b i! i = 0 Still no luck though. Jason On Wed, May 9, 2012 at 9:46 PM, Jason Filippou wrote: > Good afternoon. > > I've been using ?Maxima 5.21.1 in a Debian GNU / Linux 2.6.32-5-686 > system to solve a particular two equation system that I have to. The > system is as follows: > > (1): b*(k - 1) = 0.1 > > (2): exp(-1/b) / sum(i! * b^i, i, 0, k -1) = 0.02 > > I've been using solve/2 for this, but I've been returned an empty > solution set. Namely: > > %i9) solve([b * (k - 1) = 0.1, exp(-1/b) / sum(i! * b^i, i, 0, k -1) = > 0.02], [b, k]); > > rat: replaced -0.1 by -1/10 = -0.1 > > rat: replaced -0.02 by -1/50 = -0.02 > (%o9) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [] > > Now, normally I would assume that this means that the system doesn't > have a solution, but after substituting beta with its equivalent from > the first equation, i.e 0.1 / (k - 1), I noticed that the evaluation > of the second equation halts after a couple of steps: > > (%i5) solve([exp(-(k - 1) / 0.1) * sum(1/(i! * (0.1 / (k-1))^i), i, 0, > k -1) = 0.02], [k]); > > rat: replaced -0.02 by -1/50 = -0.02 > > rat: replaced 0.1 by 1/10 = 0.1 > > rat: replaced 10.0 by 10/1 = 10.0 > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?%i %pi > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?------ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?5 > ? ? ? ? 1 - k ? ? ? ? ? ? ? ?%e > (%o5) [%e ? ? ?= -----------------------------------, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? k - 1 > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ?i ? ? ? ?i > ? ? ? ? ? ? ? ? ?1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 > ? ? ? ? ? ? ? ? 2 ? ? 5 ? ?( > ? ?------------) > ? ? ? ? ? ? ? ? ? ? ? ? ? ? / ? ? ? ? ?i! > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== > ? ? ? ? ? ? ? ? ? ? ? ? ? ? i = 0 > ? ? ? ? ? ? ? ? ? ? ? ?2 %i %pi > ? ? ? ? ? ? ? ? ? ? ? ?-------- > ? ? ? ? ? ? ? ? ? ? ? ? ? 5 > ?1 - k ? ? ? ? ? ? ? %e > %e ? ? ?= -----------------------------------, > ? ? ? ? ? ? ? ? ? ? ?k - 1 > ? ? ? ? ? ? ? ? ? ? ?==== ? ?i ? ? ? ?i > ? ? ? ? ? 1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 > ? ? ? ? ?2 ? ? 5 ? ?( > ? ?------------) > ? ? ? ? ? ? ? ? ? ? ?/ ? ? ? ? ?i! > ? ? ? ? ? ? ? ? ? ? ?==== > ? ? ? ? ? ? ? ? ? ? ?i = 0 > ? ? ? ? ? ? ? ? ? ? ? ?3 %i %pi > ? ? ? ? ? ? ? ? ? ? ? ?-------- > ? ? ? ? ? ? ? ? ? ? ? ? ? 5 > ?1 - k ? ? ? ? ? ? ? %e > %e ? ? ?= -----------------------------------, > ? ? ? ? ? ? ? ? ? ? ?k - 1 > ? ? ? ? ? ? ? ? ? ? ?==== ? ?i ? ? ? ?i > ? ? ? ? ? 1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 > ? ? ? ? ?2 ? ? 5 ? ?( > ? ?------------) > ? ? ? ? ? ? ? ? ? ? ?/ ? ? ? ? ?i! > ? ? ? ? ? ? ? ? ? ? ?==== > ? ? ? ? ? ? ? ? ? ? ?i = 0 > ? ? ? ? ? ? ? ? ? ? ? ?4 %i %pi > ? ? ? ? ? ? ? ? ? ? ? ?-------- > ? ? ? ? ? ? ? ? ? ? ? ? ? 5 > ?1 - k ? ? ? ? ? ? ? %e > %e ? ? ?= -----------------------------------, > ? ? ? ? ? ? ? ? ? ? ?k - 1 > ? ? ? ? ? ? ? ? ? ? ?==== ? ?i ? ? ? ?i > ? ? ? ? ? 1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 > ? ? ? ? ?2 ? ? 5 ? ?( > ? ?------------) > ? ? ? ? ? ? ? ? ? ? ?/ ? ? ? ? ?i! > ? ? ? ? ? ? ? ? ? ? ?==== > ? ? ? ? ? ? ? ? ? ? ?i = 0 > ?1 - k ? ? ? ? ? ? ? ? ? ? ?1 > %e ? ? ?= - -----------------------------------, > ? ? ? ? ? ? ? ? ? ? ? ?k - 1 > ? ? ? ? ? ? ? ? ? ? ? ?==== ? ?i ? ? ? ?i > ? ? ? ? ? ? 1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 > ? ? ? ? ? ?2 ? ? 5 ? ?( > ? ?------------) > ? ? ? ? ? ? ? ? ? ? ? ?/ ? ? ? ? ?i! > ? ? ? ? ? ? ? ? ? ? ? ?==== > ? ? ? ? ? ? ? ? ? ? ? ?i = 0 > ? ?5 k - 4 %i %pi - 5 > ?- ------------------ > ? ? ? ? ? ?5 ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 > %e ? ? ? ? ? ? ? ? ? ? = -----------------------------------, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? k - 1 > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ?i ? ? ? ?i > ? ? ? ? ? ? ? ? ? ? ? ? ?1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 > ? ? ? ? ? ? ? ? ? ? ? ? 2 ? ? 5 ? ?( > ? ?------------) > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? / ? ? ? ? ?i! > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? i = 0 > ? ?5 k - 3 %i %pi - 5 > ?- ------------------ > ? ? ? ? ? ?5 ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 > %e ? ? ? ? ? ? ? ? ? ? = -----------------------------------, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? k - 1 > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ?i ? ? ? ?i > ? ? ? ? ? ? ? ? ? ? ? ? ?1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 > ? ? ? ? ? ? ? ? ? ? ? ? 2 ? ? 5 ? ?( > ? ?------------) > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? / ? ? ? ? ?i! > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? i = 0 > ? ?5 k - 2 %i %pi - 5 > ?- ------------------ > ? ? ? ? ? ?5 ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 > %e ? ? ? ? ? ? ? ? ? ? = -----------------------------------, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? k - 1 > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ?i ? ? ? ?i > ? ? ? ? ? ? ? ? ? ? ? ? ?1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 > ? ? ? ? ? ? ? ? ? ? ? ? 2 ? ? 5 ? ?( > ? ?------------) > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? / ? ? ? ? ?i! > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? i = 0 > ? ?5 k - %i %pi - 5 > ?- ---------------- > ? ? ? ? ? 5 ? ? ? ? ? ? ? ? ? ? ? ? ? ?1 > %e ? ? ? ? ? ? ? ? ? = -----------------------------------, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? k - 1 > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ?i ? ? ? ?i > ? ? ? ? ? ? ? ? ? ? ? ?1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 > ? ? ? ? ? ? ? ? ? ? ? 2 ? ? 5 ? ?( > ? ?------------) > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? / ? ? ? ? ?i! > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? i = 0 > ?1 - k ? ? ? ? ? ? ? ? ? ?1 > %e ? ? ?= -----------------------------------] > ? ? ? ? ? ? ? ? ? ? ?k - 1 > ? ? ? ? ? ? ? ? ? ? ?==== ? ?i ? ? ? ?i > ? ? ? ? ? 1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 > ? ? ? ? ?2 ? ? 5 ? ?( > ? ?------------) > ? ? ? ? ? ? ? ? ? ? ?/ ? ? ? ? ?i! > ? ? ? ? ? ? ? ? ? ? ?==== > ? ? ? ? ? ? ? ? ? ? ?i = 0 > > And then if I try to "solve" it any further I get no solutions: > > (%i6) solve(%, [k]); > (%o6) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [] > > What am I doing wrong here? > > Thanks, > > Jason > > -- > Jason Filippou > Research Associate > NCSR Demokritos > NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ > D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ > LinkedIn! Profile: http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro > > > -- > Jason Filippou > Research Associate > NCSR Demokritos > NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ > D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ > LinkedIn! Profile: http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro -- Jason Filippou Research Associate NCSR Demokritos NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ LinkedIn! Profile: http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro From toy.raymond at gmail.com Wed May 9 15:24:43 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 9 May 2012 13:24:43 -0700 Subject: [Maxima] Solving a two equation system yields strange results In-Reply-To: References: Message-ID: On Wed, May 9, 2012 at 11:46 AM, Jason Filippou wrote: > Good afternoon. > > I've been using Maxima 5.21.1 in a Debian GNU / Linux 2.6.32-5-686 > system to solve a particular two equation system that I have to. The > system is as follows: > > (1): b*(k - 1) = 0.1 > > (2): exp(-1/b) / sum(i! * b^i, i, 0, k -1) = 0.02 > > I've been using solve/2 for this, but I've been returned an empty > solution set. Namely: > > %i9) solve([b * (k - 1) = 0.1, exp(-1/b) / sum(i! * b^i, i, 0, k -1) = > 0.02], [b, k]); > > rat: replaced -0.1 by -1/10 = -0.1 > > rat: replaced -0.02 by -1/50 = -0.02 > (%o9) [] > > Now, normally I would assume that this means that the system doesn't > have a solution, but after substituting beta with its equivalent from > the first equation, i.e 0.1 / (k - 1), I noticed that the evaluation > of the second equation halts after a couple of steps: > > (%i5) solve([exp(-(k - 1) / 0.1) * sum(1/(i! * (0.1 / (k-1))^i), i, 0, > k -1) = 0.02], [k]); > > This seems a bit ill-defined. Since k is the upper limit of the sum, what do you expect sum(...,i,0,k-1) be when k is not an integer? Do you mean to take the floor of k-1? Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From jason.filippou at gmail.com Wed May 9 15:56:17 2012 From: jason.filippou at gmail.com (Jason Filippou) Date: Wed, 9 May 2012 23:56:17 +0300 Subject: [Maxima] Solving a two equation system yields strange results In-Reply-To: References: Message-ID: Yes, this particular equation is only defined if k is an integer. However, even after I make this known in maxima, the system appears to have no solutions: (%i2) declare(k, integer); (%o2) done (%i3) solve([b*(k - 1) = 0.1, exp(-1/b) * sum(1/(i! * b^i), i, 0, k -1) = 0.02], [b, k]); rat: replaced -0.1 by -1/10 = -0.1 rat: replaced -0.02 by -1/50 = -0.02 (%o3) [] (%i4) solve([b*(k - 1) = a, exp(-1/b) * sum(1/(i! * b^i), i, 0, k -1) = 0.02], [b, k]); rat: replaced -0.02 by -1/50 = -0.02 (%o4) [] FYI, what I'm trying to do here is to fit the parameters ? (theta) and k of a gamma distribution such that 98% of its mass is contained within the interval [0, 1]. In addition, I require that the "top" of the distribution, which is situated at ?*(? - 1) is equal to 0.1, or a in the general case. Unfortunately I can't use the first characterization of the CDF (as described in the link above, where x = 1) to do this because Maxima does not support the incomplete gamma function ?), so I'm using the second characterisation, which includes a sum of k terms. Two unknown quantities, two equations; there should be a solution to this. Jason On Wed, May 9, 2012 at 11:24 PM, Raymond Toy wrote: > > > On Wed, May 9, 2012 at 11:46 AM, Jason Filippou > wrote: >> >> Good afternoon. >> >> I've been using ?Maxima 5.21.1 in a Debian GNU / Linux 2.6.32-5-686 >> system to solve a particular two equation system that I have to. The >> system is as follows: >> >> (1): b*(k - 1) = 0.1 >> >> (2): exp(-1/b) / sum(i! * b^i, i, 0, k -1) = 0.02 >> >> I've been using solve/2 for this, but I've been returned an empty >> solution set. Namely: >> >> %i9) solve([b * (k - 1) = 0.1, exp(-1/b) / sum(i! * b^i, i, 0, k -1) = >> 0.02], [b, k]); >> >> rat: replaced -0.1 by -1/10 = -0.1 >> >> rat: replaced -0.02 by -1/50 = -0.02 >> (%o9) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [] >> >> Now, normally I would assume that this means that the system doesn't >> have a solution, but after substituting beta with its equivalent from >> the first equation, i.e 0.1 / (k - 1), I noticed that the evaluation >> of the second equation halts after a couple of steps: >> >> (%i5) solve([exp(-(k - 1) / 0.1) * sum(1/(i! * (0.1 / (k-1))^i), i, 0, >> k -1) = 0.02], [k]); >> > This seems a bit ill-defined.? Since k is the upper limit of the sum, what > do you expect sum(...,i,0,k-1) be when k is not an integer?? Do you mean to > take the floor of k-1? > > Ray > -- Jason Filippou Research Associate NCSR Demokritos NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ LinkedIn! Profile: http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro From jason.filippou at gmail.com Wed May 9 15:58:11 2012 From: jason.filippou at gmail.com (Jason Filippou) Date: Wed, 9 May 2012 23:58:11 +0300 Subject: [Maxima] Solving a two equation system yields strange results In-Reply-To: References: Message-ID: The link I forgot to send was this: http://en.wikipedia.org/wiki/Gamma_Distribution Thanks On Wed, May 9, 2012 at 11:56 PM, Jason Filippou wrote: > Yes, this particular equation is only defined if k is an integer. > However, even after I make this known in maxima, the system appears to > have no solutions: > > (%i2) declare(k, integer); > (%o2) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?done > (%i3) solve([b*(k - 1) = 0.1, exp(-1/b) * sum(1/(i! * b^i), i, 0, k > -1) = 0.02], [b, k]); > > rat: replaced -0.1 by -1/10 = -0.1 > > rat: replaced -0.02 by -1/50 = -0.02 > (%o3) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [] > (%i4) solve([b*(k - 1) = a, exp(-1/b) * sum(1/(i! * b^i), i, 0, k -1) > = 0.02], [b, k]); > > rat: replaced -0.02 by -1/50 = -0.02 > (%o4) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [] > > FYI, what I'm trying to do here is to fit the parameters ? (theta) and > k of a gamma distribution such that 98% of its mass is contained > within the interval [0, 1]. In addition, I require that the "top" of > the distribution, which is situated at ?*(? - 1) is equal to 0.1, or a > in the general case. Unfortunately I can't use the first > characterization of the CDF (as described in the link above, where x = > 1) to do this because Maxima does not support the incomplete gamma > function ?), so I'm using the second characterisation, which includes > a sum of k terms. > > Two unknown quantities, two equations; there should be a solution to this. > > Jason > > On Wed, May 9, 2012 at 11:24 PM, Raymond Toy wrote: >> >> >> On Wed, May 9, 2012 at 11:46 AM, Jason Filippou >> wrote: >>> >>> Good afternoon. >>> >>> I've been using ?Maxima 5.21.1 in a Debian GNU / Linux 2.6.32-5-686 >>> system to solve a particular two equation system that I have to. The >>> system is as follows: >>> >>> (1): b*(k - 1) = 0.1 >>> >>> (2): exp(-1/b) / sum(i! * b^i, i, 0, k -1) = 0.02 >>> >>> I've been using solve/2 for this, but I've been returned an empty >>> solution set. Namely: >>> >>> %i9) solve([b * (k - 1) = 0.1, exp(-1/b) / sum(i! * b^i, i, 0, k -1) = >>> 0.02], [b, k]); >>> >>> rat: replaced -0.1 by -1/10 = -0.1 >>> >>> rat: replaced -0.02 by -1/50 = -0.02 >>> (%o9) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [] >>> >>> Now, normally I would assume that this means that the system doesn't >>> have a solution, but after substituting beta with its equivalent from >>> the first equation, i.e 0.1 / (k - 1), I noticed that the evaluation >>> of the second equation halts after a couple of steps: >>> >>> (%i5) solve([exp(-(k - 1) / 0.1) * sum(1/(i! * (0.1 / (k-1))^i), i, 0, >>> k -1) = 0.02], [k]); >>> >> This seems a bit ill-defined.? Since k is the upper limit of the sum, what >> do you expect sum(...,i,0,k-1) be when k is not an integer?? Do you mean to >> take the floor of k-1? >> >> Ray >> > > > > -- > Jason Filippou > Research Associate > NCSR Demokritos > NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ > D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ > LinkedIn! Profile: http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro -- Jason Filippou Research Associate NCSR Demokritos NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ LinkedIn! Profile: http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro From toy.raymond at gmail.com Wed May 9 16:46:48 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 9 May 2012 14:46:48 -0700 Subject: [Maxima] Solving a two equation system yields strange results In-Reply-To: References: Message-ID: On Wed, May 9, 2012 at 1:56 PM, Jason Filippou wrote: > Yes, this particular equation is only defined if k is an integer. > However, even after I make this known in maxima, the system appears to > have no solutions: > > (%i2) declare(k, integer); > (%o2) done > (%i3) solve([b*(k - 1) = 0.1, exp(-1/b) * sum(1/(i! * b^i), i, 0, k > -1) = 0.02], [b, k]); > > rat: replaced -0.1 by -1/10 = -0.1 > > rat: replaced -0.02 by -1/50 = -0.02 > (%o3) [] > (%i4) solve([b*(k - 1) = a, exp(-1/b) * sum(1/(i! * b^i), i, 0, k -1) > = 0.02], [b, k]); > > rat: replaced -0.02 by -1/50 = -0.02 > (%o4) [] > > FYI, what I'm trying to do here is to fit the parameters ? (theta) and > k of a gamma distribution such that 98% of its mass is contained > within the interval [0, 1]. In addition, I require that the "top" of > the distribution, which is situated at ?*(? - 1) is equal to 0.1, or a > in the general case. Unfortunately I can't use the first > characterization of the CDF (as described in the link above, where x = > 1) to do this because Maxima does not support the incomplete gamma > function ?), so I'm using the second characterisation, which includes > a sum of k terms. > > Update your version of maxima to something newer like 5.27 or 5.26. The incomplete gamma function is defined there. (5.21 is very old.) This won't help with solve because solve doesn't know anything about the incomplete gamma function. But you should be able to find numerical solutions using find_root. > Two unknown quantities, two equations; there should be a solution to this. > Only if the equations are consistent. :-) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Wed May 9 16:48:59 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 9 May 2012 17:48:59 -0400 Subject: [Maxima] Solving a two equation system yields strange results In-Reply-To: References: Message-ID: As far as I know, 'solve' knows nothing about indexed sums, so Maxima will treat your equation exp(-1/b) / sum(i! * b^i, i, 0, k -1) = 0.02 roughly the way it treats: exp(-1/b) / f(b,k) = 0.02 namely, not something that Maxima can do anything useful with.... However, you can work on this problem in the following simple way: (%i1) eq1: b*(k - 1) = 0.1$ I will express eq2 as its left-hand-side minus its right-hand-side for convenience later. (%i2) eq2: exp(-1/b) * sum(1/(i! * b^i), i, 0, k -1) - 0.02$ (%i3) solve(eq1,b); rat: replaced -0.1 by -1/10 = -0.1 (%o3) [b=1/(10*k-10)] (%i4) subst(%o3,eq2); (%o4) %e^(10-10*k)*(sum((10*k-10)^i/i!,i,0,k-1))-0.02 Now we have an expression in one integer variable, so we can just evaluate it at the relevant integers.... (%i9) makelist(subst(j,k,%o4),j,1,10); (%o9) [-0.02,%e^(-10)*(sum(10^i/i!,i,0,1))-0.02,%e^(-20)*(sum(20^i/i!,i,0,2))-0.02,%e^(-30)*(sum(30^i/i!,i,0,3))-0.02,%e^(-40)*(sum(40^i/i!,i,0,4))-0.02,%e^(-50)*(sum(50^i/i!,i,0,5))-0.02,%e^(-60)*(sum(60^i/i!,i,0,6))-0.02,%e^(-70)*(sum(70^i/i!,i,0,7))-0.02,%e^(-80)*(sum(80^i/i!,i,0,8))-0.02,%e^(-90)*(sum(90^i/i!,i,0,9))-0.02] Now expand the sums and calculate numerical results: (%i10) %,sum,numer; (%o10) [-0.02,-.01950060077261267,-.01999954448504944,-0.0199999995338968,-.01999999999949795,-.01999999999999945,-0.02,-0.02,-0.02,-0.02] It doesn't look as though this is ever near zero, so no solutions. -s On Wed, May 9, 2012 at 2:47 PM, Jason Filippou wrote: > Pardon, the second equation (2) should read (as is implied by the > output that I typed in): > > (%i7) exp(-1/b) * sum(1/(i! * b^i), i, 0, k -1) = 0.02; > k - 1 > ==== > - 1/b \ 1 > (%o7) %e > ----- = 0.02 > / i > ==== b i! > i = 0 > > > > Still no luck though. > > Jason > > On Wed, May 9, 2012 at 9:46 PM, Jason Filippou > wrote: > > Good afternoon. > > > > I've been using Maxima 5.21.1 in a Debian GNU / Linux 2.6.32-5-686 > > system to solve a particular two equation system that I have to. The > > system is as follows: > > > > (1): b*(k - 1) = 0.1 > > > > (2): exp(-1/b) / sum(i! * b^i, i, 0, k -1) = 0.02 > > > > I've been using solve/2 for this, but I've been returned an empty > > solution set. Namely: > > > > %i9) solve([b * (k - 1) = 0.1, exp(-1/b) / sum(i! * b^i, i, 0, k -1) = > > 0.02], [b, k]); > > > > rat: replaced -0.1 by -1/10 = -0.1 > > > > rat: replaced -0.02 by -1/50 = -0.02 > > (%o9) [] > > > > Now, normally I would assume that this means that the system doesn't > > have a solution, but after substituting beta with its equivalent from > > the first equation, i.e 0.1 / (k - 1), I noticed that the evaluation > > of the second equation halts after a couple of steps: > > > > (%i5) solve([exp(-(k - 1) / 0.1) * sum(1/(i! * (0.1 / (k-1))^i), i, 0, > > k -1) = 0.02], [k]); > > > > rat: replaced -0.02 by -1/50 = -0.02 > > > > rat: replaced 0.1 by 1/10 = 0.1 > > > > rat: replaced 10.0 by 10/1 = 10.0 > > %i %pi > > ------ > > 5 > > 1 - k %e > > (%o5) [%e = -----------------------------------, > > k - 1 > > ==== i i > > 1/10 1/5 \ 10 (k - 1) 1/10 > > 2 5 ( > ------------) > > / i! > > ==== > > i = 0 > > 2 %i %pi > > -------- > > 5 > > 1 - k %e > > %e = -----------------------------------, > > k - 1 > > ==== i i > > 1/10 1/5 \ 10 (k - 1) 1/10 > > 2 5 ( > ------------) > > / i! > > ==== > > i = 0 > > 3 %i %pi > > -------- > > 5 > > 1 - k %e > > %e = -----------------------------------, > > k - 1 > > ==== i i > > 1/10 1/5 \ 10 (k - 1) 1/10 > > 2 5 ( > ------------) > > / i! > > ==== > > i = 0 > > 4 %i %pi > > -------- > > 5 > > 1 - k %e > > %e = -----------------------------------, > > k - 1 > > ==== i i > > 1/10 1/5 \ 10 (k - 1) 1/10 > > 2 5 ( > ------------) > > / i! > > ==== > > i = 0 > > 1 - k 1 > > %e = - -----------------------------------, > > k - 1 > > ==== i i > > 1/10 1/5 \ 10 (k - 1) 1/10 > > 2 5 ( > ------------) > > / i! > > ==== > > i = 0 > > 5 k - 4 %i %pi - 5 > > - ------------------ > > 5 1 > > %e = -----------------------------------, > > k - 1 > > ==== i i > > 1/10 1/5 \ 10 (k - 1) 1/10 > > 2 5 ( > ------------) > > / i! > > ==== > > i = 0 > > 5 k - 3 %i %pi - 5 > > - ------------------ > > 5 1 > > %e = -----------------------------------, > > k - 1 > > ==== i i > > 1/10 1/5 \ 10 (k - 1) 1/10 > > 2 5 ( > ------------) > > / i! > > ==== > > i = 0 > > 5 k - 2 %i %pi - 5 > > - ------------------ > > 5 1 > > %e = -----------------------------------, > > k - 1 > > ==== i i > > 1/10 1/5 \ 10 (k - 1) 1/10 > > 2 5 ( > ------------) > > / i! > > ==== > > i = 0 > > 5 k - %i %pi - 5 > > - ---------------- > > 5 1 > > %e = -----------------------------------, > > k - 1 > > ==== i i > > 1/10 1/5 \ 10 (k - 1) 1/10 > > 2 5 ( > ------------) > > / i! > > ==== > > i = 0 > > 1 - k 1 > > %e = -----------------------------------] > > k - 1 > > ==== i i > > 1/10 1/5 \ 10 (k - 1) 1/10 > > 2 5 ( > ------------) > > / i! > > ==== > > i = 0 > > > > And then if I try to "solve" it any further I get no solutions: > > > > (%i6) solve(%, [k]); > > (%o6) [] > > > > What am I doing wrong here? > > > > Thanks, > > > > Jason > > > > -- > > Jason Filippou > > Research Associate > > NCSR Demokritos > > NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ > > D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ > > LinkedIn! Profile: > http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro > > > > > > -- > > Jason Filippou > > Research Associate > > NCSR Demokritos > > NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ > > D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ > > LinkedIn! Profile: > http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro > > > > -- > Jason Filippou > Research Associate > NCSR Demokritos > NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ > D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ > LinkedIn! Profile: > http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jason.filippou at gmail.com Wed May 9 17:59:57 2012 From: jason.filippou at gmail.com (Jason Filippou) Date: Thu, 10 May 2012 01:59:57 +0300 Subject: [Maxima] Solving a two equation system yields strange results In-Reply-To: References: Message-ID: Thanks for the help. Indeed, even after changing eq1 into eq1 : b (k - 1) = a i ended up with a summation of parameterized terms in terms of a, and proceeded to do a number of substitutions of a which all appear to be minimized at 0.2. This concludes my Maxima - related questions for now, yet I am at a loss as to what these results mean regarding the statistical nature of my problem, as I mentioned it a couple of e-mails ago. I find it hard to believe that one cannot choose the mean of a distribution such that approximately 98% of its mass is bounded within [0,1]. Perhaps the fact that the minimization does not fall below the 0.2 indiates that I'm approaching my problem in the wrong way. Any pointers, perhaps? Regards, Jason On Thu, May 10, 2012 at 12:48 AM, Stavros Macrakis wrote: > As far as I know, 'solve' knows nothing about indexed sums, so Maxima will > treat your equation > > ? ?exp(-1/b) / sum(i! * b^i, i, 0, k -1) = 0.02 > > roughly the way it treats: > > ? ?exp(-1/b) / f(b,k) = 0.02 > > namely, not something that Maxima can do anything useful with.... > > However, you can work on this problem in the following simple way: > > (%i1) eq1: b*(k - 1) = 0.1$ > > I will express eq2 as its left-hand-side minus its right-hand-side for > convenience later. > > (%i2) eq2: exp(-1/b) * sum(1/(i! * b^i), i, 0, k -1) - 0.02$ > > (%i3) solve(eq1,b); > rat: replaced -0.1 by -1/10 = -0.1 > (%o3) [b=1/(10*k-10)] > (%i4) subst(%o3,eq2); > (%o4) %e^(10-10*k)*(sum((10*k-10)^i/i!,i,0,k-1))-0.02 > > Now we have an expression in one integer variable, so we can just evaluate > it at the relevant integers.... > > (%i9) makelist(subst(j,k,%o4),j,1,10); > (%o9) > [-0.02,%e^(-10)*(sum(10^i/i!,i,0,1))-0.02,%e^(-20)*(sum(20^i/i!,i,0,2))-0.02,%e^(-30)*(sum(30^i/i!,i,0,3))-0.02,%e^(-40)*(sum(40^i/i!,i,0,4))-0.02,%e^(-50)*(sum(50^i/i!,i,0,5))-0.02,%e^(-60)*(sum(60^i/i!,i,0,6))-0.02,%e^(-70)*(sum(70^i/i!,i,0,7))-0.02,%e^(-80)*(sum(80^i/i!,i,0,8))-0.02,%e^(-90)*(sum(90^i/i!,i,0,9))-0.02] > > Now expand the sums and calculate numerical results: > > (%i10) %,sum,numer; > (%o10) > [-0.02,-.01950060077261267,-.01999954448504944,-0.0199999995338968,-.01999999999949795,-.01999999999999945,-0.02,-0.02,-0.02,-0.02] > > It doesn't look as though this is ever near zero, so no solutions. > > ? ? ? ? ? ? -s > > > On Wed, May 9, 2012 at 2:47 PM, Jason Filippou > wrote: >> >> Pardon, the second equation (2) should read (as is implied by the >> output that I typed in): >> >> (%i7) exp(-1/b) * sum(1/(i! * b^i), i, 0, k -1) = 0.02; >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?k - 1 >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?==== >> ? ? ? ? ? ? ? ? ? ? ? ? ? ?- 1/b \ ? ? ? 1 >> (%o7) ? ? ? ? ? ? ? ? ? ? %e ? ? ? > ? ?----- = 0.02 >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?/ ? ? ?i >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?==== ?b ?i! >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?i = 0 >> >> >> >> Still no luck though. >> >> Jason >> >> On Wed, May 9, 2012 at 9:46 PM, Jason Filippou >> wrote: >> > Good afternoon. >> > >> > I've been using ?Maxima 5.21.1 in a Debian GNU / Linux 2.6.32-5-686 >> > system to solve a particular two equation system that I have to. The >> > system is as follows: >> > >> > (1): b*(k - 1) = 0.1 >> > >> > (2): exp(-1/b) / sum(i! * b^i, i, 0, k -1) = 0.02 >> > >> > I've been using solve/2 for this, but I've been returned an empty >> > solution set. Namely: >> > >> > %i9) solve([b * (k - 1) = 0.1, exp(-1/b) / sum(i! * b^i, i, 0, k -1) = >> > 0.02], [b, k]); >> > >> > rat: replaced -0.1 by -1/10 = -0.1 >> > >> > rat: replaced -0.02 by -1/50 = -0.02 >> > (%o9) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [] >> > >> > Now, normally I would assume that this means that the system doesn't >> > have a solution, but after substituting beta with its equivalent from >> > the first equation, i.e 0.1 / (k - 1), I noticed that the evaluation >> > of the second equation halts after a couple of steps: >> > >> > (%i5) solve([exp(-(k - 1) / 0.1) * sum(1/(i! * (0.1 / (k-1))^i), i, 0, >> > k -1) = 0.02], [k]); >> > >> > rat: replaced -0.02 by -1/50 = -0.02 >> > >> > rat: replaced 0.1 by 1/10 = 0.1 >> > >> > rat: replaced 10.0 by 10/1 = 10.0 >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?%i %pi >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?------ >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?5 >> > ? ? ? ? 1 - k ? ? ? ? ? ? ? ?%e >> > (%o5) [%e ? ? ?= -----------------------------------, >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? k - 1 >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ?i ? ? ? ?i >> > ? ? ? ? ? ? ? ? ?1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 >> > ? ? ? ? ? ? ? ? 2 ? ? 5 ? ?( > ? ?------------) >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? / ? ? ? ? ?i! >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? i = 0 >> > ? ? ? ? ? ? ? ? ? ? ? ?2 %i %pi >> > ? ? ? ? ? ? ? ? ? ? ? ?-------- >> > ? ? ? ? ? ? ? ? ? ? ? ? ? 5 >> > ?1 - k ? ? ? ? ? ? ? %e >> > %e ? ? ?= -----------------------------------, >> > ? ? ? ? ? ? ? ? ? ? ?k - 1 >> > ? ? ? ? ? ? ? ? ? ? ?==== ? ?i ? ? ? ?i >> > ? ? ? ? ? 1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 >> > ? ? ? ? ?2 ? ? 5 ? ?( > ? ?------------) >> > ? ? ? ? ? ? ? ? ? ? ?/ ? ? ? ? ?i! >> > ? ? ? ? ? ? ? ? ? ? ?==== >> > ? ? ? ? ? ? ? ? ? ? ?i = 0 >> > ? ? ? ? ? ? ? ? ? ? ? ?3 %i %pi >> > ? ? ? ? ? ? ? ? ? ? ? ?-------- >> > ? ? ? ? ? ? ? ? ? ? ? ? ? 5 >> > ?1 - k ? ? ? ? ? ? ? %e >> > %e ? ? ?= -----------------------------------, >> > ? ? ? ? ? ? ? ? ? ? ?k - 1 >> > ? ? ? ? ? ? ? ? ? ? ?==== ? ?i ? ? ? ?i >> > ? ? ? ? ? 1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 >> > ? ? ? ? ?2 ? ? 5 ? ?( > ? ?------------) >> > ? ? ? ? ? ? ? ? ? ? ?/ ? ? ? ? ?i! >> > ? ? ? ? ? ? ? ? ? ? ?==== >> > ? ? ? ? ? ? ? ? ? ? ?i = 0 >> > ? ? ? ? ? ? ? ? ? ? ? ?4 %i %pi >> > ? ? ? ? ? ? ? ? ? ? ? ?-------- >> > ? ? ? ? ? ? ? ? ? ? ? ? ? 5 >> > ?1 - k ? ? ? ? ? ? ? %e >> > %e ? ? ?= -----------------------------------, >> > ? ? ? ? ? ? ? ? ? ? ?k - 1 >> > ? ? ? ? ? ? ? ? ? ? ?==== ? ?i ? ? ? ?i >> > ? ? ? ? ? 1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 >> > ? ? ? ? ?2 ? ? 5 ? ?( > ? ?------------) >> > ? ? ? ? ? ? ? ? ? ? ?/ ? ? ? ? ?i! >> > ? ? ? ? ? ? ? ? ? ? ?==== >> > ? ? ? ? ? ? ? ? ? ? ?i = 0 >> > ?1 - k ? ? ? ? ? ? ? ? ? ? ?1 >> > %e ? ? ?= - -----------------------------------, >> > ? ? ? ? ? ? ? ? ? ? ? ?k - 1 >> > ? ? ? ? ? ? ? ? ? ? ? ?==== ? ?i ? ? ? ?i >> > ? ? ? ? ? ? 1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 >> > ? ? ? ? ? ?2 ? ? 5 ? ?( > ? ?------------) >> > ? ? ? ? ? ? ? ? ? ? ? ?/ ? ? ? ? ?i! >> > ? ? ? ? ? ? ? ? ? ? ? ?==== >> > ? ? ? ? ? ? ? ? ? ? ? ?i = 0 >> > ? ?5 k - 4 %i %pi - 5 >> > ?- ------------------ >> > ? ? ? ? ? ?5 ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 >> > %e ? ? ? ? ? ? ? ? ? ? = -----------------------------------, >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? k - 1 >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ?i ? ? ? ?i >> > ? ? ? ? ? ? ? ? ? ? ? ? ?1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 >> > ? ? ? ? ? ? ? ? ? ? ? ? 2 ? ? 5 ? ?( > ? ?------------) >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? / ? ? ? ? ?i! >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? i = 0 >> > ? ?5 k - 3 %i %pi - 5 >> > ?- ------------------ >> > ? ? ? ? ? ?5 ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 >> > %e ? ? ? ? ? ? ? ? ? ? = -----------------------------------, >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? k - 1 >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ?i ? ? ? ?i >> > ? ? ? ? ? ? ? ? ? ? ? ? ?1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 >> > ? ? ? ? ? ? ? ? ? ? ? ? 2 ? ? 5 ? ?( > ? ?------------) >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? / ? ? ? ? ?i! >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? i = 0 >> > ? ?5 k - 2 %i %pi - 5 >> > ?- ------------------ >> > ? ? ? ? ? ?5 ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 >> > %e ? ? ? ? ? ? ? ? ? ? = -----------------------------------, >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? k - 1 >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ?i ? ? ? ?i >> > ? ? ? ? ? ? ? ? ? ? ? ? ?1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 >> > ? ? ? ? ? ? ? ? ? ? ? ? 2 ? ? 5 ? ?( > ? ?------------) >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? / ? ? ? ? ?i! >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? i = 0 >> > ? ?5 k - %i %pi - 5 >> > ?- ---------------- >> > ? ? ? ? ? 5 ? ? ? ? ? ? ? ? ? ? ? ? ? ?1 >> > %e ? ? ? ? ? ? ? ? ? = -----------------------------------, >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? k - 1 >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== ? ?i ? ? ? ?i >> > ? ? ? ? ? ? ? ? ? ? ? ?1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 >> > ? ? ? ? ? ? ? ? ? ? ? 2 ? ? 5 ? ?( > ? ?------------) >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? / ? ? ? ? ?i! >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ==== >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? i = 0 >> > ?1 - k ? ? ? ? ? ? ? ? ? ?1 >> > %e ? ? ?= -----------------------------------] >> > ? ? ? ? ? ? ? ? ? ? ?k - 1 >> > ? ? ? ? ? ? ? ? ? ? ?==== ? ?i ? ? ? ?i >> > ? ? ? ? ? 1/10 ?1/5 ?\ ? ? 10 ?(k - 1) ?1/10 >> > ? ? ? ? ?2 ? ? 5 ? ?( > ? ?------------) >> > ? ? ? ? ? ? ? ? ? ? ?/ ? ? ? ? ?i! >> > ? ? ? ? ? ? ? ? ? ? ?==== >> > ? ? ? ? ? ? ? ? ? ? ?i = 0 >> > >> > And then if I try to "solve" it any further I get no solutions: >> > >> > (%i6) solve(%, [k]); >> > (%o6) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [] >> > >> > What am I doing wrong here? >> > >> > Thanks, >> > >> > Jason >> > >> > -- >> > Jason Filippou >> > Research Associate >> > NCSR Demokritos >> > NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ >> > D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ >> > LinkedIn! Profile: >> > http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro >> > >> > >> > -- >> > Jason Filippou >> > Research Associate >> > NCSR Demokritos >> > NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ >> > D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ >> > LinkedIn! Profile: >> > http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro >> >> >> >> -- >> Jason Filippou >> Research Associate >> NCSR Demokritos >> NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ >> D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ >> LinkedIn! Profile: >> http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > > -- Jason Filippou Research Associate NCSR Demokritos NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ LinkedIn! Profile: http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro From toy.raymond at gmail.com Wed May 9 21:50:13 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 09 May 2012 19:50:13 -0700 Subject: [Maxima] Solving a two equation system yields strange results In-Reply-To: References: Message-ID: <4FAB2CE5.6030508@gmail.com> On 5/9/12 3:59 PM, Jason Filippou wrote: > Thanks for the help. Indeed, even after changing eq1 into eq1 : b (k - > 1) = a i ended up with a summation of parameterized terms in terms of > a, and proceeded to do a number of substitutions of a which all appear > to be minimized at 0.2. > > This concludes my Maxima - related questions for now, yet I am at a > loss as to what these results mean regarding the statistical nature of > my problem, as I mentioned it a couple of e-mails ago. I find it hard > to believe that one cannot choose the mean of a distribution such that > approximately 98% of its mass is bounded within [0,1]. Perhaps the > fact that the minimization does not fall below the 0.2 indiates that > I'm approaching my problem in the wrong way. Let's see if I understand your question. You have a gamma distribution with parameter k and theta. You want to find k and theta such that the cdf is 98% for x = 1. That means the tail of the cdf is 2% so with maxima's gamma_incomplete function we have gamma_incomplete(k, 1/theta)/gamma(k) = .02 We also have theta*(k-1) = 0.1, or theta = 0.1/(k-1). Hence, gamma_incomplete(k, (k-1)/0.1) = 0.02. A quick plot shows that the root is somewhere between 1 and 2 and find_root(gamma_incomplete(k,(k-1)/0.1) - 0.02, k, 1, 2) -> 1.473593324038853 Does that sound right? I suspect there's no analytical solution so this might be the best you can do. Ray From toy.raymond at gmail.com Wed May 9 21:50:13 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 09 May 2012 19:50:13 -0700 Subject: [Maxima] Solving a two equation system yields strange results In-Reply-To: References: Message-ID: <4FAB2CE5.6030508@gmail.com> On 5/9/12 3:59 PM, Jason Filippou wrote: > Thanks for the help. Indeed, even after changing eq1 into eq1 : b (k - > 1) = a i ended up with a summation of parameterized terms in terms of > a, and proceeded to do a number of substitutions of a which all appear > to be minimized at 0.2. > > This concludes my Maxima - related questions for now, yet I am at a > loss as to what these results mean regarding the statistical nature of > my problem, as I mentioned it a couple of e-mails ago. I find it hard > to believe that one cannot choose the mean of a distribution such that > approximately 98% of its mass is bounded within [0,1]. Perhaps the > fact that the minimization does not fall below the 0.2 indiates that > I'm approaching my problem in the wrong way. Let's see if I understand your question. You have a gamma distribution with parameter k and theta. You want to find k and theta such that the cdf is 98% for x = 1. That means the tail of the cdf is 2% so with maxima's gamma_incomplete function we have gamma_incomplete(k, 1/theta)/gamma(k) = .02 We also have theta*(k-1) = 0.1, or theta = 0.1/(k-1). Hence, gamma_incomplete(k, (k-1)/0.1) = 0.02. A quick plot shows that the root is somewhere between 1 and 2 and find_root(gamma_incomplete(k,(k-1)/0.1) - 0.02, k, 1, 2) -> 1.473593324038853 Does that sound right? I suspect there's no analytical solution so this might be the best you can do. Ray From sarapashm at googlemail.com Thu May 10 02:57:25 2012 From: sarapashm at googlemail.com (Sara Pashmin) Date: Thu, 10 May 2012 09:57:25 +0200 Subject: [Maxima] Problem with running Message-ID: Hello, I run a maxima program parallel on two computers. The program consists of 3 loops, which the data (with a lot of if-conditions and equations) have to been run 76x101x101 times (I hope that I explain it in English clearly). The simulation on one of PCs was finished yesterday after 12 hours. On the other one the simulation has been run since 3 days but it seems to me that the simulation has been stopped but not broken. The both computers are new and have a very good performance. I tried the same simulation more than 5 times but every time was the same problem. There is no error message. I don't know ,what could be problem. Has anyone an idea? Thanks and best regards Sara From lluvia_lists at lavabit.com Thu May 10 05:29:51 2012 From: lluvia_lists at lavabit.com (lluvia_lists at lavabit.com) Date: Thu, 10 May 2012 06:29:51 -0400 (EDT) Subject: [Maxima] Building a web interface similar to wolframalpha Message-ID: <37794.151.49.163.193.1336645791.squirrel@lavabit.com> Hi, Do you know about some efforts of making a free alternative to wolframalpha.com with maxima as engine? (I suppose tha maxima is the best candidate, at least for simbolic calculations) Sincerely, I prefer the philosophy of having installed the programs in your computer instead of using internet for solving your needs, but sometimes it is useful to use software as a service, for example, when you are away from your computer and you need to use other computer for making calcs, and it is not good to install that computer ~100MB of software temporally. For this cases, I consider that having a website under a free license as the AFERO is a good idea. It could be good relaxing the matched as correct sintax of the input, or suggest what you may mean. Also to give as output the exact command that would generate that answer in your installed maxima. Thanks for your experience. Daniel From willisb at unk.edu Thu May 10 07:01:43 2012 From: willisb at unk.edu (Barton Willis) Date: Thu, 10 May 2012 12:01:43 +0000 Subject: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia Message-ID: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com> With GCL: (%i63) cos(1.0d97); (%o63) 0.44800964805919 With Julia or Clozure CL: julia> cos(1.0e97) 0.7496172085944125 $ wx86cl64 Welcome to Clozure Common Lisp Version 1.8-r15286M (WindowsX8664)! ? (cos 1.0d97) 0.7496172085944125D0 And bigfloats: (%i60) cos(1.0b97), fpprec : 2000; (%o60) -7.0797267715593222213703559504[1944 digits]888604264163488232493341331b-2 Let me guess that Clozure & Julia turn the calculation entirely over to the (Intel) microprocessor. What on earth does GCL do? Is this a binary32 / binary64 confusion problem? No, I'm not surprised that the Clozure & Julia values are likely completely wrong--it just makes me wonder what GCL is doing. --bw From kcrisman at gmail.com Thu May 10 07:28:58 2012 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Thu, 10 May 2012 08:28:58 -0400 Subject: [Maxima] Building a web interface similar to wolframalpha Message-ID: > ------------------------------ > > Message: 5 > Date: Thu, 10 May 2012 06:29:51 -0400 (EDT) > From: lluvia_lists at lavabit.com > To: maxima at math.utexas.edu > Subject: [Maxima] Building a web interface similar to wolframalpha > Message-ID: <37794.151.49.163.193.1336645791.squirrel at lavabit.com> > Content-Type: text/plain;charset=iso-8859-1 > > Hi, > > Do you know about some efforts of making a free alternative to > wolframalpha.com with maxima as engine? (I suppose tha maxima is the best > candidate, at least for simbolic calculations) See http://maxima.sourceforge.net/relatedprojects.html for some (scroll to Web interfaces running Maxima) for some things. I assume here that the natural language interface is not as important currently. Although it doesn't have natural language interface (see http://www.molto-project.eu/wiki/living-deliverables/d62-prototype-comanding-cas/gfsage-natural-language-interface-sage for something along these lines) there does exist also the Sage cell server, which would allow things like this: http://aleph.sagemath.org/?q=4ae1fc8a-8681-4d65-a6ed-4426576ea53e using Maxima. Eventually one should be able to do %maxima but I think that hasn't been ported from Sage proper yet. From jason.filippou at gmail.com Thu May 10 08:39:14 2012 From: jason.filippou at gmail.com (Jason Filippou) Date: Thu, 10 May 2012 16:39:14 +0300 Subject: [Maxima] Solving a two equation system yields strange results In-Reply-To: <4FAB2CE5.6030508@gmail.com> References: <4FAB2CE5.6030508@gmail.com> Message-ID: It sounds right, and, to the best of my knowledge, works right. find_root(gamma_incomplete(k, k/0.2)/gamma(k) - 0.02, k, 0.1, 13); (%o41) 0.58985858280192 find_root(gamma_incomplete(k, k/0.3)/gamma(k) - 0.02, k, 1, 10); (%o42) 1.442704964541916 Thanks a mil, Jason On Thu, May 10, 2012 at 5:50 AM, Raymond Toy wrote: > On 5/9/12 3:59 PM, Jason Filippou wrote: >> Thanks for the help. Indeed, even after changing eq1 into eq1 : b (k - >> 1) = a i ended up with a summation of parameterized terms in terms of >> a, and proceeded to do a number of substitutions of a which all appear >> to be minimized at 0.2. >> >> This concludes my Maxima - related questions for now, yet I am at a >> loss as to what these results mean regarding the statistical nature of >> my problem, as I mentioned it a couple of e-mails ago. I find it hard >> to believe that one cannot choose the mean of a distribution such that >> approximately 98% of its mass is bounded within [0,1]. Perhaps the >> fact that the minimization does not fall below the 0.2 indiates that >> I'm approaching my problem in the wrong way. > > Let's see if I understand your question. > > You have a gamma distribution with parameter k and theta. ?You want to > find k and theta such that the cdf is 98% for x = 1. ?That means the > tail of the cdf is 2% so with maxima's gamma_incomplete function we have > > gamma_incomplete(k, 1/theta)/gamma(k) = .02 > > We also have theta*(k-1) = 0.1, or theta = 0.1/(k-1). ?Hence, > > gamma_incomplete(k, (k-1)/0.1) = 0.02. > > A quick plot shows that the root is somewhere between 1 and 2 and > > find_root(gamma_incomplete(k,(k-1)/0.1) - 0.02, k, 1, 2) > -> 1.473593324038853 > > Does that sound right? ?I suspect there's no analytical solution so this > might be the best you can do. > > Ray > It does sound right, and it also appears to behave right. -- Jason Filippou Research Associate NCSR Demokritos NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/ D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/ LinkedIn! Profile: http://www.linkedin.com/profile/view?id=132927442&trk=tab_pro From toy.raymond at gmail.com Thu May 10 08:54:47 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 10 May 2012 06:54:47 -0700 Subject: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com> References: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: <4FABC8A7.8070203@gmail.com> On 5/10/12 5:01 AM, Barton Willis wrote: > With GCL: > > (%i63) cos(1.0d97); > (%o63) 0.44800964805919 > > With Julia or Clozure CL: > > julia> cos(1.0e97) > 0.7496172085944125 > > $ wx86cl64 > Welcome to Clozure Common Lisp Version 1.8-r15286M (WindowsX8664)! > ? (cos 1.0d97) > 0.7496172085944125D0 > > And bigfloats: > > (%i60) cos(1.0b97), fpprec : 2000; > (%o60) -7.0797267715593222213703559504[1944 digits]888604264163488232493341331b-2 > > Let me guess that Clozure & Julia turn the calculation entirely over to the (Intel) microprocessor. What on earth does GCL do? > Is this a binary32 / binary64 confusion problem? > > No, I'm not surprised that the Clozure & Julia values are likely completely wrong--it just makes me wonder what GCL is doing. There are a few issues here. First, Lisp has to read 1d97 and convert that to a float. That could account for all of the difference. Second is how range reduction is done. Third, 1b97 is not the same as 1d97. Try cos(bfloat(1d97)); the result from maxima will match ccl very closely. I suspect that the intel fsin (fcos?) instruction is not used. Any number above 2^63 (~ 1.8d19) is too large for that instruction and I think it just returns 0. (I think.) The chip only has about 66 bits of pi for range reduction. I don't know about ccl, but cmucl does accurate range reduction using upto 1500 (?) bits of pi. It may also happen that the other lisps call the C library, which may also do accurate range reduction using many bits of pi. Perhaps a better test would be (cos (scale-float 1d0 120)). There should be no problems reading 1d0 in any lisp. Ray From toy.raymond at gmail.com Thu May 10 08:54:47 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 10 May 2012 06:54:47 -0700 Subject: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com> References: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: <4FABC8A7.8070203@gmail.com> On 5/10/12 5:01 AM, Barton Willis wrote: > With GCL: > > (%i63) cos(1.0d97); > (%o63) 0.44800964805919 > > With Julia or Clozure CL: > > julia> cos(1.0e97) > 0.7496172085944125 > > $ wx86cl64 > Welcome to Clozure Common Lisp Version 1.8-r15286M (WindowsX8664)! > ? (cos 1.0d97) > 0.7496172085944125D0 > > And bigfloats: > > (%i60) cos(1.0b97), fpprec : 2000; > (%o60) -7.0797267715593222213703559504[1944 digits]888604264163488232493341331b-2 > > Let me guess that Clozure & Julia turn the calculation entirely over to the (Intel) microprocessor. What on earth does GCL do? > Is this a binary32 / binary64 confusion problem? > > No, I'm not surprised that the Clozure & Julia values are likely completely wrong--it just makes me wonder what GCL is doing. There are a few issues here. First, Lisp has to read 1d97 and convert that to a float. That could account for all of the difference. Second is how range reduction is done. Third, 1b97 is not the same as 1d97. Try cos(bfloat(1d97)); the result from maxima will match ccl very closely. I suspect that the intel fsin (fcos?) instruction is not used. Any number above 2^63 (~ 1.8d19) is too large for that instruction and I think it just returns 0. (I think.) The chip only has about 66 bits of pi for range reduction. I don't know about ccl, but cmucl does accurate range reduction using upto 1500 (?) bits of pi. It may also happen that the other lisps call the C library, which may also do accurate range reduction using many bits of pi. Perhaps a better test would be (cos (scale-float 1d0 120)). There should be no problems reading 1d0 in any lisp. Ray From willisb at unk.edu Thu May 10 09:35:54 2012 From: willisb at unk.edu (Barton Willis) Date: Thu, 10 May 2012 14:35:54 +0000 Subject: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: <4FABC8A7.8070203@gmail.com> References: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com>, <4FABC8A7.8070203@gmail.com> Message-ID: <83FD4DC40F97654495E2C9AED47658360422EA1B@BL2PRD0710MB361.namprd07.prod.outlook.com> Thanks for the information. I didn't know that fsin/fcos only really work on numbers with magnitude less than about 2^63. What lead me to this experiment was the statement on the Julia Language page about numerical accuracy (second sentence on http://julialang.org/). I suppose Maxima's numerical sine, cosine, and ... could look for out for binary64 inputs outside +/- 2^63. --bw >I suspect that the intel fsin (fcos?) instruction is not used. Any >number above 2^63 (~ 1.8d19) is too large for that instruction and I >think it just returns 0. (I think.) >Ray From mxue at vroomlab.com Thu May 10 10:00:37 2012 From: mxue at vroomlab.com (Michael) Date: Thu, 10 May 2012 15:00:37 +0000 (UTC) Subject: [Maxima] Building a web interface similar to wolframalpha References: Message-ID: You may check out these Web Applications: http://www.vroomlab.com A quick reference guide is at : http://www.vroomlab.com/nhome/qr.jsp There is also a maxima-based integrator that displays result using LaTex: http://www.vroomlab.com:8081/xint Make sure your firewall does not block connections to unstandard port. Have fun! From michael.soegtrop at intel.com Thu May 10 10:26:39 2012 From: michael.soegtrop at intel.com (Soegtrop, Michael) Date: Thu, 10 May 2012 15:26:39 +0000 Subject: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: <83FD4DC40F97654495E2C9AED47658360422EA1B@BL2PRD0710MB361.namprd07.prod.outlook.com> References: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com>, <4FABC8A7.8070203@gmail.com> <83FD4DC40F97654495E2C9AED47658360422EA1B@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: <0F7D3B1B3C4B894D824F5B822E3E5A1706A6CEB1@IRSMSX102.ger.corp.intel.com> Dear Barton, this isn't a problem of the fsin/fcos implementation. For calculating a sine function you need a certain absolute precision. E.g. if you want to have 2 decimals output precision, your number must have an absolute precision of 2 decimals. Floating point numbers have constant relative precision. So the larger the number gets, the worse the absolute precision becomes. If the absolute precision is worse than pi, the result is simply meaningless. Imagine you have the number 1000000000000 with error +-1000. The relative error is quite small (1ppb), but the absolute error is more than 100*pi. The result is meaningless. I once did a floating point implementation which takes this into account, and simply gives you ? as result on such computations. It does this by not normalizing after subtractions, so that the mantissa contains information about the number of valid bits. This might be a nice thing to have in maxima as well. Instead of garbage numbers, return ?. Best regards, Michael -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Barton Willis Sent: Thursday, May 10, 2012 4:36 PM To: Raymond Toy Cc: maxima at math.utexas.edu Subject: Re: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia Thanks for the information. I didn't know that fsin/fcos only really work on numbers with magnitude less than about 2^63. What lead me to this experiment was the statement on the Julia Language page about numerical accuracy (second sentence on http://julialang.org/). I suppose Maxima's numerical sine, cosine, and ... could look for out for binary64 inputs outside +/- 2^63. --bw >I suspect that the intel fsin (fcos?) instruction is not used. Any >number above 2^63 (~ 1.8d19) is too large for that instruction and I >think it just returns 0. (I think.) >Ray _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From toy.raymond at gmail.com Thu May 10 10:57:02 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 10 May 2012 08:57:02 -0700 Subject: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: <83FD4DC40F97654495E2C9AED47658360422EA1B@BL2PRD0710MB361.namprd07.prod.outlook.com> References: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com> <4FABC8A7.8070203@gmail.com> <83FD4DC40F97654495E2C9AED47658360422EA1B@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: On Thu, May 10, 2012 at 7:35 AM, Barton Willis wrote: > Thanks for the information. I didn't know that fsin/fcos only really work > on numbers with magnitude less than about 2^63. What lead me to this > experiment was the statement on the Julia Language page about numerical > accuracy (second sentence on http://julialang.org/). I suppose Maxima's > numerical sine, cosine, and ... could look for out for binary64 inputs > outside +/- 2^63. > > The instruction accepts any floating-point number and returns something. And actually it's worse than that. Since the fpu only has about 66 bits of pi, range reduction of 2^63 leaves only about 2-3 bits left, which just gives you a value of sin accurate to the nearest octant or so. Contrast this with Sun's libm (which might also be used in glibc sse). It has 1100 or so bits of pi so range reduction will still produce 53 bits of accuracy so the computed value has full precision. I don't have gcl around, but it might be informative to see what gcl returns for (integer-decode-float 1d97) versus what ccl or cmucl returns for (integer-decode-float 1d97). (Both return 5271098971615262, 270, 1.) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Thu May 10 11:04:12 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 10 May 2012 09:04:12 -0700 Subject: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A1706A6CEB1@IRSMSX102.ger.corp.intel.com> References: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com> <4FABC8A7.8070203@gmail.com> <83FD4DC40F97654495E2C9AED47658360422EA1B@BL2PRD0710MB361.namprd07.prod.outlook.com> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6CEB1@IRSMSX102.ger.corp.intel.com> Message-ID: On Thu, May 10, 2012 at 8:26 AM, Soegtrop, Michael < michael.soegtrop at intel.com> wrote: > Dear Barton, > > this isn't a problem of the fsin/fcos implementation. For calculating a > sine function you need a certain absolute precision. E.g. if you want to > have 2 decimals output precision, your number must have an absolute > precision of 2 decimals. Floating point numbers have constant relative > precision. So the larger the number gets, the worse the absolute precision > becomes. If the absolute precision is worse than pi, the result is simply > meaningless. Imagine you have the number 1000000000000 with error +-1000. > The relative error is quite small (1ppb), but the absolute error is more > than 100*pi. The result is meaningless. > I disagree with this analysis. If I want (cos (scale-float 1d0 120)) (from one of Kahan's examples), cos should return the correct value. Sure you can argue that 2^120 (as a float) is some kind of approximation, but, as I've constructed, I want exactly 2^120, which happens to be exactly representable in a double-float. I want cos to return the value as accurately as possible given the input. Any supposed "error" in a floating-point number is up to the user to decide, The cos function should accept it as an exact number and produce a value based on that. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From yasuaki.honda at gmail.com Thu May 10 11:42:33 2012 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Fri, 11 May 2012 01:42:33 +0900 Subject: [Maxima] Maxima on Android Message-ID: Dear all, I am not sure how many of you may be interested in, but I have ported Maxima to the Google's Android operating system. https://sites.google.com/site/maximaonandroid/ This is still a hack. No APK is available form Google play. You download the source tarball of Maxima on Android. Then, you need to use ADB to install Maxima source code on your mobile device. Also you may want to install any terminal emulator software on your Android mobile device to run Maxima. I used ECL which was already ported to Maxima while ago. Thanks to ECL, it was just a matter of three or four files with small modifications. If you want to try, visit the above site and follow the instructions. Enjoy!! Yasuaki Honda, Chiba, Japan -------------- next part -------------- An HTML attachment was scrubbed... URL: From biomates at telefonica.net Thu May 10 14:13:00 2012 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 10 May 2012 21:13:00 +0200 Subject: [Maxima] Building a web interface similar to wolframalpha In-Reply-To: References: Message-ID: <1336677180.4358.2.camel@pc> > See http://maxima.sourceforge.net/relatedprojects.html for some > (scroll to Web interfaces running Maxima) for some things. I assume > here that the natural language interface is not as important > currently. > > Although it doesn't have natural language interface (see > http://www.molto-project.eu/wiki/living-deliverables/d62-prototype-comanding-cas/gfsage-natural-language-interface-sage > for something along these lines) there does exist also the Sage cell > server, which would allow things like this: > > http://aleph.sagemath.org/?q=4ae1fc8a-8681-4d65-a6ed-4426576ea53e > > using Maxima. Eventually one should be able to do > > %maxima > > > but I think that hasn't been ported from Sage proper yet. My 0.02 Euro to this subject: http://yamwi.sourceforge.net -- Mario From mxue at vroomlab.com Thu May 10 14:26:44 2012 From: mxue at vroomlab.com (Michael) Date: Thu, 10 May 2012 19:26:44 +0000 (UTC) Subject: [Maxima] Maxima on Android References: Message-ID: Thought you might to interested in this too: http://www.vroomlab.com It can be accessed from android through its browser. Have fun. -michael From vi5u0-maxima at yahoo.co.uk Thu May 10 14:51:21 2012 From: vi5u0-maxima at yahoo.co.uk (Dan) Date: Thu, 10 May 2012 20:51:21 +0100 (BST) Subject: [Maxima] Maxima on Android In-Reply-To: References: Message-ID: On Fri, 11 May 2012, ???? wrote: > I am not sure how many of you may be interested in, but I have ported Maxima > to the Google's Android operating system. > > https://sites.google.com/site/maximaonandroid/ > > This is still a hack. No APK is available form Google play. You download > the source tarball of Maxima on Android. Then, you need to use ADB to > install > Maxima source code on your mobile device. Also you may want to install > any terminal emulator software on your Android mobile device to run Maxima. > > I used ECL which was already ported to Maxima while ago. Thanks to ECL, > it was just a matter of three or four files with small modifications. Thanks, that's interesting. I've been trying to get Maxima on Android for a while. At the moment, I have a Debian install in a chroot on my Android phone, as described at . Maxima runs fine in that Debian install, and I've tried a few simple calculations successfully. But the testsuite seems to be absent, and apt-get claims to be unable to locate the maxima-test package. From lluvia_lists at lavabit.com Thu May 10 15:32:54 2012 From: lluvia_lists at lavabit.com (lluvia) Date: Thu, 10 May 2012 22:32:54 +0200 Subject: [Maxima] Building a web interface similar to wolframalpha In-Reply-To: <1336677180.4358.2.camel@pc> References: <1336677180.4358.2.camel@pc> Message-ID: <20120510223254.479cf0f0@myhost> On Thu, 10 May 2012 21:13:00 +0200 Mario Rodriguez wrote: > > > See http://maxima.sourceforge.net/relatedprojects.html for some > > (scroll to Web interfaces running Maxima) for some things. I assume > > here that the natural language interface is not as important > > currently. > > Although it doesn't have natural language interface (see > > http://www.molto-project.eu/wiki/living-deliverables/d62-prototype-comanding-cas/gfsage-natural-language-interface-sage > > for something along these lines) there does exist also the Sage cell > > server, which would allow things like this: > > > > http://aleph.sagemath.org/?q=4ae1fc8a-8681-4d65-a6ed-4426576ea53e > > > > using Maxima. Thanks a lot! > > My 0.02 Euro to this subject: > > http://yamwi.sourceforge.net You really undervalue your spirit and time :D. From fateman at eecs.berkeley.edu Thu May 10 18:40:09 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 10 May 2012 16:40:09 -0700 Subject: [Maxima] Maxima Lapack is very slow: 7 seconds versus 0.002 seconds in Julia. In-Reply-To: References: <1336228614.51112.YahooMailClassic@web132504.mail.ird.yahoo.com> <1336233631.74042.YahooMailClassic@web132503.mail.ird.yahoo.com> <4FA59881.1040800@gmail.com> Message-ID: <4FAC51D9.1030406@eecs.berkeley.edu> On 5/7/2012 10:03 PM, Robert Dodier wrote: > On 2012-05-05, Raymond Toy wrote: >> On 5/5/12 9:00 AM, Manuel Pedrinero rossetil wrote: >>> Perhaps the efforts in linear algebra of Rosseti, Tamas, Raymond, >>> Liliam (gsl), Luis Oliveira. (cffi) and others could be ported to maxima >>> or some interface via cffi between Julia and maxima could be very >>> interesting. There also some Lispers that use Lisp and R (for example >>> C. Rhodes) . Improving the numeric capabilities of maxima could appeal >>> to more people and communities. >> Let us not lose sight of what maxima is. It is a computer algebra >> system, not a numerical evaluation system. There are many of those already. > Well, we don't have to choose one or the other. Ideally Maxima would > combine symbolic and numerical capabilities. Given the history of the > project and the people working on it, there's more emphasis on symbolic > stuff. But there's no reason to rule out expanded numerical functions, > and in fact we have made good progress over the past several years. > (Special thanks to you, Ray, for that.) > > best > > Robert Dodier > We've had a discussion of this type repeatedly over the years. There is a contrary point of view which is that -- if you are "merely" doing X (say, numerical computation,) you are better off using a system that is designed and optimized for X, and does not include Y, Z etc. Reasons: You do not have to learn about Y, Z, etc. You do not have to wade through documentation about Y, Z, etc and try to figure out if it also affects X. The programmer of a system can make contextual judgments that pertain to X but not Y, or Z. (e.g. Is x^0.5 identical to sqrt(x)? Is there a smallest non-zero floating-point number? Do all scalar data objects fit in a 64-bit [or smaller] space? Are all numerical objects potentially complex? Are all matrix objects fixed in size at the time they are created? etc etc). The X only system can be faster, more portable, more parallelizable, easier to document and explain. I am generally of the opinion that a user of Maxima who wants to use (say) Lapack, should have it available. BUT, If someone who has no interest or understanding of issues that come up in symbolic math complains about Maxima's failure to do a purely numerical task fast enough (like root-finding of a one-variable floating point formula or linear equation solving), my reaction is to suggest that the user use (say) Matlab or a free Matlab clone. This not only solves the person's problems more expeditiously, it doesn't involve him/her in being "educated" about symbolic systems by readers and writers to this newsgroup. RJF From fateman at eecs.berkeley.edu Thu May 10 18:59:32 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 10 May 2012 16:59:32 -0700 Subject: [Maxima] Building a web interface similar to wolframalpha In-Reply-To: <20120510223254.479cf0f0@myhost> References: <1336677180.4358.2.camel@pc> <20120510223254.479cf0f0@myhost> Message-ID: <4FAC5664.5010005@eecs.berkeley.edu> If you are interested in a parser with much relaxed syntax, look at the one in tilu. Tilu also includes a web server, and , being written in lisp, could fairly easily include maxima as part of its service. for a start, see http://www.cs.berkeley.edu/~fateman/papers/webmath.pdf From fateman at eecs.berkeley.edu Thu May 10 19:21:08 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 10 May 2012 17:21:08 -0700 Subject: [Maxima] Fwd: Re: cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: <4FAC5B2E.70906@eecs.berkeley.edu> References: <4FAC5B2E.70906@eecs.berkeley.edu> Message-ID: <4FAC5B74.2020108@eecs.berkeley.edu> -------- Original Message -------- Subject: Re: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia Date: Thu, 10 May 2012 17:19:58 -0700 From: Richard Fateman To: Barton Willis On 5/10/2012 5:01 AM, Barton Willis wrote: > With GCL: > > (%i63) cos(1.0d97); > (%o63) 0.44800964805919 > > With Julia or Clozure CL: > > julia> cos(1.0e97) > 0.7496172085944125 > > $ wx86cl64 > Welcome to Clozure Common Lisp Version 1.8-r15286M (WindowsX8664)! > ? (cos 1.0d97) > 0.7496172085944125D0 > > And bigfloats: > > (%i60) cos(1.0b97), fpprec : 2000; > (%o60) -7.0797267715593222213703559504[1944 digits]888604264163488232493341331b-2 > > Let me guess that Clozure& Julia turn the calculation entirely over to the (Intel) microprocessor. What on earth does GCL do? > Is this a binary32 / binary64 confusion problem? > > No, I'm not surprised that the Clozure& Julia values are likely completely wrong--it just makes me wonder what GCL is doing. > > --bw > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Maxima says 6.352949290110150372337895080118015434113381369350... b-1 and actually you don't need extravagant extra precision. All you need is enough precision to exactly represent 1.0b97. So fpprec:97 does fine. If fpprec is 20, you are computing cosine of 9999999999999999999986855440896063627350130660722318322605057839705205096078837019768675641589760 ... The bigfloat cosine routine figures that it needs about 194 digits of pi to reduce the given argument accurately into the range [-pi/8, pi/8] or thereabouts. Then a taylor series works. Julia (etc.) presumably make an error in the representation of the original input. Intel (etc) know how to do the range reduction, I think. e.g. see http://www.researchgate.net/publication/3798381_New_algorithms_for_improved_transcendental_functions_on_IA-64 -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Thu May 10 20:27:46 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 11 May 2012 01:27:46 +0000 (UTC) Subject: [Maxima] Second windows installer for maxima 5.27.0 References: <4FAA72DF.8020209@gmail.com> Message-ID: On 2012-05-09, David Billinghurst wrote: > There is a new windows installer at > http://billinghurst.customer.netspace.net.au/maxima-5.27.0.exe Thanks, David. I've uploaded this new version to the SF file manager as maxima-5.27.0-1.exe. See: http://sourceforge.net/projects/maxima/files best Robert Dodier From robert.dodier at gmail.com Thu May 10 20:34:13 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 11 May 2012 01:34:13 +0000 (UTC) Subject: [Maxima] Problem with running References: Message-ID: On 2012-05-10, Sara Pashmin wrote: > I run a maxima program parallel on two computers. > The program consists of 3 loops, which the data (with a lot of > if-conditions and equations) have to been run 76x101x101 times (I hope > that I explain it in English clearly). > > The simulation on one of PCs was finished yesterday after 12 hours. On > the other one the simulation has been run since 3 days but it seems to > me that the simulation has been stopped but not broken. Sara, you'll have to provide some additional information in order for others to understand the problem. What is the output of build_info() on each computer? What is the program which you are running? Without understanding anything, my first suggestion is to print the loop index and any other relevant data in the outer loop (the 76 x loop), so that you can see if you're making progress. Second suggestion is to break up the whole computation so that you don't have to run the whole thing in one pass. For example: load the current state for the outer loop, run the inner loops, save the current state, then exit Maxima. Then if you have to kill the program, you haven't lost much, and you can review the saved states. Those are just some ideas that can be helpful when making long computations. best Robert Dodier From toy.raymond at gmail.com Thu May 10 21:27:16 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 10 May 2012 19:27:16 -0700 Subject: [Maxima] Fwd: Re: cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: <4FAC5B74.2020108@eecs.berkeley.edu> References: <4FAC5B2E.70906@eecs.berkeley.edu> <4FAC5B74.2020108@eecs.berkeley.edu> Message-ID: <4FAC7904.3050006@gmail.com> On 5/10/12 5:21 PM, Richard Fateman wrote: > Julia (etc.) presumably make an error in the representation of the > original input. > Intel (etc) know how to do the range reduction, I think. > > e.g. see > http://www.researchgate.net/publication/3798381_New_algorithms_for_improved_transcendental_functions_on_IA-64 Indeed. If you follow that reference you can get the actual paper at http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.27.2080&rep=rep1&type=pdf. In brief the ia-64 architecture uses about 190 bits of pi/2, so that arguments up to 2^63 can be reduced to full precision. I'm pretty sure the old ia-32 arch only had 66 bits of pi. Doesn't help, of course, if you want numbers like 1d97. :-) Ray From toy.raymond at gmail.com Thu May 10 21:27:16 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 10 May 2012 19:27:16 -0700 Subject: [Maxima] Fwd: Re: cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: <4FAC5B74.2020108@eecs.berkeley.edu> References: <4FAC5B2E.70906@eecs.berkeley.edu> <4FAC5B74.2020108@eecs.berkeley.edu> Message-ID: <4FAC7904.3050006@gmail.com> On 5/10/12 5:21 PM, Richard Fateman wrote: > Julia (etc.) presumably make an error in the representation of the > original input. > Intel (etc) know how to do the range reduction, I think. > > e.g. see > http://www.researchgate.net/publication/3798381_New_algorithms_for_improved_transcendental_functions_on_IA-64 Indeed. If you follow that reference you can get the actual paper at http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.27.2080&rep=rep1&type=pdf. In brief the ia-64 architecture uses about 190 bits of pi/2, so that arguments up to 2^63 can be reduced to full precision. I'm pretty sure the old ia-32 arch only had 66 bits of pi. Doesn't help, of course, if you want numbers like 1d97. :-) Ray From sarapashm at googlemail.com Fri May 11 02:16:29 2012 From: sarapashm at googlemail.com (Sara Pashmineh) Date: Fri, 11 May 2012 09:16:29 +0200 Subject: [Maxima] Problem with running In-Reply-To: References: Message-ID: Hello Robert, thank you very much for your answer. The program is only Maxima codes consists of 3 loops (inside of the 3. loop consists of a lot of if-conditions and equations). The build_info() of the computer, in which the simulation has not been finished is: Maxima version: 5.23.2 Maxima build date: 15:35 2/4/2011 Host type: x86_64-redhat-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.38-3.el6 and build_info() of another one, in which the simulation was finished successful is: Maxima version: 5.25.2 Maxima build date: 2:7 11/25/2011 Host type: x86_64-unknown-linux-gnu Lisp implementation type: CLISP Lisp implementation version: 2.49 (2010-07-07) (built on build05 [127.0.0.1]). I will try , what you recommended me. Thanks again. Best Regards Sara 2012/5/11 Robert Dodier : > On 2012-05-10, Sara Pashmin wrote: > >> I run a maxima program parallel on two computers. >> The program consists of 3 loops, which the data (with a lot of >> if-conditions and equations) have to been run 76x101x101 times (I hope >> that I explain it in English clearly). >> >> The simulation on one of PCs was finished yesterday after 12 hours. On >> the other one the simulation has been run since 3 days but it seems to >> me that the simulation has been stopped but not broken. > > Sara, you'll have to provide some additional information in order for > others to understand the problem. What is the output of build_info() on > each computer? What is the program which you are running? > > Without understanding anything, my first suggestion is to print the loop > index and any other relevant data in the outer loop (the 76 x loop), so > that you can see if you're making progress. > > Second suggestion is to break up the whole computation so that you don't > have to run the whole thing in one pass. For example: load the current > state for the outer loop, run the inner loops, save the current state, > then exit Maxima. Then if you have to kill the program, you haven't lost > much, and you can review the saved states. > > Those are just some ideas that can be helpful when making long > computations. > > best > > Robert Dodier > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From michael.soegtrop at intel.com Fri May 11 03:23:42 2012 From: michael.soegtrop at intel.com (Soegtrop, Michael) Date: Fri, 11 May 2012 08:23:42 +0000 Subject: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: References: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com> <4FABC8A7.8070203@gmail.com> <83FD4DC40F97654495E2C9AED47658360422EA1B@BL2PRD0710MB361.namprd07.prod.outlook.com> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6CEB1@IRSMSX102.ger.corp.intel.com> Message-ID: <0F7D3B1B3C4B894D824F5B822E3E5A1706A6D29A@IRSMSX102.ger.corp.intel.com> Dear Ray, I slept over your arguments, but I still think they are not right. The problem I see is that floating point numbers can have very large exponents, e.g. more than 1000 binary digits for IEEE double precision. So worst case you need to do a range reduction with a precision of about 1000 bits for a floating point format with 53 bits mantissa. The effort for doing the range reduction, essentially a modulus operation, is quadratic (well there are asymptotically faster methods, but I think with SIMD and 1000 bits, the quadratic method is still best), so we have worst case ~400 times the effort, if we assume that numbers are precise. The question is, if this effort is worthwhile. I think no, because I think it is very unlikely, that the result of some computation has a higher precision than the mantissa. The use case of literal numbers is a bit artificial and not really what floating point numbers are made for. One argument for this is that it would be easy to detect if results are exact and add a corresponding flag to floating point numbers. But this is typically not done, so one can assume that processing of exact numbers is not the intention. So I think, if you need high precision, you should use a high precision floating point implementation. Best regards, Michael From: Raymond Toy [mailto:toy.raymond at gmail.com] Sent: Thursday, May 10, 2012 6:04 PM To: Soegtrop, Michael Cc: Barton Willis; maxima at math.utexas.edu Subject: Re: cos(1.0d97) with GCL, Clozure, and Julia On Thu, May 10, 2012 at 8:26 AM, Soegtrop, Michael > wrote: Dear Barton, this isn't a problem of the fsin/fcos implementation. For calculating a sine function you need a certain absolute precision. E.g. if you want to have 2 decimals output precision, your number must have an absolute precision of 2 decimals. Floating point numbers have constant relative precision. So the larger the number gets, the worse the absolute precision becomes. If the absolute precision is worse than pi, the result is simply meaningless. Imagine you have the number 1000000000000 with error +-1000. The relative error is quite small (1ppb), but the absolute error is more than 100*pi. The result is meaningless. I disagree with this analysis. If I want (cos (scale-float 1d0 120)) (from one of Kahan's examples), cos should return the correct value. Sure you can argue that 2^120 (as a float) is some kind of approximation, but, as I've constructed, I want exactly 2^120, which happens to be exactly representable in a double-float. I want cos to return the value as accurately as possible given the input. Any supposed "error" in a floating-point number is up to the user to decide, The cos function should accept it as an exact number and produce a value based on that. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From mxue at vroomlab.com Fri May 11 08:44:53 2012 From: mxue at vroomlab.com (Michael) Date: Fri, 11 May 2012 13:44:53 +0000 (UTC) Subject: [Maxima] Request for Maxima 5.27.0 References: <4FAC5B2E.70906@eecs.berkeley.edu> <4FAC5B74.2020108@eecs.berkeley.edu> Message-ID: Maxima Jedis, Wold like to know your thoughts on the following request: 1)Let describe(diff) and '? diff' describe diff's derivative usage without the grill downs (now in maxima-5.27.0) 2)Move the drill downs to '?? diff'. Put diff's tensor usage among its output choices. This idea came to me after reading Dr. Fateman's response to my previous request. Thanks! Michael From fateman at eecs.berkeley.edu Fri May 11 09:32:02 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 11 May 2012 07:32:02 -0700 Subject: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A1706A6D29A@IRSMSX102.ger.corp.intel.com> References: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com> <4FABC8A7.8070203@gmail.com> <83FD4DC40F97654495E2C9AED47658360422EA1B@BL2PRD0710MB361.namprd07.prod.outlook.com> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6CEB1@IRSMSX102.ger.corp.intel.com> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6D29A@IRSMSX102.ger.corp.intel.com> Message-ID: <4FAD22E2.7010508@eecs.berkeley.edu> On 5/11/2012 1:23 AM, Soegtrop, Michael wrote: > > Dear Ray, > > I slept over your arguments, but I still think they are not right. The > problem I see is that floating point numbers can have very large > exponents, e.g. more than 1000 binary digits for IEEE double > precision. So worst case you need to do a range reduction with a > precision of about 1000 bits for a floating point format with 53 bits > mantissa. > No, the worst case is that you need more than 1053 bits. How many more depends on how close some multiple of pi is to an integer that is in range. Say you have x, a number with 1000 bits, an exact power of two, which agrees with a particular integer multiple of pi to 1018 bits. To do range reduction you need 1053 +18 bits of pi. > > The effort for doing the range reduction, essentially a modulus > operation, is quadratic (well there are asymptotically faster methods, > but I think with SIMD and 1000 bits, the quadratic method is still > best), so we have worst case ~400 times the effort, if we assume that > numbers are precise. > If you assume the numbers are not precise, why not just discard them and return NaN? > > The question is, if this effort is worthwhile. I think no, because I > think it is very unlikely, that the result of some computation has a > higher precision than the mantissa. > In other words, you are saying all powers of two beyond 53 are not representable, when they are. > > The use case of literal numbers is a bit artificial and not really > what floating point numbers are made for. One argument for this is > that it would be easy to detect if results are exact and add a > corresponding flag to floating point numbers. > The IEEE standard has "inexact" traps. Not part of the number but part of the operation. > > But this is typically not done, so one can assume that processing of > exact numbers is not the intention. > It IS the intention of the trap. It is the unfortunate tendency of language implementors and hardware implementors to make it difficult or expensive to use this. (By leaving it out of the language or making it accessible through some excessively complicated mechanism). > So I think, if you need high precision, you should use a high > precision floating point implementation. > And if you use the regular routine you should get essentially random? This is somewhat reminiscent of a method used by some HP calculators circa 1975? (which allow args up to 10^99) is to implement a different function from cosine, which looks sort of like cosine but has a period that is not pi, but an approximation to pi that is something like 12 decimal digits of pi. It has many of the same properties that cosine has, but has a different period. slightly. This allows the calculator to maintain some of the trig identities even if the actual results are technically unrelated to the correct results. RJF > Best regards, > > Michael > > *From:*Raymond Toy [mailto:toy.raymond at gmail.com] > *Sent:* Thursday, May 10, 2012 6:04 PM > *To:* Soegtrop, Michael > *Cc:* Barton Willis; maxima at math.utexas.edu > *Subject:* Re: cos(1.0d97) with GCL, Clozure, and Julia > > On Thu, May 10, 2012 at 8:26 AM, Soegtrop, Michael > > wrote: > > Dear Barton, > > this isn't a problem of the fsin/fcos implementation. For calculating > a sine function you need a certain absolute precision. E.g. if you > want to have 2 decimals output precision, your number must have an > absolute precision of 2 decimals. Floating point numbers have constant > relative precision. So the larger the number gets, the worse the > absolute precision becomes. If the absolute precision is worse than > pi, the result is simply meaningless. Imagine you have the number > 1000000000000 with error +-1000. The relative error is quite small > (1ppb), but the absolute error is more than 100*pi. The result is > meaningless. > > > I disagree with this analysis. If I want (cos (scale-float 1d0 120)) > (from one of Kahan's examples), cos should return the correct value. > Sure you can argue that 2^120 (as a float) is some kind of > approximation, but, as I've constructed, I want exactly 2^120, which > happens to be exactly representable in a double-float. I want cos to > return the value as accurately as possible given the input. > > Any supposed "error" in a floating-point number is up to the user to > decide, The cos function should accept it as an exact number and > produce a value based on that. > > Ray > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima I'm not sure who is taking which position. Here's mine (and I wrote the Maxima cosine bigfloat routine, if that matters...) Floating point numbers do not have inherent error. Each floating point number is an exact rational number. 2.0^100 is EXACTLY equal to 2^100. It is not 2^100 +- 2^47 with 53 specified digits and the rest "noise". If you want to represent numbers with error-bands, you can specify the number and the error (2 data items). Otherwise you are stuck with a base representation (this is done by Mathematica) in which everything is uncertain and you get a kind of layer upon layer of fuzz in which numbers become anything+-anything. It then becomes quite tricky to implement a reasonably error system (with 2 data items) because each of the data items has fuzz! RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Fri May 11 09:59:16 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 11 May 2012 07:59:16 -0700 Subject: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A1706A6D29A@IRSMSX102.ger.corp.intel.com> References: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com> <4FABC8A7.8070203@gmail.com> <83FD4DC40F97654495E2C9AED47658360422EA1B@BL2PRD0710MB361.namprd07.prod.outlook.com> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6CEB1@IRSMSX102.ger.corp.intel.com> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6D29A@IRSMSX102.ger.corp.intel.com> Message-ID: On Fri, May 11, 2012 at 1:23 AM, Soegtrop, Michael < michael.soegtrop at intel.com> wrote: > Dear Ray,**** > > ** ** > > I slept over your arguments, but I still think they are not right. The > problem I see is that floating point numbers can have very large exponents, > e.g. more than 1000 binary digits for IEEE double precision. So worst case > you need to do a range reduction with a precision of about 1000 bits for a > floating point format with 53 bits mantissa. The effort for doing the range > reduction, essentially a modulus operation, is quadratic (well there are > asymptotically > Hope it didn't keep you awake too long! But the effort is not really that large. What we really want to compute x*(1/(2*pi)) = N + r We don't care about N because, so we really want just r. We can break 1/(2*pi) into 3 parts. The first part contributes to N, the second part contributes to r and the third part contributes to r but is the tail of r past 53 bits. So most of the 1000+ bits of 1/(2*pi) aren't needed. (In practice, I think 2/pi is used instead of 1/(2*pi).) faster methods, but I think with SIMD and 1000 bits, the quadratic method > is still best), so we have worst case ~400 times the effort, if we assume > that numbers are precise. The question is, if this effort is worthwhile. I > think no, because I think it is very unlikely, that > the result of some computation has a higher precision than the mantissa. > The use case of > Sun obviously thought it was worthwhile many decades ago on much slower machines. You can find the (hairy) code that implements this on line and also in glibc. The numbers don't even have to be near 2^53 to start showing inaccuracies. Numbers below 2^16 show differences already. literal numbers is a bit artificial and not really what floating point > numbers are made for. > Yes, the examples are artificial but the routine is just given a number, not a number and some indication of accuracy. The routine should return a result assuming the number is exactly that and no other. It's up to the user to figure out whether the accuracy of result has any meaning given the accuracy of the input. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.soegtrop at intel.com Fri May 11 10:23:57 2012 From: michael.soegtrop at intel.com (Soegtrop, Michael) Date: Fri, 11 May 2012 15:23:57 +0000 Subject: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: <4FAD22E2.7010508@eecs.berkeley.edu> References: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com> <4FABC8A7.8070203@gmail.com> <83FD4DC40F97654495E2C9AED47658360422EA1B@BL2PRD0710MB361.namprd07.prod.outlook.com> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6CEB1@IRSMSX102.ger.corp.intel.com> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6D29A@IRSMSX102.ger.corp.intel.com> <4FAD22E2.7010508@eecs.berkeley.edu> Message-ID: <0F7D3B1B3C4B894D824F5B822E3E5A1706A6D539@IRSMSX102.ger.corp.intel.com> Dear Prof. Fateman, my background is computational physics and there large exact powers of two are, well, rare. I understand your arguments, but I don't understand what application would justify the extra effort of supporting such high precision range reduction. Let's look at the case mentioned below of 2^120. Of cause you can represent this number exactly in double precision and you can calculate the sin to 53 bits. But an increment of 1LSB is more than 10^19 pi. I wonder what applications of calculating the sin of a large numbers exist, which jumps angles in increments of more than 10^19 pi. And even more I wonder if such applications are really so important, that they justify the extra effort, from which all applications would suffer? Don't get me wrong, I fully support a range reduction with high fixed precision, but in order to process any representable power of two, a variable precision range reduction would be required, and this doesn't make sense in my opinion. Regarding the trap: this gives us a way to know which results are exact and which not, but this doesn't help to resolve the computational effort problem unless there would be a sin_exact function, which does support arbitrary precision range reduction, and another sin function which doesn't. Another problems with traps is, that they are not very feasible with SIMD or parallel processing. Best regards, Michael On 5/11/2012 1:23 AM, Soegtrop, Michael wrote: Dear Ray, I slept over your arguments, but I still think they are not right. The problem I see is that floating point numbers can have very large exponents, e.g. more than 1000 binary digits for IEEE double precision. So worst case you need to do a range reduction with a precision of about 1000 bits for a floating point format with 53 bits mantissa. No, the worst case is that you need more than 1053 bits. How many more depends on how close some multiple of pi is to an integer that is in range. Say you have x, a number with 1000 bits, an exact power of two, which agrees with a particular integer multiple of pi to 1018 bits. To do range reduction you need 1053 +18 bits of pi. The effort for doing the range reduction, essentially a modulus operation, is quadratic (well there are asymptotically faster methods, but I think with SIMD and 1000 bits, the quadratic method is still best), so we have worst case ~400 times the effort, if we assume that numbers are precise. If you assume the numbers are not precise, why not just discard them and return NaN? The question is, if this effort is worthwhile. I think no, because I think it is very unlikely, that the result of some computation has a higher precision than the mantissa. In other words, you are saying all powers of two beyond 53 are not representable, when they are. The use case of literal numbers is a bit artificial and not really what floating point numbers are made for. One argument for this is that it would be easy to detect if results are exact and add a corresponding flag to floating point numbers. The IEEE standard has "inexact" traps. Not part of the number but part of the operation. But this is typically not done, so one can assume that processing of exact numbers is not the intention. It IS the intention of the trap. It is the unfortunate tendency of language implementors and hardware implementors to make it difficult or expensive to use this. (By leaving it out of the language or making it accessible through some excessively complicated mechanism). So I think, if you need high precision, you should use a high precision floating point implementation. And if you use the regular routine you should get essentially random? This is somewhat reminiscent of a method used by some HP calculators circa 1975? (which allow args up to 10^99) is to implement a different function from cosine, which looks sort of like cosine but has a period that is not pi, but an approximation to pi that is something like 12 decimal digits of pi. It has many of the same properties that cosine has, but has a different period. slightly. This allows the calculator to maintain some of the trig identities even if the actual results are technically unrelated to the correct results. RJF Best regards, Michael From: Raymond Toy [mailto:toy.raymond at gmail.com] Sent: Thursday, May 10, 2012 6:04 PM To: Soegtrop, Michael Cc: Barton Willis; maxima at math.utexas.edu Subject: Re: cos(1.0d97) with GCL, Clozure, and Julia On Thu, May 10, 2012 at 8:26 AM, Soegtrop, Michael > wrote: Dear Barton, this isn't a problem of the fsin/fcos implementation. For calculating a sine function you need a certain absolute precision. E.g. if you want to have 2 decimals output precision, your number must have an absolute precision of 2 decimals. Floating point numbers have constant relative precision. So the larger the number gets, the worse the absolute precision becomes. If the absolute precision is worse than pi, the result is simply meaningless. Imagine you have the number 1000000000000 with error +-1000. The relative error is quite small (1ppb), but the absolute error is more than 100*pi. The result is meaningless. I disagree with this analysis. If I want (cos (scale-float 1d0 120)) (from one of Kahan's examples), cos should return the correct value. Sure you can argue that 2^120 (as a float) is some kind of approximation, but, as I've constructed, I want exactly 2^120, which happens to be exactly representable in a double-float. I want cos to return the value as accurately as possible given the input. Any supposed "error" in a floating-point number is up to the user to decide, The cos function should accept it as an exact number and produce a value based on that. Ray _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima I'm not sure who is taking which position. Here's mine (and I wrote the Maxima cosine bigfloat routine, if that matters...) Floating point numbers do not have inherent error. Each floating point number is an exact rational number. 2.0^100 is EXACTLY equal to 2^100. It is not 2^100 +- 2^47 with 53 specified digits and the rest "noise". If you want to represent numbers with error-bands, you can specify the number and the error (2 data items). Otherwise you are stuck with a base representation (this is done by Mathematica) in which everything is uncertain and you get a kind of layer upon layer of fuzz in which numbers become anything+-anything. It then becomes quite tricky to implement a reasonably error system (with 2 data items) because each of the data items has fuzz! RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.soegtrop at intel.com Fri May 11 10:38:20 2012 From: michael.soegtrop at intel.com (Soegtrop, Michael) Date: Fri, 11 May 2012 15:38:20 +0000 Subject: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: References: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com> <4FABC8A7.8070203@gmail.com> <83FD4DC40F97654495E2C9AED47658360422EA1B@BL2PRD0710MB361.namprd07.prod.outlook.com> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6CEB1@IRSMSX102.ger.corp.intel.com> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6D29A@IRSMSX102.ger.corp.intel.com> Message-ID: <0F7D3B1B3C4B894D824F5B822E3E5A1706A6D5E3@IRSMSX102.ger.corp.intel.com> Dear Ray, yes, I darkly remember (I did a FP implementation once quite a few years ago). I need to look at some code to refresh my memory and to see how much effort it really is. Best regards, Michael From: Raymond Toy [mailto:toy.raymond at gmail.com] Sent: Friday, May 11, 2012 4:59 PM To: Soegtrop, Michael Cc: Barton Willis; maxima at math.utexas.edu Subject: Re: cos(1.0d97) with GCL, Clozure, and Julia On Fri, May 11, 2012 at 1:23 AM, Soegtrop, Michael > wrote: Dear Ray, I slept over your arguments, but I still think they are not right. The problem I see is that floating point numbers can have very large exponents, e.g. more than 1000 binary digits for IEEE double precision. So worst case you need to do a range reduction with a precision of about 1000 bits for a floating point format with 53 bits mantissa. The effort for doing the range reduction, essentially a modulus operation, is quadratic (well there are asymptotically Hope it didn't keep you awake too long! But the effort is not really that large. What we really want to compute x*(1/(2*pi)) = N + r We don't care about N because, so we really want just r. We can break 1/(2*pi) into 3 parts. The first part contributes to N, the second part contributes to r and the third part contributes to r but is the tail of r past 53 bits. So most of the 1000+ bits of 1/(2*pi) aren't needed. (In practice, I think 2/pi is used instead of 1/(2*pi).) faster methods, but I think with SIMD and 1000 bits, the quadratic method is still best), so we have worst case ~400 times the effort, if we assume that numbers are precise. The question is, if this effort is worthwhile. I think no, because I think it is very unlikely, that the result of some computation has a higher precision than the mantissa. The use case of Sun obviously thought it was worthwhile many decades ago on much slower machines. You can find the (hairy) code that implements this on line and also in glibc. The numbers don't even have to be near 2^53 to start showing inaccuracies. Numbers below 2^16 show differences already. literal numbers is a bit artificial and not really what floating point numbers are made for. Yes, the examples are artificial but the routine is just given a number, not a number and some indication of accuracy. The routine should return a result assuming the number is exactly that and no other. It's up to the user to figure out whether the accuracy of result has any meaning given the accuracy of the input. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri May 11 10:51:21 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 11 May 2012 08:51:21 -0700 Subject: [Maxima] plotting to psfile? Message-ID: <4FAD3579.7020503@eecs.berkeley.edu> I was hoping to produce a postscript EPS file of a plot (so I could include it in a TeX file), using Maxima. I thought something like this would work: plot2d(sin(x),[x,-%pi,%pi],[psfile,"sinplot"]); but what was produced was a gnuplot file, not EPS. Did I do something wrong? From toy.raymond at gmail.com Fri May 11 11:13:54 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 11 May 2012 09:13:54 -0700 Subject: [Maxima] plotting to psfile? In-Reply-To: <4FAD3579.7020503@eecs.berkeley.edu> References: <4FAD3579.7020503@eecs.berkeley.edu> Message-ID: On Fri, May 11, 2012 at 8:51 AM, Richard Fateman wrote: > I was hoping to produce a postscript EPS file of a plot (so I could include > it in a TeX file), using Maxima. I thought something like this would work: > > plot2d(sin(x),[x,-%pi,%pi],[**psfile,"sinplot"]); > > but what was produced was a gnuplot file, not EPS. > > Did I do something wrong? > > I think you need to add [gnuplot_term, "eps"]. The documention for plot2d needs work. I always end up having to look at src/plot.lisp to do things. plot2d should include some easier way to get to these options. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri May 11 11:17:30 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 11 May 2012 09:17:30 -0700 Subject: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A1706A6D539@IRSMSX102.ger.corp.intel.com> References: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com> <4FABC8A7.8070203@gmail.com> <83FD4DC40F97654495E2C9AED47658360422EA1B@BL2PRD0710MB361.namprd07.prod.outlook.com> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6CEB1@IRSMSX102.ger.corp.intel.com> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6D29A@IRSMSX102.ger.corp.intel.com> <4FAD22E2.7010508@eecs.berkeley.edu> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6D539@IRSMSX102.ger.corp.intel.com> Message-ID: <4FAD3B9A.5060409@eecs.berkeley.edu> On 5/11/2012 8:23 AM, Soegtrop, Michael wrote: > > Dear Prof. Fateman, > > my background is computational physics and there large exact powers of > two are, well, rare. I understand your arguments, but I don't > understand what application would justify the extra effort of > supporting such high precision range reduction. > 1. If a subroutine gives the correct answer except in rare cases, some people would say it is defective. If it can be fixed so that it produces the correct result in all cases, although in rare cases it takes more time, then that is, in my opinion, much better. 2. The fact that you or I don't know of an application where the rare cases occur does not mean it is OK to (without warning) just give wrong answers. 3. The extra effort is (so far as I can tell) the matter of having the programmer do it right once, and using a few extra words of memory. My understanding is that usually that code is not executed, so no one else is penalized in time. > Let's look at the case mentioned below of 2^120. Of cause you can > represent this number exactly in double precision and you can > calculate the sin to 53 bits. But an increment of 1LSB is more than > 10^19 pi. I wonder what applications of calculating the sin of a large > numbers exist, which jumps angles in increments of more than 10^19 pi. > Mathematicians do many odd things. > And even more I wonder if such applications are really so important, > that they justify the extra effort, from which all applications would > suffer? > How so? If you want another cosine routine that is faster and gives wrong answers, you can easily construct one that does incorrect fast range reduction and then calls the existing routine. Or for that matter you could copy a Chebyshev approximation or some other polynomial or rational computation. Such things are done for low-precision needs like graphics. > > Don't get me wrong, I fully support a range reduction with high fixed > precision, but in order to process any representable power of two, a > variable precision range reduction would be required, and this doesn't > make sense in my opinion. > I think it is easy to implement a program to avoid variable precision range reduction if it is unnecessary. > Regarding the trap: this gives us a way to know which results are > exact and which not, but this doesn't help to resolve the > computational effort problem unless there would be a sin_exact > function, which does support arbitrary precision range reduction, and > another sin function which doesn't. > It is much easy to implement a sin_fast_and_sloppy function if you have a sin_exact function around. The other way, not so easy. > Another problems with traps is, that they are not very feasible with > SIMD or parallel processing. > The thought in the IEEE design was to allow for NaNs to serve in such cases. That is, if one were truly requiring exact values (as, for example, simulating exact integer arithmetic in floats, where inexact means overflow), then a parallel setup could benefit from inserting a NaN, without interrupting the program flow. The idea that it is OK to get the wrong answer because you got the answer fast in parallel seems to me to be fairly common in some circles. I find this uncomfortable. I particularly find it uncomfortable in the context of symbolic computing systems (when they are extended to do numerics). > ..snip.. -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Fri May 11 11:23:29 2012 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 11 May 2012 17:23:29 +0100 Subject: [Maxima] plotting to psfile? In-Reply-To: References: <4FAD3579.7020503@eecs.berkeley.edu> Message-ID: <4FAD3D01.2010103@fe.up.pt> On 05/11/2012 05:13 PM, Raymond Toy wrote: > On Fri, May 11, 2012 at 8:51 AM, Richard Fateman > > wrote: > > I was hoping to produce a postscript EPS file of a plot (so I > could include > it in a TeX file), using Maxima. I thought something like this > would work: > > plot2d(sin(x),[x,-%pi,%pi],[psfile,"sinplot"]); > > but what was produced was a gnuplot file, not EPS. > > Did I do something wrong? > > > I think you need to add [gnuplot_term, "eps"]. That should not be necessary, because the psfile option already sets gnuplot_term to eps. I use "plot2d(sin(x),[x,-%pi,%pi],[psfile,"sinplot.ps"]);" all the time to include the plot in Latex files, and it works for me. Even if I use "sinplot" for the file name, a PostScript file will be created. Perhaps is a feature of the Windows port of gnuplot?: please try using a file name with a .ps or .eps extension (sinplot.ps). Regards, Jaime -------------- next part -------------- An HTML attachment was scrubbed... URL: From aishen at free.fr Fri May 11 11:33:46 2012 From: aishen at free.fr (aishen at free.fr) Date: Fri, 11 May 2012 18:33:46 +0200 Subject: [Maxima] plotting to psfile? In-Reply-To: <4FAD3D01.2010103@fe.up.pt> References: <4FAD3579.7020503@eecs.berkeley.edu> <4FAD3D01.2010103@fe.up.pt> Message-ID: <4FAD3F6A.8000300@free.fr> [gnuplot_term,ps], [gnuplot_out_file,"/pathtodir/filename"] it can be ps, png svg or any imag extension terminal=eps,filename="/pathdtodir/filename" Le 11/05/2012 18:23, Jaime Villate a ?crit : > On 05/11/2012 05:13 PM, Raymond Toy wrote: >> On Fri, May 11, 2012 at 8:51 AM, Richard Fateman >> > wrote: >> >> I was hoping to produce a postscript EPS file of a plot (so I >> could include >> it in a TeX file), using Maxima. I thought something like this >> would work: >> >> plot2d(sin(x),[x,-%pi,%pi],[psfile,"sinplot"]); >> >> but what was produced was a gnuplot file, not EPS. >> >> Did I do something wrong? >> >> >> I think you need to add [gnuplot_term, "eps"]. > That should not be necessary, because the psfile option already sets > gnuplot_term to eps. > > I use "plot2d(sin(x),[x,-%pi,%pi],[psfile,"sinplot.ps"]);" > all the time to include the plot in Latex files, and it works for me. > Even if I use "sinplot" for the file name, a PostScript file will be > created. Perhaps is a feature of the Windows port of gnuplot?: please > try using a file name with a .ps or .eps extension (sinplot.ps). > > Regards, > Jaime > > > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Fri May 11 11:36:33 2012 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 11 May 2012 17:36:33 +0100 Subject: [Maxima] plotting to psfile? In-Reply-To: <4FAD3F6A.8000300@free.fr> References: <4FAD3579.7020503@eecs.berkeley.edu> <4FAD3D01.2010103@fe.up.pt> <4FAD3F6A.8000300@free.fr> Message-ID: <4FAD4011.7050900@fe.up.pt> On 05/11/2012 05:33 PM, aishen at free.fr wrote: > [gnuplot_term,ps], > [gnuplot_out_file,"/pathtodir/filename"] [psfile, "/pathtodir/filename"] is equivalent to those two options. Regards, Jaime -------------- next part -------------- An HTML attachment was scrubbed... URL: From prevettl at gmail.com Fri May 11 12:20:09 2012 From: prevettl at gmail.com (L. Prevett) Date: Fri, 11 May 2012 10:20:09 -0700 Subject: [Maxima] plotting to psfile? In-Reply-To: <4FAD4011.7050900@fe.up.pt> References: <4FAD3579.7020503@eecs.berkeley.edu> <4FAD3D01.2010103@fe.up.pt> <4FAD3F6A.8000300@free.fr> <4FAD4011.7050900@fe.up.pt> Message-ID: I just wanted to mention that many complicated features for plots (fonts, titles, labels, axes, etc.) can be put into a ".gnuplot" file (or in windows a "GNUPLOT.INI" file - I think?) For example, put the following lines in file ".gnuplot" set terminal postscript eps "VeraBd" 16 set output "sinplot.eps" set title "Sine Plot" set x2label "Maxima Plot" set ylabel 'y values' set xlabel 'x values' set zeroaxis set xtics("-pi/2" -3.14156/2,"0" 0,"pi/2" 3.14159/2) Then run maxima and execute the simple plot2d command: plot2d(sin(x),[x,-%pi,%pi]); This plot will save to the file, but will not show onscreen. A more complicated plot2d command (without the .gnuplot entries) would implement three of the eight entries in the above ".gnuplot" file: plot2d(sin(x),[x,-%pi,%pi],[gnuplot_term, ps], [gnuplot_preamble, "set terminal postscript eps 'VeraBd' 16; set zeroaxis;"], [gnuplot_out_file, "sinplot.eps"]); This plot will save to the file and also show onscreen. L. Prevett From fateman at eecs.berkeley.edu Fri May 11 12:23:59 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 11 May 2012 10:23:59 -0700 Subject: [Maxima] plotting to psfile? In-Reply-To: <4FAD4011.7050900@fe.up.pt> References: <4FAD3579.7020503@eecs.berkeley.edu> <4FAD3D01.2010103@fe.up.pt> <4FAD3F6A.8000300@free.fr> <4FAD4011.7050900@fe.up.pt> Message-ID: <4FAD4B2F.20107@eecs.berkeley.edu> actually it seems to work a lot worse for me than the examples shown. the option [psfile, "c:/temp/sin.eps"] causes a file maxout.gnuplot to appear in c:/temp. I then fire up a cygwin command shell and run gnuplot in it to produce sin.eps I am using windows xp, wxmaxima, maxima 5.25.1 unfortunately, an eps file does not work with pdflatex, which I am using, even with \documentclass{article} \usepackage{fullpage} \usepackage{graphicx} \usepackage{epstopdf} .... \begin{figure*} \centerline{ \mbox{\includegraphics[width=3.00in]{c:/temp/sin.eps}} } \caption{sin} \label{sinplot} \end{figure*} From coolens at kahosl.be Fri May 11 12:26:44 2012 From: coolens at kahosl.be (Hugo Coolens) Date: Fri, 11 May 2012 19:26:44 +0200 Subject: [Maxima] [newbie] solving overspecified system of linear equations In-Reply-To: <4FAD3579.7020503@eecs.berkeley.edu> References: <4FAD3579.7020503@eecs.berkeley.edu> Message-ID: Coudl anyone on this list tell me how I can solve an overspecified system of linear equations in Maxima regards, hugo From cloos at jhcloos.com Fri May 11 14:13:39 2012 From: cloos at jhcloos.com (James Cloos) Date: Fri, 11 May 2012 15:13:39 -0400 Subject: [Maxima] plotting to psfile? In-Reply-To: <4FAD4B2F.20107@eecs.berkeley.edu> (Richard Fateman's message of "Fri, 11 May 2012 10:23:59 -0700") References: <4FAD3579.7020503@eecs.berkeley.edu> <4FAD3D01.2010103@fe.up.pt> <4FAD3F6A.8000300@free.fr> <4FAD4011.7050900@fe.up.pt> <4FAD4B2F.20107@eecs.berkeley.edu> Message-ID: >>>>> "RF" == Richard Fateman writes: RF> actually it seems to work a lot worse for me than the examples shown. RF> the option [psfile, "c:/temp/sin.eps"] RF> causes a file maxout.gnuplot to appear in c:/temp. I then fire up a RF> cygwin command shell and run gnuplot in it to produce sin.eps RF> unfortunately, an eps file does not work with pdflatex, which I am using, Try this then: plot2d(sin(x),[x,-%pi,%pi],[gnuplot_term, "pdf enh font 'Asana Math'"],[gnuplot_out_file,"sin.pdf"]); With your preferred font name. More recent versions of gnuplot have abandoned the old pdf term (based on libpdf) in favour of the pdfcairo term. pdf, though, will match whichever of the two are installed. Cf >help set term pdf< in gnuplot to see which pdf terminal your gnuplot uses. If your gnuplot has cairo support, the cairolatex terminal also may be of interest. It can do both eps and pdf files and allows labels to be set by TeX, if you prefer, via the xlabel, ylabel, zlabel and/or legend options to plot2d and plot3d. Cf >help set term cairolatex< in gnuplot for the syntax of the strings. (The cairolatex term doesn't seem to be documented yet in gnuplot's texinfo manual, but the label syntax matches that of the latex terminal, which is documented there.) -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From l_butler at users.sourceforge.net Fri May 11 14:37:27 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Fri, 11 May 2012 19:37:27 +0000 Subject: [Maxima] plotting to psfile? In-Reply-To: <4FAD4B2F.20107@eecs.berkeley.edu> (message from Richard Fateman on Fri, 11 May 2012 10:23:59 -0700) Message-ID: <1qppqaa1pc8.fsf@iceland.freeshell.org> Richard Fateman writes: > actually it seems to work a lot worse for me than the examples shown. > > the option [psfile, "c:/temp/sin.eps"] > > causes a file maxout.gnuplot to appear in c:/temp. > I then fire up a cygwin command shell and run gnuplot in it to produce > sin.eps > > I am using windows xp, wxmaxima, maxima 5.25.1 > > unfortunately, an eps file does not work with pdflatex, which I am using, Use the pdfcairo terminal to produce a pdf file directly: plot2d(sin(x),[x,0,2*%pi],[gnuplot_term,pdfcairo],[psfile,"./temp.pdf"]); I don't know why setting 'psfile' works, while plot2d(sin(x),[x,0,2*%pi],[gnuplot_term,pdfcairo],[gnuplot_out_file,"./temp.pdf"]); produces a truncated file, but it happens (5.27.0 gcl). In case you want to add latex markup to your plots, I just noticed that Gnuplot 4.6 now has a 'cairolatex' terminal which is like the older epslatex terminal, but for pdf files. -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From l_butler at users.sourceforge.net Fri May 11 14:55:21 2012 From: l_butler at users.sourceforge.net (Leo Butler) Date: Fri, 11 May 2012 19:55:21 +0000 Subject: [Maxima] [newbie] solving overspecified system of linear equations In-Reply-To: (message from Hugo Coolens on Fri, 11 May 2012 19:26:44 +0200) Message-ID: <1qpmx5e1oie.fsf@iceland.freeshell.org> Hugo Coolens writes: > Coudl anyone on this list tell me how I can solve an overspecified system > of linear equations in Maxima How about (%i1) linsolve([x+y+z=1,x+y=1,z=0,x=0],[x,y,z]); solve: dependent equations eliminated: (2) (%o1) [x = 0, y = 1, z = 0] and (%i2) linsolve([x+y+z=1,x+y=1,z=0,x+y=0],[x,y,z]); (%o2) [] There are ways to 'solve', in an error minimizing sense, a system of overdetermined and inconsistent equations. The most common way is least squares regression. For example: (%i1) load (lbfgs); (%o1) /usr/share/maxima/5.27.0/share/lbfgs/lbfgs.mac (%i2) eqs:[x+y+z=1,x+y=1,z=0,x+y=0]$ (%i3) fom:subst("="="-", eqs); (%o3) [z + y + x - 1, y + x - 1, z, y + x] (%i4) fom: fom.fom; 2 2 2 2 (%o4) (z + y + x - 1) + z + (y + x) + (y + x - 1) (%i5) lbfgs(fom,[x,y,z],[0,0,0],1e-4,[1,0]); ************************************************* N= 3 NUMBER OF CORRECTIONS=25 INITIAL VALUES F= 2.000000000000000D+00 GNORM= 6.000000000000000D+00 ************************************************* I NFN FUNC GNORM STEPLENGTH 1 3 6.034482758620692D-01 1.462979547282512D-01 7.758620689655173D-02 2 4 6.019883621059441D-01 1.110925645530035D-01 1.000000000000000D+00 3 5 6.000000000000000D-01 5.606351459942525D-16 1.000000000000000D+00 THE MINIMIZATION TERMINATED WITHOUT DETECTING ERRORS. IFLAG = 0 (%o5) [x = 0.3, y = 0.3, z = 0.2] -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From woollett at charter.net Fri May 11 15:32:47 2012 From: woollett at charter.net (Edwin Woollett) Date: Fri, 11 May 2012 13:32:47 -0700 Subject: [Maxima] float erf(%i) Message-ID: I recall some mailing list discussion of getting float to work with erf(%i) during the last year. Using latest gcl 5.27.0 shows that float doesn't work here. Also notice that if display2d is set to false, the build_info() return looks weird. ------------------------------------ (%i1) build_info(); (%o1) Maxima version: "5.27.0" Maxima build date: "2012-05-08 11:27:57" Host type: "i686-pc-mingw32" Lisp implementation type: "GNU Common Lisp (GCL)" Lisp implementation version: "GCL 2.6.8" (%i2) display2d:false$ (%i3) erf(%i); (%o3) erf(%i) (%i4) float(%); (%o4) erf(%i) (%i5) subst(1.0*%i,%i,%); (%o5) 1.650425758797543*%i (%i6) build_info(); (%o6) ?%build_info("5.27.0","2012-05-08 11:27:57","i686-pc-mingw32", "GNU Common Lisp (GCL)","GCL 2.6.8") --------------------------- Ted Woollett From woollett at charter.net Fri May 11 16:34:00 2012 From: woollett at charter.net (Edwin Woollett) Date: Fri, 11 May 2012 14:34:00 -0700 Subject: [Maxima] integrate ( exp (x^3), x, 0, 1) still wrong Message-ID: This is an integral which gave a history stack overflow lisp error in 5.26.0 (Jan 17, 2012). Using the lastest gcl 5.27.0-1, there is no longer a stack problem, but a wildly wrong answer. (%i1) (display2d:false,fpprintprec:8)$ (%i2) integrate(exp(x^3),x,0,1); (%o2) (gamma_incomplete(1/3,-1)-gamma(1/3))/3 (%i3) float(%); (%o3) 0.333333*(-3.4863699*%i-2.0128566) (%i4) expand(%); (%o4) -1.1621233*%i-0.670952 (%i5) quad_qags(exp(x^3),x,0,1); (%o5) [1.3419044,1.48981318E-14,21,0] (%i6) build_info(); (%o6) ?%build_info("5.27.0","2012-05-08 11:27:57","i686-pc-mingw32", "GNU Common Lisp (GCL)","GCL 2.6.8") Ted Woollett From woollett at charter.net Fri May 11 18:02:46 2012 From: woollett at charter.net (Edwin Woollett) Date: Fri, 11 May 2012 16:02:46 -0700 Subject: [Maxima] integrate ( exp (x^3), x, 0, 1) still wrong Message-ID: <00F5E3314766432E84CD8ECDB7327181@edwinc367e16bd> On May 11, 2012, I wrote ------------- >This is an integral which gave a history stack >overflow lisp error in 5.26.0 (Jan 17, 2012). > >Using the lastest gcl 5.27.0-1, there is no longer >a stack problem, but a wildly wrong answer. ---------------------------- The bug fix which cured the stack overflow error included the warning that one should use domain:complex to get the correct (symbolic) answer. Consider three cases: setting domain = complex gives a different symbolic answer, as advertised. The remaining problem is getting accurate float values from gamma_incomplete. Also, there is the non-trivial problem: how is the user supposed to know that he/she is supposed to set domain to complex?? (%i1) (display2d:false,fpprintprec:8)$ (%i2) cfloat(zzz) := expand(float(rectform(zzz)))$ (%i3) domain; (%o3) real case exp(x^3) over (0,1) domain:complex cures answer since we can neglect small fp roundoff errors: (%i4) quad_qags(exp(x^3),x,0,1); (%o4) [1.3419044,1.48981318E-14,21,0] (%i5) integrate(exp(x^3),x,0,1); (%o5) (gamma_incomplete(1/3,-1)-gamma(1/3))/3 (%i6) cfloat(%); (%o6) -1.1621233*%i-0.670952 (%i7) domain:complex; (%o7) complex (%i8) integrate(exp(x^3),x,0,1); (%o8) ((-1)^(2/3)*gamma_incomplete(1/3,-1)-(-1)^(2/3)*gamma(1/3))/3 (%i9) cfloat(%); (%o9) 1.3419044-1.48029737E-16*%i case exp(x^3) over (1,2) domain:complex cures answer provided we neglect the imaginary piece of order(E-14)?? (%i10) quad_qags(exp(x^3),x,1,2); (%o10) [275.51098,3.23056159E-7,21,0] (%i11) domain:real; (%o11) real (%i12) integrate(exp(x^3),x,1,2); (%o12) (gamma_incomplete(1/3,-8)-gamma_incomplete(1/3,-1))/3 (%i13) cfloat(%); (%o13) -238.59951*%i-137.75549 (%i14) domain:complex; (%o14) complex (%i15) integrate(exp(x^3),x,1,2); (%o15) ((-1)^(2/3)*gamma_incomplete(1/3,-8)-(-1)^(2/3) *gamma_incomplete(1/3,-1))/3 (%i16) cfloat(%); (%o16) 275.51098-1.89478063E-14*%i -------------------------------------------------- case exp(x^5) over (1,2) domain:complex greatly improves answer but large incorrect imaginary part and real part only accurate to two sig. figures. (%i17) quad_qags(exp(x^5),x,1,2); (%o17) [1.01323949E+12,0.661551,147,0] (%i18) domain:real; (%o18) real (%i19) integrate(exp(x^5),x,1,2); (%o19) (gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1))/5 (%i20) cfloat(%); (%o20) -6.21355339E+11*%i-8.55222255E+11 (%i21) domain:complex; (%o21) complex (%i22) integrate(exp(x^5),x,1,2); (%o22) ((-1)^(4/5)*gamma_incomplete(1/5,-32)-(-1)^(4/5) *gamma_incomplete(1/5,-1))/5 (%i23) cfloat(%); (%o23) 1.05711284E+12-2.9296875E-4*%i Ted Woollett From robert.dodier at gmail.com Sat May 12 03:42:57 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 12 May 2012 08:42:57 +0000 (UTC) Subject: [Maxima] integrate ( exp (x^3), x, 0, 1) still wrong References: Message-ID: On 2012-05-11, Edwin Woollett wrote: > Using the lastest gcl 5.27.0-1, there is no longer > a stack problem, but a wildly wrong answer. > > (%i1) (display2d:false,fpprintprec:8)$ > > (%i2) integrate(exp(x^3),x,0,1); > (%o2) (gamma_incomplete(1/3,-1)-gamma(1/3))/3 > > (%i3) float(%); > (%o3) 0.333333*(-3.4863699*%i-2.0128566) > > (%i4) expand(%); > (%o4) -1.1621233*%i-0.670952 Well, I don't know that this is "wildly wrong". It seems that abs(%o4) = 1.34... so that makes me think there is some branch cut stuff going on here. As such, reasonable choices can yield different results. Not sure that there's really a universal resolution to that. FWIW Robert Dodier From willisb at unk.edu Sat May 12 06:43:54 2012 From: willisb at unk.edu (Barton Willis) Date: Sat, 12 May 2012 11:43:54 +0000 Subject: [Maxima] integrate ( exp (x^3), x, 0, 1) still wrong In-Reply-To: References: , Message-ID: <83FD4DC40F97654495E2C9AED47658360424EAB6@BL2PRD0710MB361.namprd07.prod.outlook.com> A workaround is to set the domain to complex: (%i23) integrate(exp(x^3),x,0,1), domain : 'complex; (%o23) ((-1)^(2/3)*gamma_incomplete(1/3,-1)-(-1)^(2/3)*gamma(1/3))/3 (%i24) expand(float(rectform(%))); (%o24) 1.34190441797742-1.4802973661668753*10^-16*%i When domain is real, (-1)^(2/3) simplifies to 1. As for the tiny spurious imaginary part of (%o24), I don't have a cure. The option variable m1pbranch has something to do with this too. --bw ________________________________________ > (%i2) integrate(exp(x^3),x,0,1); > (%o2) (gamma_incomplete(1/3,-1)-gamma(1/3))/3 > > (%i3) float(%); > (%o3) 0.333333*(-3.4863699*%i-2.0128566) From toy.raymond at gmail.com Sat May 12 09:32:56 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 12 May 2012 07:32:56 -0700 Subject: [Maxima] integrate ( exp (x^3), x, 0, 1) still wrong In-Reply-To: <00F5E3314766432E84CD8ECDB7327181@edwinc367e16bd> References: <00F5E3314766432E84CD8ECDB7327181@edwinc367e16bd> Message-ID: <4FAE7498.70808@gmail.com> On 5/11/12 4:02 PM, Edwin Woollett wrote: > On May 11, 2012, I wrote > ------------- >> This is an integral which gave a history stack >> overflow lisp error in 5.26.0 (Jan 17, 2012). >> >> Using the lastest gcl 5.27.0-1, there is no longer >> a stack problem, but a wildly wrong answer. > ---------------------------- > The bug fix which cured the stack overflow error > included the warning that one should use domain:complex > to get the correct (symbolic) answer. That seems unfortunate that you have to know, magically, to specify a complex domain for an integral that is obviously real. If you hadn't remembered the bug fix, would you have known? I didn't. [snip] > case exp(x^3) over (1,2) > domain:complex cures answer provided we > neglect the imaginary piece of order(E-14)?? > > (%i10) quad_qags(exp(x^3),x,1,2); > (%o10) [275.51098,3.23056159E-7,21,0] > > (%i11) domain:real; > (%o11) real > > (%i12) integrate(exp(x^3),x,1,2); > (%o12) (gamma_incomplete(1/3,-8)-gamma_incomplete(1/3,-1))/3 > > (%i13) cfloat(%); > (%o13) -238.59951*%i-137.75549 > > (%i14) domain:complex; > (%o14) complex > > (%i15) integrate(exp(x^3),x,1,2); > (%o15) ((-1)^(2/3)*gamma_incomplete(1/3,-8)-(-1)^(2/3) > *gamma_incomplete(1/3,-1))/3 > > (%i16) cfloat(%); > (%o16) 275.51098-1.89478063E-14*%i I'm not sure what you're expecting. To get a real result, gamma_incomplete obviously has to be complex to cancel out the imaginary part from (-1)^(2/3). > > -------------------------------------------------- > case exp(x^5) over (1,2) > domain:complex greatly improves answer > but large incorrect imaginary part > and real part only accurate to two sig. figures. Yes, that's a problem. gamma_incomplete(1/5,-32) is not very accurate. This can probably solved, but I'm not sure. Using bigfloats with 32 digits gives a much better answer. Ray From toy.raymond at gmail.com Sat May 12 09:32:56 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 12 May 2012 07:32:56 -0700 Subject: [Maxima] integrate ( exp (x^3), x, 0, 1) still wrong In-Reply-To: <00F5E3314766432E84CD8ECDB7327181@edwinc367e16bd> References: <00F5E3314766432E84CD8ECDB7327181@edwinc367e16bd> Message-ID: <4FAE7498.70808@gmail.com> On 5/11/12 4:02 PM, Edwin Woollett wrote: > On May 11, 2012, I wrote > ------------- >> This is an integral which gave a history stack >> overflow lisp error in 5.26.0 (Jan 17, 2012). >> >> Using the lastest gcl 5.27.0-1, there is no longer >> a stack problem, but a wildly wrong answer. > ---------------------------- > The bug fix which cured the stack overflow error > included the warning that one should use domain:complex > to get the correct (symbolic) answer. That seems unfortunate that you have to know, magically, to specify a complex domain for an integral that is obviously real. If you hadn't remembered the bug fix, would you have known? I didn't. [snip] > case exp(x^3) over (1,2) > domain:complex cures answer provided we > neglect the imaginary piece of order(E-14)?? > > (%i10) quad_qags(exp(x^3),x,1,2); > (%o10) [275.51098,3.23056159E-7,21,0] > > (%i11) domain:real; > (%o11) real > > (%i12) integrate(exp(x^3),x,1,2); > (%o12) (gamma_incomplete(1/3,-8)-gamma_incomplete(1/3,-1))/3 > > (%i13) cfloat(%); > (%o13) -238.59951*%i-137.75549 > > (%i14) domain:complex; > (%o14) complex > > (%i15) integrate(exp(x^3),x,1,2); > (%o15) ((-1)^(2/3)*gamma_incomplete(1/3,-8)-(-1)^(2/3) > *gamma_incomplete(1/3,-1))/3 > > (%i16) cfloat(%); > (%o16) 275.51098-1.89478063E-14*%i I'm not sure what you're expecting. To get a real result, gamma_incomplete obviously has to be complex to cancel out the imaginary part from (-1)^(2/3). > > -------------------------------------------------- > case exp(x^5) over (1,2) > domain:complex greatly improves answer > but large incorrect imaginary part > and real part only accurate to two sig. figures. Yes, that's a problem. gamma_incomplete(1/5,-32) is not very accurate. This can probably solved, but I'm not sure. Using bigfloats with 32 digits gives a much better answer. Ray From toy.raymond at gmail.com Sat May 12 09:33:44 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 12 May 2012 07:33:44 -0700 Subject: [Maxima] float erf(%i) In-Reply-To: References: Message-ID: <4FAE74C8.5050302@gmail.com> On 5/11/12 1:32 PM, Edwin Woollett wrote: > I recall some mailing list discussion of getting > float to work with erf(%i) during the last year. > > Using latest gcl 5.27.0 shows that float doesn't > work here. Oops. Is there a bug report for this? If not, can you add one? Ray From toy.raymond at gmail.com Sat May 12 09:33:44 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 12 May 2012 07:33:44 -0700 Subject: [Maxima] float erf(%i) In-Reply-To: References: Message-ID: <4FAE74C8.5050302@gmail.com> On 5/11/12 1:32 PM, Edwin Woollett wrote: > I recall some mailing list discussion of getting > float to work with erf(%i) during the last year. > > Using latest gcl 5.27.0 shows that float doesn't > work here. Oops. Is there a bug report for this? If not, can you add one? Ray From willisb at unk.edu Sat May 12 09:50:06 2012 From: willisb at unk.edu (Barton Willis) Date: Sat, 12 May 2012 14:50:06 +0000 Subject: [Maxima] make install: No rule to make target `index.hhk' Message-ID: <83FD4DC40F97654495E2C9AED47658360424EB27@BL2PRD0710MB361.namprd07.prod.outlook.com> I don't try to do make install all that often, but when I do, the install seems to progress fairly far and then fails. I do have a working hhc available at my cygwin terminal. I've done ./bootstrap, but I'm not sure my Starkit, TclKit, img.kit, gnuplot, and wxmaxima are installed correctly. I'm sure there are dozens of possibilities. Hints? [ -z "$bad_files" ] || ( echo "WARNING: The following files have unexpanded Tab s: $bad_files" ; \ echo "Run /doc/info/fix_tab to fix the problem." ) make[4]: Entering directory `/cygdrive/c/maximagit/maxima/doc/info' make[4]: Nothing to be done for `install-exec-am'. make[4]: *** No rule to make target `index.hhk', needed by `install-datafiles'. Stop. make[4]: Leaving directory `/cygdrive/c/maximagit/maxima/doc/info' Makefile:861: recipe for target `install-am' failed make[3]: *** [install-am] Error 2 make[3]: Leaving directory `/cygdrive/c/maximagit/maxima/doc/info' Makefile:658: recipe for target `install-recursive' failed make[2]: *** [install-recursive] Error 1 make[2]: Leaving directory `/cygdrive/c/maximagit/maxima/doc/info' Makefile:287: recipe for target `install-recursive' failed make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/cygdrive/c/maximagit/maxima/doc' Makefile:326: recipe for target `install-recursive' failed make: *** [install-recursive] Error 1 --bw From woollett at charter.net Sat May 12 11:27:22 2012 From: woollett at charter.net (Edwin Woollett) Date: Sat, 12 May 2012 09:27:22 -0700 Subject: [Maxima] float erf(%i) Message-ID: <957AEA92A190428FA1419B0F1EB49E70@edwinc367e16bd> On May 12, 2012, Raymond Toy wrote: ----------------------------- >> I recall some mailing list discussion of getting >> float to work with erf(%i) during the last year. >> >> Using latest gcl 5.27.0 shows that float doesn't >> work here. > >Oops. Is there a bug report for this? If not, can you add one? done: bug #3526111 Ted From robert.dodier at gmail.com Sat May 12 12:49:20 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 12 May 2012 17:49:20 +0000 (UTC) Subject: [Maxima] make install: No rule to make target `index.hhk' References: <83FD4DC40F97654495E2C9AED47658360424EB27@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: On 2012-05-12, Barton Willis wrote: > [ -z "$bad_files" ] || ( echo "WARNING: The following files have unexpanded Tab > s: $bad_files" ; \ > echo "Run /doc/info/fix_tab to fix the problem." ) > make[4]: Entering directory `/cygdrive/c/maximagit/maxima/doc/info' > make[4]: Nothing to be done for `install-exec-am'. > make[4]: *** No rule to make target `index.hhk', needed by `install-datafiles'. Barton, I see that index.hhk is created by executing the Perl script create_index, which is executed by the rule for contents.hhc. I guess make decided not to execute the rule for some reason. If you remove contents.hhc and try again, does it execute create_index? if so, does create_index create index.hhk? HTH. Just some guesses after looking at Makefile.am. best, Robert Dodier From woollett at charter.net Sat May 12 14:01:05 2012 From: woollett at charter.net (Edwin Woollett) Date: Sat, 12 May 2012 12:01:05 -0700 Subject: [Maxima] integrate ( exp (x^3), x, 0, 1) still wrong Message-ID: <43637598B851491490A75BD9E1B99D47@edwinc367e16bd> On May 12, 2012, Raymond Toy wrote: -------------------------- >> case exp(x^5) over (1,2) >> domain:complex greatly improves answer >> but large incorrect imaginary part >> and real part only accurate to two sig. figures. > >Yes, that's a problem. gamma_incomplete(1/5,-32) is not very accurate. > This can probably solved, but I'm not sure. Using bigfloats with 32 >digits gives a much better answer. --------------------------- I have incorporated domain:complex and bigfloat evaluation of symbolic integrate result inside my nint code (which uses mfloat which I have already displayed on the mailing list). This goes now for 16 significant figure accuracy: using my mfloat(expr,16) inside nint: (%i1) load(nint); quad_util.mac mydefint.mac quad1d.mac quad2d.mac (%o1) "c:/work2/nint.mac" (%i2) domain; (%o2) complex (%i3) nint(exp(x^5),x,1,2); (%o3) 1.0132394896940183E+12 ---------------------------------- which agrees with wolfram alpha. Ted From rich.hennessy at verizon.net Sat May 12 17:54:12 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sat, 12 May 2012 18:54:12 -0400 Subject: [Maxima] wxdraw2d Message-ID: <5BD4F788F27247B1A3F366BD20019CD4@RichsLaptop> I have noticed a bug in wxplo2d with the points() graphic object. draw2d(points_joined=true,color=blue, point_type=dot,point_size=1,points(N)); works fine most of the time but sometimes it just echo?s the input to the wMaxima output. wxdraw2d(points_joined=true,color=blue, point_type=dot,point_size=1,points(N)); gives an empty window with a big x in it and the message Error C:/Users/Richard Hennessy/maxout_2.png wxWidgets: 2.8.12 Unicode Support: no Maxima version: 5.27.0 Lisp: GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) build_info(); build_info("5.27.0","2012-05-08 11:27:57","i686-pc-mingw32","GNU Common Lisp (GCL)","GCL 2.6.8") I am using Windows 7 professional. The list N is 1200 points long and in the form [[x1,y1],[x2],[y2],...[xn],[yn]] of floats or big floats, it doesn?t matter which. Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Sat May 12 18:01:48 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sat, 12 May 2012 19:01:48 -0400 Subject: [Maxima] wxdraw2d Message-ID: I meant the list is in the form [[x1,y1],[x2,y2],...[xn,yn]] of floats or big floats, it doesn?t matter which. From: Richard Hennessy Sent: Saturday, May 12, 2012 6:54 PM To: Maxima List Subject: wxdraw2d I have noticed a bug in wxplo2d with the points() graphic object. draw2d(points_joined=true,color=blue, point_type=dot,point_size=1,points(N)); works fine most of the time but sometimes it just echo?s the input to the wMaxima output. wxdraw2d(points_joined=true,color=blue, point_type=dot,point_size=1,points(N)); gives an empty window with a big x in it and the message Error C:/Users/Richard Hennessy/maxout_2.png wxWidgets: 2.8.12 Unicode Support: no Maxima version: 5.27.0 Lisp: GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) build_info(); build_info("5.27.0","2012-05-08 11:27:57","i686-pc-mingw32","GNU Common Lisp (GCL)","GCL 2.6.8") I am using Windows 7 professional. The list N is 1200 points long and in the form [[x1,y1],[x2],[y2],...[xn],[yn]] of floats or big floats, it doesn?t matter which. Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From dbmaxima at gmail.com Sat May 12 21:40:50 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Sun, 13 May 2012 12:40:50 +1000 Subject: [Maxima] make install: No rule to make target `index.hhk' In-Reply-To: References: <83FD4DC40F97654495E2C9AED47658360424EB27@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: <4FAF1F32.7010606@gmail.com> On 13/05/2012 3:49 AM, Robert Dodier wrote: > On 2012-05-12, Barton Willis wrote: > >> [ -z "$bad_files" ] || ( echo "WARNING: The following files have unexpanded Tab >> s: $bad_files" ; \ >> echo "Run /doc/info/fix_tab to fix the problem." ) >> make[4]: Entering directory `/cygdrive/c/maximagit/maxima/doc/info' >> make[4]: Nothing to be done for `install-exec-am'. >> make[4]: *** No rule to make target `index.hhk', needed by `install-datafiles'. > Barton, I see that index.hhk is created by executing the Perl script > create_index, which is executed by the rule for contents.hhc. I guess > make decided not to execute the rule for some reason. If you remove > contents.hhc and try again, does it execute create_index? if so, does > create_index create index.hhk? > > HTH. Just some guesses after looking at Makefile.am. Correct. The following patch makes the dependency explicit. I will test it on a full build then check it in. diff --git a/doc/info/Makefile.am b/doc/info/Makefile.am old mode 100644 new mode 100755 index 208ccd6..bcc20f5 --- a/doc/info/Makefile.am +++ b/doc/info/Makefile.am @@ -219,7 +219,7 @@ maxima-index.lisp: maxima.info build_index.pl maxima.html: maxima.texi $(maxima_TEXINFOS) sh extract_categories.sh maxima -contents.hhc: maxima.html +contents.hhc index.hhk: maxima.html perl ./create_index include $(top_srcdir)/common.mk From XeCycle at Gmail.com Sat May 12 03:33:47 2012 From: XeCycle at Gmail.com (XeCycle) Date: Sat, 12 May 2012 16:33:47 +0800 Subject: [Maxima] plot2d failed to plot too many discrete points Message-ID: <87aa1d23ys.fsf@xc.laptop> Hello, I'm trying to plot my computed numbers, roughly millions; then I found plot2d failed to plot these many points. Even, it failed to plot 65536 points --- should I check my compiler? I'm using SBCL on x86_64 Linux, and the plot function was called From Lisp. Or just tell me Maxima is not well suited to numeric computing, then convince me to try something else. I'm considering to output these numbers to a pipe and spawn the gnuplot myself, is it recommended? Thank you. -- Carl Lei (XeCycle) Department of Physics, Shanghai Jiao Tong University OpenPGP public key: 7795E591 Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 489 bytes Desc: not available URL: From nb0yjxtr at iceland.freeshell.org Sat May 12 09:12:12 2012 From: nb0yjxtr at iceland.freeshell.org (Leo) Date: Sat, 12 May 2012 14:12:12 +0000 Subject: [Maxima] [newbie] solving overspecified system of linear equations In-Reply-To: (message from Hugo Coolens on Sat, 12 May 2012 15:45:57 +0200) Message-ID: <1qpk40h1oar.fsf@iceland.freeshell.org> Hugo Coolens writes: > wow, great, that's just what I needed! > > sincerely, > Hugo Please reply to the maxima list. > > > On Fri, 11 May 2012, Leo Butler wrote: > >> Hugo Coolens writes: >> >>> Coudl anyone on this list tell me how I can solve an overspecified system >>> of linear equations in Maxima >> >> How about >> (%i1) linsolve([x+y+z=1,x+y=1,z=0,x=0],[x,y,z]); >> >> solve: dependent equations eliminated: (2) >> (%o1) [x = 0, y = 1, z = 0] >> >> and >> >> (%i2) linsolve([x+y+z=1,x+y=1,z=0,x+y=0],[x,y,z]); >> (%o2) [] >> >> There are ways to 'solve', in an error minimizing sense, a system of >> overdetermined and inconsistent equations. The most common way is least >> squares regression. For example: >> >> (%i1) load (lbfgs); >> (%o1) /usr/share/maxima/5.27.0/share/lbfgs/lbfgs.mac >> (%i2) eqs:[x+y+z=1,x+y=1,z=0,x+y=0]$ >> >> (%i3) fom:subst("="="-", eqs); >> (%o3) [z + y + x - 1, y + x - 1, z, y + x] >> (%i4) fom: fom.fom; >> 2 2 2 2 >> (%o4) (z + y + x - 1) + z + (y + x) + (y + x - 1) >> (%i5) lbfgs(fom,[x,y,z],[0,0,0],1e-4,[1,0]); >> ************************************************* >> N= 3 NUMBER OF CORRECTIONS=25 >> INITIAL VALUES >> F= 2.000000000000000D+00 GNORM= 6.000000000000000D+00 >> ************************************************* >> >> I NFN FUNC GNORM STEPLENGTH >> >> 1 3 6.034482758620692D-01 1.462979547282512D-01 >> 7.758620689655173D-02 >> 2 4 6.019883621059441D-01 1.110925645530035D-01 >> 1.000000000000000D+00 >> 3 5 6.000000000000000D-01 5.606351459942525D-16 >> 1.000000000000000D+00 >> >> THE MINIMIZATION TERMINATED WITHOUT DETECTING ERRORS. >> IFLAG = 0 >> (%o5) [x = 0.3, y = 0.3, z = 0.2] >> >> >> >> -- >> Leo Butler >> SDF Public Access UNIX System - http://sdf.lonestar.org >> > -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From fateman at eecs.berkeley.edu Sun May 13 09:22:24 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 13 May 2012 07:22:24 -0700 Subject: [Maxima] plot2d failed to plot too many discrete points In-Reply-To: <87aa1d23ys.fsf@xc.laptop> References: <87aa1d23ys.fsf@xc.laptop> Message-ID: <4FAFC3A0.7070002@eecs.berkeley.edu> On 5/12/2012 1:33 AM, XeCycle wrote: > Hello, > > I'm trying to plot my computed numbers, roughly millions; then I > found plot2d failed to plot these many points. Even, it failed > to plot 65536 points --- should I check my compiler? > > I'm using SBCL on x86_64 Linux, and the plot function was called > From Lisp. > > Or just tell me Maxima is not well suited to numeric computing, > then convince me to try something else. > > I'm considering to output these numbers to a pipe and spawn the > gnuplot myself, is it recommended? > > Thank you. > > I have fairly nice computer display, and it has about 1.6 million discrete pixels. Plotting 2 million discrete non-overlapping points on it would not be possible. Perhaps you would find difficulties regardless of the plotting program. RJF From toy.raymond at gmail.com Sun May 13 11:30:37 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 13 May 2012 09:30:37 -0700 Subject: [Maxima] plot2d failed to plot too many discrete points In-Reply-To: <87aa1d23ys.fsf@xc.laptop> References: <87aa1d23ys.fsf@xc.laptop> Message-ID: <4FAFE1AD.2090608@gmail.com> On 5/12/12 1:33 AM, XeCycle wrote: > Hello, > > I'm trying to plot my computed numbers, roughly millions; then I > found plot2d failed to plot these many points. Even, it failed > to plot 65536 points --- should I check my compiler? My car is broken. Please fix it. Please provide more information on exactly what "failed to plot" means. On the other hand: (%i41) zz:makelist(k,k,0,100000)$ (%i42) plot2d([discrete,zz,zz]); produces a nice straight line for me (current git, cmucl, osx). > > I'm using SBCL on x86_64 Linux, and the plot function was called > From Lisp. > > Or just tell me Maxima is not well suited to numeric computing, > then convince me to try something else. Could be true. Hard to tell from what you've given us. > > I'm considering to output these numbers to a pipe and spawn the > gnuplot myself, is it recommended? Maxima already does that. (Well, the default is to pipe the data to gnuplot.) You could just save the data to a file and see if gnuplot will plot them. That would at least give way more information on whether it's gnuplot or maxima. Ray From toy.raymond at gmail.com Sun May 13 11:30:37 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 13 May 2012 09:30:37 -0700 Subject: [Maxima] plot2d failed to plot too many discrete points In-Reply-To: <87aa1d23ys.fsf@xc.laptop> References: <87aa1d23ys.fsf@xc.laptop> Message-ID: <4FAFE1AD.2090608@gmail.com> On 5/12/12 1:33 AM, XeCycle wrote: > Hello, > > I'm trying to plot my computed numbers, roughly millions; then I > found plot2d failed to plot these many points. Even, it failed > to plot 65536 points --- should I check my compiler? My car is broken. Please fix it. Please provide more information on exactly what "failed to plot" means. On the other hand: (%i41) zz:makelist(k,k,0,100000)$ (%i42) plot2d([discrete,zz,zz]); produces a nice straight line for me (current git, cmucl, osx). > > I'm using SBCL on x86_64 Linux, and the plot function was called > From Lisp. > > Or just tell me Maxima is not well suited to numeric computing, > then convince me to try something else. Could be true. Hard to tell from what you've given us. > > I'm considering to output these numbers to a pipe and spawn the > gnuplot myself, is it recommended? Maxima already does that. (Well, the default is to pipe the data to gnuplot.) You could just save the data to a file and see if gnuplot will plot them. That would at least give way more information on whether it's gnuplot or maxima. Ray From villate at fe.up.pt Sun May 13 12:00:57 2012 From: villate at fe.up.pt (Jaime Villate) Date: Sun, 13 May 2012 18:00:57 +0100 Subject: [Maxima] plot2d failed to plot too many discrete points In-Reply-To: <4FAFE1AD.2090608@gmail.com> References: <87aa1d23ys.fsf@xc.laptop> <4FAFE1AD.2090608@gmail.com> Message-ID: <4FAFE8C9.60408@fe.up.pt> Hi Ray, I've been getting all of your messages to the list in duplicate, because your e-mail client is putting the e-mail address on teh list in both the "To:" and "Cc:". Coul you please fix that? Best regards, Jaime From toy.raymond at gmail.com Sun May 13 12:33:03 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 13 May 2012 10:33:03 -0700 Subject: [Maxima] plot2d failed to plot too many discrete points In-Reply-To: <4FAFE8C9.60408@fe.up.pt> References: <87aa1d23ys.fsf@xc.laptop> <4FAFE1AD.2090608@gmail.com> <4FAFE8C9.60408@fe.up.pt> Message-ID: On 5/13/12 10:00 AM, Jaime Villate wrote: > Hi Ray, > I've been getting all of your messages to the list in duplicate, because > your > e-mail client is putting the e-mail address on teh list in both the > "To:" and "Cc:". > Coul you please fix that? Sorry. I sometimes use gmane and sometimes the list to read and I forget, so I use reply all incorrectly. Ray From jfr.maurel at gmail.com Sun May 13 13:07:41 2012 From: jfr.maurel at gmail.com (=?ISO-8859-1?Q?Jean-Fran=E7ois_MAUREL?=) Date: Sun, 13 May 2012 20:07:41 +0200 Subject: [Maxima] part(-q/p) Message-ID: <4FAFF86D.2060001@gmail.com> Hi, I am new to maxima and I have trouble with part(). This works as expected: z:q/p; part(z,0); part(z,1); part(z,2); (%o48) q/p (%o49) "/" (%o50) q (%o51) p This doesn't: z:-q/p; part(z,0); part(z,1); part(z,2); (%o52) -q/p (%o53) "-" (%o54) q/p part: fell off the end. Could you please tell me what I am missing here to pick (-q) and p ? Regards JF Maurel PS: thank you to all developpers for this fantastic software. From jfr.maurel at gmail.com Sun May 13 13:25:30 2012 From: jfr.maurel at gmail.com (=?ISO-8859-1?Q?Jean-Fran=E7ois_MAUREL?=) Date: Sun, 13 May 2012 20:25:30 +0200 Subject: [Maxima] part(-q/p) In-Reply-To: <4FAFF86D.2060001@gmail.com> References: <4FAFF86D.2060001@gmail.com> Message-ID: <4FAFFC9A.2090508@gmail.com> Hi, forgot to say: wxMaxima 12.01.0 (%o147) build_info("5.27.0","2012-04-24 08:52:03","i686-pc-mingw32","GNU Common Lisp (GCL)","GCL 2.6.8") Windows vista Regards JF Maurel From miguelmarinho at seoutopia.com Sun May 13 07:28:31 2012 From: miguelmarinho at seoutopia.com (Miguel Marinho) Date: Sun, 13 May 2012 13:28:31 +0100 Subject: [Maxima] Function with other function as argument and other functions as output Message-ID: <4FAFA8EF.7010805@seoutopia.com> Dear Sir/Madam, I would like to creat a function with other function as argument, example: test(x(t)):=block([VelocidadeInst(t),VelocidadeEsc(t),T(t),vector_unit(u)], define(VelocidadeInst(t), diff(x, t)), define(VelocidadeEsc(t), sqrt(VelocidadeInst(t).VelocidadeInst(t))), vetor_unit(u):=((1/(sqrt(u.u)))*u), T(t):=''(vetor_unit(VelocidadeInst(t)))); where x(t) could be something like: x(t):=[t,cos(t)], so when I ran the function test(x(t)) it should return the functions: VelocidadeInst(t),VelocidadeEsc(t) and T(t), instead of "define: in definition of test, found bad argument x(t)". Thank you, Yours faithfully, Miguel Marinho From XeCycle at Gmail.com Sun May 13 09:43:34 2012 From: XeCycle at Gmail.com (XeCycle) Date: Sun, 13 May 2012 22:43:34 +0800 Subject: [Maxima] plot2d failed to plot too many discrete points References: <87aa1d23ys.fsf@xc.laptop> <4FAFC3A0.7070002@eecs.berkeley.edu> Message-ID: <87likw87l5.fsf@xc.laptop> Richard Fateman writes: [...] > I have fairly nice computer display, and it has about 1.6 > million discrete pixels. > Plotting 2 million discrete non-overlapping points on it would > not be possible. > Perhaps you would find difficulties regardless of the plotting program. > RJF You're missing the point. This many numbers are needed for my computation, and will be further processed; now I want to have an impression on how it looks like, so I tried to plot it. Now that it cannot plot something like this, I'll have to write something to decide which points to plot, that's an overkill. Such a process is what I need, but didn't find it in the docs. So asking here, not provided yet? -- Carl Lei (XeCycle) Department of Physics, Shanghai Jiao Tong University OpenPGP public key: 7795E591 Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 489 bytes Desc: not available URL: From robert.dodier at gmail.com Sun May 13 15:19:22 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 13 May 2012 20:19:22 +0000 (UTC) Subject: [Maxima] plot2d failed to plot too many discrete points References: <87aa1d23ys.fsf@xc.laptop> Message-ID: On 2012-05-12, XeCycle wrote: > I'm trying to plot my computed numbers, roughly millions; then I > found plot2d failed to plot these many points. Even, it failed > to plot 65536 points --- should I check my compiler? > > I'm using SBCL on x86_64 Linux, and the plot function was called > From Lisp. Some investigation shows that SBCL's implementation of COPY-TREE fails for long lists. Here's what the CL spec says about COPY-TREE: "the result is a new cons of the results of calling copy-tree on the car and cdr of tree." (http://www.lispworks.com/documentation/lw60/CLHS/Body/f_cp_tre.htm) Here's an example. X is a list of 65536 elements. SBCL 1.0.49 on Linux. ----- begin output ----- * (setq y (copy-tree x)) INFO: Control stack guard page unprotected Control stack guard page temporarily disabled: proceed with caution debugger invoked on a SB-KERNEL::CONTROL-STACK-EXHAUSTED in thread #: Control stack exhausted (no more space for function call frames). This is probably due to heavily nested or infinitely recursive function calls, or a tail call that SBCL cannot or has not optimized away. ----- end output ------ COPY-TREE is called eventually from plot2d([discrete, ...]). See src/plot.lisp (there is only one call to COPY-TREE there). To the developers: is there any reason to prefer COPY-TREE to COPY-LIST in src/plot.lisp? > I'm considering to output these numbers to a pipe and spawn the > gnuplot myself, is it recommended? One possibility is to write the numbers to a file, then you can experiment with different ways to plot them. Or edit src/plot.lisp to replace COPY-TREE with COPY-LIST, load(plot); in your Maxima session, and try again. Incidentally, it appears that formatting floats for output is pretty slow in all of the Lisps that I've tried today (SBCL, ECL, CMUCL, Clisp). If you have a million points, you might end up waiting a long time (several minutes, I'll guess) for Maxima to construct the Gnuplot data. HTH Robert Dodier From robert.dodier at gmail.com Sun May 13 15:29:38 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 13 May 2012 20:29:38 +0000 (UTC) Subject: [Maxima] plot2d failed to plot too many discrete points References: <87aa1d23ys.fsf@xc.laptop> <4FAFE1AD.2090608@gmail.com> Message-ID: On 2012-05-13, Raymond Toy wrote: > My car is broken. Please fix it. Forgive me for being blunt, but this isn't constructive. FWIW Robert Dodier From fateman at eecs.berkeley.edu Sun May 13 16:09:56 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 13 May 2012 14:09:56 -0700 Subject: [Maxima] plot2d failed to plot too many discrete points In-Reply-To: <87likw87l5.fsf@xc.laptop> References: <87aa1d23ys.fsf@xc.laptop> <4FAFC3A0.7070002@eecs.berkeley.edu> <87likw87l5.fsf@xc.laptop> Message-ID: <4FB02324.4080709@eecs.berkeley.edu> On 5/13/2012 7:43 AM, XeCycle wrote: > Richard Fateman writes: > > [...] > >> I have fairly nice computer display, and it has about 1.6 >> million discrete pixels. >> Plotting 2 million discrete non-overlapping points on it would >> not be possible. >> Perhaps you would find difficulties regardless of the plotting program. >> RJF > You're missing the point. This many numbers are needed for my > computation, and will be further processed; now I want to have an > impression on how it looks like, so I tried to plot it. Let us say that you have a display which is 1200X1000 pixels. Allocate a bit array of that size. Clear it to zeros. Run through your discrete points and each time you get close enough (scaled) to one of those points, turn it to a one. send the bit array to some display program. Probably would take you 1/1000 of the time. Oh, and if you were doing this in a numerical system, you should probably do the same thing. > Now that > it cannot plot something like this, I'll have to write something > to decide which points to plot, that's an overkill. Your original conception of what should be done can be re-visited. > > Such a process is what I need, but didn't find it in the docs. > So asking here, not provided yet? > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun May 13 16:26:46 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 13 May 2012 17:26:46 -0400 Subject: [Maxima] Function with other function as argument and other functions as output In-Reply-To: <4FAFA8EF.7010805@seoutopia.com> References: <4FAFA8EF.7010805@seoutopia.com> Message-ID: There are several technical problems with your definition: * Function and block arguments should be symbols, not expressions like x(t). * ''(...) evaluates at the time the expression is *read*, not the time it is evaluated, so this almost certainly doesn't do what you want, But actually you don't need any of that. Instead of defining "functions", it is easier just to define *expressions*, e.g. test(expr) := block([vi,ve,T,vu], vi: diff(expr,'t), ve: sqrt(vi . vi) vu : ..., T: subst(vu, 't , ...) etc. -s On Sun, May 13, 2012 at 8:28 AM, Miguel Marinho wrote: > Dear Sir/Madam, > > I would like to creat a function with other function as argument, example: > > test(x(t)):=block([**VelocidadeInst(t),**VelocidadeEsc(t),T(t),vector_** > unit(u)], > define(VelocidadeInst(t), diff(x, t)), > define(VelocidadeEsc(t), sqrt(VelocidadeInst(t).** > VelocidadeInst(t))), > vetor_unit(u):=((1/(sqrt(u.u))**)*u), > T(t):=''(vetor_unit(**VelocidadeInst(t)))); > > where x(t) could be something like: x(t):=[t,cos(t)], so when I ran the > function test(x(t)) it should return the functions: VelocidadeInst(t),**VelocidadeEsc(t) > and T(t), instead of "define: in definition of test, found bad argument > x(t)". > > Thank you, > Yours faithfully, > Miguel Marinho > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun May 13 16:51:22 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 13 May 2012 17:51:22 -0400 Subject: [Maxima] Function with other function as argument and other functions as output In-Reply-To: <4FB02AE3.6070206@seoutopia.com> References: <4FAFA8EF.7010805@seoutopia.com> <4FB02AE3.6070206@seoutopia.com> Message-ID: subst(2,'t,vi) On Sun, May 13, 2012 at 5:42 PM, Miguel Marinho wrote: > Dear Stavros Macrakis, > > First of all , I would like to thank you for your reply. > > Secondly, your way is working fine, but there is just a little problem, > doing this I'm defining "vi" without any argument, imagine I want to > calculate vi(2) , is there any way? > > Once again, thank you! > > Yours Sincerely, > Miguel Marinho > > > Em 13-05-2012 22:26, Stavros Macrakis escreveu: > > There are several technical problems with your definition: > > * Function and block arguments should be symbols, not expressions > like x(t). > * ''(...) evaluates at the time the expression is *read*, not the time > it is evaluated, so this almost certainly doesn't do what you want, > > But actually you don't need any of that. Instead of defining > "functions", it is easier just to define *expressions*, e.g. > > test(expr) := block([vi,ve,T,vu], > vi: diff(expr,'t), > ve: sqrt(vi . vi) > vu : ..., > T: subst(vu, 't , ...) > etc. > > -s > > On Sun, May 13, 2012 at 8:28 AM, Miguel Marinho < > miguelmarinho at seoutopia.com> wrote: > >> Dear Sir/Madam, >> >> I would like to creat a function with other function as argument, example: >> >> >> test(x(t)):=block([VelocidadeInst(t),VelocidadeEsc(t),T(t),vector_unit(u)], >> define(VelocidadeInst(t), diff(x, t)), >> define(VelocidadeEsc(t), >> sqrt(VelocidadeInst(t).VelocidadeInst(t))), >> vetor_unit(u):=((1/(sqrt(u.u)))*u), >> T(t):=''(vetor_unit(VelocidadeInst(t)))); >> >> where x(t) could be something like: x(t):=[t,cos(t)], so when I ran the >> function test(x(t)) it should return the functions: >> VelocidadeInst(t),VelocidadeEsc(t) and T(t), instead of "define: in >> definition of test, found bad argument x(t)". >> >> Thank you, >> Yours faithfully, >> Miguel Marinho >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sun May 13 16:52:23 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 13 May 2012 14:52:23 -0700 Subject: [Maxima] plot2d failed to plot too many discrete points In-Reply-To: References: <87aa1d23ys.fsf@xc.laptop> Message-ID: On 5/13/12 1:19 PM, Robert Dodier wrote: > On 2012-05-12, XeCycle wrote: > >> I'm trying to plot my computed numbers, roughly millions; then I >> found plot2d failed to plot these many points. Even, it failed >> to plot 65536 points --- should I check my compiler? >> >> I'm using SBCL on x86_64 Linux, and the plot function was called >> From Lisp. > > Some investigation shows that SBCL's implementation of COPY-TREE fails > for long lists. Here's what the CL spec says about COPY-TREE: "the > result is a new cons of the results of calling copy-tree on the car and > cdr of tree." > (http://www.lispworks.com/documentation/lw60/CLHS/Body/f_cp_tre.htm) > > Here's an example. X is a list of 65536 elements. SBCL 1.0.49 on Linux. > > ----- begin output ----- > * (setq y (copy-tree x)) > INFO: Control stack guard page unprotected > Control stack guard page temporarily disabled: proceed with caution > > debugger invoked on a SB-KERNEL::CONTROL-STACK-EXHAUSTED in thread > #: > Control stack exhausted (no more space for function call frames). > This is probably due to heavily nested or infinitely recursive function > calls, or a tail call that SBCL cannot or has not optimized away. > ----- end output ------ > > COPY-TREE is called eventually from plot2d([discrete, ...]). > See src/plot.lisp (there is only one call to COPY-TREE there). > > To the developers: is there any reason to prefer COPY-TREE to COPY-LIST > in src/plot.lisp? Maybe because it's not a list but a tree (or a list of lists)? I didn't look closely to see if that matters or not. I'm sure the sbcl folks would fix such a bug very quickly. >> I'm considering to output these numbers to a pipe and spawn the >> gnuplot myself, is it recommended? > > One possibility is to write the numbers to a file, then you can > experiment with different ways to plot them. > > Or edit src/plot.lisp to replace COPY-TREE with COPY-LIST, load(plot); > in your Maxima session, and try again. > > Incidentally, it appears that formatting floats for output is pretty > slow in all of the Lisps that I've tried today (SBCL, ECL, CMUCL, > Clisp). If you have a million points, you might end up waiting a long I know sbcl and cmucl have fairly slow float printers because both try pretty hard to make sure the output is printed in a way that when read in the same number results. Probably doesn't matter if you're using format with less than full precision, but I think there's only one routine that does the conversion. Ray From macrakis at alum.mit.edu Sun May 13 17:13:14 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 13 May 2012 18:13:14 -0400 Subject: [Maxima] part(-q/p) In-Reply-To: <4FAFF86D.2060001@gmail.com> References: <4FAFF86D.2060001@gmail.com> Message-ID: z: -q/p$ Maxima considers the "external" form of this expression to be "-"("/"(q,p)), hence: part(z,0) => "-" part(z,1) => q/p part(z,1,1) => q part(z,1,2)=> p The internal form is "*"(-1,"^"(p,-1),q), hence: inpart(z,0) => "*" inpart(z,1) => -1 etc. If p and q are both numbers, then the external form is the same, but the internal form of e.g. -2/3 is "/"(-2,3). -s On Sun, May 13, 2012 at 2:07 PM, Jean-Fran?ois MAUREL wrote: > Hi, > > I am new to maxima and I have trouble with part(). > > This works as expected: > z:q/p; > part(z,0); > part(z,1); > part(z,2); > (%o48) q/p > (%o49) "/" > (%o50) q > (%o51) p > This doesn't: > z:-q/p; > part(z,0); > part(z,1); > part(z,2); > (%o52) -q/p > (%o53) "-" > (%o54) q/p > part: fell off the end. > > Could you please tell me what I am missing here to pick (-q) and p ? > > Regards > > JF Maurel > > PS: thank you to all developpers for this fantastic software. > ______________________________**_________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/**mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sun May 13 17:38:19 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 13 May 2012 15:38:19 -0700 Subject: [Maxima] float erf(%i) In-Reply-To: <957AEA92A190428FA1419B0F1EB49E70@edwinc367e16bd> References: <957AEA92A190428FA1419B0F1EB49E70@edwinc367e16bd> Message-ID: On 5/12/12 9:27 AM, Edwin Woollett wrote: > On May 12, 2012, Raymond Toy wrote: > ----------------------------- >>> I recall some mailing list discussion of getting >>> float to work with erf(%i) during the last year. >>> >>> Using latest gcl 5.27.0 shows that float doesn't >>> work here. >> >> Oops. Is there a bug report for this? If not, can you add one? > > done: bug #3526111 > Thanks! It should be fixed now. Ray From toy.raymond at gmail.com Sun May 13 17:41:53 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 13 May 2012 15:41:53 -0700 Subject: [Maxima] integrate ( exp (x^3), x, 0, 1) still wrong In-Reply-To: <00F5E3314766432E84CD8ECDB7327181@edwinc367e16bd> References: <00F5E3314766432E84CD8ECDB7327181@edwinc367e16bd> Message-ID: On 5/11/12 4:02 PM, Edwin Woollett wrote: > -------------------------------------------------- > case exp(x^5) over (1,2) > domain:complex greatly improves answer > but large incorrect imaginary part > and real part only accurate to two sig. figures. I've written a bug report for that. I have a possible solution, but need to test it some more. I don't think your solution in nint of using bfloats is the correct solution. It will work for many cases, but not all. For example, gamma_incomplete(10.3b0,-100b0) is not very accurate with fpprec=16. It's better with fpprec = 32. Ray From robert.dodier at gmail.com Sun May 13 18:54:03 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 13 May 2012 23:54:03 +0000 (UTC) Subject: [Maxima] plot2d failed to plot too many discrete points References: <87aa1d23ys.fsf@xc.laptop> Message-ID: On 2012-05-13, Raymond Toy wrote: >> To the developers: is there any reason to prefer COPY-TREE to COPY-LIST >> in src/plot.lisp? > > Maybe because it's not a list but a tree (or a list of lists)? I didn't > look closely to see if that matters or not. I think sometimes it's just a list and sometimes it's a more complex expression. COPY-TREE is now called to prevent the plotting functions from changing the original data. I don't know if COPY-LIST is sufficient for that purpose. > I'm sure the sbcl folks would fix such a bug very quickly. Reported as: https://bugs.launchpad.net/sbcl/+bug/998926 > I know sbcl and cmucl have fairly slow float printers because both try > pretty hard to make sure the output is printed in a way that when read > in the same number results. Well, it's entirely reasonable to preserve readability for floats, but it does make it less convenient to process a sizeable data set ... I can see a couple of things that would make it faster. (1) Gnuplot could read binary data so no printing & parsing is needed. (2) Maybe scanf or whatever is Gnuplot's number parser could recognize the bytes of a float encoded as hexadecimal. E.g. #f4DEADBEEF => some number. Or maybe #f8(mantissa,scale,sign) since those fields are conveniently returned by INTEGER-DECODE-FLOAT. (1) and (2) aren't human-readable (for most humans I guess) but it could make machine-to-machine communication faster and unambiguous. Yes, I am daydreaming here. best Robert Dodier From rich.hennessy at verizon.net Sun May 13 18:58:27 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 13 May 2012 19:58:27 -0400 Subject: [Maxima] wxdraw2d Message-ID: Ok, no reply. Maybe if I attach the input. Here it is, Rich From: Richard Hennessy Sent: Saturday, May 12, 2012 7:01 PM To: Maxima List Subject: Re: wxdraw2d I meant the list is in the form [[x1,y1],[x2,y2],...[xn,yn]] of floats or big floats, it doesn?t matter which. From: Richard Hennessy Sent: Saturday, May 12, 2012 6:54 PM To: Maxima List Subject: wxdraw2d I have noticed a bug in wxplo2d with the points() graphic object. draw2d(points_joined=true,color=blue, point_type=dot,point_size=1,points(N)); works fine most of the time but sometimes it just echo?s the input to the wMaxima output. wxdraw2d(points_joined=true,color=blue, point_type=dot,point_size=1,points(N)); gives an empty window with a big x in it and the message Error C:/Users/Richard Hennessy/maxout_2.png wxWidgets: 2.8.12 Unicode Support: no Maxima version: 5.27.0 Lisp: GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) build_info(); build_info("5.27.0","2012-05-08 11:27:57","i686-pc-mingw32","GNU Common Lisp (GCL)","GCL 2.6.8") I am using Windows 7 professional. The list N is 1200 points long and in the form [[x1,y1],[x2],[y2],...[xn],[yn]] of floats or big floats, it doesn?t matter which. Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ESolver 17.txt URL: From fateman at eecs.berkeley.edu Sun May 13 19:11:21 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 13 May 2012 17:11:21 -0700 Subject: [Maxima] plot2d failed to plot too many discrete points In-Reply-To: <4FB02324.4080709@eecs.berkeley.edu> References: <87aa1d23ys.fsf@xc.laptop> <4FAFC3A0.7070002@eecs.berkeley.edu> <87likw87l5.fsf@xc.laptop> <4FB02324.4080709@eecs.berkeley.edu> Message-ID: <4FB04DA9.7000207@eecs.berkeley.edu> Another idea On 5/13/2012 2:09 PM, Richard Fateman wrote: > On 5/13/2012 7:43 AM, XeCycle wrote: >> Richard Fateman writes: >> >> [...] >> >>> I have fairly nice computer display, and it has about 1.6 >>> million discrete pixels. >>> Plotting 2 million discrete non-overlapping points on it would >>> not be possible. >>> Perhaps you would find difficulties regardless of the plotting program. >>> RJF >> You're missing the point. This many numbers are needed for my >> computation, and will be further processed; now I want to have an >> impression on how it looks like, so I tried to plot it. If you want to know what it looks like, how about plotting only every 1000th point. That still gives you several thousand points plotted, and that may give you an impression. Or you could take points that are some random number between 1 and 2000 apart. Do it several times. If the plot looks the same each time, you have some info to go on. It cannot be that each of the millions of points has something to contribute, for the reason I gave previously. I have frequently found that persons approach solving a problem by computer with insufficient consideration for the limitations of computing, requiring huge amounts of work for negligible payoff, or involving long sequences of arithmetic without considering that the result may have lost all significant digits to essentially random bits of round-off. Sometimes this doesn't matter because the computation is supposed to mirror some physical phenomenon which cannot ever be exhibited in reality and whose further exploration by computer simulation is essentially irrelevant except as an academic exercise. Computer algebra systems can sometimes be used for such pointless exercises where usual numerical computation can't be used. You haven't told us anything much about your exercise and whether there is some reason you are using Maxima instead of (say) Matlab. The fact that something is not in a system (or is not documented...) or "doesn't seem to work" is occasionally a useful hint that maybe it is not a sensible thing to do. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Sun May 13 19:51:40 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 13 May 2012 20:51:40 -0400 Subject: [Maxima] plot2d failed to plot too many discrete points In-Reply-To: <4FB04DA9.7000207@eecs.berkeley.edu> References: <87aa1d23ys.fsf@xc.laptop> <4FAFC3A0.7070002@eecs.berkeley.edu> <87likw87l5.fsf@xc.laptop> <4FB02324.4080709@eecs.berkeley.edu> <4FB04DA9.7000207@eecs.berkeley.edu> Message-ID: As a student I don?t see the irrelevance of academic exercises. IMHO. Rich From: Richard Fateman Sent: Sunday, May 13, 2012 8:11 PM To: XeCycle Cc: maxima at math.utexas.edu Subject: Re: [Maxima] plot2d failed to plot too many discrete points Another idea On 5/13/2012 2:09 PM, Richard Fateman wrote: On 5/13/2012 7:43 AM, XeCycle wrote: Richard Fateman mailto:fateman at eecs.berkeley.edu writes: [...] I have fairly nice computer display, and it has about 1.6 million discrete pixels. Plotting 2 million discrete non-overlapping points on it would not be possible. Perhaps you would find difficulties regardless of the plotting program. RJF You're missing the point. This many numbers are needed for my computation, and will be further processed; now I want to have an impression on how it looks like, so I tried to plot it. If you want to know what it looks like, how about plotting only every 1000th point. That still gives you several thousand points plotted, and that may give you an impression. Or you could take points that are some random number between 1 and 2000 apart. Do it several times. If the plot looks the same each time, you have some info to go on. It cannot be that each of the millions of points has something to contribute, for the reason I gave previously. I have frequently found that persons approach solving a problem by computer with insufficient consideration for the limitations of computing, requiring huge amounts of work for negligible payoff, or involving long sequences of arithmetic without considering that the result may have lost all significant digits to essentially random bits of round-off. Sometimes this doesn't matter because the computation is supposed to mirror some physical phenomenon which cannot ever be exhibited in reality and whose further exploration by computer simulation is essentially irrelevant except as an academic exercise. Computer algebra systems can sometimes be used for such pointless exercises where usual numerical computation can't be used. You haven't told us anything much about your exercise and whether there is some reason you are using Maxima instead of (say) Matlab. The fact that something is not in a system (or is not documented...) or "doesn't seem to work" is occasionally a useful hint that maybe it is not a sensible thing to do. RJF -------------------------------------------------------------------------------- _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From XeCycle at Gmail.com Sun May 13 21:23:47 2012 From: XeCycle at Gmail.com (XeCycle) Date: Mon, 14 May 2012 10:23:47 +0800 Subject: [Maxima] plot2d failed to plot too many discrete points References: <87aa1d23ys.fsf@xc.laptop> <4FAFE1AD.2090608@gmail.com> Message-ID: <877gwfts98.fsf@xc.laptop> Raymond Toy writes: [...] > Please provide more information on exactly what "failed to plot" means. > On the other hand: > > (%i41) zz:makelist(k,k,0,100000)$ > (%i42) plot2d([discrete,zz,zz]); > > produces a nice straight line for me (current git, cmucl, osx). Sorry for not enough info. I generated some sequence similar to an oscillating signal, in bfloat; haven't change fpprec though. Then FFT it, take the real part and try to plot it. It failed, said control stack exhausted. I executed that in Emacs SLIME, if this is relevant to stack size please tell me. P.S. Your example failed for me too. I ran `maxima' from command line, version being the one in Arch Linux repo. Error message: --8<---------------cut here---------------start------------->8--- INFO: Control stack guard page unprotected Control stack guard page temporarily disabled: proceed with caution Maxima encountered a Lisp error: Control stack exhausted (no more space for function call frames). This is probably due to heavily nested or infinitely recursive function calls, or a tail call that SBCL cannot or has not optimized away. --8<---------------cut here---------------end--------------->8--- [...] > Maxima already does that. (Well, the default is to pipe the data to > gnuplot.) You could just save the data to a file and see if gnuplot > will plot them. That would at least give way more information on > whether it's gnuplot or maxima. I know the process, but a stack overflow is not likely to bring up a lisp debugger for me. -- Carl Lei (XeCycle) Department of Physics, Shanghai Jiao Tong University OpenPGP public key: 7795E591 Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 489 bytes Desc: not available URL: From XeCycle at Gmail.com Sun May 13 21:38:50 2012 From: XeCycle at Gmail.com (XeCycle) Date: Mon, 14 May 2012 10:38:50 +0800 Subject: [Maxima] plot2d failed to plot too many discrete points References: <87aa1d23ys.fsf@xc.laptop> <4FAFC3A0.7070002@eecs.berkeley.edu> <87likw87l5.fsf@xc.laptop> <4FB02324.4080709@eecs.berkeley.edu> <4FB04DA9.7000207@eecs.berkeley.edu> Message-ID: <873973trk5.fsf@xc.laptop> Richard Fateman writes: > Another idea > > On 5/13/2012 2:09 PM, Richard Fateman wrote: >> On 5/13/2012 7:43 AM, XeCycle wrote: >>> Richard Fateman writes: >>> >>> [...] >>> >>>> I have fairly nice computer display, and it has about 1.6 >>>> million discrete pixels. >>>> Plotting 2 million discrete non-overlapping points on it would >>>> not be possible. >>>> Perhaps you would find difficulties regardless of the plotting program. >>>> RJF >>> You're missing the point. This many numbers are needed for my >>> computation, and will be further processed; now I want to have an >>> impression on how it looks like, so I tried to plot it. > > If you want to know what it looks like, how about plotting only every > 1000th point. > That still gives you several thousand points plotted, and that may give > you an impression. > Or you could take points that are some random number between 1 and 2000 > apart. > Do it several times. > If the plot looks the same each time, you have some info to go on. > > It cannot be that each of the millions of points has something to > contribute, for the > reason I gave previously. Thanks for your hint, but I have some better algorithms. Perhaps taking its second order differenial and scan through that, but it's not easy to implement a perfect one. Yes for now I just want to have an impression, but as I go further I may need to analyze them more carefully, better algorithms may be needed. > I have frequently found that persons approach solving a problem by computer > with insufficient consideration for the limitations of computing, > requiring huge > amounts of work for negligible payoff, or involving long sequences of > arithmetic > without considering that the result may have lost all significant digits > to essentially > random bits of round-off. > > Sometimes this doesn't matter because the computation is supposed to mirror > some physical phenomenon which cannot ever be exhibited in reality and whose > further exploration by computer simulation is essentially irrelevant > except as an > academic exercise. Computer algebra systems can sometimes be used for > such pointless exercises where usual numerical computation can't be used. > You haven't told us anything much about your exercise and whether there > is some reason you are using Maxima instead of (say) Matlab. Yeah you guys are assuming I'm doing an excersise. But it's, rather, part of my research. The point is that I want to use Common Lisp, and Maxima seems doing it natively, I want to give it a try. I know those FFI interfaces to other numerical systems, and if Maxima turned me down, I'd go for them. > The fact that something is not in a system (or is not documented...) or > "doesn't seem to work" is occasionally a useful hint that maybe it is > not a sensible thing to do. So numerical analysis is not important in a computer algebra system, right? -- Carl Lei (XeCycle) Department of Physics, Shanghai Jiao Tong University OpenPGP public key: 7795E591 Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 489 bytes Desc: not available URL: From XeCycle at Gmail.com Sun May 13 21:42:46 2012 From: XeCycle at Gmail.com (XeCycle) Date: Mon, 14 May 2012 10:42:46 +0800 Subject: [Maxima] plot2d failed to plot too many discrete points References: <87aa1d23ys.fsf@xc.laptop> Message-ID: <87y5ovsct5.fsf@xc.laptop> Robert Dodier writes: [...] > Some investigation shows that SBCL's implementation of COPY-TREE fails > for long lists. Here's what the CL spec says about COPY-TREE: "the > result is a new cons of the results of calling copy-tree on the car and > cdr of tree." > (http://www.lispworks.com/documentation/lw60/CLHS/Body/f_cp_tre.htm) > > Here's an example. X is a list of 65536 elements. SBCL 1.0.49 on Linux. > > ----- begin output ----- > * (setq y (copy-tree x)) > INFO: Control stack guard page unprotected > Control stack guard page temporarily disabled: proceed with caution > > debugger invoked on a SB-KERNEL::CONTROL-STACK-EXHAUSTED in thread > #: > Control stack exhausted (no more space for function call frames). > This is probably due to heavily nested or infinitely recursive function > calls, or a tail call that SBCL cannot or has not optimized away. > ----- end output ------ > > COPY-TREE is called eventually from plot2d([discrete, ...]). > See src/plot.lisp (there is only one call to COPY-TREE there). Thanks, this is exactly the problem for me, the stack also shows many recursive COPY-TREE being called. > To the developers: is there any reason to prefer COPY-TREE to COPY-LIST > in src/plot.lisp? > >> I'm considering to output these numbers to a pipe and spawn the >> gnuplot myself, is it recommended? > > One possibility is to write the numbers to a file, then you can > experiment with different ways to plot them. > > Or edit src/plot.lisp to replace COPY-TREE with COPY-LIST, load(plot); > in your Maxima session, and try again. > > Incidentally, it appears that formatting floats for output is pretty > slow in all of the Lisps that I've tried today (SBCL, ECL, CMUCL, > Clisp). If you have a million points, you might end up waiting a long > time (several minutes, I'll guess) for Maxima to construct the Gnuplot > data. Tried, and seems reasonable for 65536 points; displa that takes like several tens seconds, and slowed down my Emacs quite a bit. -- Carl Lei (XeCycle) Department of Physics, Shanghai Jiao Tong University OpenPGP public key: 7795E591 Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 489 bytes Desc: not available URL: From buggi22 at hotmail.com Mon May 14 01:26:05 2012 From: buggi22 at hotmail.com (Andy L) Date: Mon, 14 May 2012 01:26:05 -0500 Subject: [Maxima] Maxima: lambdas and sublist_indices behaving strangely when acting on symbols Message-ID: Hello, I'm having trouble using sublist_indices on lists of symbols. ?Basically, I'm trying to implement a function that will find the indices at which a given symbol appears within a list of symbols. ?In other words, I want a function f(l,x) which behaves as follows: ? f([x,y,z], x) -> [1]? f([x,y,z], y) -> [2]? f([x,y,z], z) -> [3]? f([x,y,z], a) -> [] Can anyone explain why the following code should yield [1] instead of []? ? f: lambda([l,x], sublist_indices(l, lambda([z], z = x)))$? f([x,y,z], a); ?/* this yields [1] */ The same function behaves as expected when the arguments are strings: ? f(["x","y","z"], "a"); ?/* this yields [], as expected */ An alternate approach reveals some strange behavior: ? k(l,x) := block(? ? [lstrs: map(string, l), xstr: string(x)],? ? display(l,x,lstrs,xstr),? ? sublist_indices(lstrs, lambda([z], z = xstr))? )$? k([x,y,z], a); Here, l is displayed as "[x,y,z]", but lstrs is displayed as "[a,y,z]". ?I don't understand why "x" gets changed to "a" here, or how to prevent that substitution. ?(True, I could get around this by just changing the parameter "x" to some other unlikely name, like "uncommonDummyVar", but that seems fragile & inelegant.) Does anyone have any suggestions on how to implement the behavior I'm looking for? Thanks, ~ Andrew From michael.soegtrop at intel.com Mon May 14 06:18:04 2012 From: michael.soegtrop at intel.com (Soegtrop, Michael) Date: Mon, 14 May 2012 11:18:04 +0000 Subject: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia In-Reply-To: <4FAD3B9A.5060409@eecs.berkeley.edu> References: <83FD4DC40F97654495E2C9AED47658360422E94F@BL2PRD0710MB361.namprd07.prod.outlook.com> <4FABC8A7.8070203@gmail.com> <83FD4DC40F97654495E2C9AED47658360422EA1B@BL2PRD0710MB361.namprd07.prod.outlook.com> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6CEB1@IRSMSX102.ger.corp.intel.com> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6D29A@IRSMSX102.ger.corp.intel.com> <4FAD22E2.7010508@eecs.berkeley.edu> <0F7D3B1B3C4B894D824F5B822E3E5A1706A6D539@IRSMSX102.ger.corp.intel.com> <4FAD3B9A.5060409@eecs.berkeley.edu> Message-ID: <0F7D3B1B3C4B894D824F5B822E3E5A1706A6DBE9@IRSMSX102.ger.corp.intel.com> Dear Prof. Fateman, you convinced me. Personally I probably continue to assume that floating pointer numbers have an implicit +-0.5LSB error, but I understand that other people have other expectations, and I agree that a decent implementation should fulfill all these expectations. A faster reduced precision variant can be done as an option, but precision should be the default. Best regards, Michael From: Richard Fateman [mailto:fateman at eecs.berkeley.edu] Sent: Friday, May 11, 2012 6:18 PM To: Soegtrop, Michael Cc: maxima at math.utexas.edu Subject: Re: [Maxima] cos(1.0d97) with GCL, Clozure, and Julia On 5/11/2012 8:23 AM, Soegtrop, Michael wrote: Dear Prof. Fateman, my background is computational physics and there large exact powers of two are, well, rare. I understand your arguments, but I don't understand what application would justify the extra effort of supporting such high precision range reduction. 1. If a subroutine gives the correct answer except in rare cases, some people would say it is defective. If it can be fixed so that it produces the correct result in all cases, although in rare cases it takes more time, then that is, in my opinion, much better. 2. The fact that you or I don't know of an application where the rare cases occur does not mean it is OK to (without warning) just give wrong answers. 3. The extra effort is (so far as I can tell) the matter of having the programmer do it right once, and using a few extra words of memory. My understanding is that usually that code is not executed, so no one else is penalized in time. Let's look at the case mentioned below of 2^120. Of cause you can represent this number exactly in double precision and you can calculate the sin to 53 bits. But an increment of 1LSB is more than 10^19 pi. I wonder what applications of calculating the sin of a large numbers exist, which jumps angles in increments of more than 10^19 pi. Mathematicians do many odd things. And even more I wonder if such applications are really so important, that they justify the extra effort, from which all applications would suffer? How so? If you want another cosine routine that is faster and gives wrong answers, you can easily construct one that does incorrect fast range reduction and then calls the existing routine. Or for that matter you could copy a Chebyshev approximation or some other polynomial or rational computation. Such things are done for low-precision needs like graphics. Don't get me wrong, I fully support a range reduction with high fixed precision, but in order to process any representable power of two, a variable precision range reduction would be required, and this doesn't make sense in my opinion. I think it is easy to implement a program to avoid variable precision range reduction if it is unnecessary. Regarding the trap: this gives us a way to know which results are exact and which not, but this doesn't help to resolve the computational effort problem unless there would be a sin_exact function, which does support arbitrary precision range reduction, and another sin function which doesn't. It is much easy to implement a sin_fast_and_sloppy function if you have a sin_exact function around. The other way, not so easy. Another problems with traps is, that they are not very feasible with SIMD or parallel processing. The thought in the IEEE design was to allow for NaNs to serve in such cases. That is, if one were truly requiring exact values (as, for example, simulating exact integer arithmetic in floats, where inexact means overflow), then a parallel setup could benefit from inserting a NaN, without interrupting the program flow. The idea that it is OK to get the wrong answer because you got the answer fast in parallel seems to me to be fairly common in some circles. I find this uncomfortable. I particularly find it uncomfortable in the context of symbolic computing systems (when they are extended to do numerics). ..snip.. -------------- next part -------------- An HTML attachment was scrubbed... URL: From volkervannek at googlemail.com Mon May 14 08:58:30 2012 From: volkervannek at googlemail.com (Volker van Nek) Date: Mon, 14 May 2012 15:58:30 +0200 Subject: [Maxima] Maxima: lambdas and sublist_indices behaving strangely when acting on symbols In-Reply-To: References: Message-ID: The answer is: lambda quotes its arguments. Type ? lambda and you get the documentation and examples about lambda. I believe the following does what you want. (%i1) f(l, x) ::= buildq([l : l, x : x, z : gensym()], sublist_indices(l, lambda([z], z = x)))$ (%i2) macroexpand(f([x,y,z], a)); (%o2) sublist_indices([x, y, z], lambda([g33291], g33291 = a)) (%i3) f([x,y,z], a); (%o3) [] (%i4) f([x,y,z], x); (%o4) [1] HTH Volker van Nek 2012/5/14 Andy L > > Hello, > I'm having trouble using sublist_indices on lists of symbols. Basically, > I'm trying to implement a function that will find the indices at which a > given symbol appears within a list of symbols. In other words, I want a > function f(l,x) which behaves as follows: > f([x,y,z], x) -> [1] f([x,y,z], y) -> [2] f([x,y,z], z) -> [3] > f([x,y,z], a) -> [] > Can anyone explain why the following code should yield [1] instead of []? > f: lambda([l,x], sublist_indices(l, lambda([z], z = x)))$ f([x,y,z], > a); /* this yields [1] */ > The same function behaves as expected when the arguments are strings: > f(["x","y","z"], "a"); /* this yields [], as expected */ > An alternate approach reveals some strange behavior: > k(l,x) := block( [lstrs: map(string, l), xstr: string(x)], > display(l,x,lstrs,xstr), sublist_indices(lstrs, lambda([z], z = xstr)) > )$ k([x,y,z], a); > Here, l is displayed as "[x,y,z]", but lstrs is displayed as "[a,y,z]". I > don't understand why "x" gets changed to "a" here, or how to prevent that > substitution. (True, I could get around this by just changing the > parameter "x" to some other unlikely name, like "uncommonDummyVar", but > that seems fragile & inelegant.) > Does anyone have any suggestions on how to implement the behavior I'm > looking for? > > Thanks, > ~ Andrew > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Mon May 14 09:20:49 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 14 May 2012 14:20:49 +0000 (UTC) Subject: [Maxima] Maxima: lambdas and sublist_indices behaving strangely when acting on symbols References: Message-ID: On 2012-05-14, Andy L wrote: > I'm having trouble using sublist_indices on lists of symbols. >?Basically, I'm trying to implement a function that will find the > indices at which a given symbol appears within a list of symbols. > Can anyone explain why the following code should yield [1] instead of []? > ? f: lambda([l,x], sublist_indices(l, lambda([z], z = x)))$? f([x,y,z], a); ?/* this yields [1] */ Well, I was going to go on about lexical versus dynamic scope and Maxima's evaluation policy, but I think the origin of this problem is that there is a bug in a function named 'maybe', which is called by sublist_indices to evaluate the predicate. 'maybe' explicitly evaluates its argument (incidentally contravening Maxima's general one-time evaluation policy) and that causes the confusion you observed. Fixing 'maybe' isn't so easy because (short answer) logical predicates are not simplifying functions. A simple workaround in this case is, I think, to name the argument x% or something else which is unlikely to cause a name collision. Yes, that is a fragile solution. > The same function behaves as expected when the arguments are strings: > ? f(["x","y","z"], "a"); ?/* this yields [], as expected */ It works as expected with strings since a string can only evaluate to itself. HTH Robert Dodier From fateman at eecs.berkeley.edu Mon May 14 09:33:34 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 14 May 2012 07:33:34 -0700 Subject: [Maxima] plot2d failed to plot too many discrete points In-Reply-To: <873973trk5.fsf@xc.laptop> References: <87aa1d23ys.fsf@xc.laptop> <4FAFC3A0.7070002@eecs.berkeley.edu> <87likw87l5.fsf@xc.laptop> <4FB02324.4080709@eecs.berkeley.edu> <4FB04DA9.7000207@eecs.berkeley.edu> <873973trk5.fsf@xc.laptop> Message-ID: <4FB117BE.7010509@eecs.berkeley.edu> On 5/13/2012 7:38 PM, XeCycle wrote: > >> The fact that something is not in a system (or is not documented...) or >> "doesn't seem to work" is occasionally a useful hint that maybe it is >> not a sensible thing to do. > So numerical analysis is not important in a computer algebra > system, right? A careful numerical analyst would generally aim to do a modest amount of sensible computation. Are you thinking that you are doing numerical analysis and that Maxima is not supportive of it? I am not sure that copying huge amounts of data and waiting for programs to format floating point numbers is numerical analysis :) Careful numerical analysis has recently become less important, especially with fast computers and with computer algebra systems you can almost always increase the precision. Still, some numerical analysis knowledge is useful. :) RJF > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: From emaevskiy at mail.ru Mon May 14 14:03:43 2012 From: emaevskiy at mail.ru (Evgeniy Maevskiy) Date: Mon, 14 May 2012 19:03:43 +0000 (UTC) Subject: [Maxima] List and Array indexing Message-ID: Good day for all. There are some problems... kill(x,a)$ x:makelist(x[2*k/(k^2+1)],k,-2,3); x[1]:a$ x; x[0]; x[-4/5]; listp(x); arrayinfo(x); kill(x,a)$ x[1]:a$ x:makelist(x[2*k/(k^2+1)],k,-2,3); x[1]; x[0]; x[-4/5]; listp(x); arrayinfo(x); Can somebody explain to me the logic of indexing? Thanks. From toy.raymond at gmail.com Mon May 14 16:18:36 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 14 May 2012 14:18:36 -0700 Subject: [Maxima] plot2d failed to plot too many discrete points In-Reply-To: <877gwfts98.fsf@xc.laptop> References: <87aa1d23ys.fsf@xc.laptop> <4FAFE1AD.2090608@gmail.com> <877gwfts98.fsf@xc.laptop> Message-ID: On Sun, May 13, 2012 at 7:23 PM, XeCycle wrote: > Raymond Toy writes: > > [...] > > > Please provide more information on exactly what "failed to plot" means. > > On the other hand: > > > > (%i41) zz:makelist(k,k,0,100000)$ > > (%i42) plot2d([discrete,zz,zz]); > > > > produces a nice straight line for me (current git, cmucl, osx). > > Sorry for not enough info. > You did provide enough info see that it was a length problem. But note that there have been reports that plots failed because the data was constant, so it's always hard to tell what the problem is without an example. Thus, a small example showing the problem is always useful. BTW, I also sometimes plot 100,000+ points even though I know the screen can't possibly actually show them all. I'm just looking for an interesting section to plot in more detail, but I don't know where that is, and it's just easier to ask for all the points instead of plotting every 5th or 10th or 100th point. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Mon May 14 16:24:26 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Mon, 14 May 2012 22:24:26 +0100 Subject: [Maxima] List and Array indexing References: Message-ID: Evgeniy Maevskiy writes: > Good day for all. > > There are some problems... > > kill(x,a)$ > x:makelist(x[2*k/(k^2+1)],k,-2,3); > x[1]:a$ > x; > x[0]; > x[-4/5]; > listp(x); > arrayinfo(x); > > kill(x,a)$ > x[1]:a$ > x:makelist(x[2*k/(k^2+1)],k,-2,3); > x[1]; > x[0]; > x[-4/5]; > listp(x); > arrayinfo(x); > > Can somebody explain to me the logic of indexing? > > Thanks. Firstly: you have sent a reasonably aggravating message. It's a lot easier for others on the list to respond to a message of the form "I did A, expecting B but C happened. Why? or How can I get B instead?" Asking such questions might make it more likely that you get responses to what you're confused about. Anyway, to your question. The pragmatic answer is that subscripted expressions like x[k] get treated specially. The first example you give is not particularly confusing. Notice that when you say x[1]: a, you are saying "take the list stored at x and stick a in its first element" (remember Maxima uses 1-based indexing). The statement, x[0] yields an error, because you are asking for an element that doesn't exist in the list. Similarly for x[-4/5]. In the second example, you set up a hashed array in x with your second line. Then the following line is really odd: I didn't know that Maxima even let the user do that. What you have done is set up a situation where x on its own refers to the list, but x[anything] is a subscripted array element. Anyway, that's what happens in your "problems". Now you have to explain what you were expecting and why you think what you get is wrong. Although I'm pretty certain it won't make any difference in this case, it's generally also a good idea to let us know what version of Maxima you are using. And possibly to show input / output. That would be nice. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From villate at fe.up.pt Mon May 14 17:13:24 2012 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 14 May 2012 23:13:24 +0100 Subject: [Maxima] List and Array indexing In-Reply-To: References: Message-ID: <4FB18384.1000509@fe.up.pt> On 05/14/2012 08:03 PM, Evgeniy Maevskiy wrote: > Can somebody explain to me the logic of indexing? Perhaps this might help?: http://www.math.utexas.edu/pipermail/maxima/2006/000375.html When you write something such as x[1], you might be referring to a list element or to an element of an array, depending on how x was first defined. And if it is an array element, there different types of arrays. Regards, Jaime From noreply+2210867580 at badoo.com Mon May 14 17:27:19 2012 From: noreply+2210867580 at badoo.com (Badoo) Date: Mon, 14 May 2012 22:27:19 +0000 Subject: [Maxima] =?utf-8?q?D=C3=A9couvre_le_message_de_Syn=2E=2E=2E?= Message-ID: Un message de Syn t'attend... L'exp?diteur et le contenu seront visibles seulement par toi et tu peux le supprimer ? tout moment. Tu peux aussi y r?pondre directement au travers du messenger. Pour d?couvrir le message, suis simplement ce lien: http://eu1.badoo.com/0279183266/in/8PDXFpcZNZE/?lang_id=6&m=63&mid=4fb186c5000000000006000083c7297c D'autres personnes ? proximit? qui sont sur Badoo Fabrizio (Licodia Eubea, Italie) Sonia (Treviglio, Italie) Dzine (Nantes, France) http://eu1.badoo.com/0279183266/in/8PDXFpcZNZE/?lang_id=6&m=63&mid=4fb186c5000000000006000083c7297c Le lien ne fonctionne pas dans ce message ? Copie le dans la barre d'adresse de ton navigateur. Tu as re?u cet email suite ? une requ?te de Syn aupr?s de notre syst?me. S'il s'agit d'une erreur, ignore simplement cet email. La requ?te sera alors effac?e du syst?me. Merci, L'?quipe Badoo Vous avez re?u cet email de Badoo Trading Limited (adresse postale ci-dessous). http://eu1.badoo.com/impersonation.phtml?lang_id=6&mail_code=63&email=maxima%40math.utexas.edu&secret=&action=block&block_code=3459ff&m=63&mid=4fb186c5000000000006000083c7297c Badoo Trading Limited est une Soci?t? ? Responsabilit? Limit?e, enregistr?e en Angleterre et Pays de Galles, sous le No. 7540255, bureaux enregistr?s ? l?adresse 12 Red Lion Square, London, WC1R 4QD. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Mon May 14 17:42:29 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 14 May 2012 15:42:29 -0700 Subject: [Maxima] puzzle with bfloat and radcan Message-ID: <4FB18A55.9060705@eecs.berkeley.edu> xnum : ((6-4*sqrt(2))*log(3-2*sqrt(2))+(3-2*sqrt(2))*log(17-12*sqrt(2))+32-24*sqrt(2)); xden :(48*sqrt(2)-72)*(log(sqrt(2)+1)+sqrt(2))/3; x : xnum/xden; fpprec:40; bfloat(radcan(x^16)); produces 1. Actually, the number 1.000000000000000009792437985633294125296b0. bfloat(radcan(x^32)); produces 0.0b0. So, we have this situation: there is a number p such p^16 is 1, but p^32 is zero. To see more about this, look at sci.math.symbolic, or http://12000.org/my_notes/simplification_in_CAS/index.htm From toy.raymond at gmail.com Mon May 14 17:52:07 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 14 May 2012 15:52:07 -0700 Subject: [Maxima] plot2d failed to plot too many discrete points In-Reply-To: References: <87aa1d23ys.fsf@xc.laptop> Message-ID: On Sun, May 13, 2012 at 4:54 PM, Robert Dodier wrote: > On 2012-05-13, Raymond Toy wrote: > > >> To the developers: is there any reason to prefer COPY-TREE to COPY-LIST > >> in src/plot.lisp? > > > > Maybe because it's not a list but a tree (or a list of lists)? I didn't > > look closely to see if that matters or not. > > I think sometimes it's just a list and sometimes it's a more complex > expression. COPY-TREE is now called to prevent the plotting functions > from changing the original data. I don't know if COPY-LIST is > sufficient for that purpose. > Maybe instead of copy-tree on the whole tree, it might be sufficient to do something like (let ((x (copy-list (third f))) (y (copy-list (fourth f)))) ...) x and y should be lists, I think. Ray > > > I'm sure the sbcl folks would fix such a bug very quickly. > > Reported as: https://bugs.launchpad.net/sbcl/+bug/998926 > > > I know sbcl and cmucl have fairly slow float printers because both try > > pretty hard to make sure the output is printed in a way that when read > > in the same number results. > > Well, it's entirely reasonable to preserve readability for floats, but > it does make it less convenient to process a sizeable data set ... I can > see a couple of things that would make it faster. (1) Gnuplot could read > binary data so no printing & parsing is needed. (2) Maybe scanf or > whatever is Gnuplot's number parser could recognize the bytes of a float > encoded as hexadecimal. E.g. #f4DEADBEEF => some number. Or maybe > #f8(mantissa,scale,sign) since those fields are conveniently returned by > INTEGER-DECODE-FLOAT. > > (1) and (2) aren't human-readable (for most humans I guess) but it could > make machine-to-machine communication faster and unambiguous. Yes, I am > daydreaming here. > > I didn't about this, but a google search found this: http://gnuplot.sourceforge.net/docs_4.2/node103.html Getting the supported lisps to dump out binary floating point data shouldn't be too hard as long as INTEGER-DECODE-FLOAT works and streams with element type of (signed-byte 32) (or 64?) work. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Mon May 14 17:51:04 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 14 May 2012 15:51:04 -0700 Subject: [Maxima] puzzle with bfloat and radcan / HINT In-Reply-To: <4FB18A55.9060705@eecs.berkeley.edu> References: <4FB18A55.9060705@eecs.berkeley.edu> Message-ID: <4FB18C58.7020007@eecs.berkeley.edu> On 5/14/2012 3:42 PM, Richard Fateman wrote: > xnum : > ((6-4*sqrt(2))*log(3-2*sqrt(2))+(3-2*sqrt(2))*log(17-12*sqrt(2))+32-24*sqrt(2)); > xden :(48*sqrt(2)-72)*(log(sqrt(2)+1)+sqrt(2))/3; > x : xnum/xden; > > try fpprec:200. From toy.raymond at gmail.com Mon May 14 17:57:01 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 14 May 2012 15:57:01 -0700 Subject: [Maxima] puzzle with bfloat and radcan In-Reply-To: <4FB18A55.9060705@eecs.berkeley.edu> References: <4FB18A55.9060705@eecs.berkeley.edu> Message-ID: On Mon, May 14, 2012 at 3:42 PM, Richard Fateman wrote: > xnum : ((6-4*sqrt(2))*log(3-2*sqrt(2)**)+(3-2*sqrt(2))*log(17-12*** > sqrt(2))+32-24*sqrt(2)); > xden :(48*sqrt(2)-72)*(log(sqrt(2)+**1)+sqrt(2))/3; > x : xnum/xden; > > fpprec:40; > > bfloat(radcan(x^16)); produces 1. Actually, the number 1.** > 000000000000000009792437985633**294125296b0. > > bfloat(radcan(x^32)); produces 0.0b0. > > > So, we have this situation: > > there is a number p such p^16 is 1, but p^32 is zero. > > Using 100 digits produces 1 for p^32. Looking at the output of radcan(x^32) shows some integers with 58 digits or more, so fpprec:40 may not be big enough? Although getting exactly 0b0 seems rather suspicious or very unlucky that everything cancels out exactly. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Mon May 14 18:31:31 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 14 May 2012 16:31:31 -0700 Subject: [Maxima] puzzle with bfloat and radcan In-Reply-To: References: <4FB18A55.9060705@eecs.berkeley.edu> Message-ID: <4FB195D3.70806@eecs.berkeley.edu> I hadn't thought about it so much, but it is not so hard to fool bfloat. fpprec:30 bfloat(g(10^41+1)-g(10^41)); returns 0.0b0 From subiono2008 at matematika.its.ac.id Mon May 14 19:43:40 2012 From: subiono2008 at matematika.its.ac.id (subiono2008 at matematika.its.ac.id) Date: Tue, 15 May 2012 07:43:40 +0700 (WIT) Subject: [Maxima] Draw bounded Region Message-ID: <1097.10.112.250.163.1337042620.squirrel@webmail.its.ac.id> How to draw bounded region of Linear Programming Problems such as x>=0, y>=0, 2x+y<=8 and -x+y<=2 Regards, Subiono -- http://www.its.ac.id From aleksasd873 at gmail.com Tue May 15 00:05:50 2012 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Tue, 15 May 2012 08:05:50 +0300 Subject: [Maxima] Draw bounded Region Message-ID: from http://www.math.utexas.edu/pipermail/maxima/2012/028781.html How to draw bounded region of Linear Programming Problems such as x>=0, y>=0, 2x+y<=8 and -x+y<=2 Regards, Subiono ******************************************************************** (%i1) load(draw)$ (%i2) set_draw_defaults( grid=true, proportional_axes=xy)$ (%i3) wxdraw2d( x_voxel = 30, y_voxel = 30, fill_color=skyblue, region(x>=0 and y>=0 and 2*x+y<=8 and -x+y<=2,x,-1,5,y,-1,5)); (%t3) << Graphics >> (%o3) (%i4) build_info(); (%o4) build_info("5.27.0","2012-04-24 08:52:03","i686-pc-mingw32","GNU Common Lisp (GCL)","GCL 2.6.8") Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Tue May 15 00:59:42 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 15 May 2012 05:59:42 +0000 (UTC) Subject: [Maxima] plot2d failed to plot too many discrete points References: <87aa1d23ys.fsf@xc.laptop> Message-ID: On 2012-05-14, Raymond Toy wrote: > Maybe instead of copy-tree on the whole tree, it might be sufficient to do > something like > > (let ((x (copy-list (third f))) > (y (copy-list (fourth f)))) > ...) Well, a bug fix for SBCL has been committed already, so I'm just going to let it stand. I don't think it's worth the trouble to try to work around the bug. Eventually installed versions will catch up. best Robert Dodier From robert.dodier at gmail.com Tue May 15 01:22:34 2012 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 15 May 2012 06:22:34 +0000 (UTC) Subject: [Maxima] plot2d failed to plot too many discrete points References: <87aa1d23ys.fsf@xc.laptop> Message-ID: On 2012-05-14, Raymond Toy wrote: > I didn't about this, but a google search found this: > > http://gnuplot.sourceforge.net/docs_4.2/node103.html > > Getting the supported lisps to dump out binary floating point data > shouldn't be too hard as long as INTEGER-DECODE-FLOAT works and streams > with element type of (signed-byte 32) (or 64?) work. There is already code to write (and read) binary floats in the numericalio package. Gnuplot seems to want 32 bit floats while numericalio writes 64 bits, so I guess there is some programming to be done there. best Robert Dodier From andrej.vodopivec at gmail.com Tue May 15 02:00:02 2012 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Tue, 15 May 2012 09:00:02 +0200 Subject: [Maxima] wxdraw2d In-Reply-To: References: Message-ID: This seems to be an issue between gnuplot 4.6 (which is included with the maxima installer) and the draw package. You can replace gnuplot with the one in the previous installer (the gnuplot directory inside maxima) and it should work again. HTH, Andrej On Mon, May 14, 2012 at 1:58 AM, Richard Hennessy wrote: > Ok, no reply.? Maybe if I attach the input.? Here it is, > > Rich > > From: Richard Hennessy > Sent: Saturday, May 12, 2012 7:01 PM > To: Maxima List > Subject: Re: wxdraw2d > > I meant the list is in the form > > [[x1,y1],[x2,y2],...[xn,yn]] of floats or big floats, it doesn?t matter > which. > > > > From: Richard Hennessy > Sent: Saturday, May 12, 2012 6:54 PM > To: Maxima List > Subject: wxdraw2d > > I have noticed a bug in wxplo2d with the points() graphic object. > > draw2d(points_joined=true,color=blue, > point_type=dot,point_size=1,points(N)); > > works fine most of the time but sometimes it just echo?s the input to the > wMaxima output. > > wxdraw2d(points_joined=true,color=blue, > point_type=dot,point_size=1,points(N)); > gives an empty window with a big x in it and the message > > Error > C:/Users/Richard Hennessy/maxout_2.png > > > wxWidgets: 2.8.12 > Unicode Support: no > Maxima version: 5.27.0 > Lisp: GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) > > > build_info(); > build_info("5.27.0","2012-05-08 11:27:57","i686-pc-mingw32","GNU Common Lisp > (GCL)","GCL 2.6.8") > > I am using Windows 7 professional. > > The list N is 1200 points long and in the form > [[x1,y1],[x2],[y2],...[xn],[yn]] of floats or big floats, it doesn?t matter > which. > > Rich > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From hermann.klocker at gmail.com Tue May 15 06:17:15 2012 From: hermann.klocker at gmail.com (Hermann Klocker) Date: Tue, 15 May 2012 13:17:15 +0200 Subject: [Maxima] gnu plot integration still (partially) broken on OSX Message-ID: <681D782B-4489-4A85-9AA2-80BFD36D0F57@gmail.com> I use to create 3d-graphics using gnuplot either via draw3d or via plot3d, both commands seem to fail: 1. draw3d shows nothing, it does work on windows. 2. plot3d shows a plot but does not interact with mouse to rotate the view. Do I miss something? Hermann ------------------------------------------------------------- load("draw")$ A:[2,-2,0]$B:[2,2,0]$ draw3d(vector(A,B))$ plot3d(x*y, [x,-5,5], [y,-5,5], [plot_format,gnuplot])$ From willisb at unk.edu Tue May 15 06:39:20 2012 From: willisb at unk.edu (Barton Willis) Date: Tue, 15 May 2012 11:39:20 +0000 Subject: [Maxima] make install: No rule to make target `index.hhk' In-Reply-To: <4FAF1F32.7010606@gmail.com> References: <83FD4DC40F97654495E2C9AED47658360424EB27@BL2PRD0710MB361.namprd07.prod.outlook.com> ,<4FAF1F32.7010606@gmail.com> Message-ID: <83FD4DC40F97654495E2C9AED47658360424FEB6@BL2PRD0710MB361.namprd07.prod.outlook.com> David, Your patch fixed this error---thanks. Now I have another problem with make install. I'm using an upto date cygwin and 64 bit Windows. With either clisp or ccl, make install runs for quite some time then gives: make[2]: Nothing to be done for `install-exec-am'. /bin/sh /cygdrive/c/maximagit2/maxima/install-sh -d /usr/local/share/maxima/bran ch_5_27_base_32_g4e4b8ba/share 0 [main] sh 1448 child_info_fork::abort: can't commit memory for stack 0x2 89000(94208), Win32 error 487 /bin/sh: fork: retry: Resource temporarily unavailable 1 [main] sh 832 child_info_fork::abort: can't commit memory for stack 0x28 9000(94208), Win32 error 487 /bin/sh: fork: retry: Resource temporarily unavailable 0 [main] sh 3848 child_info_fork::abort: can't commit memory for stack 0x2 89000(94208), Win32 error 487 /bin/sh: fork: retry: Resource temporarily unavailable 1 [main] sh 3376 child_info_fork::abort: can't commit memory for stack 0x2 89000(94208), Win32 error 487 /bin/sh: fork: retry: Resource temporarily unavailable 1 [main] sh 3828 child_info_fork::abort: can't commit memory for stack 0x2 89000(94208), Win32 error 487 /bin/sh: fork: Resource temporarily unavailable Makefile:1574: recipe for target `install-datafiles' failed make[2]: *** [install-datafiles] Error 254 make[2]: Leaving directory `/cygdrive/c/maximagit2/maxima/share' Makefile:1461: recipe for target `install-am' failed make[1]: *** [install-am] Error 2 make[1]: Leaving directory `/cygdrive/c/maximagit2/maxima/share' Makefile:327: recipe for target `install-recursive' failed make: *** [install-recursive] Error 1 --bw ________________________________________ Correct. The following patch makes the dependency explicit. I will test it on a full build then check it in. diff --git a/doc/info/Makefile.am b/doc/info/Makefile.am old mode 100644 new mode 100755 index 208ccd6..bcc20f5 --- a/doc/info/Makefile.am +++ b/doc/info/Makefile.am @@ -219,7 +219,7 @@ maxima-index.lisp: maxima.info build_index.pl maxima.html: maxima.texi $(maxima_TEXINFOS) sh extract_categories.sh maxima -contents.hhc: maxima.html +contents.hhc index.hhk: maxima.html perl ./create_index include $(top_srcdir)/common.mk From villate at fe.up.pt Tue May 15 07:54:10 2012 From: villate at fe.up.pt (Jaime Villate) Date: Tue, 15 May 2012 13:54:10 +0100 Subject: [Maxima] gnu plot integration still (partially) broken on OSX In-Reply-To: <681D782B-4489-4A85-9AA2-80BFD36D0F57@gmail.com> References: <681D782B-4489-4A85-9AA2-80BFD36D0F57@gmail.com> Message-ID: <4FB251F2.6050304@fe.up.pt> On 05/15/2012 12:17 PM, Hermann Klocker wrote: > I use to create 3d-graphics using gnuplot either via draw3d or via plot3d, both commands seem to fail: > 1. draw3d shows nothing, it does work on windows. > 2. plot3d shows a plot but does not interact with mouse to rotate the view. > > Do I miss something? > Hi, I can't try to reproduce your problem because I do not have OSX, but I suspect it has to do with the default terminal used in gnuplot (I guess X11?) not having mouse support and other features required by draw3d. You could try changing the gnuplot_term plot option to other terminal in OSX's version of gnuplot (see "? gnuplo_term"). You could also try adding the option [plot_format, xmaxima] to your plot3d commands and see whether you like it. Cheers, Jaime From dbmaxima at gmail.com Tue May 15 07:57:44 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Tue, 15 May 2012 22:57:44 +1000 Subject: [Maxima] make install: No rule to make target `index.hhk' In-Reply-To: <83FD4DC40F97654495E2C9AED47658360424FEB6@BL2PRD0710MB361.namprd07.prod.outlook.com> References: <83FD4DC40F97654495E2C9AED47658360424EB27@BL2PRD0710MB361.namprd07.prod.outlook.com> , <4FAF1F32.7010606@gmail.com> <83FD4DC40F97654495E2C9AED47658360424FEB6@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: <4FB252C8.1080406@gmail.com> On 15/05/2012 9:39 PM, Barton Willis wrote: > David, > > Your patch fixed this error---thanks. Now I have another problem with make install. I'm using an upto date cygwin and 64 bit Windows. With either clisp or ccl, > make install runs for quite some time then gives: > > make[2]: Nothing to be done for `install-exec-am'. > /bin/sh /cygdrive/c/maximagit2/maxima/install-sh -d /usr/local/share/maxima/bran > ch_5_27_base_32_g4e4b8ba/share > 0 [main] sh 1448 child_info_fork::abort: can't commit memory for stack 0x2 > 89000(94208), Win32 error 487 > /bin/sh: fork: retry: Resource temporarily unavailable This is not uncommon on cygwin. Search for "cygwin fork retry: Resource temporarily unavailable" This is typically the result of one of two things: 1. 2. DLL collisions - Install the 'rebase' package, read its README in /usr/share/doc/Cygwin, and follow the instructions there to run 'rebaseall'. From buggi22 at hotmail.com Mon May 14 22:28:12 2012 From: buggi22 at hotmail.com (Andy L) Date: Mon, 14 May 2012 22:28:12 -0500 Subject: [Maxima] Maxima: lambdas and sublist_indices behaving strangely when acting on symbols In-Reply-To: References: , Message-ID: Thanks very much for the explanation and elegant solution.? I seem to be using an older version of Maxima where gensym is only available as a Lisp function -- after a quick search, I found that using ?gensym() instead of gensym() works on my system. ~ Andrew Date: Mon, 14 May 2012 15:58:30 +0200 Subject: Re: [Maxima] Maxima: lambdas and sublist_indices behaving strangely when acting on symbols From: volkervannek at googlemail.com To: buggi22 at hotmail.com CC: Maxima at math.utexas.edu The answer is: lambda quotes its arguments. Type ? lambda and you get the documentation and examples about lambda. I believe the following does what you want. (%i1) f(l, x) ::= buildq([l : l, x : x, z : gensym()], sublist_indices(l, lambda([z], z =? x)))$ (%i2) macroexpand(f([x,y,z], a)); (%o2)????? sublist_indices([x, y, z], lambda([g33291], g33291 = a)) (%i3) f([x,y,z], a); (%o3)???????????????????????????????? [] (%i4) f([x,y,z], x); (%o4)???????????????????????????????? [1] HTH Volker van Nek 2012/5/14 Andy L Hello, I'm having trouble using sublist_indices on lists of symbols. ?Basically, I'm trying to implement a function that will find the indices at which a given symbol appears within a list of symbols. ?In other words, I want a function f(l,x) which behaves as follows: ? f([x,y,z], x) -> [1]? f([x,y,z], y) -> [2]? f([x,y,z], z) -> [3]? f([x,y,z], a) -> [] Can anyone explain why the following code should yield [1] instead of []? ? f: lambda([l,x], sublist_indices(l, lambda([z], z = x)))$? f([x,y,z], a); ?/* this yields [1] */ The same function behaves as expected when the arguments are strings: ? f(["x","y","z"], "a"); ?/* this yields [], as expected */ An alternate approach reveals some strange behavior: ? k(l,x) := block(? ? [lstrs: map(string, l), xstr: string(x)],? ? display(l,x,lstrs,xstr),? ? sublist_indices(lstrs, lambda([z], z = xstr))? )$? k([x,y,z], a); Here, l is displayed as "[x,y,z]", but lstrs is displayed as "[a,y,z]". ?I don't understand why "x" gets changed to "a" here, or how to prevent that substitution. ?(True, I could get around this by just changing the parameter "x" to some other unlikely name, like "uncommonDummyVar", but that seems fragile & inelegant.) Does anyone have any suggestions on how to implement the behavior I'm looking for? Thanks, ~ Andrew _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From emaevskiy at mail.ru Tue May 15 08:02:26 2012 From: emaevskiy at mail.ru (Evgeniy Maevskiy) Date: Tue, 15 May 2012 13:02:26 +0000 (UTC) Subject: [Maxima] List and Array indexing References: Message-ID: Thank you, Rupert, for your answer. About my expectations. First example ------------- 1) x is an array, because we call x[-4/5], x[-1], x[0], x[1], x[4/5], x[6/10] in makelist; 2) after x:makelist(...) x is a list; 3) x is a list therefore x[0] not exists. Second example -------------- 1) x is an array and x[1]=a; 2) after x:makelist(...) x is a list (listp=true); 3) ... but x[0], x[-4/5], etc. are safe and sound 4) ... but (list)x[1] is not (array)x[-4/5] From rswarbrick at gmail.com Tue May 15 09:41:08 2012 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Tue, 15 May 2012 15:41:08 +0100 Subject: [Maxima] Draw bounded Region References: <1097.10.112.250.163.1337042620.squirrel@webmail.its.ac.id> Message-ID: <7h6a89xthf.ln2@hake.rswarbrick.dnsalias.com> subiono2008 at matematika.its.ac.id writes: > How to draw bounded region of > Linear Programming Problems such as > x>=0, y>=0, 2x+y<=8 and -x+y<=2 > > Regards, > Subiono Since you say "draw" (rather than "plot"), have a look at the examples at http://riotorto.users.sourceforge.net/gnuplot/region/index.html Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From emaevskiy at mail.ru Tue May 15 09:44:36 2012 From: emaevskiy at mail.ru (Evgeniy Maevskiy) Date: Tue, 15 May 2012 14:44:36 +0000 (UTC) Subject: [Maxima] integrate ( exp (x^3), x, 0, 1) still wrong References: Message-ID: I'v wrote the next lisp-script for asymptotic of log(gamma_incomplete(a,x)) when (real) x\to+\infty. If a\in\mathbb{Z} result is exact. About the method see: M. Fedoruk, Asymptotic methods in analysis. Analysis. I, Encyclopaedia Math. Sci., 13, Springer, Berlin, 1989 ; lngi(a,x) = \ln \int_x^{\infty} t^{a-1} e^t dt (defun lngi (a x) (declare (type flonum x a)) (let ((u 0.0) (s 0.0) (lx (log x)) (fa (floor a)) (sgn -1)) (do ((k 1 (+ k 1))) ((>= k a) 'done) (setf u (- (+ u (log (- a k))) lx) s (+ s (log (+ 1.0 (exp (- u s))))))) (if (> a fa) (do ((k (+ 1 fa) (+ k 1))) ((> k (+ a x)) 'done) (setf u (- (+ u (log (- k a))) lx) s (+ s (log (+ 1.0 (* sgn (exp (- u s)))))) sgn (* -1 sgn)))) (setf s (+ s (- (* (- a 1) lx) x))))) From cloos at jhcloos.com Tue May 15 11:11:20 2012 From: cloos at jhcloos.com (James Cloos) Date: Tue, 15 May 2012 12:11:20 -0400 Subject: [Maxima] puzzle with bfloat and radcan / HINT In-Reply-To: <4FB18C58.7020007@eecs.berkeley.edu> (Richard Fateman's message of "Mon, 14 May 2012 15:51:04 -0700") References: <4FB18A55.9060705@eecs.berkeley.edu> <4FB18C58.7020007@eecs.berkeley.edu> Message-ID: > try fpprec:200. Using gfactor() instead of radcan() also avoids the incorrect result. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From macrakis at alum.mit.edu Tue May 15 12:34:21 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 15 May 2012 13:34:21 -0400 Subject: [Maxima] puzzle with bfloat and radcan In-Reply-To: <4FB18A55.9060705@eecs.berkeley.edu> References: <4FB18A55.9060705@eecs.berkeley.edu> Message-ID: Not sure why any of this is a "puzzle". The value of an expression evaluated to some number of digits depends on the *form* of the expression. Consider product(q-i,i,1,16) Obviously this is 0 for q in 1..16 (even 1.0 .. 16.0): subst(q=15.0,product(q-i,i,1,16)) => 0 but subst(q=15.0,expand(product(q-i,i,1,16))) => -215040.0 This is not a puzzle or an error. It is the nature of finite-precision calculation. -s On Mon, May 14, 2012 at 6:42 PM, Richard Fateman wrote: > xnum : ((6-4*sqrt(2))*log(3-2*sqrt(2)**)+(3-2*sqrt(2))*log(17-12*** > sqrt(2))+32-24*sqrt(2)); > xden :(48*sqrt(2)-72)*(log(sqrt(2)+**1)+sqrt(2))/3; > x : xnum/xden; > -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Tue May 15 12:58:47 2012 From: willisb at unk.edu (Barton Willis) Date: Tue, 15 May 2012 17:58:47 +0000 Subject: [Maxima] puzzle with bfloat and radcan In-Reply-To: References: <4FB18A55.9060705@eecs.berkeley.edu>, Message-ID: <83FD4DC40F97654495E2C9AED47658360424FFC9@BL2PRD0710MB361.namprd07.prod.outlook.com> Shameless plug for nfloat: (%i1) load(hypergeometric)$ (%i2) nfloat(expand(product(q-i,i,1,16)), [q=15.0], 19); (%o2) -3.310444991333235832b-55 Oops...? doesn't find nfloat. --bw ________________________________ From: maxima-bounces at math.utexas.edu [maxima-bounces at math.utexas.edu] on behalf of Stavros Macrakis [macrakis at alum.mit.edu] Sent: Tuesday, May 15, 2012 12:34 To: Richard Fateman Cc: Maxima - list Subject: Re: [Maxima] puzzle with bfloat and radcan Not sure why any of this is a "puzzle". The value of an expression evaluated to some number of digits depends on the form of the expression. Consider product(q-i,i,1,16) Obviously this is 0 for q in 1..16 (even 1.0 .. 16.0): subst(q=15.0,product(q-i,i,1,16)) => 0 but subst(q=15.0,expand(product(q-i,i,1,16))) => -215040.0 This is not a puzzle or an error. It is the nature of finite-precision calculation. -s On Mon, May 14, 2012 at 6:42 PM, Richard Fateman > wrote: xnum : ((6-4*sqrt(2))*log(3-2*sqrt(2))+(3-2*sqrt(2))*log(17-12*sqrt(2))+32-24*sqrt(2)); xden :(48*sqrt(2)-72)*(log(sqrt(2)+1)+sqrt(2))/3; x : xnum/xden; -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Tue May 15 14:53:09 2012 From: willisb at unk.edu (Barton Willis) Date: Tue, 15 May 2012 19:53:09 +0000 Subject: [Maxima] make install: No rule to make target `index.hhk' In-Reply-To: <4FB252C8.1080406@gmail.com> References: <83FD4DC40F97654495E2C9AED47658360424EB27@BL2PRD0710MB361.namprd07.prod.outlook.com> , <4FAF1F32.7010606@gmail.com> <83FD4DC40F97654495E2C9AED47658360424FEB6@BL2PRD0710MB361.namprd07.prod.outlook.com>, <4FB252C8.1080406@gmail.com> Message-ID: <83FD4DC40F97654495E2C9AED47658360425001B@BL2PRD0710MB361.namprd07.prod.outlook.com> Thanks--I fixed this the low-cost and easy way: tried a different machine. I think make install finishes OK. There is a problem with make iss that seems fairly minor. Like it or not, the majority of Maxima downloads are for Microsoft Windows. It would, I think, be great if Maxima would build under Windows without a herculean effort (uses an up-to-date mingw, builds under sbcl, ccl, and gcl, and ...) Thanks for working on this. $ make iss test -d "/usr/local/share/maxima/branch_5_27_base_34_ge0bcf8c/doc" || mkdir -p "/usr/local/share/maxima/branch_5_27_base_34_ge0bcf8c/doc" for file in AUTHORS COPYING INSTALL README README.lisps ; \ do \ /usr/bin/install -c -m 644 $file "/usr/local/share/maxima/branch_5_27_base_34_ge0bcf8c/doc" ; \ done make -C interfaces/xmaxima/win32 gcccopy install make[1]: Entering directory `/cygdrive/c/Users/willisb/maximagit3/maxima/interfaces/xmaxima/win32' test -d "/usr/local/bin" || mkdir -p "/usr/local/bin" test -d "/usr/local/include" || mkdir -p "/usr/local/include" test -d "/usr/local/include/sys" || mkdir -p "/usr/local/include/sys" test -d "/usr/local/lib/gcc-lib/mingw32/3.3.1/include" \ || mkdir -p "/usr/local/lib/gcc-lib/mingw32/3.3.1/include" cp /usr/local/bin/gcc.exe /usr/local/bin cp: cannot stat `/usr/local/bin/gcc.exe': No such file or directory Makefile:55: recipe for target `gcccopy' failed make[1]: *** [gcccopy] Error 1 make[1]: Leaving directory `/cygdrive/c/Users/willisb/maximagit3/maxima/interfaces/xmaxima/win32' Makefile:789: recipe for target `iss' failed make: *** [iss] Error 2 --bw ________________________________________ > /bin/sh: fork: retry: Resource temporarily unavailable This is not uncommon on cygwin. Search for "cygwin fork retry: Resource temporarily unavailable" This is typically the result of one of two things: 1. 2. DLL collisions - Install the 'rebase' package, read its README in /usr/share/doc/Cygwin, and follow the instructions there to run 'rebaseall'. From biomates at telefonica.net Tue May 15 17:27:15 2012 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 16 May 2012 00:27:15 +0200 Subject: [Maxima] wxdraw2d In-Reply-To: References: Message-ID: <1337120835.8445.9.camel@pc> El mar, 15-05-2012 a las 09:00 +0200, Andrej Vodopivec escribi?: > This seems to be an issue between gnuplot 4.6 (which is included with > the maxima installer) and the draw package. You can replace gnuplot > with the one in the previous installer (the gnuplot directory inside > maxima) and it should work again. > > HTH, Andrej > > Yes, the origin of the problem is that Gnuplot 4.6 has changed the syntax to set the background color of graphic files, with no back compatibility. It's easy to fix this, but users with older Gnuplot versions would have then a similar problem. Perhaps should I remove the 'background_color' option in future Maxima releases? I don't know what to do. -- Mario From rich.hennessy at verizon.net Tue May 15 17:54:00 2012 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 15 May 2012 18:54:00 -0400 Subject: [Maxima] wxdraw2d Message-ID: I give up. From: Richard Hennessy Sent: Sunday, May 13, 2012 7:58 PM To: Maxima List Subject: Re: wxdraw2d Ok, no reply. Maybe if I attach the input. Here it is, Rich From: Richard Hennessy Sent: Saturday, May 12, 2012 7:01 PM To: Maxima List Subject: Re: wxdraw2d I meant the list is in the form [[x1,y1],[x2,y2],...[xn,yn]] of floats or big floats, it doesn?t matter which. From: Richard Hennessy Sent: Saturday, May 12, 2012 6:54 PM To: Maxima List Subject: wxdraw2d I have noticed a bug in wxplo2d with the points() graphic object. draw2d(points_joined=true,color=blue, point_type=dot,point_size=1,points(N)); works fine most of the time but sometimes it just echo?s the input to the wMaxima output. wxdraw2d(points_joined=true,color=blue, point_type=dot,point_size=1,points(N)); gives an empty window with a big x in it and the message Error C:/Users/Richard Hennessy/maxout_2.png wxWidgets: 2.8.12 Unicode Support: no Maxima version: 5.27.0 Lisp: GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) build_info(); build_info("5.27.0","2012-05-08 11:27:57","i686-pc-mingw32","GNU Common Lisp (GCL)","GCL 2.6.8") I am using Windows 7 professional. The list N is 1200 points long and in the form [[x1,y1],[x2],[y2],...[xn],[yn]] of floats or big floats, it doesn?t matter which. Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From dbmaxima at gmail.com Tue May 15 18:01:14 2012 From: dbmaxima at gmail.com (David Billinghurst) Date: Wed, 16 May 2012 09:01:14 +1000 Subject: [Maxima] make install: No rule to make target `index.hhk' In-Reply-To: <83FD4DC40F97654495E2C9AED47658360425001B@BL2PRD0710MB361.namprd07.prod.outlook.com> References: <83FD4DC40F97654495E2C9AED47658360424EB27@BL2PRD0710MB361.namprd07.prod.outlook.com> , <4FAF1F32.7010606@gmail.com> <83FD4DC40F97654495E2C9AED47658360424FEB6@BL2PRD0710MB361.namprd07.prod.outlook.com>, <4FB252C8.1080406@gmail.com> <83FD4DC40F97654495E2C9AED47658360425001B@BL2PRD0710MB361.namprd07.prod.outlook.com> Message-ID: <4FB2E03A.9020909@gmail.com> On 16/05/2012 5:53 AM, Barton Willis wrote: > Thanks--I fixed this the low-cost and easy way: tried a different machine. I think make install finishes OK. There is a problem with make iss that seems fairly minor. > > Like it or not, the majority of Maxima downloads are for Microsoft Windows. It would, I think, be great if Maxima would build under Windows without > a herculean effort (uses an up-to-date mingw, builds under sbcl, ccl, and gcl, and ...) > > Thanks for working on this. > > $ make iss > test -d "/usr/local/share/maxima/branch_5_27_base_34_ge0bcf8c/doc" || mkdir -p "/usr/local/share/maxima/branch_5_27_base_34_ge0bcf8c/doc" > for file in AUTHORS COPYING INSTALL README README.lisps ; \ > do \ > /usr/bin/install -c -m 644 $file "/usr/local/share/maxima/branch_5_27_base_34_ge0bcf8c/doc" ; \ > done > make -C interfaces/xmaxima/win32 gcccopy install > make[1]: Entering directory `/cygdrive/c/Users/willisb/maximagit3/maxima/interfaces/xmaxima/win32' > test -d "/usr/local/bin" || mkdir -p "/usr/local/bin" > test -d "/usr/local/include" || mkdir -p "/usr/local/include" > test -d "/usr/local/include/sys" || mkdir -p "/usr/local/include/sys" > test -d "/usr/local/lib/gcc-lib/mingw32/3.3.1/include" \ > || mkdir -p "/usr/local/lib/gcc-lib/mingw32/3.3.1/include" > cp /usr/local/bin/gcc.exe /usr/local/bin > cp: cannot stat `/usr/local/bin/gcc.exe': No such file or directory > Makefile:55: recipe for target `gcccopy' failed > make[1]: *** [gcccopy] Error 1 > make[1]: Leaving directory `/cygdrive/c/Users/willisb/maximagit3/maxima/interfaces/xmaxima/win32' > Makefile:789: recipe for target `iss' failed > make: *** [iss] Error 2 > > --bw Agree 100%. There are some very ugly parts of the windows build and install. The "make iss" rule assumes you are using gcl. which needs gcc. Obviously not required for other lisps. In the short term, you could remove the gcccopy dependency from interfaces/xmaxima/win32/Makefile We need to use automake in interfaces/xmaxima/win32, to allow other lisps. Also need to restructure the install. For example, the generation of the chm documentation files is part of "make iss" and driven from interfaces/xmaxima/win32/Makefile, which is sub-optimal. From andrej.vodopivec at gmail.com Wed May 16 01:18:04 2012 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Wed, 16 May 2012 08:18:04 +0200 Subject: [Maxima] make install: No rule to make target `index.hhk' In-Reply-To: <4FB2E03A.9020909@gmail.com> References: <83FD4DC40F97654495E2C9AED47658360424EB27@BL2PRD0710MB361.namprd07.prod.outlook.com> <4FAF1F32.7010606@gmail.com> <83FD4DC40F97654495E2C9AED47658360424FEB6@BL2PRD0710MB361.namprd07.prod.outlook.com> <4FB252C8.1080406@gmail.com> <83FD4DC40F97654495E2C9AED47658360425001B@BL2PRD0710MB361.namprd07.prod.outlook.com> <4FB2E03A.9020909@gmail.com> Message-ID: On Wed, May 16, 2012 at 1:01 AM, David Billinghurst wrote: > On 16/05/2012 5:53 AM, Barton Willis wrote: >> >> Thanks--I fixed this the low-cost and easy way: tried a different machine. >> ?I think make install finishes OK. There is a problem with make iss ?that >> seems fairly minor. >> >> Like it or not, the majority of Maxima downloads are for Microsoft >> Windows. ?It would, I think, be great if Maxima would build under Windows >> without >> a herculean effort (uses an up-to-date mingw, builds under sbcl, ccl, and >> gcl, and ...) >> >> Thanks for working on this. >> >> $ make iss >> test -d "/usr/local/share/maxima/branch_5_27_base_34_ge0bcf8c/doc" || >> mkdir -p "/usr/local/share/maxima/branch_5_27_base_34_ge0bcf8c/doc" >> for file in AUTHORS COPYING INSTALL README README.lisps ; \ >> ? ? ? ? ? ? do \ >> ? ? ? ? ? ? /usr/bin/install -c -m 644 $file >> "/usr/local/share/maxima/branch_5_27_base_34_ge0bcf8c/doc" ; \ >> ? ? ? ? ? ? done >> make -C interfaces/xmaxima/win32 gcccopy install >> make[1]: Entering directory >> `/cygdrive/c/Users/willisb/maximagit3/maxima/interfaces/xmaxima/win32' >> test -d "/usr/local/bin" || mkdir -p "/usr/local/bin" >> test -d "/usr/local/include" || mkdir -p "/usr/local/include" >> test -d "/usr/local/include/sys" || mkdir -p "/usr/local/include/sys" >> test -d "/usr/local/lib/gcc-lib/mingw32/3.3.1/include" \ >> ? ? ? ? || mkdir -p "/usr/local/lib/gcc-lib/mingw32/3.3.1/include" >> cp /usr/local/bin/gcc.exe /usr/local/bin >> cp: cannot stat `/usr/local/bin/gcc.exe': No such file or directory >> Makefile:55: recipe for target `gcccopy' failed >> make[1]: *** [gcccopy] Error 1 >> make[1]: Leaving directory >> `/cygdrive/c/Users/willisb/maximagit3/maxima/interfaces/xmaxima/win32' >> Makefile:789: recipe for target `iss' failed >> make: *** [iss] Error 2 >> >> --bw > > > Agree 100%. ?There are some very ugly parts of the windows build and > install. ?The "make iss" rule assumes you are using gcl. which needs gcc. > ?Obviously not required for other lisps. ?In the short term, you could > remove the gcccopy dependency from interfaces/xmaxima/win32/Makefile > > We need to use automake in interfaces/xmaxima/win32, to allow other lisps. > ?Also need to restructure the install. ?For example, the generation of the > chm documentation files is part of "make iss" and driven from > interfaces/xmaxima/win32/Makefile, which is sub-optimal. Some time ago I changed Makefiles so that "make install" would build a ccl compiled maxima. The changes are in my github repository: https://github.com/andrejv/maxima/tree/windows-ccl It should be easy to modify this branch so that it uses some other lisp which does not depend on gcc. HTH, Andrej From emaevskiy at mail.ru Tue May 15 11:35:15 2012 From: emaevskiy at mail.ru (Evgeniy Maevskiy) Date: Tue, 15 May 2012 16:35:15 +0000 (UTC) Subject: [Maxima] integrate ( exp (x^3), x, 0, 1) still wrong References: Message-ID: Evgeniy Maevskiy mail.ru> writes: > > I'v wrote the next lisp-script > for asymptotic of log(gamma_incomplete(a,x)) when > (real) x\to+\infty. If a\in\mathbb{Z} result is exact. > > ... > Sorry, it isn't useful for x<0 From kalek0 at inbox.ru Tue May 15 12:11:45 2012 From: kalek0 at inbox.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCa0LjRgdC10LvQtdCy?=) Date: Tue, 15 May 2012 21:11:45 +0400 Subject: [Maxima] =?utf-8?q?question_about_tensor_packages_in_Maxima?= Message-ID: Tell me please, is it possible to compute the elements of the Ricci, Riemann and Einstein tensors for a spaces with dimension greater than four? -------------- next part -------------- An HTML attachment was scrubbed... URL: From emaevskiy at e-math.ru Wed May 16 03:05:31 2012 From: emaevskiy at e-math.ru (Evgeniy Maevskiy) Date: Wed, 16 May 2012 08:05:31 +0000 (UTC) Subject: [Maxima] Representation of floats Message-ID: In floats (i.e. numer:true) we have: (%i1) x:makelist(1/5^k,k,1,7); (%o1) [0.2,0.04,0.008,0.0016,3.2000000000000003E-4,6.3999999999999997E-5, 1.2799999999999999E-5] but Firefox-javascript (for example) returns precise values: 0.2 0.04 0.008 0.0016 0.00032 etc. (at least up to k=20) Limits of the FLOAT in Maxima and Firefox are the same: 1e-324 - 1e309 (Windows XP, Maxima 5.27.0, Firefox 11.0) From emaevskiy at e-math.ru Wed May 16 03:27:15 2012 From: emaevskiy at e-math.ru (Evgeniy Maevskiy) Date: Wed, 16 May 2012 08:27:15 +0000 (UTC) Subject: [Maxima] kovacic algorithm References: , , <4F7CD04F.9050601@gmail.com> , <4F7EEC1D.7070705@eecs.berkeley.edu>, <4F7F3F5B.9030504@ieee.org> Message-ID: There is an OpenAxiom implementation by Manuel Bronstein (1992). Filename: kovacic.spad I don't now how to translate spad -> GCL (for use in Maxima). --Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. --All rights reserved. -- --Redistribution and use in source and binary forms, with or without --modification, are permitted provided that the following conditions are --met: -- -- - Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- -- - Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in -- the documentation and/or other materials provided with the -- distribution. -- -- - Neither the name of The Numerical ALgorithms Group Ltd. nor the -- names of its contributors may be used to endorse or promote products -- derived from this software without specific prior written permission. -- --THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS --IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED --TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER --OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, --EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, --PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- Compile order for the differential equation solver: -- oderf.spad odealg.spad nlode.spad nlinsol.spad riccati.spad -- kovacic.spad odeef.spad )abbrev package KOVACIC Kovacic ++ Author: Manuel Bronstein ++ Date Created: 14 January 1992 ++ Date Last Updated: 3 February 1994 ++ Description: ++ \spadtype{Kovacic} provides a modified Kovacic's algorithm for ++ solving explicitely irreducible 2nd order linear ordinary ++ differential equations. ++ Keywords: differential equation, ODE Kovacic(F, UP): Exports == Impl where F : Join(CharacteristicZero, AlgebraicallyClosedField, RetractableTo Integer, RetractableTo Fraction Integer) UP : UnivariatePolynomialCategory F RF ==> Fraction UP SUP ==> SparseUnivariatePolynomial RF LF ==> List Record(factor:UP, exponent:Integer) LODO==> LinearOrdinaryDifferentialOperator1 RF Exports ==> with kovacic: (RF, RF, RF) -> Union(SUP, "failed") ++ kovacic(a_0,a_1,a_2) returns either "failed" or P(u) such that ++ \spad{$e^{\int(-a_1/2a_2)} e^{\int u}$} is a solution of ++ \spad{a_2 y'' + a_1 y' + a0 y = 0} ++ whenever \spad{u} is a solution of \spad{P u = 0}. ++ The equation must be already irreducible over the rational functions. kovacic: (RF, RF, RF, UP -> Factored UP) -> Union(SUP, "failed") ++ kovacic(a_0,a_1,a_2,ezfactor) returns either "failed" or P(u) such ++ that \spad{$e^{\int(-a_1/2a_2)} e^{\int u}$} is a solution of ++ \spad{$a_2 y'' + a_1 y' + a0 y = 0$} ++ whenever \spad{u} is a solution of \spad{P u = 0}. ++ The equation must be already irreducible over the rational functions. ++ Argument \spad{ezfactor} is a factorisation in \spad{UP}, ++ not necessarily into irreducibles. Impl ==> add import RationalRicDE(F, UP) case2 : (RF, LF, UP -> Factored UP) -> Union(SUP, "failed") cannotCase2?: LF -> Boolean kovacic(a0, a1, a2) == kovacic(a0, a1, a2, squareFree) -- it is assumed here that a2 y'' + a1 y' + a0 y is already irreducible -- over the rational functions, i.e. that the associated Riccati equation -- does NOT have rational solutions (so we don't check case 1 of Kovacic's -- algorithm) -- currently only check case 2, not 3 kovacic(a0, a1, a2, ezfactor) == -- transform first the equation to the form y'' = r y -- which makes the Galois group unimodular -- this does not change irreducibility over the rational functions -- the following is split into 5 lines in order to save a couple of -- hours of compile time. r:RF := a1**2 r := r + 2 * a2 * differentiate a1 r := r - 2 * a1 * differentiate a2 r := r - 4 * a0 * a2 r := r / (4 * a2**2) lf := factors squareFree denom r case2(r, lf, ezfactor) -- this is case 2 of Kovacic's algorithm, i.e. look for a solution -- of the associated Riccati equation in a quadratic extension -- lf is the squarefree factorisation of denom(r) and is used to -- check the necessary condition case2(r, lf, ezfactor) == cannotCase2? lf => "failed" -- build the symmetric square of the operator L = y'' - r y -- which is L2 = y''' - 4 r y' - 2 r' y l2:LODO := monomial(1, 3) - monomial(4*r, 1) - 2 * differentiate(r)::LODO -- no solution in this case if L2 has no rational solution empty?(sol := ricDsolve(l2, ezfactor)) => "failed" -- otherwise the defining polynomial for an algebraic solution -- of the Ricatti equation associated with L is -- u^2 - b u + (1/2 b' + 1/2 b^2 - r) = 0 -- where b is a rational solution of the Ricatti of L2 b := first sol monomial(1, 2)$SUP - monomial(b, 1)$SUP + ((differentiate(b) + b**2 - 2 * r) / (2::RF))::SUP -- checks the necessary condition for case 2 -- returns true if case 2 cannot have solutions -- the necessary condition is that there is either a factor with -- exponent 2 or odd exponent > 2 cannotCase2? lf == for rec in lf repeat rec.exponent = 2 or (odd?(rec.exponent) and rec.exponent > 2) => return false true From villate at fe.up.pt Wed May 16 07:59:43 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 16 May 2012 13:59:43 +0100 Subject: [Maxima] List and Array indexing In-Reply-To: References: Message-ID: <4FB3A4BF.4030308@fe.up.pt> Hi, I think that nobody has answered your last message, so I will try to. On 05/15/2012 02:02 PM, Evgeniy Maevskiy wrote: > Thank you, Rupert, for your answer. About my expectations. > > First example > ------------- > > 1) x is an array, because we call x[-4/5], x[-1], x[0], x[1], x[4/5], x[6/10] in > makelist; Wrong, the makelist command you used: makelist(x[2*k/(k^2+1)],k,-2,3) is equivalent to having written down: [x[-4/5], x[-1], x[0], x[1], x[4/5], x[3/5]] which does not create any array and does not give any values to x; x remains an unknown variable. > 2) after x:makelist(...) x is a list; Correct. > 3) x is a list therefore x[0] not exists. Correct. > Second example > -------------- > > 1) x is an array and x[1]=a; Correct. If there was already a list named x, the command x[1]:... would have replaced its first element. Since you do not have any list named x, the command x[1]:... created an array x, with one element x[1]. > 2) after x:makelist(...) x is a list (listp=true); Correct. The array x that you have created in 1) continues to exist, and you have also created a list which is also named x, as the array. > 3) ... but x[0], x[-4/5], etc. are safe and sound Wrong. The only one that is safe and sound is x[1], because you have only created one element (x[1]:a) for the array x. x[0] and x[-4/5] remain undefined. Notice that you now have a confusing situation, because x[1] might refer to the element "1" of array x or to the first element of the list x. Different functions in Maxima will look first in the array or in the list, so in some cases you get the element x[1] of the array and in some other cases the element x[1] of the list: x[1] ---> element 1 of the array first(x) ---> element 1 of the list part(x,1) ---> element 1 of the list I hope this helps. Regards, Jaime From fateman at eecs.berkeley.edu Wed May 16 09:20:03 2012 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 16 May 2012 07:20:03 -0700 Subject: [Maxima] Representation of floats In-Reply-To: References: Message-ID: <4FB3B793.6010408@eecs.berkeley.edu> On 5/16/2012 1:05 AM, Evgeniy Maevskiy wrote: > In floats (i.e. numer:true) we have: > > (%i1) > (%o1) [0.2,0.04,0.008,0.0016,3.2000000000000003E-4,6.3999999999999997E-5, > 1.2799999999999999E-5] > > but Firefox-javascript (for example) returns precise values: > > 0.2 > 0.04 > 0.008 > 0.0016 > 0.00032 > > No, it is not representing values precisely. It is just printing them with fewer digits. try fpprintprec:5; numer:true; x:makelist(1/5^k,k,1,7); [0.2,0.04,0.008,0.0016,3.2*10^-4,6.4*10^-5,1.28*10^-5] From macrakis at alum.mit.edu Wed May 16 09:27:07 2012 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 16 May 2012 10:27:07 -0400 Subject: [Maxima] Representation of floats In-Reply-To: References: Message-ID: 1/5^k cannot be represented exactly as a binary floating-point number for k>0. For example, 0.2 is actually represented as 3602879701896397/2^54. Javascript floating point is not exact, either, it is simply rounding to fewer digits when printing. To round to fewer digits when printing in Maxima, use fpprintprec; e.g. fpprintprec:14 to round to 14 digits. -s On Wed, May 16, 2012 at 4:05 AM, Evgeniy Maevskiy wrote: > In floats (i.e. numer:true) we have: > > (%i1) x:makelist(1/5^k,k,1,7); > (%o1) [0.2,0.04,0.008,0.0016,3.2000000000000003E-4,6.3999999999999997E-5, > 1.2799999999999999E-5] > > but Firefox-javascript (for example) returns precise values: > > 0.2 > 0.04 > 0.008 > 0.0016 > 0.00032 > > etc. (at least up to k=20) > > Limits of the FLOAT in Maxima and Firefox are the same: 1e-324 - 1e309 > > (Windows XP, Maxima 5.27.0, Firefox 11.0) > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Wed May 16 10:40:04 2012 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 16 May 2012 08:40:04 -0700 Subject: [Maxima] integrate ( exp (x^3), x, 0, 1) still wrong In-Reply-To: <4FAE7498.70808@gmail.com> References: <00F5E3314766432E84CD8ECDB7327181@edwinc367e16bd> <4FAE7498.70808@gmail.com> Message-ID: On Sat, May 12, 2012 at 7:32 AM, Raymond Toy wrote: > > > > -------------------------------------------------- > > case exp(x^5) over (1,2) > > domain:complex greatly improves answer > > but large incorrect imaginary part > > and real part only accurate to two sig. figures. > > Yes, that's a problem. gamma_incomplete(1/5,-32) is not very accurate. > This can probably solved, but I'm not sure. Using bigfloats with 32 > digits gives a much better answer. > > I've updated the evaluation for gamma_incomplete(, and gamma_incomplete1/5,-32) should give about 15 digits now. The bigfloat version should give about fpprec precision too. (Previously, for large negative x, it was getting less and less accurate.) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Wed May 16 12:57:59 2012 From: willisb at unk.edu (Barton Willis) Date: Wed, 16 May 2012 17:57:59 +0000 Subject: [Maxima] context based version of abs_integrate--no more simp_assuming Message-ID: <83FD4DC40F97654495E2C9AED47658360425132C@BL2PRD0710MB361.namprd07.prod.outlook.com> I committed a new version of abs_integrate that uses contexts instead of the buggy simp_assuming macro. The new code doesn't have a general purpose with_assumptions function (or macro) replacement for simp_assuming. The new version also fixes some other bugs (rtest_abs_integrate bugs 148 and 149). --bw From woollett at charter.net Wed May 16 13:37:58 2012 From: woollett at charter.net (Edwin Woollett) Date: Wed, 16 May 2012 11:37:58 -0700 Subject: [Maxima] float gamma_incomplete bug fix Message-ID: testing Raymond Toy's bug #3526359 fix contained in my gamma-new.lisp. float and bfloat of gamma_incomplete(1/5,-32) good to 15 digits (gcl). compile-file complains about two items. the bfloat evaluation now contains the comment "new stuff", and also should have an extra expansion of the result. maxima output was compared to wolfram alpha N[Gamma[1/5,-32]] output which is -4.098639832671665..x 10^12 -2.977836145416076..x 10^12 i ======================= (%i7) :lisp (compile-file "c:/work2/gamma-new.lisp") Compiling c:/work2/gamma-new.lisp. ; (IN-PACKAGE :BIGFLOAT) is being compiled. ;; Warning: The package operation (IN-PACKAGE :BIGFLOAT) was in a bad place. ; (IN-PACKAGE :MAXIMA) is being compiled. ;; Warning: The package operation (IN-PACKAGE :MAXIMA) was in a bad place. End of Pass 1. End of Pass 2. OPTIMIZE levels: Safety=2, Space=3, Speed=3 Finished compiling c:/work2/gamma-new.lisp. #pc:/work2/gamma-new.o (%i7) load("c:/work2/gamma-new.o"); (%o7) "c:/work2/gamma-new.o" (%i8) fpprec; (%o8) 16 (%i9) float(gamma_incomplete(1/5,-32)); (%o9) -2.9778361454160732E+12*%i-4.0986398326716611E+12 (%i10) bfloat(gamma_incomplete(1/5,-32)); new stuff (%o10) 4.590843711998803b0-2.533098724238109b12 *(1.175570504584946b0*%i+1.618033988749895b0) (%i11) expand(%); (%o11) -2.977836145416077b12*%i-4.098639832671666b12 ===================== Ted Woollett From villate at fe.up.pt Wed May 16 14:54:00 2012 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 16 May 2012 20:54:00 +0100 Subject: [Maxima] Representation of floats In-Reply-To: References: Message-ID: <4FB405D8.8090306@fe.up.pt> On 05/16/2012 09:05 AM, Evgeniy Maevskiy wrote: > (%i1) x:makelist(1/5^k,k,1,7); > (%o1) [0.2,0.04,0.008,0.0016,3.2000000000000003E-4,6.3999999999999997E-5, > 1.2799999999999999E-5] > > but Firefox-javascript (for example) returns precise values: > > 0.2 > 0.04 > 0.008 > 0.0016 > 0.00032 > > (Windows XP, Maxima 5.27.0, Firefox 11.0) In Ubuntu, Firefox 11.10 javascript does not show the results rounded. Consider for instance the page: It gives me the result 0.6000000000000001 No Languages that show you the results rounded might lead you into confusion. Consider for instance PHP 5 (in Ubuntu): print 0.2+0.2+0.2."\n"; if (0.2+0.2+0.2 == 0.6) { print "Yes\n"; } else { print "No\n"; } The result is: 0.6 No which will make you think that the two results contradict each other. Python and Maxima also show you the result without rounding. Python 2.7.2: >>> 0.2+0.2+0.2 0.6000000000000001 >>> if (0.2+0.2+0.2) == 0.6: ... print 'yes' ... else: ... print 'no' ... no Maxima 5.25: (%i1) 0.2+0.2+0.2; (%o1) .6000000000000001 (%i2) if (0.2+0.2+0.2 = 0.6) then "yes" else "no"; (%o2) no Regards, Jaime